]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'm68knommu/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Dec 2011 01:10:36 +0000 (12:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Dec 2011 01:10:36 +0000 (12:10 +1100)
Conflicts:
arch/m68k/Kconfig.debug

1313 files changed:
Documentation/arm/memory.txt
Documentation/cris/README
Documentation/devicetree/bindings/arm/gic.txt
Documentation/devicetree/bindings/arm/insignal-boards.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/samsung-boards.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/vic.txt [new file with mode: 0644]
Documentation/devicetree/bindings/c6x/clocks.txt [new file with mode: 0644]
Documentation/devicetree/bindings/c6x/dscr.txt [new file with mode: 0644]
Documentation/devicetree/bindings/c6x/emifa.txt [new file with mode: 0644]
Documentation/devicetree/bindings/c6x/interrupt.txt [new file with mode: 0644]
Documentation/devicetree/bindings/c6x/soc.txt [new file with mode: 0644]
Documentation/devicetree/bindings/c6x/timer64.txt [new file with mode: 0644]
Documentation/devicetree/bindings/dma/arm-pl330.txt [new file with mode: 0644]
Documentation/devicetree/bindings/gpio/gpio-samsung.txt [new file with mode: 0644]
Documentation/devicetree/bindings/input/samsung-keypad.txt [new file with mode: 0644]
Documentation/devicetree/bindings/rtc/s3c-rtc.txt [new file with mode: 0644]
Documentation/devicetree/bindings/serial/samsung_uart.txt [new file with mode: 0644]
Documentation/devicetree/bindings/usb/tegra-usb.txt [new file with mode: 0644]
MAINTAINERS
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/Makefile
arch/arm/arm-soc-for-next-contents.txt [new file with mode: 0644]
arch/arm/boot/compressed/head.S
arch/arm/boot/dts/exynos4210-origen.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos4210-smdkv310.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos4210.dtsi [new file with mode: 0644]
arch/arm/boot/dts/tegra-harmony.dts
arch/arm/boot/dts/tegra-paz00.dts [new file with mode: 0644]
arch/arm/boot/dts/tegra-seaboard.dts
arch/arm/boot/dts/tegra-trimslice.dts [new file with mode: 0644]
arch/arm/boot/dts/tegra-ventana.dts
arch/arm/boot/dts/tegra20.dtsi
arch/arm/common/Kconfig
arch/arm/common/gic.c
arch/arm/common/vic.c
arch/arm/configs/imx_v6_v7_defconfig [moved from arch/arm/configs/mx5_defconfig with 80% similarity]
arch/arm/configs/mx3_defconfig [deleted file]
arch/arm/configs/omap1_defconfig
arch/arm/include/asm/assembler.h
arch/arm/include/asm/cti.h [new file with mode: 0644]
arch/arm/include/asm/edac.h [new file with mode: 0644]
arch/arm/include/asm/entry-macro-vic2.S [deleted file]
arch/arm/include/asm/hardirq.h
arch/arm/include/asm/hardware/entry-macro-gic.S [deleted file]
arch/arm/include/asm/hardware/gic.h
arch/arm/include/asm/hardware/iop3xx.h
arch/arm/include/asm/hardware/vic.h
arch/arm/include/asm/idmap.h [new file with mode: 0644]
arch/arm/include/asm/mach/arch.h
arch/arm/include/asm/page.h
arch/arm/include/asm/perf_event.h
arch/arm/include/asm/pgalloc.h
arch/arm/include/asm/pgtable-2level.h
arch/arm/include/asm/pgtable-3level-hwdef.h [new file with mode: 0644]
arch/arm/include/asm/pgtable-3level-types.h [new file with mode: 0644]
arch/arm/include/asm/pgtable-3level.h [new file with mode: 0644]
arch/arm/include/asm/pgtable-hwdef.h
arch/arm/include/asm/pgtable.h
arch/arm/include/asm/pmu.h
arch/arm/include/asm/proc-fns.h
arch/arm/include/asm/processor.h
arch/arm/include/asm/swab.h
arch/arm/include/asm/system.h
arch/arm/include/asm/tlb.h
arch/arm/include/asm/unwind.h
arch/arm/kernel/entry-armv.S
arch/arm/kernel/head.S
arch/arm/kernel/hw_breakpoint.c
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/perf_event.c
arch/arm/kernel/perf_event_v6.c
arch/arm/kernel/perf_event_v7.c
arch/arm/kernel/perf_event_xscale.c
arch/arm/kernel/process.c
arch/arm/kernel/setup.c
arch/arm/kernel/sleep.S
arch/arm/kernel/smp.c
arch/arm/kernel/suspend.c
arch/arm/kernel/unwind.c
arch/arm/kernel/vmlinux.lds.S
arch/arm/mach-at91/Kconfig
arch/arm/mach-at91/at91cap9.c
arch/arm/mach-at91/at91cap9_devices.c
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91rm9200_time.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam926x_time.c
arch/arm/mach-at91/at91sam9_alt_reset.S
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9g45_devices.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/at91sam9rl_devices.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-cap9adk.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-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-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-at91/gpio.c
arch/arm/mach-at91/include/mach/at91_aic.h
arch/arm/mach-at91/include/mach/at91_dbgu.h
arch/arm/mach-at91/include/mach/at91_pit.h
arch/arm/mach-at91/include/mach/at91_rtc.h
arch/arm/mach-at91/include/mach/at91_shdwc.h
arch/arm/mach-at91/include/mach/at91cap9.h
arch/arm/mach-at91/include/mach/at91rm9200.h
arch/arm/mach-at91/include/mach/at91sam9260.h
arch/arm/mach-at91/include/mach/at91sam9261.h
arch/arm/mach-at91/include/mach/at91sam9263.h
arch/arm/mach-at91/include/mach/at91sam9_smc.h
arch/arm/mach-at91/include/mach/at91sam9g45.h
arch/arm/mach-at91/include/mach/at91sam9rl.h
arch/arm/mach-at91/include/mach/at91x40.h
arch/arm/mach-at91/include/mach/board.h
arch/arm/mach-at91/include/mach/debug-macro.S
arch/arm/mach-at91/include/mach/entry-macro.S
arch/arm/mach-at91/include/mach/gpio.h
arch/arm/mach-at91/include/mach/hardware.h
arch/arm/mach-at91/include/mach/io.h
arch/arm/mach-at91/include/mach/irqs.h
arch/arm/mach-at91/include/mach/system.h
arch/arm/mach-at91/include/mach/timex.h
arch/arm/mach-at91/include/mach/uncompress.h
arch/arm/mach-at91/include/mach/vmalloc.h [deleted file]
arch/arm/mach-at91/irq.c
arch/arm/mach-at91/pm.c
arch/arm/mach-at91/sam9_smc.c
arch/arm/mach-at91/sam9_smc.h
arch/arm/mach-at91/setup.c
arch/arm/mach-at91/soc.h
arch/arm/mach-bcmring/arch.c
arch/arm/mach-bcmring/dma.c
arch/arm/mach-bcmring/include/mach/system.h
arch/arm/mach-bcmring/include/mach/vmalloc.h [deleted file]
arch/arm/mach-clps711x/Makefile
arch/arm/mach-clps711x/autcpu12.c
arch/arm/mach-clps711x/cdb89712.c
arch/arm/mach-clps711x/ceiva.c
arch/arm/mach-clps711x/clep7312.c
arch/arm/mach-clps711x/common.c [moved from arch/arm/mach-clps711x/irq.c with 58% similarity]
arch/arm/mach-clps711x/edb7211-arch.c
arch/arm/mach-clps711x/fortunet.c
arch/arm/mach-clps711x/include/mach/system.h
arch/arm/mach-clps711x/include/mach/vmalloc.h [deleted file]
arch/arm/mach-clps711x/mm.c [deleted file]
arch/arm/mach-clps711x/p720t.c
arch/arm/mach-clps711x/time.c [deleted file]
arch/arm/mach-cns3xxx/cns3420vb.c
arch/arm/mach-cns3xxx/core.h
arch/arm/mach-cns3xxx/include/mach/entry-macro.S
arch/arm/mach-cns3xxx/include/mach/system.h
arch/arm/mach-cns3xxx/include/mach/vmalloc.h [deleted file]
arch/arm/mach-cns3xxx/pm.c
arch/arm/mach-davinci/Makefile
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/common.c
arch/arm/mach-davinci/da830.c
arch/arm/mach-davinci/da850.c
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/devices.c
arch/arm/mach-davinci/dm355.c
arch/arm/mach-davinci/dm365.c
arch/arm/mach-davinci/dm644x.c
arch/arm/mach-davinci/dm646x.c
arch/arm/mach-davinci/include/mach/common.h
arch/arm/mach-davinci/include/mach/da8xx.h
arch/arm/mach-davinci/include/mach/io.h
arch/arm/mach-davinci/include/mach/system.h
arch/arm/mach-davinci/include/mach/tnetv107x.h
arch/arm/mach-davinci/include/mach/vmalloc.h [deleted file]
arch/arm/mach-davinci/io.c [deleted file]
arch/arm/mach-davinci/tnetv107x.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-dove/include/mach/dove.h
arch/arm/mach-dove/include/mach/system.h
arch/arm/mach-dove/include/mach/vmalloc.h [deleted file]
arch/arm/mach-ebsa110/core.c
arch/arm/mach-ebsa110/include/mach/system.h
arch/arm/mach-ebsa110/include/mach/vmalloc.h [deleted file]
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/entry-macro.S
arch/arm/mach-ep93xx/include/mach/platform.h
arch/arm/mach-ep93xx/include/mach/system.h
arch/arm/mach-ep93xx/include/mach/vmalloc.h [deleted file]
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/Kconfig
arch/arm/mach-exynos/Makefile
arch/arm/mach-exynos/clock.c
arch/arm/mach-exynos/cpu.c
arch/arm/mach-exynos/dma.c
arch/arm/mach-exynos/include/mach/entry-macro.S
arch/arm/mach-exynos/include/mach/io.h
arch/arm/mach-exynos/include/mach/irqs.h
arch/arm/mach-exynos/include/mach/map.h
arch/arm/mach-exynos/include/mach/vmalloc.h [deleted file]
arch/arm/mach-exynos/init.c
arch/arm/mach-exynos/mach-armlex4210.c
arch/arm/mach-exynos/mach-exynos4-dt.c [new file with mode: 0644]
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-exynos/pm.c
arch/arm/mach-exynos/setup-sdhci.c [deleted file]
arch/arm/mach-footbridge/cats-hw.c
arch/arm/mach-footbridge/common.c
arch/arm/mach-footbridge/common.h
arch/arm/mach-footbridge/ebsa285.c
arch/arm/mach-footbridge/include/mach/system.h
arch/arm/mach-footbridge/include/mach/vmalloc.h [deleted file]
arch/arm/mach-footbridge/netwinder-hw.c
arch/arm/mach-footbridge/personal.c
arch/arm/mach-gemini/include/mach/system.h
arch/arm/mach-gemini/include/mach/vmalloc.h [deleted file]
arch/arm/mach-h720x/common.c
arch/arm/mach-h720x/common.h
arch/arm/mach-h720x/h7201-eval.c
arch/arm/mach-h720x/h7202-eval.c
arch/arm/mach-h720x/include/mach/system.h
arch/arm/mach-h720x/include/mach/vmalloc.h [deleted file]
arch/arm/mach-highbank/core.h
arch/arm/mach-highbank/highbank.c
arch/arm/mach-highbank/include/mach/entry-macro.S
arch/arm/mach-highbank/include/mach/system.h
arch/arm/mach-highbank/include/mach/vmalloc.h [deleted file]
arch/arm/mach-highbank/system.c
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/Makefile
arch/arm/mach-imx/Makefile.boot
arch/arm/mach-imx/clock-imx6q.c
arch/arm/mach-imx/clock-mx51-mx53.c [moved from arch/arm/mach-mx5/clock-mx51-mx53.c with 99% similarity]
arch/arm/mach-imx/cpu-imx5.c [moved from arch/arm/mach-mx5/cpu.c with 100% similarity]
arch/arm/mach-imx/cpu_op-mx51.c [moved from arch/arm/mach-mx5/cpu_op-mx51.c with 100% similarity]
arch/arm/mach-imx/cpu_op-mx51.h [moved from arch/arm/mach-mx5/cpu_op-mx51.h with 100% similarity]
arch/arm/mach-imx/crm-regs-imx5.h [moved from arch/arm/mach-mx5/crm_regs.h with 100% similarity]
arch/arm/mach-imx/devices-imx50.h [moved from arch/arm/mach-mx5/devices-imx50.h with 100% similarity]
arch/arm/mach-imx/devices-imx51.h [moved from arch/arm/mach-mx5/devices-imx51.h with 100% similarity]
arch/arm/mach-imx/devices-imx53.h [moved from arch/arm/mach-mx5/devices-imx53.h with 100% similarity]
arch/arm/mach-imx/efika.h [moved from arch/arm/mach-mx5/efika.h with 100% similarity]
arch/arm/mach-imx/ehci-imx5.c [moved from arch/arm/mach-mx5/ehci.c with 100% similarity]
arch/arm/mach-imx/eukrea_mbimx51-baseboard.c [moved from arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c with 100% similarity]
arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c [moved from arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c with 100% similarity]
arch/arm/mach-imx/imx51-dt.c [moved from arch/arm/mach-mx5/imx51-dt.c with 99% similarity]
arch/arm/mach-imx/imx53-dt.c [moved from arch/arm/mach-mx5/imx53-dt.c with 99% similarity]
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-cpuimx51.c [moved from arch/arm/mach-mx5/board-cpuimx51.c with 99% similarity]
arch/arm/mach-imx/mach-cpuimx51sd.c [moved from arch/arm/mach-mx5/board-cpuimx51sd.c with 99% similarity]
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-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 [moved from arch/arm/mach-mx5/board-mx50_rdp.c with 99% similarity]
arch/arm/mach-imx/mach-mx51_3ds.c [moved from arch/arm/mach-mx5/board-mx51_3ds.c with 99% similarity]
arch/arm/mach-imx/mach-mx51_babbage.c [moved from arch/arm/mach-mx5/board-mx51_babbage.c with 99% similarity]
arch/arm/mach-imx/mach-mx51_efikamx.c [moved from arch/arm/mach-mx5/board-mx51_efikamx.c with 98% similarity]
arch/arm/mach-imx/mach-mx51_efikasb.c [moved from arch/arm/mach-mx5/board-mx51_efikasb.c with 99% similarity]
arch/arm/mach-imx/mach-mx53_ard.c [moved from arch/arm/mach-mx5/board-mx53_ard.c with 99% similarity]
arch/arm/mach-imx/mach-mx53_evk.c [moved from arch/arm/mach-mx5/board-mx53_evk.c with 99% similarity]
arch/arm/mach-imx/mach-mx53_loco.c [moved from arch/arm/mach-mx5/board-mx53_loco.c with 99% similarity]
arch/arm/mach-imx/mach-mx53_smd.c [moved from arch/arm/mach-mx5/board-mx53_smd.c with 99% similarity]
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 [moved from arch/arm/mach-mx5/mm.c with 100% similarity]
arch/arm/mach-imx/mx51_efika.c [moved from arch/arm/mach-mx5/mx51_efika.c with 100% similarity]
arch/arm/mach-imx/pm-imx5.c [moved from arch/arm/mach-mx5/system.c with 58% similarity]
arch/arm/mach-imx/src.c
arch/arm/mach-integrator/common.h
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/include/mach/system.h
arch/arm/mach-integrator/include/mach/vmalloc.h [deleted file]
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-iop13xx/include/mach/iop13xx.h
arch/arm/mach-iop13xx/include/mach/system.h
arch/arm/mach-iop13xx/include/mach/vmalloc.h [deleted file]
arch/arm/mach-iop13xx/iq81340mc.c
arch/arm/mach-iop13xx/iq81340sc.c
arch/arm/mach-iop13xx/setup.c
arch/arm/mach-iop32x/em7210.c
arch/arm/mach-iop32x/glantank.c
arch/arm/mach-iop32x/include/mach/io.h
arch/arm/mach-iop32x/include/mach/system.h
arch/arm/mach-iop32x/include/mach/vmalloc.h [deleted file]
arch/arm/mach-iop32x/iq31244.c
arch/arm/mach-iop32x/iq80321.c
arch/arm/mach-iop32x/n2100.c
arch/arm/mach-iop33x/include/mach/io.h
arch/arm/mach-iop33x/include/mach/system.h
arch/arm/mach-iop33x/include/mach/vmalloc.h [deleted file]
arch/arm/mach-iop33x/iq80331.c
arch/arm/mach-iop33x/iq80332.c
arch/arm/mach-ixp2000/core.c
arch/arm/mach-ixp2000/enp2611.c
arch/arm/mach-ixp2000/include/mach/platform.h
arch/arm/mach-ixp2000/include/mach/system.h
arch/arm/mach-ixp2000/include/mach/vmalloc.h [deleted file]
arch/arm/mach-ixp2000/ixdp2400.c
arch/arm/mach-ixp2000/ixdp2800.c
arch/arm/mach-ixp2000/ixdp2x01.c
arch/arm/mach-ixp23xx/core.c
arch/arm/mach-ixp23xx/espresso.c
arch/arm/mach-ixp23xx/include/mach/io.h
arch/arm/mach-ixp23xx/include/mach/platform.h
arch/arm/mach-ixp23xx/include/mach/system.h
arch/arm/mach-ixp23xx/include/mach/vmalloc.h [deleted file]
arch/arm/mach-ixp23xx/ixdp2351.c
arch/arm/mach-ixp23xx/roadrunner.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/include/mach/system.h
arch/arm/mach-ixp4xx/include/mach/vmalloc.h [deleted file]
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/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/include/mach/io.h
arch/arm/mach-kirkwood/include/mach/system.h
arch/arm/mach-kirkwood/include/mach/vmalloc.h [deleted file]
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/generic.h
arch/arm/mach-ks8695/include/mach/system.h
arch/arm/mach-ks8695/include/mach/vmalloc.h [deleted file]
arch/arm/mach-ks8695/time.c
arch/arm/mach-lpc32xx/common.c
arch/arm/mach-lpc32xx/common.h
arch/arm/mach-lpc32xx/include/mach/system.h
arch/arm/mach-lpc32xx/include/mach/vmalloc.h [deleted file]
arch/arm/mach-lpc32xx/phy3250.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.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/gpio-pxa.h
arch/arm/mach-mmp/include/mach/gpio.h
arch/arm/mach-mmp/include/mach/irqs.h
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/include/mach/system.h
arch/arm/mach-mmp/include/mach/vmalloc.h [deleted file]
arch/arm/mach-mmp/jasper.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/ttc_dkb.c
arch/arm/mach-msm/Kconfig
arch/arm/mach-msm/board-msm8960.c
arch/arm/mach-msm/board-msm8x60.c
arch/arm/mach-msm/include/mach/debug-macro.S
arch/arm/mach-msm/include/mach/entry-macro-qgic.S [deleted file]
arch/arm/mach-msm/include/mach/entry-macro-vic.S [deleted file]
arch/arm/mach-msm/include/mach/entry-macro.S
arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
arch/arm/mach-msm/include/mach/msm_iomap-8960.h
arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
arch/arm/mach-msm/include/mach/msm_iomap.h
arch/arm/mach-msm/include/mach/system.h
arch/arm/mach-msm/include/mach/uncompress.h
arch/arm/mach-msm/include/mach/vmalloc.h [deleted file]
arch/arm/mach-msm/io.c
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/include/mach/system.h
arch/arm/mach-mv78xx0/include/mach/vmalloc.h [deleted file]
arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
arch/arm/mach-mx5/Kconfig [deleted file]
arch/arm/mach-mx5/Makefile [deleted file]
arch/arm/mach-mx5/Makefile.boot [deleted file]
arch/arm/mach-mx5/pm-imx5.c [deleted file]
arch/arm/mach-mxs/clock-mx28.c
arch/arm/mach-mxs/devices-mx28.h
arch/arm/mach-mxs/devices/platform-mxs-saif.c
arch/arm/mach-mxs/include/mach/common.h
arch/arm/mach-mxs/include/mach/devices-common.h
arch/arm/mach-mxs/include/mach/digctl.h [new file with mode: 0644]
arch/arm/mach-mxs/include/mach/system.h
arch/arm/mach-mxs/include/mach/vmalloc.h [deleted file]
arch/arm/mach-mxs/mach-m28evk.c
arch/arm/mach-mxs/mach-mx23evk.c
arch/arm/mach-mxs/mach-mx28evk.c
arch/arm/mach-mxs/mach-stmp378x_devb.c
arch/arm/mach-mxs/mach-tx28.c
arch/arm/mach-mxs/system.c
arch/arm/mach-netx/generic.c
arch/arm/mach-netx/generic.h
arch/arm/mach-netx/include/mach/entry-macro.S
arch/arm/mach-netx/include/mach/system.h
arch/arm/mach-netx/nxdb500.c
arch/arm/mach-netx/nxdkn.c
arch/arm/mach-netx/nxeb500hmi.c
arch/arm/mach-nomadik/board-nhk8815.c
arch/arm/mach-nomadik/cpu-8815.c
arch/arm/mach-nomadik/cpu-8815.h [new file with mode: 0644]
arch/arm/mach-nomadik/include/mach/entry-macro.S
arch/arm/mach-nomadik/include/mach/setup.h
arch/arm/mach-nomadik/include/mach/system.h
arch/arm/mach-nomadik/include/mach/vmalloc.h [deleted file]
arch/arm/mach-omap1/Kconfig
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/clock.c
arch/arm/mach-omap1/clock.h
arch/arm/mach-omap1/clock_data.c
arch/arm/mach-omap1/common.h [new file with mode: 0644]
arch/arm/mach-omap1/devices.c
arch/arm/mach-omap1/include/mach/vmalloc.h [deleted file]
arch/arm/mach-omap1/io.c
arch/arm/mach-omap1/opp.h
arch/arm/mach-omap1/opp_data.c
arch/arm/mach-omap1/reset.c
arch/arm/mach-omap1/time.c
arch/arm/mach-omap1/timer32k.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
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-peripherals.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/board-ti8168evm.c
arch/arm/mach-omap2/board-zoom-peripherals.c
arch/arm/mach-omap2/board-zoom.c
arch/arm/mach-omap2/cm2xxx_3xxx.c
arch/arm/mach-omap2/cm44xx.c
arch/arm/mach-omap2/cminst44xx.c
arch/arm/mach-omap2/common.c
arch/arm/mach-omap2/common.h [new file with mode: 0644]
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/cpuidle34xx.c
arch/arm/mach-omap2/cpuidle44xx.c [new file with mode: 0644]
arch/arm/mach-omap2/display.c
arch/arm/mach-omap2/i2c.c
arch/arm/mach-omap2/id.c
arch/arm/mach-omap2/include/mach/barriers.h [moved from arch/arm/mach-netx/include/mach/vmalloc.h with 50% similarity]
arch/arm/mach-omap2/include/mach/entry-macro.S
arch/arm/mach-omap2/include/mach/omap-secure.h [new file with mode: 0644]
arch/arm/mach-omap2/include/mach/omap-wakeupgen.h [new file with mode: 0644]
arch/arm/mach-omap2/include/mach/omap4-common.h [deleted file]
arch/arm/mach-omap2/include/mach/vmalloc.h [deleted file]
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/irq.c
arch/arm/mach-omap2/omap-headsmp.S
arch/arm/mach-omap2/omap-hotplug.c
arch/arm/mach-omap2/omap-mpuss-lowpower.c [new file with mode: 0644]
arch/arm/mach-omap2/omap-secure.c [new file with mode: 0644]
arch/arm/mach-omap2/omap-smc.S [moved from arch/arm/mach-omap2/omap44xx-smc.S with 70% similarity]
arch/arm/mach-omap2/omap-smp.c
arch/arm/mach-omap2/omap-wakeupgen.c [new file with mode: 0644]
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/omap4-sar-layout.h [new file with mode: 0644]
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/pm.h
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-omap2/pm34xx.c
arch/arm/mach-omap2/pm44xx.c
arch/arm/mach-omap2/prcm.c
arch/arm/mach-omap2/prcm_mpu44xx.c
arch/arm/mach-omap2/prm2xxx_3xxx.c
arch/arm/mach-omap2/prm44xx.c
arch/arm/mach-omap2/prminst44xx.c
arch/arm/mach-omap2/sdram-nokia.c
arch/arm/mach-omap2/sdrc.c
arch/arm/mach-omap2/sdrc2xxx.c
arch/arm/mach-omap2/serial.c
arch/arm/mach-omap2/sleep44xx.S [new file with mode: 0644]
arch/arm/mach-omap2/smartreflex.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-omap2/vc3xxx_data.c
arch/arm/mach-omap2/vc44xx_data.c
arch/arm/mach-omap2/voltage.c
arch/arm/mach-omap2/voltagedomains3xxx_data.c
arch/arm/mach-omap2/voltagedomains44xx_data.c
arch/arm/mach-omap2/vp.c
arch/arm/mach-omap2/vp3xxx_data.c
arch/arm/mach-omap2/vp44xx_data.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/edmini_v2-setup.c
arch/arm/mach-orion5x/include/mach/io.h
arch/arm/mach-orion5x/include/mach/system.h
arch/arm/mach-orion5x/include/mach/vmalloc.h [deleted file]
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/include/mach/entry-macro.S
arch/arm/mach-picoxcell/include/mach/system.h
arch/arm/mach-picoxcell/include/mach/vmalloc.h [deleted file]
arch/arm/mach-pnx4008/core.c
arch/arm/mach-pnx4008/include/mach/system.h
arch/arm/mach-pnx4008/include/mach/vmalloc.h [deleted file]
arch/arm/mach-prima2/common.h
arch/arm/mach-prima2/include/mach/map.h
arch/arm/mach-prima2/include/mach/system.h
arch/arm/mach-prima2/include/mach/vmalloc.h [deleted file]
arch/arm/mach-prima2/prima2.c
arch/arm/mach-prima2/rstc.c
arch/arm/mach-pxa/am200epd.c
arch/arm/mach-pxa/am300epd.c
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-pxa/capc7117.c
arch/arm/mach-pxa/cm-x270.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/corgi_pm.c
arch/arm/mach-pxa/csb726.c
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/devices.h
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/include/mach/balloon3.h
arch/arm/mach-pxa/include/mach/corgi.h
arch/arm/mach-pxa/include/mach/csb726.h
arch/arm/mach-pxa/include/mach/entry-macro.S
arch/arm/mach-pxa/include/mach/gpio-pxa.h [deleted file]
arch/arm/mach-pxa/include/mach/gpio.h
arch/arm/mach-pxa/include/mach/gumstix.h
arch/arm/mach-pxa/include/mach/hx4700.h
arch/arm/mach-pxa/include/mach/idp.h
arch/arm/mach-pxa/include/mach/irqs.h
arch/arm/mach-pxa/include/mach/littleton.h
arch/arm/mach-pxa/include/mach/magician.h
arch/arm/mach-pxa/include/mach/palmld.h
arch/arm/mach-pxa/include/mach/palmt5.h
arch/arm/mach-pxa/include/mach/palmtc.h
arch/arm/mach-pxa/include/mach/palmtx.h
arch/arm/mach-pxa/include/mach/pcm027.h
arch/arm/mach-pxa/include/mach/pcm990_baseboard.h
arch/arm/mach-pxa/include/mach/poodle.h
arch/arm/mach-pxa/include/mach/spitz.h
arch/arm/mach-pxa/include/mach/system.h
arch/arm/mach-pxa/include/mach/tosa.h
arch/arm/mach-pxa/include/mach/trizeps4.h
arch/arm/mach-pxa/include/mach/vmalloc.h [deleted file]
arch/arm/mach-pxa/irq.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/mfp-pxa2xx.c
arch/arm/mach-pxa/mioa701.c
arch/arm/mach-pxa/mp900.c
arch/arm/mach-pxa/mxm8x10.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/pcm990-baseboard.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/pxa95x.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/reset.c
arch/arm/mach-pxa/saar.c
arch/arm/mach-pxa/saarb.c
arch/arm/mach-pxa/sharpsl_pm.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/spitz_pm.c
arch/arm/mach-pxa/stargate2.c
arch/arm/mach-pxa/tavorevb.c
arch/arm/mach-pxa/tavorevb3.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-pxa/zylonite_pxa300.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/include/mach/entry-macro.S
arch/arm/mach-realview/include/mach/system.h
arch/arm/mach-realview/include/mach/vmalloc.h [deleted file]
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/include/mach/system.h
arch/arm/mach-rpc/include/mach/vmalloc.h [deleted file]
arch/arm/mach-rpc/riscpc.c
arch/arm/mach-s3c2410/include/mach/system-reset.h
arch/arm/mach-s3c2410/include/mach/vmalloc.h [deleted file]
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-s3c2410/s3c2410.c
arch/arm/mach-s3c2412/clock.c
arch/arm/mach-s3c2416/Makefile
arch/arm/mach-s3c2416/clock.c
arch/arm/mach-s3c2416/setup-sdhci.c [deleted file]
arch/arm/mach-s3c2440/clock.c
arch/arm/mach-s3c2440/mach-anubis.c
arch/arm/mach-s3c2440/mach-at2440evb.c
arch/arm/mach-s3c2440/mach-mini2440.c
arch/arm/mach-s3c2440/mach-osiris.c
arch/arm/mach-s3c2440/mach-rx1950.c
arch/arm/mach-s3c2440/mach-rx3715.c
arch/arm/mach-s3c64xx/Kconfig
arch/arm/mach-s3c64xx/Makefile
arch/arm/mach-s3c64xx/clock.c
arch/arm/mach-s3c64xx/dev-spi.c
arch/arm/mach-s3c64xx/include/mach/crag6410.h
arch/arm/mach-s3c64xx/include/mach/entry-macro.S
arch/arm/mach-s3c64xx/include/mach/gpio.h
arch/arm/mach-s3c64xx/include/mach/irqs.h
arch/arm/mach-s3c64xx/include/mach/system.h
arch/arm/mach-s3c64xx/include/mach/vmalloc.h [deleted file]
arch/arm/mach-s3c64xx/mach-anw6410.c
arch/arm/mach-s3c64xx/mach-crag6410-module.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-s3c64xx/pm.c
arch/arm/mach-s3c64xx/setup-sdhci.c [deleted file]
arch/arm/mach-s5p64x0/clock-s5p6440.c
arch/arm/mach-s5p64x0/clock-s5p6450.c
arch/arm/mach-s5p64x0/dev-spi.c
arch/arm/mach-s5p64x0/dma.c
arch/arm/mach-s5p64x0/include/mach/entry-macro.S
arch/arm/mach-s5p64x0/include/mach/irqs.h
arch/arm/mach-s5p64x0/include/mach/vmalloc.h [deleted file]
arch/arm/mach-s5p64x0/init.c
arch/arm/mach-s5p64x0/mach-smdk6440.c
arch/arm/mach-s5p64x0/mach-smdk6450.c
arch/arm/mach-s5pc100/Makefile
arch/arm/mach-s5pc100/clock.c
arch/arm/mach-s5pc100/dev-spi.c
arch/arm/mach-s5pc100/dma.c
arch/arm/mach-s5pc100/include/mach/entry-macro.S
arch/arm/mach-s5pc100/include/mach/irqs.h
arch/arm/mach-s5pc100/include/mach/vmalloc.h [deleted file]
arch/arm/mach-s5pc100/mach-smdkc100.c
arch/arm/mach-s5pc100/setup-sdhci.c [deleted file]
arch/arm/mach-s5pv210/Makefile
arch/arm/mach-s5pv210/clock.c
arch/arm/mach-s5pv210/dev-spi.c
arch/arm/mach-s5pv210/dma.c
arch/arm/mach-s5pv210/include/mach/entry-macro.S
arch/arm/mach-s5pv210/include/mach/irqs.h
arch/arm/mach-s5pv210/include/mach/vmalloc.h [deleted file]
arch/arm/mach-s5pv210/init.c
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-s5pv210/setup-sdhci.c [deleted file]
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.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/include/mach/system.h
arch/arm/mach-sa1100/include/mach/vmalloc.h [deleted file]
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-shark/core.c
arch/arm/mach-shark/include/mach/system.h
arch/arm/mach-shark/include/mach/vmalloc.h [deleted file]
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-kota2.c
arch/arm/mach-shmobile/entry-gic.S [deleted file]
arch/arm/mach-shmobile/include/mach/common.h
arch/arm/mach-shmobile/include/mach/entry-macro.S
arch/arm/mach-shmobile/include/mach/system.h
arch/arm/mach-shmobile/include/mach/vmalloc.h [deleted file]
arch/arm/mach-spear3xx/include/mach/entry-macro.S
arch/arm/mach-spear3xx/include/mach/generic.h
arch/arm/mach-spear3xx/include/mach/vmalloc.h [deleted file]
arch/arm/mach-spear3xx/spear300_evb.c
arch/arm/mach-spear3xx/spear310_evb.c
arch/arm/mach-spear3xx/spear320_evb.c
arch/arm/mach-spear6xx/include/mach/entry-macro.S
arch/arm/mach-spear6xx/include/mach/generic.h
arch/arm/mach-spear6xx/include/mach/vmalloc.h [deleted file]
arch/arm/mach-spear6xx/spear600_evb.c
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/Makefile.boot
arch/arm/mach-tegra/board-dt.c
arch/arm/mach-tegra/board-harmony.c
arch/arm/mach-tegra/board-paz00-pinmux.c
arch/arm/mach-tegra/board-paz00.c
arch/arm/mach-tegra/board-paz00.h
arch/arm/mach-tegra/board-seaboard.c
arch/arm/mach-tegra/board-trimslice.c
arch/arm/mach-tegra/common.c
arch/arm/mach-tegra/include/mach/entry-macro.S
arch/arm/mach-tegra/include/mach/io.h
arch/arm/mach-tegra/include/mach/system.h
arch/arm/mach-tegra/include/mach/vmalloc.h [deleted file]
arch/arm/mach-tegra/io.c
arch/arm/mach-tegra/irq.c
arch/arm/mach-tegra/timer.c
arch/arm/mach-u300/core.c
arch/arm/mach-u300/include/mach/entry-macro.S
arch/arm/mach-u300/include/mach/platform.h
arch/arm/mach-u300/include/mach/system.h
arch/arm/mach-u300/include/mach/vmalloc.h [deleted file]
arch/arm/mach-u300/u300.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/board-u5500.c
arch/arm/mach-ux500/include/mach/entry-macro.S
arch/arm/mach-ux500/include/mach/system.h
arch/arm/mach-ux500/include/mach/vmalloc.h [deleted file]
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/core.h
arch/arm/mach-versatile/include/mach/entry-macro.S
arch/arm/mach-versatile/include/mach/system.h
arch/arm/mach-versatile/include/mach/vmalloc.h [deleted file]
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/include/mach/entry-macro.S
arch/arm/mach-vexpress/include/mach/system.h
arch/arm/mach-vexpress/include/mach/vmalloc.h [deleted file]
arch/arm/mach-vexpress/v2m.c
arch/arm/mach-vt8500/include/mach/system.h
arch/arm/mach-vt8500/include/mach/vmalloc.h [deleted file]
arch/arm/mach-w90x900/cpu.c
arch/arm/mach-w90x900/include/mach/system.h
arch/arm/mach-w90x900/include/mach/vmalloc.h [deleted file]
arch/arm/mach-w90x900/irq.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/nuc910.h
arch/arm/mach-w90x900/nuc950.h
arch/arm/mach-w90x900/nuc960.h
arch/arm/mach-w90x900/nuc9xx.h [new file with mode: 0644]
arch/arm/mach-w90x900/time.c
arch/arm/mach-zynq/common.c
arch/arm/mach-zynq/include/mach/entry-macro.S
arch/arm/mach-zynq/include/mach/system.h
arch/arm/mach-zynq/include/mach/vmalloc.h [deleted file]
arch/arm/mm/Kconfig
arch/arm/mm/alignment.c
arch/arm/mm/context.c
arch/arm/mm/fault.c
arch/arm/mm/fault.h
arch/arm/mm/fsr-2level.c [new file with mode: 0644]
arch/arm/mm/fsr-3level.c [new file with mode: 0644]
arch/arm/mm/idmap.c
arch/arm/mm/init.c
arch/arm/mm/ioremap.c
arch/arm/mm/mm.h
arch/arm/mm/mmap.c
arch/arm/mm/mmu.c
arch/arm/mm/nommu.c
arch/arm/mm/pgd.c
arch/arm/mm/proc-arm1020.S
arch/arm/mm/proc-arm1020e.S
arch/arm/mm/proc-arm1022.S
arch/arm/mm/proc-arm1026.S
arch/arm/mm/proc-arm6_7.S
arch/arm/mm/proc-arm720.S
arch/arm/mm/proc-arm740.S
arch/arm/mm/proc-arm7tdmi.S
arch/arm/mm/proc-arm920.S
arch/arm/mm/proc-arm922.S
arch/arm/mm/proc-arm925.S
arch/arm/mm/proc-arm926.S
arch/arm/mm/proc-arm940.S
arch/arm/mm/proc-arm946.S
arch/arm/mm/proc-arm9tdmi.S
arch/arm/mm/proc-fa526.S
arch/arm/mm/proc-feroceon.S
arch/arm/mm/proc-macros.S
arch/arm/mm/proc-mohawk.S
arch/arm/mm/proc-sa110.S
arch/arm/mm/proc-sa1100.S
arch/arm/mm/proc-v6.S
arch/arm/mm/proc-v7-2level.S [new file with mode: 0644]
arch/arm/mm/proc-v7-3level.S [new file with mode: 0644]
arch/arm/mm/proc-v7.S
arch/arm/mm/proc-xsc3.S
arch/arm/mm/proc-xscale.S
arch/arm/plat-iop/Makefile
arch/arm/plat-iop/io.c [deleted file]
arch/arm/plat-iop/restart.c [new file with mode: 0644]
arch/arm/plat-mxc/Kconfig
arch/arm/plat-mxc/Makefile
arch/arm/plat-mxc/gic.c [deleted file]
arch/arm/plat-mxc/include/mach/common.h
arch/arm/plat-mxc/include/mach/entry-macro.S
arch/arm/plat-mxc/include/mach/mx1.h
arch/arm/plat-mxc/include/mach/system.h
arch/arm/plat-mxc/include/mach/vmalloc.h [deleted file]
arch/arm/plat-mxc/system.c
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/common.c
arch/arm/plat-omap/include/plat/clkdev_omap.h
arch/arm/plat-omap/include/plat/common.h
arch/arm/plat-omap/include/plat/io.h
arch/arm/plat-omap/include/plat/irqs.h
arch/arm/plat-omap/include/plat/omap-secure.h [new file with mode: 0644]
arch/arm/plat-omap/include/plat/omap44xx.h
arch/arm/plat-omap/include/plat/sram.h
arch/arm/plat-omap/include/plat/system.h
arch/arm/plat-omap/io.c [deleted file]
arch/arm/plat-omap/sram.c
arch/arm/plat-pxa/include/plat/gpio-pxa.h [deleted file]
arch/arm/plat-pxa/include/plat/gpio.h [deleted file]
arch/arm/plat-s3c24xx/cpu.c
arch/arm/plat-s3c24xx/dma.c
arch/arm/plat-s3c24xx/s3c2443-clock.c
arch/arm/plat-s5p/Kconfig
arch/arm/plat-samsung/Kconfig
arch/arm/plat-samsung/dev-backlight.c
arch/arm/plat-samsung/dma-ops.c
arch/arm/plat-samsung/include/plat/dma-ops.h
arch/arm/plat-samsung/include/plat/dma-pl330.h
arch/arm/plat-samsung/include/plat/irqs.h
arch/arm/plat-samsung/include/plat/regs-serial.h
arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
arch/arm/plat-samsung/include/plat/sdhci.h
arch/arm/plat-samsung/include/plat/system-reset.h
arch/arm/plat-spear/Makefile
arch/arm/plat-spear/include/plat/system.h
arch/arm/plat-spear/include/plat/vmalloc.h [deleted file]
arch/arm/plat-spear/restart.c [new file with mode: 0644]
arch/arm/plat-tcc/include/mach/system.h
arch/arm/plat-tcc/include/mach/vmalloc.h [deleted file]
arch/arm/tools/mach-types
arch/avr32/boards/atngw100/setup.c
arch/avr32/boards/atstk1000/atstk1002.c
arch/avr32/boards/favr-32/setup.c
arch/avr32/boards/hammerhead/setup.c
arch/avr32/boards/merisc/setup.c
arch/avr32/boards/mimc200/setup.c
arch/avr32/mach-at32ap/at32ap700x.c
arch/avr32/mach-at32ap/include/mach/board.h
arch/c6x/Kconfig [new file with mode: 0644]
arch/c6x/Makefile [new file with mode: 0644]
arch/c6x/boot/Makefile [new file with mode: 0644]
arch/c6x/boot/dts/dsk6455.dts [new file with mode: 0644]
arch/c6x/boot/dts/evmc6457.dts [new file with mode: 0644]
arch/c6x/boot/dts/evmc6472.dts [new file with mode: 0644]
arch/c6x/boot/dts/evmc6474.dts [new file with mode: 0644]
arch/c6x/boot/dts/tms320c6455.dtsi [new file with mode: 0644]
arch/c6x/boot/dts/tms320c6457.dtsi [new file with mode: 0644]
arch/c6x/boot/dts/tms320c6472.dtsi [new file with mode: 0644]
arch/c6x/boot/dts/tms320c6474.dtsi [new file with mode: 0644]
arch/c6x/boot/linked_dtb.S [new file with mode: 0644]
arch/c6x/configs/dsk6455_defconfig [new file with mode: 0644]
arch/c6x/configs/evmc6457_defconfig [new file with mode: 0644]
arch/c6x/configs/evmc6472_defconfig [new file with mode: 0644]
arch/c6x/configs/evmc6474_defconfig [new file with mode: 0644]
arch/c6x/include/asm/Kbuild [new file with mode: 0644]
arch/c6x/include/asm/asm-offsets.h [new file with mode: 0644]
arch/c6x/include/asm/bitops.h [new file with mode: 0644]
arch/c6x/include/asm/byteorder.h [new file with mode: 0644]
arch/c6x/include/asm/cache.h [new file with mode: 0644]
arch/c6x/include/asm/cacheflush.h [new file with mode: 0644]
arch/c6x/include/asm/checksum.h [new file with mode: 0644]
arch/c6x/include/asm/clkdev.h [new file with mode: 0644]
arch/c6x/include/asm/clock.h [new file with mode: 0644]
arch/c6x/include/asm/delay.h [new file with mode: 0644]
arch/c6x/include/asm/dma-mapping.h [new file with mode: 0644]
arch/c6x/include/asm/dscr.h [new file with mode: 0644]
arch/c6x/include/asm/elf.h [new file with mode: 0644]
arch/c6x/include/asm/ftrace.h [new file with mode: 0644]
arch/c6x/include/asm/hardirq.h [new file with mode: 0644]
arch/c6x/include/asm/irq.h [new file with mode: 0644]
arch/c6x/include/asm/irqflags.h [new file with mode: 0644]
arch/c6x/include/asm/linkage.h [new file with mode: 0644]
arch/c6x/include/asm/megamod-pic.h [new file with mode: 0644]
arch/c6x/include/asm/memblock.h [new file with mode: 0644]
arch/c6x/include/asm/mmu.h [new file with mode: 0644]
arch/c6x/include/asm/module.h [new file with mode: 0644]
arch/c6x/include/asm/mutex.h [new file with mode: 0644]
arch/c6x/include/asm/page.h [new file with mode: 0644]
arch/c6x/include/asm/pgtable.h [new file with mode: 0644]
arch/c6x/include/asm/processor.h [new file with mode: 0644]
arch/c6x/include/asm/procinfo.h [new file with mode: 0644]
arch/c6x/include/asm/prom.h [new file with mode: 0644]
arch/c6x/include/asm/ptrace.h [new file with mode: 0644]
arch/c6x/include/asm/sections.h [new file with mode: 0644]
arch/c6x/include/asm/setup.h [new file with mode: 0644]
arch/c6x/include/asm/sigcontext.h [new file with mode: 0644]
arch/c6x/include/asm/signal.h [new file with mode: 0644]
arch/c6x/include/asm/soc.h [new file with mode: 0644]
arch/c6x/include/asm/string.h [new file with mode: 0644]
arch/c6x/include/asm/swab.h [new file with mode: 0644]
arch/c6x/include/asm/syscall.h [new file with mode: 0644]
arch/c6x/include/asm/syscalls.h [new file with mode: 0644]
arch/c6x/include/asm/system.h [new file with mode: 0644]
arch/c6x/include/asm/thread_info.h [new file with mode: 0644]
arch/c6x/include/asm/timer64.h [new file with mode: 0644]
arch/c6x/include/asm/timex.h [new file with mode: 0644]
arch/c6x/include/asm/tlb.h [new file with mode: 0644]
arch/c6x/include/asm/traps.h [new file with mode: 0644]
arch/c6x/include/asm/uaccess.h [new file with mode: 0644]
arch/c6x/include/asm/unaligned.h [new file with mode: 0644]
arch/c6x/include/asm/unistd.h [new file with mode: 0644]
arch/c6x/kernel/Makefile [new file with mode: 0644]
arch/c6x/kernel/asm-offsets.c [new file with mode: 0644]
arch/c6x/kernel/c6x_ksyms.c [new file with mode: 0644]
arch/c6x/kernel/devicetree.c [new file with mode: 0644]
arch/c6x/kernel/dma.c [new file with mode: 0644]
arch/c6x/kernel/entry.S [new file with mode: 0644]
arch/c6x/kernel/head.S [new file with mode: 0644]
arch/c6x/kernel/irq.c [new file with mode: 0644]
arch/c6x/kernel/module.c [new file with mode: 0644]
arch/c6x/kernel/process.c [new file with mode: 0644]
arch/c6x/kernel/ptrace.c [new file with mode: 0644]
arch/c6x/kernel/setup.c [new file with mode: 0644]
arch/c6x/kernel/signal.c [new file with mode: 0644]
arch/c6x/kernel/soc.c [new file with mode: 0644]
arch/c6x/kernel/switch_to.S [new file with mode: 0644]
arch/c6x/kernel/sys_c6x.c [new file with mode: 0644]
arch/c6x/kernel/time.c [new file with mode: 0644]
arch/c6x/kernel/traps.c [new file with mode: 0644]
arch/c6x/kernel/vectors.S [new file with mode: 0644]
arch/c6x/kernel/vmlinux.lds.S [new file with mode: 0644]
arch/c6x/lib/Makefile [new file with mode: 0644]
arch/c6x/lib/checksum.c [new file with mode: 0644]
arch/c6x/lib/csum_64plus.S [new file with mode: 0644]
arch/c6x/lib/divi.S [new file with mode: 0644]
arch/c6x/lib/divremi.S [new file with mode: 0644]
arch/c6x/lib/divremu.S [new file with mode: 0644]
arch/c6x/lib/divu.S [new file with mode: 0644]
arch/c6x/lib/llshl.S [new file with mode: 0644]
arch/c6x/lib/llshr.S [new file with mode: 0644]
arch/c6x/lib/llshru.S [new file with mode: 0644]
arch/c6x/lib/memcpy_64plus.S [new file with mode: 0644]
arch/c6x/lib/mpyll.S [new file with mode: 0644]
arch/c6x/lib/negll.S [new file with mode: 0644]
arch/c6x/lib/pop_rts.S [new file with mode: 0644]
arch/c6x/lib/push_rts.S [new file with mode: 0644]
arch/c6x/lib/remi.S [new file with mode: 0644]
arch/c6x/lib/remu.S [new file with mode: 0644]
arch/c6x/lib/strasgi.S [new file with mode: 0644]
arch/c6x/lib/strasgi_64plus.S [new file with mode: 0644]
arch/c6x/mm/Makefile [new file with mode: 0644]
arch/c6x/mm/dma-coherent.c [new file with mode: 0644]
arch/c6x/mm/init.c [new file with mode: 0644]
arch/c6x/platforms/Kconfig [new file with mode: 0644]
arch/c6x/platforms/Makefile [new file with mode: 0644]
arch/c6x/platforms/cache.c [new file with mode: 0644]
arch/c6x/platforms/dscr.c [new file with mode: 0644]
arch/c6x/platforms/emif.c [new file with mode: 0644]
arch/c6x/platforms/megamod-pic.c [new file with mode: 0644]
arch/c6x/platforms/platform.c [new file with mode: 0644]
arch/c6x/platforms/pll.c [new file with mode: 0644]
arch/c6x/platforms/plldata.c [new file with mode: 0644]
arch/c6x/platforms/timer64.c [new file with mode: 0644]
arch/cris/arch-v32/drivers/cryptocop.c
arch/cris/arch-v32/kernel/ptrace.c
arch/cris/include/arch-v32/arch/cache.h
arch/hexagon/Kconfig
arch/hexagon/Makefile
arch/hexagon/include/asm/spinlock_types.h
arch/hexagon/kernel/dma.c
arch/hexagon/kernel/ptrace.c
arch/hexagon/kernel/time.c
arch/hexagon/kernel/vdso.c
arch/m68k/Kconfig.debug
arch/m68k/Kconfig.devices
arch/m68k/atari/ataints.c
arch/m68k/atari/debug.c
arch/m68k/configs/multi_defconfig
arch/m68k/configs/mvme16x_defconfig
arch/m68k/emu/nfeth.c
arch/m68k/hp300/config.c
arch/m68k/include/asm/atarihw.h
arch/m68k/include/asm/blinken.h
arch/m68k/include/asm/mac_baboon.h
arch/m68k/include/asm/mac_iop.h
arch/m68k/include/asm/mac_oss.h
arch/m68k/include/asm/mac_psc.h
arch/m68k/include/asm/mac_via.h
arch/m68k/include/asm/macintosh.h
arch/m68k/include/asm/macints.h
arch/m68k/include/asm/serial.h
arch/m68k/include/asm/unistd.h
arch/m68k/kernel/head.S
arch/m68k/mac/baboon.c
arch/m68k/mac/config.c
arch/m68k/mac/iop.c
arch/m68k/mac/macints.c
arch/m68k/mac/oss.c
arch/m68k/mac/psc.c
arch/m68k/mac/via.c
arch/m68k/mvme16x/config.c
arch/sparc/kernel/ds.c
arch/sparc/kernel/prom_common.c
drivers/acpi/apei/erst.c
drivers/ata/pata_at91.c
drivers/block/swim.c
drivers/bluetooth/Kconfig
drivers/bluetooth/btmrvl_sdio.c
drivers/bluetooth/btusb.c
drivers/dma/pl330.c
drivers/firmware/efivars.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/gpio-pxa.c
drivers/gpio/gpio-samsung.c
drivers/ide/at91_ide.c
drivers/input/keyboard/samsung-keypad.c
drivers/input/misc/cma3000_d0x.c
drivers/input/mouse/synaptics.c
drivers/input/tablet/wacom_wac.c
drivers/mmc/host/at91_mci.c
drivers/mmc/host/sdhci-s3c.c
drivers/mtd/nand/atmel_nand.c
drivers/net/cris/eth_v10.c
drivers/net/ethernet/Makefile
drivers/net/ethernet/cadence/Kconfig
drivers/net/ethernet/cadence/at91_ether.c
drivers/net/ethernet/cadence/at91_ether.h
drivers/net/ethernet/cadence/macb.c
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/freescale/fec.c
drivers/net/ethernet/freescale/fsl_pq_mdio.c
drivers/net/ppp/pptp.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
drivers/net/wireless/rtlwifi/rtl8192de/phy.c
drivers/net/wireless/rtlwifi/rtl8192se/phy.c
drivers/of/platform.c
drivers/pci/ats.c
drivers/pci/iov.c
drivers/pci/pci.c
drivers/pcmcia/pxa2xx_cm_x255.c
drivers/pcmcia/pxa2xx_cm_x270.c
drivers/rtc/rtc-at91rm9200.c
drivers/rtc/rtc-s3c.c
drivers/s390/scsi/zfcp_scsi.c
drivers/sbus/char/bbc_i2c.c
drivers/sbus/char/display7seg.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/flash.c
drivers/sbus/char/uctrl.c
drivers/scsi/fcoe/fcoe.c
drivers/scsi/mac_esp.c
drivers/scsi/mpt2sas/mpt2sas_scsih.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_nx.h
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla4xxx/ql4_def.h
drivers/scsi/qla4xxx/ql4_fw.h
drivers/scsi/qla4xxx/ql4_glbl.h
drivers/scsi/qla4xxx/ql4_init.c
drivers/scsi/qla4xxx/ql4_mbx.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/scsi/qla4xxx/ql4_version.h
drivers/spi/spi-s3c64xx.c
drivers/ssb/driver_pcicore.c
drivers/tty/serial/Kconfig
drivers/tty/serial/Makefile
drivers/tty/serial/s3c2410.c [deleted file]
drivers/tty/serial/s3c2412.c [deleted file]
drivers/tty/serial/s3c2440.c [deleted file]
drivers/tty/serial/s3c6400.c [deleted file]
drivers/tty/serial/s5pv210.c [deleted file]
drivers/tty/serial/samsung.c
drivers/tty/serial/samsung.h
drivers/usb/class/cdc-acm.c
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/f_mass_storage.c
drivers/usb/host/ehci-tegra.c
drivers/usb/host/ohci-at91.c
drivers/usb/renesas_usbhs/mod.c
drivers/usb/renesas_usbhs/mod_host.c
drivers/usb/serial/option.c
drivers/watchdog/at91sam9_wdt.c
drivers/watchdog/at91sam9_wdt.h
fs/pstore/inode.c
fs/pstore/platform.c
include/asm-generic/io.h
include/asm-generic/page.h
include/asm-generic/uaccess.h
include/linux/amba/pl330.h
include/linux/elf-em.h
include/linux/gpio-pxa.h [new file with mode: 0644]
include/linux/platform_data/macb.h [new file with mode: 0644]
include/linux/pstore.h
include/linux/vmalloc.h
include/sound/saif.h
mm/vmalloc.c
net/batman-adv/translation-table.c
net/bluetooth/bnep/core.c
net/bluetooth/cmtp/core.c
net/bluetooth/hci_event.c
net/ipv4/ipip.c
net/ipv6/addrconf.c
net/ipv6/sit.c
net/mac80211/agg-tx.c
net/nfc/nci/core.c
sound/pci/hda/hda_intel.c
sound/soc/mxs/mxs-saif.c

index 771d48d3b335a1419f1ec363d540c77ad6d75fbc..208a2d465b922ec826049243abc8c6ac2a724813 100644 (file)
@@ -51,15 +51,14 @@ ffc00000    ffefffff        DMA memory mapping region.  Memory returned
 ff000000       ffbfffff        Reserved for future expansion of DMA
                                mapping region.
 
-VMALLOC_END    feffffff        Free for platform use, recommended.
-                               VMALLOC_END must be aligned to a 2MB
-                               boundary.
-
 VMALLOC_START  VMALLOC_END-1   vmalloc() / ioremap() space.
                                Memory returned by vmalloc/ioremap will
                                be dynamically placed in this region.
-                               VMALLOC_START may be based upon the value
-                               of the high_memory variable.
+                               Machine specific static mappings are also
+                               located here through iotable_init().
+                               VMALLOC_START is based upon the value
+                               of the high_memory variable, and VMALLOC_END
+                               is equal to 0xff000000.
 
 PAGE_OFFSET    high_memory-1   Kernel direct-mapped RAM region.
                                This maps the platforms RAM, and typically
index d9b086869a6054d9687ec51070cfceb51fab6a50..8dbdb1a44429aedc90e770dfba266f8f57e97ce9 100644 (file)
@@ -1,38 +1,34 @@
-Linux 2.4 on the CRIS architecture
-==================================
-$Id: README,v 1.7 2001/04/19 12:38:32 bjornw Exp $
+Linux on the CRIS architecture
+==============================
 
-This is a port of Linux 2.4 to Axis Communications ETRAX 100LX embedded 
-network CPU. For more information about CRIS and ETRAX please see further
-below.
+This is a port of Linux to Axis Communications ETRAX 100LX,
+ETRAX FS and ARTPEC-3 embedded network CPUs.
+
+For more information about CRIS and ETRAX please see further below.
 
 In order to compile this you need a version of gcc with support for the
-ETRAX chip family. Please see this link for more information on how to 
+ETRAX chip family. Please see this link for more information on how to
 download the compiler and other tools useful when building and booting
 software for the ETRAX platform:
 
-http://developer.axis.com/doc/software/devboard_lx/install-howto.html
-
-<more specific information should come in this document later>
+http://developer.axis.com/wiki/doku.php?id=axis:install-howto-2_20
 
 What is CRIS ?
 --------------
 
 CRIS is an acronym for 'Code Reduced Instruction Set'. It is the CPU
 architecture in Axis Communication AB's range of embedded network CPU's,
-called ETRAX. The latest CPU is called ETRAX 100LX, where LX stands for
-'Linux' because the chip was designed to be a good host for the Linux
-operating system.
+called ETRAX.
 
 The ETRAX 100LX chip
 --------------------
 
-For reference, please see the press-release:
+For reference, please see the following link:
 
-http://www.axis.com/news/us/001101_etrax.htm
+http://www.axis.com/products/dev_etrax_100lx/index.htm
 
-The ETRAX 100LX is a 100 MIPS processor with 8kB cache, MMU, and a very broad 
-range of  built-in interfaces, all with modern scatter/gather DMA.
+The ETRAX 100LX is a 100 MIPS processor with 8kB cache, MMU, and a very broad
+range of built-in interfaces, all with modern scatter/gather DMA.
 
 Memory interfaces:
 
@@ -51,20 +47,28 @@ I/O interfaces:
        * SCSI
        * two parallel-ports
        * two generic 8-bit ports
-       
-       (not all interfaces are available at the same time due to chip pin 
+
+       (not all interfaces are available at the same time due to chip pin
          multiplexing)
 
-The previous version of the ETRAX, the ETRAX 100, sits in almost all of
-Axis shipping thin-servers like the Axis 2100 web camera or the ETRAX 100
-developer-board. It lacks an MMU so the Linux we run on that is a version
-of uClinux (Linux 2.0 without MM-support) ported to the CRIS architecture.
-The new Linux 2.4 port has full MM and needs a CPU with an MMU, so it will
-not run on the ETRAX 100.
+ETRAX 100LX is CRISv10 architecture.
+
+
+The ETRAX FS and ARTPEC-3 chips
+-------------------------------
 
-A version of the Axis developer-board with ETRAX 100LX (running Linux
-2.4) is now available. For more information please see developer.axis.com.
+The ETRAX FS is a 200MHz 32-bit RISC processor with on-chip 16kB
+I-cache and 16kB D-cache and with a wide range of device interfaces
+including multiple high speed serial ports and an integrated USB 1.1 PHY.
 
+The ARTPEC-3 is a variant of the ETRAX FS with additional IO-units
+used by the Axis Communications network cameras.
+
+See below link for more information:
+
+http://www.axis.com/products/dev_etrax_fs/index.htm
+
+ETRAX FS and ARTPEC-3 are both CRISv32 architectures.
 
 Bootlog
 -------
@@ -182,10 +186,6 @@ SwapFree:            0 kB
 -rwxr-xr-x  1 342      100         16252  Jan 01 00:00 telnetd
 
 
-(All programs are statically linked to the libc at this point - we have not ported the
- shared libraries yet)
-
-
 
 
 
index 52916b4aa1fe9b70201b2fd44f3b91893c76600b..9b4b82a721b64b5cea6309b2d81ab09c0f4f47aa 100644 (file)
@@ -42,6 +42,10 @@ Optional
 - interrupts   : Interrupt source of the parent interrupt controller. Only
   present on secondary GICs.
 
+- cpu-offset   : per-cpu offset within the distributor and cpu interface
+  regions, used when the GIC doesn't have banked registers. The offset is
+  cpu-offset * cpu-nr.
+
 Example:
 
        intc: interrupt-controller@fff11000 {
diff --git a/Documentation/devicetree/bindings/arm/insignal-boards.txt b/Documentation/devicetree/bindings/arm/insignal-boards.txt
new file mode 100644 (file)
index 0000000..524c3dc
--- /dev/null
@@ -0,0 +1,8 @@
+* Insignal's Exynos4210 based Origen evaluation board
+
+Origen low-cost evaluation board is based on Samsung's Exynos4210 SoC.
+
+Required root node properties:
+    - compatible = should be one or more of the following.
+        (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
+        (b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung-boards.txt
new file mode 100644 (file)
index 0000000..0bf68be
--- /dev/null
@@ -0,0 +1,8 @@
+* Samsung's Exynos4210 based SMDKV310 evaluation board
+
+SMDKV310 evaluation board is based on Samsung's Exynos4210 SoC.
+
+Required root node properties:
+    - compatible = should be one or more of the following.
+        (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
+        (b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt
new file mode 100644 (file)
index 0000000..266716b
--- /dev/null
@@ -0,0 +1,29 @@
+* ARM Vectored Interrupt Controller
+
+One or more Vectored Interrupt Controllers (VIC's) can be connected in an ARM
+system for interrupt routing.  For multiple controllers they can either be
+nested or have the outputs wire-OR'd together.
+
+Required properties:
+
+- compatible : should be one of
+       "arm,pl190-vic"
+       "arm,pl192-vic"
+- interrupt-controller : Identifies the node as an interrupt controller
+- #interrupt-cells : The number of cells to define the interrupts.  Must be 1 as
+  the VIC has no configuration options for interrupt sources.  The cell is a u32
+  and defines the interrupt number.
+- reg : The register bank for the VIC.
+
+Optional properties:
+
+- interrupts : Interrupt source for parent controllers if the VIC is nested.
+
+Example:
+
+       vic0: interrupt-controller@60000 {
+               compatible = "arm,pl192-vic";
+               interrupt-controller;
+               #interrupt-cells = <1>;
+               reg = <0x60000 0x1000>;
+       };
diff --git a/Documentation/devicetree/bindings/c6x/clocks.txt b/Documentation/devicetree/bindings/c6x/clocks.txt
new file mode 100644 (file)
index 0000000..a04f5fd
--- /dev/null
@@ -0,0 +1,40 @@
+C6X PLL Clock Controllers
+-------------------------
+
+This is a first-cut support for the SoC clock controllers. This is still
+under development and will probably change as the common device tree
+clock support is added to the kernel.
+
+Required properties:
+
+- compatible: "ti,c64x+pll"
+    May also have SoC-specific value to support SoC-specific initialization
+    in the driver. One of:
+        "ti,c6455-pll"
+        "ti,c6457-pll"
+        "ti,c6472-pll"
+        "ti,c6474-pll"
+
+- reg: base address and size of register area
+- clock-frequency: input clock frequency in hz
+
+
+Optional properties:
+
+- ti,c64x+pll-bypass-delay: CPU cycles to delay when entering bypass mode
+
+- ti,c64x+pll-reset-delay:  CPU cycles to delay after PLL reset
+
+- ti,c64x+pll-lock-delay:   CPU cycles to delay after PLL frequency change
+
+Example:
+
+       clock-controller@29a0000 {
+               compatible = "ti,c6472-pll", "ti,c64x+pll";
+               reg = <0x029a0000 0x200>;
+               clock-frequency = <25000000>;
+
+               ti,c64x+pll-bypass-delay = <200>;
+               ti,c64x+pll-reset-delay = <12000>;
+               ti,c64x+pll-lock-delay = <80000>;
+       };
diff --git a/Documentation/devicetree/bindings/c6x/dscr.txt b/Documentation/devicetree/bindings/c6x/dscr.txt
new file mode 100644 (file)
index 0000000..d847758
--- /dev/null
@@ -0,0 +1,127 @@
+Device State Configuration Registers
+------------------------------------
+
+TI C6X SoCs contain a region of miscellaneous registers which provide various
+function for SoC control or status. Details vary considerably among from SoC
+to SoC with no two being alike.
+
+In general, the Device State Configuraion Registers (DSCR) will provide one or
+more configuration registers often protected by a lock register where one or
+more key values must be written to a lock register in order to unlock the
+configuration register for writes. These configuration register may be used to
+enable (and disable in some cases) SoC pin drivers, select peripheral clock
+sources (internal or pin), etc. In some cases, a configuration register is
+write once or the individual bits are write once. In addition to device config,
+the DSCR block may provide registers which which are used to reset peripherals,
+provide device ID information, provide ethernet MAC addresses, as well as other
+miscellaneous functions.
+
+For device state control (enable/disable), each device control is assigned an
+id which is used by individual device drivers to control the state as needed.
+
+Required properties:
+
+- compatible: must be "ti,c64x+dscr"
+- reg: register area base and size
+
+Optional properties:
+
+  NOTE: These are optional in that not all SoCs will have all properties. For
+        SoCs which do support a given property, leaving the property out of the
+        device tree will result in reduced functionality or possibly driver
+        failure.
+
+- ti,dscr-devstat
+    offset of the devstat register
+
+- ti,dscr-silicon-rev
+    offset, start bit, and bitsize of silicon revision field
+
+- ti,dscr-rmii-resets
+    offset and bitmask of RMII reset field. May have multiple tuples if more
+    than one ethernet port is available.
+
+- ti,dscr-locked-regs
+    possibly multiple tuples describing registers which are write protected by
+    a lock register. Each tuple consists of the register offset, lock register
+    offsset, and the key value used to unlock the register.
+
+- ti,dscr-kick-regs
+    offset and key values of two "kick" registers used to write protect other
+    registers in DSCR. On SoCs using kick registers, the first key must be
+    written to the first kick register and the second key must be written to
+    the second register before other registers in the area are write-enabled.
+
+- ti,dscr-mac-fuse-regs
+    MAC addresses are contained in two registers. Each element of a MAC address
+    is contained in a single byte. This property has two tuples. Each tuple has
+    a register offset and four cells representing bytes in the register from
+    most significant to least. The value of these four cells is the MAC byte
+    index (1-6) of the byte within the register. A value of 0 means the byte
+    is unused in the MAC address.
+
+- ti,dscr-devstate-ctl-regs
+    This property describes the bitfields used to control the state of devices.
+    Each tuple describes a range of identical bitfields used to control one or
+    more devices (one bitfield per device). The layout of each tuple is:
+
+        start_id num_ids reg enable disable start_bit nbits
+
+    Where:
+        start_id is device id for the first device control in the range
+        num_ids is the number of device controls in the range
+        reg is the offset of the register holding the control bits
+        enable is the value to enable a device
+        disable is the value to disable a device (0xffffffff if cannot disable)
+        start_bit is the bit number of the first bit in the range
+        nbits is the number of bits per device control
+
+- ti,dscr-devstate-stat-regs
+    This property describes the bitfields used to provide device state status
+    for device states controlled by the DSCR. Each tuple describes a range of
+    identical bitfields used to provide status for one or more devices (one
+    bitfield per device). The layout of each tuple is:
+
+        start_id num_ids reg enable disable start_bit nbits
+
+    Where:
+        start_id is device id for the first device status in the range
+        num_ids is the number of devices covered by the range
+        reg is the offset of the register holding the status bits
+        enable is the value indicating device is enabled
+        disable is the value indicating device is disabled
+        start_bit is the bit number of the first bit in the range
+        nbits is the number of bits per device status
+
+- ti,dscr-privperm
+    Offset and default value for register used to set access privilege for
+    some SoC devices.
+
+
+Example:
+
+       device-state-config-regs@2a80000 {
+               compatible = "ti,c64x+dscr";
+               reg = <0x02a80000 0x41000>;
+
+               ti,dscr-devstat = <0>;
+               ti,dscr-silicon-rev = <8 28 0xf>;
+               ti,dscr-rmii-resets = <0x40020 0x00040000>;
+
+               ti,dscr-locked-regs = <0x40008 0x40004 0x0f0a0b00>;
+               ti,dscr-devstate-ctl-regs =
+                        <0 12 0x40008 1 0  0  2
+                         12 1 0x40008 3 0 30  2
+                         13 2 0x4002c 1 0xffffffff 0 1>;
+               ti,dscr-devstate-stat-regs =
+                       <0 10 0x40014 1 0  0  3
+                        10 2 0x40018 1 0  0  3>;
+
+               ti,dscr-mac-fuse-regs = <0x700 1 2 3 4
+                                        0x704 5 6 0 0>;
+
+               ti,dscr-privperm = <0x41c 0xaaaaaaaa>;
+
+               ti,dscr-kick-regs = <0x38 0x83E70B13
+                                    0x3c 0x95A4F1E0>;
+       };
diff --git a/Documentation/devicetree/bindings/c6x/emifa.txt b/Documentation/devicetree/bindings/c6x/emifa.txt
new file mode 100644 (file)
index 0000000..0ff6e9b
--- /dev/null
@@ -0,0 +1,62 @@
+External Memory Interface
+-------------------------
+
+The emifa node describes a simple external bus controller found on some C6X
+SoCs. This interface provides external busses with a number of chip selects.
+
+Required properties:
+
+- compatible: must be "ti,c64x+emifa", "simple-bus"
+- reg: register area base and size
+- #address-cells: must be 2 (chip-select + offset)
+- #size-cells: must be 1
+- ranges: mapping from EMIFA space to parent space
+
+
+Optional properties:
+
+- ti,dscr-dev-enable: Device ID if EMIF is enabled/disabled from DSCR
+
+- ti,emifa-burst-priority:
+      Number of memory transfers after which the EMIF will elevate the priority
+      of the oldest command in the command FIFO. Setting this field to 255
+      disables this feature, thereby allowing old commands to stay in the FIFO
+      indefinitely.
+
+- ti,emifa-ce-config:
+      Configuration values for each of the supported chip selects.
+
+Example:
+
+       emifa@70000000 {
+               compatible = "ti,c64x+emifa", "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               reg = <0x70000000 0x100>;
+               ranges = <0x2 0x0 0xa0000000 0x00000008
+                         0x3 0x0 0xb0000000 0x00400000
+                         0x4 0x0 0xc0000000 0x10000000
+                         0x5 0x0 0xD0000000 0x10000000>;
+
+               ti,dscr-dev-enable = <13>;
+               ti,emifa-burst-priority = <255>;
+               ti,emifa-ce-config = <0x00240120
+                                     0x00240120
+                                     0x00240122
+                                     0x00240122>;
+
+               flash@3,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "cfi-flash";
+                       reg = <0x3 0x0 0x400000>;
+                       bank-width = <1>;
+                       device-width = <1>;
+                       partition@0 {
+                               reg = <0x0 0x400000>;
+                               label = "NOR";
+                       };
+               };
+       };
+
+This shows a flash chip attached to chip select 3.
diff --git a/Documentation/devicetree/bindings/c6x/interrupt.txt b/Documentation/devicetree/bindings/c6x/interrupt.txt
new file mode 100644 (file)
index 0000000..42bb796
--- /dev/null
@@ -0,0 +1,104 @@
+C6X Interrupt Chips
+-------------------
+
+* C64X+ Core Interrupt Controller
+
+  The core interrupt controller provides 16 prioritized interrupts to the
+  C64X+ core. Priority 0 and 1 are used for reset and NMI respectively.
+  Priority 2 and 3 are reserved. Priority 4-15 are used for interrupt
+  sources coming from outside the core.
+
+  Required properties:
+  --------------------
+  - compatible: Should be "ti,c64x+core-pic";
+  - #interrupt-cells: <1>
+
+  Interrupt Specifier Definition
+  ------------------------------
+  Single cell specifying the core interrupt priority level (4-15) where
+  4 is highest priority and 15 is lowest priority.
+
+  Example
+  -------
+  core_pic: interrupt-controller@0 {
+       interrupt-controller;
+       #interrupt-cells = <1>;
+       compatible = "ti,c64x+core-pic";
+  };
+
+
+
+* C64x+ Megamodule Interrupt Controller
+
+  The megamodule PIC consists of four interrupt mupliplexers each of which
+  combine up to 32 interrupt inputs into a single interrupt output which
+  may be cascaded into the core interrupt controller. The megamodule PIC
+  has a total of 12 outputs cascading into the core interrupt controller.
+  One for each core interrupt priority level. In addition to the combined
+  interrupt sources, individual megamodule interrupts may be cascaded to
+  the core interrupt controller. When an individual interrupt is cascaded,
+  it is no longer handled through a megamodule interrupt combiner and is
+  considered to have the core interrupt controller as the parent.
+
+  Required properties:
+  --------------------
+  - compatible: "ti,c64x+megamod-pic"
+  - interrupt-controller
+  - #interrupt-cells: <1>
+  - reg: base address and size of register area
+  - interrupt-parent: must be core interrupt controller
+  - interrupts: This should have four cells; one for each interrupt combiner.
+                The cells contain the core priority interrupt to which the
+                corresponding combiner output is wired.
+
+  Optional properties:
+  --------------------
+  - ti,c64x+megamod-pic-mux: Array of 12 cells correspnding to the 12 core
+                             priority interrupts. The first cell corresponds to
+                             core priority 4 and the last cell corresponds to
+                             core priority 15. The value of each cell is the
+                             megamodule interrupt source which is MUXed to
+                             the core interrupt corresponding to the cell
+                             position. Allowed values are 4 - 127. Mapping for
+                             interrupts 0 - 3 (combined interrupt sources) are
+                             ignored.
+
+  Interrupt Specifier Definition
+  ------------------------------
+  Single cell specifying the megamodule interrupt source (4-127). Note that
+  interrupts mapped directly to the core with "ti,c64x+megamod-pic-mux" will
+  use the core interrupt controller as their parent and the specifier will
+  be the core priority level, not the megamodule interrupt number.
+
+  Examples
+  --------
+  megamod_pic: interrupt-controller@1800000 {
+       compatible = "ti,c64x+megamod-pic";
+       interrupt-controller;
+       #interrupt-cells = <1>;
+       reg = <0x1800000 0x1000>;
+       interrupt-parent = <&core_pic>;
+       interrupts = < 12 13 14 15 >;
+  };
+
+  This is a minimal example where all individual interrupts go through a
+  combiner. Combiner-0 is mapped to core interrupt 12, combiner-1 is mapped
+  to interrupt 13, etc.
+
+
+  megamod_pic: interrupt-controller@1800000 {
+       compatible = "ti,c64x+megamod-pic";
+       interrupt-controller;
+       #interrupt-cells = <1>;
+       reg = <0x1800000 0x1000>;
+       interrupt-parent = <&core_pic>;
+       interrupts = < 12 13 14 15 >;
+       ti,c64x+megamod-pic-mux = <  0  0  0  0
+                                    32  0  0  0
+                                     0  0  0  0 >;
+  };
+
+  This the same as the first example except that megamodule interrupt 32 is
+  mapped directly to core priority interrupt 8. The node using this interrupt
+  must set the core controller as its interrupt parent and use 8 in the
+  interrupt specifier value.
diff --git a/Documentation/devicetree/bindings/c6x/soc.txt b/Documentation/devicetree/bindings/c6x/soc.txt
new file mode 100644 (file)
index 0000000..b1e4973
--- /dev/null
@@ -0,0 +1,28 @@
+C6X System-on-Chip
+------------------
+
+Required properties:
+
+- compatible: "simple-bus"
+- #address-cells: must be 1
+- #size-cells: must be 1
+- ranges
+
+Optional properties:
+
+- model: specific SoC model
+
+- nodes for IP blocks within SoC
+
+
+Example:
+
+       soc {
+               compatible = "simple-bus";
+               model = "tms320c6455";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               ...
+       };
diff --git a/Documentation/devicetree/bindings/c6x/timer64.txt b/Documentation/devicetree/bindings/c6x/timer64.txt
new file mode 100644 (file)
index 0000000..95911fe
--- /dev/null
@@ -0,0 +1,26 @@
+Timer64
+-------
+
+The timer64 node describes C6X event timers.
+
+Required properties:
+
+- compatible: must be "ti,c64x+timer64"
+- reg: base address and size of register region
+- interrupt-parent: interrupt controller
+- interrupts: interrupt id
+
+Optional properties:
+
+- ti,dscr-dev-enable: Device ID used to enable timer IP through DSCR interface.
+
+- ti,core-mask: on multi-core SoCs, bitmask of cores allowed to use this timer.
+
+Example:
+       timer0: timer@25e0000 {
+               compatible = "ti,c64x+timer64";
+               ti,core-mask = < 0x01 >;
+               reg = <0x25e0000 0x40>;
+               interrupt-parent = <&megamod_pic>;
+               interrupts = < 16 >;
+       };
diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt b/Documentation/devicetree/bindings/dma/arm-pl330.txt
new file mode 100644 (file)
index 0000000..a4cd273
--- /dev/null
@@ -0,0 +1,30 @@
+* ARM PrimeCell PL330 DMA Controller
+
+The ARM PrimeCell PL330 DMA controller can move blocks of memory contents
+between memory and peripherals or memory to memory.
+
+Required properties:
+  - compatible: should include both "arm,pl330" and "arm,primecell".
+  - reg: physical base address of the controller and length of memory mapped
+    region.
+  - interrupts: interrupt number to the cpu.
+
+Example:
+
+       pdma0: pdma@12680000 {
+               compatible = "arm,pl330", "arm,primecell";
+               reg = <0x12680000 0x1000>;
+               interrupts = <99>;
+       };
+
+Client drivers (device nodes requiring dma transfers from dev-to-mem or
+mem-to-dev) should specify the DMA channel numbers using a two-value pair
+as shown below.
+
+  [property name]  = <[phandle of the dma controller] [dma request id]>;
+
+      where 'dma request id' is the dma request number which is connected
+      to the client controller. The 'property name' is recommended to be
+      of the form <name>-dma-channel.
+
+  Example:  tx-dma-channel = <&pdma0 12>;
diff --git a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
new file mode 100644 (file)
index 0000000..8f50fe5
--- /dev/null
@@ -0,0 +1,40 @@
+Samsung Exynos4 GPIO Controller
+
+Required properties:
+- compatible: Compatible property value should be "samsung,exynos4-gpio>".
+
+- reg: Physical base address of the controller and length of memory mapped
+  region.
+
+- #gpio-cells: Should be 4. The syntax of the gpio specifier used by client nodes
+  should be the following with values derived from the SoC user manual.
+     <[phandle of the gpio controller node]
+      [pin number within the gpio controller]
+      [mux function]
+      [pull up/down]
+      [drive strength]>
+
+  Values for gpio specifier:
+  - Pin number: is a value between 0 to 7.
+  - Pull Up/Down: 0 - Pull Up/Down Disabled.
+                  1 - Pull Down Enabled.
+                  3 - Pull Up Enabled.
+  - Drive Strength: 0 - 1x,
+                    1 - 3x,
+                    2 - 2x,
+                    3 - 4x
+
+- gpio-controller: Specifies that the node is a gpio controller.
+- #address-cells: should be 1.
+- #size-cells: should be 1.
+
+Example:
+
+       gpa0: gpio-controller@11400000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "samsung,exynos4-gpio";
+               reg = <0x11400000 0x20>;
+               #gpio-cells = <4>;
+               gpio-controller;
+       };
diff --git a/Documentation/devicetree/bindings/input/samsung-keypad.txt b/Documentation/devicetree/bindings/input/samsung-keypad.txt
new file mode 100644 (file)
index 0000000..ce3e394
--- /dev/null
@@ -0,0 +1,88 @@
+* Samsung's Keypad Controller device tree bindings
+
+Samsung's Keypad controller is used to interface a SoC with a matrix-type
+keypad device. The keypad controller supports multiple row and column lines.
+A key can be placed at each intersection of a unique row and a unique column.
+The keypad controller can sense a key-press and key-release and report the
+event using a interrupt to the cpu.
+
+Required SoC Specific Properties:
+- compatible: should be one of the following
+  - "samsung,s3c6410-keypad": For controllers compatible with s3c6410 keypad
+    controller.
+  - "samsung,s5pv210-keypad": For controllers compatible with s5pv210 keypad
+    controller.
+
+- reg: physical base address of the controller and length of memory mapped
+  region.
+
+- interrupts: The interrupt number to the cpu.
+
+Required Board Specific Properties:
+- samsung,keypad-num-rows: Number of row lines connected to the keypad
+  controller.
+
+- samsung,keypad-num-columns: Number of column lines connected to the
+  keypad controller.
+
+- row-gpios: List of gpios used as row lines. The gpio specifier for
+  this property depends on the gpio controller to which these row lines
+  are connected.
+
+- col-gpios: List of gpios used as column lines. The gpio specifier for
+  this property depends on the gpio controller to which these column
+  lines are connected.
+
+- Keys represented as child nodes: Each key connected to the keypad
+  controller is represented as a child node to the keypad controller
+  device node and should include the following properties.
+  - keypad,row: the row number to which the key is connected.
+  - keypad,column: the column number to which the key is connected.
+  - linux,code: the key-code to be reported when the key is pressed
+    and released.
+
+Optional Properties specific to linux:
+- linux,keypad-no-autorepeat: do no enable autorepeat feature.
+- linux,keypad-wakeup: use any event on keypad as wakeup event.
+
+
+Example:
+       keypad@100A0000 {
+               compatible = "samsung,s5pv210-keypad";
+               reg = <0x100A0000 0x100>;
+               interrupts = <173>;
+               samsung,keypad-num-rows = <2>;
+               samsung,keypad-num-columns = <8>;
+               linux,input-no-autorepeat;
+               linux,input-wakeup;
+
+               row-gpios = <&gpx2 0 3 3 0
+                            &gpx2 1 3 3 0>;
+
+               col-gpios = <&gpx1 0 3 0 0
+                            &gpx1 1 3 0 0
+                            &gpx1 2 3 0 0
+                            &gpx1 3 3 0 0
+                            &gpx1 4 3 0 0
+                            &gpx1 5 3 0 0
+                            &gpx1 6 3 0 0
+                            &gpx1 7 3 0 0>;
+
+               key_1 {
+                       keypad,row = <0>;
+                       keypad,column = <3>;
+                       linux,code = <2>;
+               };
+
+               key_2 {
+                       keypad,row = <0>;
+                       keypad,column = <4>;
+                       linux,code = <3>;
+               };
+
+               key_3 {
+                       keypad,row = <0>;
+                       keypad,column = <5>;
+                       linux,code = <4>;
+               };
+       };
diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
new file mode 100644 (file)
index 0000000..90ec45f
--- /dev/null
@@ -0,0 +1,20 @@
+* Samsung's S3C Real Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
+    * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc.
+    * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 rtc.
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: Two interrupt numbers to the cpu should be specified. First
+  interrupt number is the rtc alarm interupt and second interrupt number
+  is the rtc tick interrupt. The number of cells representing a interrupt
+  depends on the parent interrupt controller.
+
+Example:
+
+       rtc@10070000 {
+               compatible = "samsung,s3c6410-rtc";
+               reg = <0x10070000 0x100>;
+               interrupts = <44 0 45 0>;
+       };
diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.txt b/Documentation/devicetree/bindings/serial/samsung_uart.txt
new file mode 100644 (file)
index 0000000..2c8a17c
--- /dev/null
@@ -0,0 +1,14 @@
+* Samsung's UART Controller
+
+The Samsung's UART controller is used for interfacing SoC with serial communicaion
+devices.
+
+Required properties:
+- compatible: should be
+  - "samsung,exynos4210-uart", for UART's compatible with Exynos4210 uart ports.
+
+- reg: base physical address of the controller and length of memory mapped
+  region.
+
+- interrupts: interrupt number to the cpu. The interrupt specifier format depends
+  on the interrupt controller parent.
diff --git a/Documentation/devicetree/bindings/usb/tegra-usb.txt b/Documentation/devicetree/bindings/usb/tegra-usb.txt
new file mode 100644 (file)
index 0000000..035d63d
--- /dev/null
@@ -0,0 +1,13 @@
+Tegra SOC USB controllers
+
+The device node for a USB controller that is part of a Tegra
+SOC is as described in the document "Open Firmware Recommended
+Practice : Universal Serial Bus" with the following modifications
+and additions :
+
+Required properties :
+ - compatible : Should be "nvidia,tegra20-ehci" for USB controllers
+   used in host mode.
+ - phy_type : Should be one of "ulpi" or "utmi".
+ - nvidia,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.
index b9db108f01c8ae2d27575ae73bb0206e361c028c..f107ead1910a927adff53b2396c5cb0809476601 100644 (file)
@@ -1661,6 +1661,14 @@ T:       git git://git.alsa-project.org/alsa-kernel.git
 S:     Maintained
 F:     sound/pci/oxygen/
 
+C6X ARCHITECTURE
+M:     Mark Salter <msalter@redhat.com>
+M:     Aurelien Jacquiot <a-jacquiot@ti.com>
+L:     linux-c6x-dev@linux-c6x.org
+W:     http://www.linux-c6x.org/wiki/index.php/Main_Page
+S:     Maintained
+F:     arch/c6x/
+
 CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
 M:     David Howells <dhowells@redhat.com>
 L:     linux-cachefs@redhat.com
index e084b7e981e8ff301aaae64ef3a2dc7e66701247..45fa94804e2f17ae88abf7fb854b941f7c517d47 100644 (file)
@@ -220,8 +220,9 @@ config NEED_MACH_MEMORY_H
          be avoided when possible.
 
 config PHYS_OFFSET
-       hex "Physical address of main memory"
+       hex "Physical address of main memory" if MMU
        depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
+       default DRAM_BASE if !MMU
        help
          Please provide the physical address corresponding to the
          location of main memory in your system.
@@ -591,6 +592,7 @@ config ARCH_MMP
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
+       select GPIO_PXA
        select HAVE_SCHED_CLOCK
        select TICK_ONESHOT
        select PLAT_PXA
@@ -673,6 +675,7 @@ config ARCH_PXA
        select CLKSRC_MMIO
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
+       select GPIO_PXA
        select HAVE_SCHED_CLOCK
        select TICK_ONESHOT
        select PLAT_PXA
@@ -1971,7 +1974,7 @@ endchoice
 
 config XIP_KERNEL
        bool "Kernel Execute-In-Place from ROM"
-       depends on !ZBOOT_ROM
+       depends on !ZBOOT_ROM && !ARM_LPAE
        help
          Execute-In-Place allows the kernel to run from non-volatile storage
          directly addressable by the CPU, such as NOR flash. This saves RAM
index c5213e78606b15efd4d9454dff34c674b6ff276b..e0d236d7ff7344b28291b37acae16169c955db8c 100644 (file)
@@ -100,6 +100,14 @@ choice
                  Note that the system will appear to hang during boot if there
                  is nothing connected to read from the DCC.
 
+       config AT91_DEBUG_LL_DBGU0
+               bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10 and 9rl"
+               depends on HAVE_AT91_DBGU0
+
+       config AT91_DEBUG_LL_DBGU1
+               bool "Kernel low-level debugging on 9263, 9g45 and cap9"
+               depends on HAVE_AT91_DBGU1
+
        config DEBUG_FOOTBRIDGE_COM1
                bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1"
                depends on FOOTBRIDGE
@@ -247,6 +255,43 @@ choice
                  their output to the standard serial port on the RealView
                  PB1176 platform.
 
+       config DEBUG_MSM_UART1
+               bool "Kernel low-level debugging messages via MSM UART1"
+               depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the first serial port on MSM devices.
+
+       config DEBUG_MSM_UART2
+               bool "Kernel low-level debugging messages via MSM UART2"
+               depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the second serial port on MSM devices.
+
+       config DEBUG_MSM_UART3
+               bool "Kernel low-level debugging messages via MSM UART3"
+               depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the third serial port on MSM devices.
+
+       config DEBUG_MSM8660_UART
+               bool "Kernel low-level debugging messages via MSM 8660 UART"
+               depends on ARCH_MSM8X60
+               select MSM_HAS_DEBUG_UART_HS
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the serial port on MSM 8660 devices.
+
+       config DEBUG_MSM8960_UART
+               bool "Kernel low-level debugging messages via MSM 8960 UART"
+               depends on ARCH_MSM8960
+               select MSM_HAS_DEBUG_UART_HS
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the serial port on MSM 8960 devices.
+
 endchoice
 
 config EARLY_PRINTK
index dfcf3b033e10b465ff44107c43cfa1141fd989f4..cf7d467267ad8beadaae5092b190074f6f8395ab 100644 (file)
@@ -160,7 +160,6 @@ machine-$(CONFIG_ARCH_MSM)          := msm
 machine-$(CONFIG_ARCH_MV78XX0)         := mv78xx0
 machine-$(CONFIG_ARCH_IMX_V4_V5)       := imx
 machine-$(CONFIG_ARCH_IMX_V6_V7)       := imx
-machine-$(CONFIG_ARCH_MX5)             := mx5
 machine-$(CONFIG_ARCH_MXS)             := mxs
 machine-$(CONFIG_ARCH_NETX)            := netx
 machine-$(CONFIG_ARCH_NOMADIK)         := nomadik
diff --git a/arch/arm/arm-soc-for-next-contents.txt b/arch/arm/arm-soc-for-next-contents.txt
new file mode 100644 (file)
index 0000000..85912eb
--- /dev/null
@@ -0,0 +1,19 @@
+This file lists all branches that are pulled into the for-next branch
+of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
+and their external dependencies.
+
+next/cleanup
+  at91/ioremap         git://github.com/at91linux/linux-at91.git for-arnd-3.3-ioremap
+  at91/gpio            git://github.com/at91linux/linux-at91.git for-arnd-3.3-gpio
+  msm/misc             git://codeaurora.org/quic/kernel/davidb/linux-msm.git msm-misc
+  drivers/macb-gem-cleanup     parts of drivers/macb-gem that at91/gpio depends on
+
+next/drivers
+  drivers/macb-gem     git://github.com/jamieiles/linux-2.6-ji.git macb-gem
+  drivers/pxa-gpio     git://github.com/hzhuang1/linux.git gpio
+
+next/timer
+  msm/timer            git://codeaurora.org/quic/kernel/davidb/linux-msm.git msm-timer
+
+next/move
+  imx/move             git://git.pengutronix.de/git/imx/linux-2.6.git mx5-merge
index c2effc91725452dcaa93af7b3dc1b0ce20d979c2..c5d60250d43daf44205cd830de3ca6ed941ed348 100644 (file)
@@ -659,6 +659,7 @@ __armv7_mmu_cache_on:
                mcrne   p15, 0, r3, c2, c0, 0   @ load page table pointer
                mcrne   p15, 0, r1, c3, c0, 0   @ load domain access control
 #endif
+               mcr     p15, 0, r0, c7, c5, 4   @ ISB
                mcr     p15, 0, r0, c1, c0, 0   @ load control register
                mrc     p15, 0, r0, c1, c0, 0   @ and read it back
                mov     r0, #0
diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts
new file mode 100644 (file)
index 0000000..b8c4763
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Samsung's Exynos4210 based Origen board device tree source
+ *
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2010-2011 Linaro Ltd.
+ *             www.linaro.org
+ *
+ * Device tree source file for Insignal's Origen board which is based on
+ * Samsung's Exynos4210 SoC.
+ *
+ * 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.
+*/
+
+/dts-v1/;
+/include/ "exynos4210.dtsi"
+
+/ {
+       model = "Insignal Origen evaluation board based on Exynos4210";
+       compatible = "insignal,origen", "samsung,exynos4210";
+
+       memory {
+               reg = <0x40000000 0x40000000>;
+       };
+
+       chosen {
+               bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
+       };
+
+       sdhci@12530000 {
+               samsung,sdhci-bus-width = <4>;
+               linux,mmc_cap_4_bit_data;
+               samsung,sdhci-cd-internal;
+               gpio-cd = <&gpk2 2 2 3 3>;
+               gpios = <&gpk2 0 2 0 3>,
+                       <&gpk2 1 2 0 3>,
+                       <&gpk2 3 2 3 3>,
+                       <&gpk2 4 2 3 3>,
+                       <&gpk2 5 2 3 3>,
+                       <&gpk2 6 2 3 3>;
+       };
+
+       sdhci@12510000 {
+               samsung,sdhci-bus-width = <4>;
+               linux,mmc_cap_4_bit_data;
+               samsung,sdhci-cd-internal;
+               gpio-cd = <&gpk0 2 2 3 3>;
+               gpios = <&gpk0 0 2 0 3>,
+                       <&gpk0 1 2 0 3>,
+                       <&gpk0 3 2 3 3>,
+                       <&gpk0 4 2 3 3>,
+                       <&gpk0 5 2 3 3>,
+                       <&gpk0 6 2 3 3>;
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               up {
+                       label = "Up";
+                       gpios = <&gpx2 0 0 0 2>;
+                       linux,code = <103>;
+               };
+
+               down {
+                       label = "Down";
+                       gpios = <&gpx2 1 0 0 2>;
+                       linux,code = <108>;
+               };
+
+               back {
+                       label = "Back";
+                       gpios = <&gpx1 7 0 0 2>;
+                       linux,code = <158>;
+               };
+
+               home {
+                       label = "Home";
+                       gpios = <&gpx1 6 0 0 2>;
+                       linux,code = <102>;
+               };
+
+               menu {
+                       label = "Menu";
+                       gpios = <&gpx1 5 0 0 2>;
+                       linux,code = <139>;
+               };
+       };
+
+       keypad@100A0000 {
+               status = "disabled";
+       };
+
+       sdhci@12520000 {
+               status = "disabled";
+       };
+
+       sdhci@12540000 {
+               status = "disabled";
+       };
+
+       i2c@13860000 {
+               status = "disabled";
+       };
+
+       i2c@13870000 {
+               status = "disabled";
+       };
+
+       i2c@13880000 {
+               status = "disabled";
+       };
+
+       i2c@13890000 {
+               status = "disabled";
+       };
+
+       i2c@138A0000 {
+               status = "disabled";
+       };
+
+       i2c@138B0000 {
+               status = "disabled";
+       };
+
+       i2c@138C0000 {
+               status = "disabled";
+       };
+
+       i2c@138D0000 {
+               status = "disabled";
+       };
+};
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts
new file mode 100644 (file)
index 0000000..27afc8e
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Samsung's Exynos4210 based SMDKV310 board device tree source
+ *
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2010-2011 Linaro Ltd.
+ *             www.linaro.org
+ *
+ * Device tree source file for Samsung's SMDKV310 board which is based on
+ * Samsung's Exynos4210 SoC.
+ *
+ * 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.
+*/
+
+/dts-v1/;
+/include/ "exynos4210.dtsi"
+
+/ {
+       model = "Samsung smdkv310 evaluation board based on Exynos4210";
+       compatible = "samsung,smdkv310", "samsung,exynos4210";
+
+       memory {
+               reg = <0x40000000 0x80000000>;
+       };
+
+       chosen {
+               bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
+       };
+
+       sdhci@12530000 {
+               samsung,sdhci-bus-width = <4>;
+               linux,mmc_cap_4_bit_data;
+               samsung,sdhci-cd-internal;
+               gpio-cd = <&gpk2 2 2 3 3>;
+               gpios = <&gpk2 0 2 0 3>,
+                       <&gpk2 1 2 0 3>,
+                       <&gpk2 3 2 3 3>,
+                       <&gpk2 4 2 3 3>,
+                       <&gpk2 5 2 3 3>,
+                       <&gpk2 6 2 3 3>;
+       };
+
+       keypad@100A0000 {
+               samsung,keypad-num-rows = <2>;
+               samsung,keypad-num-columns = <8>;
+               linux,keypad-no-autorepeat;
+               linux,keypad-wakeup;
+
+               row-gpios = <&gpx2 0 3 3 0>,
+                           <&gpx2 1 3 3 0>;
+
+               col-gpios = <&gpx1 0 3 0 0>,
+                           <&gpx1 1 3 0 0>,
+                           <&gpx1 2 3 0 0>,
+                           <&gpx1 3 3 0 0>,
+                           <&gpx1 4 3 0 0>,
+                           <&gpx1 5 3 0 0>,
+                           <&gpx1 6 3 0 0>,
+                           <&gpx1 7 3 0 0>;
+
+               key_1 {
+                       keypad,row = <0>;
+                       keypad,column = <3>;
+                       linux,code = <2>;
+               };
+
+               key_2 {
+                       keypad,row = <0>;
+                       keypad,column = <4>;
+                       linux,code = <3>;
+               };
+
+               key_3 {
+                       keypad,row = <0>;
+                       keypad,column = <5>;
+                       linux,code = <4>;
+               };
+
+               key_4 {
+                       keypad,row = <0>;
+                       keypad,column = <6>;
+                       linux,code = <5>;
+               };
+
+               key_5 {
+                       keypad,row = <0>;
+                       keypad,column = <7>;
+                       linux,code = <6>;
+               };
+
+               key_a {
+                       keypad,row = <1>;
+                       keypad,column = <3>;
+                       linux,code = <30>;
+               };
+
+               key_b {
+                       keypad,row = <1>;
+                       keypad,column = <4>;
+                       linux,code = <48>;
+               };
+
+               key_c {
+                       keypad,row = <1>;
+                       keypad,column = <5>;
+                       linux,code = <46>;
+               };
+
+               key_d {
+                       keypad,row = <1>;
+                       keypad,column = <6>;
+                       linux,code = <32>;
+               };
+
+               key_e {
+                       keypad,row = <1>;
+                       keypad,column = <7>;
+                       linux,code = <18>;
+               };
+       };
+
+       i2c@13860000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               samsung,i2c-sda-delay = <100>;
+               samsung,i2c-max-bus-freq = <20000>;
+               gpios = <&gpd1 0 2 3 0>,
+                       <&gpd1 1 2 3 0>;
+
+               eeprom@50 {
+                       compatible = "samsung,24ad0xd1";
+                       reg = <0x50>;
+               };
+
+               eeprom@52 {
+                       compatible = "samsung,24ad0xd1";
+                       reg = <0x52>;
+               };
+       };
+
+       sdhci@12510000 {
+               status = "disabled";
+       };
+
+       sdhci@12520000 {
+               status = "disabled";
+       };
+
+       sdhci@12540000 {
+               status = "disabled";
+       };
+
+       i2c@13870000 {
+               status = "disabled";
+       };
+
+       i2c@13880000 {
+               status = "disabled";
+       };
+
+       i2c@13890000 {
+               status = "disabled";
+       };
+
+       i2c@138A0000 {
+               status = "disabled";
+       };
+
+       i2c@138B0000 {
+               status = "disabled";
+       };
+
+       i2c@138C0000 {
+               status = "disabled";
+       };
+
+       i2c@138D0000 {
+               status = "disabled";
+       };
+};
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi
new file mode 100644 (file)
index 0000000..63d7578
--- /dev/null
@@ -0,0 +1,397 @@
+/*
+ * Samsung's Exynos4210 SoC device tree source
+ *
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2010-2011 Linaro Ltd.
+ *             www.linaro.org
+ *
+ * Samsung's Exynos4210 SoC device nodes are listed in this file. Exynos4210
+ * based board files can include this file and provide values for board specfic
+ * bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in
+ * Exynos4210 SoC. As device tree coverage for Exynos4210 increases, additional
+ * nodes can be added to this file.
+ *
+ * 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/ "skeleton.dtsi"
+
+/ {
+       compatible = "samsung,exynos4210";
+       interrupt-parent = <&gic>;
+
+       gic:interrupt-controller@10490000 {
+               compatible = "arm,cortex-a9-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x10490000 0x1000>, <0x10480000 0x100>;
+       };
+
+       watchdog@10060000 {
+               compatible = "samsung,s3c2410-wdt";
+               reg = <0x10060000 0x100>;
+               interrupts = <0 43 0>;
+       };
+
+       rtc@10070000 {
+               compatible = "samsung,s3c6410-rtc";
+               reg = <0x10070000 0x100>;
+               interrupts = <0 44 0>, <0 45 0>;
+       };
+
+       keypad@100A0000 {
+               compatible = "samsung,s5pv210-keypad";
+               reg = <0x100A0000 0x100>;
+               interrupts = <0 109 0>;
+       };
+
+       sdhci@12510000 {
+               compatible = "samsung,exynos4210-sdhci";
+               reg = <0x12510000 0x100>;
+               interrupts = <0 73 0>;
+       };
+
+       sdhci@12520000 {
+               compatible = "samsung,exynos4210-sdhci";
+               reg = <0x12520000 0x100>;
+               interrupts = <0 74 0>;
+       };
+
+       sdhci@12530000 {
+               compatible = "samsung,exynos4210-sdhci";
+               reg = <0x12530000 0x100>;
+               interrupts = <0 75 0>;
+       };
+
+       sdhci@12540000 {
+               compatible = "samsung,exynos4210-sdhci";
+               reg = <0x12540000 0x100>;
+               interrupts = <0 76 0>;
+       };
+
+       serial@13800000 {
+               compatible = "samsung,exynos4210-uart";
+               reg = <0x13800000 0x100>;
+               interrupts = <0 52 0>;
+       };
+
+       serial@13810000 {
+               compatible = "samsung,exynos4210-uart";
+               reg = <0x13810000 0x100>;
+               interrupts = <0 53 0>;
+       };
+
+       serial@13820000 {
+               compatible = "samsung,exynos4210-uart";
+               reg = <0x13820000 0x100>;
+               interrupts = <0 54 0>;
+       };
+
+       serial@13830000 {
+               compatible = "samsung,exynos4210-uart";
+               reg = <0x13830000 0x100>;
+               interrupts = <0 55 0>;
+       };
+
+       i2c@13860000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x13860000 0x100>;
+               interrupts = <0 58 0>;
+       };
+
+       i2c@13870000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x13870000 0x100>;
+               interrupts = <0 59 0>;
+       };
+
+       i2c@13880000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x13880000 0x100>;
+               interrupts = <0 60 0>;
+       };
+
+       i2c@13890000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x13890000 0x100>;
+               interrupts = <0 61 0>;
+       };
+
+       i2c@138A0000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x138A0000 0x100>;
+               interrupts = <0 62 0>;
+       };
+
+       i2c@138B0000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x138B0000 0x100>;
+               interrupts = <0 63 0>;
+       };
+
+       i2c@138C0000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x138C0000 0x100>;
+               interrupts = <0 64 0>;
+       };
+
+       i2c@138D0000 {
+               compatible = "samsung,s3c2440-i2c";
+               reg = <0x138D0000 0x100>;
+               interrupts = <0 65 0>;
+       };
+
+       amba {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "arm,amba-bus";
+               interrupt-parent = <&gic>;
+               ranges;
+
+               pdma0: pdma@12680000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x12680000 0x1000>;
+                       interrupts = <0 35 0>;
+               };
+
+               pdma1: pdma@12690000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x12690000 0x1000>;
+                       interrupts = <0 36 0>;
+               };
+       };
+
+       gpio-controllers {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               gpio-controller;
+               ranges;
+
+               gpa0: gpio-controller@11400000 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400000 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpa1: gpio-controller@11400020 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400020 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpb: gpio-controller@11400040 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400040 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpc0: gpio-controller@11400060 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400060 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpc1: gpio-controller@11400080 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400080 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpd0: gpio-controller@114000A0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x114000A0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpd1: gpio-controller@114000C0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x114000C0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpe0: gpio-controller@114000E0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x114000E0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpe1: gpio-controller@11400100 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400100 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpe2: gpio-controller@11400120 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400120 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpe3: gpio-controller@11400140 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400140 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpe4: gpio-controller@11400160 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400160 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpf0: gpio-controller@11400180 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11400180 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpf1: gpio-controller@114001A0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x114001A0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpf2: gpio-controller@114001C0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x114001C0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpf3: gpio-controller@114001E0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x114001E0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpj0: gpio-controller@11000000 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000000 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpj1: gpio-controller@11000020 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000020 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpk0: gpio-controller@11000040 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000040 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpk1: gpio-controller@11000060 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000060 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpk2: gpio-controller@11000080 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000080 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpk3: gpio-controller@110000A0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x110000A0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpl0: gpio-controller@110000C0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x110000C0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpl1: gpio-controller@110000E0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x110000E0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpl2: gpio-controller@11000100 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000100 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpy0: gpio-controller@11000120 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000120 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpy1: gpio-controller@11000140 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000140 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpy2: gpio-controller@11000160 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000160 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpy3: gpio-controller@11000180 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000180 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpy4: gpio-controller@110001A0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x110001A0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpy5: gpio-controller@110001C0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x110001C0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpy6: gpio-controller@110001E0 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x110001E0 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpx0: gpio-controller@11000C00 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000C00 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpx1: gpio-controller@11000C20 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000C20 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpx2: gpio-controller@11000C40 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000C40 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpx3: gpio-controller@11000C60 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x11000C60 0x20>;
+                       #gpio-cells = <4>;
+               };
+
+               gpz: gpio-controller@03860000 {
+                       compatible = "samsung,exynos4-gpio";
+                       reg = <0x03860000 0x20>;
+                       #gpio-cells = <4>;
+               };
+       };
+};
index 0e225b86b6520ab944432b5ab312e7d3f08813d9..80afa1b70b80d6ed448692a5434014fa36e910f8 100644 (file)
@@ -1,16 +1,11 @@
 /dts-v1/;
 
-/memreserve/ 0x1c000000 0x04000000;
 /include/ "tegra20.dtsi"
 
 / {
        model = "NVIDIA Tegra2 Harmony evaluation board";
        compatible = "nvidia,harmony", "nvidia,tegra20";
 
-       chosen {
-               bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootwait";
-       };
-
        memory@0 {
                reg = < 0x00000000 0x40000000 >;
        };
                ext-mic-en-gpios = <&gpio 185 0>;
        };
 
+       serial@70006000 {
+               status = "disable";
+       };
+
+       serial@70006040 {
+               status = "disable";
+       };
+
+       serial@70006200 {
+               status = "disable";
+       };
+
        serial@70006300 {
                clock-frequency = < 216000000 >;
        };
 
+       serial@70006400 {
+               status = "disable";
+       };
+
+       sdhci@c8000000 {
+               status = "disable";
+       };
+
        sdhci@c8000200 {
                cd-gpios = <&gpio 69 0>; /* gpio PI5 */
                wp-gpios = <&gpio 57 0>; /* gpio PH1 */
                power-gpios = <&gpio 155 0>; /* gpio PT3 */
        };
 
+       sdhci@c8000400 {
+               status = "disable";
+       };
+
        sdhci@c8000600 {
                cd-gpios = <&gpio 58 0>; /* gpio PH2 */
                wp-gpios = <&gpio 59 0>; /* gpio PH3 */
diff --git a/arch/arm/boot/dts/tegra-paz00.dts b/arch/arm/boot/dts/tegra-paz00.dts
new file mode 100644 (file)
index 0000000..1a1d702
--- /dev/null
@@ -0,0 +1,77 @@
+/dts-v1/;
+
+/include/ "tegra20.dtsi"
+
+/ {
+       model = "Toshiba AC100 / Dynabook AZ";
+       compatible = "compal,paz00", "nvidia,tegra20";
+
+       memory@0 {
+               reg = <0x00000000 0x20000000>;
+       };
+
+       i2c@7000c000 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c400 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c500 {
+               status = "disable";
+       };
+
+       nvec@7000c500 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "nvidia,nvec";
+               reg = <0x7000C500 0x100>;
+               interrupts = <0 92 0x04>;
+               clock-frequency = <80000>;
+               request-gpios = <&gpio 170 0>;
+               slave-addr = <138>;
+       };
+
+       i2c@7000d000 {
+               clock-frequency = <400000>;
+       };
+
+       serial@70006000 {
+               clock-frequency = <216000000>;
+       };
+
+       serial@70006040 {
+               status = "disable";
+       };
+
+       serial@70006200 {
+               status = "disable";
+       };
+
+       serial@70006300 {
+               clock-frequency = <216000000>;
+       };
+
+       serial@70006400 {
+               status = "disable";
+       };
+
+       sdhci@c8000000 {
+               cd-gpios = <&gpio 173 0>; /* gpio PV5 */
+               wp-gpios = <&gpio 57 0>;  /* gpio PH1 */
+               power-gpios = <&gpio 155 0>; /* gpio PT3 */
+       };
+
+       sdhci@c8000200 {
+               status = "disable";
+       };
+
+       sdhci@c8000400 {
+               status = "disable";
+       };
+
+       sdhci@c8000600 {
+               support-8bit;
+       };
+};
index a72299b8e66857b43c1ac2ec4a2c709df6562b2a..f552bcc0441279856dab4f36a403002a936eb217 100644 (file)
@@ -1,25 +1,60 @@
 /dts-v1/;
 
-/memreserve/ 0x1c000000 0x04000000;
 /include/ "tegra20.dtsi"
 
 / {
        model = "NVIDIA Seaboard";
        compatible = "nvidia,seaboard", "nvidia,tegra20";
 
-       chosen {
-               bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk1p3 rw rootwait";
-       };
-
        memory {
                device_type = "memory";
                reg = < 0x00000000 0x40000000 >;
        };
 
+       i2c@7000c000 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c400 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c500 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000d000 {
+               clock-frequency = <400000>;
+       };
+
+       serial@70006000 {
+               status = "disable";
+       };
+
+       serial@70006040 {
+               status = "disable";
+       };
+
+       serial@70006200 {
+               status = "disable";
+       };
+
        serial@70006300 {
                clock-frequency = < 216000000 >;
        };
 
+       serial@70006400 {
+               status = "disable";
+       };
+
+       sdhci@c8000000 {
+               status = "disable";
+       };
+
+       sdhci@c8000200 {
+               status = "disable";
+       };
+
        sdhci@c8000400 {
                cd-gpios = <&gpio 69 0>; /* gpio PI5 */
                wp-gpios = <&gpio 57 0>; /* gpio PH1 */
@@ -29,4 +64,8 @@
        sdhci@c8000600 {
                support-8bit;
        };
+
+       usb@c5000000 {
+               nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */
+       };
 };
diff --git a/arch/arm/boot/dts/tegra-trimslice.dts b/arch/arm/boot/dts/tegra-trimslice.dts
new file mode 100644 (file)
index 0000000..3b3ee7d
--- /dev/null
@@ -0,0 +1,65 @@
+/dts-v1/;
+
+/include/ "tegra20.dtsi"
+
+/ {
+       model = "Compulab TrimSlice board";
+       compatible = "compulab,trimslice", "nvidia,tegra20";
+
+       memory@0 {
+               reg = < 0x00000000 0x40000000 >;
+       };
+
+       i2c@7000c000 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c400 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c500 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000d000 {
+               status = "disable";
+       };
+
+       serial@70006000 {
+               clock-frequency = < 216000000 >;
+       };
+
+       serial@70006040 {
+               status = "disable";
+       };
+
+       serial@70006200 {
+               status = "disable";
+       };
+
+       serial@70006300 {
+               status = "disable";
+       };
+
+       serial@70006400 {
+               status = "disable";
+       };
+
+       sdhci@c8000000 {
+               status = "disable";
+       };
+
+       sdhci@c8000200 {
+               status = "disable";
+       };
+
+       sdhci@c8000400 {
+               status = "disable";
+       };
+
+       sdhci@c8000600 {
+               cd-gpios = <&gpio 121 0>;
+               wp-gpios = <&gpio 122 0>;
+       };
+};
index 3f9abd6b6964546014490a3942abce3675e6e254..c7d3b87f29dfe0458f047cf64e1dc4f23d5758f9 100644 (file)
@@ -1,24 +1,59 @@
 /dts-v1/;
 
-/memreserve/ 0x1c000000 0x04000000;
 /include/ "tegra20.dtsi"
 
 / {
        model = "NVIDIA Tegra2 Ventana evaluation board";
        compatible = "nvidia,ventana", "nvidia,tegra20";
 
-       chosen {
-               bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/ram rdinit=/sbin/init";
-       };
-
        memory {
                reg = < 0x00000000 0x40000000 >;
        };
 
+       i2c@7000c000 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c400 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000c500 {
+               clock-frequency = <400000>;
+       };
+
+       i2c@7000d000 {
+               clock-frequency = <400000>;
+       };
+
+       serial@70006000 {
+               status = "disable";
+       };
+
+       serial@70006040 {
+               status = "disable";
+       };
+
+       serial@70006200 {
+               status = "disable";
+       };
+
        serial@70006300 {
                clock-frequency = < 216000000 >;
        };
 
+       serial@70006400 {
+               status = "disable";
+       };
+
+       sdhci@c8000000 {
+               status = "disable";
+       };
+
+       sdhci@c8000200 {
+               status = "disable";
+       };
+
        sdhci@c8000400 {
                cd-gpios = <&gpio 69 0>; /* gpio PI5 */
                wp-gpios = <&gpio 57 0>; /* gpio PH1 */
index 65d7e6a333eb8214ae5b21607d325e8db84935e1..660c8ad537c01917b13dde8ed8117d9972fba92d 100644 (file)
@@ -5,9 +5,9 @@
        interrupt-parent = <&intc>;
 
        intc: interrupt-controller@50041000 {
-               compatible = "nvidia,tegra20-gic";
+               compatible = "arm,cortex-a9-gic";
                interrupt-controller;
-               #interrupt-cells = <1>;
+               #interrupt-cells = <3>;
                reg = < 0x50041000 0x1000 >,
                      < 0x50040100 0x0100 >;
        };
@@ -17,7 +17,7 @@
                #size-cells = <0>;
                compatible = "nvidia,tegra20-i2c";
                reg = <0x7000C000 0x100>;
-               interrupts = < 70 >;
+               interrupts = < 0 38 0x04 >;
        };
 
        i2c@7000c400 {
@@ -25,7 +25,7 @@
                #size-cells = <0>;
                compatible = "nvidia,tegra20-i2c";
                reg = <0x7000C400 0x100>;
-               interrupts = < 116 >;
+               interrupts = < 0 84 0x04 >;
        };
 
        i2c@7000c500 {
@@ -33,7 +33,7 @@
                #size-cells = <0>;
                compatible = "nvidia,tegra20-i2c";
                reg = <0x7000C500 0x100>;
-               interrupts = < 124 >;
+               interrupts = < 0 92 0x04 >;
        };
 
        i2c@7000d000 {
                #size-cells = <0>;
                compatible = "nvidia,tegra20-i2c";
                reg = <0x7000D000 0x200>;
-               interrupts = < 85 >;
+               interrupts = < 0 53 0x04 >;
        };
 
        i2s@70002800 {
-               #address-cells = <1>;
-               #size-cells = <0>;
                compatible = "nvidia,tegra20-i2s";
                reg = <0x70002800 0x200>;
-               interrupts = < 45 >;
+               interrupts = < 0 13 0x04 >;
                dma-channel = < 2 >;
        };
 
        i2s@70002a00 {
-               #address-cells = <1>;
-               #size-cells = <0>;
                compatible = "nvidia,tegra20-i2s";
                reg = <0x70002a00 0x200>;
-               interrupts = < 35 >;
+               interrupts = < 0 3 0x04 >;
                dma-channel = < 1 >;
        };
 
        das@70000c00 {
-               #address-cells = <1>;
-               #size-cells = <0>;
                compatible = "nvidia,tegra20-das";
                reg = <0x70000c00 0x80>;
        };
        gpio: gpio@6000d000 {
                compatible = "nvidia,tegra20-gpio";
                reg = < 0x6000d000 0x1000 >;
-               interrupts = < 64 65 66 67 87 119 121 >;
+               interrupts = < 0 32 0x04
+                              0 33 0x04
+                              0 34 0x04
+                              0 35 0x04
+                              0 55 0x04
+                              0 87 0x04
+                              0 89 0x04 >;
                #gpio-cells = <2>;
                gpio-controller;
        };
                compatible = "nvidia,tegra20-uart";
                reg = <0x70006000 0x40>;
                reg-shift = <2>;
-               interrupts = < 68 >;
+               interrupts = < 0 36 0x04 >;
        };
 
        serial@70006040 {
                compatible = "nvidia,tegra20-uart";
                reg = <0x70006040 0x40>;
                reg-shift = <2>;
-               interrupts = < 69 >;
+               interrupts = < 0 37 0x04 >;
        };
 
        serial@70006200 {
                compatible = "nvidia,tegra20-uart";
                reg = <0x70006200 0x100>;
                reg-shift = <2>;
-               interrupts = < 78 >;
+               interrupts = < 0 46 0x04 >;
        };
 
        serial@70006300 {
                compatible = "nvidia,tegra20-uart";
                reg = <0x70006300 0x100>;
                reg-shift = <2>;
-               interrupts = < 122 >;
+               interrupts = < 0 90 0x04 >;
        };
 
        serial@70006400 {
                compatible = "nvidia,tegra20-uart";
                reg = <0x70006400 0x100>;
                reg-shift = <2>;
-               interrupts = < 123 >;
+               interrupts = < 0 91 0x04 >;
        };
 
        sdhci@c8000000 {
                compatible = "nvidia,tegra20-sdhci";
                reg = <0xc8000000 0x200>;
-               interrupts = < 46 >;
+               interrupts = < 0 14 0x04 >;
        };
 
        sdhci@c8000200 {
                compatible = "nvidia,tegra20-sdhci";
                reg = <0xc8000200 0x200>;
-               interrupts = < 47 >;
+               interrupts = < 0 15 0x04 >;
        };
 
        sdhci@c8000400 {
                compatible = "nvidia,tegra20-sdhci";
                reg = <0xc8000400 0x200>;
-               interrupts = < 51 >;
+               interrupts = < 0 19 0x04 >;
        };
 
        sdhci@c8000600 {
                compatible = "nvidia,tegra20-sdhci";
                reg = <0xc8000600 0x200>;
-               interrupts = < 63 >;
+               interrupts = < 0 31 0x04 >;
+       };
+
+       usb@c5000000 {
+               compatible = "nvidia,tegra20-ehci", "usb-ehci";
+               reg = <0xc5000000 0x4000>;
+               interrupts = < 0 20 0x04 >;
+               phy_type = "utmi";
+       };
+
+       usb@c5004000 {
+               compatible = "nvidia,tegra20-ehci", "usb-ehci";
+               reg = <0xc5004000 0x4000>;
+               interrupts = < 0 21 0x04 >;
+               phy_type = "ulpi";
+       };
+
+       usb@c5008000 {
+               compatible = "nvidia,tegra20-ehci", "usb-ehci";
+               reg = <0xc5008000 0x4000>;
+               interrupts = < 0 97 0x04 >;
+               phy_type = "utmi";
        };
 };
 
index 74df9ca2be316e2df49f164df3ec680366a41a6b..81a933eb0903bf446c4722bd645aa2ec0573bf47 100644 (file)
@@ -1,8 +1,14 @@
 config ARM_GIC
        select IRQ_DOMAIN
+       select MULTI_IRQ_HANDLER
+       bool
+
+config GIC_NON_BANKED
        bool
 
 config ARM_VIC
+       select IRQ_DOMAIN
+       select MULTI_IRQ_HANDLER
        bool
 
 config ARM_VIC_NR
index 410a546060a2eecf82859d76c528223e8796f9f4..b2dc2dd7f1df6d25fbba306e0822563883b18859 100644 (file)
 #include <linux/slab.h>
 
 #include <asm/irq.h>
+#include <asm/exception.h>
 #include <asm/mach/irq.h>
 #include <asm/hardware/gic.h>
 
-static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+union gic_base {
+       void __iomem *common_base;
+       void __percpu __iomem **percpu_base;
+};
 
-/* Address of GIC 0 CPU interface */
-void __iomem *gic_cpu_base_addr __read_mostly;
+struct gic_chip_data {
+       unsigned int irq_offset;
+       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
+#ifdef CONFIG_IRQ_DOMAIN
+       struct irq_domain domain;
+#endif
+       unsigned int gic_irqs;
+#ifdef CONFIG_GIC_NON_BANKED
+       void __iomem *(*get_base)(union gic_base *);
+#endif
+};
+
+static DEFINE_RAW_SPINLOCK(irq_controller_lock);
 
 /*
  * Supported arch specific GIC irq extension.
@@ -67,16 +90,48 @@ struct irq_chip gic_arch_extn = {
 
 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;
+       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;
+       return gic_data_cpu_base(gic_data);
 }
 
 static inline unsigned int gic_irq(struct irq_data *d)
@@ -215,6 +270,32 @@ static int gic_set_wake(struct irq_data *d, unsigned int on)
 #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_domain_to_irq(&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);
@@ -225,7 +306,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
        chained_irq_enter(chip, desc);
 
        raw_spin_lock(&irq_controller_lock);
-       status = readl_relaxed(chip_data->cpu_base + GIC_CPU_INTACK);
+       status = readl_relaxed(gic_data_cpu_base(chip_data) + GIC_CPU_INTACK);
        raw_spin_unlock(&irq_controller_lock);
 
        gic_irq = (status & 0x3ff);
@@ -270,7 +351,7 @@ static void __init gic_dist_init(struct gic_chip_data *gic)
        u32 cpumask;
        unsigned int gic_irqs = gic->gic_irqs;
        struct irq_domain *domain = &gic->domain;
-       void __iomem *base = gic->dist_base;
+       void __iomem *base = gic_data_dist_base(gic);
        u32 cpu = 0;
 
 #ifdef CONFIG_SMP
@@ -330,8 +411,8 @@ static void __init gic_dist_init(struct gic_chip_data *gic)
 
 static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
 {
-       void __iomem *dist_base = gic->dist_base;
-       void __iomem *base = gic->cpu_base;
+       void __iomem *dist_base = gic_data_dist_base(gic);
+       void __iomem *base = gic_data_cpu_base(gic);
        int i;
 
        /*
@@ -368,7 +449,7 @@ static void gic_dist_save(unsigned int gic_nr)
                BUG();
 
        gic_irqs = gic_data[gic_nr].gic_irqs;
-       dist_base = gic_data[gic_nr].dist_base;
+       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
 
        if (!dist_base)
                return;
@@ -403,7 +484,7 @@ static void gic_dist_restore(unsigned int gic_nr)
                BUG();
 
        gic_irqs = gic_data[gic_nr].gic_irqs;
-       dist_base = gic_data[gic_nr].dist_base;
+       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
 
        if (!dist_base)
                return;
@@ -439,8 +520,8 @@ static void gic_cpu_save(unsigned int gic_nr)
        if (gic_nr >= MAX_GIC_NR)
                BUG();
 
-       dist_base = gic_data[gic_nr].dist_base;
-       cpu_base = gic_data[gic_nr].cpu_base;
+       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;
@@ -465,8 +546,8 @@ static void gic_cpu_restore(unsigned int gic_nr)
        if (gic_nr >= MAX_GIC_NR)
                BUG();
 
-       dist_base = gic_data[gic_nr].dist_base;
-       cpu_base = gic_data[gic_nr].cpu_base;
+       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;
@@ -491,6 +572,11 @@ 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);
@@ -564,8 +650,9 @@ const struct irq_domain_ops gic_irq_domain_ops = {
 #endif
 };
 
-void __init gic_init(unsigned int gic_nr, int irq_start,
-       void __iomem *dist_base, void __iomem *cpu_base)
+void __init gic_init_bases(unsigned int gic_nr, int irq_start,
+                          void __iomem *dist_base, void __iomem *cpu_base,
+                          u32 percpu_offset)
 {
        struct gic_chip_data *gic;
        struct irq_domain *domain;
@@ -575,8 +662,36 @@ void __init gic_init(unsigned int gic_nr, int irq_start,
 
        gic = &gic_data[gic_nr];
        domain = &gic->domain;
-       gic->dist_base = dist_base;
-       gic->cpu_base = cpu_base;
+#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);
+       }
 
        /*
         * For primary GICs, skip over SGIs.
@@ -584,8 +699,6 @@ void __init gic_init(unsigned int gic_nr, int irq_start,
         */
        domain->hwirq_base = 32;
        if (gic_nr == 0) {
-               gic_cpu_base_addr = cpu_base;
-
                if ((irq_start & 31) > 0) {
                        domain->hwirq_base = 16;
                        if (irq_start != -1)
@@ -597,7 +710,7 @@ void __init gic_init(unsigned int gic_nr, int irq_start,
         * Find out how many interrupts are supported.
         * The GIC only supports up to 1020 interrupt sources.
         */
-       gic_irqs = readl_relaxed(dist_base + GIC_DIST_CTR) & 0x1f;
+       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;
@@ -645,7 +758,7 @@ void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
        dsb();
 
        /* this always happens on GIC0 */
-       writel_relaxed(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT);
+       writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
 }
 #endif
 
@@ -656,6 +769,7 @@ 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;
        struct irq_domain *domain = &gic_data[gic_cnt].domain;
 
@@ -668,9 +782,12 @@ int __init gic_of_init(struct device_node *node, struct device_node *parent)
        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;
+
        domain->of_node = of_node_get(node);
 
-       gic_init(gic_cnt, -1, dist_base, cpu_base);
+       gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset);
 
        if (parent) {
                irq = irq_of_parse_and_map(node, 0);
index 01f18a421b17c6e20c6b0bf07a10c75378accc02..77287504c8b40e31e3789d1e27dcc824003b2af6 100644 (file)
  * 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>
 
-#ifdef CONFIG_PM
 /**
  * struct vic_device - VIC PM device
  * @irq: The IRQ number for the base of the VIC.
@@ -40,6 +45,7 @@
  * @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;
@@ -50,13 +56,13 @@ struct vic_device {
        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;
-#endif /* CONFIG_PM */
 
 /**
  * vic_init2 - common initialisation code
@@ -156,39 +162,50 @@ static int __init vic_pm_init(void)
        return 0;
 }
 late_initcall(vic_pm_init);
+#endif /* CONFIG_PM */
 
 /**
- * vic_pm_register - Register a VIC for later power management control
+ * vic_register() - Register a VIC.
  * @base: The base address of the VIC.
  * @irq: The base IRQ for the VIC.
  * @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_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources)
+static void __init vic_register(void __iomem *base, unsigned int irq,
+                               u32 resume_sources, struct device_node *node)
 {
        struct vic_device *v;
 
-       if (vic_id >= ARRAY_SIZE(vic_devices))
+       if (vic_id >= ARRAY_SIZE(vic_devices)) {
                printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
-       else {
-               v = &vic_devices[vic_id];
-               v->base = base;
-               v->resume_sources = resume_sources;
-               v->irq = irq;
-               vic_id++;
+               return;
        }
+
+       v = &vic_devices[vic_id];
+       v->base = base;
+       v->resume_sources = resume_sources;
+       v->irq = irq;
+       vic_id++;
+
+       v->domain.irq_base = irq;
+       v->domain.nr_irq = 32;
+#ifdef CONFIG_OF_IRQ
+       v->domain.of_node = of_node_get(node);
+       v->domain.ops = &irq_domain_simple_ops;
+#endif /* CONFIG_OF */
+       irq_domain_add(&v->domain);
 }
-#else
-static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }
-#endif /* CONFIG_PM */
 
 static void vic_ack_irq(struct irq_data *d)
 {
        void __iomem *base = irq_data_get_irq_chip_data(d);
-       unsigned int irq = d->irq & 31;
+       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);
@@ -197,14 +214,14 @@ static void vic_ack_irq(struct irq_data *d)
 static void vic_mask_irq(struct irq_data *d)
 {
        void __iomem *base = irq_data_get_irq_chip_data(d);
-       unsigned int irq = d->irq & 31;
+       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->irq & 31;
+       unsigned int irq = d->hwirq;
        writel(1 << irq, base + VIC_INT_ENABLE);
 }
 
@@ -226,7 +243,7 @@ static struct vic_device *vic_from_irq(unsigned int irq)
 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->irq & 31;
+       unsigned int off = d->hwirq;
        u32 bit = 1 << off;
 
        if (!v)
@@ -301,7 +318,7 @@ static void __init vic_set_irq_sources(void __iomem *base,
  *  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)
+                              u32 vic_sources, struct device_node *node)
 {
        unsigned int i;
        int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
@@ -328,17 +345,12 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
        }
 
        vic_set_irq_sources(base, irq_start, vic_sources);
+       vic_register(base, irq_start, 0, 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)
+static void __init __vic_init(void __iomem *base, unsigned int irq_start,
+                             u32 vic_sources, u32 resume_sources,
+                             struct device_node *node)
 {
        unsigned int i;
        u32 cellid = 0;
@@ -356,7 +368,7 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
 
        switch(vendor) {
        case AMBA_VENDOR_ST:
-               vic_init_st(base, irq_start, vic_sources);
+               vic_init_st(base, irq_start, vic_sources, node);
                return;
        default:
                printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
@@ -375,5 +387,81 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
 
        vic_set_irq_sources(base, irq_start, vic_sources);
 
-       vic_pm_register(base, irq_start, resume_sources);
+       vic_register(base, irq_start, 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;
+       int irq_base;
+
+       if (WARN(parent, "non-root VICs are not supported"))
+               return -EINVAL;
+
+       regs = of_iomap(node, 0);
+       if (WARN_ON(!regs))
+               return -EIO;
+
+       irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
+       if (WARN_ON(irq_base < 0))
+               goto out_unmap;
+
+       __vic_init(regs, irq_base, ~0, ~0, node);
+
+       return 0;
+
+ out_unmap:
+       iounmap(regs);
+
+       return -EIO;
+}
+#endif /* CONFIG OF */
+
+/*
+ * Handle each interrupt in a single VIC.  Returns non-zero if we've
+ * handled at least one interrupt.  This does a single read of the
+ * status register and handles all interrupts in order from LSB first.
+ */
+static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
+{
+       u32 stat, irq;
+       int handled = 0;
+
+       stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
+       while (stat) {
+               irq = ffs(stat) - 1;
+               handle_IRQ(irq_domain_to_irq(&vic->domain, irq), regs);
+               stat &= ~(1 << irq);
+               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);
 }
similarity index 80%
rename from arch/arm/configs/mx5_defconfig
rename to arch/arm/configs/imx_v6_v7_defconfig
index d0d8dfece37ee7073023b7ea3f1fade5ffebc1d0..3a4fb2e5fc68fb53c54467d466da94d295703f72 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_KERNEL_LZO=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=18
+CONFIG_CGROUPS=y
 CONFIG_RELAY=y
 CONFIG_EXPERT=y
 # CONFIG_SLUB_DEBUG is not set
@@ -14,20 +15,31 @@ CONFIG_MODULE_SRCVERSION_ALL=y
 # CONFIG_LBDAF is not set
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_MXC=y
-CONFIG_ARCH_MX5=y
-CONFIG_MACH_MX51_BABBAGE=y
+CONFIG_MACH_MX31LILLY=y
+CONFIG_MACH_MX31LITE=y
+CONFIG_MACH_PCM037=y
+CONFIG_MACH_PCM037_EET=y
+CONFIG_MACH_MX31_3DS=y
+CONFIG_MACH_MX31MOBOARD=y
+CONFIG_MACH_QONG=y
+CONFIG_MACH_ARMADILLO5X0=y
+CONFIG_MACH_KZM_ARM11_01=y
+CONFIG_MACH_PCM043=y
+CONFIG_MACH_MX35_3DS=y
+CONFIG_MACH_EUKREA_CPUIMX35=y
+CONFIG_MACH_VPR200=y
+CONFIG_MACH_IMX51_DT=y
 CONFIG_MACH_MX51_3DS=y
 CONFIG_MACH_EUKREA_CPUIMX51=y
 CONFIG_MACH_EUKREA_CPUIMX51SD=y
 CONFIG_MACH_MX51_EFIKAMX=y
 CONFIG_MACH_MX51_EFIKASB=y
-CONFIG_MACH_MX53_EVK=y
-CONFIG_MACH_MX53_SMD=y
-CONFIG_MACH_MX53_LOCO=y
-CONFIG_MACH_MX53_ARD=y
+CONFIG_MACH_IMX53_DT=y
+CONFIG_SOC_IMX6Q=y
 CONFIG_MXC_PWM=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_SMP=y
 CONFIG_VMSPLIT_2G=y
 CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_AEABI=y
@@ -49,7 +61,7 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
-# CONFIG_IPV6 is not set
+CONFIG_IPV6=y
 # CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
@@ -68,24 +80,20 @@ CONFIG_SCSI_SCAN_ASYNC=y
 CONFIG_ATA=y
 CONFIG_PATA_IMX=y
 CONFIG_NETDEVICES=y
-CONFIG_MII=m
-CONFIG_MARVELL_PHY=y
-CONFIG_DAVICOM_PHY=y
-CONFIG_QSEMI_PHY=y
-CONFIG_LXT_PHY=y
-CONFIG_CICADA_PHY=y
-CONFIG_VITESSE_PHY=y
-CONFIG_SMSC_PHY=y
-CONFIG_BROADCOM_PHY=y
-CONFIG_ICPLUS_PHY=y
-CONFIG_REALTEK_PHY=y
-CONFIG_NATIONAL_PHY=y
-CONFIG_STE10XP=y
-CONFIG_LSI_ET1011C_PHY=y
-CONFIG_MICREL_PHY=y
-CONFIG_NET_ETHERNET=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CHELSIO is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+CONFIG_FEC=y
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+CONFIG_SMC91X=y
+CONFIG_SMC911X=y
+CONFIG_SMSC911X=y
+# CONFIG_NET_VENDOR_STMICRO is not set
 # CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=y
@@ -124,7 +132,6 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_MXC=y
 CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
-CONFIG_MMC_BLOCK=m
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_SDHCI_ESDHC_IMX=y
@@ -133,6 +140,8 @@ CONFIG_LEDS_CLASS=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_INTF_DEV_UIE_EMUL=y
 CONFIG_RTC_MXC=y
+CONFIG_DMADEVICES=y
+CONFIG_IMX_SDMA=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
diff --git a/arch/arm/configs/mx3_defconfig b/arch/arm/configs/mx3_defconfig
deleted file mode 100644 (file)
index cb0717f..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-CONFIG_EXPERIMENTAL=y
-CONFIG_SYSVIPC=y
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EXPERT=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_ARCH_MXC=y
-CONFIG_MACH_MX31ADS_WM1133_EV1=y
-CONFIG_MACH_MX31LILLY=y
-CONFIG_MACH_MX31LITE=y
-CONFIG_MACH_PCM037=y
-CONFIG_MACH_PCM037_EET=y
-CONFIG_MACH_MX31_3DS=y
-CONFIG_MACH_MX31MOBOARD=y
-CONFIG_MACH_QONG=y
-CONFIG_MACH_ARMADILLO5X0=y
-CONFIG_MACH_KZM_ARM11_01=y
-CONFIG_MACH_PCM043=y
-CONFIG_MACH_MX35_3DS=y
-CONFIG_MACH_EUKREA_CPUIMX35=y
-CONFIG_MXC_IRQ_PRIOR=y
-CONFIG_MXC_PWM=y
-CONFIG_ARM_ERRATA_411920=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="noinitrd console=ttymxc0,115200 root=/dev/mtdblock2 rw ip=off"
-CONFIG_VFP=y
-CONFIG_PM_DEBUG=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_LRO is not set
-# CONFIG_INET_DIAG is not set
-# CONFIG_IPV6 is not set
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_FW_LOADER=m
-CONFIG_MTD=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_MXC=y
-CONFIG_MTD_UBI=y
-# CONFIG_BLK_DEV is not set
-CONFIG_MISC_DEVICES=y
-CONFIG_EEPROM_AT24=y
-CONFIG_NETDEVICES=y
-CONFIG_SMSC_PHY=y
-CONFIG_NET_ETHERNET=y
-CONFIG_SMSC911X=y
-CONFIG_DNET=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_KEYBOARD_ATKBD is not set
-CONFIG_KEYBOARD_IMX=y
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-# CONFIG_VT is not set
-# CONFIG_LEGACY_PTYS is not set
-CONFIG_SERIAL_8250=m
-CONFIG_SERIAL_8250_EXTENDED=y
-CONFIG_SERIAL_8250_SHARE_IRQ=y
-CONFIG_SERIAL_IMX=y
-CONFIG_SERIAL_IMX_CONSOLE=y
-# CONFIG_HW_RANDOM is not set
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_IMX=y
-CONFIG_SPI=y
-CONFIG_W1=y
-CONFIG_W1_MASTER_MXC=y
-CONFIG_W1_SLAVE_THERM=y
-# CONFIG_HWMON is not set
-CONFIG_WATCHDOG=y
-CONFIG_IMX2_WDT=y
-CONFIG_MFD_WM8350_I2C=y
-CONFIG_REGULATOR=y
-CONFIG_REGULATOR_WM8350=y
-CONFIG_MEDIA_SUPPORT=y
-CONFIG_VIDEO_DEV=y
-# CONFIG_RC_CORE is not set
-# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
-CONFIG_SOC_CAMERA=y
-CONFIG_SOC_CAMERA_MT9M001=y
-CONFIG_SOC_CAMERA_MT9M111=y
-CONFIG_SOC_CAMERA_MT9T031=y
-CONFIG_SOC_CAMERA_MT9V022=y
-CONFIG_SOC_CAMERA_TW9910=y
-CONFIG_SOC_CAMERA_OV772X=y
-CONFIG_VIDEO_MX3=y
-# CONFIG_RADIO_ADAPTERS is not set
-CONFIG_FB=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-# CONFIG_SND_ARM is not set
-# CONFIG_SND_SPI is not set
-CONFIG_SND_SOC=y
-CONFIG_SND_IMX_SOC=y
-CONFIG_SND_MXC_SOC_WM1133_EV1=y
-CONFIG_SND_SOC_PHYCORE_AC97=y
-CONFIG_SND_SOC_EUKREA_TLV320=y
-CONFIG_USB=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_MXC=y
-CONFIG_USB_GADGET=m
-CONFIG_USB_FSL_USB2=m
-CONFIG_USB_G_SERIAL=m
-CONFIG_USB_ULPI=y
-CONFIG_MMC=y
-CONFIG_MMC_MXC=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_MXC=y
-CONFIG_DMADEVICES=y
-# CONFIG_DNOTIFY is not set
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_UBIFS_FS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_NFS_V4=y
-CONFIG_ROOT_NFS=y
-# CONFIG_ENABLE_WARN_DEPRECATED is not set
-# CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_SYSCTL_SYSCALL_CHECK=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
index 945a34f2a34dbd9e711ac440500d1e17cfad2ac0..dde2a1af7b39bd73cec54cf22417a9e53920f792 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_MACH_SX1=y
 CONFIG_MACH_NOKIA770=y
 CONFIG_MACH_AMS_DELTA=y
 CONFIG_MACH_OMAP_GENERIC=y
-CONFIG_OMAP_ARM_182MHZ=y
 # CONFIG_ARM_THUMB is not set
 CONFIG_PCCARD=y
 CONFIG_OMAP_CF=y
index 29035e86a59db0d4c46ab315a9350780dbfe2999..b6e65dedfd716db5e336451868af811e34a684dc 100644 (file)
 #define ALT_UP_B(label) b label
 #endif
 
+/*
+ * Instruction barrier
+ */
+       .macro  instr_sync
+#if __LINUX_ARM_ARCH__ >= 7
+       isb
+#elif __LINUX_ARM_ARCH__ == 6
+       mcr     p15, 0, r0, c7, c5, 4
+#endif
+       .endm
+
 /*
  * SMP data memory barrier
  */
diff --git a/arch/arm/include/asm/cti.h b/arch/arm/include/asm/cti.h
new file mode 100644 (file)
index 0000000..a0ada3e
--- /dev/null
@@ -0,0 +1,179 @@
+#ifndef __ASMARM_CTI_H
+#define __ASMARM_CTI_H
+
+#include       <asm/io.h>
+
+/* The registers' definition is from section 3.2 of
+ * Embedded Cross Trigger Revision: r0p0
+ */
+#define                CTICONTROL              0x000
+#define                CTISTATUS               0x004
+#define                CTILOCK                 0x008
+#define                CTIPROTECTION           0x00C
+#define                CTIINTACK               0x010
+#define                CTIAPPSET               0x014
+#define                CTIAPPCLEAR             0x018
+#define                CTIAPPPULSE             0x01c
+#define                CTIINEN                 0x020
+#define                CTIOUTEN                0x0A0
+#define                CTITRIGINSTATUS         0x130
+#define                CTITRIGOUTSTATUS        0x134
+#define                CTICHINSTATUS           0x138
+#define                CTICHOUTSTATUS          0x13c
+#define                CTIPERIPHID0            0xFE0
+#define                CTIPERIPHID1            0xFE4
+#define                CTIPERIPHID2            0xFE8
+#define                CTIPERIPHID3            0xFEC
+#define                CTIPCELLID0             0xFF0
+#define                CTIPCELLID1             0xFF4
+#define                CTIPCELLID2             0xFF8
+#define                CTIPCELLID3             0xFFC
+
+/* The below are from section 3.6.4 of
+ * CoreSight v1.0 Architecture Specification
+ */
+#define                LOCKACCESS              0xFB0
+#define                LOCKSTATUS              0xFB4
+
+/* write this value to LOCKACCESS will unlock the module, and
+ * other value will lock the module
+ */
+#define                LOCKCODE                0xC5ACCE55
+
+/**
+ * struct cti - cross trigger interface struct
+ * @base: mapped virtual address for the cti base
+ * @irq: irq number for the cti
+ * @trig_out_for_irq: triger out number which will cause
+ *     the @irq happen
+ *
+ * cti struct used to operate cti registers.
+ */
+struct cti {
+       void __iomem *base;
+       int irq;
+       int trig_out_for_irq;
+};
+
+/**
+ * cti_init - initialize the cti instance
+ * @cti: cti instance
+ * @base: mapped virtual address for the cti base
+ * @irq: irq number for the cti
+ * @trig_out: triger out number which will cause
+ *     the @irq happen
+ *
+ * called by machine code to pass the board dependent
+ * @base, @irq and @trig_out to cti.
+ */
+static inline void cti_init(struct cti *cti,
+       void __iomem *base, int irq, int trig_out)
+{
+       cti->base = base;
+       cti->irq  = irq;
+       cti->trig_out_for_irq = trig_out;
+}
+
+/**
+ * cti_map_trigger - use the @chan to map @trig_in to @trig_out
+ * @cti: cti instance
+ * @trig_in: trigger in number
+ * @trig_out: trigger out number
+ * @channel: channel number
+ *
+ * This function maps one trigger in of @trig_in to one trigger
+ * out of @trig_out using the channel @chan.
+ */
+static inline void cti_map_trigger(struct cti *cti,
+       int trig_in, int trig_out, int chan)
+{
+       void __iomem *base = cti->base;
+       unsigned long val;
+
+       val = __raw_readl(base + CTIINEN + trig_in * 4);
+       val |= BIT(chan);
+       __raw_writel(val, base + CTIINEN + trig_in * 4);
+
+       val = __raw_readl(base + CTIOUTEN + trig_out * 4);
+       val |= BIT(chan);
+       __raw_writel(val, base + CTIOUTEN + trig_out * 4);
+}
+
+/**
+ * cti_enable - enable the cti module
+ * @cti: cti instance
+ *
+ * enable the cti module
+ */
+static inline void cti_enable(struct cti *cti)
+{
+       __raw_writel(0x1, cti->base + CTICONTROL);
+}
+
+/**
+ * cti_disable - disable the cti module
+ * @cti: cti instance
+ *
+ * enable the cti module
+ */
+static inline void cti_disable(struct cti *cti)
+{
+       __raw_writel(0, cti->base + CTICONTROL);
+}
+
+/**
+ * cti_irq_ack - clear the cti irq
+ * @cti: cti instance
+ *
+ * clear the cti irq
+ */
+static inline void cti_irq_ack(struct cti *cti)
+{
+       void __iomem *base = cti->base;
+       unsigned long val;
+
+       val = __raw_readl(base + CTIINTACK);
+       val |= BIT(cti->trig_out_for_irq);
+       __raw_writel(val, base + CTIINTACK);
+}
+
+/**
+ * cti_unlock - unlock cti module
+ * @cti: cti instance
+ *
+ * unlock the cti module, or else any writes to the cti
+ * module is not allowed.
+ */
+static inline void cti_unlock(struct cti *cti)
+{
+       void __iomem *base = cti->base;
+       unsigned long val;
+
+       val = __raw_readl(base + LOCKSTATUS);
+
+       if (val & 1) {
+               val = LOCKCODE;
+               __raw_writel(val, base + LOCKACCESS);
+       }
+}
+
+/**
+ * cti_lock - lock cti module
+ * @cti: cti instance
+ *
+ * lock the cti module, so any writes to the cti
+ * module will be not allowed.
+ */
+static inline void cti_lock(struct cti *cti)
+{
+       void __iomem *base = cti->base;
+       unsigned long val;
+
+       val = __raw_readl(base + LOCKSTATUS);
+
+       if (!(val & 1)) {
+               val = ~LOCKCODE;
+               __raw_writel(val, base + LOCKACCESS);
+       }
+}
+#endif
diff --git a/arch/arm/include/asm/edac.h b/arch/arm/include/asm/edac.h
new file mode 100644 (file)
index 0000000..0df7a2c
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2011 Calxeda, Inc.
+ * Based on PPC version Copyright 2007 MontaVista Software, Inc.
+ *
+ * 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/>.
+ */
+#ifndef ASM_EDAC_H
+#define ASM_EDAC_H
+/*
+ * ECC atomic, DMA, SMP and interrupt safe scrub function.
+ * Implements the per arch atomic_scrub() that EDAC use for software
+ * ECC scrubbing.  It reads memory and then writes back the original
+ * value, allowing the hardware to detect and correct memory errors.
+ */
+static inline void atomic_scrub(void *va, u32 size)
+{
+#if __LINUX_ARM_ARCH__ >= 6
+       unsigned int *virt_addr = va;
+       unsigned int temp, temp2;
+       unsigned int i;
+
+       for (i = 0; i < size / sizeof(*virt_addr); i++, virt_addr++) {
+               /* Very carefully read and write to memory atomically
+                * so we are interrupt, DMA and SMP safe.
+                */
+               __asm__ __volatile__("\n"
+                       "1:     ldrex   %0, [%2]\n"
+                       "       strex   %1, %0, [%2]\n"
+                       "       teq     %1, #0\n"
+                       "       bne     1b\n"
+                       : "=&r"(temp), "=&r"(temp2)
+                       : "r"(virt_addr)
+                       : "cc");
+       }
+#endif
+}
+
+#endif
diff --git a/arch/arm/include/asm/entry-macro-vic2.S b/arch/arm/include/asm/entry-macro-vic2.S
deleted file mode 100644 (file)
index 3ceb85e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* arch/arm/include/asm/entry-macro-vic2.S
- *
- * Originally arch/arm/mach-s3c6400/include/mach/entry-macro.S
- *
- * Copyright 2008 Openmoko, Inc.
- * Copyright 2008 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Low-level IRQ helper macros for a device with two VICs
- *
- * 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.
-*/
-
-/* This should be included from <mach/entry-macro.S> with the necessary
- * defines for virtual addresses and IRQ bases for the two vics.
- *
- * The code needs the following defined:
- *     IRQ_VIC0_BASE   IRQ number of VIC0's first IRQ
- *     IRQ_VIC1_BASE   IRQ number of VIC1's first IRQ
- *     VA_VIC0         Virtual address of VIC0
- *     VA_VIC1         Virtual address of VIC1
- *
- * Note, code assumes VIC0's virtual address is an ARM immediate constant
- * away from VIC1.
-*/
-
-#include <asm/hardware/vic.h>
-
-       .macro  disable_fiq
-       .endm
-
-       .macro  get_irqnr_preamble, base, tmp
-       ldr     \base, =VA_VIC0
-       .endm
-
-       .macro  arch_ret_to_user, tmp1, tmp2
-       .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-
-       @ check the vic0
-       mov     \irqnr, #IRQ_VIC0_BASE + 31
-       ldr     \irqstat, [ \base, # VIC_IRQ_STATUS ]
-       teq     \irqstat, #0
-
-       @ otherwise try vic1
-       addeq   \tmp, \base, #(VA_VIC1 - VA_VIC0)
-       addeq   \irqnr, \irqnr, #(IRQ_VIC1_BASE - IRQ_VIC0_BASE)
-       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
-       teqeq   \irqstat, #0
-
-       clzne   \irqstat, \irqstat
-       subne   \irqnr, \irqnr, \irqstat
-       .endm
index ddf07a92a6c8484029927aa51fa09816ce38c337..436e60b2cf7a1bad5893ef33e3efac1791cb7ef5 100644 (file)
@@ -27,23 +27,6 @@ u64 smp_irq_stat_cpu(unsigned int cpu);
 
 #define arch_irq_stat_cpu      smp_irq_stat_cpu
 
-#if NR_IRQS > 512
-#define HARDIRQ_BITS   10
-#elif NR_IRQS > 256
-#define HARDIRQ_BITS   9
-#else
-#define HARDIRQ_BITS   8
-#endif
-
-/*
- * The hardirq mask has to be large enough to have space
- * for potentially all IRQ sources in the system nesting
- * on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 #define __ARCH_IRQ_EXIT_IRQS_DISABLED  1
 
 #endif /* __ASM_HARDIRQ_H */
diff --git a/arch/arm/include/asm/hardware/entry-macro-gic.S b/arch/arm/include/asm/hardware/entry-macro-gic.S
deleted file mode 100644 (file)
index 74ebc80..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * arch/arm/include/asm/hardware/entry-macro-gic.S
- *
- * Low-level IRQ helper macros for GIC
- *
- * 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 <asm/hardware/gic.h>
-
-#ifndef HAVE_GET_IRQNR_PREAMBLE
-       .macro  get_irqnr_preamble, base, tmp
-       ldr     \base, =gic_cpu_base_addr
-       ldr     \base, [\base]
-       .endm
-#endif
-
-/*
- * The interrupt numbering scheme is defined in the
- * interrupt controller spec.  To wit:
- *
- * Interrupts 0-15 are IPI
- * 16-31 are local.  We allow 30 to be used for the watchdog.
- * 32-1020 are global
- * 1021-1022 are reserved
- * 1023 is "spurious" (no interrupt)
- *
- * A simple read from the controller will tell us the number of the highest
- * priority enabled interrupt.  We then just need to check whether it is in the
- * valid range for an IRQ (30-1020 inclusive).
- */
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-
-       ldr     \irqstat, [\base, #GIC_CPU_INTACK]
-       /* bits 12-10 = src CPU, 9-0 = int # */
-
-       ldr     \tmp, =1021
-       bic     \irqnr, \irqstat, #0x1c00
-       cmp     \irqnr, #15
-       cmpcc   \irqnr, \irqnr
-       cmpne   \irqnr, \tmp
-       cmpcs   \irqnr, \irqnr
-       .endm
-
-/* We assume that irqstat (the raw value of the IRQ acknowledge
- * register) is preserved from the macro above.
- * If there is an IPI, we immediately signal end of interrupt on the
- * controller, since this requires the original irqstat value which
- * we won't easily be able to recreate later.
- */
-
-       .macro test_for_ipi, irqnr, irqstat, base, tmp
-       bic     \irqnr, \irqstat, #0x1c00
-       cmp     \irqnr, #16
-       strcc   \irqstat, [\base, #GIC_CPU_EOI]
-       cmpcs   \irqnr, \irqnr
-       .endm
index 3e91f22046f55d602550c1a0961312f2c9d4ba33..4bdfe0018696610f30fdfc41d197bd6c096d9777 100644 (file)
 #include <linux/irqdomain.h>
 struct device_node;
 
-extern void __iomem *gic_cpu_base_addr;
 extern struct irq_chip gic_arch_extn;
 
-void gic_init(unsigned int, int, void __iomem *, void __iomem *);
+void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
+                   u32 offset);
 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);
 
-struct gic_chip_data {
-       void __iomem *dist_base;
-       void __iomem *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
-#ifdef CONFIG_IRQ_DOMAIN
-       struct irq_domain domain;
-#endif
-       unsigned int gic_irqs;
-};
+static inline void gic_init(unsigned int nr, int start,
+                           void __iomem *dist , void __iomem *cpu)
+{
+       gic_init_bases(nr, start, dist, cpu, 0);
+}
+
 #endif
 
 #endif
index 5daea2961d48b42f34102697149ab505ea558b1e..077c32326c638755d5e195e1a5a9b09edfff2538 100644 (file)
@@ -234,6 +234,7 @@ extern int iop3xx_get_init_atu(void);
 void iop3xx_map_io(void);
 void iop_init_cp6_handler(void);
 void iop_init_time(unsigned long tickrate);
+void iop3xx_restart(char, const char *);
 
 static inline u32 read_tmr0(void)
 {
index 5d72550a809766cd98d6006221fd142af86cb815..f42ebd619590cf1fed99befda12624f074d16a08 100644 (file)
 #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, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
-#endif
+int vic_of_init(struct device_node *node, struct device_node *parent);
+void vic_handle_irq(struct pt_regs *regs);
 
+#endif /* __ASSEMBLY__ */
 #endif
diff --git a/arch/arm/include/asm/idmap.h b/arch/arm/include/asm/idmap.h
new file mode 100644 (file)
index 0000000..bf863ed
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __ASM_IDMAP_H
+#define __ASM_IDMAP_H
+
+#include <linux/compiler.h>
+#include <asm/pgtable.h>
+
+/* Tag a function as requiring to be executed via an identity mapping. */
+#define __idmap __section(.idmap.text) noinline notrace
+
+extern pgd_t *idmap_pgd;
+
+void setup_mm_for_reboot(void);
+
+#endif /* __ASM_IDMAP_H */
index 2b0efc3104ac6f73846fb89cdf0761c400676540..bcb0c883e21ed06aa18c9f48354314c877523a8b 100644 (file)
@@ -31,10 +31,10 @@ struct machine_desc {
        unsigned int            video_start;    /* start of video RAM   */
        unsigned int            video_end;      /* end of video RAM     */
 
-       unsigned int            reserve_lp0 :1; /* never has lp0        */
-       unsigned int            reserve_lp1 :1; /* never has lp1        */
-       unsigned int            reserve_lp2 :1; /* never has lp2        */
-       unsigned int            soft_reboot :1; /* soft reboot          */
+       unsigned char           reserve_lp0 :1; /* never has lp0        */
+       unsigned char           reserve_lp1 :1; /* never has lp1        */
+       unsigned char           reserve_lp2 :1; /* never has lp2        */
+       char                    restart_mode;   /* default restart mode */
        void                    (*fixup)(struct tag *, char **,
                                         struct meminfo *);
        void                    (*reserve)(void);/* reserve mem blocks  */
@@ -46,6 +46,7 @@ struct machine_desc {
 #ifdef CONFIG_MULTI_IRQ_HANDLER
        void                    (*handle_irq)(struct pt_regs *);
 #endif
+       void                    (*restart)(char, const char *);
 };
 
 /*
index ca94653f1ecbd7ebcbab8079db0d0b74de497ea8..97b440c25c5855977481a40ba18977f1f988dd09 100644 (file)
@@ -151,7 +151,11 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
 #define clear_page(page)       memset((void *)(page), 0, PAGE_SIZE)
 extern void copy_page(void *to, const void *from);
 
+#ifdef CONFIG_ARM_LPAE
+#include <asm/pgtable-3level-types.h>
+#else
 #include <asm/pgtable-2level-types.h>
+#endif
 
 #endif /* CONFIG_MMU */
 
index 0f8e3827a89b314aa47ea827e9d109cbeb8406d9..99cfe36079893101b382acf9a5fefd6279f206aa 100644 (file)
@@ -32,7 +32,4 @@ enum arm_perf_pmu_ids {
 extern enum arm_perf_pmu_ids
 armpmu_get_pmu_id(void);
 
-extern int
-armpmu_get_max_events(void);
-
 #endif /* __ARM_PERF_EVENT_H__ */
index 3e08fd3fbb6bc5772688b8001aebfb5ad1e16acd..943504f53f579e58c878165c595d5a110dae00ed 100644 (file)
 #define _PAGE_USER_TABLE       (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))
 #define _PAGE_KERNEL_TABLE     (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL))
 
+#ifdef CONFIG_ARM_LPAE
+
+static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
+{
+       return (pmd_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT);
+}
+
+static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
+{
+       BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
+       free_page((unsigned long)pmd);
+}
+
+static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
+{
+       set_pud(pud, __pud(__pa(pmd) | PMD_TYPE_TABLE));
+}
+
+#else  /* !CONFIG_ARM_LPAE */
+
 /*
  * Since we have only two-level page tables, these are trivial
  */
 #define pmd_alloc_one(mm,addr)         ({ BUG(); ((pmd_t *)2); })
 #define pmd_free(mm, pmd)              do { } while (0)
-#define pgd_populate(mm,pmd,pte)       BUG()
+#define pud_populate(mm,pmd,pte)       BUG()
+
+#endif /* CONFIG_ARM_LPAE */
 
 extern pgd_t *pgd_alloc(struct mm_struct *mm);
 extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
@@ -109,7 +131,9 @@ static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte,
 {
        pmdval_t pmdval = (pte + PTE_HWTABLE_OFF) | prot;
        pmdp[0] = __pmd(pmdval);
+#ifndef CONFIG_ARM_LPAE
        pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
+#endif
        flush_pmd_entry(pmdp);
 }
 
index 470457e1cfc5e121158037e6a1db6fead1eb3602..2317a71c8f8ec4c2cbc5404d96d1c3953877eda8 100644 (file)
 #define L_PTE_MT_DEV_CACHED    (_AT(pteval_t, 0x0b) << 2)      /* 1011 */
 #define L_PTE_MT_MASK          (_AT(pteval_t, 0x0f) << 2)
 
+#ifndef __ASSEMBLY__
+
+/*
+ * The "pud_xxx()" functions here are trivial when the pmd is folded into
+ * the pud: the pud entry is never bad, always exists, and can't be set or
+ * cleared.
+ */
+#define pud_none(pud)          (0)
+#define pud_bad(pud)           (0)
+#define pud_present(pud)       (1)
+#define pud_clear(pudp)                do { } while (0)
+#define set_pud(pud,pudp)      do { } while (0)
+
+static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
+{
+       return (pmd_t *)pud;
+}
+
+#define pmd_bad(pmd)           (pmd_val(pmd) & 2)
+
+#define copy_pmd(pmdpd,pmdps)          \
+       do {                            \
+               pmdpd[0] = pmdps[0];    \
+               pmdpd[1] = pmdps[1];    \
+               flush_pmd_entry(pmdpd); \
+       } while (0)
+
+#define pmd_clear(pmdp)                        \
+       do {                            \
+               pmdp[0] = __pmd(0);     \
+               pmdp[1] = __pmd(0);     \
+               clean_pmd_entry(pmdp);  \
+       } while (0)
+
+/* we don't need complex calculations here as the pmd is folded into the pgd */
+#define pmd_addr_end(addr,end) (end)
+
+#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
+
+#endif /* __ASSEMBLY__ */
+
 #endif /* _ASM_PGTABLE_2LEVEL_H */
diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h
new file mode 100644 (file)
index 0000000..d795282
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * arch/arm/include/asm/pgtable-3level-hwdef.h
+ *
+ * Copyright (C) 2011 ARM Ltd.
+ * Author: Catalin Marinas <catalin.marinas@arm.com>
+ *
+ * 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.
+ *
+ * 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_PGTABLE_3LEVEL_HWDEF_H
+#define _ASM_PGTABLE_3LEVEL_HWDEF_H
+
+/*
+ * Hardware page table definitions.
+ *
+ * + Level 1/2 descriptor
+ *   - common
+ */
+#define PMD_TYPE_MASK          (_AT(pmdval_t, 3) << 0)
+#define PMD_TYPE_FAULT         (_AT(pmdval_t, 0) << 0)
+#define PMD_TYPE_TABLE         (_AT(pmdval_t, 3) << 0)
+#define PMD_TYPE_SECT          (_AT(pmdval_t, 1) << 0)
+#define PMD_BIT4               (_AT(pmdval_t, 0))
+#define PMD_DOMAIN(x)          (_AT(pmdval_t, 0))
+
+/*
+ *   - section
+ */
+#define PMD_SECT_BUFFERABLE    (_AT(pmdval_t, 1) << 2)
+#define PMD_SECT_CACHEABLE     (_AT(pmdval_t, 1) << 3)
+#define PMD_SECT_S             (_AT(pmdval_t, 3) << 8)
+#define PMD_SECT_AF            (_AT(pmdval_t, 1) << 10)
+#define PMD_SECT_nG            (_AT(pmdval_t, 1) << 11)
+#define PMD_SECT_XN            (_AT(pmdval_t, 1) << 54)
+#define PMD_SECT_AP_WRITE      (_AT(pmdval_t, 0))
+#define PMD_SECT_AP_READ       (_AT(pmdval_t, 0))
+#define PMD_SECT_TEX(x)                (_AT(pmdval_t, 0))
+
+/*
+ * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).
+ */
+#define PMD_SECT_UNCACHED      (_AT(pmdval_t, 0) << 2) /* strongly ordered */
+#define PMD_SECT_BUFFERED      (_AT(pmdval_t, 1) << 2) /* normal non-cacheable */
+#define PMD_SECT_WT            (_AT(pmdval_t, 2) << 2) /* normal inner write-through */
+#define PMD_SECT_WB            (_AT(pmdval_t, 3) << 2) /* normal inner write-back */
+#define PMD_SECT_WBWA          (_AT(pmdval_t, 7) << 2) /* normal inner write-alloc */
+
+/*
+ * + Level 3 descriptor (PTE)
+ */
+#define PTE_TYPE_MASK          (_AT(pteval_t, 3) << 0)
+#define PTE_TYPE_FAULT         (_AT(pteval_t, 0) << 0)
+#define PTE_TYPE_PAGE          (_AT(pteval_t, 3) << 0)
+#define PTE_BUFFERABLE         (_AT(pteval_t, 1) << 2)         /* AttrIndx[0] */
+#define PTE_CACHEABLE          (_AT(pteval_t, 1) << 3)         /* AttrIndx[1] */
+#define PTE_EXT_SHARED         (_AT(pteval_t, 3) << 8)         /* SH[1:0], inner shareable */
+#define PTE_EXT_AF             (_AT(pteval_t, 1) << 10)        /* Access Flag */
+#define PTE_EXT_NG             (_AT(pteval_t, 1) << 11)        /* nG */
+#define PTE_EXT_XN             (_AT(pteval_t, 1) << 54)        /* XN */
+
+/*
+ * 40-bit physical address supported.
+ */
+#define PHYS_MASK_SHIFT                (40)
+#define PHYS_MASK              ((1ULL << PHYS_MASK_SHIFT) - 1)
+
+#endif
diff --git a/arch/arm/include/asm/pgtable-3level-types.h b/arch/arm/include/asm/pgtable-3level-types.h
new file mode 100644 (file)
index 0000000..921aa30
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * arch/arm/include/asm/pgtable-3level-types.h
+ *
+ * Copyright (C) 2011 ARM Ltd.
+ * Author: Catalin Marinas <catalin.marinas@arm.com>
+ *
+ * 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.
+ *
+ * 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_PGTABLE_3LEVEL_TYPES_H
+#define _ASM_PGTABLE_3LEVEL_TYPES_H
+
+#include <asm/types.h>
+
+typedef u64 pteval_t;
+typedef u64 pmdval_t;
+typedef u64 pgdval_t;
+
+#undef STRICT_MM_TYPECHECKS
+
+#ifdef STRICT_MM_TYPECHECKS
+
+/*
+ * These are used to make use of C type-checking..
+ */
+typedef struct { pteval_t pte; } pte_t;
+typedef struct { pmdval_t pmd; } pmd_t;
+typedef struct { pgdval_t pgd; } pgd_t;
+typedef struct { pteval_t pgprot; } pgprot_t;
+
+#define pte_val(x)      ((x).pte)
+#define pmd_val(x)      ((x).pmd)
+#define pgd_val(x)     ((x).pgd)
+#define pgprot_val(x)   ((x).pgprot)
+
+#define __pte(x)        ((pte_t) { (x) } )
+#define __pmd(x)        ((pmd_t) { (x) } )
+#define __pgd(x)       ((pgd_t) { (x) } )
+#define __pgprot(x)     ((pgprot_t) { (x) } )
+
+#else  /* !STRICT_MM_TYPECHECKS */
+
+typedef pteval_t pte_t;
+typedef pmdval_t pmd_t;
+typedef pgdval_t pgd_t;
+typedef pteval_t pgprot_t;
+
+#define pte_val(x)     (x)
+#define pmd_val(x)     (x)
+#define pgd_val(x)     (x)
+#define pgprot_val(x)  (x)
+
+#define __pte(x)       (x)
+#define __pmd(x)       (x)
+#define __pgd(x)       (x)
+#define __pgprot(x)    (x)
+
+#endif /* STRICT_MM_TYPECHECKS */
+
+#endif /* _ASM_PGTABLE_3LEVEL_TYPES_H */
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
new file mode 100644 (file)
index 0000000..759af70
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * arch/arm/include/asm/pgtable-3level.h
+ *
+ * Copyright (C) 2011 ARM Ltd.
+ * Author: Catalin Marinas <catalin.marinas@arm.com>
+ *
+ * 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.
+ *
+ * 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_PGTABLE_3LEVEL_H
+#define _ASM_PGTABLE_3LEVEL_H
+
+/*
+ * With LPAE, there are 3 levels of page tables. Each level has 512 entries of
+ * 8 bytes each, occupying a 4K page. The first level table covers a range of
+ * 512GB, each entry representing 1GB. Since we are limited to 4GB input
+ * address range, only 4 entries in the PGD are used.
+ *
+ * There are enough spare bits in a page table entry for the kernel specific
+ * state.
+ */
+#define PTRS_PER_PTE           512
+#define PTRS_PER_PMD           512
+#define PTRS_PER_PGD           4
+
+#define PTE_HWTABLE_PTRS       (PTRS_PER_PTE)
+#define PTE_HWTABLE_OFF                (0)
+#define PTE_HWTABLE_SIZE       (PTRS_PER_PTE * sizeof(u64))
+
+/*
+ * PGDIR_SHIFT determines the size a top-level page table entry can map.
+ */
+#define PGDIR_SHIFT            30
+
+/*
+ * PMD_SHIFT determines the size a middle-level page table entry can map.
+ */
+#define PMD_SHIFT              21
+
+#define PMD_SIZE               (1UL << PMD_SHIFT)
+#define PMD_MASK               (~(PMD_SIZE-1))
+#define PGDIR_SIZE             (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK             (~(PGDIR_SIZE-1))
+
+/*
+ * section address mask and size definitions.
+ */
+#define SECTION_SHIFT          21
+#define SECTION_SIZE           (1UL << SECTION_SHIFT)
+#define SECTION_MASK           (~(SECTION_SIZE-1))
+
+#define USER_PTRS_PER_PGD      (PAGE_OFFSET / PGDIR_SIZE)
+
+/*
+ * "Linux" PTE definitions for LPAE.
+ *
+ * These bits overlap with the hardware bits but the naming is preserved for
+ * consistency with the classic page table format.
+ */
+#define L_PTE_PRESENT          (_AT(pteval_t, 3) << 0)         /* Valid */
+#define L_PTE_FILE             (_AT(pteval_t, 1) << 2)         /* only when !PRESENT */
+#define L_PTE_BUFFERABLE       (_AT(pteval_t, 1) << 2)         /* AttrIndx[0] */
+#define L_PTE_CACHEABLE                (_AT(pteval_t, 1) << 3)         /* AttrIndx[1] */
+#define L_PTE_USER             (_AT(pteval_t, 1) << 6)         /* AP[1] */
+#define L_PTE_RDONLY           (_AT(pteval_t, 1) << 7)         /* AP[2] */
+#define L_PTE_SHARED           (_AT(pteval_t, 3) << 8)         /* SH[1:0], inner shareable */
+#define L_PTE_YOUNG            (_AT(pteval_t, 1) << 10)        /* AF */
+#define L_PTE_XN               (_AT(pteval_t, 1) << 54)        /* XN */
+#define L_PTE_DIRTY            (_AT(pteval_t, 1) << 55)        /* unused */
+#define L_PTE_SPECIAL          (_AT(pteval_t, 1) << 56)        /* unused */
+
+/*
+ * To be used in assembly code with the upper page attributes.
+ */
+#define L_PTE_XN_HIGH          (1 << (54 - 32))
+#define L_PTE_DIRTY_HIGH       (1 << (55 - 32))
+
+/*
+ * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).
+ */
+#define L_PTE_MT_UNCACHED      (_AT(pteval_t, 0) << 2) /* strongly ordered */
+#define L_PTE_MT_BUFFERABLE    (_AT(pteval_t, 1) << 2) /* normal non-cacheable */
+#define L_PTE_MT_WRITETHROUGH  (_AT(pteval_t, 2) << 2) /* normal inner write-through */
+#define L_PTE_MT_WRITEBACK     (_AT(pteval_t, 3) << 2) /* normal inner write-back */
+#define L_PTE_MT_WRITEALLOC    (_AT(pteval_t, 7) << 2) /* normal inner write-alloc */
+#define L_PTE_MT_DEV_SHARED    (_AT(pteval_t, 4) << 2) /* device */
+#define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 4) << 2) /* device */
+#define L_PTE_MT_DEV_WC                (_AT(pteval_t, 1) << 2) /* normal non-cacheable */
+#define L_PTE_MT_DEV_CACHED    (_AT(pteval_t, 3) << 2) /* normal inner write-back */
+#define L_PTE_MT_MASK          (_AT(pteval_t, 7) << 2)
+
+/*
+ * Software PGD flags.
+ */
+#define L_PGD_SWAPPER          (_AT(pgdval_t, 1) << 55)        /* swapper_pg_dir entry */
+
+#ifndef __ASSEMBLY__
+
+#define pud_none(pud)          (!pud_val(pud))
+#define pud_bad(pud)           (!(pud_val(pud) & 2))
+#define pud_present(pud)       (pud_val(pud))
+
+#define pud_clear(pudp)                        \
+       do {                            \
+               *pudp = __pud(0);       \
+               clean_pmd_entry(pudp);  \
+       } while (0)
+
+#define set_pud(pudp, pud)             \
+       do {                            \
+               *pudp = pud;            \
+               flush_pmd_entry(pudp);  \
+       } while (0)
+
+static inline pmd_t *pud_page_vaddr(pud_t pud)
+{
+       return __va(pud_val(pud) & PHYS_MASK & (s32)PAGE_MASK);
+}
+
+/* Find an entry in the second-level page table.. */
+#define pmd_index(addr)                (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
+static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
+{
+       return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr);
+}
+
+#define pmd_bad(pmd)           (!(pmd_val(pmd) & 2))
+
+#define copy_pmd(pmdpd,pmdps)          \
+       do {                            \
+               *pmdpd = *pmdps;        \
+               flush_pmd_entry(pmdpd); \
+       } while (0)
+
+#define pmd_clear(pmdp)                        \
+       do {                            \
+               *pmdp = __pmd(0);       \
+               clean_pmd_entry(pmdp);  \
+       } while (0)
+
+#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,__pte(pte_val(pte)|(ext)))
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* _ASM_PGTABLE_3LEVEL_H */
index 183111164ce93cc3c3ec3e1502c9b4fb8c53934c..8426229ba29282582a20bf65a2c08253f914edf3 100644 (file)
 #ifndef _ASMARM_PGTABLE_HWDEF_H
 #define _ASMARM_PGTABLE_HWDEF_H
 
+#ifdef CONFIG_ARM_LPAE
+#include <asm/pgtable-3level-hwdef.h>
+#else
 #include <asm/pgtable-2level-hwdef.h>
+#endif
 
 #endif
index 9451dce3a5530f9c50c9a34d9ef84e2366a9bbab..04bc70c4a483a3d7d84352e38935f20f3e7af0c1 100644 (file)
 #define _ASMARM_PGTABLE_H
 
 #include <linux/const.h>
-#include <asm-generic/4level-fixup.h>
 #include <asm/proc-fns.h>
 
 #ifndef CONFIG_MMU
 
+#include <asm-generic/4level-fixup.h>
 #include "pgtable-nommu.h"
 
 #else
 
+#include <asm-generic/pgtable-nopud.h>
 #include <asm/memory.h>
-#include <mach/vmalloc.h>
 #include <asm/pgtable-hwdef.h>
 
+#ifdef CONFIG_ARM_LPAE
+#include <asm/pgtable-3level.h>
+#else
 #include <asm/pgtable-2level.h>
+#endif
 
 /*
  * Just any arbitrary offset to the start of the vmalloc VM area: the
  * any out-of-bounds memory accesses will hopefully be caught.
  * The vmalloc() routines leaves a hole of 4kB between each vmalloced
  * area for the same reason. ;)
- *
- * Note that platforms may override VMALLOC_START, but they must provide
- * VMALLOC_END.  VMALLOC_END defines the (exclusive) limit of this space,
- * which may not overlap IO space.
  */
-#ifndef VMALLOC_START
 #define VMALLOC_OFFSET         (8*1024*1024)
 #define VMALLOC_START          (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_END            0xff000000UL
+
+/* This is a temporary hack until shmobile's DMA area size is sorted out */
+#ifdef CONFIG_ARCH_SHMOBILE
+#warning "SH-Mobile's consistent DMA size conflicts with VMALLOC_END by 144MB"
+#undef VMALLOC_END
+#define VMALLOC_END            0xF6000000UL
 #endif
 
 #define LIBRARY_TEXT_START     0x0c000000
@@ -163,39 +169,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(addr)     pgd_offset(&init_mm, addr)
 
-/*
- * The "pgd_xxx()" functions here are trivial for a folded two-level
- * setup: the pgd is never bad, and a pmd always exists (as it's folded
- * into the pgd entry)
- */
-#define pgd_none(pgd)          (0)
-#define pgd_bad(pgd)           (0)
-#define pgd_present(pgd)       (1)
-#define pgd_clear(pgdp)                do { } while (0)
-#define set_pgd(pgd,pgdp)      do { } while (0)
-#define set_pud(pud,pudp)      do { } while (0)
-
-
-/* Find an entry in the second-level page table.. */
-#define pmd_offset(dir, addr)  ((pmd_t *)(dir))
-
 #define pmd_none(pmd)          (!pmd_val(pmd))
 #define pmd_present(pmd)       (pmd_val(pmd))
-#define pmd_bad(pmd)           (pmd_val(pmd) & 2)
-
-#define copy_pmd(pmdpd,pmdps)          \
-       do {                            \
-               pmdpd[0] = pmdps[0];    \
-               pmdpd[1] = pmdps[1];    \
-               flush_pmd_entry(pmdpd); \
-       } while (0)
-
-#define pmd_clear(pmdp)                        \
-       do {                            \
-               pmdp[0] = __pmd(0);     \
-               pmdp[1] = __pmd(0);     \
-               clean_pmd_entry(pmdp);  \
-       } while (0)
 
 static inline pte_t *pmd_page_vaddr(pmd_t pmd)
 {
@@ -204,10 +179,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
 
 #define pmd_page(pmd)          pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
 
-/* we don't need complex calculations here as the pmd is folded into the pgd */
-#define pmd_addr_end(addr,end) (end)
-
-
 #ifndef CONFIG_HIGHPTE
 #define __pte_map(pmd)         pmd_page_vaddr(*(pmd))
 #define __pte_unmap(pte)       do { } while (0)
@@ -229,7 +200,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
 #define pte_page(pte)          pfn_to_page(pte_pfn(pte))
 #define mk_pte(page,prot)      pfn_pte(page_to_pfn(page), prot)
 
-#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
 #define pte_clear(mm,addr,ptep)        set_pte_ext(ptep, __pte(0), 0)
 
 #if __LINUX_ARM_ARCH__ < 6
@@ -336,6 +306,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
  * We provide our own arch_get_unmapped_area to cope with VIPT caches.
  */
 #define HAVE_ARCH_UNMAPPED_AREA
+#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 
 /*
  * remap a physical page `pfn' of size `size' with page protection `prot'
@@ -346,9 +317,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 
 #define pgtable_cache_init() do { } while (0)
 
-void identity_mapping_add(pgd_t *, unsigned long, unsigned long);
-void identity_mapping_del(pgd_t *, unsigned long, unsigned long);
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* CONFIG_MMU */
index 0bda22c094a6dd1b70100444d6e29fa1a41688ef..b5a5be2536c1158acf5a9c979eccb0f5588bb97c 100644 (file)
@@ -27,13 +27,22 @@ enum arm_pmu_type {
 /*
  * struct arm_pmu_platdata - ARM PMU platform data
  *
- * @handle_irq: an optional handler which will be called from the interrupt and
- * passed the address of the low level handler, and can be used to implement
- * any platform specific handling before or after calling it.
+ * @handle_irq: an optional handler which will be called from the
+ *     interrupt and passed the address of the low level handler,
+ *     and can be used to implement any platform specific handling
+ *     before or after calling it.
+ * @enable_irq: an optional handler which will be called after
+ *     request_irq and be used to handle some platform specific
+ *     irq enablement
+ * @disable_irq: an optional handler which will be called before
+ *     free_irq and be used to handle some platform specific
+ *     irq disablement
  */
 struct arm_pmu_platdata {
        irqreturn_t (*handle_irq)(int irq, void *dev,
                                  irq_handler_t pmu_handler);
+       void (*enable_irq)(int irq);
+       void (*disable_irq)(int irq);
 };
 
 #ifdef CONFIG_CPU_HAS_PMU
index 9e92cb205e656e61d1b47a3aed9268dd343db205..f3628fb3d2b331a9dba24fc29fdb8bf4b3c6b3d1 100644 (file)
@@ -65,7 +65,11 @@ extern struct processor {
         * Set a possibly extended PTE.  Non-extended PTEs should
         * ignore 'ext'.
         */
+#ifdef CONFIG_ARM_LPAE
+       void (*set_pte_ext)(pte_t *ptep, pte_t pte);
+#else
        void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
+#endif
 
        /* Suspend/resume */
        unsigned int suspend_size;
@@ -79,7 +83,11 @@ extern void cpu_proc_fin(void);
 extern int cpu_do_idle(void);
 extern void cpu_dcache_clean_area(void *, int);
 extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
+#ifdef CONFIG_ARM_LPAE
+extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte);
+#else
 extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
+#endif
 extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
 
 /* These three are private to arch/arm/kernel/suspend.c */
@@ -107,6 +115,18 @@ extern void cpu_resume(void);
 
 #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
 
+#ifdef CONFIG_ARM_LPAE
+#define cpu_get_pgd()  \
+       ({                                              \
+               unsigned long pg, pg2;                  \
+               __asm__("mrrc   p15, 0, %0, %1, c2"     \
+                       : "=r" (pg), "=r" (pg2)         \
+                       :                               \
+                       : "cc");                        \
+               pg &= ~(PTRS_PER_PGD*sizeof(pgd_t)-1);  \
+               (pgd_t *)phys_to_virt(pg);              \
+       })
+#else
 #define cpu_get_pgd()  \
        ({                                              \
                unsigned long pg;                       \
@@ -115,6 +135,7 @@ extern void cpu_resume(void);
                pg &= ~0x3fff;                          \
                (pgd_t *)phys_to_virt(pg);              \
        })
+#endif
 
 #endif
 
index b2d9df5667af937476baf5e64ded8520ea3fd5d4..ce280b8d613cbc7821a2adedfa32186988caf1e0 100644 (file)
@@ -123,6 +123,8 @@ static inline void prefetch(const void *ptr)
 
 #endif
 
+#define HAVE_ARCH_PICK_MMAP_LAYOUT
+
 #endif
 
 #endif /* __ASM_ARM_PROCESSOR_H */
index 9997ad20eff11d04906882b0a8da3c7c47ac4f76..32ee164a2f6bb73e066dd34debd6b1355f118f2a 100644 (file)
 
 #if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6
 
-static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
+static inline __attribute_const__ __u32 __arch_swahb32(__u32 x)
 {
        __asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x));
        return x;
 }
-#define __arch_swab16 __arch_swab16
+#define __arch_swahb32 __arch_swahb32
+#define __arch_swab16(x) ((__u16)__arch_swahb32(x))
 
 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 {
index 984014b92647a8a1a093f8b46ce05dfd729ca473..e4c96cc6ec0cf470e214a00e72008925379c74bb 100644 (file)
@@ -80,6 +80,14 @@ struct siginfo;
 void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
                unsigned long err, unsigned long trap);
 
+#ifdef CONFIG_ARM_LPAE
+#define FAULT_CODE_ALIGNMENT   33
+#define FAULT_CODE_DEBUG       34
+#else
+#define FAULT_CODE_ALIGNMENT   1
+#define FAULT_CODE_DEBUG       2
+#endif
+
 void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
                                       struct pt_regs *),
                     int sig, int code, const char *name);
@@ -100,7 +108,7 @@ extern void __show_regs(struct pt_regs *);
 extern int __pure cpu_architecture(void);
 extern void cpu_init(void);
 
-void arm_machine_restart(char mode, const char *cmd);
+void soft_restart(unsigned long);
 extern void (*arm_pm_restart)(char str, const char *cmd);
 
 #define UDBG_UNDEFINED (1 << 0)
index 265f908c4a6e79b98e07d43b7614c5164e86da53..5d3ed7e38561dd43553d1d3bf1b2af07e0d2b747 100644 (file)
@@ -202,8 +202,18 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
        tlb_remove_page(tlb, pte);
 }
 
+static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
+                                 unsigned long addr)
+{
+#ifdef CONFIG_ARM_LPAE
+       tlb_add_flush(tlb, addr);
+       tlb_remove_page(tlb, virt_to_page(pmdp));
+#endif
+}
+
 #define pte_free_tlb(tlb, ptep, addr)  __pte_free_tlb(tlb, ptep, addr)
-#define pmd_free_tlb(tlb, pmdp, addr)  pmd_free((tlb)->mm, pmdp)
+#define pmd_free_tlb(tlb, pmdp, addr)  __pmd_free_tlb(tlb, pmdp, addr)
+#define pud_free_tlb(tlb, pudp, addr)  pud_free((tlb)->mm, pudp)
 
 #define tlb_migrate_finish(mm)         do { } while (0)
 
index a5edf421005cce0d043cbb75be394253127a2582..d1c3f3a71c9454dd665b48a0cfc51bc954576a05 100644 (file)
@@ -30,14 +30,15 @@ enum unwind_reason_code {
 };
 
 struct unwind_idx {
-       unsigned long addr;
+       unsigned long addr_offset;
        unsigned long insn;
 };
 
 struct unwind_table {
        struct list_head list;
-       struct unwind_idx *start;
-       struct unwind_idx *stop;
+       const struct unwind_idx *start;
+       const struct unwind_idx *origin;
+       const struct unwind_idx *stop;
        unsigned long begin_addr;
        unsigned long end_addr;
 };
@@ -49,15 +50,6 @@ extern struct unwind_table *unwind_table_add(unsigned long start,
 extern void unwind_table_del(struct unwind_table *tab);
 extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk);
 
-#ifdef CONFIG_ARM_UNWIND
-extern int __init unwind_init(void);
-#else
-static inline int __init unwind_init(void)
-{
-       return 0;
-}
-#endif
-
 #endif /* !__ASSEMBLY__ */
 
 #ifdef CONFIG_ARM_UNWIND
index b145f16c91bc786db82fcd3cd66ccdee7b740aa4..3a456c6c70056f9267f592792193d2176c045802 100644 (file)
 #ifdef CONFIG_MULTI_IRQ_HANDLER
        ldr     r1, =handle_arch_irq
        mov     r0, sp
-       ldr     r1, [r1]
        adr     lr, BSYM(9997f)
-       teq     r1, #0
-       movne   pc, r1
-#endif
+       ldr     pc, [r1]
+#else
        arch_irq_handler_default
+#endif
 9997:
        .endm
 
index 08c82fd844a8683533216048b54ff2f210729fb6..14e277d2ff911ec7690c4223c5acea4b602e3450 100644 (file)
 #error KERNEL_RAM_VADDR must start at 0xXXXX8000
 #endif
 
+#ifdef CONFIG_ARM_LPAE
+       /* LPAE requires an additional page for the PGD */
+#define PG_DIR_SIZE    0x5000
+#define PMD_ORDER      3
+#else
 #define PG_DIR_SIZE    0x4000
 #define PMD_ORDER      2
+#endif
 
        .globl  swapper_pg_dir
        .equ    swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE
@@ -164,17 +170,36 @@ __create_page_tables:
        teq     r0, r6
        bne     1b
 
+#ifdef CONFIG_ARM_LPAE
+       /*
+        * Build the PGD table (first level) to point to the PMD table. A PGD
+        * entry is 64-bit wide.
+        */
+       mov     r0, r4
+       add     r3, r4, #0x1000                 @ first PMD table address
+       orr     r3, r3, #3                      @ PGD block type
+       mov     r6, #4                          @ PTRS_PER_PGD
+       mov     r7, #1 << (55 - 32)             @ L_PGD_SWAPPER
+1:     str     r3, [r0], #4                    @ set bottom PGD entry bits
+       str     r7, [r0], #4                    @ set top PGD entry bits
+       add     r3, r3, #0x1000                 @ next PMD table
+       subs    r6, r6, #1
+       bne     1b
+
+       add     r4, r4, #0x1000                 @ point to the PMD tables
+#endif
+
        ldr     r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags
 
        /*
         * Create identity mapping to cater for __enable_mmu.
         * This identity mapping will be removed by paging_init().
         */
-       adr     r0, __enable_mmu_loc
+       adr     r0, __turn_mmu_on_loc
        ldmia   r0, {r3, r5, r6}
        sub     r0, r0, r3                      @ virt->phys offset
-       add     r5, r5, r0                      @ phys __enable_mmu
-       add     r6, r6, r0                      @ phys __enable_mmu_end
+       add     r5, r5, r0                      @ phys __turn_mmu_on
+       add     r6, r6, r0                      @ phys __turn_mmu_on_end
        mov     r5, r5, lsr #SECTION_SHIFT
        mov     r6, r6, lsr #SECTION_SHIFT
 
@@ -219,8 +244,8 @@ __create_page_tables:
 #endif
 
        /*
-        * Then map boot params address in r2 or
-        * the first 1MB of ram if boot params address is not specified.
+        * Then map boot params address in r2 or the first 1MB (2MB with LPAE)
+        * of ram if boot params address is not specified.
         */
        mov     r0, r2, lsr #SECTION_SHIFT
        movs    r0, r0, lsl #SECTION_SHIFT
@@ -251,7 +276,15 @@ __create_page_tables:
        mov     r3, r7, lsr #SECTION_SHIFT
        ldr     r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags
        orr     r3, r7, r3, lsl #SECTION_SHIFT
+#ifdef CONFIG_ARM_LPAE
+       mov     r7, #1 << (54 - 32)             @ XN
+#else
+       orr     r3, r3, #PMD_SECT_XN
+#endif
 1:     str     r3, [r0], #4
+#ifdef CONFIG_ARM_LPAE
+       str     r7, [r0], #4
+#endif
        add     r3, r3, #1 << SECTION_SHIFT
        cmp     r0, r6
        blo     1b
@@ -282,15 +315,18 @@ __create_page_tables:
        add     r0, r4, #0xd8000000 >> (SECTION_SHIFT - PMD_ORDER)
        str     r3, [r0]
 #endif
+#endif
+#ifdef CONFIG_ARM_LPAE
+       sub     r4, r4, #0x1000         @ point to the PGD table
 #endif
        mov     pc, lr
 ENDPROC(__create_page_tables)
        .ltorg
        .align
-__enable_mmu_loc:
+__turn_mmu_on_loc:
        .long   .
-       .long   __enable_mmu
-       .long   __enable_mmu_end
+       .long   __turn_mmu_on
+       .long   __turn_mmu_on_end
 
 #if defined(CONFIG_SMP)
        __CPUINIT
@@ -374,12 +410,17 @@ __enable_mmu:
 #ifdef CONFIG_CPU_ICACHE_DISABLE
        bic     r0, r0, #CR_I
 #endif
+#ifdef CONFIG_ARM_LPAE
+       mov     r5, #0
+       mcrr    p15, 0, r4, r5, c2              @ load TTBR0
+#else
        mov     r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
                      domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
                      domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \
                      domain_val(DOMAIN_IO, DOMAIN_CLIENT))
        mcr     p15, 0, r5, c3, c0, 0           @ load domain access register
        mcr     p15, 0, r4, c2, c0, 0           @ load page table pointer
+#endif
        b       __turn_mmu_on
 ENDPROC(__enable_mmu)
 
@@ -398,15 +439,19 @@ ENDPROC(__enable_mmu)
  * other registers depend on the function called upon completion
  */
        .align  5
-__turn_mmu_on:
+       .pushsection    .idmap.text, "ax"
+ENTRY(__turn_mmu_on)
        mov     r0, r0
+       instr_sync
        mcr     p15, 0, r0, c1, c0, 0           @ write control reg
        mrc     p15, 0, r3, c0, c0, 0           @ read id reg
+       instr_sync
        mov     r3, r3
        mov     r3, r13
        mov     pc, r3
-__enable_mmu_end:
+__turn_mmu_on_end:
 ENDPROC(__turn_mmu_on)
+       .popsection
 
 
 #ifdef CONFIG_SMP_ON_UP
index 814a52a9dc39abf401629e429879080ca1e2173a..d6a95ef9131d5a567b257c056b6f932ce7b0ac23 100644 (file)
@@ -1016,10 +1016,10 @@ static int __init arch_hw_breakpoint_init(void)
        }
 
        /* Register debug fault handler. */
-       hook_fault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT,
-                       "watchpoint debug exception");
-       hook_ifault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT,
-                       "breakpoint debug exception");
+       hook_fault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP,
+                       TRAP_HWBKPT, "watchpoint debug exception");
+       hook_ifault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP,
+                       TRAP_HWBKPT, "breakpoint debug exception");
 
        /* Register hotplug notifier. */
        register_cpu_notifier(&dbg_reset_nb);
index e59bbd496c39174da0a6ee4094fe6f717df97a67..29620b632ed945366605b46424df24eb7f369815 100644 (file)
@@ -16,7 +16,7 @@
 extern const unsigned char relocate_new_kernel[];
 extern const unsigned int relocate_new_kernel_size;
 
-extern void setup_mm_for_reboot(char mode);
+extern void setup_mm_for_reboot(void);
 
 extern unsigned long kexec_start_address;
 extern unsigned long kexec_indirection_page;
@@ -113,7 +113,7 @@ void machine_kexec(struct kimage *image)
                kexec_reinit();
        local_irq_disable();
        local_fiq_disable();
-       setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
+       setup_mm_for_reboot();
        flush_cache_all();
        outer_flush_all();
        outer_disable();
index 8e9c98edc0682a8aa23790737a3b63b08dea847f..5bb91bf3d47f24c9c6fb75324535c39e54b2c62e 100644 (file)
@@ -59,8 +59,7 @@ armpmu_get_pmu_id(void)
 }
 EXPORT_SYMBOL_GPL(armpmu_get_pmu_id);
 
-int
-armpmu_get_max_events(void)
+int perf_num_counters(void)
 {
        int max_events = 0;
 
@@ -69,12 +68,6 @@ armpmu_get_max_events(void)
 
        return max_events;
 }
-EXPORT_SYMBOL_GPL(armpmu_get_max_events);
-
-int perf_num_counters(void)
-{
-       return armpmu_get_max_events();
-}
 EXPORT_SYMBOL_GPL(perf_num_counters);
 
 #define HW_OP_UNSUPPORTED              0xFFFF
@@ -380,6 +373,8 @@ armpmu_release_hardware(struct arm_pmu *armpmu)
 {
        int i, irq, irqs;
        struct platform_device *pmu_device = armpmu->plat_device;
+       struct arm_pmu_platdata *plat =
+               dev_get_platdata(&pmu_device->dev);
 
        irqs = min(pmu_device->num_resources, num_possible_cpus());
 
@@ -387,8 +382,11 @@ armpmu_release_hardware(struct arm_pmu *armpmu)
                if (!cpumask_test_and_clear_cpu(i, &armpmu->active_irqs))
                        continue;
                irq = platform_get_irq(pmu_device, i);
-               if (irq >= 0)
+               if (irq >= 0) {
+                       if (plat && plat->disable_irq)
+                               plat->disable_irq(irq);
                        free_irq(irq, armpmu);
+               }
        }
 
        release_pmu(armpmu->type);
@@ -448,7 +446,8 @@ armpmu_reserve_hardware(struct arm_pmu *armpmu)
                                irq);
                        armpmu_release_hardware(armpmu);
                        return err;
-               }
+               } else if (plat && plat->enable_irq)
+                       plat->enable_irq(irq);
 
                cpumask_set_cpu(i, &armpmu->active_irqs);
        }
@@ -640,6 +639,9 @@ static struct platform_device_id armpmu_plat_device_ids[] = {
 
 static int __devinit armpmu_device_probe(struct platform_device *pdev)
 {
+       if (!cpu_pmu)
+               return -ENODEV;
+
        cpu_pmu->plat_device = pdev;
        return 0;
 }
index e63d8115c01b2fc9cabef9a23749cdc60e9ad0e7..533be9930ec22f803e672a2e57217b8c65bfc40b 100644 (file)
@@ -65,13 +65,15 @@ enum armv6_counters {
  * accesses/misses in hardware.
  */
 static const unsigned armv6_perf_map[PERF_COUNT_HW_MAX] = {
-       [PERF_COUNT_HW_CPU_CYCLES]          = ARMV6_PERFCTR_CPU_CYCLES,
-       [PERF_COUNT_HW_INSTRUCTIONS]        = ARMV6_PERFCTR_INSTR_EXEC,
-       [PERF_COUNT_HW_CACHE_REFERENCES]    = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_CACHE_MISSES]        = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6_PERFCTR_BR_EXEC,
-       [PERF_COUNT_HW_BRANCH_MISSES]       = ARMV6_PERFCTR_BR_MISPREDICT,
-       [PERF_COUNT_HW_BUS_CYCLES]          = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_CPU_CYCLES]              = ARMV6_PERFCTR_CPU_CYCLES,
+       [PERF_COUNT_HW_INSTRUCTIONS]            = ARMV6_PERFCTR_INSTR_EXEC,
+       [PERF_COUNT_HW_CACHE_REFERENCES]        = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_CACHE_MISSES]            = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]     = ARMV6_PERFCTR_BR_EXEC,
+       [PERF_COUNT_HW_BRANCH_MISSES]           = ARMV6_PERFCTR_BR_MISPREDICT,
+       [PERF_COUNT_HW_BUS_CYCLES]              = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV6_PERFCTR_IBUF_STALL,
+       [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]  = ARMV6_PERFCTR_LSU_FULL_STALL,
 };
 
 static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
@@ -218,13 +220,15 @@ enum armv6mpcore_perf_types {
  * accesses/misses in hardware.
  */
 static const unsigned armv6mpcore_perf_map[PERF_COUNT_HW_MAX] = {
-       [PERF_COUNT_HW_CPU_CYCLES]          = ARMV6MPCORE_PERFCTR_CPU_CYCLES,
-       [PERF_COUNT_HW_INSTRUCTIONS]        = ARMV6MPCORE_PERFCTR_INSTR_EXEC,
-       [PERF_COUNT_HW_CACHE_REFERENCES]    = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_CACHE_MISSES]        = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_BR_EXEC,
-       [PERF_COUNT_HW_BRANCH_MISSES]       = ARMV6MPCORE_PERFCTR_BR_MISPREDICT,
-       [PERF_COUNT_HW_BUS_CYCLES]          = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_CPU_CYCLES]              = ARMV6MPCORE_PERFCTR_CPU_CYCLES,
+       [PERF_COUNT_HW_INSTRUCTIONS]            = ARMV6MPCORE_PERFCTR_INSTR_EXEC,
+       [PERF_COUNT_HW_CACHE_REFERENCES]        = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_CACHE_MISSES]            = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]     = ARMV6MPCORE_PERFCTR_BR_EXEC,
+       [PERF_COUNT_HW_BRANCH_MISSES]           = ARMV6MPCORE_PERFCTR_BR_MISPREDICT,
+       [PERF_COUNT_HW_BUS_CYCLES]              = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV6MPCORE_PERFCTR_IBUF_STALL,
+       [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]  = ARMV6MPCORE_PERFCTR_LSU_FULL_STALL,
 };
 
 static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
index 1ef6d0034b85d1172c8efe1d1659e82dbced1032..460bbbb6b88536ba18ded4983b6ee18baf1a4bf4 100644 (file)
@@ -28,165 +28,87 @@ static struct arm_pmu armv7pmu;
  * they are not available.
  */
 enum armv7_perf_types {
-       ARMV7_PERFCTR_PMNC_SW_INCR              = 0x00,
-       ARMV7_PERFCTR_IFETCH_MISS               = 0x01,
-       ARMV7_PERFCTR_ITLB_MISS                 = 0x02,
-       ARMV7_PERFCTR_DCACHE_REFILL             = 0x03, /* L1 */
-       ARMV7_PERFCTR_DCACHE_ACCESS             = 0x04, /* L1 */
-       ARMV7_PERFCTR_DTLB_REFILL               = 0x05,
-       ARMV7_PERFCTR_DREAD                     = 0x06,
-       ARMV7_PERFCTR_DWRITE                    = 0x07,
-       ARMV7_PERFCTR_INSTR_EXECUTED            = 0x08,
-       ARMV7_PERFCTR_EXC_TAKEN                 = 0x09,
-       ARMV7_PERFCTR_EXC_EXECUTED              = 0x0A,
-       ARMV7_PERFCTR_CID_WRITE                 = 0x0B,
-       /* ARMV7_PERFCTR_PC_WRITE is equivalent to HW_BRANCH_INSTRUCTIONS.
+       ARMV7_PERFCTR_PMNC_SW_INCR                      = 0x00,
+       ARMV7_PERFCTR_L1_ICACHE_REFILL                  = 0x01,
+       ARMV7_PERFCTR_ITLB_REFILL                       = 0x02,
+       ARMV7_PERFCTR_L1_DCACHE_REFILL                  = 0x03,
+       ARMV7_PERFCTR_L1_DCACHE_ACCESS                  = 0x04,
+       ARMV7_PERFCTR_DTLB_REFILL                       = 0x05,
+       ARMV7_PERFCTR_MEM_READ                          = 0x06,
+       ARMV7_PERFCTR_MEM_WRITE                         = 0x07,
+       ARMV7_PERFCTR_INSTR_EXECUTED                    = 0x08,
+       ARMV7_PERFCTR_EXC_TAKEN                         = 0x09,
+       ARMV7_PERFCTR_EXC_EXECUTED                      = 0x0A,
+       ARMV7_PERFCTR_CID_WRITE                         = 0x0B,
+
+       /*
+        * ARMV7_PERFCTR_PC_WRITE is equivalent to HW_BRANCH_INSTRUCTIONS.
         * It counts:
-        *  - all branch instructions,
+        *  - all (taken) branch instructions,
         *  - instructions that explicitly write the PC,
         *  - exception generating instructions.
         */
-       ARMV7_PERFCTR_PC_WRITE                  = 0x0C,
-       ARMV7_PERFCTR_PC_IMM_BRANCH             = 0x0D,
-       ARMV7_PERFCTR_PC_PROC_RETURN            = 0x0E,
-       ARMV7_PERFCTR_UNALIGNED_ACCESS          = 0x0F,
+       ARMV7_PERFCTR_PC_WRITE                          = 0x0C,
+       ARMV7_PERFCTR_PC_IMM_BRANCH                     = 0x0D,
+       ARMV7_PERFCTR_PC_PROC_RETURN                    = 0x0E,
+       ARMV7_PERFCTR_MEM_UNALIGNED_ACCESS              = 0x0F,
+       ARMV7_PERFCTR_PC_BRANCH_MIS_PRED                = 0x10,
+       ARMV7_PERFCTR_CLOCK_CYCLES                      = 0x11,
+       ARMV7_PERFCTR_PC_BRANCH_PRED                    = 0x12,
 
        /* These events are defined by the PMUv2 supplement (ARM DDI 0457A). */
-       ARMV7_PERFCTR_PC_BRANCH_MIS_PRED        = 0x10,
-       ARMV7_PERFCTR_CLOCK_CYCLES              = 0x11,
-       ARMV7_PERFCTR_PC_BRANCH_PRED            = 0x12,
-       ARMV7_PERFCTR_MEM_ACCESS                = 0x13,
-       ARMV7_PERFCTR_L1_ICACHE_ACCESS          = 0x14,
-       ARMV7_PERFCTR_L1_DCACHE_WB              = 0x15,
-       ARMV7_PERFCTR_L2_DCACHE_ACCESS          = 0x16,
-       ARMV7_PERFCTR_L2_DCACHE_REFILL          = 0x17,
-       ARMV7_PERFCTR_L2_DCACHE_WB              = 0x18,
-       ARMV7_PERFCTR_BUS_ACCESS                = 0x19,
-       ARMV7_PERFCTR_MEMORY_ERROR              = 0x1A,
-       ARMV7_PERFCTR_INSTR_SPEC                = 0x1B,
-       ARMV7_PERFCTR_TTBR_WRITE                = 0x1C,
-       ARMV7_PERFCTR_BUS_CYCLES                = 0x1D,
-
-       ARMV7_PERFCTR_CPU_CYCLES                = 0xFF
+       ARMV7_PERFCTR_MEM_ACCESS                        = 0x13,
+       ARMV7_PERFCTR_L1_ICACHE_ACCESS                  = 0x14,
+       ARMV7_PERFCTR_L1_DCACHE_WB                      = 0x15,
+       ARMV7_PERFCTR_L2_CACHE_ACCESS                   = 0x16,
+       ARMV7_PERFCTR_L2_CACHE_REFILL                   = 0x17,
+       ARMV7_PERFCTR_L2_CACHE_WB                       = 0x18,
+       ARMV7_PERFCTR_BUS_ACCESS                        = 0x19,
+       ARMV7_PERFCTR_MEM_ERROR                         = 0x1A,
+       ARMV7_PERFCTR_INSTR_SPEC                        = 0x1B,
+       ARMV7_PERFCTR_TTBR_WRITE                        = 0x1C,
+       ARMV7_PERFCTR_BUS_CYCLES                        = 0x1D,
+
+       ARMV7_PERFCTR_CPU_CYCLES                        = 0xFF
 };
 
 /* ARMv7 Cortex-A8 specific event types */
 enum armv7_a8_perf_types {
-       ARMV7_PERFCTR_WRITE_BUFFER_FULL         = 0x40,
-       ARMV7_PERFCTR_L2_STORE_MERGED           = 0x41,
-       ARMV7_PERFCTR_L2_STORE_BUFF             = 0x42,
-       ARMV7_PERFCTR_L2_ACCESS                 = 0x43,
-       ARMV7_PERFCTR_L2_CACH_MISS              = 0x44,
-       ARMV7_PERFCTR_AXI_READ_CYCLES           = 0x45,
-       ARMV7_PERFCTR_AXI_WRITE_CYCLES          = 0x46,
-       ARMV7_PERFCTR_MEMORY_REPLAY             = 0x47,
-       ARMV7_PERFCTR_UNALIGNED_ACCESS_REPLAY   = 0x48,
-       ARMV7_PERFCTR_L1_DATA_MISS              = 0x49,
-       ARMV7_PERFCTR_L1_INST_MISS              = 0x4A,
-       ARMV7_PERFCTR_L1_DATA_COLORING          = 0x4B,
-       ARMV7_PERFCTR_L1_NEON_DATA              = 0x4C,
-       ARMV7_PERFCTR_L1_NEON_CACH_DATA         = 0x4D,
-       ARMV7_PERFCTR_L2_NEON                   = 0x4E,
-       ARMV7_PERFCTR_L2_NEON_HIT               = 0x4F,
-       ARMV7_PERFCTR_L1_INST                   = 0x50,
-       ARMV7_PERFCTR_PC_RETURN_MIS_PRED        = 0x51,
-       ARMV7_PERFCTR_PC_BRANCH_FAILED          = 0x52,
-       ARMV7_PERFCTR_PC_BRANCH_TAKEN           = 0x53,
-       ARMV7_PERFCTR_PC_BRANCH_EXECUTED        = 0x54,
-       ARMV7_PERFCTR_OP_EXECUTED               = 0x55,
-       ARMV7_PERFCTR_CYCLES_INST_STALL         = 0x56,
-       ARMV7_PERFCTR_CYCLES_INST               = 0x57,
-       ARMV7_PERFCTR_CYCLES_NEON_DATA_STALL    = 0x58,
-       ARMV7_PERFCTR_CYCLES_NEON_INST_STALL    = 0x59,
-       ARMV7_PERFCTR_NEON_CYCLES               = 0x5A,
-
-       ARMV7_PERFCTR_PMU0_EVENTS               = 0x70,
-       ARMV7_PERFCTR_PMU1_EVENTS               = 0x71,
-       ARMV7_PERFCTR_PMU_EVENTS                = 0x72,
+       ARMV7_A8_PERFCTR_L2_CACHE_ACCESS                = 0x43,
+       ARMV7_A8_PERFCTR_L2_CACHE_REFILL                = 0x44,
+       ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS               = 0x50,
+       ARMV7_A8_PERFCTR_STALL_ISIDE                    = 0x56,
 };
 
 /* ARMv7 Cortex-A9 specific event types */
 enum armv7_a9_perf_types {
-       ARMV7_PERFCTR_JAVA_HW_BYTECODE_EXEC     = 0x40,
-       ARMV7_PERFCTR_JAVA_SW_BYTECODE_EXEC     = 0x41,
-       ARMV7_PERFCTR_JAZELLE_BRANCH_EXEC       = 0x42,
-
-       ARMV7_PERFCTR_COHERENT_LINE_MISS        = 0x50,
-       ARMV7_PERFCTR_COHERENT_LINE_HIT         = 0x51,
-
-       ARMV7_PERFCTR_ICACHE_DEP_STALL_CYCLES   = 0x60,
-       ARMV7_PERFCTR_DCACHE_DEP_STALL_CYCLES   = 0x61,
-       ARMV7_PERFCTR_TLB_MISS_DEP_STALL_CYCLES = 0x62,
-       ARMV7_PERFCTR_STREX_EXECUTED_PASSED     = 0x63,
-       ARMV7_PERFCTR_STREX_EXECUTED_FAILED     = 0x64,
-       ARMV7_PERFCTR_DATA_EVICTION             = 0x65,
-       ARMV7_PERFCTR_ISSUE_STAGE_NO_INST       = 0x66,
-       ARMV7_PERFCTR_ISSUE_STAGE_EMPTY         = 0x67,
-       ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE  = 0x68,
-
-       ARMV7_PERFCTR_PREDICTABLE_FUNCT_RETURNS = 0x6E,
-
-       ARMV7_PERFCTR_MAIN_UNIT_EXECUTED_INST   = 0x70,
-       ARMV7_PERFCTR_SECOND_UNIT_EXECUTED_INST = 0x71,
-       ARMV7_PERFCTR_LD_ST_UNIT_EXECUTED_INST  = 0x72,
-       ARMV7_PERFCTR_FP_EXECUTED_INST          = 0x73,
-       ARMV7_PERFCTR_NEON_EXECUTED_INST        = 0x74,
-
-       ARMV7_PERFCTR_PLD_FULL_DEP_STALL_CYCLES = 0x80,
-       ARMV7_PERFCTR_DATA_WR_DEP_STALL_CYCLES  = 0x81,
-       ARMV7_PERFCTR_ITLB_MISS_DEP_STALL_CYCLES        = 0x82,
-       ARMV7_PERFCTR_DTLB_MISS_DEP_STALL_CYCLES        = 0x83,
-       ARMV7_PERFCTR_MICRO_ITLB_MISS_DEP_STALL_CYCLES  = 0x84,
-       ARMV7_PERFCTR_MICRO_DTLB_MISS_DEP_STALL_CYCLES  = 0x85,
-       ARMV7_PERFCTR_DMB_DEP_STALL_CYCLES      = 0x86,
-
-       ARMV7_PERFCTR_INTGR_CLK_ENABLED_CYCLES  = 0x8A,
-       ARMV7_PERFCTR_DATA_ENGINE_CLK_EN_CYCLES = 0x8B,
-
-       ARMV7_PERFCTR_ISB_INST                  = 0x90,
-       ARMV7_PERFCTR_DSB_INST                  = 0x91,
-       ARMV7_PERFCTR_DMB_INST                  = 0x92,
-       ARMV7_PERFCTR_EXT_INTERRUPTS            = 0x93,
-
-       ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_COMPLETED     = 0xA0,
-       ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_SKIPPED       = 0xA1,
-       ARMV7_PERFCTR_PLE_FIFO_FLUSH            = 0xA2,
-       ARMV7_PERFCTR_PLE_RQST_COMPLETED        = 0xA3,
-       ARMV7_PERFCTR_PLE_FIFO_OVERFLOW         = 0xA4,
-       ARMV7_PERFCTR_PLE_RQST_PROG             = 0xA5
+       ARMV7_A9_PERFCTR_INSTR_CORE_RENAME              = 0x68,
+       ARMV7_A9_PERFCTR_STALL_ICACHE                   = 0x60,
+       ARMV7_A9_PERFCTR_STALL_DISPATCH                 = 0x66,
 };
 
 /* ARMv7 Cortex-A5 specific event types */
 enum armv7_a5_perf_types {
-       ARMV7_PERFCTR_IRQ_TAKEN                 = 0x86,
-       ARMV7_PERFCTR_FIQ_TAKEN                 = 0x87,
-
-       ARMV7_PERFCTR_EXT_MEM_RQST              = 0xc0,
-       ARMV7_PERFCTR_NC_EXT_MEM_RQST           = 0xc1,
-       ARMV7_PERFCTR_PREFETCH_LINEFILL         = 0xc2,
-       ARMV7_PERFCTR_PREFETCH_LINEFILL_DROP    = 0xc3,
-       ARMV7_PERFCTR_ENTER_READ_ALLOC          = 0xc4,
-       ARMV7_PERFCTR_READ_ALLOC                = 0xc5,
-
-       ARMV7_PERFCTR_STALL_SB_FULL             = 0xc9,
+       ARMV7_A5_PERFCTR_PREFETCH_LINEFILL              = 0xc2,
+       ARMV7_A5_PERFCTR_PREFETCH_LINEFILL_DROP         = 0xc3,
 };
 
 /* ARMv7 Cortex-A15 specific event types */
 enum armv7_a15_perf_types {
-       ARMV7_PERFCTR_L1_DCACHE_READ_ACCESS     = 0x40,
-       ARMV7_PERFCTR_L1_DCACHE_WRITE_ACCESS    = 0x41,
-       ARMV7_PERFCTR_L1_DCACHE_READ_REFILL     = 0x42,
-       ARMV7_PERFCTR_L1_DCACHE_WRITE_REFILL    = 0x43,
+       ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_READ         = 0x40,
+       ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_WRITE        = 0x41,
+       ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_READ         = 0x42,
+       ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_WRITE        = 0x43,
 
-       ARMV7_PERFCTR_L1_DTLB_READ_REFILL       = 0x4C,
-       ARMV7_PERFCTR_L1_DTLB_WRITE_REFILL      = 0x4D,
+       ARMV7_A15_PERFCTR_DTLB_REFILL_L1_READ           = 0x4C,
+       ARMV7_A15_PERFCTR_DTLB_REFILL_L1_WRITE          = 0x4D,
 
-       ARMV7_PERFCTR_L2_DCACHE_READ_ACCESS     = 0x50,
-       ARMV7_PERFCTR_L2_DCACHE_WRITE_ACCESS    = 0x51,
-       ARMV7_PERFCTR_L2_DCACHE_READ_REFILL     = 0x52,
-       ARMV7_PERFCTR_L2_DCACHE_WRITE_REFILL    = 0x53,
+       ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_READ          = 0x50,
+       ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_WRITE         = 0x51,
+       ARMV7_A15_PERFCTR_L2_CACHE_REFILL_READ          = 0x52,
+       ARMV7_A15_PERFCTR_L2_CACHE_REFILL_WRITE         = 0x53,
 
-       ARMV7_PERFCTR_SPEC_PC_WRITE             = 0x76,
+       ARMV7_A15_PERFCTR_PC_WRITE_SPEC                 = 0x76,
 };
 
 /*
@@ -197,13 +119,15 @@ enum armv7_a15_perf_types {
  * accesses/misses in hardware.
  */
 static const unsigned armv7_a8_perf_map[PERF_COUNT_HW_MAX] = {
-       [PERF_COUNT_HW_CPU_CYCLES]          = ARMV7_PERFCTR_CPU_CYCLES,
-       [PERF_COUNT_HW_INSTRUCTIONS]        = ARMV7_PERFCTR_INSTR_EXECUTED,
-       [PERF_COUNT_HW_CACHE_REFERENCES]    = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_CACHE_MISSES]        = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
-       [PERF_COUNT_HW_BRANCH_MISSES]       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
-       [PERF_COUNT_HW_BUS_CYCLES]          = ARMV7_PERFCTR_CLOCK_CYCLES,
+       [PERF_COUNT_HW_CPU_CYCLES]              = ARMV7_PERFCTR_CPU_CYCLES,
+       [PERF_COUNT_HW_INSTRUCTIONS]            = ARMV7_PERFCTR_INSTR_EXECUTED,
+       [PERF_COUNT_HW_CACHE_REFERENCES]        = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+       [PERF_COUNT_HW_CACHE_MISSES]            = ARMV7_PERFCTR_L1_DCACHE_REFILL,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]     = ARMV7_PERFCTR_PC_WRITE,
+       [PERF_COUNT_HW_BRANCH_MISSES]           = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+       [PERF_COUNT_HW_BUS_CYCLES]              = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV7_A8_PERFCTR_STALL_ISIDE,
+       [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]  = HW_OP_UNSUPPORTED,
 };
 
 static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
@@ -217,12 +141,12 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
                 * combined.
                 */
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_DCACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_DCACHE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_DCACHE_REFILL,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_DCACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_DCACHE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_DCACHE_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -231,12 +155,12 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        },
        [C(L1I)] = {
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_INST,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_INST_MISS,
+                       [C(RESULT_ACCESS)]      = ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_INST,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_INST_MISS,
+                       [C(RESULT_ACCESS)]      = ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -245,12 +169,12 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        },
        [C(LL)] = {
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L2_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L2_CACH_MISS,
+                       [C(RESULT_ACCESS)]      = ARMV7_A8_PERFCTR_L2_CACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_A8_PERFCTR_L2_CACHE_REFILL,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L2_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L2_CACH_MISS,
+                       [C(RESULT_ACCESS)]      = ARMV7_A8_PERFCTR_L2_CACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_A8_PERFCTR_L2_CACHE_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -274,11 +198,11 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(ITLB)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -287,14 +211,12 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        },
        [C(BPU)] = {
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_WRITE,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_WRITE,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -321,14 +243,15 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
  * Cortex-A9 HW events mapping
  */
 static const unsigned armv7_a9_perf_map[PERF_COUNT_HW_MAX] = {
-       [PERF_COUNT_HW_CPU_CYCLES]          = ARMV7_PERFCTR_CPU_CYCLES,
-       [PERF_COUNT_HW_INSTRUCTIONS]        =
-                                       ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE,
-       [PERF_COUNT_HW_CACHE_REFERENCES]    = ARMV7_PERFCTR_DCACHE_ACCESS,
-       [PERF_COUNT_HW_CACHE_MISSES]        = ARMV7_PERFCTR_DCACHE_REFILL,
-       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
-       [PERF_COUNT_HW_BRANCH_MISSES]       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
-       [PERF_COUNT_HW_BUS_CYCLES]          = ARMV7_PERFCTR_CLOCK_CYCLES,
+       [PERF_COUNT_HW_CPU_CYCLES]              = ARMV7_PERFCTR_CPU_CYCLES,
+       [PERF_COUNT_HW_INSTRUCTIONS]            = ARMV7_A9_PERFCTR_INSTR_CORE_RENAME,
+       [PERF_COUNT_HW_CACHE_REFERENCES]        = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+       [PERF_COUNT_HW_CACHE_MISSES]            = ARMV7_PERFCTR_L1_DCACHE_REFILL,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]     = ARMV7_PERFCTR_PC_WRITE,
+       [PERF_COUNT_HW_BRANCH_MISSES]           = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+       [PERF_COUNT_HW_BUS_CYCLES]              = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV7_A9_PERFCTR_STALL_ICACHE,
+       [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]  = ARMV7_A9_PERFCTR_STALL_DISPATCH,
 };
 
 static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
@@ -342,12 +265,12 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
                 * combined.
                 */
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_DCACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_DCACHE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_DCACHE_REFILL,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_DCACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_DCACHE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_DCACHE_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -357,11 +280,11 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(L1I)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_IFETCH_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_IFETCH_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -399,11 +322,11 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(ITLB)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -412,14 +335,12 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        },
        [C(BPU)] = {
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_WRITE,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_WRITE,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -446,13 +367,15 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
  * Cortex-A5 HW events mapping
  */
 static const unsigned armv7_a5_perf_map[PERF_COUNT_HW_MAX] = {
-       [PERF_COUNT_HW_CPU_CYCLES]          = ARMV7_PERFCTR_CPU_CYCLES,
-       [PERF_COUNT_HW_INSTRUCTIONS]        = ARMV7_PERFCTR_INSTR_EXECUTED,
-       [PERF_COUNT_HW_CACHE_REFERENCES]    = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_CACHE_MISSES]        = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
-       [PERF_COUNT_HW_BRANCH_MISSES]       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
-       [PERF_COUNT_HW_BUS_CYCLES]          = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_CPU_CYCLES]              = ARMV7_PERFCTR_CPU_CYCLES,
+       [PERF_COUNT_HW_INSTRUCTIONS]            = ARMV7_PERFCTR_INSTR_EXECUTED,
+       [PERF_COUNT_HW_CACHE_REFERENCES]        = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+       [PERF_COUNT_HW_CACHE_MISSES]            = ARMV7_PERFCTR_L1_DCACHE_REFILL,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]     = ARMV7_PERFCTR_PC_WRITE,
+       [PERF_COUNT_HW_BRANCH_MISSES]           = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+       [PERF_COUNT_HW_BUS_CYCLES]              = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]  = HW_OP_UNSUPPORTED,
 };
 
 static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
@@ -460,42 +383,34 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
                                        [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
        [C(L1D)] = {
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_DCACHE_ACCESS,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_DCACHE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_DCACHE_REFILL,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_DCACHE_ACCESS,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_DCACHE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_DCACHE_REFILL,
                },
                [C(OP_PREFETCH)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_PREFETCH_LINEFILL,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PREFETCH_LINEFILL_DROP,
+                       [C(RESULT_ACCESS)]      = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL,
+                       [C(RESULT_MISS)]        = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL_DROP,
                },
        },
        [C(L1I)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_IFETCH_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_IFETCH_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                /*
                 * The prefetch counters don't differentiate between the I
                 * side and the D side.
                 */
                [C(OP_PREFETCH)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_PREFETCH_LINEFILL,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PREFETCH_LINEFILL_DROP,
+                       [C(RESULT_ACCESS)]      = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL,
+                       [C(RESULT_MISS)]        = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL_DROP,
                },
        },
        [C(LL)] = {
@@ -529,11 +444,11 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(ITLB)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -543,13 +458,11 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(BPU)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -562,13 +475,15 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
  * Cortex-A15 HW events mapping
  */
 static const unsigned armv7_a15_perf_map[PERF_COUNT_HW_MAX] = {
-       [PERF_COUNT_HW_CPU_CYCLES]          = ARMV7_PERFCTR_CPU_CYCLES,
-       [PERF_COUNT_HW_INSTRUCTIONS]        = ARMV7_PERFCTR_INSTR_EXECUTED,
-       [PERF_COUNT_HW_CACHE_REFERENCES]    = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_CACHE_MISSES]        = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_SPEC_PC_WRITE,
-       [PERF_COUNT_HW_BRANCH_MISSES]       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
-       [PERF_COUNT_HW_BUS_CYCLES]          = ARMV7_PERFCTR_BUS_CYCLES,
+       [PERF_COUNT_HW_CPU_CYCLES]              = ARMV7_PERFCTR_CPU_CYCLES,
+       [PERF_COUNT_HW_INSTRUCTIONS]            = ARMV7_PERFCTR_INSTR_EXECUTED,
+       [PERF_COUNT_HW_CACHE_REFERENCES]        = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
+       [PERF_COUNT_HW_CACHE_MISSES]            = ARMV7_PERFCTR_L1_DCACHE_REFILL,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]     = ARMV7_A15_PERFCTR_PC_WRITE_SPEC,
+       [PERF_COUNT_HW_BRANCH_MISSES]           = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+       [PERF_COUNT_HW_BUS_CYCLES]              = ARMV7_PERFCTR_BUS_CYCLES,
+       [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]  = HW_OP_UNSUPPORTED,
 };
 
 static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
@@ -576,16 +491,12 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
                                        [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
        [C(L1D)] = {
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_L1_DCACHE_READ_ACCESS,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_L1_DCACHE_READ_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_READ,
+                       [C(RESULT_MISS)]        = ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_READ,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_L1_DCACHE_WRITE_ACCESS,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_L1_DCACHE_WRITE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_WRITE,
+                       [C(RESULT_MISS)]        = ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_WRITE,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -601,11 +512,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
                 */
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_IFETCH_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_IFETCH_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_L1_ICACHE_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -614,16 +525,12 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        },
        [C(LL)] = {
                [C(OP_READ)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_L2_DCACHE_READ_ACCESS,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_L2_DCACHE_READ_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_READ,
+                       [C(RESULT_MISS)]        = ARMV7_A15_PERFCTR_L2_CACHE_REFILL_READ,
                },
                [C(OP_WRITE)] = {
-                       [C(RESULT_ACCESS)]
-                                       = ARMV7_PERFCTR_L2_DCACHE_WRITE_ACCESS,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_L2_DCACHE_WRITE_REFILL,
+                       [C(RESULT_ACCESS)]      = ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_WRITE,
+                       [C(RESULT_MISS)]        = ARMV7_A15_PERFCTR_L2_CACHE_REFILL_WRITE,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -633,13 +540,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(DTLB)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_L1_DTLB_READ_REFILL,
+                       [C(RESULT_MISS)]        = ARMV7_A15_PERFCTR_DTLB_REFILL_L1_READ,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_L1_DTLB_WRITE_REFILL,
+                       [C(RESULT_MISS)]        = ARMV7_A15_PERFCTR_DTLB_REFILL_L1_WRITE,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -649,11 +554,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(ITLB)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
-                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_MISS,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_ITLB_REFILL,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
@@ -663,13 +568,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
        [C(BPU)] = {
                [C(OP_READ)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_WRITE)] = {
                        [C(RESULT_ACCESS)]      = ARMV7_PERFCTR_PC_BRANCH_PRED,
-                       [C(RESULT_MISS)]
-                                       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
+                       [C(RESULT_MISS)]        = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
                },
                [C(OP_PREFETCH)] = {
                        [C(RESULT_ACCESS)]      = CACHE_OP_UNSUPPORTED,
index e0cca10a8411d51d6a7cf1fadef714213a76de81..3b99d8269829b971db3d8f0618629c77d8317c5a 100644 (file)
@@ -48,13 +48,15 @@ enum xscale_counters {
 };
 
 static const unsigned xscale_perf_map[PERF_COUNT_HW_MAX] = {
-       [PERF_COUNT_HW_CPU_CYCLES]          = XSCALE_PERFCTR_CCNT,
-       [PERF_COUNT_HW_INSTRUCTIONS]        = XSCALE_PERFCTR_INSTRUCTION,
-       [PERF_COUNT_HW_CACHE_REFERENCES]    = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_CACHE_MISSES]        = HW_OP_UNSUPPORTED,
-       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = XSCALE_PERFCTR_BRANCH,
-       [PERF_COUNT_HW_BRANCH_MISSES]       = XSCALE_PERFCTR_BRANCH_MISS,
-       [PERF_COUNT_HW_BUS_CYCLES]          = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_CPU_CYCLES]              = XSCALE_PERFCTR_CCNT,
+       [PERF_COUNT_HW_INSTRUCTIONS]            = XSCALE_PERFCTR_INSTRUCTION,
+       [PERF_COUNT_HW_CACHE_REFERENCES]        = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_CACHE_MISSES]            = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]     = XSCALE_PERFCTR_BRANCH,
+       [PERF_COUNT_HW_BRANCH_MISSES]           = XSCALE_PERFCTR_BRANCH_MISS,
+       [PERF_COUNT_HW_BUS_CYCLES]              = HW_OP_UNSUPPORTED,
+       [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = XSCALE_PERFCTR_ICACHE_NO_DELIVER,
+       [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]  = HW_OP_UNSUPPORTED,
 };
 
 static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
index 3d0c6fb74ae4efe521cfc563ea11e0fa9738d465..17859ce4e7be3326902b6b828fab9a6ec4d1c190 100644 (file)
@@ -57,7 +57,7 @@ static const char *isa_modes[] = {
   "ARM" , "Thumb" , "Jazelle", "ThumbEE"
 };
 
-extern void setup_mm_for_reboot(char mode);
+extern void setup_mm_for_reboot(void);
 
 static volatile int hlt_counter;
 
@@ -92,7 +92,7 @@ static int __init hlt_setup(char *__unused)
 __setup("nohlt", nohlt_setup);
 __setup("hlt", hlt_setup);
 
-void arm_machine_restart(char mode, const char *cmd)
+void soft_restart(unsigned long addr)
 {
        /* Disable interrupts first */
        local_irq_disable();
@@ -103,7 +103,7 @@ void arm_machine_restart(char mode, const char *cmd)
         * we may need it to insert some 1:1 mappings so that
         * soft boot works.
         */
-       setup_mm_for_reboot(mode);
+       setup_mm_for_reboot();
 
        /* Clean and invalidate caches */
        flush_cache_all();
@@ -114,18 +114,11 @@ void arm_machine_restart(char mode, const char *cmd)
        /* Push out any further dirty data, and ensure cache is empty */
        flush_cache_all();
 
-       /*
-        * Now call the architecture specific reboot code.
-        */
-       arch_reset(mode, cmd);
+       cpu_reset(addr);
+}
 
-       /*
-        * Whoops - the architecture was unable to reboot.
-        * Tell the user!
-        */
-       mdelay(1000);
-       printk("Reboot failed -- System halted\n");
-       while (1);
+static void null_restart(char mode, const char *cmd)
+{
 }
 
 /*
@@ -134,7 +127,7 @@ void arm_machine_restart(char mode, const char *cmd)
 void (*pm_power_off)(void);
 EXPORT_SYMBOL(pm_power_off);
 
-void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart;
+void (*arm_pm_restart)(char str, const char *cmd) = null_restart;
 EXPORT_SYMBOL_GPL(arm_pm_restart);
 
 static void do_nothing(void *unused)
@@ -253,7 +246,15 @@ void machine_power_off(void)
 void machine_restart(char *cmd)
 {
        machine_shutdown();
+
        arm_pm_restart(reboot_mode, cmd);
+
+       /* Give a grace period for failure to restart of 1s */
+       mdelay(1000);
+
+       /* Whoops - the platform was unable to reboot. Tell the user! */
+       printk("Reboot failed -- System halted\n");
+       while (1);
 }
 
 void __show_regs(struct pt_regs *regs)
index 3448a3f9cc8c90ae71809075f1cc9c2d313fe167..d90a8fae1d4963178bb2447551591878e1076bd8 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/memblock.h>
 #include <linux/bug.h>
 #include <linux/compiler.h>
+#include <linux/sort.h>
 
 #include <asm/unified.h>
 #include <asm/cpu.h>
@@ -890,13 +891,17 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
        return mdesc;
 }
 
+static int __init meminfo_cmp(const void *_a, const void *_b)
+{
+       const struct membank *a = _a, *b = _b;
+       long cmp = bank_pfn_start(a) - bank_pfn_start(b);
+       return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
 
 void __init setup_arch(char **cmdline_p)
 {
        struct machine_desc *mdesc;
 
-       unwind_init();
-
        setup_processor();
        mdesc = setup_machine_fdt(__atags_pointer);
        if (!mdesc)
@@ -904,8 +909,8 @@ void __init setup_arch(char **cmdline_p)
        machine_desc = mdesc;
        machine_name = mdesc->name;
 
-       if (mdesc->soft_reboot)
-               reboot_setup("s");
+       if (mdesc->restart_mode)
+               reboot_setup(&mdesc->restart_mode);
 
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
@@ -918,12 +923,16 @@ void __init setup_arch(char **cmdline_p)
 
        parse_early_param();
 
+       sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
        sanity_check_meminfo();
        arm_memblock_init(&meminfo, mdesc);
 
        paging_init(mdesc);
        request_standard_resources(mdesc);
 
+       if (mdesc->restart)
+               arm_pm_restart = mdesc->restart;
+
        unflatten_device_tree();
 
 #ifdef CONFIG_SMP
index 020e99c845e722c2928b1fd9816b23e85fbc9d5a..1f268bda45528ebd0e52c88ddb9bdf40f5e12e03 100644 (file)
@@ -54,14 +54,18 @@ ENDPROC(cpu_suspend_abort)
  * r0 = control register value
  */
        .align  5
+       .pushsection    .idmap.text,"ax"
 ENTRY(cpu_resume_mmu)
        ldr     r3, =cpu_resume_after_mmu
+       instr_sync
        mcr     p15, 0, r0, c1, c0, 0   @ turn on MMU, I-cache, etc
        mrc     p15, 0, r0, c0, c0, 0   @ read id reg
+       instr_sync
        mov     r0, r0
        mov     r0, r0
        mov     pc, r3                  @ jump to virtual address
 ENDPROC(cpu_resume_mmu)
+       .popsection
 cpu_resume_after_mmu:
        bl      cpu_init                @ restore the und/abt/irq banked regs
        mov     r0, #0                  @ return zero on success
index ef5640b9e218fae4cd3b32cdf1e6482c2ea0cdbf..76ff28d87bf3f229b5cb9028bba1ad311abcd655 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/cpu.h>
 #include <asm/cputype.h>
 #include <asm/exception.h>
+#include <asm/idmap.h>
 #include <asm/topology.h>
 #include <asm/mmu_context.h>
 #include <asm/pgtable.h>
@@ -61,7 +62,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
 {
        struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
        struct task_struct *idle = ci->idle;
-       pgd_t *pgd;
        int ret;
 
        /*
@@ -83,30 +83,12 @@ int __cpuinit __cpu_up(unsigned int cpu)
                init_idle(idle, cpu);
        }
 
-       /*
-        * Allocate initial page tables to allow the new CPU to
-        * enable the MMU safely.  This essentially means a set
-        * of our "standard" page tables, with the addition of
-        * a 1:1 mapping for the physical address of the kernel.
-        */
-       pgd = pgd_alloc(&init_mm);
-       if (!pgd)
-               return -ENOMEM;
-
-       if (PHYS_OFFSET != PAGE_OFFSET) {
-#ifndef CONFIG_HOTPLUG_CPU
-               identity_mapping_add(pgd, __pa(__init_begin), __pa(__init_end));
-#endif
-               identity_mapping_add(pgd, __pa(_stext), __pa(_etext));
-               identity_mapping_add(pgd, __pa(_sdata), __pa(_edata));
-       }
-
        /*
         * We need to tell the secondary core where to find
         * its stack and the page tables.
         */
        secondary_data.stack = task_stack_page(idle) + THREAD_START_SP;
-       secondary_data.pgdir = virt_to_phys(pgd);
+       secondary_data.pgdir = virt_to_phys(idmap_pgd);
        secondary_data.swapper_pg_dir = virt_to_phys(swapper_pg_dir);
        __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data));
        outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
@@ -142,16 +124,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
        secondary_data.stack = NULL;
        secondary_data.pgdir = 0;
 
-       if (PHYS_OFFSET != PAGE_OFFSET) {
-#ifndef CONFIG_HOTPLUG_CPU
-               identity_mapping_del(pgd, __pa(__init_begin), __pa(__init_end));
-#endif
-               identity_mapping_del(pgd, __pa(_stext), __pa(_etext));
-               identity_mapping_del(pgd, __pa(_sdata), __pa(_edata));
-       }
-
-       pgd_free(&init_mm, pgd);
-
        return ret;
 }
 
index 93a22d282c167c1ad9753c81277c8948d153e933..1794cc3b0f1836583fec297ee484c554fdefffcd 100644 (file)
@@ -1,13 +1,12 @@
 #include <linux/init.h>
 
+#include <asm/idmap.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/memory.h>
 #include <asm/suspend.h>
 #include <asm/tlbflush.h>
 
-static pgd_t *suspend_pgd;
-
 extern int __cpu_suspend(unsigned long, int (*)(unsigned long));
 extern void cpu_resume_mmu(void);
 
@@ -21,7 +20,7 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
        *save_ptr = virt_to_phys(ptr);
 
        /* This must correspond to the LDM in cpu_resume() assembly */
-       *ptr++ = virt_to_phys(suspend_pgd);
+       *ptr++ = virt_to_phys(idmap_pgd);
        *ptr++ = sp;
        *ptr++ = virt_to_phys(cpu_do_resume);
 
@@ -42,7 +41,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
        struct mm_struct *mm = current->active_mm;
        int ret;
 
-       if (!suspend_pgd)
+       if (!idmap_pgd)
                return -EINVAL;
 
        /*
@@ -59,14 +58,3 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
 
        return ret;
 }
-
-static int __init cpu_suspend_init(void)
-{
-       suspend_pgd = pgd_alloc(&init_mm);
-       if (suspend_pgd) {
-               unsigned long addr = virt_to_phys(cpu_resume_mmu);
-               identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE);
-       }
-       return suspend_pgd ? 0 : -ENOMEM;
-}
-core_initcall(cpu_suspend_init);
index e7e8365795c3d3272a4ef56d34d41662acd608b8..3f03fe0c3269d9993ece6e05ae47439605a4ff1c 100644 (file)
@@ -67,7 +67,7 @@ EXPORT_SYMBOL(__aeabi_unwind_cpp_pr2);
 
 struct unwind_ctrl_block {
        unsigned long vrs[16];          /* virtual register set */
-       unsigned long *insn;            /* pointer to the current instructions word */
+       const unsigned long *insn;      /* pointer to the current instructions word */
        int entries;                    /* number of entries left to interpret */
        int byte;                       /* current byte number in the instructions word */
 };
@@ -83,8 +83,9 @@ enum regs {
        PC = 15
 };
 
-extern struct unwind_idx __start_unwind_idx[];
-extern struct unwind_idx __stop_unwind_idx[];
+extern const struct unwind_idx __start_unwind_idx[];
+static const struct unwind_idx *__origin_unwind_idx;
+extern const struct unwind_idx __stop_unwind_idx[];
 
 static DEFINE_SPINLOCK(unwind_lock);
 static LIST_HEAD(unwind_tables);
@@ -98,45 +99,99 @@ static LIST_HEAD(unwind_tables);
 })
 
 /*
- * Binary search in the unwind index. The entries entries are
+ * Binary search in the unwind index. The entries are
  * guaranteed to be sorted in ascending order by the linker.
+ *
+ * start = first entry
+ * origin = first entry with positive offset (or stop if there is no such entry)
+ * stop - 1 = last entry
  */
-static struct unwind_idx *search_index(unsigned long addr,
-                                      struct unwind_idx *first,
-                                      struct unwind_idx *last)
+static const struct unwind_idx *search_index(unsigned long addr,
+                                      const struct unwind_idx *start,
+                                      const struct unwind_idx *origin,
+                                      const struct unwind_idx *stop)
 {
-       pr_debug("%s(%08lx, %p, %p)\n", __func__, addr, first, last);
+       unsigned long addr_prel31;
+
+       pr_debug("%s(%08lx, %p, %p, %p)\n",
+                       __func__, addr, start, origin, stop);
+
+       /*
+        * only search in the section with the matching sign. This way the
+        * prel31 numbers can be compared as unsigned longs.
+        */
+       if (addr < (unsigned long)start)
+               /* negative offsets: [start; origin) */
+               stop = origin;
+       else
+               /* positive offsets: [origin; stop) */
+               start = origin;
+
+       /* prel31 for address relavive to start */
+       addr_prel31 = (addr - (unsigned long)start) & 0x7fffffff;
 
-       if (addr < first->addr) {
+       while (start < stop - 1) {
+               const struct unwind_idx *mid = start + ((stop - start) >> 1);
+
+               /*
+                * As addr_prel31 is relative to start an offset is needed to
+                * make it relative to mid.
+                */
+               if (addr_prel31 - ((unsigned long)mid - (unsigned long)start) <
+                               mid->addr_offset)
+                       stop = mid;
+               else {
+                       /* keep addr_prel31 relative to start */
+                       addr_prel31 -= ((unsigned long)mid -
+                                       (unsigned long)start);
+                       start = mid;
+               }
+       }
+
+       if (likely(start->addr_offset <= addr_prel31))
+               return start;
+       else {
                pr_warning("unwind: Unknown symbol address %08lx\n", addr);
                return NULL;
-       } else if (addr >= last->addr)
-               return last;
+       }
+}
 
-       while (first < last - 1) {
-               struct unwind_idx *mid = first + ((last - first + 1) >> 1);
+static const struct unwind_idx *unwind_find_origin(
+               const struct unwind_idx *start, const struct unwind_idx *stop)
+{
+       pr_debug("%s(%p, %p)\n", __func__, start, stop);
+       while (start < stop - 1) {
+               const struct unwind_idx *mid = start + ((stop - start) >> 1);
 
-               if (addr < mid->addr)
-                       last = mid;
+               if (mid->addr_offset >= 0x40000000)
+                       /* negative offset */
+                       start = mid;
                else
-                       first = mid;
+                       /* positive offset */
+                       stop = mid;
        }
-
-       return first;
+       pr_debug("%s -> %p\n", __func__, stop);
+       return stop;
 }
 
-static struct unwind_idx *unwind_find_idx(unsigned long addr)
+static const struct unwind_idx *unwind_find_idx(unsigned long addr)
 {
-       struct unwind_idx *idx = NULL;
+       const struct unwind_idx *idx = NULL;
        unsigned long flags;
 
        pr_debug("%s(%08lx)\n", __func__, addr);
 
-       if (core_kernel_text(addr))
+       if (core_kernel_text(addr)) {
+               if (unlikely(!__origin_unwind_idx))
+                       __origin_unwind_idx =
+                               unwind_find_origin(__start_unwind_idx,
+                                               __stop_unwind_idx);
+
                /* main unwind table */
                idx = search_index(addr, __start_unwind_idx,
-                                  __stop_unwind_idx - 1);
-       else {
+                                  __origin_unwind_idx,
+                                  __stop_unwind_idx);
+       } else {
                /* module unwind tables */
                struct unwind_table *table;
 
@@ -145,7 +200,8 @@ static struct unwind_idx *unwind_find_idx(unsigned long addr)
                        if (addr >= table->begin_addr &&
                            addr < table->end_addr) {
                                idx = search_index(addr, table->start,
-                                                  table->stop - 1);
+                                                  table->origin,
+                                                  table->stop);
                                /* Move-to-front to exploit common traces */
                                list_move(&table->list, &unwind_tables);
                                break;
@@ -274,7 +330,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
 int unwind_frame(struct stackframe *frame)
 {
        unsigned long high, low;
-       struct unwind_idx *idx;
+       const struct unwind_idx *idx;
        struct unwind_ctrl_block ctrl;
 
        /* only go to a higher address on the stack */
@@ -399,7 +455,6 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
                                      unsigned long text_size)
 {
        unsigned long flags;
-       struct unwind_idx *idx;
        struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL);
 
        pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size,
@@ -408,15 +463,12 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
        if (!tab)
                return tab;
 
-       tab->start = (struct unwind_idx *)start;
-       tab->stop = (struct unwind_idx *)(start + size);
+       tab->start = (const struct unwind_idx *)start;
+       tab->stop = (const struct unwind_idx *)(start + size);
+       tab->origin = unwind_find_origin(tab->start, tab->stop);
        tab->begin_addr = text_addr;
        tab->end_addr = text_addr + text_size;
 
-       /* Convert the symbol addresses to absolute values */
-       for (idx = tab->start; idx < tab->stop; idx++)
-               idx->addr = prel31_to_addr(&idx->addr);
-
        spin_lock_irqsave(&unwind_lock, flags);
        list_add_tail(&tab->list, &unwind_tables);
        spin_unlock_irqrestore(&unwind_lock, flags);
@@ -437,16 +489,3 @@ void unwind_table_del(struct unwind_table *tab)
 
        kfree(tab);
 }
-
-int __init unwind_init(void)
-{
-       struct unwind_idx *idx;
-
-       /* Convert the symbol addresses to absolute values */
-       for (idx = __start_unwind_idx; idx < __stop_unwind_idx; idx++)
-               idx->addr = prel31_to_addr(&idx->addr);
-
-       pr_debug("unwind: ARM stack unwinding initialised\n");
-
-       return 0;
-}
index 20b3041e0860f7c743f4e453a38c9ce738a10e75..f76e75548670e97eeac9112a8e48b53e37f9cc91 100644 (file)
        *(.proc.info.init)                                              \
        VMLINUX_SYMBOL(__proc_info_end) = .;
 
+#define IDMAP_TEXT                                                     \
+       ALIGN_FUNCTION();                                               \
+       VMLINUX_SYMBOL(__idmap_text_start) = .;                         \
+       *(.idmap.text)                                                  \
+       VMLINUX_SYMBOL(__idmap_text_end) = .;
+
 #ifdef CONFIG_HOTPLUG_CPU
 #define ARM_CPU_DISCARD(x)
 #define ARM_CPU_KEEP(x)                x
@@ -92,6 +98,7 @@ SECTIONS
                        SCHED_TEXT
                        LOCK_TEXT
                        KPROBES_TEXT
+                       IDMAP_TEXT
 #ifdef CONFIG_MMU
                        *(.fixup)
 #endif
index d111c3e9924986d206d0df439d12674e0a4855c8..4f991f2952846fb89d36be0758c255a4014b575a 100644 (file)
@@ -3,6 +3,12 @@ if ARCH_AT91
 config HAVE_AT91_DATAFLASH_CARD
        bool
 
+config HAVE_AT91_DBGU0
+       bool
+
+config HAVE_AT91_DBGU1
+       bool
+
 config HAVE_AT91_USART3
        bool
 
@@ -21,12 +27,14 @@ config ARCH_AT91RM9200
        bool "AT91RM9200"
        select CPU_ARM920T
        select GENERIC_CLOCKEVENTS
+       select HAVE_AT91_DBGU0
        select HAVE_AT91_USART3
 
 config ARCH_AT91SAM9260
        bool "AT91SAM9260 or AT91SAM9XE"
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
+       select HAVE_AT91_DBGU0
        select HAVE_AT91_USART3
        select HAVE_AT91_USART4
        select HAVE_AT91_USART5
@@ -37,11 +45,13 @@ config ARCH_AT91SAM9261
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
        select HAVE_FB_ATMEL
+       select HAVE_AT91_DBGU0
 
 config ARCH_AT91SAM9G10
        bool "AT91SAM9G10"
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
+       select HAVE_AT91_DBGU0
        select HAVE_FB_ATMEL
 
 config ARCH_AT91SAM9263
@@ -50,6 +60,7 @@ config ARCH_AT91SAM9263
        select GENERIC_CLOCKEVENTS
        select HAVE_FB_ATMEL
        select HAVE_NET_MACB
+       select HAVE_AT91_DBGU1
 
 config ARCH_AT91SAM9RL
        bool "AT91SAM9RL"
@@ -57,11 +68,13 @@ config ARCH_AT91SAM9RL
        select GENERIC_CLOCKEVENTS
        select HAVE_AT91_USART3
        select HAVE_FB_ATMEL
+       select HAVE_AT91_DBGU0
 
 config ARCH_AT91SAM9G20
        bool "AT91SAM9G20"
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
+       select HAVE_AT91_DBGU0
        select HAVE_AT91_USART3
        select HAVE_AT91_USART4
        select HAVE_AT91_USART5
@@ -74,6 +87,7 @@ config ARCH_AT91SAM9G45
        select HAVE_AT91_USART3
        select HAVE_FB_ATMEL
        select HAVE_NET_MACB
+       select HAVE_AT91_DBGU1
 
 config ARCH_AT91CAP9
        bool "AT91CAP9"
@@ -81,6 +95,7 @@ config ARCH_AT91CAP9
        select GENERIC_CLOCKEVENTS
        select HAVE_FB_ATMEL
        select HAVE_NET_MACB
+       select HAVE_AT91_DBGU1
 
 config ARCH_AT91X40
        bool "AT91x40"
@@ -510,8 +525,13 @@ config AT91_TIMER_HZ
 choice
        prompt "Select a UART for early kernel messages"
 
-config AT91_EARLY_DBGU
-       bool "DBGU"
+config AT91_EARLY_DBGU0
+       bool "DBGU on rm9200, 9260/9g20, 9261/9g10 and 9rl"
+       depends on HAVE_AT91_DBGU0
+
+config AT91_EARLY_DBGU1
+       bool "DBGU on 9263, 9g45 and cap9"
+       depends on HAVE_AT91_DBGU1
 
 config AT91_EARLY_USART0
        bool "USART0"
index ecdd54dd68c6c0139d10ca50595283bcf94545d7..edb879ac04c8e30c3d2b814f24497ae86075e7be 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/pm.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <mach/at91cap9.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
-#include <mach/at91_shdwc.h>
 
 #include "soc.h"
 #include "generic.h"
 #include "clock.h"
+#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Clocks
@@ -137,7 +136,7 @@ static struct clk pwm_clk = {
        .type           = CLK_TYPE_PERIPHERAL,
 };
 static struct clk macb_clk = {
-       .name           = "macb_clk",
+       .name           = "pclk",
        .pmc_mask       = 1 << AT91CAP9_ID_EMAC,
        .type           = CLK_TYPE_PERIPHERAL,
 };
@@ -210,6 +209,8 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
+       /* One additional fake clock for macb_hclk */
+       CLKDEV_CON_ID("hclk", &macb_clk),
        CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
        CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
        CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
@@ -221,6 +222,10 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
+       CLKDEV_CON_ID("pioA", &pioABCD_clk),
+       CLKDEV_CON_ID("pioB", &pioABCD_clk),
+       CLKDEV_CON_ID("pioC", &pioABCD_clk),
+       CLKDEV_CON_ID("pioD", &pioABCD_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
@@ -293,37 +298,27 @@ void __init at91cap9_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91cap9_gpio[] = {
+static struct at91_gpio_bank at91cap9_gpio[] __initdata = {
        {
                .id             = AT91CAP9_ID_PIOABCD,
-               .offset         = AT91_PIOA,
-               .clock          = &pioABCD_clk,
+               .regbase        = AT91CAP9_BASE_PIOA,
        }, {
                .id             = AT91CAP9_ID_PIOABCD,
-               .offset         = AT91_PIOB,
-               .clock          = &pioABCD_clk,
+               .regbase        = AT91CAP9_BASE_PIOB,
        }, {
                .id             = AT91CAP9_ID_PIOABCD,
-               .offset         = AT91_PIOC,
-               .clock          = &pioABCD_clk,
+               .regbase        = AT91CAP9_BASE_PIOC,
        }, {
                .id             = AT91CAP9_ID_PIOABCD,
-               .offset         = AT91_PIOD,
-               .clock          = &pioABCD_clk,
+               .regbase        = AT91CAP9_BASE_PIOD,
        }
 };
 
-static void at91cap9_reset(void)
+static void at91cap9_restart(char mode, const char *cmd)
 {
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
-static void at91cap9_poweroff(void)
-{
-       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
-}
-
-
 /* --------------------------------------------------------------------
  *  AT91CAP9 processor initialization
  * -------------------------------------------------------------------- */
@@ -333,10 +328,16 @@ static void __init at91cap9_map_io(void)
        at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE);
 }
 
+static void __init at91cap9_ioremap_registers(void)
+{
+       at91_ioremap_shdwc(AT91CAP9_BASE_SHDWC);
+       at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT);
+       at91sam9_ioremap_smc(0, AT91CAP9_BASE_SMC);
+}
+
 static void __init at91cap9_initialize(void)
 {
-       at91_arch_reset = at91cap9_reset;
-       pm_power_off = at91cap9_poweroff;
+       arm_pm_restart = at91cap9_restart;
        at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
 
        /* Register GPIO subsystem */
@@ -394,6 +395,7 @@ static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = {
 struct at91_init_soc __initdata at91cap9_soc = {
        .map_io = at91cap9_map_io,
        .default_irq_priority = at91cap9_default_irq_priority,
+       .ioremap_registers = at91cap9_ioremap_registers,
        .register_clocks = at91cap9_register_clocks,
        .init = at91cap9_initialize,
 };
index adad70db70eb8ce62191a481764efe2d09ee2bae..d298fb7cb210379a771ee52c98b05260a378769c 100644 (file)
@@ -76,7 +76,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)
 
        /* Enable VBus control for UHP ports */
        for (i = 0; i < data->ports; i++) {
-               if (data->vbus_pin[i])
+               if (gpio_is_valid(data->vbus_pin[i]))
                        at91_set_gpio_output(data->vbus_pin[i], 0);
        }
 
@@ -179,7 +179,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data)
        usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep);
        memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));
 
-       if (data && data->vbus_pin > 0) {
+       if (data && gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
                usba_udc_data.pdata.vbus_pin = data->vbus_pin;
@@ -200,7 +200,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
 
 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
 static u64 eth_dmamask = DMA_BIT_MASK(32);
-static struct at91_eth_data eth_data;
+static struct macb_platform_data eth_data;
 
 static struct resource eth_resources[] = {
        [0] = {
@@ -227,12 +227,12 @@ static struct platform_device at91cap9_eth_device = {
        .num_resources  = ARRAY_SIZE(eth_resources),
 };
 
-void __init at91_add_device_eth(struct at91_eth_data *data)
+void __init at91_add_device_eth(struct macb_platform_data *data)
 {
        if (!data)
                return;
 
-       if (data->phy_irq_pin) {
+       if (gpio_is_valid(data->phy_irq_pin)) {
                at91_set_gpio_input(data->phy_irq_pin, 0);
                at91_set_deglitch(data->phy_irq_pin, 1);
        }
@@ -264,7 +264,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
        platform_device_register(&at91cap9_eth_device);
 }
 #else
-void __init at91_add_device_eth(struct at91_eth_data *data) {}
+void __init at91_add_device_eth(struct macb_platform_data *data) {}
 #endif
 
 
@@ -332,13 +332,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
                return;
 
        /* input/irq */
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
-       if (data->wp_pin)
+       if (gpio_is_valid(data->wp_pin))
                at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
 
        if (mmc_id == 0) {              /* MCI0 */
@@ -398,8 +398,8 @@ static struct resource nand_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_BASE_SYS + AT91_ECC,
-               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .start  = AT91CAP9_BASE_ECC,
+               .end    = AT91CAP9_BASE_ECC + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -425,15 +425,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        nand_data = *data;
@@ -670,8 +670,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt_resources[] = {
        {
-               .start  = AT91_BASE_SYS + AT91_RTT,
-               .end    = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+               .start  = AT91CAP9_BASE_RTT,
+               .end    = AT91CAP9_BASE_RTT + SZ_16 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -694,10 +694,19 @@ static void __init at91_add_device_rtt(void)
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
+static struct resource wdt_resources[] = {
+       {
+               .start  = AT91CAP9_BASE_WDT,
+               .end    = AT91CAP9_BASE_WDT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91cap9_wdt_device = {
        .name           = "at91_wdt",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = wdt_resources,
+       .num_resources  = ARRAY_SIZE(wdt_resources),
 };
 
 static void __init at91_add_device_watchdog(void)
@@ -807,7 +816,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)
        at91_set_A_periph(AT91_PIN_PA9, 0);     /* AC97RX */
 
        /* reset */
-       if (data->reset_pin)
+       if (gpio_is_valid(data->reset_pin))
                at91_set_gpio_output(data->reset_pin, 0);
 
        ac97_data = *data;
@@ -1021,8 +1030,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 #if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91CAP9_BASE_DBGU,
+               .end    = AT91CAP9_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
index 713d3bdbd28447a7280adb746f4acc13af602cfd..99c3174e24a2262d1ff4e5d2cef8a7e54ecef33b 100644 (file)
@@ -23,6 +23,7 @@
 #include "soc.h"
 #include "generic.h"
 #include "clock.h"
+#include "sam9_smc.h"
 
 static struct map_desc at91rm9200_io_desc[] __initdata = {
        {
@@ -195,6 +196,10 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
+       CLKDEV_CON_ID("pioA", &pioA_clk),
+       CLKDEV_CON_ID("pioB", &pioB_clk),
+       CLKDEV_CON_ID("pioC", &pioC_clk),
+       CLKDEV_CON_ID("pioD", &pioD_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
@@ -268,27 +273,23 @@ void __init at91rm9200_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91rm9200_gpio[] = {
+static struct at91_gpio_bank at91rm9200_gpio[] __initdata = {
        {
                .id             = AT91RM9200_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
+               .regbase        = AT91RM9200_BASE_PIOA,
        }, {
                .id             = AT91RM9200_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
+               .regbase        = AT91RM9200_BASE_PIOB,
        }, {
                .id             = AT91RM9200_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
+               .regbase        = AT91RM9200_BASE_PIOC,
        }, {
                .id             = AT91RM9200_ID_PIOD,
-               .offset         = AT91_PIOD,
-               .clock          = &pioD_clk,
+               .regbase        = AT91RM9200_BASE_PIOD,
        }
 };
 
-static void at91rm9200_reset(void)
+static void at91rm9200_restart(char mode, const char *cmd)
 {
        /*
         * Perform a hardware reset with the use of the Watchdog timer.
@@ -307,9 +308,13 @@ static void __init at91rm9200_map_io(void)
        iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
 }
 
+static void __init at91rm9200_ioremap_registers(void)
+{
+}
+
 static void __init at91rm9200_initialize(void)
 {
-       at91_arch_reset = at91rm9200_reset;
+       arm_pm_restart = at91rm9200_restart;
        at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
                        | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
                        | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
@@ -366,6 +371,7 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
 struct at91_init_soc __initdata at91rm9200_soc = {
        .map_io = at91rm9200_map_io,
        .default_irq_priority = at91rm9200_default_irq_priority,
+       .ioremap_registers = at91rm9200_ioremap_registers,
        .register_clocks = at91rm9200_register_clocks,
        .init = at91rm9200_initialize,
 };
index ad930688358ca1c5683e984dc1b85799b582c5c0..18bacec2b094c202bc9dd60be5b69be0c56a683f 100644 (file)
@@ -114,11 +114,11 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
        if (!data)
                return;
 
-       if (data->vbus_pin) {
+       if (gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
        }
-       if (data->pullup_pin)
+       if (gpio_is_valid(data->pullup_pin))
                at91_set_gpio_output(data->pullup_pin, 0);
 
        udc_data = *data;
@@ -135,7 +135,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
 
 #if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
 static u64 eth_dmamask = DMA_BIT_MASK(32);
-static struct at91_eth_data eth_data;
+static struct macb_platform_data eth_data;
 
 static struct resource eth_resources[] = {
        [0] = {
@@ -162,12 +162,12 @@ static struct platform_device at91rm9200_eth_device = {
        .num_resources  = ARRAY_SIZE(eth_resources),
 };
 
-void __init at91_add_device_eth(struct at91_eth_data *data)
+void __init at91_add_device_eth(struct macb_platform_data *data)
 {
        if (!data)
                return;
 
-       if (data->phy_irq_pin) {
+       if (gpio_is_valid(data->phy_irq_pin)) {
                at91_set_gpio_input(data->phy_irq_pin, 0);
                at91_set_deglitch(data->phy_irq_pin, 1);
        }
@@ -199,7 +199,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
        platform_device_register(&at91rm9200_eth_device);
 }
 #else
-void __init at91_add_device_eth(struct at91_eth_data *data) {}
+void __init at91_add_device_eth(struct macb_platform_data *data) {}
 #endif
 
 
@@ -260,7 +260,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        );
 
        /* input/irq */
-       if (data->irq_pin) {
+       if (gpio_is_valid(data->irq_pin)) {
                at91_set_gpio_input(data->irq_pin, 1);
                at91_set_deglitch(data->irq_pin, 1);
        }
@@ -268,7 +268,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        at91_set_deglitch(data->det_pin, 1);
 
        /* outputs, initially off */
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
        at91_set_gpio_output(data->rst_pin, 0);
 
@@ -328,13 +328,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
                return;
 
        /* input/irq */
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
-       if (data->wp_pin)
+       if (gpio_is_valid(data->wp_pin))
                at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
 
        /* CLK */
@@ -419,15 +419,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        );
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        at91_set_A_periph(AT91_PIN_PC1, 0);             /* SMOE */
@@ -665,10 +665,24 @@ static void __init at91_add_device_tc(void) { }
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
+static struct resource rtc_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_RTC,
+               .end    = AT91RM9200_BASE_RTC + SZ_256 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_SYS,
+               .end    = AT91_ID_SYS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
 static struct platform_device at91rm9200_rtc_device = {
        .name           = "at91_rtc",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = rtc_resources,
+       .num_resources  = ARRAY_SIZE(rtc_resources),
 };
 
 static void __init at91_add_device_rtc(void)
@@ -877,8 +891,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 #if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91RM9200_BASE_DBGU,
+               .end    = AT91RM9200_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
index 1dd69c85dfecc4c3583bd9cc511a675b3376bf45..a028cdf8f9749d8ad4da1aef23386da5850330c4 100644 (file)
@@ -32,6 +32,8 @@ static unsigned long last_crtr;
 static u32 irqmask;
 static struct clock_event_device clkevt;
 
+#define RM9200_TIMER_LATCH     ((AT91_SLOW_CLOCK + HZ/2) / HZ)
+
 /*
  * The ST_CRTR is updated asynchronously to the master clock ... but
  * the updates as seen by the CPU don't seem to be strictly monotonic.
@@ -74,8 +76,8 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
        if (sr & AT91_ST_PITS) {
                u32     crtr = read_CRTR();
 
-               while (((crtr - last_crtr) & AT91_ST_CRTV) >= LATCH) {
-                       last_crtr += LATCH;
+               while (((crtr - last_crtr) & AT91_ST_CRTV) >= RM9200_TIMER_LATCH) {
+                       last_crtr += RM9200_TIMER_LATCH;
                        clkevt.event_handler(&clkevt);
                }
                return IRQ_HANDLED;
@@ -116,7 +118,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
        case CLOCK_EVT_MODE_PERIODIC:
                /* PIT for periodic irqs; fixed rate of 1/HZ */
                irqmask = AT91_ST_PITS;
-               at91_sys_write(AT91_ST_PIMR, LATCH);
+               at91_sys_write(AT91_ST_PIMR, RM9200_TIMER_LATCH);
                break;
        case CLOCK_EVT_MODE_ONESHOT:
                /* ALM for oneshot irqs, set by next_event()
index 0d20677fbef027591c91c2d442d528f7fa6c73f0..5e46e4a96430d90e793343115cbce42001e5cecc 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/pm.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <mach/at91sam9260.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
-#include <mach/at91_shdwc.h>
 
 #include "soc.h"
 #include "generic.h"
 #include "clock.h"
+#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Clocks
@@ -120,7 +119,7 @@ static struct clk ohci_clk = {
        .type           = CLK_TYPE_PERIPHERAL,
 };
 static struct clk macb_clk = {
-       .name           = "macb_clk",
+       .name           = "pclk",
        .pmc_mask       = 1 << AT91SAM9260_ID_EMAC,
        .type           = CLK_TYPE_PERIPHERAL,
 };
@@ -190,6 +189,8 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
+       /* One additional fake clock for macb_hclk */
+       CLKDEV_CON_ID("hclk", &macb_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
@@ -209,6 +210,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
+       CLKDEV_CON_ID("pioA", &pioA_clk),
+       CLKDEV_CON_ID("pioB", &pioB_clk),
+       CLKDEV_CON_ID("pioC", &pioC_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
@@ -270,28 +274,19 @@ void __init at91sam9260_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9260_gpio[] = {
+static struct at91_gpio_bank at91sam9260_gpio[] __initdata = {
        {
                .id             = AT91SAM9260_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
+               .regbase        = AT91SAM9260_BASE_PIOA,
        }, {
                .id             = AT91SAM9260_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
+               .regbase        = AT91SAM9260_BASE_PIOB,
        }, {
                .id             = AT91SAM9260_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
+               .regbase        = AT91SAM9260_BASE_PIOC,
        }
 };
 
-static void at91sam9260_poweroff(void)
-{
-       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
-}
-
-
 /* --------------------------------------------------------------------
  *  AT91SAM9260 processor initialization
  * -------------------------------------------------------------------- */
@@ -325,10 +320,16 @@ static void __init at91sam9260_map_io(void)
        }
 }
 
+static void __init at91sam9260_ioremap_registers(void)
+{
+       at91_ioremap_shdwc(AT91SAM9260_BASE_SHDWC);
+       at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT);
+       at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC);
+}
+
 static void __init at91sam9260_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
-       pm_power_off = at91sam9260_poweroff;
+       arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
                        | (1 << AT91SAM9260_ID_IRQ2);
 
@@ -381,6 +382,7 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
 struct at91_init_soc __initdata at91sam9260_soc = {
        .map_io = at91sam9260_map_io,
        .default_irq_priority = at91sam9260_default_irq_priority,
+       .ioremap_registers = at91sam9260_ioremap_registers,
        .register_clocks = at91sam9260_register_clocks,
        .init = at91sam9260_initialize,
 };
index 629fa977497239f171d66ef47563c3da9d2b0127..642ccb6d26b256f284388080f71b68e5494e8070 100644 (file)
@@ -115,7 +115,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
        if (!data)
                return;
 
-       if (data->vbus_pin) {
+       if (gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
        }
@@ -136,7 +136,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
 
 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
 static u64 eth_dmamask = DMA_BIT_MASK(32);
-static struct at91_eth_data eth_data;
+static struct macb_platform_data eth_data;
 
 static struct resource eth_resources[] = {
        [0] = {
@@ -163,12 +163,12 @@ static struct platform_device at91sam9260_eth_device = {
        .num_resources  = ARRAY_SIZE(eth_resources),
 };
 
-void __init at91_add_device_eth(struct at91_eth_data *data)
+void __init at91_add_device_eth(struct macb_platform_data *data)
 {
        if (!data)
                return;
 
-       if (data->phy_irq_pin) {
+       if (gpio_is_valid(data->phy_irq_pin)) {
                at91_set_gpio_input(data->phy_irq_pin, 0);
                at91_set_deglitch(data->phy_irq_pin, 1);
        }
@@ -200,7 +200,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
        platform_device_register(&at91sam9260_eth_device);
 }
 #else
-void __init at91_add_device_eth(struct at91_eth_data *data) {}
+void __init at91_add_device_eth(struct macb_platform_data *data) {}
 #endif
 
 
@@ -243,13 +243,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
                return;
 
        /* input/irq */
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
-       if (data->wp_pin)
+       if (gpio_is_valid(data->wp_pin))
                at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
 
        /* CLK */
@@ -330,11 +330,11 @@ void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
        for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
                if (data->slot[i].bus_width) {
                        /* input/irq */
-                       if (data->slot[i].detect_pin) {
+                       if (gpio_is_valid(data->slot[i].detect_pin)) {
                                at91_set_gpio_input(data->slot[i].detect_pin, 1);
                                at91_set_deglitch(data->slot[i].detect_pin, 1);
                        }
-                       if (data->slot[i].wp_pin)
+                       if (gpio_is_valid(data->slot[i].wp_pin))
                                at91_set_gpio_input(data->slot[i].wp_pin, 1);
 
                        switch (i) {
@@ -399,8 +399,8 @@ static struct resource nand_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_BASE_SYS + AT91_ECC,
-               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .start  = AT91SAM9260_BASE_ECC,
+               .end    = AT91SAM9260_BASE_ECC + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -426,15 +426,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        nand_data = *data;
@@ -714,8 +714,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt_resources[] = {
        {
-               .start  = AT91_BASE_SYS + AT91_RTT,
-               .end    = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+               .start  = AT91SAM9260_BASE_RTT,
+               .end    = AT91SAM9260_BASE_RTT + SZ_16 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -738,10 +738,19 @@ static void __init at91_add_device_rtt(void)
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
+static struct resource wdt_resources[] = {
+       {
+               .start  = AT91SAM9260_BASE_WDT,
+               .end    = AT91SAM9260_BASE_WDT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91sam9260_wdt_device = {
        .name           = "at91_wdt",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = wdt_resources,
+       .num_resources  = ARRAY_SIZE(wdt_resources),
 };
 
 static void __init at91_add_device_watchdog(void)
@@ -837,8 +846,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 #if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91SAM9260_BASE_DBGU,
+               .end    = AT91SAM9260_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@ -1281,17 +1290,17 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
 
        at91_sys_write(AT91_MATRIX_EBICSA, csa);
 
-       if (data->rst_pin) {
+       if (gpio_is_valid(data->rst_pin)) {
                at91_set_multi_drive(data->rst_pin, 0);
                at91_set_gpio_output(data->rst_pin, 1);
        }
 
-       if (data->irq_pin) {
+       if (gpio_is_valid(data->irq_pin)) {
                at91_set_gpio_input(data->irq_pin, 0);
                at91_set_deglitch(data->irq_pin, 1);
        }
 
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 0);
                at91_set_deglitch(data->det_pin, 1);
        }
index 658a5185abfd44cf4671c5d5fa7c6f44b4fc229e..b85b9ea6017071252a670fdb6e22cb222336055d 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/pm.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <mach/at91sam9261.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
-#include <mach/at91_shdwc.h>
 
 #include "soc.h"
 #include "generic.h"
 #include "clock.h"
+#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Clocks
@@ -176,6 +175,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
+       CLKDEV_CON_ID("pioA", &pioA_clk),
+       CLKDEV_CON_ID("pioB", &pioB_clk),
+       CLKDEV_CON_ID("pioC", &pioC_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
@@ -251,28 +253,19 @@ void __init at91sam9261_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9261_gpio[] = {
+static struct at91_gpio_bank at91sam9261_gpio[] __initdata = {
        {
                .id             = AT91SAM9261_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
+               .regbase        = AT91SAM9261_BASE_PIOA,
        }, {
                .id             = AT91SAM9261_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
+               .regbase        = AT91SAM9261_BASE_PIOB,
        }, {
                .id             = AT91SAM9261_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
+               .regbase        = AT91SAM9261_BASE_PIOC,
        }
 };
 
-static void at91sam9261_poweroff(void)
-{
-       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
-}
-
-
 /* --------------------------------------------------------------------
  *  AT91SAM9261 processor initialization
  * -------------------------------------------------------------------- */
@@ -285,10 +278,16 @@ static void __init at91sam9261_map_io(void)
                at91_init_sram(0, AT91SAM9261_SRAM_BASE, AT91SAM9261_SRAM_SIZE);
 }
 
+static void __init at91sam9261_ioremap_registers(void)
+{
+       at91_ioremap_shdwc(AT91SAM9261_BASE_SHDWC);
+       at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT);
+       at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC);
+}
+
 static void __init at91sam9261_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
-       pm_power_off = at91sam9261_poweroff;
+       arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
                        | (1 << AT91SAM9261_ID_IRQ2);
 
@@ -341,6 +340,7 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
 struct at91_init_soc __initdata at91sam9261_soc = {
        .map_io = at91sam9261_map_io,
        .default_irq_priority = at91sam9261_default_irq_priority,
+       .ioremap_registers = at91sam9261_ioremap_registers,
        .register_clocks = at91sam9261_register_clocks,
        .init = at91sam9261_initialize,
 };
index a178b58b0b9c8d59850ca91f0ecab9203198bbcc..fc59cbdb0e3cfcc777e3fe231bf8c525c2457198 100644 (file)
@@ -118,7 +118,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
        if (!data)
                return;
 
-       if (data->vbus_pin) {
+       if (gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
        }
@@ -171,13 +171,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
                return;
 
        /* input/irq */
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
-       if (data->wp_pin)
+       if (gpio_is_valid(data->wp_pin))
                at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
 
        /* CLK */
@@ -240,15 +240,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        at91_set_A_periph(AT91_PIN_PC0, 0);             /* NANDOE */
@@ -600,8 +600,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt_resources[] = {
        {
-               .start  = AT91_BASE_SYS + AT91_RTT,
-               .end    = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+               .start  = AT91SAM9261_BASE_RTT,
+               .end    = AT91SAM9261_BASE_RTT + SZ_16 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -624,10 +624,19 @@ static void __init at91_add_device_rtt(void)
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
+static struct resource wdt_resources[] = {
+       {
+               .start  = AT91SAM9261_BASE_WDT,
+               .end    = AT91SAM9261_BASE_WDT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91sam9261_wdt_device = {
        .name           = "at91_wdt",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = wdt_resources,
+       .num_resources  = ARRAY_SIZE(wdt_resources),
 };
 
 static void __init at91_add_device_watchdog(void)
@@ -816,8 +825,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 #if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91SAM9261_BASE_DBGU,
+               .end    = AT91SAM9261_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
index f83fbb0ee0c58e9bdaab924071bedaf148096bb2..79e3669b1117cbdf7ae18fd685647625766da513 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/pm.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <mach/at91sam9263.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
-#include <mach/at91_shdwc.h>
 
 #include "soc.h"
 #include "generic.h"
 #include "clock.h"
+#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Clocks
@@ -118,7 +117,7 @@ static struct clk pwm_clk = {
        .type           = CLK_TYPE_PERIPHERAL,
 };
 static struct clk macb_clk = {
-       .name           = "macb_clk",
+       .name           = "pclk",
        .pmc_mask       = 1 << AT91SAM9263_ID_EMAC,
        .type           = CLK_TYPE_PERIPHERAL,
 };
@@ -182,6 +181,8 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
+       /* One additional fake clock for macb_hclk */
+       CLKDEV_CON_ID("hclk", &macb_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
        CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
@@ -191,6 +192,11 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
+       CLKDEV_CON_ID("pioA", &pioA_clk),
+       CLKDEV_CON_ID("pioB", &pioB_clk),
+       CLKDEV_CON_ID("pioC", &pioCDE_clk),
+       CLKDEV_CON_ID("pioD", &pioCDE_clk),
+       CLKDEV_CON_ID("pioE", &pioCDE_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
@@ -263,36 +269,25 @@ void __init at91sam9263_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9263_gpio[] = {
+static struct at91_gpio_bank at91sam9263_gpio[] __initdata = {
        {
                .id             = AT91SAM9263_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
+               .regbase        = AT91SAM9263_BASE_PIOA,
        }, {
                .id             = AT91SAM9263_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
+               .regbase        = AT91SAM9263_BASE_PIOB,
        }, {
                .id             = AT91SAM9263_ID_PIOCDE,
-               .offset         = AT91_PIOC,
-               .clock          = &pioCDE_clk,
+               .regbase        = AT91SAM9263_BASE_PIOC,
        }, {
                .id             = AT91SAM9263_ID_PIOCDE,
-               .offset         = AT91_PIOD,
-               .clock          = &pioCDE_clk,
+               .regbase        = AT91SAM9263_BASE_PIOD,
        }, {
                .id             = AT91SAM9263_ID_PIOCDE,
-               .offset         = AT91_PIOE,
-               .clock          = &pioCDE_clk,
+               .regbase        = AT91SAM9263_BASE_PIOE,
        }
 };
 
-static void at91sam9263_poweroff(void)
-{
-       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
-}
-
-
 /* --------------------------------------------------------------------
  *  AT91SAM9263 processor initialization
  * -------------------------------------------------------------------- */
@@ -303,10 +298,17 @@ static void __init at91sam9263_map_io(void)
        at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE);
 }
 
+static void __init at91sam9263_ioremap_registers(void)
+{
+       at91_ioremap_shdwc(AT91SAM9263_BASE_SHDWC);
+       at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT);
+       at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0);
+       at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
+}
+
 static void __init at91sam9263_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
-       pm_power_off = at91sam9263_poweroff;
+       arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
 
        /* Register GPIO subsystem */
@@ -358,6 +360,7 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {
 struct at91_init_soc __initdata at91sam9263_soc = {
        .map_io = at91sam9263_map_io,
        .default_irq_priority = at91sam9263_default_irq_priority,
+       .ioremap_registers = at91sam9263_ioremap_registers,
        .register_clocks = at91sam9263_register_clocks,
        .init = at91sam9263_initialize,
 };
index d5fbac9ff4faed0da1c112869b5c5144c4cfe2f6..7b46b2787022e85729e4d39ade77d667c5110e66 100644 (file)
@@ -70,7 +70,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)
 
        /* Enable VBus control for UHP ports */
        for (i = 0; i < data->ports; i++) {
-               if (data->vbus_pin[i])
+               if (gpio_is_valid(data->vbus_pin[i]))
                        at91_set_gpio_output(data->vbus_pin[i], 0);
        }
 
@@ -123,7 +123,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
        if (!data)
                return;
 
-       if (data->vbus_pin) {
+       if (gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
        }
@@ -144,7 +144,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
 
 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
 static u64 eth_dmamask = DMA_BIT_MASK(32);
-static struct at91_eth_data eth_data;
+static struct macb_platform_data eth_data;
 
 static struct resource eth_resources[] = {
        [0] = {
@@ -171,12 +171,12 @@ static struct platform_device at91sam9263_eth_device = {
        .num_resources  = ARRAY_SIZE(eth_resources),
 };
 
-void __init at91_add_device_eth(struct at91_eth_data *data)
+void __init at91_add_device_eth(struct macb_platform_data *data)
 {
        if (!data)
                return;
 
-       if (data->phy_irq_pin) {
+       if (gpio_is_valid(data->phy_irq_pin)) {
                at91_set_gpio_input(data->phy_irq_pin, 0);
                at91_set_deglitch(data->phy_irq_pin, 1);
        }
@@ -208,7 +208,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
        platform_device_register(&at91sam9263_eth_device);
 }
 #else
-void __init at91_add_device_eth(struct at91_eth_data *data) {}
+void __init at91_add_device_eth(struct macb_platform_data *data) {}
 #endif
 
 
@@ -276,13 +276,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
                return;
 
        /* input/irq */
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
-       if (data->wp_pin)
+       if (gpio_is_valid(data->wp_pin))
                at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
 
        if (mmc_id == 0) {              /* MCI0 */
@@ -430,17 +430,17 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        }
        at91_sys_write(AT91_MATRIX_EBI0CSA, ebi0_csa);
 
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
 
-       if (data->irq_pin) {
+       if (gpio_is_valid(data->irq_pin)) {
                at91_set_gpio_input(data->irq_pin, 1);
                at91_set_deglitch(data->irq_pin, 1);
        }
 
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                /* initially off */
                at91_set_gpio_output(data->vcc_pin, 0);
 
@@ -473,8 +473,8 @@ static struct resource nand_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_BASE_SYS + AT91_ECC0,
-               .end    = AT91_BASE_SYS + AT91_ECC0 + SZ_512 - 1,
+               .start  = AT91SAM9263_BASE_ECC0,
+               .end    = AT91SAM9263_BASE_ECC0 + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -500,15 +500,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        at91_sys_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        nand_data = *data;
@@ -749,7 +749,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)
        at91_set_A_periph(AT91_PIN_PB3, 0);     /* AC97RX */
 
        /* reset */
-       if (data->reset_pin)
+       if (gpio_is_valid(data->reset_pin))
                at91_set_gpio_output(data->reset_pin, 0);
 
        ac97_data = *data;
@@ -956,8 +956,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt0_resources[] = {
        {
-               .start  = AT91_BASE_SYS + AT91_RTT0,
-               .end    = AT91_BASE_SYS + AT91_RTT0 + SZ_16 - 1,
+               .start  = AT91SAM9263_BASE_RTT0,
+               .end    = AT91SAM9263_BASE_RTT0 + SZ_16 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -971,8 +971,8 @@ static struct platform_device at91sam9263_rtt0_device = {
 
 static struct resource rtt1_resources[] = {
        {
-               .start  = AT91_BASE_SYS + AT91_RTT1,
-               .end    = AT91_BASE_SYS + AT91_RTT1 + SZ_16 - 1,
+               .start  = AT91SAM9263_BASE_RTT1,
+               .end    = AT91SAM9263_BASE_RTT1 + SZ_16 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -996,10 +996,19 @@ static void __init at91_add_device_rtt(void)
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
+static struct resource wdt_resources[] = {
+       {
+               .start  = AT91SAM9263_BASE_WDT,
+               .end    = AT91SAM9263_BASE_WDT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91sam9263_wdt_device = {
        .name           = "at91_wdt",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = wdt_resources,
+       .num_resources  = ARRAY_SIZE(wdt_resources),
 };
 
 static void __init at91_add_device_watchdog(void)
@@ -1196,8 +1205,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91SAM9263_BASE_DBGU,
+               .end    = AT91SAM9263_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
index 4ba85499fa979b8503b2e86ab9aa5c2786266b1c..d89ead740a99756b51492064eb7b3922226526e2 100644 (file)
 
 static u32 pit_cycle;          /* write-once */
 static u32 pit_cnt;            /* access only w/system irq blocked */
+static void __iomem *pit_base_addr __read_mostly;
 
+static inline unsigned int pit_read(unsigned int reg_offset)
+{
+       return __raw_readl(pit_base_addr + reg_offset);
+}
+
+static inline void pit_write(unsigned int reg_offset, unsigned long value)
+{
+       __raw_writel(value, pit_base_addr + reg_offset);
+}
 
 /*
  * Clocksource:  just a monotonic counter of MCK/16 cycles.
@@ -39,7 +49,7 @@ static cycle_t read_pit_clk(struct clocksource *cs)
 
        raw_local_irq_save(flags);
        elapsed = pit_cnt;
-       t = at91_sys_read(AT91_PIT_PIIR);
+       t = pit_read(AT91_PIT_PIIR);
        raw_local_irq_restore(flags);
 
        elapsed += PIT_PICNT(t) * pit_cycle;
@@ -64,8 +74,8 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
        switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
                /* update clocksource counter */
-               pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
-               at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
+               pit_cnt += pit_cycle * PIT_PICNT(pit_read(AT91_PIT_PIVR));
+               pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
                                | AT91_PIT_PITIEN);
                break;
        case CLOCK_EVT_MODE_ONESHOT:
@@ -74,7 +84,7 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
        case CLOCK_EVT_MODE_SHUTDOWN:
        case CLOCK_EVT_MODE_UNUSED:
                /* disable irq, leaving the clocksource active */
-               at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
+               pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
                break;
        case CLOCK_EVT_MODE_RESUME:
                break;
@@ -103,11 +113,11 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
 
        /* The PIT interrupt may be disabled, and is shared */
        if ((pit_clkevt.mode == CLOCK_EVT_MODE_PERIODIC)
-                       && (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS)) {
+                       && (pit_read(AT91_PIT_SR) & AT91_PIT_PITS)) {
                unsigned nr_ticks;
 
                /* Get number of ticks performed before irq, and ack it */
-               nr_ticks = PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
+               nr_ticks = PIT_PICNT(pit_read(AT91_PIT_PIVR));
                do {
                        pit_cnt += pit_cycle;
                        pit_clkevt.event_handler(&pit_clkevt);
@@ -129,14 +139,14 @@ static struct irqaction at91sam926x_pit_irq = {
 static void at91sam926x_pit_reset(void)
 {
        /* Disable timer and irqs */
-       at91_sys_write(AT91_PIT_MR, 0);
+       pit_write(AT91_PIT_MR, 0);
 
        /* Clear any pending interrupts, wait for PIT to stop counting */
-       while (PIT_CPIV(at91_sys_read(AT91_PIT_PIVR)) != 0)
+       while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0)
                cpu_relax();
 
        /* Start PIT but don't enable IRQ */
-       at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
+       pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
 }
 
 /*
@@ -178,7 +188,15 @@ static void __init at91sam926x_pit_init(void)
 static void at91sam926x_pit_suspend(void)
 {
        /* Disable timer */
-       at91_sys_write(AT91_PIT_MR, 0);
+       pit_write(AT91_PIT_MR, 0);
+}
+
+void __init at91sam926x_ioremap_pit(u32 addr)
+{
+       pit_base_addr = ioremap(addr, 16);
+
+       if (!pit_base_addr)
+               panic("Impossible to ioremap PIT\n");
 }
 
 struct sys_timer at91sam926x_timer = {
index e0256deb91fbfd7acc478e29609831fcfdf39c12..d3f931c5942e9078bcb31803e50a6fefed398c8b 100644 (file)
  */
 
 #include <linux/linkage.h>
-#include <asm/system.h>
 #include <mach/hardware.h>
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91_rstc.h>
 
                        .arm
 
-                       .globl  at91sam9_alt_reset
+                       .globl  at91sam9_alt_restart
 
-at91sam9_alt_reset:    mrc     p15, 0, r0, c1, c0, 0
-                       orr     r0, r0, #CR_I
-                       mcr     p15, 0, r0, c1, c0, 0           @ enable I-cache
-
-                       ldr     r0, .at91_va_base_sdramc        @ preload constants
+at91sam9_alt_restart:  ldr     r0, .at91_va_base_sdramc        @ preload constants
                        ldr     r1, .at91_va_base_rstc_cr
 
                        mov     r2, #1
index 318b0407ea041fa8d8dae59c106d8427ea48b8ec..7032dd32cdf0fbc207dc265958e70faeb1e32143 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/pm.h>
 #include <linux/dma-mapping.h>
 
 #include <asm/irq.h>
 #include <mach/at91sam9g45.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
-#include <mach/at91_shdwc.h>
 #include <mach/cpu.h>
 
 #include "soc.h"
 #include "generic.h"
 #include "clock.h"
+#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Clocks
@@ -150,7 +149,7 @@ static struct clk ac97_clk = {
        .type           = CLK_TYPE_PERIPHERAL,
 };
 static struct clk macb_clk = {
-       .name           = "macb_clk",
+       .name           = "pclk",
        .pmc_mask       = 1 << AT91SAM9G45_ID_EMAC,
        .type           = CLK_TYPE_PERIPHERAL,
 };
@@ -209,6 +208,8 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
+       /* One additional fake clock for macb_hclk */
+       CLKDEV_CON_ID("hclk", &macb_clk),
        /* One additional fake clock for ohci */
        CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
        CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
@@ -231,6 +232,11 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
+       CLKDEV_CON_ID("pioA", &pioA_clk),
+       CLKDEV_CON_ID("pioB", &pioB_clk),
+       CLKDEV_CON_ID("pioC", &pioC_clk),
+       CLKDEV_CON_ID("pioD", &pioDE_clk),
+       CLKDEV_CON_ID("pioE", &pioDE_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
@@ -293,41 +299,30 @@ void __init at91sam9g45_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9g45_gpio[] = {
+static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = {
        {
                .id             = AT91SAM9G45_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
+               .regbase        = AT91SAM9G45_BASE_PIOA,
        }, {
                .id             = AT91SAM9G45_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
+               .regbase        = AT91SAM9G45_BASE_PIOB,
        }, {
                .id             = AT91SAM9G45_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
+               .regbase        = AT91SAM9G45_BASE_PIOC,
        }, {
                .id             = AT91SAM9G45_ID_PIODE,
-               .offset         = AT91_PIOD,
-               .clock          = &pioDE_clk,
+               .regbase        = AT91SAM9G45_BASE_PIOD,
        }, {
                .id             = AT91SAM9G45_ID_PIODE,
-               .offset         = AT91_PIOE,
-               .clock          = &pioDE_clk,
+               .regbase        = AT91SAM9G45_BASE_PIOE,
        }
 };
 
-static void at91sam9g45_reset(void)
+static void at91sam9g45_restart(char mode, const char *cmd)
 {
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
-static void at91sam9g45_poweroff(void)
-{
-       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
-}
-
-
 /* --------------------------------------------------------------------
  *  AT91SAM9G45 processor initialization
  * -------------------------------------------------------------------- */
@@ -338,10 +333,16 @@ static void __init at91sam9g45_map_io(void)
        init_consistent_dma_size(SZ_4M);
 }
 
+static void __init at91sam9g45_ioremap_registers(void)
+{
+       at91_ioremap_shdwc(AT91SAM9G45_BASE_SHDWC);
+       at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT);
+       at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC);
+}
+
 static void __init at91sam9g45_initialize(void)
 {
-       at91_arch_reset = at91sam9g45_reset;
-       pm_power_off = at91sam9g45_poweroff;
+       arm_pm_restart = at91sam9g45_restart;
        at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
 
        /* Register GPIO subsystem */
@@ -393,6 +394,7 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = {
 struct at91_init_soc __initdata at91sam9g45_soc = {
        .map_io = at91sam9g45_map_io,
        .default_irq_priority = at91sam9g45_default_irq_priority,
+       .ioremap_registers = at91sam9g45_ioremap_registers,
        .register_clocks = at91sam9g45_register_clocks,
        .init = at91sam9g45_initialize,
 };
index 09a16d6bd5cdafa5a825fdffa38d769517bd483d..b7582dd10dc3bd86c577a59b5ef3c1be3269dd23 100644 (file)
@@ -44,8 +44,8 @@ static struct at_dma_platform_data atdma_pdata = {
 
 static struct resource hdmac_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DMA,
-               .end    = AT91_BASE_SYS + AT91_DMA + SZ_512 - 1,
+               .start  = AT91SAM9G45_BASE_DMA,
+               .end    = AT91SAM9G45_BASE_DMA + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@ -120,7 +120,7 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)
 
        /* Enable VBus control for UHP ports */
        for (i = 0; i < data->ports; i++) {
-               if (data->vbus_pin[i])
+               if (gpio_is_valid(data->vbus_pin[i]))
                        at91_set_gpio_output(data->vbus_pin[i], 0);
        }
 
@@ -181,7 +181,7 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data)
 
        /* Enable VBus control for UHP ports */
        for (i = 0; i < data->ports; i++) {
-               if (data->vbus_pin[i])
+               if (gpio_is_valid(data->vbus_pin[i]))
                        at91_set_gpio_output(data->vbus_pin[i], 0);
        }
 
@@ -263,7 +263,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data)
        usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep);
        memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));
 
-       if (data && data->vbus_pin > 0) {
+       if (data && gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
                usba_udc_data.pdata.vbus_pin = data->vbus_pin;
@@ -284,7 +284,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
 
 #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
 static u64 eth_dmamask = DMA_BIT_MASK(32);
-static struct at91_eth_data eth_data;
+static struct macb_platform_data eth_data;
 
 static struct resource eth_resources[] = {
        [0] = {
@@ -311,12 +311,12 @@ static struct platform_device at91sam9g45_eth_device = {
        .num_resources  = ARRAY_SIZE(eth_resources),
 };
 
-void __init at91_add_device_eth(struct at91_eth_data *data)
+void __init at91_add_device_eth(struct macb_platform_data *data)
 {
        if (!data)
                return;
 
-       if (data->phy_irq_pin) {
+       if (gpio_is_valid(data->phy_irq_pin)) {
                at91_set_gpio_input(data->phy_irq_pin, 0);
                at91_set_deglitch(data->phy_irq_pin, 1);
        }
@@ -348,7 +348,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
        platform_device_register(&at91sam9g45_eth_device);
 }
 #else
-void __init at91_add_device_eth(struct at91_eth_data *data) {}
+void __init at91_add_device_eth(struct macb_platform_data *data) {}
 #endif
 
 
@@ -449,11 +449,11 @@ void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
 
 
        /* input/irq */
-       if (data->slot[0].detect_pin) {
+       if (gpio_is_valid(data->slot[0].detect_pin)) {
                at91_set_gpio_input(data->slot[0].detect_pin, 1);
                at91_set_deglitch(data->slot[0].detect_pin, 1);
        }
-       if (data->slot[0].wp_pin)
+       if (gpio_is_valid(data->slot[0].wp_pin))
                at91_set_gpio_input(data->slot[0].wp_pin, 1);
 
        if (mmc_id == 0) {              /* MCI0 */
@@ -529,8 +529,8 @@ static struct resource nand_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_BASE_SYS + AT91_ECC,
-               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .start  = AT91SAM9G45_BASE_ECC,
+               .end    = AT91SAM9G45_BASE_ECC + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -556,15 +556,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        nand_data = *data;
@@ -859,7 +859,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)
        at91_set_A_periph(AT91_PIN_PD6, 0);     /* AC97RX */
 
        /* reset */
-       if (data->reset_pin)
+       if (gpio_is_valid(data->reset_pin))
                at91_set_gpio_output(data->reset_pin, 0);
 
        ac97_data = *data;
@@ -1009,10 +1009,24 @@ static void __init at91_add_device_tc(void) { }
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
+static struct resource rtc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9G45_BASE_RTC,
+               .end    = AT91SAM9G45_BASE_RTC + SZ_256 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_SYS,
+               .end    = AT91_ID_SYS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
 static struct platform_device at91sam9g45_rtc_device = {
        .name           = "at91_rtc",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = rtc_resources,
+       .num_resources  = ARRAY_SIZE(rtc_resources),
 };
 
 static void __init at91_add_device_rtc(void)
@@ -1081,8 +1095,8 @@ void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
 
 static struct resource rtt_resources[] = {
        {
-               .start  = AT91_BASE_SYS + AT91_RTT,
-               .end    = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+               .start  = AT91SAM9G45_BASE_RTT,
+               .end    = AT91SAM9G45_BASE_RTT + SZ_16 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -1133,10 +1147,19 @@ static void __init at91_add_device_trng(void) {}
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
+static struct resource wdt_resources[] = {
+       {
+               .start  = AT91SAM9G45_BASE_WDT,
+               .end    = AT91SAM9G45_BASE_WDT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91sam9g45_wdt_device = {
        .name           = "at91_wdt",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = wdt_resources,
+       .num_resources  = ARRAY_SIZE(wdt_resources),
 };
 
 static void __init at91_add_device_watchdog(void)
@@ -1332,8 +1355,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 #if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91SAM9G45_BASE_DBGU,
+               .end    = AT91SAM9G45_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
index a238105d2c11dabb385c7f8bbbcfa20be87b2982..d6bcb1da11dfbc004d0c59890d60fef8d3dde27f 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/pm.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <mach/at91sam9rl.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
-#include <mach/at91_shdwc.h>
 
 #include "soc.h"
 #include "generic.h"
 #include "clock.h"
+#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Clocks
@@ -184,6 +183,10 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
+       CLKDEV_CON_ID("pioA", &pioA_clk),
+       CLKDEV_CON_ID("pioB", &pioB_clk),
+       CLKDEV_CON_ID("pioC", &pioC_clk),
+       CLKDEV_CON_ID("pioD", &pioD_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
@@ -243,32 +246,22 @@ void __init at91sam9rl_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9rl_gpio[] = {
+static struct at91_gpio_bank at91sam9rl_gpio[] __initdata = {
        {
                .id             = AT91SAM9RL_ID_PIOA,
-               .offset         = AT91_PIOA,
-               .clock          = &pioA_clk,
+               .regbase        = AT91SAM9RL_BASE_PIOA,
        }, {
                .id             = AT91SAM9RL_ID_PIOB,
-               .offset         = AT91_PIOB,
-               .clock          = &pioB_clk,
+               .regbase        = AT91SAM9RL_BASE_PIOB,
        }, {
                .id             = AT91SAM9RL_ID_PIOC,
-               .offset         = AT91_PIOC,
-               .clock          = &pioC_clk,
+               .regbase        = AT91SAM9RL_BASE_PIOC,
        }, {
                .id             = AT91SAM9RL_ID_PIOD,
-               .offset         = AT91_PIOD,
-               .clock          = &pioD_clk,
+               .regbase        = AT91SAM9RL_BASE_PIOD,
        }
 };
 
-static void at91sam9rl_poweroff(void)
-{
-       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
-}
-
-
 /* --------------------------------------------------------------------
  *  AT91SAM9RL processor initialization
  * -------------------------------------------------------------------- */
@@ -290,10 +283,16 @@ static void __init at91sam9rl_map_io(void)
        at91_init_sram(0, AT91SAM9RL_SRAM_BASE, sram_size);
 }
 
+static void __init at91sam9rl_ioremap_registers(void)
+{
+       at91_ioremap_shdwc(AT91SAM9RL_BASE_SHDWC);
+       at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT);
+       at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC);
+}
+
 static void __init at91sam9rl_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
-       pm_power_off = at91sam9rl_poweroff;
+       arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
 
        /* Register GPIO subsystem */
@@ -345,6 +344,7 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {
 struct at91_init_soc __initdata at91sam9rl_soc = {
        .map_io = at91sam9rl_map_io,
        .default_irq_priority = at91sam9rl_default_irq_priority,
+       .ioremap_registers = at91sam9rl_ioremap_registers,
        .register_clocks = at91sam9rl_register_clocks,
        .init = at91sam9rl_initialize,
 };
index 628eb566d60ce2e5b7620e903417b010aede16fd..61908dce978447156f557866055fe93da689fe52 100644 (file)
@@ -39,8 +39,8 @@ static struct at_dma_platform_data atdma_pdata = {
 
 static struct resource hdmac_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DMA,
-               .end    = AT91_BASE_SYS + AT91_DMA + SZ_512 - 1,
+               .start  = AT91SAM9RL_BASE_DMA,
+               .end    = AT91SAM9RL_BASE_DMA + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
@@ -147,7 +147,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data)
        usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep);
        memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));
 
-       if (data && data->vbus_pin > 0) {
+       if (data && gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
                usba_udc_data.pdata.vbus_pin = data->vbus_pin;
@@ -201,13 +201,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
                return;
 
        /* input/irq */
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
-       if (data->wp_pin)
+       if (gpio_is_valid(data->wp_pin))
                at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
 
        /* CLK */
@@ -248,8 +248,8 @@ static struct resource nand_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_BASE_SYS + AT91_ECC,
-               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .start  = AT91SAM9RL_BASE_ECC,
+               .end    = AT91SAM9RL_BASE_ECC + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -275,15 +275,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        at91_set_A_periph(AT91_PIN_PB4, 0);             /* NANDOE */
@@ -483,7 +483,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)
        at91_set_A_periph(AT91_PIN_PD4, 0);     /* AC97RX */
 
        /* reset */
-       if (data->reset_pin)
+       if (gpio_is_valid(data->reset_pin))
                at91_set_gpio_output(data->reset_pin, 0);
 
        ac97_data = *data;
@@ -685,8 +685,8 @@ static void __init at91_add_device_rtc(void) {}
 
 static struct resource rtt_resources[] = {
        {
-               .start  = AT91_BASE_SYS + AT91_RTT,
-               .end    = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+               .start  = AT91SAM9RL_BASE_RTT,
+               .end    = AT91SAM9RL_BASE_RTT + SZ_16 - 1,
                .flags  = IORESOURCE_MEM,
        }
 };
@@ -709,10 +709,19 @@ static void __init at91_add_device_rtt(void)
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
+static struct resource wdt_resources[] = {
+       {
+               .start  = AT91SAM9RL_BASE_WDT,
+               .end    = AT91SAM9RL_BASE_WDT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91sam9rl_wdt_device = {
        .name           = "at91_wdt",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = wdt_resources,
+       .num_resources  = ARRAY_SIZE(wdt_resources),
 };
 
 static void __init at91_add_device_watchdog(void)
@@ -908,8 +917,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 #if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91SAM9RL_BASE_DBGU,
+               .end    = AT91SAM9RL_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
index 367d5cd5e36288c1c5395aedc6eaec91e2138ccf..2628384aaae1fd034219a258ebfe16892b553955 100644 (file)
@@ -63,13 +63,15 @@ static void __init onearm_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata onearm_eth_data = {
+static struct macb_platform_data __initdata onearm_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata onearm_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata onearm_udc_data = {
index 4282d96dffa808b1ebf059227d088ca3b92ec441..3bb40694b02db20599fa4c87f2867b0513e1bff0 100644 (file)
@@ -75,6 +75,8 @@ static void __init afeb9260_init_early(void)
  */
 static struct at91_usbh_data __initdata afeb9260_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -82,7 +84,7 @@ static struct at91_usbh_data __initdata afeb9260_usbh_data = {
  */
 static struct at91_udc_data __initdata afeb9260_udc_data = {
        .vbus_pin       = AT91_PIN_PC5,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -103,7 +105,7 @@ static struct spi_board_info afeb9260_spi_devices[] = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata afeb9260_macb_data = {
+static struct macb_platform_data __initdata afeb9260_macb_data = {
        .phy_irq_pin    = AT91_PIN_PA9,
        .is_rmii        = 0,
 };
@@ -138,6 +140,7 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
        .bus_width_16   = 0,
        .parts          = afeb9260_nand_partition,
        .num_parts      = ARRAY_SIZE(afeb9260_nand_partition),
+       .det_pin        = -EINVAL,
 };
 
 
@@ -149,6 +152,7 @@ static struct at91_mmc_data __initdata afeb9260_mmc_data = {
        .wp_pin         = AT91_PIN_PC4,
        .slot_b         = 1,
        .wire4          = 1,
+       .vcc_pin        = -EINVAL,
 };
 
 
@@ -169,6 +173,8 @@ static struct i2c_board_info __initdata afeb9260_i2c_devices[] = {
 static struct at91_cf_data afeb9260_cf_data = {
        .chipselect = 4,
        .irq_pin    = AT91_PIN_PA6,
+       .det_pin        = -EINVAL,
+       .vcc_pin        = -EINVAL,
        .rst_pin    = AT91_PIN_PA7,
        .flags      = AT91_CF_TRUE_IDE,
 };
index f90cfb32bad2b89815c0ed292b15721dcaa393be..8510e9e54988da5109a093689400cc724566a73f 100644 (file)
@@ -62,6 +62,8 @@ static void __init cam60_init_early(void)
  */
 static struct at91_usbh_data __initdata cam60_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 
@@ -115,7 +117,7 @@ static struct spi_board_info cam60_spi_devices[] __initdata = {
 /*
  * MACB Ethernet device
  */
-static struct __initdata at91_eth_data cam60_macb_data = {
+static struct __initdata macb_platform_data cam60_macb_data = {
        .phy_irq_pin    = AT91_PIN_PB5,
        .is_rmii        = 0,
 };
@@ -135,7 +137,7 @@ static struct mtd_partition __initdata cam60_nand_partition[] = {
 static struct atmel_nand_data __initdata cam60_nand_data = {
        .ale            = 21,
        .cle            = 22,
-       // .det_pin     = ... not there
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PA9,
        .enable_pin     = AT91_PIN_PA7,
        .parts          = cam60_nand_partition,
@@ -163,7 +165,7 @@ static struct sam9_smc_config __initdata cam60_nand_smc_config = {
 static void __init cam60_add_device_nand(void)
 {
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &cam60_nand_smc_config);
+       sam9_smc_configure(0, 3, &cam60_nand_smc_config);
 
        at91_add_device_nand(&cam60_nand_data);
 }
index 5dffd3be62d25878b52cdbb46150a7d71ad965ac..ac3de4f7c31d871fa96ebb9a190501c6249fab91 100644 (file)
@@ -70,6 +70,8 @@ static void __init cap9adk_init_early(void)
  */
 static struct at91_usbh_data __initdata cap9adk_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -144,16 +146,17 @@ static struct spi_board_info cap9adk_spi_devices[] = {
  */
 static struct at91_mmc_data __initdata cap9adk_mmc_data = {
        .wire4          = 1,
-//     .det_pin        = ... not connected
-//     .wp_pin         = ... not connected
-//     .vcc_pin        = ... not connected
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata cap9adk_macb_data = {
+static struct macb_platform_data __initdata cap9adk_macb_data = {
+       .phy_irq_pin    = -EINVAL,
        .is_rmii        = 1,
 };
 
@@ -172,8 +175,8 @@ static struct mtd_partition __initdata cap9adk_nand_partitions[] = {
 static struct atmel_nand_data __initdata cap9adk_nand_data = {
        .ale            = 21,
        .cle            = 22,
-//     .det_pin        = ... not connected
-//     .rdy_pin        = ... not connected
+       .det_pin        = -EINVAL,
+       .rdy_pin        = -EINVAL,
        .enable_pin     = AT91_PIN_PD15,
        .parts          = cap9adk_nand_partitions,
        .num_parts      = ARRAY_SIZE(cap9adk_nand_partitions),
@@ -212,7 +215,7 @@ static void __init cap9adk_add_device_nand(void)
                cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &cap9adk_nand_smc_config);
+       sam9_smc_configure(0, 3, &cap9adk_nand_smc_config);
 
        at91_add_device_nand(&cap9adk_nand_data);
 }
@@ -282,7 +285,7 @@ static __init void cap9adk_add_device_nor(void)
        at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
 
        /* configure chip-select 0 (NOR) */
-       sam9_smc_configure(0, &cap9adk_nor_smc_config);
+       sam9_smc_configure(0, 0, &cap9adk_nor_smc_config);
 
        platform_device_register(&cap9adk_nor_flash);
 }
@@ -351,7 +354,7 @@ static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data;
  * AC97
  */
 static struct ac97c_platform_data cap9adk_ac97_data = {
-//     .reset_pin      = ... not connected
+       .reset_pin      = -EINVAL,
 };
 
 
index 774c87fcbd5b8f0ee355bf7b9d7c84822eb95ac9..59d9cf997537c6b62324d7f34dff1eb7ed45685f 100644 (file)
@@ -57,13 +57,15 @@ static void __init carmeva_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata carmeva_eth_data = {
+static struct macb_platform_data __initdata carmeva_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata carmeva_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata carmeva_udc_data = {
@@ -75,8 +77,8 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
 // static struct at91_cf_data __initdata carmeva_cf_data = {
 //     .det_pin        = AT91_PIN_PB0,
 //     .rst_pin        = AT91_PIN_PC5,
-       // .irq_pin     = ... not connected
-       // .vcc_pin     = ... always powered
+       // .irq_pin     = -EINVAL,
+       // .vcc_pin     = -EINVAL,
 // };
 
 static struct at91_mmc_data __initdata carmeva_mmc_data = {
@@ -84,6 +86,7 @@ static struct at91_mmc_data __initdata carmeva_mmc_data = {
        .wire4          = 1,
        .det_pin        = AT91_PIN_PB10,
        .wp_pin         = AT91_PIN_PC14,
+       .vcc_pin        = -EINVAL,
 };
 
 static struct spi_board_info carmeva_spi_devices[] = {
index fc885a4ce243fbedce8461435cf966c859f68886..9ab3d1ea326d445bfe36bda16e37e47119a94f7a 100644 (file)
@@ -86,6 +86,8 @@ static void __init cpu9krea_init_early(void)
  */
 static struct at91_usbh_data __initdata cpu9krea_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -93,13 +95,14 @@ static struct at91_usbh_data __initdata cpu9krea_usbh_data = {
  */
 static struct at91_udc_data __initdata cpu9krea_udc_data = {
        .vbus_pin       = AT91_PIN_PC8,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata cpu9krea_macb_data = {
+static struct macb_platform_data __initdata cpu9krea_macb_data = {
+       .phy_irq_pin    = -EINVAL,
        .is_rmii        = 1,
 };
 
@@ -112,6 +115,7 @@ static struct atmel_nand_data __initdata cpu9krea_nand_data = {
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .bus_width_16   = 0,
+       .det_pin        = -EINVAL,
 };
 
 #ifdef CONFIG_MACH_CPU9260
@@ -156,7 +160,7 @@ static struct sam9_smc_config __initdata cpu9krea_nand_smc_config = {
 
 static void __init cpu9krea_add_device_nand(void)
 {
-       sam9_smc_configure(3, &cpu9krea_nand_smc_config);
+       sam9_smc_configure(0, 3, &cpu9krea_nand_smc_config);
        at91_add_device_nand(&cpu9krea_nand_data);
 }
 
@@ -238,7 +242,7 @@ static __init void cpu9krea_add_device_nor(void)
        at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V);
 
        /* configure chip-select 0 (NOR) */
-       sam9_smc_configure(0, &cpu9krea_nor_smc_config);
+       sam9_smc_configure(0, 0, &cpu9krea_nor_smc_config);
 
        platform_device_register(&cpu9krea_nor_flash);
 }
@@ -337,6 +341,8 @@ static struct at91_mmc_data __initdata cpu9krea_mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
        .det_pin        = AT91_PIN_PA29,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 static void __init cpu9krea_board_init(void)
index d35e65b08ccde481aeac88978fd83d7ca1a329c1..368e1427ad998af7be547ed2689c6b5a0d0aacf4 100644 (file)
@@ -82,12 +82,15 @@ static void __init cpuat91_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata cpuat91_eth_data = {
+static struct macb_platform_data __initdata cpuat91_eth_data = {
+       .phy_irq_pin    = -EINVAL,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata cpuat91_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata cpuat91_udc_data = {
@@ -98,6 +101,8 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {
 static struct at91_mmc_data __initdata cpuat91_mmc_data = {
        .det_pin        = AT91_PIN_PC2,
        .wire4          = 1,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 static struct physmap_flash_data cpuat91_flash_data = {
index c3936665e6457715dedaccb0a8b0be0e0fc5f936..1a1547b1ce4e61182e2cb2e069dd803ef43e9e19 100644 (file)
@@ -58,18 +58,20 @@ static void __init csb337_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata csb337_eth_data = {
+static struct macb_platform_data __initdata csb337_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC2,
        .is_rmii        = 0,
 };
 
 static struct at91_usbh_data __initdata csb337_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata csb337_udc_data = {
-       // this has no VBUS sensing pin
        .pullup_pin     = AT91_PIN_PA24,
+       .vbus_pin       = -EINVAL,
 };
 
 static struct i2c_board_info __initdata csb337_i2c_devices[] = {
@@ -98,6 +100,7 @@ static struct at91_mmc_data __initdata csb337_mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
        .wp_pin         = AT91_PIN_PD6,
+       .vcc_pin        = -EINVAL,
 };
 
 static struct spi_board_info csb337_spi_devices[] = {
index 586100e2acbbb5b54c3820b0acd34dafc14f23df..f650bf39455ddc26070bdcfe96663da074feec73 100644 (file)
@@ -52,13 +52,15 @@ static void __init csb637_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata csb637_eth_data = {
+static struct macb_platform_data __initdata csb637_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC0,
        .is_rmii        = 0,
 };
 
 static struct at91_usbh_data __initdata csb637_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata csb637_udc_data = {
index 0b7d327782100efdf1805f901c64c8f12467966c..bb6b434ec0c1c6c868be388603f7b63cfe37b01b 100644 (file)
@@ -50,6 +50,7 @@ static void __init ek_init_early(void)
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PC8,
        .enable_pin     = AT91_PIN_PC14,
 };
@@ -82,7 +83,7 @@ static void __init ek_add_device_nand(void)
                ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
index 45db7a3dbef01b960caa77ff7495a3096a9308bd..d302ca3eeb645f73340f4dc157a77c163a62e044 100644 (file)
@@ -60,13 +60,15 @@ static void __init eb9200_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata eb9200_eth_data = {
+static struct macb_platform_data __initdata eb9200_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata eb9200_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata eb9200_udc_data = {
@@ -75,15 +77,18 @@ static struct at91_udc_data __initdata eb9200_udc_data = {
 };
 
 static struct at91_cf_data __initdata eb9200_cf_data = {
+       .irq_pin        = -EINVAL,
        .det_pin        = AT91_PIN_PB0,
+       .vcc_pin        = -EINVAL,
        .rst_pin        = AT91_PIN_PC5,
-       // .irq_pin     = ... not connected
-       // .vcc_pin     = ... always powered
 };
 
 static struct at91_mmc_data __initdata eb9200_mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
index 2f9c16d29212332f195c85ae7e6e7bc7b3e814c2..69966ce4d776d6f5a62cb1de7d91affb456717bc 100644 (file)
@@ -64,18 +64,23 @@ static void __init ecb_at91init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata ecb_at91eth_data = {
+static struct macb_platform_data __initdata ecb_at91eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 0,
 };
 
 static struct at91_usbh_data __initdata ecb_at91usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_mmc_data __initdata ecb_at91mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 
index 8252c722607b978007efe922f4480052d1902019..07ef35b0ec2cdceecf7e124e705cb842c31b1b62 100644 (file)
@@ -47,13 +47,15 @@ static void __init eco920_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata eco920_eth_data = {
+static struct macb_platform_data __initdata eco920_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC2,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata eco920_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata eco920_udc_data = {
@@ -64,6 +66,9 @@ static struct at91_udc_data __initdata eco920_udc_data = {
 static struct at91_mmc_data __initdata eco920_mmc_data = {
        .slot_b         = 0,
        .wire4          = 0,
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 static struct physmap_flash_data eco920_flash_data = {
index 4c3f65d9c59b6732bc403f3e33a1f837c009658b..eec02cd57ced7fe60291f8938a64259f61b0f22a 100644 (file)
@@ -52,12 +52,14 @@ static void __init flexibity_init_early(void)
 /* USB Host port */
 static struct at91_usbh_data __initdata flexibity_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /* USB Device port */
 static struct at91_udc_data __initdata flexibity_udc_data = {
        .vbus_pin       = AT91_PIN_PC5,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 /* SPI devices */
@@ -76,6 +78,7 @@ static struct at91_mmc_data __initdata flexibity_mmc_data = {
        .wire4          = 1,
        .det_pin        = AT91_PIN_PC9,
        .wp_pin         = AT91_PIN_PC4,
+       .vcc_pin        = -EINVAL,
 };
 
 /* LEDs */
index f27d1a780cfa35ef815f6298519d69ea22105019..caf017f0f4ee3920e56280b9b89c3541bcde4751 100644 (file)
@@ -106,6 +106,8 @@ static void __init foxg20_init_early(void)
  */
 static struct at91_usbh_data __initdata foxg20_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -113,7 +115,7 @@ static struct at91_usbh_data __initdata foxg20_usbh_data = {
  */
 static struct at91_udc_data __initdata foxg20_udc_data = {
        .vbus_pin       = AT91_PIN_PC6,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -135,7 +137,7 @@ static struct spi_board_info foxg20_spi_devices[] = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata foxg20_macb_data = {
+static struct macb_platform_data __initdata foxg20_macb_data = {
        .phy_irq_pin    = AT91_PIN_PA7,
        .is_rmii        = 1,
 };
@@ -147,6 +149,9 @@ static struct at91_eth_data __initdata foxg20_macb_data = {
 static struct at91_mmc_data __initdata foxg20_mmc_data = {
        .slot_b         = 1,
        .wire4          = 1,
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 
index 2e95949737e69d91e6ca5f23fcfed44ac4325155..230e71969fb76c03f0554f12a3a409d037314589 100644 (file)
@@ -80,6 +80,8 @@ static void __init gsia18s_init_early(void)
  */
 static struct at91_usbh_data __initdata usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -87,13 +89,13 @@ static struct at91_usbh_data __initdata usbh_data = {
  */
 static struct at91_udc_data __initdata udc_data = {
        .vbus_pin       = AT91_PIN_PA22,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata macb_data = {
+static struct macb_platform_data __initdata macb_data = {
        .phy_irq_pin    = AT91_PIN_PA28,
        .is_rmii        = 1,
 };
@@ -530,6 +532,7 @@ static struct i2c_board_info __initdata gsia18s_i2c_devices[] = {
 static struct at91_cf_data __initdata gsia18s_cf1_data = {
        .irq_pin        = AT91_PIN_PA27,
        .det_pin        = AT91_PIN_PB30,
+       .vcc_pin        = -EINVAL,
        .rst_pin        = AT91_PIN_PB31,
        .chipselect     = 5,
        .flags          = AT91_CF_TRUE_IDE,
index 3bae73e636332fc5ccfef18b6e02c09915728b2d..efde1b2327c8ab839c518b2cc3a7ce6b0a8517a9 100644 (file)
@@ -61,13 +61,15 @@ static void __init kafa_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata kafa_eth_data = {
+static struct macb_platform_data __initdata kafa_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 0,
 };
 
 static struct at91_usbh_data __initdata kafa_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata kafa_udc_data = {
index e61351ffad50c15399dba98cb7b8b7fa9116728e..d75a4a2ad9c20bc9d1e13067c5f6db4d689bbc9c 100644 (file)
@@ -69,13 +69,15 @@ static void __init kb9202_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata kb9202_eth_data = {
+static struct macb_platform_data __initdata kb9202_eth_data = {
        .phy_irq_pin    = AT91_PIN_PB29,
        .is_rmii        = 0,
 };
 
 static struct at91_usbh_data __initdata kb9202_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata kb9202_udc_data = {
@@ -87,6 +89,8 @@ static struct at91_mmc_data __initdata kb9202_mmc_data = {
        .det_pin        = AT91_PIN_PB2,
        .slot_b         = 0,
        .wire4          = 1,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 static struct mtd_partition __initdata kb9202_nand_partition[] = {
@@ -100,7 +104,7 @@ static struct mtd_partition __initdata kb9202_nand_partition[] = {
 static struct atmel_nand_data __initdata kb9202_nand_data = {
        .ale            = 22,
        .cle            = 21,
-       // .det_pin     = ... not there
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PC29,
        .enable_pin     = AT91_PIN_PC28,
        .parts          = kb9202_nand_partition,
index ef816c17dc61ebd0a0b9fb0c04ab134912f5b4c7..3f8617c0e04e27849634c168e34ff2a6b7305e36 100644 (file)
@@ -72,6 +72,7 @@ static void __init neocore926_init_early(void)
 static struct at91_usbh_data __initdata neocore926_usbh_data = {
        .ports          = 2,
        .vbus_pin       = { AT91_PIN_PA24, AT91_PIN_PA21 },
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -79,7 +80,7 @@ static struct at91_usbh_data __initdata neocore926_usbh_data = {
  */
 static struct at91_udc_data __initdata neocore926_udc_data = {
        .vbus_pin       = AT91_PIN_PA25,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -149,13 +150,14 @@ static struct at91_mmc_data __initdata neocore926_mmc_data = {
        .wire4          = 1,
        .det_pin        = AT91_PIN_PE18,
        .wp_pin         = AT91_PIN_PE19,
+       .vcc_pin        = -EINVAL,
 };
 
 
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata neocore926_macb_data = {
+static struct macb_platform_data __initdata neocore926_macb_data = {
        .phy_irq_pin    = AT91_PIN_PE31,
        .is_rmii        = 1,
 };
@@ -190,6 +192,7 @@ static struct atmel_nand_data __initdata neocore926_nand_data = {
        .enable_pin             = AT91_PIN_PD15,
        .parts                  = neocore926_nand_partition,
        .num_parts              = ARRAY_SIZE(neocore926_nand_partition),
+       .det_pin                = -EINVAL,
 };
 
 static struct sam9_smc_config __initdata neocore926_nand_smc_config = {
@@ -213,7 +216,7 @@ static struct sam9_smc_config __initdata neocore926_nand_smc_config = {
 static void __init neocore926_add_device_nand(void)
 {
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &neocore926_nand_smc_config);
+       sam9_smc_configure(0, 3, &neocore926_nand_smc_config);
 
        at91_add_device_nand(&neocore926_nand_data);
 }
index 49e3f699b48e1edff3d73921c178f4426b056896..b4a12fc184c80078e93877795fffec2a38c19bf3 100644 (file)
@@ -96,9 +96,9 @@ static struct sam9_smc_config __initdata pcontrol_smc_config[2] = { {
 static void __init add_device_pcontrol(void)
 {
        /* configure chip-select 4 (IO compatible to 8051  X4 ) */
-       sam9_smc_configure(4, &pcontrol_smc_config[0]);
+       sam9_smc_configure(0, 4, &pcontrol_smc_config[0]);
        /* configure chip-select 7 (FerroRAM 256KiBx16bit MR2A16A  D4 ) */
-       sam9_smc_configure(7, &pcontrol_smc_config[1]);
+       sam9_smc_configure(0, 7, &pcontrol_smc_config[1]);
 }
 
 
@@ -107,6 +107,8 @@ static void __init add_device_pcontrol(void)
  */
 static struct at91_usbh_data __initdata usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 
@@ -122,7 +124,7 @@ static struct at91_udc_data __initdata pcontrol_g20_udc_data = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata macb_data = {
+static struct macb_platform_data __initdata macb_data = {
        .phy_irq_pin    = AT91_PIN_PA28,
        .is_rmii        = 1,
 };
index 0a8fe6a1b7c8a8a606241f46d8a0a2ff133a75e7..ab024fa11d5c7d1011086070178b1e7dc3f04ca6 100644 (file)
@@ -60,13 +60,15 @@ static void __init picotux200_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata picotux200_eth_data = {
+static struct macb_platform_data __initdata picotux200_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata picotux200_usbh_data = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_mmc_data __initdata picotux200_mmc_data = {
@@ -74,6 +76,7 @@ static struct at91_mmc_data __initdata picotux200_mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
        .wp_pin         = AT91_PIN_PA17,
+       .vcc_pin        = -EINVAL,
 };
 
 #define PICOTUX200_FLASH_BASE  AT91_CHIPSELECT_0
index 07421bdb88eaf7f1b985a39c23bac74a7d61dd08..e029d220cb84d4befab36f98fa0b1104da6461a2 100644 (file)
@@ -77,6 +77,8 @@ static void __init ek_init_early(void)
  */
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -84,7 +86,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {
  */
 static struct at91_udc_data __initdata ek_udc_data = {
        .vbus_pin       = AT91_PIN_PC5,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 /*
@@ -104,7 +106,7 @@ static struct spi_board_info ek_spi_devices[] = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata ek_macb_data = {
+static struct macb_platform_data __initdata ek_macb_data = {
        .phy_irq_pin    = AT91_PIN_PA31,
        .is_rmii        = 1,
 };
@@ -133,7 +135,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
-//     .det_pin        = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .parts          = ek_nand_partition,
@@ -161,7 +163,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
 static void __init ek_add_device_nand(void)
 {
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -172,9 +174,9 @@ static void __init ek_add_device_nand(void)
 static struct at91_mmc_data __initdata ek_mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
-//     .det_pin        = ... not connected
-//     .wp_pin         = ... not connected
-//     .vcc_pin        = ... not connected
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 /*
@@ -251,7 +253,7 @@ static void __init ek_board_init(void)
        /* LEDs */
        at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
        /* shutdown controller, wakeup button (5 msec low) */
-       at91_sys_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10) | AT91_SHDW_WKMODE0_LOW
+       at91_shdwc_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10) | AT91_SHDW_WKMODE0_LOW
                                | AT91_SHDW_RTTWKEN);
 }
 
index 80a8c9c6e92221f53b2024f95d41a1be80e90afe..782f37946af5b561ea066d491ce51f4cd645c44e 100644 (file)
@@ -65,13 +65,15 @@ static void __init dk_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata dk_eth_data = {
+static struct macb_platform_data __initdata dk_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata dk_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata dk_udc_data = {
@@ -80,16 +82,19 @@ static struct at91_udc_data __initdata dk_udc_data = {
 };
 
 static struct at91_cf_data __initdata dk_cf_data = {
+       .irq_pin        = -EINVAL,
        .det_pin        = AT91_PIN_PB0,
+       .vcc_pin        = -EINVAL,
        .rst_pin        = AT91_PIN_PC5,
-       // .irq_pin     = ... not connected
-       // .vcc_pin     = ... always powered
 };
 
 #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
 static struct at91_mmc_data __initdata dk_mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 #endif
 
@@ -143,7 +148,7 @@ static struct atmel_nand_data __initdata dk_nand_data = {
        .cle            = 21,
        .det_pin        = AT91_PIN_PB1,
        .rdy_pin        = AT91_PIN_PC2,
-       // .enable_pin  = ... not there
+       .enable_pin     = -EINVAL,
        .parts          = dk_nand_partition,
        .num_parts      = ARRAY_SIZE(dk_nand_partition),
 };
index 99fd7f8aee0e0f378583365575d3be4bd9127bfe..ef7c12a922464d3accbd06e263a2e548115906ac 100644 (file)
@@ -65,13 +65,15 @@ static void __init ek_init_early(void)
        at91_set_serial_console(0);
 }
 
-static struct at91_eth_data __initdata ek_eth_data = {
+static struct macb_platform_data __initdata ek_eth_data = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 1,
 };
 
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata ek_udc_data = {
@@ -85,6 +87,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
        .wp_pin         = AT91_PIN_PA17,
+       .vcc_pin        = -EINVAL,
 };
 #endif
 
index e927df0175dff55f05ba9ab428a7fe4e5a57138d..af0750fafa29cd5ba5dc712ad4e3348f72ee8cb8 100644 (file)
@@ -60,7 +60,7 @@ static void __init rsi_ews_init_early(void)
 /*
  * Ethernet
  */
-static struct at91_eth_data rsi_ews_eth_data __initdata = {
+static struct macb_platform_data rsi_ews_eth_data __initdata = {
        .phy_irq_pin    = AT91_PIN_PC4,
        .is_rmii        = 1,
 };
@@ -70,6 +70,8 @@ static struct at91_eth_data rsi_ews_eth_data __initdata = {
  */
 static struct at91_usbh_data rsi_ews_usbh_data __initdata = {
        .ports          = 1,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
index 072d53af98d9ebdd594dc9d17efd68c479341976..84bce587735fd408f1c34e39ee615e82f6bb92bd 100644 (file)
@@ -72,6 +72,8 @@ static void __init ek_init_early(void)
  */
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -79,7 +81,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {
  */
 static struct at91_udc_data __initdata ek_udc_data = {
        .vbus_pin       = AT91_PIN_PC5,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -109,7 +111,7 @@ static struct spi_board_info ek_spi_devices[] = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata ek_macb_data = {
+static struct macb_platform_data __initdata ek_macb_data = {
        .phy_irq_pin    = AT91_PIN_PA7,
        .is_rmii        = 0,
 };
@@ -134,7 +136,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
-//     .det_pin        = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .parts          = ek_nand_partition,
@@ -162,7 +164,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
 static void __init ek_add_device_nand(void)
 {
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -176,7 +178,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
        .wire4          = 1,
        .det_pin        = AT91_PIN_PC8,
        .wp_pin         = AT91_PIN_PC4,
-//     .vcc_pin        = ... not connected
+       .vcc_pin        = -EINVAL,
 };
 
 static void __init ek_board_init(void)
index 4f10181a07822b4a4a93b0634aa668f428951a19..be8233bcabdcc1d56b96bf632b8a91dfd6c97a47 100644 (file)
@@ -75,6 +75,8 @@ static void __init ek_init_early(void)
  */
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -82,7 +84,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {
  */
 static struct at91_udc_data __initdata ek_udc_data = {
        .vbus_pin       = AT91_PIN_PC5,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -151,7 +153,7 @@ static struct spi_board_info ek_spi_devices[] = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata ek_macb_data = {
+static struct macb_platform_data __initdata ek_macb_data = {
        .phy_irq_pin    = AT91_PIN_PA7,
        .is_rmii        = 1,
 };
@@ -176,7 +178,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
-//     .det_pin        = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .parts          = ek_nand_partition,
@@ -211,7 +213,7 @@ static void __init ek_add_device_nand(void)
                ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -223,9 +225,9 @@ static void __init ek_add_device_nand(void)
 static struct at91_mmc_data __initdata ek_mmc_data = {
        .slot_b         = 1,
        .wire4          = 1,
-//     .det_pin        = ... not connected
-//     .wp_pin         = ... not connected
-//     .vcc_pin        = ... not connected
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 
index b005b738e8ff7bc6dc4af3c8e173421bd9b234c7..40895072a1a754c520608427faa5fdfe708a0fdf 100644 (file)
@@ -131,7 +131,7 @@ static struct sam9_smc_config __initdata dm9000_smc_config = {
 static void __init ek_add_device_dm9000(void)
 {
        /* Configure chip-select 2 (DM9000) */
-       sam9_smc_configure(2, &dm9000_smc_config);
+       sam9_smc_configure(0, 2, &dm9000_smc_config);
 
        /* Configure Reset signal as output */
        at91_set_gpio_output(AT91_PIN_PC10, 0);
@@ -151,6 +151,8 @@ static void __init ek_add_device_dm9000(void) {}
  */
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 
@@ -159,7 +161,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {
  */
 static struct at91_udc_data __initdata ek_udc_data = {
        .vbus_pin       = AT91_PIN_PB29,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -182,7 +184,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 22,
        .cle            = 21,
-//     .det_pin        = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PC15,
        .enable_pin     = AT91_PIN_PC14,
        .parts          = ek_nand_partition,
@@ -217,7 +219,7 @@ static void __init ek_add_device_nand(void)
                ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -345,6 +347,9 @@ static struct spi_board_info ek_spi_devices[] = {
  */
 static struct at91_mmc_data __initdata ek_mmc_data = {
        .wire4          = 1,
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 #endif /* CONFIG_SPI_ATMEL_* */
index bccdcf23caa106e392dba97fa4df69f9775a5337..29f66052fe63b57d275cc40ae694b1f0199b83bf 100644 (file)
@@ -74,6 +74,7 @@ static void __init ek_init_early(void)
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
        .vbus_pin       = { AT91_PIN_PA24, AT91_PIN_PA21 },
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -81,7 +82,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {
  */
 static struct at91_udc_data __initdata ek_udc_data = {
        .vbus_pin       = AT91_PIN_PA25,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -151,14 +152,14 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
        .wire4          = 1,
        .det_pin        = AT91_PIN_PE18,
        .wp_pin         = AT91_PIN_PE19,
-//     .vcc_pin        = ... not connected
+       .vcc_pin        = -EINVAL,
 };
 
 
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata ek_macb_data = {
+static struct macb_platform_data __initdata ek_macb_data = {
        .phy_irq_pin    = AT91_PIN_PE31,
        .is_rmii        = 1,
 };
@@ -183,7 +184,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
-//     .det_pin        = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PA22,
        .enable_pin     = AT91_PIN_PD15,
        .parts          = ek_nand_partition,
@@ -218,7 +219,7 @@ static void __init ek_add_device_nand(void)
                ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -353,6 +354,7 @@ static void __init ek_add_device_buttons(void) {}
  * reset_pin is not connected: NRST
  */
 static struct ac97c_platform_data ek_ac97_data = {
+       .reset_pin      = -EINVAL,
 };
 
 
index 64fc75c9d0ac118730cac024eeb94c4d3da17611..843d6286c6f452bc6f84dd2b2f7b5fe43b16f6a0 100644 (file)
@@ -86,6 +86,8 @@ static void __init ek_init_early(void)
  */
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -93,7 +95,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {
  */
 static struct at91_udc_data __initdata ek_udc_data = {
        .vbus_pin       = AT91_PIN_PC5,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
@@ -123,7 +125,7 @@ static struct spi_board_info ek_spi_devices[] = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata ek_macb_data = {
+static struct macb_platform_data __initdata ek_macb_data = {
        .phy_irq_pin    = AT91_PIN_PA7,
        .is_rmii        = 1,
 };
@@ -163,6 +165,7 @@ static struct atmel_nand_data __initdata ek_nand_data = {
        .cle            = 22,
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
+       .det_pin        = -EINVAL,
        .parts          = ek_nand_partition,
        .num_parts      = ARRAY_SIZE(ek_nand_partition),
 };
@@ -195,7 +198,7 @@ static void __init ek_add_device_nand(void)
                ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -210,6 +213,7 @@ static struct mci_platform_data __initdata ek_mmc_data = {
        .slot[1] = {
                .bus_width      = 4,
                .detect_pin     = AT91_PIN_PC9,
+               .wp_pin         = -EINVAL,
        },
 
 };
@@ -218,6 +222,8 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
        .slot_b         = 1,    /* Only one slot so use slot B */
        .wire4          = 1,
        .det_pin        = AT91_PIN_PC9,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 #endif
 
@@ -227,6 +233,7 @@ static void __init ek_add_device_mmc(void)
        if (ek_have_2mmc()) {
                ek_mmc_data.slot[0].bus_width = 4;
                ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2;
+               ek_mmc_data.slot[0].wp_pin = -1;
        }
        at91_add_device_mci(0, &ek_mmc_data);
 #else
index 92de9127923a6dd0ecf6b61780129a1e3e9d6cf2..ea0d1b9c2b7bd0327326a227509f7d4f1c896263 100644 (file)
@@ -69,6 +69,7 @@ static void __init ek_init_early(void)
 static struct at91_usbh_data __initdata ek_usbh_hs_data = {
        .ports          = 2,
        .vbus_pin       = {AT91_PIN_PD1, AT91_PIN_PD3},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 
@@ -100,6 +101,7 @@ static struct mci_platform_data __initdata mci0_data = {
        .slot[0] = {
                .bus_width      = 4,
                .detect_pin     = AT91_PIN_PD10,
+               .wp_pin         = -EINVAL,
        },
 };
 
@@ -115,7 +117,7 @@ static struct mci_platform_data __initdata mci1_data = {
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata ek_macb_data = {
+static struct macb_platform_data __initdata ek_macb_data = {
        .phy_irq_pin    = AT91_PIN_PD5,
        .is_rmii        = 1,
 };
@@ -143,6 +145,7 @@ static struct atmel_nand_data __initdata ek_nand_data = {
        .cle            = 22,
        .rdy_pin        = AT91_PIN_PC8,
        .enable_pin     = AT91_PIN_PC14,
+       .det_pin        = -EINVAL,
        .parts          = ek_nand_partition,
        .num_parts      = ARRAY_SIZE(ek_nand_partition),
 };
@@ -175,7 +178,7 @@ static void __init ek_add_device_nand(void)
                ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -330,6 +333,7 @@ static void __init ek_add_device_buttons(void) {}
  * reset_pin is not connected: NRST
  */
 static struct ac97c_platform_data ek_ac97_data = {
+       .reset_pin      = -EINVAL,
 };
 
 
index b2b748239f365ab77627a6d96a7c442be91fd161..c1366d0032bf46a7bcafedaac099b1b6f6210b6e 100644 (file)
@@ -67,8 +67,8 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {
 static struct at91_mmc_data __initdata ek_mmc_data = {
        .wire4          = 1,
        .det_pin        = AT91_PIN_PA15,
-//     .wp_pin         = ... not connected
-//     .vcc_pin        = ... not connected
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 
@@ -91,7 +91,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
-//     .det_pin        = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PD17,
        .enable_pin     = AT91_PIN_PB6,
        .parts          = ek_nand_partition,
@@ -119,7 +119,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
 static void __init ek_add_device_nand(void)
 {
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &ek_nand_smc_config);
+       sam9_smc_configure(0, 3, &ek_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -204,6 +204,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data;
  * reset_pin is not connected: NRST
  */
 static struct ac97c_platform_data ek_ac97_data = {
+       .reset_pin      = -EINVAL,
 };
 
 
index 0df01c6e2d0c1b458bc89ac41e46740302eda69b..4770db08e5a6c1895b52794d02eba84b499da56c 100644 (file)
@@ -57,15 +57,19 @@ static void __init snapper9260_init_early(void)
 
 static struct at91_usbh_data __initdata snapper9260_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 static struct at91_udc_data __initdata snapper9260_udc_data = {
        .vbus_pin               = SNAPPER9260_IO_EXP_GPIO(5),
        .vbus_active_low        = 1,
        .vbus_polled            = 1,
+       .pullup_pin             = -EINVAL,
 };
 
-static struct at91_eth_data snapper9260_macb_data = {
+static struct macb_platform_data snapper9260_macb_data = {
+       .phy_irq_pin    = -EINVAL,
        .is_rmii        = 1,
 };
 
@@ -104,6 +108,8 @@ static struct atmel_nand_data __initdata snapper9260_nand_data = {
        .parts          = snapper9260_nand_partitions,
        .num_parts      = ARRAY_SIZE(snapper9260_nand_partitions),
        .bus_width_16   = 0,
+       .enable_pin     = -EINVAL,
+       .det_pin        = -EINVAL,
 };
 
 static struct sam9_smc_config __initdata snapper9260_nand_smc_config = {
@@ -149,7 +155,7 @@ static struct i2c_board_info __initdata snapper9260_i2c_devices[] = {
 static void __init snapper9260_add_device_nand(void)
 {
        at91_set_A_periph(AT91_PIN_PC14, 0);
-       sam9_smc_configure(3, &snapper9260_nand_smc_config);
+       sam9_smc_configure(0, 3, &snapper9260_nand_smc_config);
        at91_add_device_nand(&snapper9260_nand_data);
 }
 
index 936e5fd7f40696d6db2680fde276344a7e3950cb..e8d3d5b8824481097e6ba0f94068d3c1ec4530fd 100644 (file)
@@ -85,6 +85,7 @@ static struct atmel_nand_data __initdata nand_data = {
        .rdy_pin        = AT91_PIN_PC13,
        .enable_pin     = AT91_PIN_PC14,
        .bus_width_16   = 0,
+       .det_pin        = -EINVAL,
 };
 
 static struct sam9_smc_config __initdata nand_smc_config = {
@@ -108,7 +109,7 @@ static struct sam9_smc_config __initdata nand_smc_config = {
 static void __init add_device_nand(void)
 {
        /* configure chip-select 3 (NAND) */
-       sam9_smc_configure(3, &nand_smc_config);
+       sam9_smc_configure(0, 3, &nand_smc_config);
 
        at91_add_device_nand(&nand_data);
 }
@@ -122,12 +123,17 @@ static void __init add_device_nand(void)
 static struct mci_platform_data __initdata mmc_data = {
        .slot[0] = {
                .bus_width      = 4,
+               .detect_pin     = -1;
+               .wp_pin         = -1;
        },
 };
 #else
 static struct at91_mmc_data __initdata mmc_data = {
        .slot_b         = 0,
        .wire4          = 1,
+       .det_pin        = -EINVAL,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 #endif
 
@@ -137,6 +143,8 @@ static struct at91_mmc_data __initdata mmc_data = {
  */
 static struct at91_usbh_data __initdata usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 
@@ -145,19 +153,19 @@ static struct at91_usbh_data __initdata usbh_data = {
  */
 static struct at91_udc_data __initdata portuxg20_udc_data = {
        .vbus_pin       = AT91_PIN_PC7,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 static struct at91_udc_data __initdata stamp9g20evb_udc_data = {
        .vbus_pin       = AT91_PIN_PA22,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata macb_data = {
+static struct macb_platform_data __initdata macb_data = {
        .phy_irq_pin    = AT91_PIN_PA28,
        .is_rmii        = 1,
 };
index 0a20bab21f998ef5597be890f9ed47977d27d19f..26c36fc2d1e539b8c0c5d31ffd281a32f9ba587d 100644 (file)
@@ -66,6 +66,8 @@ static void __init ek_init_early(void)
  */
 static struct at91_usbh_data __initdata ek_usbh_data = {
        .ports          = 2,
+       .vbus_pin       = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -73,7 +75,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {
  */
 static struct at91_udc_data __initdata ek_udc_data = {
        .vbus_pin       = AT91_PIN_PB11,
-       .pullup_pin     = 0,            /* pull-up driven by UDC */
+       .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
 };
 
 static void __init ek_add_device_udc(void)
@@ -146,7 +148,7 @@ static void __init ek_add_device_spi(void)
 /*
  * MACB Ethernet device
  */
-static struct at91_eth_data __initdata ek_macb_data = {
+static struct macb_platform_data __initdata ek_macb_data = {
        .phy_irq_pin    = AT91_PIN_PE31,
        .is_rmii        = 1,
 };
@@ -193,7 +195,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
 static struct atmel_nand_data __initdata ek_nand_data = {
        .ale            = 21,
        .cle            = 22,
-//     .det_pin        = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PA22,
        .enable_pin     = AT91_PIN_PD15,
        .parts          = ek_nand_partition,
@@ -245,9 +247,9 @@ static void __init ek_add_device_nand(void)
 
        /* configure chip-select 3 (NAND) */
        if (machine_is_usb_a9g20())
-               sam9_smc_configure(3, &usb_a9g20_nand_smc_config);
+               sam9_smc_configure(0, 3, &usb_a9g20_nand_smc_config);
        else
-               sam9_smc_configure(3, &usb_a9260_nand_smc_config);
+               sam9_smc_configure(0, 3, &usb_a9260_nand_smc_config);
 
        at91_add_device_nand(&ek_nand_data);
 }
@@ -344,7 +346,7 @@ static void __init ek_board_init(void)
                /* I2C */
                at91_add_device_i2c(NULL, 0);
                /* shutdown controller, wakeup button (5 msec low) */
-               at91_sys_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10)
+               at91_shdwc_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10)
                                | AT91_SHDW_WKMODE0_LOW
                                | AT91_SHDW_RTTWKEN);
        }
index 12a3f955162b2eb84ce1346ee2eb090bc0113442..bbd553e1cd93d024cc4b8c5931f989c3a5becbfa 100644 (file)
@@ -110,7 +110,7 @@ static struct gpio_led yl9200_leds[] = {
 /*
  * Ethernet
  */
-static struct at91_eth_data __initdata yl9200_eth_data = {
+static struct macb_platform_data __initdata yl9200_eth_data = {
        .phy_irq_pin            = AT91_PIN_PB28,
        .is_rmii                = 1,
 };
@@ -120,6 +120,8 @@ static struct at91_eth_data __initdata yl9200_eth_data = {
  */
 static struct at91_usbh_data __initdata yl9200_usbh_data = {
        .ports                  = 1,    /* PQFP version of AT91RM9200 */
+       .vbus_pin               = {-EINVAL, -EINVAL},
+       .overcurrent_pin= {-EINVAL, -EINVAL},
 };
 
 /*
@@ -137,8 +139,9 @@ static struct at91_udc_data __initdata yl9200_udc_data = {
  */
 static struct at91_mmc_data __initdata yl9200_mmc_data = {
        .det_pin        = AT91_PIN_PB9,
-       // .wp_pin      = ... not connected
        .wire4          = 1,
+       .wp_pin         = -EINVAL,
+       .vcc_pin        = -EINVAL,
 };
 
 /*
@@ -175,7 +178,7 @@ static struct mtd_partition __initdata yl9200_nand_partition[] = {
 static struct atmel_nand_data __initdata yl9200_nand_data = {
        .ale            = 6,
        .cle            = 7,
-       // .det_pin     = ... not connected
+       .det_pin        = -EINVAL,
        .rdy_pin        = AT91_PIN_PC14,        /* R/!B (Sheet10) */
        .enable_pin     = AT91_PIN_PC15,        /* !CE  (Sheet10) */
        .parts          = yl9200_nand_partition,
index 938b34f577419b9dba43f466c3d59dfe4b73fe69..4866b8180d66610d17d6a0576424e19a751995a0 100644 (file)
@@ -29,6 +29,7 @@ extern void __init at91_aic_init(unsigned int priority[]);
  /* Timer */
 struct sys_timer;
 extern struct sys_timer at91rm9200_timer;
+extern void at91sam926x_ioremap_pit(u32 addr);
 extern struct sys_timer at91sam926x_timer;
 extern struct sys_timer at91x40_timer;
 
@@ -57,7 +58,10 @@ extern void at91_irq_suspend(void);
 extern void at91_irq_resume(void);
 
 /* reset */
-extern void at91sam9_alt_reset(void);
+extern void at91sam9_alt_restart(char, const char *);
+
+/* shutdown */
+extern void at91_ioremap_shdwc(u32 base_addr);
 
  /* GPIO */
 #define AT91RM9200_PQFP                3       /* AT91RM9200 PQFP package has 3 banks */
@@ -65,11 +69,9 @@ extern void at91sam9_alt_reset(void);
 
 struct at91_gpio_bank {
        unsigned short id;              /* peripheral ID */
-       unsigned long offset;           /* offset from system peripheral base */
-       struct clk *clock;              /* associated clock */
+       unsigned long regbase;          /* offset from system peripheral base */
 };
 extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
 extern void __init at91_gpio_irq_setup(void);
 
-extern void (*at91_arch_reset)(void);
 extern int at91_extern_irq;
index 224e9e2f867453bd85b08b371edf888f961d6e6e..74d6783eeabbb976c4261d299fcfe11b70d83984 100644 (file)
@@ -29,8 +29,9 @@
 struct at91_gpio_chip {
        struct gpio_chip        chip;
        struct at91_gpio_chip   *next;          /* Bank sharing same clock */
-       struct at91_gpio_bank   *bank;          /* Bank definition */
+       int                     id;             /* ID of register bank */
        void __iomem            *regbase;       /* Base of register bank */
+       struct clk              *clock;         /* associated clock */
 };
 
 #define to_at91_gpio_chip(c) container_of(c, struct at91_gpio_chip, chip)
@@ -58,18 +59,17 @@ static int at91_gpiolib_direction_input(struct gpio_chip *chip,
        }
 
 static struct at91_gpio_chip gpio_chip[] = {
-       AT91_GPIO_CHIP("A", 0x00 + PIN_BASE, 32),
-       AT91_GPIO_CHIP("B", 0x20 + PIN_BASE, 32),
-       AT91_GPIO_CHIP("C", 0x40 + PIN_BASE, 32),
-       AT91_GPIO_CHIP("D", 0x60 + PIN_BASE, 32),
-       AT91_GPIO_CHIP("E", 0x80 + PIN_BASE, 32),
+       AT91_GPIO_CHIP("pioA", 0x00, 32),
+       AT91_GPIO_CHIP("pioB", 0x20, 32),
+       AT91_GPIO_CHIP("pioC", 0x40, 32),
+       AT91_GPIO_CHIP("pioD", 0x60, 32),
+       AT91_GPIO_CHIP("pioE", 0x80, 32),
 };
 
 static int gpio_banks;
 
 static inline void __iomem *pin_to_controller(unsigned pin)
 {
-       pin -= PIN_BASE;
        pin /= 32;
        if (likely(pin < gpio_banks))
                return gpio_chip[pin].regbase;
@@ -79,7 +79,6 @@ static inline void __iomem *pin_to_controller(unsigned pin)
 
 static inline unsigned pin_to_mask(unsigned pin)
 {
-       pin -= PIN_BASE;
        return 1 << (pin % 32);
 }
 
@@ -274,8 +273,9 @@ static u32 backups[MAX_GPIO_BANKS];
 
 static int gpio_irq_set_wake(struct irq_data *d, unsigned state)
 {
-       unsigned        mask = pin_to_mask(d->irq);
-       unsigned        bank = (d->irq - PIN_BASE) / 32;
+       unsigned        pin = irq_to_gpio(d->irq);
+       unsigned        mask = pin_to_mask(pin);
+       unsigned        bank = pin / 32;
 
        if (unlikely(bank >= MAX_GPIO_BANKS))
                return -EINVAL;
@@ -285,7 +285,7 @@ static int gpio_irq_set_wake(struct irq_data *d, unsigned state)
        else
                wakeups[bank] &= ~mask;
 
-       irq_set_irq_wake(gpio_chip[bank].bank->id, state);
+       irq_set_irq_wake(gpio_chip[bank].id, state);
 
        return 0;
 }
@@ -302,7 +302,7 @@ void at91_gpio_suspend(void)
                __raw_writel(wakeups[i], pio + PIO_IER);
 
                if (!wakeups[i])
-                       clk_disable(gpio_chip[i].bank->clock);
+                       clk_disable(gpio_chip[i].clock);
                else {
 #ifdef CONFIG_PM_DEBUG
                        printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]);
@@ -319,7 +319,7 @@ void at91_gpio_resume(void)
                void __iomem    *pio = gpio_chip[i].regbase;
 
                if (!wakeups[i])
-                       clk_enable(gpio_chip[i].bank->clock);
+                       clk_enable(gpio_chip[i].clock);
 
                __raw_writel(wakeups[i], pio + PIO_IDR);
                __raw_writel(backups[i], pio + PIO_IER);
@@ -344,8 +344,9 @@ void at91_gpio_resume(void)
 
 static void gpio_irq_mask(struct irq_data *d)
 {
-       void __iomem    *pio = pin_to_controller(d->irq);
-       unsigned        mask = pin_to_mask(d->irq);
+       unsigned        pin = irq_to_gpio(d->irq);
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
 
        if (pio)
                __raw_writel(mask, pio + PIO_IDR);
@@ -353,8 +354,9 @@ static void gpio_irq_mask(struct irq_data *d)
 
 static void gpio_irq_unmask(struct irq_data *d)
 {
-       void __iomem    *pio = pin_to_controller(d->irq);
-       unsigned        mask = pin_to_mask(d->irq);
+       unsigned        pin = irq_to_gpio(d->irq);
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
 
        if (pio)
                __raw_writel(mask, pio + PIO_IER);
@@ -382,7 +384,7 @@ static struct irq_chip gpio_irqchip = {
 
 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
 {
-       unsigned        pin;
+       unsigned        irq_pin;
        struct irq_data *idata = irq_desc_get_irq_data(desc);
        struct irq_chip *chip = irq_data_get_irq_chip(idata);
        struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(idata);
@@ -405,12 +407,12 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
                        continue;
                }
 
-               pin = at91_gpio->chip.base;
+               irq_pin = gpio_to_irq(at91_gpio->chip.base);
 
                while (isr) {
                        if (isr & 1)
-                               generic_handle_irq(pin);
-                       pin++;
+                               generic_handle_irq(irq_pin);
+                       irq_pin++;
                        isr >>= 1;
                }
        }
@@ -438,7 +440,7 @@ static int at91_gpio_show(struct seq_file *s, void *unused)
                seq_printf(s, "%i:\t", j);
 
                for (bank = 0; bank < gpio_banks; bank++) {
-                       unsigned        pin  = PIN_BASE + (32 * bank) + j;
+                       unsigned        pin  = (32 * bank) + j;
                        void __iomem    *pio = pin_to_controller(pin);
                        unsigned        mask = pin_to_mask(pin);
 
@@ -491,27 +493,28 @@ static struct lock_class_key gpio_lock_class;
  */
 void __init at91_gpio_irq_setup(void)
 {
-       unsigned                pioc, pin;
+       unsigned                pioc, irq = gpio_to_irq(0);
        struct at91_gpio_chip   *this, *prev;
 
-       for (pioc = 0, pin = PIN_BASE, this = gpio_chip, prev = NULL;
+       for (pioc = 0, this = gpio_chip, prev = NULL;
                        pioc++ < gpio_banks;
                        prev = this, this++) {
-               unsigned        id = this->bank->id;
+               unsigned        id = this->id;
                unsigned        i;
 
                __raw_writel(~0, this->regbase + PIO_IDR);
 
-               for (i = 0, pin = this->chip.base; i < 32; i++, pin++) {
-                       irq_set_lockdep_class(pin, &gpio_lock_class);
+               for (i = 0, irq = gpio_to_irq(this->chip.base); i < 32;
+                    i++, irq++) {
+                       irq_set_lockdep_class(irq, &gpio_lock_class);
 
                        /*
                         * Can use the "simple" and not "edge" handler since it's
                         * shorter, and the AIC handles interrupts sanely.
                         */
-                       irq_set_chip_and_handler(pin, &gpio_irqchip,
+                       irq_set_chip_and_handler(irq, &gpio_irqchip,
                                                 handle_simple_irq);
-                       set_irq_flags(pin, IRQF_VALID);
+                       set_irq_flags(irq, IRQF_VALID);
                }
 
                /* The toplevel handler handles one bank of GPIOs, except
@@ -524,7 +527,7 @@ void __init at91_gpio_irq_setup(void)
                irq_set_chip_data(id, this);
                irq_set_chained_handler(id, gpio_irq_handler);
        }
-       pr_info("AT91: %d gpio irqs in %d banks\n", pin - PIN_BASE, gpio_banks);
+       pr_info("AT91: %d gpio irqs in %d banks\n", irq - gpio_to_irq(0), gpio_banks);
 }
 
 /* gpiolib support */
@@ -612,16 +615,26 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
        for (i = 0; i < nr_banks; i++) {
                at91_gpio = &gpio_chip[i];
 
-               at91_gpio->bank = &data[i];
-               at91_gpio->chip.base = PIN_BASE + i * 32;
-               at91_gpio->regbase = at91_gpio->bank->offset +
-                       (void __iomem *)AT91_VA_BASE_SYS;
+               at91_gpio->id = data[i].id;
+               at91_gpio->chip.base = i * 32;
+
+               at91_gpio->regbase = ioremap(data[i].regbase, 512);
+               if (!at91_gpio->regbase) {
+                       pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", i);
+                       continue;
+               }
+
+               at91_gpio->clock = clk_get_sys(NULL, at91_gpio->chip.label);
+               if (!at91_gpio->clock) {
+                       pr_err("at91_gpio.%d, failed to get clock, ignoring.\n", i);
+                       continue;
+               }
 
                /* enable PIO controller's clock */
-               clk_enable(at91_gpio->bank->clock);
+               clk_enable(at91_gpio->clock);
 
                /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */
-               if (last && last->bank->id == at91_gpio->bank->id)
+               if (last && last->id == at91_gpio->id)
                        last->next = at91_gpio;
                last = at91_gpio;
 
index 03566799d3bee4e1ade7161dae8594acb95c95ed..3045781c473f5d427e84e9ad83e51592c5e3d3da 100644 (file)
 #ifndef AT91_AIC_H
 #define AT91_AIC_H
 
-#define AT91_AIC_SMR(n)                (AT91_AIC + ((n) * 4))  /* Source Mode Registers 0-31 */
+#ifndef __ASSEMBLY__
+extern void __iomem *at91_aic_base;
+
+#define at91_aic_read(field) \
+       __raw_readl(at91_aic_base + field)
+
+#define at91_aic_write(field, value) \
+       __raw_writel(value, at91_aic_base + field);
+#else
+.extern at91_aic_base
+#endif
+
+#define AT91_AIC_SMR(n)                ((n) * 4)               /* Source Mode Registers 0-31 */
 #define                AT91_AIC_PRIOR          (7 << 0)                /* Priority Level */
 #define                AT91_AIC_SRCTYPE        (3 << 5)                /* Interrupt Source Type */
 #define                        AT91_AIC_SRCTYPE_LOW            (0 << 5)
 #define                        AT91_AIC_SRCTYPE_HIGH           (2 << 5)
 #define                        AT91_AIC_SRCTYPE_RISING         (3 << 5)
 
-#define AT91_AIC_SVR(n)                (AT91_AIC + 0x80 + ((n) * 4))   /* Source Vector Registers 0-31 */
-#define AT91_AIC_IVR           (AT91_AIC + 0x100)      /* Interrupt Vector Register */
-#define AT91_AIC_FVR           (AT91_AIC + 0x104)      /* Fast Interrupt Vector Register */
-#define AT91_AIC_ISR           (AT91_AIC + 0x108)      /* Interrupt Status Register */
+#define AT91_AIC_SVR(n)                (0x80 + ((n) * 4))      /* Source Vector Registers 0-31 */
+#define AT91_AIC_IVR           0x100                   /* Interrupt Vector Register */
+#define AT91_AIC_FVR           0x104                   /* Fast Interrupt Vector Register */
+#define AT91_AIC_ISR           0x108                   /* Interrupt Status Register */
 #define                AT91_AIC_IRQID          (0x1f << 0)             /* Current Interrupt Identifier */
 
-#define AT91_AIC_IPR           (AT91_AIC + 0x10c)      /* Interrupt Pending Register */
-#define AT91_AIC_IMR           (AT91_AIC + 0x110)      /* Interrupt Mask Register */
-#define AT91_AIC_CISR          (AT91_AIC + 0x114)      /* Core Interrupt Status Register */
+#define AT91_AIC_IPR           0x10c                   /* Interrupt Pending Register */
+#define AT91_AIC_IMR           0x110                   /* Interrupt Mask Register */
+#define AT91_AIC_CISR          0x114                   /* Core Interrupt Status Register */
 #define                AT91_AIC_NFIQ           (1 << 0)                /* nFIQ Status */
 #define                AT91_AIC_NIRQ           (1 << 1)                /* nIRQ Status */
 
-#define AT91_AIC_IECR          (AT91_AIC + 0x120)      /* Interrupt Enable Command Register */
-#define AT91_AIC_IDCR          (AT91_AIC + 0x124)      /* Interrupt Disable Command Register */
-#define AT91_AIC_ICCR          (AT91_AIC + 0x128)      /* Interrupt Clear Command Register */
-#define AT91_AIC_ISCR          (AT91_AIC + 0x12c)      /* Interrupt Set Command Register */
-#define AT91_AIC_EOICR         (AT91_AIC + 0x130)      /* End of Interrupt Command Register */
-#define AT91_AIC_SPU           (AT91_AIC + 0x134)      /* Spurious Interrupt Vector Register */
-#define AT91_AIC_DCR           (AT91_AIC + 0x138)      /* Debug Control Register */
+#define AT91_AIC_IECR          0x120                   /* Interrupt Enable Command Register */
+#define AT91_AIC_IDCR          0x124                   /* Interrupt Disable Command Register */
+#define AT91_AIC_ICCR          0x128                   /* Interrupt Clear Command Register */
+#define AT91_AIC_ISCR          0x12c                   /* Interrupt Set Command Register */
+#define AT91_AIC_EOICR         0x130                   /* End of Interrupt Command Register */
+#define AT91_AIC_SPU           0x134                   /* Spurious Interrupt Vector Register */
+#define AT91_AIC_DCR           0x138                   /* Debug Control Register */
 #define                AT91_AIC_DCR_PROT       (1 << 0)                /* Protection Mode */
 #define                AT91_AIC_DCR_GMSK       (1 << 1)                /* General Mask */
 
-#define AT91_AIC_FFER          (AT91_AIC + 0x140)      /* Fast Forcing Enable Register [SAM9 only] */
-#define AT91_AIC_FFDR          (AT91_AIC + 0x144)      /* Fast Forcing Disable Register [SAM9 only] */
-#define AT91_AIC_FFSR          (AT91_AIC + 0x148)      /* Fast Forcing Status Register [SAM9 only] */
+#define AT91_AIC_FFER          0x140                   /* Fast Forcing Enable Register [SAM9 only] */
+#define AT91_AIC_FFDR          0x144                   /* Fast Forcing Disable Register [SAM9 only] */
+#define AT91_AIC_FFSR          0x148                   /* Fast Forcing Status Register [SAM9 only] */
 
 #endif
index dbfe455a4c410a1dab1756b967acbf6dd15ddaec..2aa0c5e134953e35350dcfebec43f2946452e3e9 100644 (file)
@@ -19,7 +19,7 @@
 #define dbgu_readl(dbgu, field) \
        __raw_readl(AT91_VA_BASE_SYS + dbgu + AT91_DBGU_ ## field)
 
-#ifdef AT91_DBGU
+#if !defined(CONFIG_ARCH_AT91X40)
 #define AT91_DBGU_CR           (0x00)  /* Control Register */
 #define AT91_DBGU_MR           (0x04)  /* Mode Register */
 #define AT91_DBGU_IER          (0x08)  /* Interrupt Enable Register */
index 974d0bd05b5bd07dde5defd2a4df1ddcf60151a0..d1f80ad7f4d4e07ea44d6d4e3bed311fccb6b052 100644 (file)
 #ifndef AT91_PIT_H
 #define AT91_PIT_H
 
-#define AT91_PIT_MR            (AT91_PIT + 0x00)       /* Mode Register */
+#define AT91_PIT_MR            0x00                    /* Mode Register */
 #define                AT91_PIT_PITIEN         (1 << 25)               /* Timer Interrupt Enable */
 #define                AT91_PIT_PITEN          (1 << 24)               /* Timer Enabled */
 #define                AT91_PIT_PIV            (0xfffff)               /* Periodic Interval Value */
 
-#define AT91_PIT_SR            (AT91_PIT + 0x04)       /* Status Register */
+#define AT91_PIT_SR            0x04                    /* Status Register */
 #define                AT91_PIT_PITS           (1 << 0)                /* Timer Status */
 
-#define AT91_PIT_PIVR          (AT91_PIT + 0x08)       /* Periodic Interval Value Register */
-#define AT91_PIT_PIIR          (AT91_PIT + 0x0c)       /* Periodic Interval Image Register */
+#define AT91_PIT_PIVR          0x08                    /* Periodic Interval Value Register */
+#define AT91_PIT_PIIR          0x0c                    /* Periodic Interval Image Register */
 #define                AT91_PIT_PICNT          (0xfff << 20)           /* Interval Counter */
 #define                AT91_PIT_CPIV           (0xfffff)               /* Inverval Value */
 
index e56f4701a3e58b4fdfd37b1948d93e483b2a2139..da1945e5f71449a99dd6ed5baa6a4aec23af7a64 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef AT91_RTC_H
 #define AT91_RTC_H
 
-#define        AT91_RTC_CR             (AT91_RTC + 0x00)       /* Control Register */
+#define        AT91_RTC_CR             0x00                    /* Control Register */
 #define                AT91_RTC_UPDTIM         (1 <<  0)               /* Update Request Time Register */
 #define                AT91_RTC_UPDCAL         (1 <<  1)               /* Update Request Calendar Register */
 #define                AT91_RTC_TIMEVSEL       (3 <<  8)               /* Time Event Selection */
 #define                        AT91_RTC_CALEVSEL_MONTH         (1 << 16)
 #define                        AT91_RTC_CALEVSEL_YEAR          (2 << 16)
 
-#define        AT91_RTC_MR             (AT91_RTC + 0x04)       /* Mode Register */
+#define        AT91_RTC_MR             0x04                    /* Mode Register */
 #define                        AT91_RTC_HRMOD          (1 <<  0)               /* 12/24 Hour Mode */
 
-#define        AT91_RTC_TIMR           (AT91_RTC + 0x08)       /* Time Register */
+#define        AT91_RTC_TIMR           0x08                    /* Time Register */
 #define                AT91_RTC_SEC            (0x7f <<  0)            /* Current Second */
 #define                AT91_RTC_MIN            (0x7f <<  8)            /* Current Minute */
 #define                AT91_RTC_HOUR           (0x3f << 16)            /* Current Hour */
 #define                AT91_RTC_AMPM           (1    << 22)            /* Ante Meridiem Post Meridiem Indicator */
 
-#define        AT91_RTC_CALR           (AT91_RTC + 0x0c)       /* Calendar Register */
+#define        AT91_RTC_CALR           0x0c                    /* Calendar Register */
 #define                AT91_RTC_CENT           (0x7f <<  0)            /* Current Century */
 #define                AT91_RTC_YEAR           (0xff <<  8)            /* Current Year */
 #define                AT91_RTC_MONTH          (0x1f << 16)            /* Current Month */
 #define                AT91_RTC_DAY            (7    << 21)            /* Current Day */
 #define                AT91_RTC_DATE           (0x3f << 24)            /* Current Date */
 
-#define        AT91_RTC_TIMALR         (AT91_RTC + 0x10)       /* Time Alarm Register */
+#define        AT91_RTC_TIMALR         0x10                    /* Time Alarm Register */
 #define                AT91_RTC_SECEN          (1 <<  7)               /* Second Alarm Enable */
 #define                AT91_RTC_MINEN          (1 << 15)               /* Minute Alarm Enable */
 #define                AT91_RTC_HOUREN         (1 << 23)               /* Hour Alarm Enable */
 
-#define        AT91_RTC_CALALR         (AT91_RTC + 0x14)       /* Calendar Alarm Register */
+#define        AT91_RTC_CALALR         0x14                    /* Calendar Alarm Register */
 #define                AT91_RTC_MTHEN          (1 << 23)               /* Month Alarm Enable */
 #define                AT91_RTC_DATEEN         (1 << 31)               /* Date Alarm Enable */
 
-#define        AT91_RTC_SR             (AT91_RTC + 0x18)       /* Status Register */
+#define        AT91_RTC_SR             0x18                    /* Status Register */
 #define                AT91_RTC_ACKUPD         (1 <<  0)               /* Acknowledge for Update */
 #define                AT91_RTC_ALARM          (1 <<  1)               /* Alarm Flag */
 #define                AT91_RTC_SECEV          (1 <<  2)               /* Second Event */
 #define                AT91_RTC_TIMEV          (1 <<  3)               /* Time Event */
 #define                AT91_RTC_CALEV          (1 <<  4)               /* Calendar Event */
 
-#define        AT91_RTC_SCCR           (AT91_RTC + 0x1c)       /* Status Clear Command Register */
-#define        AT91_RTC_IER            (AT91_RTC + 0x20)       /* Interrupt Enable Register */
-#define        AT91_RTC_IDR            (AT91_RTC + 0x24)       /* Interrupt Disable Register */
-#define        AT91_RTC_IMR            (AT91_RTC + 0x28)       /* Interrupt Mask Register */
+#define        AT91_RTC_SCCR           0x1c                    /* Status Clear Command Register */
+#define        AT91_RTC_IER            0x20                    /* Interrupt Enable Register */
+#define        AT91_RTC_IDR            0x24                    /* Interrupt Disable Register */
+#define        AT91_RTC_IMR            0x28                    /* Interrupt Mask Register */
 
-#define        AT91_RTC_VER            (AT91_RTC + 0x2c)       /* Valid Entry Register */
+#define        AT91_RTC_VER            0x2c                    /* Valid Entry Register */
 #define                AT91_RTC_NVTIM          (1 <<  0)               /* Non valid Time */
 #define                AT91_RTC_NVCAL          (1 <<  1)               /* Non valid Calendar */
 #define                AT91_RTC_NVTIMALR       (1 <<  2)               /* Non valid Time Alarm */
index c4ce07e8a8faa5a1b639d278436a95455804785f..1d4fe822c77a50fb6ac877b546f1846d1a79f3e9 100644 (file)
 #ifndef AT91_SHDWC_H
 #define AT91_SHDWC_H
 
-#define AT91_SHDW_CR           (AT91_SHDWC + 0x00)     /* Shut Down Control Register */
+#ifndef __ASSEMBLY__
+extern void __iomem *at91_shdwc_base;
+
+#define at91_shdwc_read(field) \
+       __raw_readl(at91_shdwc_base + field)
+
+#define at91_shdwc_write(field, value) \
+       __raw_writel(value, at91_shdwc_base + field);
+#endif
+
+#define AT91_SHDW_CR           0x00                    /* Shut Down Control Register */
 #define                AT91_SHDW_SHDW          (1    << 0)             /* Shut Down command */
 #define                AT91_SHDW_KEY           (0xa5 << 24)            /* KEY Password */
 
-#define AT91_SHDW_MR           (AT91_SHDWC + 0x04)     /* Shut Down Mode Register */
+#define AT91_SHDW_MR           0x04                    /* Shut Down Mode Register */
 #define                AT91_SHDW_WKMODE0       (3 << 0)                /* Wake-up 0 Mode Selection */
 #define                        AT91_SHDW_WKMODE0_NONE          0
 #define                        AT91_SHDW_WKMODE0_HIGH          1
@@ -30,7 +40,7 @@
 #define                        AT91_SHDW_CPTWK0_(x)    ((x) << 4)
 #define                AT91_SHDW_RTTWKEN       (1   << 16)             /* Real Time Timer Wake-up Enable */
 
-#define AT91_SHDW_SR           (AT91_SHDWC + 0x08)     /* Shut Down Status Register */
+#define AT91_SHDW_SR           0x08                    /* Shut Down Status Register */
 #define                AT91_SHDW_WAKEUP0       (1 <<  0)               /* Wake-up 0 Status */
 #define                AT91_SHDW_RTTWK         (1 << 16)               /* Real-time Timer Wake-up */
 #define                AT91_SHDW_RTCWK         (1 << 17)               /* Real-time Clock Wake-up [SAM9RL] */
index c5df1e8f19557854199b08b767935f358d4307c0..4c0e2f6011d70cc2ef93c349e70d02d9fc740065 100644 (file)
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_ECC       (0xffffe200 - AT91_BASE_SYS)
 #define AT91_BCRAMC    (0xffffe400 - AT91_BASE_SYS)
 #define AT91_DDRSDRC0  (0xffffe600 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffe800 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffea00 - AT91_BASE_SYS)
-#define AT91_CCFG      (0xffffeb10 - AT91_BASE_SYS)
-#define AT91_DMA       (0xffffec00 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xffffee00 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOD      (0xfffff800 - AT91_BASE_SYS)
 #define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR      (cpu_is_at91cap9_revB() ?       \
                        (0xfffffd50 - AT91_BASE_SYS) :  \
                        (0xfffffd60 - AT91_BASE_SYS))
 
+#define AT91CAP9_BASE_ECC      0xffffe200
+#define AT91CAP9_BASE_DMA      0xffffec00
+#define AT91CAP9_BASE_SMC      0xffffe800
+#define AT91CAP9_BASE_DBGU     AT91_BASE_DBGU1
+#define AT91CAP9_BASE_PIOA     0xfffff200
+#define AT91CAP9_BASE_PIOB     0xfffff400
+#define AT91CAP9_BASE_PIOC     0xfffff600
+#define AT91CAP9_BASE_PIOD     0xfffff800
+#define AT91CAP9_BASE_SHDWC    0xfffffd10
+#define AT91CAP9_BASE_RTT      0xfffffd20
+#define AT91CAP9_BASE_PIT      0xfffffd30
+#define AT91CAP9_BASE_WDT      0xfffffd40
+
 #define AT91_USART0    AT91CAP9_BASE_US0
 #define AT91_USART1    AT91CAP9_BASE_US1
 #define AT91_USART2    AT91CAP9_BASE_US2
index e4037b500302d1571701937c4547bc4f33e53e14..bacb511418194eef2665579555bc3ffa2b608383 100644 (file)
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)    /* Advanced Interrupt Controller */
-#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)    /* Debug Unit */
-#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)    /* PIO Controller A */
-#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)    /* PIO Controller B */
-#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)    /* PIO Controller C */
-#define AT91_PIOD      (0xfffffa00 - AT91_BASE_SYS)    /* PIO Controller D */
 #define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)    /* Power Management Controller */
 #define AT91_ST                (0xfffffd00 - AT91_BASE_SYS)    /* System Timer */
-#define AT91_RTC       (0xfffffe00 - AT91_BASE_SYS)    /* Real-Time Clock */
 #define AT91_MC                (0xffffff00 - AT91_BASE_SYS)    /* Memory Controllers */
 
+#define AT91RM9200_BASE_DBGU   AT91_BASE_DBGU0 /* Debug Unit */
+#define AT91RM9200_BASE_PIOA   0xfffff400      /* PIO Controller A */
+#define AT91RM9200_BASE_PIOB   0xfffff600      /* PIO Controller B */
+#define AT91RM9200_BASE_PIOC   0xfffff800      /* PIO Controller C */
+#define AT91RM9200_BASE_PIOD   0xfffffa00      /* PIO Controller D */
+#define AT91RM9200_BASE_RTC    0xfffffe00      /* Real-Time Clock */
+
 #define AT91_USART0    AT91RM9200_BASE_US0
 #define AT91_USART1    AT91RM9200_BASE_US1
 #define AT91_USART2    AT91RM9200_BASE_US2
index 9a791165913f07f2a50489130a4fd9fecbb681b2..f937c476bb67d6a584b08b122178caa0979cb405 100644 (file)
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_ECC       (0xffffe800 - AT91_BASE_SYS)
 #define AT91_SDRAMC0   (0xffffea00 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
-#define AT91_CCFG      (0xffffef10 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
 #define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
 
+#define AT91SAM9260_BASE_ECC   0xffffe800
+#define AT91SAM9260_BASE_SMC   0xffffec00
+#define AT91SAM9260_BASE_DBGU  AT91_BASE_DBGU0
+#define AT91SAM9260_BASE_PIOA  0xfffff400
+#define AT91SAM9260_BASE_PIOB  0xfffff600
+#define AT91SAM9260_BASE_PIOC  0xfffff800
+#define AT91SAM9260_BASE_SHDWC 0xfffffd10
+#define AT91SAM9260_BASE_RTT   0xfffffd20
+#define AT91SAM9260_BASE_PIT   0xfffffd30
+#define AT91SAM9260_BASE_WDT   0xfffffd40
+
 #define AT91_USART0    AT91SAM9260_BASE_US0
 #define AT91_USART1    AT91SAM9260_BASE_US1
 #define AT91_USART2    AT91SAM9260_BASE_US2
index ce596204cefa6c23cde9de020693a9ebe77fcabb..175604e261becd42ba06aa5b7dc9150cf3eb7fb1 100644 (file)
  * System Peripherals (offset from AT91_BASE_SYS)
  */
 #define AT91_SDRAMC0   (0xffffea00 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
 #define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
 
+#define AT91SAM9261_BASE_SMC   0xffffec00
+#define AT91SAM9261_BASE_DBGU  AT91_BASE_DBGU0
+#define AT91SAM9261_BASE_PIOA  0xfffff400
+#define AT91SAM9261_BASE_PIOB  0xfffff600
+#define AT91SAM9261_BASE_PIOC  0xfffff800
+#define AT91SAM9261_BASE_SHDWC 0xfffffd10
+#define AT91SAM9261_BASE_RTT   0xfffffd20
+#define AT91SAM9261_BASE_PIT   0xfffffd30
+#define AT91SAM9261_BASE_WDT   0xfffffd40
+
 #define AT91_USART0    AT91SAM9261_BASE_US0
 #define AT91_USART1    AT91SAM9261_BASE_US1
 #define AT91_USART2    AT91SAM9261_BASE_US2
index f1b92961a2b19a5d883d503dead47d70e0e4e5cd..80c915002d835a91e87d420efdb1c2ac422a8803 100644 (file)
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_ECC0      (0xffffe000 - AT91_BASE_SYS)
 #define AT91_SDRAMC0   (0xffffe200 - AT91_BASE_SYS)
-#define AT91_SMC0      (0xffffe400 - AT91_BASE_SYS)
-#define AT91_ECC1      (0xffffe600 - AT91_BASE_SYS)
 #define AT91_SDRAMC1   (0xffffe800 - AT91_BASE_SYS)
-#define AT91_SMC1      (0xffffea00 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffec00 - AT91_BASE_SYS)
-#define AT91_CCFG      (0xffffed10 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xffffee00 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOD      (0xfffff800 - AT91_BASE_SYS)
-#define AT91_PIOE      (0xfffffa00 - AT91_BASE_SYS)
 #define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT0      (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
-#define AT91_RTT1      (0xfffffd50 - AT91_BASE_SYS)
 #define AT91_GPBR      (0xfffffd60 - AT91_BASE_SYS)
 
+#define AT91SAM9263_BASE_ECC0  0xffffe000
+#define AT91SAM9263_BASE_SMC0  0xffffe400
+#define AT91SAM9263_BASE_ECC1  0xffffe600
+#define AT91SAM9263_BASE_SMC1  0xffffea00
+#define AT91SAM9263_BASE_DBGU  AT91_BASE_DBGU1
+#define AT91SAM9263_BASE_PIOA  0xfffff200
+#define AT91SAM9263_BASE_PIOB  0xfffff400
+#define AT91SAM9263_BASE_PIOC  0xfffff600
+#define AT91SAM9263_BASE_PIOD  0xfffff800
+#define AT91SAM9263_BASE_PIOE  0xfffffa00
+#define AT91SAM9263_BASE_SHDWC 0xfffffd10
+#define AT91SAM9263_BASE_RTT0  0xfffffd20
+#define AT91SAM9263_BASE_PIT   0xfffffd30
+#define AT91SAM9263_BASE_WDT   0xfffffd40
+#define AT91SAM9263_BASE_RTT1  0xfffffd50
+
 #define AT91_USART0    AT91SAM9263_BASE_US0
 #define AT91_USART1    AT91SAM9263_BASE_US1
 #define AT91_USART2    AT91SAM9263_BASE_US2
index 57de6207e57e566842ea53cb2113b27796ce3c47..eb18a70fa6472d32881af288909d144d988f39ce 100644 (file)
@@ -16,7 +16,9 @@
 #ifndef AT91SAM9_SMC_H
 #define AT91SAM9_SMC_H
 
-#define AT91_SMC_SETUP(n)      (AT91_SMC + 0x00 + ((n)*0x10))  /* Setup Register for CS n */
+#include <mach/cpu.h>
+
+#define AT91_SMC_SETUP         0x00                            /* Setup Register for CS n */
 #define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
 #define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
 #define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
@@ -26,7 +28,7 @@
 #define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
 #define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
 
-#define AT91_SMC_PULSE(n)      (AT91_SMC + 0x04 + ((n)*0x10))  /* Pulse Register for CS n */
+#define AT91_SMC_PULSE         0x04                            /* Pulse Register for CS n */
 #define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
 #define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
 #define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
 #define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
 #define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
 
-#define AT91_SMC_CYCLE(n)      (AT91_SMC + 0x08 + ((n)*0x10))  /* Cycle Register for CS n */
+#define AT91_SMC_CYCLE         0x08                            /* Cycle Register for CS n */
 #define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
 #define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
 #define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
 #define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
 
-#define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
+#define AT91_SMC_MODE          0x0c                            /* Mode Register for CS n */
 #define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
 #define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
 #define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
 #define                        AT91_SMC_PS_16                  (2 << 28)
 #define                        AT91_SMC_PS_32                  (3 << 28)
 
-#if defined(AT91_SMC1)         /* The AT91SAM9263 has 2 Static Memory contollers */
-#define AT91_SMC1_SETUP(n)     (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
-#define AT91_SMC1_PULSE(n)     (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
-#define AT91_SMC1_CYCLE(n)     (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
-#define AT91_SMC1_MODE(n)      (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
-#endif
-
 #endif
index 406bb6496805f38e82790157b98b82b98622a366..f0c23c960dece748b5453e735c66e710c205a54d 100644 (file)
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_ECC       (0xffffe200 - AT91_BASE_SYS)
 #define AT91_DDRSDRC1  (0xffffe400 - AT91_BASE_SYS)
 #define AT91_DDRSDRC0  (0xffffe600 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffe800 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffea00 - AT91_BASE_SYS)
-#define AT91_DMA       (0xffffec00 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xffffee00 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOD      (0xfffff800 - AT91_BASE_SYS)
-#define AT91_PIOE      (0xfffffa00 - AT91_BASE_SYS)
 #define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR      (0xfffffd60 - AT91_BASE_SYS)
-#define AT91_RTC       (0xfffffdb0 - AT91_BASE_SYS)
+
+#define AT91SAM9G45_BASE_ECC   0xffffe200
+#define AT91SAM9G45_BASE_DMA   0xffffec00
+#define AT91SAM9G45_BASE_SMC   0xffffe800
+#define AT91SAM9G45_BASE_DBGU  AT91_BASE_DBGU1
+#define AT91SAM9G45_BASE_PIOA  0xfffff200
+#define AT91SAM9G45_BASE_PIOB  0xfffff400
+#define AT91SAM9G45_BASE_PIOC  0xfffff600
+#define AT91SAM9G45_BASE_PIOD  0xfffff800
+#define AT91SAM9G45_BASE_PIOE  0xfffffa00
+#define AT91SAM9G45_BASE_SHDWC 0xfffffd10
+#define AT91SAM9G45_BASE_RTT   0xfffffd20
+#define AT91SAM9G45_BASE_PIT   0xfffffd30
+#define AT91SAM9G45_BASE_WDT   0xfffffd40
+#define AT91SAM9G45_BASE_RTC   0xfffffdb0
 
 #define AT91_USART0    AT91SAM9G45_BASE_US0
 #define AT91_USART1    AT91SAM9G45_BASE_US1
index 1aabacd315d4adb74874fbd71e2532081e58e941..2bb359e60b97f5b71367ac3ffe832b255f90be3d 100644 (file)
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_DMA       (0xffffe600 - AT91_BASE_SYS)
-#define AT91_ECC       (0xffffe800 - AT91_BASE_SYS)
 #define AT91_SDRAMC0   (0xffffea00 - AT91_BASE_SYS)
-#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
-#define AT91_CCFG      (0xffffef10 - AT91_BASE_SYS)
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
-#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
-#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
-#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
-#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
-#define AT91_PIOD      (0xfffffa00 - AT91_BASE_SYS)
 #define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
-#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
-#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
-#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
 #define AT91_SCKCR     (0xfffffd50 - AT91_BASE_SYS)
 #define AT91_GPBR      (0xfffffd60 - AT91_BASE_SYS)
-#define AT91_RTC       (0xfffffe00 - AT91_BASE_SYS)
+
+#define AT91SAM9RL_BASE_DMA    0xffffe600
+#define AT91SAM9RL_BASE_ECC    0xffffe800
+#define AT91SAM9RL_BASE_SMC    0xffffec00
+#define AT91SAM9RL_BASE_DBGU   AT91_BASE_DBGU0
+#define AT91SAM9RL_BASE_PIOA   0xfffff400
+#define AT91SAM9RL_BASE_PIOB   0xfffff600
+#define AT91SAM9RL_BASE_PIOC   0xfffff800
+#define AT91SAM9RL_BASE_PIOD   0xfffffa00
+#define AT91SAM9RL_BASE_SHDWC  0xfffffd10
+#define AT91SAM9RL_BASE_RTT    0xfffffd20
+#define AT91SAM9RL_BASE_PIT    0xfffffd30
+#define AT91SAM9RL_BASE_WDT    0xfffffd40
+#define AT91SAM9RL_BASE_RTC    0xfffffe00
 
 #define AT91_USART0    AT91SAM9RL_BASE_US0
 #define AT91_USART1    AT91SAM9RL_BASE_US1
index a152ff87e688ea48792be4733643b1b9fb2c5c89..a57829f4fd184ffb8a82cee37a2140c2c97115de 100644 (file)
@@ -40,7 +40,6 @@
 #define AT91_PIOA      (0xffff0000 - AT91_BASE_SYS)    /* PIO Controller A */
 #define AT91_PS                (0xffff4000 - AT91_BASE_SYS)    /* Power Save */
 #define AT91_WD                (0xffff8000 - AT91_BASE_SYS)    /* Watchdog Timer */
-#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)    /* Advanced Interrupt Controller */
 
 /*
  * The AT91x40 series doesn't have a debug unit like the other AT91 parts.
index eac92e995bb52ba1d0c81cc55af29b4cf6e97b3a..d0b377b21bd7d76da84a19db3c05c6d7304e62c0 100644 (file)
 #include <linux/atmel-mci.h>
 #include <sound/atmel-ac97c.h>
 #include <linux/serial.h>
+#include <linux/platform_data/macb.h>
 
  /* USB Device */
 struct at91_udc_data {
-       u8      vbus_pin;               /* high == host powering us */
+       int     vbus_pin;               /* high == host powering us */
        u8      vbus_active_low;        /* vbus polarity */
        u8      vbus_polled;            /* Use polling, not interrupt */
-       u8      pullup_pin;             /* active == D+ pulled up */
+       int     pullup_pin;             /* active == D+ pulled up */
        u8      pullup_active_low;      /* true == pullup_pin is active low */
 };
 extern void __init at91_add_device_udc(struct at91_udc_data *data);
@@ -56,10 +57,10 @@ extern void __init at91_add_device_usba(struct usba_platform_data *data);
 
  /* Compact Flash */
 struct at91_cf_data {
-       u8      irq_pin;                /* I/O IRQ */
-       u8      det_pin;                /* Card detect */
-       u8      vcc_pin;                /* power switching */
-       u8      rst_pin;                /* card reset */
+       int     irq_pin;                /* I/O IRQ */
+       int     det_pin;                /* Card detect */
+       int     vcc_pin;                /* power switching */
+       int     rst_pin;                /* card reset */
        u8      chipselect;             /* EBI Chip Select number */
        u8      flags;
 #define AT91_CF_TRUE_IDE       0x01
@@ -70,37 +71,26 @@ extern void __init at91_add_device_cf(struct at91_cf_data *data);
  /* MMC / SD */
   /* at91_mci platform config */
 struct at91_mmc_data {
-       u8              det_pin;        /* card detect IRQ */
+       int             det_pin;        /* card detect IRQ */
        unsigned        slot_b:1;       /* uses Slot B */
        unsigned        wire4:1;        /* (SD) supports DAT0..DAT3 */
-       u8              wp_pin;         /* (SD) writeprotect detect */
-       u8              vcc_pin;        /* power switching (high == on) */
+       int             wp_pin;         /* (SD) writeprotect detect */
+       int             vcc_pin;        /* power switching (high == on) */
 };
 extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data);
 
   /* atmel-mci platform config */
 extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data);
 
- /* Ethernet (EMAC & MACB) */
-struct at91_eth_data {
-       u32             phy_mask;
-       u8              phy_irq_pin;    /* PHY IRQ */
-       u8              is_rmii;        /* using RMII interface? */
-};
-extern void __init at91_add_device_eth(struct at91_eth_data *data);
-
-#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \
-       || defined(CONFIG_ARCH_AT91SAM9G45)
-#define eth_platform_data      at91_eth_data
-#endif
+extern void __init at91_add_device_eth(struct macb_platform_data *data);
 
  /* USB Host */
 struct at91_usbh_data {
        u8              ports;          /* number of ports on root hub */
-       u8              vbus_pin[2];    /* port power-control pin */
+       int             vbus_pin[2];    /* port power-control pin */
        u8              vbus_pin_inverted;
        u8              overcurrent_supported;
-       u8              overcurrent_pin[2];
+       int             overcurrent_pin[2];
        u8              overcurrent_status[2];
        u8              overcurrent_changed[2];
 };
@@ -110,9 +100,9 @@ extern void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data);
 
  /* NAND / SmartMedia */
 struct atmel_nand_data {
-       u8              enable_pin;     /* chip enable */
-       u8              det_pin;        /* card detect */
-       u8              rdy_pin;        /* ready/busy */
+       int             enable_pin;     /* chip enable */
+       int             det_pin;        /* card detect */
+       int             rdy_pin;        /* ready/busy */
        u8              rdy_pin_active_low;     /* rdy_pin value is inverted */
        u8              ale;            /* address line number connected to ALE */
        u8              cle;            /* address line number connected to CLE */
index 0ed8648c6452eba116ee8ed321442ae44d53fc73..c6bb9e2d9baa5c3d24f84b0f96584b66de35f4ca 100644 (file)
 #include <mach/hardware.h>
 #include <mach/at91_dbgu.h>
 
+#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
+#define AT91_DBGU AT91_BASE_DBGU0
+#else
+#define AT91_DBGU AT91_BASE_DBGU1
+#endif
+
        .macro  addruart, rp, rv, tmp
-       ldr     \rp, =(AT91_BASE_SYS + AT91_DBGU)       @ System peripherals (phys address)
-       ldr     \rv, =(AT91_VA_BASE_SYS + AT91_DBGU)    @ System peripherals (virt address)
+       ldr     \rp, =AT91_DBGU                         @ System peripherals (phys address)
+       ldr     \rv, =AT91_IO_P2V(AT91_DBGU)            @ System peripherals (virt address)
        .endm
 
        .macro  senduart,rd,rx
index 7ab68f972227fb2998cfdd0dfe9910a74670def8..423eea0ed74c31921551c5e53a6b2f1f0332ec3a 100644 (file)
        .endm
 
        .macro  get_irqnr_preamble, base, tmp
-       ldr     \base, =(AT91_VA_BASE_SYS + AT91_AIC)           @ base virtual address of AIC peripheral
+       ldr     \base, =at91_aic_base           @ base virtual address of AIC peripheral
+       ldr     \base, [\base]
        .endm
 
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
 
        .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       ldr     \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)]     @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt)
-       ldr     \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)]   @ read interrupt source number
-       teq     \irqstat, #0                                    @ ISR is 0 when no current interrupt, or spurious interrupt
-       streq   \tmp, [\base, #(AT91_AIC_EOICR - AT91_AIC)]     @ not going to be handled further, then ACK it now.
+       ldr     \irqnr, [\base, #AT91_AIC_IVR]          @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt)
+       ldr     \irqstat, [\base, #AT91_AIC_ISR]        @ read interrupt source number
+       teq     \irqstat, #0                            @ ISR is 0 when no current interrupt, or spurious interrupt
+       streq   \tmp, [\base, #AT91_AIC_EOICR]          @ not going to be handled further, then ACK it now.
        .endm
 
index 2b9a1f51210f0cc048048410bd9e801883e04bc9..e3fd225121c748f7f592b0ebedfe095028e5845b 100644 (file)
 #include <linux/kernel.h>
 #include <asm/irq.h>
 
-#define PIN_BASE               NR_AIC_IRQS
-
 #define MAX_GPIO_BANKS         5
-#define NR_BUILTIN_GPIO                (PIN_BASE + (MAX_GPIO_BANKS * 32))
+#define NR_BUILTIN_GPIO                (MAX_GPIO_BANKS * 32)
 
 /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
 
-#define        AT91_PIN_PA0    (PIN_BASE + 0x00 + 0)
-#define        AT91_PIN_PA1    (PIN_BASE + 0x00 + 1)
-#define        AT91_PIN_PA2    (PIN_BASE + 0x00 + 2)
-#define        AT91_PIN_PA3    (PIN_BASE + 0x00 + 3)
-#define        AT91_PIN_PA4    (PIN_BASE + 0x00 + 4)
-#define        AT91_PIN_PA5    (PIN_BASE + 0x00 + 5)
-#define        AT91_PIN_PA6    (PIN_BASE + 0x00 + 6)
-#define        AT91_PIN_PA7    (PIN_BASE + 0x00 + 7)
-#define        AT91_PIN_PA8    (PIN_BASE + 0x00 + 8)
-#define        AT91_PIN_PA9    (PIN_BASE + 0x00 + 9)
-#define        AT91_PIN_PA10   (PIN_BASE + 0x00 + 10)
-#define        AT91_PIN_PA11   (PIN_BASE + 0x00 + 11)
-#define        AT91_PIN_PA12   (PIN_BASE + 0x00 + 12)
-#define        AT91_PIN_PA13   (PIN_BASE + 0x00 + 13)
-#define        AT91_PIN_PA14   (PIN_BASE + 0x00 + 14)
-#define        AT91_PIN_PA15   (PIN_BASE + 0x00 + 15)
-#define        AT91_PIN_PA16   (PIN_BASE + 0x00 + 16)
-#define        AT91_PIN_PA17   (PIN_BASE + 0x00 + 17)
-#define        AT91_PIN_PA18   (PIN_BASE + 0x00 + 18)
-#define        AT91_PIN_PA19   (PIN_BASE + 0x00 + 19)
-#define        AT91_PIN_PA20   (PIN_BASE + 0x00 + 20)
-#define        AT91_PIN_PA21   (PIN_BASE + 0x00 + 21)
-#define        AT91_PIN_PA22   (PIN_BASE + 0x00 + 22)
-#define        AT91_PIN_PA23   (PIN_BASE + 0x00 + 23)
-#define        AT91_PIN_PA24   (PIN_BASE + 0x00 + 24)
-#define        AT91_PIN_PA25   (PIN_BASE + 0x00 + 25)
-#define        AT91_PIN_PA26   (PIN_BASE + 0x00 + 26)
-#define        AT91_PIN_PA27   (PIN_BASE + 0x00 + 27)
-#define        AT91_PIN_PA28   (PIN_BASE + 0x00 + 28)
-#define        AT91_PIN_PA29   (PIN_BASE + 0x00 + 29)
-#define        AT91_PIN_PA30   (PIN_BASE + 0x00 + 30)
-#define        AT91_PIN_PA31   (PIN_BASE + 0x00 + 31)
-
-#define        AT91_PIN_PB0    (PIN_BASE + 0x20 + 0)
-#define        AT91_PIN_PB1    (PIN_BASE + 0x20 + 1)
-#define        AT91_PIN_PB2    (PIN_BASE + 0x20 + 2)
-#define        AT91_PIN_PB3    (PIN_BASE + 0x20 + 3)
-#define        AT91_PIN_PB4    (PIN_BASE + 0x20 + 4)
-#define        AT91_PIN_PB5    (PIN_BASE + 0x20 + 5)
-#define        AT91_PIN_PB6    (PIN_BASE + 0x20 + 6)
-#define        AT91_PIN_PB7    (PIN_BASE + 0x20 + 7)
-#define        AT91_PIN_PB8    (PIN_BASE + 0x20 + 8)
-#define        AT91_PIN_PB9    (PIN_BASE + 0x20 + 9)
-#define        AT91_PIN_PB10   (PIN_BASE + 0x20 + 10)
-#define        AT91_PIN_PB11   (PIN_BASE + 0x20 + 11)
-#define        AT91_PIN_PB12   (PIN_BASE + 0x20 + 12)
-#define        AT91_PIN_PB13   (PIN_BASE + 0x20 + 13)
-#define        AT91_PIN_PB14   (PIN_BASE + 0x20 + 14)
-#define        AT91_PIN_PB15   (PIN_BASE + 0x20 + 15)
-#define        AT91_PIN_PB16   (PIN_BASE + 0x20 + 16)
-#define        AT91_PIN_PB17   (PIN_BASE + 0x20 + 17)
-#define        AT91_PIN_PB18   (PIN_BASE + 0x20 + 18)
-#define        AT91_PIN_PB19   (PIN_BASE + 0x20 + 19)
-#define        AT91_PIN_PB20   (PIN_BASE + 0x20 + 20)
-#define        AT91_PIN_PB21   (PIN_BASE + 0x20 + 21)
-#define        AT91_PIN_PB22   (PIN_BASE + 0x20 + 22)
-#define        AT91_PIN_PB23   (PIN_BASE + 0x20 + 23)
-#define        AT91_PIN_PB24   (PIN_BASE + 0x20 + 24)
-#define        AT91_PIN_PB25   (PIN_BASE + 0x20 + 25)
-#define        AT91_PIN_PB26   (PIN_BASE + 0x20 + 26)
-#define        AT91_PIN_PB27   (PIN_BASE + 0x20 + 27)
-#define        AT91_PIN_PB28   (PIN_BASE + 0x20 + 28)
-#define        AT91_PIN_PB29   (PIN_BASE + 0x20 + 29)
-#define        AT91_PIN_PB30   (PIN_BASE + 0x20 + 30)
-#define        AT91_PIN_PB31   (PIN_BASE + 0x20 + 31)
-
-#define        AT91_PIN_PC0    (PIN_BASE + 0x40 + 0)
-#define        AT91_PIN_PC1    (PIN_BASE + 0x40 + 1)
-#define        AT91_PIN_PC2    (PIN_BASE + 0x40 + 2)
-#define        AT91_PIN_PC3    (PIN_BASE + 0x40 + 3)
-#define        AT91_PIN_PC4    (PIN_BASE + 0x40 + 4)
-#define        AT91_PIN_PC5    (PIN_BASE + 0x40 + 5)
-#define        AT91_PIN_PC6    (PIN_BASE + 0x40 + 6)
-#define        AT91_PIN_PC7    (PIN_BASE + 0x40 + 7)
-#define        AT91_PIN_PC8    (PIN_BASE + 0x40 + 8)
-#define        AT91_PIN_PC9    (PIN_BASE + 0x40 + 9)
-#define        AT91_PIN_PC10   (PIN_BASE + 0x40 + 10)
-#define        AT91_PIN_PC11   (PIN_BASE + 0x40 + 11)
-#define        AT91_PIN_PC12   (PIN_BASE + 0x40 + 12)
-#define        AT91_PIN_PC13   (PIN_BASE + 0x40 + 13)
-#define        AT91_PIN_PC14   (PIN_BASE + 0x40 + 14)
-#define        AT91_PIN_PC15   (PIN_BASE + 0x40 + 15)
-#define        AT91_PIN_PC16   (PIN_BASE + 0x40 + 16)
-#define        AT91_PIN_PC17   (PIN_BASE + 0x40 + 17)
-#define        AT91_PIN_PC18   (PIN_BASE + 0x40 + 18)
-#define        AT91_PIN_PC19   (PIN_BASE + 0x40 + 19)
-#define        AT91_PIN_PC20   (PIN_BASE + 0x40 + 20)
-#define        AT91_PIN_PC21   (PIN_BASE + 0x40 + 21)
-#define        AT91_PIN_PC22   (PIN_BASE + 0x40 + 22)
-#define        AT91_PIN_PC23   (PIN_BASE + 0x40 + 23)
-#define        AT91_PIN_PC24   (PIN_BASE + 0x40 + 24)
-#define        AT91_PIN_PC25   (PIN_BASE + 0x40 + 25)
-#define        AT91_PIN_PC26   (PIN_BASE + 0x40 + 26)
-#define        AT91_PIN_PC27   (PIN_BASE + 0x40 + 27)
-#define        AT91_PIN_PC28   (PIN_BASE + 0x40 + 28)
-#define        AT91_PIN_PC29   (PIN_BASE + 0x40 + 29)
-#define        AT91_PIN_PC30   (PIN_BASE + 0x40 + 30)
-#define        AT91_PIN_PC31   (PIN_BASE + 0x40 + 31)
-
-#define        AT91_PIN_PD0    (PIN_BASE + 0x60 + 0)
-#define        AT91_PIN_PD1    (PIN_BASE + 0x60 + 1)
-#define        AT91_PIN_PD2    (PIN_BASE + 0x60 + 2)
-#define        AT91_PIN_PD3    (PIN_BASE + 0x60 + 3)
-#define        AT91_PIN_PD4    (PIN_BASE + 0x60 + 4)
-#define        AT91_PIN_PD5    (PIN_BASE + 0x60 + 5)
-#define        AT91_PIN_PD6    (PIN_BASE + 0x60 + 6)
-#define        AT91_PIN_PD7    (PIN_BASE + 0x60 + 7)
-#define        AT91_PIN_PD8    (PIN_BASE + 0x60 + 8)
-#define        AT91_PIN_PD9    (PIN_BASE + 0x60 + 9)
-#define        AT91_PIN_PD10   (PIN_BASE + 0x60 + 10)
-#define        AT91_PIN_PD11   (PIN_BASE + 0x60 + 11)
-#define        AT91_PIN_PD12   (PIN_BASE + 0x60 + 12)
-#define        AT91_PIN_PD13   (PIN_BASE + 0x60 + 13)
-#define        AT91_PIN_PD14   (PIN_BASE + 0x60 + 14)
-#define        AT91_PIN_PD15   (PIN_BASE + 0x60 + 15)
-#define        AT91_PIN_PD16   (PIN_BASE + 0x60 + 16)
-#define        AT91_PIN_PD17   (PIN_BASE + 0x60 + 17)
-#define        AT91_PIN_PD18   (PIN_BASE + 0x60 + 18)
-#define        AT91_PIN_PD19   (PIN_BASE + 0x60 + 19)
-#define        AT91_PIN_PD20   (PIN_BASE + 0x60 + 20)
-#define        AT91_PIN_PD21   (PIN_BASE + 0x60 + 21)
-#define        AT91_PIN_PD22   (PIN_BASE + 0x60 + 22)
-#define        AT91_PIN_PD23   (PIN_BASE + 0x60 + 23)
-#define        AT91_PIN_PD24   (PIN_BASE + 0x60 + 24)
-#define        AT91_PIN_PD25   (PIN_BASE + 0x60 + 25)
-#define        AT91_PIN_PD26   (PIN_BASE + 0x60 + 26)
-#define        AT91_PIN_PD27   (PIN_BASE + 0x60 + 27)
-#define        AT91_PIN_PD28   (PIN_BASE + 0x60 + 28)
-#define        AT91_PIN_PD29   (PIN_BASE + 0x60 + 29)
-#define        AT91_PIN_PD30   (PIN_BASE + 0x60 + 30)
-#define        AT91_PIN_PD31   (PIN_BASE + 0x60 + 31)
-
-#define        AT91_PIN_PE0    (PIN_BASE + 0x80 + 0)
-#define        AT91_PIN_PE1    (PIN_BASE + 0x80 + 1)
-#define        AT91_PIN_PE2    (PIN_BASE + 0x80 + 2)
-#define        AT91_PIN_PE3    (PIN_BASE + 0x80 + 3)
-#define        AT91_PIN_PE4    (PIN_BASE + 0x80 + 4)
-#define        AT91_PIN_PE5    (PIN_BASE + 0x80 + 5)
-#define        AT91_PIN_PE6    (PIN_BASE + 0x80 + 6)
-#define        AT91_PIN_PE7    (PIN_BASE + 0x80 + 7)
-#define        AT91_PIN_PE8    (PIN_BASE + 0x80 + 8)
-#define        AT91_PIN_PE9    (PIN_BASE + 0x80 + 9)
-#define        AT91_PIN_PE10   (PIN_BASE + 0x80 + 10)
-#define        AT91_PIN_PE11   (PIN_BASE + 0x80 + 11)
-#define        AT91_PIN_PE12   (PIN_BASE + 0x80 + 12)
-#define        AT91_PIN_PE13   (PIN_BASE + 0x80 + 13)
-#define        AT91_PIN_PE14   (PIN_BASE + 0x80 + 14)
-#define        AT91_PIN_PE15   (PIN_BASE + 0x80 + 15)
-#define        AT91_PIN_PE16   (PIN_BASE + 0x80 + 16)
-#define        AT91_PIN_PE17   (PIN_BASE + 0x80 + 17)
-#define        AT91_PIN_PE18   (PIN_BASE + 0x80 + 18)
-#define        AT91_PIN_PE19   (PIN_BASE + 0x80 + 19)
-#define        AT91_PIN_PE20   (PIN_BASE + 0x80 + 20)
-#define        AT91_PIN_PE21   (PIN_BASE + 0x80 + 21)
-#define        AT91_PIN_PE22   (PIN_BASE + 0x80 + 22)
-#define        AT91_PIN_PE23   (PIN_BASE + 0x80 + 23)
-#define        AT91_PIN_PE24   (PIN_BASE + 0x80 + 24)
-#define        AT91_PIN_PE25   (PIN_BASE + 0x80 + 25)
-#define        AT91_PIN_PE26   (PIN_BASE + 0x80 + 26)
-#define        AT91_PIN_PE27   (PIN_BASE + 0x80 + 27)
-#define        AT91_PIN_PE28   (PIN_BASE + 0x80 + 28)
-#define        AT91_PIN_PE29   (PIN_BASE + 0x80 + 29)
-#define        AT91_PIN_PE30   (PIN_BASE + 0x80 + 30)
-#define        AT91_PIN_PE31   (PIN_BASE + 0x80 + 31)
+#define        AT91_PIN_PA0    (0x00 + 0)
+#define        AT91_PIN_PA1    (0x00 + 1)
+#define        AT91_PIN_PA2    (0x00 + 2)
+#define        AT91_PIN_PA3    (0x00 + 3)
+#define        AT91_PIN_PA4    (0x00 + 4)
+#define        AT91_PIN_PA5    (0x00 + 5)
+#define        AT91_PIN_PA6    (0x00 + 6)
+#define        AT91_PIN_PA7    (0x00 + 7)
+#define        AT91_PIN_PA8    (0x00 + 8)
+#define        AT91_PIN_PA9    (0x00 + 9)
+#define        AT91_PIN_PA10   (0x00 + 10)
+#define        AT91_PIN_PA11   (0x00 + 11)
+#define        AT91_PIN_PA12   (0x00 + 12)
+#define        AT91_PIN_PA13   (0x00 + 13)
+#define        AT91_PIN_PA14   (0x00 + 14)
+#define        AT91_PIN_PA15   (0x00 + 15)
+#define        AT91_PIN_PA16   (0x00 + 16)
+#define        AT91_PIN_PA17   (0x00 + 17)
+#define        AT91_PIN_PA18   (0x00 + 18)
+#define        AT91_PIN_PA19   (0x00 + 19)
+#define        AT91_PIN_PA20   (0x00 + 20)
+#define        AT91_PIN_PA21   (0x00 + 21)
+#define        AT91_PIN_PA22   (0x00 + 22)
+#define        AT91_PIN_PA23   (0x00 + 23)
+#define        AT91_PIN_PA24   (0x00 + 24)
+#define        AT91_PIN_PA25   (0x00 + 25)
+#define        AT91_PIN_PA26   (0x00 + 26)
+#define        AT91_PIN_PA27   (0x00 + 27)
+#define        AT91_PIN_PA28   (0x00 + 28)
+#define        AT91_PIN_PA29   (0x00 + 29)
+#define        AT91_PIN_PA30   (0x00 + 30)
+#define        AT91_PIN_PA31   (0x00 + 31)
+
+#define        AT91_PIN_PB0    (0x20 + 0)
+#define        AT91_PIN_PB1    (0x20 + 1)
+#define        AT91_PIN_PB2    (0x20 + 2)
+#define        AT91_PIN_PB3    (0x20 + 3)
+#define        AT91_PIN_PB4    (0x20 + 4)
+#define        AT91_PIN_PB5    (0x20 + 5)
+#define        AT91_PIN_PB6    (0x20 + 6)
+#define        AT91_PIN_PB7    (0x20 + 7)
+#define        AT91_PIN_PB8    (0x20 + 8)
+#define        AT91_PIN_PB9    (0x20 + 9)
+#define        AT91_PIN_PB10   (0x20 + 10)
+#define        AT91_PIN_PB11   (0x20 + 11)
+#define        AT91_PIN_PB12   (0x20 + 12)
+#define        AT91_PIN_PB13   (0x20 + 13)
+#define        AT91_PIN_PB14   (0x20 + 14)
+#define        AT91_PIN_PB15   (0x20 + 15)
+#define        AT91_PIN_PB16   (0x20 + 16)
+#define        AT91_PIN_PB17   (0x20 + 17)
+#define        AT91_PIN_PB18   (0x20 + 18)
+#define        AT91_PIN_PB19   (0x20 + 19)
+#define        AT91_PIN_PB20   (0x20 + 20)
+#define        AT91_PIN_PB21   (0x20 + 21)
+#define        AT91_PIN_PB22   (0x20 + 22)
+#define        AT91_PIN_PB23   (0x20 + 23)
+#define        AT91_PIN_PB24   (0x20 + 24)
+#define        AT91_PIN_PB25   (0x20 + 25)
+#define        AT91_PIN_PB26   (0x20 + 26)
+#define        AT91_PIN_PB27   (0x20 + 27)
+#define        AT91_PIN_PB28   (0x20 + 28)
+#define        AT91_PIN_PB29   (0x20 + 29)
+#define        AT91_PIN_PB30   (0x20 + 30)
+#define        AT91_PIN_PB31   (0x20 + 31)
+
+#define        AT91_PIN_PC0    (0x40 + 0)
+#define        AT91_PIN_PC1    (0x40 + 1)
+#define        AT91_PIN_PC2    (0x40 + 2)
+#define        AT91_PIN_PC3    (0x40 + 3)
+#define        AT91_PIN_PC4    (0x40 + 4)
+#define        AT91_PIN_PC5    (0x40 + 5)
+#define        AT91_PIN_PC6    (0x40 + 6)
+#define        AT91_PIN_PC7    (0x40 + 7)
+#define        AT91_PIN_PC8    (0x40 + 8)
+#define        AT91_PIN_PC9    (0x40 + 9)
+#define        AT91_PIN_PC10   (0x40 + 10)
+#define        AT91_PIN_PC11   (0x40 + 11)
+#define        AT91_PIN_PC12   (0x40 + 12)
+#define        AT91_PIN_PC13   (0x40 + 13)
+#define        AT91_PIN_PC14   (0x40 + 14)
+#define        AT91_PIN_PC15   (0x40 + 15)
+#define        AT91_PIN_PC16   (0x40 + 16)
+#define        AT91_PIN_PC17   (0x40 + 17)
+#define        AT91_PIN_PC18   (0x40 + 18)
+#define        AT91_PIN_PC19   (0x40 + 19)
+#define        AT91_PIN_PC20   (0x40 + 20)
+#define        AT91_PIN_PC21   (0x40 + 21)
+#define        AT91_PIN_PC22   (0x40 + 22)
+#define        AT91_PIN_PC23   (0x40 + 23)
+#define        AT91_PIN_PC24   (0x40 + 24)
+#define        AT91_PIN_PC25   (0x40 + 25)
+#define        AT91_PIN_PC26   (0x40 + 26)
+#define        AT91_PIN_PC27   (0x40 + 27)
+#define        AT91_PIN_PC28   (0x40 + 28)
+#define        AT91_PIN_PC29   (0x40 + 29)
+#define        AT91_PIN_PC30   (0x40 + 30)
+#define        AT91_PIN_PC31   (0x40 + 31)
+
+#define        AT91_PIN_PD0    (0x60 + 0)
+#define        AT91_PIN_PD1    (0x60 + 1)
+#define        AT91_PIN_PD2    (0x60 + 2)
+#define        AT91_PIN_PD3    (0x60 + 3)
+#define        AT91_PIN_PD4    (0x60 + 4)
+#define        AT91_PIN_PD5    (0x60 + 5)
+#define        AT91_PIN_PD6    (0x60 + 6)
+#define        AT91_PIN_PD7    (0x60 + 7)
+#define        AT91_PIN_PD8    (0x60 + 8)
+#define        AT91_PIN_PD9    (0x60 + 9)
+#define        AT91_PIN_PD10   (0x60 + 10)
+#define        AT91_PIN_PD11   (0x60 + 11)
+#define        AT91_PIN_PD12   (0x60 + 12)
+#define        AT91_PIN_PD13   (0x60 + 13)
+#define        AT91_PIN_PD14   (0x60 + 14)
+#define        AT91_PIN_PD15   (0x60 + 15)
+#define        AT91_PIN_PD16   (0x60 + 16)
+#define        AT91_PIN_PD17   (0x60 + 17)
+#define        AT91_PIN_PD18   (0x60 + 18)
+#define        AT91_PIN_PD19   (0x60 + 19)
+#define        AT91_PIN_PD20   (0x60 + 20)
+#define        AT91_PIN_PD21   (0x60 + 21)
+#define        AT91_PIN_PD22   (0x60 + 22)
+#define        AT91_PIN_PD23   (0x60 + 23)
+#define        AT91_PIN_PD24   (0x60 + 24)
+#define        AT91_PIN_PD25   (0x60 + 25)
+#define        AT91_PIN_PD26   (0x60 + 26)
+#define        AT91_PIN_PD27   (0x60 + 27)
+#define        AT91_PIN_PD28   (0x60 + 28)
+#define        AT91_PIN_PD29   (0x60 + 29)
+#define        AT91_PIN_PD30   (0x60 + 30)
+#define        AT91_PIN_PD31   (0x60 + 31)
+
+#define        AT91_PIN_PE0    (0x80 + 0)
+#define        AT91_PIN_PE1    (0x80 + 1)
+#define        AT91_PIN_PE2    (0x80 + 2)
+#define        AT91_PIN_PE3    (0x80 + 3)
+#define        AT91_PIN_PE4    (0x80 + 4)
+#define        AT91_PIN_PE5    (0x80 + 5)
+#define        AT91_PIN_PE6    (0x80 + 6)
+#define        AT91_PIN_PE7    (0x80 + 7)
+#define        AT91_PIN_PE8    (0x80 + 8)
+#define        AT91_PIN_PE9    (0x80 + 9)
+#define        AT91_PIN_PE10   (0x80 + 10)
+#define        AT91_PIN_PE11   (0x80 + 11)
+#define        AT91_PIN_PE12   (0x80 + 12)
+#define        AT91_PIN_PE13   (0x80 + 13)
+#define        AT91_PIN_PE14   (0x80 + 14)
+#define        AT91_PIN_PE15   (0x80 + 15)
+#define        AT91_PIN_PE16   (0x80 + 16)
+#define        AT91_PIN_PE17   (0x80 + 17)
+#define        AT91_PIN_PE18   (0x80 + 18)
+#define        AT91_PIN_PE19   (0x80 + 19)
+#define        AT91_PIN_PE20   (0x80 + 20)
+#define        AT91_PIN_PE21   (0x80 + 21)
+#define        AT91_PIN_PE22   (0x80 + 22)
+#define        AT91_PIN_PE23   (0x80 + 23)
+#define        AT91_PIN_PE24   (0x80 + 24)
+#define        AT91_PIN_PE25   (0x80 + 25)
+#define        AT91_PIN_PE26   (0x80 + 26)
+#define        AT91_PIN_PE27   (0x80 + 27)
+#define        AT91_PIN_PE28   (0x80 + 28)
+#define        AT91_PIN_PE29   (0x80 + 29)
+#define        AT91_PIN_PE30   (0x80 + 30)
+#define        AT91_PIN_PE31   (0x80 + 31)
 
 #ifndef __ASSEMBLY__
 /* setup setup routines, called from board init or driver probe() */
@@ -215,8 +213,8 @@ extern void at91_gpio_resume(void);
 
 #include <asm/errno.h>
 
-#define gpio_to_irq(gpio) (gpio)
-#define irq_to_gpio(irq)  (irq)
+#define gpio_to_irq(gpio) (gpio + NR_AIC_IRQS)
+#define irq_to_gpio(irq)  (irq - NR_AIC_IRQS)
 
 #endif /* __ASSEMBLY__ */
 
index 483478d8be6b06ccf7debddb61ac8a2b26145918..2d0e4e99856624415d72e1ddcae38bb1f6dadb32 100644 (file)
 
 #include <asm/sizes.h>
 
+/* DBGU base */
+/* rm9200, 9260/9g20, 9261/9g10, 9rl */
+#define AT91_BASE_DBGU0        0xfffff200
+/* 9263, 9g45, cap9 */
+#define AT91_BASE_DBGU1        0xffffee00
+
 #if defined(CONFIG_ARCH_AT91RM9200)
 #include <mach/at91rm9200.h>
 #elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
 #define AT91_BASE_SYS  0xffffc000
 #endif
 
+/*
+ * On all at91 have the Advanced Interrupt Controller starts at address
+ * 0xfffff000
+ */
+#define AT91_AIC       0xfffff000
+
 /*
  * Peripheral identifiers/interrupts.
  */
index 4298e7806c766efcde674ce92a97b26499516454..4ca09ef7ca2906e39654fe9867405c04c824ed6f 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-#ifndef CONFIG_ARCH_AT91X40
-#define __arch_ioremap at91_ioremap
-#define __arch_iounmap at91_iounmap
-#endif
-
-void __iomem *at91_ioremap(unsigned long phys, size_t size, unsigned int type);
-void at91_iounmap(volatile void __iomem *addr);
-
 static inline unsigned int at91_sys_read(unsigned int reg_offset)
 {
        void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
index 36bd55f3fc6ef1957f444431cdd5edbc44032717..ac8b7dfc85effabb7c86938cd58be4491ab8d813 100644 (file)
@@ -31,7 +31,7 @@
  * Acknowledge interrupt with AIC after interrupt has been handled.
  *   (by kernel/irq.c)
  */
-#define irq_finish(irq) do { at91_sys_write(AT91_AIC_EOICR, 0); } while (0)
+#define irq_finish(irq) do { at91_aic_write(AT91_AIC_EOICR, 0); } while (0)
 
 
 /*
index 36af14bc13bbbbc88aad80487b6d3cc85b924f0b..cbd64f3bcecde0aa3cfeed86277bba1870acc063 100644 (file)
@@ -47,13 +47,4 @@ static inline void arch_idle(void)
 #endif
 }
 
-void (*at91_arch_reset)(void);
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /* call the CPU-specific reset function */
-       if (at91_arch_reset)
-               (at91_arch_reset)();
-}
-
 #endif
index 85820ad801cc2b77d2d57835db5291c90462b74d..5e917a66edd7937fb7a8d4f622ff5a95a78031da 100644 (file)
 
 #include <mach/hardware.h>
 
-#if defined(CONFIG_ARCH_AT91RM9200)
+#ifdef CONFIG_ARCH_AT91X40
 
-#define CLOCK_TICK_RATE                (AT91_SLOW_CLOCK)
-
-#elif defined(CONFIG_ARCH_AT91SAM9260)
-
-#if defined(CONFIG_MACH_USB_A9260) || defined(CONFIG_MACH_QIL_A9260)
-#define AT91SAM9_MASTER_CLOCK  90000000
-#else
-#define AT91SAM9_MASTER_CLOCK  99300000
-#endif
-
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91SAM9261)
-
-#define AT91SAM9_MASTER_CLOCK  99300000
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91SAM9G10)
-
-#define AT91SAM9_MASTER_CLOCK  133000000
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91SAM9263)
-
-#if defined(CONFIG_MACH_USB_A9263)
-#define AT91SAM9_MASTER_CLOCK  90000000
-#else
-#define AT91SAM9_MASTER_CLOCK  99959500
-#endif
-
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91SAM9RL)
-
-#define AT91SAM9_MASTER_CLOCK  100000000
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91SAM9G20)
+#define AT91X40_MASTER_CLOCK   40000000
+#define CLOCK_TICK_RATE                (AT91X40_MASTER_CLOCK)
 
-#if defined(CONFIG_MACH_USB_A9G20)
-#define AT91SAM9_MASTER_CLOCK  133000000
 #else
-#define AT91SAM9_MASTER_CLOCK  132096000
-#endif
-
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91SAM9G45)
 
-#define AT91SAM9_MASTER_CLOCK  133333333
-#define CLOCK_TICK_RATE                (AT91SAM9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91CAP9)
-
-#define AT91CAP9_MASTER_CLOCK  100000000
-#define CLOCK_TICK_RATE                (AT91CAP9_MASTER_CLOCK/16)
-
-#elif defined(CONFIG_ARCH_AT91X40)
-
-#define AT91X40_MASTER_CLOCK   40000000
-#define CLOCK_TICK_RATE                (AT91X40_MASTER_CLOCK)
+#define CLOCK_TICK_RATE                12345678
 
 #endif
 
-#endif
+#endif /* __ASM_ARCH_TIMEX_H */
index 18bdcdeb474fb74713d9bcb7bd6a75bd6a2dd7c9..0234fd9d20d6f13dc81f6e98984a22e954b03aeb 100644 (file)
 #include <linux/io.h>
 #include <linux/atmel_serial.h>
 
-#if defined(CONFIG_AT91_EARLY_DBGU)
-#define UART_OFFSET (AT91_DBGU + AT91_BASE_SYS)
+#if defined(CONFIG_AT91_EARLY_DBGU0)
+#define UART_OFFSET AT91_BASE_DBGU0
+#elif defined(CONFIG_AT91_EARLY_DBGU1)
+#define UART_OFFSET AT91_BASE_DBGU1
 #elif defined(CONFIG_AT91_EARLY_USART0)
 #define UART_OFFSET AT91_USART0
 #elif defined(CONFIG_AT91_EARLY_USART1)
diff --git a/arch/arm/mach-at91/include/mach/vmalloc.h b/arch/arm/mach-at91/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 8e4a1bd..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/vmalloc.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * 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_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#include <mach/hardware.h>
-
-#define VMALLOC_END            (AT91_VIRT_BASE & PGDIR_MASK)
-
-#endif
index 9665265ec757b6c50372e45649506f1590ab01db..be6b639ecd7b7ac431d289b79f993c9f023b1479 100644 (file)
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 
+void __iomem *at91_aic_base;
 
 static void at91_aic_mask_irq(struct irq_data *d)
 {
        /* Disable interrupt on AIC */
-       at91_sys_write(AT91_AIC_IDCR, 1 << d->irq);
+       at91_aic_write(AT91_AIC_IDCR, 1 << d->irq);
 }
 
 static void at91_aic_unmask_irq(struct irq_data *d)
 {
        /* Enable interrupt on AIC */
-       at91_sys_write(AT91_AIC_IECR, 1 << d->irq);
+       at91_aic_write(AT91_AIC_IECR, 1 << d->irq);
 }
 
 unsigned int at91_extern_irq;
@@ -77,8 +78,8 @@ static int at91_aic_set_type(struct irq_data *d, unsigned type)
                return -EINVAL;
        }
 
-       smr = at91_sys_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE;
-       at91_sys_write(AT91_AIC_SMR(d->irq), smr | srctype);
+       smr = at91_aic_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE;
+       at91_aic_write(AT91_AIC_SMR(d->irq), smr | srctype);
        return 0;
 }
 
@@ -102,15 +103,15 @@ static int at91_aic_set_wake(struct irq_data *d, unsigned value)
 
 void at91_irq_suspend(void)
 {
-       backups = at91_sys_read(AT91_AIC_IMR);
-       at91_sys_write(AT91_AIC_IDCR, backups);
-       at91_sys_write(AT91_AIC_IECR, wakeups);
+       backups = at91_aic_read(AT91_AIC_IMR);
+       at91_aic_write(AT91_AIC_IDCR, backups);
+       at91_aic_write(AT91_AIC_IECR, wakeups);
 }
 
 void at91_irq_resume(void)
 {
-       at91_sys_write(AT91_AIC_IDCR, wakeups);
-       at91_sys_write(AT91_AIC_IECR, backups);
+       at91_aic_write(AT91_AIC_IDCR, wakeups);
+       at91_aic_write(AT91_AIC_IECR, backups);
 }
 
 #else
@@ -133,34 +134,39 @@ void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS])
 {
        unsigned int i;
 
+       at91_aic_base = ioremap(AT91_AIC, 512);
+
+       if (!at91_aic_base)
+               panic("Impossible to ioremap AT91_AIC\n");
+
        /*
         * The IVR is used by macro get_irqnr_and_base to read and verify.
         * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred.
         */
        for (i = 0; i < NR_AIC_IRQS; i++) {
                /* Put irq number in Source Vector Register: */
-               at91_sys_write(AT91_AIC_SVR(i), i);
+               at91_aic_write(AT91_AIC_SVR(i), i);
                /* Active Low interrupt, with the specified priority */
-               at91_sys_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
+               at91_aic_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
 
                irq_set_chip_and_handler(i, &at91_aic_chip, handle_level_irq);
                set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
 
                /* Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nIRQ */
                if (i < 8)
-                       at91_sys_write(AT91_AIC_EOICR, 0);
+                       at91_aic_write(AT91_AIC_EOICR, 0);
        }
 
        /*
         * Spurious Interrupt ID in Spurious Vector Register is NR_AIC_IRQS
         * When there is no current interrupt, the IRQ Vector Register reads the value stored in AIC_SPU
         */
-       at91_sys_write(AT91_AIC_SPU, NR_AIC_IRQS);
+       at91_aic_write(AT91_AIC_SPU, NR_AIC_IRQS);
 
        /* No debugging in AIC: Debug (Protect) Control Register */
-       at91_sys_write(AT91_AIC_DCR, 0);
+       at91_aic_write(AT91_AIC_DCR, 0);
 
        /* Disable and clear all interrupts initially */
-       at91_sys_write(AT91_AIC_IDCR, 0xFFFFFFFF);
-       at91_sys_write(AT91_AIC_ICCR, 0xFFFFFFFF);
+       at91_aic_write(AT91_AIC_IDCR, 0xFFFFFFFF);
+       at91_aic_write(AT91_AIC_ICCR, 0xFFFFFFFF);
 }
index 7046158109d7cd581776466798becc3abbe83f47..62ad95556c367f7ab7f0311428b6475070aeab02 100644 (file)
@@ -34,7 +34,7 @@
 /*
  * Show the reason for the previous system reset.
  */
-#if defined(AT91_SHDWC)
+#if defined(AT91_RSTC)
 
 #include <mach/at91_rstc.h>
 #include <mach/at91_shdwc.h>
@@ -58,8 +58,11 @@ static void __init show_reset_status(void)
        char *reason, *r2 = reset;
        u32 reset_type, wake_type;
 
+       if (!at91_shdwc_base)
+               return;
+
        reset_type = at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_RSTTYP;
-       wake_type = at91_sys_read(AT91_SHDW_SR);
+       wake_type = at91_shdwc_read(AT91_SHDW_SR);
 
        switch (reset_type) {
        case AT91_RSTC_RSTTYP_GENERAL:
@@ -215,7 +218,7 @@ static int at91_pm_enter(suspend_state_t state)
                                        | (1 << AT91_ID_FIQ)
                                        | (1 << AT91_ID_SYS)
                                        | (at91_extern_irq))
-                               & at91_sys_read(AT91_AIC_IMR),
+                               & at91_aic_read(AT91_AIC_IMR),
                        state);
 
        switch (state) {
@@ -283,7 +286,7 @@ static int at91_pm_enter(suspend_state_t state)
        }
 
        pr_debug("AT91: PM - wakeup %08x\n",
-                       at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));
+                       at91_aic_read(AT91_AIC_IPR) & at91_aic_read(AT91_AIC_IMR));
 
 error:
        target_state = PM_SUSPEND_ON;
index 5eab6aa621d070dd251411c6523ade62a3402962..8294783b679d8aa58579a9d0a149a1a79bb1af6a 100644 (file)
 
 #include <linux/module.h>
 #include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 
 #include <mach/at91sam9_smc.h>
 
 #include "sam9_smc.h"
 
-void __init sam9_smc_configure(int cs, struct sam9_smc_config* config)
+
+#define AT91_SMC_CS(id, n)     (smc_base_addr[id] + ((n) * 0x10))
+
+static void __iomem *smc_base_addr[2];
+
+static void __init sam9_smc_cs_configure(void __iomem *base, struct sam9_smc_config* config)
 {
+
        /* Setup register */
-       at91_sys_write(AT91_SMC_SETUP(cs),
-                 AT91_SMC_NWESETUP_(config->nwe_setup)
-               | AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup)
-               | AT91_SMC_NRDSETUP_(config->nrd_setup)
-               | AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup)
-       );
+       __raw_writel(AT91_SMC_NWESETUP_(config->nwe_setup)
+                  | AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup)
+                  | AT91_SMC_NRDSETUP_(config->nrd_setup)
+                  | AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup),
+                  base + AT91_SMC_SETUP);
 
        /* Pulse register */
-       at91_sys_write(AT91_SMC_PULSE(cs),
-                 AT91_SMC_NWEPULSE_(config->nwe_pulse)
-               | AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse)
-                | AT91_SMC_NRDPULSE_(config->nrd_pulse)
-               | AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse)
-       );
+       __raw_writel(AT91_SMC_NWEPULSE_(config->nwe_pulse)
+                  | AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse)
+                  | AT91_SMC_NRDPULSE_(config->nrd_pulse)
+                  | AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse),
+                  base + AT91_SMC_PULSE);
 
        /* Cycle register */
-       at91_sys_write(AT91_SMC_CYCLE(cs),
-                 AT91_SMC_NWECYCLE_(config->write_cycle)
-               | AT91_SMC_NRDCYCLE_(config->read_cycle)
-       );
+       __raw_writel(AT91_SMC_NWECYCLE_(config->write_cycle)
+                  | AT91_SMC_NRDCYCLE_(config->read_cycle),
+                  base + AT91_SMC_CYCLE);
 
        /* Mode register */
-       at91_sys_write(AT91_SMC_MODE(cs),
-                 config->mode
-               | AT91_SMC_TDF_(config->tdf_cycles)
-       );
+       __raw_writel(config->mode
+                  | AT91_SMC_TDF_(config->tdf_cycles),
+                  base + AT91_SMC_MODE);
+}
+
+void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config)
+{
+       sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config);
+}
+
+void __init at91sam9_ioremap_smc(int id, u32 addr)
+{
+       if (id > 1) {
+               pr_warn("%s: id > 2\n", __func__);
+               return;
+       }
+       smc_base_addr[id] = ioremap(addr, 512);
+       if (!smc_base_addr[id])
+               pr_warn("Impossible to ioremap smc.%d 0x%x\n", id, addr);
 }
index bf72cfb3455baf2ebb224eff017e4ecdab2fbea2..039c5ce17aec5cb2c8b01625041b7924f5bc7e3c 100644 (file)
@@ -30,4 +30,5 @@ struct sam9_smc_config {
        u8 tdf_cycles:4;
 };
 
-extern void __init sam9_smc_configure(int cs, struct sam9_smc_config* config);
+extern void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config);
+extern void __init at91sam9_ioremap_smc(int id, u32 addr);
index aa64294c7db39e9fba2da9cdffb46a9ac7d1c907..8bdcc3cb6012bf723ab46c27ca44f63d81d22da9 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/mm.h>
+#include <linux/pm.h>
 
 #include <asm/mach/map.h>
 
@@ -15,6 +16,7 @@
 #include <mach/cpu.h>
 #include <mach/at91_dbgu.h>
 #include <mach/at91_pmc.h>
+#include <mach/at91_shdwc.h>
 
 #include "soc.h"
 #include "generic.h"
@@ -73,27 +75,6 @@ static struct map_desc at91_io_desc __initdata = {
        .type           = MT_DEVICE,
 };
 
-void __iomem *at91_ioremap(unsigned long p, size_t size, unsigned int type)
-{
-       if (p >= AT91_BASE_SYS && p <= (AT91_BASE_SYS + SZ_16K - 1))
-               return (void __iomem *)AT91_IO_P2V(p);
-
-       return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
-}
-EXPORT_SYMBOL(at91_ioremap);
-
-void at91_iounmap(volatile void __iomem *addr)
-{
-       unsigned long virt = (unsigned long)addr;
-
-       if (virt >= VMALLOC_START && virt < VMALLOC_END)
-               __iounmap(addr);
-}
-EXPORT_SYMBOL(at91_iounmap);
-
-#define AT91_DBGU0     0xfffff200
-#define AT91_DBGU1     0xffffee00
-
 static void __init soc_detect(u32 dbgu_base)
 {
        u32 cidr, socid;
@@ -266,9 +247,9 @@ void __init at91_map_io(void)
        at91_soc_initdata.type = AT91_SOC_NONE;
        at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
 
-       soc_detect(AT91_DBGU0);
+       soc_detect(AT91_BASE_DBGU0);
        if (!at91_soc_is_detected())
-               soc_detect(AT91_DBGU1);
+               soc_detect(AT91_BASE_DBGU1);
 
        if (!at91_soc_is_detected())
                panic("AT91: Impossible to detect the SOC type");
@@ -285,8 +266,25 @@ void __init at91_map_io(void)
                at91_boot_soc.map_io();
 }
 
+void __iomem *at91_shdwc_base = NULL;
+
+static void at91sam9_poweroff(void)
+{
+       at91_shdwc_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
+void __init at91_ioremap_shdwc(u32 base_addr)
+{
+       at91_shdwc_base = ioremap(base_addr, 16);
+       if (!at91_shdwc_base)
+               panic("Impossible to ioremap at91_shdwc_base\n");
+       pm_power_off = at91sam9_poweroff;
+}
+
 void __init at91_initialize(unsigned long main_clock)
 {
+       at91_boot_soc.ioremap_registers();
+
        /* Init clock subsystem */
        at91_clock_init(main_clock);
 
index 21ed8816e6f7021f2e2516256347c5be7890e68b..4588ae6f7acd0fda38afa0fee51eb57ac4eb6fa6 100644 (file)
@@ -7,6 +7,7 @@
 struct at91_init_soc {
        unsigned int *default_irq_priority;
        void (*map_io)(void);
+       void (*ioremap_registers)(void);
        void (*register_clocks)(void);
        void (*init)(void);
 };
index 31a143592c81deeb481b53293c2d6dc7c57f2e0d..9e5e7552498c362c7880b76d3e820640cddfc555 100644 (file)
@@ -49,7 +49,29 @@ HW_DECLARE_SPINLOCK(gpio)
 #endif
 
 /* sysctl */
-int bcmring_arch_warm_reboot;  /* do a warm reboot on hard reset */
+static int bcmring_arch_warm_reboot;   /* do a warm reboot on hard reset */
+
+static void bcmring_restart(char mode, const char *cmd)
+{
+       printk("arch_reset:%c %x\n", mode, bcmring_arch_warm_reboot);
+
+       if (mode == 'h') {
+               /* Reboot configured in proc entry */
+               if (bcmring_arch_warm_reboot) {
+                       printk("warm reset\n");
+                       /* Issue Warm reset (do not reset ethernet switch, keep alive) */
+                       chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_WARM);
+               } else {
+                       /* Force reset of everything */
+                       printk("force reset\n");
+                       chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
+               }
+       } else {
+               /* Force reset of everything */
+               printk("force reset\n");
+               chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
+       }
+}
 
 static struct ctl_table_header *bcmring_sysctl_header;
 
@@ -173,4 +195,5 @@ MACHINE_START(BCMRING, "BCMRING")
        .init_irq = bcmring_init_irq,
        .timer = &bcmring_timer,
        .init_machine = bcmring_init_machine
+       .restart = bcmring_restart,
 MACHINE_END
index f4d4d6d174d06e9c049756de6089e02e790abe8a..1a1a27dd56544d0684bebc29d40b69bdff2d190f 100644 (file)
@@ -1615,7 +1615,7 @@ DMA_MemType_t dma_mem_type(void *addr)
 {
        unsigned long addrVal = (unsigned long)addr;
 
-       if (addrVal >= VMALLOC_END) {
+       if (addrVal >= CONSISTENT_BASE) {
                /* NOTE: DMA virtual memory space starts at 0xFFxxxxxx */
 
                /* dma_alloc_xxx pages are physically and virtually contiguous */
index 38b37060d42683a9f09d9340ad001914410b4e25..cb78250db64983fe8ed2bca3c76d7941a4726a93 100644 (file)
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <mach/csp/chipcHw_inline.h>
-
-extern int bcmring_arch_warm_reboot;
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       printk("arch_reset:%c %x\n", mode, bcmring_arch_warm_reboot);
-
-       if (mode == 'h') {
-               /* Reboot configured in proc entry */
-               if (bcmring_arch_warm_reboot) {
-                       printk("warm reset\n");
-                       /* Issue Warm reset (do not reset ethernet switch, keep alive) */
-                       chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_WARM);
-               } else {
-                       /* Force reset of everything */
-                       printk("force reset\n");
-                       chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
-               }
-       } else {
-               /* Force reset of everything */
-               printk("force reset\n");
-               chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
-       }
-}
-
 #endif
diff --git a/arch/arm/mach-bcmring/include/mach/vmalloc.h b/arch/arm/mach-bcmring/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 7397bd7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-
-/*
- * Move VMALLOC_END to 0xf0000000 so that the vm space can range from
- * 0xe0000000 to 0xefffffff. This gives us 256 MB of vm space and handles
- * larger physical memory designs better.
- */
-#define VMALLOC_END       0xf0000000UL
index 4a197315f0cf0c6c03c3d5b4f92acf14408039f2..f2f0256232e3bbbf4f4ac045697e2151f7be7db7 100644 (file)
@@ -4,7 +4,7 @@
 
 # Object file lists.
 
-obj-y                  := irq.o mm.o time.o
+obj-y                  := common.o
 obj-m                  :=
 obj-n                  :=
 obj-                   :=
index 0276091b7f86d406cd2bd382921fbac1d6e7a48b..3fb79a1d0bde3e94f9804d9d0a4f47e1e490a937 100644 (file)
@@ -68,5 +68,6 @@ MACHINE_START(AUTCPU12, "autronix autcpu12")
        .map_io         = autcpu12_map_io,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
+       .restart        = clps711x_restart,
 MACHINE_END
 
index 25b3bfd0e85aa56679973b6cbfd1024b3817051b..c314f49d6ef66dd7eda503654f5ed67899ffe9a2 100644 (file)
@@ -59,4 +59,5 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712")
        .map_io         = cdb89712_map_io,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
+       .restart        = clps711x_restart,
 MACHINE_END
index 1df9ec67aa9228fcdfa02276650d9c156c94af74..a70147e347ac99516990871761e1c8d72c69aba5 100644 (file)
@@ -60,4 +60,5 @@ MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
        .map_io         = ceiva_map_io,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
+       .restart        = clps711x_restart,
 MACHINE_END
index 80496c09ac59efd63746560cf17a994dde5bfaec..dbc7842639dccb6f48c9481184caff452a33779e 100644 (file)
@@ -41,5 +41,6 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
        .map_io         = clps711x_map_io,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
+       .restart        = clps711x_restart,
 MACHINE_END
 
similarity index 58%
rename from arch/arm/mach-clps711x/irq.c
rename to arch/arm/mach-clps711x/common.c
index c2eceee645e3ecac1b2d66fd94fd1b26a683b3e2..ab1711b9b4d6324f039dfc12a63802b53937daf9 100644 (file)
@@ -1,7 +1,9 @@
 /*
- *  linux/arch/arm/mach-clps711x/irq.c
+ *  linux/arch/arm/mach-clps711x/core.c
  *
- *  Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *  Core support for the CLPS711x-based machines.
+ *
+ *  Copyright (C) 2001,2011 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
  * 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/kernel.h>
+#include <linux/mm.h>
 #include <linux/init.h>
-#include <linux/list.h>
+#include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/sched.h>
+#include <linux/timex.h>
 
-#include <asm/mach/irq.h>
+#include <asm/sizes.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
-
+#include <asm/leds.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/mach/map.h>
+#include <asm/mach/time.h>
 #include <asm/hardware/clps7111.h>
 
+/*
+ * This maps the generic CLPS711x registers
+ */
+static struct map_desc clps711x_io_desc[] __initdata = {
+       {
+               .virtual        = CLPS7111_VIRT_BASE,
+               .pfn            = __phys_to_pfn(CLPS7111_PHYS_BASE),
+               .length         = SZ_1M,
+               .type           = MT_DEVICE
+       }
+};
+
+void __init clps711x_map_io(void)
+{
+       iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
+}
+
 static void int1_mask(struct irq_data *d)
 {
        u32 intmr1;
@@ -112,15 +140,15 @@ void __init clps711x_init_irq(void)
 
        for (i = 0; i < NR_IRQS; i++) {
                if (INT1_IRQS & (1 << i)) {
-                       irq_set_chip_and_handler(i, &int1_chip,
+                       irq_set_chip_and_handler(i, &int1_chip,
                                                 handle_level_irq);
-                       set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+                       set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
                }
                if (INT2_IRQS & (1 << i)) {
                        irq_set_chip_and_handler(i, &int2_chip,
                                                 handle_level_irq);
                        set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
-               }                       
+               }
        }
 
        /*
@@ -141,3 +169,59 @@ void __init clps711x_init_irq(void)
        clps_writel(0, SYNCIO);
        clps_writel(0, KBDEOI);
 }
+
+/*
+ * gettimeoffset() returns time since last timer tick, in usecs.
+ *
+ * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
+ * 'tick' is usecs per jiffy.
+ */
+static unsigned long clps711x_gettimeoffset(void)
+{
+       unsigned long hwticks;
+       hwticks = LATCH - (clps_readl(TC2D) & 0xffff);  /* since last underflow */
+       return (hwticks * (tick_nsec / 1000)) / LATCH;
+}
+
+/*
+ * IRQ handler for the timer
+ */
+static irqreturn_t p720t_timer_interrupt(int irq, void *dev_id)
+{
+       timer_tick();
+       return IRQ_HANDLED;
+}
+
+static struct irqaction clps711x_timer_irq = {
+       .name           = "CLPS711x Timer Tick",
+       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+       .handler        = p720t_timer_interrupt,
+};
+
+static void __init clps711x_timer_init(void)
+{
+       struct timespec tv;
+       unsigned int syscon;
+
+       syscon = clps_readl(SYSCON1);
+       syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
+       clps_writel(syscon, SYSCON1);
+
+       clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
+
+       setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
+
+       tv.tv_nsec = 0;
+       tv.tv_sec = clps_readl(RTCDR);
+       do_settimeofday(&tv);
+}
+
+struct sys_timer clps711x_timer = {
+       .init           = clps711x_timer_init,
+       .offset         = clps711x_gettimeoffset,
+};
+
+void clps711x_restart(char mode, const char *cmd)
+{
+       soft_restart(0);
+}
index 9721f6111dc0bb567546288a612123014c005087..5fad0b4f40ad1ab9635c20fe65437b52de23632f 100644 (file)
@@ -62,4 +62,5 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
        .reserve        = edb7211_reserve,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
+       .restart        = clps711x_restart,
 MACHINE_END
index d99256687298dae6f79014eb7d5477c43352291d..3a3f0b702cb4777c50b399b861e81f5b3db1aa8b 100644 (file)
@@ -78,4 +78,5 @@ MACHINE_START(FORTUNET, "ARM-FortuNet")
        .map_io         = clps711x_map_io,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
+       .restart        = clps711x_restart,
 MACHINE_END
index f916cd7a477d14ca8b552f6b2a3fe8b231a8d40e..23d6ef8c84daa5a7de5dc35a56e848217bfe2b8b 100644 (file)
@@ -32,9 +32,4 @@ static inline void arch_idle(void)
        mov     r0, r0");
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       cpu_reset(0);
-}
-
 #endif
diff --git a/arch/arm/mach-clps711x/include/mach/vmalloc.h b/arch/arm/mach-clps711x/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 467b961..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  arch/arm/mach-clps711x/include/mach/vmalloc.h
- *
- *  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
- */
-#define VMALLOC_END       0xd0000000UL
diff --git a/arch/arm/mach-clps711x/mm.c b/arch/arm/mach-clps711x/mm.c
deleted file mode 100644 (file)
index 9865921..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *  linux/arch/arm/mach-clps711x/mm.c
- *
- *  Generic MM setup for the CLPS711x-based machines.
- *
- *  Copyright (C) 2001 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/kernel.h>
-#include <linux/mm.h>
-#include <linux/init.h>
-
-#include <asm/sizes.h>
-#include <mach/hardware.h>
-#include <asm/pgtable.h>
-#include <asm/page.h>
-#include <asm/mach/map.h>
-#include <asm/hardware/clps7111.h>
-
-/*
- * This maps the generic CLPS711x registers
- */
-static struct map_desc clps711x_io_desc[] __initdata = {
-       {
-               .virtual        = CLPS7111_VIRT_BASE,
-               .pfn            = __phys_to_pfn(CLPS7111_PHYS_BASE),
-               .length         = SZ_1M,
-               .type           = MT_DEVICE
-       }
-};
-
-void __init clps711x_map_io(void)
-{
-       iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
-}
index 6ecea95f38b2f92b90753fbf3dca19cd30af0a53..42ee8f33eafbaf7421c6db5b5dd0630971fc660b 100644 (file)
@@ -93,6 +93,7 @@ MACHINE_START(P720T, "ARM-Prospector720T")
        .map_io         = p720t_map_io,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
+       .restart        = clps711x_restart,
 MACHINE_END
 
 static int p720t_hw_init(void)
diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c
deleted file mode 100644 (file)
index d581ef0..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *  linux/arch/arm/mach-clps711x/time.c
- *
- *  Copyright (C) 2001 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 version 2 as
- * published by the Free Software Foundation.
- *
- * 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/timex.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/sched.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-#include <asm/irq.h>
-#include <asm/leds.h>
-#include <asm/hardware/clps7111.h>
-
-#include <asm/mach/time.h>
-
-
-/*
- * gettimeoffset() returns time since last timer tick, in usecs.
- *
- * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
- * 'tick' is usecs per jiffy.
- */
-static unsigned long clps711x_gettimeoffset(void)
-{
-       unsigned long hwticks;
-       hwticks = LATCH - (clps_readl(TC2D) & 0xffff);  /* since last underflow */
-       return (hwticks * (tick_nsec / 1000)) / LATCH;
-}
-
-/*
- * IRQ handler for the timer
- */
-static irqreturn_t
-p720t_timer_interrupt(int irq, void *dev_id)
-{
-       timer_tick();
-       return IRQ_HANDLED;
-}
-
-static struct irqaction clps711x_timer_irq = {
-       .name           = "CLPS711x Timer Tick",
-       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = p720t_timer_interrupt,
-};
-
-static void __init clps711x_timer_init(void)
-{
-       struct timespec tv;
-       unsigned int syscon;
-
-       syscon = clps_readl(SYSCON1);
-       syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
-       clps_writel(syscon, SYSCON1);
-
-       clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
-
-       setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
-
-       tv.tv_nsec = 0;
-       tv.tv_sec = clps_readl(RTCDR);
-       do_settimeofday(&tv);
-}
-
-struct sys_timer clps711x_timer = {
-       .init           = clps711x_timer_init,
-       .offset         = clps711x_gettimeoffset,
-};
index 55f7b4b08ab906822cf11b8db544b4ba64d0872b..2c5fb4c7e509b8786fb1ba0d45cb974bc373f4d2 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/mtd/partitions.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>
@@ -201,5 +202,7 @@ MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
        .map_io         = cns3420_map_io,
        .init_irq       = cns3xxx_init_irq,
        .timer          = &cns3xxx_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = cns3420_init,
+       .restart        = cns3xxx_restart,
 MACHINE_END
index fcd225343c61c6b18535edcd2ce0230db8e65348..4894b8c17151330ff956ae490608728b629b4e12 100644 (file)
@@ -22,5 +22,6 @@ static inline void cns3xxx_l2x0_init(void) {}
 void __init cns3xxx_map_io(void);
 void __init cns3xxx_init_irq(void);
 void cns3xxx_power_off(void);
+void cns3xxx_restart(char, const char *);
 
 #endif /* __CNS3XXX_CORE_H */
index d87bfc397d39859d01817c016e8c8b4aceab72d3..01c57df5f716b3890a9f380cdb258ba37bcf4629 100644 (file)
@@ -8,8 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <asm/hardware/entry-macro-gic.S>
-
                .macro  disable_fiq
                .endm
 
index 4f16c9b79f784e970e1e467b8dafbeb7f7feef61..9e56b7dc133a35448ea2fc0a1a29446b33bfb3b4 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef __MACH_SYSTEM_H
 #define __MACH_SYSTEM_H
 
-#include <linux/io.h>
 #include <asm/proc-fns.h>
 
 static inline void arch_idle(void)
@@ -23,6 +22,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-void arch_reset(char mode, const char *cmd);
-
 #endif
diff --git a/arch/arm/mach-cns3xxx/include/mach/vmalloc.h b/arch/arm/mach-cns3xxx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 1dd231d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright 2000 Russell King.
- * Copyright 2003 ARM Limited
- * Copyright 2008 Cavium Networks
- *
- * This file 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 VMALLOC_END            0xd8000000UL
index 0c04678615ceade16015442eeefada0ae1623c7d..36458080332ad36ce92bb232bc00fd876f9aa58b 100644 (file)
@@ -11,9 +11,9 @@
 #include <linux/io.h>
 #include <linux/delay.h>
 #include <linux/atomic.h>
-#include <mach/system.h>
 #include <mach/cns3xxx.h>
 #include <mach/pm.h>
+#include "core.h"
 
 void cns3xxx_pwr_clk_en(unsigned int block)
 {
@@ -89,7 +89,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block)
 }
 EXPORT_SYMBOL(cns3xxx_pwr_soft_rst);
 
-void arch_reset(char mode, const char *cmd)
+void cns3xxx_restart(char mode, const char *cmd)
 {
        /*
         * To reset, we hit the on-board reset register
index 495e31306fc00a213f3084daf20894bfa94c53bd..2db78bd5c835dbda436faf7184fc837b8eed8f0e 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 # Common objects
-obj-y                  := time.o clock.o serial.o io.o psc.o \
+obj-y                  := time.o clock.o serial.o psc.o \
                           dma.o usb.o common.o sram.o aemif.o
 
 obj-$(CONFIG_DAVINCI_MUX)              += mux.o
index 11c3db985285880ac7a2f22b13b51ff677fcae46..dc1afe5be20cc3d305c178faaec0bfd1633e4e3f 100644 (file)
@@ -682,4 +682,5 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
        .timer          = &davinci_timer,
        .init_machine   = da830_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index 6659a90dbcadafffdc6ae4988f1a1c6148a955b5..f8a682f60a4208defb9daeae1c4d105b4ed09230 100644 (file)
@@ -1411,4 +1411,5 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
        .timer          = &davinci_timer,
        .init_machine   = da850_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index 4e0e707c313d7b9e51f87acbece9b3e0af3a97f3..275341f159fb6ee6cc0ddef2ca04bf14349eb913 100644 (file)
@@ -357,4 +357,5 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
        .timer        = &davinci_timer,
        .init_machine = dm355_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index ff2d2413279a26482411dcbb8728266b93e8bbe4..e99db28181ae8ad518a08dfafbb57fa6de4d09f0 100644 (file)
@@ -276,4 +276,5 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
        .timer        = &davinci_timer,
        .init_machine = dm355_leopard_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index 46e1f4173b9735c622c8a95c5c9a605782c1eda6..346e1de2f5a857ac16fb9c2ecb5b85af9c4537d9 100644 (file)
@@ -618,5 +618,6 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
        .timer          = &davinci_timer,
        .init_machine   = dm365_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
 
index 0cf8abf78d33d878acd1dbf3480e7d92403e2c66..a64b49cfedcad5f495ac2e360751e045036ca2cd 100644 (file)
@@ -719,4 +719,5 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
        .timer        = &davinci_timer,
        .init_machine = davinci_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index 635bf7740157bb7ea88b94580c98ead839f44068..64017558860bd0c127a9c5178d8aacd47229a62f 100644 (file)
@@ -799,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
        .timer        = &davinci_timer,
        .init_machine = evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
 
 MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
@@ -808,5 +809,6 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
        .timer        = &davinci_timer,
        .init_machine = evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
 
index 3cfff555e8f22a842eb75f3614d5e5605eaf642b..672d820e2aa4c73d93fe128cd233d99ae2fa8eaa 100644 (file)
@@ -573,4 +573,5 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
        .timer          = &davinci_timer,
        .init_machine   = mityomapl138_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index e5f231aefee428bfd26cde4b4b05d7de45627992..6c4a16415d476f58fbdadb88308cb803a9019956 100644 (file)
@@ -278,4 +278,5 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
        .timer          = &davinci_timer,
        .init_machine = davinci_ntosd2_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index c6701e4a795c3da5ebe3a14f1d2e770e8a6231aa..e7c0c7c534937132929cf4cdd760fb4c63f4118b 100644 (file)
@@ -344,4 +344,5 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
        .timer          = &davinci_timer,
        .init_machine   = omapl138_hawk_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index 5dd4da9d23083e83010725df9a83bee61e9f2b06..0b136a831c59563100312646d0b1b1324e8c4e20 100644 (file)
@@ -157,4 +157,5 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
        .timer        = &davinci_timer,
        .init_machine = davinci_sffsdr_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index f69e40a29e0256005801d46756529dadb3e1d5db..5f14e30b00d896a79c83ded76929543c956fb93f 100644 (file)
@@ -283,4 +283,5 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
        .timer          = &davinci_timer,
        .init_machine   = tnetv107x_evm_board_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = tnetv107x_restart,
 MACHINE_END
index 865ffe5899ac4eb2864176542a150c3ca2524a87..cb9b2e47510c8de2118bd80364f4b60b4308e07b 100644 (file)
@@ -97,9 +97,6 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
        local_flush_tlb_all();
        flush_cache_all();
 
-       if (!davinci_soc_info.reset)
-               davinci_soc_info.reset = davinci_watchdog_reset;
-
        /*
         * We want to check CPU revision early for cpu_is_xxxx() macros.
         * IO space mapping must be initialized before we can do that.
index a6bf5dcaef1341863d614412fe3bc29275f44a47..deee5c2da7546b987be46b596b00bef4bbf04d1f 100644 (file)
@@ -1201,7 +1201,6 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
        .gpio_irq               = IRQ_DA8XX_GPIO0,
        .serial_dev             = &da8xx_serial_device,
        .emac_pdata             = &da8xx_emac_pdata,
-       .reset_device           = &da8xx_wdt_device,
 };
 
 void __init da830_init(void)
index b047f87022785477ffafc8336bfd438f27e51ae9..0ed7fdb64efbf5211a8e5b8fc19bc5cf56fc3b97 100644 (file)
@@ -1121,7 +1121,6 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
        .emac_pdata             = &da8xx_emac_pdata,
        .sram_dma               = DA8XX_ARM_RAM_BASE,
        .sram_len               = SZ_8K,
-       .reset_device           = &da8xx_wdt_device,
 };
 
 void __init da850_init(void)
index 68def71888685b0277b1dacab25bd5bfaef1c09e..42dbf3dc11abe780592cb07ddc72651e5a30c259 100644 (file)
@@ -363,6 +363,11 @@ struct platform_device da8xx_wdt_device = {
        .resource       = da8xx_watchdog_resources,
 };
 
+void da8xx_restart(char mode, const char *cmd)
+{
+       davinci_watchdog_reset(&da8xx_wdt_device);
+}
+
 int __init da8xx_register_watchdog(void)
 {
        return platform_device_register(&da8xx_wdt_device);
index 806a2f02b9808abf870ac9b9b0e1c77d99e60bb4..50c0156b42628db2402967054430dcce027004bf 100644 (file)
@@ -291,6 +291,11 @@ struct platform_device davinci_wdt_device = {
        .resource       = wdt_resources,
 };
 
+void davinci_restart(char mode, const char *cmd)
+{
+       davinci_watchdog_reset(&davinci_wdt_device);
+}
+
 static void davinci_init_wdt(void)
 {
        platform_device_register(&davinci_wdt_device);
index fe520d4167a2c34d3cc794ed3e836049bc926594..19667cfc5de0ec9ed10829a97ba225f7d2143037 100644 (file)
@@ -853,7 +853,6 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
        .serial_dev             = &dm355_serial_device,
        .sram_dma               = 0x00010000,
        .sram_len               = SZ_32K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
index 679e168dce34e55f4c711d12c01eab4300174bac..f15b435cc655c79003607cde11e599938cb05129 100644 (file)
@@ -1083,7 +1083,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
        .emac_pdata             = &dm365_emac_pdata,
        .sram_dma               = 0x00010000,
        .sram_len               = SZ_32K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm365_init_asp(struct snd_platform_data *pdata)
index 3470983aa343c6a9d30a0b50cdcd3570cd6882e0..0800f9cf33bbb0e2c0bf03dd1ce8fb4e34cb8d30 100644 (file)
@@ -767,7 +767,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
        .emac_pdata             = &dm644x_emac_pdata,
        .sram_dma               = 0x00008000,
        .sram_len               = SZ_16K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm644x_init_asp(struct snd_platform_data *pdata)
index af27c130595fb6897cb104253ad157f567d53f04..00f774394b167808a9d9adc2096fa7f94b20f4bf 100644 (file)
@@ -854,7 +854,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
        .emac_pdata             = &dm646x_emac_pdata,
        .sram_dma               = 0x10010000,
        .sram_len               = SZ_32K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm646x_init_mcasp0(struct snd_platform_data *pdata)
index a57cba21e21e1e150a949971deda4f46f38c50d7..5cd39a4e0c966d4823d2c438edf8376216f35ae6 100644 (file)
@@ -77,14 +77,13 @@ struct davinci_soc_info {
        struct emac_platform_data       *emac_pdata;
        dma_addr_t                      sram_dma;
        unsigned                        sram_len;
-       struct platform_device          *reset_device;
-       void                            (*reset)(struct platform_device *);
 };
 
 extern struct davinci_soc_info davinci_soc_info;
 
 extern void davinci_common_init(struct davinci_soc_info *soc_info);
 extern void davinci_init_ide(void);
+void davinci_restart(char mode, const char *cmd);
 
 /* standard place to map on-chip SRAMs; they *may* support DMA */
 #define SRAM_VIRT      0xfffe0000
index eaca7d8b9d68fb61c75f5da8dd7d6e787da8ef8c..ee3461d7ec1b9e1302f3bab314ee656200468d6e 100644 (file)
@@ -91,6 +91,7 @@ int da8xx_register_cpuidle(void);
 void __iomem * __init da8xx_get_mem_ctlr(void);
 int da850_register_pm(struct platform_device *pdev);
 int __init da850_register_sata(unsigned long refclkpn);
+void da8xx_restart(char mode, const char *cmd);
 
 extern struct platform_device da8xx_serial_device;
 extern struct emac_platform_data da8xx_emac_pdata;
index d1b954955c1242321dc296056d70d4d849db5555..b2267d1e1a71703889d6c693614a9ba2f9383a1e 100644 (file)
 #define __mem_pci(a)           (a)
 #define __mem_isa(a)           (a)
 
-#ifndef __ASSEMBLER__
-#define __arch_ioremap         davinci_ioremap
-#define __arch_iounmap         davinci_iounmap
-
-void __iomem *davinci_ioremap(unsigned long phys, size_t size,
-                             unsigned int type);
-void davinci_iounmap(volatile void __iomem *addr);
-#endif
 #endif /* __ASM_ARCH_IO_H */
index e65629c20769047ec4900d89f3bee1e09ac552fc..fcb7a015aba56e443eb9bea995aa60a063150c1e 100644 (file)
@@ -18,10 +18,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       if (davinci_soc_info.reset)
-               davinci_soc_info.reset(davinci_soc_info.reset_device);
-}
-
 #endif /* __ASM_ARCH_SYSTEM_H */
index 89c1fdc63c0b3924379798a7cc9552fa40d899ef..83e5926f3c46966f29b01c227d343a64dc12a7da 100644 (file)
@@ -54,6 +54,7 @@ extern struct platform_device tnetv107x_serial_device;
 extern void __init tnetv107x_init(void);
 extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *);
 extern void __init tnetv107x_irq_init(void);
+void tnetv107x_restart(char mode, const char *cmd);
 
 #endif
 
diff --git a/arch/arm/mach-davinci/include/mach/vmalloc.h b/arch/arm/mach-davinci/include/mach/vmalloc.h
deleted file mode 100644 (file)
index d49646a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * DaVinci vmalloc definitions
- *
- * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
- *
- * 2007 (c) MontaVista Software, Inc. 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 <mach/hardware.h>
-
-/* Allow vmalloc range until the IO virtual range minus a 2M "hole" */
-#define VMALLOC_END      (IO_VIRT - (2<<20))
diff --git a/arch/arm/mach-davinci/io.c b/arch/arm/mach-davinci/io.c
deleted file mode 100644 (file)
index 8ea60a8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * DaVinci I/O mapping code
- *
- * Copyright (C) 2005-2006 Texas Instruments
- *
- * 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/module.h>
-#include <linux/io.h>
-
-#include <asm/tlb.h>
-#include <asm/mach/map.h>
-
-#include <mach/common.h>
-
-/*
- * Intercept ioremap() requests for addresses in our fixed mapping regions.
- */
-void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)
-{
-       struct map_desc *desc = davinci_soc_info.io_desc;
-       int desc_num = davinci_soc_info.io_desc_num;
-       int i;
-
-       for (i = 0; i < desc_num; i++, desc++) {
-               unsigned long iophys = __pfn_to_phys(desc->pfn);
-               unsigned long iosize = desc->length;
-
-               if (p >= iophys && (p + size) <= (iophys + iosize))
-                       return __io(desc->virtual + p - iophys);
-       }
-
-       return __arm_ioremap_caller(p, size, type,
-                                       __builtin_return_address(0));
-}
-EXPORT_SYMBOL(davinci_ioremap);
-
-void davinci_iounmap(volatile void __iomem *addr)
-{
-       unsigned long virt = (unsigned long)addr;
-
-       if (virt >= VMALLOC_START && virt < VMALLOC_END)
-               __iounmap(addr);
-}
-EXPORT_SYMBOL(davinci_iounmap);
index 409bb869c7c766c071bf9838375b2df1410b14f3..dc1a209b9b66624fdfa8f748e237b682e3cec18a 100644 (file)
@@ -730,6 +730,11 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev)
        __raw_writel(1, &regs->kick);
 }
 
+void tnetv107x_restart(char mode, const char *cmd)
+{
+       tnetv107x_watchdog_reset(&tnetv107x_wdt_device);
+}
+
 static struct davinci_soc_info tnetv107x_soc_info = {
        .io_desc                = io_desc,
        .io_desc_num            = ARRAY_SIZE(io_desc),
@@ -752,8 +757,6 @@ static struct davinci_soc_info tnetv107x_soc_info = {
        .gpio_num               = TNETV107X_N_GPIO,
        .timer_info             = &timer_info,
        .serial_dev             = &tnetv107x_serial_device,
-       .reset                  = tnetv107x_watchdog_reset,
-       .reset_device           = &tnetv107x_wdt_device,
 };
 
 void __init tnetv107x_init(void)
index c8a406f7e946f70908061b0040361a122a6c8775..792b4e2e24f1e6d719f43376f9590a3fae813359 100644 (file)
@@ -93,4 +93,5 @@ MACHINE_START(CM_A510, "Compulab CM-A510 Board")
        .init_early     = dove_init_early,
        .init_irq       = dove_init_irq,
        .timer          = &dove_timer,
+       .restart        = dove_restart,
 MACHINE_END
index a9e0dae86a26f52cccd241a686ae7555b83b48cd..13bb236cd0cdd63dc15c0093d06ca6eabdef8775 100644 (file)
@@ -292,3 +292,19 @@ void __init dove_init(void)
        dove_xor0_init();
        dove_xor1_init();
 }
+
+void dove_restart(char mode, const char *cmd)
+{
+       /*
+        * Enable soft reset to assert RSTOUTn.
+        */
+       writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
+
+       /*
+        * Assert soft reset.
+        */
+       writel(SOFT_RESET, SYSTEM_SOFT_RESET);
+
+       while (1)
+               ;
+}
index 6a2046e4470678215675c46b165a30d8a38f664d..42027305c107984f9efde233a1b4a18f6c0cc4c5 100644 (file)
@@ -39,5 +39,6 @@ void dove_spi1_init(void);
 void dove_i2c_init(void);
 void dove_sdio0_init(void);
 void dove_sdio1_init(void);
+void dove_restart(char, const char *);
 
 #endif
index 11ea34e4fc7657838d63bbc8d20d916eb0c83be0..ea77ae430b2d018f034f536471c306cf2a68db1b 100644 (file)
@@ -100,4 +100,5 @@ MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
        .init_early     = dove_init_early,
        .init_irq       = dove_init_irq,
        .timer          = &dove_timer,
+       .restart        = dove_restart,
 MACHINE_END
index b20ec9af7882d2d365eeb24761a8e5f924df0b97..ad1165d488c13f393bf352a00f0e03b62265f3cc 100644 (file)
@@ -11,8 +11,6 @@
 #ifndef __ASM_ARCH_DOVE_H
 #define __ASM_ARCH_DOVE_H
 
-#include <mach/vmalloc.h>
-
 /*
  * Marvell Dove address maps.
  *
index 356afda56853b1667ba3e61d9d79a8eb8bae64ff..3027954f616246befe1245b9d634eaea8053bb9d 100644 (file)
@@ -9,28 +9,9 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <mach/bridge-regs.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /*
-        * Enable soft reset to assert RSTOUTn.
-        */
-       writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
-
-       /*
-        * Assert soft reset.
-        */
-       writel(SOFT_RESET, SYSTEM_SOFT_RESET);
-
-       while (1)
-               ;
-}
-
-
 #endif
diff --git a/arch/arm/mach-dove/include/mach/vmalloc.h b/arch/arm/mach-dove/include/mach/vmalloc.h
deleted file mode 100644 (file)
index a28792c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-dove/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END    0xfd800000UL
index d0ce8abdd4b67d4929d1f66d545004ec0fae3a8d..294aad07f7a05eaabcfe9b6fb7ac8d48ca1cfe10 100644 (file)
@@ -278,13 +278,19 @@ static int __init ebsa110_init(void)
 
 arch_initcall(ebsa110_init);
 
+static void ebsa110_restart(char mode, const char *cmd)
+{
+       soft_restart(0x80000000);
+}
+
 MACHINE_START(EBSA110, "EBSA110")
        /* Maintainer: Russell King */
        .atag_offset    = 0x400,
        .reserve_lp0    = 1,
        .reserve_lp2    = 1,
-       .soft_reboot    = 1,
+       .restart_mode   = 's',
        .map_io         = ebsa110_map_io,
        .init_irq       = ebsa110_init_irq,
        .timer          = &ebsa110_timer,
+       .restart        = ebsa110_restart,
 MACHINE_END
index 9a26245bf1fc58900c39242b90a6e1cabb3eeb14..2e4af65edb6fc0e7efd5336ebb8db59d01c693b4 100644 (file)
@@ -34,6 +34,4 @@ static inline void arch_idle(void)
        asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
 }
 
-#define arch_reset(mode, cmd)  cpu_reset(0x80000000)
-
 #endif
diff --git a/arch/arm/mach-ebsa110/include/mach/vmalloc.h b/arch/arm/mach-ebsa110/include/mach/vmalloc.h
deleted file mode 100644 (file)
index ea141b7..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  arch/arm/mach-ebsa110/include/mach/vmalloc.h
- *
- *  Copyright (C) 1998 Russell King
- *
- * 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 VMALLOC_END       0xdf000000UL
index 0713448206a5c5ffca9eb5972b203d4d408c5812..681e939407d4bc907dfb99f528992c12bb462eec 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <mach/hardware.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -36,6 +37,8 @@ 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_machine   = adssphere_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
index 2432a6b7dcac79b8f83e8261198835e45d1cd02f..24203f9a67967df314a6d3776d6ac581a8d22fb3 100644 (file)
@@ -906,3 +906,15 @@ void __init ep93xx_init_devices(void)
        platform_device_register(&ep93xx_ohci_device);
        platform_device_register(&ep93xx_leds);
 }
+
+void ep93xx_restart(char mode, const char *cmd)
+{
+       /*
+        * Set then clear the SWRST bit to initiate a software reset
+        */
+       ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_SWRST);
+       ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_SWRST);
+
+       while (1)
+               ;
+}
index 70ef8c527d2792957331ea066c26a8a56e2493de..d115653edca3e3cd9632fcfb14ebb616dad7a985 100644 (file)
@@ -39,6 +39,7 @@
 #include <mach/ep93xx_spi.h>
 #include <mach/gpio-ep93xx.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -250,8 +251,10 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -261,8 +264,10 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -272,8 +277,10 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -283,8 +290,10 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -294,8 +303,10 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -305,8 +316,10 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -316,8 +329,10 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -327,7 +342,9 @@ 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_machine   = edb93xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
index 45ee205856f876386417491822e1ab71a821d719..af46970dc58e78c2a484c4db0351c1eb8f94ab4b 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <mach/hardware.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -36,6 +37,8 @@ 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_machine   = gesbc9312_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
index 96b85e2c2c0b73532cd2a3299e6ab59cb9f9afa6..9be6edcf90453cf82698f37771ca58fbea1c1a45 100644 (file)
@@ -9,51 +9,9 @@
  * the Free Software Foundation; either version 2 of the License, or (at
  * your option) any later version.
  */
-#include <mach/ep93xx-regs.h>
 
                .macro  disable_fiq
                .endm
 
-               .macro  get_irqnr_preamble, base, tmp
-               .endm
-
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \base, =(EP93XX_AHB_VIRT_BASE)
-               orr     \base, \base, #0x000b0000
-               mov     \irqnr, #0
-               ldr     \irqstat, [\base]               @ lower 32 interrupts
-               cmp     \irqstat, #0
-               bne     1001f
-
-               eor     \base, \base, #0x00070000
-               ldr     \irqstat, [\base]               @ upper 32 interrupts
-               cmp     \irqstat, #0
-               beq     1002f
-               mov     \irqnr, #0x20
-
-1001:
-               movs    \tmp, \irqstat, lsl #16
-               movne   \irqstat, \tmp
-               addeq   \irqnr, \irqnr, #16
-
-               movs    \tmp, \irqstat, lsl #8
-               movne   \irqstat, \tmp
-               addeq   \irqnr, \irqnr, #8
-
-               movs    \tmp, \irqstat, lsl #4
-               movne   \irqstat, \tmp
-               addeq   \irqnr, \irqnr, #4
-
-               movs    \tmp, \irqstat, lsl #2
-               movne   \irqstat, \tmp
-               addeq   \irqnr, \irqnr, #2
-
-               movs    \tmp, \irqstat, lsl #1
-               addeq   \irqnr, \irqnr, #1
-               orrs    \base, \base, #1
-
-1002:
-               .endm
index 50660455b1d8bbaca6f221e8a8f7aa1710816057..d4c934931f9d4cbf85c580355a0115f154ca241e 100644 (file)
@@ -66,4 +66,6 @@ void ep93xx_register_ac97(void);
 void ep93xx_init_devices(void);
 extern struct sys_timer ep93xx_timer;
 
+void ep93xx_restart(char, const char *);
+
 #endif
index 6d661fe9d66c00d05ec8a8f61581206a007b6646..b5bec7cb9b52384f8eb499202f0e13f5b65b0abf 100644 (file)
@@ -1,24 +1,7 @@
 /*
  * arch/arm/mach-ep93xx/include/mach/system.h
  */
-
-#include <mach/hardware.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       local_irq_disable();
-
-       /*
-        * Set then clear the SWRST bit to initiate a software reset
-        */
-       ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_SWRST);
-       ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_SWRST);
-
-       while (1)
-               ;
-}
diff --git a/arch/arm/mach-ep93xx/include/mach/vmalloc.h b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 1b3f25d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-ep93xx/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END    0xfe800000UL
index e72f7368876ee537335129c4fdb5747016fda7dc..7b98084f0c97bf14e8830a30b3dd18b10d5a3163 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <mach/hardware.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -80,8 +81,10 @@ 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_machine   = micro9_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -91,8 +94,10 @@ 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_machine   = micro9_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -102,8 +107,10 @@ 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_machine   = micro9_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
 
@@ -113,7 +120,9 @@ 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_machine   = micro9_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
 #endif
index 52e090dc9d2786cf9171eea814f026ace04fc026..f4e553eca21c7d7c4cfdfd406489a34623945592 100644 (file)
@@ -25,6 +25,7 @@
 #include <mach/fb.h>
 #include <mach/gpio-ep93xx.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -80,6 +81,8 @@ 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_machine   = simone_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
index 8121e3aedc0a4693fac60000bc186d4edf4c343d..fd846331ddff9119023c2a726adae50a16578f6f 100644 (file)
@@ -31,6 +31,7 @@
 #include <mach/fb.h>
 #include <mach/gpio-ep93xx.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -177,6 +178,8 @@ 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_machine   = snappercl15_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
index 8b2f1435bcacfa2a60ac6a53e75f369ee55a11d8..79f8ecf07a190a082ac4da524ef185faea62715a 100644 (file)
@@ -23,6 +23,7 @@
 #include <mach/hardware.h>
 #include <mach/ts72xx.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
@@ -247,6 +248,8 @@ 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_machine   = ts72xx_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
index d96e4dbec6a8c6fc28a32c0b1e239db1437323f0..03dd4012043eb29a39b7abcf9e0d8bee92c77562 100644 (file)
@@ -361,4 +361,5 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
        .init_machine   = vision_init_machine,
+       .restart        = ep93xx_restart,
 MACHINE_END
index 724ec0f3560ddf5cb00cff43147e1ec3f98bfe3d..0afcc3b0f87094fbe26a16f9908697eb3d4bde54 100644 (file)
@@ -57,6 +57,11 @@ config EXYNOS4_MCT
        help
          Use MCT (Multi Core Timer) as kernel timers
 
+config EXYNOS4_DEV_DMA
+       bool
+       help
+         Compile in amba device definitions for DMA controller
+
 config EXYNOS4_DEV_AHCI
        bool
        help
@@ -177,6 +182,7 @@ config MACH_SMDKV310
        select SAMSUNG_DEV_BACKLIGHT
        select EXYNOS4_DEV_AHCI
        select SAMSUNG_DEV_KEYPAD
+       select EXYNOS4_DEV_DMA
        select EXYNOS4_DEV_PD
        select SAMSUNG_DEV_PWM
        select EXYNOS4_DEV_SYSMMU
@@ -197,6 +203,7 @@ config MACH_ARMLEX4210
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
        select EXYNOS4_DEV_AHCI
+       select EXYNOS4_DEV_DMA
        select EXYNOS4_DEV_SYSMMU
        select EXYNOS4_SETUP_SDHCI
        help
@@ -222,6 +229,7 @@ config MACH_UNIVERSAL_C210
        select S5P_DEV_MFC
        select S5P_DEV_ONENAND
        select S5P_DEV_TV
+       select EXYNOS4_DEV_DMA
        select EXYNOS4_DEV_PD
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_I2C1
@@ -255,6 +263,7 @@ config MACH_NURI
        select S5P_DEV_MFC
        select S5P_DEV_USB_EHCI
        select S5P_SETUP_MIPIPHY
+       select EXYNOS4_DEV_DMA
        select EXYNOS4_DEV_PD
        select EXYNOS4_SETUP_FIMC
        select EXYNOS4_SETUP_FIMD0
@@ -287,6 +296,7 @@ config MACH_ORIGEN
        select S5P_DEV_USB_EHCI
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_PWM
+       select EXYNOS4_DEV_DMA
        select EXYNOS4_DEV_PD
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_SDHCI
@@ -327,6 +337,20 @@ config MACH_SMDK4412
          Machine support for Samsung SMDK4412
 endif
 
+comment "Flattened Device Tree based board for Exynos4 based SoC"
+
+config MACH_EXYNOS4_DT
+       bool "Samsung Exynos4 Machine using device tree"
+       select CPU_EXYNOS4210
+       select USE_OF
+       select ARM_AMBA
+       select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
+       help
+         Machine support for Samsung Exynos4 machine with device tree enabled.
+         Select this if a fdt blob is available for the Exynos4 SoC based board.
+         Note: This is under development and not all peripherals can be supported
+         with this machine file.
+
 if ARCH_EXYNOS4
 
 comment "Configuration for HSMMC 8-bit bus width"
index 59069a35e40b922a11d3b93ac1dafdb250da92c5..57e5296208043c53923790ce6b5ef5958a3f1afd 100644 (file)
@@ -13,7 +13,7 @@ obj-                          :=
 # Core support for EXYNOS4 system
 
 obj-$(CONFIG_ARCH_EXYNOS4)     += cpu.o init.o clock.o irq-combiner.o setup-i2c0.o
-obj-$(CONFIG_ARCH_EXYNOS4)     += irq-eint.o dma.o pmu.o
+obj-$(CONFIG_ARCH_EXYNOS4)     += irq-eint.o pmu.o
 obj-$(CONFIG_CPU_EXYNOS4210)   += clock-exynos4210.o
 obj-$(CONFIG_SOC_EXYNOS4212)   += clock-exynos4212.o
 obj-$(CONFIG_PM)               += pm.o
@@ -37,6 +37,8 @@ obj-$(CONFIG_MACH_ORIGEN)             += mach-origen.o
 obj-$(CONFIG_MACH_SMDK4212)            += mach-smdk4x12.o
 obj-$(CONFIG_MACH_SMDK4412)            += mach-smdk4x12.o
 
+obj-$(CONFIG_MACH_EXYNOS4_DT)          += mach-exynos4-dt.o
+
 # device support
 
 obj-$(CONFIG_ARCH_EXYNOS4)             += dev-audio.o
@@ -44,6 +46,7 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI)                += dev-ahci.o
 obj-$(CONFIG_EXYNOS4_DEV_PD)           += dev-pd.o
 obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)       += dev-sysmmu.o
 obj-$(CONFIG_EXYNOS4_DEV_DWMCI)                += dev-dwmci.o
+obj-$(CONFIG_EXYNOS4_DEV_DMA)          += dma.o
 
 obj-$(CONFIG_EXYNOS4_SETUP_FIMC)       += setup-fimc.o
 obj-$(CONFIG_EXYNOS4_SETUP_FIMD0)      += setup-fimd0.o
@@ -55,6 +58,5 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C5)      += setup-i2c5.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C6)       += setup-i2c6.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C7)       += setup-i2c7.o
 obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD)     += setup-keypad.o
-obj-$(CONFIG_EXYNOS4_SETUP_SDHCI)      += setup-sdhci.o
 obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY)    += setup-usb-phy.o
index 2894f0adef5c325dd117c0224d5ddbf40809b0c7..28e2842978fd920623ac6e8ee47a65c9230f4442 100644 (file)
@@ -552,16 +552,6 @@ static struct clk init_clocks_off[] = {
                .devname        = "s5p-sdo",
                .enable         = exynos4_clk_dac_ctrl,
                .ctrlbit        = (1 << 0),
-       }, {
-               .name           = "dma",
-               .devname        = "dma-pl330.0",
-               .enable         = exynos4_clk_ip_fsys_ctrl,
-               .ctrlbit        = (1 << 0),
-       }, {
-               .name           = "dma",
-               .devname        = "dma-pl330.1",
-               .enable         = exynos4_clk_ip_fsys_ctrl,
-               .ctrlbit        = (1 << 1),
        }, {
                .name           = "adc",
                .enable         = exynos4_clk_ip_peril_ctrl,
@@ -778,6 +768,27 @@ static struct clk init_clocks[] = {
        }
 };
 
+static struct clk clk_pdma0 = {
+       .name           = "dma",
+       .devname        = "dma-pl330.0",
+       .enable         = exynos4_clk_ip_fsys_ctrl,
+       .ctrlbit        = (1 << 0),
+};
+
+static struct clk clk_pdma1 = {
+       .name           = "dma",
+       .devname        = "dma-pl330.1",
+       .enable         = exynos4_clk_ip_fsys_ctrl,
+       .ctrlbit        = (1 << 1),
+};
+
+static struct clk clk_mdma1 = {
+       .name           = "dma",
+       .devname        = "dma-pl330.2",
+       .enable         = exynos4_clk_ip_image_ctrl,
+       .ctrlbit        = ((1 << 8) | (1 << 5) | (1 << 2)),
+};
+
 struct clk *clkset_group_list[] = {
        [0] = &clk_ext_xtal_mux,
        [1] = &clk_xusbxti,
@@ -1009,46 +1020,6 @@ static struct clksrc_clk clk_dout_mmc4 = {
 
 static struct clksrc_clk clksrcs[] = {
        {
-               .clk    = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.0",
-                       .enable         = exynos4_clksrc_mask_peril0_ctrl,
-                       .ctrlbit        = (1 << 0),
-               },
-               .sources = &clkset_group,
-               .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 0, .size = 4 },
-               .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 0, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.1",
-                       .enable         = exynos4_clksrc_mask_peril0_ctrl,
-                       .ctrlbit        = (1 << 4),
-               },
-               .sources = &clkset_group,
-               .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 4, .size = 4 },
-               .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 4, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.2",
-                       .enable         = exynos4_clksrc_mask_peril0_ctrl,
-                       .ctrlbit        = (1 << 8),
-               },
-               .sources = &clkset_group,
-               .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 8, .size = 4 },
-               .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 8, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.3",
-                       .enable         = exynos4_clksrc_mask_peril0_ctrl,
-                       .ctrlbit        = (1 << 12),
-               },
-               .sources = &clkset_group,
-               .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 12, .size = 4 },
-               .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 },
-       }, {
                .clk            = {
                        .name           = "sclk_pwm",
                        .enable         = exynos4_clksrc_mask_peril0_ctrl,
@@ -1190,42 +1161,6 @@ static struct clksrc_clk clksrcs[] = {
                .sources = &clkset_mout_mfc,
                .reg_src = { .reg = S5P_CLKSRC_MFC, .shift = 8, .size = 1 },
                .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.0",
-                       .parent         = &clk_dout_mmc0.clk,
-                       .enable         = exynos4_clksrc_mask_fsys_ctrl,
-                       .ctrlbit        = (1 << 0),
-               },
-               .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.1",
-                       .parent         = &clk_dout_mmc1.clk,
-                       .enable         = exynos4_clksrc_mask_fsys_ctrl,
-                       .ctrlbit        = (1 << 4),
-               },
-               .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.2",
-                       .parent         = &clk_dout_mmc2.clk,
-                       .enable         = exynos4_clksrc_mask_fsys_ctrl,
-                       .ctrlbit        = (1 << 8),
-               },
-               .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.3",
-                       .parent         = &clk_dout_mmc3.clk,
-                       .enable         = exynos4_clksrc_mask_fsys_ctrl,
-                       .ctrlbit        = (1 << 12),
-               },
-               .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
        }, {
                .clk            = {
                        .name           = "sclk_dwmmc",
@@ -1237,6 +1172,98 @@ static struct clksrc_clk clksrcs[] = {
        }
 };
 
+static struct clksrc_clk clk_sclk_uart0 = {
+       .clk    = {
+               .name           = "uclk1",
+               .devname        = "exynos4210-uart.0",
+               .enable         = exynos4_clksrc_mask_peril0_ctrl,
+               .ctrlbit        = (1 << 0),
+       },
+       .sources = &clkset_group,
+       .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 0, .size = 4 },
+       .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 0, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_uart1 = {
+       .clk            = {
+               .name           = "uclk1",
+               .devname        = "exynos4210-uart.1",
+               .enable         = exynos4_clksrc_mask_peril0_ctrl,
+               .ctrlbit        = (1 << 4),
+       },
+       .sources = &clkset_group,
+       .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 4, .size = 4 },
+       .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 4, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_uart2 = {
+       .clk            = {
+               .name           = "uclk1",
+               .devname        = "exynos4210-uart.2",
+               .enable         = exynos4_clksrc_mask_peril0_ctrl,
+               .ctrlbit        = (1 << 8),
+       },
+       .sources = &clkset_group,
+       .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 8, .size = 4 },
+       .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 8, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_uart3 = {
+       .clk            = {
+               .name           = "uclk1",
+               .devname        = "exynos4210-uart.3",
+               .enable         = exynos4_clksrc_mask_peril0_ctrl,
+               .ctrlbit        = (1 << 12),
+       },
+       .sources = &clkset_group,
+       .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 12, .size = 4 },
+       .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc0 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.0",
+               .parent         = &clk_dout_mmc0.clk,
+               .enable         = exynos4_clksrc_mask_fsys_ctrl,
+               .ctrlbit        = (1 << 0),
+       },
+       .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.1",
+               .parent         = &clk_dout_mmc1.clk,
+               .enable         = exynos4_clksrc_mask_fsys_ctrl,
+               .ctrlbit        = (1 << 4),
+       },
+       .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.2",
+               .parent         = &clk_dout_mmc2.clk,
+               .enable         = exynos4_clksrc_mask_fsys_ctrl,
+               .ctrlbit        = (1 << 8),
+       },
+       .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.3",
+               .parent         = &clk_dout_mmc3.clk,
+               .enable         = exynos4_clksrc_mask_fsys_ctrl,
+               .ctrlbit        = (1 << 12),
+       },
+       .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
+};
+
 /* Clock initialization code */
 static struct clksrc_clk *sysclks[] = {
        &clk_mout_apll,
@@ -1271,6 +1298,36 @@ static struct clksrc_clk *sysclks[] = {
        &clk_mout_mfc1,
 };
 
+static struct clk *clk_cdev[] = {
+       &clk_pdma0,
+       &clk_pdma1,
+       &clk_mdma1,
+};
+
+static struct clksrc_clk *clksrc_cdev[] = {
+       &clk_sclk_uart0,
+       &clk_sclk_uart1,
+       &clk_sclk_uart2,
+       &clk_sclk_uart3,
+       &clk_sclk_mmc0,
+       &clk_sclk_mmc1,
+       &clk_sclk_mmc2,
+       &clk_sclk_mmc3,
+};
+
+static struct clk_lookup exynos4_clk_lookup[] = {
+       CLKDEV_INIT("exynos4210-uart.0", "clk_uart_baud0", &clk_sclk_uart0.clk),
+       CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk),
+       CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk),
+       CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+       CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+       CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
+       CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0),
+       CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1),
+};
+
 static int xtal_rate;
 
 static unsigned long exynos4_fout_apll_get_rate(struct clk *clk)
@@ -1478,11 +1535,19 @@ void __init exynos4_register_clocks(void)
        for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++)
                s3c_register_clksrc(sclk_tv[ptr], 1);
 
+       for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
+               s3c_register_clksrc(clksrc_cdev[ptr], 1);
+
        s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
        s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
 
+       s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
+       for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++)
+               s3c_disable_clocks(clk_cdev[ptr], 1);
+
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
+       clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup));
 
        register_syscore_ops(&exynos4_clock_syscore_ops);
        s3c24xx_register_clock(&dummy_apb_pclk);
index 90ec247f3b375f498e20f46c20e25fe2c943b54a..c7cb4626b839506fd97613c4e21e6162f60b9d47 100644 (file)
 
 #include <linux/sched.h>
 #include <linux/sysdev.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
 
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 
 #include <asm/proc-fns.h>
+#include <asm/exception.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/hardware/gic.h>
 
@@ -33,8 +36,6 @@
 #include <mach/regs-irq.h>
 #include <mach/regs-pmu.h>
 
-unsigned int gic_bank_offset __read_mostly;
-
 extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
                         unsigned int irq_start);
 extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
@@ -141,6 +142,28 @@ static struct map_desc exynos4_iodesc1[] __initdata = {
        },
 };
 
+/*
+ * For all ioremap requests of statically mapped regions, intercept ioremap and
+ * return virtual address from the iodesc table.
+ */
+void __iomem *exynos4_ioremap(unsigned long phy, size_t size, unsigned int type)
+{
+       struct map_desc *desc;
+       unsigned int idx;
+
+       desc = exynos_iodesc;
+       for (idx = 0; idx < ARRAY_SIZE(exynos_iodesc); idx++, desc++)
+               if (desc->pfn == __phys_to_pfn(phy) && desc->type == type)
+                       return (void __iomem *)desc->virtual;
+
+       desc = exynos4_iodesc;
+       for (idx = 0; idx < ARRAY_SIZE(exynos4_iodesc); idx++, desc++)
+               if (desc->pfn == __phys_to_pfn(phy) && desc->type == type)
+                       return (void __iomem *)desc->virtual;
+
+       return __arm_ioremap(phy, size, type);
+}
+
 static void exynos_idle(void)
 {
        if (!need_resched())
@@ -207,27 +230,26 @@ void __init exynos4_init_clocks(int xtal)
        exynos4_setup_clocks();
 }
 
-static void exynos4_gic_irq_fix_base(struct irq_data *d)
-{
-       struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
-
-       gic_data->cpu_base = S5P_VA_GIC_CPU +
-                           (gic_bank_offset * smp_processor_id());
-
-       gic_data->dist_base = S5P_VA_GIC_DIST +
-                           (gic_bank_offset * smp_processor_id());
-}
+#ifdef CONFIG_OF
+static const struct of_device_id exynos4_dt_irq_match[] = {
+       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
+       {},
+};
+#endif
 
 void __init exynos4_init_irq(void)
 {
        int irq;
+       unsigned int gic_bank_offset;
 
        gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
 
-       gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU);
-       gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base;
-       gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base;
-       gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base;
+       if (!of_have_populated_dt())
+               gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset);
+#ifdef CONFIG_OF
+       else
+               of_irq_init(exynos4_dt_irq_match);
+#endif
 
        for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
 
index 9667c61e64fb8d0296ab5d10658e082b83b7153d..e89329eddfd98172c4dee14fb313a3f6ff3fdc60 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/amba/bus.h>
 #include <linux/amba/pl330.h>
+#include <linux/of.h>
 
 #include <asm/irq.h>
 #include <plat/devs.h>
 
 static u64 dma_dmamask = DMA_BIT_MASK(32);
 
-struct dma_pl330_peri pdma0_peri[28] = {
-       {
-               .peri_id = (u8)DMACH_PCM0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ0,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ2,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0S_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART4_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART4_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS4_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS4_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_AC97_MICIN,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_AC97_PCMIN,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_AC97_PCMOUT,
-               .rqtype = MEMTODEV,
-       },
+u8 pdma0_peri[] = {
+       DMACH_PCM0_RX,
+       DMACH_PCM0_TX,
+       DMACH_PCM2_RX,
+       DMACH_PCM2_TX,
+       DMACH_MSM_REQ0,
+       DMACH_MSM_REQ2,
+       DMACH_SPI0_RX,
+       DMACH_SPI0_TX,
+       DMACH_SPI2_RX,
+       DMACH_SPI2_TX,
+       DMACH_I2S0S_TX,
+       DMACH_I2S0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S2_RX,
+       DMACH_I2S2_TX,
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART2_RX,
+       DMACH_UART2_TX,
+       DMACH_UART4_RX,
+       DMACH_UART4_TX,
+       DMACH_SLIMBUS0_RX,
+       DMACH_SLIMBUS0_TX,
+       DMACH_SLIMBUS2_RX,
+       DMACH_SLIMBUS2_TX,
+       DMACH_SLIMBUS4_RX,
+       DMACH_SLIMBUS4_TX,
+       DMACH_AC97_MICIN,
+       DMACH_AC97_PCMIN,
+       DMACH_AC97_PCMOUT,
 };
 
 struct dma_pl330_platdata exynos4_pdma0_pdata = {
        .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
-       .peri = pdma0_peri,
+       .peri_id = pdma0_peri,
 };
 
 struct amba_device exynos4_device_pdma0 = {
@@ -142,86 +90,37 @@ struct amba_device exynos4_device_pdma0 = {
        .periphid = 0x00041330,
 };
 
-struct dma_pl330_peri pdma1_peri[25] = {
-       {
-               .peri_id = (u8)DMACH_PCM0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ1,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ3,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0S_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS5_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SLIMBUS5_TX,
-               .rqtype = MEMTODEV,
-       },
+u8 pdma1_peri[] = {
+       DMACH_PCM0_RX,
+       DMACH_PCM0_TX,
+       DMACH_PCM1_RX,
+       DMACH_PCM1_TX,
+       DMACH_MSM_REQ1,
+       DMACH_MSM_REQ3,
+       DMACH_SPI1_RX,
+       DMACH_SPI1_TX,
+       DMACH_I2S0S_TX,
+       DMACH_I2S0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S1_RX,
+       DMACH_I2S1_TX,
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART1_RX,
+       DMACH_UART1_TX,
+       DMACH_UART3_RX,
+       DMACH_UART3_TX,
+       DMACH_SLIMBUS1_RX,
+       DMACH_SLIMBUS1_TX,
+       DMACH_SLIMBUS3_RX,
+       DMACH_SLIMBUS3_TX,
+       DMACH_SLIMBUS5_RX,
+       DMACH_SLIMBUS5_TX,
 };
 
 struct dma_pl330_platdata exynos4_pdma1_pdata = {
        .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
-       .peri = pdma1_peri,
+       .peri_id = pdma1_peri,
 };
 
 struct amba_device exynos4_device_pdma1 = {
@@ -240,11 +139,54 @@ struct amba_device exynos4_device_pdma1 = {
        .periphid = 0x00041330,
 };
 
+u8 mdma_peri[] = {
+       DMACH_MTOM_0,
+       DMACH_MTOM_1,
+       DMACH_MTOM_2,
+       DMACH_MTOM_3,
+       DMACH_MTOM_4,
+       DMACH_MTOM_5,
+       DMACH_MTOM_6,
+       DMACH_MTOM_7,
+};
+
+struct dma_pl330_platdata exynos4_mdma_pdata = {
+       .nr_valid_peri = ARRAY_SIZE(mdma_peri),
+       .peri_id = mdma_peri,
+};
+
+struct amba_device exynos4_device_mdma = {
+       .dev = {
+               .init_name = "dma-pl330.2",
+               .dma_mask = &dma_dmamask,
+               .coherent_dma_mask = DMA_BIT_MASK(32),
+               .platform_data = &exynos4_mdma_pdata,
+       },
+       .res = {
+               .start = EXYNOS4_PA_MDMA1,
+               .end = EXYNOS4_PA_MDMA1 + SZ_4K,
+               .flags = IORESOURCE_MEM,
+       },
+       .irq = {IRQ_MDMA1, NO_IRQ},
+       .periphid = 0x00041330,
+};
+
 static int __init exynos4_dma_init(void)
 {
+       if (of_have_populated_dt())
+               return 0;
+
+       dma_cap_set(DMA_SLAVE, exynos4_pdma0_pdata.cap_mask);
+       dma_cap_set(DMA_CYCLIC, exynos4_pdma0_pdata.cap_mask);
        amba_device_register(&exynos4_device_pdma0, &iomem_resource);
+
+       dma_cap_set(DMA_SLAVE, exynos4_pdma1_pdata.cap_mask);
+       dma_cap_set(DMA_CYCLIC, exynos4_pdma1_pdata.cap_mask);
        amba_device_register(&exynos4_device_pdma1, &iomem_resource);
 
+       dma_cap_set(DMA_MEMCPY, exynos4_mdma_pdata.cap_mask);
+       amba_device_register(&exynos4_device_mdma, &iomem_resource);
+
        return 0;
 }
 arch_initcall(exynos4_dma_init);
index f5e9fd8e37b4fc0d4e2657ba3739ea2d78aa7151..3ba4f547534b0715ab1f1cb8c00a14bbe952d248 100644 (file)
@@ -9,83 +9,8 @@
  * warranty of any kind, whether express or implied.
 */
 
-#include <mach/hardware.h>
-#include <mach/map.h>
-#include <asm/hardware/gic.h>
-
                .macro  disable_fiq
                .endm
 
-               .macro  get_irqnr_preamble, base, tmp
-               mov     \tmp, #0
-
-               mrc     p15, 0, \base, c0, c0, 5
-               and     \base, \base, #3
-               cmp     \base, #0
-               beq     1f
-
-               ldr     \tmp, =gic_bank_offset
-               ldr     \tmp, [\tmp]
-               cmp     \base, #1
-               beq     1f
-
-               cmp     \base, #2
-               addeq   \tmp, \tmp, \tmp
-               addne   \tmp, \tmp, \tmp, LSL #1
-
-1:             ldr     \base, =gic_cpu_base_addr
-               ldr     \base, [\base]
-               add     \base, \base, \tmp
-               .endm
-
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-               /*
-                * The interrupt numbering scheme is defined in the
-                * interrupt controller spec.  To wit:
-                *
-                * Interrupts 0-15 are IPI
-                * 16-28 are reserved
-                * 29-31 are local.  We allow 30 to be used for the watchdog.
-                * 32-1020 are global
-                * 1021-1022 are reserved
-                * 1023 is "spurious" (no interrupt)
-                *
-                * For now, we ignore all local interrupts so only return an interrupt if it's
-                * between 30 and 1020.  The test_for_ipi routine below will pick up on IPIs.
-                *
-                * A simple read from the controller will tell us the number of the highest
-                 * priority enabled interrupt.  We then just need to check whether it is in the
-                * valid range for an IRQ (30-1020 inclusive).
-                */
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-
-               ldr     \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */
-
-               ldr     \tmp, =1021
-
-               bic     \irqnr, \irqstat, #0x1c00
-
-               cmp     \irqnr, #15
-               cmpcc   \irqnr, \irqnr
-               cmpne   \irqnr, \tmp
-               cmpcs   \irqnr, \irqnr
-               addne   \irqnr, \irqnr, #32
-
-               .endm
-
-               /* We assume that irqstat (the raw value of the IRQ acknowledge
-                * register) is preserved from the macro above.
-                * If there is an IPI, we immediately signal end of interrupt on the
-                * controller, since this requires the original irqstat value which
-                * we won't easily be able to recreate later.
-                */
-
-               .macro test_for_ipi, irqnr, irqstat, base, tmp
-               bic     \irqnr, \irqstat, #0x1c00
-               cmp     \irqnr, #16
-               strcc   \irqstat, [\base, #GIC_CPU_EOI]
-               cmpcs   \irqnr, \irqnr
-               .endm
index d5478d24753555c4fd60a63ce58592b8dabad959..c1b21d5c1275cf10ee90fcb5ee5eb7465a1adca5 100644 (file)
 #define __mem_pci(a)   (a)
 
 #define IO_SPACE_LIMIT (0xFFFFFFFF)
+#define __arch_ioremap exynos4_ioremap
+#define __arch_iounmap __iounmap
+
+void __iomem *exynos4_ioremap(unsigned long phy, size_t size,
+                                       unsigned int type);
 
 #endif /* __ASM_ARM_ARCH_IO_H */
index dfd4b7eecb9076f8d00716f4a41223acae094b92..f7d73b12204e63fb1164cdb965d3a95741dcb583 100644 (file)
 
 /* PPI: Private Peripheral Interrupt */
 
-#define IRQ_PPI(x)             S5P_IRQ(x+16)
+#define IRQ_PPI(x)             (x+16)
 
 #define IRQ_MCT_LOCALTIMER     IRQ_PPI(12)
 
 /* SPI: Shared Peripheral Interrupt */
 
-#define IRQ_SPI(x)             S5P_IRQ(x+32)
+#define IRQ_SPI(x)             (x+32)
 
 #define IRQ_EINT0              IRQ_SPI(16)
 #define IRQ_EINT1              IRQ_SPI(17)
@@ -43,6 +43,8 @@
 #define IRQ_EINT15             IRQ_SPI(31)
 #define IRQ_EINT16_31          IRQ_SPI(32)
 
+#define IRQ_MDMA0              IRQ_SPI(33)
+#define IRQ_MDMA1              IRQ_SPI(34)
 #define IRQ_PDMA0              IRQ_SPI(35)
 #define IRQ_PDMA1              IRQ_SPI(36)
 #define IRQ_TIMER0_VIC         IRQ_SPI(37)
 #define IRQ_GPIO2_NR_GROUPS    9
 #define IRQ_GPIO_END           (S5P_GPIOINT_BASE + S5P_GPIOINT_COUNT)
 
+#define IRQ_TIMER_BASE         (IRQ_GPIO_END + 64)
+
 /* Set the default NR_IRQS */
-#define NR_IRQS                        (IRQ_GPIO_END + 64)
+#define NR_IRQS                        (IRQ_TIMER_BASE + IRQ_TIMER_COUNT)
 
 #endif /* __ASM_ARCH_IRQS_H */
index 058541d45af0906692eb9c6850beb0e903892efe..03e2c99a840a03a90640e0ce5ad445a058fd00f2 100644 (file)
@@ -67,7 +67,8 @@
 #define EXYNOS4_PA_TWD                 0x10500600
 #define EXYNOS4_PA_L2CC                        0x10502000
 
-#define EXYNOS4_PA_MDMA                        0x10810000
+#define EXYNOS4_PA_MDMA0               0x10810000
+#define EXYNOS4_PA_MDMA1               0x12840000
 #define EXYNOS4_PA_PDMA0               0x12680000
 #define EXYNOS4_PA_PDMA1               0x12690000
 
diff --git a/arch/arm/mach-exynos/include/mach/vmalloc.h b/arch/arm/mach-exynos/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 284330e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* linux/arch/arm/mach-exynos4/include/mach/vmalloc.h
- *
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
- *
- * Based on arch/arm/mach-s5p6440/include/mach/vmalloc.h
- *
- * 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.
- *
- * EXYNOS4 vmalloc definition
-*/
-
-#ifndef __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H __FILE__
-
-#define VMALLOC_END    0xF6000000UL
-
-#endif /* __ASM_ARCH_VMALLOC_H */
index a8a83e3881a4e9442a15a06a46210355e65ddebd..5b35978029be7fb4a006b4b210dcf835fd148102 100644 (file)
 #include <plat/devs.h>
 #include <plat/regs-serial.h>
 
-static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk1",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-};
-
 /* uart registration process */
 void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
        struct s3c2410_uartcfg *tcfg = cfg;
        u32 ucnt;
 
-       for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
-               if (!tcfg->clocks) {
-                       tcfg->has_fracval = 1;
-                       tcfg->clocks = exynos4_serial_clocks;
-                       tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
-               }
-               tcfg->flags |= NO_NEED_CHECK_CLKSRC;
-       }
+       for (ucnt = 0; ucnt < no; ucnt++, tcfg++)
+               tcfg->has_fracval = 1;
 
-       s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
+       s3c24xx_init_uartdevs("exynos4210-uart", s5p_uart_resources, cfg, no);
 }
index f0ca6c157d292d4ac2358ada85de4cd6c1949c18..49da3089249a04244f4df5e592ded614a694ee65 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/smsc911x.h>
 
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <plat/cpu.h>
@@ -210,6 +211,7 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = armlex4210_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = armlex4210_machine_init,
        .timer          = &exynos4_timer,
 MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
new file mode 100644 (file)
index 0000000..85fa027
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Samsung's Exynos4210 flattened device tree enabled machine
+ *
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2010-2011 Linaro Ltd.
+ *             www.linaro.org
+ *
+ * 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/of_platform.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/arch.h>
+#include <mach/map.h>
+
+#include <plat/cpu.h>
+#include <plat/regs-serial.h>
+#include <plat/exynos4.h>
+
+/*
+ * The following lookup table is used to override device names when devices
+ * are registered from device tree. This is temporarily added to enable
+ * device tree support addition for the Exynos4 architecture.
+ *
+ * For drivers that require platform data to be provided from the machine
+ * file, a platform data pointer can also be supplied along with the
+ * devices names. Usually, the platform data elements that cannot be parsed
+ * from the device tree by the drivers (example: function pointers) are
+ * supplied. But it should be noted that this is a temporary mechanism and
+ * at some point, the drivers should be capable of parsing all the platform
+ * data from the device tree.
+ */
+static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = {
+       OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART0,
+                               "exynos4210-uart.0", NULL),
+       OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART1,
+                               "exynos4210-uart.1", NULL),
+       OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART2,
+                               "exynos4210-uart.2", NULL),
+       OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART3,
+                               "exynos4210-uart.3", NULL),
+       OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(0),
+                               "exynos4-sdhci.0", NULL),
+       OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(1),
+                               "exynos4-sdhci.1", NULL),
+       OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(2),
+                               "exynos4-sdhci.2", NULL),
+       OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(3),
+                               "exynos4-sdhci.3", NULL),
+       OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0),
+                               "s3c2440-i2c.0", NULL),
+       OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL),
+       OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL),
+       {},
+};
+
+static void __init exynos4210_dt_map_io(void)
+{
+       s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+       s3c24xx_init_clocks(24000000);
+}
+
+static void __init exynos4210_dt_machine_init(void)
+{
+       of_platform_populate(NULL, of_default_bus_match_table,
+                               exynos4210_auxdata_lookup, NULL);
+}
+
+static char const *exynos4210_dt_compat[] __initdata = {
+       "samsung,exynos4210",
+       NULL
+};
+
+DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
+       /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
+       .init_irq       = exynos4_init_irq,
+       .map_io         = exynos4210_dt_map_io,
+       .init_machine   = exynos4210_dt_machine_init,
+       .timer          = &exynos4_timer,
+       .dt_compat      = exynos4210_dt_compat,
+MACHINE_END
index 236bbe187163257665e70ea02c1be15d7814d53d..5acec11821a4a059d226d27b91b565c3d7cc6fdc 100644 (file)
@@ -32,6 +32,7 @@
 #include <media/v4l2-mediabus.h>
 
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <plat/adc.h>
@@ -1333,6 +1334,7 @@ MACHINE_START(NURI, "NURI")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = nuri_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = nuri_machine_init,
        .timer          = &exynos4_timer,
        .reserve        = &nuri_reserve,
index f80b563f2be7841d3fc2bb939d0bb20d513b86ae..48d157e85ee64cdc052d307c2ebc70803358eace 100644 (file)
 #include <linux/regulator/machine.h>
 #include <linux/mfd/max8997.h>
 #include <linux/lcd.h>
+#include <linux/rfkill-gpio.h>
 
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <video/platform_lcd.h>
@@ -232,6 +234,7 @@ static struct regulator_init_data __initdata max8997_ldo9_data = {
                .min_uV         = 2800000,
                .max_uV         = 2800000,
                .apply_uV       = 1,
+               .always_on      = 1,
                .valid_ops_mask = REGULATOR_CHANGE_STATUS,
                .state_mem      = {
                        .disabled       = 1,
@@ -275,6 +278,7 @@ static struct regulator_init_data __initdata max8997_ldo14_data = {
                .min_uV         = 1800000,
                .max_uV         = 1800000,
                .apply_uV       = 1,
+               .always_on      = 1,
                .valid_ops_mask = REGULATOR_CHANGE_STATUS,
                .state_mem      = {
                        .disabled       = 1,
@@ -290,6 +294,7 @@ static struct regulator_init_data __initdata max8997_ldo17_data = {
                .min_uV         = 3300000,
                .max_uV         = 3300000,
                .apply_uV       = 1,
+               .always_on      = 1,
                .valid_ops_mask = REGULATOR_CHANGE_STATUS,
                .state_mem      = {
                        .disabled       = 1,
@@ -588,6 +593,23 @@ static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
        .setup_gpio     = exynos4_fimd0_gpio_setup_24bpp,
 };
 
+/* Bluetooth rfkill gpio platform data */
+struct rfkill_gpio_platform_data origen_bt_pdata = {
+       .reset_gpio     = EXYNOS4_GPX2(2),
+       .shutdown_gpio  = -1,
+       .type           = RFKILL_TYPE_BLUETOOTH,
+       .name           = "origen-bt",
+};
+
+/* Bluetooth Platform device */
+static struct platform_device origen_device_bluetooth = {
+       .name           = "rfkill_gpio",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &origen_bt_pdata,
+       },
+};
+
 static struct platform_device *origen_devices[] __initdata = {
        &s3c_device_hsmmc2,
        &s3c_device_hsmmc0,
@@ -615,6 +637,7 @@ static struct platform_device *origen_devices[] __initdata = {
        &exynos4_device_pd[PD_MFC],
        &origen_device_gpiokeys,
        &origen_lcd_hv070wsa,
+       &origen_device_bluetooth,
 };
 
 /* LCD Backlight data */
@@ -628,6 +651,16 @@ static struct platform_pwm_backlight_data origen_bl_data = {
        .pwm_period_ns  = 1000,
 };
 
+static void __init origen_bt_setup(void)
+{
+       gpio_request(EXYNOS4_GPA0(0), "GPIO BT_UART");
+       /* 4 UART Pins configuration */
+       s3c_gpio_cfgrange_nopull(EXYNOS4_GPA0(0), 4, S3C_GPIO_SFN(2));
+       /* Setup BT Reset, this gpio will be requesed by rfkill-gpio */
+       s3c_gpio_cfgpin(EXYNOS4_GPX2(2), S3C_GPIO_OUTPUT);
+       s3c_gpio_setpull(EXYNOS4_GPX2(2), S3C_GPIO_PULL_NONE);
+}
+
 static void s5p_tv_setup(void)
 {
        /* Direct HPD to HDMI chip */
@@ -687,6 +720,8 @@ static void __init origen_machine_init(void)
        s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
 
        samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
+
+       origen_bt_setup();
 }
 
 MACHINE_START(ORIGEN, "ORIGEN")
@@ -694,6 +729,7 @@ MACHINE_START(ORIGEN, "ORIGEN")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = origen_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = origen_machine_init,
        .timer          = &exynos4_timer,
        .reserve        = &origen_reserve,
index fcf2e0e23d53f31d98a760e9c11610a62642765e..722d82d7f217dca6c748616ce6e9f735f70a113b 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/serial_core.h>
 
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <plat/backlight.h>
@@ -287,6 +288,7 @@ MACHINE_START(SMDK4212, "SMDK4212")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = smdk4x12_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = smdk4x12_machine_init,
        .timer          = &exynos4_timer,
 MACHINE_END
@@ -297,6 +299,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = smdk4x12_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = smdk4x12_machine_init,
        .timer          = &exynos4_timer,
 MACHINE_END
index cec2afabe7b42475e2d1f8585642b048ea7ee34b..edc60b6108ed301c05beff160b81fc5051a22363 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/pwm_backlight.h>
 
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <video/platform_lcd.h>
@@ -375,6 +376,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = smdkv310_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = smdkv310_machine_init,
        .timer          = &exynos4_timer,
        .reserve        = &smdkv310_reserve,
@@ -385,6 +387,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = smdkv310_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = smdkv310_machine_init,
        .timer          = &exynos4_timer,
 MACHINE_END
index a2a177ff4b44fa324f948e61eafbaf7225cb0570..cfc7d5076f5a689c7a4e8d0ec35a0e863a3b3b48 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/i2c/atmel_mxt_ts.h>
 
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <plat/regs-serial.h>
@@ -1058,6 +1059,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
        .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = universal_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = universal_machine_init,
        .timer          = &exynos4_timer,
        .reserve        = &universal_reserve,
index 97343df8f13227c371f8a906f371a7eb1d7c3c74..85b5527d0918e4bea1ca7b9abea9362dd64c357d 100644 (file)
@@ -44,8 +44,6 @@ struct mct_clock_event_device {
        char name[10];
 };
 
-static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick);
-
 static void exynos4_mct_write(unsigned int value, void *addr)
 {
        void __iomem *stat_addr;
@@ -264,6 +262,9 @@ static void exynos4_clockevent_init(void)
 }
 
 #ifdef CONFIG_LOCAL_TIMERS
+
+static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick);
+
 /* Clock event handling */
 static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt)
 {
@@ -428,9 +429,13 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt)
 
 void local_timer_stop(struct clock_event_device *evt)
 {
+       unsigned int cpu = smp_processor_id();
        evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
        if (mct_int_type == MCT_INT_SPI)
-               disable_irq(evt->irq);
+               if (cpu == 0)
+                       remove_irq(evt->irq, &mct_tick0_event_irq);
+               else
+                       remove_irq(evt->irq, &mct_tick1_event_irq);
        else
                disable_percpu_irq(IRQ_MCT_LOCALTIMER);
 }
@@ -443,6 +448,7 @@ static void __init exynos4_timer_resources(void)
 
        clk_rate = clk_get_rate(mct_clk);
 
+#ifdef CONFIG_LOCAL_TIMERS
        if (mct_int_type == MCT_INT_PPI) {
                int err;
 
@@ -452,6 +458,7 @@ static void __init exynos4_timer_resources(void)
                WARN(err, "MCT: can't request IRQ %d (%d)\n",
                     IRQ_MCT_LOCALTIMER, err);
        }
+#endif /* CONFIG_LOCAL_TIMERS */
 }
 
 static void __init exynos4_timer_init(void)
index 69ffb2fb38755c795a541903e0a4071237be71fa..60bc45e3e7099045560f71bf4aaf29664341e488 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <plat/cpu.h>
 
-extern unsigned int gic_bank_offset;
 extern void exynos4_secondary_startup(void);
 
 #define CPU1_BOOT_REG          (samsung_rev() == EXYNOS4210_REV_1_1 ? \
@@ -65,31 +64,6 @@ static void __iomem *scu_base_addr(void)
 
 static DEFINE_SPINLOCK(boot_lock);
 
-static void __cpuinit exynos4_gic_secondary_init(void)
-{
-       void __iomem *dist_base = S5P_VA_GIC_DIST +
-                               (gic_bank_offset * smp_processor_id());
-       void __iomem *cpu_base = S5P_VA_GIC_CPU +
-                               (gic_bank_offset * smp_processor_id());
-       int i;
-
-       /*
-        * Deal with the banked PPI and SGI interrupts - disable all
-        * PPI interrupts, ensure all SGI interrupts are enabled.
-        */
-       __raw_writel(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);
-       __raw_writel(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);
-
-       /*
-        * Set priority on PPI and SGI interrupts
-        */
-       for (i = 0; i < 32; i += 4)
-               __raw_writel(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);
-
-       __raw_writel(0xf0, cpu_base + GIC_CPU_PRIMASK);
-       __raw_writel(1, cpu_base + GIC_CPU_CTRL);
-}
-
 void __cpuinit platform_secondary_init(unsigned int cpu)
 {
        /*
@@ -97,7 +71,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
         * core (e.g. timer irq), then they will not have been enabled
         * for us: do so
         */
-       exynos4_gic_secondary_init();
+       gic_secondary_init(0);
 
        /*
         * let the primary processor know we're out of the
index 509a435afd4bf85cf4636343b0cdd32bbf94a863..4093fea849c39c1a4400b0ad460450dfc3f2e905 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
+#include <asm/smp_scu.h>
 
 #include <plat/cpu.h>
 #include <plat/pm.h>
@@ -213,27 +214,6 @@ static int exynos4_pm_add(struct sys_device *sysdev)
        return 0;
 }
 
-/* This function copy from linux/arch/arm/kernel/smp_scu.c */
-
-void exynos4_scu_enable(void __iomem *scu_base)
-{
-       u32 scu_ctrl;
-
-       scu_ctrl = __raw_readl(scu_base);
-       /* already enabled? */
-       if (scu_ctrl & 1)
-               return;
-
-       scu_ctrl |= 1;
-       __raw_writel(scu_ctrl, scu_base);
-
-       /*
-        * Ensure that the data accessed by CPU0 before the SCU was
-        * initialised is visible to the other CPUs.
-        */
-       flush_cache_all();
-}
-
 static unsigned long pll_base_rate;
 
 static void exynos4_restore_pll(void)
@@ -402,7 +382,7 @@ static void exynos4_pm_resume(void)
 
        exynos4_restore_pll();
 
-       exynos4_scu_enable(S5P_VA_SCU);
+       scu_enable(S5P_VA_SCU);
 
 #ifdef CONFIG_CACHE_L2X0
        s3c_pm_do_restore_core(exynos4_l2cc_save, ARRAY_SIZE(exynos4_l2cc_save));
diff --git a/arch/arm/mach-exynos/setup-sdhci.c b/arch/arm/mach-exynos/setup-sdhci.c
deleted file mode 100644 (file)
index 92937b4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* linux/arch/arm/mach-exynos4/setup-sdhci.c
- *
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * EXYNOS4 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * 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/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *exynos4_hsmmc_clksrcs[4] = {
-       [0] = NULL,
-       [1] = NULL,
-       [2] = "sclk_mmc",       /* mmc_bus */
-       [3] = NULL,
-};
index d5f178540928604b414d538ffd00421c9e07c7b6..25b453601accc98e403f061b66762df8be65389f 100644 (file)
@@ -86,9 +86,10 @@ fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)
 MACHINE_START(CATS, "Chalice-CATS")
        /* Maintainer: Philip Blundell */
        .atag_offset    = 0x100,
-       .soft_reboot    = 1,
+       .restart_mode   = 's',
        .fixup          = fixup_cats,
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
        .timer          = &isa_timer,
+       .restart        = footbridge_restart,
 MACHINE_END
index 38a44f9b9da255affb155c4503e4641a5974b42a..41978ee4f9d0424639422adaa82789f0064c0776 100644 (file)
@@ -199,6 +199,33 @@ void __init footbridge_map_io(void)
                iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc));
 }
 
+void footbridge_restart(char mode, const char *cmd)
+{
+       if (mode == 's') {
+               /* Jump into the ROM */
+               soft_restart(0x41000000);
+       } else {
+               /*
+                * Force the watchdog to do a CPU reset.
+                *
+                * After making sure that the watchdog is disabled
+                * (so we can change the timer registers) we first
+                * enable the timer to autoreload itself.  Next, the
+                * timer interval is set really short and any
+                * current interrupt request is cleared (so we can
+                * see an edge transition).  Finally, TIMER4 is
+                * enabled as the watchdog.
+                */
+               *CSR_SA110_CNTL &= ~(1 << 13);
+               *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE |
+                                  TIMER_CNTL_AUTORELOAD |
+                                  TIMER_CNTL_DIV16;
+               *CSR_TIMER4_LOAD = 0x2;
+               *CSR_TIMER4_CLR  = 0;
+               *CSR_SA110_CNTL |= (1 << 13);
+       }
+}
+
 #ifdef CONFIG_FOOTBRIDGE_ADDIN
 
 static inline unsigned long fb_bus_sdram_offset(void)
index b05e662d21ad8162ec21542849116efb05fda0a2..c9767b892cb2135676e9dd1a82f3af2610c77965 100644 (file)
@@ -8,3 +8,4 @@ extern void footbridge_map_io(void);
 extern void footbridge_init_irq(void);
 
 extern void isa_init_irq(unsigned int irq);
+extern void footbridge_restart(char, const char *);
index 012210cf7d16876c24f7e1dccd8bce07ab1b1d27..27716a7e5fc16c88eab0bbf2bb4ad9a9f7b1df00 100644 (file)
@@ -21,5 +21,6 @@ MACHINE_START(EBSA285, "EBSA285")
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
        .timer          = &footbridge_timer,
+       .restart        = footbridge_restart,
 MACHINE_END
 
index 0b293156620948269d1b6a6ca6e01079947d5762..a174a5841bc24a89b68b669ded11bfee985808c1 100644 (file)
@@ -7,63 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/io.h>
-#include <asm/hardware/dec21285.h>
-#include <mach/hardware.h>
-#include <asm/leds.h>
-#include <asm/mach-types.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       if (mode == 's') {
-               /*
-                * Jump into the ROM
-                */
-               cpu_reset(0x41000000);
-       } else {
-               if (machine_is_netwinder()) {
-                       /* open up the SuperIO chip
-                        */
-                       outb(0x87, 0x370);
-                       outb(0x87, 0x370);
-
-                       /* aux function group 1 (logical device 7)
-                        */
-                       outb(0x07, 0x370);
-                       outb(0x07, 0x371);
-
-                       /* set GP16 for WD-TIMER output
-                        */
-                       outb(0xe6, 0x370);
-                       outb(0x00, 0x371);
-
-                       /* set a RED LED and toggle WD_TIMER for rebooting
-                        */
-                       outb(0xc4, 0x338);
-               } else {
-                       /* 
-                        * Force the watchdog to do a CPU reset.
-                        *
-                        * After making sure that the watchdog is disabled
-                        * (so we can change the timer registers) we first
-                        * enable the timer to autoreload itself.  Next, the
-                        * timer interval is set really short and any
-                        * current interrupt request is cleared (so we can
-                        * see an edge transition).  Finally, TIMER4 is
-                        * enabled as the watchdog.
-                        */
-                       *CSR_SA110_CNTL &= ~(1 << 13);
-                       *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE |
-                                          TIMER_CNTL_AUTORELOAD |
-                                          TIMER_CNTL_DIV16;
-                       *CSR_TIMER4_LOAD = 0x2;
-                       *CSR_TIMER4_CLR  = 0;
-                       *CSR_SA110_CNTL |= (1 << 13);
-               }
-       }
-}
diff --git a/arch/arm/mach-footbridge/include/mach/vmalloc.h b/arch/arm/mach-footbridge/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 40ba78e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  arch/arm/mach-footbridge/include/mach/vmalloc.h
- *
- * 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 VMALLOC_END       0xf0000000UL
index 0d3846f3b60d737205f9a8f6ead5c5275399cf88..80a1c5cc9071bb345fb19c5c19d6881695f808a2 100644 (file)
@@ -645,6 +645,32 @@ fixup_netwinder(struct tag *tags, char **cmdline, struct meminfo *mi)
 #endif
 }
 
+static void netwinder_restart(char mode, const char *cmd)
+{
+       if (mode == 's') {
+               /* Jump into the ROM */
+               soft_restart(0x41000000);
+       } else {
+               local_irq_disable();
+               local_fiq_disable();
+
+               /* open up the SuperIO chip */
+               outb(0x87, 0x370);
+               outb(0x87, 0x370);
+
+               /* aux function group 1 (logical device 7) */
+               outb(0x07, 0x370);
+               outb(0x07, 0x371);
+
+               /* set GP16 for WD-TIMER output */
+               outb(0xe6, 0x370);
+               outb(0x00, 0x371);
+
+               /* set a RED LED and toggle WD_TIMER for rebooting */
+               outb(0xc4, 0x338);
+       }
+}
+
 MACHINE_START(NETWINDER, "Rebel-NetWinder")
        /* Maintainer: Russell King/Rebel.com */
        .atag_offset    = 0x100,
@@ -656,4 +682,5 @@ MACHINE_START(NETWINDER, "Rebel-NetWinder")
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
        .timer          = &isa_timer,
+       .restart        = netwinder_restart,
 MACHINE_END
index f41dba39b32744575481f5821a3d95099d15b18c..e1e9990fa95724388877fa5b1f317b45251c9246 100644 (file)
@@ -19,5 +19,6 @@ MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
        .timer          = &footbridge_timer,
+       .restart        = footbridge_restart,
 MACHINE_END
 
index 4d9c1f872472a8e89abf73e8f1633990598d95ee..5e68cd41fd4ccc48fcffd836ad2534d2c1fc0ed4 100644 (file)
@@ -28,6 +28,7 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
+#error Fix me up
 static inline void arch_reset(char mode, const char *cmd)
 {
        __raw_writel(RESET_GLOBAL | RESET_CPU1,
diff --git a/arch/arm/mach-gemini/include/mach/vmalloc.h b/arch/arm/mach-gemini/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 45371eb..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- *
- * 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.
- */
-
-#define VMALLOC_END    0xf0000000UL
index 51d4e44ab9734bad131efb0f4c11c399b729eedc..f8a2f6bb548358a08bce3596beaf83eb0bffa37f 100644 (file)
@@ -242,3 +242,8 @@ void __init h720x_map_io(void)
 {
        iotable_init(h720x_io_desc,ARRAY_SIZE(h720x_io_desc));
 }
+
+void h720x_restart(char mode, const char *cmd)
+{
+       CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
+}
index 7dd5fa604efc503affc28c4e53de1763365b3b9a..2489537d33ddb5722e1772283e670da0cb0ff9ab 100644 (file)
@@ -16,6 +16,7 @@
 extern unsigned long 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;
index 9886f19805f41301aa4769856a679dc0dae12c4d..5fdb20c855e234cb824e1473f9be4a2ce35cff2e 100644 (file)
@@ -34,4 +34,5 @@ MACHINE_START(H7201, "Hynix GMS30C7201")
        .init_irq       = h720x_init_irq,
        .timer          = &h7201_timer,
        .dma_zone_size  = SZ_256M,
+       .restart        = h720x_restart,
 MACHINE_END
index 284a134819e1072db3dd47012d63ba7360f9a447..169673036c593220df36a0e7ac4b895516654522 100644 (file)
@@ -77,4 +77,5 @@ MACHINE_START(H7202, "Hynix HMS30C7202")
        .timer          = &h7202_timer,
        .init_machine   = init_eval_h7202,
        .dma_zone_size  = SZ_256M,
+       .restart        = h720x_restart,
 MACHINE_END
index a708d24ee46d67a80d2129860c7c91e20029cfea..16ac46e239aa270820f9f535fe0ec1bdefd98536 100644 (file)
@@ -24,10 +24,4 @@ static void arch_idle(void)
        nop();
 }
 
-
-static __inline__ void arch_reset(char mode, const char *cmd)
-{
-       CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
-}
-
 #endif
diff --git a/arch/arm/mach-h720x/include/mach/vmalloc.h b/arch/arm/mach-h720x/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 8520b4a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * arch/arm/mach-h720x/include/mach/vmalloc.h
- */
-
-#ifndef __ARCH_ARM_VMALLOC_H
-#define __ARCH_ARM_VMALLOC_H
-
-#define VMALLOC_END       0xd0000000UL
-
-#endif
index 7e33fc94cd1e6ff81c134662a467c72fdf47aabc..d8e2d0be64ac365dc665b1e7e1a52c4549973f77 100644 (file)
@@ -1,5 +1,6 @@
 extern void highbank_set_cpu_jump(int cpu, void *jump_addr);
 extern void highbank_clocks_init(void);
+extern void highbank_restart(char, const char *);
 extern void __iomem *scu_base_addr;
 #ifdef CONFIG_DEBUG_HIGHBANK_UART
 extern void highbank_lluart_map_io(void);
index 88660d500f5be259bde8bd94389805881cf8975e..804c4a55f8038c75cbf0731168ee6d0d36de004a 100644 (file)
@@ -144,6 +144,8 @@ DT_MACHINE_START(HIGHBANK, "Highbank")
        .map_io         = highbank_map_io,
        .init_irq       = highbank_init_irq,
        .timer          = &highbank_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = highbank_init,
        .dt_compat      = highbank_match,
+       .restart        = highbank_restart,
 MACHINE_END
index 73c11297509ed4bf9cfdefad92b831aab9495218..a14f9e62ca9203b5a67014907d7065295121cc38 100644 (file)
@@ -1,5 +1,3 @@
-#include <asm/hardware/entry-macro-gic.S>
-
        .macro  disable_fiq
        .endm
 
index 7e8192296cae97d88642f128b320172d39055299..b1d8b5fbe3735e3f87337804a6371248863faa1f 100644 (file)
@@ -21,6 +21,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-extern void arch_reset(char mode, const char *cmd);
-
 #endif
diff --git a/arch/arm/mach-highbank/include/mach/vmalloc.h b/arch/arm/mach-highbank/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 1969e95..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define VMALLOC_END            0xFEE00000UL
index 53f0c4c5ef1c7dc0ea5744da0efba832a1f21296..82c27230d4a93e657ca4c4a4e1e79439c422bbae 100644 (file)
@@ -20,7 +20,7 @@
 #include "core.h"
 #include "sysregs.h"
 
-void arch_reset(char mode, const char *cmd)
+void highbank_restart(char mode, const char *cmd)
 {
        if (mode == 'h')
                hignbank_set_pwr_hard_reset();
index c44aa974e79c473d123631236269bdb8c2daa8a3..fbd414baa94dcc92999fda3440863aac0a013d9c 100644 (file)
@@ -22,6 +22,18 @@ config ARCH_MX25
 config MACH_MX27
        bool
 
+config ARCH_MX5
+       bool
+
+config ARCH_MX50
+       bool
+
+config ARCH_MX51
+       bool
+
+config ARCH_MX53
+       bool
+
 config SOC_IMX1
        bool
        select ARCH_MX1
@@ -73,6 +85,32 @@ config SOC_IMX35
        select MXC_AVIC
        select SMP_ON_UP if SMP
 
+config SOC_IMX5
+       select CPU_V7
+       select ARM_L1_CACHE_SHIFT_6
+       select MXC_TZIC
+       select ARCH_MXC_IOMUX_V3
+       select ARCH_MXC_AUDMUX_V2
+       select ARCH_HAS_CPUFREQ
+       select ARCH_MX5
+       bool
+
+config SOC_IMX50
+       bool
+       select SOC_IMX5
+       select ARCH_MX50
+
+config SOC_IMX51
+       bool
+       select SOC_IMX5
+       select ARCH_MX5
+       select ARCH_MX51
+
+config SOC_IMX53
+       bool
+       select SOC_IMX5
+       select ARCH_MX5
+       select ARCH_MX53
 
 if ARCH_IMX_V4_V5
 
@@ -591,6 +629,207 @@ config MACH_VPR200
          Include support for VPR200 platform. This includes specific
          configurations for the board and its peripherals.
 
+comment "i.MX5 platforms:"
+
+config MACH_MX50_RDP
+       bool "Support MX50 reference design platform"
+       depends on BROKEN
+       select SOC_IMX50
+       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
+       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 SOC_IMX51
+       select USE_OF
+       select MACH_MX51_BABBAGE
+       help
+         Include support for Freescale i.MX51 based platforms
+         using the device tree for discovery
+
+config MACH_MX51_BABBAGE
+       bool "Support MX51 BABBAGE platforms"
+       select SOC_IMX51
+       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
+       select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select IMX_HAVE_PLATFORM_SPI_IMX
+       help
+         Include support for MX51 Babbage platform, also known as MX51EVK in
+         u-boot. This includes specific configurations for the board and its
+         peripherals.
+
+config MACH_MX51_3DS
+       bool "Support MX51PDK (3DS)"
+       select SOC_IMX51
+       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
+       help
+         Include support for MX51PDK (3DS) platform. This includes specific
+         configurations for the board and its peripherals.
+
+config MACH_EUKREA_CPUIMX51
+       bool "Support Eukrea CPUIMX51 module"
+       select SOC_IMX51
+       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
+       select IMX_HAVE_PLATFORM_MXC_NAND
+       select IMX_HAVE_PLATFORM_SPI_IMX
+       help
+         Include support for Eukrea CPUIMX51 platform. This includes
+         specific configurations for the module and its peripherals.
+
+choice
+       prompt "Baseboard"
+       depends on MACH_EUKREA_CPUIMX51
+       default MACH_EUKREA_MBIMX51_BASEBOARD
+
+config MACH_EUKREA_MBIMX51_BASEBOARD
+       prompt "Eukrea MBIMX51 development board"
+       bool
+       select IMX_HAVE_PLATFORM_IMX_KEYPAD
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select LEDS_GPIO_REGISTER
+       help
+         This adds board specific devices that can be found on Eukrea's
+         MBIMX51 evaluation board.
+
+endchoice
+
+config MACH_EUKREA_CPUIMX51SD
+       bool "Support Eukrea CPUIMX51SD module"
+       select SOC_IMX51
+       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
+       select IMX_HAVE_PLATFORM_MXC_NAND
+       select IMX_HAVE_PLATFORM_SPI_IMX
+       help
+         Include support for Eukrea CPUIMX51SD platform. This includes
+         specific configurations for the module and its peripherals.
+
+choice
+       prompt "Baseboard"
+       depends on MACH_EUKREA_CPUIMX51SD
+       default MACH_EUKREA_MBIMXSD51_BASEBOARD
+
+config MACH_EUKREA_MBIMXSD51_BASEBOARD
+       prompt "Eukrea MBIMXSD development board"
+       bool
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select LEDS_GPIO_REGISTER
+       help
+         This adds board specific devices that can be found on Eukrea's
+         MBIMXSD evaluation board.
+
+endchoice
+
+config MX51_EFIKA_COMMON
+       bool
+       select SOC_IMX51
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
+       select IMX_HAVE_PLATFORM_PATA_IMX
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select IMX_HAVE_PLATFORM_SPI_IMX
+       select MXC_ULPI if USB_ULPI
+
+config MACH_MX51_EFIKAMX
+       bool "Support MX51 Genesi Efika MX nettop"
+       select LEDS_GPIO_REGISTER
+       select MX51_EFIKA_COMMON
+       help
+         Include support for Genesi Efika MX nettop. This includes specific
+         configurations for the board and its peripherals.
+
+config MACH_MX51_EFIKASB
+       bool "Support MX51 Genesi Efika Smartbook"
+       select LEDS_GPIO_REGISTER
+       select MX51_EFIKA_COMMON
+       help
+         Include support for Genesi Efika Smartbook. This includes specific
+         configurations for the board and its peripherals.
+
+comment "i.MX53 machines:"
+
+config MACH_IMX53_DT
+       bool "Support i.MX53 platforms from device tree"
+       select SOC_IMX53
+       select USE_OF
+       select MACH_MX53_ARD
+       select MACH_MX53_EVK
+       select MACH_MX53_LOCO
+       select MACH_MX53_SMD
+       help
+         Include support for Freescale i.MX53 based platforms
+         using the device tree for discovery
+
+config MACH_MX53_EVK
+       bool "Support MX53 EVK platforms"
+       select SOC_IMX53
+       select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select IMX_HAVE_PLATFORM_SPI_IMX
+       select LEDS_GPIO_REGISTER
+       help
+         Include support for MX53 EVK platform. This includes specific
+         configurations for the board and its peripherals.
+
+config MACH_MX53_SMD
+       bool "Support MX53 SMD platforms"
+       select SOC_IMX53
+       select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       help
+         Include support for MX53 SMD platform. This includes specific
+         configurations for the board and its peripherals.
+
+config MACH_MX53_LOCO
+       bool "Support MX53 LOCO platforms"
+       select SOC_IMX53
+       select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select IMX_HAVE_PLATFORM_GPIO_KEYS
+       select LEDS_GPIO_REGISTER
+       help
+         Include support for MX53 LOCO platform. This includes specific
+         configurations for the board and its peripherals.
+
+config MACH_MX53_ARD
+       bool "Support MX53 ARD platforms"
+       select SOC_IMX53
+       select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select IMX_HAVE_PLATFORM_GPIO_KEYS
+       help
+         Include support for MX53 ARD platform. This includes specific
+         configurations for the board and its peripherals.
+
 comment "i.MX6 family:"
 
 config SOC_IMX6Q
index aba73214c2a8cd640e0f4371caf4ce99ac53dc0f..9cf630a341e18bd9579686ae80af497c558f2df9 100644 (file)
@@ -11,6 +11,8 @@ obj-$(CONFIG_SOC_IMX27) += clock-imx27.o mm-imx27.o ehci-imx27.o
 obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clock-imx31.o iomux-imx31.o ehci-imx31.o
 obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clock-imx35.o ehci-imx35.o
 
+obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clock-mx51-mx53.o ehci-imx5.o pm-imx5.o cpu_op-mx51.o
+
 # Support for CMOS sensor interface
 obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
 
@@ -71,3 +73,22 @@ obj-$(CONFIG_SMP) += platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
 obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
 obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o
+
+# 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_MX53_EVK) += mach-mx53_evk.o
+obj-$(CONFIG_MACH_MX53_SMD) += mach-mx53_smd.o
+obj-$(CONFIG_MACH_MX53_LOCO) += mach-mx53_loco.o
+obj-$(CONFIG_MACH_MX53_ARD) += mach-mx53_ard.o
+obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += mach-cpuimx51.o
+obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
+obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o
+obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o
+obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o
+obj-$(CONFIG_MACH_MX51_EFIKAMX) += mach-mx51_efikamx.o
+obj-$(CONFIG_MACH_MX51_EFIKASB) += mach-mx51_efikasb.o
+obj-$(CONFIG_MACH_MX50_RDP) += mach-mx50_rdp.o
+
+obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
+obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o
index cfede5768aa0f788a6d8f6fd8893578a5c4ed75b..b27815de8473326788c96d08e2e57de1a54ec608 100644 (file)
@@ -22,6 +22,18 @@ 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
+
+zreladdr-$(CONFIG_SOC_IMX53)   += 0x70008000
+params_phys-$(CONFIG_SOC_IMX53)        := 0x70000100
+initrd_phys-$(CONFIG_SOC_IMX53)        := 0x70800000
+
 zreladdr-$(CONFIG_SOC_IMX6Q)   += 0x10008000
 params_phys-$(CONFIG_SOC_IMX6Q)        := 0x10000100
 initrd_phys-$(CONFIG_SOC_IMX6Q)        := 0x10800000
index 039a7abb165a35f4afc10ae08dbb7cc62f1121f7..9273c2a24b540a12646c406ac82dedb6c27ca28b 100644 (file)
@@ -1931,14 +1931,12 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
                val |= 0x1 << BP_CLPCR_LPM;
                val &= ~BM_CLPCR_VSTBY;
                val &= ~BM_CLPCR_SBYOS;
-               val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
                break;
        case STOP_POWER_OFF:
                val |= 0x2 << BP_CLPCR_LPM;
                val |= 0x3 << BP_CLPCR_STBY_COUNT;
                val |= BM_CLPCR_VSTBY;
                val |= BM_CLPCR_SBYOS;
-               val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
                break;
        default:
                return -EINVAL;
similarity index 99%
rename from arch/arm/mach-mx5/clock-mx51-mx53.c
rename to arch/arm/mach-imx/clock-mx51-mx53.c
index 4cb276977190e98174c70419a64a63696179ac73..08470504a088915f1cd0eea8e7ca1a3b25a41e32 100644 (file)
@@ -23,7 +23,7 @@
 #include <mach/common.h>
 #include <mach/clock.h>
 
-#include "crm_regs.h"
+#include "crm-regs-imx5.h"
 
 /* External clock values passed-in by the board code */
 static unsigned long external_high_reference, external_low_reference;
similarity index 99%
rename from arch/arm/mach-mx5/imx51-dt.c
rename to arch/arm/mach-imx/imx51-dt.c
index 596edd967dbfef9a21b009b327f42cdda3ad60b0..e6bad17b908c2192ffbe349cbef43ee4e52a642b 100644 (file)
@@ -115,4 +115,5 @@ DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
        .timer          = &imx51_timer,
        .init_machine   = imx51_dt_init,
        .dt_compat      = imx51_dt_board_compat,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/imx53-dt.c
rename to arch/arm/mach-imx/imx53-dt.c
index 85bfd5ff21b0bb925583679260321fbc7e25731b..05ebb3e68679795faa8f87507169d108dab88c98 100644 (file)
@@ -125,4 +125,5 @@ DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)")
        .timer          = &imx53_timer,
        .init_machine   = imx53_dt_init,
        .dt_compat      = imx53_dt_board_compat,
+       .restart        = mxc_restart,
 MACHINE_END
index 1e486e67dabbfa598a010d616fe59101d8a9406e..146a4f073464019fe913184074ce4b4593405c22 100644 (file)
@@ -139,4 +139,5 @@ MACHINE_START(APF9328, "Armadeus APF9328")
        .handle_irq   = imx1_handle_irq,
        .timer        = &apf9328_timer,
        .init_machine = apf9328_init,
+       .restart        = mxc_restart,
 MACHINE_END
index c9a9cf67755e7fa3c1666e1aebb81f52dbbcca0b..e4f426a09899175a948134e006d84a2edcc5c3ae 100644 (file)
@@ -561,4 +561,5 @@ MACHINE_START(ARMADILLO5X0, "Armadillo-500")
        .handle_irq = imx31_handle_irq,
        .timer = &armadillo5x0_timer,
        .init_machine = armadillo5x0_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 313f62ddc1ef058ec80340bc7980aa61fc9f2af3..9a9897749dd61b5b06b7a5d2037a72044acbc76f 100644 (file)
@@ -65,4 +65,5 @@ MACHINE_START(BUG, "BugLabs BUGBase")
        .handle_irq = imx31_handle_irq,
        .timer = &bug_timer,
        .init_machine = bug_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index edb373052576a86e7a3301a26f09536a771530b6..d085aea087095e4750e104a54aaee02c7312b0cf 100644 (file)
@@ -318,4 +318,5 @@ MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27")
        .handle_irq = imx27_handle_irq,
        .timer = &eukrea_cpuimx27_timer,
        .init_machine = eukrea_cpuimx27_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 66af2e8f7e576dffd5372862653d397d22811069..012e120509e087f6669bd56c3321ffca0187c84b 100644 (file)
@@ -201,4 +201,5 @@ MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
        .handle_irq = imx35_handle_irq,
        .timer = &eukrea_cpuimx35_timer,
        .init_machine = eukrea_cpuimx35_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-cpuimx51.c
rename to arch/arm/mach-imx/mach-cpuimx51.c
index 1fc110348040b0a94c61b009e3546c686f33596c..944025da83336d88f5c697ac917a16f3ed706d72 100644 (file)
@@ -297,4 +297,5 @@ MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
        .handle_irq = imx51_handle_irq,
        .timer = &mxc_timer,
        .init_machine = eukrea_cpuimx51_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-cpuimx51sd.c
rename to arch/arm/mach-imx/mach-cpuimx51sd.c
index 52a11c1898e6aeb31a8f5ca3c81ed9f875a8003d..9fbe923c8b087ab68d5e48a58570397824651d28 100644 (file)
@@ -335,4 +335,5 @@ MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
        .handle_irq = imx51_handle_irq,
        .timer = &mxc_timer,
        .init_machine = eukrea_cpuimx51sd_init,
+       .restart        = mxc_restart,
 MACHINE_END
index ab8fbcc472b5e1e6a1ddb19e6361d96ad3620110..76a97a598b9e9b69f29c69d2d2cebfe27be970bf 100644 (file)
@@ -170,4 +170,5 @@ MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
        .handle_irq = imx25_handle_irq,
        .timer = &eukrea_cpuimx25_timer,
        .init_machine = eukrea_cpuimx25_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 38eb9e45110b2d3e5bdb8f96f5d89627e17ddbe7..c2766ae02b4f049f6bfa6ecf79a312226e35a909 100644 (file)
@@ -282,4 +282,5 @@ MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
        .handle_irq = imx27_handle_irq,
        .timer = &visstrim_m10_timer,
        .init_machine = visstrim_m10_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 7052155d0557b735fe93982f6ab7bc65a023647c..c9d350c5dcc83a590ea36774887eb7fd8461e72b 100644 (file)
@@ -78,4 +78,5 @@ MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
        .handle_irq = imx27_handle_irq,
        .timer = &mx27ipcam_timer,
        .init_machine = mx27ipcam_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 8d6a63521f17b9f19f5dbcc956487d081aa70aad..1f45b9189229787343ca9465b4c2d3d0425c6758 100644 (file)
@@ -84,4 +84,5 @@ MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
        .handle_irq = imx27_handle_irq,
        .timer = &mx27lite_timer,
        .init_machine = mx27lite_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 8deb012189b5a7e185f7299a8ad8c8503edad587..05b49bb5d677d2a64501276d5ab76a5c586362ea 100644 (file)
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+#include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <mach/common.h>
 #include <mach/hardware.h>
 
+void imx6q_restart(char mode, const char *cmd)
+{
+       struct device_node *np;
+       void __iomem *wdog_base;
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-wdt");
+       wdog_base = of_iomap(np, 0);
+       if (!wdog_base)
+               goto soft;
+
+       imx_src_prepare_restart();
+
+       /* enable wdog */
+       writew_relaxed(1 << 2, wdog_base);
+       /* write twice to ensure the request will not get ignored */
+       writew_relaxed(1 << 2, wdog_base);
+
+       /* wait for reset to assert ... */
+       mdelay(500);
+
+       pr_err("Watchdog reset failed to assert reset\n");
+
+       /* delay to allow the serial port to show the message */
+       mdelay(50);
+
+soft:
+       /* we'll take a jump through zero as a poor second */
+       soft_restart(0);
+}
+
 static void __init imx6q_init_machine(void)
 {
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
@@ -83,4 +116,5 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
        .timer          = &imx6q_timer,
        .init_machine   = imx6q_init_machine,
        .dt_compat      = imx6q_dt_compat,
+       .restart        = imx6q_restart,
 MACHINE_END
index 5f37f89e40fac9f7aba14d1b50f5792b4f50b6e6..fc78e8071cd178de28ada44104b9faf182b5bdf9 100644 (file)
@@ -279,4 +279,5 @@ MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
        .handle_irq = imx31_handle_irq,
        .timer = &kzm_timer,
        .init_machine = kzm_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index fc49785e7340a9adb9964794f16114ff96b5c125..97046088ff1a81c21ef3061b27d859537b0a19fe 100644 (file)
@@ -147,6 +147,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS")
        .handle_irq = imx1_handle_irq,
        .timer = &mx1ads_timer,
        .init_machine = mx1ads_init,
+       .restart        = mxc_restart,
 MACHINE_END
 
 MACHINE_START(MXLADS, "Freescale MXLADS")
@@ -157,4 +158,5 @@ MACHINE_START(MXLADS, "Freescale MXLADS")
        .handle_irq = imx1_handle_irq,
        .timer = &mx1ads_timer,
        .init_machine = mx1ads_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 25f84028d055078cd284aa48c844b3697e3dab78..8d9f95514b1f1410997b7ecadfcc3918b9b5f613 100644 (file)
@@ -312,4 +312,5 @@ MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
        .handle_irq = imx21_handle_irq,
        .timer = &mx21ads_timer,
        .init_machine = mx21ads_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 88dccf1222437ef6959d5d094a512b7ce9294eb2..f26734298aa629d52c94faea8f7e7ea2a0694230 100644 (file)
@@ -270,4 +270,5 @@ MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
        .handle_irq = imx25_handle_irq,
        .timer = &mx25pdk_timer,
        .init_machine = mx25pdk_init,
+       .restart        = mxc_restart,
 MACHINE_END
index ba232d79fa81a2f87e2402fa03d203243f25f44e..18f35816706a1e77771d2a57992bee32a006c694 100644 (file)
@@ -425,4 +425,5 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
        .handle_irq = imx27_handle_irq,
        .timer = &mx27pdk_timer,
        .init_machine = mx27pdk_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 74dd5731eb61547e8e0e79bccaeb9f4849cada7e..0228d2e07fe05ed641b6f24988b0730b9eae86ed 100644 (file)
@@ -351,4 +351,5 @@ MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
        .handle_irq = imx27_handle_irq,
        .timer = &mx27ads_timer,
        .init_machine = mx27ads_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index b8c54b840185edc2bd4fd7b344e22bdc29187bd8..2b565c381347a4760e6cfbbec756473256410929 100644 (file)
@@ -770,4 +770,5 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
        .timer = &mx31_3ds_timer,
        .init_machine = mx31_3ds_init,
        .reserve = mx31_3ds_reserve,
+       .restart        = mxc_restart,
 MACHINE_END
index 9cc1a49053bb347053fed66d6817b3b2d4f2f32f..4917aab0e2539609a57bbcdc94bf8b24fccb37aa 100644 (file)
@@ -542,4 +542,5 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS")
        .handle_irq = imx31_handle_irq,
        .timer = &mx31ads_timer,
        .init_machine = mx31ads_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 102ec99357ccb99bec5e83551d3d0f1303b6a25f..02401bbd6d53e7ef014507f2029212fb74f34b1d 100644 (file)
@@ -303,4 +303,5 @@ MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
        .handle_irq = imx31_handle_irq,
        .timer = &mx31lilly_timer,
        .init_machine = mx31lilly_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 5366d2de18fdc4b75047a435dc8d27e8f39f023e..ef80751712e70ca0165c7fa817f41f1f92c39589 100644 (file)
@@ -287,4 +287,5 @@ MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
        .handle_irq = imx31_handle_irq,
        .timer = &mx31lite_timer,
        .init_machine = mx31lite_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 93269150309cfd11571c9b84c770d31bf510bc31..b95981dacb2bcef2ff8138b59d32f58d85d3a394 100644 (file)
@@ -600,4 +600,5 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
        .handle_irq = imx31_handle_irq,
        .timer = &mx31moboard_timer,
        .init_machine = mx31moboard_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 7a462025a0f75a97db5a1253e7dd9ff5926bb4ef..0af6c9c5b3fdd443748d625db5529409074e124d 100644 (file)
@@ -224,4 +224,5 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK")
        .handle_irq = imx35_handle_irq,
        .timer = &mx35pdk_timer,
        .init_machine = mx35_3ds_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx50_rdp.c
rename to arch/arm/mach-imx/mach-mx50_rdp.c
index fc3621d90bded70a8bd93e48a0356c05b0893e83..42b66e8d9615be75b2a4e4a3238ef04cedef360c 100644 (file)
@@ -222,4 +222,5 @@ MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform")
        .handle_irq = imx50_handle_irq,
        .timer = &mx50_rdp_timer,
        .init_machine = mx50_rdp_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx51_3ds.c
rename to arch/arm/mach-imx/mach-mx51_3ds.c
index 05783906db2bd5fdb262b20d100774c03b568c3c..83eab4176ca48668f1f7295698c3ca6b4aaa4502 100644 (file)
@@ -175,4 +175,5 @@ MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
        .handle_irq = imx51_handle_irq,
        .timer = &mx51_3ds_timer,
        .init_machine = mx51_3ds_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx51_babbage.c
rename to arch/arm/mach-imx/mach-mx51_babbage.c
index 5c837603ff0fc3b6a173ab677bdfda2a75bec09b..68cdfda675faa3f46e964524f2a30c3b32ee052d 100644 (file)
@@ -426,4 +426,5 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
        .handle_irq = imx51_handle_irq,
        .timer = &mx51_babbage_timer,
        .init_machine = mx51_babbage_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 98%
rename from arch/arm/mach-mx5/board-mx51_efikamx.c
rename to arch/arm/mach-imx/mach-mx51_efikamx.c
index a9e48662cf75e928fe2fe60c040130801a8c44d4..3a5ed2dd885af8326e42d63ba44e1a6a4caee39b 100644 (file)
@@ -182,7 +182,7 @@ static const struct gpio_keys_platform_data mx51_efikamx_powerkey_data __initcon
        .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey),
 };
 
-void mx51_efikamx_reset(void)
+static void mx51_efikamx_restart(char mode, const char *cmd)
 {
        if (system_rev == 0x11)
                gpio_direction_output(EFIKAMX_RESET1_1, 0);
@@ -292,4 +292,5 @@ MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop")
        .handle_irq = imx51_handle_irq,
        .timer = &mx51_efikamx_timer,
        .init_machine = mx51_efikamx_init,
+       .restart = mx51_efikamx_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx51_efikasb.c
rename to arch/arm/mach-imx/mach-mx51_efikasb.c
index 38c4a3e28d3cd9c836f3c83d0a346fe6bd119b4d..ea5f65b0381ae995ee7558793f4eba0e56e0697e 100644 (file)
@@ -287,4 +287,5 @@ MACHINE_START(MX51_EFIKASB, "Genesi Efika Smartbook")
        .handle_irq = imx51_handle_irq,
        .init_machine =  efikasb_board_init,
        .timer = &mx51_efikasb_timer,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx53_ard.c
rename to arch/arm/mach-imx/mach-mx53_ard.c
index 0d7f0fffb23a865585faa28b4c40a2afbd5b3029..08dfb7628d2debfba4dd511b51925bd80d71531e 100644 (file)
@@ -32,7 +32,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 
-#include "crm_regs.h"
 #include "devices-imx53.h"
 
 #define ARD_ETHERNET_INT_B     IMX_GPIO_NR(2, 31)
@@ -257,4 +256,5 @@ MACHINE_START(MX53_ARD, "Freescale MX53 ARD Board")
        .handle_irq = imx53_handle_irq,
        .timer = &mx53_ard_timer,
        .init_machine = mx53_ard_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx53_evk.c
rename to arch/arm/mach-imx/mach-mx53_evk.c
index 6bea31ab8f8581ee637a7f9a998157cd982a1b1b..5097606da2b9f49fa605518a20c961371ee69576 100644 (file)
@@ -37,7 +37,6 @@
 #define EVK_ECSPI1_CS1         IMX_GPIO_NR(3, 19)
 #define MX53EVK_LED            IMX_GPIO_NR(7, 7)
 
-#include "crm_regs.h"
 #include "devices-imx53.h"
 
 static iomux_v3_cfg_t mx53_evk_pads[] = {
@@ -175,4 +174,5 @@ MACHINE_START(MX53_EVK, "Freescale MX53 EVK Board")
        .handle_irq = imx53_handle_irq,
        .timer = &mx53_evk_timer,
        .init_machine = mx53_evk_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx53_loco.c
rename to arch/arm/mach-imx/mach-mx53_loco.c
index 7678f7734db631ab5163bc1144520311e2666e18..ad2d845b25d3aeb16f4333ff5a347fbbb45799d9 100644 (file)
@@ -32,7 +32,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 
-#include "crm_regs.h"
 #include "devices-imx53.h"
 
 #define MX53_LOCO_POWER                        IMX_GPIO_NR(1, 8)
@@ -317,4 +316,5 @@ MACHINE_START(MX53_LOCO, "Freescale MX53 LOCO Board")
        .handle_irq = imx53_handle_irq,
        .timer = &mx53_loco_timer,
        .init_machine = mx53_loco_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 99%
rename from arch/arm/mach-mx5/board-mx53_smd.c
rename to arch/arm/mach-imx/mach-mx53_smd.c
index 59c0845eb4a6321badc4f6b1f58943e64c68a33e..69e20093574ea0a092e164c8bfd6796812e095bd 100644 (file)
@@ -31,7 +31,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 
-#include "crm_regs.h"
 #include "devices-imx53.h"
 
 #define SMD_FEC_PHY_RST                IMX_GPIO_NR(7, 6)
@@ -164,4 +163,5 @@ MACHINE_START(MX53_SMD, "Freescale MX53 SMD Board")
        .handle_irq = imx53_handle_irq,
        .timer = &mx53_smd_timer,
        .init_machine = mx53_smd_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 125c19643b0fc9b9d8f3f4d718e882ac7a0c32c8..8b3d3f07d894ab72f30d5d21de495c991a2ecca2 100644 (file)
@@ -274,4 +274,5 @@ MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
        .handle_irq = imx27_handle_irq,
        .timer = &mxt_td60_timer,
        .init_machine = mxt_td60_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 26072f4b02e37cfa0ea3c1315885cdcd892c6541..d3b9c6b5edde091d56f3196be79a5cf245410137 100644 (file)
@@ -442,4 +442,5 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
        .handle_irq = imx27_handle_irq,
        .init_machine = pca100_init,
        .timer = &pca100_timer,
+       .restart        = mxc_restart,
 MACHINE_END
index efd6b536ef6a4187d413aaf167d218718c5e0957..d7e151669ed347591e1687de4c628156aa56820d 100644 (file)
@@ -696,4 +696,5 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
        .handle_irq = imx31_handle_irq,
        .timer = &pcm037_timer,
        .init_machine = pcm037_init,
+       .restart        = mxc_restart,
 MACHINE_END
index a17e9c7dfca0f4dfde76b49ba4639510b714fe7e..16f126da9f8f543abf7d175477778b5636bb0a55 100644 (file)
@@ -357,4 +357,5 @@ MACHINE_START(PCM038, "phyCORE-i.MX27")
        .handle_irq = imx27_handle_irq,
        .timer = &pcm038_timer,
        .init_machine = pcm038_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 7366c2ae3ea5ccf0c8b74024b96bb135822752ec..06dc106519aec6f8826b1589b3c765cad148bfc5 100644 (file)
@@ -425,4 +425,5 @@ MACHINE_START(PCM043, "Phytec Phycore pcm043")
        .handle_irq = imx35_handle_irq,
        .timer = &pcm043_timer,
        .init_machine = pcm043_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 4ff5faf102a8667d2ac7c71ce5a07a6a7c567b84..260621055b6be1edfe9ef4ce8eca2f391d3edb86 100644 (file)
@@ -273,4 +273,5 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
        .handle_irq = imx31_handle_irq,
        .timer = &qong_timer,
        .init_machine = qong_init,
+       .restart        = mxc_restart,
 MACHINE_END
index bb6e5b25d8d07905cf951f5c14ee1ff07ba88594..cb9ceae2f648dbd8f6a838c9c42ddb48b76dcea2 100644 (file)
@@ -144,4 +144,5 @@ MACHINE_START(SCB9328, "Synertronixx scb9328")
        .handle_irq = imx1_handle_irq,
        .timer = &scb9328_timer,
        .init_machine = scb9328_init,
+       .restart        = mxc_restart,
 MACHINE_END
index 69092458f2d9a6ca519ff1747fa6bae26400df77..033257e553ef7177dae5672f40e3d842d26b7d51 100644 (file)
@@ -322,4 +322,5 @@ MACHINE_START(VPR200, "VPR200")
        .handle_irq = imx35_handle_irq,
        .timer = &vpr200_timer,
        .init_machine = vpr200_board_init,
+       .restart        = mxc_restart,
 MACHINE_END
similarity index 58%
rename from arch/arm/mach-mx5/system.c
rename to arch/arm/mach-imx/pm-imx5.c
index 144ebebc4a6135a001cfac93801d4920e5cec769..3d57b5d429fe753ba5066570ec037ef5560ad6c7 100644 (file)
@@ -1,8 +1,6 @@
 /*
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
-/*
+ *  Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
  * 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/platform_device.h>
+#include <linux/suspend.h>
+#include <linux/clk.h>
 #include <linux/io.h>
-#include <mach/hardware.h>
+#include <linux/err.h>
+#include <asm/cacheflush.h>
+#include <asm/tlbflush.h>
 #include <mach/common.h>
-#include "crm_regs.h"
+#include <mach/hardware.h>
+#include "crm-regs-imx5.h"
+
+static struct clk *gpc_dvfs_clk;
 
-/* set cpu low power mode before WFI instruction. This function is called
-  * mx5 because it can be used for mx50, mx51, and mx53.*/
+/*
+ * set cpu low power mode before WFI instruction. This function is called
+ * mx5 because it can be used for mx50, mx51, and mx53.
+ */
 void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode)
 {
        u32 plat_lpc, arm_srpgcr, ccm_clpcr;
@@ -83,3 +89,68 @@ void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode)
                __raw_writel(empgc1, MXC_SRPG_EMPGC1_SRPGCR);
        }
 }
+
+static int mx5_suspend_prepare(void)
+{
+       return clk_enable(gpc_dvfs_clk);
+}
+
+static int mx5_suspend_enter(suspend_state_t state)
+{
+       switch (state) {
+       case PM_SUSPEND_MEM:
+               mx5_cpu_lp_set(STOP_POWER_OFF);
+               break;
+       case PM_SUSPEND_STANDBY:
+               mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       if (state == PM_SUSPEND_MEM) {
+               local_flush_tlb_all();
+               flush_cache_all();
+
+               /*clear the EMPGC0/1 bits */
+               __raw_writel(0, MXC_SRPG_EMPGC0_SRPGCR);
+               __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR);
+       }
+       cpu_do_idle();
+       return 0;
+}
+
+static void mx5_suspend_finish(void)
+{
+       clk_disable(gpc_dvfs_clk);
+}
+
+static int mx5_pm_valid(suspend_state_t state)
+{
+       return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
+}
+
+static const struct platform_suspend_ops mx5_suspend_ops = {
+       .valid = mx5_pm_valid,
+       .prepare = mx5_suspend_prepare,
+       .enter = mx5_suspend_enter,
+       .finish = mx5_suspend_finish,
+};
+
+static int __init mx5_pm_init(void)
+{
+       if (!cpu_is_mx51() && !cpu_is_mx53())
+               return 0;
+
+       if (gpc_dvfs_clk == NULL)
+               gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
+
+       if (!IS_ERR(gpc_dvfs_clk)) {
+               if (cpu_is_mx51())
+                       suspend_set_ops(&mx5_suspend_ops);
+       } else
+               return -EPERM;
+
+       return 0;
+}
+device_initcall(mx5_pm_init);
index a8e33681b73251f498a7cfee463f20c3f6d0e1ff..4bde04f99e38ceda85fd4cb43f89bf2eb080ead7 100644 (file)
@@ -19,6 +19,7 @@
 
 #define SRC_SCR                                0x000
 #define SRC_GPR1                       0x020
+#define BP_SRC_SCR_WARM_RESET_ENABLE   0
 #define BP_SRC_SCR_CORE1_RST           14
 #define BP_SRC_SCR_CORE1_ENABLE                22
 
@@ -46,11 +47,33 @@ void imx_set_cpu_jump(int cpu, void *jump_addr)
                       src_base + SRC_GPR1 + cpu * 8);
 }
 
+void imx_src_prepare_restart(void)
+{
+       u32 val;
+
+       /* clear enable bits of secondary cores */
+       val = readl_relaxed(src_base + SRC_SCR);
+       val &= ~(0x7 << BP_SRC_SCR_CORE1_ENABLE);
+       writel_relaxed(val, src_base + SRC_SCR);
+
+       /* clear persistent entry register of primary core */
+       writel_relaxed(0, src_base + SRC_GPR1);
+}
+
 void __init imx_src_init(void)
 {
        struct device_node *np;
+       u32 val;
 
        np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-src");
        src_base = of_iomap(np, 0);
        WARN_ON(!src_base);
+
+       /*
+        * force warm reset sources to generate cold reset
+        * for a more reliable restart
+        */
+       val = readl_relaxed(src_base + SRC_SCR);
+       val &= ~(1 << BP_SRC_SCR_WARM_RESET_ENABLE);
+       writel_relaxed(val, src_base + SRC_SCR);
 }
index a08f9b0299dfa43090b564ca39f20cfdf4325a9c..899561d8db285c475459799b03b4dd7619c8273b 100644 (file)
@@ -1,2 +1,3 @@
 void integrator_init_early(void);
 void integrator_reserve(void);
+void integrator_restart(char, const char *);
index 4b38e13667acf0f316e8881305c065f939c5d2cb..0a3e0974398aeb678ebbc65c019b7ebbf362396a 100644 (file)
@@ -238,3 +238,11 @@ void __init integrator_reserve(void)
 {
        memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
 }
+
+/*
+ * To reset, we hit the on-board reset register in the system FPGA
+ */
+void integrator_restart(char mode, const char *cmd)
+{
+       cm_control(CM_CTRL_RESET, CM_CTRL_RESET);
+}
index e1551b8dab77448687a8752df3f839ccb274f9d3..901514eba4a6fa353fc05e845fb25d1ffc9068cc 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <mach/cm.h>
-
 static inline void arch_idle(void)
 {
        /*
@@ -32,13 +30,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /*
-        * To reset, we hit the on-board reset register
-        * in the system FPGA
-        */
-       cm_control(CM_CTRL_RESET, CM_CTRL_RESET);
-}
-
 #endif
diff --git a/arch/arm/mach-integrator/include/mach/vmalloc.h b/arch/arm/mach-integrator/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 2f5a2ba..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  arch/arm/mach-integrator/include/mach/vmalloc.h
- *
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-#define VMALLOC_END       0xd0000000UL
index a1769f35a86e35013f32cc5fc05d7da6abe3239c..21a1d6cbef40c43dad90ff3fc9da70d550f78fe9 100644 (file)
@@ -472,4 +472,5 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
        .init_irq       = ap_init_irq,
        .timer          = &ap_timer,
        .init_machine   = ap_init,
+       .restart        = integrator_restart,
 MACHINE_END
index 5de49c33e4d4eb70129614b7aeff6fa4afaa7ad6..3a730d447c9a1f6365d560f94d9553190bf9ef9f 100644 (file)
@@ -499,4 +499,5 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
        .init_irq       = intcp_init_irq,
        .timer          = &cp_timer,
        .init_machine   = intcp_init,
+       .restart        = integrator_restart,
 MACHINE_END
index 52b7fab7ef60555f58dd916fafb54891580394d3..07e9ff7adafb4dd5c79f2b6ba83fb785ed03186d 100644 (file)
@@ -10,6 +10,7 @@ void iop13xx_map_io(void);
 void iop13xx_platform_init(void);
 void iop13xx_add_tpmi_devices(void);
 void iop13xx_init_irq(void);
+void iop13xx_restart(char, const char *);
 
 /* CPUID CP6 R0 Page 0 */
 static inline int iop13xx_cpu_id(void)
index d0c66ef450a7398e08ee4fd5cd70c0f7a571c25f..1f31ed3f8ae2b3ec29c0563d0f01352e920471d2 100644 (file)
@@ -7,21 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <mach/iop13xx.h>
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /*
-        * Reset the internal bus (warning both cores are reset)
-        */
-       write_wdtcr(IOP_WDTCR_EN_ARM);
-       write_wdtcr(IOP_WDTCR_EN);
-       write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
-       write_wdtcr(0x1000);
-
-       for(;;);
-}
diff --git a/arch/arm/mach-iop13xx/include/mach/vmalloc.h b/arch/arm/mach-iop13xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index c534567..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef _VMALLOC_H_
-#define _VMALLOC_H_
-#define VMALLOC_END    0xfa000000UL
-#endif
index 4cf2cc477eae88f142d5549bb4a758be705c6563..abaee883358874f4bbaf5c5bf1c7a6a90bf6bf2a 100644 (file)
@@ -96,4 +96,5 @@ MACHINE_START(IQ81340MC, "Intel IQ81340MC")
        .init_irq       = iop13xx_init_irq,
        .timer          = &iq81340mc_timer,
        .init_machine   = iq81340mc_init,
+       .restart        = iop13xx_restart,
 MACHINE_END
index cd9e27499a1ebd04572e9d5fdf631db013a870d7..690916a09dc6bed10561272d8e300f5838bbb76b 100644 (file)
@@ -98,4 +98,5 @@ MACHINE_START(IQ81340SC, "Intel IQ81340SC")
        .init_irq       = iop13xx_init_irq,
        .timer          = &iq81340sc_timer,
        .init_machine   = iq81340sc_init,
+       .restart        = iop13xx_restart,
 MACHINE_END
index a5b989728b9e9e45bf35980283ed8a790e4ed588..daabb1fa6c2c3b19db0d570fbda1d84b03f9b3c4 100644 (file)
@@ -606,3 +606,14 @@ static int __init iop13xx_init_adma_setup(char *str)
 __setup("iop13xx_init_adma", iop13xx_init_adma_setup);
 __setup("iop13xx_init_uart", iop13xx_init_uart_setup);
 __setup("iop13xx_init_i2c", iop13xx_init_i2c_setup);
+
+void iop13xx_restart(char mode, const char *cmd)
+{
+       /*
+        * Reset the internal bus (warning both cores are reset)
+        */
+       write_wdtcr(IOP_WDTCR_EN_ARM);
+       write_wdtcr(IOP_WDTCR_EN);
+       write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
+       write_wdtcr(0x1000);
+}
index 4325055d4e197cfd807d9f4b278b3476de83255f..24069e03fdc1d632154b3bf489461fbfde5621d2 100644 (file)
@@ -208,4 +208,5 @@ MACHINE_START(EM7210, "Lanner EM7210")
        .init_irq       = iop32x_init_irq,
        .timer          = &em7210_timer,
        .init_machine   = em7210_init_machine,
+       .restart        = iop3xx_restart,
 MACHINE_END
index 0edc880205778a22eabc6850a37a4770a7e46a54..204e1d1cd7666f679742d8ace9d113c3bce34b11 100644 (file)
@@ -212,4 +212,5 @@ MACHINE_START(GLANTANK, "GLAN Tank")
        .init_irq       = iop32x_init_irq,
        .timer          = &glantank_timer,
        .init_machine   = glantank_init_machine,
+       .restart        = iop3xx_restart,
 MACHINE_END
index 059c783ce0b2c8651ed5864b8fe4a047894e67d9..2d88264b9863b36de1c4d837aafb2cb2a9941693 100644 (file)
 
 #include <asm/hardware/iop3xx.h>
 
-extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
-       unsigned int mtype);
-extern void __iop3xx_iounmap(void __iomem *addr);
-
 #define IO_SPACE_LIMIT         0xffffffff
 #define __io(p)                ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
 #define __mem_pci(a)           (a)
 
-#define __arch_ioremap __iop3xx_ioremap
-#define __arch_iounmap __iop3xx_iounmap
-
 #endif
index a4b808fe0d817c77db50928f22e6a24018417a06..4a88727bca98eaae5bdcb06b2593b66dd711a1ae 100644 (file)
@@ -7,28 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <asm/mach-types.h>
-#include <asm/hardware/iop3xx.h>
-#include <mach/n2100.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       local_irq_disable();
-
-       if (machine_is_n2100()) {
-               gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW);
-               gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT);
-               while (1)
-                       ;
-       }
-
-       *IOP3XX_PCSR = 0x30;
-
-       /* Jump into ROM at address 0 */
-       cpu_reset(0);
-}
diff --git a/arch/arm/mach-iop32x/include/mach/vmalloc.h b/arch/arm/mach-iop32x/include/mach/vmalloc.h
deleted file mode 100644 (file)
index c4862d4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-iop32x/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END    0xfe000000UL
index 9e7aaccfeba0d6e1a0390d12bf6e7980733eeb6f..3eb642af1cdc261c1a43cb613b987078ed3b3823 100644 (file)
@@ -318,6 +318,7 @@ MACHINE_START(IQ31244, "Intel IQ31244")
        .init_irq       = iop32x_init_irq,
        .timer          = &iq31244_timer,
        .init_machine   = iq31244_init_machine,
+       .restart        = iop3xx_restart,
 MACHINE_END
 
 /* There should have been an ep80219 machine identifier from the beginning.
@@ -332,4 +333,5 @@ MACHINE_START(EP80219, "Intel EP80219")
        .init_irq       = iop32x_init_irq,
        .timer          = &iq31244_timer,
        .init_machine   = iq31244_init_machine,
+       .restart        = iop3xx_restart,
 MACHINE_END
index 53ea86f649dde55333a78c5f1481d062bdb93285..2ec724b58a2c109545600acb824e68b59563679e 100644 (file)
@@ -191,4 +191,5 @@ MACHINE_START(IQ80321, "Intel IQ80321")
        .init_irq       = iop32x_init_irq,
        .timer          = &iq80321_timer,
        .init_machine   = iq80321_init_machine,
+       .restart        = iop3xx_restart,
 MACHINE_END
index d7269279968c5522cfbc7e176329ef53d0f15dd6..6b6d55912444a4e6498465b87102b39bbb557722 100644 (file)
@@ -291,6 +291,14 @@ static void n2100_power_off(void)
                ;
 }
 
+static void n2100_restart(char mode, const char *cmd)
+{
+       gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW);
+       gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT);
+       while (1)
+               ;
+}
+
 
 static struct timer_list power_button_poll_timer;
 
@@ -332,4 +340,5 @@ MACHINE_START(N2100, "Thecus N2100")
        .init_irq       = iop32x_init_irq,
        .timer          = &n2100_timer,
        .init_machine   = n2100_init_machine,
+       .restart        = n2100_restart,
 MACHINE_END
index 39e893e97c212ba8b67875ee56fcb708189e4460..a8a66fc8fbdbe8eb5ac34c3a5b08583caa1d3de7 100644 (file)
 
 #include <asm/hardware/iop3xx.h>
 
-extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
-       unsigned int mtype);
-extern void __iop3xx_iounmap(void __iomem *addr);
-
 #define IO_SPACE_LIMIT         0xffffffff
 #define __io(p)                ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
 #define __mem_pci(a)           (a)
 
-#define __arch_ioremap __iop3xx_ioremap
-#define __arch_iounmap __iop3xx_iounmap
-
 #endif
index f192a34be0731969dec3547d846db75cd8920fad..4f98e765397ce76f55b0740316931ada44cc3a95 100644 (file)
@@ -7,17 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <asm/hardware/iop3xx.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       *IOP3XX_PCSR = 0x30;
-
-       /* Jump into ROM at address 0 */
-       cpu_reset(0);
-}
diff --git a/arch/arm/mach-iop33x/include/mach/vmalloc.h b/arch/arm/mach-iop33x/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 48331dc..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-iop33x/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END    0xfe000000UL
index 9e14ccc56f8e405050f33851c864091be0f72906..abce934f38166069e535b37c921bf7e8c6925dab 100644 (file)
@@ -146,4 +146,5 @@ MACHINE_START(IQ80331, "Intel IQ80331")
        .init_irq       = iop33x_init_irq,
        .timer          = &iq80331_timer,
        .init_machine   = iq80331_init_machine,
+       .restart        = iop3xx_restart,
 MACHINE_END
index 09c899a2523f7a16b5dbbe8d857f3096722c5de6..7513559e25bbeed2c40b0ae2735731c164b37661 100644 (file)
@@ -146,4 +146,5 @@ MACHINE_START(IQ80332, "Intel IQ80332")
        .init_irq       = iop33x_init_irq,
        .timer          = &iq80332_timer,
        .init_machine   = iq80332_init_machine,
+       .restart        = iop3xx_restart,
 MACHINE_END
index 24f0fe35f4adfca63249cf5a099db5234298087b..81c45370a4e6f4c63b0854d0e41fa5ec79ec54f8 100644 (file)
@@ -515,3 +515,7 @@ void __init ixp2000_init_irq(void)
        }
 }
 
+void ixp2000_restart(char mode, const char *cmd)
+{
+       ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
+}
index af9994537e015386ef3cebcde1a808843f52c6cc..ee525416f0d20b0ca6a69b42cd9820c8b45a0731 100644 (file)
@@ -259,6 +259,7 @@ MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
        .init_irq       = ixp2000_init_irq,
        .timer          = &enp2611_timer,
        .init_machine   = enp2611_init_machine,
+       .restart        = ixp2000_restart,
 MACHINE_END
 
 
index 42182c79ed9070915673eae713fadde4c9bb9127..bb0f8dcf9ee1312442be8b88647957a8d9d7840d 100644 (file)
@@ -122,6 +122,7 @@ void ixp2000_map_io(void);
 void ixp2000_uart_init(void);
 void ixp2000_init_irq(void);
 void ixp2000_init_time(unsigned long);
+void ixp2000_restart(char, const char *);
 unsigned long ixp2000_gettimeoffset(void);
 
 struct pci_sys_data;
index de370992c8485d5ef2eb86f215d52def936005f5..a7fb08b2b8e73bdf4af786a3dcc25f64b3c20e2f 100644 (file)
@@ -8,42 +8,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#include <mach/hardware.h>
-#include <asm/mach-types.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       local_irq_disable();
-
-       /*
-        * Reset flash banking register so that we are pointing at
-        * RedBoot bank.
-        */
-       if (machine_is_ixdp2401()) {
-               ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
-                                       ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
-                                               | IXDP2X01_CPLD_FLASH_INTERN));
-               ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
-       }
-
-       /*
-        * On IXDP2801 we need to write this magic sequence to the CPLD
-        * to cause a complete reset of the CPU and all external devices
-        * and move the flash bank register back to 0.
-        */
-       if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
-               unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
-
-               reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
-               ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
-               ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
-       }
-
-       ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
-}
diff --git a/arch/arm/mach-ixp2000/include/mach/vmalloc.h b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 61c8dae..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * arch/arm/mach-ixp2000/include/mach/vmalloc.h
- *
- * Author: Naeem Afzal <naeem.m.afzal@intel.com>
- *
- * Copyright 2002 Intel Corp.
- *
- *  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.
- *
- * Just any arbitrary offset to the start of the vmalloc VM area: the
- * current 8MB value just means that there will be a 8MB "hole" after the
- * physical memory until the kernel virtual memory starts.  That means that
- * any out-of-bounds memory accesses will hopefully be caught.
- * The vmalloc() routines leaves a hole of 4kB between each vmalloced
- * area for the same reason. ;)
- */
-#define VMALLOC_END        0xfb000000UL
index f7dfd970014106dcb57d36811eb610d272d5a2fa..f53e911ec94a9f475d3d65842cdb22d66e0b0f67 100644 (file)
@@ -176,5 +176,6 @@ MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
        .init_irq       = ixdp2400_init_irq,
        .timer          = &ixdp2400_timer,
        .init_machine   = ixdp2x00_init_machine,
+       .restart        = ixp2000_restart,
 MACHINE_END
 
index d33bcac1ec92885b31bbea53b187ee94b1813102..a2e7c393e74fb198d3d3aad258c88bd17ce2cc08 100644 (file)
@@ -291,5 +291,6 @@ MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
        .init_irq       = ixdp2800_init_irq,
        .timer          = &ixdp2800_timer,
        .init_machine   = ixdp2x00_init_machine,
+       .restart        = ixp2000_restart,
 MACHINE_END
 
index 61a28676b5bef1965bf990c435a18506c611cac3..7632beadabf6ac7c9ac656ee9d853b0755e5eb60 100644 (file)
@@ -413,6 +413,35 @@ static void __init ixdp2x01_init_machine(void)
        ixdp2x01_uart_init();
 }
 
+static void ixdp2401_restart(char mode, const char *cmd)
+{
+       /*
+        * Reset flash banking register so that we are pointing at
+        * RedBoot bank.
+        */
+       ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
+                               ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
+                                       | IXDP2X01_CPLD_FLASH_INTERN));
+       ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
+
+       ixp2000_restart(mode, cmd);
+}
+
+static void ixdp280x_restart(char mode, const char *cmd)
+{
+       /*
+        * On IXDP2801 we need to write this magic sequence to the CPLD
+        * to cause a complete reset of the CPU and all external devices
+        * and move the flash bank register back to 0.
+        */
+       unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
+
+       reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
+       ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
+       ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
+
+       ixp2000_restart(mode, cmd);
+}
 
 #ifdef CONFIG_ARCH_IXDP2401
 MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
@@ -422,6 +451,7 @@ MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
        .init_irq       = ixdp2x01_init_irq,
        .timer          = &ixdp2x01_timer,
        .init_machine   = ixdp2x01_init_machine,
+       .restart        = ixdp2401_restart,
 MACHINE_END
 #endif
 
@@ -433,6 +463,7 @@ MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
        .init_irq       = ixdp2x01_init_irq,
        .timer          = &ixdp2x01_timer,
        .init_machine   = ixdp2x01_init_machine,
+       .restart        = ixdp280x_restart,
 MACHINE_END
 
 /*
@@ -446,6 +477,7 @@ MACHINE_START(IXDP28X5, "Intel IXDP2805/2855 Development Platform")
        .init_irq       = ixdp2x01_init_irq,
        .timer          = &ixdp2x01_timer,
        .init_machine   = ixdp2x01_init_machine,
+       .restart        = ixdp280x_restart,
 MACHINE_END
 #endif
 
index a1bee33d183ea871f72d9ffaef8f4265c3a8b40f..0923bb905cc0ce917bf1df1a249c482bb3f27c10 100644 (file)
@@ -444,3 +444,9 @@ void __init ixp23xx_sys_init(void)
        *IXP23XX_EXP_UNIT_FUSE |= 0xf;
        platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices));
 }
+
+void ixp23xx_restart(char mode, const char *cmd)
+{
+       /* Use on-chip reset capability */
+       *IXP23XX_RESET0 |= IXP23XX_RST_ALL;
+}
index 30dd31652e9d51f289fd208f1f3ad97ed25bd277..8f2487e1fc4e1a7e0a2fe5ba3abd554a7ea83810 100644 (file)
@@ -90,4 +90,5 @@ MACHINE_START(ESPRESSO, "IP Fabrics Double Espresso")
        .timer          = &ixp23xx_timer,
        .atag_offset    = 0x100,
        .init_machine   = espresso_init,
+       .restart        = ixp23xx_restart,
 MACHINE_END
index a1749d0fd8961df2d2f57068950660146b325302..4ce4353b9f72d144ba07febbd6f56a3f557407cd 100644 (file)
 #define __io(p)                ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
 #define __mem_pci(a)   (a)
 
-static inline void __iomem *
-ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)
-{
-       if (addr >= IXP23XX_PCI_MEM_START &&
-               addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) {
-               if (addr + size > IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE)
-                       return NULL;
-
-               return (void __iomem *)
-                       ((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT);
-       }
-
-       return __arm_ioremap(addr, size, mtype);
-}
-
-static inline void
-ixp23xx_iounmap(void __iomem *addr)
-{
-       if ((((u32)addr) >= IXP23XX_PCI_MEM_VIRT) &&
-           (((u32)addr) < IXP23XX_PCI_MEM_VIRT + IXP23XX_PCI_MEM_SIZE))
-               return;
-
-       __iounmap(addr);
-}
-
-#define __arch_ioremap ixp23xx_ioremap
-#define __arch_iounmap ixp23xx_iounmap
-
-
 #endif
index db9d9416e5e4edd2ca7eaa7b0c6011e1e0f52fc4..50de558e722e940ab1671cf0d96815841065ca03 100644 (file)
@@ -34,6 +34,7 @@ struct pci_sys_data;
 void ixp23xx_map_io(void);
 void ixp23xx_init_irq(void);
 void ixp23xx_sys_init(void);
+void ixp23xx_restart(char, const char *);
 int ixp23xx_pci_setup(int, struct pci_sys_data *);
 void ixp23xx_pci_preinit(void);
 struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*);
index 8920ff2dff1f7c8ea0ed57274fa3188c370f153d..277dda7334b93492cffb8c718ca1a0ee1ca83b09 100644 (file)
@@ -7,10 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#include <mach/hardware.h>
-#include <asm/mach-types.h>
-
 static inline void arch_idle(void)
 {
 #if 0
@@ -18,16 +14,3 @@ static inline void arch_idle(void)
                cpu_do_idle();
 #endif
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /* First try machine specific support */
-       if (machine_is_ixdp2351()) {
-               *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
-               (void) *IXDP2351_CPLD_RESET1_REG;
-               *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;
-       }
-
-       /* Use on-chip reset capability */
-       *IXP23XX_RESET0 |= IXP23XX_RST_ALL;
-}
diff --git a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 896c56a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * arch/arm/mach-ixp23xx/include/mach/vmalloc.h
- *
- * Copyright (c) 2005 MontaVista Software, Inc.
- *
- * NPU mappings end at 0xf0000000 and we allocate 64MB for board
- * specific static I/O.
- */
-
-#define VMALLOC_END    (0xec000000UL)
index b3a57e0f3419dca561be776f112a39316129a90d..5d5dd3e8d0693fda41ed7667b2476b890b375678 100644 (file)
@@ -326,6 +326,17 @@ static void __init ixdp2351_init(void)
        ixp23xx_sys_init();
 }
 
+static void ixdp2351_restart(char mode, const char *cmd)
+{
+       /* First try machine specific support */
+
+       *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
+       (void) *IXDP2351_CPLD_RESET1_REG;
+       *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;
+
+       ixp23xx_restart(mode, cmd);
+}
+
 MACHINE_START(IXDP2351, "Intel IXDP2351 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
        .map_io         = ixdp2351_map_io,
@@ -333,4 +344,5 @@ MACHINE_START(IXDP2351, "Intel IXDP2351 Development Platform")
        .timer          = &ixp23xx_timer,
        .atag_offset    = 0x100,
        .init_machine   = ixdp2351_init,
+       .restart        = ixdp2351_restart,
 MACHINE_END
index 8f4dcbba90250e7b5c3d8b9e95c13cc09d111767..377283fc658cd8944ffa19def4ab370f02b7c0c9 100644 (file)
@@ -177,4 +177,5 @@ MACHINE_START(ROADRUNNER, "ADI Engineering RoadRunner Development Platform")
        .timer          = &ixp23xx_timer,
        .atag_offset    = 0x100,
        .init_machine   = roadrunner_init,
+       .restart        = ixp23xx_restart,
 MACHINE_END
index 37609a22c4501ad6ed9fc5a5c5ba28018cbdfefc..a7277ad470a50ffdf8248f1b574b9961dccea0ca 100644 (file)
@@ -172,6 +172,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 
  /*
@@ -190,6 +191,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
 
index b86a0055ab969694dc931be487a33aaef4368a4c..04aa12103bcec1f9e7e68a19208d2da873f4be26 100644 (file)
@@ -501,3 +501,23 @@ static void __init ixp4xx_clockevent_init(void)
 
        clockevents_register_device(&clockevent_ixp4xx);
 }
+
+void ixp4xx_restart(char mode, const char *cmd)
+{
+       if ( 1 && mode == 's') {
+               /* Jump into ROM at address 0 */
+               soft_restart(0);
+       } else {
+               /* Use on-chip reset capability */
+
+               /* set the "key" register to enable access to
+                * "timer" and "enable" registers
+                */
+               *IXP4XX_OSWK = IXP4XX_WDT_KEY;
+
+               /* write 0 to the timer register for an immediate reset */
+               *IXP4XX_OSWT = 0;
+
+               *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
+       }
+}
index 81dfec31842b8b025914f6300485d8fb430f8fe0..a74f86ce8bcc8252576215455998b79fb7b5d1a6 100644 (file)
@@ -117,6 +117,7 @@ MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
 
@@ -132,6 +133,7 @@ MACHINE_START(IXDPG425, "Intel IXDPG425")
        .timer          = &ixp4xx_timer,
        .atag_offset    = 0x100,
        .init_machine   = coyote_init,
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
 
index 8837fbca27ce7e06a47f50c5d05537986d7c3bb8..67be177b336aa0ebd04315f31bc659d66c8c65f8 100644 (file)
@@ -286,4 +286,5 @@ MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
index 2887c3578c17531c6017b0cf085ca277a52a4612..6d5818285af8efd970d363aff1cee67003d7d281 100644 (file)
@@ -277,5 +277,6 @@ MACHINE_START(FSG, "Freecom FSG-3")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 
index d69d1b053bb73bcdf9e8a88f939c313555ac0c06..7ecf9b28f1c0a3d0d8c2f288e94cf2a18bf6ee14 100644 (file)
@@ -104,5 +104,6 @@ MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
index bf6678d1a929867750da6f73f9e4506911bb7076..c0e3d69a8aeccf23e7372693c01284b9d43e6917 100644 (file)
@@ -504,4 +504,5 @@ MACHINE_START(GORAMO_MLR, "MultiLink")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
index aa029fc19140b133f8cec8cdca9ab61bcb917d99..a23f8939145836b280a8fbd53d35b4dce0f45ad1 100644 (file)
@@ -172,6 +172,7 @@ MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 
 
index e824c02c825aa8c1885206d5f5a8bcf758041776..df9250bbf13d90c1b198338ae61be5366b0041c8 100644 (file)
@@ -125,6 +125,7 @@ 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;
 extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
index 54c0af7fa2d42296cb393c9d84456c22c3597480..140a9bef4466f2f44e5831aa70751959a3954a24 100644 (file)
@@ -8,9 +8,6 @@
  * published by the Free Software Foundation.
  *
  */
-
-#include <mach/hardware.h>
-
 static inline void arch_idle(void)
 {
        /* ixp4xx does not implement the XScale PWRMODE register,
@@ -20,25 +17,3 @@ static inline void arch_idle(void)
        cpu_do_idle();
 #endif
 }
-
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       if ( 1 && mode == 's') {
-               /* Jump into ROM at address 0 */
-               cpu_reset(0);
-       } else {
-               /* Use on-chip reset capability */
-
-               /* set the "key" register to enable access to
-                * "timer" and "enable" registers
-                */
-               *IXP4XX_OSWK = IXP4XX_WDT_KEY;
-
-               /* write 0 to the timer register for an immediate reset */
-               *IXP4XX_OSWT = 0;
-
-               *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
-       }
-}
-
diff --git a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 9bcd64d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-ixp4xx/include/mach/vmalloc.h
- */
-#define VMALLOC_END       (0xff000000UL)
-
index f235f829dfa65979c992e261d4780dfb80bc0b4d..8a38b39999f836b5ffb7c3f430ce8f489eb7b8a5 100644 (file)
@@ -261,6 +261,7 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
 
index de716fa1aab64e713edc822200b814fcb2445264..1010eb7b0083c6a0f33a63fe373d9567c9ea5b7a 100644 (file)
@@ -321,4 +321,5 @@ MACHINE_START(NAS100D, "Iomega NAS 100d")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
index ac81ccb26bfea8b63902f83041b66137fb11896f..aa355c360d5720e4665999f4acfa11e9495d2467 100644 (file)
@@ -307,4 +307,5 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
index 3b6a81a696fc8696b095be92c28f0629d3c79a3b..0940869fcfdd33f487c629806b65862433a2c5c4 100644 (file)
@@ -246,6 +246,7 @@ MACHINE_START(DEVIXP, "Omicron DEVIXP")
        .init_irq       = ixp4xx_init_irq,
        .timer          = &ixp4xx_timer,
        .init_machine   = omixp_init,
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
 
@@ -259,6 +260,7 @@ MACHINE_START(MICCPT, "Omicron MICCPT")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
 
@@ -269,5 +271,6 @@ MACHINE_START(MIC256, "Omicron MIC256")
        .init_irq       = ixp4xx_init_irq,
        .timer          = &ixp4xx_timer,
        .init_machine   = omixp_init,
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
index 27e469ef45238081d50fecf86e30c54002a0abb4..9dec20683291f4eb3c4ee4874b6046bd70788c38 100644 (file)
@@ -244,4 +244,5 @@ MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
index b14144b967a783c49b1bafc56384edb6986dd086..5ac0f0a0fd8cea97f30046de24fffcebb190a784 100644 (file)
@@ -105,5 +105,6 @@ MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = ixp4xx_restart,
 MACHINE_END
 #endif
index f3248cfbe51d058f79812d5247125fc98c2c2af6..0bff4a916231fbc9509ab9608e18eb585f8e8c1e 100644 (file)
@@ -534,3 +534,19 @@ static int __init kirkwood_clock_gate(void)
        return 0;
 }
 late_initcall(kirkwood_clock_gate);
+
+void kirkwood_restart(char mode, const char *cmd)
+{
+       /*
+        * Enable soft reset to assert RSTOUTn.
+        */
+       writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
+
+       /*
+        * Assert soft reset.
+        */
+       writel(SOFT_RESET, SYSTEM_SOFT_RESET);
+
+       while (1)
+               ;
+}
index b9b0f0968a36ac035d8d74a4cd5594d91522fe82..1529280246d6e8cd03da68d143f6d10280cfa734 100644 (file)
@@ -50,6 +50,7 @@ void kirkwood_uart1_init(void);
 void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
 void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *));
 void kirkwood_audio_init(void);
+void kirkwood_restart(char, const char *);
 
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
index f457e07a65f099bec0a3401ea6445a8b1bd0dd3b..6e1bac929ab5dd5b64903c4b7f587ac338ac2f0e 100644 (file)
@@ -227,4 +227,5 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index ff4c21c1f923ebfcb110fd61a097b955f4b49b15..d933593795985749fce168849dd04b8edf917506 100644 (file)
@@ -103,4 +103,5 @@ MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index e4d199b2b1e8f866bc4ae88feefb5f2a43154509..61d9a552a054e93e73ef9c9fc5dc8670e7a126f1 100644 (file)
@@ -108,4 +108,5 @@ MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index 6c40f784b5169d8029888ba49e7bf593f9adf485..bdaed3867d13ae062c11473ee95a8ac220d1e044 100644 (file)
@@ -127,4 +127,5 @@ MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index 1aaddc364f2e6259eca95e6bd4e815322fb67673..49dd0cb5e16621818a49c52ff529b9b7b18df5f4 100644 (file)
@@ -19,31 +19,6 @@ static inline void __iomem *__io(unsigned long addr)
                                        + KIRKWOOD_PCIE_IO_VIRT_BASE);
 }
 
-static inline void __iomem *
-__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
-{
-       void __iomem *retval;
-       unsigned long offs = paddr - KIRKWOOD_REGS_PHYS_BASE;
-       if (mtype == MT_DEVICE && size && offs < KIRKWOOD_REGS_SIZE &&
-           size <= KIRKWOOD_REGS_SIZE && offs + size <= KIRKWOOD_REGS_SIZE) {
-               retval = (void __iomem *)KIRKWOOD_REGS_VIRT_BASE + offs;
-       } else {
-               retval = __arm_ioremap(paddr, size, mtype);
-       }
-
-       return retval;
-}
-
-static inline void
-__arch_iounmap(void __iomem *addr)
-{
-       if (addr < (void __iomem *)KIRKWOOD_REGS_VIRT_BASE ||
-           addr >= (void __iomem *)(KIRKWOOD_REGS_VIRT_BASE + KIRKWOOD_REGS_SIZE))
-               __iounmap(addr);
-}
-
-#define __arch_ioremap         __arch_ioremap
-#define __arch_iounmap         __arch_iounmap
 #define __io(a)                        __io(a)
 #define __mem_pci(a)           (a)
 
index 7568e95d279baeed920f8226ec2e73e703089118..5fddde002b5e01d535abc38ab84119ce61fe5bce 100644 (file)
@@ -9,28 +9,9 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <mach/bridge-regs.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /*
-        * Enable soft reset to assert RSTOUTn.
-        */
-       writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
-
-       /*
-        * Assert soft reset.
-        */
-       writel(SOFT_RESET, SYSTEM_SOFT_RESET);
-
-       while (1)
-               ;
-}
-
-
 #endif
diff --git a/arch/arm/mach-kirkwood/include/mach/vmalloc.h b/arch/arm/mach-kirkwood/include/mach/vmalloc.h
deleted file mode 100644 (file)
index bf162ca..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END    0xfe800000UL
index 9a1e917352f77e2679469d9016c51930008d337c..85f6169c24846178570cb1cc079a12dd209fd9b3 100644 (file)
@@ -169,4 +169,5 @@ MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index 8849bcc7328e7db1bbb7c8a5e9f6e7b5c0885883..e6bba01bae387139c9e54d6acf0a285c6f1a94b2 100644 (file)
@@ -264,6 +264,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
 
@@ -275,6 +276,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
 
@@ -286,5 +288,6 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index 1ba12c4dff8f31276b11b51e5cd8480cfa6c76be..31ae8de34e9361936ec6cb92597e3c41661d0c94 100644 (file)
@@ -405,6 +405,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
 
@@ -416,5 +417,6 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index 5660ca6c3d888ec6384e74c6b9eac7aee4439971..01f8c8992880450d1a69d861d718d63434133977 100644 (file)
@@ -220,6 +220,7 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
 
@@ -232,6 +233,7 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
 
@@ -244,5 +246,6 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index 6663869773abaa7d27825462739ecb1012cb5e52..fd2c9c8b6831a1d0ae808bef994e691a9a38c721 100644 (file)
@@ -85,4 +85,5 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index 66b3c05e37a6f7f6413d39ca322e644b8e6de7eb..ef922079348b8ea0a3769dbf839d710776eaba84 100644 (file)
@@ -121,4 +121,5 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index 8b102d62e82c7b7a3a5e2fb6dde9c7393e13171e..4ea70e5f7137587e8cbac4e0211f8ee3d370b6f5 100644 (file)
@@ -107,7 +107,7 @@ static void __init sheevaplug_init(void)
        kirkwood_init();
 
        /* setup gpio pin select */
-       if (machine_is_sheeva_esata())
+       if (machine_is_esata_sheevaplug())
                kirkwood_mpp_conf(sheeva_esata_mpp_config);
        else
                kirkwood_mpp_conf(sheevaplug_mpp_config);
@@ -123,11 +123,11 @@ static void __init sheevaplug_init(void)
        kirkwood_ge00_init(&sheevaplug_ge00_data);
 
        /* honor lower power consumption for plugs with out eSATA */
-       if (machine_is_sheeva_esata())
+       if (machine_is_esata_sheevaplug())
                kirkwood_sata_init(&sheeva_esata_sata_data);
 
        /* enable sd wp and sd cd on plugs with esata */
-       if (machine_is_sheeva_esata())
+       if (machine_is_esata_sheevaplug())
                kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
        else
                kirkwood_sdio_init(&sheevaplug_mvsdio_data);
@@ -144,6 +144,7 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
 
@@ -155,5 +156,6 @@ MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index ea104fb5ec3d9317fd01d3e62462f2b6e019966f..966b2b3bb8136a6e0ecb4b1a41190f10f379ba19 100644 (file)
@@ -207,4 +207,5 @@ MACHINE_START(T5325, "HP t5325 Thin Client")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index 262c034836d47b493d185a8ac681c6637cc68e5a..73e2b6ca95642e31222ff9e9628c75c952a1eceb 100644 (file)
@@ -138,4 +138,5 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index b68f5b4a9ec87696c4283a55dc7e87f199599d27..5bbca26804425b0f8858a3cfed59973619fab348 100644 (file)
@@ -182,4 +182,5 @@ MACHINE_START(TS41X, "QNAP TS-41x")
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
        .timer          = &kirkwood_timer,
+       .restart        = kirkwood_restart,
 MACHINE_END
index a91f99d265aa8a5897efba886869fed32da44363..255502ddd87924b444a27ba9f669d463f73ba251 100644 (file)
@@ -228,4 +228,5 @@ MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
        .init_irq       = ks8695_init_irq,
        .init_machine   = acs5k_init,
        .timer          = &ks8695_timer,
+       .restart        = ks8695_restart,
 MACHINE_END
index d24bcef2e2dd782d336d8283fe94a636fc456019..e0d36cef2c56faea7e215ce680aeda29140742eb 100644 (file)
@@ -126,4 +126,5 @@ MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
        .init_irq       = ks8695_init_irq,
        .init_machine   = dsm320_init,
        .timer          = &ks8695_timer,
+       .restart        = ks8695_restart,
 MACHINE_END
index 16c95657f8fd4548aad5027ee4d66cb597edf481..a8270725b76d271773cffce4886886671f2964a3 100644 (file)
@@ -58,4 +58,5 @@ MACHINE_START(KS8695, "KS8695 Centaur Development Board")
        .init_irq       = ks8695_init_irq,
        .init_machine   = micrel_init,
        .timer          = &ks8695_timer,
+       .restart        = ks8695_restart,
 MACHINE_END
index 2fbfab8d5faeff91308ecc9fe880927b55ccd59b..f8bdb11a9c33c342d73d0bece21382b6ec544556 100644 (file)
@@ -12,4 +12,5 @@
 
 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;
index fb1dda9be2d0a8c7fd6a032fb06417af1499455d..59fe992395bf920f1c01bb0dd7cd970f51267552 100644 (file)
@@ -14,9 +14,6 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <linux/io.h>
-#include <mach/regs-timer.h>
-
 static void arch_idle(void)
 {
        /*
@@ -27,22 +24,4 @@ static void arch_idle(void)
 
 }
 
-static void arch_reset(char mode, const char *cmd)
-{
-       unsigned int reg;
-
-       if (mode == 's')
-               cpu_reset(0);
-
-       /* disable timer0 */
-       reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-       __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-
-       /* enable watchdog mode */
-       __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
-
-       /* re-enable timer0 */
-       __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-}
-
 #endif
diff --git a/arch/arm/mach-ks8695/include/mach/vmalloc.h b/arch/arm/mach-ks8695/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 744ac66..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-ks8695/include/mach/vmalloc.h
- *
- * Copyright (C) 2006 Ben Dooks
- * Copyright (C) 2006 Simtec Electronics <linux@simtec.co.uk>
- *
- * KS8695 vmalloc definition
- *
- * 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_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END      (KS8695_IO_VA & PGDIR_MASK)
-
-#endif
index 69c072c2c0f9a28c1fc466a786216f4ad62b24e8..37dfcd5bd2ad9178213bac8ad27b080cd37dc03d 100644 (file)
@@ -109,3 +109,21 @@ struct sys_timer ks8695_timer = {
        .offset         = ks8695_gettimeoffset,
        .resume         = ks8695_timer_setup,
 };
+
+void ks8695_restart(char mode, const char *cmd)
+{
+       unsigned int reg;
+
+       if (mode == 's')
+               soft_restart(0);
+
+       /* disable timer0 */
+       reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
+       __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+
+       /* enable watchdog mode */
+       __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
+
+       /* re-enable timer0 */
+       __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+}
index 205b2dbb565bb91c00593b848c1aec2adfda74cf..369b152896cd7d7c4311a5766ded9428b2e74c87 100644 (file)
@@ -164,7 +164,7 @@ int clk_is_sysclk_mainosc(void)
 /*
  * System reset via the watchdog timer
  */
-void lpc32xx_watchdog_reset(void)
+static void lpc32xx_watchdog_reset(void)
 {
        /* Make sure WDT clocks are enabled */
        __raw_writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN,
@@ -311,3 +311,21 @@ void __init lpc32xx_map_io(void)
 {
        iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc));
 }
+
+void lpc23xx_restart(char mode, const char *cmd)
+{
+       switch (mode) {
+       case 's':
+       case 'h':
+               lpc32xx_watchdog_reset();
+               break;
+
+       default:
+               /* Do nothing */
+               break;
+       }
+
+       /* Wait for watchdog to reset system */
+       while (1)
+               ;
+}
index 5583f52662bda8164dec061b60d57476b9c761e4..4b4e700343c14f89ecefb18af80810d031ba5a2d 100644 (file)
@@ -39,6 +39,8 @@ extern void __init lpc32xx_init_irq(void);
 extern void __init lpc32xx_map_io(void);
 extern void __init lpc32xx_serial_init(void);
 extern void __init lpc32xx_gpio_init(void);
+extern void lpc23xx_restart(char, const char *);
+
 
 /*
  * Structure used for setting up and querying the PLLS
index df3b0dea4d7bffcc77a5c9bca0fb08443ac69c11..bf176c9915201d24054bdd9d33791b0db7a1af6e 100644 (file)
@@ -24,29 +24,4 @@ static void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       extern void lpc32xx_watchdog_reset(void);
-
-       switch (mode) {
-       case 's':
-       case 'h':
-               printk(KERN_CRIT "RESET: Rebooting system\n");
-
-               /* Disable interrupts */
-               local_irq_disable();
-
-               lpc32xx_watchdog_reset();
-               break;
-
-       default:
-               /* Do nothing */
-               break;
-       }
-
-       /* Wait for watchdog to reset system */
-       while (1)
-               ;
-}
-
 #endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/vmalloc.h b/arch/arm/mach-lpc32xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 720fa43..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * arch/arm/mach-lpc32xx/include/mach/vmalloc.h
- *
- * Author: Kevin Wells <kevin.wells@nxp.com>
- *
- * Copyright (C) 2010 NXP Semiconductors
- *
- * 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 __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END    0xF0000000UL
-
-#endif
index 6d2f0d1b9373243d586ae4ef3a33452f48766a5d..ecb94114c81bdf495f17d940d5287800304527e6 100644 (file)
@@ -388,4 +388,5 @@ MACHINE_START(PHY3250, "Phytec 3250 board with the LPC3250 Microcontroller")
        .init_irq       = lpc32xx_init_irq,
        .timer          = &lpc32xx_timer,
        .init_machine   = phy3250_board_init,
+       .restart        = lpc23xx_restart,
 MACHINE_END
index 7a60bbbce7a43523c888f04a9ae8444fb95c1993..17cb76060125ef0be126d5cc7f8d8c843e390f38 100644 (file)
@@ -120,8 +120,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = gpio_to_irq(27),
-               .end    = gpio_to_irq(27),
+               .start  = MMP_GPIO_TO_IRQ(27),
+               .end    = MMP_GPIO_TO_IRQ(27),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -232,6 +232,7 @@ static void __init common_init(void)
        pxa168_add_nand(&aspenite_nand_info);
        pxa168_add_fb(&aspenite_lcd_info);
        pxa168_add_keypad(&aspenite_keypad_info);
+       platform_device_register(&pxa168_device_gpio);
 
        /* off-chip devices */
        platform_device_register(&smc91x_device);
@@ -243,6 +244,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
        .init_irq       = pxa168_init_irq,
        .timer          = &pxa168_timer,
        .init_machine   = common_init,
+       .restart        = pxa168_restart,
 MACHINE_END
 
 MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
@@ -251,4 +253,5 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
        .init_irq       = pxa168_init_irq,
        .timer          = &pxa168_timer,
        .init_machine   = common_init,
+       .restart        = pxa168_restart,
 MACHINE_END
index 39f0878d64a0c39ba026c2be0f20755576d75045..b148a9dc5a443a5e19987ba9a46b66c4fe043d71 100644 (file)
@@ -38,6 +38,7 @@ static void __init avengers_lite_init(void)
 
        /* on-chip devices */
        pxa168_add_uart(2);
+       platform_device_register(&pxa168_device_gpio);
 }
 
 MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
@@ -45,4 +46,5 @@ MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
        .init_irq       = pxa168_init_irq,
        .timer          = &pxa168_timer,
        .init_machine   = avengers_lite_init,
+       .restart        = pxa168_restart,
 MACHINE_END
index 983cfb15fbde99bc0b394b56a779cc4708f6be9c..d839fe6421e69654468a3e3aaa22002cdb142076 100644 (file)
@@ -202,6 +202,7 @@ static void __init brownstone_init(void)
        /* on-chip devices */
        mmp2_add_uart(1);
        mmp2_add_uart(3);
+       platform_device_register(&mmp2_device_gpio);
        mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
        mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
        mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */
@@ -219,4 +220,5 @@ MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
        .init_irq       = mmp2_init_irq,
        .timer          = &mmp2_timer,
        .init_machine   = brownstone_init,
+       .restart        = mmp_restart,
 MACHINE_END
index 5720674739f093f16b08e91d585fc0b8fe3c3e55..062b5b93c50e9eb2e8398f600de29d120a905289 100644 (file)
@@ -45,3 +45,8 @@ void __init mmp_map_io(void)
        /* this is early, initialize mmp_chip_id here */
        mmp_chip_id = __raw_readl(MMP_CHIPID);
 }
+
+void mmp_restart(char mode, const char *cmd)
+{
+       soft_restart(0);
+}
index ec8d65ded25cb7a6dd908f1d950da7366d38618a..1c9d6c1ea97a792159df74f66b9f7a3835bdca06 100644 (file)
@@ -6,3 +6,4 @@ extern void timer_init(int irq);
 
 extern void __init icu_init_irq(void);
 extern void __init mmp_map_io(void);
+extern void mmp_restart(char, const char *);
index c4fd806b15b42ad282533587e54a8378eb514c3d..2ee8cd7829dd862ff0d062b52f56baeab12a1c7a 100644 (file)
@@ -87,8 +87,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = gpio_to_irq(155),
-               .end    = gpio_to_irq(155),
+               .start  = MMP_GPIO_TO_IRQ(155),
+               .end    = MMP_GPIO_TO_IRQ(155),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -110,6 +110,7 @@ static void __init flint_init(void)
        /* on-chip devices */
        mmp2_add_uart(1);
        mmp2_add_uart(2);
+       platform_device_register(&mmp2_device_gpio);
 
        /* off-chip devices */
        platform_device_register(&smc91x_device);
@@ -121,4 +122,5 @@ MACHINE_START(FLINT, "Flint Development Platform")
        .init_irq       = mmp2_init_irq,
        .timer          = &mmp2_timer,
        .init_machine   = flint_init,
+       .restart        = mmp_restart,
 MACHINE_END
index 4665767a4f79ee918ec1fd24053d296ce13d0806..87765467de633c896c00188906bb289c966dda68 100644 (file)
@@ -184,6 +184,7 @@ static void __init gplugd_init(void)
        pxa168_add_uart(3);
        pxa168_add_ssp(1);
        pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
+       platform_device_register(&pxa168_device_gpio);
 
        pxa168_add_eth(&gplugd_eth_platform_data);
 }
@@ -194,4 +195,5 @@ MACHINE_START(GPLUGD, "PXA168-based GuruPlug Display (gplugD) Platform")
        .init_irq       = pxa168_init_irq,
        .timer          = &pxa168_timer,
        .init_machine   = gplugd_init,
+       .restart        = pxa168_restart,
 MACHINE_END
index 99b4ce1b6562cebf64651b9a0039599d624593d6..0e135a599f3e190fa04f94a7b5044431cf52bbb7 100644 (file)
@@ -2,6 +2,7 @@
 #define __ASM_MACH_GPIO_PXA_H
 
 #include <mach/addr-map.h>
+#include <mach/cputype.h>
 #include <mach/irqs.h>
 
 #define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)
@@ -9,8 +10,6 @@
 #define BANK_OFF(n)    (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
 #define GPIO_REG(x)    (*(volatile u32 *)(GPIO_REGS_VIRT + (x)))
 
-#define NR_BUILTIN_GPIO                IRQ_GPIO_NUM
-
 #define gpio_to_bank(gpio)     ((gpio) >> 5)
 
 /* NOTE: these macros are defined here to make optimization of
index 681262359d1c28cfc30b26e4f093fc43930c17a5..13219ebf5128d033033d1159deb5b8fabedfee8f 100644 (file)
@@ -3,11 +3,6 @@
 
 #include <asm-generic/gpio.h>
 
-#define gpio_to_irq(gpio)      (IRQ_GPIO_START + (gpio))
-#define irq_to_gpio(irq)       ((irq) - IRQ_GPIO_START)
+#include <mach/cputype.h>
 
-#define __gpio_is_inverted(gpio)       (0)
-#define __gpio_is_occupied(gpio)       (0)
-
-#include <plat/gpio.h>
 #endif /* __ASM_MACH_GPIO_H */
index a09d328e2ddd02087cdd7d08c68d6950b0ff6250..34635a0bbb5924be0db26ffa8a1ddfd12d65da71 100644 (file)
 #define IRQ_MMP2_MUX_END               (IRQ_MMP2_SSP_BASE + 2)
 
 #define IRQ_GPIO_START                 128
-#define IRQ_GPIO_NUM                   192
-#define IRQ_GPIO(x)                    (IRQ_GPIO_START + (x))
+#define MMP_NR_BUILTIN_GPIO            192
+#define MMP_GPIO_TO_IRQ(gpio)          (IRQ_GPIO_START + (gpio))
 
-#define IRQ_BOARD_START                        (IRQ_GPIO_START + IRQ_GPIO_NUM)
+#define IRQ_BOARD_START                        (IRQ_GPIO_START + MMP_NR_BUILTIN_GPIO)
 
 #define NR_IRQS                                (IRQ_BOARD_START)
 
index 2f7b2d3c2b184f9717307076d281c82619f628c8..cba22fed2265b431737a5f08cae7055133d52dc5 100644 (file)
@@ -32,6 +32,8 @@ extern struct pxa_device_desc mmp2_device_sdh3;
 extern struct pxa_device_desc mmp2_device_asram;
 extern struct pxa_device_desc mmp2_device_isram;
 
+extern struct platform_device mmp2_device_gpio;
+
 static inline int mmp2_add_uart(int id)
 {
        struct pxa_device_desc *d = NULL;
index 7fb568d2845b0da8f86c2614b6072b9526b3ee5e..dc03d580a06d64737dab0962bcab81ffa296eddd 100644 (file)
@@ -5,6 +5,7 @@ struct sys_timer;
 
 extern struct sys_timer pxa168_timer;
 extern void __init pxa168_init_irq(void);
+extern void pxa168_restart(char, const char *);
 extern void pxa168_clear_keypad_wakeup(void);
 
 #include <linux/i2c.h>
@@ -42,6 +43,8 @@ struct pxa168_usb_pdata {
 /* pdata can be NULL */
 int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata);
 
+extern struct platform_device pxa168_device_gpio;
+
 static inline int pxa168_add_uart(int id)
 {
        struct pxa_device_desc *d = NULL;
index 91be75591398baf9427a892864316101284dc7cf..4de13abef7bbf5a6413ca8fec3f647aee96a209e 100644 (file)
@@ -21,6 +21,8 @@ extern struct pxa_device_desc pxa910_device_pwm3;
 extern struct pxa_device_desc pxa910_device_pwm4;
 extern struct pxa_device_desc pxa910_device_nand;
 
+extern struct platform_device pxa910_device_gpio;
+
 static inline int pxa910_add_uart(int id)
 {
        struct pxa_device_desc *d = NULL;
index 1a8a25edb1b422ace6925e07171953390b51bc11..1d001eab81e11654ecbe0116daaec0d87c56699d 100644 (file)
@@ -9,18 +9,8 @@
 #ifndef __ASM_MACH_SYSTEM_H
 #define __ASM_MACH_SYSTEM_H
 
-#include <mach/cputype.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       if (cpu_is_pxa168())
-               cpu_reset(0xffff0000);
-       else
-               cpu_reset(0);
-}
 #endif /* __ASM_MACH_SYSTEM_H */
diff --git a/arch/arm/mach-mmp/include/mach/vmalloc.h b/arch/arm/mach-mmp/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 1d0bac0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * linux/arch/arm/mach-mmp/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END    0xfe000000UL
index 8bfac66126234df28995cbc630311cebbf482818..96cf5c8fe47dcb3b0529ead1538281d584f47e13 100644 (file)
@@ -175,4 +175,5 @@ MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
        .init_irq       = mmp2_init_irq,
        .timer          = &mmp2_timer,
        .init_machine   = jasper_init,
+       .restart        = mmp_restart,
 MACHINE_END
index 5dd1d4a6aeb90d4458ffeca378d1f08233908442..617c60a170a4c1787327e738d428c042ada56869 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 
 #include <asm/hardware/cache-tauros2.h>
 
@@ -24,7 +25,6 @@
 #include <mach/irqs.h>
 #include <mach/dma.h>
 #include <mach/mfp.h>
-#include <mach/gpio-pxa.h>
 #include <mach/devices.h>
 #include <mach/mmp2.h>
 
@@ -33,8 +33,6 @@
 
 #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
 
-#define APMASK(i)      (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c)
-
 static struct mfp_addr_map mmp2_addr_map[] __initdata = {
 
        MFP_ADDR_X(GPIO0, GPIO58, 0x54),
@@ -95,24 +93,9 @@ void mmp2_clear_pmic_int(void)
        __raw_writel(data, mfpr_pmic);
 }
 
-static void __init mmp2_init_gpio(void)
-{
-       int i;
-
-       /* enable GPIO clock */
-       __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_MMP2_GPIO);
-
-       /* unmask GPIO edge detection for all 6 banks -- APMASKx */
-       for (i = 0; i < 6; i++)
-               __raw_writel(0xffffffff, APMASK(i));
-
-       pxa_init_gpio(IRQ_MMP2_GPIO, 0, 167, NULL);
-}
-
 void __init mmp2_init_irq(void)
 {
        mmp2_init_icu();
-       mmp2_init_gpio();
 }
 
 static void sdhc_clk_enable(struct clk *clk)
@@ -149,6 +132,7 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
 static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
 static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
 static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
+static APBC_CLK(gpio, MMP2_GPIO, 0, 26000000);
 
 static APMU_CLK(nand, NAND, 0xbf, 100000000);
 static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops);
@@ -168,6 +152,7 @@ static struct clk_lookup mmp2_clkregs[] = {
        INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL),
        INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL),
        INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
+       INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
        INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"),
        INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"),
        INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"),
@@ -230,3 +215,21 @@ MMP2_DEVICE(asram, "asram", -1, NONE, 0xe0000000, 0x4000);
 /* 0xd1000000 ~ 0xd101ffff is reserved for secure processor */
 MMP2_DEVICE(isram, "isram", -1, NONE, 0xd1020000, 0x18000);
 
+struct resource mmp2_resource_gpio[] = {
+       {
+               .start  = 0xd4019000,
+               .end    = 0xd4019fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_MMP2_GPIO,
+               .end    = IRQ_MMP2_GPIO,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device mmp2_device_gpio = {
+       .name           = "pxa-gpio",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(mmp2_resource_gpio),
+       .resource       = mmp2_resource_gpio,
+};
index 76ca15c00e4589602a5123e278a9960c07095c2a..7bc17eaa12eba3835392554aa893aff71641fdac 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/list.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/platform_device.h>
 
 #include <asm/mach/time.h>
 #include <mach/addr-map.h>
@@ -20,7 +21,6 @@
 #include <mach/regs-apbc.h>
 #include <mach/regs-apmu.h>
 #include <mach/irqs.h>
-#include <mach/gpio-pxa.h>
 #include <mach/dma.h>
 #include <mach/devices.h>
 #include <mach/mfp.h>
@@ -43,26 +43,9 @@ static struct mfp_addr_map pxa168_mfp_addr_map[] __initdata =
        MFP_ADDR_END,
 };
 
-#define APMASK(i)      (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
-
-static void __init pxa168_init_gpio(void)
-{
-       int i;
-
-       /* enable GPIO clock */
-       __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA168_GPIO);
-
-       /* unmask GPIO edge detection for all 4 banks - APMASKx */
-       for (i = 0; i < 4; i++)
-               __raw_writel(0xffffffff, APMASK(i));
-
-       pxa_init_gpio(IRQ_PXA168_GPIOX, 0, 127, NULL);
-}
-
 void __init pxa168_init_irq(void)
 {
        icu_init_irq();
-       pxa168_init_gpio();
 }
 
 /* APB peripheral clocks */
@@ -80,6 +63,7 @@ static APBC_CLK(ssp2, PXA168_SSP2, 4, 0);
 static APBC_CLK(ssp3, PXA168_SSP3, 4, 0);
 static APBC_CLK(ssp4, PXA168_SSP4, 4, 0);
 static APBC_CLK(ssp5, PXA168_SSP5, 4, 0);
+static APBC_CLK(gpio, PXA168_GPIO, 0, 13000000);
 static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
 
 static APMU_CLK(nand, NAND, 0x19b, 156000000);
@@ -105,6 +89,7 @@ static struct clk_lookup pxa168_clkregs[] = {
        INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL),
        INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
        INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
+       INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
        INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
        INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
        INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"),
@@ -174,6 +159,25 @@ PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
 PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
 PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff);
 
+struct resource pxa168_resource_gpio[] = {
+       {
+               .start  = 0xd4019000,
+               .end    = 0xd4019fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_PXA168_GPIOX,
+               .end    = IRQ_PXA168_GPIOX,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device pxa168_device_gpio = {
+       .name           = "pxa-gpio",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(pxa168_resource_gpio),
+       .resource       = pxa168_resource_gpio,
+};
+
 struct resource pxa168_usb_host_resources[] = {
        /* USB Host conroller register base */
        [0] = {
@@ -214,3 +218,8 @@ int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata)
        pxa168_device_usb_host.dev.platform_data = pdata;
        return platform_device_register(&pxa168_device_usb_host);
 }
+
+void pxa168_restart(char mode, const char *cmd)
+{
+       soft_restart(0xffff0000);
+}
index 4ebbfbba39fcf3bb54e3da76891918c14f66ea50..3241a25784d09b6c5ba83ba88752fcee5c7f9dd0 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 
 #include <asm/mach/time.h>
 #include <mach/addr-map.h>
@@ -19,7 +20,6 @@
 #include <mach/regs-apmu.h>
 #include <mach/cputype.h>
 #include <mach/irqs.h>
-#include <mach/gpio-pxa.h>
 #include <mach/dma.h>
 #include <mach/mfp.h>
 #include <mach/devices.h>
@@ -77,26 +77,9 @@ static struct mfp_addr_map pxa910_mfp_addr_map[] __initdata =
        MFP_ADDR_END,
 };
 
-#define APMASK(i)      (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
-
-static void __init pxa910_init_gpio(void)
-{
-       int i;
-
-       /* enable GPIO clock */
-       __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA910_GPIO);
-
-       /* unmask GPIO edge detection for all 4 banks - APMASKx */
-       for (i = 0; i < 4; i++)
-               __raw_writel(0xffffffff, APMASK(i));
-
-       pxa_init_gpio(IRQ_PXA910_AP_GPIO, 0, 127, NULL);
-}
-
 void __init pxa910_init_irq(void)
 {
        icu_init_irq();
-       pxa910_init_gpio();
 }
 
 /* APB peripheral clocks */
@@ -108,6 +91,7 @@ static APBC_CLK(pwm1, PXA910_PWM1, 1, 13000000);
 static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000);
 static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000);
 static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000);
+static APBC_CLK(gpio, PXA910_GPIO, 0, 13000000);
 
 static APMU_CLK(nand, NAND, 0x19b, 156000000);
 static APMU_CLK(u2o, USB, 0x1b, 480000000);
@@ -123,6 +107,7 @@ static struct clk_lookup pxa910_clkregs[] = {
        INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL),
        INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
        INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
+       INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
        INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"),
 };
 
@@ -179,3 +164,22 @@ PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10);
 PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10);
 PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
 PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99);
+
+struct resource pxa910_resource_gpio[] = {
+       {
+               .start  = 0xd4019000,
+               .end    = 0xd4019fff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_PXA910_AP_GPIO,
+               .end    = IRQ_PXA910_AP_GPIO,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device pxa910_device_gpio = {
+       .name           = "pxa-gpio",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(pxa910_resource_gpio),
+       .resource       = pxa910_resource_gpio,
+};
index eb5be879fd8cd76748d109546c77d34eb9914116..8e3b5af04a57127aafbc7ee8f892828905835ddb 100644 (file)
@@ -19,6 +19,7 @@
 #include <mach/addr-map.h>
 #include <mach/mfp-pxa910.h>
 #include <mach/pxa910.h>
+#include <mach/irqs.h>
 
 #include "common.h"
 
@@ -71,8 +72,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = gpio_to_irq(80),
-               .end    = gpio_to_irq(80),
+               .start  = MMP_GPIO_TO_IRQ(80),
+               .end    = MMP_GPIO_TO_IRQ(80),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -93,6 +94,7 @@ static void __init tavorevb_init(void)
 
        /* on-chip devices */
        pxa910_add_uart(1);
+       platform_device_register(&pxa910_device_gpio);
 
        /* off-chip devices */
        platform_device_register(&smc91x_device);
@@ -103,4 +105,5 @@ MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)")
        .init_irq       = pxa910_init_irq,
        .timer          = &pxa910_timer,
        .init_machine   = tavorevb_init,
+       .restart        = mmp_restart,
 MACHINE_END
index bbe4727b96ccb26f068b61f4096dd01b2d07fc5d..0523e422990eeb3f3e6cb98afab1a4d6ea62f049 100644 (file)
@@ -66,7 +66,7 @@ static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
 static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
        {
                I2C_BOARD_INFO("ds1337", 0x68),
-               .irq = gpio_to_irq(RTC_INT_GPIO)
+               .irq = MMP_GPIO_TO_IRQ(RTC_INT_GPIO)
        },
 };
 
@@ -78,6 +78,7 @@ static void __init teton_bga_init(void)
        pxa168_add_uart(1);
        pxa168_add_keypad(&teton_bga_keypad_info);
        pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
+       platform_device_register(&pxa168_device_gpio);
 }
 
 MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
@@ -86,4 +87,5 @@ MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
        .init_irq       = pxa168_init_irq,
        .timer          = &pxa168_timer,
        .init_machine   = teton_bga_init,
+       .restart        = pxa168_restart,
 MACHINE_END
index 176515a7698935ee136842563b1c025e39a22651..5ac5d5832e450b7b4a6db27941c5eabd8a3f7816 100644 (file)
 #include <mach/addr-map.h>
 #include <mach/mfp-pxa910.h>
 #include <mach/pxa910.h>
+#include <mach/irqs.h>
 
 #include "common.h"
 
-#define TTCDKB_GPIO_EXT0(x)    (NR_BUILTIN_GPIO + ((x < 0) ? 0 :       \
+#define TTCDKB_GPIO_EXT0(x)    (MMP_NR_BUILTIN_GPIO + ((x < 0) ? 0 :   \
                                ((x < 16) ? x : 15)))
-#define TTCDKB_GPIO_EXT1(x)    (NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 :  \
+#define TTCDKB_GPIO_EXT1(x)    (MMP_NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 : \
                                ((x < 16) ? x : 15)))
 
 /*
@@ -122,6 +123,7 @@ static struct platform_device ttc_dkb_device_onenand = {
 };
 
 static struct platform_device *ttc_dkb_devices[] = {
+       &pxa910_device_gpio,
        &ttc_dkb_device_onenand,
 };
 
@@ -136,7 +138,7 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
        {
                .type           = "max7312",
                .addr           = 0x23,
-               .irq            = IRQ_GPIO(80),
+               .irq            = MMP_GPIO_TO_IRQ(80),
                .platform_data  = &max7312_data,
        },
 };
@@ -159,4 +161,5 @@ MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
        .init_irq       = pxa910_init_irq,
        .timer          = &pxa910_timer,
        .init_machine   = ttc_dkb_init,
+       .restart        = mmp_restart,
 MACHINE_END
index ebde97f5d5f0d94035792972722331862a0ebdd6..000ddf0a4f33935c274504ce45516267b1ddfb5d 100644 (file)
@@ -13,7 +13,6 @@ config ARCH_MSM7X00A
        select CPU_V6
        select GPIO_MSM_V1
        select MSM_PROC_COMM
-       select HAS_MSM_DEBUG_UART_PHYS
 
 config ARCH_MSM7X30
        bool "MSM7x30"
@@ -25,7 +24,6 @@ config ARCH_MSM7X30
        select MSM_GPIOMUX
        select GPIO_MSM_V1
        select MSM_PROC_COMM
-       select HAS_MSM_DEBUG_UART_PHYS
 
 config ARCH_QSD8X50
        bool "QSD8X50"
@@ -37,7 +35,6 @@ config ARCH_QSD8X50
        select MSM_GPIOMUX
        select GPIO_MSM_V1
        select MSM_PROC_COMM
-       select HAS_MSM_DEBUG_UART_PHYS
 
 config ARCH_MSM8X60
        bool "MSM8X60"
@@ -63,6 +60,9 @@ config ARCH_MSM8960
 
 endchoice
 
+config MSM_HAS_DEBUG_UART_HS
+       bool
+
 config MSM_SOC_REV_A
        bool
 config  ARCH_MSM_SCORPIONMP
@@ -73,9 +73,6 @@ config  ARCH_MSM_ARM11
 config  ARCH_MSM_SCORPION
        bool
 
-config HAS_MSM_DEBUG_UART_PHYS
-       bool
-
 config  MSM_VIC
        bool
 
@@ -152,32 +149,6 @@ config MACH_MSM8960_RUMI3
 
 endmenu
 
-config MSM_DEBUG_UART
-       int
-       default 1 if MSM_DEBUG_UART1
-       default 2 if MSM_DEBUG_UART2
-       default 3 if MSM_DEBUG_UART3
-
-if HAS_MSM_DEBUG_UART_PHYS
-choice
-       prompt "Debug UART"
-
-       default MSM_DEBUG_UART_NONE
-
-       config MSM_DEBUG_UART_NONE
-               bool "None"
-
-       config MSM_DEBUG_UART1
-               bool "UART1"
-
-       config MSM_DEBUG_UART2
-               bool "UART2"
-
-       config MSM_DEBUG_UART3
-               bool "UART3"
-endchoice
-endif
-
 config MSM_SMD_PKG3
        bool
 
index 6dc1cbd2a595b559824dc485a1e0bb74e880d93a..ed3598128530f143df0c89fedf66a96177c8f4e0 100644 (file)
@@ -99,6 +99,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
        .map_io = msm8960_map_io,
        .init_irq = msm8960_init_irq,
        .timer = &msm_timer,
+       .handle_irq = gic_handle_irq,
        .init_machine = msm8960_sim_init,
 MACHINE_END
 
@@ -108,6 +109,7 @@ MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
        .map_io = msm8960_map_io,
        .init_irq = msm8960_init_irq,
        .timer = &msm_timer,
+       .handle_irq = gic_handle_irq,
        .init_machine = msm8960_rumi3_init,
 MACHINE_END
 
index 44bf71688373b4af31907f744b28f7765f150e75..0a113424632c4133f099b218b9f49f124b2ba1d4 100644 (file)
@@ -108,6 +108,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
        .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
+       .handle_irq = gic_handle_irq,
        .init_machine = msm8x60_init,
        .timer = &msm_timer,
 MACHINE_END
@@ -117,6 +118,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
        .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
+       .handle_irq = gic_handle_irq,
        .init_machine = msm8x60_init,
        .timer = &msm_timer,
 MACHINE_END
@@ -126,6 +128,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
        .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
+       .handle_irq = gic_handle_irq,
        .init_machine = msm8x60_init,
        .timer = &msm_timer,
 MACHINE_END
@@ -135,6 +138,7 @@ MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
        .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
+       .handle_irq = gic_handle_irq,
        .init_machine = msm8x60_init,
        .timer = &msm_timer,
 MACHINE_END
index 2dc73ccddb11ba946899d3622e0c7c5bf7bf3a3d..3ffd8668c9a5dae483613e8bcc59a98a4bc975a7 100644 (file)
@@ -1,6 +1,7 @@
-/* arch/arm/mach-msm7200/include/mach/debug-macro.S
+/*
  *
  * Copyright (C) 2007 Google, Inc.
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
  * Author: Brian Swetland <swetland@google.com>
  *
  * This software is licensed under the terms of the GNU General Public
  *
  */
 
-
-
 #include <mach/hardware.h>
 #include <mach/msm_iomap.h>
 
-#if defined(CONFIG_HAS_MSM_DEBUG_UART_PHYS) && !defined(CONFIG_MSM_DEBUG_UART_NONE)
        .macro  addruart, rp, rv, tmp
+#ifdef MSM_DEBUG_UART_PHYS
        ldr     \rp, =MSM_DEBUG_UART_PHYS
        ldr     \rv, =MSM_DEBUG_UART_BASE
+#endif
        .endm
 
-       .macro  senduart,rd,rx
+       .macro  senduart, rd, rx
+#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
+       @ Write the 1 character to UARTDM_TF
+       str     \rd, [\rx, #0x70]
+#else
        teq     \rx, #0
        strne   \rd, [\rx, #0x0C]
+#endif
        .endm
 
-       .macro  waituart,rd,rx
+       .macro  waituart, rd, rx
+#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
+       @ check for TX_EMT in UARTDM_SR
+       ldr     \rd, [\rx, #0x08]
+       tst     \rd, #0x08
+       bne     1002f
+       @ wait for TXREADY in UARTDM_ISR
+1001:  ldr     \rd, [\rx, #0x14]
+       tst     \rd, #0x80
+       beq     1001b
+1002:
+       @ Clear TX_READY by writing to the UARTDM_CR register
+       mov     \rd, #0x300
+       str     \rd, [\rx, #0x10]
+       @ Write 0x1 to NCF register
+       mov     \rd, #0x1
+       str     \rd, [\rx, #0x40]
+       @ UARTDM reg. Read to induce delay
+       ldr     \rd, [\rx, #0x08]
+#else
        @ wait for TX_READY
 1001:  ldr     \rd, [\rx, #0x08]
        tst     \rd, #0x04
        beq     1001b
-       .endm
-#else
-       .macro  addruart, rp, rv, tmp
-       mov     \rv, #0xff000000
-       orr     \rv, \rv, #0x00f00000
-       .endm
-
-       .macro  senduart,rd,rx
-       .endm
-
-       .macro  waituart,rd,rx
-       .endm
 #endif
+       .endm
 
-       .macro  busyuart,rd,rx
+       .macro  busyuart, rd, rx
        .endm
diff --git a/arch/arm/mach-msm/include/mach/entry-macro-qgic.S b/arch/arm/mach-msm/include/mach/entry-macro-qgic.S
deleted file mode 100644 (file)
index 717076f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Low-level IRQ helper macros
- *
- * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * 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 <asm/hardware/entry-macro-gic.S>
-
-       .macro  disable_fiq
-       .endm
-
-       .macro  arch_ret_to_user, tmp1, tmp2
-       .endm
diff --git a/arch/arm/mach-msm/include/mach/entry-macro-vic.S b/arch/arm/mach-msm/include/mach/entry-macro-vic.S
deleted file mode 100644 (file)
index 70563ed..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- */
-
-#include <mach/msm_iomap.h>
-
-       .macro  disable_fiq
-       .endm
-
-       .macro  get_irqnr_preamble, base, tmp
-       @ enable imprecise aborts
-       cpsie   a
-       mov     \base, #MSM_VIC_BASE
-       .endm
-
-       .macro  arch_ret_to_user, tmp1, tmp2
-       .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       @ 0xD0 has irq# or old irq# if the irq has been handled
-       @ 0xD4 has irq# or -1 if none pending *but* if you just
-       @ read 0xD4 you never get the first irq for some reason
-       ldr     \irqnr, [\base, #0xD0]
-       ldr     \irqnr, [\base, #0xD4]
-       cmp     \irqnr, #0xffffffff
-       .endm
index b16f082eeb6f7c092f8a041f3ba302fae5fcf163..41f7003ef34f7596f1a517415b20fcfed7d9b3b0 100644 (file)
  *
  */
 
-#if defined(CONFIG_ARM_GIC)
-#include <mach/entry-macro-qgic.S>
-#else
-#include <mach/entry-macro-vic.S>
+       .macro  disable_fiq
+       .endm
+
+       .macro  arch_ret_to_user, tmp1, tmp2
+       .endm
+
+#if !defined(CONFIG_ARM_GIC)
+#include <mach/msm_iomap.h>
+
+       .macro  get_irqnr_preamble, base, tmp
+       @ enable imprecise aborts
+       cpsie   a
+       mov     \base, #MSM_VIC_BASE
+       .endm
+
+       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
+       @ 0xD0 has irq# or old irq# if the irq has been handled
+       @ 0xD4 has irq# or -1 if none pending *but* if you just
+       @ read 0xD4 you never get the first irq for some reason
+       ldr     \irqnr, [\base, #0xD0]
+       ldr     \irqnr, [\base, #0xD4]
+       cmp     \irqnr, #0xffffffff
+       .endm
 #endif
index 94fe9fe6feb35e207a48b88685f143985d6910d1..8af46123dab6856c3870e82ac519edf62eab5ad8 100644 (file)
 #define MSM_UART3_PHYS        0xA9C00000
 #define MSM_UART3_SIZE        SZ_4K
 
-#ifdef CONFIG_MSM_DEBUG_UART
-#define MSM_DEBUG_UART_BASE   0xE1000000
-#if CONFIG_MSM_DEBUG_UART == 1
-#define MSM_DEBUG_UART_PHYS   MSM_UART1_PHYS
-#elif CONFIG_MSM_DEBUG_UART == 2
-#define MSM_DEBUG_UART_PHYS   MSM_UART2_PHYS
-#elif CONFIG_MSM_DEBUG_UART == 3
-#define MSM_DEBUG_UART_PHYS   MSM_UART3_PHYS
-#endif
-#define MSM_DEBUG_UART_SIZE   SZ_4K
-#endif
-
 #define MSM_SDC1_PHYS         0xA0400000
 #define MSM_SDC1_SIZE         SZ_4K
 
index 37694442d1bda079bb1475e71a511cf27ad825f3..198202c267c846d6375be0f59bf2aad38eba277a 100644 (file)
 #define MSM_UART3_PHYS        0xACC00000
 #define MSM_UART3_SIZE        SZ_4K
 
-#ifdef CONFIG_MSM_DEBUG_UART
-#define MSM_DEBUG_UART_BASE   0xE1000000
-#if CONFIG_MSM_DEBUG_UART == 1
-#define MSM_DEBUG_UART_PHYS   MSM_UART1_PHYS
-#elif CONFIG_MSM_DEBUG_UART == 2
-#define MSM_DEBUG_UART_PHYS   MSM_UART2_PHYS
-#elif CONFIG_MSM_DEBUG_UART == 3
-#define MSM_DEBUG_UART_PHYS   MSM_UART3_PHYS
-#endif
-#define MSM_DEBUG_UART_SIZE   SZ_4K
-#endif
-
 #define MSM_MDC_BASE         IOMEM(0xE0200000)
 #define MSM_MDC_PHYS         0xAA500000
 #define MSM_MDC_SIZE         SZ_1M
index 3c9d9602a318b935ebb5e5a940df12fba6fdbeb6..800b55767e6b83ee7856692bf4e8fcf122df5863 100644 (file)
@@ -45,4 +45,9 @@
 #define MSM8960_TMR0_PHYS      0x0208A000
 #define MSM8960_TMR0_SIZE      SZ_4K
 
+#ifdef CONFIG_DEBUG_MSM8960_UART
+#define MSM_DEBUG_UART_BASE    0xE1040000
+#define MSM_DEBUG_UART_PHYS    0x16440000
+#endif
+
 #endif
index d67cd73316f456eaaf7258fc8ea3444ebd884b9d..0faa894729b7737d2c310f890aa27bd339506ec8 100644 (file)
 #define MSM_UART3_PHYS        0xA9C00000
 #define MSM_UART3_SIZE        SZ_4K
 
-#ifdef CONFIG_MSM_DEBUG_UART
-#define MSM_DEBUG_UART_BASE   0xE1000000
-#if CONFIG_MSM_DEBUG_UART == 1
-#define MSM_DEBUG_UART_PHYS   MSM_UART1_PHYS
-#elif CONFIG_MSM_DEBUG_UART == 2
-#define MSM_DEBUG_UART_PHYS   MSM_UART2_PHYS
-#elif CONFIG_MSM_DEBUG_UART == 3
-#define MSM_DEBUG_UART_PHYS   MSM_UART3_PHYS
-#endif
-#define MSM_DEBUG_UART_SIZE   SZ_4K
-#endif
-
 #define MSM_MDC_BASE         IOMEM(0xE0200000)
 #define MSM_MDC_PHYS         0xAA500000
 #define MSM_MDC_SIZE         SZ_1M
index 3b19b8f244b8808d63489a1b92fc1851a38e0ffb..54e12caa8d860a99a4d6c4e11505e25a7d269d62 100644 (file)
@@ -62,4 +62,9 @@
 #define MSM8X60_TMR0_PHYS      0x02040000
 #define MSM8X60_TMR0_SIZE      SZ_4K
 
+#ifdef CONFIG_DEBUG_MSM8660_UART
+#define MSM_DEBUG_UART_BASE    0xE1040000
+#define MSM_DEBUG_UART_PHYS    0x19C40000
+#endif
+
 #endif
index 4ded15238b60267442f4f7aec2f640e131dfd6dd..90682f4599d3dd4842e18129781e949952e237ef 100644 (file)
 
 #include "msm_iomap-8960.h"
 
+#define MSM_DEBUG_UART_SIZE    SZ_4K
+#if defined(CONFIG_DEBUG_MSM_UART1)
+#define MSM_DEBUG_UART_BASE    0xE1000000
+#define MSM_DEBUG_UART_PHYS    MSM_UART1_PHYS
+#elif defined(CONFIG_DEBUG_MSM_UART2)
+#define MSM_DEBUG_UART_BASE    0xE1000000
+#define MSM_DEBUG_UART_PHYS    MSM_UART2_PHYS
+#elif defined(CONFIG_DEBUG_MSM_UART3)
+#define MSM_DEBUG_UART_BASE    0xE1000000
+#define MSM_DEBUG_UART_PHYS    MSM_UART3_PHYS
+#endif
+
 /* Virtual addresses shared across all MSM targets. */
 #define MSM_CSR_BASE           IOMEM(0xE0001000)
 #define MSM_QGIC_DIST_BASE     IOMEM(0xF0000000)
index d2e83f42ba1654f79f5953b1e65b0cbefc174785..311db2b35da0e025c4b808c381a1d2a4928035a5 100644 (file)
  * GNU General Public License for more details.
  *
  */
-
-#include <mach/hardware.h>
-
 void arch_idle(void);
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       for (;;) ;  /* depends on IPC w/ other core */
-}
-
 /* low level hardware reset hook -- for example, hitting the
  * PSHOLD line on the PMIC to hard reset the system
  */
index d94292c29d8e27ed6a736a8bb24b7d8f640d3dd0..169a8400745659171efcfcefa6a4e55b9dbef060 100644 (file)
@@ -1,6 +1,6 @@
-/* arch/arm/mach-msm/include/mach/uncompress.h
- *
+/*
  * Copyright (C) 2007 Google, Inc.
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
  */
 
 #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H
+#define __ASM_ARCH_MSM_UNCOMPRESS_H
+
+#include <asm/processor.h>
+#include <mach/msm_iomap.h>
+
+#define UART_CSR      (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08))
+#define UART_TF       (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x0c))
 
-#include "hardware.h"
-#include "linux/io.h"
-#include "mach/msm_iomap.h"
+#define UART_DM_SR    (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08)))
+#define UART_DM_CR    (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x10)))
+#define UART_DM_ISR   (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x14)))
+#define UART_DM_NCHAR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x40)))
+#define UART_DM_TF    (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x70)))
 
 static void putc(int c)
 {
 #if defined(MSM_DEBUG_UART_PHYS)
-       unsigned base = MSM_DEBUG_UART_PHYS;
-       while (!(readl(base + 0x08) & 0x04)) ;
-       writel(c, base + 0x0c);
+#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
+       /*
+        * Wait for TX_READY to be set; but skip it if we have a
+        * TX underrun.
+        */
+       if (UART_DM_SR & 0x08)
+               while (!(UART_DM_ISR & 0x80))
+                       cpu_relax();
+
+       UART_DM_CR = 0x300;
+       UART_DM_NCHAR = 0x1;
+       UART_DM_TF = c;
+#else
+       while (!(UART_CSR & 0x04))
+               cpu_relax();
+       UART_TF = c;
+#endif
 #endif
 }
 
diff --git a/arch/arm/mach-msm/include/mach/vmalloc.h b/arch/arm/mach-msm/include/mach/vmalloc.h
deleted file mode 100644 (file)
index d138448..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* arch/arm/mach-msm/include/mach/vmalloc.h
- *
- * Copyright (C) 2007 Google, Inc.
- *
- * 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.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_VMALLOC_H
-#define __ASM_ARCH_MSM_VMALLOC_H
-
-#define VMALLOC_END      0xd0000000UL
-
-#endif
-
index 8759ecf7454f367cead42922f8de900b24b45879..578b04e42deb8cbc1d29fa66b75fb20c3a21ff43 100644 (file)
@@ -47,7 +47,8 @@ static struct map_desc msm_io_desc[] __initdata = {
        MSM_CHIP_DEVICE(GPIO1, MSM7X00),
        MSM_CHIP_DEVICE(GPIO2, MSM7X00),
        MSM_DEVICE(CLK_CTL),
-#ifdef CONFIG_MSM_DEBUG_UART
+#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
+       defined(CONFIG_DEBUG_MSM_UART3)
        MSM_DEVICE(DEBUG_UART),
 #endif
 #ifdef CONFIG_ARCH_MSM7X30
@@ -84,7 +85,8 @@ static struct map_desc qsd8x50_io_desc[] __initdata = {
        MSM_DEVICE(SCPLL),
        MSM_DEVICE(AD5),
        MSM_DEVICE(MDC),
-#ifdef CONFIG_MSM_DEBUG_UART
+#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
+       defined(CONFIG_DEBUG_MSM_UART3)
        MSM_DEVICE(DEBUG_UART),
 #endif
        {
@@ -109,6 +111,9 @@ static struct map_desc msm8x60_io_desc[] __initdata = {
        MSM_CHIP_DEVICE(TMR0, MSM8X60),
        MSM_DEVICE(ACC),
        MSM_DEVICE(GCC),
+#ifdef CONFIG_DEBUG_MSM8660_UART
+       MSM_DEVICE(DEBUG_UART),
+#endif
 };
 
 void __init msm_map_msm8x60_io(void)
@@ -123,6 +128,9 @@ static struct map_desc msm8960_io_desc[] __initdata = {
        MSM_CHIP_DEVICE(QGIC_CPU, MSM8960),
        MSM_CHIP_DEVICE(TMR, MSM8960),
        MSM_CHIP_DEVICE(TMR0, MSM8960),
+#ifdef CONFIG_DEBUG_MSM8960_UART
+       MSM_DEVICE(DEBUG_UART),
+#endif
 };
 
 void __init msm_map_msm8960_io(void)
@@ -146,7 +154,8 @@ static struct map_desc msm7x30_io_desc[] __initdata = {
        MSM_DEVICE(SAW),
        MSM_DEVICE(GCC),
        MSM_DEVICE(TCSR),
-#ifdef CONFIG_MSM_DEBUG_UART
+#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
+       defined(CONFIG_DEBUG_MSM_UART3)
        MSM_DEVICE(DEBUG_UART),
 #endif
        {
index fdec58aaa35c27c9c4156246f35dae1ad259e955..0b3e357c4c8c8166e144a023a059336bddb660d7 100644 (file)
@@ -79,7 +79,7 @@ static __cpuinit void prepare_cold_cpu(unsigned int cpu)
        ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup),
                                SCM_FLAG_COLDBOOT_CPU1);
        if (ret == 0) {
-               void *sc1_base_ptr;
+               void __iomem *sc1_base_ptr;
                sc1_base_ptr = ioremap_nocache(0x00902000, SZ_4K*2);
                if (sc1_base_ptr) {
                        writel(0, sc1_base_ptr + VDD_SC1_ARRAY_CLAMP_GFS_CTL);
index afeeca52fc664d1c6c9a36928eb48ecc7d5afc2c..11d0d8f2656cb92b4af676db094d758b1591094f 100644 (file)
@@ -1,6 +1,7 @@
-/* linux/arch/arm/mach-msm/timer.c
+/*
  *
  * Copyright (C) 2007 Google, Inc.
+ * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
  *
  */
 
+#include <linux/clocksource.h>
+#include <linux/clockchips.h>
 #include <linux/init.h>
-#include <linux/time.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
-#include <linux/clk.h>
-#include <linux/clockchips.h>
-#include <linux/delay.h>
 #include <linux/io.h>
 
 #include <asm/mach/time.h>
 #include <asm/hardware/gic.h>
+#include <asm/localtimer.h>
 
 #include <mach/msm_iomap.h>
 #include <mach/cpu.h>
+#include <mach/board.h>
 
 #define TIMER_MATCH_VAL         0x0000
 #define TIMER_COUNT_VAL         0x0004
 #define TIMER_ENABLE            0x0008
-#define TIMER_ENABLE_CLR_ON_MATCH_EN    2
-#define TIMER_ENABLE_EN                 1
+#define TIMER_ENABLE_CLR_ON_MATCH_EN    BIT(1)
+#define TIMER_ENABLE_EN                 BIT(0)
 #define TIMER_CLEAR             0x000C
 #define DGT_CLK_CTL             0x0034
-enum {
-       DGT_CLK_CTL_DIV_1 = 0,
-       DGT_CLK_CTL_DIV_2 = 1,
-       DGT_CLK_CTL_DIV_3 = 2,
-       DGT_CLK_CTL_DIV_4 = 3,
-};
-#define CSR_PROTECTION          0x0020
-#define CSR_PROTECTION_EN               1
+#define DGT_CLK_CTL_DIV_4      0x3
 
 #define GPT_HZ 32768
 
-enum timer_location {
-       LOCAL_TIMER = 0,
-       GLOBAL_TIMER = 1,
-};
-
-#define MSM_GLOBAL_TIMER MSM_CLOCK_DGT
-
-/* TODO: Remove these ifdefs */
-#if defined(CONFIG_ARCH_QSD8X50)
-#define DGT_HZ (19200000 / 4) /* 19.2 MHz / 4 by default */
-#define MSM_DGT_SHIFT (0)
-#elif defined(CONFIG_ARCH_MSM7X30)
-#define DGT_HZ (24576000 / 4) /* 24.576 MHz (LPXO) / 4 by default */
-#define MSM_DGT_SHIFT (0)
-#elif defined(CONFIG_ARCH_MSM8X60) || defined(CONFIG_ARCH_MSM8960)
-#define DGT_HZ (27000000 / 4) /* 27 MHz (PXO) / 4 by default */
-#define MSM_DGT_SHIFT (0)
-#else
-#define DGT_HZ 19200000 /* 19.2 MHz or 600 KHz after shift */
-#define MSM_DGT_SHIFT (5)
-#endif
+#define MSM_DGT_SHIFT 5
 
-struct msm_clock {
-       struct clock_event_device   clockevent;
-       struct clocksource          clocksource;
-       unsigned int                irq;
-       void __iomem                *regbase;
-       uint32_t                    freq;
-       uint32_t                    shift;
-       void __iomem                *global_counter;
-       void __iomem                *local_counter;
-       union {
-               struct clock_event_device               *evt;
-               struct clock_event_device __percpu      **percpu_evt;
-       };              
-};
-
-enum {
-       MSM_CLOCK_GPT,
-       MSM_CLOCK_DGT,
-       NR_TIMERS,
-};
-
-
-static struct msm_clock msm_clocks[];
+static void __iomem *event_base;
 
 static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
 {
        struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
-       if (evt->event_handler == NULL)
-               return IRQ_HANDLED;
+       /* Stop the timer tick */
+       if (evt->mode == CLOCK_EVT_MODE_ONESHOT) {
+               u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
+               ctrl &= ~TIMER_ENABLE_EN;
+               writel_relaxed(ctrl, event_base + TIMER_ENABLE);
+       }
        evt->event_handler(evt);
        return IRQ_HANDLED;
 }
 
-static cycle_t msm_read_timer_count(struct clocksource *cs)
-{
-       struct msm_clock *clk = container_of(cs, struct msm_clock, clocksource);
-
-       /*
-        * Shift timer count down by a constant due to unreliable lower bits
-        * on some targets.
-        */
-       return readl(clk->global_counter) >> clk->shift;
-}
-
-static struct msm_clock *clockevent_to_clock(struct clock_event_device *evt)
-{
-#ifdef CONFIG_SMP
-       int i;
-       for (i = 0; i < NR_TIMERS; i++)
-               if (evt == &(msm_clocks[i].clockevent))
-                       return &msm_clocks[i];
-       return &msm_clocks[MSM_GLOBAL_TIMER];
-#else
-       return container_of(evt, struct msm_clock, clockevent);
-#endif
-}
-
 static int msm_timer_set_next_event(unsigned long cycles,
                                    struct clock_event_device *evt)
 {
-       struct msm_clock *clock = clockevent_to_clock(evt);
-       uint32_t now = readl(clock->local_counter);
-       uint32_t alarm = now + (cycles << clock->shift);
+       u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
 
-       writel(alarm, clock->regbase + TIMER_MATCH_VAL);
+       writel_relaxed(0, event_base + TIMER_CLEAR);
+       writel_relaxed(cycles, event_base + TIMER_MATCH_VAL);
+       writel_relaxed(ctrl | TIMER_ENABLE_EN, event_base + TIMER_ENABLE);
        return 0;
 }
 
 static void msm_timer_set_mode(enum clock_event_mode mode,
                              struct clock_event_device *evt)
 {
-       struct msm_clock *clock = clockevent_to_clock(evt);
+       u32 ctrl;
+
+       ctrl = readl_relaxed(event_base + TIMER_ENABLE);
+       ctrl &= ~(TIMER_ENABLE_EN | TIMER_ENABLE_CLR_ON_MATCH_EN);
 
        switch (mode) {
        case CLOCK_EVT_MODE_RESUME:
        case CLOCK_EVT_MODE_PERIODIC:
                break;
        case CLOCK_EVT_MODE_ONESHOT:
-               writel(TIMER_ENABLE_EN, clock->regbase + TIMER_ENABLE);
+               /* Timer is enabled in set_next_event */
                break;
        case CLOCK_EVT_MODE_UNUSED:
        case CLOCK_EVT_MODE_SHUTDOWN:
-               writel(0, clock->regbase + TIMER_ENABLE);
                break;
        }
+       writel_relaxed(ctrl, event_base + TIMER_ENABLE);
 }
 
-static struct msm_clock msm_clocks[] = {
-       [MSM_CLOCK_GPT] = {
-               .clockevent = {
-                       .name           = "gp_timer",
-                       .features       = CLOCK_EVT_FEAT_ONESHOT,
-                       .shift          = 32,
-                       .rating         = 200,
-                       .set_next_event = msm_timer_set_next_event,
-                       .set_mode       = msm_timer_set_mode,
-               },
-               .clocksource = {
-                       .name           = "gp_timer",
-                       .rating         = 200,
-                       .read           = msm_read_timer_count,
-                       .mask           = CLOCKSOURCE_MASK(32),
-                       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-               },
-               .irq = INT_GP_TIMER_EXP,
-               .freq = GPT_HZ,
-       },
-       [MSM_CLOCK_DGT] = {
-               .clockevent = {
-                       .name           = "dg_timer",
-                       .features       = CLOCK_EVT_FEAT_ONESHOT,
-                       .shift          = 32 + MSM_DGT_SHIFT,
-                       .rating         = 300,
-                       .set_next_event = msm_timer_set_next_event,
-                       .set_mode       = msm_timer_set_mode,
-               },
-               .clocksource = {
-                       .name           = "dg_timer",
-                       .rating         = 300,
-                       .read           = msm_read_timer_count,
-                       .mask           = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)),
-                       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-               },
-               .irq = INT_DEBUG_TIMER_EXP,
-               .freq = DGT_HZ >> MSM_DGT_SHIFT,
-               .shift = MSM_DGT_SHIFT,
-       }
+static struct clock_event_device msm_clockevent = {
+       .name           = "gp_timer",
+       .features       = CLOCK_EVT_FEAT_ONESHOT,
+       .rating         = 200,
+       .set_next_event = msm_timer_set_next_event,
+       .set_mode       = msm_timer_set_mode,
+};
+
+static union {
+       struct clock_event_device *evt;
+       struct clock_event_device __percpu **percpu_evt;
+} msm_evt;
+
+static void __iomem *source_base;
+
+static cycle_t msm_read_timer_count(struct clocksource *cs)
+{
+       return readl_relaxed(source_base + TIMER_COUNT_VAL);
+}
+
+static cycle_t msm_read_timer_count_shift(struct clocksource *cs)
+{
+       /*
+        * Shift timer count down by a constant due to unreliable lower bits
+        * on some targets.
+        */
+       return msm_read_timer_count(cs) >> MSM_DGT_SHIFT;
+}
+
+static struct clocksource msm_clocksource = {
+       .name   = "dg_timer",
+       .rating = 300,
+       .read   = msm_read_timer_count,
+       .mask   = CLOCKSOURCE_MASK(32),
+       .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
 static void __init msm_timer_init(void)
 {
-       int i;
+       struct clock_event_device *ce = &msm_clockevent;
+       struct clocksource *cs = &msm_clocksource;
        int res;
-       int global_offset = 0;
+       u32 dgt_hz;
 
        if (cpu_is_msm7x01()) {
-               msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE;
-               msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x10;
+               event_base = MSM_CSR_BASE;
+               source_base = MSM_CSR_BASE + 0x10;
+               dgt_hz = 19200000 >> MSM_DGT_SHIFT; /* 600 KHz */
+               cs->read = msm_read_timer_count_shift;
+               cs->mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT));
        } else if (cpu_is_msm7x30()) {
-               msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE + 0x04;
-               msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x24;
+               event_base = MSM_CSR_BASE + 0x04;
+               source_base = MSM_CSR_BASE + 0x24;
+               dgt_hz = 24576000 / 4;
        } else if (cpu_is_qsd8x50()) {
-               msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE;
-               msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x10;
+               event_base = MSM_CSR_BASE;
+               source_base = MSM_CSR_BASE + 0x10;
+               dgt_hz = 19200000 / 4;
        } else if (cpu_is_msm8x60() || cpu_is_msm8960()) {
-               msm_clocks[MSM_CLOCK_GPT].regbase = MSM_TMR_BASE + 0x04;
-               msm_clocks[MSM_CLOCK_DGT].regbase = MSM_TMR_BASE + 0x24;
-
-               /* Use CPU0's timer as the global timer. */
-               global_offset = MSM_TMR0_BASE - MSM_TMR_BASE;
+               event_base = MSM_TMR_BASE + 0x04;
+               /* Use CPU0's timer as the global clock source. */
+               source_base = MSM_TMR0_BASE + 0x24;
+               dgt_hz = 27000000 / 4;
+               writel_relaxed(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL);
        } else
                BUG();
 
-#ifdef CONFIG_ARCH_MSM_SCORPIONMP
-       writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL);
-#endif
-
-       for (i = 0; i < ARRAY_SIZE(msm_clocks); i++) {
-               struct msm_clock *clock = &msm_clocks[i];
-               struct clock_event_device *ce = &clock->clockevent;
-               struct clocksource *cs = &clock->clocksource;
-
-               clock->local_counter = clock->regbase + TIMER_COUNT_VAL;
-               clock->global_counter = clock->local_counter + global_offset;
-
-               writel(0, clock->regbase + TIMER_ENABLE);
-               writel(0, clock->regbase + TIMER_CLEAR);
-               writel(~0, clock->regbase + TIMER_MATCH_VAL);
-
-               ce->mult = div_sc(clock->freq, NSEC_PER_SEC, ce->shift);
-               /* allow at least 10 seconds to notice that the timer wrapped */
-               ce->max_delta_ns =
-                       clockevent_delta2ns(0xf0000000 >> clock->shift, ce);
-               /* 4 gets rounded down to 3 */
-               ce->min_delta_ns = clockevent_delta2ns(4, ce);
-               ce->cpumask = cpumask_of(0);
-
-               res = clocksource_register_hz(cs, clock->freq);
-               if (res)
-                       printk(KERN_ERR "msm_timer_init: clocksource_register "
-                              "failed for %s\n", cs->name);
-
-               ce->irq = clock->irq;
-               if (cpu_is_msm8x60() || cpu_is_msm8960()) {
-                       clock->percpu_evt = alloc_percpu(struct clock_event_device *);
-                       if (!clock->percpu_evt) {
-                               pr_err("msm_timer_init: memory allocation "
-                                      "failed for %s\n", ce->name);
-                               continue;
-                       }
-
-                       *__this_cpu_ptr(clock->percpu_evt) = ce;
-                       res = request_percpu_irq(ce->irq, msm_timer_interrupt,
-                                                ce->name, clock->percpu_evt);
-                       if (!res)
-                               enable_percpu_irq(ce->irq, 0);
-               } else {
-                       clock->evt = ce;
-                       res = request_irq(ce->irq, msm_timer_interrupt,
-                                         IRQF_TIMER | IRQF_NOBALANCING | IRQF_TRIGGER_RISING,
-                                         ce->name, &clock->evt);
+       writel_relaxed(0, event_base + TIMER_ENABLE);
+       writel_relaxed(0, event_base + TIMER_CLEAR);
+       writel_relaxed(~0, event_base + TIMER_MATCH_VAL);
+       ce->cpumask = cpumask_of(0);
+
+       ce->irq = INT_GP_TIMER_EXP;
+       clockevents_config_and_register(ce, GPT_HZ, 4, 0xffffffff);
+       if (cpu_is_msm8x60() || cpu_is_msm8960()) {
+               msm_evt.percpu_evt = alloc_percpu(struct clock_event_device *);
+               if (!msm_evt.percpu_evt) {
+                       pr_err("memory allocation failed for %s\n", ce->name);
+                       goto err;
                }
-
-               if (res)
-                       pr_err("msm_timer_init: request_irq failed for %s\n",
-                              ce->name);
-
-               clockevents_register_device(ce);
+               *__this_cpu_ptr(msm_evt.percpu_evt) = ce;
+               res = request_percpu_irq(ce->irq, msm_timer_interrupt,
+                                        ce->name, msm_evt.percpu_evt);
+               if (!res)
+                       enable_percpu_irq(ce->irq, 0);
+       } else {
+               msm_evt.evt = ce;
+               res = request_irq(ce->irq, msm_timer_interrupt,
+                                 IRQF_TIMER | IRQF_NOBALANCING |
+                                 IRQF_TRIGGER_RISING, ce->name, &msm_evt.evt);
        }
+
+       if (res)
+               pr_err("request_irq failed for %s\n", ce->name);
+err:
+       writel_relaxed(TIMER_ENABLE_EN, source_base + TIMER_ENABLE);
+       res = clocksource_register_hz(cs, dgt_hz);
+       if (res)
+               pr_err("clocksource_register failed\n");
 }
 
-#ifdef CONFIG_SMP
+#ifdef CONFIG_LOCAL_TIMERS
 int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
-       static bool local_timer_inited;
-       struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER];
-
        /* Use existing clock_event for cpu 0 */
        if (!smp_processor_id())
                return 0;
 
-       writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL);
-
-       if (!local_timer_inited) {
-               writel(0, clock->regbase  + TIMER_ENABLE);
-               writel(0, clock->regbase + TIMER_CLEAR);
-               writel(~0, clock->regbase + TIMER_MATCH_VAL);
-               local_timer_inited = true;
-       }
-       evt->irq = clock->irq;
+       writel_relaxed(0, event_base + TIMER_ENABLE);
+       writel_relaxed(0, event_base + TIMER_CLEAR);
+       writel_relaxed(~0, event_base + TIMER_MATCH_VAL);
+       evt->irq = msm_clockevent.irq;
        evt->name = "local_timer";
-       evt->features = CLOCK_EVT_FEAT_ONESHOT;
-       evt->rating = clock->clockevent.rating;
+       evt->features = msm_clockevent.features;
+       evt->rating = msm_clockevent.rating;
        evt->set_mode = msm_timer_set_mode;
        evt->set_next_event = msm_timer_set_next_event;
-       evt->shift = clock->clockevent.shift;
-       evt->mult = div_sc(clock->freq, NSEC_PER_SEC, evt->shift);
-       evt->max_delta_ns =
-               clockevent_delta2ns(0xf0000000 >> clock->shift, evt);
+       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(clock->percpu_evt) = evt;
-       enable_percpu_irq(evt->irq, 0);
-
+       *__this_cpu_ptr(msm_evt.percpu_evt) = evt;
        clockevents_register_device(evt);
+       enable_percpu_irq(evt->irq, 0);
        return 0;
 }
 
@@ -321,8 +223,7 @@ void local_timer_stop(struct clock_event_device *evt)
        evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
        disable_percpu_irq(evt->irq);
 }
-
-#endif
+#endif /* CONFIG_LOCAL_TIMERS */
 
 struct sys_timer msm_timer = {
        .init = msm_timer_init
index 0e94268d6e6f71895f3e965638bfd1975e4c9350..ee74ec97c141b8fd45e05936832cea12689e65e8 100644 (file)
@@ -151,4 +151,5 @@ MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
        .init_early     = mv78xx0_init_early,
        .init_irq       = mv78xx0_init_irq,
        .timer          = &mv78xx0_timer,
+       .restart        = mv78xx0_restart,
 MACHINE_END
index 23d3980ef59d561e8a4c9055170266dcb3b45faa..5b9632b011698ca944354f8e5dc0ff0621f6ebad 100644 (file)
@@ -401,3 +401,19 @@ void __init mv78xx0_init(void)
        feroceon_l2_init(is_l2_writethrough());
 #endif
 }
+
+void mv78xx0_restart(char mode, const char *cmd)
+{
+       /*
+        * Enable soft reset to assert RSTOUTn.
+        */
+       writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
+
+       /*
+        * Assert soft reset.
+        */
+       writel(SOFT_RESET, SYSTEM_SOFT_RESET);
+
+       while (1)
+               ;
+}
index 632e63d65e7a1f1e5d4c4ea7ae72c611e57a7d52..07d5f8f6be7dc6986aaa4f0deac25bf03a1e29dd 100644 (file)
@@ -46,6 +46,7 @@ void mv78xx0_uart1_init(void);
 void mv78xx0_uart2_init(void);
 void mv78xx0_uart3_init(void);
 void mv78xx0_i2c_init(void);
+void mv78xx0_restart(char, const char *);
 
 extern struct sys_timer mv78xx0_timer;
 
index 50b85ae2da5208f5d2e57034703617a32e1cfe61..4d6d48bf51ef4e4b71a324db873a30e60b5d2009 100644 (file)
@@ -99,4 +99,5 @@ MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
        .init_early     = mv78xx0_init_early,
        .init_irq       = mv78xx0_init_irq,
        .timer          = &mv78xx0_timer,
+       .restart        = mv78xx0_restart,
 MACHINE_END
index 66e7ce4e90bd260fd037930633e71db9a52a6b02..8c3a5387cec7644743c7789aea2fddda0bd6971c 100644 (file)
@@ -9,28 +9,9 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <mach/bridge-regs.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /*
-        * Enable soft reset to assert RSTOUTn.
-        */
-       writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
-
-       /*
-        * Assert soft reset.
-        */
-       writel(SOFT_RESET, SYSTEM_SOFT_RESET);
-
-       while (1)
-               ;
-}
-
-
 #endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h b/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
deleted file mode 100644 (file)
index ba26fe9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-mv78xx0/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END    0xfe000000UL
index e85222e535788c4b88e221ea5f748e03eb816587..9a882706e1387fbe998fec18c09bd9210892af1c 100644 (file)
@@ -84,4 +84,5 @@ MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
        .init_early     = mv78xx0_init_early,
        .init_irq       = mv78xx0_init_irq,
        .timer          = &mv78xx0_timer,
+       .restart        = mv78xx0_restart,
 MACHINE_END
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
deleted file mode 100644 (file)
index af0c212..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-if ARCH_MX5
-
-# ARCH_MX5/50/53 are left to mark places where prevent multi-soc in single
-# image. So for most time, SOC_IMX50/51/53 should be used.
-
-config ARCH_MX51
-       bool
-
-config ARCH_MX50
-       bool
-
-config ARCH_MX53
-       bool
-
-config SOC_IMX50
-       bool
-       select CPU_V7
-       select ARM_L1_CACHE_SHIFT_6
-       select MXC_TZIC
-       select ARCH_MXC_IOMUX_V3
-       select ARCH_MXC_AUDMUX_V2
-       select ARCH_HAS_CPUFREQ
-       select ARCH_MX50
-
-config SOC_IMX51
-       bool
-       select CPU_V7
-       select ARM_L1_CACHE_SHIFT_6
-       select MXC_TZIC
-       select ARCH_MXC_IOMUX_V3
-       select ARCH_MXC_AUDMUX_V2
-       select ARCH_HAS_CPUFREQ
-       select ARCH_MX51
-
-config SOC_IMX53
-       bool
-       select CPU_V7
-       select ARM_L1_CACHE_SHIFT_6
-       select MXC_TZIC
-       select ARCH_MXC_IOMUX_V3
-       select ARCH_MX53
-
-#comment "i.MX50 machines:"
-
-config MACH_MX50_RDP
-       bool "Support MX50 reference design platform"
-       depends on BROKEN
-       select SOC_IMX50
-       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
-       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 SOC_IMX51
-       select USE_OF
-       select MACH_MX51_BABBAGE
-       help
-         Include support for Freescale i.MX51 based platforms
-         using the device tree for discovery
-
-config MACH_MX51_BABBAGE
-       bool "Support MX51 BABBAGE platforms"
-       select SOC_IMX51
-       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_MXC_EHCI
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       help
-         Include support for MX51 Babbage platform, also known as MX51EVK in
-         u-boot. This includes specific configurations for the board and its
-         peripherals.
-
-config MACH_MX51_3DS
-       bool "Support MX51PDK (3DS)"
-       select SOC_IMX51
-       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
-       help
-         Include support for MX51PDK (3DS) platform. This includes specific
-         configurations for the board and its peripherals.
-
-config MACH_EUKREA_CPUIMX51
-       bool "Support Eukrea CPUIMX51 module"
-       select SOC_IMX51
-       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_MXC_EHCI
-       select IMX_HAVE_PLATFORM_MXC_NAND
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       help
-         Include support for Eukrea CPUIMX51 platform. This includes
-         specific configurations for the module and its peripherals.
-
-choice
-       prompt "Baseboard"
-       depends on MACH_EUKREA_CPUIMX51
-       default MACH_EUKREA_MBIMX51_BASEBOARD
-
-config MACH_EUKREA_MBIMX51_BASEBOARD
-       prompt "Eukrea MBIMX51 development board"
-       bool
-       select IMX_HAVE_PLATFORM_IMX_KEYPAD
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select LEDS_GPIO_REGISTER
-       help
-         This adds board specific devices that can be found on Eukrea's
-         MBIMX51 evaluation board.
-
-endchoice
-
-config MACH_EUKREA_CPUIMX51SD
-       bool "Support Eukrea CPUIMX51SD module"
-       select SOC_IMX51
-       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_MXC_EHCI
-       select IMX_HAVE_PLATFORM_MXC_NAND
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       help
-         Include support for Eukrea CPUIMX51SD platform. This includes
-         specific configurations for the module and its peripherals.
-
-choice
-       prompt "Baseboard"
-       depends on MACH_EUKREA_CPUIMX51SD
-       default MACH_EUKREA_MBIMXSD51_BASEBOARD
-
-config MACH_EUKREA_MBIMXSD51_BASEBOARD
-       prompt "Eukrea MBIMXSD development board"
-       bool
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select LEDS_GPIO_REGISTER
-       help
-         This adds board specific devices that can be found on Eukrea's
-         MBIMXSD evaluation board.
-
-endchoice
-
-config MX51_EFIKA_COMMON
-       bool
-       select SOC_IMX51
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_MXC_EHCI
-       select IMX_HAVE_PLATFORM_PATA_IMX
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select MXC_ULPI if USB_ULPI
-
-config MACH_MX51_EFIKAMX
-       bool "Support MX51 Genesi Efika MX nettop"
-       select LEDS_GPIO_REGISTER
-       select MX51_EFIKA_COMMON
-       help
-         Include support for Genesi Efika MX nettop. This includes specific
-         configurations for the board and its peripherals.
-
-config MACH_MX51_EFIKASB
-       bool "Support MX51 Genesi Efika Smartbook"
-       select LEDS_GPIO_REGISTER
-       select MX51_EFIKA_COMMON
-       help
-         Include support for Genesi Efika Smartbook. This includes specific
-         configurations for the board and its peripherals.
-
-comment "i.MX53 machines:"
-
-config MACH_IMX53_DT
-       bool "Support i.MX53 platforms from device tree"
-       select SOC_IMX53
-       select USE_OF
-       select MACH_MX53_ARD
-       select MACH_MX53_EVK
-       select MACH_MX53_LOCO
-       select MACH_MX53_SMD
-       help
-         Include support for Freescale i.MX53 based platforms
-         using the device tree for discovery
-
-config MACH_MX53_EVK
-       bool "Support MX53 EVK platforms"
-       select SOC_IMX53
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select LEDS_GPIO_REGISTER
-       help
-         Include support for MX53 EVK platform. This includes specific
-         configurations for the board and its peripherals.
-
-config MACH_MX53_SMD
-       bool "Support MX53 SMD platforms"
-       select SOC_IMX53
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       help
-         Include support for MX53 SMD platform. This includes specific
-         configurations for the board and its peripherals.
-
-config MACH_MX53_LOCO
-       bool "Support MX53 LOCO platforms"
-       select SOC_IMX53
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_GPIO_KEYS
-       select LEDS_GPIO_REGISTER
-       help
-         Include support for MX53 LOCO platform. This includes specific
-         configurations for the board and its peripherals.
-
-config MACH_MX53_ARD
-       bool "Support MX53 ARD platforms"
-       select SOC_IMX53
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_GPIO_KEYS
-       help
-         Include support for MX53 ARD platform. This includes specific
-         configurations for the board and its peripherals.
-
-endif
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
deleted file mode 100644 (file)
index 0fc6080..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Makefile for the linux kernel.
-#
-
-# Object file lists.
-obj-y   := cpu.o mm.o clock-mx51-mx53.o ehci.o system.o
-
-obj-$(CONFIG_PM) += pm-imx5.o
-obj-$(CONFIG_CPU_FREQ_IMX)    += cpu_op-mx51.o
-obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
-obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
-obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o
-obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o
-obj-$(CONFIG_MACH_MX53_LOCO) += board-mx53_loco.o
-obj-$(CONFIG_MACH_MX53_ARD) += board-mx53_ard.o
-obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
-obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
-obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
-obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o
-obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o
-obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o
-obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o
-obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o
-
-obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
-obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o
diff --git a/arch/arm/mach-mx5/Makefile.boot b/arch/arm/mach-mx5/Makefile.boot
deleted file mode 100644 (file)
index ca207ca..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-   zreladdr-$(CONFIG_ARCH_MX50)        += 0x70008000
-params_phys-$(CONFIG_ARCH_MX50)        := 0x70000100
-initrd_phys-$(CONFIG_ARCH_MX50)        := 0x70800000
-   zreladdr-$(CONFIG_ARCH_MX51)        += 0x90008000
-params_phys-$(CONFIG_ARCH_MX51)        := 0x90000100
-initrd_phys-$(CONFIG_ARCH_MX51)        := 0x90800000
-   zreladdr-$(CONFIG_ARCH_MX53)        += 0x70008000
-params_phys-$(CONFIG_ARCH_MX53)        := 0x70000100
-initrd_phys-$(CONFIG_ARCH_MX53)        := 0x70800000
diff --git a/arch/arm/mach-mx5/pm-imx5.c b/arch/arm/mach-mx5/pm-imx5.c
deleted file mode 100644 (file)
index 98052fc..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *  Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * 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/suspend.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/err.h>
-#include <asm/cacheflush.h>
-#include <asm/tlbflush.h>
-#include <mach/common.h>
-#include <mach/hardware.h>
-#include "crm_regs.h"
-
-static struct clk *gpc_dvfs_clk;
-
-static int mx5_suspend_prepare(void)
-{
-       return clk_enable(gpc_dvfs_clk);
-}
-
-static int mx5_suspend_enter(suspend_state_t state)
-{
-       switch (state) {
-       case PM_SUSPEND_MEM:
-               mx5_cpu_lp_set(STOP_POWER_OFF);
-               break;
-       case PM_SUSPEND_STANDBY:
-               mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       if (state == PM_SUSPEND_MEM) {
-               local_flush_tlb_all();
-               flush_cache_all();
-
-               /*clear the EMPGC0/1 bits */
-               __raw_writel(0, MXC_SRPG_EMPGC0_SRPGCR);
-               __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR);
-       }
-       cpu_do_idle();
-       return 0;
-}
-
-static void mx5_suspend_finish(void)
-{
-       clk_disable(gpc_dvfs_clk);
-}
-
-static int mx5_pm_valid(suspend_state_t state)
-{
-       return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
-}
-
-static const struct platform_suspend_ops mx5_suspend_ops = {
-       .valid = mx5_pm_valid,
-       .prepare = mx5_suspend_prepare,
-       .enter = mx5_suspend_enter,
-       .finish = mx5_suspend_finish,
-};
-
-static int __init mx5_pm_init(void)
-{
-       if (gpc_dvfs_clk == NULL)
-               gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
-
-       if (!IS_ERR(gpc_dvfs_clk)) {
-               if (cpu_is_mx51())
-                       suspend_set_ops(&mx5_suspend_ops);
-       } else
-               return -EPERM;
-
-       return 0;
-}
-device_initcall(mx5_pm_init);
index da6e4aad177c2097b12515b2ddd2572e8b397ea2..520066a7b1e3ab946737a32f15d7556f2bcace31 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/io.h>
 #include <linux/jiffies.h>
 #include <linux/clkdev.h>
+#include <linux/spinlock.h>
 
 #include <asm/clkdev.h>
 #include <asm/div64.h>
@@ -29,6 +30,7 @@
 #include <mach/mx28.h>
 #include <mach/common.h>
 #include <mach/clock.h>
+#include <mach/digctl.h>
 
 #include "regs-clkctrl-mx28.h"
 
@@ -43,6 +45,33 @@ static struct clk emi_clk;
 static struct clk saif0_clk;
 static struct clk saif1_clk;
 static struct clk clk32k_clk;
+static DEFINE_SPINLOCK(clkmux_lock);
+
+/*
+ * HW_SAIF_CLKMUX_SEL:
+ *  DIRECT(0x0): SAIF0 clock pins selected for SAIF0 input clocks, and SAIF1
+ *             clock pins selected for SAIF1 input clocks.
+ *  CROSSINPUT(0x1): SAIF1 clock inputs selected for SAIF0 input clocks, and
+ *             SAIF0 clock inputs selected for SAIF1 input clocks.
+ *  EXTMSTR0(0x2): SAIF0 clock pin selected for both SAIF0 and SAIF1 input
+ *             clocks.
+ *  EXTMSTR1(0x3): SAIF1 clock pin selected for both SAIF0 and SAIF1 input
+ *             clocks.
+ */
+int mxs_saif_clkmux_select(unsigned int clkmux)
+{
+       if (clkmux > 0x3)
+               return -EINVAL;
+
+       spin_lock(&clkmux_lock);
+       __raw_writel(BM_DIGCTL_CTRL_SAIF_CLKMUX,
+                       DIGCTRL_BASE_ADDR + HW_DIGCTL_CTRL + MXS_CLR_ADDR);
+       __raw_writel(clkmux << BP_DIGCTL_CTRL_SAIF_CLKMUX,
+                       DIGCTRL_BASE_ADDR + HW_DIGCTL_CTRL + MXS_SET_ADDR);
+       spin_unlock(&clkmux_lock);
+
+       return 0;
+}
 
 static int _raw_clk_enable(struct clk *clk)
 {
@@ -448,6 +477,10 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)            \
        reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs);         \
        reg &= ~BM_CLKCTRL_##rs##_DIV;                                  \
        reg |= div << BP_CLKCTRL_##rs##_DIV;                            \
+       if (reg & (1 << clk->enable_shift)) {                           \
+               pr_err("%s: clock is gated\n", __func__);               \
+               return -EINVAL;                                         \
+       }                                                               \
        __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs);         \
                                                                        \
        for (i = 10000; i; i--)                                         \
@@ -785,6 +818,15 @@ int __init mx28_clocks_init(void)
        clk_set_parent(&saif0_clk, &pll0_clk);
        clk_set_parent(&saif1_clk, &pll0_clk);
 
+       /*
+        * Set an initial clock rate for the saif internal logic to work
+        * properly. This is important when working in EXTMASTER mode that
+        * uses the other saif's BITCLK&LRCLK but it still needs a basic
+        * clock which should be fast enough for the internal logic.
+        */
+       clk_set_rate(&saif0_clk, 24000000);
+       clk_set_rate(&saif1_clk, 24000000);
+
        clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
        mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0);
index c8887103f0e32670b043d948d60f6b0fc915cecb..4f50094e293d35aa9cd28e980ae647e63c0beb8c 100644 (file)
@@ -47,6 +47,7 @@ struct platform_device *__init mx28_add_mxsfb(
                const struct mxsfb_platform_data *pdata);
 
 extern const struct mxs_saif_data mx28_saif_data[] __initconst;
-#define mx28_add_saif(id)              mxs_add_saif(&mx28_saif_data[id])
+#define mx28_add_saif(id, pdata) \
+       mxs_add_saif(&mx28_saif_data[id], pdata)
 
 struct platform_device *__init mx28_add_rtc_stmp3xxx(void);
index 1ec965e9fe92e6e14c98b3bbc4787966136dbfa4..f6e3a60b4201f1efc379a76c89e03e072cb81ac0 100644 (file)
@@ -32,7 +32,8 @@ const struct mxs_saif_data mx28_saif_data[] __initconst = {
 };
 #endif
 
-struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data)
+struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data,
+                               const struct mxs_saif_platform_data *pdata)
 {
        struct resource res[] = {
                {
@@ -56,5 +57,5 @@ struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data)
        };
 
        return mxs_add_platform_device("mxs-saif", data->id, res,
-                                       ARRAY_SIZE(res), NULL, 0);
+                               ARRAY_SIZE(res), pdata, sizeof(*pdata));
 }
index 635bb5d9a20ade988bfa61667b9513c985a47bb9..e1237ab25862416f52de15a7812485d97f6a5f6c 100644 (file)
@@ -16,6 +16,8 @@ struct clk;
 extern const u32 *mxs_get_ocotp(void);
 extern int mxs_reset_block(void __iomem *);
 extern void mxs_timer_init(struct clk *, int);
+extern void mxs_restart(char, const char *);
+extern int mxs_saif_clkmux_select(unsigned int clkmux);
 
 extern int mx23_register_gpios(void);
 extern int mx23_clocks_init(void);
index a8080f44c03d9310d74b26d2965dba0862f006f1..dc369c1239fc3eac5a1c7d27968a3bf5c27f3912 100644 (file)
@@ -94,6 +94,7 @@ struct platform_device *__init mxs_add_mxs_pwm(
                resource_size_t iobase, int id);
 
 /* saif */
+#include <sound/saif.h>
 struct mxs_saif_data {
        int id;
        resource_size_t iobase;
@@ -103,4 +104,5 @@ struct mxs_saif_data {
 };
 
 struct platform_device *__init mxs_add_saif(
-               const struct mxs_saif_data *data);
+               const struct mxs_saif_data *data,
+               const struct mxs_saif_platform_data *pdata);
diff --git a/arch/arm/mach-mxs/include/mach/digctl.h b/arch/arm/mach-mxs/include/mach/digctl.h
new file mode 100644 (file)
index 0000000..49a888c
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2011 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 version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __MACH_DIGCTL_H__
+#define __MACH_DIGCTL_H__
+
+/* MXS DIGCTL SAIF CLKMUX */
+#define MXS_DIGCTL_SAIF_CLKMUX_DIRECT          0x0
+#define MXS_DIGCTL_SAIF_CLKMUX_CROSSINPUT      0x1
+#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0                0x2
+#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR1                0x3
+
+#define HW_DIGCTL_CTRL                 0x0
+#define  BP_DIGCTL_CTRL_SAIF_CLKMUX    10
+#define  BM_DIGCTL_CTRL_SAIF_CLKMUX    (0x3 << 10)
+#endif
index 0e428239b4333c7d7f5bf7c00db380b5c604ab5b..e7ad1bb29423e7cfcadf4ceac8554b5308f438b8 100644 (file)
@@ -22,6 +22,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-void arch_reset(char mode, const char *cmd);
-
 #endif /* __MACH_MXS_SYSTEM_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/vmalloc.h b/arch/arm/mach-mxs/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 103b016..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *  Copyright (C) 2000 Russell King.
- *  Copyright 2004-2007 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.
- */
-
-#ifndef __MACH_MXS_VMALLOC_H__
-#define __MACH_MXS_VMALLOC_H__
-
-/* vmalloc ending address */
-#define VMALLOC_END       0xf4000000UL
-
-#endif /* __MACH_MXS_VMALLOC_H__ */
index 6b00577b70256254e29951bdf8828a2ecd613fdb..2f2758230edf83f4cd98ae5a80817dd2b6c4e0ad 100644 (file)
@@ -363,4 +363,5 @@ MACHINE_START(M28EVK, "DENX M28 EVK")
        .init_irq       = mx28_init_irq,
        .timer          = &m28evk_timer,
        .init_machine   = m28evk_init,
+       .restart        = mxs_restart,
 MACHINE_END
index c325fbe4e4c6aa4873afd4b38b30017041ea9c91..5ea1c57d2606dce6a7c94bc270a53b41ea4232ef 100644 (file)
@@ -184,4 +184,5 @@ MACHINE_START(MX23EVK, "Freescale MX23 EVK")
        .init_irq       = mx23_init_irq,
        .timer          = &mx23evk_timer,
        .init_machine   = mx23evk_init,
+       .restart        = mxs_restart,
 MACHINE_END
index 064ec5abaa557f7c6679bf4fe965c67f3fb6a022..eb0597be4e23ef5a17a2f68d612f58268e5f7824 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <mach/common.h>
 #include <mach/iomux-mx28.h>
+#include <mach/digctl.h>
 
 #include "devices-mx28.h"
 
@@ -421,6 +422,18 @@ static struct gpio mx28evk_lcd_gpios[] = {
        { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" },
 };
 
+static const struct mxs_saif_platform_data
+                       mx28evk_mxs_saif_pdata[] __initconst = {
+       /* working on EXTMSTR0 mode (saif0 master, saif1 slave) */
+       {
+               .master_mode = 1,
+               .master_id = 0,
+       }, {
+               .master_mode = 0,
+               .master_id = 0,
+       },
+};
+
 static void __init mx28evk_init(void)
 {
        int ret;
@@ -454,8 +467,9 @@ static void __init mx28evk_init(void)
        else
                mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
 
-       mx28_add_saif(0);
-       mx28_add_saif(1);
+       mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
+       mx28_add_saif(0, &mx28evk_mxs_saif_pdata[0]);
+       mx28_add_saif(1, &mx28evk_mxs_saif_pdata[1]);
 
        mx28_add_mxs_i2c(0);
        i2c_register_board_info(0, mxs_i2c0_board_info,
@@ -501,4 +515,5 @@ MACHINE_START(MX28EVK, "Freescale MX28 EVK")
        .init_irq       = mx28_init_irq,
        .timer          = &mx28evk_timer,
        .init_machine   = mx28evk_init,
+       .restart        = mxs_restart,
 MACHINE_END
index 6834dea38c04cce77e20bffc2baa3019327d9610..a626c07b8713c46235eac72e3a1ef3dda9abdd0e 100644 (file)
@@ -117,4 +117,5 @@ MACHINE_START(STMP378X, "STMP378X")
        .init_irq       = mx23_init_irq,
        .timer          = &stmp378x_dvb_timer,
        .init_machine   = stmp378x_dvb_init,
+       .restart        = mxs_restart,
 MACHINE_END
index 9a1f0e7a338eff1a5992b9e7db7ebc7a6ed3ea5b..2c0862e655ee9022f5a4b39276d9286c66f8047a 100644 (file)
@@ -178,4 +178,5 @@ MACHINE_START(TX28, "Ka-Ro electronics TX28 module")
        .init_irq = mx28_init_irq,
        .timer = &tx28_timer,
        .init_machine = tx28_stk5v3_init,
+       .restart        = mxs_restart,
 MACHINE_END
index 20ec3bddf7cde3581503c3182b74a0e83bf25257..b936633b7682c87d9a75ffd354cdd975c1e62517 100644 (file)
@@ -42,7 +42,7 @@ static void __iomem *mxs_clkctrl_reset_addr;
 /*
  * Reset the system. It is called by machine_restart().
  */
-void arch_reset(char mode, const char *cmd)
+void mxs_restart(char mode, const char *cmd)
 {
        /* reset the chip */
        __mxs_setl(MXS_CLKCTRL_RESET_CHIP, mxs_clkctrl_reset_addr);
@@ -53,7 +53,7 @@ void arch_reset(char mode, const char *cmd)
        mdelay(50);
 
        /* We'll take a jump through zero as a poor second */
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 static int __init mxs_arch_reset_init(void)
index 00023b5cf12b640f01291ba4f56b0e87941831cd..59e67979f197bb4908efc1e617911183cc6c5b3d 100644 (file)
@@ -187,3 +187,8 @@ static int __init netx_init(void)
 
 subsys_initcall(netx_init);
 
+void netx_restart(char mode, const char *cmd)
+{
+       writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
+              NETX_SYSTEM_RES_CR);
+}
index ede2d35341c325b4cace6b14ca0e77b8581ce64f..9b915119b8d6e7bb939baf0094d09689e2b2c048 100644 (file)
@@ -19,6 +19,7 @@
 
 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;
index 844f1f9acbdf09705f653563ed3a4052398d6a5e..6e9f1cbe163443156d707f3f0f32a6ba1e2c2d49 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <mach/hardware.h>
 
                .macro  disable_fiq
                .endm
 
-               .macro  get_irqnr_preamble, base, tmp
-               ldr     \base, =io_p2v(0x001ff000)
-               .endm
-
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \irqstat, [\base, #0]
-               clz     \irqnr, \irqstat
-               rsb     \irqnr, \irqnr, #31
-               cmp     \irqstat, #0
-               .endm
-
index dc7b4bc003c58182357ce5ce0aff477c82a0de63..b38fa36d58c417cbdcc36a1f36aa0a81b4264fc5 100644 (file)
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include "netx-regs.h"
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
-              NETX_SYSTEM_RES_CR);
-}
-
 #endif
 
index 90903dd44cbc1d2f5d38d0f04690dc4f225d2a22..180ea899a48afcf76586f24cf1a68cca5438f098 100644 (file)
@@ -28,6 +28,7 @@
 #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 <mach/eth.h>
 
@@ -203,6 +204,8 @@ 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_machine   = nxdb500_init,
+       .restart        = netx_restart,
 MACHINE_END
index c63384aba500a6bddd71afc2f4280a8bf993d180..58009e29b20e722d5f9759d148d3a26e1b3fbcc4 100644 (file)
@@ -28,6 +28,7 @@
 #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 <mach/eth.h>
 
@@ -96,6 +97,8 @@ 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_machine   = nxdkn_init,
+       .restart        = netx_restart,
 MACHINE_END
index 8f548ec83ad2de6a8443239de9a74f50089a60de..122e99826ef6fd0869a80f2935352c081a000ec1 100644 (file)
@@ -28,6 +28,7 @@
 #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 <mach/eth.h>
 
@@ -180,6 +181,8 @@ 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_machine   = nxeb500hmi_init,
+       .restart        = netx_restart,
 MACHINE_END
index 0cbb74c96ef7603631121ef9b965dd3d929d453d..7c878bf0034094fbbc8e31a933f9d091b4ae95f0 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/mtd/onenand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/io.h>
+#include <asm/hardware/vic.h>
 #include <asm/sizes.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -34,6 +35,8 @@
 #include <mach/nand.h>
 #include <mach/fsmc.h>
 
+#include "cpu-8815.h"
+
 /* Initial value for SRC control register: all timers use MXTAL/8 source */
 #define SRC_CR_INIT_MASK       0x00007fff
 #define SRC_CR_INIT_VAL                0x2aaa8000
@@ -280,6 +283,8 @@ 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_machine   = nhk8815_platform_init,
+       .restart        = cpu8815_restart,
 MACHINE_END
index dc67717db6f078db7975adc873bf6efe2a64eaef..65df7b4fdd3ede7326d3ef0b747e642a269fe99e 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/device.h>
 #include <linux/amba/bus.h>
 #include <linux/platform_device.h>
+#include <linux/io.h>
 
 #include <plat/gpio-nomadik.h>
 #include <mach/hardware.h>
@@ -32,6 +33,7 @@
 #include <asm/hardware/cache-l2x0.h>
 
 #include "clock.h"
+#include "cpu-8815.h"
 
 #define __MEM_4K_RESOURCE(x) \
        .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
@@ -164,3 +166,13 @@ void __init cpu8815_init_irq(void)
 #endif
         return;
 }
+
+void cpu8815_restart(char mode, const char *cmd)
+{
+       void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
+
+       /* FIXME: use egpio when implemented */
+
+       /* Write anything to Reset status register */
+       writel(1, src_rstsr);
+}
diff --git a/arch/arm/mach-nomadik/cpu-8815.h b/arch/arm/mach-nomadik/cpu-8815.h
new file mode 100644 (file)
index 0000000..71c21e8
--- /dev/null
@@ -0,0 +1,4 @@
+extern void cpu8815_map_io(void);
+extern void cpu8815_platform_init(void);
+extern void cpu8815_init_irq(void);
+extern void cpu8815_restart(char, const char *);
index 49f1aa3bb42016fb2c0521a7002889a718b8188b..98ea1c1fbbab15165cfe0e704f7255d0ada61179 100644 (file)
@@ -6,38 +6,8 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <mach/hardware.h>
-#include <mach/irqs.h>
-
        .macro  disable_fiq
        .endm
 
-       .macro  get_irqnr_preamble, base, tmp
-       ldr     \base, =IO_ADDRESS(NOMADIK_IC_BASE)
-       .endm
-
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-
-       /* This stanza gets the irq mask from one of two status registers */
-       mov     \irqnr, #0
-       ldr     \irqstat, [\base, #VIC_REG_IRQSR0]      @ get masked status
-       cmp     \irqstat, #0
-       bne     1001f
-       add     \irqnr, \irqnr, #32
-       ldr     \irqstat, [\base, #VIC_REG_IRQSR1]      @ get masked status
-
-1001:  tst     \irqstat, #15
-       bne     1002f
-       add     \irqnr, \irqnr, #4
-       movs    \irqstat, \irqstat, lsr #4
-       bne     1001b
-1002:  tst     \irqstat, #1
-       bne     1003f
-       add     \irqnr, \irqnr, #1
-       movs    \irqstat, \irqstat, lsr #1
-       bne     1002b
-1003:  /* EQ will be set if no irqs pending */
-       .endm
index b7897edf1f3577cac64769b6a31f8d869dd6bcaf..bcaeaf41c053d7c16a42edf5f045ec29f20d7e8a 100644 (file)
@@ -12,9 +12,6 @@
 
 #ifdef CONFIG_NOMADIK_8815
 
-extern void cpu8815_map_io(void);
-extern void cpu8815_platform_init(void);
-extern void cpu8815_init_irq(void);
 extern void nmdk_timer_init(void);
 
 #endif /* NOMADIK_8815 */
index 7119f688116eecfc51dbcbf2fbcbe47a4324b6a3..25e198b8976cd874a03a74cbbac811400eddd428 100644 (file)
@@ -20,9 +20,6 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <linux/io.h>
-#include <mach/hardware.h>
-
 static inline void arch_idle(void)
 {
        /*
@@ -32,14 +29,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
-
-       /* FIXME: use egpio when implemented */
-
-       /* Write anything to Reset status register */
-       writel(1, src_rstsr);
-}
-
 #endif
diff --git a/arch/arm/mach-nomadik/include/mach/vmalloc.h b/arch/arm/mach-nomadik/include/mach/vmalloc.h
deleted file mode 100644 (file)
index f83d574..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#define VMALLOC_END       0xe8000000UL
index 73f287d6429b629d57f7c093645962ce48cee318..4f8d66f044e7b90ef64fc40e27441f063ac1afa9 100644 (file)
@@ -168,70 +168,6 @@ config MACH_OMAP_GENERIC
           custom OMAP boards. Say Y here if you have a custom
           board.
 
-comment "OMAP CPU Speed"
-       depends on ARCH_OMAP1
-
-config OMAP_ARM_216MHZ
-       bool "OMAP ARM 216 MHz CPU (1710 only)"
-        depends on ARCH_OMAP1 && ARCH_OMAP16XX
-        help
-          Enable 216 MHz clock for OMAP1710 CPU. If unsure, say N.
-
-config OMAP_ARM_195MHZ
-       bool "OMAP ARM 195 MHz CPU"
-       depends on ARCH_OMAP1 && (ARCH_OMAP730 || ARCH_OMAP850)
-       help
-          Enable 195MHz clock for OMAP CPU. If unsure, say N.
-
-config OMAP_ARM_192MHZ
-       bool "OMAP ARM 192 MHz CPU"
-       depends on ARCH_OMAP1 && ARCH_OMAP16XX
-       help
-          Enable 192MHz clock for OMAP CPU. If unsure, say N.
-
-config OMAP_ARM_182MHZ
-       bool "OMAP ARM 182 MHz CPU"
-       depends on ARCH_OMAP1 && (ARCH_OMAP730 || ARCH_OMAP850)
-       help
-          Enable 182MHz clock for OMAP CPU. If unsure, say N.
-
-config OMAP_ARM_168MHZ
-       bool "OMAP ARM 168 MHz CPU"
-       depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
-       help
-          Enable 168MHz clock for OMAP CPU. If unsure, say N.
-
-config OMAP_ARM_150MHZ
-       bool "OMAP ARM 150 MHz CPU"
-       depends on ARCH_OMAP1 && ARCH_OMAP15XX
-       help
-         Enable 150MHz clock for OMAP CPU. If unsure, say N.
-
-config OMAP_ARM_120MHZ
-       bool "OMAP ARM 120 MHz CPU"
-       depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
-       help
-          Enable 120MHz clock for OMAP CPU. If unsure, say N.
-
-config OMAP_ARM_96MHZ
-       bool "OMAP ARM 96 MHz CPU"
-       depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
-       help
-          Enable 96MHz clock for OMAP CPU. If unsure, say N.
-
-config OMAP_ARM_60MHZ
-       bool "OMAP ARM 60 MHz CPU"
-       depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
-        default y
-       help
-          Enable 60MHz clock for OMAP CPU. If unsure, say Y.
-
-config OMAP_ARM_30MHZ
-       bool "OMAP ARM 30 MHz CPU"
-       depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
-       help
-          Enable 30MHz clock for OMAP CPU. If unsure, say N.
-
 endmenu
 
 endif
index b0f15d234a12b4ad9dd1beb34da7df187e3f86b4..88909cc0b25407eada87f91b651525fa35cf30fe 100644 (file)
@@ -35,7 +35,7 @@
 #include <plat/mux.h>
 #include <plat/usb.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <mach/camera.h>
 
 #include <mach/ams-delta-fiq.h>
@@ -386,6 +386,7 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
        .init_irq       = omap1_init_irq,
        .init_machine   = ams_delta_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
 
 EXPORT_SYMBOL(ams_delta_latch1_write);
index 23178275f96ba3a9c1878298edf26852b4ac8e41..0b9464b4121286c930b2f1c6af835386cdc306f4 100644 (file)
@@ -32,7 +32,7 @@
 #include <plat/flash.h>
 #include <plat/fpga.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/board.h>
 
 /* fsample is pretty close to p2-sample */
@@ -390,4 +390,5 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_fsample_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index dc5b75de531c5a3ddcf46d7aa699aafec6664623..9a5fe581bc1c8c0e22264edbe5b8dd17b9215780 100644 (file)
@@ -25,7 +25,7 @@
 #include <plat/mux.h>
 #include <plat/usb.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 
 /* assume no Mini-AB port */
 
@@ -89,4 +89,5 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index b334b1481678caf49019eee094f002d123e1eb8e..00ad6b22d60a287e488295859b7995a5af87a4b1 100644 (file)
@@ -43,7 +43,7 @@
 #include <plat/irda.h>
 #include <plat/usb.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/flash.h>
 
 #include "board-h2.h"
@@ -456,4 +456,5 @@ MACHINE_START(OMAP_H2, "TI-H2")
        .init_irq       = omap1_init_irq,
        .init_machine   = h2_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 74ebe72c984849d912001966d3eec5132750312d..4a7f25149703a6cdd9384d376fa792f6eadfd094 100644 (file)
@@ -45,7 +45,7 @@
 #include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/dma.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/flash.h>
 
 #include "board-h3.h"
@@ -444,4 +444,5 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
        .init_irq       = omap1_init_irq,
        .init_machine   = h3_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 3e91baab1a89de784651bea3dfd2da8b7cb63459..731cc3db7ab377c1ee556d63fb37e5039ad3f20d 100644 (file)
@@ -41,7 +41,7 @@
 #include <asm/mach/arch.h>
 
 #include <plat/omap7xx.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/board.h>
 #include <plat/keypad.h>
 #include <plat/usb.h>
@@ -610,4 +610,5 @@ MACHINE_START(HERALD, "HTC Herald")
        .init_irq       = omap1_init_irq,
        .init_machine   = htcherald_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 273153dba15b6946f751bc702a4a7586729fa771..309369ea6978e59367e7e884875706b52f85478d 100644 (file)
@@ -37,7 +37,7 @@
 #include <plat/tc.h>
 #include <plat/usb.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/mmc.h>
 
 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
@@ -460,4 +460,5 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
        .init_irq       = omap1_init_irq,
        .init_machine   = innovator_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 6798b8488315258921d91eea30814db401576ad8..f9efc036ba96d3cfbbe669e397aa5dfb5be7eeb3 100644 (file)
@@ -30,7 +30,7 @@
 #include <plat/usb.h>
 #include <plat/board.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/hwa742.h>
 #include <plat/lcd_mipid.h>
 #include <plat/mmc.h>
@@ -259,4 +259,5 @@ MACHINE_START(NOKIA770, "Nokia 770")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_nokia770_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index c3859278d2576ca3d4ffa135ce3aac225c83a867..675de06557aab60bb8c16345d9ada9dcc32d720a 100644 (file)
@@ -51,7 +51,7 @@
 #include <plat/usb.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
-#include <plat/common.h>
+#include "common.h"
 
 /* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
 #define OMAP_OSK_ETHR_START            0x04800300
@@ -578,4 +578,5 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
        .init_irq       = omap1_init_irq,
        .init_machine   = osk_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index f9c44cb15b47bb0bf9f3aa5bcee114cdc65b3925..81fa27f88369e00f05601c2d44c696e34b4ddeef 100644 (file)
@@ -41,7 +41,7 @@
 #include <plat/board.h>
 #include <plat/irda.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 
 #define PALMTE_USBDETECT_GPIO  0
 #define PALMTE_USB_OR_DC_GPIO  1
@@ -270,4 +270,5 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmte_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 11a98539f7bbc2d55b6a1102b9a442abf2e0a623..81cb82178388ed63743baf8470af756f1978a1cd 100644 (file)
@@ -39,7 +39,7 @@
 #include <plat/board.h>
 #include <plat/irda.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
@@ -317,4 +317,5 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmtt_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 42061573e3803b449a314d1c0ccc0553371f854b..e881945ce8ec7a043db554c0470302f64a8378a0 100644 (file)
@@ -41,7 +41,7 @@
 #include <plat/board.h>
 #include <plat/irda.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
@@ -334,4 +334,5 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmz71_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 203ae07550db5c2d30060e88ef3098531f50aba0..c000bed7627633135bf0e2d5b39450e56b41ab51 100644 (file)
@@ -32,7 +32,7 @@
 #include <plat/fpga.h>
 #include <plat/flash.h>
 #include <plat/keypad.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/board.h>
 
 static const unsigned int p2_keymap[] = {
@@ -352,4 +352,5 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_perseus2_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 092a4c04640757f4d8d7c92f464c20d17f068938..7bcd82ab0fd0a655d9b216b8770e1cb8b49bb836 100644 (file)
@@ -40,7 +40,7 @@
 #include <plat/usb.h>
 #include <plat/tc.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/keypad.h>
 #include <plat/board-sx1.h>
 
@@ -416,4 +416,5 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_sx1_init,
        .timer          = &omap1_timer,
+       .restart        = omap1_restart,
 MACHINE_END
index 61ed6cdab2bdb9adbe9af4b8104f2508b902e84d..f83a502dc93c7a45866ccbbc9c30c9c82afb9130 100644 (file)
 #include <linux/export.h>
 
 #include <mach/hardware.h>
-#include <mach/system.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
 #include <plat/board-voiceblue.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
@@ -221,7 +220,7 @@ void voiceblue_wdt_ping(void)
        gpio_set_value(0, wdt_gpio_state);
 }
 
-static void voiceblue_reset(char mode, const char *cmd)
+static void voiceblue_restart(char mode, const char *cmd)
 {
        /*
         * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
@@ -285,8 +284,6 @@ static void __init voiceblue_init(void)
         * (it is connected through invertor) */
        omap_writeb(0x00, OMAP_LPG1_LCR);
        omap_writeb(0x00, OMAP_LPG1_PMR);       /* Disable clock */
-
-       arch_reset = voiceblue_reset;
 }
 
 MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
@@ -298,4 +295,5 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
        .init_irq       = omap1_init_irq,
        .init_machine   = voiceblue_init,
        .timer          = &omap1_timer,
+       .restart        = voiceblue_restart,
 MACHINE_END
index 84ef70476b511e1005b75f7e80b633ef3a66c7fd..0c50df05d13559c059526341c2decbe274011f6a 100644 (file)
@@ -197,11 +197,10 @@ int omap1_select_table_rate(struct clk *clk, unsigned long rate)
        ref_rate = ck_ref_p->rate;
 
        for (ptr = omap1_rate_table; ptr->rate; ptr++) {
-               if (ptr->xtal != ref_rate)
+               if (!(ptr->flags & cpu_mask))
                        continue;
 
-               /* DPLL1 cannot be reprogrammed without risking system crash */
-               if (likely(dpll1_rate != 0) && ptr->pll_rate != dpll1_rate)
+               if (ptr->xtal != ref_rate)
                        continue;
 
                /* Can check only after xtal frequency check */
@@ -215,12 +214,8 @@ int omap1_select_table_rate(struct clk *clk, unsigned long rate)
        /*
         * In most cases we should not need to reprogram DPLL.
         * Reprogramming the DPLL is tricky, it must be done from SRAM.
-        * (on 730, bit 13 must always be 1)
         */
-       if (cpu_is_omap7xx())
-               omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000);
-       else
-               omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
+       omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
 
        /* XXX Do we need to recalculate the tree below DPLL1 at this point? */
        ck_dpll1_p->rate = ptr->pll_rate;
@@ -290,6 +285,9 @@ long omap1_round_to_table_rate(struct clk *clk, unsigned long rate)
        highest_rate = -EINVAL;
 
        for (ptr = omap1_rate_table; ptr->rate; ptr++) {
+               if (!(ptr->flags & cpu_mask))
+                       continue;
+
                if (ptr->xtal != ref_rate)
                        continue;
 
index 16b1423b454a32dea7197460a393b12a4bd4e2b0..3d04f4f67676280a591f7bbcfb003c426fdba2dc 100644 (file)
@@ -111,4 +111,7 @@ extern const struct clkops clkops_dummy;
 extern const struct clkops clkops_uart_16xx;
 extern const struct clkops clkops_generic;
 
+/* used for passing SoC type to omap1_{select,round_to}_table_rate() */
+extern u32 cpu_mask;
+
 #endif
index 9ff90a744a2140a0bf5168403301ac9cec68b927..94699a82a7342a68140b7bb834e0de6a038101b7 100644 (file)
@@ -25,6 +25,7 @@
 #include <plat/clock.h>
 #include <plat/cpu.h>
 #include <plat/clkdev_omap.h>
+#include <plat/sram.h> /* for omap_sram_reprogram_clock() */
 #include <plat/usb.h>   /* for OTG_BASE */
 
 #include "clock.h"
@@ -778,12 +779,14 @@ static void __init omap1_show_rates(void)
                arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
 }
 
+u32 cpu_mask;
+
 int __init omap1_clk_init(void)
 {
        struct omap_clk *c;
        const struct omap_clock_config *info;
        int crystal_type = 0; /* Default 12 MHz */
-       u32 reg, cpu_mask;
+       u32 reg;
 
 #ifdef CONFIG_DEBUG_LL
        /*
@@ -808,6 +811,8 @@ int __init omap1_clk_init(void)
                clk_preinit(c->lk.clk);
 
        cpu_mask = 0;
+       if (cpu_is_omap1710())
+               cpu_mask |= CK_1710;
        if (cpu_is_omap16xx())
                cpu_mask |= CK_16XX;
        if (cpu_is_omap1510())
@@ -931,17 +936,13 @@ void __init omap1_clk_late_init(void)
 {
        unsigned long rate = ck_dpll1.rate;
 
-       if (rate >= OMAP1_DPLL1_SANE_VALUE)
-               return;
-
-       /* System booting at unusable rate, force reprogramming of DPLL1 */
-       ck_dpll1_p->rate = 0;
-
        /* Find the highest supported frequency and enable it */
        if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
                pr_err("System frequencies not set, using default. Check your config.\n");
-               omap_writew(0x2290, DPLL_CTL);
-               omap_writew(cpu_is_omap7xx() ? 0x2005 : 0x0005, ARM_CKCTL);
+               /*
+                * Reprogramming the DPLL is tricky, it must be done from SRAM.
+                */
+               omap_sram_reprogram_clock(0x2290, 0x0005);
                ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE;
        }
        propagate_rate(&ck_dpll1);
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
new file mode 100644 (file)
index 0000000..a9a5146
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ *
+ * Header for code common to all OMAP1 machines.
+ *
+ * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * 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.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP1_COMMON_H
+#define __ARCH_ARM_MACH_OMAP1_COMMON_H
+
+#include <plat/common.h>
+
+#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
+void omap7xx_map_io(void);
+#else
+static inline void omap7xx_map_io(void)
+{
+}
+#endif
+
+#ifdef CONFIG_ARCH_OMAP15XX
+void omap15xx_map_io(void);
+#else
+static inline void omap15xx_map_io(void)
+{
+}
+#endif
+
+#ifdef CONFIG_ARCH_OMAP16XX
+void omap16xx_map_io(void);
+#else
+static inline void omap16xx_map_io(void)
+{
+}
+#endif
+
+void omap1_init_early(void);
+void omap1_init_irq(void);
+void omap1_restart(char, const char *);
+
+extern struct sys_timer omap1_timer;
+extern bool omap_32k_timer_init(void);
+
+#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
index 475cb2f50d872f326325991b76d0c5348aa5cfd2..1d76a63c098362742773ac89298c1a8cf0980e6f 100644 (file)
@@ -22,7 +22,7 @@
 #include <mach/hardware.h>
 #include <asm/mach/map.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/tc.h>
 #include <plat/board.h>
 #include <plat/mux.h>
diff --git a/arch/arm/mach-omap1/include/mach/vmalloc.h b/arch/arm/mach-omap1/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 22ec4a4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  arch/arm/mach-omap1/include/mach/vmalloc.h
- *
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-#define VMALLOC_END    0xd8000000UL
index 7969cfda4454eca89bfdd350145fdc644b39e099..8e55b6fb3478becc4c18a02dc976451fcf4adb1e 100644 (file)
@@ -121,7 +121,6 @@ void __init omap16xx_map_io(void)
 void omap1_init_early(void)
 {
        omap_check_revision();
-       omap_ioremap_init();
 
        /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
         * on a Posted Write in the TIPB Bridge".
index 07074d79adcea5aae223d890d0f5e4239e696041..79a683864a5cea2c3c35086c87cb6b547aa08263 100644 (file)
@@ -21,6 +21,7 @@ struct mpu_rate {
        unsigned long           pll_rate;
        __u16                   ckctl_val;
        __u16                   dpllctl_val;
+       u32                     flags;
 };
 
 extern struct mpu_rate omap1_rate_table[];
index 75a5465149947aeeba33adbfdec804d595d2256c..9cd4ddb51397dc56fecc26c7384b0564836eaf0d 100644 (file)
@@ -10,6 +10,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <plat/clkdev_omap.h>
 #include "opp.h"
 
 /*-------------------------------------------------------------------------
@@ -20,40 +21,34 @@ struct mpu_rate omap1_rate_table[] = {
         * NOTE: Comment order here is different from bits in CKCTL value:
         * armdiv, dspdiv, dspmmu, tcdiv, perdiv, lcddiv
         */
-#if defined(CONFIG_OMAP_ARM_216MHZ)
-       { 216000000, 12000000, 216000000, 0x050d, 0x2910 }, /* 1/1/2/2/2/8 */
-#endif
-#if defined(CONFIG_OMAP_ARM_195MHZ)
-       { 195000000, 13000000, 195000000, 0x050e, 0x2790 }, /* 1/1/2/2/4/8 */
-#endif
-#if defined(CONFIG_OMAP_ARM_192MHZ)
-       { 192000000, 19200000, 192000000, 0x050f, 0x2510 }, /* 1/1/2/2/8/8 */
-       { 192000000, 12000000, 192000000, 0x050f, 0x2810 }, /* 1/1/2/2/8/8 */
-       {  96000000, 12000000, 192000000, 0x055f, 0x2810 }, /* 2/2/2/2/8/8 */
-       {  48000000, 12000000, 192000000, 0x0baf, 0x2810 }, /* 4/4/4/8/8/8 */
-       {  24000000, 12000000, 192000000, 0x0fff, 0x2810 }, /* 8/8/8/8/8/8 */
-#endif
-#if defined(CONFIG_OMAP_ARM_182MHZ)
-       { 182000000, 13000000, 182000000, 0x050e, 0x2710 }, /* 1/1/2/2/4/8 */
-#endif
-#if defined(CONFIG_OMAP_ARM_168MHZ)
-       { 168000000, 12000000, 168000000, 0x010f, 0x2710 }, /* 1/1/1/2/8/8 */
-#endif
-#if defined(CONFIG_OMAP_ARM_150MHZ)
-       { 150000000, 12000000, 150000000, 0x010a, 0x2cb0 }, /* 1/1/1/2/4/4 */
-#endif
-#if defined(CONFIG_OMAP_ARM_120MHZ)
-       { 120000000, 12000000, 120000000, 0x010a, 0x2510 }, /* 1/1/1/2/4/4 */
-#endif
-#if defined(CONFIG_OMAP_ARM_96MHZ)
-       {  96000000, 12000000,  96000000, 0x0005, 0x2410 }, /* 1/1/1/1/2/2 */
-#endif
-#if defined(CONFIG_OMAP_ARM_60MHZ)
-       {  60000000, 12000000,  60000000, 0x0005, 0x2290 }, /* 1/1/1/1/2/2 */
-#endif
-#if defined(CONFIG_OMAP_ARM_30MHZ)
-       {  30000000, 12000000,  60000000, 0x0555, 0x2290 }, /* 2/2/2/2/2/2 */
-#endif
+       { 216000000, 12000000, 216000000, 0x050d, 0x2910, /* 1/1/2/2/2/8 */
+                       CK_1710 },
+       { 195000000, 13000000, 195000000, 0x050e, 0x2790, /* 1/1/2/2/4/8 */
+                       CK_7XX },
+       { 192000000, 19200000, 192000000, 0x050f, 0x2510, /* 1/1/2/2/8/8 */
+                       CK_16XX },
+       { 192000000, 12000000, 192000000, 0x050f, 0x2810, /* 1/1/2/2/8/8 */
+                       CK_16XX },
+       {  96000000, 12000000, 192000000, 0x055f, 0x2810, /* 2/2/2/2/8/8 */
+                       CK_16XX },
+       {  48000000, 12000000, 192000000, 0x0baf, 0x2810, /* 4/4/4/8/8/8 */
+                       CK_16XX },
+       {  24000000, 12000000, 192000000, 0x0fff, 0x2810, /* 8/8/8/8/8/8 */
+                       CK_16XX },
+       { 182000000, 13000000, 182000000, 0x050e, 0x2710, /* 1/1/2/2/4/8 */
+                       CK_7XX },
+       { 168000000, 12000000, 168000000, 0x010f, 0x2710, /* 1/1/1/2/8/8 */
+                       CK_16XX|CK_7XX },
+       { 150000000, 12000000, 150000000, 0x010a, 0x2cb0, /* 1/1/1/2/4/4 */
+                       CK_1510 },
+       { 120000000, 12000000, 120000000, 0x010a, 0x2510, /* 1/1/1/2/4/4 */
+                       CK_16XX|CK_1510|CK_310|CK_7XX },
+       {  96000000, 12000000,  96000000, 0x0005, 0x2410, /* 1/1/1/1/2/2 */
+                       CK_16XX|CK_1510|CK_310|CK_7XX },
+       {  60000000, 12000000,  60000000, 0x0005, 0x2290, /* 1/1/1/1/2/2 */
+                       CK_16XX|CK_1510|CK_310|CK_7XX },
+       {  30000000, 12000000,  60000000, 0x0555, 0x2290, /* 2/2/2/2/2/2 */
+                       CK_16XX|CK_1510|CK_310|CK_7XX },
        { 0, 0, 0, 0, 0 },
 };
 
index ad951ee692058d69c517f1df84fe2ba4a999086f..91d199b6497935acf85192494b6d2c116e43b694 100644 (file)
@@ -5,10 +5,9 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
-#include <mach/system.h>
 #include <plat/prcm.h>
 
-void omap1_arch_reset(char mode, const char *cmd)
+void omap1_restart(char mode, const char *cmd)
 {
        /*
         * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
@@ -21,5 +20,3 @@ void omap1_arch_reset(char mode, const char *cmd)
 
        omap_writew(1, ARM_RSTCT1);
 }
-
-void (*arch_reset)(char, const char *) = omap1_arch_reset;
index a1837771e031bdd3836e054bf549f85af21a1640..485a21d31004b5b86874293283067749fcd9336f 100644 (file)
@@ -54,7 +54,7 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #ifdef CONFIG_OMAP_MPU_TIMER
 
index 96604a50c4fe54302f29c3b9872a7ff265bb0797..9a54ef4dcf5e638fb4777b24e09285501a8a7064 100644 (file)
@@ -52,7 +52,7 @@
 #include <asm/irq.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/dmtimer.h>
 
 /*
index e1293aa513d338fe19ffd7990b189109b7ca0787..50f43942c1aa8f5091b16c8a11669505f0aed1a8 100644 (file)
@@ -25,6 +25,7 @@ config ARCH_OMAP2
        depends on ARCH_OMAP2PLUS
        default y
        select CPU_V6
+       select MULTI_IRQ_HANDLER
 
 config ARCH_OMAP3
        bool "TI OMAP3"
@@ -36,6 +37,7 @@ config ARCH_OMAP3
        select ARCH_HAS_OPP
        select PM_OPP if PM
        select ARM_CPU_SUSPEND if PM
+       select MULTI_IRQ_HANDLER
 
 config ARCH_OMAP4
        bool "TI OMAP4"
@@ -351,6 +353,27 @@ config OMAP3_SDRC_AC_TIMING
          wish to say no.  Selecting yes without understanding what is
          going on could result in system crashes;
 
+config OMAP4_ERRATA_I688
+       bool "OMAP4 errata: Async Bridge Corruption"
+       depends on ARCH_OMAP4
+       select ARCH_HAS_BARRIERS
+       help
+         If a data is stalled inside asynchronous bridge because of back
+         pressure, it may be accepted multiple times, creating pointer
+         misalignment that will corrupt next transfers on that data path
+         until next reset of the system (No recovery procedure once the
+         issue is hit, the path remains consistently broken). Async bridge
+         can be found on path between MPU to EMIF and MPU to L3 interconnect.
+         This situation can happen only when the idle is initiated by a
+         Master Request Disconnection (which is trigged by software when
+         executing WFI on CPU).
+         The work-around for this errata needs all the initiators connected
+         through async bridge must ensure that data path is properly drained
+         before issuing WFI. This condition will be met if one Strongly ordered
+         access is performed to the target right before executing the WFI.
+         In MPU case, L3 T2ASYNC FIFO and DDR T2ASYNC FIFO needs to be drained.
+         IO barrier ensure that there is no synchronisation loss on initiators
+         operating on both interconnect port simultaneously.
 endmenu
 
 endif
index b009f17dee5606de2acbb1b7ba25c8938d0c5adb..9a6da52661cef50db22ff1aa2c0db5667bf02631 100644 (file)
@@ -11,10 +11,11 @@ hwmod-common                                = omap_hwmod.o \
                                          omap_hwmod_common_data.o
 clock-common                           = clock.o clock_common_data.o \
                                          clkt_dpll.o clkt_clksel.o
+secure-common                          = omap-smc.o omap-secure.o
 
-obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
-obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common)
-obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
+obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
+obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 
@@ -24,11 +25,13 @@ obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
 obj-$(CONFIG_SMP)                      += omap-smp.o omap-headsmp.o
 obj-$(CONFIG_LOCAL_TIMERS)             += timer-mpu.o
 obj-$(CONFIG_HOTPLUG_CPU)              += omap-hotplug.o
-obj-$(CONFIG_ARCH_OMAP4)               += omap44xx-smc.o omap4-common.o
+obj-$(CONFIG_ARCH_OMAP4)               += omap4-common.o omap-wakeupgen.o \
+                                          sleep44xx.o
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_omap-headsmp.o                  :=-Wa,-march=armv7-a$(plus_sec)
-AFLAGS_omap44xx-smc.o                  :=-Wa,-march=armv7-a$(plus_sec)
+AFLAGS_omap-smc.o                      :=-Wa,-march=armv7-a$(plus_sec)
+AFLAGS_sleep44xx.o                     :=-Wa,-march=armv7-a$(plus_sec)
 
 # Functions loaded to SRAM
 obj-$(CONFIG_SOC_OMAP2420)             += sram242x.o
@@ -62,7 +65,8 @@ obj-$(CONFIG_ARCH_OMAP2)              += pm24xx.o
 obj-$(CONFIG_ARCH_OMAP2)               += sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)               += pm34xx.o sleep34xx.o \
                                           cpuidle34xx.o
-obj-$(CONFIG_ARCH_OMAP4)               += pm44xx.o
+obj-$(CONFIG_ARCH_OMAP4)               += pm44xx.o omap-mpuss-lowpower.o \
+                                          cpuidle44xx.o
 obj-$(CONFIG_PM_DEBUG)                 += pm-debug.o
 obj-$(CONFIG_OMAP_SMARTREFLEX)          += sr_device.o smartreflex.o
 obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3)  += smartreflex-class3.o
index d704f0ac328dabaf3601bd00917374017a307122..7370983f809fc3994a8722970f2c6f7f1a85f08e 100644 (file)
@@ -34,7 +34,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc.h>
 #include <plat/usb.h>
 #include <plat/gpmc-smc91x.h>
@@ -301,6 +301,8 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
        .map_io         = omap243x_map_io,
        .init_early     = omap2430_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_2430sdp_init,
        .timer          = &omap2_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 77142c13fa13621edb91c49301f2b88fba8293d3..9996334cb6879f2fe6b7b770608a7db7cde8375f 100644 (file)
@@ -33,7 +33,7 @@
 #include <plat/mcspi.h>
 #include <plat/board.h>
 #include <plat/usb.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/dma.h>
 #include <plat/gpmc.h>
 #include <video/omapdss.h>
@@ -728,6 +728,8 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
        .map_io         = omap3_map_io,
        .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_3430sdp_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index f552305162fc59f87ecd93d2b26bec5da1f75846..6ef350d1ae4f40a89a8b1bc54c6858780db1b2a8 100644 (file)
@@ -16,7 +16,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/board.h>
 #include <plat/gpmc-smc91x.h>
 #include <plat/usb.h>
@@ -215,6 +215,8 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
        .map_io         = omap3_map_io,
        .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_sdp_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 515646886b590cc7cad81cbef4048efc609bb7b9..bad5d5a5ef7949fafdeb06ce4a2e95d686eeb29c 100644 (file)
 #include <linux/leds_pwm.h>
 
 #include <mach/hardware.h>
-#include <mach/omap4-common.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/usb.h>
 #include <plat/mmc.h>
 #include <plat/omap4-keypad.h>
@@ -984,6 +984,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,
        .timer          = &omap4_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 7834536ab41666ca2b2ff720a068023f3a48f765..c3851e8de28bf78d94f4be19baa0ca869915cd95 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/usb.h>
 
 #include "mux.h"
@@ -98,6 +98,8 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
        .map_io         = omap3_map_io,
        .init_early     = am35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = am3517_crane_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index d314f033c9dfd7b21e5f8f94d24b44418a19e3da..f5a3a3f117394e0c713b9deff1419f9f02fba415 100644 (file)
@@ -32,7 +32,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/usb.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
@@ -491,6 +491,8 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
        .map_io         = omap3_map_io,
        .init_early     = am35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = am3517_evm_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index de8134b7f5805458cbcc3dc14753d93b15cc5b68..ac773829941f487493f4ce0592dfa787592211a9 100644 (file)
@@ -37,7 +37,7 @@
 #include <plat/led.h>
 #include <plat/usb.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc.h>
 
 #include <video/omapdss.h>
@@ -354,6 +354,8 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
        .map_io         = omap242x_map_io,
        .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_apollon_init,
        .timer          = &omap2_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index bd1bcacb40f96b5c946f12096b4a0953de544bee..1545102d1f9b2b5a8471785aadfe463f84185d30 100644 (file)
@@ -37,7 +37,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/nand.h>
 #include <plat/gpmc.h>
 #include <plat/usb.h>
@@ -634,8 +634,10 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t35_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 
 MACHINE_START(CM_T3730, "Compulab CM-T3730")
@@ -644,6 +646,8 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730")
        .map_io         = omap3_map_io,
        .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t3730_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 3f4dc6626845db9069a7193823de24025a93864c..f36d694d21590e069aa390a66eb56024d113d8f7 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/usb.h>
 #include <plat/nand.h>
 #include <plat/gpmc.h>
@@ -299,6 +299,8 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
        .map_io         = omap3_map_io,
        .init_early     = am35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t3517_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 90154e411da0f27c2850fa4075ba44255bda7eb4..e873063f4fdaf4cac7fffe5d18ca718a79cb84fe 100644 (file)
@@ -41,7 +41,7 @@
 #include <asm/mach/flash.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc.h>
 #include <plat/nand.h>
 #include <plat/usb.h>
@@ -660,6 +660,8 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = devkit8000_init,
        .timer          = &omap3_secure_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index fb55fa3dad5ae6d94cd76b4085b08f12aa07da2e..f8c5b2cc7c9c228c14847b16ca3d9f98eaa35426 100644 (file)
@@ -20,8 +20,7 @@
 #include <asm/mach/arch.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
-#include <mach/omap4-common.h>
+#include "common.h"
 #include "common-board-devices.h"
 
 /*
@@ -107,6 +106,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
        .init_machine   = omap_generic_init,
        .timer          = &omap2_timer,
        .dt_compat      = omap242x_boards_compat,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 #endif
 
@@ -122,9 +122,11 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
        .map_io         = omap243x_map_io,
        .init_early     = omap2430_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap2_timer,
        .dt_compat      = omap243x_boards_compat,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 #endif
 
@@ -143,6 +145,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
        .init_machine   = omap3_init,
        .timer          = &omap3_timer,
        .dt_compat      = omap3_boards_compat,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 #endif
 
@@ -161,5 +164,6 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
        .init_machine   = omap4_init,
        .timer          = &omap4_timer,
        .dt_compat      = omap4_boards_compat,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 #endif
index 8b351d92a1cce289cf1af4eba51577b788f5b602..54af800d143c0e261b4acd6548103c6b3c08634f 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <plat/usb.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/menelaus.h>
 #include <plat/dma.h>
 #include <plat/gpmc.h>
@@ -396,6 +396,8 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
        .map_io         = omap242x_map_io,
        .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_h4_init,
        .timer          = &omap2_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index d0a3f78a9b694c2ffe6ad5a1507215c5ef909cee..a59ace0ed560a57cdf1009cd15d596b94d71c76d 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/mach/arch.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc.h>
 #include <plat/usb.h>
 #include <video/omapdss.h>
@@ -672,8 +672,10 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = igep_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 
 MACHINE_START(IGEP0030, "IGEP OMAP3 module")
@@ -682,6 +684,8 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = igep_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index e179da0c4da53821003f3205717eaa8cc2d96787..2d2a61f7dcbf8e3d799fee8054a39011d94ab603 100644 (file)
@@ -36,7 +36,7 @@
 
 #include <plat/mcspi.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc.h>
 #include <mach/board-zoom.h>
 
@@ -434,6 +434,8 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
        .map_io         = omap3_map_io,
        .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_ldp_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index e9d5f4a3d0642dd0b553da23987136e9864e3d70..cef2cf1c0b8d9affe9afdedcaa16376b1caab783 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/mach-types.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/menelaus.h>
 #include <mach/irqs.h>
 #include <plat/mcspi.h>
@@ -689,8 +689,10 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
        .map_io         = omap242x_map_io,
        .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap2_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 
 MACHINE_START(NOKIA_N810, "Nokia N810")
@@ -699,8 +701,10 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
        .map_io         = omap242x_map_io,
        .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap2_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 
 MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
@@ -709,6 +713,8 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
        .map_io         = omap242x_map_io,
        .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap2_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 4a71cb7e42d4b02517d30be11a0151b93ef1e18f..7ffcd2839e7ba872d872e0a53476b2e95832c2a2 100644 (file)
@@ -40,7 +40,7 @@
 #include <asm/mach/flash.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <video/omapdss.h>
 #include <video/omap-panel-dvi.h>
 #include <plat/gpmc.h>
@@ -559,6 +559,8 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
        .map_io         = omap3_map_io,
        .init_early     = omap3_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_beagle_init,
        .timer          = &omap3_secure_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index ec00b2ec70227ffa164fc928c5bc403d05c52f32..003fe34c934311251452ba4af1efc20382dbbdb6 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <plat/board.h>
 #include <plat/usb.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/mcspi.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-dvi.h>
@@ -681,6 +681,8 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_evm_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 7c0f193f246dd58e5bc008cfb939c610b73ed65c..4198dd017d8fdfde7fd00b2a8a00d5f9d7e766fb 100644 (file)
@@ -40,7 +40,7 @@
 
 #include <plat/mux.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc-smsc911x.h>
 #include <plat/gpmc.h>
 #include <plat/sdrc.h>
@@ -208,8 +208,10 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3logic_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 
 MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
@@ -217,6 +219,8 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3logic_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index f7811f4cfc3dbe4a059222a4dfdef4eaaaf3e233..1644b73017fcafbdc0e7b87a503ac35f92e8f992 100644 (file)
@@ -41,7 +41,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <mach/hardware.h>
 #include <plat/mcspi.h>
 #include <plat/usb.h>
@@ -606,6 +606,8 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3pandora_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index ddb7d6663c6d160869a70bce7a1c7949ae4cc8f3..cb089a46f62f691cceec4c20f9f035111dded5a3 100644 (file)
@@ -35,7 +35,7 @@
 #include <asm/mach/flash.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc.h>
 #include <plat/nand.h>
 #include <plat/usb.h>
@@ -454,6 +454,8 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
        .map_io                 = omap3_map_io,
        .init_early             = omap35xx_init_early,
        .init_irq               = omap3_init_irq,
+       .handle_irq             = omap3_intc_handle_irq,
        .init_machine           = omap3_stalker_init,
        .timer                  = &omap3_secure_timer,
+       .restart                = omap_prcm_restart,
 MACHINE_END
index a2d0d1971e27a7850457aad684ed7c92bbc704de..a0b851aafccad1bc87d900d9474cfa689e8cf39d 100644 (file)
@@ -44,7 +44,7 @@
 #include <asm/mach/flash.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/gpmc.h>
 #include <plat/nand.h>
 #include <plat/usb.h>
@@ -381,6 +381,8 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
        .map_io         = omap3_map_io,
        .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_touchbook_init,
        .timer          = &omap3_secure_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index a8c2c4263e387c6b1b418191a1bd78ed0f847a37..8b06c6a60d02767819f4cdb833f72f3f6471c580 100644 (file)
 #include <linux/wl12xx.h>
 
 #include <mach/hardware.h>
-#include <mach/omap4-common.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <video/omapdss.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/usb.h>
 #include <plat/mmc.h>
 #include <video/omap-panel-dvi.h>
@@ -577,6 +577,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,
        .timer          = &omap4_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 4cf7aeabab8652303e93b935d5332c41cc0350e8..52c0cef77165cb2cbc8a658d8fd63b260ec5662a 100644 (file)
@@ -43,7 +43,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
 #include <video/omap-panel-dvi.h>
@@ -562,6 +562,8 @@ MACHINE_START(OVERO, "Gumstix Overo")
        .map_io         = omap3_map_io,
        .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = overo_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 616fb39763b0f4b82d9885a7057a0c0a6bdc6cde..8678b386c6a2ab8e7a0b664546f837eb9966d36f 100644 (file)
@@ -25,7 +25,7 @@
 #include <plat/mmc.h>
 #include <plat/usb.h>
 #include <plat/gpmc.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/onenand.h>
 
 #include "mux.h"
@@ -149,6 +149,8 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
        .map_io         = omap3_map_io,
        .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = rm680_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index ba1aa07bdb29d325841b74da3117e76e60e5b668..bd18d691c6ad9e9558703feff60c02b82b237a73 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <plat/mcspi.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/dma.h>
 #include <plat/gpmc.h>
 #include <plat/onenand.h>
index 4af7c4b2881ae19793d29c4c68ad65f50330210d..27f01f051dfff07135762b216621eabbc6bf1046 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <plat/mcspi.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/dma.h>
 #include <plat/gpmc.h>
 #include <plat/usb.h>
@@ -127,6 +127,8 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
        .map_io         = omap3_map_io,
        .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = rx51_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index e6ee8842285c00f9915e85f6b9b4d02ed00fb601..74713e3993e5f4b8d43bc3d20adf84a88d1944b8 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <plat/irqs.h>
 #include <plat/board.h>
-#include <plat/common.h>
+#include "common.h"
 
 static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
 };
@@ -48,4 +48,5 @@ MACHINE_START(TI8168EVM, "ti8168evm")
        .init_irq       = ti816x_init_irq,
        .timer          = &omap3_timer,
        .init_machine   = ti8168_evm_init,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 6d0aa4fcb7c37fed33337732b41ab35fda62f22d..8d7ce11cfeaf14b34d18c5ac4945a855b51f0d2d 100644 (file)
@@ -24,7 +24,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/usb.h>
 
 #include <mach/board-zoom.h>
index be6684dc4f55d6a0c33ada72fc5f15f25b807f60..5c20bcc57f2b951d50fe2bef11080b36e9729a36 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/board.h>
 #include <plat/usb.h>
 
@@ -135,8 +135,10 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
        .map_io         = omap3_map_io,
        .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_zoom_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
 
 MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
@@ -145,6 +147,8 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
        .map_io         = omap3_map_io,
        .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_zoom_init,
        .timer          = &omap3_timer,
+       .restart        = omap_prcm_restart,
 MACHINE_END
index 38830d8d47835d30db060b77c49d4beb385ded4a..04d39cdd211204325856727b45b234d5edc0cdd1 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "cm.h"
 #include "cm2xxx_3xxx.h"
index e96f53ea01a119853f95e5d8035027d818d0ad65..6a836303252cb62aef1ced08fb3edcb0bcbe75ee 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "cm.h"
 #include "cm1_44xx.h"
index eb2a472bbf466416fceee1962152bab518242fa6..6204deaf85b1f06daba9d0b9db758cf31cdb1fb3 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "cm.h"
 #include "cm1_44xx.h"
index 110e5b9db1455083a780096b272770a516654806..684b8a7cd401adcd034b7ab23a4f7852680eff34 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/board.h>
 #include <plat/mux.h>
 
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
new file mode 100644 (file)
index 0000000..0279f7a
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * Header for code common to all OMAP2+ machines.
+ *
+ * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * 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.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H
+#define __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H
+#ifndef __ASSEMBLER__
+
+#include <linux/delay.h>
+#include <plat/common.h>
+#include <asm/proc-fns.h>
+
+#ifdef CONFIG_SOC_OMAP2420
+extern void omap242x_map_common_io(void);
+#else
+static inline void omap242x_map_common_io(void)
+{
+}
+#endif
+
+#ifdef CONFIG_SOC_OMAP2430
+extern void omap243x_map_common_io(void);
+#else
+static inline void omap243x_map_common_io(void)
+{
+}
+#endif
+
+#ifdef CONFIG_ARCH_OMAP3
+extern void omap34xx_map_common_io(void);
+#else
+static inline void omap34xx_map_common_io(void)
+{
+}
+#endif
+
+#ifdef CONFIG_SOC_OMAPTI816X
+extern void omapti816x_map_common_io(void);
+#else
+static inline void omapti816x_map_common_io(void)
+{
+}
+#endif
+
+#ifdef CONFIG_ARCH_OMAP4
+extern void omap44xx_map_common_io(void);
+#else
+static inline void omap44xx_map_common_io(void)
+{
+}
+#endif
+
+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 omap4_timer;
+
+void omap2420_init_early(void);
+void omap2430_init_early(void);
+void omap3430_init_early(void);
+void omap35xx_init_early(void);
+void omap3630_init_early(void);
+void omap3_init_early(void);   /* Do not use this one */
+void am35xx_init_early(void);
+void ti816x_init_early(void);
+void omap4430_init_early(void);
+void omap_prcm_restart(char, const char *);
+
+/*
+ * IO bases for various OMAP processors
+ * Except the tap base, rest all the io bases
+ * listed are physical addresses.
+ */
+struct omap_globals {
+       u32             class;          /* OMAP class to detect */
+       void __iomem    *tap;           /* Control module ID code */
+       void __iomem    *sdrc;           /* SDRAM Controller */
+       void __iomem    *sms;            /* SDRAM Memory Scheduler */
+       void __iomem    *ctrl;           /* System Control Module */
+       void __iomem    *ctrl_pad;      /* PAD Control Module */
+       void __iomem    *prm;            /* Power and Reset Management */
+       void __iomem    *cm;             /* Clock Management */
+       void __iomem    *cm2;
+};
+
+void omap2_set_globals_242x(void);
+void omap2_set_globals_243x(void);
+void omap2_set_globals_3xxx(void);
+void omap2_set_globals_443x(void);
+void omap2_set_globals_ti816x(void);
+
+/* These get called from omap2_set_globals_xxxx(), do not call these */
+void omap2_set_globals_tap(struct omap_globals *);
+void omap2_set_globals_sdrc(struct omap_globals *);
+void omap2_set_globals_control(struct omap_globals *);
+void omap2_set_globals_prcm(struct omap_globals *);
+
+void omap242x_map_io(void);
+void omap243x_map_io(void);
+void omap3_map_io(void);
+void omap4_map_io(void);
+
+/**
+ * omap_test_timeout - busy-loop, testing a condition
+ * @cond: condition to test until it evaluates to true
+ * @timeout: maximum number of microseconds in the timeout
+ * @index: loop index (integer)
+ *
+ * Loop waiting for @cond to become true or until at least @timeout
+ * microseconds have passed.  To use, define some integer @index in the
+ * calling code.  After running, if @index == @timeout, then the loop has
+ * timed out.
+ */
+#define omap_test_timeout(cond, timeout, index)                        \
+({                                                             \
+       for (index = 0; index < timeout; index++) {             \
+               if (cond)                                       \
+                       break;                                  \
+               udelay(1);                                      \
+       }                                                       \
+})
+
+extern struct device *omap2_get_mpuss_device(void);
+extern struct device *omap2_get_iva_device(void);
+extern struct device *omap2_get_l3_device(void);
+extern struct device *omap4_get_dsp_device(void);
+
+void omap2_init_irq(void);
+void omap3_init_irq(void);
+void ti816x_init_irq(void);
+extern int omap_irq_pending(void);
+void omap_intc_save_context(void);
+void omap_intc_restore_context(void);
+void omap3_intc_suspend(void);
+void omap3_intc_prepare_idle(void);
+void omap3_intc_resume_idle(void);
+void omap2_intc_handle_irq(struct pt_regs *regs);
+void omap3_intc_handle_irq(struct pt_regs *regs);
+
+#ifdef CONFIG_CACHE_L2X0
+extern void __iomem *omap4_get_l2cache_base(void);
+#endif
+
+#ifdef CONFIG_SMP
+extern void __iomem *omap4_get_scu_base(void);
+#else
+static inline void __iomem *omap4_get_scu_base(void)
+{
+       return NULL;
+}
+#endif
+
+extern void __init gic_init_irq(void);
+extern void omap_smc1(u32 fn, u32 arg);
+extern void __iomem *omap4_get_sar_ram_base(void);
+extern void omap_do_wfi(void);
+
+#ifdef CONFIG_SMP
+/* Needed for secondary core boot */
+extern void omap_secondary_startup(void);
+extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
+extern void omap_auxcoreboot_addr(u32 cpu_addr);
+extern u32 omap_read_auxcoreboot0(void);
+#endif
+
+#if defined(CONFIG_SMP) && defined(CONFIG_PM)
+extern int omap4_mpuss_init(void);
+extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);
+extern int omap4_finish_suspend(unsigned long cpu_state);
+extern void omap4_cpu_resume(void);
+extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);
+extern u32 omap4_mpuss_read_prev_context_state(void);
+#else
+static inline int omap4_enter_lowpower(unsigned int cpu,
+                                       unsigned int power_state)
+{
+       cpu_do_idle();
+       return 0;
+}
+
+static inline int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
+{
+       cpu_do_idle();
+       return 0;
+}
+
+static inline int omap4_mpuss_init(void)
+{
+       return 0;
+}
+
+static inline int omap4_finish_suspend(unsigned long cpu_state)
+{
+       return 0;
+}
+
+static inline void omap4_cpu_resume(void)
+{}
+
+static inline u32 omap4_mpuss_read_prev_context_state(void)
+{
+       return 0;
+}
+#endif
+#endif /* __ASSEMBLER__ */
+#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
index e34d27f8c49c6f47d7c3c23e03990c2419970d05..114c037e433c77f33673c39c599dd3d32190187e 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/sdrc.h>
 
 #include "cm-regbits-34xx.h"
index 942bb4f19f9fd6df5af92b1b551cb1a3f3bb2313..1f71ebb6c12cc649a7243d07780ddb962bb20ae7 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/sched.h>
 #include <linux/cpuidle.h>
 #include <linux/export.h>
+#include <linux/cpu_pm.h>
 
 #include <plat/prcm.h>
 #include <plat/irqs.h>
@@ -34,6 +35,7 @@
 
 #include "pm.h"
 #include "control.h"
+#include "common.h"
 
 #ifdef CONFIG_CPU_IDLE
 
@@ -123,9 +125,23 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
                pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
        }
 
+       /*
+        * Call idle CPU PM enter notifier chain so that
+        * VFP context is saved.
+        */
+       if (mpu_state == PWRDM_POWER_OFF)
+               cpu_pm_enter();
+
        /* Execute ARM wfi */
        omap_sram_idle();
 
+       /*
+        * Call idle CPU PM enter notifier chain to restore
+        * VFP context.
+        */
+       if (pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
+               cpu_pm_exit();
+
        /* Re-allow idle for C1 */
        if (index == 0) {
                pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
new file mode 100644 (file)
index 0000000..cfdbb86
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+ * OMAP4 CPU idle Routines
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ * Santosh Shilimkar <santosh.shilimkar@ti.com>
+ * Rajendra Nayak <rnayak@ti.com>
+ *
+ * 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/sched.h>
+#include <linux/cpuidle.h>
+#include <linux/cpu_pm.h>
+#include <linux/export.h>
+#include <linux/clockchips.h>
+
+#include <asm/proc-fns.h>
+
+#include "common.h"
+#include "pm.h"
+#include "prm.h"
+
+#ifdef CONFIG_CPU_IDLE
+
+/* Machine specific information to be recorded in the C-state driver_data */
+struct omap4_idle_statedata {
+       u32 cpu_state;
+       u32 mpu_logic_state;
+       u32 mpu_state;
+       u8 valid;
+};
+
+static struct cpuidle_params cpuidle_params_table[] = {
+       /* C1 - CPU0 ON + CPU1 ON + MPU ON */
+       {.exit_latency = 2 + 2 , .target_residency = 5, .valid = 1},
+       /* C2- CPU0 OFF + CPU1 OFF + MPU CSWR */
+       {.exit_latency = 328 + 440 , .target_residency = 960, .valid = 1},
+       /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
+       {.exit_latency = 460 + 518 , .target_residency = 1100, .valid = 1},
+};
+
+#define OMAP4_NUM_STATES ARRAY_SIZE(cpuidle_params_table)
+
+struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
+static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd;
+
+/**
+ * omap4_enter_idle - Programs OMAP4 to enter the specified state
+ * @dev: cpuidle device
+ * @drv: cpuidle driver
+ * @index: the index of state to be entered
+ *
+ * Called from the CPUidle framework to program the device to the
+ * specified low power state selected by the governor.
+ * Returns the amount of time spent in the low power state.
+ */
+static int omap4_enter_idle(struct cpuidle_device *dev,
+                       struct cpuidle_driver *drv,
+                       int index)
+{
+       struct omap4_idle_statedata *cx =
+                       cpuidle_get_statedata(&dev->states_usage[index]);
+       struct timespec ts_preidle, ts_postidle, ts_idle;
+       u32 cpu1_state;
+       int idle_time;
+       int new_state_idx;
+       int cpu_id = smp_processor_id();
+
+       /* Used to keep track of the total time in idle */
+       getnstimeofday(&ts_preidle);
+
+       local_irq_disable();
+       local_fiq_disable();
+
+       /*
+        * CPU0 has to stay ON (i.e in C1) until CPU1 is OFF state.
+        * This is necessary to honour hardware recommondation
+        * of triggeing all the possible low power modes once CPU1 is
+        * out of coherency and in OFF mode.
+        * Update dev->last_state so that governor stats reflects right
+        * data.
+        */
+       cpu1_state = pwrdm_read_pwrst(cpu1_pd);
+       if (cpu1_state != PWRDM_POWER_OFF) {
+               new_state_idx = drv->safe_state_index;
+               cx = cpuidle_get_statedata(&dev->states_usage[new_state_idx]);
+       }
+
+       if (index > 0)
+               clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id);
+
+       /*
+        * Call idle CPU PM enter notifier chain so that
+        * VFP and per CPU interrupt context is saved.
+        */
+       if (cx->cpu_state == PWRDM_POWER_OFF)
+               cpu_pm_enter();
+
+       pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
+       omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
+
+       /*
+        * Call idle CPU cluster PM enter notifier chain
+        * to save GIC and wakeupgen context.
+        */
+       if ((cx->mpu_state == PWRDM_POWER_RET) &&
+               (cx->mpu_logic_state == PWRDM_POWER_OFF))
+                       cpu_cluster_pm_enter();
+
+       omap4_enter_lowpower(dev->cpu, cx->cpu_state);
+
+       /*
+        * Call idle CPU PM exit notifier chain to restore
+        * VFP and per CPU IRQ context. Only CPU0 state is
+        * considered since CPU1 is managed by CPU hotplug.
+        */
+       if (pwrdm_read_prev_pwrst(cpu0_pd) == PWRDM_POWER_OFF)
+               cpu_pm_exit();
+
+       /*
+        * Call idle CPU cluster PM exit notifier chain
+        * to restore GIC and wakeupgen context.
+        */
+       if (omap4_mpuss_read_prev_context_state())
+               cpu_cluster_pm_exit();
+
+       if (index > 0)
+               clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id);
+
+       getnstimeofday(&ts_postidle);
+       ts_idle = timespec_sub(ts_postidle, ts_preidle);
+
+       local_irq_enable();
+       local_fiq_enable();
+
+       idle_time = ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * \
+                                                               USEC_PER_SEC;
+
+       /* Update cpuidle counters */
+       dev->last_residency = idle_time;
+
+       return index;
+}
+
+DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev);
+
+struct cpuidle_driver omap4_idle_driver = {
+       .name =         "omap4_idle",
+       .owner =        THIS_MODULE,
+};
+
+static inline void _fill_cstate(struct cpuidle_driver *drv,
+                                       int idx, const char *descr)
+{
+       struct cpuidle_state *state = &drv->states[idx];
+
+       state->exit_latency     = cpuidle_params_table[idx].exit_latency;
+       state->target_residency = cpuidle_params_table[idx].target_residency;
+       state->flags            = CPUIDLE_FLAG_TIME_VALID;
+       state->enter            = omap4_enter_idle;
+       sprintf(state->name, "C%d", idx + 1);
+       strncpy(state->desc, descr, CPUIDLE_DESC_LEN);
+}
+
+static inline struct omap4_idle_statedata *_fill_cstate_usage(
+                                       struct cpuidle_device *dev,
+                                       int idx)
+{
+       struct omap4_idle_statedata *cx = &omap4_idle_data[idx];
+       struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
+
+       cx->valid               = cpuidle_params_table[idx].valid;
+       cpuidle_set_statedata(state_usage, cx);
+
+       return cx;
+}
+
+
+
+/**
+ * omap4_idle_init - Init routine for OMAP4 idle
+ *
+ * Registers the OMAP4 specific cpuidle driver to the cpuidle
+ * framework with the valid set of states.
+ */
+int __init omap4_idle_init(void)
+{
+       struct omap4_idle_statedata *cx;
+       struct cpuidle_device *dev;
+       struct cpuidle_driver *drv = &omap4_idle_driver;
+       unsigned int cpu_id = 0;
+
+       mpu_pd = pwrdm_lookup("mpu_pwrdm");
+       cpu0_pd = pwrdm_lookup("cpu0_pwrdm");
+       cpu1_pd = pwrdm_lookup("cpu1_pwrdm");
+       if ((!mpu_pd) || (!cpu0_pd) || (!cpu1_pd))
+               return -ENODEV;
+
+
+       drv->safe_state_index = -1;
+       dev = &per_cpu(omap4_idle_dev, cpu_id);
+       dev->cpu = cpu_id;
+
+       /* C1 - CPU0 ON + CPU1 ON + MPU ON */
+       _fill_cstate(drv, 0, "MPUSS ON");
+       drv->safe_state_index = 0;
+       cx = _fill_cstate_usage(dev, 0);
+       cx->valid = 1;  /* C1 is always valid */
+       cx->cpu_state = PWRDM_POWER_ON;
+       cx->mpu_state = PWRDM_POWER_ON;
+       cx->mpu_logic_state = PWRDM_POWER_RET;
+
+       /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
+       _fill_cstate(drv, 1, "MPUSS CSWR");
+       cx = _fill_cstate_usage(dev, 1);
+       cx->cpu_state = PWRDM_POWER_OFF;
+       cx->mpu_state = PWRDM_POWER_RET;
+       cx->mpu_logic_state = PWRDM_POWER_RET;
+
+       /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
+       _fill_cstate(drv, 2, "MPUSS OSWR");
+       cx = _fill_cstate_usage(dev, 2);
+       cx->cpu_state = PWRDM_POWER_OFF;
+       cx->mpu_state = PWRDM_POWER_RET;
+       cx->mpu_logic_state = PWRDM_POWER_OFF;
+
+       drv->state_count = OMAP4_NUM_STATES;
+       cpuidle_register_driver(&omap4_idle_driver);
+
+       dev->state_count = OMAP4_NUM_STATES;
+       if (cpuidle_register_device(dev)) {
+               pr_err("%s: CPUidle register device failed\n", __func__);
+                       return -EIO;
+               }
+
+       return 0;
+}
+#else
+int __init omap4_idle_init(void)
+{
+       return 0;
+}
+#endif /* CONFIG_CPU_IDLE */
index dce9905d64bb6e1af6c0b80d012142ffdfca49ee..bc6cf863a563bcf51f76240598ca6424b92939fe 100644 (file)
 #include <linux/io.h>
 #include <linux/clk.h>
 #include <linux/err.h>
+#include <linux/delay.h>
 
 #include <video/omapdss.h>
 #include <plat/omap_hwmod.h>
 #include <plat/omap_device.h>
 #include <plat/omap-pm.h>
-#include <plat/common.h>
+#include "common.h"
 
 #include "control.h"
 #include "display.h"
index ace99944e96f1b0ac50224cc24a838849fc77d49..a12e224eb97daae7795f407b97e6748bbbe60f7b 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <plat/cpu.h>
 #include <plat/i2c.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/omap_hwmod.h>
 
 #include "mux.h"
index 7f47092a193f71444fee33d01c857f51b8c2c318..27ad722df637d29b33634a2586e21df55addcda1 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <asm/cputype.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/cpu.h>
 
 #include <mach/id.h>
similarity index 50%
rename from arch/arm/mach-netx/include/mach/vmalloc.h
rename to arch/arm/mach-omap2/include/mach/barriers.h
index 871f1ef7bff58ad30be02182a1547f0d9c761624..4fa72c7cc7cdee537c65dbc13b553ce60dd667b6 100644 (file)
@@ -1,11 +1,13 @@
 /*
- *  arch/arm/mach-netx/include/mach/vmalloc.h
+ * OMAP memory barrier header.
  *
- * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *  Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *  Richard Woodruff <r-woodruff2@ti.com>
  *
  * 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.
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-#define VMALLOC_END       0xd0000000UL
+
+#ifndef __MACH_BARRIERS_H
+#define __MACH_BARRIERS_H
+
+extern void omap_bus_sync(void);
+
+#define rmb()          dsb()
+#define wmb()          do { dsb(); outer_sync(); omap_bus_sync(); } while (0)
+#define mb()           wmb()
+
+#endif /* __MACH_BARRIERS_H */
index feb90a10945af23348d59e7a88a413b98ce18b4a..56964a0c4c7e71be8a242caaae69205c1465496c 100644 (file)
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <mach/hardware.h>
-#include <mach/io.h>
-#include <mach/irqs.h>
-#include <asm/hardware/gic.h>
-
-#include <plat/omap24xx.h>
-#include <plat/omap34xx.h>
-#include <plat/omap44xx.h>
-
-#include <plat/multi.h>
-
-#define OMAP2_IRQ_BASE         OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
-#define OMAP3_IRQ_BASE         OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
-#define OMAP4_IRQ_BASE         OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
-#define INTCPS_SIR_IRQ_OFFSET  0x0040  /* omap2/3 active interrupt offset */
-#define        ACTIVEIRQ_MASK          0x7f    /* omap2/3 active interrupt bits */
 
                .macro  disable_fiq
                .endm
 
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-/*
- * Unoptimized irq functions for multi-omap2, 3 and 4
- */
-
-#ifdef MULTI_OMAP2
-               /*
-                * Configure the interrupt base on the first interrupt.
-                * See also omap_irq_base_init for setting omap_irq_base.
-                */
-               .macro  get_irqnr_preamble, base, tmp
-               ldr     \base, =omap_irq_base   @ irq base address
-               ldr     \base, [\base, #0]      @ irq base value
-               .endm
-
-               /* Check the pending interrupts. Note that base already set */
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               tst     \base, #0x100           @ gic address?
-               bne     4401f                   @ found gic
-
-               /* Handle omap2 and omap3 */
-               ldr     \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
-               cmp     \irqnr, #0x0
-               bne     9998f
-               ldr     \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
-               cmp     \irqnr, #0x0
-               bne     9998f
-               ldr     \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
-               cmp     \irqnr, #0x0
-               bne     9998f
-
-               /*
-                * ti816x has additional IRQ pending register. Checking this
-                * register on omap2 & omap3 has no effect (read as 0).
-                */
-               ldr     \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
-               cmp     \irqnr, #0x0
-9998:
-               ldrne   \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
-               and     \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
-               b       9999f
-
-               /* Handle omap4 */
-4401:          ldr     \irqstat, [\base, #GIC_CPU_INTACK]
-               ldr     \tmp, =1021
-               bic     \irqnr, \irqstat, #0x1c00
-               cmp     \irqnr, #15
-               cmpcc   \irqnr, \irqnr
-               cmpne   \irqnr, \tmp
-               cmpcs   \irqnr, \irqnr
-9999:
-               .endm
-
-#ifdef CONFIG_SMP
-               /* We assume that irqstat (the raw value of the IRQ acknowledge
-                * register) is preserved from the macro above.
-                * If there is an IPI, we immediately signal end of interrupt
-                * on the controller, since this requires the original irqstat
-                * value which we won't easily be able to recreate later.
-                */
-
-               .macro test_for_ipi, irqnr, irqstat, base, tmp
-               bic     \irqnr, \irqstat, #0x1c00
-               cmp     \irqnr, #16
-               it      cc
-               strcc   \irqstat, [\base, #GIC_CPU_EOI]
-               it      cs
-               cmpcs   \irqnr, \irqnr
-               .endm
-#endif /* CONFIG_SMP */
-
-#else  /* MULTI_OMAP2 */
-
-
-/*
- * Optimized irq functions for omap2, 3 and 4
- */
-
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-               .macro  get_irqnr_preamble, base, tmp
-#ifdef CONFIG_ARCH_OMAP2
-               ldr     \base, =OMAP2_IRQ_BASE
-#else
-               ldr     \base, =OMAP3_IRQ_BASE
-#endif
-               .endm
-
-               /* Check the pending interrupts. Note that base already set */
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
-               cmp     \irqnr, #0x0
-               bne     9999f
-               ldr     \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
-               cmp     \irqnr, #0x0
-               bne     9999f
-               ldr     \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
-               cmp     \irqnr, #0x0
-#ifdef CONFIG_SOC_OMAPTI816X
-               bne     9999f
-               ldr     \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
-               cmp     \irqnr, #0x0
-#endif
-9999:
-               ldrne   \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
-               and     \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
-
-               .endm
-#endif
-
-
-#ifdef CONFIG_ARCH_OMAP4
-#define HAVE_GET_IRQNR_PREAMBLE
-#include <asm/hardware/entry-macro-gic.S>
-
-               .macro  get_irqnr_preamble, base, tmp
-               ldr     \base, =OMAP4_IRQ_BASE
-               .endm
-
-#endif
-
-#endif /* MULTI_OMAP2 */
diff --git a/arch/arm/mach-omap2/include/mach/omap-secure.h b/arch/arm/mach-omap2/include/mach/omap-secure.h
new file mode 100644 (file)
index 0000000..c90a435
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * omap-secure.h: OMAP Secure infrastructure header.
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * 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 OMAP_ARCH_OMAP_SECURE_H
+#define OMAP_ARCH_OMAP_SECURE_H
+
+/* Monitor error code */
+#define  API_HAL_RET_VALUE_NS2S_CONVERSION_ERROR       0xFFFFFFFE
+#define  API_HAL_RET_VALUE_SERVICE_UNKNWON             0xFFFFFFFF
+
+/* HAL API error codes */
+#define  API_HAL_RET_VALUE_OK          0x00
+#define  API_HAL_RET_VALUE_FAIL                0x01
+
+/* Secure HAL API flags */
+#define FLAG_START_CRITICAL            0x4
+#define FLAG_IRQFIQ_MASK               0x3
+#define FLAG_IRQ_ENABLE                        0x2
+#define FLAG_FIQ_ENABLE                        0x1
+#define NO_FLAG                                0x0
+
+/* Maximum Secure memory storage size */
+#define OMAP_SECURE_RAM_STORAGE        (88 * SZ_1K)
+
+/* Secure low power HAL API index */
+#define OMAP4_HAL_SAVESECURERAM_INDEX  0x1a
+#define OMAP4_HAL_SAVEHW_INDEX         0x1b
+#define OMAP4_HAL_SAVEALL_INDEX                0x1c
+#define OMAP4_HAL_SAVEGIC_INDEX                0x1d
+
+/* Secure Monitor mode APIs */
+#define OMAP4_MON_SCU_PWR_INDEX                0x108
+#define OMAP4_MON_L2X0_DBG_CTRL_INDEX  0x100
+#define OMAP4_MON_L2X0_CTRL_INDEX      0x102
+#define OMAP4_MON_L2X0_AUXCTRL_INDEX   0x109
+#define OMAP4_MON_L2X0_PREFETCH_INDEX  0x113
+
+/* Secure PPA(Primary Protected Application) APIs */
+#define OMAP4_PPA_L2_POR_INDEX         0x23
+#define OMAP4_PPA_CPU_ACTRL_SMP_INDEX  0x25
+
+#ifndef __ASSEMBLER__
+
+extern u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
+                               u32 arg1, u32 arg2, u32 arg3, u32 arg4);
+extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
+extern phys_addr_t omap_secure_ram_mempool_base(void);
+
+#endif /* __ASSEMBLER__ */
+#endif /* OMAP_ARCH_OMAP_SECURE_H */
diff --git a/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h b/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h
new file mode 100644 (file)
index 0000000..d79321b
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * OMAP WakeupGen header file
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * 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 OMAP_ARCH_WAKEUPGEN_H
+#define OMAP_ARCH_WAKEUPGEN_H
+
+#define OMAP_WKG_CONTROL_0                     0x00
+#define OMAP_WKG_ENB_A_0                       0x10
+#define OMAP_WKG_ENB_B_0                       0x14
+#define OMAP_WKG_ENB_C_0                       0x18
+#define OMAP_WKG_ENB_D_0                       0x1c
+#define OMAP_WKG_ENB_SECURE_A_0                        0x20
+#define OMAP_WKG_ENB_SECURE_B_0                        0x24
+#define OMAP_WKG_ENB_SECURE_C_0                        0x28
+#define OMAP_WKG_ENB_SECURE_D_0                        0x2c
+#define OMAP_WKG_ENB_A_1                       0x410
+#define OMAP_WKG_ENB_B_1                       0x414
+#define OMAP_WKG_ENB_C_1                       0x418
+#define OMAP_WKG_ENB_D_1                       0x41c
+#define OMAP_WKG_ENB_SECURE_A_1                        0x420
+#define OMAP_WKG_ENB_SECURE_B_1                        0x424
+#define OMAP_WKG_ENB_SECURE_C_1                        0x428
+#define OMAP_WKG_ENB_SECURE_D_1                        0x42c
+#define OMAP_AUX_CORE_BOOT_0                   0x800
+#define OMAP_AUX_CORE_BOOT_1                   0x804
+#define OMAP_PTMSYNCREQ_MASK                   0xc00
+#define OMAP_PTMSYNCREQ_EN                     0xc04
+#define OMAP_TIMESTAMPCYCLELO                  0xc08
+#define OMAP_TIMESTAMPCYCLEHI                  0xc0c
+
+extern int __init omap_wakeupgen_init(void);
+#endif
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h
deleted file mode 100644 (file)
index e4bd876..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * omap4-common.h: OMAP4 specific common header file
- *
- * Copyright (C) 2010 Texas Instruments, Inc.
- *
- * Author:
- *     Santosh Shilimkar <santosh.shilimkar@ti.com>
- *
- * 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 OMAP_ARCH_OMAP4_COMMON_H
-#define OMAP_ARCH_OMAP4_COMMON_H
-
-/*
- * wfi used in low power code. Directly opcode is used instead
- * of instruction to avoid mulit-omap build break
- */
-#ifdef CONFIG_THUMB2_KERNEL
-#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory")
-#else
-#define do_wfi()                       \
-               __asm__ __volatile__ (".word    0xe320f003" : : : "memory")
-#endif
-
-#ifdef CONFIG_CACHE_L2X0
-extern void __iomem *l2cache_base;
-#endif
-
-extern void __iomem *gic_dist_base_addr;
-
-extern void __init gic_init_irq(void);
-extern void omap_smc1(u32 fn, u32 arg);
-
-#ifdef CONFIG_SMP
-/* Needed for secondary core boot */
-extern void omap_secondary_startup(void);
-extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
-extern void omap_auxcoreboot_addr(u32 cpu_addr);
-extern u32 omap_read_auxcoreboot0(void);
-#endif
-#endif
diff --git a/arch/arm/mach-omap2/include/mach/vmalloc.h b/arch/arm/mach-omap2/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 8663199..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  arch/arm/plat-omap/include/mach/vmalloc.h
- *
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-#define VMALLOC_END      0xf8000000UL
index 25d20ced03e13cb18bc7d6f27d44d11c5c671d90..65843390e7f00f3c3f751a64c5e5e0d5621b650f 100644 (file)
@@ -35,7 +35,7 @@
 #include "clock3xxx.h"
 #include "clock44xx.h"
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/omap-pm.h>
 #include "voltage.h"
 #include "powerdomain.h"
@@ -43,7 +43,7 @@
 #include "clockdomain.h"
 #include <plat/omap_hwmod.h>
 #include <plat/multi.h>
-#include <plat/common.h>
+#include "common.h"
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -237,6 +237,15 @@ static struct map_desc omap44xx_io_desc[] __initdata = {
                .length         = L4_EMU_44XX_SIZE,
                .type           = MT_DEVICE,
        },
+#ifdef CONFIG_OMAP4_ERRATA_I688
+       {
+               .virtual        = OMAP4_SRAM_VA,
+               .pfn            = __phys_to_pfn(OMAP4_SRAM_PA),
+               .length         = PAGE_SIZE,
+               .type           = MT_MEMORY_SO,
+       },
+#endif
+
 };
 #endif
 
@@ -316,13 +325,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
        return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
 }
 
-/* See irq.c, omap4-common.c and entry-macro.S */
-void __iomem *omap_irq_base;
-
 static void __init omap_common_init_early(void)
 {
        omap2_check_revision();
-       omap_ioremap_init();
        omap_init_consistent_dma_size();
 }
 
index 65f1be6a182cf6a384b72156ced623592d549d71..42b1d659191215582f1288893a919881ee0dd13d 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <mach/hardware.h>
+#include <asm/exception.h>
 #include <asm/mach/irq.h>
 
 
 /* Number of IRQ state bits in each MIR register */
 #define IRQ_BITS_PER_REG       32
 
+#define OMAP2_IRQ_BASE         OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
+#define OMAP3_IRQ_BASE         OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
+#define INTCPS_SIR_IRQ_OFFSET  0x0040  /* omap2/3 active interrupt offset */
+#define ACTIVEIRQ_MASK         0x7f    /* omap2/3 active interrupt bits */
+
 /*
  * OMAP2 has a number of different interrupt controllers, each interrupt
  * controller is identified as its own "bank". Register definitions are
@@ -143,6 +149,7 @@ omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
 
 static void __init omap_init_irq(u32 base, int nr_irqs)
 {
+       void __iomem *omap_irq_base;
        unsigned long nr_of_irqs = 0;
        unsigned int nr_banks = 0;
        int i, j;
@@ -191,6 +198,44 @@ void __init ti816x_init_irq(void)
        omap_init_irq(OMAP34XX_IC_BASE, 128);
 }
 
+static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs)
+{
+       u32 irqnr;
+
+       do {
+               irqnr = readl_relaxed(base_addr + 0x98);
+               if (irqnr)
+                       goto out;
+
+               irqnr = readl_relaxed(base_addr + 0xb8);
+               if (irqnr)
+                       goto out;
+
+               irqnr = readl_relaxed(base_addr + 0xd8);
+#ifdef CONFIG_SOC_OMAPTI816X
+               if (irqnr)
+                       goto out;
+               irqnr = readl_relaxed(base_addr + 0xf8);
+#endif
+
+out:
+               if (!irqnr)
+                       break;
+
+               irqnr = readl_relaxed(base_addr + INTCPS_SIR_IRQ_OFFSET);
+               irqnr &= ACTIVEIRQ_MASK;
+
+               if (irqnr)
+                       handle_IRQ(irqnr, regs);
+       } while (irqnr);
+}
+
+asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs)
+{
+       void __iomem *base_addr = OMAP2_IRQ_BASE;
+       omap_intc_handle_irq(base_addr, regs);
+}
+
 #ifdef CONFIG_ARCH_OMAP3
 static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
 
@@ -263,4 +308,10 @@ void omap3_intc_resume_idle(void)
        /* Re-enable autoidle */
        intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG);
 }
+
+asmlinkage void __exception_irq_entry omap3_intc_handle_irq(struct pt_regs *regs)
+{
+       void __iomem *base_addr = OMAP3_IRQ_BASE;
+       omap_intc_handle_irq(base_addr, regs);
+}
 #endif /* CONFIG_ARCH_OMAP3 */
index 4ee6aeca885a830d31714a2e897ebb4b0ff63660..b13ef7ef5ef4746bf4d2f8987375ba3d5261cc2f 100644 (file)
 #include <linux/linkage.h>
 #include <linux/init.h>
 
-/* Physical address needed since MMU not enabled yet on secondary core */
-#define OMAP4_AUX_CORE_BOOT1_PA                        0x48281804
-
-       __INIT
-
 /*
  * OMAP4 specific entry point for secondary CPU to jump from ROM
  * code.  This routine also provides a holding flag into which
index 4976b9393e49123ad04eaa8fabb15b7ca4357c99..adbe4d8c7cafdcd64d52c5880530f096ffacaebd 100644 (file)
 #include <linux/smp.h>
 
 #include <asm/cacheflush.h>
-#include <mach/omap4-common.h>
+
+#include "common.h"
+
+#include "powerdomain.h"
 
 int platform_cpu_kill(unsigned int cpu)
 {
@@ -32,6 +35,8 @@ int platform_cpu_kill(unsigned int cpu)
  */
 void platform_cpu_die(unsigned int cpu)
 {
+       unsigned int this_cpu;
+
        flush_cache_all();
        dsb();
 
@@ -39,15 +44,15 @@ void platform_cpu_die(unsigned int cpu)
         * we're ready for shutdown now, so do it
         */
        if (omap_modify_auxcoreboot0(0x0, 0x200) != 0x0)
-               printk(KERN_CRIT "Secure clear status failed\n");
+               pr_err("Secure clear status failed\n");
 
        for (;;) {
                /*
-                * Execute WFI
+                * Enter into low power state
                 */
-               do_wfi();
-
-               if (omap_read_auxcoreboot0() == cpu) {
+               omap4_hotplug_cpu(cpu, PWRDM_POWER_OFF);
+               this_cpu = smp_processor_id();
+               if (omap_read_auxcoreboot0() == this_cpu) {
                        /*
                         * OK, proper wakeup, we're done
                         */
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
new file mode 100644 (file)
index 0000000..1d5d010
--- /dev/null
@@ -0,0 +1,398 @@
+/*
+ * OMAP MPUSS low power code
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * OMAP4430 MPUSS mainly consists of dual Cortex-A9 with per-CPU
+ * Local timer and Watchdog, GIC, SCU, PL310 L2 cache controller,
+ * CPU0 and CPU1 LPRM modules.
+ * CPU0, CPU1 and MPUSS each have there own power domain and
+ * hence multiple low power combinations of MPUSS are possible.
+ *
+ * The CPU0 and CPU1 can't support Closed switch Retention (CSWR)
+ * because the mode is not supported by hw constraints of dormant
+ * mode. While waking up from the dormant mode, a reset  signal
+ * to the Cortex-A9 processor must be asserted by the external
+ * power controller.
+ *
+ * With architectural inputs and hardware recommendations, only
+ * below modes are supported from power gain vs latency point of view.
+ *
+ *     CPU0            CPU1            MPUSS
+ *     ----------------------------------------------
+ *     ON              ON              ON
+ *     ON(Inactive)    OFF             ON(Inactive)
+ *     OFF             OFF             CSWR
+ *     OFF             OFF             OSWR
+ *     OFF             OFF             OFF(Device OFF *TBD)
+ *     ----------------------------------------------
+ *
+ * Note: CPU0 is the master core and it is the last CPU to go down
+ * and first to wake-up when MPUSS low power states are excercised
+ *
+ *
+ * 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/kernel.h>
+#include <linux/io.h>
+#include <linux/errno.h>
+#include <linux/linkage.h>
+#include <linux/smp.h>
+
+#include <asm/cacheflush.h>
+#include <asm/tlbflush.h>
+#include <asm/smp_scu.h>
+#include <asm/system.h>
+#include <asm/pgalloc.h>
+#include <asm/suspend.h>
+#include <asm/hardware/cache-l2x0.h>
+
+#include <plat/omap44xx.h>
+
+#include "common.h"
+#include "omap4-sar-layout.h"
+#include "pm.h"
+#include "prcm_mpu44xx.h"
+#include "prminst44xx.h"
+#include "prcm44xx.h"
+#include "prm44xx.h"
+#include "prm-regbits-44xx.h"
+
+#ifdef CONFIG_SMP
+
+struct omap4_cpu_pm_info {
+       struct powerdomain *pwrdm;
+       void __iomem *scu_sar_addr;
+       void __iomem *wkup_sar_addr;
+       void __iomem *l2x0_sar_addr;
+};
+
+static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info);
+static struct powerdomain *mpuss_pd;
+static void __iomem *sar_base;
+
+/*
+ * Program the wakeup routine address for the CPU0 and CPU1
+ * used for OFF or DORMANT wakeup.
+ */
+static inline void set_cpu_wakeup_addr(unsigned int cpu_id, u32 addr)
+{
+       struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
+
+       __raw_writel(addr, pm_info->wkup_sar_addr);
+}
+
+/*
+ * Set the CPUx powerdomain's previous power state
+ */
+static inline void set_cpu_next_pwrst(unsigned int cpu_id,
+                               unsigned int power_state)
+{
+       struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
+
+       pwrdm_set_next_pwrst(pm_info->pwrdm, power_state);
+}
+
+/*
+ * Read CPU's previous power state
+ */
+static inline unsigned int read_cpu_prev_pwrst(unsigned int cpu_id)
+{
+       struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
+
+       return pwrdm_read_prev_pwrst(pm_info->pwrdm);
+}
+
+/*
+ * Clear the CPUx powerdomain's previous power state
+ */
+static inline void clear_cpu_prev_pwrst(unsigned int cpu_id)
+{
+       struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
+
+       pwrdm_clear_all_prev_pwrst(pm_info->pwrdm);
+}
+
+/*
+ * Store the SCU power status value to scratchpad memory
+ */
+static void scu_pwrst_prepare(unsigned int cpu_id, unsigned int cpu_state)
+{
+       struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
+       u32 scu_pwr_st;
+
+       switch (cpu_state) {
+       case PWRDM_POWER_RET:
+               scu_pwr_st = SCU_PM_DORMANT;
+               break;
+       case PWRDM_POWER_OFF:
+               scu_pwr_st = SCU_PM_POWEROFF;
+               break;
+       case PWRDM_POWER_ON:
+       case PWRDM_POWER_INACTIVE:
+       default:
+               scu_pwr_st = SCU_PM_NORMAL;
+               break;
+       }
+
+       __raw_writel(scu_pwr_st, pm_info->scu_sar_addr);
+}
+
+/* Helper functions for MPUSS OSWR */
+static inline void mpuss_clear_prev_logic_pwrst(void)
+{
+       u32 reg;
+
+       reg = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
+               OMAP4430_PRM_MPU_INST, OMAP4_RM_MPU_MPU_CONTEXT_OFFSET);
+       omap4_prminst_write_inst_reg(reg, OMAP4430_PRM_PARTITION,
+               OMAP4430_PRM_MPU_INST, OMAP4_RM_MPU_MPU_CONTEXT_OFFSET);
+}
+
+static inline void cpu_clear_prev_logic_pwrst(unsigned int cpu_id)
+{
+       u32 reg;
+
+       if (cpu_id) {
+               reg = omap4_prcm_mpu_read_inst_reg(OMAP4430_PRCM_MPU_CPU1_INST,
+                                       OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET);
+               omap4_prcm_mpu_write_inst_reg(reg, OMAP4430_PRCM_MPU_CPU1_INST,
+                                       OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET);
+       } else {
+               reg = omap4_prcm_mpu_read_inst_reg(OMAP4430_PRCM_MPU_CPU0_INST,
+                                       OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET);
+               omap4_prcm_mpu_write_inst_reg(reg, OMAP4430_PRCM_MPU_CPU0_INST,
+                                       OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET);
+       }
+}
+
+/**
+ * omap4_mpuss_read_prev_context_state:
+ * Function returns the MPUSS previous context state
+ */
+u32 omap4_mpuss_read_prev_context_state(void)
+{
+       u32 reg;
+
+       reg = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
+               OMAP4430_PRM_MPU_INST, OMAP4_RM_MPU_MPU_CONTEXT_OFFSET);
+       reg &= OMAP4430_LOSTCONTEXT_DFF_MASK;
+       return reg;
+}
+
+/*
+ * Store the CPU cluster state for L2X0 low power operations.
+ */
+static void l2x0_pwrst_prepare(unsigned int cpu_id, unsigned int save_state)
+{
+       struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
+
+       __raw_writel(save_state, pm_info->l2x0_sar_addr);
+}
+
+/*
+ * Save the L2X0 AUXCTRL and POR value to SAR memory. Its used to
+ * in every restore MPUSS OFF path.
+ */
+#ifdef CONFIG_CACHE_L2X0
+static void save_l2x0_context(void)
+{
+       u32 val;
+       void __iomem *l2x0_base = omap4_get_l2cache_base();
+
+       val = __raw_readl(l2x0_base + L2X0_AUX_CTRL);
+       __raw_writel(val, sar_base + L2X0_AUXCTRL_OFFSET);
+       val = __raw_readl(l2x0_base + L2X0_PREFETCH_CTRL);
+       __raw_writel(val, sar_base + L2X0_PREFETCH_CTRL_OFFSET);
+}
+#else
+static void save_l2x0_context(void)
+{}
+#endif
+
+/**
+ * omap4_enter_lowpower: OMAP4 MPUSS Low Power Entry Function
+ * The purpose of this function is to manage low power programming
+ * of OMAP4 MPUSS subsystem
+ * @cpu : CPU ID
+ * @power_state: Low power state.
+ *
+ * MPUSS states for the context save:
+ * save_state =
+ *     0 - Nothing lost and no need to save: MPUSS INACTIVE
+ *     1 - CPUx L1 and logic lost: MPUSS CSWR
+ *     2 - CPUx L1 and logic lost + GIC lost: MPUSS OSWR
+ *     3 - CPUx L1 and logic lost + GIC + L2 lost: DEVICE OFF
+ */
+int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
+{
+       unsigned int save_state = 0;
+       unsigned int wakeup_cpu;
+
+       if (omap_rev() == OMAP4430_REV_ES1_0)
+               return -ENXIO;
+
+       switch (power_state) {
+       case PWRDM_POWER_ON:
+       case PWRDM_POWER_INACTIVE:
+               save_state = 0;
+               break;
+       case PWRDM_POWER_OFF:
+               save_state = 1;
+               break;
+       case PWRDM_POWER_RET:
+       default:
+               /*
+                * CPUx CSWR is invalid hardware state. Also CPUx OSWR
+                * doesn't make much scense, since logic is lost and $L1
+                * needs to be cleaned because of coherency. This makes
+                * CPUx OSWR equivalent to CPUX OFF and hence not supported
+                */
+               WARN_ON(1);
+               return -ENXIO;
+       }
+
+       pwrdm_pre_transition();
+
+       /*
+        * Check MPUSS next state and save interrupt controller if needed.
+        * In MPUSS OSWR or device OFF, interrupt controller  contest is lost.
+        */
+       mpuss_clear_prev_logic_pwrst();
+       pwrdm_clear_all_prev_pwrst(mpuss_pd);
+       if ((pwrdm_read_next_pwrst(mpuss_pd) == PWRDM_POWER_RET) &&
+               (pwrdm_read_logic_retst(mpuss_pd) == PWRDM_POWER_OFF))
+               save_state = 2;
+
+       clear_cpu_prev_pwrst(cpu);
+       cpu_clear_prev_logic_pwrst(cpu);
+       set_cpu_next_pwrst(cpu, power_state);
+       set_cpu_wakeup_addr(cpu, virt_to_phys(omap4_cpu_resume));
+       scu_pwrst_prepare(cpu, power_state);
+       l2x0_pwrst_prepare(cpu, save_state);
+
+       /*
+        * Call low level function  with targeted low power state.
+        */
+       cpu_suspend(save_state, omap4_finish_suspend);
+
+       /*
+        * Restore the CPUx power state to ON otherwise CPUx
+        * power domain can transitions to programmed low power
+        * state while doing WFI outside the low powe code. On
+        * secure devices, CPUx does WFI which can result in
+        * domain transition
+        */
+       wakeup_cpu = smp_processor_id();
+       set_cpu_next_pwrst(wakeup_cpu, PWRDM_POWER_ON);
+
+       pwrdm_post_transition();
+
+       return 0;
+}
+
+/**
+ * omap4_hotplug_cpu: OMAP4 CPU hotplug entry
+ * @cpu : CPU ID
+ * @power_state: CPU low power state.
+ */
+int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
+{
+       unsigned int cpu_state = 0;
+
+       if (omap_rev() == OMAP4430_REV_ES1_0)
+               return -ENXIO;
+
+       if (power_state == PWRDM_POWER_OFF)
+               cpu_state = 1;
+
+       clear_cpu_prev_pwrst(cpu);
+       set_cpu_next_pwrst(cpu, power_state);
+       set_cpu_wakeup_addr(cpu, virt_to_phys(omap_secondary_startup));
+       scu_pwrst_prepare(cpu, power_state);
+
+       /*
+        * CPU never retuns back if targetted power state is OFF mode.
+        * CPU ONLINE follows normal CPU ONLINE ptah via
+        * omap_secondary_startup().
+        */
+       omap4_finish_suspend(cpu_state);
+
+       set_cpu_next_pwrst(cpu, PWRDM_POWER_ON);
+       return 0;
+}
+
+
+/*
+ * Initialise OMAP4 MPUSS
+ */
+int __init omap4_mpuss_init(void)
+{
+       struct omap4_cpu_pm_info *pm_info;
+
+       if (omap_rev() == OMAP4430_REV_ES1_0) {
+               WARN(1, "Power Management not supported on OMAP4430 ES1.0\n");
+               return -ENODEV;
+       }
+
+       sar_base = omap4_get_sar_ram_base();
+
+       /* Initilaise per CPU PM information */
+       pm_info = &per_cpu(omap4_pm_info, 0x0);
+       pm_info->scu_sar_addr = sar_base + SCU_OFFSET0;
+       pm_info->wkup_sar_addr = sar_base + CPU0_WAKEUP_NS_PA_ADDR_OFFSET;
+       pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET0;
+       pm_info->pwrdm = pwrdm_lookup("cpu0_pwrdm");
+       if (!pm_info->pwrdm) {
+               pr_err("Lookup failed for CPU0 pwrdm\n");
+               return -ENODEV;
+       }
+
+       /* Clear CPU previous power domain state */
+       pwrdm_clear_all_prev_pwrst(pm_info->pwrdm);
+       cpu_clear_prev_logic_pwrst(0);
+
+       /* Initialise CPU0 power domain state to ON */
+       pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON);
+
+       pm_info = &per_cpu(omap4_pm_info, 0x1);
+       pm_info->scu_sar_addr = sar_base + SCU_OFFSET1;
+       pm_info->wkup_sar_addr = sar_base + CPU1_WAKEUP_NS_PA_ADDR_OFFSET;
+       pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1;
+       pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm");
+       if (!pm_info->pwrdm) {
+               pr_err("Lookup failed for CPU1 pwrdm\n");
+               return -ENODEV;
+       }
+
+       /* Clear CPU previous power domain state */
+       pwrdm_clear_all_prev_pwrst(pm_info->pwrdm);
+       cpu_clear_prev_logic_pwrst(1);
+
+       /* Initialise CPU1 power domain state to ON */
+       pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON);
+
+       mpuss_pd = pwrdm_lookup("mpu_pwrdm");
+       if (!mpuss_pd) {
+               pr_err("Failed to lookup MPUSS power domain\n");
+               return -ENODEV;
+       }
+       pwrdm_clear_all_prev_pwrst(mpuss_pd);
+       mpuss_clear_prev_logic_pwrst();
+
+       /* Save device type on scratchpad for low level code to use */
+       if (omap_type() != OMAP2_DEVICE_TYPE_GP)
+               __raw_writel(1, sar_base + OMAP_TYPE_OFFSET);
+       else
+               __raw_writel(0, sar_base + OMAP_TYPE_OFFSET);
+
+       save_l2x0_context();
+
+       return 0;
+}
+
+#endif
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
new file mode 100644 (file)
index 0000000..69f3c72
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * OMAP Secure API infrastructure.
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ *
+ * 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/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/memblock.h>
+
+#include <asm/cacheflush.h>
+
+#include <mach/omap-secure.h>
+
+static phys_addr_t omap_secure_memblock_base;
+
+/**
+ * omap_sec_dispatcher: Routine to dispatch low power secure
+ * service routines
+ * @idx: The HAL API index
+ * @flag: The flag indicating criticality of operation
+ * @nargs: Number of valid arguments out of four.
+ * @arg1, arg2, arg3 args4: Parameters passed to secure API
+ *
+ * Return the non-zero error value on failure.
+ */
+u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
+                                                        u32 arg3, u32 arg4)
+{
+       u32 ret;
+       u32 param[5];
+
+       param[0] = nargs;
+       param[1] = arg1;
+       param[2] = arg2;
+       param[3] = arg3;
+       param[4] = arg4;
+
+       /*
+        * Secure API needs physical address
+        * pointer for the parameters
+        */
+       flush_cache_all();
+       outer_clean_range(__pa(param), __pa(param + 5));
+       ret = omap_smc2(idx, flag, __pa(param));
+
+       return ret;
+}
+
+/* Allocate the memory to save secure ram */
+int __init omap_secure_ram_reserve_memblock(void)
+{
+       phys_addr_t paddr;
+       u32 size = OMAP_SECURE_RAM_STORAGE;
+
+       size = ALIGN(size, SZ_1M);
+       paddr = memblock_alloc(size, SZ_1M);
+       if (!paddr) {
+               pr_err("%s: failed to reserve %x bytes\n",
+                               __func__, size);
+               return -ENOMEM;
+       }
+       memblock_free(paddr, size);
+       memblock_remove(paddr, size);
+
+       omap_secure_memblock_base = paddr;
+
+       return 0;
+}
+
+phys_addr_t omap_secure_ram_mempool_base(void)
+{
+       return omap_secure_memblock_base;
+}
similarity index 70%
rename from arch/arm/mach-omap2/omap44xx-smc.S
rename to arch/arm/mach-omap2/omap-smc.S
index e69d37d952042da5f1d348600f0c3efa41ef9490..f6441c13cd8ce35ba78fb526f2a33d1123064f91 100644 (file)
@@ -31,6 +31,29 @@ ENTRY(omap_smc1)
        ldmfd   sp!, {r2-r12, pc}
 ENDPROC(omap_smc1)
 
+/**
+ * u32 omap_smc2(u32 id, u32 falg, u32 pargs)
+ * Low level common routine for secure HAL and PPA APIs.
+ * @id: Application ID of HAL APIs
+ * @flag: Flag to indicate the criticality of operation
+ * @pargs: Physical address of parameter list starting
+ *         with number of parametrs
+ */
+ENTRY(omap_smc2)
+       stmfd   sp!, {r4-r12, lr}
+       mov     r3, r2
+       mov     r2, r1
+       mov     r1, #0x0        @ Process ID
+       mov     r6, #0xff
+       mov     r12, #0x00      @ Secure Service ID
+       mov     r7, #0
+       mcr     p15, 0, r7, c7, c5, 6
+       dsb
+       dmb
+       smc     #0
+       ldmfd   sp!, {r4-r12, pc}
+ENDPROC(omap_smc2)
+
 ENTRY(omap_modify_auxcoreboot0)
        stmfd   sp!, {r1-r12, lr}
        ldr     r12, =0x104
index 4412ddb7b3f68f60d2374b0a32bc94d5f9e21bb6..c1bf3ef0ba02d5ffe0ea8af5642b9a078d9f0b66 100644 (file)
 #include <asm/hardware/gic.h>
 #include <asm/smp_scu.h>
 #include <mach/hardware.h>
-#include <mach/omap4-common.h>
+#include <mach/omap-secure.h>
+
+#include "common.h"
+
+#include "clockdomain.h"
 
 /* SCU base address */
 static void __iomem *scu_base;
 
 static DEFINE_SPINLOCK(boot_lock);
 
+void __iomem *omap4_get_scu_base(void)
+{
+       return scu_base;
+}
+
 void __cpuinit platform_secondary_init(unsigned int cpu)
 {
+       /*
+        * Configure ACTRL and enable NS SMP bit access on CPU1 on HS device.
+        * OMAP44XX EMU/HS devices - CPU0 SMP bit access is enabled in PPA
+        * init and for CPU1, a secure PPA API provided. CPU0 must be ON
+        * while executing NS_SMP API on CPU1 and PPA version must be 1.4.0+.
+        * OMAP443X GP devices- SMP bit isn't accessible.
+        * OMAP446X GP devices - SMP bit access is enabled on both CPUs.
+        */
+       if (cpu_is_omap443x() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
+               omap_secure_dispatcher(OMAP4_PPA_CPU_ACTRL_SMP_INDEX,
+                                                       4, 0, 0, 0, 0, 0);
+
        /*
         * If any interrupts are already enabled for the primary
         * core (e.g. timer irq), then they will not have been enabled
@@ -49,6 +70,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 
 int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
+       static struct clockdomain *cpu1_clkdm;
+       static bool booted;
        /*
         * Set synchronisation state between this boot processor
         * and the secondary one
@@ -64,6 +87,29 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
        omap_modify_auxcoreboot0(0x200, 0xfffffdff);
        flush_cache_all();
        smp_wmb();
+
+       if (!cpu1_clkdm)
+               cpu1_clkdm = clkdm_lookup("mpu1_clkdm");
+
+       /*
+        * The SGI(Software Generated Interrupts) are not wakeup capable
+        * from low power states. This is known limitation on OMAP4 and
+        * needs to be worked around by using software forced clockdomain
+        * wake-up. To wakeup CPU1, CPU0 forces the CPU1 clockdomain to
+        * software force wakeup. The clockdomain is then put back to
+        * hardware supervised mode.
+        * More details can be found in OMAP4430 TRM - Version J
+        * Section :
+        *      4.3.4.2 Power States of CPU0 and CPU1
+        */
+       if (booted) {
+               clkdm_wakeup(cpu1_clkdm);
+               clkdm_allow_idle(cpu1_clkdm);
+       } else {
+               dsb_sev();
+               booted = true;
+       }
+
        gic_raise_softirq(cpumask_of(cpu), 1);
 
        /*
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
new file mode 100644 (file)
index 0000000..d3d8971
--- /dev/null
@@ -0,0 +1,389 @@
+/*
+ * OMAP WakeupGen Source file
+ *
+ * OMAP WakeupGen is the interrupt controller extension used along
+ * with ARM GIC to wake the CPU out from low power states on
+ * external interrupts. It is responsible for generating wakeup
+ * event from the incoming interrupts and enable bits. It is
+ * implemented in MPU always ON power domain. During normal operation,
+ * WakeupGen delivers external interrupts directly to the GIC.
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * 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/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/cpu.h>
+#include <linux/notifier.h>
+#include <linux/cpu_pm.h>
+
+#include <asm/hardware/gic.h>
+
+#include <mach/omap-wakeupgen.h>
+#include <mach/omap-secure.h>
+
+#include "omap4-sar-layout.h"
+#include "common.h"
+
+#define NR_REG_BANKS           4
+#define MAX_IRQS               128
+#define WKG_MASK_ALL           0x00000000
+#define WKG_UNMASK_ALL         0xffffffff
+#define CPU_ENA_OFFSET         0x400
+#define CPU0_ID                        0x0
+#define CPU1_ID                        0x1
+
+static void __iomem *wakeupgen_base;
+static void __iomem *sar_base;
+static DEFINE_PER_CPU(u32 [NR_REG_BANKS], irqmasks);
+static DEFINE_SPINLOCK(wakeupgen_lock);
+static unsigned int irq_target_cpu[NR_IRQS];
+
+/*
+ * Static helper functions.
+ */
+static inline u32 wakeupgen_readl(u8 idx, u32 cpu)
+{
+       return __raw_readl(wakeupgen_base + OMAP_WKG_ENB_A_0 +
+                               (cpu * CPU_ENA_OFFSET) + (idx * 4));
+}
+
+static inline void wakeupgen_writel(u32 val, u8 idx, u32 cpu)
+{
+       __raw_writel(val, wakeupgen_base + OMAP_WKG_ENB_A_0 +
+                               (cpu * CPU_ENA_OFFSET) + (idx * 4));
+}
+
+static inline void sar_writel(u32 val, u32 offset, u8 idx)
+{
+       __raw_writel(val, sar_base + offset + (idx * 4));
+}
+
+static void _wakeupgen_set_all(unsigned int cpu, unsigned int reg)
+{
+       u8 i;
+
+       for (i = 0; i < NR_REG_BANKS; i++)
+               wakeupgen_writel(reg, i, cpu);
+}
+
+static inline int _wakeupgen_get_irq_info(u32 irq, u32 *bit_posn, u8 *reg_index)
+{
+       unsigned int spi_irq;
+
+       /*
+        * PPIs and SGIs are not supported.
+        */
+       if (irq < OMAP44XX_IRQ_GIC_START)
+               return -EINVAL;
+
+       /*
+        * Subtract the GIC offset.
+        */
+       spi_irq = irq - OMAP44XX_IRQ_GIC_START;
+       if (spi_irq > MAX_IRQS) {
+               pr_err("omap wakeupGen: Invalid IRQ%d\n", irq);
+               return -EINVAL;
+       }
+
+       /*
+        * Each WakeupGen register controls 32 interrupt.
+        * i.e. 1 bit per SPI IRQ
+        */
+       *reg_index = spi_irq >> 5;
+       *bit_posn = spi_irq %= 32;
+
+       return 0;
+}
+
+static void _wakeupgen_clear(unsigned int irq, unsigned int cpu)
+{
+       u32 val, bit_number;
+       u8 i;
+
+       if (_wakeupgen_get_irq_info(irq, &bit_number, &i))
+               return;
+
+       val = wakeupgen_readl(i, cpu);
+       val &= ~BIT(bit_number);
+       wakeupgen_writel(val, i, cpu);
+}
+
+static void _wakeupgen_set(unsigned int irq, unsigned int cpu)
+{
+       u32 val, bit_number;
+       u8 i;
+
+       if (_wakeupgen_get_irq_info(irq, &bit_number, &i))
+               return;
+
+       val = wakeupgen_readl(i, cpu);
+       val |= BIT(bit_number);
+       wakeupgen_writel(val, i, cpu);
+}
+
+static void _wakeupgen_save_masks(unsigned int cpu)
+{
+       u8 i;
+
+       for (i = 0; i < NR_REG_BANKS; i++)
+               per_cpu(irqmasks, cpu)[i] = wakeupgen_readl(i, cpu);
+}
+
+static void _wakeupgen_restore_masks(unsigned int cpu)
+{
+       u8 i;
+
+       for (i = 0; i < NR_REG_BANKS; i++)
+               wakeupgen_writel(per_cpu(irqmasks, cpu)[i], i, cpu);
+}
+
+/*
+ * Architecture specific Mask extension
+ */
+static void wakeupgen_mask(struct irq_data *d)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&wakeupgen_lock, flags);
+       _wakeupgen_clear(d->irq, irq_target_cpu[d->irq]);
+       spin_unlock_irqrestore(&wakeupgen_lock, flags);
+}
+
+/*
+ * Architecture specific Unmask extension
+ */
+static void wakeupgen_unmask(struct irq_data *d)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&wakeupgen_lock, flags);
+       _wakeupgen_set(d->irq, irq_target_cpu[d->irq]);
+       spin_unlock_irqrestore(&wakeupgen_lock, flags);
+}
+
+/*
+ * Mask or unmask all interrupts on given CPU.
+ *     0 = Mask all interrupts on the 'cpu'
+ *     1 = Unmask all interrupts on the 'cpu'
+ * Ensure that the initial mask is maintained. This is faster than
+ * iterating through GIC registers to arrive at the correct masks.
+ */
+static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&wakeupgen_lock, flags);
+       if (set) {
+               _wakeupgen_save_masks(cpu);
+               _wakeupgen_set_all(cpu, WKG_MASK_ALL);
+       } else {
+               _wakeupgen_set_all(cpu, WKG_UNMASK_ALL);
+               _wakeupgen_restore_masks(cpu);
+       }
+       spin_unlock_irqrestore(&wakeupgen_lock, flags);
+}
+
+#ifdef CONFIG_CPU_PM
+/*
+ * Save WakeupGen interrupt context in SAR BANK3. Restore is done by
+ * ROM code. WakeupGen IP is integrated along with GIC to manage the
+ * interrupt wakeups from CPU low power states. It manages
+ * masking/unmasking of Shared peripheral interrupts(SPI). So the
+ * interrupt enable/disable control should be in sync and consistent
+ * at WakeupGen and GIC so that interrupts are not lost.
+ */
+static void irq_save_context(void)
+{
+       u32 i, val;
+
+       if (omap_rev() == OMAP4430_REV_ES1_0)
+               return;
+
+       if (!sar_base)
+               sar_base = omap4_get_sar_ram_base();
+
+       for (i = 0; i < NR_REG_BANKS; i++) {
+               /* Save the CPUx interrupt mask for IRQ 0 to 127 */
+               val = wakeupgen_readl(i, 0);
+               sar_writel(val, WAKEUPGENENB_OFFSET_CPU0, i);
+               val = wakeupgen_readl(i, 1);
+               sar_writel(val, WAKEUPGENENB_OFFSET_CPU1, i);
+
+               /*
+                * Disable the secure interrupts for CPUx. The restore
+                * code blindly restores secure and non-secure interrupt
+                * masks from SAR RAM. Secure interrupts are not suppose
+                * to be enabled from HLOS. So overwrite the SAR location
+                * so that the secure interrupt remains disabled.
+                */
+               sar_writel(0x0, WAKEUPGENENB_SECURE_OFFSET_CPU0, i);
+               sar_writel(0x0, WAKEUPGENENB_SECURE_OFFSET_CPU1, i);
+       }
+
+       /* Save AuxBoot* registers */
+       val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
+       __raw_writel(val, sar_base + AUXCOREBOOT0_OFFSET);
+       val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
+       __raw_writel(val, sar_base + AUXCOREBOOT1_OFFSET);
+
+       /* Save SyncReq generation logic */
+       val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
+       __raw_writel(val, sar_base + AUXCOREBOOT0_OFFSET);
+       val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
+       __raw_writel(val, sar_base + AUXCOREBOOT1_OFFSET);
+
+       /* Save SyncReq generation logic */
+       val = __raw_readl(wakeupgen_base + OMAP_PTMSYNCREQ_MASK);
+       __raw_writel(val, sar_base + PTMSYNCREQ_MASK_OFFSET);
+       val = __raw_readl(wakeupgen_base + OMAP_PTMSYNCREQ_EN);
+       __raw_writel(val, sar_base + PTMSYNCREQ_EN_OFFSET);
+
+       /* Set the Backup Bit Mask status */
+       val = __raw_readl(sar_base + SAR_BACKUP_STATUS_OFFSET);
+       val |= SAR_BACKUP_STATUS_WAKEUPGEN;
+       __raw_writel(val, sar_base + SAR_BACKUP_STATUS_OFFSET);
+}
+
+/*
+ * Clear WakeupGen SAR backup status.
+ */
+void irq_sar_clear(void)
+{
+       u32 val;
+       val = __raw_readl(sar_base + SAR_BACKUP_STATUS_OFFSET);
+       val &= ~SAR_BACKUP_STATUS_WAKEUPGEN;
+       __raw_writel(val, sar_base + SAR_BACKUP_STATUS_OFFSET);
+}
+
+/*
+ * Save GIC and Wakeupgen interrupt context using secure API
+ * for HS/EMU devices.
+ */
+static void irq_save_secure_context(void)
+{
+       u32 ret;
+       ret = omap_secure_dispatcher(OMAP4_HAL_SAVEGIC_INDEX,
+                               FLAG_START_CRITICAL,
+                               0, 0, 0, 0, 0);
+       if (ret != API_HAL_RET_VALUE_OK)
+               pr_err("GIC and Wakeupgen context save failed\n");
+}
+#endif
+
+#ifdef CONFIG_HOTPLUG_CPU
+static int __cpuinit irq_cpu_hotplug_notify(struct notifier_block *self,
+                                        unsigned long action, void *hcpu)
+{
+       unsigned int cpu = (unsigned int)hcpu;
+
+       switch (action) {
+       case CPU_ONLINE:
+               wakeupgen_irqmask_all(cpu, 0);
+               break;
+       case CPU_DEAD:
+               wakeupgen_irqmask_all(cpu, 1);
+               break;
+       }
+       return NOTIFY_OK;
+}
+
+static struct notifier_block __refdata irq_hotplug_notifier = {
+       .notifier_call = irq_cpu_hotplug_notify,
+};
+
+static void __init irq_hotplug_init(void)
+{
+       register_hotcpu_notifier(&irq_hotplug_notifier);
+}
+#else
+static void __init irq_hotplug_init(void)
+{}
+#endif
+
+#ifdef CONFIG_CPU_PM
+static int irq_notifier(struct notifier_block *self, unsigned long cmd,        void *v)
+{
+       switch (cmd) {
+       case CPU_CLUSTER_PM_ENTER:
+               if (omap_type() == OMAP2_DEVICE_TYPE_GP)
+                       irq_save_context();
+               else
+                       irq_save_secure_context();
+               break;
+       case CPU_CLUSTER_PM_EXIT:
+               if (omap_type() == OMAP2_DEVICE_TYPE_GP)
+                       irq_sar_clear();
+               break;
+       }
+       return NOTIFY_OK;
+}
+
+static struct notifier_block irq_notifier_block = {
+       .notifier_call = irq_notifier,
+};
+
+static void __init irq_pm_init(void)
+{
+       cpu_pm_register_notifier(&irq_notifier_block);
+}
+#else
+static void __init irq_pm_init(void)
+{}
+#endif
+
+/*
+ * Initialise the wakeupgen module.
+ */
+int __init omap_wakeupgen_init(void)
+{
+       int i;
+       unsigned int boot_cpu = smp_processor_id();
+
+       /* Not supported on OMAP4 ES1.0 silicon */
+       if (omap_rev() == OMAP4430_REV_ES1_0) {
+               WARN(1, "WakeupGen: Not supported on OMAP4430 ES1.0\n");
+               return -EPERM;
+       }
+
+       /* Static mapping, never released */
+       wakeupgen_base = ioremap(OMAP44XX_WKUPGEN_BASE, SZ_4K);
+       if (WARN_ON(!wakeupgen_base))
+               return -ENOMEM;
+
+       /* Clear all IRQ bitmasks at wakeupGen level */
+       for (i = 0; i < NR_REG_BANKS; i++) {
+               wakeupgen_writel(0, i, CPU0_ID);
+               wakeupgen_writel(0, i, CPU1_ID);
+       }
+
+       /*
+        * Override GIC architecture specific functions to add
+        * OMAP WakeupGen interrupt controller along with GIC
+        */
+       gic_arch_extn.irq_mask = wakeupgen_mask;
+       gic_arch_extn.irq_unmask = wakeupgen_unmask;
+       gic_arch_extn.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE;
+
+       /*
+        * FIXME: Add support to set_smp_affinity() once the core
+        * GIC code has necessary hooks in place.
+        */
+
+       /* Associate all the IRQs to boot CPU like GIC init does. */
+       for (i = 0; i < NR_IRQS; i++)
+               irq_target_cpu[i] = boot_cpu;
+
+       irq_hotplug_init();
+       irq_pm_init();
+
+       return 0;
+}
index 35ac3e5f6e94c4077e712cd8ae4333771eef3526..bc16c818c6b72e77ae276976c887b7a85647a9df 100644 (file)
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/memblock.h>
 
 #include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
+#include <asm/mach/map.h>
 
 #include <plat/irqs.h>
+#include <plat/sram.h>
 
 #include <mach/hardware.h>
-#include <mach/omap4-common.h>
+#include <mach/omap-wakeupgen.h>
+
+#include "common.h"
+#include "omap4-sar-layout.h"
 
 #ifdef CONFIG_CACHE_L2X0
-void __iomem *l2cache_base;
+static void __iomem *l2cache_base;
 #endif
 
-void __iomem *gic_dist_base_addr;
+static void __iomem *sar_ram_base;
+
+#ifdef CONFIG_OMAP4_ERRATA_I688
+/* Used to implement memory barrier on DRAM path */
+#define OMAP4_DRAM_BARRIER_VA                  0xfe600000
+
+void __iomem *dram_sync, *sram_sync;
+
+void omap_bus_sync(void)
+{
+       if (dram_sync && sram_sync) {
+               writel_relaxed(readl_relaxed(dram_sync), dram_sync);
+               writel_relaxed(readl_relaxed(sram_sync), sram_sync);
+               isb();
+       }
+}
+
+static int __init omap_barriers_init(void)
+{
+       struct map_desc dram_io_desc[1];
+       phys_addr_t paddr;
+       u32 size;
+
+       if (!cpu_is_omap44xx())
+               return -ENODEV;
 
+       size = ALIGN(PAGE_SIZE, SZ_1M);
+       paddr = memblock_alloc(size, SZ_1M);
+       if (!paddr) {
+               pr_err("%s: failed to reserve 4 Kbytes\n", __func__);
+               return -ENOMEM;
+       }
+       memblock_free(paddr, size);
+       memblock_remove(paddr, size);
+       dram_io_desc[0].virtual = OMAP4_DRAM_BARRIER_VA;
+       dram_io_desc[0].pfn = __phys_to_pfn(paddr);
+       dram_io_desc[0].length = size;
+       dram_io_desc[0].type = MT_MEMORY_SO;
+       iotable_init(dram_io_desc, ARRAY_SIZE(dram_io_desc));
+       dram_sync = (void __iomem *) dram_io_desc[0].virtual;
+       sram_sync = (void __iomem *) OMAP4_SRAM_VA;
+
+       pr_info("OMAP4: Map 0x%08llx to 0x%08lx for dram barrier\n",
+               (long long) paddr, dram_io_desc[0].virtual);
+
+       return 0;
+}
+core_initcall(omap_barriers_init);
+#endif
 
 void __init gic_init_irq(void)
 {
+       void __iomem *omap_irq_base;
+       void __iomem *gic_dist_base_addr;
+
        /* Static mapping, never released */
        gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
        BUG_ON(!gic_dist_base_addr);
@@ -41,11 +97,18 @@ void __init gic_init_irq(void)
        omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
        BUG_ON(!omap_irq_base);
 
+       omap_wakeupgen_init();
+
        gic_init(0, 29, gic_dist_base_addr, omap_irq_base);
 }
 
 #ifdef CONFIG_CACHE_L2X0
 
+void __iomem *omap4_get_l2cache_base(void)
+{
+       return l2cache_base;
+}
+
 static void omap4_l2x0_disable(void)
 {
        /* Disable PL310 L2 Cache controller */
@@ -71,7 +134,8 @@ static int __init omap_l2_cache_init(void)
 
        /* Static mapping, never released */
        l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
-       BUG_ON(!l2cache_base);
+       if (WARN_ON(!l2cache_base))
+               return -ENOMEM;
 
        /*
         * 16-way associativity, parity disabled
@@ -111,3 +175,30 @@ static int __init omap_l2_cache_init(void)
 }
 early_initcall(omap_l2_cache_init);
 #endif
+
+void __iomem *omap4_get_sar_ram_base(void)
+{
+       return sar_ram_base;
+}
+
+/*
+ * SAR RAM used to save and restore the HW
+ * context in low power modes
+ */
+static int __init omap4_sar_ram_init(void)
+{
+       /*
+        * To avoid code running on other OMAPs in
+        * multi-omap builds
+        */
+       if (!cpu_is_omap44xx())
+               return -ENOMEM;
+
+       /* Static mapping, never released */
+       sar_ram_base = ioremap(OMAP44XX_SAR_RAM_BASE, SZ_16K);
+       if (WARN_ON(!sar_ram_base))
+               return -ENOMEM;
+
+       return 0;
+}
+early_initcall(omap4_sar_ram_init);
diff --git a/arch/arm/mach-omap2/omap4-sar-layout.h b/arch/arm/mach-omap2/omap4-sar-layout.h
new file mode 100644 (file)
index 0000000..fe5b545
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * omap4-sar-layout.h: OMAP4 SAR RAM layout header file
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * 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 OMAP_ARCH_OMAP4_SAR_LAYOUT_H
+#define OMAP_ARCH_OMAP4_SAR_LAYOUT_H
+
+/*
+ * SAR BANK offsets from base address OMAP44XX_SAR_RAM_BASE
+ */
+#define SAR_BANK1_OFFSET               0x0000
+#define SAR_BANK2_OFFSET               0x1000
+#define SAR_BANK3_OFFSET               0x2000
+#define SAR_BANK4_OFFSET               0x3000
+
+/* Scratch pad memory offsets from SAR_BANK1 */
+#define SCU_OFFSET0                            0xd00
+#define SCU_OFFSET1                            0xd04
+#define OMAP_TYPE_OFFSET                       0xd10
+#define L2X0_SAVE_OFFSET0                      0xd14
+#define L2X0_SAVE_OFFSET1                      0xd18
+#define L2X0_AUXCTRL_OFFSET                    0xd1c
+#define L2X0_PREFETCH_CTRL_OFFSET              0xd20
+
+/* CPUx Wakeup Non-Secure Physical Address offsets in SAR_BANK3 */
+#define CPU0_WAKEUP_NS_PA_ADDR_OFFSET          0xa04
+#define CPU1_WAKEUP_NS_PA_ADDR_OFFSET          0xa08
+
+#define SAR_BACKUP_STATUS_OFFSET               (SAR_BANK3_OFFSET + 0x500)
+#define SAR_SECURE_RAM_SIZE_OFFSET             (SAR_BANK3_OFFSET + 0x504)
+#define SAR_SECRAM_SAVED_AT_OFFSET             (SAR_BANK3_OFFSET + 0x508)
+
+/* WakeUpGen save restore offset from OMAP44XX_SAR_RAM_BASE */
+#define WAKEUPGENENB_OFFSET_CPU0               (SAR_BANK3_OFFSET + 0x684)
+#define WAKEUPGENENB_SECURE_OFFSET_CPU0                (SAR_BANK3_OFFSET + 0x694)
+#define WAKEUPGENENB_OFFSET_CPU1               (SAR_BANK3_OFFSET + 0x6a4)
+#define WAKEUPGENENB_SECURE_OFFSET_CPU1                (SAR_BANK3_OFFSET + 0x6b4)
+#define AUXCOREBOOT0_OFFSET                    (SAR_BANK3_OFFSET + 0x6c4)
+#define AUXCOREBOOT1_OFFSET                    (SAR_BANK3_OFFSET + 0x6c8)
+#define PTMSYNCREQ_MASK_OFFSET                 (SAR_BANK3_OFFSET + 0x6cc)
+#define PTMSYNCREQ_EN_OFFSET                   (SAR_BANK3_OFFSET + 0x6d0)
+#define SAR_BACKUP_STATUS_WAKEUPGEN            0x10
+
+#endif
index 207a2ff9a8c4e1473c6c497ab8c969f64e0ac0c7..529142aff76699a85082179eb3e455d13a97959b 100644 (file)
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/cpu.h>
 #include "clockdomain.h"
 #include "powerdomain.h"
index 00bff46ca48beb606557f8fba7a1974f571ebb91..1881fe9151495ba4fd542146fcee7c208565cb63 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <plat/omap-pm.h>
 #include <plat/omap_device.h>
-#include <plat/common.h>
+#include "common.h"
 
 #include "voltage.h"
 #include "powerdomain.h"
index 4e166add2f351db8b423adfbbd262ccb8a3ff0e4..b737b11e4499f37a47176445649ffaa9614b7fcd 100644 (file)
@@ -21,6 +21,7 @@ extern void omap_sram_idle(void);
 extern int omap3_can_sleep(void);
 extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
 extern int omap3_idle_init(void);
+extern int omap4_idle_init(void);
 
 #if defined(CONFIG_PM_OPP)
 extern int omap3_opp_init(void);
index cf0c216132ab2a4f9aa67dd86a904ea954cb27ed..ef8595c802966e53993103fcbecaeed33318e1fe 100644 (file)
@@ -42,6 +42,7 @@
 #include <plat/dma.h>
 #include <plat/board.h>
 
+#include "common.h"
 #include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm2xxx_3xxx.h"
index efa66494c1e3c82ff6e1adfee5ef812d57e13089..fa637dfdda53f3ed593fea78b1030e6e9b5cd66f 100644 (file)
@@ -42,6 +42,7 @@
 #include <plat/gpmc.h>
 #include <plat/dma.h>
 
+#include "common.h"
 #include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 #include "prm-regbits-34xx.h"
index 59a870be8390289931bde435d0499952ec9ecb00..c264ef7219c171c38471a35dc7a1475fd5c5baa1 100644 (file)
@@ -1,8 +1,9 @@
 /*
  * OMAP4 Power Management Routines
  *
- * Copyright (C) 2010 Texas Instruments, Inc.
+ * Copyright (C) 2010-2011 Texas Instruments, Inc.
  * Rajendra Nayak <rnayak@ti.com>
+ * Santosh Shilimkar <santosh.shilimkar@ti.com>
  *
  * 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
 #include <linux/err.h>
 #include <linux/slab.h>
 
+#include "common.h"
+#include "clockdomain.h"
 #include "powerdomain.h"
-#include <mach/omap4-common.h>
+#include "pm.h"
 
 struct power_state {
        struct powerdomain *pwrdm;
        u32 next_state;
 #ifdef CONFIG_SUSPEND
        u32 saved_state;
+       u32 saved_logic_state;
 #endif
        struct list_head node;
 };
@@ -33,7 +37,50 @@ static LIST_HEAD(pwrst_list);
 #ifdef CONFIG_SUSPEND
 static int omap4_pm_suspend(void)
 {
-       do_wfi();
+       struct power_state *pwrst;
+       int state, ret = 0;
+       u32 cpu_id = smp_processor_id();
+
+       /* Save current powerdomain state */
+       list_for_each_entry(pwrst, &pwrst_list, node) {
+               pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm);
+               pwrst->saved_logic_state = pwrdm_read_logic_retst(pwrst->pwrdm);
+       }
+
+       /* Set targeted power domain states by suspend */
+       list_for_each_entry(pwrst, &pwrst_list, node) {
+               omap_set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
+               pwrdm_set_logic_retst(pwrst->pwrdm, PWRDM_POWER_OFF);
+       }
+
+       /*
+        * For MPUSS to hit power domain retention(CSWR or OSWR),
+        * CPU0 and CPU1 power domains need to be in OFF or DORMANT state,
+        * since CPU power domain CSWR is not supported by hardware
+        * Only master CPU follows suspend path. All other CPUs follow
+        * CPU hotplug path in system wide suspend. On OMAP4, CPU power
+        * domain CSWR is not supported by hardware.
+        * More details can be found in OMAP4430 TRM section 4.3.4.2.
+        */
+       omap4_enter_lowpower(cpu_id, PWRDM_POWER_OFF);
+
+       /* Restore next powerdomain state */
+       list_for_each_entry(pwrst, &pwrst_list, node) {
+               state = pwrdm_read_prev_pwrst(pwrst->pwrdm);
+               if (state > pwrst->next_state) {
+                       pr_info("Powerdomain (%s) didn't enter "
+                              "target state %d\n",
+                              pwrst->pwrdm->name, pwrst->next_state);
+                       ret = -1;
+               }
+               omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
+               pwrdm_set_logic_retst(pwrst->pwrdm, pwrst->saved_logic_state);
+       }
+       if (ret)
+               pr_crit("Could not enter target state in pm_suspend\n");
+       else
+               pr_info("Successfully put all powerdomains to target state\n");
+
        return 0;
 }
 
@@ -73,6 +120,22 @@ static const struct platform_suspend_ops omap_pm_ops = {
 };
 #endif /* CONFIG_SUSPEND */
 
+/*
+ * Enable hardware supervised mode for all clockdomains if it's
+ * supported. Initiate sleep transition for other clockdomains, if
+ * they are not used
+ */
+static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
+{
+       if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
+               clkdm_allow_idle(clkdm);
+       else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
+                       atomic_read(&clkdm->usecount) == 0)
+               clkdm_sleep(clkdm);
+       return 0;
+}
+
+
 static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
 {
        struct power_state *pwrst;
@@ -80,14 +143,48 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
        if (!pwrdm->pwrsts)
                return 0;
 
+       /*
+        * Skip CPU0 and CPU1 power domains. CPU1 is programmed
+        * through hotplug path and CPU0 explicitly programmed
+        * further down in the code path
+        */
+       if (!strncmp(pwrdm->name, "cpu", 3))
+               return 0;
+
+       /*
+        * FIXME: Remove this check when core retention is supported
+        * Only MPUSS power domain is added in the list.
+        */
+       if (strcmp(pwrdm->name, "mpu_pwrdm"))
+               return 0;
+
        pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC);
        if (!pwrst)
                return -ENOMEM;
+
        pwrst->pwrdm = pwrdm;
-       pwrst->next_state = PWRDM_POWER_ON;
+       pwrst->next_state = PWRDM_POWER_RET;
        list_add(&pwrst->node, &pwrst_list);
 
-       return pwrdm_set_next_pwrst(pwrst->pwrdm, pwrst->next_state);
+       return omap_set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
+}
+
+/**
+ * omap_default_idle - OMAP4 default ilde routine.'
+ *
+ * Implements OMAP4 memory, IO ordering requirements which can't be addressed
+ * with default arch_idle() hook. Used by all CPUs with !CONFIG_CPUIDLE and
+ * by secondary CPU with CONFIG_CPUIDLE.
+ */
+static void omap_default_idle(void)
+{
+       local_irq_disable();
+       local_fiq_disable();
+
+       omap_do_wfi();
+
+       local_fiq_enable();
+       local_irq_enable();
 }
 
 /**
@@ -99,10 +196,17 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
 static int __init omap4_pm_init(void)
 {
        int ret;
+       struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm;
+       struct clockdomain *ducati_clkdm, *l3_2_clkdm, *l4_per_clkdm;
 
        if (!cpu_is_omap44xx())
                return -ENODEV;
 
+       if (omap_rev() == OMAP4430_REV_ES1_0) {
+               WARN(1, "Power Management not supported on OMAP4430 ES1.0\n");
+               return -ENODEV;
+       }
+
        pr_err("Power Management for TI OMAP4.\n");
 
        ret = pwrdm_for_each(pwrdms_setup, NULL);
@@ -111,10 +215,51 @@ static int __init omap4_pm_init(void)
                goto err2;
        }
 
+       /*
+        * The dynamic dependency between MPUSS -> MEMIF and
+        * MPUSS -> L4_PER/L3_* and DUCATI -> L3_* doesn't work as
+        * expected. The hardware recommendation is to enable static
+        * dependencies for these to avoid system lock ups or random crashes.
+        */
+       mpuss_clkdm = clkdm_lookup("mpuss_clkdm");
+       emif_clkdm = clkdm_lookup("l3_emif_clkdm");
+       l3_1_clkdm = clkdm_lookup("l3_1_clkdm");
+       l3_2_clkdm = clkdm_lookup("l3_2_clkdm");
+       l4_per_clkdm = clkdm_lookup("l4_per_clkdm");
+       ducati_clkdm = clkdm_lookup("ducati_clkdm");
+       if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) ||
+               (!l3_2_clkdm) || (!ducati_clkdm) || (!l4_per_clkdm))
+               goto err2;
+
+       ret = clkdm_add_wkdep(mpuss_clkdm, emif_clkdm);
+       ret |= clkdm_add_wkdep(mpuss_clkdm, l3_1_clkdm);
+       ret |= clkdm_add_wkdep(mpuss_clkdm, l3_2_clkdm);
+       ret |= clkdm_add_wkdep(mpuss_clkdm, l4_per_clkdm);
+       ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm);
+       ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm);
+       if (ret) {
+               pr_err("Failed to add MPUSS -> L3/EMIF/L4PER, DUCATI -> L3 "
+                               "wakeup dependency\n");
+               goto err2;
+       }
+
+       ret = omap4_mpuss_init();
+       if (ret) {
+               pr_err("Failed to initialise OMAP4 MPUSS\n");
+               goto err2;
+       }
+
+       (void) clkdm_for_each(clkdms_setup, NULL);
+
 #ifdef CONFIG_SUSPEND
        suspend_set_ops(&omap_pm_ops);
 #endif /* CONFIG_SUSPEND */
 
+       /* Overwrite the default arch_idle() */
+       pm_idle = omap_default_idle;
+
+       omap4_idle_init();
+
 err2:
        return ret;
 }
index 597e2da831b30c048181cbd38e2d925c5d143213..626acfad719001714136704cba55fe99150128cf 100644 (file)
@@ -25,8 +25,7 @@
 #include <linux/delay.h>
 #include <linux/export.h>
 
-#include <mach/system.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/prcm.h>
 #include <plat/irqs.h>
 
@@ -59,7 +58,7 @@ u32 omap_prcm_get_reset_sources(void)
 EXPORT_SYMBOL(omap_prcm_get_reset_sources);
 
 /* Resets clock rates and reboots the system. Only called from system.h */
-static void omap_prcm_arch_reset(char mode, const char *cmd)
+void omap_prcm_restart(char mode, const char *cmd)
 {
        s16 prcm_offs = 0;
 
@@ -110,8 +109,6 @@ static void omap_prcm_arch_reset(char mode, const char *cmd)
        omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */
 }
 
-void (*arch_reset)(char, const char *) = omap_prcm_arch_reset;
-
 /**
  * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness
  * @reg: physical address of module IDLEST register
index 171fe171a749bec41ebb47a050cee73f5cc19646..ca669b50f3907182cfff3bf097e7354dd3fd3fc9 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prcm_mpu44xx.h"
 #include "cm-regbits-44xx.h"
index f02d87f68e5415ddefa5df4b00f0e88d085b4058..9a08ba397327647fab7a3c9be21f654a1b49e275 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/cpu.h>
 #include <plat/prcm.h>
 
index 495a31a7e8a7534cd3fdfca70b6a4e99686e4f6b..dd885eecf22a9e019cb0f48f7cd72113c6f63ee3 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/cpu.h>
 #include <plat/prcm.h>
 
index 3a7bab16edd5b4326d38fdfa93b00b82aa2a10ef..f6de5bc6b12ae2c116819aba0287f4e261560f4e 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prm44xx.h"
 #include "prminst44xx.h"
index 14caa228bc0d9b38b36ecf4f43bfff47663b5bc5..ee3a8ad304cbada51f3b21edff31d661b3704f53 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/io.h>
 
 #include <plat/io.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/clock.h>
 #include <plat/sdrc.h>
 
index 8f2782874771ad93c5466b0b74e6456d72d5b98c..e3d345f464094c0709382b9ab160ef70384f581d 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/clock.h>
 #include <plat/sram.h>
 
index ccdb010f169d32004caa0c7fa9940e75f44f2f27..791a63cdceb281fc165279b39bec613e8bb2b260 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/clock.h>
 #include <plat/sram.h>
 
index 9992dbfdfdb31deffcfbb0e01c5ebe19558f753d..42c326732a29a078f93f2a1874dadcfe5fd6c16c 100644 (file)
@@ -33,7 +33,7 @@
 #include <plat/omap-serial.h>
 #endif
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/board.h>
 #include <plat/clock.h>
 #include <plat/dma.h>
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S
new file mode 100644 (file)
index 0000000..abd2834
--- /dev/null
@@ -0,0 +1,379 @@
+/*
+ * OMAP44xx sleep code.
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * 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/linkage.h>
+#include <asm/system.h>
+#include <asm/smp_scu.h>
+#include <asm/memory.h>
+#include <asm/hardware/cache-l2x0.h>
+
+#include <plat/omap44xx.h>
+#include <mach/omap-secure.h>
+
+#include "common.h"
+#include "omap4-sar-layout.h"
+
+#if defined(CONFIG_SMP) && defined(CONFIG_PM)
+
+.macro DO_SMC
+       dsb
+       smc     #0
+       dsb
+.endm
+
+ppa_zero_params:
+       .word           0x0
+
+ppa_por_params:
+       .word           1, 0
+
+/*
+ * =============================
+ * == CPU suspend finisher ==
+ * =============================
+ *
+ * void omap4_finish_suspend(unsigned long cpu_state)
+ *
+ * This function code saves the CPU context and performs the CPU
+ * power down sequence. Calling WFI effectively changes the CPU
+ * power domains states to the desired target power state.
+ *
+ * @cpu_state : contains context save state (r0)
+ *     0 - No context lost
+ *     1 - CPUx L1 and logic lost: MPUSS CSWR
+ *     2 - CPUx L1 and logic lost + GIC lost: MPUSS OSWR
+ *     3 - CPUx L1 and logic lost + GIC + L2 lost: MPUSS OFF
+ * @return: This function never returns for CPU OFF and DORMANT power states.
+ * Post WFI, CPU transitions to DORMANT or OFF power state and on wake-up
+ * from this follows a full CPU reset path via ROM code to CPU restore code.
+ * The restore function pointer is stored at CPUx_WAKEUP_NS_PA_ADDR_OFFSET.
+ * It returns to the caller for CPU INACTIVE and ON power states or in case
+ * CPU failed to transition to targeted OFF/DORMANT state.
+ */
+ENTRY(omap4_finish_suspend)
+       stmfd   sp!, {lr}
+       cmp     r0, #0x0
+       beq     do_WFI                          @ No lowpower state, jump to WFI
+
+       /*
+        * Flush all data from the L1 data cache before disabling
+        * SCTLR.C bit.
+        */
+       bl      omap4_get_sar_ram_base
+       ldr     r9, [r0, #OMAP_TYPE_OFFSET]
+       cmp     r9, #0x1                        @ Check for HS device
+       bne     skip_secure_l1_clean
+       mov     r0, #SCU_PM_NORMAL
+       mov     r1, #0xFF                       @ clean seucre L1
+       stmfd   r13!, {r4-r12, r14}
+       ldr     r12, =OMAP4_MON_SCU_PWR_INDEX
+       DO_SMC
+       ldmfd   r13!, {r4-r12, r14}
+skip_secure_l1_clean:
+       bl      v7_flush_dcache_all
+
+       /*
+        * Clear the SCTLR.C bit to prevent further data cache
+        * allocation. Clearing SCTLR.C would make all the data accesses
+        * strongly ordered and would not hit the cache.
+        */
+       mrc     p15, 0, r0, c1, c0, 0
+       bic     r0, r0, #(1 << 2)               @ Disable the C bit
+       mcr     p15, 0, r0, c1, c0, 0
+       isb
+
+       /*
+        * Invalidate L1 data cache. Even though only invalidate is
+        * necessary exported flush API is used here. Doing clean
+        * on already clean cache would be almost NOP.
+        */
+       bl      v7_flush_dcache_all
+
+       /*
+        * Switch the CPU from Symmetric Multiprocessing (SMP) mode
+        * to AsymmetricMultiprocessing (AMP) mode by programming
+        * the SCU power status to DORMANT or OFF mode.
+        * This enables the CPU to be taken out of coherency by
+        * preventing the CPU from receiving cache, TLB, or BTB
+        * maintenance operations broadcast by other CPUs in the cluster.
+        */
+       bl      omap4_get_sar_ram_base
+       mov     r8, r0
+       ldr     r9, [r8, #OMAP_TYPE_OFFSET]
+       cmp     r9, #0x1                        @ Check for HS device
+       bne     scu_gp_set
+       mrc     p15, 0, r0, c0, c0, 5           @ Read MPIDR
+       ands    r0, r0, #0x0f
+       ldreq   r0, [r8, #SCU_OFFSET0]
+       ldrne   r0, [r8, #SCU_OFFSET1]
+       mov     r1, #0x00
+       stmfd   r13!, {r4-r12, r14}
+       ldr     r12, =OMAP4_MON_SCU_PWR_INDEX
+       DO_SMC
+       ldmfd   r13!, {r4-r12, r14}
+       b       skip_scu_gp_set
+scu_gp_set:
+       mrc     p15, 0, r0, c0, c0, 5           @ Read MPIDR
+       ands    r0, r0, #0x0f
+       ldreq   r1, [r8, #SCU_OFFSET0]
+       ldrne   r1, [r8, #SCU_OFFSET1]
+       bl      omap4_get_scu_base
+       bl      scu_power_mode
+skip_scu_gp_set:
+       mrc     p15, 0, r0, c1, c1, 2           @ Read NSACR data
+       tst     r0, #(1 << 18)
+       mrcne   p15, 0, r0, c1, c0, 1
+       bicne   r0, r0, #(1 << 6)               @ Disable SMP bit
+       mcrne   p15, 0, r0, c1, c0, 1
+       isb
+       dsb
+#ifdef CONFIG_CACHE_L2X0
+       /*
+        * Clean and invalidate the L2 cache.
+        * Common cache-l2x0.c functions can't be used here since it
+        * uses spinlocks. We are out of coherency here with data cache
+        * disabled. The spinlock implementation uses exclusive load/store
+        * instruction which can fail without data cache being enabled.
+        * OMAP4 hardware doesn't support exclusive monitor which can
+        * overcome exclusive access issue. Because of this, CPU can
+        * lead to deadlock.
+        */
+       bl      omap4_get_sar_ram_base
+       mov     r8, r0
+       mrc     p15, 0, r5, c0, c0, 5           @ Read MPIDR
+       ands    r5, r5, #0x0f
+       ldreq   r0, [r8, #L2X0_SAVE_OFFSET0]    @ Retrieve L2 state from SAR
+       ldrne   r0, [r8, #L2X0_SAVE_OFFSET1]    @ memory.
+       cmp     r0, #3
+       bne     do_WFI
+#ifdef CONFIG_PL310_ERRATA_727915
+       mov     r0, #0x03
+       mov     r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX
+       DO_SMC
+#endif
+       bl      omap4_get_l2cache_base
+       mov     r2, r0
+       ldr     r0, =0xffff
+       str     r0, [r2, #L2X0_CLEAN_INV_WAY]
+wait:
+       ldr     r0, [r2, #L2X0_CLEAN_INV_WAY]
+       ldr     r1, =0xffff
+       ands    r0, r0, r1
+       bne     wait
+#ifdef CONFIG_PL310_ERRATA_727915
+       mov     r0, #0x00
+       mov     r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX
+       DO_SMC
+#endif
+l2x_sync:
+       bl      omap4_get_l2cache_base
+       mov     r2, r0
+       mov     r0, #0x0
+       str     r0, [r2, #L2X0_CACHE_SYNC]
+sync:
+       ldr     r0, [r2, #L2X0_CACHE_SYNC]
+       ands    r0, r0, #0x1
+       bne     sync
+#endif
+
+do_WFI:
+       bl      omap_do_wfi
+
+       /*
+        * CPU is here when it failed to enter OFF/DORMANT or
+        * no low power state was attempted.
+        */
+       mrc     p15, 0, r0, c1, c0, 0
+       tst     r0, #(1 << 2)                   @ Check C bit enabled?
+       orreq   r0, r0, #(1 << 2)               @ Enable the C bit
+       mcreq   p15, 0, r0, c1, c0, 0
+       isb
+
+       /*
+        * Ensure the CPU power state is set to NORMAL in
+        * SCU power state so that CPU is back in coherency.
+        * In non-coherent mode CPU can lock-up and lead to
+        * system deadlock.
+        */
+       mrc     p15, 0, r0, c1, c0, 1
+       tst     r0, #(1 << 6)                   @ Check SMP bit enabled?
+       orreq   r0, r0, #(1 << 6)
+       mcreq   p15, 0, r0, c1, c0, 1
+       isb
+       bl      omap4_get_sar_ram_base
+       mov     r8, r0
+       ldr     r9, [r8, #OMAP_TYPE_OFFSET]
+       cmp     r9, #0x1                        @ Check for HS device
+       bne     scu_gp_clear
+       mov     r0, #SCU_PM_NORMAL
+       mov     r1, #0x00
+       stmfd   r13!, {r4-r12, r14}
+       ldr     r12, =OMAP4_MON_SCU_PWR_INDEX
+       DO_SMC
+       ldmfd   r13!, {r4-r12, r14}
+       b       skip_scu_gp_clear
+scu_gp_clear:
+       bl      omap4_get_scu_base
+       mov     r1, #SCU_PM_NORMAL
+       bl      scu_power_mode
+skip_scu_gp_clear:
+       isb
+       dsb
+       ldmfd   sp!, {pc}
+ENDPROC(omap4_finish_suspend)
+
+/*
+ * ============================
+ * == CPU resume entry point ==
+ * ============================
+ *
+ * void omap4_cpu_resume(void)
+ *
+ * ROM code jumps to this function while waking up from CPU
+ * OFF or DORMANT state. Physical address of the function is
+ * stored in the SAR RAM while entering to OFF or DORMANT mode.
+ * The restore function pointer is stored at CPUx_WAKEUP_NS_PA_ADDR_OFFSET.
+ */
+ENTRY(omap4_cpu_resume)
+       /*
+        * Configure ACTRL and enable NS SMP bit access on CPU1 on HS device.
+        * OMAP44XX EMU/HS devices - CPU0 SMP bit access is enabled in PPA
+        * init and for CPU1, a secure PPA API provided. CPU0 must be ON
+        * while executing NS_SMP API on CPU1 and PPA version must be 1.4.0+.
+        * OMAP443X GP devices- SMP bit isn't accessible.
+        * OMAP446X GP devices - SMP bit access is enabled on both CPUs.
+        */
+       ldr     r8, =OMAP44XX_SAR_RAM_BASE
+       ldr     r9, [r8, #OMAP_TYPE_OFFSET]
+       cmp     r9, #0x1                        @ Skip if GP device
+       bne     skip_ns_smp_enable
+       mrc     p15, 0, r0, c0, c0, 5
+       ands    r0, r0, #0x0f
+       beq     skip_ns_smp_enable
+ppa_actrl_retry:
+       mov     r0, #OMAP4_PPA_CPU_ACTRL_SMP_INDEX
+       adr     r3, ppa_zero_params             @ Pointer to parameters
+       mov     r1, #0x0                        @ Process ID
+       mov     r2, #0x4                        @ Flag
+       mov     r6, #0xff
+       mov     r12, #0x00                      @ Secure Service ID
+       DO_SMC
+       cmp     r0, #0x0                        @ API returns 0 on success.
+       beq     enable_smp_bit
+       b       ppa_actrl_retry
+enable_smp_bit:
+       mrc     p15, 0, r0, c1, c0, 1
+       tst     r0, #(1 << 6)                   @ Check SMP bit enabled?
+       orreq   r0, r0, #(1 << 6)
+       mcreq   p15, 0, r0, c1, c0, 1
+       isb
+skip_ns_smp_enable:
+#ifdef CONFIG_CACHE_L2X0
+       /*
+        * Restore the L2 AUXCTRL and enable the L2 cache.
+        * OMAP4_MON_L2X0_AUXCTRL_INDEX =  Program the L2X0 AUXCTRL
+        * OMAP4_MON_L2X0_CTRL_INDEX =  Enable the L2 using L2X0 CTRL
+        * register r0 contains value to be programmed.
+        * L2 cache is already invalidate by ROM code as part
+        * of MPUSS OFF wakeup path.
+        */
+       ldr     r2, =OMAP44XX_L2CACHE_BASE
+       ldr     r0, [r2, #L2X0_CTRL]
+       and     r0, #0x0f
+       cmp     r0, #1
+       beq     skip_l2en                       @ Skip if already enabled
+       ldr     r3, =OMAP44XX_SAR_RAM_BASE
+       ldr     r1, [r3, #OMAP_TYPE_OFFSET]
+       cmp     r1, #0x1                        @ Check for HS device
+       bne     set_gp_por
+       ldr     r0, =OMAP4_PPA_L2_POR_INDEX
+       ldr     r1, =OMAP44XX_SAR_RAM_BASE
+       ldr     r4, [r1, #L2X0_PREFETCH_CTRL_OFFSET]
+       adr     r3, ppa_por_params
+       str     r4, [r3, #0x04]
+       mov     r1, #0x0                        @ Process ID
+       mov     r2, #0x4                        @ Flag
+       mov     r6, #0xff
+       mov     r12, #0x00                      @ Secure Service ID
+       DO_SMC
+       b       set_aux_ctrl
+set_gp_por:
+       ldr     r1, =OMAP44XX_SAR_RAM_BASE
+       ldr     r0, [r1, #L2X0_PREFETCH_CTRL_OFFSET]
+       ldr     r12, =OMAP4_MON_L2X0_PREFETCH_INDEX     @ Setup L2 PREFETCH
+       DO_SMC
+set_aux_ctrl:
+       ldr     r1, =OMAP44XX_SAR_RAM_BASE
+       ldr     r0, [r1, #L2X0_AUXCTRL_OFFSET]
+       ldr     r12, =OMAP4_MON_L2X0_AUXCTRL_INDEX      @ Setup L2 AUXCTRL
+       DO_SMC
+       mov     r0, #0x1
+       ldr     r12, =OMAP4_MON_L2X0_CTRL_INDEX         @ Enable L2 cache
+       DO_SMC
+skip_l2en:
+#endif
+
+       b       cpu_resume                      @ Jump to generic resume
+ENDPROC(omap4_cpu_resume)
+#endif
+
+#ifndef CONFIG_OMAP4_ERRATA_I688
+ENTRY(omap_bus_sync)
+       mov     pc, lr
+ENDPROC(omap_bus_sync)
+#endif
+
+ENTRY(omap_do_wfi)
+       stmfd   sp!, {lr}
+       /* Drain interconnect write buffers. */
+       bl omap_bus_sync
+
+       /*
+        * Execute an ISB instruction to ensure that all of the
+        * CP15 register changes have been committed.
+        */
+       isb
+
+       /*
+        * Execute a barrier instruction to ensure that all cache,
+        * TLB and branch predictor maintenance operations issued
+        * by any CPU in the cluster have completed.
+        */
+       dsb
+       dmb
+
+       /*
+        * Execute a WFI instruction and wait until the
+        * STANDBYWFI output is asserted to indicate that the
+        * CPU is in idle and low power state. CPU can specualatively
+        * prefetch the instructions so add NOPs after WFI. Sixteen
+        * NOPs as per Cortex-A9 pipeline.
+        */
+       wfi                                     @ Wait For Interrupt
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+
+       ldmfd   sp!, {pc}
+ENDPROC(omap_do_wfi)
index cf246b39bac745dc315576ecc161c35666643381..9dd93453e563eaa666b2640663d529dc9102c928 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "pm.h"
 #include "smartreflex.h"
index 037b0d7d4e05b1b77f0d93035283484ce3ba1078..9edcd520510fef4953ae0f5708cdaab287fa76dd 100644 (file)
@@ -41,7 +41,7 @@
 #include <plat/dmtimer.h>
 #include <asm/localtimer.h>
 #include <asm/sched_clock.h>
-#include <plat/common.h>
+#include "common.h"
 #include <plat/omap_hwmod.h>
 #include <plat/omap_device.h>
 #include <plat/omap-pm.h>
index cfe348e1af0eca9316779adbd684834947015441..a5ec7f8f2ea86810261c890c080b31a17f44652d 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prm-regbits-34xx.h"
 #include "voltage.h"
index 2740a968145e2bdf2840c8c5298789f80956baf3..d70b930f2739e22ce726a93474d104684409a480 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
index 1f8fdf736e630976bc97fc781d58bfbf85704179..8a36342e60d2aaf23ad434152e208b7ee5d1b8fd 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/slab.h>
 #include <linux/clk.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prm-regbits-34xx.h"
 #include "prm-regbits-44xx.h"
index 071101debbbc1269153a43e1c04336e42a365a0e..474559d5b072c848e5ffc69f046a5fff5aefa1ee 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 
-#include <plat/common.h>
+#include "common.h"
 #include <plat/cpu.h>
 
 #include "prm-regbits-34xx.h"
index c4584e9ac717993c6b709b0335438c7efc4442a9..4e11d022595d13fa349601bf5c194fe69e0a40d3 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prm-regbits-44xx.h"
 #include "prm44xx.h"
index 66bd700a2b9846d837ac0a8a7cd1f78f61778754..807391d84a9dcd6aa394bb71b3729e97de542f67 100644 (file)
@@ -1,7 +1,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "voltage.h"
 #include "vp.h"
index 260c554b15472ba30e67002a011c1d38fe130bf3..bd89f80089f5b2c1e32cf6246ed43a82dad4ca6d 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prm-regbits-34xx.h"
 #include "voltage.h"
index b4e77044891e4ce476c620e2e7878852d047c6b9..8c031d16879e8b833c281be6267a88ced41bd38d 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 
-#include <plat/common.h>
+#include "common.h"
 
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
index 22ace0bf2f9239278bba364f21627a622a6dc80b..41127e80cc1e961369679e91dd8c1e87196baf98 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/mbus.h>
 #include <linux/mv643xx_i2c.h>
 #include <linux/ata_platform.h>
+#include <linux/delay.h>
 #include <net/dsa.h>
 #include <asm/page.h>
 #include <asm/setup.h>
@@ -304,6 +305,17 @@ void __init orion5x_init(void)
        orion5x_wdt_init();
 }
 
+void orion5x_restart(char mode, const char *cmd)
+{
+       /*
+        * Enable and issue soft reset
+        */
+       orion5x_setbits(RSTOUTn_MASK, (1 << 2));
+       orion5x_setbits(CPU_SOFT_RESET, 1);
+       mdelay(200);
+       orion5x_clrbits(CPU_SOFT_RESET, 1);
+}
+
 /*
  * Many orion-based systems have buggy bootloader implementations.
  * This is a common fixup for bogus memory tags.
index 909489f4d23eb257de4450369d282d5217d3e446..37ef18de61b7742bec93d8a4c4008e16cda5d7fd 100644 (file)
@@ -39,6 +39,7 @@ void orion5x_spi_init(void);
 void orion5x_uart0_init(void);
 void orion5x_uart1_init(void);
 void orion5x_xor_init(void);
+void orion5x_restart(char, const char *);
 
 /*
  * PCIe/PCI functions.
index 8c8300951f46d954bc732f10cd8635d975b14453..d75dcfa0f01c51bc05f11331d14ad28ba7a32118 100644 (file)
@@ -343,6 +343,7 @@ MACHINE_START(D2NET, "LaCie d2 Network")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
 #endif
 
@@ -355,6 +356,7 @@ MACHINE_START(BIGDISK, "LaCie Big Disk Network")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
 #endif
 
index 4b79a80d5e1f67154adc0544e484726e0d5f3686..a104d5a80e111fec985bc207f5c6419f3e0ef4ee 100644 (file)
@@ -364,4 +364,5 @@ MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
+       .restart        = orion5x_restart,
 MACHINE_END
index 343f60e9639fe54a9f3cf59978ceb17730d6fcb6..91b0f47885977e80ba5109f6b4205ce4b30de3b8 100644 (file)
@@ -736,4 +736,5 @@ MACHINE_START(DNS323, "D-Link DNS-323")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 70a4e9265f06dc636a326e7628291078448c109a..355e962137c7cbee346142f7a66756c063bd4f19 100644 (file)
@@ -258,4 +258,5 @@ MACHINE_START(EDMINI_V2, "LaCie Ethernet Disk mini V2")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index c5196101a237ac960ccd1eefce8792e6483a8a93..e9d9afdc26594f2936c85faeba3e2b454e1f9d1a 100644 (file)
 
 #define IO_SPACE_LIMIT         0xffffffff
 
-static inline void __iomem *
-__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
-{
-       void __iomem *retval;
-       unsigned long offs = paddr - ORION5X_REGS_PHYS_BASE;
-       if (mtype == MT_DEVICE && size && offs < ORION5X_REGS_SIZE &&
-           size <= ORION5X_REGS_SIZE && offs + size <= ORION5X_REGS_SIZE) {
-               retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + offs;
-       } else {
-               retval = __arm_ioremap(paddr, size, mtype);
-       }
-
-       return retval;
-}
-
-static inline void
-__arch_iounmap(void __iomem *addr)
-{
-       if (addr < (void __iomem *)ORION5X_REGS_VIRT_BASE ||
-           addr >= (void __iomem *)(ORION5X_REGS_VIRT_BASE + ORION5X_REGS_SIZE))
-               __iounmap(addr);
-}
-
-#define __arch_ioremap         __arch_ioremap
-#define __arch_iounmap         __arch_iounmap
 #define __io(a)                        __typesafe_io(a)
 #define __mem_pci(a)           (a)
 
index a1d6e46ab0355fd5e6410ff4449bbcca28427d81..825a2650cefa7bd219aef05cd76cd01adcc195bf 100644 (file)
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <mach/bridge-regs.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /*
-        * Enable and issue soft reset
-        */
-       orion5x_setbits(RSTOUTn_MASK, (1 << 2));
-       orion5x_setbits(CPU_SOFT_RESET, 1);
-       mdelay(200);
-       orion5x_clrbits(CPU_SOFT_RESET, 1);
-}
-
-
 #endif
diff --git a/arch/arm/mach-orion5x/include/mach/vmalloc.h b/arch/arm/mach-orion5x/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 06b50ae..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * arch/arm/mach-orion5x/include/mach/vmalloc.h
- */
-
-#define VMALLOC_END       0xfd800000UL
index d3cd3f63258a63dbd2e7354a239f188ee8f3de37..47587b83284299ae562ba20a5ff422c9668e5b86 100644 (file)
@@ -386,6 +386,7 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
 #endif
 
@@ -399,5 +400,6 @@ MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
 #endif
index 9503fff404e3c5078527ec000bcb1a7287538142..527213169db07348d57c27e336b984db53e5ec35 100644 (file)
@@ -140,7 +140,7 @@ static struct mv_sata_platform_data lschl_sata_data = {
 
 static void lschl_power_off(void)
 {
-       arm_machine_restart('h', NULL);
+       orion5x_restart('h', NULL);
 }
 
 /*****************************************************************************
@@ -325,4 +325,5 @@ MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index ed6d772f4a24a233e17a70b705b989c4fd4fcec5..9a8697b97dd7d75d023fafe413beb270d97f0dca 100644 (file)
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data ls_hgl_sata_data = {
 
 static void ls_hgl_power_off(void)
 {
-       arm_machine_restart('h', NULL);
+       orion5x_restart('h', NULL);
 }
 
 
@@ -272,4 +272,5 @@ MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 743f7f1db181a43b7d40d89c139125335009931f..09c73659f467021631a3f769a58d5c2c9401d9e9 100644 (file)
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data lsmini_sata_data = {
 
 static void lsmini_power_off(void)
 {
-       arm_machine_restart('h', NULL);
+       orion5x_restart('h', NULL);
 }
 
 
@@ -274,5 +274,6 @@ MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
 #endif
index 6020e26b1c7164700081ecc81ff8bedadf15a884..65faaa34de61382c6f74e2a90f0070f69c2adf58 100644 (file)
@@ -267,5 +267,6 @@ MACHINE_START(MSS2, "Maxtor Shared Storage II")
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
-       .fixup          = tag_fixup_mem32
+       .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 201ae3676289f53fed5acbdaedba1a9b6f08ca5a..c87fde4deecad440b12482e9789eeea11ea08915 100644 (file)
@@ -234,5 +234,6 @@ MACHINE_START(MV2120, "HP Media Vault mv2120")
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
-       .fixup          = tag_fixup_mem32
+       .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 6197c79a2ecb7a38260eb6e437cab38f49e6aafb..0180c393c711a6267e75b59933a982605db9464b 100644 (file)
@@ -426,5 +426,6 @@ MACHINE_START(NET2BIG, "LaCie 2Big Network")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
 
index ebd6767d8e88d5e3d467198b599756776f282335..292038fc59fdd70f8b0db81c9f95a2d52cd0e116 100644 (file)
@@ -175,4 +175,5 @@ MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 05db2d336b0891655a04e5e430a8fd8c3dc25130..c44eabaabc1650d487f0a066a5ac1cdffebd23ab 100644 (file)
@@ -187,4 +187,5 @@ MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index e47fa0578ae3f8e4f25782cd07ff067835481adf..96438b6b2022294297f8fc23390546f877f2b139 100644 (file)
@@ -311,4 +311,5 @@ MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
+       .restart        = orion5x_restart,
 MACHINE_END
index 64317251ec008c93d2890ec3c38e2a3c33a66a3e..2c5fab00d205c9414ba44483b9f896c9864e1509 100644 (file)
@@ -128,4 +128,5 @@ MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 29f1526f7b70671129cebe330ab8c8b7656cb764..632a861ef82bcf9e85336e87fafb27a0f68aba3a 100644 (file)
@@ -364,4 +364,5 @@ MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 31e51f9b4b6402b3c5131168719cd0aed6c9d4ac..5d6408745582b1341845a5b6ccb76f54e11ca8b9 100644 (file)
@@ -178,7 +178,7 @@ static struct hw_pci qnap_ts209_pci __initdata = {
 
 static int __init qnap_ts209_pci_init(void)
 {
-       if (machine_is_ts_x09())
+       if (machine_is_ts209())
                pci_common_init(&qnap_ts209_pci);
 
        return 0;
@@ -329,4 +329,5 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 0fbcc14e09d7d7c55bb397721c4c84d9eff90d70..4e6ff759cd3293df880f5fc1d2f2fbaf422e067c 100644 (file)
@@ -318,4 +318,5 @@ MACHINE_START(TS409, "QNAP TS-409")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index b35e2005a348e6fbc4c960d83e0d2d0d75cf889f..c96f37472edac0db7932d466935a4ba0f3d2b28d 100644 (file)
@@ -627,4 +627,5 @@ MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
+       .restart        = orion5x_restart,
 MACHINE_END
index b8be7d8d0cf406a6690412b45074fc2fedd4c84f..078c03f7cd52a2d6c13413aae2490aae0377dc09 100644 (file)
@@ -179,4 +179,5 @@ MACHINE_START(WNR854T, "Netgear WNR854T")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index faf81a0393600a7742ac645edd29570ec0c06600..46a9778171ce8b9da2ee0eafaad67f467d1f21f7 100644 (file)
@@ -267,4 +267,5 @@ MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
+       .restart        = orion5x_restart,
 MACHINE_END
index 34d08347be5f1684490163cb0ca027af76f5057e..ad871bd7b1abe1754e05eeadaa099cac6e189091 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
@@ -33,22 +34,20 @@ static const char *picoxcell_dt_match[] = {
 };
 
 static const struct of_device_id vic_of_match[] __initconst = {
-       { .compatible = "arm,pl192-vic" },
+       { .compatible = "arm,pl192-vic", .data = vic_of_init, },
        { /* Sentinel */ }
 };
 
 static void __init picoxcell_init_irq(void)
 {
-       vic_init(IO_ADDRESS(PICOXCELL_VIC0_BASE), 0, ~0, 0);
-       vic_init(IO_ADDRESS(PICOXCELL_VIC1_BASE), 32, ~0, 0);
-       irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC0_BASE, 0);
-       irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC1_BASE, 32);
+       of_irq_init(vic_of_match);
 }
 
 DT_MACHINE_START(PICOXCELL, "Picochip picoXcell")
        .map_io         = picoxcell_map_io,
        .nr_irqs        = ARCH_NR_IRQS,
        .init_irq       = picoxcell_init_irq,
+       .handle_irq     = vic_handle_irq,
        .timer          = &picoxcell_timer,
        .init_machine   = picoxcell_init_machine,
        .dt_compat      = picoxcell_dt_match,
index a6b09f75d9dfad6a685544a776c8c7581a6fa992..9b505ac00be9d570774b520f3a7b7c0121d0f966 100644 (file)
@@ -9,11 +9,8 @@
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <mach/hardware.h>
-#include <mach/irqs.h>
-#include <mach/map.h>
+       .macro  disable_fiq
+       .endm
 
-#define VA_VIC0                IO_ADDRESS(PICOXCELL_VIC0_BASE)
-#define VA_VIC1                IO_ADDRESS(PICOXCELL_VIC1_BASE)
-
-#include <asm/entry-macro-vic2.S>
+       .macro  arch_ret_to_user, tmp1, tmp2
+       .endm
index 67c589b0c1bcfc2acb52d8668bbd6c3079d06805..1a5d8cb57df4a2faba66c90a50ef4054443c45c2 100644 (file)
@@ -23,9 +23,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(int mode, const char *cmd)
-{
-       /* Watchdog reset to go here. */
-}
-
 #endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-picoxcell/include/mach/vmalloc.h b/arch/arm/mach-picoxcell/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 0216cc4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (c) 2011 Picochip Ltd., Jamie Iles
- *
- * 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.
- */
-#define VMALLOC_END    0xfe000000UL
index cdb95e726f5c285f06fc63aa9d4191a1817fb476..4cfb40b2ec19f2b866da3e9e3b24b7a3451bcc66 100644 (file)
@@ -260,6 +260,11 @@ void __init pnx4008_map_io(void)
        iotable_init(pnx4008_io_desc, ARRAY_SIZE(pnx4008_io_desc));
 }
 
+static void pnx4008_restart(char mode, const char *cmd)
+{
+       soft_restart(0);
+}
+
 extern struct sys_timer pnx4008_timer;
 
 MACHINE_START(PNX4008, "Philips PNX4008")
@@ -269,4 +274,5 @@ MACHINE_START(PNX4008, "Philips PNX4008")
        .init_irq               = pnx4008_init_irq,
        .init_machine           = pnx4008_init,
        .timer                  = &pnx4008_timer,
+       .restart                = pnx4008_restart,
 MACHINE_END
index 5dda2bb55f8d838fb817877572feafb7fc076004..60cfe71880912d046b5206d707070fba3c43c7f5 100644 (file)
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
 static void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       cpu_reset(0);
-}
-
 #endif
diff --git a/arch/arm/mach-pnx4008/include/mach/vmalloc.h b/arch/arm/mach-pnx4008/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 184913c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * arch/arm/mach-pnx4008/include/mach/vmalloc.h
- *
- * Author: Vitaly Wool <source@mvista.com>
- *
- * 2006 (c) MontaVista Software, Inc. 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.
- */
-
-/*
- * Just any arbitrary offset to the start of the vmalloc VM area: the
- * current 8MB value just means that there will be a 8MB "hole" after the
- * physical memory until the kernel virtual memory starts.  That means that
- * any out-of-bounds memory accesses will hopefully be caught.
- * The vmalloc() routines leaves a hole of 4kB between each vmalloced
- * area for the same reason. ;)
- */
-#define VMALLOC_END       0xd0000000UL
index 83e5d2128118487d77a8c1215e1b4ee792a1645f..b28a930d4f8ad0e0cf2f54deec014d4233d00a16 100644 (file)
@@ -16,6 +16,7 @@ extern struct sys_timer sirfsoc_timer;
 
 extern void __init sirfsoc_of_irq_init(void);
 extern void __init sirfsoc_of_clk_init(void);
+extern void sirfsoc_restart(char, const char *);
 
 #ifndef CONFIG_DEBUG_LL
 static inline void sirfsoc_map_lluart(void)  {}
index 66b1ae2e553f628ac5283db8524a4bd242d6f426..6f243532570cb59637af65454fe14c1883e64b4f 100644 (file)
@@ -9,8 +9,10 @@
 #ifndef __MACH_PRIMA2_MAP_H__
 #define __MACH_PRIMA2_MAP_H__
 
-#include <mach/vmalloc.h>
+#include <linux/const.h>
 
-#define SIRFSOC_VA(x)                  (VMALLOC_END + ((x) & 0x00FFF000))
+#define SIRFSOC_VA_BASE                _AC(0xFEC00000, UL)
+
+#define SIRFSOC_VA(x)          (SIRFSOC_VA_BASE + ((x) & 0x00FFF000))
 
 #endif
index 0dbd257ad16d06856bae63e5da8920ea647e5d86..2c7d2a9d0c927f32884b3115ac6ad590e30dc0c4 100644 (file)
@@ -9,21 +9,9 @@
 #ifndef __MACH_SYSTEM_H__
 #define __MACH_SYSTEM_H__
 
-#include <linux/bitops.h>
-#include <mach/hardware.h>
-
-#define SIRFSOC_SYS_RST_BIT  BIT(31)
-
-extern void __iomem *sirfsoc_rstc_base;
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base);
-}
-
 #endif
diff --git a/arch/arm/mach-prima2/include/mach/vmalloc.h b/arch/arm/mach-prima2/include/mach/vmalloc.h
deleted file mode 100644 (file)
index c9f90fe..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * arch/arm/ach-prima2/include/mach/vmalloc.h
- *
- * Copyright (c) 2010 â€“ 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
- *
- * Licensed under GPLv2 or later.
- */
-
-#ifndef __MACH_VMALLOC_H
-#define __MACH_VMALLOC_H
-
-#include <linux/const.h>
-
-#define VMALLOC_END    _AC(0xFEC00000, UL)
-
-#endif
index a12b689a87026c9e06af50351b2b20d8c7e01d7d..02b9c05ff9905b5ca94d1f5672709fe68d6b8c5c 100644 (file)
@@ -40,4 +40,5 @@ MACHINE_START(PRIMA2_EVB, "prima2cb")
        .dma_zone_size  = SZ_256M,
        .init_machine   = sirfsoc_mach_init,
        .dt_compat      = prima2cb_dt_match,
+       .restart        = sirfsoc_restart,
 MACHINE_END
index 492cfa8d261073eac1d17498bee1af9123b77c00..762adb73ab7c9ece0de51b87f09cd6c5208f5576 100644 (file)
@@ -68,3 +68,10 @@ int sirfsoc_reset_device(struct device *dev)
 
        return 0;
 }
+
+#define SIRFSOC_SYS_RST_BIT  BIT(31)
+
+void sirfsoc_restart(char mode, const char *cmd)
+{
+       writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base);
+}
index 4cb069fd9af2e82b8504f032993bd696be6d4c70..ccdac4b6a4696db1e3bcfb5bf6912496c041c498 100644 (file)
@@ -138,7 +138,7 @@ static void am200_cleanup(struct metronomefb_par *par)
 {
        int i;
 
-       free_irq(IRQ_GPIO(RDY_GPIO_PIN), par);
+       free_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), par);
 
        for (i = 0; i < ARRAY_SIZE(gpios); i++)
                gpio_free(gpios[i]);
@@ -292,7 +292,7 @@ static int am200_setup_irq(struct fb_info *info)
 {
        int ret;
 
-       ret = request_irq(IRQ_GPIO(RDY_GPIO_PIN), am200_handle_irq,
+       ret = request_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), am200_handle_irq,
                                IRQF_DISABLED|IRQF_TRIGGER_FALLING,
                                "AM200", info->par);
        if (ret)
index fa8bad235d9f94d7b374d58c5e4d4d12efa5059d..76c4b9494031c46050ef1704738bf4bbd7097561 100644 (file)
@@ -176,7 +176,7 @@ static void am300_cleanup(struct broadsheetfb_par *par)
 {
        int i;
 
-       free_irq(IRQ_GPIO(RDY_GPIO_PIN), par);
+       free_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), par);
 
        for (i = 0; i < ARRAY_SIZE(gpios); i++)
                gpio_free(gpios[i]);
@@ -240,7 +240,7 @@ static int am300_setup_irq(struct fb_info *info)
        int ret;
        struct broadsheetfb_par *par = info->par;
 
-       ret = request_irq(IRQ_GPIO(RDY_GPIO_PIN), am300_handle_irq,
+       ret = request_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), am300_handle_irq,
                                IRQF_DISABLED|IRQF_TRIGGER_RISING,
                                "AM300", par);
        if (ret)
index 4b81f59a4cbaf5aebbac8c1d55980d9b4dd45618..5971c4653fd06ea9bc09110ed588b86f15a26389 100644 (file)
@@ -179,7 +179,7 @@ static unsigned long balloon3_ac97_pin_config[] __initdata = {
 };
 
 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
-       .irq            = IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ),
+       .irq            = PXA_GPIO_TO_IRQ(BALLOON3_GPIO_CODEC_IRQ),
 };
 
 
@@ -829,4 +829,5 @@ MACHINE_START(BALLOON3, "Balloon3")
        .timer          = &pxa_timer,
        .init_machine   = balloon3_init,
        .atag_offset    = 0x100,
+       .restart        = pxa_restart,
 MACHINE_END
index 4efc16d39c7985810d45b683fdab335a988ab9e3..c91727d1fe097ab5bf01d0dbf261afefc7748775 100644 (file)
@@ -50,8 +50,8 @@ static struct resource capc7117_ide_resources[] = {
               .flags = IORESOURCE_MEM
        },
        [2] = {
-              .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
-              .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
+              .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
+              .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
               .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
        }
 };
@@ -80,7 +80,7 @@ static void __init capc7117_ide_init(void)
 static struct plat_serial8250_port ti16c752_platform_data[] = {
        [0] = {
               .mapbase = 0x14000000,
-              .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO78)),
+              .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)),
               .irqflags = IRQF_TRIGGER_RISING,
               .flags = TI16C752_FLAGS,
               .iotype = UPIO_MEM,
@@ -89,7 +89,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
        },
        [1] = {
               .mapbase = 0x14000040,
-              .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO79)),
+              .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)),
               .irqflags = IRQF_TRIGGER_RISING,
               .flags = TI16C752_FLAGS,
               .iotype = UPIO_MEM,
@@ -98,7 +98,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
        },
        [2] = {
               .mapbase = 0x14000080,
-              .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO80)),
+              .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)),
               .irqflags = IRQF_TRIGGER_RISING,
               .flags = TI16C752_FLAGS,
               .iotype = UPIO_MEM,
@@ -107,7 +107,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
        },
        [3] = {
               .mapbase = 0x140000c0,
-              .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO81)),
+              .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)),
               .irqflags = IRQF_TRIGGER_RISING,
               .flags = TI16C752_FLAGS,
               .iotype = UPIO_MEM,
@@ -153,5 +153,6 @@ MACHINE_START(CAPC7117,
        .init_irq = pxa3xx_init_irq,
        .handle_irq = pxa3xx_handle_irq,
        .timer = &pxa_timer,
-       .init_machine = capc7117_init
+       .init_machine = capc7117_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 13518a7053994dbfe6c4ce422ee994a88d3e21f4..431ef56700c419f4fa04cc73cd999644d4ba1a6e 100644 (file)
@@ -33,7 +33,7 @@
 /* GPIO IRQ usage */
 #define GPIO83_MMC_IRQ         (83)
 
-#define CMX270_MMC_IRQ         IRQ_GPIO(GPIO83_MMC_IRQ)
+#define CMX270_MMC_IRQ         PXA_GPIO_TO_IRQ(GPIO83_MMC_IRQ)
 
 /* MMC power enable */
 #define GPIO105_MMC_POWER      (105)
@@ -380,7 +380,7 @@ static struct spi_board_info cm_x270_spi_devices[] __initdata = {
                .modalias               = "libertas_spi",
                .max_speed_hz           = 13000000,
                .bus_num                = 2,
-               .irq                    = gpio_to_irq(95),
+               .irq                    = PXA_GPIO_TO_IRQ(95),
                .chip_select            = 0,
                .controller_data        = &cm_x270_libertas_chip,
                .platform_data          = &cm_x270_libertas_pdata,
index f2e4190080cbd2b5584fe03c1ce6aeae705b94e7..8fa4ad27edf3c89a1bf87a8d087ef1b3b8bad16a 100644 (file)
@@ -58,8 +58,8 @@ extern void cmx270_init(void);
 #define CMX255_GPIO_IT8152_IRQ (0)
 #define CMX270_GPIO_IT8152_IRQ (22)
 
-#define CMX255_ETHIRQ          IRQ_GPIO(GPIO22_ETHIRQ)
-#define CMX270_ETHIRQ          IRQ_GPIO(GPIO10_ETHIRQ)
+#define CMX255_ETHIRQ          PXA_GPIO_TO_IRQ(GPIO22_ETHIRQ)
+#define CMX270_ETHIRQ          PXA_GPIO_TO_IRQ(GPIO10_ETHIRQ)
 
 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
 static struct resource cmx255_dm9000_resource[] = {
@@ -524,4 +524,5 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX")
 #ifdef CONFIG_PCI
        .dma_zone_size  = SZ_64M,
 #endif
+       .restart        = pxa_restart,
 MACHINE_END
index e096bba8fd57c231aaa0593c4b0efc19f2649e93..4b981b82d2a5401ecd50bc3b60df219df962433b 100644 (file)
@@ -64,7 +64,7 @@
 #define GPIO82_MMC_IRQ         (82)
 #define GPIO85_MMC_WP          (85)
 
-#define        CM_X300_MMC_IRQ         IRQ_GPIO(GPIO82_MMC_IRQ)
+#define        CM_X300_MMC_IRQ         PXA_GPIO_TO_IRQ(GPIO82_MMC_IRQ)
 
 #define GPIO95_RTC_CS          (95)
 #define GPIO96_RTC_WR          (96)
@@ -229,8 +229,8 @@ static struct resource dm9000_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
-               .start  = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)),
-               .end    = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)),
+               .start  = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO99)),
+               .end    = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO99)),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -858,4 +858,5 @@ MACHINE_START(CM_X300, "CM-X300 module")
        .timer          = &pxa_timer,
        .init_machine   = cm_x300_init,
        .fixup          = cm_x300_fixup,
+       .restart        = pxa_restart,
 MACHINE_END
index 05bfa1b1c001756b465731e5ac67fa0185ef79c5..29d5d541f602f081b17b26acce6ef8f7bc148772 100644 (file)
@@ -218,8 +218,8 @@ static struct resource colibri_pxa270_dm9000_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        {
-               .start  = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
-               .end    = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
+               .start  = PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ),
                .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
        },
 };
@@ -249,7 +249,7 @@ static pxa2xx_audio_ops_t colibri_pxa270_ac97_pdata = {
 };
 
 static struct ucb1400_pdata colibri_pxa270_ucb1400_pdata = {
-       .irq            = gpio_to_irq(GPIO113_COLIBRI_PXA270_TS_IRQ),
+       .irq            = PXA_GPIO_TO_IRQ(GPIO113_COLIBRI_PXA270_TS_IRQ),
 };
 
 static struct platform_device colibri_pxa270_ucb1400_device = {
@@ -313,6 +313,7 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 
 MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
@@ -322,5 +323,6 @@ MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 
index c825e8bf2db14a922978ae1b6442b7185fd6800d..0846d210cb05401be28b4b22840c683bcb09f6f8 100644 (file)
@@ -78,8 +78,8 @@ static struct resource colibri_asix_resource[] = {
                .flags = IORESOURCE_MEM,
        },
        [1] = {
-               .start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
-               .end   = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
+               .start = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
+               .end   = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
                .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
        }
 };
@@ -189,5 +189,6 @@ MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 
index d23b92b80488257db2ef2bf4af458fc4060feaf8..6ad3359063af4fe49727c0645367050b2a9adf36 100644 (file)
@@ -115,8 +115,8 @@ static struct resource colibri_asix_resource[] = {
                .flags = IORESOURCE_MEM,
        },
        [1] = {
-               .start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
-               .end   = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
+               .start = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
+               .end   = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
                .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
        }
 };
@@ -259,5 +259,6 @@ MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 
index 549468d088b9e0e34336ef0b50a3551258b8c366..66600f05e4364cd57b8cae96fafb5cb1811340dc 100644 (file)
@@ -531,7 +531,7 @@ static struct spi_board_info corgi_spi_devices[] = {
                .chip_select    = 0,
                .platform_data  = &corgi_ads7846_info,
                .controller_data= &corgi_ads7846_chip,
-               .irq            = gpio_to_irq(CORGI_GPIO_TP_INT),
+               .irq            = PXA_GPIO_TO_IRQ(CORGI_GPIO_TP_INT),
        }, {
                .modalias       = "corgi-lcd",
                .max_speed_hz   = 50000,
@@ -655,7 +655,7 @@ static void corgi_poweroff(void)
                /* Green LED off tells the bootloader to halt */
                gpio_set_value(CORGI_GPIO_LED_GREEN, 0);
 
-       arm_machine_restart('h', NULL);
+       pxa_restart('h', NULL);
 }
 
 static void corgi_restart(char mode, const char *cmd)
@@ -664,13 +664,12 @@ static void corgi_restart(char mode, const char *cmd)
                /* Green LED on tells the bootloader to reboot */
                gpio_set_value(CORGI_GPIO_LED_GREEN, 1);
 
-       arm_machine_restart('h', cmd);
+       pxa_restart('h', cmd);
 }
 
 static void __init corgi_init(void)
 {
        pm_power_off = corgi_poweroff;
-       arm_pm_restart = corgi_restart;
 
        /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
        PCFR |= PCFR_OPDE;
@@ -726,6 +725,7 @@ MACHINE_START(CORGI, "SHARP Corgi")
        .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
        .timer          = &pxa_timer,
+       .restart        = corgi_restart,
 MACHINE_END
 #endif
 
@@ -737,6 +737,7 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd")
        .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
        .timer          = &pxa_timer,
+       .restart        = corgi_restart,
 MACHINE_END
 #endif
 
@@ -748,6 +749,7 @@ MACHINE_START(HUSKY, "SHARP Husky")
        .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
        .timer          = &pxa_timer,
+       .restart        = corgi_restart,
 MACHINE_END
 #endif
 
index 29034778bfdaa03f2cc99608ac17de638ffa0c14..39e265cfc86d1af6eefb5362a9a7cc2f5cedf189 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/gpio-pxa.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/apm-emulation.h>
@@ -40,7 +41,9 @@ static struct gpio charger_gpios[] = {
        { CORGI_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" },
        { CORGI_GPIO_CHRG_ON,     GPIOF_OUT_INIT_LOW, "Charger On" },
        { CORGI_GPIO_CHRG_UKN,    GPIOF_OUT_INIT_LOW, "Charger Unknown" },
+       { CORGI_GPIO_AC_IN,       GPIOF_IN, "Charger Detection" },
        { CORGI_GPIO_KEY_INT,     GPIOF_IN, "Key Interrupt" },
+       { CORGI_GPIO_WAKEUP,      GPIOF_IN, "System wakeup notification" },
 };
 
 static void corgi_charger_init(void)
@@ -90,7 +93,12 @@ static int corgi_should_wakeup(unsigned int resume_on_alarm)
 {
        int is_resume = 0;
 
-       dev_dbg(sharpsl_pm.dev, "GPLR0 = %x,%x\n", GPLR0, PEDR);
+       dev_dbg(sharpsl_pm.dev, "PEDR = %x, GPIO_AC_IN = %d, "
+               "GPIO_CHRG_FULL = %d, GPIO_KEY_INT = %d, GPIO_WAKEUP = %d\n",
+               PEDR, gpio_get_value(CORGI_GPIO_AC_IN),
+               gpio_get_value(CORGI_GPIO_CHRG_FULL),
+               gpio_get_value(CORGI_GPIO_KEY_INT),
+               gpio_get_value(CORGI_GPIO_WAKEUP));
 
        if ((PEDR & GPIO_bit(CORGI_GPIO_AC_IN))) {
                if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
@@ -124,14 +132,21 @@ static int corgi_should_wakeup(unsigned int resume_on_alarm)
 
 static unsigned long corgi_charger_wakeup(void)
 {
-       return ~GPLR0 & ( GPIO_bit(CORGI_GPIO_AC_IN) | GPIO_bit(CORGI_GPIO_KEY_INT) | GPIO_bit(CORGI_GPIO_WAKEUP) );
+       unsigned long ret;
+
+       ret = (!gpio_get_value(CORGI_GPIO_AC_IN) << GPIO_bit(CORGI_GPIO_AC_IN))
+               | (!gpio_get_value(CORGI_GPIO_KEY_INT)
+               << GPIO_bit(CORGI_GPIO_KEY_INT))
+               | (!gpio_get_value(CORGI_GPIO_WAKEUP)
+               << GPIO_bit(CORGI_GPIO_WAKEUP));
+       return ret;
 }
 
 unsigned long corgipm_read_devdata(int type)
 {
        switch(type) {
        case SHARPSL_STATUS_ACIN:
-               return ((GPLR(CORGI_GPIO_AC_IN) & GPIO_bit(CORGI_GPIO_AC_IN)) != 0);
+               return !gpio_get_value(CORGI_GPIO_AC_IN);
        case SHARPSL_STATUS_LOCK:
                return gpio_get_value(sharpsl_pm.machinfo->gpio_batlock);
        case SHARPSL_STATUS_CHRGFULL:
index 5e2cf39e9e4c5e8091028ab5576cffb711725797..fb5a51d834e5391c4cb407b4270009dcaf68b33c 100644 (file)
@@ -278,4 +278,5 @@ MACHINE_START(CSB726, "Cogent CSB726")
        .handle_irq       = pxa27x_handle_irq,
        .init_machine   = csb726_init,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
index 2e0425404de52e9204f07e61a4eec50924a1114e..5bc13121eac5d15eb239e3992b18f90720f67416 100644 (file)
@@ -1051,6 +1051,36 @@ struct platform_device pxa3xx_device_ssp4 = {
 };
 #endif /* CONFIG_PXA3xx || CONFIG_PXA95x */
 
+struct resource pxa_resource_gpio[] = {
+       {
+               .start  = 0x40e00000,
+               .end    = 0x40e0ffff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_GPIO0,
+               .end    = IRQ_GPIO0,
+               .name   = "gpio0",
+               .flags  = IORESOURCE_IRQ,
+       }, {
+               .start  = IRQ_GPIO1,
+               .end    = IRQ_GPIO1,
+               .name   = "gpio1",
+               .flags  = IORESOURCE_IRQ,
+       }, {
+               .start  = IRQ_GPIO_2_x,
+               .end    = IRQ_GPIO_2_x,
+               .name   = "gpio_mux",
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device pxa_device_gpio = {
+       .name           = "pxa-gpio",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(pxa_resource_gpio),
+       .resource       = pxa_resource_gpio,
+};
+
 /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
  * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
 void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
index 2fd5a8b35757ac5463303b278d3970d7d4df9d02..1475db1072546ba7d1029b5c0de3c32e526239f5 100644 (file)
@@ -16,6 +16,7 @@ extern struct platform_device pxa_device_ficp;
 extern struct platform_device sa1100_device_rtc;
 extern struct platform_device pxa_device_rtc;
 extern struct platform_device pxa_device_ac97;
+extern struct platform_device pxa_device_gpio;
 
 extern struct platform_device pxa27x_device_i2c_power;
 extern struct platform_device pxa27x_device_ohci;
index 94acc0b01dd6791b06d469bb83963a56c2c60849..d80c0ba9a0955613a2f393f5fefd1d882483ad52 100644 (file)
@@ -70,7 +70,7 @@
 /* common  GPIOs */
 #define GPIO11_NAND_CS         (11)
 #define GPIO41_ETHIRQ          (41)
-#define EM_X270_ETHIRQ         IRQ_GPIO(GPIO41_ETHIRQ)
+#define EM_X270_ETHIRQ         PXA_GPIO_TO_IRQ(GPIO41_ETHIRQ)
 #define GPIO115_WLAN_PWEN      (115)
 #define GPIO19_WLAN_STRAP      (19)
 #define GPIO9_USB_VBUS_EN      (9)
@@ -805,7 +805,7 @@ static struct spi_board_info em_x270_spi_devices[] __initdata = {
                .modalias               = "libertas_spi",
                .max_speed_hz           = 13000000,
                .bus_num                = 2,
-               .irq                    = IRQ_GPIO(116),
+               .irq                    = PXA_GPIO_TO_IRQ(116),
                .chip_select            = 0,
                .controller_data        = &em_x270_libertas_chip,
                .platform_data          = &em_x270_libertas_pdata,
@@ -1203,7 +1203,7 @@ static struct da903x_platform_data em_x270_da9030_info = {
 
 static struct i2c_board_info em_x270_i2c_pmic_info = {
        I2C_BOARD_INFO("da9030", 0x49),
-       .irq = IRQ_GPIO(0),
+       .irq = PXA_GPIO_TO_IRQ(0),
        .platform_data = &em_x270_da9030_info,
 };
 
@@ -1305,6 +1305,7 @@ MACHINE_START(EM_X270, "Compulab EM-X270")
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = em_x270_init,
+       .restart        = pxa_restart,
 MACHINE_END
 
 MACHINE_START(EXEDA, "Compulab eXeda")
@@ -1314,4 +1315,5 @@ MACHINE_START(EXEDA, "Compulab eXeda")
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = em_x270_init,
+       .restart        = pxa_restart,
 MACHINE_END
index d82b7aa3c096eaf09f6b99d83953efad07bb07b4..f79a610c62fc36c629002b855da09800883055a9 100644 (file)
@@ -119,8 +119,8 @@ struct resource eseries_tmio_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
-               .end    = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
+               .start  = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -196,6 +196,7 @@ MACHINE_START(E330, "Toshiba e330")
        .fixup          = eseries_fixup,
        .init_machine   = e330_init,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -246,6 +247,7 @@ MACHINE_START(E350, "Toshiba e350")
        .fixup          = eseries_fixup,
        .init_machine   = e350_init,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -369,6 +371,7 @@ MACHINE_START(E400, "Toshiba e400")
        .fixup          = eseries_fixup,
        .init_machine   = e400_init,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -558,6 +561,7 @@ MACHINE_START(E740, "Toshiba e740")
        .fixup          = eseries_fixup,
        .init_machine   = e740_init,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -750,6 +754,7 @@ MACHINE_START(E750, "Toshiba e750")
        .fixup          = eseries_fixup,
        .init_machine   = e750_init,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -955,5 +960,6 @@ MACHINE_START(E800, "Toshiba e800")
        .fixup          = eseries_fixup,
        .init_machine   = e800_init,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
index 8308eee5a92468d79873980bff22d69c3b8b6fda..15ab2533667d065dba6a51101e60c84c92db2b03 100644 (file)
@@ -804,6 +804,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = a780_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -870,6 +871,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = e680_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -936,6 +938,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = a1200_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -1127,6 +1130,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = a910_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -1193,6 +1197,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = e6_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -1233,5 +1238,6 @@ MACHINE_START(EZX_E2, "Motorola EZX E2")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = e2_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
index 92a2e85ab02cff7d91c182ec47628ff3087e5d65..0d729e6619dfb411c6b4a5e875cc4e75a1928731 100644 (file)
@@ -57,3 +57,5 @@ void __init pxa_set_ffuart_info(void *info);
 void __init pxa_set_btuart_info(void *info);
 void __init pxa_set_stuart_info(void *info);
 void __init pxa_set_hwuart_info(void *info);
+
+void pxa_restart(char, const char *);
index ffdd70dad327dd135f1a2d5fc36a3cde45f2f86b..ac3b1cef47519ed4c431cc2b576bfc76ebcda792 100644 (file)
@@ -239,4 +239,5 @@ MACHINE_START(GUMSTIX, "Gumstix")
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = gumstix_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 4b5e110640b1c39bf55aef1dfb8dd96086a518bc..fde6b4c873c40fba6fe1c0aad5d85d1f03272c8f 100644 (file)
@@ -209,4 +209,5 @@ MACHINE_START(H5400, "HP iPAQ H5000")
        .handle_irq = pxa25x_handle_irq,
        .timer = &pxa_timer,
        .init_machine = h5000_init,
+       .restart        = pxa_restart,
 MACHINE_END
index f2c324570844b189a3a16c286c0c705ecd344780..26d069a9f900117269936685f86a504fdb55f672 100644 (file)
@@ -164,4 +164,5 @@ MACHINE_START(HIMALAYA, "HTC Himalaya")
        .handle_irq = pxa25x_handle_irq,
        .init_machine = himalaya_init,
        .timer = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
index 6f6368ece9bda4288e9a99a48118db5caedae72a..fb9b62dcf4ca44099bbbca6cc02f750cd451384c 100644 (file)
@@ -252,8 +252,8 @@ static struct resource asic3_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
-               .end    = gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
+               .start  = PXA_GPIO_TO_IRQ(GPIO12_HX4700_ASIC3_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO12_HX4700_ASIC3_IRQ),
                .flags  = IORESOURCE_IRQ,
        },
        /* SD part */
@@ -263,8 +263,8 @@ static struct resource asic3_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [3] = {
-               .start  = gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
-               .end    = gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
+               .start  = PXA_GPIO_TO_IRQ(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -587,7 +587,7 @@ static struct spi_board_info tsc2046_board_info[] __initdata = {
                .modalias        = "ads7846",
                .bus_num         = 2,
                .max_speed_hz    = 2600000, /* 100 kHz sample rate */
-               .irq             = gpio_to_irq(GPIO58_HX4700_TSC2046_nPENIRQ),
+               .irq             = PXA_GPIO_TO_IRQ(GPIO58_HX4700_TSC2046_nPENIRQ),
                .platform_data   = &tsc2046_info,
                .controller_data = &tsc2046_chip,
        },
@@ -635,15 +635,15 @@ static struct resource power_supply_resources[] = {
                .name  = "ac",
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
                         IORESOURCE_IRQ_LOWEDGE,
-               .start = gpio_to_irq(GPIOD9_nAC_IN),
-               .end   = gpio_to_irq(GPIOD9_nAC_IN),
+               .start = PXA_GPIO_TO_IRQ(GPIOD9_nAC_IN),
+               .end   = PXA_GPIO_TO_IRQ(GPIOD9_nAC_IN),
        },
        [1] = {
                .name  = "usb",
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
                         IORESOURCE_IRQ_LOWEDGE,
-               .start = gpio_to_irq(GPIOD14_nUSBC_DETECT),
-               .end   = gpio_to_irq(GPIOD14_nUSBC_DETECT),
+               .start = PXA_GPIO_TO_IRQ(GPIOD14_nUSBC_DETECT),
+               .end   = PXA_GPIO_TO_IRQ(GPIOD14_nUSBC_DETECT),
        },
 };
 
@@ -845,4 +845,5 @@ MACHINE_START(H4700, "HP iPAQ HX4700")
        .handle_irq     = pxa27x_handle_irq,
        .init_machine = hx4700_init,
        .timer        = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
index f78d5db758daf920a732ed62543bf77ae788647d..67400192ed3b9d6532792e967a207f25a933c89a 100644 (file)
@@ -86,7 +86,7 @@ static struct spi_board_info mcp251x_board_info[] = {
                .chip_select     = 0,
                .platform_data   = &mcp251x_info,
                .controller_data = &mcp251x_chip_info1,
-               .irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ1)
+               .irq             = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ1)
        },
        {
                .modalias        = "mcp2515",
@@ -95,7 +95,7 @@ static struct spi_board_info mcp251x_board_info[] = {
                .chip_select     = 1,
                .platform_data   = &mcp251x_info,
                .controller_data = &mcp251x_chip_info2,
-               .irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ2)
+               .irq             = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ2)
        },
        {
                .modalias        = "mcp2515",
@@ -104,7 +104,7 @@ static struct spi_board_info mcp251x_board_info[] = {
                .chip_select     = 0,
                .platform_data   = &mcp251x_info,
                .controller_data = &mcp251x_chip_info3,
-               .irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ3)
+               .irq             = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ3)
        },
        {
                .modalias        = "mcp2515",
@@ -113,7 +113,7 @@ static struct spi_board_info mcp251x_board_info[] = {
                .chip_select     = 1,
                .platform_data   = &mcp251x_info,
                .controller_data = &mcp251x_chip_info4,
-               .irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ4)
+               .irq             = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ4)
        }
 };
 
@@ -196,5 +196,6 @@ MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = icontrol_init
+       .init_machine   = icontrol_init,
+       .restart        = pxa_restart,
 MACHINE_END
index ddf20e5c376ed292a11b7945d5c35dc8ed3ca167..8af1840e12cc4d8cdb6b24dd2f9e46110c59139d 100644 (file)
@@ -75,8 +75,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = IRQ_GPIO(4),
-               .end    = IRQ_GPIO(4),
+               .start  = PXA_GPIO_TO_IRQ(4),
+               .end    = PXA_GPIO_TO_IRQ(4),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -199,4 +199,5 @@ MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = idp_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 6d7eab3d0867ab0b306fe6d0b6aaf62b84f8abcf..f02fa1e6ba8619d995773d831bdd04bb7ad34802 100644 (file)
@@ -172,9 +172,9 @@ enum balloon3_features {
 /* Balloon3 Interrupts */
 #define BALLOON3_IRQ(x)                (IRQ_BOARD_START + (x))
 
-#define BALLOON3_AUX_NIRQ      IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
-#define BALLOON3_CODEC_IRQ     IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
-#define BALLOON3_S0_CD_IRQ     IRQ_GPIO(BALLOON3_GPIO_S0_CD)
+#define BALLOON3_AUX_NIRQ      PXA_GPIO_TO_IRQ(BALLOON3_GPIO_AUX_NIRQ)
+#define BALLOON3_CODEC_IRQ     PXA_GPIO_TO_IRQ(BALLOON3_GPIO_CODEC_IRQ)
+#define BALLOON3_S0_CD_IRQ     PXA_GPIO_TO_IRQ(BALLOON3_GPIO_S0_CD)
 
 #define BALLOON3_NR_IRQS       (IRQ_BOARD_START + 16)
 
index 5dfd1195a5a795be2947907dda3a24afeee108b2..f3c3493b468dff61399381567e89dbb6d6c5eeda 100644 (file)
 /*
  * Corgi Interrupts
  */
-#define CORGI_IRQ_GPIO_KEY_INT         IRQ_GPIO(0)
-#define CORGI_IRQ_GPIO_AC_IN           IRQ_GPIO(1)
-#define CORGI_IRQ_GPIO_WAKEUP          IRQ_GPIO(3)
-#define CORGI_IRQ_GPIO_AK_INT          IRQ_GPIO(4)
-#define CORGI_IRQ_GPIO_TP_INT          IRQ_GPIO(5)
-#define CORGI_IRQ_GPIO_nSD_DETECT      IRQ_GPIO(9)
-#define CORGI_IRQ_GPIO_nSD_INT         IRQ_GPIO(10)
-#define CORGI_IRQ_GPIO_MAIN_BAT_LOW    IRQ_GPIO(11)
-#define CORGI_IRQ_GPIO_CF_CD           IRQ_GPIO(14)
-#define CORGI_IRQ_GPIO_CHRG_FULL       IRQ_GPIO(16)    /* Battery fully charged */
-#define CORGI_IRQ_GPIO_CF_IRQ          IRQ_GPIO(17)
-#define CORGI_IRQ_GPIO_KEY_SENSE(a)    IRQ_GPIO(58+(a))        /* Keyboard Sense lines */
+#define CORGI_IRQ_GPIO_KEY_INT         PXA_GPIO_TO_IRQ(0)
+#define CORGI_IRQ_GPIO_AC_IN           PXA_GPIO_TO_IRQ(1)
+#define CORGI_IRQ_GPIO_WAKEUP          PXA_GPIO_TO_IRQ(3)
+#define CORGI_IRQ_GPIO_AK_INT          PXA_GPIO_TO_IRQ(4)
+#define CORGI_IRQ_GPIO_TP_INT          PXA_GPIO_TO_IRQ(5)
+#define CORGI_IRQ_GPIO_nSD_DETECT      PXA_GPIO_TO_IRQ(9)
+#define CORGI_IRQ_GPIO_nSD_INT         PXA_GPIO_TO_IRQ(10)
+#define CORGI_IRQ_GPIO_MAIN_BAT_LOW    PXA_GPIO_TO_IRQ(11)
+#define CORGI_IRQ_GPIO_CF_CD           PXA_GPIO_TO_IRQ(14)
+#define CORGI_IRQ_GPIO_CHRG_FULL       PXA_GPIO_TO_IRQ(16)     /* Battery fully charged */
+#define CORGI_IRQ_GPIO_CF_IRQ          PXA_GPIO_TO_IRQ(17)
+#define CORGI_IRQ_GPIO_KEY_SENSE(a)    PXA_GPIO_TO_IRQ(58+(a)) /* Keyboard Sense lines */
 
 
 /*
@@ -98,7 +98,7 @@
                        CORGI_SCP_MIC_BIAS )
 #define CORGI_SCOOP_IO_OUT     ( CORGI_SCP_MUTE_L | CORGI_SCP_MUTE_R )
 
-#define CORGI_SCOOP_GPIO_BASE          (NR_BUILTIN_GPIO)
+#define CORGI_SCOOP_GPIO_BASE          (PXA_NR_BUILTIN_GPIO)
 #define CORGI_GPIO_LED_GREEN           (CORGI_SCOOP_GPIO_BASE + 0)
 #define CORGI_GPIO_SWA                 (CORGI_SCOOP_GPIO_BASE + 1)  /* Hinge Switch A */
 #define CORGI_GPIO_SWB                 (CORGI_SCOOP_GPIO_BASE + 2)  /* Hinge Switch B */
index 747ab1a71f2f833c2941a3e9921a322b3b2d532c..2628e7b721168c99cb8dc1214934bcdffbfa8e1c 100644 (file)
@@ -19,8 +19,8 @@
 #define CSB726_FLASH_SIZE      (64 * 1024 * 1024)
 #define CSB726_FLASH_uMON      (8 * 1024 * 1024)
 
-#define CSB726_IRQ_LAN         gpio_to_irq(CSB726_GPIO_IRQ_LAN)
-#define CSB726_IRQ_SM501       gpio_to_irq(CSB726_GPIO_IRQ_SM501)
+#define CSB726_IRQ_LAN         PXA_GPIO_TO_IRQ(CSB726_GPIO_IRQ_LAN)
+#define CSB726_IRQ_SM501       PXA_GPIO_TO_IRQ(CSB726_GPIO_IRQ_SM501)
 
 #endif
 
index a73bc86a3c263d238e2a7b7a82d297748857b9ce..260c0c17692a088a6bb00662f28d0f18df7b6de2 100644 (file)
@@ -7,45 +7,9 @@
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <mach/hardware.h>
-#include <mach/irqs.h>
 
                .macro  disable_fiq
                .endm
 
-               .macro  get_irqnr_preamble, base, tmp
-               .endm
-
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               mrc     p15, 0, \tmp, c0, c0, 0         @ CPUID
-               mov     \tmp, \tmp, lsr #13
-               and     \tmp, \tmp, #0x7                @ Core G
-               cmp     \tmp, #1
-               bhi     1002f
-
-               @ Core Generation 1 (PXA25x)
-               mov     \base, #io_p2v(0x40000000)      @ IIR Ctl = 0x40d00000
-               add     \base, \base, #0x00d00000
-               ldr     \irqstat, [\base, #0]           @ ICIP
-               ldr     \irqnr, [\base, #4]             @ ICMR
-
-               ands    \irqnr, \irqstat, \irqnr
-               beq     1001f
-               rsb     \irqstat, \irqnr, #0
-               and     \irqstat, \irqstat, \irqnr
-               clz     \irqnr, \irqstat
-               rsb     \irqnr, \irqnr, #(31 + PXA_IRQ(0))
-               b       1001f
-1002:
-               @ Core Generation 2 (PXA27x) or Core Generation 3 (PXA3xx)
-               mrc     p6, 0, \irqstat, c5, c0, 0      @ ICHP
-               tst     \irqstat, #0x80000000
-               beq     1001f
-               bic     \irqstat, \irqstat, #0x80000000
-               mov     \irqnr, \irqstat, lsr #16
-               add     \irqnr, \irqnr, #(PXA_IRQ(0))
-1001:
-               .endm
diff --git a/arch/arm/mach-pxa/include/mach/gpio-pxa.h b/arch/arm/mach-pxa/include/mach/gpio-pxa.h
deleted file mode 100644 (file)
index 41b4c93..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Written by Philipp Zabel <philipp.zabel@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_PXA_GPIO_PXA_H
-#define __MACH_PXA_GPIO_PXA_H
-
-#include <mach/irqs.h>
-#include <mach/hardware.h>
-
-#define GPIO_REGS_VIRT io_p2v(0x40E00000)
-
-#define BANK_OFF(n)    (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
-#define GPIO_REG(x)    (*(volatile u32 *)(GPIO_REGS_VIRT + (x)))
-
-/* GPIO Pin Level Registers */
-#define GPLR0          GPIO_REG(BANK_OFF(0) + 0x00)
-#define GPLR1          GPIO_REG(BANK_OFF(1) + 0x00)
-#define GPLR2          GPIO_REG(BANK_OFF(2) + 0x00)
-#define GPLR3          GPIO_REG(BANK_OFF(3) + 0x00)
-
-/* GPIO Pin Direction Registers */
-#define GPDR0          GPIO_REG(BANK_OFF(0) + 0x0c)
-#define GPDR1          GPIO_REG(BANK_OFF(1) + 0x0c)
-#define GPDR2          GPIO_REG(BANK_OFF(2) + 0x0c)
-#define GPDR3          GPIO_REG(BANK_OFF(3) + 0x0c)
-
-/* GPIO Pin Output Set Registers */
-#define GPSR0          GPIO_REG(BANK_OFF(0) + 0x18)
-#define GPSR1          GPIO_REG(BANK_OFF(1) + 0x18)
-#define GPSR2          GPIO_REG(BANK_OFF(2) + 0x18)
-#define GPSR3          GPIO_REG(BANK_OFF(3) + 0x18)
-
-/* GPIO Pin Output Clear Registers */
-#define GPCR0          GPIO_REG(BANK_OFF(0) + 0x24)
-#define GPCR1          GPIO_REG(BANK_OFF(1) + 0x24)
-#define GPCR2          GPIO_REG(BANK_OFF(2) + 0x24)
-#define GPCR3          GPIO_REG(BANK_OFF(3) + 0x24)
-
-/* GPIO Rising Edge Detect Registers */
-#define GRER0          GPIO_REG(BANK_OFF(0) + 0x30)
-#define GRER1          GPIO_REG(BANK_OFF(1) + 0x30)
-#define GRER2          GPIO_REG(BANK_OFF(2) + 0x30)
-#define GRER3          GPIO_REG(BANK_OFF(3) + 0x30)
-
-/* GPIO Falling Edge Detect Registers */
-#define GFER0          GPIO_REG(BANK_OFF(0) + 0x3c)
-#define GFER1          GPIO_REG(BANK_OFF(1) + 0x3c)
-#define GFER2          GPIO_REG(BANK_OFF(2) + 0x3c)
-#define GFER3          GPIO_REG(BANK_OFF(3) + 0x3c)
-
-/* GPIO Edge Detect Status Registers */
-#define GEDR0          GPIO_REG(BANK_OFF(0) + 0x48)
-#define GEDR1          GPIO_REG(BANK_OFF(1) + 0x48)
-#define GEDR2          GPIO_REG(BANK_OFF(2) + 0x48)
-#define GEDR3          GPIO_REG(BANK_OFF(3) + 0x48)
-
-/* GPIO Alternate Function Select Registers */
-#define GAFR0_L                GPIO_REG(0x0054)
-#define GAFR0_U                GPIO_REG(0x0058)
-#define GAFR1_L                GPIO_REG(0x005C)
-#define GAFR1_U                GPIO_REG(0x0060)
-#define GAFR2_L                GPIO_REG(0x0064)
-#define GAFR2_U                GPIO_REG(0x0068)
-#define GAFR3_L                GPIO_REG(0x006C)
-#define GAFR3_U                GPIO_REG(0x0070)
-
-/* More handy macros.  The argument is a literal GPIO number. */
-
-#define GPIO_bit(x)    (1 << ((x) & 0x1f))
-
-#define GPLR(x)                GPIO_REG(BANK_OFF((x) >> 5) + 0x00)
-#define GPDR(x)                GPIO_REG(BANK_OFF((x) >> 5) + 0x0c)
-#define GPSR(x)                GPIO_REG(BANK_OFF((x) >> 5) + 0x18)
-#define GPCR(x)                GPIO_REG(BANK_OFF((x) >> 5) + 0x24)
-#define GRER(x)                GPIO_REG(BANK_OFF((x) >> 5) + 0x30)
-#define GFER(x)                GPIO_REG(BANK_OFF((x) >> 5) + 0x3c)
-#define GEDR(x)                GPIO_REG(BANK_OFF((x) >> 5) + 0x48)
-#define GAFR(x)                GPIO_REG(0x54 + (((x) & 0x70) >> 2))
-
-
-#define NR_BUILTIN_GPIO                PXA_GPIO_IRQ_NUM
-
-#define gpio_to_bank(gpio)     ((gpio) >> 5)
-
-#ifdef CONFIG_CPU_PXA26x
-/* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted,
- * as well as their Alternate Function value being '1' for GPIO in GAFRx.
- */
-static inline int __gpio_is_inverted(unsigned gpio)
-{
-       return cpu_is_pxa25x() && gpio > 85;
-}
-#else
-static inline int __gpio_is_inverted(unsigned gpio) { return 0; }
-#endif
-
-/*
- * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate
- * function of a GPIO, and GPDRx cannot be altered once configured. It
- * is attributed as "occupied" here (I know this terminology isn't
- * accurate, you are welcome to propose a better one :-)
- */
-static inline int __gpio_is_occupied(unsigned gpio)
-{
-       if (cpu_is_pxa27x() || cpu_is_pxa25x()) {
-               int af = (GAFR(gpio) >> ((gpio & 0xf) * 2)) & 0x3;
-               int dir = GPDR(gpio) & GPIO_bit(gpio);
-
-               if (__gpio_is_inverted(gpio))
-                       return af != 1 || dir == 0;
-               else
-                       return af != 0 || dir != 0;
-       } else
-               return GPDR(gpio) & GPIO_bit(gpio);
-}
-
-#include <plat/gpio-pxa.h>
-#endif /* __MACH_PXA_GPIO_PXA_H */
index 004cade7bb13b4c24ad642272f75388ebc101ef1..0248e433bc982525e69d641fe576e960e65ea437 100644 (file)
 #define __ASM_ARCH_PXA_GPIO_H
 
 #include <asm-generic/gpio.h>
-/* The defines for the driver are needed for the accelerated accessors */
-#include "gpio-pxa.h"
 
-#define gpio_to_irq(gpio)      IRQ_GPIO(gpio)
+#include <mach/irqs.h>
+#include <mach/hardware.h>
 
-static inline int irq_to_gpio(unsigned int irq)
-{
-       int gpio;
-
-       if (irq == IRQ_GPIO0 || irq == IRQ_GPIO1)
-               return irq - IRQ_GPIO0;
-
-       gpio = irq - PXA_GPIO_IRQ_BASE;
-       if (gpio >= 2 && gpio < NR_BUILTIN_GPIO)
-               return gpio;
-
-       return -1;
-}
-
-#include <plat/gpio.h>
 #endif
index 9b898680b206a7d59ec5aacadf8dafa8dadc677a..dba14b6503ad17008660d23f81306db42c72119c 100644 (file)
@@ -24,7 +24,7 @@ has detected a cable insertion; driven low otherwise. */
 #define GPIO_GUMSTIX_USB_GPIOx         41
 
 /* usb state change */
-#define GUMSTIX_USB_INTR_IRQ           IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn)
+#define GUMSTIX_USB_INTR_IRQ           PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_USB_GPIOn)
 
 #define GPIO_GUMSTIX_USB_GPIOn_MD      (GPIO_GUMSTIX_USB_GPIOn | GPIO_IN)
 #define GPIO_GUMSTIX_USB_GPIOx_CON_MD  (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
@@ -35,7 +35,7 @@ has detected a cable insertion; driven low otherwise. */
  */
 #define GUMSTIX_GPIO_nSD_WP            22 /* SD Write Protect */
 #define GUMSTIX_GPIO_nSD_DETECT                11 /* MMC/SD Card Detect */
-#define GUMSTIX_IRQ_GPIO_nSD_DETECT    IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT)
+#define GUMSTIX_IRQ_GPIO_nSD_DETECT    PXA_GPIO_TO_IRQ(GUMSTIX_GPIO_nSD_DETECT)
 
 /*
  * SMC Ethernet definitions
@@ -49,10 +49,10 @@ has detected a cable insertion; driven low otherwise. */
 
 #define GPIO_GUMSTIX_ETH0              36
 #define GPIO_GUMSTIX_ETH0_MD           (GPIO_GUMSTIX_ETH0 | GPIO_IN)
-#define GUMSTIX_ETH0_IRQ               IRQ_GPIO(GPIO_GUMSTIX_ETH0)
+#define GUMSTIX_ETH0_IRQ               PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH0)
 #define GPIO_GUMSTIX_ETH1              27
 #define GPIO_GUMSTIX_ETH1_MD           (GPIO_GUMSTIX_ETH1 | GPIO_IN)
-#define GUMSTIX_ETH1_IRQ               IRQ_GPIO(GPIO_GUMSTIX_ETH1)
+#define GUMSTIX_ETH1_IRQ               PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH1)
 
 
 /* CF reset line */
@@ -63,18 +63,18 @@ has detected a cable insertion; driven low otherwise. */
 #define GPIO4_nSTSCHG                  GPIO4_nBVD1
 #define GPIO11_nCD                     11
 #define GPIO26_PRDY_nBSY               26
-#define GUMSTIX_S0_nSTSCHG_IRQ         IRQ_GPIO(GPIO4_nSTSCHG)
-#define GUMSTIX_S0_nCD_IRQ             IRQ_GPIO(GPIO11_nCD)
-#define GUMSTIX_S0_PRDY_nBSY_IRQ       IRQ_GPIO(GPIO26_PRDY_nBSY)
+#define GUMSTIX_S0_nSTSCHG_IRQ         PXA_GPIO_TO_IRQ(GPIO4_nSTSCHG)
+#define GUMSTIX_S0_nCD_IRQ             PXA_GPIO_TO_IRQ(GPIO11_nCD)
+#define GUMSTIX_S0_PRDY_nBSY_IRQ       PXA_GPIO_TO_IRQ(GPIO26_PRDY_nBSY)
 
 /* CF slot 1 */
 #define GPIO18_nBVD1                   18
 #define GPIO18_nSTSCHG                 GPIO18_nBVD1
 #define GPIO36_nCD                     36
 #define GPIO27_PRDY_nBSY               27
-#define GUMSTIX_S1_nSTSCHG_IRQ         IRQ_GPIO(GPIO18_nSTSCHG)
-#define GUMSTIX_S1_nCD_IRQ             IRQ_GPIO(GPIO36_nCD)
-#define GUMSTIX_S1_PRDY_nBSY_IRQ       IRQ_GPIO(GPIO27_PRDY_nBSY)
+#define GUMSTIX_S1_nSTSCHG_IRQ         PXA_GPIO_TO_IRQ(GPIO18_nSTSCHG)
+#define GUMSTIX_S1_nCD_IRQ             PXA_GPIO_TO_IRQ(GPIO36_nCD)
+#define GUMSTIX_S1_PRDY_nBSY_IRQ       PXA_GPIO_TO_IRQ(GPIO27_PRDY_nBSY)
 
 /* CF GPIO line modes */
 #define GPIO4_nSTSCHG_MD               (GPIO4_nSTSCHG | GPIO_IN)
index 37408449ec25e023264ae8852fc3bec9feb381a6..8bc02913517cd14a6e96f05295ff94f9fd250ee3 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/gpio.h>
 #include <linux/mfd/asic3.h>
 
-#define HX4700_ASIC3_GPIO_BASE NR_BUILTIN_GPIO
+#define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO
 #define HX4700_EGPIO_BASE      (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
 #define HX4700_NR_IRQS         (IRQ_BOARD_START + 70)
 
index 5eff96fcc944d764bdf9fc00423cbb1d62b1af79..22a96f87232b5d5bdf894b55624900e832d054f4 100644 (file)
 #define PCC_VS2                (1 << 1)
 #define PCC_VS1                (1 << 0)
 
-#define PCC_DETECT(x)  (GPLR(7 + (x)) & GPIO_bit(7 + (x)))
-
 /* A listing of interrupts used by external hardware devices */
 
-#define TOUCH_PANEL_IRQ                        IRQ_GPIO(5)
-#define IDE_IRQ                                IRQ_GPIO(21)
+#define TOUCH_PANEL_IRQ                        PXA_GPIO_TO_IRQ(5)
+#define IDE_IRQ                                PXA_GPIO_TO_IRQ(21)
 
 #define TOUCH_PANEL_IRQ_EDGE           IRQ_TYPE_EDGE_FALLING
 
-#define ETHERNET_IRQ                   IRQ_GPIO(4)
+#define ETHERNET_IRQ                   PXA_GPIO_TO_IRQ(4)
 #define ETHERNET_IRQ_EDGE              IRQ_TYPE_EDGE_RISING
 
 #define IDE_IRQ_EDGE                   IRQ_TYPE_EDGE_RISING
 
-#define PCMCIA_S0_CD_VALID             IRQ_GPIO(7)
+#define PCMCIA_S0_CD_VALID             PXA_GPIO_TO_IRQ(7)
 #define PCMCIA_S0_CD_VALID_EDGE                IRQ_TYPE_EDGE_BOTH
 
-#define PCMCIA_S1_CD_VALID             IRQ_GPIO(8)
+#define PCMCIA_S1_CD_VALID             PXA_GPIO_TO_IRQ(8)
 #define PCMCIA_S1_CD_VALID_EDGE                IRQ_TYPE_EDGE_BOTH
 
-#define PCMCIA_S0_RDYINT               IRQ_GPIO(19)
-#define PCMCIA_S1_RDYINT               IRQ_GPIO(22)
+#define PCMCIA_S0_RDYINT               PXA_GPIO_TO_IRQ(19)
+#define PCMCIA_S1_RDYINT               PXA_GPIO_TO_IRQ(22)
 
 
 /*
index 7cc5a781e99e4dc6683b16d3ed132645c420126d..32975adf3ca4927a2d77eba14efb1ad7bddd0638 100644 (file)
 #define IRQ_U2P                PXA_IRQ(93)     /* USB PHY D+/D- Lines (PXA935) */
 
 #define PXA_GPIO_IRQ_BASE      PXA_IRQ(96)
-#define PXA_GPIO_IRQ_NUM       (192)
-
-#define GPIO_2_x_TO_IRQ(x)     (PXA_GPIO_IRQ_BASE + (x))
-#define IRQ_GPIO(x)    (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x))
+#define PXA_NR_BUILTIN_GPIO    (192)
+#define PXA_GPIO_TO_IRQ(x)     (PXA_GPIO_IRQ_BASE + (x))
 
 /*
  * The following interrupts are for board specific purposes. Since
  * By default, no board IRQ is reserved. It should be finished in
  * custom board since sparse IRQ is already enabled.
  */
-#define IRQ_BOARD_START                (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM)
+#define IRQ_BOARD_START                (PXA_GPIO_IRQ_BASE + PXA_NR_BUILTIN_GPIO)
 
 #define NR_IRQS                        (IRQ_BOARD_START)
 
index b6238cbd8aeab1da22f6da03655a93e8bfb8b8e6..8066be54e9f53701cc2fe80bae2bf85540f5419a 100644 (file)
@@ -1,13 +1,11 @@
 #ifndef __ASM_ARCH_LITTLETON_H
 #define __ASM_ARCH_LITTLETON_H
 
-#include <mach/gpio-pxa.h>
-
 #define LITTLETON_ETH_PHYS     0x30000000
 
 #define LITTLETON_GPIO_LCD_CS  (17)
 
-#define EXT0_GPIO_BASE (NR_BUILTIN_GPIO)
+#define EXT0_GPIO_BASE (PXA_NR_BUILTIN_GPIO)
 #define EXT0_GPIO(x)   (EXT0_GPIO_BASE + (x))
 
 #define LITTLETON_NR_IRQS      (IRQ_BOARD_START + 8)
index 7cbfc5d3f9dfb9a6e9483922a237c83457759d31..ba6a6e1d29e9611c11b95363d55010e36c3a5981 100644 (file)
@@ -78,7 +78,7 @@
  * CPLD EGPIOs
  */
 
-#define MAGICIAN_EGPIO_BASE                    NR_BUILTIN_GPIO
+#define MAGICIAN_EGPIO_BASE                    PXA_NR_BUILTIN_GPIO
 #define MAGICIAN_EGPIO(reg,bit) \
        (MAGICIAN_EGPIO_BASE + 8*reg + bit)
 
index ae536e86d8e86b0f4b910cb823d136aa0aadd858..2c4471336570f0c38563f8b19d61b2a1b3bd5ed3 100644 (file)
 /* 20, 53 and 86 are usb related too */
 
 /* INTERRUPTS */
-#define IRQ_GPIO_PALMLD_GPIO_RESET     IRQ_GPIO(GPIO_NR_PALMLD_GPIO_RESET)
-#define IRQ_GPIO_PALMLD_SD_DETECT_N    IRQ_GPIO(GPIO_NR_PALMLD_SD_DETECT_N)
-#define IRQ_GPIO_PALMLD_WM9712_IRQ     IRQ_GPIO(GPIO_NR_PALMLD_WM9712_IRQ)
-#define IRQ_GPIO_PALMLD_IDE_IRQ                IRQ_GPIO(GPIO_NR_PALMLD_IDE_IRQ)
+#define IRQ_GPIO_PALMLD_GPIO_RESET     PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_GPIO_RESET)
+#define IRQ_GPIO_PALMLD_SD_DETECT_N    PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_SD_DETECT_N)
+#define IRQ_GPIO_PALMLD_WM9712_IRQ     PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_WM9712_IRQ)
+#define IRQ_GPIO_PALMLD_IDE_IRQ                PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_IDE_IRQ)
 
 
 /** HERE ARE INIT VALUES **/
index 6baf7469d4eced9c51151537161437c5e9706e93..0bd4f036c72fbb1deda29f4a2097785a9aee8a5c 100644 (file)
 #define GPIO_NR_PALMT5_BT_RESET                        83
 
 /* INTERRUPTS */
-#define IRQ_GPIO_PALMT5_SD_DETECT_N    IRQ_GPIO(GPIO_NR_PALMT5_SD_DETECT_N)
-#define IRQ_GPIO_PALMT5_WM9712_IRQ     IRQ_GPIO(GPIO_NR_PALMT5_WM9712_IRQ)
-#define IRQ_GPIO_PALMT5_USB_DETECT     IRQ_GPIO(GPIO_NR_PALMT5_USB_DETECT)
-#define IRQ_GPIO_PALMT5_GPIO_RESET     IRQ_GPIO(GPIO_NR_PALMT5_GPIO_RESET)
+#define IRQ_GPIO_PALMT5_SD_DETECT_N    PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_SD_DETECT_N)
+#define IRQ_GPIO_PALMT5_WM9712_IRQ     PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_WM9712_IRQ)
+#define IRQ_GPIO_PALMT5_USB_DETECT     PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_USB_DETECT)
+#define IRQ_GPIO_PALMT5_GPIO_RESET     PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_GPIO_RESET)
 
 /** HERE ARE INIT VALUES **/
 
index 3f9dd3fd4638e03a103b54f16a87d3da74fd2047..c383a21680b6992e711f8397e0dee98498cb0c94 100644 (file)
@@ -52,8 +52,8 @@
 #define GPIO_NR_PALMTC_IR_DISABLE      45
 
 /* IRQs */
-#define IRQ_GPIO_PALMTC_SD_DETECT_N    IRQ_GPIO(GPIO_NR_PALMTC_SD_DETECT_N)
-#define IRQ_GPIO_PALMTC_WLAN_READY     IRQ_GPIO(GPIO_NR_PALMTC_WLAN_READY)
+#define IRQ_GPIO_PALMTC_SD_DETECT_N    PXA_GPIO_TO_IRQ(GPIO_NR_PALMTC_SD_DETECT_N)
+#define IRQ_GPIO_PALMTC_WLAN_READY     PXA_GPIO_TO_IRQ(GPIO_NR_PALMTC_WLAN_READY)
 
 /* UCB1400 GPIOs */
 #define GPIO_NR_PALMTC_POWER_DETECT    (0x80 | 0x00)
index 7074a6ed46c6b20ec321b5b0106aae3392eb7b29..f2e5303802537d79bac10b397b7b1d17e23bdf3d 100644 (file)
 #define GPIO_NR_PALMTX_NAND_BUFFER_DIR         79
 
 /* INTERRUPTS */
-#define IRQ_GPIO_PALMTX_SD_DETECT_N    IRQ_GPIO(GPIO_NR_PALMTX_SD_DETECT_N)
-#define IRQ_GPIO_PALMTX_WM9712_IRQ     IRQ_GPIO(GPIO_NR_PALMTX_WM9712_IRQ)
-#define IRQ_GPIO_PALMTX_USB_DETECT     IRQ_GPIO(GPIO_NR_PALMTX_USB_DETECT)
-#define IRQ_GPIO_PALMTX_GPIO_RESET     IRQ_GPIO(GPIO_NR_PALMTX_GPIO_RESET)
+#define IRQ_GPIO_PALMTX_SD_DETECT_N    PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_SD_DETECT_N)
+#define IRQ_GPIO_PALMTX_WM9712_IRQ     PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_WM9712_IRQ)
+#define IRQ_GPIO_PALMTX_USB_DETECT     PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_USB_DETECT)
+#define IRQ_GPIO_PALMTX_GPIO_RESET     PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_GPIO_RESET)
 
 /** HERE ARE INIT VALUES **/
 
index 4bac588478a898ee6dae6107a9cd44fc7d365c69..6bf28de228bdeb8952f14458a5ebde1a93653530 100644 (file)
@@ -34,7 +34,7 @@
 
 /* I2C RTC */
 #define PCM027_RTC_IRQ_GPIO    0
-#define PCM027_RTC_IRQ         IRQ_GPIO(PCM027_RTC_IRQ_GPIO)
+#define PCM027_RTC_IRQ         PXA_GPIO_TO_IRQ(PCM027_RTC_IRQ_GPIO)
 #define PCM027_RTC_IRQ_EDGE    IRQ_TYPE_EDGE_FALLING
 #define ADR_PCM027_RTC         0x51    /* I2C address */
 
 
 /* Ethernet chip (SMSC91C111) */
 #define PCM027_ETH_IRQ_GPIO    52
-#define PCM027_ETH_IRQ         IRQ_GPIO(PCM027_ETH_IRQ_GPIO)
+#define PCM027_ETH_IRQ         PXA_GPIO_TO_IRQ(PCM027_ETH_IRQ_GPIO)
 #define PCM027_ETH_IRQ_EDGE    IRQ_TYPE_EDGE_RISING
 #define PCM027_ETH_PHYS                PXA_CS5_PHYS
 #define PCM027_ETH_SIZE                (1*1024*1024)
 
 /* CAN controller SJA1000 (unsupported yet) */
 #define PCM027_CAN_IRQ_GPIO    114
-#define PCM027_CAN_IRQ         IRQ_GPIO(PCM027_CAN_IRQ_GPIO)
+#define PCM027_CAN_IRQ         PXA_GPIO_TO_IRQ(PCM027_CAN_IRQ_GPIO)
 #define PCM027_CAN_IRQ_EDGE    IRQ_TYPE_EDGE_FALLING
 #define PCM027_CAN_PHYS                0x22000000
 #define PCM027_CAN_SIZE                0x100
 
 /* SPI GPIO expander (unsupported yet) */
 #define PCM027_EGPIO_IRQ_GPIO  27
-#define PCM027_EGPIO_IRQ       IRQ_GPIO(PCM027_EGPIO_IRQ_GPIO)
+#define PCM027_EGPIO_IRQ       PXA_GPIO_TO_IRQ(PCM027_EGPIO_IRQ_GPIO)
 #define PCM027_EGPIO_IRQ_EDGE  IRQ_TYPE_EDGE_FALLING
 #define PCM027_EGPIO_CS                24
 /*
index 8a4383b776d7fb7806f17ed6cfb163b681aea18f..d72791695b2611ba3e55aeeab43623641d7baacf 100644 (file)
 
 /* CPLD's interrupt controller is connected to PCM-027 GPIO 9 */
 #define PCM990_CTRL_INT_IRQ_GPIO       9
-#define PCM990_CTRL_INT_IRQ            IRQ_GPIO(PCM990_CTRL_INT_IRQ_GPIO)
+#define PCM990_CTRL_INT_IRQ            PXA_GPIO_TO_IRQ(PCM990_CTRL_INT_IRQ_GPIO)
 #define PCM990_CTRL_INT_IRQ_EDGE       IRQ_TYPE_EDGE_RISING
 #define PCM990_CTRL_PHYS               PXA_CS1_PHYS    /* 16-Bit */
 #define PCM990_CTRL_BASE               0xea000000
 #define PCM990_CTRL_SIZE               (1*1024*1024)
 
 #define PCM990_CTRL_PWR_IRQ_GPIO       14
-#define PCM990_CTRL_PWR_IRQ            IRQ_GPIO(PCM990_CTRL_PWR_IRQ_GPIO)
+#define PCM990_CTRL_PWR_IRQ            PXA_GPIO_TO_IRQ(PCM990_CTRL_PWR_IRQ_GPIO)
 #define PCM990_CTRL_PWR_IRQ_EDGE       IRQ_TYPE_EDGE_RISING
 
 /* visible CPLD (U7) registers */
  * IDE
  */
 #define PCM990_IDE_IRQ_GPIO    13
-#define PCM990_IDE_IRQ         IRQ_GPIO(PCM990_IDE_IRQ_GPIO)
+#define PCM990_IDE_IRQ         PXA_GPIO_TO_IRQ(PCM990_IDE_IRQ_GPIO)
 #define PCM990_IDE_IRQ_EDGE    IRQ_TYPE_EDGE_RISING
 #define PCM990_IDE_PLD_PHYS    0x20000000      /* 16 bit wide */
 #define PCM990_IDE_PLD_BASE    0xee000000
  * Compact Flash
  */
 #define PCM990_CF_IRQ_GPIO     11
-#define PCM990_CF_IRQ          IRQ_GPIO(PCM990_CF_IRQ_GPIO)
+#define PCM990_CF_IRQ          PXA_GPIO_TO_IRQ(PCM990_CF_IRQ_GPIO)
 #define PCM990_CF_IRQ_EDGE     IRQ_TYPE_EDGE_RISING
 
 #define PCM990_CF_CD_GPIO      12
-#define PCM990_CF_CD           IRQ_GPIO(PCM990_CF_CD_GPIO)
+#define PCM990_CF_CD           PXA_GPIO_TO_IRQ(PCM990_CF_CD_GPIO)
 #define PCM990_CF_CD_EDGE      IRQ_TYPE_EDGE_RISING
 
 #define PCM990_CF_PLD_PHYS     0x30000000      /* 16 bit wide */
  * Wolfson AC97 Touch
  */
 #define PCM990_AC97_IRQ_GPIO   10
-#define PCM990_AC97_IRQ                IRQ_GPIO(PCM990_AC97_IRQ_GPIO)
+#define PCM990_AC97_IRQ                PXA_GPIO_TO_IRQ(PCM990_AC97_IRQ_GPIO)
 #define PCM990_AC97_IRQ_EDGE   IRQ_TYPE_EDGE_RISING
 
 /*
  * MMC phyCORE
  */
 #define PCM990_MMC0_IRQ_GPIO   9
-#define PCM990_MMC0_IRQ                IRQ_GPIO(PCM990_MMC0_IRQ_GPIO)
+#define PCM990_MMC0_IRQ                PXA_GPIO_TO_IRQ(PCM990_MMC0_IRQ_GPIO)
 #define PCM990_MMC0_IRQ_EDGE   IRQ_TYPE_EDGE_FALLING
 
 /*
index 83d1cfd00fc9f7d05e75c4a0c94383c479407179..f32ff75dcca83abd42fb8dfc30ac7a8ebdbf9e59 100644 (file)
 #define POODLE_GPIO_DISCHARGE_ON        (42) /* Enable battery discharge */
 
 /* PXA GPIOs */
-#define POODLE_IRQ_GPIO_ON_KEY         IRQ_GPIO(0)
-#define POODLE_IRQ_GPIO_AC_IN          IRQ_GPIO(1)
-#define POODLE_IRQ_GPIO_HP_IN          IRQ_GPIO(4)
-#define POODLE_IRQ_GPIO_CO             IRQ_GPIO(16)
-#define POODLE_IRQ_GPIO_TP_INT         IRQ_GPIO(5)
-#define POODLE_IRQ_GPIO_WAKEUP         IRQ_GPIO(11)
-#define POODLE_IRQ_GPIO_GA_INT         IRQ_GPIO(10)
-#define POODLE_IRQ_GPIO_CF_IRQ         IRQ_GPIO(17)
-#define POODLE_IRQ_GPIO_CF_CD          IRQ_GPIO(14)
-#define POODLE_IRQ_GPIO_nSD_INT                IRQ_GPIO(8)
-#define POODLE_IRQ_GPIO_nSD_DETECT     IRQ_GPIO(9)
-#define POODLE_IRQ_GPIO_MAIN_BAT_LOW   IRQ_GPIO(13)
+#define POODLE_IRQ_GPIO_ON_KEY         PXA_GPIO_TO_IRQ(0)
+#define POODLE_IRQ_GPIO_AC_IN          PXA_GPIO_TO_IRQ(1)
+#define POODLE_IRQ_GPIO_HP_IN          PXA_GPIO_TO_IRQ(4)
+#define POODLE_IRQ_GPIO_CO             PXA_GPIO_TO_IRQ(16)
+#define POODLE_IRQ_GPIO_TP_INT         PXA_GPIO_TO_IRQ(5)
+#define POODLE_IRQ_GPIO_WAKEUP         PXA_GPIO_TO_IRQ(11)
+#define POODLE_IRQ_GPIO_GA_INT         PXA_GPIO_TO_IRQ(10)
+#define POODLE_IRQ_GPIO_CF_IRQ         PXA_GPIO_TO_IRQ(17)
+#define POODLE_IRQ_GPIO_CF_CD          PXA_GPIO_TO_IRQ(14)
+#define POODLE_IRQ_GPIO_nSD_INT                PXA_GPIO_TO_IRQ(8)
+#define POODLE_IRQ_GPIO_nSD_DETECT     PXA_GPIO_TO_IRQ(9)
+#define POODLE_IRQ_GPIO_MAIN_BAT_LOW   PXA_GPIO_TO_IRQ(13)
 
 /* SCOOP GPIOs */
 #define POODLE_SCOOP_CHARGE_ON SCOOP_GPCR_PA11
@@ -71,7 +71,7 @@
 #define POODLE_SCOOP_IO_DIR    ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT )
 #define POODLE_SCOOP_IO_OUT    ( 0 )
 
-#define POODLE_SCOOP_GPIO_BASE (NR_BUILTIN_GPIO)
+#define POODLE_SCOOP_GPIO_BASE (PXA_NR_BUILTIN_GPIO)
 #define POODLE_GPIO_CHARGE_ON  (POODLE_SCOOP_GPIO_BASE + 0)
 #define POODLE_GPIO_CP401      (POODLE_SCOOP_GPIO_BASE + 2)
 #define POODLE_GPIO_VPEN       (POODLE_SCOOP_GPIO_BASE + 7)
index 685749a51c4284159324bee89c7a5e96e7404da2..0bfe6507c95dd2c4e89e8c23384a179ba1b0030d 100644 (file)
 #define SPITZ_SCP_SUS_CLR     (SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R | SPITZ_SCP_JK_A | SPITZ_SCP_ADC_TEMP_ON)
 #define SPITZ_SCP_SUS_SET     0
 
-#define SPITZ_SCP_GPIO_BASE    (NR_BUILTIN_GPIO)
+#define SPITZ_SCP_GPIO_BASE    (PXA_NR_BUILTIN_GPIO)
 #define SPITZ_GPIO_LED_GREEN   (SPITZ_SCP_GPIO_BASE + 0)
 #define SPITZ_GPIO_JK_B                (SPITZ_SCP_GPIO_BASE + 1)
 #define SPITZ_GPIO_CHRG_ON     (SPITZ_SCP_GPIO_BASE + 2)
                              SPITZ_SCP2_BACKLIGHT_CONT | SPITZ_SCP2_BACKLIGHT_ON | SPITZ_SCP2_MIC_BIAS)
 #define SPITZ_SCP2_SUS_SET  (SPITZ_SCP2_IR_ON | SPITZ_SCP2_RESERVED_1)
 
-#define SPITZ_SCP2_GPIO_BASE           (NR_BUILTIN_GPIO + 12)
+#define SPITZ_SCP2_GPIO_BASE           (PXA_NR_BUILTIN_GPIO + 12)
 #define SPITZ_GPIO_IR_ON               (SPITZ_SCP2_GPIO_BASE + 0)
 #define SPITZ_GPIO_AKIN_PULLUP         (SPITZ_SCP2_GPIO_BASE + 1)
 #define SPITZ_GPIO_RESERVED_1          (SPITZ_SCP2_GPIO_BASE + 2)
 #define SPITZ_GPIO_MIC_BIAS            (SPITZ_SCP2_GPIO_BASE + 8)
 
 /* Akita IO Expander GPIOs */
-#define AKITA_IOEXP_GPIO_BASE          (NR_BUILTIN_GPIO + 12)
+#define AKITA_IOEXP_GPIO_BASE          (PXA_NR_BUILTIN_GPIO + 12)
 #define AKITA_GPIO_RESERVED_0          (AKITA_IOEXP_GPIO_BASE + 0)
 #define AKITA_GPIO_RESERVED_1          (AKITA_IOEXP_GPIO_BASE + 1)
 #define AKITA_GPIO_MIC_BIAS            (AKITA_IOEXP_GPIO_BASE + 2)
 
 /* Spitz IRQ Definitions */
 
-#define SPITZ_IRQ_GPIO_KEY_INT        IRQ_GPIO(SPITZ_GPIO_KEY_INT)
-#define SPITZ_IRQ_GPIO_AC_IN          IRQ_GPIO(SPITZ_GPIO_AC_IN)
-#define SPITZ_IRQ_GPIO_AK_INT         IRQ_GPIO(SPITZ_GPIO_AK_INT)
-#define SPITZ_IRQ_GPIO_HP_IN          IRQ_GPIO(SPITZ_GPIO_HP_IN)
-#define SPITZ_IRQ_GPIO_TP_INT         IRQ_GPIO(SPITZ_GPIO_TP_INT)
-#define SPITZ_IRQ_GPIO_SYNC           IRQ_GPIO(SPITZ_GPIO_SYNC)
-#define SPITZ_IRQ_GPIO_ON_KEY         IRQ_GPIO(SPITZ_GPIO_ON_KEY)
-#define SPITZ_IRQ_GPIO_SWA            IRQ_GPIO(SPITZ_GPIO_SWA)
-#define SPITZ_IRQ_GPIO_SWB            IRQ_GPIO(SPITZ_GPIO_SWB)
-#define SPITZ_IRQ_GPIO_BAT_COVER      IRQ_GPIO(SPITZ_GPIO_BAT_COVER)
-#define SPITZ_IRQ_GPIO_FATAL_BAT      IRQ_GPIO(SPITZ_GPIO_FATAL_BAT)
-#define SPITZ_IRQ_GPIO_CO             IRQ_GPIO(SPITZ_GPIO_CO)
-#define SPITZ_IRQ_GPIO_CF_IRQ         IRQ_GPIO(SPITZ_GPIO_CF_IRQ)
-#define SPITZ_IRQ_GPIO_CF_CD          IRQ_GPIO(SPITZ_GPIO_CF_CD)
-#define SPITZ_IRQ_GPIO_CF2_IRQ        IRQ_GPIO(SPITZ_GPIO_CF2_IRQ)
-#define SPITZ_IRQ_GPIO_nSD_INT        IRQ_GPIO(SPITZ_GPIO_nSD_INT)
-#define SPITZ_IRQ_GPIO_nSD_DETECT     IRQ_GPIO(SPITZ_GPIO_nSD_DETECT)
+#define SPITZ_IRQ_GPIO_KEY_INT        PXA_GPIO_TO_IRQ(SPITZ_GPIO_KEY_INT)
+#define SPITZ_IRQ_GPIO_AC_IN          PXA_GPIO_TO_IRQ(SPITZ_GPIO_AC_IN)
+#define SPITZ_IRQ_GPIO_AK_INT         PXA_GPIO_TO_IRQ(SPITZ_GPIO_AK_INT)
+#define SPITZ_IRQ_GPIO_HP_IN          PXA_GPIO_TO_IRQ(SPITZ_GPIO_HP_IN)
+#define SPITZ_IRQ_GPIO_TP_INT         PXA_GPIO_TO_IRQ(SPITZ_GPIO_TP_INT)
+#define SPITZ_IRQ_GPIO_SYNC           PXA_GPIO_TO_IRQ(SPITZ_GPIO_SYNC)
+#define SPITZ_IRQ_GPIO_ON_KEY         PXA_GPIO_TO_IRQ(SPITZ_GPIO_ON_KEY)
+#define SPITZ_IRQ_GPIO_SWA            PXA_GPIO_TO_IRQ(SPITZ_GPIO_SWA)
+#define SPITZ_IRQ_GPIO_SWB            PXA_GPIO_TO_IRQ(SPITZ_GPIO_SWB)
+#define SPITZ_IRQ_GPIO_BAT_COVER      PXA_GPIO_TO_IRQ(SPITZ_GPIO_BAT_COVER)
+#define SPITZ_IRQ_GPIO_FATAL_BAT      PXA_GPIO_TO_IRQ(SPITZ_GPIO_FATAL_BAT)
+#define SPITZ_IRQ_GPIO_CO             PXA_GPIO_TO_IRQ(SPITZ_GPIO_CO)
+#define SPITZ_IRQ_GPIO_CF_IRQ         PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF_IRQ)
+#define SPITZ_IRQ_GPIO_CF_CD          PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF_CD)
+#define SPITZ_IRQ_GPIO_CF2_IRQ        PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF2_IRQ)
+#define SPITZ_IRQ_GPIO_nSD_INT        PXA_GPIO_TO_IRQ(SPITZ_GPIO_nSD_INT)
+#define SPITZ_IRQ_GPIO_nSD_DETECT     PXA_GPIO_TO_IRQ(SPITZ_GPIO_nSD_DETECT)
 
 /*
  * Shared data structures
index d1fce8b6d1051d23b910bae6e7e5d8109ee0bdad..c5afacd3cc0b4067aac361514f85c88e14595ab4 100644 (file)
@@ -9,15 +9,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#include <asm/proc-fns.h>
-#include "hardware.h"
-#include "pxa2xx-regs.h"
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-
-void arch_reset(char mode, const char *cmd);
index 1272c4b56ceb8de05875e75310df11b86b377982..2bb0e862598c41eeca0c20b36469b49f7cdc9692 100644 (file)
@@ -24,7 +24,7 @@
 /*
  * SCOOP2 internal GPIOs
  */
-#define TOSA_SCOOP_GPIO_BASE           NR_BUILTIN_GPIO
+#define TOSA_SCOOP_GPIO_BASE           PXA_NR_BUILTIN_GPIO
 #define TOSA_SCOOP_PXA_VCORE1          SCOOP_GPCR_PA11
 #define TOSA_GPIO_TC6393XB_REST_IN     (TOSA_SCOOP_GPIO_BASE + 1)
 #define TOSA_GPIO_IR_POWERDWN          (TOSA_SCOOP_GPIO_BASE + 2)
@@ -42,7 +42,7 @@
 /*
  * SCOOP2 jacket GPIOs
  */
-#define TOSA_SCOOP_JC_GPIO_BASE                (NR_BUILTIN_GPIO + 12)
+#define TOSA_SCOOP_JC_GPIO_BASE                (PXA_NR_BUILTIN_GPIO + 12)
 #define TOSA_GPIO_BT_LED               (TOSA_SCOOP_JC_GPIO_BASE + 0)
 #define TOSA_GPIO_NOTE_LED             (TOSA_SCOOP_JC_GPIO_BASE + 1)
 #define TOSA_GPIO_CHRG_ERR_LED         (TOSA_SCOOP_JC_GPIO_BASE + 2)
@@ -59,7 +59,7 @@
 /*
  * TC6393XB GPIOs
  */
-#define TOSA_TC6393XB_GPIO_BASE                (NR_BUILTIN_GPIO + 2 * 12)
+#define TOSA_TC6393XB_GPIO_BASE                (PXA_NR_BUILTIN_GPIO + 2 * 12)
 
 #define TOSA_GPIO_TG_ON                        (TOSA_TC6393XB_GPIO_BASE + 0)
 #define TOSA_GPIO_L_MUTE               (TOSA_TC6393XB_GPIO_BASE + 1)
 /*
  * Interrupts
  */
-#define TOSA_IRQ_GPIO_WAKEUP           IRQ_GPIO(TOSA_GPIO_WAKEUP)
-#define TOSA_IRQ_GPIO_AC_IN            IRQ_GPIO(TOSA_GPIO_AC_IN)
-#define TOSA_IRQ_GPIO_RECORD_BTN       IRQ_GPIO(TOSA_GPIO_RECORD_BTN)
-#define TOSA_IRQ_GPIO_SYNC             IRQ_GPIO(TOSA_GPIO_SYNC)
-#define TOSA_IRQ_GPIO_USB_IN           IRQ_GPIO(TOSA_GPIO_USB_IN)
-#define TOSA_IRQ_GPIO_JACKET_DETECT    IRQ_GPIO(TOSA_GPIO_JACKET_DETECT)
-#define TOSA_IRQ_GPIO_nSD_INT          IRQ_GPIO(TOSA_GPIO_nSD_INT)
-#define TOSA_IRQ_GPIO_nSD_DETECT       IRQ_GPIO(TOSA_GPIO_nSD_DETECT)
-#define TOSA_IRQ_GPIO_BAT1_CRG         IRQ_GPIO(TOSA_GPIO_BAT1_CRG)
-#define TOSA_IRQ_GPIO_CF_CD            IRQ_GPIO(TOSA_GPIO_CF_CD)
-#define TOSA_IRQ_GPIO_BAT0_CRG         IRQ_GPIO(TOSA_GPIO_BAT0_CRG)
-#define TOSA_IRQ_GPIO_TC6393XB_INT     IRQ_GPIO(TOSA_GPIO_TC6393XB_INT)
-#define TOSA_IRQ_GPIO_BAT0_LOW         IRQ_GPIO(TOSA_GPIO_BAT0_LOW)
-#define TOSA_IRQ_GPIO_EAR_IN           IRQ_GPIO(TOSA_GPIO_EAR_IN)
-#define TOSA_IRQ_GPIO_CF_IRQ           IRQ_GPIO(TOSA_GPIO_CF_IRQ)
-#define TOSA_IRQ_GPIO_ON_KEY           IRQ_GPIO(TOSA_GPIO_ON_KEY)
-#define TOSA_IRQ_GPIO_VGA_LINE         IRQ_GPIO(TOSA_GPIO_VGA_LINE)
-#define TOSA_IRQ_GPIO_TP_INT           IRQ_GPIO(TOSA_GPIO_TP_INT)
-#define TOSA_IRQ_GPIO_JC_CF_IRQ        IRQ_GPIO(TOSA_GPIO_JC_CF_IRQ)
-#define TOSA_IRQ_GPIO_BAT_LOCKED       IRQ_GPIO(TOSA_GPIO_BAT_LOCKED)
-#define TOSA_IRQ_GPIO_BAT1_LOW         IRQ_GPIO(TOSA_GPIO_BAT1_LOW)
-#define TOSA_IRQ_GPIO_KEY_SENSE(a)     IRQ_GPIO(69+(a))
-
-#define TOSA_IRQ_GPIO_MAIN_BAT_LOW     IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW)
+#define TOSA_IRQ_GPIO_WAKEUP           PXA_GPIO_TO_IRQ(TOSA_GPIO_WAKEUP)
+#define TOSA_IRQ_GPIO_AC_IN            PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN)
+#define TOSA_IRQ_GPIO_RECORD_BTN       PXA_GPIO_TO_IRQ(TOSA_GPIO_RECORD_BTN)
+#define TOSA_IRQ_GPIO_SYNC             PXA_GPIO_TO_IRQ(TOSA_GPIO_SYNC)
+#define TOSA_IRQ_GPIO_USB_IN           PXA_GPIO_TO_IRQ(TOSA_GPIO_USB_IN)
+#define TOSA_IRQ_GPIO_JACKET_DETECT    PXA_GPIO_TO_IRQ(TOSA_GPIO_JACKET_DETECT)
+#define TOSA_IRQ_GPIO_nSD_INT          PXA_GPIO_TO_IRQ(TOSA_GPIO_nSD_INT)
+#define TOSA_IRQ_GPIO_nSD_DETECT       PXA_GPIO_TO_IRQ(TOSA_GPIO_nSD_DETECT)
+#define TOSA_IRQ_GPIO_BAT1_CRG         PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT1_CRG)
+#define TOSA_IRQ_GPIO_CF_CD            PXA_GPIO_TO_IRQ(TOSA_GPIO_CF_CD)
+#define TOSA_IRQ_GPIO_BAT0_CRG         PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT0_CRG)
+#define TOSA_IRQ_GPIO_TC6393XB_INT     PXA_GPIO_TO_IRQ(TOSA_GPIO_TC6393XB_INT)
+#define TOSA_IRQ_GPIO_BAT0_LOW         PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT0_LOW)
+#define TOSA_IRQ_GPIO_EAR_IN           PXA_GPIO_TO_IRQ(TOSA_GPIO_EAR_IN)
+#define TOSA_IRQ_GPIO_CF_IRQ           PXA_GPIO_TO_IRQ(TOSA_GPIO_CF_IRQ)
+#define TOSA_IRQ_GPIO_ON_KEY           PXA_GPIO_TO_IRQ(TOSA_GPIO_ON_KEY)
+#define TOSA_IRQ_GPIO_VGA_LINE         PXA_GPIO_TO_IRQ(TOSA_GPIO_VGA_LINE)
+#define TOSA_IRQ_GPIO_TP_INT           PXA_GPIO_TO_IRQ(TOSA_GPIO_TP_INT)
+#define TOSA_IRQ_GPIO_JC_CF_IRQ        PXA_GPIO_TO_IRQ(TOSA_GPIO_JC_CF_IRQ)
+#define TOSA_IRQ_GPIO_BAT_LOCKED       PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT_LOCKED)
+#define TOSA_IRQ_GPIO_BAT1_LOW         PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT1_LOW)
+#define TOSA_IRQ_GPIO_KEY_SENSE(a)     PXA_GPIO_TO_IRQ(69+(a))
+
+#define TOSA_IRQ_GPIO_MAIN_BAT_LOW     PXA_GPIO_TO_IRQ(TOSA_GPIO_MAIN_BAT_LOW)
 
 #define TOSA_KEY_SYNC          KEY_102ND /* ??? */
 
index 903e1a2e6641409d8d9ffca8f03387cabf0474ea..d2ca01053f697d888bb3d529e5f8a998efcbb27b 100644 (file)
 
 /* Ethernet Controller Davicom DM9000 */
 #define GPIO_DM9000            101
-#define TRIZEPS4_ETH_IRQ       IRQ_GPIO(GPIO_DM9000)
+#define TRIZEPS4_ETH_IRQ       PXA_GPIO_TO_IRQ(GPIO_DM9000)
 
 /* UCB1400 audio / TS-controller */
 #define GPIO_UCB1400           1
-#define TRIZEPS4_UCB1400_IRQ   IRQ_GPIO(GPIO_UCB1400)
+#define TRIZEPS4_UCB1400_IRQ   PXA_GPIO_TO_IRQ(GPIO_UCB1400)
 
 /* PCMCIA socket Compact Flash */
 #define GPIO_PCD               11              /* PCMCIA Card Detect */
-#define TRIZEPS4_CD_IRQ                IRQ_GPIO(GPIO_PCD)
+#define TRIZEPS4_CD_IRQ                PXA_GPIO_TO_IRQ(GPIO_PCD)
 #define GPIO_PRDY              13              /* READY / nINT */
-#define TRIZEPS4_READY_NINT    IRQ_GPIO(GPIO_PRDY)
+#define TRIZEPS4_READY_NINT    PXA_GPIO_TO_IRQ(GPIO_PRDY)
 
 /* MMC socket */
 #define GPIO_MMC_DET           12
-#define TRIZEPS4_MMC_IRQ       IRQ_GPIO(GPIO_MMC_DET)
+#define TRIZEPS4_MMC_IRQ       PXA_GPIO_TO_IRQ(GPIO_MMC_DET)
 
 /* DOC NAND chip */
 #define GPIO_DOC_LOCK           94
 #define GPIO_DOC_IRQ            93
-#define TRIZEPS4_DOC_IRQ        IRQ_GPIO(GPIO_DOC_IRQ)
+#define TRIZEPS4_DOC_IRQ        PXA_GPIO_TO_IRQ(GPIO_DOC_IRQ)
 
 /* SPI interface */
 #define GPIO_SPI                53
-#define TRIZEPS4_SPI_IRQ        IRQ_GPIO(GPIO_SPI)
+#define TRIZEPS4_SPI_IRQ        PXA_GPIO_TO_IRQ(GPIO_SPI)
 
 /* LEDS using tx2 / rx2 */
 #define GPIO_SYS_BUSY_LED      46
@@ -74,7 +74,7 @@
 
 /* Off-module PIC on ConXS board */
 #define GPIO_PIC               0
-#define TRIZEPS4_PIC_IRQ       IRQ_GPIO(GPIO_PIC)
+#define TRIZEPS4_PIC_IRQ       PXA_GPIO_TO_IRQ(GPIO_PIC)
 
 #ifdef CONFIG_MACH_TRIZEPS_CONXS
 /* for CONXS base board define these registers */
diff --git a/arch/arm/mach-pxa/include/mach/vmalloc.h b/arch/arm/mach-pxa/include/mach/vmalloc.h
deleted file mode 100644 (file)
index bfecfbf..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * arch/arm/mach-pxa/include/mach/vmalloc.h
- *
- * Author:     Nicolas Pitre
- * Copyright:  (C) 2001 MontaVista Software 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.
- */
-#define VMALLOC_END       (0xe8000000UL)
index 532c5d3a97d24e861ff61305280c41f8de1bbac0..5dae15ea67184a5c1b60db8c5c3fd2e62f168961 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
-#include <mach/gpio-pxa.h>
 
 #include "generic.h"
 
@@ -92,44 +91,6 @@ static struct irq_chip pxa_internal_irq_chip = {
        .irq_unmask     = pxa_unmask_irq,
 };
 
-/*
- * GPIO IRQs for GPIO 0 and 1
- */
-static int pxa_set_low_gpio_type(struct irq_data *d, unsigned int type)
-{
-       int gpio = d->irq - IRQ_GPIO0;
-
-       if (__gpio_is_occupied(gpio)) {
-               pr_err("%s failed: GPIO is configured\n", __func__);
-               return -EINVAL;
-       }
-
-       if (type & IRQ_TYPE_EDGE_RISING)
-               GRER0 |= GPIO_bit(gpio);
-       else
-               GRER0 &= ~GPIO_bit(gpio);
-
-       if (type & IRQ_TYPE_EDGE_FALLING)
-               GFER0 |= GPIO_bit(gpio);
-       else
-               GFER0 &= ~GPIO_bit(gpio);
-
-       return 0;
-}
-
-static void pxa_ack_low_gpio(struct irq_data *d)
-{
-       GEDR0 = (1 << (d->irq - IRQ_GPIO0));
-}
-
-static struct irq_chip pxa_low_gpio_chip = {
-       .name           = "GPIO-l",
-       .irq_ack        = pxa_ack_low_gpio,
-       .irq_mask       = pxa_mask_irq,
-       .irq_unmask     = pxa_unmask_irq,
-       .irq_set_type   = pxa_set_low_gpio_type,
-};
-
 asmlinkage void __exception_irq_entry icip_handle_irq(struct pt_regs *regs)
 {
        uint32_t icip, icmr, mask;
@@ -160,26 +121,7 @@ asmlinkage void __exception_irq_entry ichp_handle_irq(struct pt_regs *regs)
        } while (1);
 }
 
-static void __init pxa_init_low_gpio_irq(set_wake_t fn)
-{
-       int irq;
-
-       /* clear edge detection on GPIO 0 and 1 */
-       GFER0 &= ~0x3;
-       GRER0 &= ~0x3;
-       GEDR0 = 0x3;
-
-       for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
-               irq_set_chip_and_handler(irq, &pxa_low_gpio_chip,
-                                        handle_edge_irq);
-               irq_set_chip_data(irq, irq_base(0));
-               set_irq_flags(irq, IRQF_VALID);
-       }
-
-       pxa_low_gpio_chip.irq_set_wake = fn;
-}
-
-void __init pxa_init_irq(int irq_nr, set_wake_t fn)
+void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int))
 {
        int irq, i, n;
 
@@ -209,7 +151,6 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
        __raw_writel(1, irq_base(0) + ICCR);
 
        pxa_internal_irq_chip.irq_set_wake = fn;
-       pxa_init_low_gpio_irq(fn);
 }
 
 #ifdef CONFIG_PM
index 7b324ec6449f49553654d45b4aba900da01f23ed..1fb86edb857caab03c9bf6b77ab8f7ece812a350 100644 (file)
@@ -124,8 +124,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)),
-               .end    = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)),
+               .start  = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)),
+               .end    = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
        }
 };
@@ -396,7 +396,7 @@ static struct i2c_board_info littleton_i2c_info[] = {
                .type           = "da9034",
                .addr           = 0x34,
                .platform_data  = &littleton_da9034_info,
-               .irq            = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO18)),
+               .irq            = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO18)),
        },
        [1] = {
                .type           = "max7320",
@@ -445,4 +445,5 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = littleton_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 1dd530279e0b977f2726addff891d540c1fdbc46..cee9ce2fc0b5caf9f806d815e8c036739ef4e4e6 100644 (file)
@@ -152,8 +152,8 @@ static void __init lpd270_init_irq(void)
                                         handle_level_irq);
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }
-       irq_set_chained_handler(IRQ_GPIO(0), lpd270_irq_handler);
-       irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING);
+       irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lpd270_irq_handler);
+       irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
 }
 
 
@@ -505,4 +505,5 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = lpd270_init,
+       .restart        = pxa_restart,
 MACHINE_END
index c48ce6da9184f6d338e15ef729f8f043d66b8e77..6ebd276aebeb484a93923689657d35867f3cf7d5 100644 (file)
@@ -170,8 +170,8 @@ static void __init lubbock_init_irq(void)
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }
 
-       irq_set_chained_handler(IRQ_GPIO(0), lubbock_irq_handler);
-       irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING);
+       irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lubbock_irq_handler);
+       irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
 }
 
 #ifdef CONFIG_PM
@@ -556,4 +556,5 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = lubbock_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 4b796c37af3ec5ab6ef15edebb1c8092b6f2ab50..3d6baf91396cd2cd52f2b41163f17a17cea6aa5d 100644 (file)
@@ -184,8 +184,8 @@ static struct resource egpio_resources[] = {
                .flags = IORESOURCE_MEM,
        },
        [1] = {
-               .start = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
-               .end   = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
+               .start = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
+               .end   = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
                .flags = IORESOURCE_IRQ,
        },
 };
@@ -468,8 +468,8 @@ static struct resource pasic3_resources[] = {
        },
        /* No IRQ handler in the PASIC3, DS1WM needs an external IRQ */
        [1] = {
-               .start  = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
-               .end    = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
+               .start  = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -760,4 +760,5 @@ MACHINE_START(MAGICIAN, "HTC Magician")
        .handle_irq = pxa27x_handle_irq,
        .init_machine = magician_init,
        .timer = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
index 0567d3965fda4dffb422125a7cf4351272f2daa8..1aebaf719462e091f7b7c29a9180c115b346808c 100644 (file)
@@ -178,8 +178,8 @@ static void __init mainstone_init_irq(void)
        MST_INTMSKENA = 0;
        MST_INTSETCLR = 0;
 
-       irq_set_chained_handler(IRQ_GPIO(0), mainstone_irq_handler);
-       irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING);
+       irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), mainstone_irq_handler);
+       irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
 }
 
 #ifdef CONFIG_PM
@@ -622,4 +622,5 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = mainstone_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 43a5f6861ca3f8209c79bd311cac9e0d87781e11..f14775536b8385172e929791a627c3a689fb94ac 100644 (file)
@@ -13,6 +13,7 @@
  *  published by the Free Software Foundation.
  */
 #include <linux/gpio.h>
+#include <linux/gpio-pxa.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -20,7 +21,6 @@
 
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa2xx.h>
-#include <mach/gpio-pxa.h>
 
 #include "generic.h"
 
 #define GAFR_L(x)      __GAFR(0, x)
 #define GAFR_U(x)      __GAFR(1, x)
 
+#define BANK_OFF(n)    (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
+#define GPLR(x)                __REG2(0x40E00000, BANK_OFF((x) >> 5))
+#define GPDR(x)                __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x0c)
+
 #define PWER_WE35      (1 << 24)
 
 struct gpio_desc {
index b938fc2c316a7d7145423e96396d84ebae27afc6..6518a30ece8eeb54906f6ad36fd589cdfae2524f 100644 (file)
@@ -541,15 +541,15 @@ static struct pda_power_pdata power_pdata = {
 static struct resource power_resources[] = {
        [0] = {
                .name   = "ac",
-               .start  = gpio_to_irq(GPIO96_AC_DETECT),
-               .end    = gpio_to_irq(GPIO96_AC_DETECT),
+               .start  = PXA_GPIO_TO_IRQ(GPIO96_AC_DETECT),
+               .end    = PXA_GPIO_TO_IRQ(GPIO96_AC_DETECT),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
                IORESOURCE_IRQ_LOWEDGE,
        },
        [1] = {
                .name   = "usb",
-               .start  = gpio_to_irq(GPIO13_nUSB_DETECT),
-               .end    = gpio_to_irq(GPIO13_nUSB_DETECT),
+               .start  = PXA_GPIO_TO_IRQ(GPIO13_nUSB_DETECT),
+               .end    = PXA_GPIO_TO_IRQ(GPIO13_nUSB_DETECT),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
                IORESOURCE_IRQ_LOWEDGE,
        },
@@ -696,13 +696,13 @@ static void mioa701_machine_exit(void);
 static void mioa701_poweroff(void)
 {
        mioa701_machine_exit();
-       arm_machine_restart('s', NULL);
+       pxa_restart('s', NULL);
 }
 
 static void mioa701_restart(char c, const char *cmd)
 {
        mioa701_machine_exit();
-       arm_machine_restart('s', cmd);
+       pxa_restart('s', cmd);
 }
 
 static struct gpio global_gpios[] = {
@@ -734,7 +734,6 @@ static void __init mioa701_machine_init(void)
        pxa_set_udc_info(&mioa701_udc_info);
        pxa_set_ac97_info(&mioa701_ac97_info);
        pm_power_off = mioa701_poweroff;
-       arm_pm_restart = mioa701_restart;
        platform_add_devices(devices, ARRAY_SIZE(devices));
        gsm_init();
 
@@ -752,9 +751,11 @@ static void mioa701_machine_exit(void)
 
 MACHINE_START(MIOA701, "MIO A701")
        .atag_offset    = 0x100,
+       .restart_mode   = 's',
        .map_io         = &pxa27x_map_io,
        .init_irq       = &pxa27x_init_irq,
        .handle_irq     = &pxa27x_handle_irq,
        .init_machine   = mioa701_machine_init,
        .timer          = &pxa_timer,
+       .restart        = mioa701_restart,
 MACHINE_END
index 4af5d513c38026ea0194d239df879a746f976654..169bf8f97af00028a76d314b2bb8efa2d6b19e93 100644 (file)
@@ -98,5 +98,6 @@ MACHINE_START(NEC_MP900, "MobilePro900/C")
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
        .init_machine   = mp900c_init,
+       .restart        = pxa_restart,
 MACHINE_END
 
index 90928d6e1a5bc05f3579c2901a2036eb34872aa3..83570a79e7d24f02e8f9bd0db1bc6247bf8cbeee 100644 (file)
@@ -417,8 +417,8 @@ static struct resource dm9k_resources[] = {
               .flags = IORESOURCE_MEM
        },
        [2] = {
-              .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
-              .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
+              .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
+              .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
        }
 };
index 3d4a2819cae181f4645bd249aa2ab5e7244e5ba4..1fa80f4f80c8484595c4f4a5a17cdaf931a9cc33 100644 (file)
@@ -347,5 +347,6 @@ MACHINE_START(PALMLD, "Palm LifeDrive")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = palmld_init
+       .init_machine   = palmld_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 99d6bcf1f9741463ffe53845ac518c61dd605896..5ba14316bd9c273b386e6267582dc93aa1131463 100644 (file)
@@ -208,5 +208,6 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = palmt5_init
+       .init_machine   = palmt5_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 2c24c67fd92b6d863fc2e534b6ad9f15b7daaaf7..29b51b40f09df49a60a2ab07d91122f0f840ed74 100644 (file)
@@ -542,5 +542,6 @@ MACHINE_START(PALMTC, "Palm Tungsten|C")
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = palmtc_init
+       .init_machine   = palmtc_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 9376da06404c7ea25c25101a44962a19ff4f3614..5ebf49acb8279d321a61596718980dc45dadfa11 100644 (file)
@@ -361,5 +361,6 @@ MACHINE_START(PALMTE2, "Palm Tungsten|E2")
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = palmte2_init
+       .init_machine   = palmte2_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 94e9708b349da5f0be7cfa4fec34f2f24e445475..ec8249156c0846b1d6129b6c55ab7a431d23d2a4 100644 (file)
@@ -452,6 +452,7 @@ MACHINE_START(TREO680, "Palm Treo 680")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = treo680_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -464,5 +465,6 @@ MACHINE_START(CENTRO, "Palm Centro 685")
        .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = centro_init,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
index 4e3e45927e95336cf9d2fb4c4185f7f94c90d26b..6170d76dfba8f395a41ff16c6c16ac28d1760970 100644 (file)
@@ -369,5 +369,6 @@ MACHINE_START(PALMTX, "Palm T|X")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = palmtx_init
+       .init_machine   = palmtx_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 68e18baf8e079986d1ca63459c809eaad13b668e..b2dff9d415ebf69eedba22393913e74075bb75ac 100644 (file)
@@ -404,5 +404,6 @@ MACHINE_START(PALMZ72, "Palm Zire72")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = palmz72_init
+       .init_machine   = palmz72_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 0b825a353537c783f1f6e4623b2923fa79842ec7..fe9054435b6f214c63b700fe61967d0ec2d32987 100644 (file)
@@ -265,4 +265,5 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = pcm027_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 6d38c6548b3d4ba0c6dcc0471819fca0ab7b9ee5..abab4e2b122c088195f9fcbdc8708976c68da90a 100644 (file)
@@ -378,7 +378,7 @@ struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
 #include <linux/i2c/pca953x.h>
 
 static struct pca953x_platform_data pca9536_data = {
-       .gpio_base      = NR_BUILTIN_GPIO,
+       .gpio_base      = PXA_NR_BUILTIN_GPIO,
 };
 
 static int gpio_bus_switch = -EINVAL;
@@ -406,9 +406,9 @@ static unsigned long pcm990_camera_query_bus_param(struct soc_camera_link *link)
        int ret;
 
        if (gpio_bus_switch < 0) {
-               ret = gpio_request(NR_BUILTIN_GPIO, "camera");
+               ret = gpio_request(PXA_NR_BUILTIN_GPIO, "camera");
                if (!ret) {
-                       gpio_bus_switch = NR_BUILTIN_GPIO;
+                       gpio_bus_switch = PXA_NR_BUILTIN_GPIO;
                        gpio_direction_output(gpio_bus_switch, 0);
                }
        }
index 50c8331778668c66c97b4ff99b2b345e01efb999..69036e42ca31dc7f38f136c527add7e0f0e8fe95 100644 (file)
@@ -166,8 +166,8 @@ static struct resource locomo_resources[] = {
                .flags          = IORESOURCE_MEM,
        },
        [1] = {
-               .start          = IRQ_GPIO(10),
-               .end            = IRQ_GPIO(10),
+               .start          = PXA_GPIO_TO_IRQ(10),
+               .end            = PXA_GPIO_TO_IRQ(10),
                .flags          = IORESOURCE_IRQ,
        },
 };
@@ -212,7 +212,7 @@ static struct spi_board_info poodle_spi_devices[] = {
                .bus_num        = 1,
                .platform_data  = &poodle_ads7846_info,
                .controller_data= &poodle_ads7846_chip,
-               .irq            = gpio_to_irq(POODLE_GPIO_TP_INT),
+               .irq            = PXA_GPIO_TO_IRQ(POODLE_GPIO_TP_INT),
        },
 };
 
@@ -417,12 +417,7 @@ static struct i2c_board_info __initdata poodle_i2c_devices[] = {
 
 static void poodle_poweroff(void)
 {
-       arm_machine_restart('h', NULL);
-}
-
-static void poodle_restart(char mode, const char *cmd)
-{
-       arm_machine_restart('h', cmd);
+       pxa_restart('h', NULL);
 }
 
 static void __init poodle_init(void)
@@ -430,7 +425,6 @@ static void __init poodle_init(void)
        int ret = 0;
 
        pm_power_off = poodle_poweroff;
-       arm_pm_restart = poodle_restart;
 
        PCFR |= PCFR_OPDE;
 
@@ -472,4 +466,5 @@ MACHINE_START(POODLE, "SHARP Poodle")
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = poodle_init,
+       .restart        = pxa_restart,
 MACHINE_END
index f05f9486b0cbfadb8f41f3ac269fc7e1e329604b..8a775f631c551b47015900d2650329797558156f 100644 (file)
@@ -17,6 +17,7 @@
  * need be.
  */
 #include <linux/gpio.h>
+#include <linux/gpio-pxa.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -208,6 +209,7 @@ static struct clk_lookup pxa25x_clkregs[] = {
        INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"),
        INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"),
        INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL),
+       INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL),
 };
 
 static struct clk_lookup pxa25x_hwuart_clkreg =
@@ -287,7 +289,7 @@ static inline void pxa25x_init_pm(void) {}
 
 static int pxa25x_set_wake(struct irq_data *d, unsigned int on)
 {
-       int gpio = irq_to_gpio(d->irq);
+       int gpio = pxa_irq_to_gpio(d->irq);
        uint32_t mask = 0;
 
        if (gpio >= 0 && gpio < 85)
@@ -312,14 +314,12 @@ set_pwer:
 void __init pxa25x_init_irq(void)
 {
        pxa_init_irq(32, pxa25x_set_wake);
-       pxa_init_gpio(IRQ_GPIO_2_x, 2, 84, pxa25x_set_wake);
 }
 
 #ifdef CONFIG_CPU_PXA26x
 void __init pxa26x_init_irq(void)
 {
        pxa_init_irq(32, pxa25x_set_wake);
-       pxa_init_gpio(IRQ_GPIO_2_x, 2, 89, pxa25x_set_wake);
 }
 #endif
 
index bc5a98ebaa72872033ab49c7e535f4d5bc1317f7..6c49e66057e327539d14c543c108073318195d06 100644 (file)
@@ -12,6 +12,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/gpio.h>
+#include <linux/gpio-pxa.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -229,6 +230,7 @@ static struct clk_lookup pxa27x_clkregs[] = {
        INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"),
        INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
        INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL),
+       INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL),
 };
 
 #ifdef CONFIG_PM
@@ -355,7 +357,7 @@ static inline void pxa27x_init_pm(void) {}
  */
 static int pxa27x_set_wake(struct irq_data *d, unsigned int on)
 {
-       int gpio = irq_to_gpio(d->irq);
+       int gpio = pxa_irq_to_gpio(d->irq);
        uint32_t mask;
 
        if (gpio >= 0 && gpio < 128)
@@ -386,7 +388,6 @@ static int pxa27x_set_wake(struct irq_data *d, unsigned int on)
 void __init pxa27x_init_irq(void)
 {
        pxa_init_irq(34, pxa27x_set_wake);
-       pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake);
 }
 
 static struct map_desc pxa27x_io_desc[] __initdata = {
@@ -422,6 +423,7 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 }
 
 static struct platform_device *devices[] __initdata = {
+       &pxa_device_gpio,
        &pxa27x_device_udc,
        &pxa_device_pmu,
        &pxa_device_i2s,
index 0737c59b88ae4b571cef1e907f841c2dc9d1184b..4f402afa6609c0ed584100d951347ec1272f8531 100644 (file)
@@ -25,7 +25,6 @@
 #include <asm/mach/map.h>
 #include <asm/suspend.h>
 #include <mach/hardware.h>
-#include <mach/gpio-pxa.h>
 #include <mach/pxa3xx-regs.h>
 #include <mach/reset.h>
 #include <mach/ohci.h>
@@ -56,6 +55,7 @@ static DEFINE_PXA3_CKEN(pxa3xx_pwm0, PWM0, 13000000, 0);
 static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0);
 static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0);
 static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_gpio, GPIO, 13000000, 0);
 
 static DEFINE_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops);
 static DEFINE_CK(pxa3xx_smemc, SMC, &clk_pxa3xx_smemc_ops);
@@ -88,6 +88,7 @@ static struct clk_lookup pxa3xx_clkregs[] = {
        INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
        INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL),
        INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL),
+       INIT_CLKREG(&clk_pxa3xx_gpio, "pxa-gpio", NULL),
 };
 
 #ifdef CONFIG_PM
@@ -365,7 +366,8 @@ static struct irq_chip pxa_ext_wakeup_chip = {
        .irq_set_type   = pxa_set_ext_wakeup_type,
 };
 
-static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
+static void __init pxa_init_ext_wakeup_irq(int (*fn)(struct irq_data *,
+                                          unsigned int))
 {
        int irq;
 
@@ -388,7 +390,6 @@ void __init pxa3xx_init_irq(void)
 
        pxa_init_irq(56, pxa3xx_set_wake);
        pxa_init_ext_wakeup_irq(pxa3xx_set_wake);
-       pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
 }
 
 static struct map_desc pxa3xx_io_desc[] __initdata = {
@@ -417,6 +418,7 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 }
 
 static struct platform_device *devices[] __initdata = {
+       &pxa_device_gpio,
        &pxa27x_device_udc,
        &pxa_device_pmu,
        &pxa_device_i2s,
index 51371b39d2a315b8880a2d2d03ca5a061a00baa8..d082a583df78a14c0bc4074db270bb8ce2393ca1 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/syscore_ops.h>
 
 #include <mach/hardware.h>
-#include <mach/gpio-pxa.h>
 #include <mach/pxa3xx-regs.h>
 #include <mach/pxa930.h>
 #include <mach/reset.h>
@@ -212,6 +211,7 @@ static DEFINE_PXA3_CKEN(pxa95x_ssp3, SSP3, 13000000, 0);
 static DEFINE_PXA3_CKEN(pxa95x_ssp4, SSP4, 13000000, 0);
 static DEFINE_PXA3_CKEN(pxa95x_pwm0, PWM0, 13000000, 0);
 static DEFINE_PXA3_CKEN(pxa95x_pwm1, PWM1, 13000000, 0);
+static DEFINE_PXA3_CKEN(pxa95x_gpio, GPIO, 13000000, 0);
 
 static struct clk_lookup pxa95x_clkregs[] = {
        INIT_CLKREG(&clk_pxa95x_pout, NULL, "CLK_POUT"),
@@ -230,12 +230,12 @@ static struct clk_lookup pxa95x_clkregs[] = {
        INIT_CLKREG(&clk_pxa95x_ssp4, "pxa27x-ssp.3", NULL),
        INIT_CLKREG(&clk_pxa95x_pwm0, "pxa27x-pwm.0", NULL),
        INIT_CLKREG(&clk_pxa95x_pwm1, "pxa27x-pwm.1", NULL),
+       INIT_CLKREG(&clk_pxa95x_gpio, "pxa-gpio", NULL),
 };
 
 void __init pxa95x_init_irq(void)
 {
        pxa_init_irq(96, NULL);
-       pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
 }
 
 /*
@@ -248,6 +248,7 @@ void __init pxa95x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 }
 
 static struct platform_device *devices[] __initdata = {
+       &pxa_device_gpio,
        &sa1100_device_rtc,
        &pxa_device_rtc,
        &pxa27x_device_ssp1,
index f0c05f4d12ed5eb48715d8433665b20199bde3bd..22818c7694a8fdb142b619f32c801e3cc9424386 100644 (file)
@@ -292,8 +292,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        {
-               .start  = gpio_to_irq(GPIO_ETH_IRQ),
-               .end    = gpio_to_irq(GPIO_ETH_IRQ),
+               .start  = PXA_GPIO_TO_IRQ(GPIO_ETH_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO_ETH_IRQ),
                .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
        }
 };
@@ -672,7 +672,7 @@ static struct lis3lv02d_platform_data lis3_pdata = {
        .chip_select    = 1,                    \
        .controller_data = (void *) GPIO_ACCEL_CS,      \
        .platform_data  = &lis3_pdata,          \
-       .irq            = gpio_to_irq(GPIO_ACCEL_IRQ),  \
+       .irq            = PXA_GPIO_TO_IRQ(GPIO_ACCEL_IRQ),      \
 }
 
 #define SPI_DAC7512    \
@@ -956,7 +956,7 @@ static struct eeti_ts_platform_data eeti_ts_pdata = {
 static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
        .type   = "eeti_ts",
        .addr   = 0x0a,
-       .irq    = gpio_to_irq(GPIO_TOUCH_IRQ),
+       .irq    = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ),
        .platform_data = &eeti_ts_pdata,
 };
 
@@ -1093,6 +1093,7 @@ MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -1104,6 +1105,7 @@ MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -1115,5 +1117,6 @@ MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
index 01e9d643394a9d28160a98ccaee118761d8fb75f..c8497b00cdfe8bcb66f791c2907fbea345290571 100644 (file)
@@ -81,14 +81,17 @@ static void do_hw_reset(void)
        OSMR3 = OSCR + 368640;  /* ... in 100 ms */
 }
 
-void arch_reset(char mode, const char *cmd)
+void pxa_restart(char mode, const char *cmd)
 {
+       local_irq_disable();
+       local_fiq_disable();
+
        clear_reset_status(RESET_STATUS_ALL);
 
        switch (mode) {
        case 's':
                /* Jump into ROM at address 0 */
-               cpu_reset(0);
+               soft_restart(0);
                break;
        case 'g':
                do_gpio_reset();
index fc2c1e05af9c2f59b1138dd011ef43069806d24a..0fe354efb9317a8d183b76ef23a5e1a056982c58 100644 (file)
@@ -96,8 +96,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
-               .end    = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
+               .start  = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO97)),
+               .end    = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO97)),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -502,7 +502,7 @@ static struct i2c_board_info saar_i2c_info[] = {
                .type           = "da9034",
                .addr           = 0x34,
                .platform_data  = &saar_da9034_info,
-               .irq            = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
+               .irq            = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO83)),
        },
 };
 
@@ -602,4 +602,5 @@ MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
        .handle_irq       = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = saar_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 3e999e308a2da66c86cee2eacbf4ee3f2eb82094..febc809ed5a6bd0657054bb78f59804e2a354f0a 100644 (file)
@@ -92,7 +92,7 @@ static struct i2c_board_info saarb_i2c_info[] = {
                .type           = "88PM860x",
                .addr           = 0x34,
                .platform_data  = &saarb_pm8607_info,
-               .irq            = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
+               .irq            = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO83)),
        },
 };
 
@@ -111,5 +111,6 @@ MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)")
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = saarb_init,
+       .restart        = pxa_restart,
 MACHINE_END
 
index 785880f67b60f9fac6f79f10c65c4ff13a137049..8d5168d253a9c8829b54c2b09ea6b4e57b8c5fe5 100644 (file)
@@ -907,24 +907,24 @@ static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
        gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
 
        /* Register interrupt handlers */
-       if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
-               dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin));
+       if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
+               dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin));
        }
 
-       if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
-               dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock));
+       if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
+               dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock));
        }
 
        if (sharpsl_pm.machinfo->gpio_fatal) {
-               if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
-                       dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal));
+               if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
+                       dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal));
                }
        }
 
        if (sharpsl_pm.machinfo->batfull_irq) {
                /* Register interrupt handler. */
-               if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
-                       dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull));
+               if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
+                       dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull));
                }
        }
 
@@ -953,14 +953,14 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
 
        led_trigger_unregister_simple(sharpsl_charge_led_trigger);
 
-       free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
-       free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
+       free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
+       free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
 
        if (sharpsl_pm.machinfo->gpio_fatal)
-               free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
+               free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
 
        if (sharpsl_pm.machinfo->batfull_irq)
-               free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
+               free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
 
        gpio_free(sharpsl_pm.machinfo->gpio_batlock);
        gpio_free(sharpsl_pm.machinfo->gpio_batfull);
index 953a9195f9e5bdd9850f62c2632c8f62c27fc9b2..abf355d0c92f4fda72ea75cdfeb146cfa32d4c48 100644 (file)
@@ -552,7 +552,7 @@ static struct spi_board_info spitz_spi_devices[] = {
                .chip_select            = 0,
                .platform_data          = &spitz_ads7846_info,
                .controller_data        = &spitz_ads7846_chip,
-               .irq                    = gpio_to_irq(SPITZ_GPIO_TP_INT),
+               .irq                    = PXA_GPIO_TO_IRQ(SPITZ_GPIO_TP_INT),
        }, {
                .modalias               = "corgi-lcd",
                .max_speed_hz           = 50000,
@@ -926,7 +926,7 @@ static inline void spitz_i2c_init(void) {}
  ******************************************************************************/
 static void spitz_poweroff(void)
 {
-       arm_machine_restart('g', NULL);
+       pxa_restart('g', NULL);
 }
 
 static void spitz_restart(char mode, const char *cmd)
@@ -943,7 +943,6 @@ static void __init spitz_init(void)
 {
        init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0);
        pm_power_off = spitz_poweroff;
-       arm_pm_restart = spitz_restart;
 
        PMCR = 0x00;
 
@@ -982,33 +981,39 @@ static void __init spitz_fixup(struct tag *tags, char **cmdline,
 
 #ifdef CONFIG_MACH_SPITZ
 MACHINE_START(SPITZ, "SHARP Spitz")
+       .restart_mode   = 'g',
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
        .timer          = &pxa_timer,
+       .restart        = spitz_restart,
 MACHINE_END
 #endif
 
 #ifdef CONFIG_MACH_BORZOI
 MACHINE_START(BORZOI, "SHARP Borzoi")
+       .restart_mode   = 'g',
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
        .timer          = &pxa_timer,
+       .restart        = spitz_restart,
 MACHINE_END
 #endif
 
 #ifdef CONFIG_MACH_AKITA
 MACHINE_START(AKITA, "SHARP Akita")
+       .restart_mode   = 'g',
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
        .timer          = &pxa_timer,
+       .restart        = spitz_restart,
 MACHINE_END
 #endif
index 094279aefe9c6fd5d6a86dd88fbbc44b6d55c07b..34cbdac51525524517bbedd355df413e9b9c89a1 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/gpio-pxa.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/apm-emulation.h>
@@ -41,6 +42,7 @@ static int spitz_last_ac_status;
 static struct gpio spitz_charger_gpios[] = {
        { SPITZ_GPIO_KEY_INT,   GPIOF_IN, "Keyboard Interrupt" },
        { SPITZ_GPIO_SYNC,      GPIOF_IN, "Sync" },
+       { SPITZ_GPIO_AC_IN,     GPIOF_IN, "Charger Detection" },
        { SPITZ_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" },
        { SPITZ_GPIO_JK_B,        GPIOF_OUT_INIT_LOW, "JK B" },
        { SPITZ_GPIO_CHRG_ON,     GPIOF_OUT_INIT_LOW, "Charger On" },
@@ -169,14 +171,19 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm)
 
 static unsigned long spitz_charger_wakeup(void)
 {
-       return (~GPLR0 & GPIO_bit(SPITZ_GPIO_KEY_INT)) | (GPLR0 & GPIO_bit(SPITZ_GPIO_SYNC));
+       unsigned long ret;
+       ret = (!gpio_get_value(SPITZ_GPIO_KEY_INT)
+               << GPIO_bit(SPITZ_GPIO_KEY_INT))
+               | (!gpio_get_value(SPITZ_GPIO_SYNC)
+               << GPIO_bit(SPITZ_GPIO_SYNC));
+       return ret;
 }
 
 unsigned long spitzpm_read_devdata(int type)
 {
        switch (type) {
        case SHARPSL_STATUS_ACIN:
-               return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0);
+               return !gpio_get_value(SPITZ_GPIO_AC_IN);
        case SHARPSL_STATUS_LOCK:
                return gpio_get_value(sharpsl_pm.machinfo->gpio_batlock);
        case SHARPSL_STATUS_CHRGFULL:
index 4c9a48bef569b41c57948d43d3dd9d8de8e686b5..d8a2467de92e3aabe7a366d17f59977a4cc4c473 100644 (file)
@@ -376,7 +376,7 @@ static struct spi_board_info spi_board_info[] __initdata = {
                .bus_num = 1,
                .chip_select = 0,
                .controller_data = &staccel_chip_info,
-               .irq = IRQ_GPIO(96),
+               .irq = PXA_GPIO_TO_IRQ(96),
        }, {
                .modalias = "cc2420",
                .max_speed_hz = 6500000,
@@ -546,7 +546,7 @@ static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = {
                .type = "da9030",
                .addr = 0x49,
                .platform_data = &imote2_da9030_pdata,
-               .irq = gpio_to_irq(1),
+               .irq = PXA_GPIO_TO_IRQ(1),
        },
 };
 
@@ -560,18 +560,18 @@ static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
                /* Through a nand gate - Also beware, on V2 sensor board the
                 * pull up resistors are missing.
                 */
-               .irq = IRQ_GPIO(99),
+               .irq = PXA_GPIO_TO_IRQ(99),
        }, { /* ITS400 Sensor board only */
                .type = "tsl2561",
                .addr = 0x49,
                /* Through a nand gate - Also beware, on V2 sensor board the
                 * pull up resistors are missing.
                 */
-               .irq = IRQ_GPIO(99),
+               .irq = PXA_GPIO_TO_IRQ(99),
        }, { /* ITS400 Sensor board only */
                .type = "tmp175",
                .addr = 0x4A,
-               .irq = IRQ_GPIO(96),
+               .irq = PXA_GPIO_TO_IRQ(96),
        }, { /* IMB400 Multimedia board */
                .type = "wm8940",
                .addr = 0x1A,
@@ -661,8 +661,8 @@ static struct resource smc91x_resources[] = {
                .flags = IORESOURCE_MEM,
        },
        [1] = {
-               .start = IRQ_GPIO(40),
-               .end = IRQ_GPIO(40),
+               .start = PXA_GPIO_TO_IRQ(40),
+               .end = PXA_GPIO_TO_IRQ(40),
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -707,7 +707,7 @@ static int stargate2_mci_init(struct device *dev,
        }
        gpio_direction_input(SG2_GPIO_nSD_DETECT);
 
-       err = request_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT),
+       err = request_irq(PXA_GPIO_TO_IRQ(SG2_GPIO_nSD_DETECT),
                          stargate2_detect_int,
                          IRQ_TYPE_EDGE_BOTH,
                          "MMC card detect",
@@ -738,7 +738,7 @@ static void stargate2_mci_setpower(struct device *dev, unsigned int vdd)
 
 static void stargate2_mci_exit(struct device *dev, void *data)
 {
-       free_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT), data);
+       free_irq(PXA_GPIO_TO_IRQ(SG2_GPIO_nSD_DETECT), data);
        gpio_free(SG2_SD_POWER_ENABLE);
        gpio_free(SG2_GPIO_nSD_DETECT);
 }
@@ -913,7 +913,7 @@ static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = {
                .type = "da9030",
                .addr = 0x49,
                .platform_data = &stargate2_da9030_pdata,
-               .irq = gpio_to_irq(1),
+               .irq = PXA_GPIO_TO_IRQ(1),
        },
 };
 
@@ -938,18 +938,18 @@ static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {
                /* Through a nand gate - Also beware, on V2 sensor board the
                 * pull up resistors are missing.
                 */
-               .irq = IRQ_GPIO(99),
+               .irq = PXA_GPIO_TO_IRQ(99),
        }, { /* ITS400 Sensor board only */
                .type = "tsl2561",
                .addr = 0x49,
                /* Through a nand gate - Also beware, on V2 sensor board the
                 * pull up resistors are missing.
                 */
-               .irq = IRQ_GPIO(99),
+               .irq = PXA_GPIO_TO_IRQ(99),
        }, { /* ITS400 Sensor board only */
                .type = "tmp175",
                .addr = 0x4A,
-               .irq = IRQ_GPIO(96),
+               .irq = PXA_GPIO_TO_IRQ(96),
        },
 };
 
@@ -1005,6 +1005,7 @@ MACHINE_START(INTELMOTE2, "IMOTE 2")
        .timer          = &pxa_timer,
        .init_machine   = imote2_init,
        .atag_offset    = 0x100,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
 
@@ -1017,5 +1018,6 @@ MACHINE_START(STARGATE2, "Stargate 2")
        .timer = &pxa_timer,
        .init_machine = stargate2_init,
        .atag_offset = 0x100,
+       .restart        = pxa_restart,
 MACHINE_END
 #endif
index ad47bb98f30d88a57702462ea926880f05972071..9fb38e80e076ca984056031cadae43ba306060c5 100644 (file)
@@ -85,8 +85,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
-               .end    = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
+               .start  = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO47)),
+               .end    = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO47)),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
@@ -495,4 +495,5 @@ MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
        .handle_irq       = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = tavorevb_init,
+       .restart        = pxa_restart,
 MACHINE_END
index fd569167302a6d57f4aaea6902782d8d16149166..f7d9305cfd7782700069b0d69d3ad4aac2ef63f6 100644 (file)
@@ -101,7 +101,7 @@ static struct i2c_board_info evb3_i2c_info[] = {
                .type           = "88PM860x",
                .addr           = 0x34,
                .platform_data  = &evb3_pm8607_info,
-               .irq            = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
+               .irq            = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO83)),
        },
 };
 
@@ -132,4 +132,5 @@ MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)")
        .handle_irq       = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = evb3_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 402b0c96613baa424941d50e650ca4d5b51cc882..7ce5c436cc4ed3cf99c55282e6e85ee2a6808757 100644 (file)
@@ -404,8 +404,8 @@ static struct pda_power_pdata tosa_power_data = {
 static struct resource tosa_power_resource[] = {
        {
                .name           = "ac",
-               .start          = gpio_to_irq(TOSA_GPIO_AC_IN),
-               .end            = gpio_to_irq(TOSA_GPIO_AC_IN),
+               .start          = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN),
+               .end            = PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN),
                .flags          = IORESOURCE_IRQ |
                                  IORESOURCE_IRQ_HIGHEDGE |
                                  IORESOURCE_IRQ_LOWEDGE,
@@ -905,7 +905,7 @@ static struct platform_device *devices[] __initdata = {
 
 static void tosa_poweroff(void)
 {
-       arm_machine_restart('g', NULL);
+       pxa_restart('g', NULL);
 }
 
 static void tosa_restart(char mode, const char *cmd)
@@ -935,7 +935,6 @@ static void __init tosa_init(void)
        init_gpio_reset(TOSA_GPIO_ON_RESET, 0, 0);
 
        pm_power_off = tosa_poweroff;
-       arm_pm_restart = tosa_restart;
 
        PCFR |= PCFR_OPDE;
 
@@ -970,6 +969,7 @@ static void __init fixup_tosa(struct tag *tags, char **cmdline,
 }
 
 MACHINE_START(TOSA, "SHARP Tosa")
+       .restart_mode   = 'g',
        .fixup          = fixup_tosa,
        .map_io         = pxa25x_map_io,
        .nr_irqs        = TOSA_NR_IRQS,
@@ -977,4 +977,5 @@ MACHINE_START(TOSA, "SHARP Tosa")
        .handle_irq       = pxa25x_handle_irq,
        .init_machine   = tosa_init,
        .timer          = &pxa_timer,
+       .restart        = tosa_restart,
 MACHINE_END
index 1aaed2b17e102ef90adb4add2065b472a5d7fb76..0f30af617d8f47924eb1591928aa9a87627f3405 100644 (file)
@@ -561,6 +561,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 
 MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
@@ -571,4 +572,5 @@ MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
index 242ddae332d30b6dd34a8107d3315f6f03e188c0..023d6ca789de4f0126939b247a6972f4f1cb5498 100644 (file)
@@ -422,8 +422,8 @@ static struct resource smc91x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = gpio_to_irq(VIPER_ETH_GPIO),
-               .end    = gpio_to_irq(VIPER_ETH_GPIO),
+               .start  = PXA_GPIO_TO_IRQ(VIPER_ETH_GPIO),
+               .end    = PXA_GPIO_TO_IRQ(VIPER_ETH_GPIO),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        },
        [2] = {
@@ -546,7 +546,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
        /* External UARTs */
        {
                .mapbase        = VIPER_UARTA_PHYS,
-               .irq            = gpio_to_irq(VIPER_UARTA_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(VIPER_UARTA_GPIO),
                .irqflags       = IRQF_TRIGGER_RISING,
                .uartclk        = 1843200,
                .regshift       = 1,
@@ -556,7 +556,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
        },
        {
                .mapbase        = VIPER_UARTB_PHYS,
-               .irq            = gpio_to_irq(VIPER_UARTB_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(VIPER_UARTB_GPIO),
                .irqflags       = IRQF_TRIGGER_RISING,
                .uartclk        = 1843200,
                .regshift       = 1,
@@ -596,8 +596,8 @@ static struct resource isp116x_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
-               .start  = gpio_to_irq(VIPER_USB_GPIO),
-               .end    = gpio_to_irq(VIPER_USB_GPIO),
+               .start  = PXA_GPIO_TO_IRQ(VIPER_USB_GPIO),
+               .end    = PXA_GPIO_TO_IRQ(VIPER_USB_GPIO),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        },
 };
@@ -998,4 +998,5 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC")
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = viper_init,
+       .restart        = pxa_restart,
 MACHINE_END
index ca0c6615028c42aa0414cc2e76de4a0a29c83918..1f5cfa96f6d6a244da2d43f867d666b8b9232138 100644 (file)
@@ -395,8 +395,8 @@ static struct resource vpac270_dm9000_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
-               .start  = IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ),
-               .end    = IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ),
+               .start  = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO114_VPAC270_ETH_IRQ),
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        },
 };
@@ -433,7 +433,7 @@ static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
 };
 
 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
-       .irq            = IRQ_GPIO(GPIO113_VPAC270_TS_IRQ),
+       .irq            = PXA_GPIO_TO_IRQ(GPIO113_VPAC270_TS_IRQ),
 };
 
 static struct platform_device vpac270_ucb1400_device = {
@@ -610,8 +610,8 @@ static struct resource vpac270_ide_resources[] = {
               .flags   = IORESOURCE_DMA
        },
        [3] = { /* IDE IRQ pin */
-              .start   = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
-              .end     = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
+              .start   = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
+              .end     = PXA_GPIO_TO_IRQ(GPIO36_VPAC270_IDE_IRQ),
               .flags   = IORESOURCE_IRQ
        }
 };
@@ -721,5 +721,6 @@ MACHINE_START(VPAC270, "Voipac PXA270")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
-       .init_machine   = vpac270_init
+       .init_machine   = vpac270_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 70e1730ef282a9aadf9f3cf1887d5d369e02cbf4..4bbe9a36fe74df730ca419f4bfeeb6c3be6516dc 100644 (file)
@@ -185,5 +185,6 @@ MACHINE_START(XCEP, "Iskratel XCEP")
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
+       .restart        = pxa_restart,
 MACHINE_END
 
index ead32c90fec17380cce3dcda522e35812d631eb1..b6476848b5618dfc72f68f3f76dfdd1bee2d3533 100644 (file)
@@ -573,7 +573,7 @@ static struct spi_board_info spi_board_info[] __initdata = {
        .modalias               = "libertas_spi",
        .platform_data          = &z2_lbs_pdata,
        .controller_data        = &z2_lbs_chip_info,
-       .irq                    = gpio_to_irq(GPIO36_ZIPITZ2_WIFI_IRQ),
+       .irq                    = PXA_GPIO_TO_IRQ(GPIO36_ZIPITZ2_WIFI_IRQ),
        .max_speed_hz           = 13000000,
        .bus_num                = 1,
        .chip_select            = 0,
@@ -725,4 +725,5 @@ MACHINE_START(ZIPIT2, "Zipit Z2")
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = z2_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 498b83b089f32034b7d3ba8c0cfcb6aa9bcade69..a4dd1c3470502dc364d0965179596bf6013faf0c 100644 (file)
@@ -233,7 +233,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
        /* FIXME: Shared IRQs on COM1-COM4 will not work properly on v1i1 hardware. */
        { /* COM1 */
                .mapbase        = 0x10000000,
-               .irq            = gpio_to_irq(ZEUS_UARTA_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(ZEUS_UARTA_GPIO),
                .irqflags       = IRQF_TRIGGER_RISING,
                .uartclk        = 14745600,
                .regshift       = 1,
@@ -242,7 +242,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
        },
        { /* COM2 */
                .mapbase        = 0x10800000,
-               .irq            = gpio_to_irq(ZEUS_UARTB_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(ZEUS_UARTB_GPIO),
                .irqflags       = IRQF_TRIGGER_RISING,
                .uartclk        = 14745600,
                .regshift       = 1,
@@ -251,7 +251,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
        },
        { /* COM3 */
                .mapbase        = 0x11000000,
-               .irq            = gpio_to_irq(ZEUS_UARTC_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(ZEUS_UARTC_GPIO),
                .irqflags       = IRQF_TRIGGER_RISING,
                .uartclk        = 14745600,
                .regshift       = 1,
@@ -260,7 +260,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
        },
        { /* COM4 */
                .mapbase        = 0x11800000,
-               .irq            = gpio_to_irq(ZEUS_UARTD_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(ZEUS_UARTD_GPIO),
                .irqflags       = IRQF_TRIGGER_RISING,
                .uartclk        = 14745600,
                .regshift       = 1,
@@ -321,8 +321,8 @@ static struct resource zeus_dm9k0_resource[] = {
                .flags = IORESOURCE_MEM
        },
        [2] = {
-               .start = gpio_to_irq(ZEUS_ETH0_GPIO),
-               .end   = gpio_to_irq(ZEUS_ETH0_GPIO),
+               .start = PXA_GPIO_TO_IRQ(ZEUS_ETH0_GPIO),
+               .end   = PXA_GPIO_TO_IRQ(ZEUS_ETH0_GPIO),
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
        },
 };
@@ -339,8 +339,8 @@ static struct resource zeus_dm9k1_resource[] = {
                .flags = IORESOURCE_MEM,
        },
        [2] = {
-               .start = gpio_to_irq(ZEUS_ETH1_GPIO),
-               .end   = gpio_to_irq(ZEUS_ETH1_GPIO),
+               .start = PXA_GPIO_TO_IRQ(ZEUS_ETH1_GPIO),
+               .end   = PXA_GPIO_TO_IRQ(ZEUS_ETH1_GPIO),
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
        },
 };
@@ -423,7 +423,7 @@ static struct spi_board_info zeus_spi_board_info[] = {
        [0] = {
                .modalias       = "mcp2515",
                .platform_data  = &zeus_mcp2515_pdata,
-               .irq            = gpio_to_irq(ZEUS_CAN_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(ZEUS_CAN_GPIO),
                .max_speed_hz   = 1*1000*1000,
                .bus_num        = 3,
                .mode           = SPI_MODE_0,
@@ -753,7 +753,7 @@ static struct i2c_board_info __initdata zeus_i2c_devices[] = {
        {
                I2C_BOARD_INFO("pca9535",       0x20),
                .platform_data  = &zeus_pca953x_pdata[2],
-               .irq            = gpio_to_irq(ZEUS_EXTGPIO_GPIO),
+               .irq            = PXA_GPIO_TO_IRQ(ZEUS_EXTGPIO_GPIO),
        },
        { I2C_BOARD_INFO("lm75a",       0x48) },
        { I2C_BOARD_INFO("24c01",       0x50) },
@@ -911,5 +911,6 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = zeus_init,
+       .restart        = pxa_restart,
 MACHINE_END
 
index 6c39c332841807325864e14c77cf0cfdc6bb2bc5..98eec80623e383dfafaf831897e101cbcf0020ce 100644 (file)
@@ -408,8 +408,8 @@ static void __init zylonite_init(void)
         * Note: We depend that the bootloader set
         * the correct value to MSC register for SMC91x.
         */
-       smc91x_resources[1].start = gpio_to_irq(gpio_eth_irq);
-       smc91x_resources[1].end   = gpio_to_irq(gpio_eth_irq);
+       smc91x_resources[1].start = PXA_GPIO_TO_IRQ(gpio_eth_irq);
+       smc91x_resources[1].end   = PXA_GPIO_TO_IRQ(gpio_eth_irq);
        platform_device_register(&smc91x_device);
 
        pxa_set_ac97_info(NULL);
@@ -430,4 +430,5 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
        .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = zylonite_init,
+       .restart        = pxa_restart,
 MACHINE_END
index 93c64d8d7de9714e52e1a37b0af18f123fd79611..86e59c043de2ba4847b0bed5349fa8e183643a68 100644 (file)
@@ -231,12 +231,12 @@ static struct i2c_board_info zylonite_i2c_board_info[] = {
                .type           = "pca9539",
                .addr           = 0x74,
                .platform_data  = &gpio_exp[0],
-               .irq            = IRQ_GPIO(18),
+               .irq            = PXA_GPIO_TO_IRQ(18),
        }, {
                .type           = "pca9539",
                .addr           = 0x75,
                .platform_data  = &gpio_exp[1],
-               .irq            = IRQ_GPIO(19),
+               .irq            = PXA_GPIO_TO_IRQ(19),
        },
 };
 
index 47259c89a75eaba74ab3b248f115e3e9af1a065e..735b57aaf2d6030bf50d81eaadcb1c072307d69d 100644 (file)
@@ -65,6 +65,5 @@ extern int realview_usb_register(struct resource *res);
 extern void realview_init_early(void);
 extern void realview_fixup(struct tag *tags, char **from,
                           struct meminfo *meminfo);
-extern void (*realview_reset)(char);
 
 #endif
index 4071164aebaaafe9872b0557c599d5788a3b9859..e8a5179c26536b2f1038123c4f7da3e49b34e828 100644 (file)
@@ -7,8 +7,6 @@
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <mach/hardware.h>
-#include <asm/hardware/entry-macro-gic.S>
 
                .macro  disable_fiq
                .endm
index 6657ff23116139184061b66c52064cb81565e737..471b671159ce3c742995ff0b27d60b7433ac7bf8 100644 (file)
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
-void (*realview_reset)(char mode);
-
 static inline void arch_idle(void)
 {
        /*
@@ -36,15 +30,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /*
-        * To reset, we hit the on-board reset register
-        * in the system FPGA
-        */
-       if (realview_reset)
-               realview_reset(mode);
-       dsb();
-}
-
 #endif
diff --git a/arch/arm/mach-realview/include/mach/vmalloc.h b/arch/arm/mach-realview/include/mach/vmalloc.h
deleted file mode 100644 (file)
index a2a4c68..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *  arch/arm/mach-realview/include/mach/vmalloc.h
- *
- *  Copyright (C) 2003 ARM Limited
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-#define VMALLOC_END            0xf8000000UL
index 026c66ad7ec2402f277bc7cec073ea6919d3ee85..f92a920cf507c1b411d3503daced441bcfe8b576 100644 (file)
@@ -91,8 +91,8 @@ static struct map_desc realview_eb_io_desc[] __initdata = {
 
 static struct map_desc realview_eb11mp_io_desc[] __initdata = {
        {
-               .virtual        = IO_ADDRESS(REALVIEW_EB11MP_GIC_CPU_BASE),
-               .pfn            = __phys_to_pfn(REALVIEW_EB11MP_GIC_CPU_BASE),
+               .virtual        = IO_ADDRESS(REALVIEW_EB11MP_SCU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_EB11MP_SCU_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }, {
@@ -415,7 +415,7 @@ static struct sys_timer realview_eb_timer = {
        .init           = realview_eb_timer_init,
 };
 
-static void realview_eb_reset(char mode)
+static void realview_eb_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
        void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -427,6 +427,7 @@ static void realview_eb_reset(char mode)
        __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
        if (core_tile_eb11mp())
                __raw_writel(0x0008, reset_ctrl);
+       dsb();
 }
 
 static void __init realview_eb_init(void)
@@ -458,7 +459,6 @@ static void __init realview_eb_init(void)
 #ifdef CONFIG_LEDS
        leds_event = realview_leds_event;
 #endif
-       realview_reset = realview_eb_reset;
 }
 
 MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
@@ -469,8 +469,10 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
        .timer          = &realview_eb_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = realview_eb_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
 #endif
+       .restart        = realview_eb_restart,
 MACHINE_END
index c057540ec776eca7d27a321e67664a701894e495..8ec37b29e0fa22bd0b048ab8a0a25c0f234c6f85 100644 (file)
@@ -336,12 +336,13 @@ static struct sys_timer realview_pb1176_timer = {
        .init           = realview_pb1176_timer_init,
 };
 
-static void realview_pb1176_reset(char mode)
+static void realview_pb1176_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
        void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
        __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
        __raw_writel(REALVIEW_PB1176_SYS_SOFT_RESET, reset_ctrl);
+       dsb();
 }
 
 static void realview_pb1176_fixup(struct tag *tags, char **from,
@@ -381,7 +382,6 @@ static void __init realview_pb1176_init(void)
 #ifdef CONFIG_LEDS
        leds_event = realview_leds_event;
 #endif
-       realview_reset = realview_pb1176_reset;
 }
 
 MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
@@ -392,8 +392,10 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
        .timer          = &realview_pb1176_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = realview_pb1176_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
 #endif
+       .restart        = realview_pb1176_restart,
 MACHINE_END
index 671ad6d6ff00d995efb9e98f6a3962305ca3ef2e..f035fda8b619d0000ac539d82b700742e944e707 100644 (file)
@@ -315,7 +315,7 @@ static struct sys_timer realview_pb11mp_timer = {
        .init           = realview_pb11mp_timer_init,
 };
 
-static void realview_pb11mp_reset(char mode)
+static void realview_pb11mp_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
        void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -327,6 +327,7 @@ static void realview_pb11mp_reset(char mode)
        __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
        __raw_writel(0x0000, reset_ctrl);
        __raw_writel(0x0004, reset_ctrl);
+       dsb();
 }
 
 static void __init realview_pb11mp_init(void)
@@ -355,7 +356,6 @@ static void __init realview_pb11mp_init(void)
 #ifdef CONFIG_LEDS
        leds_event = realview_leds_event;
 #endif
-       realview_reset = realview_pb11mp_reset;
 }
 
 MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
@@ -366,8 +366,10 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
        .timer          = &realview_pb11mp_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = realview_pb11mp_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
 #endif
+       .restart        = realview_pb11mp_restart,
 MACHINE_END
index cbf22df4ad5b233039d42a95ab13dbfb7cac5c7a..0109c8b440ccd339eb458821119f064fce06b899 100644 (file)
@@ -271,7 +271,7 @@ static struct sys_timer realview_pba8_timer = {
        .init           = realview_pba8_timer_init,
 };
 
-static void realview_pba8_reset(char mode)
+static void realview_pba8_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
        void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -283,6 +283,7 @@ static void realview_pba8_reset(char mode)
        __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
        __raw_writel(0x0000, reset_ctrl);
        __raw_writel(0x0004, reset_ctrl);
+       dsb();
 }
 
 static void __init realview_pba8_init(void)
@@ -305,7 +306,6 @@ static void __init realview_pba8_init(void)
 #ifdef CONFIG_LEDS
        leds_event = realview_leds_event;
 #endif
-       realview_reset = realview_pba8_reset;
 }
 
 MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
@@ -316,8 +316,10 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
        .timer          = &realview_pba8_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = realview_pba8_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
 #endif
+       .restart        = realview_pba8_restart,
 MACHINE_END
index 63c4114afae92b84a32ebfe5cf7527e0af5e9c1b..0194b3e26dc1146293dce362d5aed04e6b0f6df0 100644 (file)
@@ -98,8 +98,8 @@ static struct map_desc realview_pbx_io_desc[] __initdata = {
 
 static struct map_desc realview_local_io_desc[] __initdata = {
        {
-               .virtual        = IO_ADDRESS(REALVIEW_PBX_TILE_GIC_CPU_BASE),
-               .pfn            = __phys_to_pfn(REALVIEW_PBX_TILE_GIC_CPU_BASE),
+               .virtual        = IO_ADDRESS(REALVIEW_PBX_TILE_SCU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PBX_TILE_SCU_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }, {
@@ -339,7 +339,7 @@ static void realview_pbx_fixup(struct tag *tags, char **from,
 #endif
 }
 
-static void realview_pbx_reset(char mode)
+static void realview_pbx_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
        void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -351,6 +351,7 @@ static void realview_pbx_reset(char mode)
        __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
        __raw_writel(0x00F0, reset_ctrl);
        __raw_writel(0x00F4, reset_ctrl);
+       dsb();
 }
 
 static void __init realview_pbx_init(void)
@@ -388,7 +389,6 @@ static void __init realview_pbx_init(void)
 #ifdef CONFIG_LEDS
        leds_event = realview_leds_event;
 #endif
-       realview_reset = realview_pbx_reset;
 }
 
 MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
@@ -399,8 +399,10 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
        .timer          = &realview_pbx_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = realview_pbx_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
 #endif
+       .restart        = realview_pbx_restart,
 MACHINE_END
index 45c7b935dc45b768aea310c398411a22ed4e1e02..359bab94b6afa3463c069d2c528d690d9e678ae9 100644 (file)
@@ -7,21 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <asm/hardware/iomd.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       iomd_writeb(0, IOMD_ROMCR0);
-
-       /*
-        * Jump into the ROM
-        */
-       cpu_reset(0);
-}
diff --git a/arch/arm/mach-rpc/include/mach/vmalloc.h b/arch/arm/mach-rpc/include/mach/vmalloc.h
deleted file mode 100644 (file)
index fb70022..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  arch/arm/mach-rpc/include/mach/vmalloc.h
- *
- *  Copyright (C) 1997 Russell King
- *
- * 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 VMALLOC_END       0xdc000000UL
index 8559598ab767ea8c1ef872e6f35a3bd0792bb398..3d44a59fc0df38e10bcf492f987c274e17c5da1e 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/elf.h>
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
+#include <asm/hardware/iomd.h>
 #include <asm/page.h>
 #include <asm/domain.h>
 #include <asm/setup.h>
@@ -214,6 +215,16 @@ static int __init rpc_init(void)
 
 arch_initcall(rpc_init);
 
+static void rpc_restart(char mode, const char *cmd)
+{
+       iomd_writeb(0, IOMD_ROMCR0);
+
+       /*
+        * Jump into the ROM
+        */
+       soft_restart(0);
+}
+
 extern struct sys_timer ioc_timer;
 
 MACHINE_START(RISCPC, "Acorn-RiscPC")
@@ -224,4 +235,5 @@ MACHINE_START(RISCPC, "Acorn-RiscPC")
        .map_io         = rpc_map_io,
        .init_irq       = rpc_init_irq,
        .timer          = &ioc_timer,
+       .restart        = rpc_restart,
 MACHINE_END
index 6faadcee7729bd525553bad354738fb66d87d94b..ec0cee7924a5ddb02b8fc45a0713be48ac9ce435 100644 (file)
 
 extern void (*s3c24xx_reset_hook)(void);
 
+#error Fix me up
 static void
 arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
-               cpu_reset(0);
+               soft_restart(0);
        }
 
        if (s3c24xx_reset_hook)
@@ -28,5 +29,5 @@ arch_reset(char mode, const char *cmd)
        arch_wdt_reset();
 
        /* we'll take a jump through zero as a poor second */
-       cpu_reset(0);
+       soft_restart(0);
 }
diff --git a/arch/arm/mach-s3c2410/include/mach/vmalloc.h b/arch/arm/mach-s3c2410/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 7a311e8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/vmalloc.h
- *
- * from arch/arm/mach-iop3xx/include/mach/vmalloc.h
- *
- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
- *                   http://www.simtec.co.uk/products/SWLINUX/
- *
- * 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.
- *
- * S3C2410 vmalloc definition
-*/
-
-#ifndef __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END    0xF6000000UL
-
-#endif /* __ASM_ARCH_VMALLOC_H */
index a20ae1ad406217d3ae7699f0d9ba25dc01941515..71b955877793a8d6873eaf4c348036f8cb3e32ad 100644 (file)
@@ -164,22 +164,6 @@ static struct map_desc bast_iodesc[] __initdata = {
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
 
-static struct s3c24xx_uart_clksrc bast_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
-
 static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = {
        [0] = {
                .hwport      = 0,
@@ -187,8 +171,6 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = bast_serial_clocks,
-               .clocks_size = ARRAY_SIZE(bast_serial_clocks),
        },
        [1] = {
                .hwport      = 1,
@@ -196,8 +178,6 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = bast_serial_clocks,
-               .clocks_size = ARRAY_SIZE(bast_serial_clocks),
        },
        /* port 2 is not actually used */
        [2] = {
@@ -206,8 +186,6 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = bast_serial_clocks,
-               .clocks_size = ARRAY_SIZE(bast_serial_clocks),
        }
 };
 
index df47e8e900659a3b85501938e98fb902e10808cf..0f0a9a1795e9c2e29e5fe538de1ce3ca2fdc4864 100644 (file)
@@ -109,23 +109,6 @@ static struct map_desc vr1000_iodesc[] __initdata = {
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
 
-/* uart clock source(s) */
-
-static struct s3c24xx_uart_clksrc vr1000_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0.
-       }
-};
-
 static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = {
        [0] = {
                .hwport      = 0,
@@ -133,8 +116,6 @@ static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = vr1000_serial_clocks,
-               .clocks_size = ARRAY_SIZE(vr1000_serial_clocks),
        },
        [1] = {
                .hwport      = 1,
@@ -142,8 +123,6 @@ static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = vr1000_serial_clocks,
-               .clocks_size = ARRAY_SIZE(vr1000_serial_clocks),
        },
        /* port 2 is not actually used */
        [2] = {
@@ -152,9 +131,6 @@ static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = vr1000_serial_clocks,
-               .clocks_size = ARRAY_SIZE(vr1000_serial_clocks),
-
        }
 };
 
index 3d7ebc557a723aa3446b5a6287e8d446d254274f..af74927bca141365e1612a721066297e66d3af48 100644 (file)
@@ -123,12 +123,18 @@ static struct clk s3c2410_armclk = {
        .id     = -1,
 };
 
+static struct clk_lookup s3c2410_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p),
+       CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk),
+};
+
 void __init s3c2410_init_clocks(int xtal)
 {
        s3c24xx_register_baseclocks(xtal);
        s3c2410_setup_clocks();
        s3c2410_baseclk_add();
        s3c24xx_register_clock(&s3c2410_armclk);
+       clkdev_add_table(s3c2410_clk_lookup, ARRAY_SIZE(s3c2410_clk_lookup));
 }
 
 struct sysdev_class s3c2410_sysclass = {
index 140711db6c89b058a4b9c52cf3a1dc3943222bb2..cd50291931f78dda0c4b187dfe512ebee56a4e64 100644 (file)
@@ -659,6 +659,12 @@ static struct clk *clks[] __initdata = {
        &clk_armclk,
 };
 
+static struct clk_lookup s3c2412_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk),
+       CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
+       CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_usysclk),
+};
+
 int __init s3c2412_baseclk_add(void)
 {
        unsigned long clkcon  = __raw_readl(S3C2410_CLKCON);
@@ -751,6 +757,7 @@ int __init s3c2412_baseclk_add(void)
                s3c2412_clkcon_enable(clkp, 0);
        }
 
+       clkdev_add_table(s3c2412_clk_lookup, ARRAY_SIZE(s3c2412_clk_lookup));
        s3c_pwmclk_init();
        return 0;
 }
index 7b805b279caf9cc2ebc3d3f1d334a6911add1b22..ca0cd227f873a838d06cc0eec0adb853b6dfa548 100644 (file)
@@ -15,7 +15,6 @@ obj-$(CONFIG_S3C2416_PM)      += pm.o
 #obj-$(CONFIG_S3C2416_DMA)     += dma.o
 
 # Device setup
-obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
 # Machine support
index afbbe8bc21d14dd7a93e5acd5d359c1175d04e26..59f54d1d7f8b1772624d871bd520f7a094ff4892 100644 (file)
@@ -90,39 +90,38 @@ static struct clksrc_clk hsmmc_div[] = {
        },
 };
 
-static struct clksrc_clk hsmmc_mux[] = {
-       [0] = {
-               .clk    = {
-                       .name   = "hsmmc-if",
-                       .devname        = "s3c-sdhci.0",
-                       .ctrlbit = (1 << 6),
-                       .enable = s3c2443_clkcon_enable_s,
-               },
-               .sources = &(struct clksrc_sources) {
-                       .nr_sources = 2,
-                       .sources = (struct clk *[]) {
-                               [0] = &hsmmc_div[0].clk,
-                               [1] = NULL, /* to fix */
-                       },
-               },
-               .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 16 },
+static struct clksrc_clk hsmmc_mux0 = {
+       .clk    = {
+               .name           = "hsmmc-if",
+               .devname        = "s3c-sdhci.0",
+               .ctrlbit        = (1 << 6),
+               .enable         = s3c2443_clkcon_enable_s,
        },
-       [1] = {
-               .clk    = {
-                       .name   = "hsmmc-if",
-                       .devname        = "s3c-sdhci.1",
-                       .ctrlbit = (1 << 12),
-                       .enable = s3c2443_clkcon_enable_s,
+       .sources        = &(struct clksrc_sources) {
+               .nr_sources     = 2,
+               .sources        = (struct clk * []) {
+                       [0]     = &hsmmc_div[0].clk,
+                       [1]     = NULL, /* to fix */
                },
-               .sources = &(struct clksrc_sources) {
-                       .nr_sources = 2,
-                       .sources = (struct clk *[]) {
-                               [0] = &hsmmc_div[1].clk,
-                               [1] = NULL, /* to fix */
-                       },
+       },
+       .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 16 },
+};
+
+static struct clksrc_clk hsmmc_mux1 = {
+       .clk    = {
+               .name           = "hsmmc-if",
+               .devname        = "s3c-sdhci.1",
+               .ctrlbit        = (1 << 12),
+               .enable         = s3c2443_clkcon_enable_s,
+       },
+       .sources        = &(struct clksrc_sources) {
+               .nr_sources     = 2,
+               .sources        = (struct clk * []) {
+                       [0]     = &hsmmc_div[1].clk,
+                       [1]     = NULL, /* to fix */
                },
-               .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 17 },
        },
+       .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 17 },
 };
 
 static struct clk hsmmc0_clk = {
@@ -144,8 +143,14 @@ static struct clksrc_clk *clksrcs[] __initdata = {
        &hsspi_mux,
        &hsmmc_div[0],
        &hsmmc_div[1],
-       &hsmmc_mux[0],
-       &hsmmc_mux[1],
+       &hsmmc_mux0,
+       &hsmmc_mux1,
+};
+
+static struct clk_lookup s3c2416_clk_lookup[] = {
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &hsmmc0_clk),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &hsmmc_mux0.clk),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &hsmmc_mux1.clk),
 };
 
 void __init s3c2416_init_clocks(int xtal)
@@ -167,6 +172,7 @@ void __init s3c2416_init_clocks(int xtal)
                s3c_register_clksrc(clksrcs[ptr], 1);
 
        s3c24xx_register_clock(&hsmmc0_clk);
+       clkdev_add_table(s3c2416_clk_lookup, ARRAY_SIZE(s3c2416_clk_lookup));
 
        s3c_pwmclk_init();
 
diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-s3c2416/setup-sdhci.c
deleted file mode 100644 (file)
index cee5395..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
- *
- * Copyright 2010 Promwad Innovation Company
- *     Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
- *
- * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * Based on mach-s3c64xx/setup-sdhci.c
- *
- * 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/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s3c2416_hsmmc_clksrcs[4] = {
-       [0] = "hsmmc",
-       [1] = "hsmmc",
-       [2] = "hsmmc-if",
-       /* [3] = "48m", - note not successfully used yet */
-};
index f9e6bdaf41d289f1afe60e8cb952e8c5dc5fda44..c9879af42b0844648138b77f02dd1603d6d68406 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/mutex.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/serial_core.h>
 
 #include <mach/hardware.h>
 #include <linux/atomic.h>
@@ -43,6 +44,7 @@
 
 #include <plat/clock.h>
 #include <plat/cpu.h>
+#include <plat/regs-serial.h>
 
 /* S3C2440 extended clock support */
 
@@ -108,6 +110,46 @@ static struct clk s3c2440_clk_ac97 = {
        .ctrlbit        = S3C2440_CLKCON_CAMERA,
 };
 
+static unsigned long  s3c2440_fclk_n_getrate(struct clk *clk)
+{
+       unsigned long ucon0, ucon1, ucon2, divisor;
+
+       /* the fun of calculating the uart divisors on the s3c2440 */
+       ucon0 = __raw_readl(S3C24XX_VA_UART0 + S3C2410_UCON);
+       ucon1 = __raw_readl(S3C24XX_VA_UART1 + S3C2410_UCON);
+       ucon2 = __raw_readl(S3C24XX_VA_UART2 + S3C2410_UCON);
+
+       ucon0 &= S3C2440_UCON0_DIVMASK;
+       ucon1 &= S3C2440_UCON1_DIVMASK;
+       ucon2 &= S3C2440_UCON2_DIVMASK;
+
+       if (ucon0 != 0)
+               divisor = (ucon0 >> S3C2440_UCON_DIVSHIFT) + 6;
+       else if (ucon1 != 0)
+               divisor = (ucon1 >> S3C2440_UCON_DIVSHIFT) + 21;
+       else if (ucon2 != 0)
+               divisor = (ucon2 >> S3C2440_UCON_DIVSHIFT) + 36;
+       else
+               /* manual calims 44, seems to be 9 */
+               divisor = 9;
+
+       return clk_get_rate(clk->parent) / divisor;
+}
+
+static struct clk s3c2440_clk_fclk_n = {
+       .name           = "fclk_n",
+       .parent         = &clk_f,
+       .ops            = &(struct clk_ops) {
+               .get_rate       = s3c2440_fclk_n_getrate,
+       },
+};
+
+static struct clk_lookup s3c2440_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk),
+       CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
+       CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n),
+};
+
 static int s3c2440_clk_add(struct sys_device *sysdev)
 {
        struct clk *clock_upll;
@@ -126,10 +168,12 @@ static int s3c2440_clk_add(struct sys_device *sysdev)
        s3c2440_clk_cam.parent = clock_h;
        s3c2440_clk_ac97.parent = clock_p;
        s3c2440_clk_cam_upll.parent = clock_upll;
+       s3c24xx_register_clock(&s3c2440_clk_fclk_n);
 
        s3c24xx_register_clock(&s3c2440_clk_ac97);
        s3c24xx_register_clock(&s3c2440_clk_cam);
        s3c24xx_register_clock(&s3c2440_clk_cam_upll);
+       clkdev_add_table(s3c2440_clk_lookup, ARRAY_SIZE(s3c2440_clk_lookup));
 
        clk_disable(&s3c2440_clk_ac97);
        clk_disable(&s3c2440_clk_cam);
index 74f92fc3fd041ed3a110cb1e9226966190a90d27..d8f36c0a16ad9ebf935223f3bd6f43e4f93fe3c3 100644 (file)
@@ -96,22 +96,6 @@ static struct map_desc anubis_iodesc[] __initdata = {
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
 
-static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
-
 static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
        [0] = {
                .hwport      = 0,
@@ -119,8 +103,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2,
        },
        [1] = {
                .hwport      = 2,
@@ -128,8 +111,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2,
        },
 };
 
index 38887ee0c784587015b53c8da0712800c3ae3fbb..aa86ca8fa1e9d5cdbcb1b88f74ff22c988bfd350 100644 (file)
@@ -57,22 +57,6 @@ static struct map_desc at2440evb_iodesc[] __initdata = {
 #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)
 #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
 
-static struct s3c24xx_uart_clksrc at2440evb_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
-
 static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = {
        [0] = {
                .hwport      = 0,
@@ -80,8 +64,7 @@ static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = at2440evb_serial_clocks,
-               .clocks_size = ARRAY_SIZE(at2440evb_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2,
        },
        [1] = {
                .hwport      = 1,
@@ -89,8 +72,7 @@ static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = at2440evb_serial_clocks,
-               .clocks_size = ARRAY_SIZE(at2440evb_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2,
        },
 };
 
index 91fe0b4c95f1939e4f7b2b2d2fe9d4ea67ed60c5..937eb7818c1a0e886fc500d14ef68932fa3d1f6b 100644 (file)
@@ -167,6 +167,24 @@ static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
                .lcdcon5        = (S3C2410_LCDCON5_FRM565 |
                                   S3C2410_LCDCON5_HWSWP),
        },
+       /* mini2440 + 3.5" TFT (LCD-W35i, LQ035Q1DG06 type) + touchscreen*/
+       [3] = {
+               _LCD_DECLARE(
+                       /* clock */
+                       7,
+                       /* xres, margin_right, margin_left, hsync */
+                       320, 68, 66, 4,
+                       /* yres, margin_top, margin_bottom, vsync */
+                       240, 4, 4, 9,
+                       /* refresh rate */
+                       60),
+               .lcdcon5        = (S3C2410_LCDCON5_FRM565 |
+                                  S3C2410_LCDCON5_INVVDEN |
+                                  S3C2410_LCDCON5_INVVFRAME |
+                                  S3C2410_LCDCON5_INVVLINE |
+                                  S3C2410_LCDCON5_INVVCLK |
+                                  S3C2410_LCDCON5_HWSWP),
+       },
 };
 
 /* todo - put into gpio header */
index dc142ebf8cbae643f3f9d685e91882f749d6ed1f..d7e47b2b6ec9710518662cfba81d4684989787dc 100644 (file)
@@ -100,21 +100,6 @@ static struct map_desc osiris_iodesc[] __initdata = {
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
 
-static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = {
-       [0] = {
-               .name           = "uclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
 static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
        [0] = {
                .hwport      = 0,
@@ -122,8 +107,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2,
        },
        [1] = {
                .hwport      = 1,
@@ -131,8 +115,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2,
        },
        [2] = {
                .hwport      = 2,
@@ -140,8 +123,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
                .ucon        = UCON,
                .ulcon       = ULCON,
                .ufcon       = UFCON,
-               .clocks      = osiris_serial_clocks,
-               .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2,
        }
 };
 
index 0d3453bf567c29e85290774973bd19e0a59b5d89..4267cd56bfe720d7e3d7a5eeeaa48fab653ab21d 100644 (file)
 static struct map_desc rx1950_iodesc[] __initdata = {
 };
 
-static struct s3c24xx_uart_clksrc rx1950_serial_clocks[] = {
-       [0] = {
-              .name = "fclk",
-              .divisor = 0x0a,
-              .min_baud = 0,
-              .max_baud = 0,
-       },
-};
-
 static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = {
        [0] = {
               .hwport = 0,
@@ -84,8 +75,7 @@ static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = {
               .ucon = 0x3c5,
               .ulcon = 0x03,
               .ufcon = 0x51,
-              .clocks = rx1950_serial_clocks,
-              .clocks_size = ARRAY_SIZE(rx1950_serial_clocks),
+               .clk_sel = S3C2410_UCON_CLKSEL3,
        },
        [1] = {
               .hwport = 1,
@@ -93,8 +83,7 @@ static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = {
               .ucon = 0x3c5,
               .ulcon = 0x03,
               .ufcon = 0x51,
-              .clocks = rx1950_serial_clocks,
-              .clocks_size = ARRAY_SIZE(rx1950_serial_clocks),
+               .clk_sel = S3C2410_UCON_CLKSEL3,
        },
        /* IR port */
        [2] = {
@@ -103,8 +92,7 @@ static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = {
               .ucon = 0x3c5,
               .ulcon = 0x43,
               .ufcon = 0xf1,
-              .clocks = rx1950_serial_clocks,
-              .clocks_size = ARRAY_SIZE(rx1950_serial_clocks),
+               .clk_sel = S3C2410_UCON_CLKSEL3,
        },
 };
 
index e19499c2f909122cc47d3bb80df4e504bd31abb0..3d5e2e67971ed3a9709d3bbfd5385d7fd597c16b 100644 (file)
@@ -67,16 +67,6 @@ static struct map_desc rx3715_iodesc[] __initdata = {
        },
 };
 
-
-static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
-       [0] = {
-               .name           = "fclk",
-               .divisor        = 0,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       }
-};
-
 static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
        [0] = {
                .hwport      = 0,
@@ -84,8 +74,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
                .ucon        = 0x3c5,
                .ulcon       = 0x03,
                .ufcon       = 0x51,
-               .clocks      = rx3715_serial_clocks,
-               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL3,
        },
        [1] = {
                .hwport      = 1,
@@ -93,8 +82,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
                .ucon        = 0x3c5,
                .ulcon       = 0x03,
                .ufcon       = 0x00,
-               .clocks      = rx3715_serial_clocks,
-               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL3,
        },
        /* IR port */
        [2] = {
@@ -103,8 +91,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
                .ucon        = 0x3c5,
                .ulcon       = 0x43,
                .ufcon       = 0x51,
-               .clocks      = rx3715_serial_clocks,
-               .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
+               .clk_sel        = S3C2410_UCON_CLKSEL3,
        }
 };
 
index 5552e048c2be510608bd6fbd1f1418c9e5ab74a7..4d8c489edc04805f338b88c97059b175cd1cf73b 100644 (file)
@@ -188,7 +188,7 @@ config SMDK6410_WM1190_EV1
        depends on MACH_SMDK6410
        select REGULATOR
        select REGULATOR_WM8350
-       select S3C24XX_GPIO_EXTRA64
+       select SAMSUNG_GPIO_EXTRA64
        select MFD_WM8350_I2C
        select MFD_WM8350_CONFIG_MODE_0
        select MFD_WM8350_CONFIG_MODE_3
@@ -206,7 +206,7 @@ config SMDK6410_WM1192_EV1
        depends on MACH_SMDK6410
        select REGULATOR
        select REGULATOR_WM831X
-       select S3C24XX_GPIO_EXTRA64
+       select SAMSUNG_GPIO_EXTRA64
        select MFD_WM831X
        select MFD_WM831X_I2C
        help
@@ -287,7 +287,7 @@ config MACH_WLF_CRAGG_6410
        select S3C_DEV_WDT
        select S3C_DEV_RTC
        select S3C64XX_DEV_SPI
-       select S3C24XX_GPIO_EXTRA128
+       select SAMSUNG_GPIO_EXTRA128
        select I2C
        help
          Machine support for the Wolfson Cragganmore S3C6410 variant.
index cfc0b9941808e9ed4e80f183cfe193e927ebc7ae..e32093c58b2f4ebc0d58ab4be80f2a991d9c0be6 100644 (file)
@@ -32,7 +32,6 @@ obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
 obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
 obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o
 obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o
-obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
index 39c238d7a3dc5a9eff3272aa84609c88f3f84465..bff0f10cfbf570666b79478d37f855363677ebfa 100644 (file)
@@ -183,18 +183,6 @@ static struct clk init_clocks_off[] = {
                .parent         = &clk_p,
                .enable         = s3c64xx_pclk_ctrl,
                .ctrlbit        = S3C_CLKCON_PCLK_SPI1,
-       }, {
-               .name           = "spi_48m",
-               .devname        = "s3c64xx-spi.0",
-               .parent         = &clk_48m,
-               .enable         = s3c64xx_sclk_ctrl,
-               .ctrlbit        = S3C_CLKCON_SCLK_SPI0_48,
-       }, {
-               .name           = "spi_48m",
-               .devname        = "s3c64xx-spi.1",
-               .parent         = &clk_48m,
-               .enable         = s3c64xx_sclk_ctrl,
-               .ctrlbit        = S3C_CLKCON_SCLK_SPI1_48,
        }, {
                .name           = "48m",
                .devname        = "s3c-sdhci.0",
@@ -213,6 +201,15 @@ static struct clk init_clocks_off[] = {
                .parent         = &clk_48m,
                .enable         = s3c64xx_sclk_ctrl,
                .ctrlbit        = S3C_CLKCON_SCLK_MMC2_48,
+       }, {
+               .name           = "ac97",
+               .parent         = &clk_p,
+               .ctrlbit        = S3C_CLKCON_PCLK_AC97,
+       }, {
+               .name           = "cfcon",
+               .parent         = &clk_h,
+               .enable         = s3c64xx_hclk_ctrl,
+               .ctrlbit        = S3C_CLKCON_HCLK_IHOST,
        }, {
                .name           = "dma0",
                .parent         = &clk_h,
@@ -226,6 +223,22 @@ static struct clk init_clocks_off[] = {
        },
 };
 
+static struct clk clk_48m_spi0 = {
+       .name           = "spi_48m",
+       .devname        = "s3c64xx-spi.0",
+       .parent         = &clk_48m,
+       .enable         = s3c64xx_sclk_ctrl,
+       .ctrlbit        = S3C_CLKCON_SCLK_SPI0_48,
+};
+
+static struct clk clk_48m_spi1 = {
+       .name           = "spi_48m",
+       .devname        = "s3c64xx-spi.1",
+       .parent         = &clk_48m,
+       .enable         = s3c64xx_sclk_ctrl,
+       .ctrlbit        = S3C_CLKCON_SCLK_SPI1_48,
+};
+
 static struct clk init_clocks[] = {
        {
                .name           = "lcd",
@@ -242,24 +255,6 @@ static struct clk init_clocks[] = {
                .parent         = &clk_h,
                .enable         = s3c64xx_hclk_ctrl,
                .ctrlbit        = S3C_CLKCON_HCLK_UHOST,
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.0",
-               .parent         = &clk_h,
-               .enable         = s3c64xx_hclk_ctrl,
-               .ctrlbit        = S3C_CLKCON_HCLK_HSMMC0,
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.1",
-               .parent         = &clk_h,
-               .enable         = s3c64xx_hclk_ctrl,
-               .ctrlbit        = S3C_CLKCON_HCLK_HSMMC1,
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.2",
-               .parent         = &clk_h,
-               .enable         = s3c64xx_hclk_ctrl,
-               .ctrlbit        = S3C_CLKCON_HCLK_HSMMC2,
        }, {
                .name           = "otg",
                .parent         = &clk_h,
@@ -298,18 +293,32 @@ static struct clk init_clocks[] = {
                .name           = "watchdog",
                .parent         = &clk_p,
                .ctrlbit        = S3C_CLKCON_PCLK_WDT,
-       }, {
-               .name           = "ac97",
-               .parent         = &clk_p,
-               .ctrlbit        = S3C_CLKCON_PCLK_AC97,
-       }, {
-               .name           = "cfcon",
-               .parent         = &clk_h,
-               .enable         = s3c64xx_hclk_ctrl,
-               .ctrlbit        = S3C_CLKCON_HCLK_IHOST,
-       }
+       },
 };
 
+static struct clk clk_hsmmc0 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.0",
+       .parent         = &clk_h,
+       .enable         = s3c64xx_hclk_ctrl,
+       .ctrlbit        = S3C_CLKCON_HCLK_HSMMC0,
+};
+
+static struct clk clk_hsmmc1 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.1",
+       .parent         = &clk_h,
+       .enable         = s3c64xx_hclk_ctrl,
+       .ctrlbit        = S3C_CLKCON_HCLK_HSMMC1,
+};
+
+static struct clk clk_hsmmc2 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.2",
+       .parent         = &clk_h,
+       .enable         = s3c64xx_hclk_ctrl,
+       .ctrlbit        = S3C_CLKCON_HCLK_HSMMC2,
+};
 
 static struct clk clk_fout_apll = {
        .name           = "fout_apll",
@@ -577,36 +586,6 @@ static struct clksrc_sources clkset_camif = {
 
 static struct clksrc_clk clksrcs[] = {
        {
-               .clk    = {
-                       .name           = "mmc_bus",
-                       .devname        = "s3c-sdhci.0",
-                       .ctrlbit        = S3C_CLKCON_SCLK_MMC0,
-                       .enable         = s3c64xx_sclk_ctrl,
-               },
-               .reg_src        = { .reg = S3C_CLK_SRC, .shift = 18, .size = 2  },
-               .reg_div        = { .reg = S3C_CLK_DIV1, .shift = 0, .size = 4  },
-               .sources        = &clkset_spi_mmc,
-       }, {
-               .clk    = {
-                       .name           = "mmc_bus",
-                       .devname        = "s3c-sdhci.1",
-                       .ctrlbit        = S3C_CLKCON_SCLK_MMC1,
-                       .enable         = s3c64xx_sclk_ctrl,
-               },
-               .reg_src        = { .reg = S3C_CLK_SRC, .shift = 20, .size = 2  },
-               .reg_div        = { .reg = S3C_CLK_DIV1, .shift = 4, .size = 4  },
-               .sources        = &clkset_spi_mmc,
-       }, {
-               .clk    = {
-                       .name           = "mmc_bus",
-                       .devname        = "s3c-sdhci.2",
-                       .ctrlbit        = S3C_CLKCON_SCLK_MMC2,
-                       .enable         = s3c64xx_sclk_ctrl,
-               },
-               .reg_src        = { .reg = S3C_CLK_SRC, .shift = 22, .size = 2  },
-               .reg_div        = { .reg = S3C_CLK_DIV1, .shift = 8, .size = 4  },
-               .sources        = &clkset_spi_mmc,
-       }, {
                .clk    = {
                        .name           = "usb-bus-host",
                        .ctrlbit        = S3C_CLKCON_SCLK_UHOST,
@@ -615,35 +594,6 @@ static struct clksrc_clk clksrcs[] = {
                .reg_src        = { .reg = S3C_CLK_SRC, .shift = 5, .size = 2  },
                .reg_div        = { .reg = S3C_CLK_DIV1, .shift = 20, .size = 4  },
                .sources        = &clkset_uhost,
-       }, {
-               .clk    = {
-                       .name           = "uclk1",
-                       .ctrlbit        = S3C_CLKCON_SCLK_UART,
-                       .enable         = s3c64xx_sclk_ctrl,
-               },
-               .reg_src        = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1  },
-               .reg_div        = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4  },
-               .sources        = &clkset_uart,
-       }, {
-/* Where does UCLK0 come from? */
-               .clk    = {
-                       .name           = "spi-bus",
-                       .devname        = "s3c64xx-spi.0",
-                       .ctrlbit        = S3C_CLKCON_SCLK_SPI0,
-                       .enable         = s3c64xx_sclk_ctrl,
-               },
-               .reg_src        = { .reg = S3C_CLK_SRC, .shift = 14, .size = 2  },
-               .reg_div        = { .reg = S3C_CLK_DIV2, .shift = 0, .size = 4  },
-               .sources        = &clkset_spi_mmc,
-       }, {
-               .clk    = {
-                       .name           = "spi-bus",
-                       .devname        = "s3c64xx-spi.1",
-                       .enable         = s3c64xx_sclk_ctrl,
-               },
-               .reg_src        = { .reg = S3C_CLK_SRC, .shift = 16, .size = 2  },
-               .reg_div        = { .reg = S3C_CLK_DIV2, .shift = 4, .size = 4  },
-               .sources        = &clkset_spi_mmc,
        }, {
                .clk    = {
                        .name           = "audio-bus",
@@ -695,6 +645,78 @@ static struct clksrc_clk clksrcs[] = {
        },
 };
 
+/* Where does UCLK0 come from? */
+static struct clksrc_clk clk_sclk_uclk = {
+       .clk    = {
+               .name           = "uclk1",
+               .ctrlbit        = S3C_CLKCON_SCLK_UART,
+               .enable         = s3c64xx_sclk_ctrl,
+       },
+       .reg_src        = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1  },
+       .reg_div        = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4  },
+       .sources        = &clkset_uart,
+};
+
+static struct clksrc_clk clk_sclk_mmc0 = {
+       .clk    = {
+               .name           = "mmc_bus",
+               .devname        = "s3c-sdhci.0",
+               .ctrlbit        = S3C_CLKCON_SCLK_MMC0,
+               .enable         = s3c64xx_sclk_ctrl,
+       },
+       .reg_src        = { .reg = S3C_CLK_SRC, .shift = 18, .size = 2  },
+       .reg_div        = { .reg = S3C_CLK_DIV1, .shift = 0, .size = 4  },
+       .sources        = &clkset_spi_mmc,
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+       .clk    = {
+               .name           = "mmc_bus",
+               .devname        = "s3c-sdhci.1",
+               .ctrlbit        = S3C_CLKCON_SCLK_MMC1,
+               .enable         = s3c64xx_sclk_ctrl,
+       },
+       .reg_src        = { .reg = S3C_CLK_SRC, .shift = 20, .size = 2  },
+       .reg_div        = { .reg = S3C_CLK_DIV1, .shift = 4, .size = 4  },
+       .sources        = &clkset_spi_mmc,
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+       .clk    = {
+               .name           = "mmc_bus",
+               .devname        = "s3c-sdhci.2",
+               .ctrlbit        = S3C_CLKCON_SCLK_MMC2,
+               .enable         = s3c64xx_sclk_ctrl,
+       },
+       .reg_src        = { .reg = S3C_CLK_SRC, .shift = 22, .size = 2  },
+       .reg_div        = { .reg = S3C_CLK_DIV1, .shift = 8, .size = 4  },
+       .sources        = &clkset_spi_mmc,
+};
+
+static struct clksrc_clk clk_sclk_spi0 = {
+       .clk    = {
+               .name           = "spi-bus",
+               .devname        = "s3c64xx-spi.0",
+               .ctrlbit        = S3C_CLKCON_SCLK_SPI0,
+               .enable         = s3c64xx_sclk_ctrl,
+       },
+       .reg_src = { .reg = S3C_CLK_SRC, .shift = 14, .size = 2 },
+       .reg_div = { .reg = S3C_CLK_DIV2, .shift = 0, .size = 4 },
+       .sources = &clkset_spi_mmc,
+};
+
+static struct clksrc_clk clk_sclk_spi1 = {
+       .clk    = {
+               .name           = "spi-bus",
+               .devname        = "s3c64xx-spi.1",
+               .ctrlbit        = S3C_CLKCON_SCLK_SPI1,
+               .enable         = s3c64xx_sclk_ctrl,
+       },
+       .reg_src = { .reg = S3C_CLK_SRC, .shift = 16, .size = 2 },
+       .reg_div = { .reg = S3C_CLK_DIV2, .shift = 4, .size = 4 },
+       .sources = &clkset_spi_mmc,
+};
+
 /* Clock initialisation code */
 
 static struct clksrc_clk *init_parents[] = {
@@ -703,6 +725,39 @@ static struct clksrc_clk *init_parents[] = {
        &clk_mout_mpll,
 };
 
+static struct clksrc_clk *clksrc_cdev[] = {
+       &clk_sclk_uclk,
+       &clk_sclk_mmc0,
+       &clk_sclk_mmc1,
+       &clk_sclk_mmc2,
+       &clk_sclk_spi0,
+       &clk_sclk_spi1,
+};
+
+static struct clk *clk_cdev[] = {
+       &clk_hsmmc0,
+       &clk_hsmmc1,
+       &clk_hsmmc2,
+       &clk_48m_spi0,
+       &clk_48m_spi1,
+};
+
+static struct clk_lookup s3c64xx_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
+       CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &clk_hsmmc0),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &clk_hsmmc1),
+       CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.0", &clk_hsmmc2),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+       CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+       CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
+       CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
+       CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk2", &clk_48m_spi0),
+       CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk),
+       CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk2", &clk_48m_spi1),
+};
+
 #define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
 
 void __init_or_cpufreq s3c6400_setup_clocks(void)
@@ -811,6 +866,8 @@ static struct clk *clks[] __initdata = {
 void __init s3c64xx_register_clocks(unsigned long xtal, 
                                    unsigned armclk_divlimit)
 {
+       unsigned int cnt;
+
        armclk_mask = armclk_divlimit;
 
        s3c24xx_register_baseclocks(xtal);
@@ -821,7 +878,15 @@ void __init s3c64xx_register_clocks(unsigned long xtal,
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
 
+       s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
+       for (cnt = 0; cnt < ARRAY_SIZE(clk_cdev); cnt++)
+               s3c_disable_clocks(clk_cdev[cnt], 1);
+
        s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1));
        s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
+       for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++)
+               s3c_register_clksrc(clksrc_cdev[cnt], 1);
+       clkdev_add_table(s3c64xx_clk_lookup, ARRAY_SIZE(s3c64xx_clk_lookup));
+
        s3c_pwmclk_init();
 }
index 3341fd118723ff11cc7a21df95241c1252c2f6a0..3f437e7a6ba55a0011fa8e9e76ec4202306be655 100644 (file)
 #include <plat/gpio-cfg.h>
 #include <plat/devs.h>
 
-static char *spi_src_clks[] = {
-       [S3C64XX_SPI_SRCCLK_PCLK] = "pclk",
-       [S3C64XX_SPI_SRCCLK_SPIBUS] = "spi-bus",
-       [S3C64XX_SPI_SRCCLK_48M] = "spi_48m",
-};
-
 /* SPI Controller platform_devices */
 
 /* Since we emulate multi-cs capability, we do not touch the GPC-3,7.
@@ -176,5 +170,4 @@ void __init s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
 
        pd->num_cs = num_cs;
        pd->src_clk_nr = src_clk_nr;
-       pd->src_clk_name = spi_src_clks[src_clk_nr];
 }
index be9074e17dfd62748b069a832c6780f9d04b6f3c..5d55ab018b6b3f74b1946a67d0efd84a534e3caf 100644 (file)
 
 #define BANFF_PMIC_IRQ_BASE            IRQ_BOARD_START
 #define GLENFARCLAS_PMIC_IRQ_BASE      (IRQ_BOARD_START + 64)
+#define CODEC_IRQ_BASE                 (IRQ_BOARD_START + 128)
 
 #define PCA935X_GPIO_BASE              GPIO_BOARD_START
-#define CODEC_GPIO_BASE                (GPIO_BOARD_START + 8)
-#define GLENFARCLAS_PMIC_GPIO_BASE     (GPIO_BOARD_START + 16)
+#define CODEC_GPIO_BASE                        (GPIO_BOARD_START + 8)
+#define GLENFARCLAS_PMIC_GPIO_BASE     (GPIO_BOARD_START + 32)
+#define BANFF_PMIC_GPIO_BASE           (GPIO_BOARD_START + 64)
 
 #endif
index dd362604dccec92630d16cddece3989df3bca0f1..dc2bc15142cefeda02c0b4bc4349da1c68fd95ab 100644 (file)
@@ -12,7 +12,8 @@
  * warranty of any kind, whether express or implied.
 */
 
-#include <mach/map.h>
-#include <mach/irqs.h>
+               .macro  disable_fiq
+               .endm
 
-#include <asm/entry-macro-vic2.S>
+               .macro  arch_ret_to_user, tmp1, tmp2
+               .endm
index 6e34c2f6e670394ac6437662af481af2bfaa7e79..8b540c42d5ddeae84b79efb650bdc9989406194b 100644 (file)
@@ -88,6 +88,6 @@ enum s3c_gpio_number {
 /* define the number of gpios we need to the one after the GPQ() range */
 #define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1)
 
-#define BOARD_NR_GPIOS 16
+#define BOARD_NR_GPIOS (16 + CONFIG_SAMSUNG_GPIO_EXTRA)
 
 #define ARCH_NR_GPIOS  (GPIO_BOARD_START + BOARD_NR_GPIOS)
index 443f85b3c203be5b42b04019da149ba0da357278..96d60e0d9372fa5d510dab85d45f4069cb4b521a 100644 (file)
 #define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1)
 
 #ifdef CONFIG_MACH_WLF_CRAGG_6410
-#define IRQ_BOARD_NR 128
+#define IRQ_BOARD_NR 160
 #elif defined(CONFIG_SMDK6410_WM1190_EV1)
 #define IRQ_BOARD_NR 64
 #elif defined(CONFIG_SMDK6410_WM1192_EV1)
index 2e58cb7a71479d79181416714990cc6fb3a4509a..e19c58468174fa2505e1dce877b8234d668672b5 100644 (file)
@@ -18,13 +18,14 @@ static void arch_idle(void)
        /* nothing here yet */
 }
 
+#error Fix me up
 static void arch_reset(char mode, const char *cmd)
 {
        if (mode != 's')
                arch_wdt_reset();
 
        /* if all else fails, or mode was for soft, jump to 0 */
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 #endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/vmalloc.h b/arch/arm/mach-s3c64xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 23f75e5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* arch/arm/mach-s3c64xx/include/mach/vmalloc.h
- *
- * from arch/arm/mach-iop3xx/include/mach/vmalloc.h
- *
- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
- *                   http://www.simtec.co.uk/products/SWLINUX/
- *
- * 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.
- *
- * S3C6400 vmalloc definition
-*/
-
-#ifndef __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END    0xF6000000UL
-
-#endif /* __ASM_ARCH_VMALLOC_H */
index 8eba88e7209e123df3eaede76cb08f9833f5db5f..2bbc14d93428b3db42c7443c4c45dfde0ead6b59 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <video/platform_lcd.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -236,6 +237,7 @@ 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,
        .timer          = &s3c24xx_timer,
index f208154b1382d0492898ebba6b6d7c14079ad80d..cd3c97e2ee75045afb4a855f7adf03066bca478b 100644 (file)
 
 #include <linux/mfd/wm831x/irq.h>
 #include <linux/mfd/wm831x/gpio.h>
+#include <linux/mfd/wm8994/pdata.h>
 
+#include <sound/wm5100.h>
 #include <sound/wm8996.h>
 #include <sound/wm8962.h>
 #include <sound/wm9081.h>
 
 #include <mach/crag6410.h>
 
+static struct wm5100_pdata wm5100_pdata = {
+       .ldo_ena = S3C64XX_GPN(7),
+       .irq_flags = IRQF_TRIGGER_HIGH,
+       .gpio_base = CODEC_GPIO_BASE,
+
+       .in_mode = {
+               WM5100_IN_DIFF,
+               WM5100_IN_DIFF,
+               WM5100_IN_DIFF,
+               WM5100_IN_SE,
+       },
+
+       .hp_pol = CODEC_GPIO_BASE + 3,
+       .jack_modes = {
+               { WM5100_MICDET_MICBIAS3, 0, 0 },
+               { WM5100_MICDET_MICBIAS2, 1, 1 },
+       },
+
+       .gpio_defaults = {
+               0,
+               0,
+               0,
+               0,
+               0x2, /* IRQ: CMOS output */
+               0x3, /* CLKOUT: CMOS output */
+       },
+};
+
 static struct wm8996_retune_mobile_config wm8996_retune[] = {
        {
                .name = "Sub LPF",
@@ -72,7 +102,6 @@ static struct wm8962_pdata wm8962_pdata __initdata = {
                0x8000 | WM8962_GPIO_FN_DMICDAT,
                WM8962_GPIO_FN_IRQ,    /* Open drain mode */
        },
-       .irq_active_low = true,
 };
 
 static struct wm9081_pdata wm9081_pdata __initdata = {
@@ -91,6 +120,7 @@ static const struct i2c_board_info wm1254_devs[] = {
 
 static const struct i2c_board_info wm1255_devs[] = {
        { I2C_BOARD_INFO("wm5100", 0x1a),
+         .platform_data = &wm5100_pdata,
          .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
        },
        { I2C_BOARD_INFO("wm9081", 0x6c),
@@ -104,6 +134,24 @@ static const struct i2c_board_info wm1259_devs[] = {
        },
 };
 
+static struct wm8994_pdata wm8994_pdata = {
+       .gpio_base = CODEC_GPIO_BASE,
+       .gpio_defaults = {
+               0x3,          /* IRQ out, active high, CMOS */
+       },
+       .irq_base = CODEC_IRQ_BASE,
+       .ldo = {
+               { .supply = "WALLVDD" },
+               { .supply = "WALLVDD" },
+       },
+};
+
+static const struct i2c_board_info wm1277_devs[] = {
+       { I2C_BOARD_INFO("wm8958", 0x1a),  /* WM8958 is the superset */
+         .platform_data = &wm8994_pdata,
+         .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
+       },
+};
 
 static __devinitdata const struct {
        u8 id;
@@ -125,6 +173,8 @@ static __devinitdata const struct {
        { .id = 0x3b, .name = "1255-EV1 Kilchoman",
          .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs) },
        { .id = 0x3c, .name = "1273-EV1 Longmorn" },
+       { .id = 0x3d, .name = "1277-EV1 Littlemill",
+         .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs) },
 };
 
 static __devinit int wlf_gf_module_probe(struct i2c_client *i2c,
@@ -154,8 +204,8 @@ static __devinit int wlf_gf_module_probe(struct i2c_client *i2c,
                                        "Failed to register dev: %d\n", ret);
                }
        } else {
-               dev_warn(&i2c->dev, "Unknown module ID %d revision %d\n",
-                        id, rev);
+               dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n",
+                        id, rev + 1);
        }
 
        return 0;
index d04b6544851031bf2800ebea7768e00e803fb67c..799558c15b4eeb1d595fd5059cccb3af0fc69db4 100644 (file)
@@ -37,6 +37,9 @@
 #include <linux/mfd/wm831x/irq.h>
 #include <linux/mfd/wm831x/gpio.h>
 
+#include <sound/wm1250-ev1.h>
+
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
@@ -287,6 +290,11 @@ static struct platform_device speyside_wm8962_device = {
        .id             = -1,
 };
 
+static struct platform_device littlemill_device = {
+       .name           = "littlemill",
+       .id             = -1,
+};
+
 static struct regulator_consumer_supply wallvdd_consumers[] = {
        REGULATOR_SUPPLY("SPKVDD1", "1-001a"),
        REGULATOR_SUPPLY("SPKVDD2", "1-001a"),
@@ -339,6 +347,7 @@ static struct platform_device *crag6410_devices[] __initdata = {
        &crag6410_backlight_device,
        &speyside_device,
        &speyside_wm8962_device,
+       &littlemill_device,
        &lowland_device,
        &wallvdd_device,
 };
@@ -372,6 +381,10 @@ static struct regulator_init_data vddarm __initdata = {
        .driver_data = &vddarm_pdata,
 };
 
+static struct regulator_consumer_supply vddint_consumers[] __initdata = {
+       REGULATOR_SUPPLY("vddint", NULL),
+};
+
 static struct regulator_init_data vddint __initdata = {
        .constraints = {
                .name = "VDDINT",
@@ -380,6 +393,9 @@ static struct regulator_init_data vddint __initdata = {
                .always_on = 1,
                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
        },
+       .num_consumer_supplies = ARRAY_SIZE(vddint_consumers),
+       .consumer_supplies = vddint_consumers,
+       .supply_regulator = "WALLVDD",
 };
 
 static struct regulator_init_data vddmem __initdata = {
@@ -500,7 +516,8 @@ static struct wm831x_touch_pdata touch_pdata __initdata = {
 static struct wm831x_pdata crag_pmic_pdata __initdata = {
        .wm831x_num = 1,
        .irq_base = BANFF_PMIC_IRQ_BASE,
-       .gpio_base = GPIO_BOARD_START + 8,
+       .gpio_base = BANFF_PMIC_GPIO_BASE,
+       .soft_shutdown = true,
 
        .backup = &banff_backup_pdata,
 
@@ -605,6 +622,7 @@ static struct wm831x_pdata glenfarclas_pmic_pdata __initdata = {
        .wm831x_num = 2,
        .irq_base = GLENFARCLAS_PMIC_IRQ_BASE,
        .gpio_base = GLENFARCLAS_PMIC_GPIO_BASE,
+       .soft_shutdown = true,
 
        .gpio_defaults = {
                /* GPIO1-3: IRQ inputs, rising edge triggered, CMOS */
@@ -622,6 +640,16 @@ static struct wm831x_pdata glenfarclas_pmic_pdata __initdata = {
        .disable_touch = true,
 };
 
+static struct wm1250_ev1_pdata wm1250_ev1_pdata = {
+       .gpios = {
+               [WM1250_EV1_GPIO_CLK_ENA] = S3C64XX_GPN(12),
+               [WM1250_EV1_GPIO_CLK_SEL0] = S3C64XX_GPL(12),
+               [WM1250_EV1_GPIO_CLK_SEL1] = S3C64XX_GPL(13),
+               [WM1250_EV1_GPIO_OSR] = S3C64XX_GPL(14),
+               [WM1250_EV1_GPIO_MASTER] = S3C64XX_GPL(8),
+       },
+};
+
 static struct i2c_board_info i2c_devs1[] __initdata = {
        { I2C_BOARD_INFO("wm8311", 0x34),
          .irq = S3C_EINT(0),
@@ -631,7 +659,13 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
        { I2C_BOARD_INFO("wlf-gf-module", 0x25) },
        { I2C_BOARD_INFO("wlf-gf-module", 0x26) },
 
-       { I2C_BOARD_INFO("wm1250-ev1", 0x27) },
+       { I2C_BOARD_INFO("wm1250-ev1", 0x27),
+         .platform_data = &wm1250_ev1_pdata },
+};
+
+static struct s3c2410_platform_i2c i2c1_pdata = {
+       .frequency = 400000,
+       .bus_num = 1,
 };
 
 static void __init crag6410_map_io(void)
@@ -692,7 +726,7 @@ static void __init crag6410_machine_init(void)
        s3c_sdhci2_set_platdata(&crag6410_hsmmc2_pdata);
 
        s3c_i2c0_set_platdata(&i2c0_pdata);
-       s3c_i2c1_set_platdata(NULL);
+       s3c_i2c1_set_platdata(&i2c1_pdata);
        s3c_fb_set_platdata(&crag6410_lcd_pdata);
 
        i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
@@ -711,6 +745,7 @@ 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,
        .timer          = &s3c24xx_timer,
index 952f75ff5debaa245e0cac3ac638067a9463958c..c5955f301709a1638734eb1365671b3b348bb8aa 100644 (file)
@@ -29,6 +29,7 @@
 #include <mach/hardware.h>
 #include <mach/map.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
@@ -267,6 +268,7 @@ 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,
        .timer          = &s3c24xx_timer,
index 1bc85c35949894e7eff7607d572df777c604fcf0..4415c85e3f6f41b5528fc1e717058d8e8a8f2bca 100644 (file)
@@ -24,6 +24,7 @@
 #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>
@@ -345,6 +346,7 @@ 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,
        .timer          = &s3c24xx_timer,
index cb13cba98b3d00fba0c0c7a73795a597288153ce..9b2c610eac2a733a0d2c94e59e5e45f1b0215905 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <video/platform_lcd.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -99,6 +100,7 @@ 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,
        .timer          = &s3c24xx_timer,
index 87281e4b847134da27b461c2d05bec07063ee759..dbab49f2713e2c55e52f5b03714c405a3b6cbc00 100644 (file)
@@ -25,6 +25,7 @@
 #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>
@@ -326,6 +327,7 @@ 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,
        .timer          = &s3c24xx_timer,
index 94c831d8836502165477cda3c1e3124b318bd37f..05394528265228a12450dde813ac1edb6929a6f2 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -148,6 +149,7 @@ 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,
        .timer          = &s3c24xx_timer,
index f112547ce80a123fdf9f495624ebe031abf28bd5..a58d1ba5cba2e2a965fc9ccdcb1308a88e9f0f3a 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -164,6 +165,7 @@ 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,
        .timer          = &s3c24xx_timer,
index 73450c2b530a661b131bf9e9e3824f7423ee94ba..be28a59e3f57a6dec034b13548b968bce6499bff 100644 (file)
@@ -22,6 +22,7 @@
 
 #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>
@@ -88,6 +89,7 @@ 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,
        .timer          = &s3c24xx_timer,
index 8bc8edd85e5a33418c6b50438037cc3878f82bca..08309155d087236b6a5b8dcf772258ff2c9ea36a 100644 (file)
@@ -43,6 +43,7 @@
 
 #include <video/platform_lcd.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -700,6 +701,7 @@ 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,
        .timer          = &s3c24xx_timer,
index b375cd5c47cb2ebe9f7b28ce2f7d0b6c0624ddc8..0868d1331912a53187e897735eaa41f0ac3b3ab1 100644 (file)
@@ -89,6 +89,8 @@ static struct sleep_save misc_save[] = {
 
        SAVE_ITEM(S3C64XX_SDMA_SEL),
        SAVE_ITEM(S3C64XX_MODEM_MIFPCON),
+
+       SAVE_ITEM(S3C64XX_NORMAL_CFG),
 };
 
 void s3c_pm_configure_extint(void)
@@ -181,10 +183,23 @@ static void s3c64xx_pm_prepare(void)
 
 static int s3c64xx_pm_init(void)
 {
+       u32 val;
+
        pm_cpu_prep = s3c64xx_pm_prepare;
        pm_cpu_sleep = s3c64xx_cpu_suspend;
        pm_uart_udivslot = 1;
 
+       /*
+        * Unconditionally disable power domains that contain only
+        * blocks which have no mainline driver support.
+        */
+       val = __raw_readl(S3C64XX_NORMAL_CFG);
+       val &= ~(S3C64XX_NORMALCFG_DOMAIN_G_ON |
+                S3C64XX_NORMALCFG_DOMAIN_V_ON |
+                S3C64XX_NORMALCFG_DOMAIN_I_ON |
+                S3C64XX_NORMALCFG_DOMAIN_P_ON);
+       __raw_writel(val, S3C64XX_NORMAL_CFG);
+
 #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
        gpio_request(S3C64XX_GPN(12), "DEBUG_LED0");
        gpio_request(S3C64XX_GPN(13), "DEBUG_LED1");
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci.c b/arch/arm/mach-s3c64xx/setup-sdhci.c
deleted file mode 100644 (file)
index c75a71b..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* linux/arch/arm/mach-s3c64xx/setup-sdhci.c
- *
- * Copyright 2008 Simtec Electronics
- * Copyright 2008 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *     http://armlinux.simtec.co.uk/
- *
- * S3C6400/S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * 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/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s3c64xx_hsmmc_clksrcs[4] = {
-       [0] = "hsmmc",
-       [1] = "hsmmc",
-       [2] = "mmc_bus",
-       /* [3] = "48m", - note not successfully used yet */
-};
index c54c65d511f04cb67b9a5bfa930257188a2a1a7d..73c7cc9ef0ddb1e64717459cae05da6afba42a25 100644 (file)
@@ -267,18 +267,6 @@ static struct clk init_clocks_off[] = {
                .parent         = &clk_pclk.clk,
                .enable         = s5p64x0_pclk_ctrl,
                .ctrlbit        = (1 << 31),
-       }, {
-               .name           = "sclk_spi_48",
-               .devname        = "s3c64xx-spi.0",
-               .parent         = &clk_48m,
-               .enable         = s5p64x0_sclk_ctrl,
-               .ctrlbit        = (1 << 22),
-       }, {
-               .name           = "sclk_spi_48",
-               .devname        = "s3c64xx-spi.1",
-               .parent         = &clk_48m,
-               .enable         = s5p64x0_sclk_ctrl,
-               .ctrlbit        = (1 << 23),
        }, {
                .name           = "mmc_48m",
                .devname        = "s3c-sdhci.0",
@@ -419,35 +407,6 @@ static struct clksrc_clk clksrcs[] = {
                .sources = &clkset_group1,
                .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 },
                .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "uclk1",
-                       .ctrlbit        = (1 << 5),
-                       .enable         = s5p64x0_sclk_ctrl,
-               },
-               .sources = &clkset_uart,
-               .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 },
-               .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.0",
-                       .ctrlbit        = (1 << 20),
-                       .enable         = s5p64x0_sclk_ctrl,
-               },
-               .sources = &clkset_group1,
-               .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 14, .size = 2 },
-               .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 0, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.1",
-                       .ctrlbit        = (1 << 21),
-                       .enable         = s5p64x0_sclk_ctrl,
-               },
-               .sources = &clkset_group1,
-               .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 16, .size = 2 },
-               .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 },
        }, {
                .clk    = {
                        .name           = "sclk_post",
@@ -487,6 +446,41 @@ static struct clksrc_clk clksrcs[] = {
        },
 };
 
+static struct clksrc_clk clk_sclk_uclk = {
+       .clk    = {
+               .name           = "uclk1",
+               .ctrlbit        = (1 << 5),
+               .enable         = s5p64x0_sclk_ctrl,
+       },
+       .sources = &clkset_uart,
+       .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 },
+       .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi0 = {
+       .clk    = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.0",
+               .ctrlbit        = (1 << 20),
+               .enable         = s5p64x0_sclk_ctrl,
+       },
+       .sources = &clkset_group1,
+       .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 14, .size = 2 },
+       .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 0, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi1 = {
+       .clk    = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.1",
+               .ctrlbit        = (1 << 21),
+               .enable         = s5p64x0_sclk_ctrl,
+       },
+       .sources = &clkset_group1,
+       .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 16, .size = 2 },
+       .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 },
+};
+
 /* Clock initialization code */
 static struct clksrc_clk *sysclks[] = {
        &clk_mout_apll,
@@ -505,6 +499,20 @@ static struct clk dummy_apb_pclk = {
        .id             = -1,
 };
 
+static struct clksrc_clk *clksrc_cdev[] = {
+       &clk_sclk_uclk,
+       &clk_sclk_spi0,
+       &clk_sclk_spi1,
+};
+
+static struct clk_lookup s5p6440_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_pclk_low.clk),
+       CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk),
+       CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
+       CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
+       CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk),
+};
+
 void __init_or_cpufreq s5p6440_setup_clocks(void)
 {
        struct clk *xtal_clk;
@@ -583,9 +591,12 @@ void __init s5p6440_register_clocks(void)
 
        s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
        s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
+       for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
+               s3c_register_clksrc(clksrc_cdev[ptr], 1);
 
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
+       clkdev_add_table(s5p6440_clk_lookup, ARRAY_SIZE(s5p6440_clk_lookup));
 
        s3c24xx_register_clock(&dummy_apb_pclk);
 
index 2d04abfba12ecfcaed6cfd5988984f0128681935..50f90cbf7798df2ee7e147adc0cb3eee7f0b8476 100644 (file)
@@ -441,35 +441,6 @@ static struct clksrc_clk clksrcs[] = {
                .sources = &clkset_group2,
                .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 },
                .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "uclk1",
-                       .ctrlbit        = (1 << 5),
-                       .enable         = s5p64x0_sclk_ctrl,
-               },
-               .sources = &clkset_uart,
-               .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 },
-               .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.0",
-                       .ctrlbit        = (1 << 20),
-                       .enable         = s5p64x0_sclk_ctrl,
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 14, .size = 2 },
-               .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 0, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.1",
-                       .ctrlbit        = (1 << 21),
-                       .enable         = s5p64x0_sclk_ctrl,
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 16, .size = 2 },
-               .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 },
        }, {
                .clk    = {
                        .name           = "sclk_fimc",
@@ -536,6 +507,55 @@ static struct clksrc_clk clksrcs[] = {
        },
 };
 
+static struct clksrc_clk clk_sclk_uclk = {
+       .clk    = {
+               .name           = "uclk1",
+               .ctrlbit        = (1 << 5),
+               .enable         = s5p64x0_sclk_ctrl,
+       },
+       .sources = &clkset_uart,
+       .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 },
+       .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi0 = {
+       .clk    = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.0",
+               .ctrlbit        = (1 << 20),
+               .enable         = s5p64x0_sclk_ctrl,
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 14, .size = 2 },
+       .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 0, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi1 = {
+       .clk    = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.1",
+               .ctrlbit        = (1 << 21),
+               .enable         = s5p64x0_sclk_ctrl,
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 16, .size = 2 },
+       .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 },
+};
+
+static struct clksrc_clk *clksrc_cdev[] = {
+       &clk_sclk_uclk,
+       &clk_sclk_spi0,
+       &clk_sclk_spi1,
+};
+
+static struct clk_lookup s5p6450_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_pclk_low.clk),
+       CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk),
+       CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
+       CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
+       CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk),
+};
+
 /* Clock initialization code */
 static struct clksrc_clk *sysclks[] = {
        &clk_mout_apll,
@@ -634,9 +654,12 @@ void __init s5p6450_register_clocks(void)
 
        s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
        s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
+       for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
+               s3c_register_clksrc(clksrc_cdev[ptr], 1);
 
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
+       clkdev_add_table(s5p6450_clk_lookup, ARRAY_SIZE(s5p6450_clk_lookup));
 
        s3c24xx_register_clock(&dummy_apb_pclk);
 
index 1fd9c79c7dbc91108725379f6c53c54a82c6e23b..5b5d3c08364430200ce48a67a79fe869bfd1cfc0 100644 (file)
 #include <plat/s3c64xx-spi.h>
 #include <plat/gpio-cfg.h>
 
-static char *s5p64x0_spi_src_clks[] = {
-       [S5P64X0_SPI_SRCCLK_PCLK] = "pclk",
-       [S5P64X0_SPI_SRCCLK_SCLK] = "sclk_spi",
-};
-
 /* SPI Controller platform_devices */
 
 /* Since we emulate multi-cs capability, we do not touch the CS.
@@ -220,5 +215,4 @@ void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
 
        pd->num_cs = num_cs;
        pd->src_clk_nr = src_clk_nr;
-       pd->src_clk_name = s5p64x0_spi_src_clks[src_clk_nr];
 }
index 442dd4ad12da61a02694e97923ca53386a7854ad..f820c07444054c7d1698e22160e0cf77fddc1fc4 100644 (file)
 
 static u64 dma_dmamask = DMA_BIT_MASK(32);
 
-struct dma_pl330_peri s5p6440_pdma_peri[22] = {
-       {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = DMACH_MAX,
-       }, {
-               .peri_id = DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_RX,
-               .rqtype = DEVTOMEM,
-       },
+u8 s5p6440_pdma_peri[] = {
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART1_RX,
+       DMACH_UART1_TX,
+       DMACH_UART2_RX,
+       DMACH_UART2_TX,
+       DMACH_UART3_RX,
+       DMACH_UART3_TX,
+       DMACH_MAX,
+       DMACH_MAX,
+       DMACH_PCM0_TX,
+       DMACH_PCM0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S0_RX,
+       DMACH_SPI0_TX,
+       DMACH_SPI0_RX,
+       DMACH_MAX,
+       DMACH_MAX,
+       DMACH_MAX,
+       DMACH_MAX,
+       DMACH_SPI1_TX,
+       DMACH_SPI1_RX,
 };
 
 struct dma_pl330_platdata s5p6440_pdma_pdata = {
        .nr_valid_peri = ARRAY_SIZE(s5p6440_pdma_peri),
-       .peri = s5p6440_pdma_peri,
+       .peri_id = s5p6440_pdma_peri,
 };
 
-struct dma_pl330_peri s5p6450_pdma_peri[32] = {
-       {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART4_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART4_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_USI_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_USI_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PWM,
-       }, {
-               .peri_id = (u8)DMACH_UART5_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART5_TX,
-               .rqtype = MEMTODEV,
-       },
+u8 s5p6450_pdma_peri[] = {
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART1_RX,
+       DMACH_UART1_TX,
+       DMACH_UART2_RX,
+       DMACH_UART2_TX,
+       DMACH_UART3_RX,
+       DMACH_UART3_TX,
+       DMACH_UART4_RX,
+       DMACH_UART4_TX,
+       DMACH_PCM0_TX,
+       DMACH_PCM0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S0_RX,
+       DMACH_SPI0_TX,
+       DMACH_SPI0_RX,
+       DMACH_PCM1_TX,
+       DMACH_PCM1_RX,
+       DMACH_PCM2_TX,
+       DMACH_PCM2_RX,
+       DMACH_SPI1_TX,
+       DMACH_SPI1_RX,
+       DMACH_USI_TX,
+       DMACH_USI_RX,
+       DMACH_MAX,
+       DMACH_I2S1_TX,
+       DMACH_I2S1_RX,
+       DMACH_I2S2_TX,
+       DMACH_I2S2_RX,
+       DMACH_PWM,
+       DMACH_UART5_RX,
+       DMACH_UART5_TX,
 };
 
 struct dma_pl330_platdata s5p6450_pdma_pdata = {
        .nr_valid_peri = ARRAY_SIZE(s5p6450_pdma_peri),
-       .peri = s5p6450_pdma_peri,
+       .peri_id = s5p6450_pdma_peri,
 };
 
 struct amba_device s5p64x0_device_pdma = {
@@ -227,10 +125,15 @@ struct amba_device s5p64x0_device_pdma = {
 
 static int __init s5p64x0_dma_init(void)
 {
-       if (soc_is_s5p6450())
+       if (soc_is_s5p6450()) {
+               dma_cap_set(DMA_SLAVE, s5p6450_pdma_pdata.cap_mask);
+               dma_cap_set(DMA_CYCLIC, s5p6450_pdma_pdata.cap_mask);
                s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata;
-       else
+       } else {
+               dma_cap_set(DMA_SLAVE, s5p6440_pdma_pdata.cap_mask);
+               dma_cap_set(DMA_CYCLIC, s5p6440_pdma_pdata.cap_mask);
                s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata;
+       }
 
        amba_device_register(&s5p64x0_device_pdma, &iomem_resource);
 
index 10b62b4f821177aa2c45fd2d7c91748411973d44..fbb246d0a3dfee7bd21252fb54e98abd32518086 100644 (file)
@@ -10,7 +10,8 @@
  * published by the Free Software Foundation.
 */
 
-#include <mach/map.h>
-#include <plat/irqs.h>
+               .macro  disable_fiq
+               .endm
 
-#include <asm/entry-macro-vic2.S>
+               .macro  arch_ret_to_user, tmp1, tmp2
+               .endm
index 53982db9d25989d27c09d822b0c595a061c41874..5b845e849b300da0f1e4a3dd55cd859103ab053f 100644 (file)
 
 #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x))
 
+#define IRQ_TIMER_BASE         (11)
+
 /* Set the default NR_IRQS */
 
 #define NR_IRQS                        (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1)
diff --git a/arch/arm/mach-s5p64x0/include/mach/vmalloc.h b/arch/arm/mach-s5p64x0/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 38dcc71..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* linux/arch/arm/mach-s5p64x0/include/mach/vmalloc.h
- *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
- *
- * 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.
- *
- * S3C6400 vmalloc definition
-*/
-
-#ifndef __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END    0xF6000000UL
-
-#endif /* __ASM_ARCH_VMALLOC_H */
index 79833caf816560404fe1190c8235ed3ae1da7c10..659a66c131a141e3378d1f2a64ada2ca21a0aecd 100644 (file)
 #include <plat/s5p6450.h>
 #include <plat/regs-serial.h>
 
-static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = {
-       [0] = {
-               .name           = "pclk_low",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-       [1] = {
-               .name           = "uclk1",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-};
-
 /* uart registration process */
-
-void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
-{
-       struct s3c2410_uartcfg *tcfg = cfg;
-       u32 ucnt;
-
-       for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
-               if (!tcfg->clocks) {
-                       tcfg->clocks = s5p64x0_serial_clocks;
-                       tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks);
-               }
-       }
-}
-
 void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
        int uart;
@@ -62,12 +33,10 @@ void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
                s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART;
        }
 
-       s5p64x0_common_init_uarts(cfg, no);
        s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
 }
 
 void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
-       s5p64x0_common_init_uarts(cfg, no);
        s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
 }
index 4a1250cd1356b364c5a4c38160610caadccf3292..c272c3f7d6deed40a6b7560075c392907578becb 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <video/platform_lcd.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/irq.h>
@@ -242,6 +243,7 @@ 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,
index 0ab129ecf00956decaab6e1b60b55d71e7a841fa..7a47009596162de6112214f3fe827f61a457c46f 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <video/platform_lcd.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/irq.h>
@@ -262,6 +263,7 @@ 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,
index a5e6e608b498ccd1b285123550dc13ad5a5e9d1e..2320e5495a55ec5510a93fee17455d4e6b27a7f5 100644 (file)
@@ -21,7 +21,6 @@ obj-$(CONFIG_S5PC100_SETUP_FB_24BPP)  += setup-fb-24bpp.o
 obj-$(CONFIG_S5PC100_SETUP_I2C1)       += setup-i2c1.o
 obj-$(CONFIG_S5PC100_SETUP_IDE)                += setup-ide.o
 obj-$(CONFIG_S5PC100_SETUP_KEYPAD)     += setup-keypad.o
-obj-$(CONFIG_S5PC100_SETUP_SDHCI)      += setup-sdhci.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
 # device support
index 8d47709da713f22001622b90d67595d3ae0dd7c3..eba721b551fcc318381ff16fe3a5252aa24bdb90 100644 (file)
@@ -425,24 +425,6 @@ static struct clk init_clocks_off[] = {
                .parent         = &clk_div_d0_bus.clk,
                .enable         = s5pc100_d0_2_ctrl,
                .ctrlbit        = (1 << 1),
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.2",
-               .parent         = &clk_div_d1_bus.clk,
-               .enable         = s5pc100_d1_0_ctrl,
-               .ctrlbit        = (1 << 7),
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.1",
-               .parent         = &clk_div_d1_bus.clk,
-               .enable         = s5pc100_d1_0_ctrl,
-               .ctrlbit        = (1 << 6),
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.0",
-               .parent         = &clk_div_d1_bus.clk,
-               .enable         = s5pc100_d1_0_ctrl,
-               .ctrlbit        = (1 << 5),
        }, {
                .name           = "modemif",
                .parent         = &clk_div_d1_bus.clk,
@@ -672,24 +654,6 @@ static struct clk init_clocks_off[] = {
                .parent         = &clk_div_pclkd1.clk,
                .enable         = s5pc100_d1_5_ctrl,
                .ctrlbit        = (1 << 8),
-       }, {
-               .name           = "spi_48m",
-               .devname        = "s3c64xx-spi.0",
-               .parent         = &clk_mout_48m.clk,
-               .enable         = s5pc100_sclk0_ctrl,
-               .ctrlbit        = (1 << 7),
-       }, {
-               .name           = "spi_48m",
-               .devname        = "s3c64xx-spi.1",
-               .parent         = &clk_mout_48m.clk,
-               .enable         = s5pc100_sclk0_ctrl,
-               .ctrlbit        = (1 << 8),
-       }, {
-               .name           = "spi_48m",
-               .devname        = "s3c64xx-spi.2",
-               .parent         = &clk_mout_48m.clk,
-               .enable         = s5pc100_sclk0_ctrl,
-               .ctrlbit        = (1 << 9),
        }, {
                .name           = "mmc_48m",
                .devname        = "s3c-sdhci.0",
@@ -711,6 +675,54 @@ static struct clk init_clocks_off[] = {
        },
 };
 
+static struct clk clk_hsmmc2 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.2",
+       .parent         = &clk_div_d1_bus.clk,
+       .enable         = s5pc100_d1_0_ctrl,
+       .ctrlbit        = (1 << 7),
+};
+
+static struct clk clk_hsmmc1 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.1",
+       .parent         = &clk_div_d1_bus.clk,
+       .enable         = s5pc100_d1_0_ctrl,
+       .ctrlbit        = (1 << 6),
+};
+
+static struct clk clk_hsmmc0 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.0",
+       .parent         = &clk_div_d1_bus.clk,
+       .enable         = s5pc100_d1_0_ctrl,
+       .ctrlbit        = (1 << 5),
+};
+
+static struct clk clk_48m_spi0 = {
+       .name           = "spi_48m",
+       .devname        = "s3c64xx-spi.0",
+       .parent         = &clk_mout_48m.clk,
+       .enable         = s5pc100_sclk0_ctrl,
+       .ctrlbit        = (1 << 7),
+};
+
+static struct clk clk_48m_spi1 = {
+       .name           = "spi_48m",
+       .devname        = "s3c64xx-spi.1",
+       .parent         = &clk_mout_48m.clk,
+       .enable         = s5pc100_sclk0_ctrl,
+       .ctrlbit        = (1 << 8),
+};
+
+static struct clk clk_48m_spi2 = {
+       .name           = "spi_48m",
+       .devname        = "s3c64xx-spi.2",
+       .parent         = &clk_mout_48m.clk,
+       .enable         = s5pc100_sclk0_ctrl,
+       .ctrlbit        = (1 << 9),
+};
+
 static struct clk clk_vclk54m = {
        .name           = "vclk_54m",
        .rate           = 54000000,
@@ -928,49 +940,6 @@ static struct clksrc_clk clk_sclk_spdif = {
 
 static struct clksrc_clk clksrcs[] = {
        {
-               .clk    = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.0",
-                       .ctrlbit        = (1 << 4),
-                       .enable         = s5pc100_sclk0_ctrl,
-
-               },
-               .sources = &clk_src_group1,
-               .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 2 },
-               .reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.1",
-                       .ctrlbit        = (1 << 5),
-                       .enable         = s5pc100_sclk0_ctrl,
-
-               },
-               .sources = &clk_src_group1,
-               .reg_src = { .reg = S5P_CLK_SRC1, .shift = 8, .size = 2 },
-               .reg_div = { .reg = S5P_CLK_DIV2, .shift = 8, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.2",
-                       .ctrlbit        = (1 << 6),
-                       .enable         = s5pc100_sclk0_ctrl,
-
-               },
-               .sources = &clk_src_group1,
-               .reg_src = { .reg = S5P_CLK_SRC1, .shift = 12, .size = 2 },
-               .reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "uclk1",
-                       .ctrlbit        = (1 << 3),
-                       .enable         = s5pc100_sclk0_ctrl,
-
-               },
-               .sources = &clk_src_group2,
-               .reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1 },
-               .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 },
-       }, {
                .clk    = {
                        .name           = "sclk_mixer",
                        .ctrlbit        = (1 << 6),
@@ -1022,39 +991,6 @@ static struct clksrc_clk clksrcs[] = {
                .sources = &clk_src_group7,
                .reg_src = { .reg = S5P_CLK_SRC2, .shift = 24, .size = 2 },
                .reg_div = { .reg = S5P_CLK_DIV3, .shift = 24, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.0",
-                       .ctrlbit        = (1 << 12),
-                       .enable         = s5pc100_sclk1_ctrl,
-
-               },
-               .sources = &clk_src_mmc0,
-               .reg_src = { .reg = S5P_CLK_SRC2, .shift = 0, .size = 2 },
-               .reg_div = { .reg = S5P_CLK_DIV3, .shift = 0, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.1",
-                       .ctrlbit        = (1 << 13),
-                       .enable         = s5pc100_sclk1_ctrl,
-
-               },
-               .sources = &clk_src_mmc12,
-               .reg_src = { .reg = S5P_CLK_SRC2, .shift = 4, .size = 2 },
-               .reg_div = { .reg = S5P_CLK_DIV3, .shift = 4, .size = 4 },
-       }, {
-               .clk    = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.2",
-                       .ctrlbit        = (1 << 14),
-                       .enable         = s5pc100_sclk1_ctrl,
-
-               },
-               .sources = &clk_src_mmc12,
-               .reg_src = { .reg = S5P_CLK_SRC2, .shift = 8, .size = 2 },
-               .reg_div = { .reg = S5P_CLK_DIV3, .shift = 8, .size = 4 },
        }, {
                .clk    = {
                        .name           = "sclk_irda",
@@ -1098,6 +1034,89 @@ static struct clksrc_clk clksrcs[] = {
        },
 };
 
+static struct clksrc_clk clk_sclk_uart = {
+       .clk    = {
+               .name           = "uclk1",
+               .ctrlbit        = (1 << 3),
+               .enable         = s5pc100_sclk0_ctrl,
+       },
+       .sources = &clk_src_group2,
+       .reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1 },
+       .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc0 = {
+       .clk    = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.0",
+               .ctrlbit        = (1 << 12),
+               .enable         = s5pc100_sclk1_ctrl,
+       },
+       .sources = &clk_src_mmc0,
+       .reg_src = { .reg = S5P_CLK_SRC2, .shift = 0, .size = 2 },
+       .reg_div = { .reg = S5P_CLK_DIV3, .shift = 0, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+       .clk    = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.1",
+               .ctrlbit        = (1 << 13),
+               .enable         = s5pc100_sclk1_ctrl,
+       },
+       .sources = &clk_src_mmc12,
+       .reg_src = { .reg = S5P_CLK_SRC2, .shift = 4, .size = 2 },
+       .reg_div = { .reg = S5P_CLK_DIV3, .shift = 4, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+       .clk    = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.2",
+               .ctrlbit        = (1 << 14),
+               .enable         = s5pc100_sclk1_ctrl,
+       },
+       .sources = &clk_src_mmc12,
+       .reg_src = { .reg = S5P_CLK_SRC2, .shift = 8, .size = 2 },
+       .reg_div = { .reg = S5P_CLK_DIV3, .shift = 8, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi0 = {
+       .clk    = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.0",
+               .ctrlbit        = (1 << 4),
+               .enable         = s5pc100_sclk0_ctrl,
+       },
+       .sources = &clk_src_group1,
+       .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 2 },
+       .reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi1 = {
+       .clk    = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.1",
+               .ctrlbit        = (1 << 5),
+               .enable         = s5pc100_sclk0_ctrl,
+       },
+       .sources = &clk_src_group1,
+       .reg_src = { .reg = S5P_CLK_SRC1, .shift = 8, .size = 2 },
+       .reg_div = { .reg = S5P_CLK_DIV2, .shift = 8, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi2 = {
+       .clk    = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.2",
+               .ctrlbit        = (1 << 6),
+               .enable         = s5pc100_sclk0_ctrl,
+       },
+       .sources = &clk_src_group1,
+       .reg_src = { .reg = S5P_CLK_SRC1, .shift = 12, .size = 2 },
+       .reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4 },
+};
+
 /* Clock initialisation code */
 static struct clksrc_clk *sysclks[] = {
        &clk_mout_apll,
@@ -1127,6 +1146,25 @@ static struct clksrc_clk *sysclks[] = {
        &clk_sclk_spdif,
 };
 
+static struct clk *clk_cdev[] = {
+       &clk_hsmmc0,
+       &clk_hsmmc1,
+       &clk_hsmmc2,
+       &clk_48m_spi0,
+       &clk_48m_spi1,
+       &clk_48m_spi2,
+};
+
+static struct clksrc_clk *clksrc_cdev[] = {
+       &clk_sclk_uart,
+       &clk_sclk_mmc0,
+       &clk_sclk_mmc1,
+       &clk_sclk_mmc2,
+       &clk_sclk_spi0,
+       &clk_sclk_spi1,
+       &clk_sclk_spi2,
+};
+
 void __init_or_cpufreq s5pc100_setup_clocks(void)
 {
        unsigned long xtal;
@@ -1266,6 +1304,24 @@ static struct clk *clks[] __initdata = {
        &clk_pcmcdclk1,
 };
 
+static struct clk_lookup s5pc100_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
+       CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uart.clk),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &clk_hsmmc0),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &clk_hsmmc1),
+       CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.0", &clk_hsmmc2),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+       CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+       CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
+       CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_48m_spi0),
+       CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk2", &clk_sclk_spi0.clk),
+       CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_48m_spi1),
+       CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk2", &clk_sclk_spi1.clk),
+       CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk1", &clk_48m_spi2),
+       CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk2", &clk_sclk_spi2.clk),
+};
+
 void __init s5pc100_register_clocks(void)
 {
        int ptr;
@@ -1277,9 +1333,16 @@ void __init s5pc100_register_clocks(void)
 
        s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
        s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
+       for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
+               s3c_register_clksrc(clksrc_cdev[ptr], 1);
 
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
+       clkdev_add_table(s5pc100_clk_lookup, ARRAY_SIZE(s5pc100_clk_lookup));
+
+       s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
+       for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++)
+               s3c_disable_clocks(clk_cdev[ptr], 1);
 
        s3c24xx_register_clock(&dummy_apb_pclk);
 
index e5d6c4dceb566db4f77d616eff07550e74ae0b28..155f50da2d785ce5a7744f7076b723e635dbd47c 100644 (file)
 #include <plat/gpio-cfg.h>
 #include <plat/irqs.h>
 
-static char *spi_src_clks[] = {
-       [S5PC100_SPI_SRCCLK_PCLK] = "pclk",
-       [S5PC100_SPI_SRCCLK_48M] = "spi_48m",
-       [S5PC100_SPI_SRCCLK_SPIBUS] = "spi_bus",
-};
-
 /* SPI Controller platform_devices */
 
 /* Since we emulate multi-cs capability, we do not touch the CS.
@@ -223,5 +217,4 @@ void __init s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
 
        pd->num_cs = num_cs;
        pd->src_clk_nr = src_clk_nr;
-       pd->src_clk_name = spi_src_clks[src_clk_nr];
 }
index 065a087f5a8bf4edbfb197589f482635d340e55d..c841f4d313f2ac898f9c1a6c1e319a68c9f687ec 100644 (file)
 
 static u64 dma_dmamask = DMA_BIT_MASK(32);
 
-struct dma_pl330_peri pdma0_peri[30] = {
-       {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = DMACH_IRDA,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0S_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_AC97_MICIN,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_AC97_PCMIN,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_AC97_PCMOUT,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_EXTERNAL,
-       }, {
-               .peri_id = (u8)DMACH_PWM,
-       }, {
-               .peri_id = (u8)DMACH_SPDIF,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_HSI_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_HSI_TX,
-               .rqtype = MEMTODEV,
-       },
+u8 pdma0_peri[] = {
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART1_RX,
+       DMACH_UART1_TX,
+       DMACH_UART2_RX,
+       DMACH_UART2_TX,
+       DMACH_UART3_RX,
+       DMACH_UART3_TX,
+       DMACH_IRDA,
+       DMACH_I2S0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S0S_TX,
+       DMACH_I2S1_RX,
+       DMACH_I2S1_TX,
+       DMACH_I2S2_RX,
+       DMACH_I2S2_TX,
+       DMACH_SPI0_RX,
+       DMACH_SPI0_TX,
+       DMACH_SPI1_RX,
+       DMACH_SPI1_TX,
+       DMACH_SPI2_RX,
+       DMACH_SPI2_TX,
+       DMACH_AC97_MICIN,
+       DMACH_AC97_PCMIN,
+       DMACH_AC97_PCMOUT,
+       DMACH_EXTERNAL,
+       DMACH_PWM,
+       DMACH_SPDIF,
+       DMACH_HSI_RX,
+       DMACH_HSI_TX,
 };
 
 struct dma_pl330_platdata s5pc100_pdma0_pdata = {
        .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
-       .peri = pdma0_peri,
+       .peri_id = pdma0_peri,
 };
 
 struct amba_device s5pc100_device_pdma0 = {
@@ -147,98 +89,42 @@ struct amba_device s5pc100_device_pdma0 = {
        .periphid = 0x00041330,
 };
 
-struct dma_pl330_peri pdma1_peri[30] = {
-       {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = DMACH_IRDA,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0S_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ0,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ1,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ2,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ3,
-       },
+u8 pdma1_peri[] = {
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART1_RX,
+       DMACH_UART1_TX,
+       DMACH_UART2_RX,
+       DMACH_UART2_TX,
+       DMACH_UART3_RX,
+       DMACH_UART3_TX,
+       DMACH_IRDA,
+       DMACH_I2S0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S0S_TX,
+       DMACH_I2S1_RX,
+       DMACH_I2S1_TX,
+       DMACH_I2S2_RX,
+       DMACH_I2S2_TX,
+       DMACH_SPI0_RX,
+       DMACH_SPI0_TX,
+       DMACH_SPI1_RX,
+       DMACH_SPI1_TX,
+       DMACH_SPI2_RX,
+       DMACH_SPI2_TX,
+       DMACH_PCM0_RX,
+       DMACH_PCM0_TX,
+       DMACH_PCM1_RX,
+       DMACH_PCM1_TX,
+       DMACH_MSM_REQ0,
+       DMACH_MSM_REQ1,
+       DMACH_MSM_REQ2,
+       DMACH_MSM_REQ3,
 };
 
 struct dma_pl330_platdata s5pc100_pdma1_pdata = {
        .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
-       .peri = pdma1_peri,
+       .peri_id = pdma1_peri,
 };
 
 struct amba_device s5pc100_device_pdma1 = {
@@ -259,7 +145,12 @@ struct amba_device s5pc100_device_pdma1 = {
 
 static int __init s5pc100_dma_init(void)
 {
+       dma_cap_set(DMA_SLAVE, s5pc100_pdma0_pdata.cap_mask);
+       dma_cap_set(DMA_CYCLIC, s5pc100_pdma0_pdata.cap_mask);
        amba_device_register(&s5pc100_device_pdma0, &iomem_resource);
+
+       dma_cap_set(DMA_SLAVE, s5pc100_pdma1_pdata.cap_mask);
+       dma_cap_set(DMA_CYCLIC, s5pc100_pdma1_pdata.cap_mask);
        amba_device_register(&s5pc100_device_pdma1, &iomem_resource);
 
        return 0;
index ba76af052c81fac1183584e33bf0e337246f9d48..b8c242edfa22d6711674e66c1974c23c9c914eed 100644 (file)
  * warranty of any kind, whether express or implied.
 */
 
-#include <asm/hardware/vic.h>
-#include <mach/map.h>
-#include <plat/irqs.h>
-
        .macro  disable_fiq
        .endm
 
        .macro  get_irqnr_preamble, base, tmp
-       ldr     \base, =VA_VIC0
        .endm
 
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
 
        .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-
-       @ check the vic0
-       mov     \irqnr, # S5P_IRQ_OFFSET + 31
-       ldr     \irqstat, [ \base, # VIC_IRQ_STATUS ]
-       teq     \irqstat, #0
-
-       @ otherwise try vic1
-       addeq   \tmp, \base, #(VA_VIC1 - VA_VIC0)
-       addeq   \irqnr, \irqnr, #32
-       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
-       teqeq   \irqstat, #0
-
-       @ otherwise try vic2
-       addeq   \tmp, \base, #(VA_VIC2 - VA_VIC0)
-       addeq   \irqnr, \irqnr, #32
-       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
-       teqeq   \irqstat, #0
-
-       clzne   \irqstat, \irqstat
-       subne   \irqnr, \irqnr, \irqstat
        .endm
index d2eb4757381f30b5464f061ad6e9d9a4771cffe5..2870f12c7926d5967727d08fbfb11aef46df1cc1 100644 (file)
@@ -97,6 +97,8 @@
 #define IRQ_SDMFIQ             S5P_IRQ_VIC2(31)
 #define IRQ_VIC_END            S5P_IRQ_VIC2(31)
 
+#define IRQ_TIMER_BASE         (11)
+
 #define S5P_EINT_BASE1         (S5P_IRQ_VIC0(0))
 #define S5P_EINT_BASE2         (IRQ_VIC_END + 1)
 
diff --git a/arch/arm/mach-s5pc100/include/mach/vmalloc.h b/arch/arm/mach-s5pc100/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 44c8e57..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* arch/arm/mach-s5pc100/include/mach/vmalloc.h
- *
- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
- *
- * 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.
- *
- * S3C6400 vmalloc definition
-*/
-
-#ifndef __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END    0xF6000000UL
-
-#endif /* __ASM_ARCH_VMALLOC_H */
index 26f5c91c9427be2c9642858c01f4f7205d165e3b..93ebe3a92d1056f433cdc58eb23c72aa1965e19a 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/input.h>
 #include <linux/pwm_backlight.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -250,6 +251,7 @@ 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,
diff --git a/arch/arm/mach-s5pc100/setup-sdhci.c b/arch/arm/mach-s5pc100/setup-sdhci.c
deleted file mode 100644 (file)
index 6418c6e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* linux/arch/arm/mach-s5pc100/setup-sdhci.c
- *
- * Copyright 2008 Samsung Electronics
- *
- * S5PC100 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * Based on mach-s3c6410/setup-sdhci.c
- *
- * 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/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s5pc100_hsmmc_clksrcs[4] = {
-       [0] = "hsmmc",          /* HCLK */
-       /* [1] = "hsmmc",       - duplicate HCLK entry */
-       [2] = "sclk_mmc",       /* mmc_bus */
-       /* [3] = "48m",         - note not successfully used yet */
-};
index 009fbe53df96031f462cf92357630345482e1bb7..53c346a4cbb1cee11425a5254841affcd7fcd69a 100644 (file)
@@ -35,5 +35,4 @@ obj-$(CONFIG_S5PV210_SETUP_I2C1)      += setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2)       += setup-i2c2.o
 obj-$(CONFIG_S5PV210_SETUP_IDE)                += setup-ide.o
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD)     += setup-keypad.o
-obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
index 4c5ac7a69e9e1b75fb7640d698f9ba0116122a0a..cead51321b297acadff7e2cb0163e6c028cb6646 100644 (file)
@@ -398,30 +398,6 @@ static struct clk init_clocks_off[] = {
                .parent         = &clk_hclk_psys.clk,
                .enable         = s5pv210_clk_ip1_ctrl,
                .ctrlbit        = (1<<25),
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.0",
-               .parent         = &clk_hclk_psys.clk,
-               .enable         = s5pv210_clk_ip2_ctrl,
-               .ctrlbit        = (1<<16),
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.1",
-               .parent         = &clk_hclk_psys.clk,
-               .enable         = s5pv210_clk_ip2_ctrl,
-               .ctrlbit        = (1<<17),
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.2",
-               .parent         = &clk_hclk_psys.clk,
-               .enable         = s5pv210_clk_ip2_ctrl,
-               .ctrlbit        = (1<<18),
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.3",
-               .parent         = &clk_hclk_psys.clk,
-               .enable         = s5pv210_clk_ip2_ctrl,
-               .ctrlbit        = (1<<19),
        }, {
                .name           = "systimer",
                .parent         = &clk_pclk_psys.clk,
@@ -559,6 +535,38 @@ static struct clk init_clocks[] = {
        },
 };
 
+static struct clk clk_hsmmc0 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.0",
+       .parent         = &clk_hclk_psys.clk,
+       .enable         = s5pv210_clk_ip2_ctrl,
+       .ctrlbit        = (1<<16),
+};
+
+static struct clk clk_hsmmc1 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.1",
+       .parent         = &clk_hclk_psys.clk,
+       .enable         = s5pv210_clk_ip2_ctrl,
+       .ctrlbit        = (1<<17),
+};
+
+static struct clk clk_hsmmc2 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.2",
+       .parent         = &clk_hclk_psys.clk,
+       .enable         = s5pv210_clk_ip2_ctrl,
+       .ctrlbit        = (1<<18),
+};
+
+static struct clk clk_hsmmc3 = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.3",
+       .parent         = &clk_hclk_psys.clk,
+       .enable         = s5pv210_clk_ip2_ctrl,
+       .ctrlbit        = (1<<19),
+};
+
 static struct clk *clkset_uart_list[] = {
        [6] = &clk_mout_mpll.clk,
        [7] = &clk_mout_epll.clk,
@@ -807,46 +815,6 @@ static struct clksrc_clk clksrcs[] = {
                .sources = &clkset_sclk_onenand,
                .reg_src = { .reg = S5P_CLK_SRC0, .shift = 28, .size = 1 },
                .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 },
-       }, {
-               .clk    = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.0",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 12),
-               },
-               .sources = &clkset_uart,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.1",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 13),
-               },
-               .sources = &clkset_uart,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.2",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 14),
-               },
-               .sources = &clkset_uart,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "uclk1",
-                       .devname        = "s5pv210-uart.3",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 15),
-               },
-               .sources = &clkset_uart,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 },
        }, {
                .clk    = {
                        .name           = "sclk_fimc",
@@ -904,46 +872,6 @@ static struct clksrc_clk clksrcs[] = {
                .sources = &clkset_group2,
                .reg_src = { .reg = S5P_CLK_SRC1, .shift = 20, .size = 4 },
                .reg_div = { .reg = S5P_CLK_DIV1, .shift = 20, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.0",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 8),
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 0, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 0, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.1",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 9),
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 4, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 4, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.2",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 10),
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 8, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 8, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_mmc",
-                       .devname        = "s3c-sdhci.3",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 11),
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P_CLK_SRC4, .shift = 12, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV4, .shift = 12, .size = 4 },
        }, {
                .clk            = {
                        .name           = "sclk_mfc",
@@ -981,26 +909,6 @@ static struct clksrc_clk clksrcs[] = {
                .sources = &clkset_group2,
                .reg_src = { .reg = S5P_CLK_SRC1, .shift = 24, .size = 4 },
                .reg_div = { .reg = S5P_CLK_DIV1, .shift = 28, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.0",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 16),
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P_CLK_SRC5, .shift = 0, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV5, .shift = 0, .size = 4 },
-       }, {
-               .clk            = {
-                       .name           = "sclk_spi",
-                       .devname        = "s3c64xx-spi.1",
-                       .enable         = s5pv210_clk_mask0_ctrl,
-                       .ctrlbit        = (1 << 17),
-               },
-               .sources = &clkset_group2,
-               .reg_src = { .reg = S5P_CLK_SRC5, .shift = 4, .size = 4 },
-               .reg_div = { .reg = S5P_CLK_DIV5, .shift = 4, .size = 4 },
        }, {
                .clk            = {
                        .name           = "sclk_pwi",
@@ -1022,6 +930,147 @@ static struct clksrc_clk clksrcs[] = {
        },
 };
 
+static struct clksrc_clk clk_sclk_uart0 = {
+       .clk    = {
+               .name           = "uclk1",
+               .devname        = "s5pv210-uart.0",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 12),
+       },
+       .sources = &clkset_uart,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_uart1 = {
+       .clk            = {
+               .name           = "uclk1",
+               .devname        = "s5pv210-uart.1",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 13),
+       },
+       .sources = &clkset_uart,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_uart2 = {
+       .clk            = {
+               .name           = "uclk1",
+               .devname        = "s5pv210-uart.2",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 14),
+       },
+       .sources = &clkset_uart,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_uart3        = {
+       .clk            = {
+               .name           = "uclk1",
+               .devname        = "s5pv210-uart.3",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 15),
+       },
+       .sources = &clkset_uart,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc0 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.0",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 8),
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 0, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 0, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.1",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 9),
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 4, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 4, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.2",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 10),
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 8, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 8, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+       .clk            = {
+               .name           = "sclk_mmc",
+               .devname        = "s3c-sdhci.3",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 11),
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P_CLK_SRC4, .shift = 12, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV4, .shift = 12, .size = 4 },
+};
+
+static struct clksrc_clk clk_sclk_spi0 = {
+       .clk            = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.0",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 16),
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P_CLK_SRC5, .shift = 0, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV5, .shift = 0, .size = 4 },
+       };
+
+static struct clksrc_clk clk_sclk_spi1 = {
+       .clk            = {
+               .name           = "sclk_spi",
+               .devname        = "s3c64xx-spi.1",
+               .enable         = s5pv210_clk_mask0_ctrl,
+               .ctrlbit        = (1 << 17),
+       },
+       .sources = &clkset_group2,
+       .reg_src = { .reg = S5P_CLK_SRC5, .shift = 4, .size = 4 },
+       .reg_div = { .reg = S5P_CLK_DIV5, .shift = 4, .size = 4 },
+       };
+
+
+static struct clksrc_clk *clksrc_cdev[] = {
+       &clk_sclk_uart0,
+       &clk_sclk_uart1,
+       &clk_sclk_uart2,
+       &clk_sclk_uart3,
+       &clk_sclk_mmc0,
+       &clk_sclk_mmc1,
+       &clk_sclk_mmc2,
+       &clk_sclk_mmc3,
+       &clk_sclk_spi0,
+       &clk_sclk_spi1,
+};
+
+static struct clk *clk_cdev[] = {
+       &clk_hsmmc0,
+       &clk_hsmmc1,
+       &clk_hsmmc2,
+       &clk_hsmmc3,
+};
+
 /* Clock initialisation code */
 static struct clksrc_clk *sysclks[] = {
        &clk_mout_apll,
@@ -1261,6 +1310,25 @@ static struct clk *clks[] __initdata = {
        &clk_pcmcdclk2,
 };
 
+static struct clk_lookup s5pv210_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p),
+       CLKDEV_INIT("s5pv210-uart.0", "clk_uart_baud1", &clk_sclk_uart0.clk),
+       CLKDEV_INIT("s5pv210-uart.1", "clk_uart_baud1", &clk_sclk_uart1.clk),
+       CLKDEV_INIT("s5pv210-uart.2", "clk_uart_baud1", &clk_sclk_uart2.clk),
+       CLKDEV_INIT("s5pv210-uart.3", "clk_uart_baud1", &clk_sclk_uart3.clk),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &clk_hsmmc0),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &clk_hsmmc1),
+       CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.0", &clk_hsmmc2),
+       CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.0", &clk_hsmmc3),
+       CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+       CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+       CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
+       CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
+       CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
+       CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk),
+};
+
 void __init s5pv210_register_clocks(void)
 {
        int ptr;
@@ -1273,11 +1341,19 @@ void __init s5pv210_register_clocks(void)
        for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++)
                s3c_register_clksrc(sclk_tv[ptr], 1);
 
+       for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
+               s3c_register_clksrc(clksrc_cdev[ptr], 1);
+
        s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
        s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
 
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
+       clkdev_add_table(s5pv210_clk_lookup, ARRAY_SIZE(s5pv210_clk_lookup));
+
+       s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
+       for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++)
+               s3c_disable_clocks(clk_cdev[ptr], 1);
 
        s3c24xx_register_clock(&dummy_apb_pclk);
        s3c_pwmclk_init();
index eaf9a7bff7a0bb6facc39dd27ba12592ec1dfb2b..39bef19dbd684702a5fd872139dcb5a2565e2904 100644 (file)
 #include <plat/s3c64xx-spi.h>
 #include <plat/gpio-cfg.h>
 
-static char *spi_src_clks[] = {
-       [S5PV210_SPI_SRCCLK_PCLK] = "pclk",
-       [S5PV210_SPI_SRCCLK_SCLK] = "sclk_spi",
-};
-
 /* SPI Controller platform_devices */
 
 /* Since we emulate multi-cs capability, we do not touch the CS.
@@ -171,5 +166,4 @@ void __init s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
 
        pd->num_cs = num_cs;
        pd->src_clk_nr = src_clk_nr;
-       pd->src_clk_name = spi_src_clks[src_clk_nr];
 }
index 86b749c18b77cfdb0da3215cd2528b44f7429e56..a6113e0267f2e720027b1c2bb64f0ccd8e6298cc 100644 (file)
 
 static u64 dma_dmamask = DMA_BIT_MASK(32);
 
-struct dma_pl330_peri pdma0_peri[28] = {
-       {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0S_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_AC97_MICIN,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_AC97_PCMIN,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_AC97_PCMOUT,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_PWM,
-       }, {
-               .peri_id = (u8)DMACH_SPDIF,
-               .rqtype = MEMTODEV,
-       },
+u8 pdma0_peri[] = {
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART1_RX,
+       DMACH_UART1_TX,
+       DMACH_UART2_RX,
+       DMACH_UART2_TX,
+       DMACH_UART3_RX,
+       DMACH_UART3_TX,
+       DMACH_MAX,
+       DMACH_I2S0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S0S_TX,
+       DMACH_I2S1_RX,
+       DMACH_I2S1_TX,
+       DMACH_MAX,
+       DMACH_MAX,
+       DMACH_SPI0_RX,
+       DMACH_SPI0_TX,
+       DMACH_SPI1_RX,
+       DMACH_SPI1_TX,
+       DMACH_MAX,
+       DMACH_MAX,
+       DMACH_AC97_MICIN,
+       DMACH_AC97_PCMIN,
+       DMACH_AC97_PCMOUT,
+       DMACH_MAX,
+       DMACH_PWM,
+       DMACH_SPDIF,
 };
 
 struct dma_pl330_platdata s5pv210_pdma0_pdata = {
        .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
-       .peri = pdma0_peri,
+       .peri_id = pdma0_peri,
 };
 
 struct amba_device s5pv210_device_pdma0 = {
@@ -137,102 +87,44 @@ struct amba_device s5pv210_device_pdma0 = {
        .periphid = 0x00041330,
 };
 
-struct dma_pl330_peri pdma1_peri[32] = {
-       {
-               .peri_id = (u8)DMACH_UART0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_UART3_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_UART3_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S0S_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_I2S2_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_SPI1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_MAX,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM0_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM1_TX,
-               .rqtype = MEMTODEV,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ0,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ1,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ2,
-       }, {
-               .peri_id = (u8)DMACH_MSM_REQ3,
-       }, {
-               .peri_id = (u8)DMACH_PCM2_RX,
-               .rqtype = DEVTOMEM,
-       }, {
-               .peri_id = (u8)DMACH_PCM2_TX,
-               .rqtype = MEMTODEV,
-       },
+u8 pdma1_peri[] = {
+       DMACH_UART0_RX,
+       DMACH_UART0_TX,
+       DMACH_UART1_RX,
+       DMACH_UART1_TX,
+       DMACH_UART2_RX,
+       DMACH_UART2_TX,
+       DMACH_UART3_RX,
+       DMACH_UART3_TX,
+       DMACH_MAX,
+       DMACH_I2S0_RX,
+       DMACH_I2S0_TX,
+       DMACH_I2S0S_TX,
+       DMACH_I2S1_RX,
+       DMACH_I2S1_TX,
+       DMACH_I2S2_RX,
+       DMACH_I2S2_TX,
+       DMACH_SPI0_RX,
+       DMACH_SPI0_TX,
+       DMACH_SPI1_RX,
+       DMACH_SPI1_TX,
+       DMACH_MAX,
+       DMACH_MAX,
+       DMACH_PCM0_RX,
+       DMACH_PCM0_TX,
+       DMACH_PCM1_RX,
+       DMACH_PCM1_TX,
+       DMACH_MSM_REQ0,
+       DMACH_MSM_REQ1,
+       DMACH_MSM_REQ2,
+       DMACH_MSM_REQ3,
+       DMACH_PCM2_RX,
+       DMACH_PCM2_TX,
 };
 
 struct dma_pl330_platdata s5pv210_pdma1_pdata = {
        .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
-       .peri = pdma1_peri,
+       .peri_id = pdma1_peri,
 };
 
 struct amba_device s5pv210_device_pdma1 = {
@@ -253,7 +145,12 @@ struct amba_device s5pv210_device_pdma1 = {
 
 static int __init s5pv210_dma_init(void)
 {
+       dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask);
+       dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask);
        amba_device_register(&s5pv210_device_pdma0, &iomem_resource);
+
+       dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask);
+       dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask);
        amba_device_register(&s5pv210_device_pdma1, &iomem_resource);
 
        return 0;
index 3aa41ac59f079f5551724fe0d6ef0386b08fff8b..bebca1b5d0b1bb73ea47b05085308b8e0f748dd1 100644 (file)
  * published by the Free Software Foundation.
 */
 
-#include <asm/hardware/vic.h>
-#include <mach/map.h>
-#include <plat/irqs.h>
-
        .macro  disable_fiq
        .endm
 
-       .macro  get_irqnr_preamble, base, tmp
-       ldr     \base, =VA_VIC0
-       .endm
-
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-
-       @ check the vic0
-       mov     \irqnr, # S5P_IRQ_OFFSET + 31
-       ldr     \irqstat, [ \base, # VIC_IRQ_STATUS ]
-       teq     \irqstat, #0
-
-       @ otherwise try vic1
-       addeq   \tmp, \base, #(VA_VIC1 - VA_VIC0)
-       addeq   \irqnr, \irqnr, #32
-       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
-       teqeq   \irqstat, #0
-
-       @ otherwise try vic2
-       addeq   \tmp, \base, #(VA_VIC2 - VA_VIC0)
-       addeq   \irqnr, \irqnr, #32
-       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
-       teqeq   \irqstat, #0
-
-       @ otherwise try vic3
-       addeq   \tmp, \base, #(VA_VIC3 - VA_VIC0)
-       addeq   \irqnr, \irqnr, #32
-       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
-       teqeq   \irqstat, #0
-
-       clzne   \irqstat, \irqstat
-       subne   \irqnr, \irqnr, \irqstat
-       .endm
index 5e0de3a31f3d7f621f32eba0d6e5a448ccdad559..e777e010ed2e4e55da635479487c1af1cb9c8da9 100644 (file)
 #define IRQ_MDNIE3             S5P_IRQ_VIC3(8)
 #define IRQ_VIC_END            S5P_IRQ_VIC3(31)
 
+#define IRQ_TIMER_BASE         (11)
+
 #define S5P_EINT_BASE1         (S5P_IRQ_VIC0(0))
 #define S5P_EINT_BASE2         (IRQ_VIC_END + 1)
 
diff --git a/arch/arm/mach-s5pv210/include/mach/vmalloc.h b/arch/arm/mach-s5pv210/include/mach/vmalloc.h
deleted file mode 100644 (file)
index a6c659d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* linux/arch/arm/mach-s5p6442/include/mach/vmalloc.h
- *
- * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
- *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com/
- *
- * Based on arch/arm/mach-s5p6442/include/mach/vmalloc.h
- *
- * S5PV210 vmalloc definition
- *
- * 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_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H __FILE__
-
-#define VMALLOC_END    0xF6000000UL
-
-#endif /* __ASM_ARCH_VMALLOC_H */
index 4865ae2c475a685c0626b6e1e03537052446906f..468a5f88619329c7b727ce38dfc68b4c6762983d 100644 (file)
 #include <plat/s5pv210.h>
 #include <plat/regs-serial.h>
 
-static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
-       [0] = {
-               .name           = "pclk",
-               .divisor        = 1,
-               .min_baud       = 0,
-               .max_baud       = 0,
-       },
-};
-
 /* uart registration process */
 void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
-       struct s3c2410_uartcfg *tcfg = cfg;
-       u32 ucnt;
-
-       for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
-               if (!tcfg->clocks) {
-                       tcfg->clocks = s5pv210_serial_clocks;
-                       tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks);
-               }
-       }
-
        s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
 }
index 5811a96125f0afdff992b77536f0c60ea1b52c32..71ca95604d6309d96d0e0698136faab87d17a2b9 100644 (file)
@@ -22,6 +22,7 @@
 #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>
@@ -680,6 +681,7 @@ 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,
index 15edcae448b9a81411dda546d48803875eb239b1..448fd9ea96f2a52b87f24df1ebb37fa13349f381 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -956,6 +957,7 @@ 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,
index f7266bb0cac8d364d11deb5005ec67743d9d8e84..c2531ffc720bbc60df829934204f3ea9550f96a5 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/i2c.h>
 #include <linux/sysdev.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -138,6 +139,7 @@ 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,
index a9106c392398c1c61dc16f01914508b7b5a8956c..3ac9e57d9705ce252d804d4755673f5e9576fb2f 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/pwm_backlight.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -273,6 +274,7 @@ static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = {
 
 static struct platform_pwm_backlight_data smdkv210_bl_data = {
        .pwm_id = 3,
+       .pwm_period_ns = 1000,
 };
 
 static void __init smdkv210_map_io(void)
@@ -315,6 +317,7 @@ 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,
index 97cc066c5369ac2b8598577ec550e98bf93f8402..df70fcb345168d4b0ce8a93ff586ce2612552a5e 100644 (file)
@@ -14,6 +14,7 @@
 #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>
@@ -127,6 +128,7 @@ 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,
diff --git a/arch/arm/mach-s5pv210/setup-sdhci.c b/arch/arm/mach-s5pv210/setup-sdhci.c
deleted file mode 100644 (file)
index 6b8ccc4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* linux/arch/arm/mach-s5pv210/setup-sdhci.c
- *
- * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com/
- *
- * S5PV210 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * 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/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s5pv210_hsmmc_clksrcs[4] = {
-       [0] = "hsmmc",          /* HCLK */
-       /* [1] = "hsmmc",       - duplicate HCLK entry */
-       [2] = "sclk_mmc",       /* mmc_bus */
-       /* [3] = NULL,          - reserved */
-};
index 3dd133f184153bb84f90e50cc1aa8eb39c43e5af..6b93e200bcaceecec1bdc18c27929480b860066b 100644 (file)
@@ -455,4 +455,5 @@ MACHINE_START(ASSABET, "Intel-Assabet")
 #ifdef CONFIG_SA1111
        .dma_zone_size  = SZ_1M,
 #endif
+       .restart        = sa11x0_restart,
 MACHINE_END
index bda83e1ab0780e0d9bc44b46bc0a8b4ffde2313b..b07a2c024cb78682d944d025e6fb7c26c349c097 100644 (file)
@@ -309,4 +309,5 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
 #ifdef CONFIG_SA1111
        .dma_zone_size  = SZ_1M,
 #endif
+       .restart        = sa11x0_restart,
 MACHINE_END
index 7f3da4b11ec90fd7caeff810d65ea3ffc010546e..11bb6d0b9be377b6c926f3e759a03a21d2e9ffff 100644 (file)
@@ -139,4 +139,5 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
        .init_irq       = cerf_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = cerf_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
index 2965cc9d424ee5dc9f504930052bec9ddcc0504f..b9060e236def9e90204fa2be99734ea3a4fc6417 100644 (file)
@@ -387,4 +387,5 @@ MACHINE_START(COLLIE, "Sharp-Collie")
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = collie_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
index 5fa5ae1f39e1164f6745704ed23f7825f16c17b6..bb10ee2cb89f11f82c801d7f9c1d8ced11c1c3b7 100644 (file)
@@ -126,6 +126,17 @@ static void sa1100_power_off(void)
        PMCR = PMCR_SF;
 }
 
+void sa11x0_restart(char mode, const char *cmd)
+{
+       if (mode == 's') {
+               /* Jump into ROM at address 0 */
+               soft_restart(0);
+       } else {
+               /* Use on-chip reset capability */
+               RSRR = RSRR_SWR;
+       }
+}
+
 static void sa11x0_register_device(struct platform_device *dev, void *data)
 {
        int err;
index b7a9a601c2d1e18a407c6110976812e35ebf93a3..33268cf6be368e3feab4195d3e9222834ad53802 100644 (file)
@@ -10,6 +10,7 @@ extern struct sys_timer sa1100_timer;
 extern void __init sa1100_map_io(void);
 extern void __init sa1100_init_irq(void);
 extern void __init sa1100_init_gpio(void);
+extern void sa11x0_restart(char, const char *);
 
 #define SET_BANK(__nr,__start,__size) \
        mi->bank[__nr].start = (__start), \
index b30733a2b82e280e9b507d67721de96eb5799549..1e6b3c105ba660c82cf72f3718caf33be87b19a3 100644 (file)
@@ -89,5 +89,6 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = h3100_mach_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
 
index 6fd324d923895b8c3688b30d87b11506300fa500..6b58e7460ecf8cd384af16aabf4d4f9023373abf 100644 (file)
@@ -130,5 +130,6 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = h3600_mach_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
 
index 30f4a551b8e56027dba638c865387ca601bccc40..c01bb36db94099357770feee2deb3ecbac4f5c6f 100644 (file)
@@ -200,4 +200,5 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board")
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = hackkit_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
index ba9da9f7f1837cc0a94667ad3e0377dbba762237..e17b208f76d4522071a06b52bfe8e7665ec1ac1a 100644 (file)
@@ -3,20 +3,7 @@
  *
  * Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
  */
-#include <mach/hardware.h>
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       if (mode == 's') {
-               /* Jump into ROM at address 0 */
-               cpu_reset(0);
-       } else {
-               /* Use on-chip reset capability */
-               RSRR = RSRR_SWR;
-       }
-}
diff --git a/arch/arm/mach-sa1100/include/mach/vmalloc.h b/arch/arm/mach-sa1100/include/mach/vmalloc.h
deleted file mode 100644 (file)
index b3d0023..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/*
- * arch/arm/mach-sa1100/include/mach/vmalloc.h
- */
-#define VMALLOC_END       (0xe8000000UL)
index 77198fe02bc5ad2e8e4fc69bafe7881e21663c7a..ee121d6f048021489f014728924904990d07a858 100644 (file)
@@ -373,4 +373,5 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
 #ifdef CONFIG_SA1111
        .dma_zone_size  = SZ_1M,
 #endif
+       .restart        = sa11x0_restart,
 MACHINE_END
index 5bc59d0947ba40ecf2df0e3fa996c41fe38a0790..af4e2761f3dbf4a6254bfab53f98080334e5f387 100644 (file)
@@ -66,4 +66,5 @@ MACHINE_START(LART, "LART")
        .init_irq       = sa1100_init_irq,
        .init_machine   = lart_init,
        .timer          = &sa1100_timer,
+       .restart        = sa11x0_restart,
 MACHINE_END
index 032f3881d145174cf00838fda285d893492a87dd..ed77f85b9951ee27befb33ff69ecb797655b2fa1 100644 (file)
@@ -116,4 +116,5 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine")
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = nanoengine_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
index 65161f2bea29132632a468328c0616c66e6f84b2..9307df053533201d1bb5b71d39e196069b24426d 100644 (file)
@@ -150,4 +150,5 @@ MACHINE_START(PLEB, "PLEB")
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = pleb_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
index 1cccbf5b9e9abbefa1332f938ff7761230cbd03d..318b2b766a0b3ee7b8921c2904b65c0fdd551c8c 100644 (file)
@@ -87,4 +87,5 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
        .init_machine   = shannon_init,
+       .restart        = sa11x0_restart,
 MACHINE_END
index 4790f3f3d008b422d1d5be85a80d8ffae3a65eae..e17c04d6e32428af6aa7c8eb1fbc35ca6d7a02d8 100644 (file)
@@ -396,4 +396,5 @@ MACHINE_START(SIMPAD, "Simpad")
        .map_io         = simpad_map_io,
        .init_irq       = sa1100_init_irq,
        .timer          = &sa1100_timer,
+       .restart        = sa11x0_restart,
 MACHINE_END
index feda3ca7fc9555a68775fdbe74bf47b273d75abc..a851c254ad6c8a79bc00204063021c1bcba2e118 100644 (file)
 #define ROMCARD_SIZE            0x08000000
 #define ROMCARD_START           0x10000000
 
-void arch_reset(char mode, const char *cmd)
+static void shark_restart(char mode, const char *cmd)
 {
         short temp;
-        local_irq_disable();
         /* Reset the Machine via pc[3] of the sequoia chipset */
         outw(0x09,0x24);
         temp=inw(0x26);
@@ -157,4 +156,5 @@ MACHINE_START(SHARK, "Shark")
        .init_irq       = shark_init_irq,
        .timer          = &shark_timer,
        .dma_zone_size  = SZ_4M,
+       .restart        = shark_restart,
 MACHINE_END
index 21c373b30bbc38079c36597d48bfee410ceaadf1..1b2f2c5050a82f350da71310afeda15fbffff8cd 100644 (file)
@@ -6,9 +6,6 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-/* Found in arch/mach-shark/core.c */
-extern void arch_reset(char mode, const char *cmd);
-
 static inline void arch_idle(void)
 {
 }
diff --git a/arch/arm/mach-shark/include/mach/vmalloc.h b/arch/arm/mach-shark/include/mach/vmalloc.h
deleted file mode 100644 (file)
index b10df98..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/*
- * arch/arm/mach-shark/include/mach/vmalloc.h
- */
-#define VMALLOC_END       0xd0000000UL
index 737bdc631b0dba4d292057bd0393840880b3a2e7..5ca1f9d669953cec4f04b0b1ff806bed85fba150 100644 (file)
@@ -28,7 +28,6 @@ pfc-$(CONFIG_ARCH_SH73A0)     += pfc-sh73a0.o
 obj-$(CONFIG_ARCH_SH7367)      += entry-intc.o
 obj-$(CONFIG_ARCH_SH7377)      += entry-intc.o
 obj-$(CONFIG_ARCH_SH7372)      += entry-intc.o
-obj-$(CONFIG_ARCH_SH73A0)      += entry-gic.o
 
 # PM objects
 obj-$(CONFIG_SUSPEND)          += suspend.o
index b862e9f81e3e557935f13df5ec6fa29128b4d86c..202c3c6ec9d8667759a22bd6079835be18220a3f 100644 (file)
@@ -608,7 +608,7 @@ struct sys_timer ag5evm_timer = {
 MACHINE_START(AG5EVM, "ag5evm")
        .map_io         = ag5evm_map_io,
        .init_irq       = sh73a0_init_irq,
-       .handle_irq     = shmobile_handle_irq_gic,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = ag5evm_init,
        .timer          = &ag5evm_timer,
 MACHINE_END
index bd9a78424d6b8e25a56b548ed3f38954981b5678..1b4439d3f9d51e41b9c3c0824eb5990389cd1343 100644 (file)
@@ -448,7 +448,7 @@ struct sys_timer kota2_timer = {
 MACHINE_START(KOTA2, "kota2")
        .map_io         = kota2_map_io,
        .init_irq       = kota2_init_irq,
-       .handle_irq     = shmobile_handle_irq_gic,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = kota2_init,
        .timer          = &kota2_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/entry-gic.S b/arch/arm/mach-shmobile/entry-gic.S
deleted file mode 100644 (file)
index e20239b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * ARM Interrupt demux handler using GIC
- *
- * Copyright (C) 2010 Magnus Damm
- * Copyright (C) 2011 Paul Mundt
- * Copyright (C) 2010 - 2011 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 <asm/assembler.h>
-#include <asm/entry-macro-multi.S>
-#include <asm/hardware/gic.h>
-#include <asm/hardware/entry-macro-gic.S>
-
-       arch_irq_handler shmobile_handle_irq_gic
index 834bd6cd508f1f75625fb1f1126507ca9acf25d4..4bf82c156771cc3a15414d338b97da64b04184c8 100644 (file)
@@ -7,7 +7,6 @@ extern void shmobile_secondary_vector(void);
 struct clk;
 extern int clk_init(void);
 extern void shmobile_handle_irq_intc(struct pt_regs *);
-extern void shmobile_handle_irq_gic(struct pt_regs *);
 extern struct platform_suspend_ops shmobile_suspend_ops;
 struct cpuidle_driver;
 extern void (*shmobile_cpuidle_modes[])(void);
index 8d4a416d42859f87a3a4d4bef1209e3b15588145..2a57b2964ee915a108979ef44f20a338419ced74 100644 (file)
        .macro  disable_fiq
        .endm
 
-       .macro  get_irqnr_preamble, base, tmp
-       .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       .endm
-
-       .macro  test_for_ipi, irqnr, irqstat, base, tmp
-       .endm
-
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
index 76a687eeaa22d706ca6c3d08cba1ebf6c9721896..3e9f823231cb634b8cc5d83fcbe73d0bfcb8059a 100644 (file)
@@ -6,9 +6,10 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
+#error Fix me up
 static inline void arch_reset(char mode, const char *cmd)
 {
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 #endif
diff --git a/arch/arm/mach-shmobile/include/mach/vmalloc.h b/arch/arm/mach-shmobile/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 2b8fd8b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_MACH_VMALLOC_H
-#define __ASM_MACH_VMALLOC_H
-
-/* Vmalloc at ... - 0xe5ffffff */
-#define VMALLOC_END 0xe6000000UL
-
-#endif /* __ASM_MACH_VMALLOC_H */
index 53da4224ba3dc76bb7c20b95a41a5e06d2770526..de3bb41c8e9e0b05b79f095941b3fec1709f1f9f 100644 (file)
  * warranty of any kind, whether express or implied.
  */
 
-#include <asm/hardware/vic.h>
-#include <mach/hardware.h>
-
                .macro  disable_fiq
                .endm
 
-               .macro  get_irqnr_preamble, base, tmp
-               .endm
-
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \base, =VA_SPEAR3XX_ML1_VIC_BASE
-               ldr     \irqstat, [\base, #VIC_IRQ_STATUS]      @ get status
-               teq     \irqstat, #0
-               beq     1001f                           @ this will set/reset
-                                                       @ zero register
-               /*
-                * Following code will find bit position of least significang
-                * bit set in irqstat, using following equation
-                * least significant bit set in n = (n & ~(n-1))
-                */
-               sub     \tmp, \irqstat, #1              @ tmp = irqstat - 1
-               mvn     \tmp, \tmp                      @ tmp = ~tmp
-               and     \irqstat, \irqstat, \tmp        @ irqstat &= tmp
-               /* Now, irqstat is = bit no. of 1st bit set in vic irq status */
-               clz     \tmp, \irqstat                  @ tmp = leading zeros
-               rsb     \irqnr, \tmp, #0x1F             @ irqnr = 32 - tmp - 1
-
-1001:          /* EQ will be set if no irqs pending */
-               .endm
index b8f31c3935f7c23eae979532ea337d5c9fddac50..14276e5a98d2e2081d5ba227ceac6d5f11b6d985 100644 (file)
@@ -42,6 +42,8 @@ void __init spear3xx_map_io(void);
 void __init spear3xx_init_irq(void);
 void __init spear3xx_init(void);
 
+void spear_restart(char, const char *);
+
 /* pad mux declarations */
 #define PMX_FIRDA_MASK         (1 << 14)
 #define PMX_I2C_MASK           (1 << 13)
diff --git a/arch/arm/mach-spear3xx/include/mach/vmalloc.h b/arch/arm/mach-spear3xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index df977b3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear3xx/include/mach/vmalloc.h
- *
- * Defining Vmalloc area for SPEAr3xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.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 __MACH_VMALLOC_H
-#define __MACH_VMALLOC_H
-
-#include <plat/vmalloc.h>
-
-#endif /* __MACH_VMALLOC_H */
index a5ff98eed1db2711103b463acf5412e7b5375ee1..3462ab9d612231b5107cad2787ffd67c7fdc2632 100644 (file)
@@ -11,6 +11,7 @@
  * warranty of any kind, whether express or implied.
  */
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 #include <mach/generic.h>
@@ -67,6 +68,8 @@ MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
        .atag_offset    =       0x100,
        .map_io         =       spear3xx_map_io,
        .init_irq       =       spear3xx_init_irq,
+       .handle_irq     =       vic_handle_irq,
        .timer          =       &spear3xx_timer,
        .init_machine   =       spear300_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index 45d180d593620609767e98075ff59a2856487af3..f92c4993f65ae5477d69e11cb2a301cf9c7ab240 100644 (file)
@@ -11,6 +11,7 @@
  * warranty of any kind, whether express or implied.
  */
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 #include <mach/generic.h>
@@ -73,6 +74,8 @@ MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
        .atag_offset    =       0x100,
        .map_io         =       spear3xx_map_io,
        .init_irq       =       spear3xx_init_irq,
+       .handle_irq     =       vic_handle_irq,
        .timer          =       &spear3xx_timer,
        .init_machine   =       spear310_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index 22879848d73a35ce083ed866466c72a56e7ab6ba..105334ab70213e85a4f3c8f8909e5cb634879921 100644 (file)
@@ -11,6 +11,7 @@
  * warranty of any kind, whether express or implied.
  */
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 #include <mach/generic.h>
@@ -71,6 +72,8 @@ MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
        .atag_offset    =       0x100,
        .map_io         =       spear3xx_map_io,
        .init_irq       =       spear3xx_init_irq,
+       .handle_irq     =       vic_handle_irq,
        .timer          =       &spear3xx_timer,
        .init_machine   =       spear320_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index 8a0b0ed7b2035606d182541347727a0a9dbdff03..d490a910d92577ac621ce90c566b10b2ce32ed83 100644 (file)
  * warranty of any kind, whether express or implied.
  */
 
-#include <asm/hardware/vic.h>
-#include <mach/hardware.h>
-
                .macro  disable_fiq
                .endm
 
-               .macro  get_irqnr_preamble, base, tmp
-               .endm
-
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \base, =VA_SPEAR6XX_CPU_VIC_PRI_BASE
-               ldr     \irqstat, [\base, #VIC_IRQ_STATUS]      @ get status
-               mov     \irqnr, #0
-               teq     \irqstat, #0
-               bne     1001f
-               ldr     \base, =VA_SPEAR6XX_CPU_VIC_SEC_BASE
-               ldr     \irqstat, [\base, #VIC_IRQ_STATUS]      @ get status
-               teq     \irqstat, #0
-               beq     1002f                           @ this will set/reset
-                                                       @ zero register
-               mov     \irqnr, #32
-1001:
-               /*
-                * Following code will find bit position of least significang
-                * bit set in irqstat, using following equation
-                * least significant bit set in n = (n & ~(n-1))
-                */
-               sub     \tmp, \irqstat, #1              @ tmp = irqstat - 1
-               mvn     \tmp, \tmp                      @ tmp = ~tmp
-               and     \irqstat, \irqstat, \tmp        @ irqstat &= tmp
-               /* Now, irqstat is = bit no. of 1st bit set in vic irq status */
-               clz     \tmp, \irqstat                  @ tmp = leading zeros
-
-               rsb     \tmp, \tmp, #0x1F               @ tmp = 32 - tmp - 1
-               add     \irqnr, \irqnr, \tmp
-
-1002:          /* EQ will be set if no irqs pending */
-               .endm
index 183f0238c5e26c611a066ebc781fa29116590f58..116b99301cf59d059bd99f5a46fca045ab362c11 100644 (file)
@@ -41,6 +41,8 @@ void __init spear6xx_init(void);
 void __init spear600_init(void);
 void __init spear6xx_clk_init(void);
 
+void spear_restart(char, const char *);
+
 /* Add spear600 machine device structure declarations here */
 
 #endif /* __MACH_GENERIC_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/vmalloc.h b/arch/arm/mach-spear6xx/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 4a0b56c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/include/mach/vmalloc.h
- *
- * Defining Vmalloc area for SPEAr6xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar<rajeev-dlh.kumar@st.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 __MACH_VMALLOC_H
-#define __MACH_VMALLOC_H
-
-#include <plat/vmalloc.h>
-
-#endif /* __MACH_VMALLOC_H */
index 8238fe38e713cf742191074dd13008b8d7755e27..c6e4254741cc71348696369e494ab79c86494060 100644 (file)
@@ -11,6 +11,7 @@
  * warranty of any kind, whether express or implied.
  */
 
+#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 #include <mach/generic.h>
@@ -46,6 +47,8 @@ MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
        .atag_offset    =       0x100,
        .map_io         =       spear6xx_map_io,
        .init_irq       =       spear6xx_init_irq,
+       .handle_irq     =       vic_handle_irq,
        .timer          =       &spear6xx_timer,
        .init_machine   =       spear600_evb_init,
+       .restart        =       spear_restart,
 MACHINE_END
index 91a07e1872085d26ce2a4834db40df410f30b92e..c9ec38e829913c41694484f7ecea7cf0d4b7e7dd 100644 (file)
@@ -18,20 +18,22 @@ obj-$(CONFIG_CPU_FREQ)                  += cpu-tegra.o
 obj-$(CONFIG_TEGRA_PCI)                        += pcie.o
 obj-$(CONFIG_USB_SUPPORT)              += usb_phy.o
 
-obj-${CONFIG_MACH_HARMONY}              += board-harmony.o
-obj-${CONFIG_MACH_HARMONY}              += board-harmony-pinmux.o
-obj-${CONFIG_MACH_HARMONY}              += board-harmony-pcie.o
-obj-${CONFIG_MACH_HARMONY}              += board-harmony-power.o
+obj-$(CONFIG_MACH_HARMONY)              += board-harmony.o
+obj-$(CONFIG_MACH_HARMONY)              += board-harmony-pinmux.o
+obj-$(CONFIG_MACH_HARMONY)              += board-harmony-pcie.o
+obj-$(CONFIG_MACH_HARMONY)              += board-harmony-power.o
 
-obj-${CONFIG_MACH_PAZ00}               += board-paz00.o
-obj-${CONFIG_MACH_PAZ00}               += board-paz00-pinmux.o
+obj-$(CONFIG_MACH_PAZ00)               += board-paz00.o
+obj-$(CONFIG_MACH_PAZ00)               += board-paz00-pinmux.o
 
-obj-${CONFIG_MACH_SEABOARD}             += board-seaboard.o
-obj-${CONFIG_MACH_SEABOARD}             += board-seaboard-pinmux.o
+obj-$(CONFIG_MACH_SEABOARD)             += board-seaboard.o
+obj-$(CONFIG_MACH_SEABOARD)             += board-seaboard-pinmux.o
 
-obj-${CONFIG_MACH_TEGRA_DT}             += board-dt.o
-obj-${CONFIG_MACH_TEGRA_DT}             += board-harmony-pinmux.o
-obj-${CONFIG_MACH_TEGRA_DT}             += board-seaboard-pinmux.o
+obj-$(CONFIG_MACH_TEGRA_DT)             += board-dt.o
+obj-$(CONFIG_MACH_TEGRA_DT)             += board-harmony-pinmux.o
+obj-$(CONFIG_MACH_TEGRA_DT)             += board-seaboard-pinmux.o
+obj-$(CONFIG_MACH_TEGRA_DT)             += board-paz00-pinmux.o
+obj-$(CONFIG_MACH_TEGRA_DT)             += board-trimslice-pinmux.o
 
-obj-${CONFIG_MACH_TRIMSLICE}            += board-trimslice.o
-obj-${CONFIG_MACH_TRIMSLICE}            += board-trimslice-pinmux.o
+obj-$(CONFIG_MACH_TRIMSLICE)            += board-trimslice.o
+obj-$(CONFIG_MACH_TRIMSLICE)            += board-trimslice-pinmux.o
index bd12c9fb81e8e8600b7017a9b22c6f66a48fca9e..cf51a000d400728ff85b43063060ae639cccb349 100644 (file)
@@ -3,5 +3,7 @@ params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00000100
 initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)        := 0x00800000
 
 dtb-$(CONFIG_MACH_HARMONY) += tegra-harmony.dtb
+dtb-$(CONFIG_MACH_PAZ00) += tegra-paz00.dtb
 dtb-$(CONFIG_MACH_SEABOARD) += tegra-seaboard.dtb
+dtb-$(CONFIG_MACH_TRIMSLICE) += tegra-trimslice.dtb
 dtb-$(CONFIG_MACH_VENTANA) += tegra-ventana.dtb
index 74743ad3d2d356b90908529dfa57b15ccd168dd5..ddc5effef91f9b22891f07af421e7e6c2c72c511 100644 (file)
 #include <linux/i2c.h>
 #include <linux/i2c-tegra.h>
 
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <asm/setup.h>
+#include <asm/hardware/gic.h>
 
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include "devices.h"
 
 void harmony_pinmux_init(void);
+void paz00_pinmux_init(void);
 void seaboard_pinmux_init(void);
+void trimslice_pinmux_init(void);
 void ventana_pinmux_init(void);
 
+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);
+}
+
 struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL),
        OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC2_BASE, "sdhci-tegra.1", NULL),
@@ -59,14 +74,28 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_I2C3_BASE, "tegra-i2c.2", NULL),
        OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_DVC_BASE, "tegra-i2c.3", NULL),
        OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S1_BASE, "tegra-i2s.0", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S1_BASE, "tegra-i2s.1", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S2_BASE, "tegra-i2s.1", NULL),
        OF_DEV_AUXDATA("nvidia,tegra20-das", TEGRA_APB_MISC_DAS_BASE, "tegra-das", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB_BASE, "tegra-ehci.0",
+                      &tegra_ehci1_device.dev.platform_data),
+       OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB2_BASE, "tegra-ehci.1",
+                      &tegra_ehci2_device.dev.platform_data),
+       OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2",
+                      &tegra_ehci3_device.dev.platform_data),
        {}
 };
 
 static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
        /* name         parent          rate            enabled */
        { "uartd",      "pll_p",        216000000,      true },
+       { "usbd",       "clk_m",        12000000,       false },
+       { "usb2",       "clk_m",        12000000,       false },
+       { "usb3",       "clk_m",        12000000,       false },
+       { "pll_a",      "pll_p_out1",   56448000,       true },
+       { "pll_a_out0", "pll_a",        11289600,       true },
+       { "cdev1",      NULL,           0,              true },
+       { "i2s1",       "pll_a_out0",   11289600,       false},
+       { "i2s2",       "pll_a_out0",   11289600,       false},
        { NULL,         NULL,           0,              0},
 };
 
@@ -75,30 +104,21 @@ static struct of_device_id tegra_dt_match_table[] __initdata = {
        {}
 };
 
-static struct of_device_id tegra_dt_gic_match[] __initdata = {
-       { .compatible = "nvidia,tegra20-gic", },
-       {}
-};
-
 static struct {
        char *machine;
        void (*init)(void);
 } pinmux_configs[] = {
+       { "compulab,trimslice", trimslice_pinmux_init },
        { "nvidia,harmony", harmony_pinmux_init },
+       { "compal,paz00", paz00_pinmux_init },
        { "nvidia,seaboard", seaboard_pinmux_init },
        { "nvidia,ventana", ventana_pinmux_init },
 };
 
 static void __init tegra_dt_init(void)
 {
-       struct device_node *node;
        int i;
 
-       node = of_find_matching_node_by_address(NULL, tegra_dt_gic_match,
-                                               TEGRA_ARM_INT_DIST_BASE);
-       if (node)
-               irq_domain_add_simple(node, INT_GIC_BASE);
-
        tegra_clk_init_from_table(tegra_dt_clk_init_table);
 
        /*
@@ -120,7 +140,9 @@ static void __init tegra_dt_init(void)
 }
 
 static const char * tegra_dt_board_compat[] = {
+       "compulab,trimslice",
        "nvidia,harmony",
+       "compal,paz00",
        "nvidia,seaboard",
        "nvidia,ventana",
        NULL
@@ -129,8 +151,10 @@ static const char * tegra_dt_board_compat[] = {
 DT_MACHINE_START(TEGRA_DT, "nVidia Tegra (Flattened Device Tree)")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra_init_early,
-       .init_irq       = tegra_init_irq,
+       .init_irq       = tegra_dt_init_irq,
+       .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
        .init_machine   = tegra_dt_init,
+       .restart        = tegra_assert_system_reset,
        .dt_compat      = tegra_dt_board_compat,
 MACHINE_END
index f0bdc5e3fe527a3a34d61b269a0ee0cc816a657e..70ee674131f9fee9d77a189c12fafbb0dbd3af65 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
+#include <asm/hardware/gic.h>
 #include <asm/setup.h>
 
 #include <mach/tegra_wm8903_pdata.h>
@@ -187,6 +188,8 @@ MACHINE_START(HARMONY, "harmony")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra_init_early,
        .init_irq       = tegra_init_irq,
+       .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
        .init_machine   = tegra_harmony_init,
+       .restart        = tegra_assert_system_reset,
 MACHINE_END
index be30e215f4b73ba15daefb2030c8d86afc4e1637..126892cfddce1ce222b0251f1bac972cb16b6db1 100644 (file)
@@ -30,7 +30,7 @@ static struct tegra_pingroup_config paz00_pinmux[] = {
        {TEGRA_PINGROUP_ATC,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_ATD,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_ATE,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
-       {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT,      TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT,      TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4,     TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_CRTP,  TEGRA_MUX_CRT,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_CSUS,  TEGRA_MUX_PLLC_OUT1,     TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
index 55c55ba89f1e0c52ddbe838764c814f423ca4cb3..1f563ddccd101ee388e5a598696a9eca54a60ab3 100644 (file)
 #include <linux/serial_8250.h>
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
+#include <linux/gpio_keys.h>
 #include <linux/pda_power.h>
 #include <linux/io.h>
+#include <linux/input.h>
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 #include <linux/rfkill-gpio.h>
 
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
@@ -114,12 +117,37 @@ static struct platform_device leds_gpio = {
         },
 };
 
+static struct gpio_keys_button paz00_gpio_keys_buttons[] = {
+       {
+               .code           = KEY_POWER,
+               .gpio           = TEGRA_GPIO_POWERKEY,
+               .active_low     = 1,
+               .desc           = "Power",
+               .type           = EV_KEY,
+               .wakeup         = 1,
+       },
+};
+
+static struct gpio_keys_platform_data paz00_gpio_keys = {
+       .buttons        = paz00_gpio_keys_buttons,
+       .nbuttons       = ARRAY_SIZE(paz00_gpio_keys_buttons),
+};
+
+static struct platform_device gpio_keys_device = {
+       .name   = "gpio-keys",
+       .id     = -1,
+       .dev    = {
+               .platform_data = &paz00_gpio_keys,
+       },
+};
+
 static struct platform_device *paz00_devices[] __initdata = {
        &debug_uart,
        &tegra_sdhci_device4,
        &tegra_sdhci_device1,
        &wifi_rfkill_device,
        &leds_gpio,
+       &gpio_keys_device,
 };
 
 static void paz00_i2c_init(void)
@@ -190,6 +218,8 @@ MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra_init_early,
        .init_irq       = tegra_init_irq,
+       .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
        .init_machine   = tegra_paz00_init,
+       .restart        = tegra_assert_system_reset,
 MACHINE_END
index 8aff06eb58c38e3f0dfdf52d1a8aa02044637317..ffa83f580db6740289fe0ee00ef1a77a1cf8910b 100644 (file)
@@ -32,6 +32,9 @@
 #define TEGRA_WIFI_RST                 TEGRA_GPIO_PD1
 #define TEGRA_WIFI_LED                 TEGRA_GPIO_PD0
 
+/* WakeUp */
+#define TEGRA_GPIO_POWERKEY    TEGRA_GPIO_PJ7
+
 void paz00_pinmux_init(void);
 
 #endif
index bf13ea355efcc5049642f78f9e2869609a0bff91..c1599eb8e0cb0acb791551f9b90a0d1f124da1e1 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 
 #include "board.h"
 #include "board-seaboard.h"
@@ -284,8 +285,10 @@ MACHINE_START(SEABOARD, "seaboard")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra_init_early,
        .init_irq       = tegra_init_irq,
+       .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
        .init_machine   = tegra_seaboard_init,
+       .restart        = tegra_assert_system_reset,
 MACHINE_END
 
 MACHINE_START(KAEN, "kaen")
@@ -293,8 +296,10 @@ MACHINE_START(KAEN, "kaen")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra_init_early,
        .init_irq       = tegra_init_irq,
+       .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
        .init_machine   = tegra_kaen_init,
+       .restart        = tegra_assert_system_reset,
 MACHINE_END
 
 MACHINE_START(WARIO, "wario")
@@ -302,6 +307,8 @@ MACHINE_START(WARIO, "wario")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra_init_early,
        .init_irq       = tegra_init_irq,
+       .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
        .init_machine   = tegra_wario_init,
+       .restart        = tegra_assert_system_reset,
 MACHINE_END
index 1a6617b7806f2d8cf75178dcdc7393fb4195c24a..c242314a1db5e55e2a6552da18ef99497f100a7f 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 
+#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/setup.h>
@@ -176,6 +177,8 @@ MACHINE_START(TRIMSLICE, "trimslice")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra_init_early,
        .init_irq       = tegra_init_irq,
+       .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
        .init_machine   = tegra_trimslice_init,
+       .restart        = tegra_assert_system_reset,
 MACHINE_END
index 690b888be506b0f1e841a19f96180966cce00c89..20f396d740fa40a9e5852741d338429ba5f37bb8 100644 (file)
@@ -31,8 +31,6 @@
 #include "clock.h"
 #include "fuse.h"
 
-void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;
-
 void tegra_assert_system_reset(char mode, const char *cmd)
 {
        void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
index dd165c53889de61d499731f8e5b6da8fc88d5d55..31e28ae5852935ba7a5e842411b4bb4308e7dd50 100644 (file)
  * GNU General Public License for more details.
  *
  */
-#include <mach/iomap.h>
-#include <mach/io.h>
-
-#if defined(CONFIG_ARM_GIC)
-#define HAVE_GET_IRQNR_PREAMBLE
-#include <asm/hardware/entry-macro-gic.S>
-
-       /* Uses the GIC interrupt controller built into the cpu */
-#define ICTRL_BASE (IO_CPU_VIRT + 0x100)
 
        .macro  disable_fiq
        .endm
 
-       .macro  get_irqnr_preamble, base, tmp
-       movw \base, #(ICTRL_BASE & 0x0000ffff)
-       movt \base, #((ICTRL_BASE & 0xffff0000) >> 16)
-       .endm
-
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
-#else
-       /* legacy interrupt controller for AP16 */
-       .macro  disable_fiq
-       .endm
-
-       .macro  get_irqnr_preamble, base, tmp
-       @ enable imprecise aborts
-       cpsie   a
-       @ EVP base at 0xf010f000
-       mov \base, #0xf0000000
-       orr \base, #0x00100000
-       orr \base, #0x0000f000
-       .endm
-
-       .macro  arch_ret_to_user, tmp1, tmp2
-       .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       ldr \irqnr, [\base, #0x20]      @ EVT_IRQ_STS
-       cmp \irqnr, #0x80
-       .endm
-#endif
index 35a011fbc42d38f551017a7389b28d003b225169..f15defffb5d252f519cb838afa8cbc628a097248 100644 (file)
 
 #ifndef __ASSEMBLER__
 
-#define __arch_ioremap         tegra_ioremap
-#define __arch_iounmap         tegra_iounmap
-
-void __iomem *tegra_ioremap(unsigned long phys, size_t size, unsigned int type);
-void tegra_iounmap(volatile void __iomem *addr);
-
 #define IO_ADDRESS(n) (IO_TO_VIRT(n))
 
 #ifdef CONFIG_TEGRA_PCI
index 027c4215d3132cf273de1eeadf49760a680a2afa..a312988bf6f8609a9bbeb590db5a4cfe8e8df30f 100644 (file)
 #ifndef __MACH_TEGRA_SYSTEM_H
 #define __MACH_TEGRA_SYSTEM_H
 
-#include <mach/iomap.h>
-
-extern void (*arch_reset)(char mode, const char *cmd);
-
 static inline void arch_idle(void)
 {
 }
diff --git a/arch/arm/mach-tegra/include/mach/vmalloc.h b/arch/arm/mach-tegra/include/mach/vmalloc.h
deleted file mode 100644 (file)
index fd6aa65..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * arch/arm/mach-tegra/include/mach/vmalloc.h
- *
- * Copyright (C) 2010 Google, Inc.
- *
- * Author:
- *     Colin Cross <ccross@google.com>
- *     Erik Gilling <konkers@google.com>
- *
- * 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.
- *
- */
-
-#ifndef __MACH_TEGRA_VMALLOC_H
-#define __MACH_TEGRA_VMALLOC_H
-
-#include <asm/sizes.h>
-
-#define VMALLOC_END        0xFE000000UL
-
-#endif
index 5489f8b5d6ade198e50401a4a9a3adcaff66e038..d23ee2db28273afd250ecf6b6981a1562cdf5fab 100644 (file)
@@ -60,24 +60,3 @@ void __init tegra_map_common_io(void)
 {
        iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc));
 }
-
-/*
- * Intercept ioremap() requests for addresses in our fixed mapping regions.
- */
-void __iomem *tegra_ioremap(unsigned long p, size_t size, unsigned int type)
-{
-       void __iomem *v = IO_ADDRESS(p);
-       if (v == NULL)
-               v = __arm_ioremap(p, size, type);
-       return v;
-}
-EXPORT_SYMBOL(tegra_ioremap);
-
-void tegra_iounmap(volatile void __iomem *addr)
-{
-       unsigned long virt = (unsigned long)addr;
-
-       if (virt >= VMALLOC_START && virt < VMALLOC_END)
-               __iounmap(addr);
-}
-EXPORT_SYMBOL(tegra_iounmap);
index 4956c3cea73172923cff3f2166eff9711a727e1c..4e1afcd54faedd71ffb04276d78c9f025bc4b407 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/io.h>
+#include <linux/of.h>
 
 #include <asm/hardware/gic.h>
 
 
 #include "board.h"
 
-#define INT_SYS_NR     (INT_GPIO_BASE - INT_PRI_BASE)
-#define INT_SYS_SZ     (INT_SEC_BASE - INT_PRI_BASE)
-#define PPI_NR         ((INT_SYS_NR+INT_SYS_SZ-1)/INT_SYS_SZ)
-
 #define ICTLR_CPU_IEP_VFIQ     0x08
 #define ICTLR_CPU_IEP_FIR      0x14
 #define ICTLR_CPU_IEP_FIR_SET  0x18
@@ -129,6 +126,11 @@ void __init tegra_init_irq(void)
        gic_arch_extn.irq_unmask = tegra_unmask;
        gic_arch_extn.irq_retrigger = tegra_retrigger;
 
-       gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
-                IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
+       /*
+        * Check if there is a devicetree present, since the GIC will be
+        * initialized elsewhere under DT.
+        */
+       if (!of_have_populated_dt())
+               gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
+                       IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
 }
index e2272d263a83bd8bc98970a1d38329fe209db5d2..2f1df471c9328783db0b4f5cede240b64b47d6e5 100644 (file)
@@ -186,16 +186,20 @@ static void __init tegra_init_timer(void)
        int ret;
 
        clk = clk_get_sys("timer", NULL);
-       BUG_ON(IS_ERR(clk));
-       clk_enable(clk);
+       if (IS_ERR(clk))
+               pr_warn("Unable to get timer clock\n");
+       else
+               clk_enable(clk);
 
        /*
         * rtc registers are used by read_persistent_clock, keep the rtc clock
         * enabled
         */
        clk = clk_get_sys("rtc-tegra", NULL);
-       BUG_ON(IS_ERR(clk));
-       clk_enable(clk);
+       if (IS_ERR(clk))
+               pr_warn("Unable to get rtc-tegra clock\n");
+       else
+               clk_enable(clk);
 
 #ifdef CONFIG_HAVE_ARM_TWD
        twd_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x600);
index ac0791e924bc06666f4644358d94606b1295641d..697930761b3ec1f3b7cb8ce3a31a6557b91fe39a 100644 (file)
@@ -1888,3 +1888,23 @@ static int core_module_init(void)
        return mmc_init(&mmcsd_device);
 }
 module_init(core_module_init);
+
+/* Forward declare this function from the watchdog */
+void coh901327_watchdog_reset(void);
+
+void u300_restart(char mode, const char *cmd)
+{
+       switch (mode) {
+       case 's':
+       case 'h':
+#ifdef CONFIG_COH901327_WATCHDOG
+               coh901327_watchdog_reset();
+#endif
+               break;
+       default:
+               /* Do nothing */
+               break;
+       }
+       /* Wait for system do die/reset. */
+       while (1);
+}
index 20731ae39d384b192cbf84709be003e7e7b5f7dc..7181d6ac6651948623b9221f56c204e4d4783d2a 100644 (file)
@@ -8,33 +8,9 @@
  * Low-level IRQ helper macros for ST-Ericsson U300
  * Author: Linus Walleij <linus.walleij@stericsson.com>
  */
-#include <mach/hardware.h>
-#include <asm/hardware/vic.h>
 
        .macro  disable_fiq
        .endm
 
-       .macro  get_irqnr_preamble, base, tmp
-       .endm
-
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       ldr     \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON0_BASE
-       ldr     \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
-       mov     \irqnr, #0
-       teq     \irqstat, #0
-       bne     1002f
-1001:  ldr     \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON1_BASE
-       ldr     \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
-       mov     \irqnr, #32
-       teq     \irqstat, #0
-       beq     1003f
-1002:  tst     \irqstat, #1
-       bne     1003f
-       add     \irqnr, \irqnr, #1
-       movs    \irqstat, \irqstat, lsr #1
-       bne     1002b
-1003:          /* EQ will be set if no irqs pending */
-       .endm
index 77d9210a82e294f6c9d82e6ec535dd02ba382ddc..096333f32fc34eb791a61e8b593dc1933a231778 100644 (file)
@@ -14,6 +14,7 @@
 void u300_map_io(void);
 void u300_init_irq(void);
 void u300_init_devices(void);
+void u300_restart(char, const char *);
 extern struct sys_timer u300_timer;
 
 #endif
index 8daf13634ce030420e75a7b107b5af3471197877..574d46e3829066fb67792b6e563e8c88e1a5d848 100644 (file)
@@ -8,35 +8,7 @@
  * System shutdown and reset functions.
  * Author: Linus Walleij <linus.walleij@stericsson.com>
  */
-#include <mach/hardware.h>
-#include <asm/io.h>
-#include <asm/hardware/vic.h>
-#include <asm/irq.h>
-
-/* Forward declare this function from the watchdog */
-void coh901327_watchdog_reset(void);
-
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
-
-static void arch_reset(char mode, const char *cmd)
-{
-       switch (mode) {
-       case 's':
-       case 'h':
-               printk(KERN_CRIT "RESET: shutting down/rebooting system\n");
-               /* Disable interrupts */
-               local_irq_disable();
-#ifdef CONFIG_COH901327_WATCHDOG
-               coh901327_watchdog_reset();
-#endif
-               break;
-       default:
-               /* Do nothing */
-               break;
-       }
-       /* Wait for system do die/reset. */
-       while (1);
-}
diff --git a/arch/arm/mach-u300/include/mach/vmalloc.h b/arch/arm/mach-u300/include/mach/vmalloc.h
deleted file mode 100644 (file)
index ec423b9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- *
- * arch/arm/mach-u300/include/mach/vmalloc.h
- *
- *
- * Copyright (C) 2006-2009 ST-Ericsson AB
- * License terms: GNU General Public License (GPL) version 2
- * Virtual memory allocations
- * End must be above the I/O registers and on an even 2MiB boundary.
- * Author: Linus Walleij <linus.walleij@stericsson.com>
- */
-#define VMALLOC_END    0xfe800000UL
index 89422ee7f3a8719d7edc0df21ccdbbd2710ea387..def45bda29327eb14eb97cd3712957814b0f9870 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/io.h>
 #include <mach/hardware.h>
 #include <mach/platform.h>
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/memory.h>
@@ -49,6 +50,8 @@ MACHINE_START(U300, MACH_U300_STRING)
        .atag_offset    = BOOT_PARAMS_OFFSET,
        .map_io         = u300_map_io,
        .init_irq       = u300_init_irq,
+       .handle_irq     = vic_handle_irq,
        .timer          = &u300_timer,
        .init_machine   = u300_init_machine,
+       .restart        = u300_restart,
 MACHINE_END
index bdd7b80dd7adf1ee14688110badff51f1e544225..de1f5f8f73306f3ed6b02f18ce09cb39c1760293 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/leds.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 
 #include <plat/i2c.h>
 #include <plat/ste_dma40.h>
@@ -695,6 +696,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
        .timer          = &ux500_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = mop500_init_machine,
 MACHINE_END
 
@@ -703,6 +705,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        .timer          = &ux500_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = hrefv60_init_machine,
 MACHINE_END
 
@@ -712,5 +715,6 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
        .timer          = &ux500_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = snowball_init_machine,
 MACHINE_END
index 82025ba70c0301b11326ac9f6ce3b2da6bcbefa4..fe1569b67c9182cea704dab1fc4ddd1145388dbe 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/i2c.h>
 #include <linux/mfd/ab5500/ab5500.h>
 
+#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
@@ -149,5 +150,6 @@ MACHINE_START(U5500, "ST-Ericsson U5500 Platform")
        .map_io         = u5500_map_io,
        .init_irq       = ux500_init_irq,
        .timer          = &ux500_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = u5500_init_machine,
 MACHINE_END
index 071bba94f7271470e0a2e4de884abcbf03b3d231..e16299e1020a9cc825305a14acf7cc019d72b645 100644 (file)
@@ -10,8 +10,6 @@
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <mach/hardware.h>
-#include <asm/hardware/entry-macro-gic.S>
 
                .macro  disable_fiq
                .endm
index c0cd8006f1a2a197d59e139425ec20826d1b020f..258e5c919c243d176e6ddfdad78a6455d41f2c35 100644 (file)
@@ -17,9 +17,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /* yet to be implemented - TODO */
-}
-
 #endif
diff --git a/arch/arm/mach-ux500/include/mach/vmalloc.h b/arch/arm/mach-ux500/include/mach/vmalloc.h
deleted file mode 100644 (file)
index a4945cb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- *  Copyright (C) 2009 ST-Ericsson
- *
- * 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
- */
-#define VMALLOC_END    0xf0000000UL
index e340a54251df5d1245f1e913c91587fb23f48fd7..cbcda61162d32182a915fa25890d76d981c1ba27 100644 (file)
@@ -141,11 +141,6 @@ static struct map_desc versatile_io_desc[] __initdata = {
        },
 #ifdef CONFIG_MACH_VERSATILE_AB
        {
-               .virtual        =  IO_ADDRESS(VERSATILE_GPIO0_BASE),
-               .pfn            = __phys_to_pfn(VERSATILE_GPIO0_BASE),
-               .length         = SZ_4K,
-               .type           = MT_DEVICE
-       }, {
                .virtual        =  IO_ADDRESS(VERSATILE_IB2_BASE),
                .pfn            = __phys_to_pfn(VERSATILE_IB2_BASE),
                .length         = SZ_64M,
@@ -745,6 +740,19 @@ static void versatile_leds_event(led_event_t ledevt)
 }
 #endif /* CONFIG_LEDS */
 
+void versatile_restart(char mode, const char *cmd)
+{
+       void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
+       u32 val;
+
+       val = __raw_readl(sys + VERSATILE_SYS_RESETCTL_OFFSET);
+       val |= 0x105;
+
+       __raw_writel(0xa05f, sys + VERSATILE_SYS_LOCK_OFFSET);
+       __raw_writel(val, sys + VERSATILE_SYS_RESETCTL_OFFSET);
+       __raw_writel(0, sys + VERSATILE_SYS_LOCK_OFFSET);
+}
+
 /* Early initializations */
 void __init versatile_init_early(void)
 {
index e01422700ebb50a3621943276a054b1f74d5b6ed..2ef2f555f315c8326fd85b73b295c6511d502904 100644 (file)
@@ -30,6 +30,7 @@ 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_restart(char, const char *);
 extern unsigned int mmc_status(struct device *dev);
 #ifdef CONFIG_OF
 extern struct of_dev_auxdata versatile_auxdata_lookup[];
index e6f7c1663160b34b07b80aed6f6d27d30214e40b..b6f0dbf122eee997c191ba258ee84cb2daf68eca 100644 (file)
@@ -7,39 +7,9 @@
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <mach/hardware.h>
-#include <mach/platform.h>
-#include <asm/hardware/vic.h>
 
                .macro  disable_fiq
                .endm
 
-               .macro  get_irqnr_preamble, base, tmp
-               ldr     \base, =IO_ADDRESS(VERSATILE_VIC_BASE)
-               .endm
-
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \irqstat, [\base, #VIC_IRQ_STATUS]      @ get masked status
-               mov     \irqnr, #0
-               teq     \irqstat, #0
-               beq     1003f
-
-1001:          tst     \irqstat, #15
-               bne     1002f
-               add     \irqnr, \irqnr, #4
-               movs    \irqstat, \irqstat, lsr #4
-               bne     1001b
-1002:          tst     \irqstat, #1
-               bne     1003f
-               add     \irqnr, \irqnr, #1
-               movs    \irqstat, \irqstat, lsr #1
-               bne     1002b
-1003:          /* EQ will be set if no irqs pending */
-
-@              clz     \irqnr, \irqstat
-@1003:         /* EQ will be set if we reach MAXIRQNUM */
-               .endm
-
index 8ffc12a7cb25dd0f0273d8bc6d938d067821f646..f3fa347895f07b8a746899606bacdc0bb6af77b8 100644 (file)
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
 static inline void arch_idle(void)
 {
        /*
@@ -34,16 +30,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       u32 val;
-
-       val = __raw_readl(IO_ADDRESS(VERSATILE_SYS_RESETCTL)) & ~0x7;
-       val |= 0x105;
-
-       __raw_writel(0xa05f, IO_ADDRESS(VERSATILE_SYS_LOCK));
-       __raw_writel(val, IO_ADDRESS(VERSATILE_SYS_RESETCTL));
-       __raw_writel(0, IO_ADDRESS(VERSATILE_SYS_LOCK));
-}
-
 #endif
diff --git a/arch/arm/mach-versatile/include/mach/vmalloc.h b/arch/arm/mach-versatile/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 7d8e069..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *  arch/arm/mach-versatile/include/mach/vmalloc.h
- *
- *  Copyright (C) 2003 ARM Limited
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-#define VMALLOC_END            0xd8000000UL
index fda4866703cdbc731fa80b9a771756d049442955..63b8dd2b9f4d297132605432af9c17363870d517 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 
 #include <asm/mach/arch.h>
@@ -39,6 +40,8 @@ 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_machine   = versatile_init,
+       .restart        = versatile_restart,
 MACHINE_END
index 54e037c090f584b7c3f7dd287256d48ed7b22d24..ae5ad3c8f3dd0184f0a4259986a9ee8131558703 100644 (file)
@@ -24,6 +24,7 @@
 #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>
 
@@ -45,7 +46,9 @@ 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_machine   = versatile_dt_init,
        .dt_compat      = versatile_dt_match,
+       .restart        = versatile_restart,
 MACHINE_END
index feaf9cbe60f699336b34de627830a685304c94f3..7aab79b665e71ee8bc57899817e29c76db046ac7 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
+#include <asm/hardware/vic.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
@@ -107,6 +108,8 @@ 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_machine   = versatile_pb_init,
+       .restart        = versatile_restart,
 MACHINE_END
index 73c11297509ed4bf9cfdefad92b831aab9495218..a14f9e62ca9203b5a67014907d7065295121cc38 100644 (file)
@@ -1,5 +1,3 @@
-#include <asm/hardware/entry-macro-gic.S>
-
        .macro  disable_fiq
        .endm
 
index 899a4e628a4c0c9109e601e3ee84d63dd1ac985d..f653a8e265bdbfbf3d9804c0efb912823fcaf139 100644 (file)
@@ -30,8 +30,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-}
-
 #endif
diff --git a/arch/arm/mach-vexpress/include/mach/vmalloc.h b/arch/arm/mach-vexpress/include/mach/vmalloc.h
deleted file mode 100644 (file)
index f43a36e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *  arch/arm/mach-vexpress/include/mach/vmalloc.h
- *
- *  Copyright (C) 2003 ARM Limited
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-#define VMALLOC_END            0xf8000000UL
index 1fafc324460743654a46079c87781c99dfe3c10d..6dd10e320ef68de0e16726cca8062bbc911cb6da 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/timer-sp.h>
 #include <asm/hardware/sp810.h>
+#include <asm/hardware/gic.h>
 
 #include <mach/ct-ca9x4.h>
 #include <mach/motherboard.h>
@@ -437,7 +438,6 @@ static void __init v2m_init(void)
                amba_device_register(v2m_amba_devs[i], &iomem_resource);
 
        pm_power_off = v2m_power_off;
-       arm_pm_restart = v2m_restart;
 
        ct_desc->init_tile();
 }
@@ -448,5 +448,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
        .init_early     = v2m_init_early,
        .init_irq       = v2m_init_irq,
        .timer          = &v2m_timer,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = v2m_init,
+       .restart        = v2m_restart,
 MACHINE_END
index d6c757eaf26b2d9dd1312090654869a07f4d2c96..787bcd25c5b3c8691960da8b7fabaf8e46aab8f5 100644 (file)
@@ -12,6 +12,7 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
+#error Fix me up
 static inline void arch_reset(char mode, const char *cmd)
 {
        writel(1, VT8500_PMSR_VIRT);
diff --git a/arch/arm/mach-vt8500/include/mach/vmalloc.h b/arch/arm/mach-vt8500/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 4642290..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  arch/arm/mach-vt8500/include/mach/vmalloc.h
- *
- *  Copyright (C) 2000 Russell King.
- *
- * 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
- */
-#define VMALLOC_END    0xd0000000UL
index 0a235e502330ced25bb246da225778641bdcf3bb..604e1db266e8402d5f85c018c3870e15794c8bef 100644 (file)
 #include <mach/regs-serial.h>
 #include <mach/regs-clock.h>
 #include <mach/regs-ebi.h>
+#include <mach/regs-timer.h>
 
 #include "cpu.h"
 #include "clock.h"
+#include "nuc9xx.h"
 
 /* Initial IO mappings */
 
@@ -222,3 +224,17 @@ void __init nuc900_init_clocks(void)
        clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
 }
 
+#define        WTCR    (TMR_BA + 0x1C)
+#define        WTCLK   (1 << 10)
+#define        WTE     (1 << 7)
+#define        WTRE    (1 << 1)
+
+void nuc9xx_restart(char mode, const char *cmd)
+{
+       if (mode == 's') {
+               /* Jump into ROM at address 0 */
+               soft_restart(0);
+       } else {
+               __raw_writel(WTE | WTRE | WTCLK, WTCR);
+       }
+}
index ce228bdc66dd64ca3cf10d410138d68c6b25edc5..2aaeb93116193fca2e6a6e9f5138bf1af24d0943 100644 (file)
  * (at your option) any later version.
  *
  */
-
-#include <linux/io.h>
-#include <asm/proc-fns.h>
-#include <mach/map.h>
-#include <mach/regs-timer.h>
-
-#define        WTCR    (TMR_BA + 0x1C)
-#define        WTCLK   (1 << 10)
-#define        WTE     (1 << 7)
-#define        WTRE    (1 << 1)
-
 static void arch_idle(void)
 {
 }
-
-static void arch_reset(char mode, const char *cmd)
-{
-       if (mode == 's') {
-               /* Jump into ROM at address 0 */
-               cpu_reset(0);
-       } else {
-               __raw_writel(WTE | WTRE | WTCLK, WTCR);
-       }
-}
-
diff --git a/arch/arm/mach-w90x900/include/mach/vmalloc.h b/arch/arm/mach-w90x900/include/mach/vmalloc.h
deleted file mode 100644 (file)
index b067e44..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * arch/arm/mach-w90x900/include/mach/vmalloc.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/vmalloc.h
- *
- * 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.
- *
- */
-
-#ifndef __ASM_ARCH_VMALLOC_H
-#define __ASM_ARCH_VMALLOC_H
-
-#define VMALLOC_END      (0xe0000000UL)
-
-#endif /* __ASM_ARCH_VMALLOC_H */
index 7bf143c443f15c27ec30f079b9864304db8ae881..b466e2450ba30e15743e987b8b98638e468965ae 100644 (file)
@@ -28,6 +28,8 @@
 #include <mach/hardware.h>
 #include <mach/regs-irq.h>
 
+#include "nuc9xx.h"
+
 struct group_irq {
        unsigned long           gpen;
        unsigned int            enabled;
index 31c109018228a20435523c4af960a2a628f55416..b4243e4f1565b4614db0a1ba64f21a92bdb0bb22 100644 (file)
@@ -38,4 +38,5 @@ MACHINE_START(W90P910EVB, "W90P910EVB")
        .init_irq       = nuc900_init_irq,
        .init_machine   = nuc910evb_init,
        .timer          = &nuc900_timer,
+       .restart        = nuc9xx_restart,
 MACHINE_END
index 4062e55a57d8a8cf2d6baef38d774e3426074a4c..067d8f9166dc2a1131d0a647402fb0b546afa4a9 100644 (file)
@@ -41,4 +41,5 @@ MACHINE_START(W90P950EVB, "W90P950EVB")
        .init_irq       = nuc900_init_irq,
        .init_machine   = nuc950evb_init,
        .timer          = &nuc900_timer,
+       .restart        = nuc9xx_restart,
 MACHINE_END
index 0ab9995d5b58be532dff1488d10e06291f034ad9..cbb3adc3db1074471d96a112d8c7940fa51e2080 100644 (file)
@@ -38,4 +38,5 @@ MACHINE_START(W90N960EVB, "W90N960EVB")
        .init_irq       = nuc900_init_irq,
        .init_machine   = nuc960evb_init,
        .timer          = &nuc900_timer,
+       .restart        = nuc9xx_restart,
 MACHINE_END
index 83e9ba5fc26c9bf3590c5e9708c0bae657835d2b..b14c71a9e683d7f2195e1b7ee1231d57f3e69d4f 100644 (file)
  * published by the Free Software Foundation.
  *
  */
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"
 
 /* extern file from nuc910.c */
 
index 98a1148bc5ae6b39e8781532a08a0cff412fca15..6e9de3051cd4d8601cefb2ba7a28e4cfcfc4eeb6 100644 (file)
  * published by the Free Software Foundation.
  *
  */
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"
 
 /* extern file from nuc950.c */
 
index f0c07cbe3a8232c44595efa57e2af0f733e7e27b..9f6df9a002868469d29e3744c6fb00244b3c1b83 100644 (file)
  * published by the Free Software Foundation.
  *
  */
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"
 
 /* extern file from nuc960.c */
 
diff --git a/arch/arm/mach-w90x900/nuc9xx.h b/arch/arm/mach-w90x900/nuc9xx.h
new file mode 100644 (file)
index 0000000..91acb40
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * arch/arm/mach-w90x900/nuc9xx.h
+ *
+ * Copied from nuc910.h, which had:
+ *
+ * Copyright (c) 2008 Nuvoton corporation
+ *
+ * Header file for NUC900 CPU support
+ *
+ * Wan ZongShun <mcuos.com@gmail.com>
+ *
+ * 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.
+ *
+ */
+struct map_desc;
+struct sys_timer;
+
+/* core initialisation functions */
+
+extern void nuc900_init_irq(void);
+extern struct sys_timer nuc900_timer;
+extern void nuc9xx_restart(char, const char *);
index a2c4e2d0a0d4b6d510c2e81c33bb617a53cbdc2e..fa27c498ac0910fc3d6b7e936f1fb3ce09b81008 100644 (file)
@@ -33,6 +33,8 @@
 #include <mach/map.h>
 #include <mach/regs-timer.h>
 
+#include "nuc9xx.h"
+
 #define RESETINT       0x1f
 #define PERIOD         (0x01 << 27)
 #define ONESHOT                (0x00 << 27)
index 73e93687b81a1a60e3ca84daaca1fefb3216f582..ab5cfddc0d7b44c007a408d0febb4d14c7559daa 100644 (file)
@@ -112,6 +112,7 @@ 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_machine   = xilinx_init_machine,
        .timer          = &xttcpss_sys_timer,
        .dt_compat      = xilinx_dt_match,
index 3cfc01b37461359e3e3abec7fcb440b1f989cc93..d621fb7325691143b215379c03f0e7244ded07a4 100644 (file)
@@ -20,9 +20,6 @@
  * GNU General Public License for more details.
  */
 
-#include <mach/hardware.h>
-#include <asm/hardware/entry-macro-gic.S>
-
                .macro  disable_fiq
                .endm
 
index 1b84d705c675e43ff584a467f46009aca57dc6c3..8e88e0b8d2babf415f452e08e7904b50f2d95cc1 100644 (file)
@@ -20,9 +20,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       /* Add architecture specific reset processing here */
-}
-
 #endif
diff --git a/arch/arm/mach-zynq/include/mach/vmalloc.h b/arch/arm/mach-zynq/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 2398eff..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* arch/arm/mach-zynq/include/mach/vmalloc.h
- *
- *  Copyright (C) 2011 Xilinx
- *
- * 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.
- */
-
-#ifndef __MACH_VMALLOC_H__
-#define __MACH_VMALLOC_H__
-
-#define VMALLOC_END       0xE0000000UL
-
-#endif
index 67f75a0b66d640c4ffdd44b74fc2ac37e8b0063d..5cf7922ff5e7190e141406019b2d82bd737fe22c 100644 (file)
@@ -629,6 +629,23 @@ config IO_36
 
 comment "Processor Features"
 
+config ARM_LPAE
+       bool "Support for the Large Physical Address Extension"
+       depends on MMU && CPU_V7
+       help
+         Say Y if you have an ARMv7 processor supporting the LPAE page
+         table format and you would like to access memory beyond the
+         4GB limit. The resulting kernel image will not run on
+         processors without the LPA extension.
+
+         If unsure, say N.
+
+config ARCH_PHYS_ADDR_T_64BIT
+       def_bool ARM_LPAE
+
+config ARCH_DMA_ADDR_T_64BIT
+       bool
+
 config ARM_THUMB
        bool "Support Thumb user binaries"
        depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || CPU_V7 || CPU_FEROCEON
index c335c76e0d88665a581da12c4af189e4dc757e69..caf14dc059e5dcfd35289af5e2d3dc6f392a273b 100644 (file)
@@ -968,7 +968,7 @@ static int __init alignment_init(void)
                ai_usermode = safe_usermode(ai_usermode, false);
        }
 
-       hook_fault_code(1, do_alignment, SIGBUS, BUS_ADRALN,
+       hook_fault_code(FAULT_CODE_ALIGNMENT, do_alignment, SIGBUS, BUS_ADRALN,
                        "alignment exception");
 
        /*
index 93aac068da945d5b92987424e579d21953983050..ee9bb363d6064aa89276301940ff3980a15602d3 100644 (file)
@@ -22,6 +22,21 @@ unsigned int cpu_last_asid = ASID_FIRST_VERSION;
 DEFINE_PER_CPU(struct mm_struct *, current_mm);
 #endif
 
+#ifdef CONFIG_ARM_LPAE
+#define cpu_set_asid(asid) {                                           \
+       unsigned long ttbl, ttbh;                                       \
+       asm volatile(                                                   \
+       "       mrrc    p15, 0, %0, %1, c2              @ read TTBR0\n" \
+       "       mov     %1, %2, lsl #(48 - 32)          @ set ASID\n"   \
+       "       mcrr    p15, 0, %0, %1, c2              @ set TTBR0\n"  \
+       : "=&r" (ttbl), "=&r" (ttbh)                                    \
+       : "r" (asid & ~ASID_MASK));                                     \
+}
+#else
+#define cpu_set_asid(asid) \
+       asm("   mcr     p15, 0, %0, c13, c0, 1\n" : : "r" (asid))
+#endif
+
 /*
  * We fork()ed a process, and we need a new context for the child
  * to run in.  We reserve version 0 for initial tasks so we will
@@ -37,7 +52,7 @@ void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 static void flush_context(void)
 {
        /* set the reserved ASID before flushing the TLB */
-       asm("mcr        p15, 0, %0, c13, c0, 1\n" : : "r" (0));
+       cpu_set_asid(0);
        isb();
        local_flush_tlb_all();
        if (icache_is_vivt_asid_tagged()) {
@@ -99,7 +114,7 @@ static void reset_context(void *info)
        set_mm_context(mm, asid);
 
        /* set the new ASID */
-       asm("mcr        p15, 0, %0, c13, c0, 1\n" : : "r" (mm->context.id));
+       cpu_set_asid(mm->context.id);
        isb();
 }
 
index aa33949fef608cb4c5b7b9a76e0f4020ba0f1db6..bb7eac381a8e60f619591e7c80c4ad30cc972d62 100644 (file)
 
 #include "fault.h"
 
-/*
- * Fault status register encodings.  We steal bit 31 for our own purposes.
- */
-#define FSR_LNX_PF             (1 << 31)
-#define FSR_WRITE              (1 << 11)
-#define FSR_FS4                        (1 << 10)
-#define FSR_FS3_0              (15)
-
-static inline int fsr_fs(unsigned int fsr)
-{
-       return (fsr & FSR_FS3_0) | (fsr & FSR_FS4) >> 6;
-}
-
 #ifdef CONFIG_MMU
 
 #ifdef CONFIG_KPROBES
@@ -123,8 +110,10 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
 
                pte = pte_offset_map(pmd, addr);
                printk(", *pte=%08llx", (long long)pte_val(*pte));
+#ifndef CONFIG_ARM_LPAE
                printk(", *ppte=%08llx",
                       (long long)pte_val(pte[PTE_HWTABLE_PTRS]));
+#endif
                pte_unmap(pte);
        } while(0);
 
@@ -231,7 +220,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
 
 static int __kprobes
 __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
-               struct task_struct *tsk)
+               unsigned int flags, struct task_struct *tsk)
 {
        struct vm_area_struct *vma;
        int fault;
@@ -253,18 +242,7 @@ good_area:
                goto out;
        }
 
-       /*
-        * If for any reason at all we couldn't handle the fault, make
-        * sure we exit gracefully rather than endlessly redo the fault.
-        */
-       fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, (fsr & FSR_WRITE) ? FAULT_FLAG_WRITE : 0);
-       if (unlikely(fault & VM_FAULT_ERROR))
-               return fault;
-       if (fault & VM_FAULT_MAJOR)
-               tsk->maj_flt++;
-       else
-               tsk->min_flt++;
-       return fault;
+       return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags);
 
 check_stack:
        if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
@@ -279,6 +257,9 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
        struct task_struct *tsk;
        struct mm_struct *mm;
        int fault, sig, code;
+       int write = fsr & FSR_WRITE;
+       unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
+                               (write ? FAULT_FLAG_WRITE : 0);
 
        if (notify_page_fault(regs, fsr))
                return 0;
@@ -305,6 +286,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
        if (!down_read_trylock(&mm->mmap_sem)) {
                if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
                        goto no_context;
+retry:
                down_read(&mm->mmap_sem);
        } else {
                /*
@@ -320,14 +302,41 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 #endif
        }
 
-       fault = __do_page_fault(mm, addr, fsr, tsk);
-       up_read(&mm->mmap_sem);
+       fault = __do_page_fault(mm, addr, fsr, flags, tsk);
+
+       /* If we need to retry but a fatal signal is pending, handle the
+        * signal first. We do not need to release the mmap_sem because
+        * it would already be released in __lock_page_or_retry in
+        * mm/filemap.c. */
+       if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
+               return 0;
+
+       /*
+        * Major/minor page fault accounting is only done on the
+        * initial attempt. If we go through a retry, it is extremely
+        * likely that the page will be found in page cache at that point.
+        */
 
        perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
-       if (fault & VM_FAULT_MAJOR)
-               perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, addr);
-       else if (fault & VM_FAULT_MINOR)
-               perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, addr);
+       if (flags & FAULT_FLAG_ALLOW_RETRY) {
+               if (fault & VM_FAULT_MAJOR) {
+                       tsk->maj_flt++;
+                       perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
+                                       regs, addr);
+               } else {
+                       tsk->min_flt++;
+                       perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
+                                       regs, addr);
+               }
+               if (fault & VM_FAULT_RETRY) {
+                       /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
+                       * of starvation. */
+                       flags &= ~FAULT_FLAG_ALLOW_RETRY;
+                       goto retry;
+               }
+       }
+
+       up_read(&mm->mmap_sem);
 
        /*
         * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
@@ -441,6 +450,12 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
        pmd = pmd_offset(pud, addr);
        pmd_k = pmd_offset(pud_k, addr);
 
+#ifdef CONFIG_ARM_LPAE
+       /*
+        * Only one hardware entry per PMD with LPAE.
+        */
+       index = 0;
+#else
        /*
         * On ARM one Linux PGD entry contains two hardware entries (see page
         * tables layout in pgtable.h). We normally guarantee that we always
@@ -450,6 +465,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
         * for the first of pair.
         */
        index = (addr >> SECTION_SHIFT) & 1;
+#endif
        if (pmd_none(pmd_k[index]))
                goto bad_area;
 
@@ -489,55 +505,20 @@ do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
        return 1;
 }
 
-static struct fsr_info {
+struct fsr_info {
        int     (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
        int     sig;
        int     code;
        const char *name;
-} fsr_info[] = {
-       /*
-        * The following are the standard ARMv3 and ARMv4 aborts.  ARMv5
-        * defines these to be "precise" aborts.
-        */
-       { do_bad,               SIGSEGV, 0,             "vector exception"                 },
-       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment exception"              },
-       { do_bad,               SIGKILL, 0,             "terminal exception"               },
-       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment exception"              },
-       { do_bad,               SIGBUS,  0,             "external abort on linefetch"      },
-       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "section translation fault"        },
-       { do_bad,               SIGBUS,  0,             "external abort on linefetch"      },
-       { do_page_fault,        SIGSEGV, SEGV_MAPERR,   "page translation fault"           },
-       { do_bad,               SIGBUS,  0,             "external abort on non-linefetch"  },
-       { do_bad,               SIGSEGV, SEGV_ACCERR,   "section domain fault"             },
-       { do_bad,               SIGBUS,  0,             "external abort on non-linefetch"  },
-       { do_bad,               SIGSEGV, SEGV_ACCERR,   "page domain fault"                },
-       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
-       { do_sect_fault,        SIGSEGV, SEGV_ACCERR,   "section permission fault"         },
-       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
-       { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "page permission fault"            },
-       /*
-        * The following are "imprecise" aborts, which are signalled by bit
-        * 10 of the FSR, and may not be recoverable.  These are only
-        * supported if the CPU abort handler supports bit 10.
-        */
-       { do_bad,               SIGBUS,  0,             "unknown 16"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 17"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 18"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 19"                       },
-       { do_bad,               SIGBUS,  0,             "lock abort"                       }, /* xscale */
-       { do_bad,               SIGBUS,  0,             "unknown 21"                       },
-       { do_bad,               SIGBUS,  BUS_OBJERR,    "imprecise external abort"         }, /* xscale */
-       { do_bad,               SIGBUS,  0,             "unknown 23"                       },
-       { do_bad,               SIGBUS,  0,             "dcache parity error"              }, /* xscale */
-       { do_bad,               SIGBUS,  0,             "unknown 25"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 26"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 27"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 28"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 29"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 30"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 31"                       }
 };
 
+/* FSR definition */
+#ifdef CONFIG_ARM_LPAE
+#include "fsr-3level.c"
+#else
+#include "fsr-2level.c"
+#endif
+
 void __init
 hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
                int sig, int code, const char *name)
@@ -573,42 +554,6 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
        arm_notify_die("", regs, &info, fsr, 0);
 }
 
-
-static struct fsr_info ifsr_info[] = {
-       { do_bad,               SIGBUS,  0,             "unknown 0"                        },
-       { do_bad,               SIGBUS,  0,             "unknown 1"                        },
-       { do_bad,               SIGBUS,  0,             "debug event"                      },
-       { do_bad,               SIGSEGV, SEGV_ACCERR,   "section access flag fault"        },
-       { do_bad,               SIGBUS,  0,             "unknown 4"                        },
-       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "section translation fault"        },
-       { do_bad,               SIGSEGV, SEGV_ACCERR,   "page access flag fault"           },
-       { do_page_fault,        SIGSEGV, SEGV_MAPERR,   "page translation fault"           },
-       { do_bad,               SIGBUS,  0,             "external abort on non-linefetch"  },
-       { do_bad,               SIGSEGV, SEGV_ACCERR,   "section domain fault"             },
-       { do_bad,               SIGBUS,  0,             "unknown 10"                       },
-       { do_bad,               SIGSEGV, SEGV_ACCERR,   "page domain fault"                },
-       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
-       { do_sect_fault,        SIGSEGV, SEGV_ACCERR,   "section permission fault"         },
-       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
-       { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "page permission fault"            },
-       { do_bad,               SIGBUS,  0,             "unknown 16"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 17"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 18"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 19"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 20"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 21"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 22"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 23"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 24"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 25"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 26"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 27"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 28"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 29"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 30"                       },
-       { do_bad,               SIGBUS,  0,             "unknown 31"                       },
-};
-
 void __init
 hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
                 int sig, int code, const char *name)
@@ -641,6 +586,7 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs)
        arm_notify_die("", regs, &info, ifsr, 0);
 }
 
+#ifndef CONFIG_ARM_LPAE
 static int __init exceptions_init(void)
 {
        if (cpu_architecture() >= CPU_ARCH_ARMv6) {
@@ -663,3 +609,4 @@ static int __init exceptions_init(void)
 }
 
 arch_initcall(exceptions_init);
+#endif
index 49e9e3804de41ead9959b676a57279cfdd800baf..cf08bdfbe0d6b6168970e7962341dd407c2823fd 100644 (file)
@@ -1,3 +1,28 @@
-void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
+#ifndef __ARCH_ARM_FAULT_H
+#define __ARCH_ARM_FAULT_H
+
+/*
+ * Fault status register encodings.  We steal bit 31 for our own purposes.
+ */
+#define FSR_LNX_PF             (1 << 31)
+#define FSR_WRITE              (1 << 11)
+#define FSR_FS4                        (1 << 10)
+#define FSR_FS3_0              (15)
+#define FSR_FS5_0              (0x3f)
+
+#ifdef CONFIG_ARM_LPAE
+static inline int fsr_fs(unsigned int fsr)
+{
+       return fsr & FSR_FS5_0;
+}
+#else
+static inline int fsr_fs(unsigned int fsr)
+{
+       return (fsr & FSR_FS3_0) | (fsr & FSR_FS4) >> 6;
+}
+#endif
 
+void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
 unsigned long search_exception_table(unsigned long addr);
+
+#endif /* __ARCH_ARM_FAULT_H */
diff --git a/arch/arm/mm/fsr-2level.c b/arch/arm/mm/fsr-2level.c
new file mode 100644 (file)
index 0000000..18ca74c
--- /dev/null
@@ -0,0 +1,78 @@
+static struct fsr_info fsr_info[] = {
+       /*
+        * The following are the standard ARMv3 and ARMv4 aborts.  ARMv5
+        * defines these to be "precise" aborts.
+        */
+       { do_bad,               SIGSEGV, 0,             "vector exception"                 },
+       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment exception"              },
+       { do_bad,               SIGKILL, 0,             "terminal exception"               },
+       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment exception"              },
+       { do_bad,               SIGBUS,  0,             "external abort on linefetch"      },
+       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "section translation fault"        },
+       { do_bad,               SIGBUS,  0,             "external abort on linefetch"      },
+       { do_page_fault,        SIGSEGV, SEGV_MAPERR,   "page translation fault"           },
+       { do_bad,               SIGBUS,  0,             "external abort on non-linefetch"  },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "section domain fault"             },
+       { do_bad,               SIGBUS,  0,             "external abort on non-linefetch"  },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "page domain fault"                },
+       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
+       { do_sect_fault,        SIGSEGV, SEGV_ACCERR,   "section permission fault"         },
+       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
+       { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "page permission fault"            },
+       /*
+        * The following are "imprecise" aborts, which are signalled by bit
+        * 10 of the FSR, and may not be recoverable.  These are only
+        * supported if the CPU abort handler supports bit 10.
+        */
+       { do_bad,               SIGBUS,  0,             "unknown 16"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 17"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 18"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 19"                       },
+       { do_bad,               SIGBUS,  0,             "lock abort"                       }, /* xscale */
+       { do_bad,               SIGBUS,  0,             "unknown 21"                       },
+       { do_bad,               SIGBUS,  BUS_OBJERR,    "imprecise external abort"         }, /* xscale */
+       { do_bad,               SIGBUS,  0,             "unknown 23"                       },
+       { do_bad,               SIGBUS,  0,             "dcache parity error"              }, /* xscale */
+       { do_bad,               SIGBUS,  0,             "unknown 25"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 26"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 27"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 28"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 29"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 30"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 31"                       },
+};
+
+static struct fsr_info ifsr_info[] = {
+       { do_bad,               SIGBUS,  0,             "unknown 0"                        },
+       { do_bad,               SIGBUS,  0,             "unknown 1"                        },
+       { do_bad,               SIGBUS,  0,             "debug event"                      },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "section access flag fault"        },
+       { do_bad,               SIGBUS,  0,             "unknown 4"                        },
+       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "section translation fault"        },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "page access flag fault"           },
+       { do_page_fault,        SIGSEGV, SEGV_MAPERR,   "page translation fault"           },
+       { do_bad,               SIGBUS,  0,             "external abort on non-linefetch"  },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "section domain fault"             },
+       { do_bad,               SIGBUS,  0,             "unknown 10"                       },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "page domain fault"                },
+       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
+       { do_sect_fault,        SIGSEGV, SEGV_ACCERR,   "section permission fault"         },
+       { do_bad,               SIGBUS,  0,             "external abort on translation"    },
+       { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "page permission fault"            },
+       { do_bad,               SIGBUS,  0,             "unknown 16"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 17"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 18"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 19"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 20"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 21"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 22"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 23"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 24"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 25"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 26"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 27"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 28"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 29"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 30"                       },
+       { do_bad,               SIGBUS,  0,             "unknown 31"                       },
+};
diff --git a/arch/arm/mm/fsr-3level.c b/arch/arm/mm/fsr-3level.c
new file mode 100644 (file)
index 0000000..05a4e94
--- /dev/null
@@ -0,0 +1,68 @@
+static struct fsr_info fsr_info[] = {
+       { do_bad,               SIGBUS,  0,             "unknown 0"                     },
+       { do_bad,               SIGBUS,  0,             "unknown 1"                     },
+       { do_bad,               SIGBUS,  0,             "unknown 2"                     },
+       { do_bad,               SIGBUS,  0,             "unknown 3"                     },
+       { do_bad,               SIGBUS,  0,             "reserved translation fault"    },
+       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "level 1 translation fault"     },
+       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "level 2 translation fault"     },
+       { do_page_fault,        SIGSEGV, SEGV_MAPERR,   "level 3 translation fault"     },
+       { do_bad,               SIGBUS,  0,             "reserved access flag fault"    },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "level 1 access flag fault"     },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "level 2 access flag fault"     },
+       { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "level 3 access flag fault"     },
+       { do_bad,               SIGBUS,  0,             "reserved permission fault"     },
+       { do_bad,               SIGSEGV, SEGV_ACCERR,   "level 1 permission fault"      },
+       { do_sect_fault,        SIGSEGV, SEGV_ACCERR,   "level 2 permission fault"      },
+       { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "level 3 permission fault"      },
+       { do_bad,               SIGBUS,  0,             "synchronous external abort"    },
+       { do_bad,               SIGBUS,  0,             "asynchronous external abort"   },
+       { do_bad,               SIGBUS,  0,             "unknown 18"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 19"                    },
+       { do_bad,               SIGBUS,  0,             "synchronous abort (translation table walk)" },
+       { do_bad,               SIGBUS,  0,             "synchronous abort (translation table walk)" },
+       { do_bad,               SIGBUS,  0,             "synchronous abort (translation table walk)" },
+       { do_bad,               SIGBUS,  0,             "synchronous abort (translation table walk)" },
+       { do_bad,               SIGBUS,  0,             "synchronous parity error"      },
+       { do_bad,               SIGBUS,  0,             "asynchronous parity error"     },
+       { do_bad,               SIGBUS,  0,             "unknown 26"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 27"                    },
+       { do_bad,               SIGBUS,  0,             "synchronous parity error (translation table walk" },
+       { do_bad,               SIGBUS,  0,             "synchronous parity error (translation table walk" },
+       { do_bad,               SIGBUS,  0,             "synchronous parity error (translation table walk" },
+       { do_bad,               SIGBUS,  0,             "synchronous parity error (translation table walk" },
+       { do_bad,               SIGBUS,  0,             "unknown 32"                    },
+       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment fault"               },
+       { do_bad,               SIGBUS,  0,             "debug event"                   },
+       { do_bad,               SIGBUS,  0,             "unknown 35"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 36"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 37"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 38"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 39"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 40"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 41"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 42"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 43"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 44"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 45"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 46"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 47"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 48"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 49"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 50"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 51"                    },
+       { do_bad,               SIGBUS,  0,             "implementation fault (lockdown abort)" },
+       { do_bad,               SIGBUS,  0,             "unknown 53"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 54"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 55"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 56"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 57"                    },
+       { do_bad,               SIGBUS,  0,             "implementation fault (coprocessor abort)" },
+       { do_bad,               SIGBUS,  0,             "unknown 59"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 60"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 61"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 62"                    },
+       { do_bad,               SIGBUS,  0,             "unknown 63"                    },
+};
+
+#define ifsr_info      fsr_info
index 2be9139a4ef3cc5af97f03a30eefefe7d019740e..feacf4c7671236faf8f343002f1a5a4f601c3d4b 100644 (file)
@@ -1,9 +1,38 @@
 #include <linux/kernel.h>
 
 #include <asm/cputype.h>
+#include <asm/idmap.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
+#include <asm/sections.h>
 
+pgd_t *idmap_pgd;
+
+#ifdef CONFIG_ARM_LPAE
+static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
+       unsigned long prot)
+{
+       pmd_t *pmd;
+       unsigned long next;
+
+       if (pud_none_or_clear_bad(pud) || (pud_val(*pud) & L_PGD_SWAPPER)) {
+               pmd = pmd_alloc_one(&init_mm, addr);
+               if (!pmd) {
+                       pr_warning("Failed to allocate identity pmd.\n");
+                       return;
+               }
+               pud_populate(&init_mm, pud, pmd);
+               pmd += pmd_index(addr);
+       } else
+               pmd = pmd_offset(pud, addr);
+
+       do {
+               next = pmd_addr_end(addr, end);
+               *pmd = __pmd((addr & PMD_MASK) | prot);
+               flush_pmd_entry(pmd);
+       } while (pmd++, addr = next, addr != end);
+}
+#else  /* !CONFIG_ARM_LPAE */
 static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
        unsigned long prot)
 {
@@ -15,6 +44,7 @@ static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
        pmd[1] = __pmd(addr);
        flush_pmd_entry(pmd);
 }
+#endif /* CONFIG_ARM_LPAE */
 
 static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
        unsigned long prot)
@@ -28,11 +58,11 @@ static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
        } while (pud++, addr = next, addr != end);
 }
 
-void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
+static void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
 {
        unsigned long prot, next;
 
-       prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE;
+       prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF;
        if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
                prot |= PMD_BIT4;
 
@@ -43,48 +73,41 @@ void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
        } while (pgd++, addr = next, addr != end);
 }
 
-#ifdef CONFIG_SMP
-static void idmap_del_pmd(pud_t *pud, unsigned long addr, unsigned long end)
-{
-       pmd_t *pmd = pmd_offset(pud, addr);
-       pmd_clear(pmd);
-}
+extern char  __idmap_text_start[], __idmap_text_end[];
 
-static void idmap_del_pud(pgd_t *pgd, unsigned long addr, unsigned long end)
+static int __init init_static_idmap(void)
 {
-       pud_t *pud = pud_offset(pgd, addr);
-       unsigned long next;
+       phys_addr_t idmap_start, idmap_end;
 
-       do {
-               next = pud_addr_end(addr, end);
-               idmap_del_pmd(pud, addr, next);
-       } while (pud++, addr = next, addr != end);
-}
+       idmap_pgd = pgd_alloc(&init_mm);
+       if (!idmap_pgd)
+               return -ENOMEM;
 
-void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)
-{
-       unsigned long next;
+       /* Add an identity mapping for the physical address of the section. */
+       idmap_start = virt_to_phys((void *)__idmap_text_start);
+       idmap_end = virt_to_phys((void *)__idmap_text_end);
 
-       pgd += pgd_index(addr);
-       do {
-               next = pgd_addr_end(addr, end);
-               idmap_del_pud(pgd, addr, next);
-       } while (pgd++, addr = next, addr != end);
+       pr_info("Setting up static identity map for 0x%llx - 0x%llx\n",
+               (long long)idmap_start, (long long)idmap_end);
+       identity_mapping_add(idmap_pgd, idmap_start, idmap_end);
+
+       return 0;
 }
-#endif
+early_initcall(init_static_idmap);
 
 /*
- * In order to soft-boot, we need to insert a 1:1 mapping in place of
- * the user-mode pages.  This will then ensure that we have predictable
- * results when turning the mmu off
+ * In order to soft-boot, we need to switch to a 1:1 mapping for the
+ * cpu_reset functions. This will then ensure that we have predictable
+ * results when turning off the mmu.
  */
-void setup_mm_for_reboot(char mode)
+void setup_mm_for_reboot(void)
 {
-       /*
-        * We need to access to user-mode page tables here. For kernel threads
-        * we don't have any user-mode mappings so we use the context that we
-        * "borrowed".
-        */
-       identity_mapping_add(current->active_mm->pgd, 0, TASK_SIZE);
+       /* Clean and invalidate L1. */
+       flush_cache_all();
+
+       /* Switch to the identity mapping. */
+       cpu_switch_mm(idmap_pgd, &init_mm);
+
+       /* Flush the TLB. */
        local_flush_tlb_all();
 }
index fbdd12ea3a587a146497f9e560d28d86c52fca45..786adddf1a86c70cd1087a7341c79b49bf03ca6b 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/highmem.h>
 #include <linux/gfp.h>
 #include <linux/memblock.h>
-#include <linux/sort.h>
 
 #include <asm/mach-types.h>
 #include <asm/prom.h>
@@ -134,30 +133,18 @@ void show_mem(unsigned int filter)
 }
 
 static void __init find_limits(unsigned long *min, unsigned long *max_low,
-       unsigned long *max_high)
+                              unsigned long *max_high)
 {
        struct meminfo *mi = &meminfo;
        int i;
 
-       *min = -1UL;
-       *max_low = *max_high = 0;
-
-       for_each_bank (i, mi) {
-               struct membank *bank = &mi->bank[i];
-               unsigned long start, end;
-
-               start = bank_pfn_start(bank);
-               end = bank_pfn_end(bank);
-
-               if (*min > start)
-                       *min = start;
-               if (*max_high < end)
-                       *max_high = end;
-               if (bank->highmem)
-                       continue;
-               if (*max_low < end)
-                       *max_low = end;
-       }
+       /* This assumes the meminfo array is properly sorted */
+       *min = bank_pfn_start(&mi->bank[0]);
+       for_each_bank (i, mi)
+               if (mi->bank[i].highmem)
+                               break;
+       *max_low = bank_pfn_end(&mi->bank[i - 1]);
+       *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
 }
 
 static void __init arm_bootmem_init(unsigned long start_pfn,
@@ -319,19 +306,10 @@ static void arm_memory_present(void)
 }
 #endif
 
-static int __init meminfo_cmp(const void *_a, const void *_b)
-{
-       const struct membank *a = _a, *b = _b;
-       long cmp = bank_pfn_start(a) - bank_pfn_start(b);
-       return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
 void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
 {
        int i;
 
-       sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
-
        memblock_init();
        for (i = 0; i < mi->nr_banks; i++)
                memblock_add(mi->bank[i].start, mi->bank[i].size);
@@ -403,8 +381,6 @@ void __init bootmem_init(void)
         */
        arm_bootmem_free(min, max_low, max_high);
 
-       high_memory = __va(((phys_addr_t)max_low << PAGE_SHIFT) - 1) + 1;
-
        /*
         * This doesn't seem to be used by the Linux memory manager any
         * more, but is used by ll_rw_block.  If we can get rid of it, we
index bdb248c4f55cdb923f7f4da2f59e9bfd08562933..80632e8d7538f33d5a6539df5a72a90fff52e7ec 100644 (file)
 #include <asm/mach/map.h>
 #include "mm.h"
 
-/*
- * Used by ioremap() and iounmap() code to mark (super)section-mapped
- * I/O regions in vm_struct->flags field.
- */
-#define VM_ARM_SECTION_MAPPING 0x80000000
-
 int ioremap_page(unsigned long virt, unsigned long phys,
                 const struct mem_type *mtype)
 {
@@ -64,7 +58,7 @@ void __check_kvm_seq(struct mm_struct *mm)
        } while (seq != init_mm.context.kvm_seq);
 }
 
-#ifndef CONFIG_SMP
+#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
 /*
  * Section support is unsafe on SMP - If you iounmap and ioremap a region,
  * the other CPUs will not see this change until their next context switch.
@@ -79,13 +73,16 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
 {
        unsigned long addr = virt, end = virt + (size & ~(SZ_1M - 1));
        pgd_t *pgd;
+       pud_t *pud;
+       pmd_t *pmdp;
 
        flush_cache_vunmap(addr, end);
        pgd = pgd_offset_k(addr);
+       pud = pud_offset(pgd, addr);
+       pmdp = pmd_offset(pud, addr);
        do {
-               pmd_t pmd, *pmdp = pmd_offset(pgd, addr);
+               pmd_t pmd = *pmdp;
 
-               pmd = *pmdp;
                if (!pmd_none(pmd)) {
                        /*
                         * Clear the PMD from the page table, and
@@ -104,8 +101,8 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
                                pte_free_kernel(&init_mm, pmd_page_vaddr(pmd));
                }
 
-               addr += PGDIR_SIZE;
-               pgd++;
+               addr += PMD_SIZE;
+               pmdp += 2;
        } while (addr < end);
 
        /*
@@ -124,6 +121,8 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
 {
        unsigned long addr = virt, end = virt + size;
        pgd_t *pgd;
+       pud_t *pud;
+       pmd_t *pmd;
 
        /*
         * Remove and free any PTE-based mapping, and
@@ -132,17 +131,17 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
        unmap_area_sections(virt, size);
 
        pgd = pgd_offset_k(addr);
+       pud = pud_offset(pgd, addr);
+       pmd = pmd_offset(pud, addr);
        do {
-               pmd_t *pmd = pmd_offset(pgd, addr);
-
                pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
                pfn += SZ_1M >> PAGE_SHIFT;
                pmd[1] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
                pfn += SZ_1M >> PAGE_SHIFT;
                flush_pmd_entry(pmd);
 
-               addr += PGDIR_SIZE;
-               pgd++;
+               addr += PMD_SIZE;
+               pmd += 2;
        } while (addr < end);
 
        return 0;
@@ -154,6 +153,8 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
 {
        unsigned long addr = virt, end = virt + size;
        pgd_t *pgd;
+       pud_t *pud;
+       pmd_t *pmd;
 
        /*
         * Remove and free any PTE-based mapping, and
@@ -162,6 +163,8 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
        unmap_area_sections(virt, size);
 
        pgd = pgd_offset_k(virt);
+       pud = pud_offset(pgd, addr);
+       pmd = pmd_offset(pud, addr);
        do {
                unsigned long super_pmd_val, i;
 
@@ -170,14 +173,12 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
                super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20;
 
                for (i = 0; i < 8; i++) {
-                       pmd_t *pmd = pmd_offset(pgd, addr);
-
                        pmd[0] = __pmd(super_pmd_val);
                        pmd[1] = __pmd(super_pmd_val);
                        flush_pmd_entry(pmd);
 
-                       addr += PGDIR_SIZE;
-                       pgd++;
+                       addr += PMD_SIZE;
+                       pmd += 2;
                }
 
                pfn += SUPERSECTION_SIZE >> PAGE_SHIFT;
@@ -195,17 +196,13 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
        unsigned long addr;
        struct vm_struct * area;
 
+#ifndef CONFIG_ARM_LPAE
        /*
         * High mappings must be supersection aligned
         */
        if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
                return NULL;
-
-       /*
-        * Don't allow RAM to be mapped - this causes problems with ARMv6+
-        */
-       if (WARN_ON(pfn_valid(pfn)))
-               return NULL;
+#endif
 
        type = get_mem_type(mtype);
        if (!type)
@@ -216,12 +213,40 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
         */
        size = PAGE_ALIGN(offset + size);
 
+       /*
+        * Try to reuse one of the static mapping whenever possible.
+        */
+       read_lock(&vmlist_lock);
+       for (area = vmlist; area; area = area->next) {
+               if (!size || (sizeof(phys_addr_t) == 4 && pfn >= 0x100000))
+                       break;
+               if (!(area->flags & VM_ARM_STATIC_MAPPING))
+                       continue;
+               if ((area->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))
+                       continue;
+               if (__phys_to_pfn(area->phys_addr) > pfn ||
+                   __pfn_to_phys(pfn) + size-1 > area->phys_addr + area->size-1)
+                       continue;
+               /* we can drop the lock here as we know *area is static */
+               read_unlock(&vmlist_lock);
+               addr = (unsigned long)area->addr;
+               addr += __pfn_to_phys(pfn) - area->phys_addr;
+               return (void __iomem *) (offset + addr);
+       }
+       read_unlock(&vmlist_lock);
+
+       /*
+        * Don't allow RAM to be mapped - this causes problems with ARMv6+
+        */
+       if (WARN_ON(pfn_valid(pfn)))
+               return NULL;
+
        area = get_vm_area_caller(size, VM_IOREMAP, caller);
        if (!area)
                return NULL;
        addr = (unsigned long)area->addr;
 
-#ifndef CONFIG_SMP
+#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
        if (DOMAIN_IO == 0 &&
            (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
               cpu_is_xsc3()) && pfn >= 0x100000 &&
@@ -313,28 +338,34 @@ __arm_ioremap_exec(unsigned long phys_addr, size_t size, bool cached)
 void __iounmap(volatile void __iomem *io_addr)
 {
        void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
-#ifndef CONFIG_SMP
-       struct vm_struct **p, *tmp;
+       struct vm_struct *vm;
 
-       /*
-        * If this is a section based mapping we need to handle it
-        * specially as the VM subsystem does not know how to handle
-        * such a beast. We need the lock here b/c we need to clear
-        * all the mappings before the area can be reclaimed
-        * by someone else.
-        */
-       write_lock(&vmlist_lock);
-       for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) {
-               if ((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) {
-                       if (tmp->flags & VM_ARM_SECTION_MAPPING) {
-                               unmap_area_sections((unsigned long)tmp->addr,
-                                                   tmp->size);
-                       }
+       read_lock(&vmlist_lock);
+       for (vm = vmlist; vm; vm = vm->next) {
+               if (vm->addr > addr)
+                       break;
+               if (!(vm->flags & VM_IOREMAP))
+                       continue;
+               /* If this is a static mapping we must leave it alone */
+               if ((vm->flags & VM_ARM_STATIC_MAPPING) &&
+                   (vm->addr <= addr) && (vm->addr + vm->size > addr)) {
+                       read_unlock(&vmlist_lock);
+                       return;
+               }
+#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
+               /*
+                * If this is a section based mapping we need to handle it
+                * specially as the VM subsystem does not know how to handle
+                * such a beast.
+                */
+               if ((vm->addr == addr) &&
+                   (vm->flags & VM_ARM_SECTION_MAPPING)) {
+                       unmap_area_sections((unsigned long)vm->addr, vm->size);
                        break;
                }
-       }
-       write_unlock(&vmlist_lock);
 #endif
+       }
+       read_unlock(&vmlist_lock);
 
        vunmap(addr);
 }
index ad7cce3bc431bfda3060f98ea067bd4c5bb339e3..70f6d3ea48340fb7d8ac2aa6d8e9046a467117c8 100644 (file)
@@ -21,6 +21,20 @@ const struct mem_type *get_mem_type(unsigned int type);
 
 extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
 
+/*
+ * ARM specific vm_struct->flags bits.
+ */
+
+/* (super)section-mapped I/O regions used by ioremap()/iounmap() */
+#define VM_ARM_SECTION_MAPPING 0x80000000
+
+/* permanent static mappings from iotable_init() */
+#define VM_ARM_STATIC_MAPPING  0x40000000
+
+/* mapping type (attributes) for permanent static mappings */
+#define VM_ARM_MTYPE(mt)               ((mt) << 20)
+#define VM_ARM_MTYPE_MASK      (0x1f << 20)
+
 #endif
 
 #ifdef CONFIG_ZONE_DMA
index 44b628e4d6ea9c0121acf892ffbcfb30d0fc40ad..ce8cb1970d7ae393da39208c929e8a1d983f91c2 100644 (file)
 #include <linux/random.h>
 #include <asm/cachetype.h>
 
+static inline unsigned long COLOUR_ALIGN_DOWN(unsigned long addr,
+                                             unsigned long pgoff)
+{
+       unsigned long base = addr & ~(SHMLBA-1);
+       unsigned long off = (pgoff << PAGE_SHIFT) & (SHMLBA-1);
+
+       if (base + off <= addr)
+               return base + off;
+
+       return base - off;
+}
+
 #define COLOUR_ALIGN(addr,pgoff)               \
        ((((addr)+SHMLBA-1)&~(SHMLBA-1)) +      \
         (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1)))
 
+/* gap between mmap and stack */
+#define MIN_GAP (128*1024*1024UL)
+#define MAX_GAP ((TASK_SIZE)/6*5)
+
+static int mmap_is_legacy(void)
+{
+       if (current->personality & ADDR_COMPAT_LAYOUT)
+               return 1;
+
+       if (rlimit(RLIMIT_STACK) == RLIM_INFINITY)
+               return 1;
+
+       return sysctl_legacy_va_layout;
+}
+
+static unsigned long mmap_base(unsigned long rnd)
+{
+       unsigned long gap = rlimit(RLIMIT_STACK);
+
+       if (gap < MIN_GAP)
+               gap = MIN_GAP;
+       else if (gap > MAX_GAP)
+               gap = MAX_GAP;
+
+       return PAGE_ALIGN(TASK_SIZE - gap - rnd);
+}
+
 /*
  * We need to ensure that shared mappings are correctly aligned to
  * avoid aliasing issues with VIPT caches.  We need to ensure that
@@ -68,13 +107,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
        if (len > mm->cached_hole_size) {
                start_addr = addr = mm->free_area_cache;
        } else {
-               start_addr = addr = TASK_UNMAPPED_BASE;
+               start_addr = addr = mm->mmap_base;
                mm->cached_hole_size = 0;
        }
-       /* 8 bits of randomness in 20 address space bits */
-       if ((current->flags & PF_RANDOMIZE) &&
-           !(current->personality & ADDR_NO_RANDOMIZE))
-               addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT;
 
 full_search:
        if (do_align)
@@ -111,6 +146,134 @@ full_search:
        }
 }
 
+unsigned long
+arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+                       const unsigned long len, const unsigned long pgoff,
+                       const unsigned long flags)
+{
+       struct vm_area_struct *vma;
+       struct mm_struct *mm = current->mm;
+       unsigned long addr = addr0;
+       int do_align = 0;
+       int aliasing = cache_is_vipt_aliasing();
+
+       /*
+        * We only need to do colour alignment if either the I or D
+        * caches alias.
+        */
+       if (aliasing)
+               do_align = filp || (flags & MAP_SHARED);
+
+       /* requested length too big for entire address space */
+       if (len > TASK_SIZE)
+               return -ENOMEM;
+
+       if (flags & MAP_FIXED) {
+               if (aliasing && flags & MAP_SHARED &&
+                   (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))
+                       return -EINVAL;
+               return addr;
+       }
+
+       /* requesting a specific address */
+       if (addr) {
+               if (do_align)
+                       addr = COLOUR_ALIGN(addr, pgoff);
+               else
+                       addr = PAGE_ALIGN(addr);
+               vma = find_vma(mm, addr);
+               if (TASK_SIZE - len >= addr &&
+                               (!vma || addr + len <= vma->vm_start))
+                       return addr;
+       }
+
+       /* check if free_area_cache is useful for us */
+       if (len <= mm->cached_hole_size) {
+               mm->cached_hole_size = 0;
+               mm->free_area_cache = mm->mmap_base;
+       }
+
+       /* either no address requested or can't fit in requested address hole */
+       addr = mm->free_area_cache;
+       if (do_align) {
+               unsigned long base = COLOUR_ALIGN_DOWN(addr - len, pgoff);
+               addr = base + len;
+       }
+
+       /* make sure it can fit in the remaining address space */
+       if (addr > len) {
+               vma = find_vma(mm, addr-len);
+               if (!vma || addr <= vma->vm_start)
+                       /* remember the address as a hint for next time */
+                       return (mm->free_area_cache = addr-len);
+       }
+
+       if (mm->mmap_base < len)
+               goto bottomup;
+
+       addr = mm->mmap_base - len;
+       if (do_align)
+               addr = COLOUR_ALIGN_DOWN(addr, pgoff);
+
+       do {
+               /*
+                * Lookup failure means no vma is above this address,
+                * else if new region fits below vma->vm_start,
+                * return with success:
+                */
+               vma = find_vma(mm, addr);
+               if (!vma || addr+len <= vma->vm_start)
+                       /* remember the address as a hint for next time */
+                       return (mm->free_area_cache = addr);
+
+               /* remember the largest hole we saw so far */
+               if (addr + mm->cached_hole_size < vma->vm_start)
+                       mm->cached_hole_size = vma->vm_start - addr;
+
+               /* try just below the current vma->vm_start */
+               addr = vma->vm_start - len;
+               if (do_align)
+                       addr = COLOUR_ALIGN_DOWN(addr, pgoff);
+       } while (len < vma->vm_start);
+
+bottomup:
+       /*
+        * A failed mmap() very likely causes application failure,
+        * so fall back to the bottom-up function here. This scenario
+        * can happen with large stack limits and large mmap()
+        * allocations.
+        */
+       mm->cached_hole_size = ~0UL;
+       mm->free_area_cache = TASK_UNMAPPED_BASE;
+       addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
+       /*
+        * Restore the topdown base:
+        */
+       mm->free_area_cache = mm->mmap_base;
+       mm->cached_hole_size = ~0UL;
+
+       return addr;
+}
+
+void arch_pick_mmap_layout(struct mm_struct *mm)
+{
+       unsigned long random_factor = 0UL;
+
+       /* 8 bits of randomness in 20 address space bits */
+       if ((current->flags & PF_RANDOMIZE) &&
+           !(current->personality & ADDR_NO_RANDOMIZE))
+               random_factor = (get_random_int() % (1 << 8)) << PAGE_SHIFT;
+
+       if (mmap_is_legacy()) {
+               mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
+               mm->get_unmapped_area = arch_get_unmapped_area;
+               mm->unmap_area = arch_unmap_area;
+       } else {
+               mm->mmap_base = mmap_base(random_factor);
+               mm->get_unmapped_area = arch_get_unmapped_area_topdown;
+               mm->unmap_area = arch_unmap_area_topdown;
+       }
+}
 
 /*
  * You really shouldn't be using read() or write() on /dev/mem.  This
index dc8c550e6cbde82ae786488dadc33d92550c1d0c..94c5a0c94f5e2e9a19da0509b5717004188ee31a 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/nodemask.h>
 #include <linux/memblock.h>
 #include <linux/fs.h>
+#include <linux/vmalloc.h>
 
 #include <asm/cputype.h>
 #include <asm/sections.h>
@@ -150,6 +151,7 @@ static int __init early_nowrite(char *__unused)
 }
 early_param("nowb", early_nowrite);
 
+#ifndef CONFIG_ARM_LPAE
 static int __init early_ecc(char *p)
 {
        if (memcmp(p, "on", 2) == 0)
@@ -159,6 +161,7 @@ static int __init early_ecc(char *p)
        return 0;
 }
 early_param("ecc", early_ecc);
+#endif
 
 static int __init noalign_setup(char *__unused)
 {
@@ -228,10 +231,12 @@ static struct mem_type mem_types[] = {
                .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
                .domain    = DOMAIN_KERNEL,
        },
+#ifndef CONFIG_ARM_LPAE
        [MT_MINICLEAN] = {
                .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE,
                .domain    = DOMAIN_KERNEL,
        },
+#endif
        [MT_LOW_VECTORS] = {
                .prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
                                L_PTE_RDONLY,
@@ -429,6 +434,7 @@ static void __init build_mem_type_table(void)
         * ARMv6 and above have extended page tables.
         */
        if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
+#ifndef CONFIG_ARM_LPAE
                /*
                 * Mark cache clean areas and XIP ROM read only
                 * from SVC mode and no access from userspace.
@@ -436,6 +442,7 @@ static void __init build_mem_type_table(void)
                mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
                mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
                mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
+#endif
 
                if (is_smp()) {
                        /*
@@ -474,6 +481,18 @@ static void __init build_mem_type_table(void)
                mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE;
        }
 
+#ifdef CONFIG_ARM_LPAE
+       /*
+        * Do not generate access flag faults for the kernel mappings.
+        */
+       for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
+               mem_types[i].prot_pte |= PTE_EXT_AF;
+               mem_types[i].prot_sect |= PMD_SECT_AF;
+       }
+       kern_pgprot |= PTE_EXT_AF;
+       vecs_pgprot |= PTE_EXT_AF;
+#endif
+
        for (i = 0; i < 16; i++) {
                unsigned long v = pgprot_val(protection_map[i]);
                protection_map[i] = __pgprot(v | user_pgprot);
@@ -529,13 +548,18 @@ EXPORT_SYMBOL(phys_mem_access_prot);
 
 #define vectors_base() (vectors_high() ? 0xffff0000 : 0)
 
-static void __init *early_alloc(unsigned long sz)
+static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
 {
-       void *ptr = __va(memblock_alloc(sz, sz));
+       void *ptr = __va(memblock_alloc(sz, align));
        memset(ptr, 0, sz);
        return ptr;
 }
 
+static void __init *early_alloc(unsigned long sz)
+{
+       return early_alloc_aligned(sz, sz);
+}
+
 static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)
 {
        if (pmd_none(*pmd)) {
@@ -572,8 +596,10 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
        if (((addr | end | phys) & ~SECTION_MASK) == 0) {
                pmd_t *p = pmd;
 
+#ifndef CONFIG_ARM_LPAE
                if (addr & SECTION_SIZE)
                        pmd++;
+#endif
 
                do {
                        *pmd = __pmd(phys | type->prot_sect);
@@ -603,6 +629,7 @@ static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
        } while (pud++, addr = next, addr != end);
 }
 
+#ifndef CONFIG_ARM_LPAE
 static void __init create_36bit_mapping(struct map_desc *md,
                                        const struct mem_type *type)
 {
@@ -662,6 +689,7 @@ static void __init create_36bit_mapping(struct map_desc *md,
                pgd += SUPERSECTION_SIZE >> PGDIR_SHIFT;
        } while (addr != end);
 }
+#endif /* !CONFIG_ARM_LPAE */
 
 /*
  * Create the page directory entries and any necessary
@@ -685,14 +713,16 @@ static void __init create_mapping(struct map_desc *md)
        }
 
        if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
-           md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {
+           md->virtual >= PAGE_OFFSET &&
+           (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {
                printk(KERN_WARNING "BUG: mapping for 0x%08llx"
-                      " at 0x%08lx overlaps vmalloc space\n",
+                      " at 0x%08lx out of vmalloc space\n",
                       (long long)__pfn_to_phys((u64)md->pfn), md->virtual);
        }
 
        type = &mem_types[md->type];
 
+#ifndef CONFIG_ARM_LPAE
        /*
         * Catch 36-bit addresses
         */
@@ -700,6 +730,7 @@ static void __init create_mapping(struct map_desc *md)
                create_36bit_mapping(md, type);
                return;
        }
+#endif
 
        addr = md->virtual & PAGE_MASK;
        phys = __pfn_to_phys(md->pfn);
@@ -729,18 +760,33 @@ static void __init create_mapping(struct map_desc *md)
  */
 void __init iotable_init(struct map_desc *io_desc, int nr)
 {
-       int i;
+       struct map_desc *md;
+       struct vm_struct *vm;
+
+       if (!nr)
+               return;
 
-       for (i = 0; i < nr; i++)
-               create_mapping(io_desc + i);
+       vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm));
+
+       for (md = io_desc; nr; md++, nr--) {
+               create_mapping(md);
+               vm->addr = (void *)(md->virtual & PAGE_MASK);
+               vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
+               vm->phys_addr = __pfn_to_phys(md->pfn); 
+               vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; 
+               vm->flags |= VM_ARM_MTYPE(md->type);
+               vm->caller = iotable_init;
+               vm_area_add_early(vm++);
+       }
 }
 
-static void * __initdata vmalloc_min = (void *)(VMALLOC_END - SZ_128M);
+static void * __initdata vmalloc_min =
+       (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
 
 /*
  * vmalloc=size forces the vmalloc area to be exactly 'size'
  * bytes. This can be used to increase (or decrease) the vmalloc
- * area - the default is 128m.
+ * area - the default is 240m.
  */
 static int __init early_vmalloc(char *arg)
 {
@@ -775,6 +821,9 @@ void __init sanity_check_meminfo(void)
                struct membank *bank = &meminfo.bank[j];
                *bank = meminfo.bank[i];
 
+               if (bank->start > ULONG_MAX)
+                       highmem = 1;
+
 #ifdef CONFIG_HIGHMEM
                if (__va(bank->start) >= vmalloc_min ||
                    __va(bank->start) < (void *)PAGE_OFFSET)
@@ -786,7 +835,7 @@ void __init sanity_check_meminfo(void)
                 * Split those memory banks which are partially overlapping
                 * the vmalloc area greatly simplifying things later.
                 */
-               if (__va(bank->start) < vmalloc_min &&
+               if (!highmem && __va(bank->start) < vmalloc_min &&
                    bank->size > vmalloc_min - __va(bank->start)) {
                        if (meminfo.nr_banks >= NR_BANKS) {
                                printk(KERN_CRIT "NR_BANKS too low, "
@@ -806,6 +855,17 @@ void __init sanity_check_meminfo(void)
 #else
                bank->highmem = highmem;
 
+               /*
+                * Highmem banks not allowed with !CONFIG_HIGHMEM.
+                */
+               if (highmem) {
+                       printk(KERN_NOTICE "Ignoring RAM at %.8llx-%.8llx "
+                              "(!CONFIG_HIGHMEM).\n",
+                              (unsigned long long)bank->start,
+                              (unsigned long long)bank->start + bank->size - 1);
+                       continue;
+               }
+
                /*
                 * Check whether this memory bank would entirely overlap
                 * the vmalloc area.
@@ -860,6 +920,7 @@ void __init sanity_check_meminfo(void)
        }
 #endif
        meminfo.nr_banks = j;
+       high_memory = __va(lowmem_limit - 1) + 1;
        memblock_set_current_limit(lowmem_limit);
 }
 
@@ -890,14 +951,20 @@ static inline void prepare_page_table(void)
 
        /*
         * Clear out all the kernel space mappings, except for the first
-        * memory bank, up to the end of the vmalloc region.
+        * memory bank, up to the vmalloc region.
         */
        for (addr = __phys_to_virt(end);
-            addr < VMALLOC_END; addr += PMD_SIZE)
+            addr < VMALLOC_START; addr += PMD_SIZE)
                pmd_clear(pmd_off_k(addr));
 }
 
+#ifdef CONFIG_ARM_LPAE
+/* the first page is reserved for pgd */
+#define SWAPPER_PG_DIR_SIZE    (PAGE_SIZE + \
+                                PTRS_PER_PGD * PTRS_PER_PMD * sizeof(pmd_t))
+#else
 #define SWAPPER_PG_DIR_SIZE    (PTRS_PER_PGD * sizeof(pgd_t))
+#endif
 
 /*
  * Reserve the special regions of memory
@@ -920,8 +987,8 @@ void __init arm_mm_memblock_reserve(void)
 }
 
 /*
- * Set up device the mappings.  Since we clear out the page tables for all
- * mappings above VMALLOC_END, we will remove any debug device mappings.
+ * Set up the device mappings.  Since we clear out the page tables for all
+ * mappings above VMALLOC_START, we will remove any debug device mappings.
  * This means you have to be careful how you debug this function, or any
  * called function.  This means you can't use any function or debugging
  * method which may touch any device, otherwise the kernel _will_ crash.
@@ -936,7 +1003,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
         */
        vectors_page = early_alloc(PAGE_SIZE);
 
-       for (addr = VMALLOC_END; addr; addr += PMD_SIZE)
+       for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
                pmd_clear(pmd_off_k(addr));
 
        /*
index 941a98c9e8aaf327b5131227ccaddb1d697ad2e5..4fc6794cca4bfd0d0364000119df7722c6c85c8b 100644 (file)
@@ -29,6 +29,8 @@ void __init arm_mm_memblock_reserve(void)
 
 void __init sanity_check_meminfo(void)
 {
+       phys_addr_t end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);
+       high_memory = __va(end - 1) + 1;
 }
 
 /*
@@ -43,7 +45,7 @@ void __init paging_init(struct machine_desc *mdesc)
 /*
  * We don't need to do anything here for nommu machines.
  */
-void setup_mm_for_reboot(char mode)
+void setup_mm_for_reboot(void)
 {
 }
 
index b2027c154b2a0c946198de99370a89be2f60b6eb..a3e78ccabd655ef871c74b66b6a277eee29290d6 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/mm.h>
 #include <linux/gfp.h>
 #include <linux/highmem.h>
+#include <linux/slab.h>
 
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 
 #include "mm.h"
 
+#ifdef CONFIG_ARM_LPAE
+#define __pgd_alloc()  kmalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL)
+#define __pgd_free(pgd)        kfree(pgd)
+#else
+#define __pgd_alloc()  (pgd_t *)__get_free_pages(GFP_KERNEL, 2)
+#define __pgd_free(pgd)        free_pages((unsigned long)pgd, 2)
+#endif
+
 /*
  * need to get a 16k page for level 1
  */
@@ -27,7 +36,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
        pmd_t *new_pmd, *init_pmd;
        pte_t *new_pte, *init_pte;
 
-       new_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL, 2);
+       new_pgd = __pgd_alloc();
        if (!new_pgd)
                goto no_pgd;
 
@@ -42,10 +51,25 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 
        clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
 
+#ifdef CONFIG_ARM_LPAE
+       /*
+        * Allocate PMD table for modules and pkmap mappings.
+        */
+       new_pud = pud_alloc(mm, new_pgd + pgd_index(MODULES_VADDR),
+                           MODULES_VADDR);
+       if (!new_pud)
+               goto no_pud;
+
+       new_pmd = pmd_alloc(mm, new_pud, 0);
+       if (!new_pmd)
+               goto no_pmd;
+#endif
+
        if (!vectors_high()) {
                /*
                 * On ARM, first page must always be allocated since it
-                * contains the machine vectors.
+                * contains the machine vectors. The vectors are always high
+                * with LPAE.
                 */
                new_pud = pud_alloc(mm, new_pgd, 0);
                if (!new_pud)
@@ -74,7 +98,7 @@ no_pte:
 no_pmd:
        pud_free(mm, new_pud);
 no_pud:
-       free_pages((unsigned long)new_pgd, 2);
+       __pgd_free(new_pgd);
 no_pgd:
        return NULL;
 }
@@ -111,5 +135,24 @@ no_pud:
        pgd_clear(pgd);
        pud_free(mm, pud);
 no_pgd:
-       free_pages((unsigned long) pgd_base, 2);
+#ifdef CONFIG_ARM_LPAE
+       /*
+        * Free modules/pkmap or identity pmd tables.
+        */
+       for (pgd = pgd_base; pgd < pgd_base + PTRS_PER_PGD; pgd++) {
+               if (pgd_none_or_clear_bad(pgd))
+                       continue;
+               if (pgd_val(*pgd) & L_PGD_SWAPPER)
+                       continue;
+               pud = pud_offset(pgd, 0);
+               if (pud_none_or_clear_bad(pud))
+                       continue;
+               pmd = pmd_offset(pud, 0);
+               pud_clear(pud);
+               pmd_free(mm, pmd);
+               pgd_clear(pgd);
+               pud_free(mm, pud);
+       }
+#endif
+       __pgd_free(pgd_base);
 }
index 67469665d47ab48a4d8684f2d881af0df4c12e28..234951345eb3de1d5a806794819ecc437b8ee924 100644 (file)
@@ -95,6 +95,7 @@ ENTRY(cpu_arm1020_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm1020_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -107,6 +108,8 @@ ENTRY(cpu_arm1020_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm1020_reset)
+       .popsection
 
 /*
  * cpu_arm1020_do_idle()
index 4251421c0ed50c1af75f320b509ae7faff38b833..c244b06caac9630679f11403a1f60bc0617799a8 100644 (file)
@@ -95,6 +95,7 @@ ENTRY(cpu_arm1020e_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm1020e_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -107,6 +108,8 @@ ENTRY(cpu_arm1020e_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm1020e_reset)
+       .popsection
 
 /*
  * cpu_arm1020e_do_idle()
index d283cf3d06e3a51481724fa1bafe5d27798ed7b0..38fe22efd18fc804951b85c22480dd294e4a4790 100644 (file)
@@ -84,6 +84,7 @@ ENTRY(cpu_arm1022_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm1022_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -96,6 +97,8 @@ ENTRY(cpu_arm1022_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm1022_reset)
+       .popsection
 
 /*
  * cpu_arm1022_do_idle()
index 678a1ceafed239ab10651bb2ae556b08e35a2d29..3eb9c3c26c75ac7128585e64316ede8f1662b85f 100644 (file)
@@ -84,6 +84,7 @@ ENTRY(cpu_arm1026_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm1026_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -96,6 +97,8 @@ ENTRY(cpu_arm1026_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm1026_reset)
+       .popsection
 
 /*
  * cpu_arm1026_do_idle()
index e5b974cddac38ec185cf55e9407df52761fda084..4fbeb5b8e6c246dcb8c3b647bbe36f8558f53f14 100644 (file)
@@ -225,6 +225,7 @@ ENTRY(cpu_arm7_set_pte_ext)
  * Params  : r0 = address to jump to
  * Notes   : This sets up everything for a reset
  */
+               .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm6_reset)
 ENTRY(cpu_arm7_reset)
                mov     r1, #0
@@ -235,6 +236,9 @@ ENTRY(cpu_arm7_reset)
                mov     r1, #0x30
                mcr     p15, 0, r1, c1, c0, 0           @ turn off MMU etc
                mov     pc, r0
+ENDPROC(cpu_arm6_reset)
+ENDPROC(cpu_arm7_reset)
+               .popsection
 
                __CPUINIT
 
index 55f4e290665a61e65599faba6392d10988f577f0..0ac908c7ade1f178afe35a4c3d1c79e59aa8ceb2 100644 (file)
@@ -101,6 +101,7 @@ ENTRY(cpu_arm720_set_pte_ext)
  * Params  : r0 = address to jump to
  * Notes   : This sets up everything for a reset
  */
+               .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm720_reset)
                mov     ip, #0
                mcr     p15, 0, ip, c7, c7, 0           @ invalidate cache
@@ -112,6 +113,8 @@ ENTRY(cpu_arm720_reset)
                bic     ip, ip, #0x2100                 @ ..v....s........
                mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
                mov     pc, r0
+ENDPROC(cpu_arm720_reset)
+               .popsection
 
        __CPUINIT
 
index 4506be3adda6f48d7921f06cdccc3c44a40aef50..dc5de5d53f20c4865f6522d86fa96e7d9495071e 100644 (file)
@@ -49,6 +49,7 @@ ENTRY(cpu_arm740_proc_fin)
  * Params  : r0 = address to jump to
  * Notes   : This sets up everything for a reset
  */
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm740_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c0, 0           @ invalidate cache
@@ -56,6 +57,8 @@ ENTRY(cpu_arm740_reset)
        bic     ip, ip, #0x0000000c             @ ............wc..
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm740_reset)
+       .popsection
 
        __CPUINIT
 
index 7e0e1fe4ed4d7843f0a1226843c83f61891a7aee..6ddea3e464bd1e30ffc2115dc00b4a842949afdb 100644 (file)
@@ -45,8 +45,11 @@ ENTRY(cpu_arm7tdmi_proc_fin)
  * Params  : loc(r0)   address to jump to
  * Purpose : Sets up everything for a reset and jump to the location for soft reset.
  */
+               .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm7tdmi_reset)
                mov     pc, r0
+ENDPROC(cpu_arm7tdmi_reset)
+               .popsection
 
                __CPUINIT
 
index 88fb3d9e0640768ba827c58fa4a81989236f355c..cb941ae95f66ee43132cd267e14eba8161a2580c 100644 (file)
@@ -85,6 +85,7 @@ ENTRY(cpu_arm920_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm920_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -97,6 +98,8 @@ ENTRY(cpu_arm920_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm920_reset)
+       .popsection
 
 /*
  * cpu_arm920_do_idle()
index 490e18833857208e84f0ad4bb233bcdef1fee1b1..4ec0e074dd554898e3d3c3ba8728bafb768346ea 100644 (file)
@@ -87,6 +87,7 @@ ENTRY(cpu_arm922_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm922_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -99,6 +100,8 @@ ENTRY(cpu_arm922_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm922_reset)
+       .popsection
 
 /*
  * cpu_arm922_do_idle()
index 51d494be057eb149c95b1d0b47b36c6f54bd7843..9dccd9a365b38c2c7c1261a280d55f4f4e7d5af4 100644 (file)
@@ -108,6 +108,7 @@ ENTRY(cpu_arm925_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm925_reset)
        /* Send software reset to MPU and DSP */
        mov     ip, #0xff000000
@@ -115,6 +116,8 @@ ENTRY(cpu_arm925_reset)
        orr     ip, ip, #0x0000ce00
        mov     r4, #1
        strh    r4, [ip, #0x10]
+ENDPROC(cpu_arm925_reset)
+       .popsection
 
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
index 9f8fd91f918a09ba61604ef6dac26a59d86bfd67..820259b81a1f3d54f93587d0f1d3618688f98549 100644 (file)
@@ -77,6 +77,7 @@ ENTRY(cpu_arm926_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm926_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -89,6 +90,8 @@ ENTRY(cpu_arm926_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm926_reset)
+       .popsection
 
 /*
  * cpu_arm926_do_idle()
index ac750d50615333d40bf9b3218ff66a01fe0400f2..9fdc0a1709748ed27ea06e6155f8904338c5b4ac 100644 (file)
@@ -48,6 +48,7 @@ ENTRY(cpu_arm940_proc_fin)
  * Params  : r0 = address to jump to
  * Notes   : This sets up everything for a reset
  */
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm940_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c5, 0           @ flush I cache
@@ -58,6 +59,8 @@ ENTRY(cpu_arm940_reset)
        bic     ip, ip, #0x00001000             @ i-cache
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm940_reset)
+       .popsection
 
 /*
  * cpu_arm940_do_idle()
index 683af3a182b7e8bea1138ffa4f977b3f0828af61..f684cfedcca9836e5bdec9877adef28984b34f03 100644 (file)
@@ -55,6 +55,7 @@ ENTRY(cpu_arm946_proc_fin)
  * Params  : r0 = address to jump to
  * Notes   : This sets up everything for a reset
  */
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm946_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c5, 0           @ flush I cache
@@ -65,6 +66,8 @@ ENTRY(cpu_arm946_reset)
        bic     ip, ip, #0x00001000             @ i-cache
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_arm946_reset)
+       .popsection
 
 /*
  * cpu_arm946_do_idle()
index 2120f9e2af7fab7cc42d9b6d9d205cab092b0ee9..8881391dfb9ee42c819efd086de5b70711fee08d 100644 (file)
@@ -45,8 +45,11 @@ ENTRY(cpu_arm9tdmi_proc_fin)
  * Params  : loc(r0)   address to jump to
  * Purpose : Sets up everything for a reset and jump to the location for soft reset.
  */
+               .pushsection    .idmap.text, "ax"
 ENTRY(cpu_arm9tdmi_reset)
                mov     pc, r0
+ENDPROC(cpu_arm9tdmi_reset)
+               .popsection
 
                __CPUINIT
 
index 4c7a5710472b8a4f92007fd443fce65acff2a639..272558a133a36ec685d63f5f7f40fd33e73a0caa 100644 (file)
@@ -57,6 +57,7 @@ ENTRY(cpu_fa526_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  4
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_fa526_reset)
 /* TODO: Use CP8 if possible... */
        mov     ip, #0
@@ -73,6 +74,8 @@ ENTRY(cpu_fa526_reset)
        nop
        nop
        mov     pc, r0
+ENDPROC(cpu_fa526_reset)
+       .popsection
 
 /*
  * cpu_fa526_do_idle()
index 8a6c2f78c1c303c26d851580f472d0058c7ec6b3..ba3c500584ac4808b58926c9c0ec9bf945483795 100644 (file)
@@ -98,6 +98,7 @@ ENTRY(cpu_feroceon_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_feroceon_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -110,6 +111,8 @@ ENTRY(cpu_feroceon_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_feroceon_reset)
+       .popsection
 
 /*
  * cpu_feroceon_do_idle()
index 307a4def8d3a7d6c89d06211e53f855a7e518fea..2d8ff3ad86d3e1a2b9d9abd83a1bdd3ab42eba3a 100644 (file)
@@ -91,8 +91,9 @@
 #if L_PTE_SHARED != PTE_EXT_SHARED
 #error PTE shared bit mismatch
 #endif
-#if (L_PTE_XN+L_PTE_USER+L_PTE_RDONLY+L_PTE_DIRTY+L_PTE_YOUNG+\
-     L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED
+#if !defined (CONFIG_ARM_LPAE) && \
+       (L_PTE_XN+L_PTE_USER+L_PTE_RDONLY+L_PTE_DIRTY+L_PTE_YOUNG+\
+        L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED
 #error Invalid Linux PTE bit settings
 #endif
 #endif /* CONFIG_MMU */
index db52b0fb14a080cdc9356e7942c50b1691fb6738..cdfedc5b8ad83f26fb4e89d77aa4d234e473717f 100644 (file)
@@ -69,6 +69,7 @@ ENTRY(cpu_mohawk_proc_fin)
  * (same as arm926)
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_mohawk_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -79,6 +80,8 @@ ENTRY(cpu_mohawk_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_mohawk_reset)
+       .popsection
 
 /*
  * cpu_mohawk_do_idle()
index d50ada26edd61ad68057bca0c3a654b7af4d5be1..775d70fba93719e04c297d14c1a9a6491a9dcc8e 100644 (file)
@@ -62,6 +62,7 @@ ENTRY(cpu_sa110_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_sa110_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -74,6 +75,8 @@ ENTRY(cpu_sa110_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_sa110_reset)
+       .popsection
 
 /*
  * cpu_sa110_do_idle(type)
index 7d91545d089baf3ca530831bbdccd8d261e951b5..3aa0da11fd8473376405d6fe57b76b777ca1cf93 100644 (file)
@@ -70,6 +70,7 @@ ENTRY(cpu_sa1100_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_sa1100_reset)
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate I,D caches
@@ -82,6 +83,8 @@ ENTRY(cpu_sa1100_reset)
        bic     ip, ip, #0x1100                 @ ...i...s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+ENDPROC(cpu_sa1100_reset)
+       .popsection
 
 /*
  * cpu_sa1100_do_idle(type)
index d061d2fa5506b8f6556c8a99147a6a1dfe5d6998..5900cd520e8456a9563b387f14f606d081ccaa56 100644 (file)
@@ -55,6 +55,7 @@ ENTRY(cpu_v6_proc_fin)
  *     - loc   - location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_v6_reset)
        mrc     p15, 0, r1, c1, c0, 0           @ ctrl register
        bic     r1, r1, #0x1                    @ ...............m
@@ -62,6 +63,8 @@ ENTRY(cpu_v6_reset)
        mov     r1, #0
        mcr     p15, 0, r1, c7, c5, 4           @ ISB
        mov     pc, r0
+ENDPROC(cpu_v6_reset)
+       .popsection
 
 /*
  *     cpu_v6_do_idle()
diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S
new file mode 100644 (file)
index 0000000..3a4b3e7
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * arch/arm/mm/proc-v7-2level.S
+ *
+ * Copyright (C) 2001 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 version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define TTB_S          (1 << 1)
+#define TTB_RGN_NC     (0 << 3)
+#define TTB_RGN_OC_WBWA        (1 << 3)
+#define TTB_RGN_OC_WT  (2 << 3)
+#define TTB_RGN_OC_WB  (3 << 3)
+#define TTB_NOS                (1 << 5)
+#define TTB_IRGN_NC    ((0 << 0) | (0 << 6))
+#define TTB_IRGN_WBWA  ((0 << 0) | (1 << 6))
+#define TTB_IRGN_WT    ((1 << 0) | (0 << 6))
+#define TTB_IRGN_WB    ((1 << 0) | (1 << 6))
+
+/* PTWs cacheable, inner WB not shareable, outer WB not shareable */
+#define TTB_FLAGS_UP   TTB_IRGN_WB|TTB_RGN_OC_WB
+#define PMD_FLAGS_UP   PMD_SECT_WB
+
+/* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */
+#define TTB_FLAGS_SMP  TTB_IRGN_WBWA|TTB_S|TTB_NOS|TTB_RGN_OC_WBWA
+#define PMD_FLAGS_SMP  PMD_SECT_WBWA|PMD_SECT_S
+
+/*
+ *     cpu_v7_switch_mm(pgd_phys, tsk)
+ *
+ *     Set the translation table base pointer to be pgd_phys
+ *
+ *     - pgd_phys - physical address of new TTB
+ *
+ *     It is assumed that:
+ *     - we are not using split page tables
+ */
+ENTRY(cpu_v7_switch_mm)
+#ifdef CONFIG_MMU
+       mov     r2, #0
+       ldr     r1, [r1, #MM_CONTEXT_ID]        @ get mm->context.id
+       ALT_SMP(orr     r0, r0, #TTB_FLAGS_SMP)
+       ALT_UP(orr      r0, r0, #TTB_FLAGS_UP)
+#ifdef CONFIG_ARM_ERRATA_430973
+       mcr     p15, 0, r2, c7, c5, 6           @ flush BTAC/BTB
+#endif
+#ifdef CONFIG_ARM_ERRATA_754322
+       dsb
+#endif
+       mcr     p15, 0, r2, c13, c0, 1          @ set reserved context ID
+       isb
+1:     mcr     p15, 0, r0, c2, c0, 0           @ set TTB 0
+       isb
+#ifdef CONFIG_ARM_ERRATA_754322
+       dsb
+#endif
+       mcr     p15, 0, r1, c13, c0, 1          @ set context ID
+       isb
+#endif
+       mov     pc, lr
+ENDPROC(cpu_v7_switch_mm)
+
+/*
+ *     cpu_v7_set_pte_ext(ptep, pte)
+ *
+ *     Set a level 2 translation table entry.
+ *
+ *     - ptep  - pointer to level 2 translation table entry
+ *               (hardware version is stored at +2048 bytes)
+ *     - pte   - PTE value to store
+ *     - ext   - value for extended PTE bits
+ */
+ENTRY(cpu_v7_set_pte_ext)
+#ifdef CONFIG_MMU
+       str     r1, [r0]                        @ linux version
+
+       bic     r3, r1, #0x000003f0
+       bic     r3, r3, #PTE_TYPE_MASK
+       orr     r3, r3, r2
+       orr     r3, r3, #PTE_EXT_AP0 | 2
+
+       tst     r1, #1 << 4
+       orrne   r3, r3, #PTE_EXT_TEX(1)
+
+       eor     r1, r1, #L_PTE_DIRTY
+       tst     r1, #L_PTE_RDONLY | L_PTE_DIRTY
+       orrne   r3, r3, #PTE_EXT_APX
+
+       tst     r1, #L_PTE_USER
+       orrne   r3, r3, #PTE_EXT_AP1
+#ifdef CONFIG_CPU_USE_DOMAINS
+       @ allow kernel read/write access to read-only user pages
+       tstne   r3, #PTE_EXT_APX
+       bicne   r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
+#endif
+
+       tst     r1, #L_PTE_XN
+       orrne   r3, r3, #PTE_EXT_XN
+
+       tst     r1, #L_PTE_YOUNG
+       tstne   r1, #L_PTE_PRESENT
+       moveq   r3, #0
+
+ ARM(  str     r3, [r0, #2048]! )
+ THUMB(        add     r0, r0, #2048 )
+ THUMB(        str     r3, [r0] )
+       mcr     p15, 0, r0, c7, c10, 1          @ flush_pte
+#endif
+       mov     pc, lr
+ENDPROC(cpu_v7_set_pte_ext)
+
+       /*
+        * Memory region attributes with SCTLR.TRE=1
+        *
+        *   n = TEX[0],C,B
+        *   TR = PRRR[2n+1:2n]         - memory type
+        *   IR = NMRR[2n+1:2n]         - inner cacheable property
+        *   OR = NMRR[2n+17:2n+16]     - outer cacheable property
+        *
+        *                      n       TR      IR      OR
+        *   UNCACHED           000     00
+        *   BUFFERABLE         001     10      00      00
+        *   WRITETHROUGH       010     10      10      10
+        *   WRITEBACK          011     10      11      11
+        *   reserved           110
+        *   WRITEALLOC         111     10      01      01
+        *   DEV_SHARED         100     01
+        *   DEV_NONSHARED      100     01
+        *   DEV_WC             001     10
+        *   DEV_CACHED         011     10
+        *
+        * Other attributes:
+        *
+        *   DS0 = PRRR[16] = 0         - device shareable property
+        *   DS1 = PRRR[17] = 1         - device shareable property
+        *   NS0 = PRRR[18] = 0         - normal shareable property
+        *   NS1 = PRRR[19] = 1         - normal shareable property
+        *   NOS = PRRR[24+n] = 1       - not outer shareable
+        */
+.equ   PRRR,   0xff0a81a8
+.equ   NMRR,   0x40e040e0
+
+       /*
+        * Macro for setting up the TTBRx and TTBCR registers.
+        * - \ttb0 and \ttb1 updated with the corresponding flags.
+        */
+       .macro  v7_ttb_setup, zero, ttbr0, ttbr1, tmp
+       mcr     p15, 0, \zero, c2, c0, 2        @ TTB control register
+       ALT_SMP(orr     \ttbr0, \ttbr0, #TTB_FLAGS_SMP)
+       ALT_UP(orr      \ttbr0, \ttbr0, #TTB_FLAGS_UP)
+       ALT_SMP(orr     \ttbr1, \ttbr1, #TTB_FLAGS_SMP)
+       ALT_UP(orr      \ttbr1, \ttbr1, #TTB_FLAGS_UP)
+       mcr     p15, 0, \ttbr1, c2, c0, 1       @ load TTB1
+       .endm
+
+       __CPUINIT
+
+       /*   AT
+        *  TFR   EV X F   I D LR    S
+        * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM
+        * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced
+        *    1    0 110       0011 1100 .111 1101 < we want
+        */
+       .align  2
+       .type   v7_crval, #object
+v7_crval:
+       crval   clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c
+
+       .previous
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S
new file mode 100644 (file)
index 0000000..8de0f1d
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * arch/arm/mm/proc-v7-3level.S
+ *
+ * Copyright (C) 2001 Deep Blue Solutions Ltd.
+ * Copyright (C) 2011 ARM Ltd.
+ * Author: Catalin Marinas <catalin.marinas@arm.com>
+ *   based on arch/arm/mm/proc-v7-2level.S
+ *
+ * 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.
+ *
+ * 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
+ */
+
+#define TTB_IRGN_NC    (0 << 8)
+#define TTB_IRGN_WBWA  (1 << 8)
+#define TTB_IRGN_WT    (2 << 8)
+#define TTB_IRGN_WB    (3 << 8)
+#define TTB_RGN_NC     (0 << 10)
+#define TTB_RGN_OC_WBWA        (1 << 10)
+#define TTB_RGN_OC_WT  (2 << 10)
+#define TTB_RGN_OC_WB  (3 << 10)
+#define TTB_S          (3 << 12)
+#define TTB_EAE                (1 << 31)
+
+/* PTWs cacheable, inner WB not shareable, outer WB not shareable */
+#define TTB_FLAGS_UP   (TTB_IRGN_WB|TTB_RGN_OC_WB)
+#define PMD_FLAGS_UP   (PMD_SECT_WB)
+
+/* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */
+#define TTB_FLAGS_SMP  (TTB_IRGN_WBWA|TTB_S|TTB_RGN_OC_WBWA)
+#define PMD_FLAGS_SMP  (PMD_SECT_WBWA|PMD_SECT_S)
+
+/*
+ * cpu_v7_switch_mm(pgd_phys, tsk)
+ *
+ * Set the translation table base pointer to be pgd_phys (physical address of
+ * the new TTB).
+ */
+ENTRY(cpu_v7_switch_mm)
+#ifdef CONFIG_MMU
+       ldr     r1, [r1, #MM_CONTEXT_ID]        @ get mm->context.id
+       and     r3, r1, #0xff
+       mov     r3, r3, lsl #(48 - 32)          @ ASID
+       mcrr    p15, 0, r0, r3, c2              @ set TTB 0
+       isb
+#endif
+       mov     pc, lr
+ENDPROC(cpu_v7_switch_mm)
+
+/*
+ * cpu_v7_set_pte_ext(ptep, pte)
+ *
+ * Set a level 2 translation table entry.
+ * - ptep - pointer to level 3 translation table entry
+ * - pte - PTE value to store (64-bit in r2 and r3)
+ */
+ENTRY(cpu_v7_set_pte_ext)
+#ifdef CONFIG_MMU
+       tst     r2, #L_PTE_PRESENT
+       beq     1f
+       tst     r3, #1 << (55 - 32)             @ L_PTE_DIRTY
+       orreq   r2, #L_PTE_RDONLY
+1:     strd    r2, r3, [r0]
+       mcr     p15, 0, r0, c7, c10, 1          @ flush_pte
+#endif
+       mov     pc, lr
+ENDPROC(cpu_v7_set_pte_ext)
+
+       /*
+        * Memory region attributes for LPAE (defined in pgtable-3level.h):
+        *
+        *   n = AttrIndx[2:0]
+        *
+        *                      n       MAIR
+        *   UNCACHED           000     00000000
+        *   BUFFERABLE         001     01000100
+        *   DEV_WC             001     01000100
+        *   WRITETHROUGH       010     10101010
+        *   WRITEBACK          011     11101110
+        *   DEV_CACHED         011     11101110
+        *   DEV_SHARED         100     00000100
+        *   DEV_NONSHARED      100     00000100
+        *   unused             101
+        *   unused             110
+        *   WRITEALLOC         111     11111111
+        */
+.equ   PRRR,   0xeeaa4400                      @ MAIR0
+.equ   NMRR,   0xff000004                      @ MAIR1
+
+       /*
+        * Macro for setting up the TTBRx and TTBCR registers.
+        * - \ttbr1 updated.
+        */
+       .macro  v7_ttb_setup, zero, ttbr0, ttbr1, tmp
+       ldr     \tmp, =swapper_pg_dir           @ swapper_pg_dir virtual address
+       cmp     \ttbr1, \tmp                    @ PHYS_OFFSET > PAGE_OFFSET? (branch below)
+       mrc     p15, 0, \tmp, c2, c0, 2         @ TTB control register
+       orr     \tmp, \tmp, #TTB_EAE
+       ALT_SMP(orr     \tmp, \tmp, #TTB_FLAGS_SMP)
+       ALT_UP(orr      \tmp, \tmp, #TTB_FLAGS_UP)
+       ALT_SMP(orr     \tmp, \tmp, #TTB_FLAGS_SMP << 16)
+       ALT_UP(orr      \tmp, \tmp, #TTB_FLAGS_UP << 16)
+       /*
+        * TTBR0/TTBR1 split (PAGE_OFFSET):
+        *   0x40000000: T0SZ = 2, T1SZ = 0 (not used)
+        *   0x80000000: T0SZ = 0, T1SZ = 1
+        *   0xc0000000: T0SZ = 0, T1SZ = 2
+        *
+        * Only use this feature if PHYS_OFFSET <= PAGE_OFFSET, otherwise
+        * booting secondary CPUs would end up using TTBR1 for the identity
+        * mapping set up in TTBR0.
+        */
+       bhi     9001f                           @ PHYS_OFFSET > PAGE_OFFSET?
+       orr     \tmp, \tmp, #(((PAGE_OFFSET >> 30) - 1) << 16) @ TTBCR.T1SZ
+#if defined CONFIG_VMSPLIT_2G
+       /* PAGE_OFFSET == 0x80000000, T1SZ == 1 */
+       add     \ttbr1, \ttbr1, #1 << 4         @ skip two L1 entries
+#elif defined CONFIG_VMSPLIT_3G
+       /* PAGE_OFFSET == 0xc0000000, T1SZ == 2 */
+       add     \ttbr1, \ttbr1, #4096 * (1 + 3) @ only L2 used, skip pgd+3*pmd
+#endif
+       /* CONFIG_VMSPLIT_1G does not need TTBR1 adjustment */
+9001:  mcr     p15, 0, \tmp, c2, c0, 2         @ TTB control register
+       mcrr    p15, 1, \ttbr1, \zero, c2       @ load TTBR1
+       .endm
+
+       __CPUINIT
+
+       /*
+        *   AT
+        *  TFR   EV X F   IHD LR    S
+        * .EEE ..EE PUI. .TAT 4RVI ZWRS BLDP WCAM
+        * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced
+        *   11    0 110    1  0011 1100 .111 1101 < we want
+        */
+       .align  2
+       .type   v7_crval, #object
+v7_crval:
+       crval   clear=0x0120c302, mmuset=0x30c23c7d, ucset=0x00c01c7c
+
+       .previous
index 2c559ac381425d325757c68d83e73c37c77e6b5d..2755e3664015fc68d5e761e4043a080516e84821 100644 (file)
 
 #include "proc-macros.S"
 
-#define TTB_S          (1 << 1)
-#define TTB_RGN_NC     (0 << 3)
-#define TTB_RGN_OC_WBWA        (1 << 3)
-#define TTB_RGN_OC_WT  (2 << 3)
-#define TTB_RGN_OC_WB  (3 << 3)
-#define TTB_NOS                (1 << 5)
-#define TTB_IRGN_NC    ((0 << 0) | (0 << 6))
-#define TTB_IRGN_WBWA  ((0 << 0) | (1 << 6))
-#define TTB_IRGN_WT    ((1 << 0) | (0 << 6))
-#define TTB_IRGN_WB    ((1 << 0) | (1 << 6))
-
-/* PTWs cacheable, inner WB not shareable, outer WB not shareable */
-#define TTB_FLAGS_UP   TTB_IRGN_WB|TTB_RGN_OC_WB
-#define PMD_FLAGS_UP   PMD_SECT_WB
-
-/* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */
-#define TTB_FLAGS_SMP  TTB_IRGN_WBWA|TTB_S|TTB_NOS|TTB_RGN_OC_WBWA
-#define PMD_FLAGS_SMP  PMD_SECT_WBWA|PMD_SECT_S
+#ifdef CONFIG_ARM_LPAE
+#include "proc-v7-3level.S"
+#else
+#include "proc-v7-2level.S"
+#endif
 
 ENTRY(cpu_v7_proc_init)
        mov     pc, lr
@@ -63,6 +50,7 @@ ENDPROC(cpu_v7_proc_fin)
  *      caches disabled.
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_v7_reset)
        mrc     p15, 0, r1, c1, c0, 0           @ ctrl register
        bic     r1, r1, #0x1                    @ ...............m
@@ -71,6 +59,7 @@ ENTRY(cpu_v7_reset)
        isb
        mov     pc, r0
 ENDPROC(cpu_v7_reset)
+       .popsection
 
 /*
  *     cpu_v7_do_idle()
@@ -97,127 +86,12 @@ ENTRY(cpu_v7_dcache_clean_area)
        mov     pc, lr
 ENDPROC(cpu_v7_dcache_clean_area)
 
-/*
- *     cpu_v7_switch_mm(pgd_phys, tsk)
- *
- *     Set the translation table base pointer to be pgd_phys
- *
- *     - pgd_phys - physical address of new TTB
- *
- *     It is assumed that:
- *     - we are not using split page tables
- */
-ENTRY(cpu_v7_switch_mm)
-#ifdef CONFIG_MMU
-       mov     r2, #0
-       ldr     r1, [r1, #MM_CONTEXT_ID]        @ get mm->context.id
-       ALT_SMP(orr     r0, r0, #TTB_FLAGS_SMP)
-       ALT_UP(orr      r0, r0, #TTB_FLAGS_UP)
-#ifdef CONFIG_ARM_ERRATA_430973
-       mcr     p15, 0, r2, c7, c5, 6           @ flush BTAC/BTB
-#endif
-#ifdef CONFIG_ARM_ERRATA_754322
-       dsb
-#endif
-       mcr     p15, 0, r2, c13, c0, 1          @ set reserved context ID
-       isb
-1:     mcr     p15, 0, r0, c2, c0, 0           @ set TTB 0
-       isb
-#ifdef CONFIG_ARM_ERRATA_754322
-       dsb
-#endif
-       mcr     p15, 0, r1, c13, c0, 1          @ set context ID
-       isb
-#endif
-       mov     pc, lr
-ENDPROC(cpu_v7_switch_mm)
-
-/*
- *     cpu_v7_set_pte_ext(ptep, pte)
- *
- *     Set a level 2 translation table entry.
- *
- *     - ptep  - pointer to level 2 translation table entry
- *               (hardware version is stored at +2048 bytes)
- *     - pte   - PTE value to store
- *     - ext   - value for extended PTE bits
- */
-ENTRY(cpu_v7_set_pte_ext)
-#ifdef CONFIG_MMU
-       str     r1, [r0]                        @ linux version
-
-       bic     r3, r1, #0x000003f0
-       bic     r3, r3, #PTE_TYPE_MASK
-       orr     r3, r3, r2
-       orr     r3, r3, #PTE_EXT_AP0 | 2
-
-       tst     r1, #1 << 4
-       orrne   r3, r3, #PTE_EXT_TEX(1)
-
-       eor     r1, r1, #L_PTE_DIRTY
-       tst     r1, #L_PTE_RDONLY | L_PTE_DIRTY
-       orrne   r3, r3, #PTE_EXT_APX
-
-       tst     r1, #L_PTE_USER
-       orrne   r3, r3, #PTE_EXT_AP1
-#ifdef CONFIG_CPU_USE_DOMAINS
-       @ allow kernel read/write access to read-only user pages
-       tstne   r3, #PTE_EXT_APX
-       bicne   r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
-#endif
-
-       tst     r1, #L_PTE_XN
-       orrne   r3, r3, #PTE_EXT_XN
-
-       tst     r1, #L_PTE_YOUNG
-       tstne   r1, #L_PTE_PRESENT
-       moveq   r3, #0
-
- ARM(  str     r3, [r0, #2048]! )
- THUMB(        add     r0, r0, #2048 )
- THUMB(        str     r3, [r0] )
-       mcr     p15, 0, r0, c7, c10, 1          @ flush_pte
-#endif
-       mov     pc, lr
-ENDPROC(cpu_v7_set_pte_ext)
-
        string  cpu_v7_name, "ARMv7 Processor"
        .align
 
-       /*
-        * Memory region attributes with SCTLR.TRE=1
-        *
-        *   n = TEX[0],C,B
-        *   TR = PRRR[2n+1:2n]         - memory type
-        *   IR = NMRR[2n+1:2n]         - inner cacheable property
-        *   OR = NMRR[2n+17:2n+16]     - outer cacheable property
-        *
-        *                      n       TR      IR      OR
-        *   UNCACHED           000     00
-        *   BUFFERABLE         001     10      00      00
-        *   WRITETHROUGH       010     10      10      10
-        *   WRITEBACK          011     10      11      11
-        *   reserved           110
-        *   WRITEALLOC         111     10      01      01
-        *   DEV_SHARED         100     01
-        *   DEV_NONSHARED      100     01
-        *   DEV_WC             001     10
-        *   DEV_CACHED         011     10
-        *
-        * Other attributes:
-        *
-        *   DS0 = PRRR[16] = 0         - device shareable property
-        *   DS1 = PRRR[17] = 1         - device shareable property
-        *   NS0 = PRRR[18] = 0         - normal shareable property
-        *   NS1 = PRRR[19] = 1         - normal shareable property
-        *   NOS = PRRR[24+n] = 1       - not outer shareable
-        */
-.equ   PRRR,   0xff0a81a8
-.equ   NMRR,   0x40e040e0
-
 /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
 .globl cpu_v7_suspend_size
-.equ   cpu_v7_suspend_size, 4 * 7
+.equ   cpu_v7_suspend_size, 4 * 8
 #ifdef CONFIG_ARM_CPU_SUSPEND
 ENTRY(cpu_v7_do_suspend)
        stmfd   sp!, {r4 - r10, lr}
@@ -226,10 +100,11 @@ ENTRY(cpu_v7_do_suspend)
        stmia   r0!, {r4 - r5}
        mrc     p15, 0, r6, c3, c0, 0   @ Domain ID
        mrc     p15, 0, r7, c2, c0, 1   @ TTB 1
+       mrc     p15, 0, r11, c2, c0, 2  @ TTB control register
        mrc     p15, 0, r8, c1, c0, 0   @ Control register
        mrc     p15, 0, r9, c1, c0, 1   @ Auxiliary control register
        mrc     p15, 0, r10, c1, c0, 2  @ Co-processor access control
-       stmia   r0, {r6 - r10}
+       stmia   r0, {r6 - r11}
        ldmfd   sp!, {r4 - r10, pc}
 ENDPROC(cpu_v7_do_suspend)
 
@@ -241,13 +116,15 @@ ENTRY(cpu_v7_do_resume)
        ldmia   r0!, {r4 - r5}
        mcr     p15, 0, r4, c13, c0, 0  @ FCSE/PID
        mcr     p15, 0, r5, c13, c0, 3  @ User r/o thread ID
-       ldmia   r0, {r6 - r10}
+       ldmia   r0, {r6 - r11}
        mcr     p15, 0, r6, c3, c0, 0   @ Domain ID
+#ifndef CONFIG_ARM_LPAE
        ALT_SMP(orr     r1, r1, #TTB_FLAGS_SMP)
        ALT_UP(orr      r1, r1, #TTB_FLAGS_UP)
+#endif
        mcr     p15, 0, r1, c2, c0, 0   @ TTB 0
        mcr     p15, 0, r7, c2, c0, 1   @ TTB 1
-       mcr     p15, 0, ip, c2, c0, 2   @ TTB control register
+       mcr     p15, 0, r11, c2, c0, 2  @ TTB control register
        mrc     p15, 0, r4, c1, c0, 1   @ Read Auxiliary control register
        teq     r4, r9                  @ Is it already set?
        mcrne   p15, 0, r9, c1, c0, 1   @ No, so write it
@@ -284,6 +161,7 @@ __v7_ca5mp_setup:
 __v7_ca9mp_setup:
        mov     r10, #(1 << 0)                  @ TLB ops broadcasting
        b       1f
+__v7_ca7mp_setup:
 __v7_ca15mp_setup:
        mov     r10, #0
 1:
@@ -377,12 +255,7 @@ __v7_setup:
        dsb
 #ifdef CONFIG_MMU
        mcr     p15, 0, r10, c8, c7, 0          @ invalidate I + D TLBs
-       mcr     p15, 0, r10, c2, c0, 2          @ TTB control register
-       ALT_SMP(orr     r4, r4, #TTB_FLAGS_SMP)
-       ALT_UP(orr      r4, r4, #TTB_FLAGS_UP)
-       ALT_SMP(orr     r8, r8, #TTB_FLAGS_SMP)
-       ALT_UP(orr      r8, r8, #TTB_FLAGS_UP)
-       mcr     p15, 0, r8, c2, c0, 1           @ load TTB1
+       v7_ttb_setup r10, r4, r8, r5            @ TTBCR, TTBRx setup
        ldr     r5, =PRRR                       @ PRRR
        ldr     r6, =NMRR                       @ NMRR
        mcr     p15, 0, r5, c10, c2, 0          @ write PRRR
@@ -404,16 +277,7 @@ __v7_setup:
        mov     pc, lr                          @ return to head.S:__ret
 ENDPROC(__v7_setup)
 
-       /*   AT
-        *  TFR   EV X F   I D LR    S
-        * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM
-        * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced
-        *    1    0 110       0011 1100 .111 1101 < we want
-        */
-       .type   v7_crval, #object
-v7_crval:
-       crval   clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c
-
+       .align  2
 __v7_setup_stack:
        .space  4 * 11                          @ 11 registers
 
@@ -435,11 +299,11 @@ __v7_setup_stack:
         */
 .macro __v7_proc initfunc, mm_mmuflags = 0, io_mmuflags = 0, hwcaps = 0
        ALT_SMP(.long   PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \
-                       PMD_FLAGS_SMP | \mm_mmuflags)
+                       PMD_SECT_AF | PMD_FLAGS_SMP | \mm_mmuflags)
        ALT_UP(.long    PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \
-                       PMD_FLAGS_UP | \mm_mmuflags)
-       .long   PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_AP_WRITE | \
-               PMD_SECT_AP_READ | \io_mmuflags
+                       PMD_SECT_AF | PMD_FLAGS_UP | \mm_mmuflags)
+       .long   PMD_TYPE_SECT | PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ | PMD_SECT_AF | \io_mmuflags
        W(b)    \initfunc
        .long   cpu_arch_name
        .long   cpu_elf_name
@@ -452,6 +316,7 @@ __v7_setup_stack:
        .long   v7_cache_fns
 .endm
 
+#ifndef CONFIG_ARM_LPAE
        /*
         * ARM Ltd. Cortex A5 processor.
         */
@@ -462,6 +327,16 @@ __v7_ca5mp_proc_info:
        __v7_proc __v7_ca5mp_setup
        .size   __v7_ca5mp_proc_info, . - __v7_ca5mp_proc_info
 
+       /*
+        * ARM Ltd. Cortex A7 processor.
+        */
+       .type   __v7_ca7mp_proc_info, #object
+__v7_ca7mp_proc_info:
+       .long   0x410fc070
+       .long   0xff0ffff0
+       __v7_proc __v7_ca7mp_setup, hwcaps = HWCAP_IDIV
+       .size   __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info
+
        /*
         * ARM Ltd. Cortex A9 processor.
         */
@@ -471,6 +346,7 @@ __v7_ca9mp_proc_info:
        .long   0xff0ffff0
        __v7_proc __v7_ca9mp_setup
        .size   __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info
+#endif /* CONFIG_ARM_LPAE */
 
        /*
         * ARM Ltd. Cortex A15 processor.
index abf0507a08ae9d06c2cda16bbab66f95cd14d025..b0d57869da2d95f1af47702bf039f3ef90ad5f02 100644 (file)
@@ -105,6 +105,7 @@ ENTRY(cpu_xsc3_proc_fin)
  * loc: location to jump to for soft reset
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_xsc3_reset)
        mov     r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
        msr     cpsr_c, r1                      @ reset CPSR
@@ -119,6 +120,8 @@ ENTRY(cpu_xsc3_reset)
        @ already containing those two last instructions to survive.
        mcr     p15, 0, ip, c8, c7, 0           @ invalidate I and D TLBs
        mov     pc, r0
+ENDPROC(cpu_xsc3_reset)
+       .popsection
 
 /*
  * cpu_xsc3_do_idle()
index 3277904bebaf5618b759b8195faef155b7dd327b..4ffebaa595eec597d37e556bd66edc4af28f2a20 100644 (file)
@@ -142,6 +142,7 @@ ENTRY(cpu_xscale_proc_fin)
  * Beware PXA270 erratum E7.
  */
        .align  5
+       .pushsection    .idmap.text, "ax"
 ENTRY(cpu_xscale_reset)
        mov     r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
        msr     cpsr_c, r1                      @ reset CPSR
@@ -160,6 +161,8 @@ ENTRY(cpu_xscale_reset)
        @ already containing those two last instructions to survive.
        mcr     p15, 0, ip, c8, c7, 0           @ invalidate I & D TLBs
        mov     pc, r0
+ENDPROC(cpu_xscale_reset)
+       .popsection
 
 /*
  * cpu_xscale_do_idle()
index 69b09c1cec8bc9f12b173a9d5a47421790f34589..a99dc15a70f7955060bcc0ae5b7509efaa7922aa 100644 (file)
@@ -10,10 +10,10 @@ obj-$(CONFIG_ARCH_IOP32X) += i2c.o
 obj-$(CONFIG_ARCH_IOP32X) += pci.o
 obj-$(CONFIG_ARCH_IOP32X) += setup.o
 obj-$(CONFIG_ARCH_IOP32X) += time.o
-obj-$(CONFIG_ARCH_IOP32X) += io.o
 obj-$(CONFIG_ARCH_IOP32X) += cp6.o
 obj-$(CONFIG_ARCH_IOP32X) += adma.o
 obj-$(CONFIG_ARCH_IOP32X) += pmu.o
+obj-$(CONFIG_ARCH_IOP32X) += restart.o
 
 # IOP33X
 obj-$(CONFIG_ARCH_IOP33X) += gpio.o
@@ -21,10 +21,10 @@ obj-$(CONFIG_ARCH_IOP33X) += i2c.o
 obj-$(CONFIG_ARCH_IOP33X) += pci.o
 obj-$(CONFIG_ARCH_IOP33X) += setup.o
 obj-$(CONFIG_ARCH_IOP33X) += time.o
-obj-$(CONFIG_ARCH_IOP33X) += io.o
 obj-$(CONFIG_ARCH_IOP33X) += cp6.o
 obj-$(CONFIG_ARCH_IOP33X) += adma.o
 obj-$(CONFIG_ARCH_IOP33X) += pmu.o
+obj-$(CONFIG_ARCH_IOP33X) += restart.o
 
 # IOP13XX
 obj-$(CONFIG_ARCH_IOP13XX) += cp6.o
diff --git a/arch/arm/plat-iop/io.c b/arch/arm/plat-iop/io.c
deleted file mode 100644 (file)
index e15bc17..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * iop3xx custom ioremap implementation
- * Copyright (c) 2006, Intel Corporation.
- *
- * 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
- *
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/io.h>
-#include <mach/hardware.h>
-
-void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
-       unsigned int mtype)
-{
-       void __iomem * retval;
-
-       switch (cookie) {
-       case IOP3XX_PCI_LOWER_IO_PA ... IOP3XX_PCI_UPPER_IO_PA:
-               retval = (void *) IOP3XX_PCI_IO_PHYS_TO_VIRT(cookie);
-               break;
-       case IOP3XX_PERIPHERAL_PHYS_BASE ... IOP3XX_PERIPHERAL_UPPER_PA:
-               retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie);
-               break;
-       default:
-               retval = __arm_ioremap_caller(cookie, size, mtype,
-                               __builtin_return_address(0));
-       }
-
-       return retval;
-}
-EXPORT_SYMBOL(__iop3xx_ioremap);
-
-void __iop3xx_iounmap(void __iomem *addr)
-{
-       extern void __iounmap(volatile void __iomem *addr);
-
-       switch ((u32) addr) {
-       case IOP3XX_PCI_LOWER_IO_VA ... IOP3XX_PCI_UPPER_IO_VA:
-       case IOP3XX_PERIPHERAL_VIRT_BASE ... IOP3XX_PERIPHERAL_UPPER_VA:
-               goto skip;
-       }
-       __iounmap(addr);
-
-skip:
-       return;
-}
-EXPORT_SYMBOL(__iop3xx_iounmap);
diff --git a/arch/arm/plat-iop/restart.c b/arch/arm/plat-iop/restart.c
new file mode 100644 (file)
index 0000000..6a85a0c
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * restart.c
+ *
+ * Copyright (C) 2001 MontaVista Software, 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 <asm/hardware/iop3xx.h>
+#include <mach/hardware.h>
+
+void iop3xx_restart(char mode, const char *cmd)
+{
+       *IOP3XX_PCSR = 0x30;
+
+       /* Jump into ROM at address 0 */
+       soft_restart(0);
+}
index b3a1f2b3ada3bcb2f699b7a1e86bda0a1e866acb..cbc290a087e2ee5e6d513ff420ee8a12c15d14fd 100644 (file)
@@ -17,25 +17,16 @@ config ARCH_IMX_V4_V5
          and ARMv5 SoCs
 
 config ARCH_IMX_V6_V7
-       bool "i.MX3, i.MX6"
+       bool "i.MX3, i.MX5, i.MX6"
        select AUTO_ZRELADDR if !ZBOOT_ROM
        select ARM_PATCH_PHYS_VIRT
        help
-         This enables support for systems based on the Freescale i.MX3 and i.MX6
-         family.
-
-config ARCH_MX5
-       bool "i.MX50, i.MX51, i.MX53"
-       select AUTO_ZRELADDR if !ZBOOT_ROM
-       select ARM_PATCH_PHYS_VIRT
-       help
-         This enables support for machines using Freescale's i.MX50 and i.MX53
-         processors.
+         This enables support for systems based on the Freescale i.MX3, i.MX5
+         and i.MX6 family.
 
 endchoice
 
 source "arch/arm/mach-imx/Kconfig"
-source "arch/arm/mach-mx5/Kconfig"
 
 endmenu
 
index b9f0f5f499a4e7906f19e69568c59938adcd5fcf..076db84f3e3183a47096cded0ac90abf50aa23b4 100644 (file)
@@ -5,7 +5,6 @@
 # Common support
 obj-y := clock.o time.o devices.o cpu.o system.o irq-common.o
 
-obj-$(CONFIG_ARM_GIC) += gic.o
 obj-$(CONFIG_MXC_TZIC) += tzic.o
 obj-$(CONFIG_MXC_AVIC) += avic.o
 
diff --git a/arch/arm/plat-mxc/gic.c b/arch/arm/plat-mxc/gic.c
deleted file mode 100644 (file)
index 12f8f81..0000000
+++ /dev/null
@@ -1,41 +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/io.h>
-#include <asm/exception.h>
-#include <asm/localtimer.h>
-#include <asm/hardware/gic.h>
-#ifdef CONFIG_SMP
-#include <asm/smp.h>
-#endif
-
-asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
-{
-       u32 irqstat, irqnr;
-
-       do {
-               irqstat = readl_relaxed(gic_cpu_base_addr + GIC_CPU_INTACK);
-               irqnr = irqstat & 0x3ff;
-               if (irqnr == 1023)
-                       break;
-
-               if (irqnr > 15 && irqnr < 1021)
-                       handle_IRQ(irqnr, regs);
-#ifdef CONFIG_SMP
-               else {
-                       writel_relaxed(irqstat, gic_cpu_base_addr +
-                                               GIC_CPU_EOI);
-                       handle_IPI(irqnr, regs);
-               }
-#endif
-       } while (1);
-}
index c75f254abd857c07e6f8133716b51d5925f17581..83cca9bcfc972729fd74fecc8ce1272189d04b6a 100644 (file)
@@ -71,8 +71,8 @@ extern int mx6q_clocks_init(void);
 extern struct platform_device *mxc_register_gpio(char *name, int id,
        resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
 extern void mxc_set_cpu_type(unsigned int type);
+extern void mxc_restart(char, const char *);
 extern void mxc_arch_reset_init(void __iomem *);
-extern void mx51_efikamx_reset(void);
 extern int mx53_revision(void);
 extern int mx53_display_revision(void);
 
@@ -89,7 +89,6 @@ extern void imx_print_silicon_rev(const char *cpu, int srev);
 
 void avic_handle_irq(struct pt_regs *);
 void tzic_handle_irq(struct pt_regs *);
-void gic_handle_irq(struct pt_regs *);
 
 #define imx1_handle_irq avic_handle_irq
 #define imx21_handle_irq avic_handle_irq
@@ -122,6 +121,7 @@ static inline void imx_smp_prepare(void) {}
 extern void imx_enable_cpu(int cpu, bool enable);
 extern void imx_set_cpu_jump(int cpu, void *jump_addr);
 extern void imx_src_init(void);
+extern void imx_src_prepare_restart(void);
 extern void imx_gpc_init(void);
 extern void imx_gpc_pre_suspend(void);
 extern void imx_gpc_post_resume(void);
index ca5cf26a04b1c9f16bf3e455afd4fa4098a7048e..def5d30cb67e83ce918bae06c055d1fa2d1842ea 100644 (file)
@@ -9,19 +9,8 @@
  * published by the Free Software Foundation.
  */
 
-/* Unused, we use CONFIG_MULTI_IRQ_HANDLER */
-
        .macro  disable_fiq
        .endm
 
-       .macro  get_irqnr_preamble, base, tmp
-       .endm
-
        .macro  arch_ret_to_user, tmp1, tmp2
        .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       .endm
-
-       .macro test_for_ipi, irqnr, irqstat, base, tmp
-       .endm
index 97b19e7800bc15989011056e066009ef3df771e2..2b7c08d13e89be022848ced8f176a9760d0ce86d 100644 (file)
@@ -12,8 +12,6 @@
 #ifndef __MACH_MX1_H__
 #define __MACH_MX1_H__
 
-#include <mach/vmalloc.h>
-
 /*
  * Memory map
  */
index b9895d250167cf6b384d5cb1320e00e855537019..13ad0df2e86065bf43cb8882fab90e4fed5b4957 100644 (file)
@@ -22,6 +22,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-void arch_reset(char mode, const char *cmd);
-
 #endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/vmalloc.h b/arch/arm/plat-mxc/include/mach/vmalloc.h
deleted file mode 100644 (file)
index ef6379c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *  Copyright (C) 2000 Russell King.
- *  Copyright 2004-2007 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.
- */
-
-#ifndef __ASM_ARCH_MXC_VMALLOC_H__
-#define __ASM_ARCH_MXC_VMALLOC_H__
-
-/* vmalloc ending address */
-#define VMALLOC_END       0xf4000000UL
-
-#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
index d65fb31a55ca47ef350e38da864b6d34cf5295f9..3599bf2cfd4f7a351717bb3abdd2f54160d4d712 100644 (file)
@@ -37,17 +37,10 @@ static void __iomem *wdog_base;
 /*
  * Reset the system. It is called by machine_restart().
  */
-void arch_reset(char mode, const char *cmd)
+void mxc_restart(char mode, const char *cmd)
 {
        unsigned int wcr_enable;
 
-#ifdef CONFIG_MACH_MX51_EFIKAMX
-       if (machine_is_mx51_efikamx()) {
-               mx51_efikamx_reset();
-               return;
-       }
-#endif
-
        if (cpu_is_mx1()) {
                wcr_enable = (1 << 0);
        } else {
@@ -71,7 +64,7 @@ void arch_reset(char mode, const char *cmd)
        mdelay(50);
 
        /* we'll take a jump through zero as a poor second */
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 void mxc_arch_reset_init(void __iomem *base)
index 985262242f25d994399511fa964b434c47cb18d6..3df04d944e4d1497f4e74475acac603e163af24c 100644 (file)
@@ -4,7 +4,7 @@
 
 # Common support
 obj-y := common.o sram.o clock.o devices.o dma.o mux.o \
-        usb.o fb.o io.o counter_32k.o
+        usb.o fb.o counter_32k.o
 obj-m :=
 obj-n :=
 obj-  :=
index d9f10a31e6042df965be23d899111de230bb493f..06383b51e6553b0aab931cab4f700972e9e52514 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/dma-mapping.h>
 #include <linux/omapfb.h>
 
 #include <plat/common.h>
@@ -21,6 +22,8 @@
 #include <plat/vram.h>
 #include <plat/dsp.h>
 
+#include <plat/omap-secure.h>
+
 
 #define NO_LENGTH_CHECK 0xffffffff
 
@@ -65,4 +68,12 @@ void __init omap_reserve(void)
        omapfb_reserve_sdram_memblock();
        omap_vram_reserve_sdram_memblock();
        omap_dsp_reserve_sdram_memblock();
+       omap_secure_ram_reserve_memblock();
+}
+
+void __init omap_init_consistent_dma_size(void)
+{
+#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
+       init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
+#endif
 }
index 387a9638991b78a47514a0fd5d811f0ea25b3984..b299b8d201c8ba22fffc7c0991edbd30842a5dc5 100644 (file)
@@ -40,6 +40,7 @@ struct omap_clk {
 #define CK_443X                (1 << 11)
 #define CK_TI816X      (1 << 12)
 #define CK_446X                (1 << 13)
+#define CK_1710                (1 << 15)       /* 1710 extra for rate selection */
 
 
 #define CK_34XX                (CK_3430ES1 | CK_3430ES2PLUS)
index 3ff3e36580f267df6890712efef55e8ee22bdbc7..257f9770b2da2faa38d3de32550963f0124d611c 100644 (file)
 #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
 #define __ARCH_ARM_MACH_OMAP_COMMON_H
 
-#include <linux/delay.h>
-
 #include <plat/i2c.h>
 #include <plat/omap_hwmod.h>
 
-struct sys_timer;
-
-extern void omap_map_common_io(void);
-extern struct sys_timer omap1_timer;
-extern struct sys_timer omap2_timer;
-extern struct sys_timer omap3_timer;
-extern struct sys_timer omap3_secure_timer;
-extern struct sys_timer omap4_timer;
-extern bool omap_32k_timer_init(void);
 extern int __init omap_init_clocksource_32k(void);
 extern unsigned long long notrace omap_32k_sched_clock(void);
 
 extern void omap_reserve(void);
-
-void omap2420_init_early(void);
-void omap2430_init_early(void);
-void omap3430_init_early(void);
-void omap35xx_init_early(void);
-void omap3630_init_early(void);
-void omap3_init_early(void);   /* Do not use this one */
-void am35xx_init_early(void);
-void ti816x_init_early(void);
-void omap4430_init_early(void);
-
 extern int omap_dss_reset(struct omap_hwmod *);
 
 void omap_sram_init(void);
 
-/*
- * IO bases for various OMAP processors
- * Except the tap base, rest all the io bases
- * listed are physical addresses.
- */
-struct omap_globals {
-       u32             class;          /* OMAP class to detect */
-       void __iomem    *tap;           /* Control module ID code */
-       void __iomem    *sdrc;           /* SDRAM Controller */
-       void __iomem    *sms;            /* SDRAM Memory Scheduler */
-       void __iomem    *ctrl;           /* System Control Module */
-       void __iomem    *ctrl_pad;      /* PAD Control Module */
-       void __iomem    *prm;            /* Power and Reset Management */
-       void __iomem    *cm;             /* Clock Management */
-       void __iomem    *cm2;
-};
-
-void omap2_set_globals_242x(void);
-void omap2_set_globals_243x(void);
-void omap2_set_globals_3xxx(void);
-void omap2_set_globals_443x(void);
-void omap2_set_globals_ti816x(void);
-
-/* These get called from omap2_set_globals_xxxx(), do not call these */
-void omap2_set_globals_tap(struct omap_globals *);
-void omap2_set_globals_sdrc(struct omap_globals *);
-void omap2_set_globals_control(struct omap_globals *);
-void omap2_set_globals_prcm(struct omap_globals *);
-
-void omap242x_map_io(void);
-void omap243x_map_io(void);
-void omap3_map_io(void);
-void omap4_map_io(void);
-
-
-/**
- * omap_test_timeout - busy-loop, testing a condition
- * @cond: condition to test until it evaluates to true
- * @timeout: maximum number of microseconds in the timeout
- * @index: loop index (integer)
- *
- * Loop waiting for @cond to become true or until at least @timeout
- * microseconds have passed.  To use, define some integer @index in the
- * calling code.  After running, if @index == @timeout, then the loop has
- * timed out.
- */
-#define omap_test_timeout(cond, timeout, index)                        \
-({                                                             \
-       for (index = 0; index < timeout; index++) {             \
-               if (cond)                                       \
-                       break;                                  \
-               udelay(1);                                      \
-       }                                                       \
-})
-
-extern struct device *omap2_get_mpuss_device(void);
-extern struct device *omap2_get_iva_device(void);
-extern struct device *omap2_get_l3_device(void);
-extern struct device *omap4_get_dsp_device(void);
-
 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
index 7f2969eadb857cd09b5797840e5359a343adcfb9..1234944a4da06870fbd11cf9bb2725f05c876f4a 100644 (file)
  * NOTE: Please use ioremap + __raw_read/write where possible instead of these
  */
 
-void omap_ioremap_init(void);
-
 extern u8 omap_readb(u32 pa);
 extern u16 omap_readw(u32 pa);
 extern u32 omap_readl(u32 pa);
@@ -257,83 +255,9 @@ extern void omap_writew(u16 v, u32 pa);
 extern void omap_writel(u32 v, u32 pa);
 
 struct omap_sdrc_params;
-
-#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
-void omap7xx_map_io(void);
-#else
-static inline void omap_map_io(void)
-{
-}
-#endif
-
-#ifdef CONFIG_ARCH_OMAP15XX
-void omap15xx_map_io(void);
-#else
-static inline void omap15xx_map_io(void)
-{
-}
-#endif
-
-#ifdef CONFIG_ARCH_OMAP16XX
-void omap16xx_map_io(void);
-#else
-static inline void omap16xx_map_io(void)
-{
-}
-#endif
-
-void omap1_init_early(void);
-
-#ifdef CONFIG_SOC_OMAP2420
-extern void omap242x_map_common_io(void);
-#else
-static inline void omap242x_map_common_io(void)
-{
-}
-#endif
-
-#ifdef CONFIG_SOC_OMAP2430
-extern void omap243x_map_common_io(void);
-#else
-static inline void omap243x_map_common_io(void)
-{
-}
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-extern void omap34xx_map_common_io(void);
-#else
-static inline void omap34xx_map_common_io(void)
-{
-}
-#endif
-
-#ifdef CONFIG_SOC_OMAPTI816X
-extern void omapti816x_map_common_io(void);
-#else
-static inline void omapti816x_map_common_io(void)
-{
-}
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-extern void omap44xx_map_common_io(void);
-#else
-static inline void omap44xx_map_common_io(void)
-{
-}
-#endif
-
-extern void omap2_init_common_infrastructure(void);
 extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
                                      struct omap_sdrc_params *sdrc_cs1);
 
-#define __arch_ioremap omap_ioremap
-#define __arch_iounmap omap_iounmap
-
-void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
-void omap_iounmap(volatile void __iomem *addr);
-
 extern void __init omap_init_consistent_dma_size(void);
 
 #endif
index 30e10719b774853e2247badf8a414111408c8fac..ebda7382c65b2d53d7002b208c3456b1e6c351bf 100644 (file)
 #define INTCPS_NR_MIR_REGS     3
 #define INTCPS_NR_IRQS         96
 
-#ifndef __ASSEMBLY__
-extern void __iomem *omap_irq_base;
-void omap1_init_irq(void);
-void omap2_init_irq(void);
-void omap3_init_irq(void);
-void ti816x_init_irq(void);
-extern int omap_irq_pending(void);
-void omap_intc_save_context(void);
-void omap_intc_restore_context(void);
-void omap3_intc_suspend(void);
-void omap3_intc_prepare_idle(void);
-void omap3_intc_resume_idle(void);
-#endif
-
 #include <mach/hardware.h>
 
 #ifdef CONFIG_FIQ
diff --git a/arch/arm/plat-omap/include/plat/omap-secure.h b/arch/arm/plat-omap/include/plat/omap-secure.h
new file mode 100644 (file)
index 0000000..64f9d1c
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __OMAP_SECURE_H__
+#define __OMAP_SECURE_H__
+
+#include <linux/types.h>
+
+#ifdef CONFIG_ARCH_OMAP2PLUS
+extern int omap_secure_ram_reserve_memblock(void);
+#else
+static inline void omap_secure_ram_reserve_memblock(void)
+{ }
+#endif
+
+#endif /* __OMAP_SECURE_H__ */
index ea2b8a6306e7e4d3555fddf8f60856e917586a9f..c0d478e55c84c155cc20e2cd9031b83c08b7e178 100644 (file)
@@ -45,6 +45,7 @@
 #define OMAP44XX_WKUPGEN_BASE          0x48281000
 #define OMAP44XX_MCPDM_BASE            0x40132000
 #define OMAP44XX_MCPDM_L3_BASE         0x49032000
+#define OMAP44XX_SAR_RAM_BASE          0x4a326000
 
 #define OMAP44XX_MAILBOX_BASE          (L4_44XX_BASE + 0xF4000)
 #define OMAP44XX_HSUSB_OTG_BASE                (L4_44XX_BASE + 0xAB000)
index f500fc34d06595254fb8688cb7c633a7807c113d..75aa1b2bef519eaa8958c37a7050df66c022848a 100644 (file)
@@ -95,6 +95,10 @@ static inline void omap_push_sram_idle(void) {}
  */
 #define OMAP2_SRAM_PA          0x40200000
 #define OMAP3_SRAM_PA           0x40200000
+#ifdef CONFIG_OMAP4_ERRATA_I688
+#define OMAP4_SRAM_PA          0x40304000
+#define OMAP4_SRAM_VA          0xfe404000
+#else
 #define OMAP4_SRAM_PA          0x40300000
-
+#endif
 #endif
index c5fa9e92900947e3ca41be37c4edb397146aa069..8e5ebd74b129389b10cd02cc138765fc8ca8e8f9 100644 (file)
@@ -12,6 +12,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-extern void (*arch_reset)(char, const char *);
-
 #endif
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
deleted file mode 100644 (file)
index 333871f..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Common io.c file
- * This file is created by Russell King <rmk+kernel@arm.linux.org.uk>
- *
- * Copyright (C) 2009 Texas Instruments
- * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
- *
- * 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/module.h>
-#include <linux/io.h>
-#include <linux/mm.h>
-#include <linux/dma-mapping.h>
-
-#include <plat/omap7xx.h>
-#include <plat/omap1510.h>
-#include <plat/omap16xx.h>
-#include <plat/omap24xx.h>
-#include <plat/omap34xx.h>
-#include <plat/omap44xx.h>
-
-#define BETWEEN(p,st,sz)       ((p) >= (st) && (p) < ((st) + (sz)))
-#define XLATE(p,pst,vst)       ((void __iomem *)((p) - (pst) + (vst)))
-
-static int initialized;
-
-/*
- * Intercept ioremap() requests for addresses in our fixed mapping regions.
- */
-void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
-{
-
-       WARN(!initialized, "Do not use ioremap before init_early\n");
-
-#ifdef CONFIG_ARCH_OMAP1
-       if (cpu_class_is_omap1()) {
-               if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE))
-                       return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT);
-       }
-       if (cpu_is_omap7xx()) {
-               if (BETWEEN(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_SIZE))
-                       return XLATE(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_START);
-
-               if (BETWEEN(p, OMAP7XX_DSPREG_BASE, OMAP7XX_DSPREG_SIZE))
-                       return XLATE(p, OMAP7XX_DSPREG_BASE,
-                                       OMAP7XX_DSPREG_START);
-       }
-       if (cpu_is_omap15xx()) {
-               if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE))
-                       return XLATE(p, OMAP1510_DSP_BASE, OMAP1510_DSP_START);
-
-               if (BETWEEN(p, OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_SIZE))
-                       return XLATE(p, OMAP1510_DSPREG_BASE,
-                                       OMAP1510_DSPREG_START);
-       }
-       if (cpu_is_omap16xx()) {
-               if (BETWEEN(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_SIZE))
-                       return XLATE(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_START);
-
-               if (BETWEEN(p, OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_SIZE))
-                       return XLATE(p, OMAP16XX_DSPREG_BASE,
-                                       OMAP16XX_DSPREG_START);
-       }
-#endif
-#ifdef CONFIG_ARCH_OMAP2
-       if (cpu_is_omap24xx()) {
-               if (BETWEEN(p, L3_24XX_PHYS, L3_24XX_SIZE))
-                       return XLATE(p, L3_24XX_PHYS, L3_24XX_VIRT);
-               if (BETWEEN(p, L4_24XX_PHYS, L4_24XX_SIZE))
-                       return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT);
-       }
-       if (cpu_is_omap2420()) {
-               if (BETWEEN(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_SIZE))
-                       return XLATE(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_VIRT);
-               if (BETWEEN(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE))
-                       return XLATE(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE);
-               if (BETWEEN(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_SIZE))
-                       return XLATE(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_VIRT);
-       }
-       if (cpu_is_omap2430()) {
-               if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE))
-                       return XLATE(p, L4_WK_243X_PHYS, L4_WK_243X_VIRT);
-               if (BETWEEN(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_SIZE))
-                       return XLATE(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_VIRT);
-               if (BETWEEN(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_SIZE))
-                       return XLATE(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_VIRT);
-               if (BETWEEN(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_SIZE))
-                       return XLATE(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_VIRT);
-       }
-#endif
-#ifdef CONFIG_ARCH_OMAP3
-       if (cpu_is_ti816x()) {
-               if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
-                       return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
-       } else if (cpu_is_omap34xx()) {
-               if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))
-                       return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);
-               if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
-                       return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
-               if (BETWEEN(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_SIZE))
-                       return XLATE(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_VIRT);
-               if (BETWEEN(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_SIZE))
-                       return XLATE(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_VIRT);
-               if (BETWEEN(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_SIZE))
-                       return XLATE(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_VIRT);
-               if (BETWEEN(p, L4_PER_34XX_PHYS, L4_PER_34XX_SIZE))
-                       return XLATE(p, L4_PER_34XX_PHYS, L4_PER_34XX_VIRT);
-               if (BETWEEN(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_SIZE))
-                       return XLATE(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_VIRT);
-       }
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-       if (cpu_is_omap44xx()) {
-               if (BETWEEN(p, L3_44XX_PHYS, L3_44XX_SIZE))
-                       return XLATE(p, L3_44XX_PHYS, L3_44XX_VIRT);
-               if (BETWEEN(p, L4_44XX_PHYS, L4_44XX_SIZE))
-                       return XLATE(p, L4_44XX_PHYS, L4_44XX_VIRT);
-               if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE))
-                       return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT);
-               if (BETWEEN(p, OMAP44XX_EMIF1_PHYS, OMAP44XX_EMIF1_SIZE))
-                       return XLATE(p, OMAP44XX_EMIF1_PHYS,            \
-                                                       OMAP44XX_EMIF1_VIRT);
-               if (BETWEEN(p, OMAP44XX_EMIF2_PHYS, OMAP44XX_EMIF2_SIZE))
-                       return XLATE(p, OMAP44XX_EMIF2_PHYS,            \
-                                                       OMAP44XX_EMIF2_VIRT);
-               if (BETWEEN(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_SIZE))
-                       return XLATE(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_VIRT);
-               if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE))
-                       return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT);
-               if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE))
-                       return XLATE(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_VIRT);
-       }
-#endif
-       return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
-}
-EXPORT_SYMBOL(omap_ioremap);
-
-void omap_iounmap(volatile void __iomem *addr)
-{
-       unsigned long virt = (unsigned long)addr;
-
-       if (virt >= VMALLOC_START && virt < VMALLOC_END)
-               __iounmap(addr);
-}
-EXPORT_SYMBOL(omap_iounmap);
-
-void __init omap_init_consistent_dma_size(void)
-{
-#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
-       init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
-#endif
-}
-
-void __init omap_ioremap_init(void)
-{
-       initialized++;
-}
index 8b28664d1c62634b0d8ec68e62f1a23a5d06a27a..4243bdcc87bcb99fe8ba3f26341757cd47ea41d9 100644 (file)
 #define OMAP1_SRAM_PA          0x20000000
 #define OMAP2_SRAM_PUB_PA      (OMAP2_SRAM_PA + 0xf800)
 #define OMAP3_SRAM_PUB_PA       (OMAP3_SRAM_PA + 0x8000)
+#ifdef CONFIG_OMAP4_ERRATA_I688
+#define OMAP4_SRAM_PUB_PA      OMAP4_SRAM_PA
+#else
 #define OMAP4_SRAM_PUB_PA      (OMAP4_SRAM_PA + 0x4000)
+#endif
 
 #if defined(CONFIG_ARCH_OMAP2PLUS)
 #define SRAM_BOOTLOADER_SZ     0x00
@@ -141,11 +145,9 @@ static void __init omap_detect_sram(void)
                        omap_sram_size = 0x32000;       /* 200K */
                else if (cpu_is_omap15xx())
                        omap_sram_size = 0x30000;       /* 192K */
-               else if (cpu_is_omap1610() || cpu_is_omap1621() ||
-                    cpu_is_omap1710())
+               else if (cpu_is_omap1610() || cpu_is_omap1611() ||
+                               cpu_is_omap1621() || cpu_is_omap1710())
                        omap_sram_size = 0x4000;        /* 16K */
-               else if (cpu_is_omap1611())
-                       omap_sram_size = SZ_256K;
                else {
                        pr_err("Could not detect SRAM size\n");
                        omap_sram_size = 0x4000;
@@ -163,6 +165,10 @@ static void __init omap_map_sram(void)
        if (omap_sram_size == 0)
                return;
 
+#ifdef CONFIG_OMAP4_ERRATA_I688
+               omap_sram_start += PAGE_SIZE;
+               omap_sram_size -= SZ_16K;
+#endif
        if (cpu_is_omap34xx()) {
                /*
                 * SRAM must be marked as non-cached on OMAP3 since the
@@ -224,6 +230,9 @@ static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl);
 void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl)
 {
        BUG_ON(!_omap_sram_reprogram_clock);
+       /* On 730, bit 13 must always be 1 */
+       if (cpu_is_omap7xx())
+               ckctl |= 0x2000;
        _omap_sram_reprogram_clock(dpllctl, ckctl);
 }
 
diff --git a/arch/arm/plat-pxa/include/plat/gpio-pxa.h b/arch/arm/plat-pxa/include/plat/gpio-pxa.h
deleted file mode 100644 (file)
index b6390be..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef __PLAT_PXA_GPIO_H
-#define __PLAT_PXA_GPIO_H
-
-struct irq_data;
-
-/*
- * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with
- * one set of registers. The register offsets are organized below:
- *
- *           GPLR    GPDR    GPSR    GPCR    GRER    GFER    GEDR
- * BANK 0 - 0x0000  0x000C  0x0018  0x0024  0x0030  0x003C  0x0048
- * BANK 1 - 0x0004  0x0010  0x001C  0x0028  0x0034  0x0040  0x004C
- * BANK 2 - 0x0008  0x0014  0x0020  0x002C  0x0038  0x0044  0x0050
- *
- * BANK 3 - 0x0100  0x010C  0x0118  0x0124  0x0130  0x013C  0x0148
- * BANK 4 - 0x0104  0x0110  0x011C  0x0128  0x0134  0x0140  0x014C
- * BANK 5 - 0x0108  0x0114  0x0120  0x012C  0x0138  0x0144  0x0150
- *
- * NOTE:
- *   BANK 3 is only available on PXA27x and later processors.
- *   BANK 4 and 5 are only available on PXA935
- */
-
-#define GPIO_BANK(n)   (GPIO_REGS_VIRT + BANK_OFF(n))
-
-#define GPLR_OFFSET    0x00
-#define GPDR_OFFSET    0x0C
-#define GPSR_OFFSET    0x18
-#define GPCR_OFFSET    0x24
-#define GRER_OFFSET    0x30
-#define GFER_OFFSET    0x3C
-#define GEDR_OFFSET    0x48
-
-/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
- * Those cases currently cause holes in the GPIO number space, the
- * actual number of the last GPIO is recorded by 'pxa_last_gpio'.
- */
-extern int pxa_last_gpio;
-
-typedef int (*set_wake_t)(struct irq_data *d, unsigned int on);
-
-extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn);
-
-#endif /* __PLAT_PXA_GPIO_H */
diff --git a/arch/arm/plat-pxa/include/plat/gpio.h b/arch/arm/plat-pxa/include/plat/gpio.h
deleted file mode 100644 (file)
index 258f772..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __PLAT_GPIO_H
-#define __PLAT_GPIO_H
-
-#define __ARM_GPIOLIB_COMPLEX
-
-/* The individual machine provides register offsets and NR_BUILTIN_GPIO */
-#include <mach/gpio-pxa.h>
-
-static inline int gpio_get_value(unsigned gpio)
-{
-       if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO))
-               return GPLR(gpio) & GPIO_bit(gpio);
-       else
-               return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
-       if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) {
-               if (value)
-                       GPSR(gpio) = GPIO_bit(gpio);
-               else
-                       GPCR(gpio) = GPIO_bit(gpio);
-       } else
-               __gpio_set_value(gpio, value);
-}
-
-#define gpio_cansleep          __gpio_cansleep
-
-#endif /* __PLAT_GPIO_H */
index 3c6335307fb12afd53cf3b9bdbee6cc0983f1a86..1121df13e15f52de91d7d30ee41399950e60ee72 100644 (file)
@@ -192,27 +192,6 @@ static unsigned long s3c24xx_read_idcode_v4(void)
        return __raw_readl(S3C2410_GSTATUS1);
 }
 
-/* Hook for arm_pm_restart to ensure we execute the reset code
- * with the caches enabled. It seems at least the S3C2440 has a problem
- * resetting if there is bus activity interrupted by the reset.
- */
-static void s3c24xx_pm_restart(char mode, const char *cmd)
-{
-       if (mode != 's') {
-               unsigned long flags;
-
-               local_irq_save(flags);
-               __cpuc_flush_kern_all();
-               __cpuc_flush_user_all();
-
-               arch_reset(mode, cmd);
-               local_irq_restore(flags);
-       }
-
-       /* fallback, or unhandled */
-       arm_machine_restart(mode, cmd);
-}
-
 void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
 {
        /* initialise the io descriptors we need for initialisation */
@@ -226,7 +205,5 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
        }
        s3c24xx_init_cpu();
 
-       arm_pm_restart = s3c24xx_pm_restart;
-
        s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
 }
index 53754bcf15a758c05b536f5836c2efb6ea2ba57d..9fe35348e03b433d5294cfcd02c1742c268f3391 100644 (file)
@@ -1437,11 +1437,10 @@ int __init s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel)
        size_t map_sz = sizeof(*nmap) * sel->map_size;
        int ptr;
 
-       nmap = kmalloc(map_sz, GFP_KERNEL);
+       nmap = kmemdup(sel->map, map_sz, GFP_KERNEL);
        if (nmap == NULL)
                return -ENOMEM;
 
-       memcpy(nmap, sel->map, map_sz);
        memcpy(&dma_sel, sel, sizeof(*sel));
 
        dma_sel.map = nmap;
index 5a21b15b2a978e01b016b7309a4e5585a6ee995a..95e68190d59305bbe0d65787abd1f3c66cd151b7 100644 (file)
@@ -297,13 +297,6 @@ static struct clksrc_clk clk_usb_bus_host = {
 
 static struct clksrc_clk clksrc_clks[] = {
        {
-               /* ART baud-rate clock sourced from esysclk via a divisor */
-               .clk    = {
-                       .name           = "uartclk",
-                       .parent         = &clk_esysclk.clk,
-               },
-               .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 },
-       }, {
                /* camera interface bus-clock, divided down from esysclk */
                .clk    = {
                        .name           = "camif-upll", /* same as 2440 name */
@@ -323,6 +316,15 @@ static struct clksrc_clk clksrc_clks[] = {
        },
 };
 
+static struct clksrc_clk clk_esys_uart = {
+       /* ART baud-rate clock sourced from esysclk via a divisor */
+       .clk    = {
+               .name           = "uartclk",
+               .parent         = &clk_esysclk.clk,
+       },
+       .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 },
+};
+
 static struct clk clk_i2s_ext = {
        .name           = "i2s-ext",
 };
@@ -424,12 +426,6 @@ static struct clk init_clocks[] = {
                .parent         = &clk_h,
                .enable         = s3c2443_clkcon_enable_h,
                .ctrlbit        = S3C2443_HCLKCON_DMA5,
-       }, {
-               .name           = "hsmmc",
-               .devname        = "s3c-sdhci.1",
-               .parent         = &clk_h,
-               .enable         = s3c2443_clkcon_enable_h,
-               .ctrlbit        = S3C2443_HCLKCON_HSMMC,
        }, {
                .name           = "gpio",
                .parent         = &clk_p,
@@ -512,6 +508,14 @@ static struct clk init_clocks[] = {
        }
 };
 
+static struct clk hsmmc1_clk = {
+       .name           = "hsmmc",
+       .devname        = "s3c-sdhci.1",
+       .parent         = &clk_h,
+       .enable         = s3c2443_clkcon_enable_h,
+       .ctrlbit        = S3C2443_HCLKCON_HSMMC,
+};
+
 static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0)
 {
        clkcon0 &= S3C2443_CLKDIV0_HCLKDIV_MASK;
@@ -577,6 +581,7 @@ static struct clk *clks[] __initdata = {
        &clk_epll,
        &clk_usb_bus,
        &clk_armdiv,
+       &hsmmc1_clk,
 };
 
 static struct clksrc_clk *clksrcs[] __initdata = {
@@ -589,6 +594,13 @@ static struct clksrc_clk *clksrcs[] __initdata = {
        &clk_arm,
 };
 
+static struct clk_lookup s3c2443_clk_lookup[] = {
+       CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk),
+       CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
+       CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_esys_uart.clk),
+       CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &hsmmc1_clk),
+};
+
 void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
                                       unsigned int *divs, int nr_divs,
                                       int divmask)
@@ -618,6 +630,7 @@ void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
        /* See s3c2443/etc notes on disabling clocks at init time */
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
+       clkdev_add_table(s3c2443_clk_lookup, ARRAY_SIZE(s3c2443_clk_lookup));
 
        s3c2443_common_setup_clocks(get_mpll);
 }
index 9b9968fa8695b05b0fa4edb3784dc90fd000126f..8167ce66188c65c19f6d9efda34b718f7acf7c0b 100644 (file)
@@ -11,6 +11,7 @@ config PLAT_S5P
        default y
        select ARM_VIC if !ARCH_EXYNOS4
        select ARM_GIC if ARCH_EXYNOS4
+       select GIC_NON_BANKED if ARCH_EXYNOS4
        select NO_IOPORT
        select ARCH_REQUIRE_GPIOLIB
        select S3C_GPIO_TRACK
index 313eb26cfa62cb6e953ef865ba260e6e5ee23393..bb0af66bb487994bd90a510fd1b78c14bd1a1747 100644 (file)
@@ -88,12 +88,20 @@ config S5P_GPIO_DRVSTR
 
 config SAMSUNG_GPIO_EXTRA
        int "Number of additional GPIO pins"
+       default 128 if SAMSUNG_GPIO_EXTRA128
+       default 64 if SAMSUNG_GPIO_EXTRA64
        default 0
        help
          Use additional GPIO space in addition to the GPIO's the SOC
          provides. This allows expanding the GPIO space for use with
          GPIO expanders.
 
+config SAMSUNG_GPIO_EXTRA64
+       bool
+
+config SAMSUNG_GPIO_EXTRA128
+       bool
+
 config S3C_GPIO_SPACE
        int "Space between gpio banks"
        default 0
index e657305644cc27140f8c878d99e34ac2ea668ac0..a976c023b286b4a1b991cfa63c2dc93e9912151d 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/slab.h>
 #include <linux/io.h>
 #include <linux/pwm_backlight.h>
-#include <linux/slab.h>
 
 #include <plat/devs.h>
 #include <plat/gpio-cfg.h>
index 93a994a5dd8f546c53ea2d80af751336d0f84184..2cded872f22b3debd634282a408d67169ceff981 100644 (file)
 
 #include <mach/dma.h>
 
-static inline bool pl330_filter(struct dma_chan *chan, void *param)
-{
-       struct dma_pl330_peri *peri = chan->private;
-       return peri->peri_id == (unsigned)param;
-}
-
 static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
                                struct samsung_dma_info *info)
 {
        struct dma_chan *chan;
        dma_cap_mask_t mask;
        struct dma_slave_config slave_config;
+       void *filter_param;
 
        dma_cap_zero(mask);
        dma_cap_set(info->cap, mask);
 
-       chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
+       /*
+        * If a dma channel property of a device node from device tree is
+        * specified, use that as the fliter parameter.
+        */
+       filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop :
+                               (void *)dma_ch;
+       chan = dma_request_channel(mask, pl330_filter, filter_param);
 
        if (info->direction == DMA_FROM_DEVICE) {
                memset(&slave_config, 0, sizeof(struct dma_slave_config));
index 4c1a363526cf368cb995a0ee159db96c875d6da9..22eafc310bd7858a8fb10b39087fc6064e78e04c 100644 (file)
@@ -31,6 +31,7 @@ struct samsung_dma_info {
        enum dma_slave_buswidth width;
        dma_addr_t fifo;
        struct s3c2410_dma_client *client;
+       struct property *dt_dmach_prop;
 };
 
 struct samsung_dma_ops {
index 2e55e595867425ad0a6801bfa99ab220686c56c3..ecf23a830e737d9c6be23082ebd36a423e24e028 100644 (file)
@@ -21,7 +21,8 @@
  * use these just as IDs.
  */
 enum dma_ch {
-       DMACH_UART0_RX,
+       DMACH_DT_PROP = -1,
+       DMACH_UART0_RX = 0,
        DMACH_UART0_TX,
        DMACH_UART1_RX,
        DMACH_UART1_TX,
@@ -81,6 +82,14 @@ enum dma_ch {
        DMACH_SLIMBUS4_TX,
        DMACH_SLIMBUS5_RX,
        DMACH_SLIMBUS5_TX,
+       DMACH_MTOM_0,
+       DMACH_MTOM_1,
+       DMACH_MTOM_2,
+       DMACH_MTOM_3,
+       DMACH_MTOM_4,
+       DMACH_MTOM_5,
+       DMACH_MTOM_6,
+       DMACH_MTOM_7,
        /* END Marker, also used to denote a reserved channel */
        DMACH_MAX,
 };
index 08d1a7ef97b7e4a634e197893dc51cff29dd246a..df46b776976aca73c186226cfa505e01ae05eec3 100644 (file)
 #define S5P_IRQ_VIC2(x)                (S5P_VIC2_BASE + (x))
 #define S5P_IRQ_VIC3(x)                (S5P_VIC3_BASE + (x))
 
-#define S5P_TIMER_IRQ(x)       (11 + (x))
+#define S5P_TIMER_IRQ(x)       (IRQ_TIMER_BASE + (x))
 
 #define IRQ_TIMER0             S5P_TIMER_IRQ(0)
 #define IRQ_TIMER1             S5P_TIMER_IRQ(1)
 #define IRQ_TIMER2             S5P_TIMER_IRQ(2)
 #define IRQ_TIMER3             S5P_TIMER_IRQ(3)
 #define IRQ_TIMER4             S5P_TIMER_IRQ(4)
+#define IRQ_TIMER_COUNT                (5)
 
 #define IRQ_EINT(x)            ((x) < 16 ? ((x) + S5P_EINT_BASE1) \
                                        : ((x) - 16 + S5P_EINT_BASE2))
index 7207348470275d238a0446bbbb4e98f35dc7f36a..29c26a818842c41a679b09ec71bd9489e61f0c11 100644 (file)
@@ -71,6 +71,7 @@
 #define S3C2410_LCON_IRM          (1<<6)
 
 #define S3C2440_UCON_CLKMASK     (3<<10)
+#define S3C2440_UCON_CLKSHIFT    (10)
 #define S3C2440_UCON_PCLK        (0<<10)
 #define S3C2440_UCON_UCLK        (1<<10)
 #define S3C2440_UCON_PCLK2       (2<<10)
@@ -78,6 +79,7 @@
 #define S3C2443_UCON_EPLL        (3<<10)
 
 #define S3C6400_UCON_CLKMASK   (3<<10)
+#define S3C6400_UCON_CLKSHIFT  (10)
 #define S3C6400_UCON_PCLK      (0<<10)
 #define S3C6400_UCON_PCLK2     (2<<10)
 #define S3C6400_UCON_UCLK0     (1<<10)
 #define S3C2440_UCON_DIVSHIFT    (12)
 
 #define S3C2412_UCON_CLKMASK   (3<<10)
+#define S3C2412_UCON_CLKSHIFT  (10)
 #define S3C2412_UCON_UCLK      (1<<10)
 #define S3C2412_UCON_USYSCLK   (3<<10)
 #define S3C2412_UCON_PCLK      (0<<10)
 #define S3C2412_UCON_PCLK2     (2<<10)
 
+#define S3C2410_UCON_CLKMASK   (1 << 10)
+#define S3C2410_UCON_CLKSHIFT  (10)
 #define S3C2410_UCON_UCLK        (1<<10)
 #define S3C2410_UCON_SBREAK      (1<<4)
 
 
 /* Following are specific to S5PV210 */
 #define S5PV210_UCON_CLKMASK   (1<<10)
+#define S5PV210_UCON_CLKSHIFT  (10)
 #define S5PV210_UCON_PCLK      (0<<10)
 #define S5PV210_UCON_UCLK      (1<<10)
 
 #define S5PV210_UFSTAT_RXMASK  (255<<0)
 #define S5PV210_UFSTAT_RXSHIFT (0)
 
-#define NO_NEED_CHECK_CLKSRC   1
+#define S3C2410_UCON_CLKSEL0   (1 << 0)
+#define S3C2410_UCON_CLKSEL1   (1 << 1)
+#define S3C2410_UCON_CLKSEL2   (1 << 2)
+#define S3C2410_UCON_CLKSEL3   (1 << 3)
 
-#ifndef __ASSEMBLY__
+/* Default values for s5pv210 UCON and UFCON uart registers */
+#define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |        \
+                                S3C2410_UCON_RXILEVEL |        \
+                                S3C2410_UCON_TXIRQMODE |       \
+                                S3C2410_UCON_RXIRQMODE |       \
+                                S3C2410_UCON_RXFIFO_TOI |      \
+                                S3C2443_UCON_RXERR_IRQEN)
 
-/* struct s3c24xx_uart_clksrc
- *
- * this structure defines a named clock source that can be used for the
- * uart, so that the best clock can be selected for the requested baud
- * rate.
- *
- * min_baud and max_baud define the range of baud-rates this clock is
- * acceptable for, if they are both zero, it is assumed any baud rate that
- * can be generated from this clock will be used.
- *
- * divisor gives the divisor from the clock to the one seen by the uart
-*/
+#define S5PV210_UFCON_DEFAULT  (S3C2410_UFCON_FIFOMODE |       \
+                                S5PV210_UFCON_TXTRIG4 |        \
+                                S5PV210_UFCON_RXTRIG4)
 
-struct s3c24xx_uart_clksrc {
-       const char      *name;
-       unsigned int     divisor;
-       unsigned int     min_baud;
-       unsigned int     max_baud;
-};
+#ifndef __ASSEMBLY__
 
 /* configuration structure for per-machine configurations for the
  * serial port
@@ -257,15 +258,13 @@ struct s3c2410_uartcfg {
        unsigned char      unused;
        unsigned short     flags;
        upf_t              uart_flags;   /* default uart flags */
+       unsigned int       clk_sel;
 
        unsigned int       has_fracval;
 
        unsigned long      ucon;         /* value of ucon for port */
        unsigned long      ulcon;        /* value of ulcon for port */
        unsigned long      ufcon;        /* value of ufcon for port */
-
-       struct s3c24xx_uart_clksrc *clocks;
-       unsigned int                clocks_size;
 };
 
 /* s3c24xx_uart_devs
index 4c16fa3621bb813f1dbd80f25e9a987dbd5e04ca..c3d82a5f56306c4637acfdceddae7b34fd0e1cc7 100644 (file)
@@ -31,7 +31,6 @@ struct s3c64xx_spi_csinfo {
 /**
  * struct s3c64xx_spi_info - SPI Controller defining structure
  * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
- * @src_clk_name: Platform name of the corresponding clock.
  * @clk_from_cmu: If the SPI clock/prescalar control block is present
  *     by the platform's clock-management-unit and not in SPI controller.
  * @num_cs: Number of CS this controller emulates.
@@ -43,7 +42,6 @@ struct s3c64xx_spi_csinfo {
  */
 struct s3c64xx_spi_info {
        int src_clk_nr;
-       char *src_clk_name;
        bool clk_from_cmu;
 
        int num_cs;
index e7b3c752e91963e542d53c832775b08ede46ef6e..dcff7dd1ae8ae63e3c41aa70781d818d11476f0a 100644 (file)
@@ -66,8 +66,6 @@ struct s3c_sdhci_platdata {
        enum cd_types   cd_type;
        enum clk_types  clk_type;
 
-       char            **clocks;       /* set of clock sources */
-
        int             ext_cd_gpio;
        bool            ext_cd_gpio_invert;
        int     (*ext_cd_init)(void (*notify_func)(struct platform_device *,
@@ -129,12 +127,9 @@ extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
 /* S3C2416 SDHCI setup */
 
 #ifdef CONFIG_S3C2416_SETUP_SDHCI
-extern char *s3c2416_hsmmc_clksrcs[4];
-
 static inline void s3c2416_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-       s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
 #endif /* CONFIG_S3C_DEV_HSMMC */
 }
@@ -142,7 +137,6 @@ static inline void s3c2416_default_sdhci0(void)
 static inline void s3c2416_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-       s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
 #endif /* CONFIG_S3C_DEV_HSMMC1 */
 }
@@ -155,12 +149,9 @@ static inline void s3c2416_default_sdhci1(void) { }
 /* S3C64XX SDHCI setup */
 
 #ifdef CONFIG_S3C64XX_SETUP_SDHCI
-extern char *s3c64xx_hsmmc_clksrcs[4];
-
 static inline void s3c6400_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-       s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -168,7 +159,6 @@ static inline void s3c6400_default_sdhci0(void)
 static inline void s3c6400_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-       s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -176,7 +166,6 @@ static inline void s3c6400_default_sdhci1(void)
 static inline void s3c6400_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-       s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -184,7 +173,6 @@ static inline void s3c6400_default_sdhci2(void)
 static inline void s3c6410_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-       s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -192,7 +180,6 @@ static inline void s3c6410_default_sdhci0(void)
 static inline void s3c6410_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-       s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -200,7 +187,6 @@ static inline void s3c6410_default_sdhci1(void)
 static inline void s3c6410_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-       s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -218,12 +204,9 @@ static inline void s3c6400_default_sdhci2(void) { }
 /* S5PC100 SDHCI setup */
 
 #ifdef CONFIG_S5PC100_SETUP_SDHCI
-extern char *s5pc100_hsmmc_clksrcs[4];
-
 static inline void s5pc100_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-       s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -231,7 +214,6 @@ static inline void s5pc100_default_sdhci0(void)
 static inline void s5pc100_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-       s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -239,7 +221,6 @@ static inline void s5pc100_default_sdhci1(void)
 static inline void s5pc100_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-       s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -254,12 +235,9 @@ static inline void s5pc100_default_sdhci2(void) { }
 /* S5PV210 SDHCI setup */
 
 #ifdef CONFIG_S5PV210_SETUP_SDHCI
-extern char *s5pv210_hsmmc_clksrcs[4];
-
 static inline void s5pv210_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-       s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -267,7 +245,6 @@ static inline void s5pv210_default_sdhci0(void)
 static inline void s5pv210_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-       s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -275,7 +252,6 @@ static inline void s5pv210_default_sdhci1(void)
 static inline void s5pv210_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-       s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -283,7 +259,6 @@ static inline void s5pv210_default_sdhci2(void)
 static inline void s5pv210_default_sdhci3(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC3
-       s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
 #endif
 }
@@ -298,12 +273,9 @@ static inline void s5pv210_default_sdhci3(void) { }
 
 /* EXYNOS4 SDHCI setup */
 #ifdef CONFIG_EXYNOS4_SETUP_SDHCI
-extern char *exynos4_hsmmc_clksrcs[4];
-
 static inline void exynos4_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-       s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -311,7 +283,6 @@ static inline void exynos4_default_sdhci0(void)
 static inline void exynos4_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-       s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -319,7 +290,6 @@ static inline void exynos4_default_sdhci1(void)
 static inline void exynos4_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-       s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -327,7 +297,6 @@ static inline void exynos4_default_sdhci2(void)
 static inline void exynos4_default_sdhci3(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC3
-       s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
 #endif
 }
index a448e990964d4ab45d34afd8015cb4e7f021c9a6..19e0b72870d3f9204776be222584c019a829ffde 100644 (file)
@@ -16,6 +16,7 @@
 
 void (*s5p_reset_hook)(void);
 
+#error Fix me up
 static void arch_reset(char mode, const char *cmd)
 {
        /* SWRESET support in s5p_reset_hook() */
index b4f340b8f1f1eeedfd630c13dba27dfe7710d51d..e0f2e5b9530c8390c264f5eba165aa6571e7120f 100644 (file)
@@ -3,6 +3,6 @@
 #
 
 # Common support
-obj-y  := clock.o time.o
+obj-y  := clock.o restart.o time.o
 
 obj-$(CONFIG_ARCH_SPEAR3XX)    += shirq.o padmux.o
index a235fa0ca7778e922c39b6eca0426e369dae38de..86c6f83b44cc15cd22e86afbc5a6d7788f923336 100644 (file)
 #ifndef __PLAT_SYSTEM_H
 #define __PLAT_SYSTEM_H
 
-#include <linux/io.h>
-#include <asm/hardware/sp810.h>
-#include <mach/hardware.h>
-
 static inline void arch_idle(void)
 {
        /*
@@ -27,15 +23,4 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
-static inline void arch_reset(char mode, const char *cmd)
-{
-       if (mode == 's') {
-               /* software reset, Jump into ROM at address 0 */
-               cpu_reset(0);
-       } else {
-               /* hardware reset, Use on-chip reset capability */
-               sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
-       }
-}
-
 #endif /* __PLAT_SYSTEM_H */
diff --git a/arch/arm/plat-spear/include/plat/vmalloc.h b/arch/arm/plat-spear/include/plat/vmalloc.h
deleted file mode 100644 (file)
index 8c8b24d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/plat-spear/include/plat/vmalloc.h
- *
- * Defining Vmalloc area for SPEAr platform
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.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 __PLAT_VMALLOC_H
-#define __PLAT_VMALLOC_H
-
-#define VMALLOC_END            0xF0000000UL
-
-#endif /* __PLAT_VMALLOC_H */
diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c
new file mode 100644 (file)
index 0000000..2b4e3d8
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * arch/arm/plat-spear/restart.c
+ *
+ * SPEAr platform specific restart functions
+ *
+ * Copyright (C) 2009 ST Microelectronics
+ * Viresh Kumar<viresh.kumar@st.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/io.h>
+#include <asm/hardware/sp810.h>
+#include <mach/hardware.h>
+#include <mach/generic.h>
+
+void spear_restart(char mode, const char *cmd)
+{
+       if (mode == 's') {
+               /* software reset, Jump into ROM at address 0 */
+               soft_restart(0);
+       } else {
+               /* hardware reset, Use on-chip reset capability */
+               sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
+       }
+}
index 909e6035d843da98309be68d50719ec8e1725823..c4fca0126e18f8b04afd909e47d0abdb7a121276 100644 (file)
@@ -23,6 +23,7 @@ static inline void arch_idle(void)
        cpu_do_idle();
 }
 
+#error Fix me up
 static inline void arch_reset(char mode, const char *cmd)
 {
        plat_tcc_reboot();
diff --git a/arch/arm/plat-tcc/include/mach/vmalloc.h b/arch/arm/plat-tcc/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 99414d9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Author: <linux@telechips.com>
- * Created: June 10, 2008
- *
- * Copyright (C) 2000 Russell King.
- * Copyright (C) 2008-2009 Telechips
- *
- * Licensed under the terms of the GPL v2.
- */
-#define VMALLOC_END    0xf0000000UL
index ccbe16f47227e2ebb171032b2a5de66289014cd0..f9c9f33f8cbe2f651277793400d8287eec0073c9 100644 (file)
@@ -16,7 +16,7 @@
 # are merged into mainline or have been edited in the machine database
 # within the last 12 months.  References to machine_is_NAME() do not count!
 #
-# Last update: Sat May 7 08:48:24 2011
+# Last update: Tue Dec 6 11:07:38 2011
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -269,7 +269,7 @@ dns323                      MACH_DNS323             DNS323                  1542
 omap3_beagle           MACH_OMAP3_BEAGLE       OMAP3_BEAGLE            1546
 nokia_n810             MACH_NOKIA_N810         NOKIA_N810              1548
 pcm038                 MACH_PCM038             PCM038                  1551
-ts_x09                 MACH_TS209              TS209                   1565
+ts209                  MACH_TS209              TS209                   1565
 at91cap9adk            MACH_AT91CAP9ADK        AT91CAP9ADK             1566
 mx31moboard            MACH_MX31MOBOARD        MX31MOBOARD             1574
 vision_ep9307          MACH_VISION_EP9307      VISION_EP9307           1578
@@ -321,7 +321,6 @@ lb88rc8480          MACH_LB88RC8480         LB88RC8480              1769
 mx25_3ds               MACH_MX25_3DS           MX25_3DS                1771
 omap3530_lv_som                MACH_OMAP3530_LV_SOM    OMAP3530_LV_SOM         1773
 davinci_da830_evm      MACH_DAVINCI_DA830_EVM  DAVINCI_DA830_EVM       1781
-at572d940hfek          MACH_AT572D940HFEB      AT572D940HFEB           1783
 dove_db                        MACH_DOVE_DB            DOVE_DB                 1788
 overo                  MACH_OVERO              OVERO                   1798
 at2440evb              MACH_AT2440EVB          AT2440EVB               1799
@@ -459,7 +458,7 @@ guruplug            MACH_GURUPLUG           GURUPLUG                2659
 spear310               MACH_SPEAR310           SPEAR310                2660
 spear320               MACH_SPEAR320           SPEAR320                2661
 aquila                 MACH_AQUILA             AQUILA                  2676
-sheeva_esata           MACH_ESATA_SHEEVAPLUG   ESATA_SHEEVAPLUG        2678
+esata_sheevaplug       MACH_ESATA_SHEEVAPLUG   ESATA_SHEEVAPLUG        2678
 msm7x30_surf           MACH_MSM7X30_SURF       MSM7X30_SURF            2679
 ea2478devkit           MACH_EA2478DEVKIT       EA2478DEVKIT            2683
 terastation_wxl                MACH_TERASTATION_WXL    TERASTATION_WXL         2697
@@ -491,380 +490,53 @@ eukrea_cpuimx35sd        MACH_EUKREA_CPUIMX35SD  EUKREA_CPUIMX35SD       2821
 eukrea_cpuimx51sd      MACH_EUKREA_CPUIMX51SD  EUKREA_CPUIMX51SD       2822
 eukrea_cpuimx51                MACH_EUKREA_CPUIMX51    EUKREA_CPUIMX51         2823
 smdkc210               MACH_SMDKC210           SMDKC210                2838
-omap3_braillo          MACH_OMAP3_BRAILLO      OMAP3_BRAILLO           2839
-spyplug                        MACH_SPYPLUG            SPYPLUG                 2840
-ginger                 MACH_GINGER             GINGER                  2841
-tny_t3530              MACH_TNY_T3530          TNY_T3530               2842
 pca102                 MACH_PCA102             PCA102                  2843
-spade                  MACH_SPADE              SPADE                   2844
-mxc25_topaz            MACH_MXC25_TOPAZ        MXC25_TOPAZ             2845
 t5325                  MACH_T5325              T5325                   2846
-gw2361                 MACH_GW2361             GW2361                  2847
-elog                   MACH_ELOG               ELOG                    2848
 income                 MACH_INCOME             INCOME                  2849
-bcm589x                        MACH_BCM589X            BCM589X                 2850
-etna                   MACH_ETNA               ETNA                    2851
-hawks                  MACH_HAWKS              HAWKS                   2852
-meson                  MACH_MESON              MESON                   2853
-xsbase255              MACH_XSBASE255          XSBASE255               2854
-pvm2030                        MACH_PVM2030            PVM2030                 2855
-mioa502                        MACH_MIOA502            MIOA502                 2856
 vvbox_sdorig2          MACH_VVBOX_SDORIG2      VVBOX_SDORIG2           2857
 vvbox_sdlite2          MACH_VVBOX_SDLITE2      VVBOX_SDLITE2           2858
 vvbox_sdpro4           MACH_VVBOX_SDPRO4       VVBOX_SDPRO4            2859
-htc_spv_m700           MACH_HTC_SPV_M700       HTC_SPV_M700            2860
 mx257sx                        MACH_MX257SX            MX257SX                 2861
 goni                   MACH_GONI               GONI                    2862
-msm8x55_svlte_ffa      MACH_MSM8X55_SVLTE_FFA  MSM8X55_SVLTE_FFA       2863
-msm8x55_svlte_surf     MACH_MSM8X55_SVLTE_SURF MSM8X55_SVLTE_SURF      2864
-quickstep              MACH_QUICKSTEP          QUICKSTEP               2865
-dmw96                  MACH_DMW96              DMW96                   2866
-hammerhead             MACH_HAMMERHEAD         HAMMERHEAD              2867
-trident                        MACH_TRIDENT            TRIDENT                 2868
-lightning              MACH_LIGHTNING          LIGHTNING               2869
-iconnect               MACH_ICONNECT           ICONNECT                2870
-autobot                        MACH_AUTOBOT            AUTOBOT                 2871
-coconut                        MACH_COCONUT            COCONUT                 2872
-durian                 MACH_DURIAN             DURIAN                  2873
-cayenne                        MACH_CAYENNE            CAYENNE                 2874
-fuji                   MACH_FUJI               FUJI                    2875
-synology_6282          MACH_SYNOLOGY_6282      SYNOLOGY_6282           2876
-em1sy                  MACH_EM1SY              EM1SY                   2877
-m502                   MACH_M502               M502                    2878
-matrix518              MACH_MATRIX518          MATRIX518               2879
-tiny_gurnard           MACH_TINY_GURNARD       TINY_GURNARD            2880
-spear1310              MACH_SPEAR1310          SPEAR1310               2881
 bv07                   MACH_BV07               BV07                    2882
-mxt_td61               MACH_MXT_TD61           MXT_TD61                2883
 openrd_ultimate                MACH_OPENRD_ULTIMATE    OPENRD_ULTIMATE         2884
 devixp                 MACH_DEVIXP             DEVIXP                  2885
 miccpt                 MACH_MICCPT             MICCPT                  2886
 mic256                 MACH_MIC256             MIC256                  2887
-as1167                 MACH_AS1167             AS1167                  2888
-omap3_ibiza            MACH_OMAP3_IBIZA        OMAP3_IBIZA             2889
 u5500                  MACH_U5500              U5500                   2890
-davinci_picto          MACH_DAVINCI_PICTO      DAVINCI_PICTO           2891
-mecha                  MACH_MECHA              MECHA                   2892
-bubba3                 MACH_BUBBA3             BUBBA3                  2893
-pupitre                        MACH_PUPITRE            PUPITRE                 2894
-tegra_vogue            MACH_TEGRA_VOGUE        TEGRA_VOGUE             2896
-tegra_e1165            MACH_TEGRA_E1165        TEGRA_E1165             2897
-simplenet              MACH_SIMPLENET          SIMPLENET               2898
-ec4350tbm              MACH_EC4350TBM          EC4350TBM               2899
-pec_tc                 MACH_PEC_TC             PEC_TC                  2900
-pec_hc2                        MACH_PEC_HC2            PEC_HC2                 2901
-esl_mobilis_a          MACH_ESL_MOBILIS_A      ESL_MOBILIS_A           2902
-esl_mobilis_b          MACH_ESL_MOBILIS_B      ESL_MOBILIS_B           2903
-esl_wave_a             MACH_ESL_WAVE_A         ESL_WAVE_A              2904
-esl_wave_b             MACH_ESL_WAVE_B         ESL_WAVE_B              2905
-unisense_mmm           MACH_UNISENSE_MMM       UNISENSE_MMM            2906
-blueshark              MACH_BLUESHARK          BLUESHARK               2907
-e10                    MACH_E10                E10                     2908
-app3k_robin            MACH_APP3K_ROBIN        APP3K_ROBIN             2909
-pov15hd                        MACH_POV15HD            POV15HD                 2910
-stella                 MACH_STELLA             STELLA                  2911
 linkstation_lschl      MACH_LINKSTATION_LSCHL  LINKSTATION_LSCHL       2913
-netwalker              MACH_NETWALKER          NETWALKER               2914
-acsx106                        MACH_ACSX106            ACSX106                 2915
-atlas5_c1              MACH_ATLAS5_C1          ATLAS5_C1               2916
-nsb3ast                        MACH_NSB3AST            NSB3AST                 2917
-gnet_slc               MACH_GNET_SLC           GNET_SLC                2918
-af4000                 MACH_AF4000             AF4000                  2919
-ark9431                        MACH_ARK9431            ARK9431                 2920
-fs_s5pc100             MACH_FS_S5PC100         FS_S5PC100              2921
-omap3505nova8          MACH_OMAP3505NOVA8      OMAP3505NOVA8           2922
-omap3621_edp1          MACH_OMAP3621_EDP1      OMAP3621_EDP1           2923
-oratisaes              MACH_ORATISAES          ORATISAES               2924
 smdkv310               MACH_SMDKV310           SMDKV310                2925
-siemens_l0             MACH_SIEMENS_L0         SIEMENS_L0              2926
-ventana                        MACH_VENTANA            VENTANA                 2927
 wm8505_7in_netbook     MACH_WM8505_7IN_NETBOOK WM8505_7IN_NETBOOK      2928
-ec4350sdb              MACH_EC4350SDB          EC4350SDB               2929
-mimas                  MACH_MIMAS              MIMAS                   2930
-titan                  MACH_TITAN              TITAN                   2931
 craneboard             MACH_CRANEBOARD         CRANEBOARD              2932
-es2440                 MACH_ES2440             ES2440                  2933
-najay_a9263            MACH_NAJAY_A9263        NAJAY_A9263             2934
-htctornado             MACH_HTCTORNADO         HTCTORNADO              2935
-dimm_mx257             MACH_DIMM_MX257         DIMM_MX257              2936
-jigen301               MACH_JIGEN              JIGEN                   2937
 smdk6450               MACH_SMDK6450           SMDK6450                2938
-meno_qng               MACH_MENO_QNG           MENO_QNG                2939
-ns2416                 MACH_NS2416             NS2416                  2940
-rpc353                 MACH_RPC353             RPC353                  2941
-tq6410                 MACH_TQ6410             TQ6410                  2942
-sky6410                        MACH_SKY6410            SKY6410                 2943
-dynasty                        MACH_DYNASTY            DYNASTY                 2944
-vivo                   MACH_VIVO               VIVO                    2945
-bury_bl7582            MACH_BURY_BL7582        BURY_BL7582             2946
-bury_bps5270           MACH_BURY_BPS5270       BURY_BPS5270            2947
-basi                   MACH_BASI               BASI                    2948
-tn200                  MACH_TN200              TN200                   2949
-c2mmi                  MACH_C2MMI              C2MMI                   2950
-meson_6236m            MACH_MESON_6236M        MESON_6236M             2951
-meson_8626m            MACH_MESON_8626M        MESON_8626M             2952
-tube                   MACH_TUBE               TUBE                    2953
-messina                        MACH_MESSINA            MESSINA                 2954
-mx50_arm2              MACH_MX50_ARM2          MX50_ARM2               2955
-cetus9263              MACH_CETUS9263          CETUS9263               2956
 brownstone             MACH_BROWNSTONE         BROWNSTONE              2957
-vmx25                  MACH_VMX25              VMX25                   2958
-vmx51                  MACH_VMX51              VMX51                   2959
-abacus                 MACH_ABACUS             ABACUS                  2960
-cm4745                 MACH_CM4745             CM4745                  2961
-oratislink             MACH_ORATISLINK         ORATISLINK              2962
-davinci_dm365_dvr      MACH_DAVINCI_DM365_DVR  DAVINCI_DM365_DVR       2963
-netviz                 MACH_NETVIZ             NETVIZ                  2964
 flexibity              MACH_FLEXIBITY          FLEXIBITY               2965
-wlan_computer          MACH_WLAN_COMPUTER      WLAN_COMPUTER           2966
-lpc24xx                        MACH_LPC24XX            LPC24XX                 2967
-spica                  MACH_SPICA              SPICA                   2968
-gpsdisplay             MACH_GPSDISPLAY         GPSDISPLAY              2969
-bipnet                 MACH_BIPNET             BIPNET                  2970
-overo_ctu_inertial     MACH_OVERO_CTU_INERTIAL OVERO_CTU_INERTIAL      2971
-davinci_dm355_mmm      MACH_DAVINCI_DM355_MMM  DAVINCI_DM355_MMM       2972
-pc9260_v2              MACH_PC9260_V2          PC9260_V2               2973
-ptx7545                        MACH_PTX7545            PTX7545                 2974
-tm_efdc                        MACH_TM_EFDC            TM_EFDC                 2975
-omap3_waldo1           MACH_OMAP3_WALDO1       OMAP3_WALDO1            2977
-flyer                  MACH_FLYER              FLYER                   2978
-tornado3240            MACH_TORNADO3240        TORNADO3240             2979
-soli_01                        MACH_SOLI_01            SOLI_01                 2980
-omapl138_europalc      MACH_OMAPL138_EUROPALC  OMAPL138_EUROPALC       2981
-helios_v1              MACH_HELIOS_V1          HELIOS_V1               2982
-netspace_lite_v2       MACH_NETSPACE_LITE_V2   NETSPACE_LITE_V2        2983
-ssc                    MACH_SSC                SSC                     2984
-premierwave_en         MACH_PREMIERWAVE_EN     PREMIERWAVE_EN          2985
-wasabi                 MACH_WASABI             WASABI                  2986
 mx50_rdp               MACH_MX50_RDP           MX50_RDP                2988
 universal_c210         MACH_UNIVERSAL_C210     UNIVERSAL_C210          2989
 real6410               MACH_REAL6410           REAL6410                2990
-spx_sakura             MACH_SPX_SAKURA         SPX_SAKURA              2991
-ij3k_2440              MACH_IJ3K_2440          IJ3K_2440               2992
-omap3_bc10             MACH_OMAP3_BC10         OMAP3_BC10              2993
-thebe                  MACH_THEBE              THEBE                   2994
-rv082                  MACH_RV082              RV082                   2995
-armlguest              MACH_ARMLGUEST          ARMLGUEST               2996
-tjinc1000              MACH_TJINC1000          TJINC1000               2997
 dockstar               MACH_DOCKSTAR           DOCKSTAR                2998
-ax8008                 MACH_AX8008             AX8008                  2999
-gnet_sgce              MACH_GNET_SGCE          GNET_SGCE               3000
-pxwnas_500_1000                MACH_PXWNAS_500_1000    PXWNAS_500_1000         3001
-ea20                   MACH_EA20               EA20                    3002
-awm2                   MACH_AWM2               AWM2                    3003
 ti8148evm              MACH_TI8148EVM          TI8148EVM               3004
 seaboard               MACH_SEABOARD           SEABOARD                3005
-linkstation_chlv2      MACH_LINKSTATION_CHLV2  LINKSTATION_CHLV2       3006
-tera_pro2_rack         MACH_TERA_PRO2_RACK     TERA_PRO2_RACK          3007
-rubys                  MACH_RUBYS              RUBYS                   3008
-aquarius               MACH_AQUARIUS           AQUARIUS                3009
 mx53_ard               MACH_MX53_ARD           MX53_ARD                3010
 mx53_smd               MACH_MX53_SMD           MX53_SMD                3011
-lswxl                  MACH_LSWXL              LSWXL                   3012
-dove_avng_v3           MACH_DOVE_AVNG_V3       DOVE_AVNG_V3            3013
-sdi_ess_9263           MACH_SDI_ESS_9263       SDI_ESS_9263            3014
-jocpu550               MACH_JOCPU550           JOCPU550                3015
 msm8x60_rumi3          MACH_MSM8X60_RUMI3      MSM8X60_RUMI3           3016
 msm8x60_ffa            MACH_MSM8X60_FFA        MSM8X60_FFA             3017
-yanomami               MACH_YANOMAMI           YANOMAMI                3018
-gta04                  MACH_GTA04              GTA04                   3019
 cm_a510                        MACH_CM_A510            CM_A510                 3020
-omap3_rfs200           MACH_OMAP3_RFS200       OMAP3_RFS200            3021
-kx33xx                 MACH_KX33XX             KX33XX                  3022
-ptx7510                        MACH_PTX7510            PTX7510                 3023
-top9000                        MACH_TOP9000            TOP9000                 3024
-teenote                        MACH_TEENOTE            TEENOTE                 3025
-ts3                    MACH_TS3                TS3                     3026
-a0                     MACH_A0                 A0                      3027
-fsm9xxx_surf           MACH_FSM9XXX_SURF       FSM9XXX_SURF            3028
-fsm9xxx_ffa            MACH_FSM9XXX_FFA        FSM9XXX_FFA             3029
-frrhwcdma60w           MACH_FRRHWCDMA60W       FRRHWCDMA60W            3030
-remus                  MACH_REMUS              REMUS                   3031
-at91cap7xdk            MACH_AT91CAP7XDK        AT91CAP7XDK             3032
-at91cap7stk            MACH_AT91CAP7STK        AT91CAP7STK             3033
-kt_sbc_sam9_1          MACH_KT_SBC_SAM9_1      KT_SBC_SAM9_1           3034
-armada_xp_db           MACH_ARMADA_XP_DB       ARMADA_XP_DB            3036
-spdm                   MACH_SPDM               SPDM                    3037
-gtib                   MACH_GTIB               GTIB                    3038
-dgm3240                        MACH_DGM3240            DGM3240                 3039
-htcmega                        MACH_HTCMEGA            HTCMEGA                 3041
-tricorder              MACH_TRICORDER          TRICORDER               3042
 tx28                   MACH_TX28               TX28                    3043
-bstbrd                 MACH_BSTBRD             BSTBRD                  3044
-pwb3090                        MACH_PWB3090            PWB3090                 3045
-idea6410               MACH_IDEA6410           IDEA6410                3046
-qbc9263                        MACH_QBC9263            QBC9263                 3047
-borabora               MACH_BORABORA           BORABORA                3048
-valdez                 MACH_VALDEZ             VALDEZ                  3049
-ls9g20                 MACH_LS9G20             LS9G20                  3050
-mios_v1                        MACH_MIOS_V1            MIOS_V1                 3051
-s5pc110_crespo         MACH_S5PC110_CRESPO     S5PC110_CRESPO          3052
-controltek9g20         MACH_CONTROLTEK9G20     CONTROLTEK9G20          3053
-tin307                 MACH_TIN307             TIN307                  3054
-tin510                 MACH_TIN510             TIN510                  3055
-bluecheese             MACH_BLUECHEESE         BLUECHEESE              3057
-tem3x30                        MACH_TEM3X30            TEM3X30                 3058
-harvest_desoto         MACH_HARVEST_DESOTO     HARVEST_DESOTO          3059
-msm8x60_qrdc           MACH_MSM8X60_QRDC       MSM8X60_QRDC            3060
-spear900               MACH_SPEAR900           SPEAR900                3061
 pcontrol_g20           MACH_PCONTROL_G20       PCONTROL_G20            3062
-rdstor                 MACH_RDSTOR             RDSTOR                  3063
-usdloader              MACH_USDLOADER          USDLOADER               3064
-tsoploader             MACH_TSOPLOADER         TSOPLOADER              3065
-kronos                 MACH_KRONOS             KRONOS                  3066
-ffcore                 MACH_FFCORE             FFCORE                  3067
-mone                   MACH_MONE               MONE                    3068
-unit2s                 MACH_UNIT2S             UNIT2S                  3069
-acer_a5                        MACH_ACER_A5            ACER_A5                 3070
-etherpro_isp           MACH_ETHERPRO_ISP       ETHERPRO_ISP            3071
-stretchs7000           MACH_STRETCHS7000       STRETCHS7000            3072
-p87_smartsim           MACH_P87_SMARTSIM       P87_SMARTSIM            3073
-tulip                  MACH_TULIP              TULIP                   3074
-sunflower              MACH_SUNFLOWER          SUNFLOWER               3075
-rib                    MACH_RIB                RIB                     3076
-clod                   MACH_CLOD               CLOD                    3077
-rump                   MACH_RUMP               RUMP                    3078
-tenderloin             MACH_TENDERLOIN         TENDERLOIN              3079
-shortloin              MACH_SHORTLOIN          SHORTLOIN               3080
-antares                        MACH_ANTARES            ANTARES                 3082
-wb40n                  MACH_WB40N              WB40N                   3083
-herring                        MACH_HERRING            HERRING                 3084
-naxy400                        MACH_NAXY400            NAXY400                 3085
-naxy1200               MACH_NAXY1200           NAXY1200                3086
 vpr200                 MACH_VPR200             VPR200                  3087
-bug20                  MACH_BUG20              BUG20                   3088
-goflexnet              MACH_GOFLEXNET          GOFLEXNET               3089
 torbreck               MACH_TORBRECK           TORBRECK                3090
-saarb_mg1              MACH_SAARB_MG1          SAARB_MG1               3091
-callisto               MACH_CALLISTO           CALLISTO                3092
-multhsu                        MACH_MULTHSU            MULTHSU                 3093
-saluda                 MACH_SALUDA             SALUDA                  3094
-pemp_omap3_apollo      MACH_PEMP_OMAP3_APOLLO  PEMP_OMAP3_APOLLO       3095
-vc0718                 MACH_VC0718             VC0718                  3096
-mvblx                  MACH_MVBLX              MVBLX                   3097
-inhand_apeiron         MACH_INHAND_APEIRON     INHAND_APEIRON          3098
-inhand_fury            MACH_INHAND_FURY        INHAND_FURY             3099
-inhand_siren           MACH_INHAND_SIREN       INHAND_SIREN            3100
-hdnvp                  MACH_HDNVP              HDNVP                   3101
-softwinner             MACH_SOFTWINNER         SOFTWINNER              3102
 prima2_evb             MACH_PRIMA2_EVB         PRIMA2_EVB              3103
-nas6210                        MACH_NAS6210            NAS6210                 3104
-unisdev                        MACH_UNISDEV            UNISDEV                 3105
-sbca11                 MACH_SBCA11             SBCA11                  3106
-saga                   MACH_SAGA               SAGA                    3107
-ns_k330                        MACH_NS_K330            NS_K330                 3108
-tanna                  MACH_TANNA              TANNA                   3109
-imate8502              MACH_IMATE8502          IMATE8502               3110
-aspen                  MACH_ASPEN              ASPEN                   3111
-daintree_cwac          MACH_DAINTREE_CWAC      DAINTREE_CWAC           3112
-zmx25                  MACH_ZMX25              ZMX25                   3113
-maple1                 MACH_MAPLE1             MAPLE1                  3114
-qsd8x72_surf           MACH_QSD8X72_SURF       QSD8X72_SURF            3115
-qsd8x72_ffa            MACH_QSD8X72_FFA        QSD8X72_FFA             3116
-abilene                        MACH_ABILENE            ABILENE                 3117
-eigen_ttr              MACH_EIGEN_TTR          EIGEN_TTR               3118
-iomega_ix2_200         MACH_IOMEGA_IX2_200     IOMEGA_IX2_200          3119
-coretec_vcx7400                MACH_CORETEC_VCX7400    CORETEC_VCX7400         3120
-santiago               MACH_SANTIAGO           SANTIAGO                3121
-mx257sol               MACH_MX257SOL           MX257SOL                3122
-strasbourg             MACH_STRASBOURG         STRASBOURG              3123
-msm8x60_fluid          MACH_MSM8X60_FLUID      MSM8X60_FLUID           3124
-smartqv5               MACH_SMARTQV5           SMARTQV5                3125
-smartqv3               MACH_SMARTQV3           SMARTQV3                3126
-smartqv7               MACH_SMARTQV7           SMARTQV7                3127
 paz00                  MACH_PAZ00              PAZ00                   3128
 acmenetusfoxg20                MACH_ACMENETUSFOXG20    ACMENETUSFOXG20         3129
-fwbd_0404              MACH_FWBD_0404          FWBD_0404               3131
-hdgu                   MACH_HDGU               HDGU                    3132
-pyramid                        MACH_PYRAMID            PYRAMID                 3133
-epiphan                        MACH_EPIPHAN            EPIPHAN                 3134
-omap_bender            MACH_OMAP_BENDER        OMAP_BENDER             3135
-gurnard                        MACH_GURNARD            GURNARD                 3136
-gtl_it5100             MACH_GTL_IT5100         GTL_IT5100              3137
-bcm2708                        MACH_BCM2708            BCM2708                 3138
-mx51_ggc               MACH_MX51_GGC           MX51_GGC                3139
-sharespace             MACH_SHARESPACE         SHARESPACE              3140
-haba_knx_explorer      MACH_HABA_KNX_EXPLORER  HABA_KNX_EXPLORER       3141
-simtec_kirkmod         MACH_SIMTEC_KIRKMOD     SIMTEC_KIRKMOD          3142
-crux                   MACH_CRUX               CRUX                    3143
-mx51_bravo             MACH_MX51_BRAVO         MX51_BRAVO              3144
-charon                 MACH_CHARON             CHARON                  3145
-picocom3               MACH_PICOCOM3           PICOCOM3                3146
-picocom4               MACH_PICOCOM4           PICOCOM4                3147
-serrano                        MACH_SERRANO            SERRANO                 3148
-doubleshot             MACH_DOUBLESHOT         DOUBLESHOT              3149
-evsy                   MACH_EVSY               EVSY                    3150
-huashan                        MACH_HUASHAN            HUASHAN                 3151
-lausanne               MACH_LAUSANNE           LAUSANNE                3152
-emerald                        MACH_EMERALD            EMERALD                 3153
-tqma35                 MACH_TQMA35             TQMA35                  3154
-marvel                 MACH_MARVEL             MARVEL                  3155
-manuae                 MACH_MANUAE             MANUAE                  3156
-chacha                 MACH_CHACHA             CHACHA                  3157
-lemon                  MACH_LEMON              LEMON                   3158
-csc                    MACH_CSC                CSC                     3159
-gira_knxip_router      MACH_GIRA_KNXIP_ROUTER  GIRA_KNXIP_ROUTER       3160
-t20                    MACH_T20                T20                     3161
-hdmini                 MACH_HDMINI             HDMINI                  3162
-sciphone_g2            MACH_SCIPHONE_G2        SCIPHONE_G2             3163
-express                        MACH_EXPRESS            EXPRESS                 3164
-express_kt             MACH_EXPRESS_KT         EXPRESS_KT              3165
-maximasp               MACH_MAXIMASP           MAXIMASP                3166
-nitrogen_imx51         MACH_NITROGEN_IMX51     NITROGEN_IMX51          3167
-nitrogen_imx53         MACH_NITROGEN_IMX53     NITROGEN_IMX53          3168
-sunfire                        MACH_SUNFIRE            SUNFIRE                 3169
-arowana                        MACH_AROWANA            AROWANA                 3170
-tegra_daytona          MACH_TEGRA_DAYTONA      TEGRA_DAYTONA           3171
-tegra_swordfish                MACH_TEGRA_SWORDFISH    TEGRA_SWORDFISH         3172
-edison                 MACH_EDISON             EDISON                  3173
-svp8500v1              MACH_SVP8500V1          SVP8500V1               3174
-svp8500v2              MACH_SVP8500V2          SVP8500V2               3175
-svp5500                        MACH_SVP5500            SVP5500                 3176
-b5500                  MACH_B5500              B5500                   3177
-s5500                  MACH_S5500              S5500                   3178
-icon                   MACH_ICON               ICON                    3179
-elephant               MACH_ELEPHANT           ELEPHANT                3180
-shooter                        MACH_SHOOTER            SHOOTER                 3182
-spade_lte              MACH_SPADE_LTE          SPADE_LTE               3183
-philhwani              MACH_PHILHWANI          PHILHWANI               3184
-gsncomm                        MACH_GSNCOMM            GSNCOMM                 3185
-strasbourg_a2          MACH_STRASBOURG_A2      STRASBOURG_A2           3186
-mmm                    MACH_MMM                MMM                     3187
-davinci_dm365_bv       MACH_DAVINCI_DM365_BV   DAVINCI_DM365_BV        3188
 ag5evm                 MACH_AG5EVM             AG5EVM                  3189
-sc575plc               MACH_SC575PLC           SC575PLC                3190
-sc575hmi               MACH_SC575IPC           SC575IPC                3191
-omap3_tdm3730          MACH_OMAP3_TDM3730      OMAP3_TDM3730           3192
-top9000_eval           MACH_TOP9000_EVAL       TOP9000_EVAL            3194
-top9000_su             MACH_TOP9000_SU         TOP9000_SU              3195
-utm300                 MACH_UTM300             UTM300                  3196
 tsunagi                        MACH_TSUNAGI            TSUNAGI                 3197
-ts75xx                 MACH_TS75XX             TS75XX                  3198
-ts47xx                 MACH_TS47XX             TS47XX                  3200
-da850_k5               MACH_DA850_K5           DA850_K5                3201
-ax502                  MACH_AX502              AX502                   3202
-igep0032               MACH_IGEP0032           IGEP0032                3203
-antero                 MACH_ANTERO             ANTERO                  3204
-synergy                        MACH_SYNERGY            SYNERGY                 3205
 ics_if_voip            MACH_ICS_IF_VOIP        ICS_IF_VOIP             3206
 wlf_cragg_6410         MACH_WLF_CRAGG_6410     WLF_CRAGG_6410          3207
-punica                 MACH_PUNICA             PUNICA                  3208
 trimslice              MACH_TRIMSLICE          TRIMSLICE               3209
-mx27_wmultra           MACH_MX27_WMULTRA       MX27_WMULTRA            3210
 mackerel               MACH_MACKEREL           MACKEREL                3211
-fa9x27                 MACH_FA9X27             FA9X27                  3213
-ns2816tb               MACH_NS2816TB           NS2816TB                3214
-ns2816_ntpad           MACH_NS2816_NTPAD       NS2816_NTPAD            3215
-ns2816_ntnb            MACH_NS2816_NTNB        NS2816_NTNB             3216
 kaen                   MACH_KAEN               KAEN                    3217
-nv1000                 MACH_NV1000             NV1000                  3218
-nuc950ts               MACH_NUC950TS           NUC950TS                3219
 nokia_rm680            MACH_NOKIA_RM680        NOKIA_RM680             3220
-ast2200                        MACH_AST2200            AST2200                 3221
-lead                   MACH_LEAD               LEAD                    3222
-unino1                 MACH_UNINO1             UNINO1                  3223
-greeco                 MACH_GREECO             GREECO                  3224
-verdi                  MACH_VERDI              VERDI                   3225
 dm6446_adbox           MACH_DM6446_ADBOX       DM6446_ADBOX            3226
 quad_salsa             MACH_QUAD_SALSA         QUAD_SALSA              3227
 abb_gma_1_1            MACH_ABB_GMA_1_1        ABB_GMA_1_1             3228
@@ -949,13 +621,11 @@ koi                       MACH_KOI                KOI                     3312
 ts4800                 MACH_TS4800             TS4800                  3313
 tqma9263               MACH_TQMA9263           TQMA9263                3314
 holiday                        MACH_HOLIDAY            HOLIDAY                 3315
-dma_6410               MACH_DMA6410            DMA6410                 3316
 pcats_overlay          MACH_PCATS_OVERLAY      PCATS_OVERLAY           3317
 hwgw6410               MACH_HWGW6410           HWGW6410                3318
 shenzhou               MACH_SHENZHOU           SHENZHOU                3319
 cwme9210               MACH_CWME9210           CWME9210                3320
 cwme9210js             MACH_CWME9210JS         CWME9210JS              3321
-pgs_v1                 MACH_PGS_SITARA         PGS_SITARA              3322
 colibri_tegra2         MACH_COLIBRI_TEGRA2     COLIBRI_TEGRA2          3323
 w21                    MACH_W21                W21                     3324
 polysat1               MACH_POLYSAT1           POLYSAT1                3325
@@ -1021,13 +691,11 @@ viprinet         MACH_VIPRINET           VIPRINET                3385
 bockw                  MACH_BOCKW              BOCKW                   3386
 eva2000                        MACH_EVA2000            EVA2000                 3387
 steelyard              MACH_STEELYARD          STEELYARD               3388
-sdh001                 MACH_MACH_SDH001        MACH_SDH001             3390
 nsslsboard             MACH_NSSLSBOARD         NSSLSBOARD              3392
 geneva_b5              MACH_GENEVA_B5          GENEVA_B5               3393
 spear1340              MACH_SPEAR1340          SPEAR1340               3394
 rexmas                 MACH_REXMAS             REXMAS                  3395
 msm8960_cdp            MACH_MSM8960_CDP        MSM8960_CDP             3396
-msm8960_mdp            MACH_MSM8960_MDP        MSM8960_MDP             3397
 msm8960_fluid          MACH_MSM8960_FLUID      MSM8960_FLUID           3398
 msm8960_apq            MACH_MSM8960_APQ        MSM8960_APQ             3399
 helios_v2              MACH_HELIOS_V2          HELIOS_V2               3400
@@ -1123,6 +791,381 @@ blissc                   MACH_BLISSC             BLISSC                  3491
 thales_adc             MACH_THALES_ADC         THALES_ADC              3492
 ubisys_p9d_evp         MACH_UBISYS_P9D_EVP     UBISYS_P9D_EVP          3493
 atdgp318               MACH_ATDGP318           ATDGP318                3494
+dma210u                        MACH_DMA210U            DMA210U                 3495
+em_t3                  MACH_EM_T3              EM_T3                   3496
+htx3250                        MACH_HTX3250            HTX3250                 3497
+g50                    MACH_G50                G50                     3498
+eco5                   MACH_ECO5               ECO5                    3499
+wintergrasp            MACH_WINTERGRASP        WINTERGRASP             3500
+puro                   MACH_PURO               PURO                    3501
+shooter_k              MACH_SHOOTER_K          SHOOTER_K               3502
+nspire                 MACH_NSPIRE             NSPIRE                  3503
+mickxx                 MACH_MICKXX             MICKXX                  3504
+lxmb                   MACH_LXMB               LXMB                    3505
+adam                   MACH_ADAM               ADAM                    3507
+b1004                  MACH_B1004              B1004                   3508
+oboea                  MACH_OBOEA              OBOEA                   3509
+a1015                  MACH_A1015              A1015                   3510
+robin_vbdt30           MACH_ROBIN_VBDT30       ROBIN_VBDT30            3511
+tegra_enterprise       MACH_TEGRA_ENTERPRISE   TEGRA_ENTERPRISE        3512
+rfl108200_mk10         MACH_RFL108200_MK10     RFL108200_MK10          3513
+rfl108300_mk16         MACH_RFL108300_MK16     RFL108300_MK16          3514
+rover_v7               MACH_ROVER_V7           ROVER_V7                3515
+miphone                        MACH_MIPHONE            MIPHONE                 3516
+femtobts               MACH_FEMTOBTS           FEMTOBTS                3517
+monopoli               MACH_MONOPOLI           MONOPOLI                3518
+boss                   MACH_BOSS               BOSS                    3519
+davinci_dm368_vtam     MACH_DAVINCI_DM368_VTAM DAVINCI_DM368_VTAM      3520
+clcon                  MACH_CLCON              CLCON                   3521
+nokia_rm696            MACH_NOKIA_RM696        NOKIA_RM696             3522
+tahiti                 MACH_TAHITI             TAHITI                  3523
+fighter                        MACH_FIGHTER            FIGHTER                 3524
+sgh_i710               MACH_SGH_I710           SGH_I710                3525
+integreproscb          MACH_INTEGREPROSCB      INTEGREPROSCB           3526
+monza                  MACH_MONZA              MONZA                   3527
+calimain               MACH_CALIMAIN           CALIMAIN                3528
+mx6q_sabreauto         MACH_MX6Q_SABREAUTO     MX6Q_SABREAUTO          3529
+gma01x                 MACH_GMA01X             GMA01X                  3530
+sbc51                  MACH_SBC51              SBC51                   3531
+fit                    MACH_FIT                FIT                     3532
+steelhead              MACH_STEELHEAD          STEELHEAD               3533
+panther                        MACH_PANTHER            PANTHER                 3534
+msm8960_liquid         MACH_MSM8960_LIQUID     MSM8960_LIQUID          3535
+lexikonct              MACH_LEXIKONCT          LEXIKONCT               3536
+ns2816_stb             MACH_NS2816_STB         NS2816_STB              3537
+sei_mm2_lpc3250                MACH_SEI_MM2_LPC3250    SEI_MM2_LPC3250         3538
+cmimx53                        MACH_CMIMX53            CMIMX53                 3539
+sandwich               MACH_SANDWICH           SANDWICH                3540
+chief                  MACH_CHIEF              CHIEF                   3541
+pogo_e02               MACH_POGO_E02           POGO_E02                3542
+mikrap_x168            MACH_MIKRAP_X168        MIKRAP_X168             3543
+htcmozart              MACH_HTCMOZART          HTCMOZART               3544
+htcgold                        MACH_HTCGOLD            HTCGOLD                 3545
+mt72xx                 MACH_MT72XX             MT72XX                  3546
+mx51_ivy               MACH_MX51_IVY           MX51_IVY                3547
+mx51_lvd               MACH_MX51_LVD           MX51_LVD                3548
+omap3_wiser2           MACH_OMAP3_WISER2       OMAP3_WISER2            3549
+dreamplug              MACH_DREAMPLUG          DREAMPLUG               3550
+cobas_c_111            MACH_COBAS_C_111        COBAS_C_111             3551
+cobas_u_411            MACH_COBAS_U_411        COBAS_U_411             3552
+hssd                   MACH_HSSD               HSSD                    3553
+iom35x                 MACH_IOM35X             IOM35X                  3554
+psom_omap              MACH_PSOM_OMAP          PSOM_OMAP               3555
+iphone_2g              MACH_IPHONE_2G          IPHONE_2G               3556
+iphone_3g              MACH_IPHONE_3G          IPHONE_3G               3557
+ipod_touch_1g          MACH_IPOD_TOUCH_1G      IPOD_TOUCH_1G           3558
+pharos_tpc             MACH_PHAROS_TPC         PHAROS_TPC              3559
+mx53_hydra             MACH_MX53_HYDRA         MX53_HYDRA              3560
+ns2816_dev_board       MACH_NS2816_DEV_BOARD   NS2816_DEV_BOARD        3561
+iphone_3gs             MACH_IPHONE_3GS         IPHONE_3GS              3562
+iphone_4               MACH_IPHONE_4           IPHONE_4                3563
+ipod_touch_4g          MACH_IPOD_TOUCH_4G      IPOD_TOUCH_4G           3564
+dragon_e1100           MACH_DRAGON_E1100       DRAGON_E1100            3565
+topside                        MACH_TOPSIDE            TOPSIDE                 3566
+irisiii                        MACH_IRISIII            IRISIII                 3567
+deto_macarm9           MACH_DETO_MACARM9       DETO_MACARM9            3568
+eti_d1                 MACH_ETI_D1             ETI_D1                  3569
+som3530sdk             MACH_SOM3530SDK         SOM3530SDK              3570
+oc_engine              MACH_OC_ENGINE          OC_ENGINE               3571
+apq8064_sim            MACH_APQ8064_SIM        APQ8064_SIM             3572
+alps                   MACH_ALPS               ALPS                    3575
+tny_t3730              MACH_TNY_T3730          TNY_T3730               3576
+geryon_nfe             MACH_GERYON_NFE         GERYON_NFE              3577
+ns2816_ref_board       MACH_NS2816_REF_BOARD   NS2816_REF_BOARD        3578
+silverstone            MACH_SILVERSTONE        SILVERSTONE             3579
+mtt2440                        MACH_MTT2440            MTT2440                 3580
+ynicdb                 MACH_YNICDB             YNICDB                  3581
+bct                    MACH_BCT                BCT                     3582
+tuscan                 MACH_TUSCAN             TUSCAN                  3583
+xbt_sam9g45            MACH_XBT_SAM9G45        XBT_SAM9G45             3584
+enbw_cmc               MACH_ENBW_CMC           ENBW_CMC                3585
+ch104mx257             MACH_CH104MX257         CH104MX257              3587
+openpri                        MACH_OPENPRI            OPENPRI                 3588
+am335xevm              MACH_AM335XEVM          AM335XEVM               3589
+picodmb                        MACH_PICODMB            PICODMB                 3590
+waluigi                        MACH_WALUIGI            WALUIGI                 3591
+punicag7               MACH_PUNICAG7           PUNICAG7                3592
+ipad_1g                        MACH_IPAD_1G            IPAD_1G                 3593
+appletv_2g             MACH_APPLETV_2G         APPLETV_2G              3594
+mach_ecog45            MACH_MACH_ECOG45        MACH_ECOG45             3595
+ait_cam_enc_4xx                MACH_AIT_CAM_ENC_4XX    AIT_CAM_ENC_4XX         3596
+runnymede              MACH_RUNNYMEDE          RUNNYMEDE               3597
+play                   MACH_PLAY               PLAY                    3598
+hw90260                        MACH_HW90260            HW90260                 3599
+tagh                   MACH_TAGH               TAGH                    3600
+filbert                        MACH_FILBERT            FILBERT                 3601
+getinge_netcomv3       MACH_GETINGE_NETCOMV3   GETINGE_NETCOMV3        3602
+cw20                   MACH_CW20               CW20                    3603
+cinema                 MACH_CINEMA             CINEMA                  3604
+cinema_tea             MACH_CINEMA_TEA         CINEMA_TEA              3605
+cinema_coffee          MACH_CINEMA_COFFEE      CINEMA_COFFEE           3606
+cinema_juice           MACH_CINEMA_JUICE       CINEMA_JUICE            3607
+mx53_mirage2           MACH_MX53_MIRAGE2       MX53_MIRAGE2            3609
+mx53_efikasb           MACH_MX53_EFIKASB       MX53_EFIKASB            3610
+stm_b2000              MACH_STM_B2000          STM_B2000               3612
 m28evk                 MACH_M28EVK             M28EVK                  3613
+pda                    MACH_PDA                PDA                     3614
+meraki_mr58            MACH_MERAKI_MR58        MERAKI_MR58             3615
+kota2                  MACH_KOTA2              KOTA2                   3616
+letcool                        MACH_LETCOOL            LETCOOL                 3617
+mx27iat                        MACH_MX27IAT            MX27IAT                 3618
+apollo_td              MACH_APOLLO_TD          APOLLO_TD               3619
+arena                  MACH_ARENA              ARENA                   3620
+gsngateway             MACH_GSNGATEWAY         GSNGATEWAY              3621
+lf2000                 MACH_LF2000             LF2000                  3622
+bonito                 MACH_BONITO             BONITO                  3623
+asymptote              MACH_ASYMPTOTE          ASYMPTOTE               3624
+bst2brd                        MACH_BST2BRD            BST2BRD                 3625
+tx335s                 MACH_TX335S             TX335S                  3626
+pelco_tesla            MACH_PELCO_TESLA        PELCO_TESLA             3627
+rrhtestplat            MACH_RRHTESTPLAT        RRHTESTPLAT             3628
+vidtonic_pro           MACH_VIDTONIC_PRO       VIDTONIC_PRO            3629
+pl_apollo              MACH_PL_APOLLO          PL_APOLLO               3630
+pl_phoenix             MACH_PL_PHOENIX         PL_PHOENIX              3631
+m28cu3                 MACH_M28CU3             M28CU3                  3632
+vvbox_hd               MACH_VVBOX_HD           VVBOX_HD                3633
+coreware_sam9260_      MACH_COREWARE_SAM9260_  COREWARE_SAM9260_       3634
+marmaduke              MACH_MARMADUKE          MARMADUKE               3635
+amg_xlcore_camera      MACH_AMG_XLCORE_CAMERA  AMG_XLCORE_CAMERA       3636
+omap3_egf              MACH_OMAP3_EGF          OMAP3_EGF               3637
 smdk4212               MACH_SMDK4212           SMDK4212                3638
+dnp9200                        MACH_DNP9200            DNP9200                 3639
+tf101                  MACH_TF101              TF101                   3640
+omap3silvio            MACH_OMAP3SILVIO        OMAP3SILVIO             3641
+picasso2               MACH_PICASSO2           PICASSO2                3642
+vangogh2               MACH_VANGOGH2           VANGOGH2                3643
+olpc_xo_1_75           MACH_OLPC_XO_1_75       OLPC_XO_1_75            3644
+gx400                  MACH_GX400              GX400                   3645
+gs300                  MACH_GS300              GS300                   3646
+acer_a9                        MACH_ACER_A9            ACER_A9                 3647
+vivow_evm              MACH_VIVOW_EVM          VIVOW_EVM               3648
+veloce_cxq             MACH_VELOCE_CXQ         VELOCE_CXQ              3649
+veloce_cxm             MACH_VELOCE_CXM         VELOCE_CXM              3650
+p1852                  MACH_P1852              P1852                   3651
+naxy100                        MACH_NAXY100            NAXY100                 3652
+taishan                        MACH_TAISHAN            TAISHAN                 3653
+touchlink              MACH_TOUCHLINK          TOUCHLINK               3654
+stm32f103ze            MACH_STM32F103ZE        STM32F103ZE             3655
+mcx                    MACH_MCX                MCX                     3656
+stm_nmhdk_fli7610      MACH_STM_NMHDK_FLI7610  STM_NMHDK_FLI7610       3657
+top28x                 MACH_TOP28X             TOP28X                  3658
+okl4vp_microvisor      MACH_OKL4VP_MICROVISOR  OKL4VP_MICROVISOR       3659
+pop                    MACH_POP                POP                     3660
+layer                  MACH_LAYER              LAYER                   3661
+trondheim              MACH_TRONDHEIM          TRONDHEIM               3662
+eva                    MACH_EVA                EVA                     3663
+trust_taurus           MACH_TRUST_TAURUS       TRUST_TAURUS            3664
+ns2816_huashan         MACH_NS2816_HUASHAN     NS2816_HUASHAN          3665
+ns2816_yangcheng       MACH_NS2816_YANGCHENG   NS2816_YANGCHENG        3666
+p852                   MACH_P852               P852                    3667
+flea3                  MACH_FLEA3              FLEA3                   3668
+bowfin                 MACH_BOWFIN             BOWFIN                  3669
+mv88de3100             MACH_MV88DE3100         MV88DE3100              3670
+pia_am35x              MACH_PIA_AM35X          PIA_AM35X               3671
+cedar                  MACH_CEDAR              CEDAR                   3672
+picasso_e              MACH_PICASSO_E          PICASSO_E               3673
+samsung_e60            MACH_SAMSUNG_E60        SAMSUNG_E60             3674
+sdvr_mini              MACH_SDVR_MINI          SDVR_MINI               3676
+omap3_ij3k             MACH_OMAP3_IJ3K         OMAP3_IJ3K              3677
+modasmc1               MACH_MODASMC1           MODASMC1                3678
+apq8064_rumi3          MACH_APQ8064_RUMI3      APQ8064_RUMI3           3679
+matrix506              MACH_MATRIX506          MATRIX506               3680
+msm9615_mtp            MACH_MSM9615_MTP        MSM9615_MTP             3681
+dm36x_spawndc          MACH_DM36X_SPAWNDC      DM36X_SPAWNDC           3682
+sff792                 MACH_SFF792             SFF792                  3683
+am335xiaevm            MACH_AM335XIAEVM        AM335XIAEVM             3684
+g3c2440                        MACH_G3C2440            G3C2440                 3685
+tion270                        MACH_TION270            TION270                 3686
+w22q7arm02             MACH_W22Q7ARM02         W22Q7ARM02              3687
+omap_cat               MACH_OMAP_CAT           OMAP_CAT                3688
+at91sam9n12ek          MACH_AT91SAM9N12EK      AT91SAM9N12EK           3689
+morrison               MACH_MORRISON           MORRISON                3690
+svdu                   MACH_SVDU               SVDU                    3691
+lpp01                  MACH_LPP01              LPP01                   3692
+ubc283                 MACH_UBC283             UBC283                  3693
+zeppelin               MACH_ZEPPELIN           ZEPPELIN                3694
+motus                  MACH_MOTUS              MOTUS                   3695
+neomainboard           MACH_NEOMAINBOARD       NEOMAINBOARD            3696
+devkit3250             MACH_DEVKIT3250         DEVKIT3250              3697
+devkit7000             MACH_DEVKIT7000         DEVKIT7000              3698
+fmc_uic                        MACH_FMC_UIC            FMC_UIC                 3699
+fmc_dcm                        MACH_FMC_DCM            FMC_DCM                 3700
+batwm                  MACH_BATWM              BATWM                   3701
+atlas6cb               MACH_ATLAS6CB           ATLAS6CB                3702
+blue                   MACH_BLUE               BLUE                    3705
+colorado               MACH_COLORADO           COLORADO                3706
+popc                   MACH_POPC               POPC                    3707
+promwad_jade           MACH_PROMWAD_JADE       PROMWAD_JADE            3708
+amp                    MACH_AMP                AMP                     3709
+gnet_amp               MACH_GNET_AMP           GNET_AMP                3710
+toques                 MACH_TOQUES             TOQUES                  3711
+dct_storm              MACH_DCT_STORM          DCT_STORM               3713
+owl                    MACH_OWL                OWL                     3715
+cogent_csb1741         MACH_COGENT_CSB1741     COGENT_CSB1741          3716
+adillustra610          MACH_ADILLUSTRA610      ADILLUSTRA610           3718
+ecafe_na04             MACH_ECAFE_NA04         ECAFE_NA04              3719
+popct                  MACH_POPCT              POPCT                   3720
+omap3_helena           MACH_OMAP3_HELENA       OMAP3_HELENA            3721
+ach                    MACH_ACH                ACH                     3722
+module_dtb             MACH_MODULE_DTB         MODULE_DTB              3723
+oslo_elisabeth         MACH_OSLO_ELISABETH     OSLO_ELISABETH          3725
+tt01                   MACH_TT01               TT01                    3726
+msm8930_cdp            MACH_MSM8930_CDP        MSM8930_CDP             3727
+msm8930_mtp            MACH_MSM8930_MTP        MSM8930_MTP             3728
+msm8930_fluid          MACH_MSM8930_FLUID      MSM8930_FLUID           3729
+ltu11                  MACH_LTU11              LTU11                   3730
+am1808_spawnco         MACH_AM1808_SPAWNCO     AM1808_SPAWNCO          3731
+flx6410                        MACH_FLX6410            FLX6410                 3732
+mx6q_qsb               MACH_MX6Q_QSB           MX6Q_QSB                3733
+mx53_plt424            MACH_MX53_PLT424        MX53_PLT424             3734
+jasmine                        MACH_JASMINE            JASMINE                 3735
+l138_owlboard_plus     MACH_L138_OWLBOARD_PLUS L138_OWLBOARD_PLUS      3736
+wr21                   MACH_WR21               WR21                    3737
+peaboy                 MACH_PEABOY             PEABOY                  3739
+mx28_plato             MACH_MX28_PLATO         MX28_PLATO              3740
+kacom2                 MACH_KACOM2             KACOM2                  3741
+slco                   MACH_SLCO               SLCO                    3742
+imx51pico              MACH_IMX51PICO          IMX51PICO               3743
+glink1                 MACH_GLINK1             GLINK1                  3744
+diamond                        MACH_DIAMOND            DIAMOND                 3745
+d9000                  MACH_D9000              D9000                   3746
+w5300e01               MACH_W5300E01           W5300E01                3747
+im6000                 MACH_IM6000             IM6000                  3748
+mx51_fred51            MACH_MX51_FRED51        MX51_FRED51             3749
+stm32f2                        MACH_STM32F2            STM32F2                 3750
+ville                  MACH_VILLE              VILLE                   3751
+ptip_murnau            MACH_PTIP_MURNAU        PTIP_MURNAU             3752
+ptip_classic           MACH_PTIP_CLASSIC       PTIP_CLASSIC            3753
+mx53grb                        MACH_MX53GRB            MX53GRB                 3754
+gagarin                        MACH_GAGARIN            GAGARIN                 3755
+nas2big                        MACH_NAS2BIG            NAS2BIG                 3757
+superfemto             MACH_SUPERFEMTO         SUPERFEMTO              3758
+teufel                 MACH_TEUFEL             TEUFEL                  3759
+dinara                 MACH_DINARA             DINARA                  3760
+vanquish               MACH_VANQUISH           VANQUISH                3761
+zipabox1               MACH_ZIPABOX1           ZIPABOX1                3762
+u9540                  MACH_U9540              U9540                   3763
+jet                    MACH_JET                JET                     3764
 smdk4412               MACH_SMDK4412           SMDK4412                3765
+elite                  MACH_ELITE              ELITE                   3766
+spear320_hmi           MACH_SPEAR320_HMI       SPEAR320_HMI            3767
+ontario                        MACH_ONTARIO            ONTARIO                 3768
+mx6q_sabrelite         MACH_MX6Q_SABRELITE     MX6Q_SABRELITE          3769
+vc200                  MACH_VC200              VC200                   3770
+msm7625a_ffa           MACH_MSM7625A_FFA       MSM7625A_FFA            3771
+msm7625a_surf          MACH_MSM7625A_SURF      MSM7625A_SURF           3772
+benthossbp             MACH_BENTHOSSBP         BENTHOSSBP              3773
+smdk5210               MACH_SMDK5210           SMDK5210                3774
+empq2300               MACH_EMPQ2300           EMPQ2300                3775
+minipos                        MACH_MINIPOS            MINIPOS                 3776
+omap5_sevm             MACH_OMAP5_SEVM         OMAP5_SEVM              3777
+shelter                        MACH_SHELTER            SHELTER                 3778
+omap3_devkit8500       MACH_OMAP3_DEVKIT8500   OMAP3_DEVKIT8500        3779
+edgetd                 MACH_EDGETD             EDGETD                  3780
+copperyard             MACH_COPPERYARD         COPPERYARD              3781
+edge                   MACH_EDGE               EDGE                    3782
+edge_u                 MACH_EDGE_U             EDGE_U                  3783
+edge_td                        MACH_EDGE_TD            EDGE_TD                 3784
+wdss                   MACH_WDSS               WDSS                    3785
+dl_pb25                        MACH_DL_PB25            DL_PB25                 3786
+dss11                  MACH_DSS11              DSS11                   3787
+cpa                    MACH_CPA                CPA                     3788
+aptp2000               MACH_APTP2000           APTP2000                3789
+marzen                 MACH_MARZEN             MARZEN                  3790
+st_turbine             MACH_ST_TURBINE         ST_TURBINE              3791
+gtl_it3300             MACH_GTL_IT3300         GTL_IT3300              3792
+mx6_mule               MACH_MX6_MULE           MX6_MULE                3793
+v7pxa_dt               MACH_V7PXA_DT           V7PXA_DT                3794
+v7mmp_dt               MACH_V7MMP_DT           V7MMP_DT                3795
+dragon7                        MACH_DRAGON7            DRAGON7                 3796
+krome                  MACH_KROME              KROME                   3797
+oratisdante            MACH_ORATISDANTE        ORATISDANTE             3798
+fathom                 MACH_FATHOM             FATHOM                  3799
+dns325                 MACH_DNS325             DNS325                  3800
+sarnen                 MACH_SARNEN             SARNEN                  3801
+ubisys_g1              MACH_UBISYS_G1          UBISYS_G1               3802
+mx53_pf1               MACH_MX53_PF1           MX53_PF1                3803
+asanti                 MACH_ASANTI             ASANTI                  3804
+volta                  MACH_VOLTA              VOLTA                   3805
+knight                 MACH_KNIGHT             KNIGHT                  3807
+beaglebone             MACH_BEAGLEBONE         BEAGLEBONE              3808
+becker                 MACH_BECKER             BECKER                  3809
+fc360                  MACH_FC360              FC360                   3810
+pmi2_xls               MACH_PMI2_XLS           PMI2_XLS                3811
+taranto                        MACH_TARANTO            TARANTO                 3812
+plutux                 MACH_PLUTUX             PLUTUX                  3813
+ipmp_medcom            MACH_IPMP_MEDCOM        IPMP_MEDCOM             3814
+absolut                        MACH_ABSOLUT            ABSOLUT                 3815
+awpb3                  MACH_AWPB3              AWPB3                   3816
+nfp32xx_dt             MACH_NFP32XX_DT         NFP32XX_DT              3817
+dl_pb53                        MACH_DL_PB53            DL_PB53                 3818
+acu_ii                 MACH_ACU_II             ACU_II                  3819
+avalon                 MACH_AVALON             AVALON                  3820
+sphinx                 MACH_SPHINX             SPHINX                  3821
+titan_t                        MACH_TITAN_T            TITAN_T                 3822
+harvest_boris          MACH_HARVEST_BORIS      HARVEST_BORIS           3823
+mach_msm7x30_m3s       MACH_MACH_MSM7X30_M3S   MACH_MSM7X30_M3S        3824
+smdk5250               MACH_SMDK5250           SMDK5250                3825
+imxt_lite              MACH_IMXT_LITE          IMXT_LITE               3826
+imxt_std               MACH_IMXT_STD           IMXT_STD                3827
+imxt_log               MACH_IMXT_LOG           IMXT_LOG                3828
+imxt_nav               MACH_IMXT_NAV           IMXT_NAV                3829
+imxt_full              MACH_IMXT_FULL          IMXT_FULL               3830
+ag09015                        MACH_AG09015            AG09015                 3831
+am3517_mt_ventoux      MACH_AM3517_MT_VENTOUX  AM3517_MT_VENTOUX       3832
+dp1arm9                        MACH_DP1ARM9            DP1ARM9                 3833
+picasso_m              MACH_PICASSO_M          PICASSO_M               3834
+video_gadget           MACH_VIDEO_GADGET       VIDEO_GADGET            3835
+mtt_om3x               MACH_MTT_OM3X           MTT_OM3X                3836
+mx6q_arm2              MACH_MX6Q_ARM2          MX6Q_ARM2               3837
+picosam9g45            MACH_PICOSAM9G45        PICOSAM9G45             3838
+vpm_dm365              MACH_VPM_DM365          VPM_DM365               3839
+bonfire                        MACH_BONFIRE            BONFIRE                 3840
+mt2p2d                 MACH_MT2P2D             MT2P2D                  3841
+sigpda01               MACH_SIGPDA01           SIGPDA01                3842
+cn27                   MACH_CN27               CN27                    3843
+mx25_cwtap             MACH_MX25_CWTAP         MX25_CWTAP              3844
+apf28                  MACH_APF28              APF28                   3845
+pelco_maxwell          MACH_PELCO_MAXWELL      PELCO_MAXWELL           3846
+ge_phoenix             MACH_GE_PHOENIX         GE_PHOENIX              3847
+empc_a500              MACH_EMPC_A500          EMPC_A500               3848
+ims_arm9               MACH_IMS_ARM9           IMS_ARM9                3849
+mini2416               MACH_MINI2416           MINI2416                3850
+mini2450               MACH_MINI2450           MINI2450                3851
+mini310                        MACH_MINI310            MINI310                 3852
+spear_hurricane                MACH_SPEAR_HURRICANE    SPEAR_HURRICANE         3853
+mt7208                 MACH_MT7208             MT7208                  3854
+lpc178x                        MACH_LPC178X            LPC178X                 3855
+farleys                        MACH_FARLEYS            FARLEYS                 3856
+efm32gg_dk3750         MACH_EFM32GG_DK3750     EFM32GG_DK3750          3857
+zeus_board             MACH_ZEUS_BOARD         ZEUS_BOARD              3858
+cc51                   MACH_CC51               CC51                    3859
+fxi_c210               MACH_FXI_C210           FXI_C210                3860
+msm8627_cdp            MACH_MSM8627_CDP        MSM8627_CDP             3861
+msm8627_mtp            MACH_MSM8627_MTP        MSM8627_MTP             3862
+armadillo800eva                MACH_ARMADILLO800EVA    ARMADILLO800EVA         3863
+primou                 MACH_PRIMOU             PRIMOU                  3864
+primoc                 MACH_PRIMOC             PRIMOC                  3865
+primoct                        MACH_PRIMOCT            PRIMOCT                 3866
+a9500                  MACH_A9500              A9500                   3867
+pluto                  MACH_PLUTO              PLUTO                   3869
+acfx100                        MACH_ACFX100            ACFX100                 3870
+msm8625_rumi3          MACH_MSM8625_RUMI3      MSM8625_RUMI3           3871
+valente                        MACH_VALENTE            VALENTE                 3872
+crfs_rfeye             MACH_CRFS_RFEYE         CRFS_RFEYE              3873
+rfeye                  MACH_RFEYE              RFEYE                   3874
+phidget_sbc3           MACH_PHIDGET_SBC3       PHIDGET_SBC3            3875
+tcw_mika               MACH_TCW_MIKA           TCW_MIKA                3876
+imx28_egf              MACH_IMX28_EGF          IMX28_EGF               3877
+valente_wx             MACH_VALENTE_WX         VALENTE_WX              3878
+huangshans             MACH_HUANGSHANS         HUANGSHANS              3879
+bosphorus1             MACH_BOSPHORUS1         BOSPHORUS1              3880
+prima                  MACH_PRIMA              PRIMA                   3881
+evita_ulk              MACH_EVITA_ULK          EVITA_ULK               3884
+merisc600              MACH_MERISC600          MERISC600               3885
+dolak                  MACH_DOLAK              DOLAK                   3886
+sbc53                  MACH_SBC53              SBC53                   3887
+elite_ulk              MACH_ELITE_ULK          ELITE_ULK               3888
+pov2                   MACH_POV2               POV2                    3889
+ipod_touch_2g          MACH_IPOD_TOUCH_2G      IPOD_TOUCH_2G           3890
+da850_pqab             MACH_DA850_PQAB         DA850_PQAB              3891
index 1f17bde52cd4dca07e6ec59aac6a13588ed8096b..7c756fb189f713f3fd9d0b06de43530cb60833c1 100644 (file)
@@ -109,7 +109,7 @@ struct eth_addr {
        u8 addr[6];
 };
 static struct eth_addr __initdata hw_addr[2];
-static struct eth_platform_data __initdata eth_data[2];
+static struct macb_platform_data __initdata eth_data[2];
 
 static struct spi_board_info spi0_board_info[] __initdata = {
        {
index 4643ff5107c9f76ea4b3fa10a2c02f217696a22e..c56ddac85d615ba7acdeac3cc5fc67fa925898b3 100644 (file)
@@ -105,7 +105,7 @@ struct eth_addr {
 };
 
 static struct eth_addr __initdata hw_addr[2];
-static struct eth_platform_data __initdata eth_data[2] = {
+static struct macb_platform_data __initdata eth_data[2] = {
        {
                /*
                 * The MDIO pullups on STK1000 are a bit too weak for
index 86fab77a5a00f993b8e9f82621b0cda03bdc74a2..27bd6fbe21cb5f76253ad88f50f4a12c13f9778e 100644 (file)
@@ -50,7 +50,7 @@ struct eth_addr {
        u8 addr[6];
 };
 static struct eth_addr __initdata hw_addr[1];
-static struct eth_platform_data __initdata eth_data[1] = {
+static struct macb_platform_data __initdata eth_data[1] = {
        {
                .phy_mask       = ~(1U << 1),
        },
index da14fbdd4e8e0062a87464a8c8d9d43954f63730..9d1efd1cd42534076307d59c1444a663c3b8764d 100644 (file)
@@ -102,7 +102,7 @@ struct eth_addr {
 };
 
 static struct eth_addr __initdata hw_addr[1];
-static struct eth_platform_data __initdata eth_data[1];
+static struct macb_platform_data __initdata eth_data[1];
 
 /*
  * The next two functions should go away as the boot loader is
index e61bc948f959861047449fcce267422b0fe84c78..ed137e335796e7a7e0cf881c2879037720d4200f 100644 (file)
@@ -52,7 +52,7 @@ struct eth_addr {
 };
 
 static struct eth_addr __initdata hw_addr[2];
-static struct eth_platform_data __initdata eth_data[2];
+static struct macb_platform_data __initdata eth_data[2];
 
 static int ads7846_get_pendown_state_PB26(void)
 {
index c4da5cba2dbfa718cd1a3ea34afd3a0c50257c01..05358aa5ef7d210ed42d2bb6f68be48b3fa4c690 100644 (file)
@@ -86,7 +86,7 @@ struct eth_addr {
        u8 addr[6];
 };
 static struct eth_addr __initdata hw_addr[2];
-static struct eth_platform_data __initdata eth_data[2];
+static struct macb_platform_data __initdata eth_data[2];
 
 static struct spi_eeprom eeprom_25lc010 = {
                .name = "25lc010",
index 7fbf0dcb9afe5f88e9e307f3530cdbd875cf20f1..402a7bb726696b4091e15a4e367004e634295859 100644 (file)
@@ -1067,7 +1067,7 @@ void __init at32_setup_serial_console(unsigned int usart_id)
  * -------------------------------------------------------------------- */
 
 #ifdef CONFIG_CPU_AT32AP7000
-static struct eth_platform_data macb0_data;
+static struct macb_platform_data macb0_data;
 static struct resource macb0_resource[] = {
        PBMEM(0xfff01800),
        IRQ(25),
@@ -1076,7 +1076,7 @@ DEFINE_DEV_DATA(macb, 0);
 DEV_CLK(hclk, macb0, hsb, 8);
 DEV_CLK(pclk, macb0, pbb, 6);
 
-static struct eth_platform_data macb1_data;
+static struct macb_platform_data macb1_data;
 static struct resource macb1_resource[] = {
        PBMEM(0xfff01c00),
        IRQ(26),
@@ -1086,7 +1086,7 @@ DEV_CLK(hclk, macb1, hsb, 9);
 DEV_CLK(pclk, macb1, pbb, 7);
 
 struct platform_device *__init
-at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
+at32_add_device_eth(unsigned int id, struct macb_platform_data *data)
 {
        struct platform_device *pdev;
        u32 pin_mask;
@@ -1163,7 +1163,7 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
                return NULL;
        }
 
-       memcpy(pdev->dev.platform_data, data, sizeof(struct eth_platform_data));
+       memcpy(pdev->dev.platform_data, data, sizeof(struct macb_platform_data));
        platform_device_register(pdev);
 
        return pdev;
index 5d7ffca7d69f01bb5b28cec422b8afb702d27859..67b111ce332ddf02bc32afb9eacd66869a2e7a92 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <linux/types.h>
 #include <linux/serial.h>
+#include <linux/platform_data/macb.h>
 
 #define GPIO_PIN_NONE  (-1)
 
@@ -42,12 +43,8 @@ struct atmel_uart_data {
 void at32_map_usart(unsigned int hw_id, unsigned int line, int flags);
 struct platform_device *at32_add_device_usart(unsigned int id);
 
-struct eth_platform_data {
-       u32     phy_mask;
-       u8      is_rmii;
-};
 struct platform_device *
-at32_add_device_eth(unsigned int id, struct eth_platform_data *data);
+at32_add_device_eth(unsigned int id, struct macb_platform_data *data);
 
 struct spi_board_info;
 struct platform_device *
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
new file mode 100644 (file)
index 0000000..26e67f0
--- /dev/null
@@ -0,0 +1,174 @@
+#
+# For a description of the syntax of this configuration file,
+# see Documentation/kbuild/kconfig-language.txt.
+#
+
+config TMS320C6X
+       def_bool y
+       select CLKDEV_LOOKUP
+       select GENERIC_IRQ_SHOW
+       select HAVE_ARCH_TRACEHOOK
+       select HAVE_DMA_API_DEBUG
+       select HAVE_GENERIC_HARDIRQS
+       select HAVE_MEMBLOCK
+       select HAVE_SPARSE_IRQ
+       select OF
+       select OF_EARLY_FLATTREE
+
+config MMU
+       def_bool n
+
+config ZONE_DMA
+       def_bool y
+
+config FPU
+       def_bool n
+
+config HIGHMEM
+       def_bool n
+
+config NUMA
+       def_bool n
+
+config RWSEM_GENERIC_SPINLOCK
+       def_bool y
+
+config RWSEM_XCHGADD_ALGORITHM
+       def_bool n
+
+config GENERIC_CALIBRATE_DELAY
+       def_bool y
+
+config GENERIC_HWEIGHT
+       def_bool y
+
+config GENERIC_CLOCKEVENTS
+       def_bool y
+
+config GENERIC_CLOCKEVENTS_BROADCAST
+       bool
+
+config GENERIC_BUG
+       def_bool y
+
+config COMMON_CLKDEV
+       def_bool y
+
+config C6X_BIG_KERNEL
+       bool "Build a big kernel"
+       help
+         The C6X function call instruction has a limited range of +/- 2MiB.
+         This is sufficient for most kernels, but some kernel configurations
+         with lots of compiled-in functionality may require a larger range
+         for function calls. Use this option to have the compiler generate
+         function calls with 32-bit range. This will make the kernel both
+         larger and slower.
+
+         If unsure, say N.
+
+source "init/Kconfig"
+
+# Use the generic interrupt handling code in kernel/irq/
+
+source "kernel/Kconfig.freezer"
+
+config CMDLINE_BOOL
+       bool "Default bootloader kernel arguments"
+
+config CMDLINE
+       string "Kernel command line"
+       depends on CMDLINE_BOOL
+       default "console=ttyS0,57600"
+       help
+         On some architectures there is currently no way for the boot loader
+         to pass arguments to the kernel. For these architectures, you should
+         supply some command-line options at build time by entering them
+         here.
+
+config CMDLINE_FORCE
+       bool "Force default kernel command string"
+       depends on CMDLINE_BOOL
+       default n
+       help
+         Set this to have arguments from the default kernel command string
+         override those passed by the boot loader.
+
+config CPU_BIG_ENDIAN
+       bool "Build big-endian kernel"
+       default n
+       help
+         Say Y if you plan on running a kernel in big-endian mode.
+         Note that your board must be properly built and your board
+         port must properly enable any big-endian related features
+         of your chipset/board/processor.
+
+config FORCE_MAX_ZONEORDER
+       int "Maximum zone order"
+       default "13"
+       help
+         The kernel memory allocator divides physically contiguous memory
+         blocks into "zones", where each zone is a power of two number of
+         pages.  This option selects the largest power of two that the kernel
+         keeps in the memory allocator.  If you need to allocate very large
+         blocks of physically contiguous memory, then you may need to
+         increase this value.
+
+         This config option is actually maximum order plus one. For example,
+         a value of 11 means that the largest free memory block is 2^10 pages.
+
+menu "Processor type and features"
+
+source "arch/c6x/platforms/Kconfig"
+
+config TMS320C6X_CACHES_ON
+       bool "L2 cache support"
+       default y
+
+config KERNEL_RAM_BASE_ADDRESS
+       hex "Virtual address of memory base"
+       default 0xe0000000 if SOC_TMS320C6455
+       default 0xe0000000 if SOC_TMS320C6457
+       default 0xe0000000 if SOC_TMS320C6472
+       default 0x80000000
+
+source "mm/Kconfig"
+
+source "kernel/Kconfig.preempt"
+
+source "kernel/Kconfig.hz"
+source "kernel/time/Kconfig"
+
+endmenu
+
+menu "Executable file formats"
+
+source "fs/Kconfig.binfmt"
+
+endmenu
+
+source "net/Kconfig"
+
+source "drivers/Kconfig"
+
+source "fs/Kconfig"
+
+source "security/Kconfig"
+
+source "crypto/Kconfig"
+
+source "lib/Kconfig"
+
+menu "Kernel hacking"
+
+source "lib/Kconfig.debug"
+
+config ACCESS_CHECK
+       bool "Check the user pointer address"
+       default y
+       help
+         Usually the pointer transfer from user space is checked to see if its
+         address is in the kernel space.
+
+         Say N here to disable that check to improve the performance.
+
+endmenu
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile
new file mode 100644 (file)
index 0000000..1d08dd0
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# linux/arch/c6x/Makefile
+#
+# 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.
+#
+
+cflags-y += -mno-dsbt -msdata=none
+
+cflags-$(CONFIG_C6X_BIG_KERNEL) += -mlong-calls
+
+CFLAGS_MODULE   += -mlong-calls -mno-dsbt -msdata=none
+
+CHECKFLAGS      +=
+
+KBUILD_CFLAGS   += $(cflags-y)
+KBUILD_AFLAGS   += $(cflags-y)
+
+ifdef CONFIG_CPU_BIG_ENDIAN
+KBUILD_CFLAGS   += -mbig-endian
+KBUILD_AFLAGS   += -mbig-endian
+LINKFLAGS       += -mbig-endian
+KBUILD_LDFLAGS  += -mbig-endian
+LDFLAGS += -EB
+endif
+
+head-y          := arch/c6x/kernel/head.o
+core-y          += arch/c6x/kernel/ arch/c6x/mm/ arch/c6x/platforms/
+libs-y          += arch/c6x/lib/
+
+# Default to vmlinux.bin, override when needed
+all: vmlinux.bin
+
+boot := arch/$(ARCH)/boot
+
+# Are we making a dtbImage.<boardname> target? If so, crack out the boardname
+DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS)))
+export DTB
+
+ifneq ($(DTB),)
+core-y += $(boot)/
+endif
+
+# With make 3.82 we cannot mix normal and wildcard targets
+
+vmlinux.bin: vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+
+dtbImage.%: vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+
+archclean:
+       $(Q)$(MAKE) $(clean)=$(boot)
+
+define archhelp
+  @echo '  vmlinux.bin     - Binary kernel image (arch/$(ARCH)/boot/vmlinux.bin)'
+  @echo '  dtbImage.<dt>   - ELF image with $(arch)/boot/dts/<dt>.dts linked in'
+  @echo '                  - stripped elf with fdt blob'
+endef
diff --git a/arch/c6x/boot/Makefile b/arch/c6x/boot/Makefile
new file mode 100644 (file)
index 0000000..ecca820
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# Makefile for bootable kernel images
+#
+
+OBJCOPYFLAGS_vmlinux.bin := -O binary
+$(obj)/vmlinux.bin: vmlinux FORCE
+       $(call if_changed,objcopy)
+
+DTC_FLAGS ?= -p 1024
+
+ifneq ($(DTB),)
+obj-y += linked_dtb.o
+endif
+
+$(obj)/%.dtb: $(src)/dts/%.dts FORCE
+       $(call cmd,dtc)
+
+quiet_cmd_cp = CP      $< $@$2
+       cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
+
+# Generate builtin.dtb from $(DTB).dtb
+$(obj)/builtin.dtb: $(obj)/$(DTB).dtb
+       $(call if_changed,cp)
+
+$(obj)/linked_dtb.o: $(obj)/builtin.dtb
+
+$(obj)/dtbImage.%: vmlinux
+       $(call if_changed,objcopy)
+
+clean-files := $(obj)/*.dtb
diff --git a/arch/c6x/boot/dts/dsk6455.dts b/arch/c6x/boot/dts/dsk6455.dts
new file mode 100644 (file)
index 0000000..2b71f80
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * arch/c6x/boot/dts/dsk6455.dts
+ *
+ * DSK6455 Evaluation Platform For TMS320C6455
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ * Author: Mark Salter <msalter@redhat.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.
+ *
+ */
+
+/dts-v1/;
+
+/include/ "tms320c6455.dtsi"
+
+/ {
+       model = "Spectrum Digital DSK6455";
+       compatible = "spectrum-digital,dsk6455";
+
+       chosen {
+               bootargs = "root=/dev/nfs ip=dhcp rw";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0xE0000000 0x08000000>;
+       };
+
+       soc {
+               megamod_pic: interrupt-controller@1800000 {
+                       interrupts = < 12 13 14 15 >;
+               };
+
+               emifa@70000000 {
+                       flash@3,0 {
+                                 #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "cfi-flash";
+                               reg = <0x3 0x0 0x400000>;
+                               bank-width = <1>;
+                               device-width = <1>;
+                               partition@0 {
+                                       reg = <0x0 0x400000>;
+                                       label = "NOR";
+                               };
+                       };
+               };
+
+               timer1: timer@2980000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 69 >;
+               };
+
+               clock-controller@029a0000 {
+                       clock-frequency = <50000000>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/dts/evmc6457.dts b/arch/c6x/boot/dts/evmc6457.dts
new file mode 100644 (file)
index 0000000..0301eb9
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * arch/c6x/boot/dts/evmc6457.dts
+ *
+ * EVMC6457 Evaluation Platform For TMS320C6457
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ * Author: Mark Salter <msalter@redhat.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.
+ *
+ */
+
+/dts-v1/;
+
+/include/ "tms320c6457.dtsi"
+
+/ {
+       model = "eInfochips EVMC6457";
+       compatible = "einfochips,evmc6457";
+
+       chosen {
+               bootargs = "console=hvc root=/dev/nfs ip=dhcp rw";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0xE0000000 0x10000000>;
+       };
+
+       soc {
+               megamod_pic: interrupt-controller@1800000 {
+                      interrupts = < 12 13 14 15 >;
+               };
+
+               timer0: timer@2940000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 67 >;
+               };
+
+               clock-controller@29a0000 {
+                       clock-frequency = <60000000>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/dts/evmc6472.dts b/arch/c6x/boot/dts/evmc6472.dts
new file mode 100644 (file)
index 0000000..3e207b4
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * arch/c6x/boot/dts/evmc6472.dts
+ *
+ * EVMC6472 Evaluation Platform For TMS320C6472
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ * Author: Mark Salter <msalter@redhat.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.
+ *
+ */
+
+/dts-v1/;
+
+/include/ "tms320c6472.dtsi"
+
+/ {
+       model = "eInfochips EVMC6472";
+       compatible = "einfochips,evmc6472";
+
+       chosen {
+               bootargs = "console=hvc root=/dev/nfs ip=dhcp rw";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0xE0000000 0x10000000>;
+       };
+
+       soc {
+               megamod_pic: interrupt-controller@1800000 {
+                      interrupts = < 12 13 14 15 >;
+               };
+
+               timer0: timer@25e0000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 16 >;
+               };
+
+               timer1: timer@25f0000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 16 >;
+               };
+
+               timer2: timer@2600000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 16 >;
+               };
+
+               timer3: timer@2610000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 16 >;
+               };
+
+               timer4: timer@2620000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 16 >;
+               };
+
+               timer5: timer@2630000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 16 >;
+               };
+
+               clock-controller@29a0000 {
+                       clock-frequency = <25000000>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/dts/evmc6474.dts b/arch/c6x/boot/dts/evmc6474.dts
new file mode 100644 (file)
index 0000000..4dc2912
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * arch/c6x/boot/dts/evmc6474.dts
+ *
+ * EVMC6474 Evaluation Platform For TMS320C6474
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ * Author: Mark Salter <msalter@redhat.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.
+ *
+ */
+
+/dts-v1/;
+
+/include/ "tms320c6474.dtsi"
+
+/ {
+       model = "Spectrum Digital EVMC6474";
+       compatible = "spectrum-digital,evmc6474";
+
+       chosen {
+               bootargs = "console=hvc root=/dev/nfs ip=dhcp rw";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x08000000>;
+       };
+
+       soc {
+               megamod_pic: interrupt-controller@1800000 {
+                      interrupts = < 12 13 14 15 >;
+               };
+
+               timer3: timer@2940000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 39 >;
+               };
+
+               timer4: timer@2950000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 41 >;
+               };
+
+               timer5: timer@2960000 {
+                       interrupt-parent = <&megamod_pic>;
+                       interrupts = < 43 >;
+               };
+
+               clock-controller@29a0000 {
+                       clock-frequency = <50000000>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/dts/tms320c6455.dtsi b/arch/c6x/boot/dts/tms320c6455.dtsi
new file mode 100644 (file)
index 0000000..a804ec1
--- /dev/null
@@ -0,0 +1,96 @@
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       model = "ti,c64x+";
+                       reg = <0>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               model = "tms320c6455";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               core_pic: interrupt-controller {
+                         interrupt-controller;
+                         #interrupt-cells = <1>;
+                         compatible = "ti,c64x+core-pic";
+               };
+
+               /*
+                * Megamodule interrupt controller
+                */
+               megamod_pic: interrupt-controller@1800000 {
+                      compatible = "ti,c64x+megamod-pic";
+                      interrupt-controller;
+                      #interrupt-cells = <1>;
+                      reg = <0x1800000 0x1000>;
+                      interrupt-parent = <&core_pic>;
+               };
+
+               cache-controller@1840000 {
+                       compatible = "ti,c64x+cache";
+                       reg = <0x01840000 0x8400>;
+               };
+
+               emifa@70000000 {
+                       compatible = "ti,c64x+emifa", "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       reg = <0x70000000 0x100>;
+                       ranges = <0x2 0x0 0xa0000000 0x00000008
+                                 0x3 0x0 0xb0000000 0x00400000
+                                 0x4 0x0 0xc0000000 0x10000000
+                                 0x5 0x0 0xD0000000 0x10000000>;
+
+                       ti,dscr-dev-enable = <13>;
+                       ti,emifa-burst-priority = <255>;
+                       ti,emifa-ce-config = <0x00240120
+                                             0x00240120
+                                             0x00240122
+                                             0x00240122>;
+               };
+
+               timer1: timer@2980000 {
+                       compatible = "ti,c64x+timer64";
+                       reg = <0x2980000 0x40>;
+                       ti,dscr-dev-enable = <4>;
+               };
+
+               clock-controller@029a0000 {
+                       compatible = "ti,c6455-pll", "ti,c64x+pll";
+                       reg = <0x029a0000 0x200>;
+                       ti,c64x+pll-bypass-delay = <1440>;
+                       ti,c64x+pll-reset-delay = <15360>;
+                       ti,c64x+pll-lock-delay = <24000>;
+               };
+
+               device-state-config-regs@2a80000 {
+                       compatible = "ti,c64x+dscr";
+                       reg = <0x02a80000 0x41000>;
+
+                       ti,dscr-devstat = <0>;
+                       ti,dscr-silicon-rev = <8 28 0xf>;
+                       ti,dscr-rmii-resets = <0 0x40020 0x00040000>;
+
+                       ti,dscr-locked-regs = <0x40008 0x40004 0x0f0a0b00>;
+                       ti,dscr-devstate-ctl-regs =
+                                <0 12 0x40008 1 0  0  2
+                                 12 1 0x40008 3 0 30  2
+                                 13 2 0x4002c 1 0xffffffff 0 1>;
+                       ti,dscr-devstate-stat-regs =
+                               <0 10 0x40014 1 0  0  3
+                                10 2 0x40018 1 0  0  3>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/dts/tms320c6457.dtsi b/arch/c6x/boot/dts/tms320c6457.dtsi
new file mode 100644 (file)
index 0000000..35f4070
--- /dev/null
@@ -0,0 +1,68 @@
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       model = "ti,c64x+";
+                       reg = <0>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               model = "tms320c6457";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               core_pic: interrupt-controller {
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       compatible = "ti,c64x+core-pic";
+               };
+
+               megamod_pic: interrupt-controller@1800000 {
+                       compatible = "ti,c64x+megamod-pic";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&core_pic>;
+                       reg = <0x1800000 0x1000>;
+               };
+
+               cache-controller@1840000 {
+                       compatible = "ti,c64x+cache";
+                       reg = <0x01840000 0x8400>;
+               };
+
+               device-state-controller@2880800 {
+                       compatible = "ti,c64x+dscr";
+                       reg = <0x02880800 0x400>;
+
+                       ti,dscr-devstat = <0x20>;
+                       ti,dscr-silicon-rev = <0x18 28 0xf>;
+                       ti,dscr-mac-fuse-regs = <0x114 3 4 5 6
+                                                0x118 0 0 1 2>;
+                       ti,dscr-kick-regs = <0x38 0x83E70B13
+                                            0x3c 0x95A4F1E0>;
+               };
+
+               timer0: timer@2940000 {
+                       compatible = "ti,c64x+timer64";
+                       reg = <0x2940000 0x40>;
+               };
+
+               clock-controller@29a0000 {
+                       compatible = "ti,c6457-pll", "ti,c64x+pll";
+                       reg = <0x029a0000 0x200>;
+                       ti,c64x+pll-bypass-delay = <300>;
+                       ti,c64x+pll-reset-delay = <24000>;
+                       ti,c64x+pll-lock-delay = <50000>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/dts/tms320c6472.dtsi b/arch/c6x/boot/dts/tms320c6472.dtsi
new file mode 100644 (file)
index 0000000..b488aae
--- /dev/null
@@ -0,0 +1,134 @@
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       model = "ti,c64x+";
+               };
+               cpu@1 {
+                       device_type = "cpu";
+                       reg = <1>;
+                       model = "ti,c64x+";
+               };
+               cpu@2 {
+                       device_type = "cpu";
+                       reg = <2>;
+                       model = "ti,c64x+";
+               };
+               cpu@3 {
+                       device_type = "cpu";
+                       reg = <3>;
+                       model = "ti,c64x+";
+               };
+               cpu@4 {
+                       device_type = "cpu";
+                       reg = <4>;
+                       model = "ti,c64x+";
+               };
+               cpu@5 {
+                       device_type = "cpu";
+                       reg = <5>;
+                       model = "ti,c64x+";
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               model = "tms320c6472";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               core_pic: interrupt-controller {
+                       compatible = "ti,c64x+core-pic";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+               };
+
+               megamod_pic: interrupt-controller@1800000 {
+                      compatible = "ti,c64x+megamod-pic";
+                      interrupt-controller;
+                      #interrupt-cells = <1>;
+                      reg = <0x1800000 0x1000>;
+                      interrupt-parent = <&core_pic>;
+               };
+
+               cache-controller@1840000 {
+                       compatible = "ti,c64x+cache";
+                       reg = <0x01840000 0x8400>;
+               };
+
+               timer0: timer@25e0000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x01 >;
+                       reg = <0x25e0000 0x40>;
+               };
+
+               timer1: timer@25f0000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x02 >;
+                       reg = <0x25f0000 0x40>;
+               };
+
+               timer2: timer@2600000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x04 >;
+                       reg = <0x2600000 0x40>;
+               };
+
+               timer3: timer@2610000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x08 >;
+                       reg = <0x2610000 0x40>;
+               };
+
+               timer4: timer@2620000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x10 >;
+                       reg = <0x2620000 0x40>;
+               };
+
+               timer5: timer@2630000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x20 >;
+                       reg = <0x2630000 0x40>;
+               };
+
+               clock-controller@29a0000 {
+                       compatible = "ti,c6472-pll", "ti,c64x+pll";
+                       reg = <0x029a0000 0x200>;
+                       ti,c64x+pll-bypass-delay = <200>;
+                       ti,c64x+pll-reset-delay = <12000>;
+                       ti,c64x+pll-lock-delay = <80000>;
+               };
+
+               device-state-controller@2a80000 {
+                       compatible = "ti,c64x+dscr";
+                       reg = <0x02a80000 0x1000>;
+
+                       ti,dscr-devstat = <0>;
+                       ti,dscr-silicon-rev = <0x70c 16 0xff>;
+
+                       ti,dscr-mac-fuse-regs = <0x700 1 2 3 4
+                                                0x704 5 6 0 0>;
+
+                       ti,dscr-rmii-resets = <0x208 1
+                                              0x20c 1>;
+
+                       ti,dscr-locked-regs = <0x200 0x204 0x0a1e183a
+                                              0x40c 0x420 0xbea7
+                                              0x41c 0x420 0xbea7>;
+
+                       ti,dscr-privperm = <0x41c 0xaaaaaaaa>;
+
+                       ti,dscr-devstate-ctl-regs = <0 13 0x200 1 0 0 1>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/dts/tms320c6474.dtsi b/arch/c6x/boot/dts/tms320c6474.dtsi
new file mode 100644 (file)
index 0000000..cc601bf
--- /dev/null
@@ -0,0 +1,89 @@
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       model = "ti,c64x+";
+               };
+               cpu@1 {
+                       device_type = "cpu";
+                       reg = <1>;
+                       model = "ti,c64x+";
+               };
+               cpu@2 {
+                       device_type = "cpu";
+                       reg = <2>;
+                       model = "ti,c64x+";
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               model = "tms320c6474";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               core_pic: interrupt-controller {
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       compatible = "ti,c64x+core-pic";
+               };
+
+               megamod_pic: interrupt-controller@1800000 {
+                      compatible = "ti,c64x+megamod-pic";
+                      interrupt-controller;
+                      #interrupt-cells = <1>;
+                      reg = <0x1800000 0x1000>;
+                      interrupt-parent = <&core_pic>;
+               };
+
+               cache-controller@1840000 {
+                       compatible = "ti,c64x+cache";
+                       reg = <0x01840000 0x8400>;
+               };
+
+               timer3: timer@2940000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x04 >;
+                       reg = <0x2940000 0x40>;
+               };
+
+               timer4: timer@2950000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x02 >;
+                       reg = <0x2950000 0x40>;
+               };
+
+               timer5: timer@2960000 {
+                       compatible = "ti,c64x+timer64";
+                       ti,core-mask = < 0x01 >;
+                       reg = <0x2960000 0x40>;
+               };
+
+               device-state-controller@2880800 {
+                       compatible = "ti,c64x+dscr";
+                       reg = <0x02880800 0x400>;
+
+                       ti,dscr-devstat = <0x004>;
+                       ti,dscr-silicon-rev = <0x014 28 0xf>;
+                       ti,dscr-mac-fuse-regs = <0x34 3 4 5 6
+                                                0x38 0 0 1 2>;
+               };
+
+               clock-controller@29a0000 {
+                       compatible = "ti,c6474-pll", "ti,c64x+pll";
+                       reg = <0x029a0000 0x200>;
+                       ti,c64x+pll-bypass-delay = <120>;
+                       ti,c64x+pll-reset-delay = <30000>;
+                       ti,c64x+pll-lock-delay = <60000>;
+               };
+       };
+};
diff --git a/arch/c6x/boot/linked_dtb.S b/arch/c6x/boot/linked_dtb.S
new file mode 100644 (file)
index 0000000..57a4454
--- /dev/null
@@ -0,0 +1,2 @@
+.section __fdt_blob,"a"
+.incbin "arch/c6x/boot/builtin.dtb"
diff --git a/arch/c6x/configs/dsk6455_defconfig b/arch/c6x/configs/dsk6455_defconfig
new file mode 100644 (file)
index 0000000..4663487
--- /dev/null
@@ -0,0 +1,44 @@
+CONFIG_SOC_TMS320C6455=y
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EXPERT=y
+# CONFIG_FUTEX is not set
+# CONFIG_SLUB_DEBUG is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=2
+CONFIG_BLK_DEV_RAM_SIZE=17000
+CONFIG_MISC_DEVICES=y
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_CRC16=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_MTD=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP_OF=y
diff --git a/arch/c6x/configs/evmc6457_defconfig b/arch/c6x/configs/evmc6457_defconfig
new file mode 100644 (file)
index 0000000..bba40e1
--- /dev/null
@@ -0,0 +1,41 @@
+CONFIG_SOC_TMS320C6457=y
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EXPERT=y
+# CONFIG_FUTEX is not set
+# CONFIG_SLUB_DEBUG is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+CONFIG_BOARD_EVM6457=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=2
+CONFIG_BLK_DEV_RAM_SIZE=17000
+CONFIG_MISC_DEVICES=y
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_CRC16=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/c6x/configs/evmc6472_defconfig b/arch/c6x/configs/evmc6472_defconfig
new file mode 100644 (file)
index 0000000..8c46155
--- /dev/null
@@ -0,0 +1,42 @@
+CONFIG_SOC_TMS320C6472=y
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EXPERT=y
+# CONFIG_FUTEX is not set
+# CONFIG_SLUB_DEBUG is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+# CONFIG_CMDLINE_FORCE is not set
+CONFIG_BOARD_EVM6472=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=2
+CONFIG_BLK_DEV_RAM_SIZE=17000
+CONFIG_MISC_DEVICES=y
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_CRC16=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/c6x/configs/evmc6474_defconfig b/arch/c6x/configs/evmc6474_defconfig
new file mode 100644 (file)
index 0000000..15533f6
--- /dev/null
@@ -0,0 +1,42 @@
+CONFIG_SOC_TMS320C6474=y
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EXPERT=y
+# CONFIG_FUTEX is not set
+# CONFIG_SLUB_DEBUG is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+# CONFIG_CMDLINE_FORCE is not set
+CONFIG_BOARD_EVM6474=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=2
+CONFIG_BLK_DEV_RAM_SIZE=17000
+CONFIG_MISC_DEVICES=y
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_CRC16=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild
new file mode 100644 (file)
index 0000000..13dcf78
--- /dev/null
@@ -0,0 +1,54 @@
+include include/asm-generic/Kbuild.asm
+
+generic-y += atomic.h
+generic-y += auxvec.h
+generic-y += bitsperlong.h
+generic-y += bug.h
+generic-y += bugs.h
+generic-y += cputime.h
+generic-y += current.h
+generic-y += device.h
+generic-y += div64.h
+generic-y += dma.h
+generic-y += emergency-restart.h
+generic-y += errno.h
+generic-y += fb.h
+generic-y += fcntl.h
+generic-y += futex.h
+generic-y += hw_irq.h
+generic-y += io.h
+generic-y += ioctl.h
+generic-y += ioctls.h
+generic-y += ipcbuf.h
+generic-y += irq_regs.h
+generic-y += kdebug.h
+generic-y += kmap_types.h
+generic-y += local.h
+generic-y += mman.h
+generic-y += mmu_context.h
+generic-y += msgbuf.h
+generic-y += param.h
+generic-y += pci.h
+generic-y += percpu.h
+generic-y += pgalloc.h
+generic-y += poll.h
+generic-y += posix_types.h
+generic-y += resource.h
+generic-y += scatterlist.h
+generic-y += segment.h
+generic-y += sembuf.h
+generic-y += shmbuf.h
+generic-y += shmparam.h
+generic-y += siginfo.h
+generic-y += socket.h
+generic-y += sockios.h
+generic-y += stat.h
+generic-y += statfs.h
+generic-y += termbits.h
+generic-y += termios.h
+generic-y += tlbflush.h
+generic-y += topology.h
+generic-y += types.h
+generic-y += ucontext.h
+generic-y += user.h
+generic-y += vga.h
diff --git a/arch/c6x/include/asm/asm-offsets.h b/arch/c6x/include/asm/asm-offsets.h
new file mode 100644 (file)
index 0000000..d370ee3
--- /dev/null
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
diff --git a/arch/c6x/include/asm/bitops.h b/arch/c6x/include/asm/bitops.h
new file mode 100644 (file)
index 0000000..39ab7e8
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_BITOPS_H
+#define _ASM_C6X_BITOPS_H
+
+#ifdef __KERNEL__
+
+#include <linux/bitops.h>
+
+#include <asm/system.h>
+#include <asm/byteorder.h>
+
+/*
+ * clear_bit() doesn't provide any barrier for the compiler.
+ */
+#define smp_mb__before_clear_bit() barrier()
+#define smp_mb__after_clear_bit()  barrier()
+
+/*
+ * We are lucky, DSP is perfect for bitops: do it in 3 cycles
+ */
+
+/**
+ * __ffs - find first bit in word.
+ * @word: The word to search
+ *
+ * Undefined if no bit exists, so code should check against 0 first.
+ * Note __ffs(0) = undef, __ffs(1) = 0, __ffs(0x80000000) = 31.
+ *
+ */
+static inline unsigned long __ffs(unsigned long x)
+{
+       asm (" bitr  .M1  %0,%0\n"
+            " nop\n"
+            " lmbd  .L1  1,%0,%0\n"
+            : "+a"(x));
+
+       return x;
+}
+
+/*
+ * ffz - find first zero in word.
+ * @word: The word to search
+ *
+ * Undefined if no zero exists, so code should check against ~0UL first.
+ */
+#define ffz(x) __ffs(~(x))
+
+/**
+ * fls - find last (most-significant) bit set
+ * @x: the word to search
+ *
+ * This is defined the same way as ffs.
+ * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
+ */
+static inline int fls(int x)
+{
+       if (!x)
+               return 0;
+
+       asm (" lmbd  .L1  1,%0,%0\n" : "+a"(x));
+
+       return 32 - x;
+}
+
+/**
+ * ffs - find first bit set
+ * @x: the word to search
+ *
+ * This is defined the same way as
+ * the libc and compiler builtin ffs routines, therefore
+ * differs in spirit from the above ffz (man ffs).
+ * Note ffs(0) = 0, ffs(1) = 1, ffs(0x80000000) = 32.
+ */
+static inline int ffs(int x)
+{
+       if (!x)
+               return 0;
+
+       return __ffs(x) + 1;
+}
+
+#include <asm-generic/bitops/__fls.h>
+#include <asm-generic/bitops/fls64.h>
+#include <asm-generic/bitops/find.h>
+
+#include <asm-generic/bitops/sched.h>
+#include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
+
+#include <asm-generic/bitops/atomic.h>
+#include <asm-generic/bitops/non-atomic.h>
+#include <asm-generic/bitops/le.h>
+#include <asm-generic/bitops/ext2-atomic.h>
+
+#endif /* __KERNEL__ */
+#endif /* _ASM_C6X_BITOPS_H */
diff --git a/arch/c6x/include/asm/byteorder.h b/arch/c6x/include/asm/byteorder.h
new file mode 100644 (file)
index 0000000..166038d
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _ASM_C6X_BYTEORDER_H
+#define _ASM_C6X_BYTEORDER_H
+
+#include <asm/types.h>
+
+#ifdef _BIG_ENDIAN
+#include <linux/byteorder/big_endian.h>
+#else /* _BIG_ENDIAN */
+#include <linux/byteorder/little_endian.h>
+#endif /* _BIG_ENDIAN */
+
+#endif /* _ASM_BYTEORDER_H */
diff --git a/arch/c6x/include/asm/cache.h b/arch/c6x/include/asm/cache.h
new file mode 100644 (file)
index 0000000..6d521d9
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2005, 2006, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_CACHE_H
+#define _ASM_C6X_CACHE_H
+
+#include <linux/irqflags.h>
+
+/*
+ * Cache line size
+ */
+#define L1D_CACHE_BYTES   64
+#define L1P_CACHE_BYTES   32
+#define L2_CACHE_BYTES   128
+
+/*
+ * L2 used as cache
+ */
+#define L2MODE_SIZE      L2MODE_256K_CACHE
+
+/*
+ * For practical reasons the L1_CACHE_BYTES defines should not be smaller than
+ * the L2 line size
+ */
+#define L1_CACHE_BYTES        L2_CACHE_BYTES
+
+#define L2_CACHE_ALIGN_LOW(x) \
+       (((x) & ~(L2_CACHE_BYTES - 1)))
+#define L2_CACHE_ALIGN_UP(x) \
+       (((x) + (L2_CACHE_BYTES - 1)) & ~(L2_CACHE_BYTES - 1))
+#define L2_CACHE_ALIGN_CNT(x) \
+       (((x) + (sizeof(int) - 1)) & ~(sizeof(int) - 1))
+
+#define ARCH_DMA_MINALIGN      L1_CACHE_BYTES
+#define ARCH_SLAB_MINALIGN     L1_CACHE_BYTES
+
+/*
+ * This is the granularity of hardware cacheability control.
+ */
+#define CACHEABILITY_ALIGN     0x01000000
+
+/*
+ * Align a physical address to MAR regions
+ */
+#define CACHE_REGION_START(v) \
+       (((u32) (v)) & ~(CACHEABILITY_ALIGN - 1))
+#define CACHE_REGION_END(v) \
+       (((u32) (v) + (CACHEABILITY_ALIGN - 1)) & ~(CACHEABILITY_ALIGN - 1))
+
+extern void __init c6x_cache_init(void);
+
+extern void enable_caching(unsigned long start, unsigned long end);
+extern void disable_caching(unsigned long start, unsigned long end);
+
+extern void L1_cache_off(void);
+extern void L1_cache_on(void);
+
+extern void L1P_cache_global_invalidate(void);
+extern void L1D_cache_global_invalidate(void);
+extern void L1D_cache_global_writeback(void);
+extern void L1D_cache_global_writeback_invalidate(void);
+extern void L2_cache_set_mode(unsigned int mode);
+extern void L2_cache_global_writeback_invalidate(void);
+extern void L2_cache_global_writeback(void);
+
+extern void L1P_cache_block_invalidate(unsigned int start, unsigned int end);
+extern void L1D_cache_block_invalidate(unsigned int start, unsigned int end);
+extern void L1D_cache_block_writeback_invalidate(unsigned int start,
+                                                unsigned int end);
+extern void L1D_cache_block_writeback(unsigned int start, unsigned int end);
+extern void L2_cache_block_invalidate(unsigned int start, unsigned int end);
+extern void L2_cache_block_writeback(unsigned int start, unsigned int end);
+extern void L2_cache_block_writeback_invalidate(unsigned int start,
+                                               unsigned int end);
+extern void L2_cache_block_invalidate_nowait(unsigned int start,
+                                            unsigned int end);
+extern void L2_cache_block_writeback_nowait(unsigned int start,
+                                           unsigned int end);
+
+extern void L2_cache_block_writeback_invalidate_nowait(unsigned int start,
+                                                      unsigned int end);
+
+#endif /* _ASM_C6X_CACHE_H */
diff --git a/arch/c6x/include/asm/cacheflush.h b/arch/c6x/include/asm/cacheflush.h
new file mode 100644 (file)
index 0000000..df5db90
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_CACHEFLUSH_H
+#define _ASM_C6X_CACHEFLUSH_H
+
+#include <linux/spinlock.h>
+
+#include <asm/setup.h>
+#include <asm/cache.h>
+#include <asm/mman.h>
+#include <asm/page.h>
+#include <asm/string.h>
+
+/*
+ * virtually-indexed cache management (our cache is physically indexed)
+ */
+#define flush_cache_all()                      do {} while (0)
+#define flush_cache_mm(mm)                     do {} while (0)
+#define flush_cache_dup_mm(mm)                 do {} while (0)
+#define flush_cache_range(mm, start, end)      do {} while (0)
+#define flush_cache_page(vma, vmaddr, pfn)     do {} while (0)
+#define flush_cache_vmap(start, end)           do {} while (0)
+#define flush_cache_vunmap(start, end)         do {} while (0)
+#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
+#define flush_dcache_page(page)                        do {} while (0)
+#define flush_dcache_mmap_lock(mapping)                do {} while (0)
+#define flush_dcache_mmap_unlock(mapping)      do {} while (0)
+
+/*
+ * physically-indexed cache management
+ */
+#define flush_icache_range(s, e)                                 \
+do {                                                             \
+               L1D_cache_block_writeback((s), (e));              \
+               L1P_cache_block_invalidate((s), (e));             \
+} while (0)
+
+#define flush_icache_page(vma, page)                                     \
+do {                                                             \
+       if ((vma)->vm_flags & PROT_EXEC)                                  \
+               L1D_cache_block_writeback_invalidate(page_address(page),  \
+                       (unsigned long) page_address(page) + PAGE_SIZE)); \
+               L1P_cache_block_invalidate(page_address(page),            \
+                       (unsigned long) page_address(page) + PAGE_SIZE)); \
+} while (0)
+
+
+#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
+do {                                                \
+       memcpy(dst, src, len);                       \
+       flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
+} while (0)
+
+#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
+       memcpy(dst, src, len)
+
+#endif /* _ASM_C6X_CACHEFLUSH_H */
diff --git a/arch/c6x/include/asm/checksum.h b/arch/c6x/include/asm/checksum.h
new file mode 100644 (file)
index 0000000..7246816
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_CHECKSUM_H
+#define _ASM_C6X_CHECKSUM_H
+
+static inline __wsum
+csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
+                  unsigned short proto, __wsum sum)
+{
+       unsigned long long tmp;
+
+       asm ("add     .d1   %1,%5,%1\n"
+            "|| addu .l1   %3,%4,%0\n"
+            "addu    .l1   %2,%0,%0\n"
+#ifndef CONFIG_CPU_BIG_ENDIAN
+            "|| shl  .s1   %1,8,%1\n"
+#endif
+            "addu    .l1   %1,%0,%0\n"
+            "add     .l1   %P0,%p0,%2\n"
+            : "=&a"(tmp), "+a"(len), "+a"(sum)
+            : "a" (saddr), "a" (daddr), "a" (proto));
+       return sum;
+}
+#define csum_tcpudp_nofold csum_tcpudp_nofold
+
+#include <asm-generic/checksum.h>
+
+#endif /* _ASM_C6X_CHECKSUM_H */
diff --git a/arch/c6x/include/asm/clkdev.h b/arch/c6x/include/asm/clkdev.h
new file mode 100644 (file)
index 0000000..76a070b
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _ASM_CLKDEV_H
+#define _ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+struct clk;
+
+static inline int __clk_get(struct clk *clk)
+{
+       return 1;
+}
+
+static inline void __clk_put(struct clk *clk)
+{
+}
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+       return kzalloc(size, GFP_KERNEL);
+}
+
+#endif /* _ASM_CLKDEV_H */
diff --git a/arch/c6x/include/asm/clock.h b/arch/c6x/include/asm/clock.h
new file mode 100644 (file)
index 0000000..bcf42b2
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * TI C64X clock definitions
+ *
+ * Copyright (C) 2010, 2011 Texas Instruments.
+ * Contributed by: Mark Salter <msalter@redhat.com>
+ *
+ * Copied heavily from arm/mach-davinci/clock.h, so:
+ *
+ * Copyright (C) 2006-2007 Texas Instruments.
+ * Copyright (C) 2008-2009 Deep Root Systems, LLC
+ *
+ * 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_C6X_CLOCK_H
+#define _ASM_C6X_CLOCK_H
+
+#ifndef __ASSEMBLER__
+
+#include <linux/list.h>
+
+/* PLL/Reset register offsets */
+#define PLLCTL         0x100
+#define PLLM           0x110
+#define PLLPRE         0x114
+#define PLLDIV1                0x118
+#define PLLDIV2                0x11c
+#define PLLDIV3                0x120
+#define PLLPOST                0x128
+#define PLLCMD         0x138
+#define PLLSTAT                0x13c
+#define PLLALNCTL      0x140
+#define PLLDCHANGE     0x144
+#define PLLCKEN                0x148
+#define PLLCKSTAT      0x14c
+#define PLLSYSTAT      0x150
+#define PLLDIV4                0x160
+#define PLLDIV5                0x164
+#define PLLDIV6                0x168
+#define PLLDIV7                0x16c
+#define PLLDIV8                0x170
+#define PLLDIV9                0x174
+#define PLLDIV10       0x178
+#define PLLDIV11       0x17c
+#define PLLDIV12       0x180
+#define PLLDIV13       0x184
+#define PLLDIV14       0x188
+#define PLLDIV15       0x18c
+#define PLLDIV16       0x190
+
+/* PLLM register bits */
+#define PLLM_PLLM_MASK 0xff
+#define PLLM_VAL(x)    ((x) - 1)
+
+/* PREDIV register bits */
+#define PLLPREDIV_EN   BIT(15)
+#define PLLPREDIV_VAL(x) ((x) - 1)
+
+/* PLLCTL register bits */
+#define PLLCTL_PLLEN   BIT(0)
+#define PLLCTL_PLLPWRDN        BIT(1)
+#define PLLCTL_PLLRST  BIT(3)
+#define PLLCTL_PLLDIS  BIT(4)
+#define PLLCTL_PLLENSRC        BIT(5)
+#define PLLCTL_CLKMODE BIT(8)
+
+/* PLLCMD register bits */
+#define PLLCMD_GOSTAT  BIT(0)
+
+/* PLLSTAT register bits */
+#define PLLSTAT_GOSTAT BIT(0)
+
+/* PLLDIV register bits */
+#define PLLDIV_EN      BIT(15)
+#define PLLDIV_RATIO_MASK 0x1f
+#define PLLDIV_RATIO(x) ((x) - 1)
+
+struct pll_data;
+
+struct clk {
+       struct list_head        node;
+       struct module           *owner;
+       const char              *name;
+       unsigned long           rate;
+       int                     usecount;
+       u32                     flags;
+       struct clk              *parent;
+       struct list_head        children;       /* list of children */
+       struct list_head        childnode;      /* parent's child list node */
+       struct pll_data         *pll_data;
+       u32                     div;
+       unsigned long (*recalc) (struct clk *);
+       int (*set_rate) (struct clk *clk, unsigned long rate);
+       int (*round_rate) (struct clk *clk, unsigned long rate);
+};
+
+/* Clock flags: SoC-specific flags start at BIT(16) */
+#define ALWAYS_ENABLED         BIT(1)
+#define CLK_PLL                        BIT(2) /* PLL-derived clock */
+#define PRE_PLL                        BIT(3) /* source is before PLL mult/div */
+#define FIXED_DIV_PLL          BIT(4) /* fixed divisor from PLL */
+#define FIXED_RATE_PLL         BIT(5) /* fixed ouput rate PLL */
+
+#define MAX_PLL_SYSCLKS 16
+
+struct pll_data {
+       void __iomem *base;
+       u32 num;
+       u32 flags;
+       u32 input_rate;
+       u32 bypass_delay; /* in loops */
+       u32 reset_delay;  /* in loops */
+       u32 lock_delay;   /* in loops */
+       struct clk sysclks[MAX_PLL_SYSCLKS + 1];
+};
+
+/* pll_data flag bit */
+#define PLL_HAS_PRE    BIT(0)
+#define PLL_HAS_MUL    BIT(1)
+#define PLL_HAS_POST   BIT(2)
+
+#define CLK(dev, con, ck)      \
+       {                       \
+               .dev_id = dev,  \
+               .con_id = con,  \
+               .clk = ck,      \
+       }                       \
+
+extern void c6x_clks_init(struct clk_lookup *clocks);
+extern int clk_register(struct clk *clk);
+extern void clk_unregister(struct clk *clk);
+extern void c64x_setup_clocks(void);
+
+extern struct pll_data c6x_soc_pll1;
+
+extern struct clk clkin1;
+extern struct clk c6x_core_clk;
+extern struct clk c6x_i2c_clk;
+extern struct clk c6x_watchdog_clk;
+extern struct clk c6x_mcbsp1_clk;
+extern struct clk c6x_mcbsp2_clk;
+extern struct clk c6x_mdio_clk;
+
+#endif
+
+#endif /* _ASM_C6X_CLOCK_H */
diff --git a/arch/c6x/include/asm/delay.h b/arch/c6x/include/asm/delay.h
new file mode 100644 (file)
index 0000000..f314c2e
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_DELAY_H
+#define _ASM_C6X_DELAY_H
+
+#include <linux/kernel.h>
+
+extern unsigned int ticks_per_ns_scaled;
+
+static inline void __delay(unsigned long loops)
+{
+       uint32_t tmp;
+
+       /* 6 cycles per loop */
+       asm volatile ("        mv    .s1  %0,%1\n"
+                     "0: [%1] b     .s1  0b\n"
+                     "        add   .l1  -6,%0,%0\n"
+                     "        cmplt .l1  1,%0,%1\n"
+                     "        nop   3\n"
+                     : "+a"(loops), "=A"(tmp));
+}
+
+static inline void _c6x_tickdelay(unsigned int x)
+{
+       uint32_t cnt, endcnt;
+
+       asm volatile ("        mvc   .s2   TSCL,%0\n"
+                     "        add   .s2x  %0,%1,%2\n"
+                     " ||     mvk   .l2   1,B0\n"
+                     "0: [B0] b     .s2   0b\n"
+                     "        mvc   .s2   TSCL,%0\n"
+                     "        sub   .s2   %0,%2,%0\n"
+                     "        cmpgt .l2   0,%0,B0\n"
+                     "        nop   2\n"
+                     : "=b"(cnt), "+a"(x), "=b"(endcnt) : : "B0");
+}
+
+/* use scaled math to avoid slow division */
+#define C6X_NDELAY_SCALE 10
+
+static inline void _ndelay(unsigned int n)
+{
+       _c6x_tickdelay((ticks_per_ns_scaled * n) >> C6X_NDELAY_SCALE);
+}
+
+static inline void _udelay(unsigned int n)
+{
+       while (n >= 10) {
+               _ndelay(10000);
+               n -= 10;
+       }
+       while (n-- > 0)
+               _ndelay(1000);
+}
+
+#define udelay(x) _udelay((unsigned int)(x))
+#define ndelay(x) _ndelay((unsigned int)(x))
+
+#endif /* _ASM_C6X_DELAY_H */
diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h
new file mode 100644 (file)
index 0000000..03579fd
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot <aurelien.jacquiot@ti.com>
+ *
+ *  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_C6X_DMA_MAPPING_H
+#define _ASM_C6X_DMA_MAPPING_H
+
+#include <linux/dma-debug.h>
+#include <asm-generic/dma-coherent.h>
+
+#define dma_supported(d, m)    1
+
+static inline int dma_set_mask(struct device *dev, u64 dma_mask)
+{
+       if (!dev->dma_mask || !dma_supported(dev, dma_mask))
+               return -EIO;
+
+       *dev->dma_mask = dma_mask;
+
+       return 0;
+}
+
+/*
+ * DMA errors are defined by all-bits-set in the DMA address.
+ */
+static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
+{
+       return dma_addr == ~0;
+}
+
+extern dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
+                                size_t size, enum dma_data_direction dir);
+
+extern void dma_unmap_single(struct device *dev, dma_addr_t handle,
+                            size_t size, enum dma_data_direction dir);
+
+extern int dma_map_sg(struct device *dev, struct scatterlist *sglist,
+                     int nents, enum dma_data_direction direction);
+
+extern void dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
+                        int nents, enum dma_data_direction direction);
+
+static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
+                                     unsigned long offset, size_t size,
+                                     enum dma_data_direction dir)
+{
+       dma_addr_t handle;
+
+       handle = dma_map_single(dev, page_address(page) + offset, size, dir);
+
+       debug_dma_map_page(dev, page, offset, size, dir, handle, false);
+
+       return handle;
+}
+
+static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
+               size_t size, enum dma_data_direction dir)
+{
+       dma_unmap_single(dev, handle, size, dir);
+
+       debug_dma_unmap_page(dev, handle, size, dir, false);
+}
+
+extern void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
+                                   size_t size, enum dma_data_direction dir);
+
+extern void dma_sync_single_for_device(struct device *dev, dma_addr_t handle,
+                                      size_t size,
+                                      enum dma_data_direction dir);
+
+extern void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
+                               int nents, enum dma_data_direction dir);
+
+extern void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
+                                  int nents, enum dma_data_direction dir);
+
+extern void coherent_mem_init(u32 start, u32 size);
+extern void *dma_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t);
+extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t);
+
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f))
+#define dma_free_noncoherent(d, s, v, h)  dma_free_coherent((d), (s), (v), (h))
+
+#endif /* _ASM_C6X_DMA_MAPPING_H */
diff --git a/arch/c6x/include/asm/dscr.h b/arch/c6x/include/asm/dscr.h
new file mode 100644 (file)
index 0000000..561ba83
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_DSCR_H
+#define _ASM_C6X_DSCR_H
+
+enum dscr_devstate_t {
+       DSCR_DEVSTATE_ENABLED,
+       DSCR_DEVSTATE_DISABLED,
+};
+
+/*
+ * Set the device state of the device with the given ID.
+ *
+ * Individual drivers should use this to enable or disable the
+ * hardware device. The devid used to identify the device being
+ * controlled should be a property in the device's tree node.
+ */
+extern void dscr_set_devstate(int devid, enum dscr_devstate_t state);
+
+/*
+ * Assert or de-assert an RMII reset.
+ */
+extern void dscr_rmii_reset(int id, int assert);
+
+extern void dscr_probe(void);
+
+#endif /* _ASM_C6X_DSCR_H */
diff --git a/arch/c6x/include/asm/elf.h b/arch/c6x/include/asm/elf.h
new file mode 100644 (file)
index 0000000..d57865b
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_ELF_H
+#define _ASM_C6X_ELF_H
+
+/*
+ * ELF register definitions..
+ */
+#include <asm/ptrace.h>
+
+typedef unsigned long elf_greg_t;
+typedef unsigned long elf_fpreg_t;
+
+#define ELF_NGREG  58
+#define ELF_NFPREG 1
+
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x) ((x)->e_machine == EM_TI_C6000)
+
+#define elf_check_const_displacement(x) (1)
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#ifdef __LITTLE_ENDIAN__
+#define ELF_DATA       ELFDATA2LSB
+#else
+#define ELF_DATA       ELFDATA2MSB
+#endif
+
+#define ELF_CLASS      ELFCLASS32
+#define ELF_ARCH       EM_TI_C6000
+
+/* Nothing for now. Need to setup DP... */
+#define ELF_PLAT_INIT(_r)
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE      4096
+
+#define ELF_CORE_COPY_REGS(_dest, _regs)               \
+       memcpy((char *) &_dest, (char *) _regs,         \
+       sizeof(struct pt_regs));
+
+/* This yields a mask that user programs can use to figure out what
+   instruction set this cpu supports.  */
+
+#define ELF_HWCAP      (0)
+
+/* This yields a string that ld.so will use to load implementation
+   specific libraries for optimization.  This is more specific in
+   intent than poking at uname or /proc/cpuinfo.  */
+
+#define ELF_PLATFORM  (NULL)
+
+#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
+
+/* C6X specific section types */
+#define SHT_C6000_UNWIND       0x70000001
+#define SHT_C6000_PREEMPTMAP   0x70000002
+#define SHT_C6000_ATTRIBUTES   0x70000003
+
+/* C6X specific DT_ tags */
+#define DT_C6000_DSBT_BASE     0x70000000
+#define DT_C6000_DSBT_SIZE     0x70000001
+#define DT_C6000_PREEMPTMAP    0x70000002
+#define DT_C6000_DSBT_INDEX    0x70000003
+
+/* C6X specific relocs */
+#define R_C6000_NONE           0
+#define R_C6000_ABS32          1
+#define R_C6000_ABS16          2
+#define R_C6000_ABS8           3
+#define R_C6000_PCR_S21                4
+#define R_C6000_PCR_S12                5
+#define R_C6000_PCR_S10                6
+#define R_C6000_PCR_S7         7
+#define R_C6000_ABS_S16                8
+#define R_C6000_ABS_L16                9
+#define R_C6000_ABS_H16                10
+#define R_C6000_SBR_U15_B      11
+#define R_C6000_SBR_U15_H      12
+#define R_C6000_SBR_U15_W      13
+#define R_C6000_SBR_S16                14
+#define R_C6000_SBR_L16_B      15
+#define R_C6000_SBR_L16_H      16
+#define R_C6000_SBR_L16_W      17
+#define R_C6000_SBR_H16_B      18
+#define R_C6000_SBR_H16_H      19
+#define R_C6000_SBR_H16_W      20
+#define R_C6000_SBR_GOT_U15_W  21
+#define R_C6000_SBR_GOT_L16_W  22
+#define R_C6000_SBR_GOT_H16_W  23
+#define R_C6000_DSBT_INDEX     24
+#define R_C6000_PREL31         25
+#define R_C6000_COPY           26
+#define R_C6000_ALIGN          253
+#define R_C6000_FPHEAD         254
+#define R_C6000_NOCMP          255
+
+#endif /*_ASM_C6X_ELF_H */
diff --git a/arch/c6x/include/asm/ftrace.h b/arch/c6x/include/asm/ftrace.h
new file mode 100644 (file)
index 0000000..3701958
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_FTRACE_H
+#define _ASM_C6X_FTRACE_H
+
+/* empty */
+
+#endif /* _ASM_C6X_FTRACE_H */
diff --git a/arch/c6x/include/asm/hardirq.h b/arch/c6x/include/asm/hardirq.h
new file mode 100644 (file)
index 0000000..9621954
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_HARDIRQ_H
+#define _ASM_C6X_HARDIRQ_H
+
+extern void ack_bad_irq(int irq);
+#define ack_bad_irq ack_bad_irq
+
+#include <asm-generic/hardirq.h>
+
+#endif /* _ASM_C6X_HARDIRQ_H */
diff --git a/arch/c6x/include/asm/irq.h b/arch/c6x/include/asm/irq.h
new file mode 100644 (file)
index 0000000..a6ae3c9
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Large parts taken directly from powerpc.
+ *
+ *  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_C6X_IRQ_H
+#define _ASM_C6X_IRQ_H
+
+#include <linux/threads.h>
+#include <linux/list.h>
+#include <linux/radix-tree.h>
+#include <asm/percpu.h>
+
+#define irq_canonicalize(irq)  (irq)
+
+/*
+ * The C64X+ core has 16 IRQ vectors. One each is used by Reset and NMI. Two
+ * are reserved. The remaining 12 vectors are used to route SoC interrupts.
+ * These interrupt vectors are prioritized with IRQ 4 having the highest
+ * priority and IRQ 15 having the lowest.
+ *
+ * The C64x+ megamodule provides a PIC which combines SoC IRQ sources into a
+ * single core IRQ vector. There are four combined sources, each of which
+ * feed into one of the 12 general interrupt vectors. The remaining 8 vectors
+ * can each route a single SoC interrupt directly.
+ */
+#define NR_PRIORITY_IRQS 16
+
+#define NR_IRQS_LEGACY NR_PRIORITY_IRQS
+
+/* Total number of virq in the platform */
+#define NR_IRQS                256
+
+/* This number is used when no interrupt has been assigned */
+#define NO_IRQ         0
+
+/* This type is the placeholder for a hardware interrupt number. It has to
+ * be big enough to enclose whatever representation is used by a given
+ * platform.
+ */
+typedef unsigned long irq_hw_number_t;
+
+/* Interrupt controller "host" data structure. This could be defined as a
+ * irq domain controller. That is, it handles the mapping between hardware
+ * and virtual interrupt numbers for a given interrupt domain. The host
+ * structure is generally created by the PIC code for a given PIC instance
+ * (though a host can cover more than one PIC if they have a flat number
+ * model). It's the host callbacks that are responsible for setting the
+ * irq_chip on a given irq_desc after it's been mapped.
+ *
+ * The host code and data structures are fairly agnostic to the fact that
+ * we use an open firmware device-tree. We do have references to struct
+ * device_node in two places: in irq_find_host() to find the host matching
+ * a given interrupt controller node, and of course as an argument to its
+ * counterpart host->ops->match() callback. However, those are treated as
+ * generic pointers by the core and the fact that it's actually a device-node
+ * pointer is purely a convention between callers and implementation. This
+ * code could thus be used on other architectures by replacing those two
+ * by some sort of arch-specific void * "token" used to identify interrupt
+ * controllers.
+ */
+struct irq_host;
+struct radix_tree_root;
+struct device_node;
+
+/* Functions below are provided by the host and called whenever a new mapping
+ * is created or an old mapping is disposed. The host can then proceed to
+ * whatever internal data structures management is required. It also needs
+ * to setup the irq_desc when returning from map().
+ */
+struct irq_host_ops {
+       /* Match an interrupt controller device node to a host, returns
+        * 1 on a match
+        */
+       int (*match)(struct irq_host *h, struct device_node *node);
+
+       /* Create or update a mapping between a virtual irq number and a hw
+        * irq number. This is called only once for a given mapping.
+        */
+       int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
+
+       /* Dispose of such a mapping */
+       void (*unmap)(struct irq_host *h, unsigned int virq);
+
+       /* Translate device-tree interrupt specifier from raw format coming
+        * from the firmware to a irq_hw_number_t (interrupt line number) and
+        * type (sense) that can be passed to set_irq_type(). In the absence
+        * of this callback, irq_create_of_mapping() and irq_of_parse_and_map()
+        * will return the hw number in the first cell and IRQ_TYPE_NONE for
+        * the type (which amount to keeping whatever default value the
+        * interrupt controller has for that line)
+        */
+       int (*xlate)(struct irq_host *h, struct device_node *ctrler,
+                    const u32 *intspec, unsigned int intsize,
+                    irq_hw_number_t *out_hwirq, unsigned int *out_type);
+};
+
+struct irq_host {
+       struct list_head        link;
+
+       /* type of reverse mapping technique */
+       unsigned int            revmap_type;
+#define IRQ_HOST_MAP_PRIORITY   0 /* core priority irqs, get irqs 1..15 */
+#define IRQ_HOST_MAP_NOMAP     1 /* no fast reverse mapping */
+#define IRQ_HOST_MAP_LINEAR    2 /* linear map of interrupts */
+#define IRQ_HOST_MAP_TREE      3 /* radix tree */
+       union {
+               struct {
+                       unsigned int size;
+                       unsigned int *revmap;
+               } linear;
+               struct radix_tree_root tree;
+       } revmap_data;
+       struct irq_host_ops     *ops;
+       void                    *host_data;
+       irq_hw_number_t         inval_irq;
+
+       /* Optional device node pointer */
+       struct device_node      *of_node;
+};
+
+struct irq_data;
+extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d);
+extern irq_hw_number_t virq_to_hw(unsigned int virq);
+extern bool virq_is_host(unsigned int virq, struct irq_host *host);
+
+/**
+ * irq_alloc_host - Allocate a new irq_host data structure
+ * @of_node: optional device-tree node of the interrupt controller
+ * @revmap_type: type of reverse mapping to use
+ * @revmap_arg: for IRQ_HOST_MAP_LINEAR linear only: size of the map
+ * @ops: map/unmap host callbacks
+ * @inval_irq: provide a hw number in that host space that is always invalid
+ *
+ * Allocates and initialize and irq_host structure. Note that in the case of
+ * IRQ_HOST_MAP_LEGACY, the map() callback will be called before this returns
+ * for all legacy interrupts except 0 (which is always the invalid irq for
+ * a legacy controller). For a IRQ_HOST_MAP_LINEAR, the map is allocated by
+ * this call as well. For a IRQ_HOST_MAP_TREE, the radix tree will be allocated
+ * later during boot automatically (the reverse mapping will use the slow path
+ * until that happens).
+ */
+extern struct irq_host *irq_alloc_host(struct device_node *of_node,
+                                      unsigned int revmap_type,
+                                      unsigned int revmap_arg,
+                                      struct irq_host_ops *ops,
+                                      irq_hw_number_t inval_irq);
+
+
+/**
+ * irq_find_host - Locates a host for a given device node
+ * @node: device-tree node of the interrupt controller
+ */
+extern struct irq_host *irq_find_host(struct device_node *node);
+
+
+/**
+ * irq_set_default_host - Set a "default" host
+ * @host: default host pointer
+ *
+ * For convenience, it's possible to set a "default" host that will be used
+ * whenever NULL is passed to irq_create_mapping(). It makes life easier for
+ * platforms that want to manipulate a few hard coded interrupt numbers that
+ * aren't properly represented in the device-tree.
+ */
+extern void irq_set_default_host(struct irq_host *host);
+
+
+/**
+ * irq_set_virq_count - Set the maximum number of virt irqs
+ * @count: number of linux virtual irqs, capped with NR_IRQS
+ *
+ * This is mainly for use by platforms like iSeries who want to program
+ * the virtual irq number in the controller to avoid the reverse mapping
+ */
+extern void irq_set_virq_count(unsigned int count);
+
+
+/**
+ * irq_create_mapping - Map a hardware interrupt into linux virq space
+ * @host: host owning this hardware interrupt or NULL for default host
+ * @hwirq: hardware irq number in that host space
+ *
+ * Only one mapping per hardware interrupt is permitted. Returns a linux
+ * virq number.
+ * If the sense/trigger is to be specified, set_irq_type() should be called
+ * on the number returned from that call.
+ */
+extern unsigned int irq_create_mapping(struct irq_host *host,
+                                      irq_hw_number_t hwirq);
+
+
+/**
+ * irq_dispose_mapping - Unmap an interrupt
+ * @virq: linux virq number of the interrupt to unmap
+ */
+extern void irq_dispose_mapping(unsigned int virq);
+
+/**
+ * irq_find_mapping - Find a linux virq from an hw irq number.
+ * @host: host owning this hardware interrupt
+ * @hwirq: hardware irq number in that host space
+ *
+ * This is a slow path, for use by generic code. It's expected that an
+ * irq controller implementation directly calls the appropriate low level
+ * mapping function.
+ */
+extern unsigned int irq_find_mapping(struct irq_host *host,
+                                    irq_hw_number_t hwirq);
+
+/**
+ * irq_create_direct_mapping - Allocate a virq for direct mapping
+ * @host: host to allocate the virq for or NULL for default host
+ *
+ * This routine is used for irq controllers which can choose the hardware
+ * interrupt numbers they generate. In such a case it's simplest to use
+ * the linux virq as the hardware interrupt number.
+ */
+extern unsigned int irq_create_direct_mapping(struct irq_host *host);
+
+/**
+ * irq_radix_revmap_insert - Insert a hw irq to linux virq number mapping.
+ * @host: host owning this hardware interrupt
+ * @virq: linux irq number
+ * @hwirq: hardware irq number in that host space
+ *
+ * This is for use by irq controllers that use a radix tree reverse
+ * mapping for fast lookup.
+ */
+extern void irq_radix_revmap_insert(struct irq_host *host, unsigned int virq,
+                                   irq_hw_number_t hwirq);
+
+/**
+ * irq_radix_revmap_lookup - Find a linux virq from a hw irq number.
+ * @host: host owning this hardware interrupt
+ * @hwirq: hardware irq number in that host space
+ *
+ * This is a fast path, for use by irq controller code that uses radix tree
+ * revmaps
+ */
+extern unsigned int irq_radix_revmap_lookup(struct irq_host *host,
+                                           irq_hw_number_t hwirq);
+
+/**
+ * irq_linear_revmap - Find a linux virq from a hw irq number.
+ * @host: host owning this hardware interrupt
+ * @hwirq: hardware irq number in that host space
+ *
+ * This is a fast path, for use by irq controller code that uses linear
+ * revmaps. It does fallback to the slow path if the revmap doesn't exist
+ * yet and will create the revmap entry with appropriate locking
+ */
+
+extern unsigned int irq_linear_revmap(struct irq_host *host,
+                                     irq_hw_number_t hwirq);
+
+
+
+/**
+ * irq_alloc_virt - Allocate virtual irq numbers
+ * @host: host owning these new virtual irqs
+ * @count: number of consecutive numbers to allocate
+ * @hint: pass a hint number, the allocator will try to use a 1:1 mapping
+ *
+ * This is a low level function that is used internally by irq_create_mapping()
+ * and that can be used by some irq controllers implementations for things
+ * like allocating ranges of numbers for MSIs. The revmaps are left untouched.
+ */
+extern unsigned int irq_alloc_virt(struct irq_host *host,
+                                  unsigned int count,
+                                  unsigned int hint);
+
+/**
+ * irq_free_virt - Free virtual irq numbers
+ * @virq: virtual irq number of the first interrupt to free
+ * @count: number of interrupts to free
+ *
+ * This function is the opposite of irq_alloc_virt. It will not clear reverse
+ * maps, this should be done previously by unmap'ing the interrupt. In fact,
+ * all interrupts covered by the range being freed should have been unmapped
+ * prior to calling this.
+ */
+extern void irq_free_virt(unsigned int virq, unsigned int count);
+
+extern void __init init_pic_c64xplus(void);
+
+extern void init_IRQ(void);
+
+struct pt_regs;
+
+extern asmlinkage void c6x_do_IRQ(unsigned int prio, struct pt_regs *regs);
+
+extern unsigned long irq_err_count;
+
+#endif /* _ASM_C6X_IRQ_H */
diff --git a/arch/c6x/include/asm/irqflags.h b/arch/c6x/include/asm/irqflags.h
new file mode 100644 (file)
index 0000000..cf78e09
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ *  C6X IRQ flag handling
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated
+ * Written by Mark Salter (msalter@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+
+#ifndef __ASSEMBLY__
+
+/* read interrupt enabled status */
+static inline unsigned long arch_local_save_flags(void)
+{
+       unsigned long flags;
+
+       asm volatile (" mvc .s2 CSR,%0\n" : "=b"(flags));
+       return flags;
+}
+
+/* set interrupt enabled status */
+static inline void arch_local_irq_restore(unsigned long flags)
+{
+       asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags));
+}
+
+/* unconditionally enable interrupts */
+static inline void arch_local_irq_enable(void)
+{
+       unsigned long flags = arch_local_save_flags();
+       flags |= 1;
+       arch_local_irq_restore(flags);
+}
+
+/* unconditionally disable interrupts */
+static inline void arch_local_irq_disable(void)
+{
+       unsigned long flags = arch_local_save_flags();
+       flags &= ~1;
+       arch_local_irq_restore(flags);
+}
+
+/* get status and disable interrupts */
+static inline unsigned long arch_local_irq_save(void)
+{
+       unsigned long flags;
+
+       flags = arch_local_save_flags();
+       arch_local_irq_restore(flags & ~1);
+       return flags;
+}
+
+/* test flags */
+static inline int arch_irqs_disabled_flags(unsigned long flags)
+{
+       return (flags & 1) == 0;
+}
+
+/* test hardware interrupt enable bit */
+static inline int arch_irqs_disabled(void)
+{
+       return arch_irqs_disabled_flags(arch_local_save_flags());
+}
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_IRQFLAGS_H */
diff --git a/arch/c6x/include/asm/linkage.h b/arch/c6x/include/asm/linkage.h
new file mode 100644 (file)
index 0000000..376925c
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _ASM_C6X_LINKAGE_H
+#define _ASM_C6X_LINKAGE_H
+
+#ifdef __ASSEMBLER__
+
+#define __ALIGN                .align 2
+#define __ALIGN_STR    ".align 2"
+
+#ifndef __DSBT__
+#define ENTRY(name)            \
+       .global name @          \
+       __ALIGN @               \
+name:
+#else
+#define ENTRY(name)            \
+       .global name @          \
+       .hidden name @          \
+       __ALIGN @               \
+name:
+#endif
+
+#define ENDPROC(name)          \
+       .type name, @function @ \
+       .size name, . - name
+
+#endif
+
+#include <asm-generic/linkage.h>
+
+#endif /* _ASM_C6X_LINKAGE_H */
diff --git a/arch/c6x/include/asm/megamod-pic.h b/arch/c6x/include/asm/megamod-pic.h
new file mode 100644 (file)
index 0000000..eca0a86
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _C6X_MEGAMOD_PIC_H
+#define _C6X_MEGAMOD_PIC_H
+
+#ifdef __KERNEL__
+
+extern void __init megamod_pic_init(void);
+
+#endif /* __KERNEL__ */
+#endif /* _C6X_MEGAMOD_PIC_H */
diff --git a/arch/c6x/include/asm/memblock.h b/arch/c6x/include/asm/memblock.h
new file mode 100644 (file)
index 0000000..1181a97
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef _ASM_C6X_MEMBLOCK_H
+#define _ASM_C6X_MEMBLOCK_H
+
+#endif /* _ASM_C6X_MEMBLOCK_H */
diff --git a/arch/c6x/include/asm/mmu.h b/arch/c6x/include/asm/mmu.h
new file mode 100644 (file)
index 0000000..41592bf
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_MMU_H
+#define _ASM_C6X_MMU_H
+
+typedef struct {
+       unsigned long           end_brk;
+} mm_context_t;
+
+#endif /* _ASM_C6X_MMU_H */
diff --git a/arch/c6x/include/asm/module.h b/arch/c6x/include/asm/module.h
new file mode 100644 (file)
index 0000000..a453f97
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Updated for 2.6.34 by: Mark Salter (msalter@redhat.com)
+ *
+ *  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_C6X_MODULE_H
+#define _ASM_C6X_MODULE_H
+
+#define Elf_Shdr       Elf32_Shdr
+#define Elf_Sym                Elf32_Sym
+#define Elf_Ehdr       Elf32_Ehdr
+#define Elf_Addr       Elf32_Addr
+#define Elf_Word       Elf32_Word
+
+/*
+ * This file contains the C6x architecture specific module code.
+ */
+struct mod_arch_specific {
+};
+
+struct loaded_sections {
+       unsigned int new_vaddr;
+       unsigned int loaded;
+};
+
+#endif /* _ASM_C6X_MODULE_H */
diff --git a/arch/c6x/include/asm/mutex.h b/arch/c6x/include/asm/mutex.h
new file mode 100644 (file)
index 0000000..7a7248e
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_C6X_MUTEX_H
+#define _ASM_C6X_MUTEX_H
+
+#include <asm-generic/mutex-null.h>
+
+#endif /* _ASM_C6X_MUTEX_H */
diff --git a/arch/c6x/include/asm/page.h b/arch/c6x/include/asm/page.h
new file mode 100644 (file)
index 0000000..d18e2b0
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _ASM_C6X_PAGE_H
+#define _ASM_C6X_PAGE_H
+
+#define VM_DATA_DEFAULT_FLAGS \
+       (VM_READ | VM_WRITE | \
+       ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
+                VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+
+#include <asm-generic/page.h>
+
+#endif /* _ASM_C6X_PAGE_H */
diff --git a/arch/c6x/include/asm/pgtable.h b/arch/c6x/include/asm/pgtable.h
new file mode 100644 (file)
index 0000000..68c8af4
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_PGTABLE_H
+#define _ASM_C6X_PGTABLE_H
+
+#include <asm-generic/4level-fixup.h>
+
+#include <asm/setup.h>
+#include <asm/page.h>
+
+/*
+ * All 32bit addresses are effectively valid for vmalloc...
+ * Sort of meaningless for non-VM targets.
+ */
+#define        VMALLOC_START   0
+#define        VMALLOC_END     0xffffffff
+
+#define pgd_present(pgd)       (1)
+#define pgd_none(pgd)          (0)
+#define pgd_bad(pgd)           (0)
+#define pgd_clear(pgdp)
+#define kern_addr_valid(addr) (1)
+
+#define pmd_offset(a, b)       ((void *)0)
+#define pmd_none(x)            (!pmd_val(x))
+#define pmd_present(x)         (pmd_val(x))
+#define pmd_clear(xp)          do { set_pmd(xp, __pmd(0)); } while (0)
+#define pmd_bad(x)             (pmd_val(x) & ~PAGE_MASK)
+
+#define PAGE_NONE              __pgprot(0)    /* these mean nothing to NO_MM */
+#define PAGE_SHARED            __pgprot(0)    /* these mean nothing to NO_MM */
+#define PAGE_COPY              __pgprot(0)    /* these mean nothing to NO_MM */
+#define PAGE_READONLY          __pgprot(0)    /* these mean nothing to NO_MM */
+#define PAGE_KERNEL            __pgprot(0)    /* these mean nothing to NO_MM */
+#define pgprot_noncached(prot) (prot)
+
+extern void paging_init(void);
+
+#define __swp_type(x)          (0)
+#define __swp_offset(x)                (0)
+#define __swp_entry(typ, off)  ((swp_entry_t) { ((typ) | ((off) << 7)) })
+#define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
+#define __swp_entry_to_pte(x)  ((pte_t) { (x).val })
+
+static inline int pte_file(pte_t pte)
+{
+       return 0;
+}
+
+#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
+#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
+
+/*
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+#define ZERO_PAGE(vaddr)       virt_to_page(empty_zero_page)
+extern unsigned long empty_zero_page;
+
+#define swapper_pg_dir ((pgd_t *) 0)
+
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init()   do { } while (0)
+#define io_remap_pfn_range      remap_pfn_range
+
+#define io_remap_page_range(vma, vaddr, paddr, size, prot)             \
+               remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot)
+
+#include <asm-generic/pgtable.h>
+
+#endif /* _ASM_C6X_PGTABLE_H */
diff --git a/arch/c6x/include/asm/processor.h b/arch/c6x/include/asm/processor.h
new file mode 100644 (file)
index 0000000..8154c4e
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Updated for 2.6.34: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_PROCESSOR_H
+#define _ASM_C6X_PROCESSOR_H
+
+#include <asm/ptrace.h>
+#include <asm/page.h>
+#include <asm/current.h>
+
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr()                    \
+({                                             \
+       void *__pc;                             \
+       asm("mvc .S2 pce1,%0\n" : "=b"(__pc));  \
+       __pc;                                   \
+})
+
+/*
+ * User space process size. This is mostly meaningless for NOMMU
+ * but some C6X processors may have RAM addresses up to 0xFFFFFFFF.
+ * Since calls like mmap() can return an address or an error, we
+ * have to allow room for error returns when code does something
+ * like:
+ *
+ *       addr = do_mmap(...)
+ *       if ((unsigned long)addr >= TASK_SIZE)
+ *            ... its an error code, not an address ...
+ *
+ * Here, we allow for 4096 error codes which means we really can't
+ * use the last 4K page on systems with RAM extending all the way
+ * to the end of the 32-bit address space.
+ */
+#define TASK_SIZE      0xFFFFF000
+
+/*
+ * This decides where the kernel will search for a free chunk of vm
+ * space during mmap's. We won't be using it
+ */
+#define TASK_UNMAPPED_BASE     0
+
+struct thread_struct {
+       unsigned long long b15_14;
+       unsigned long long a15_14;
+       unsigned long long b13_12;
+       unsigned long long a13_12;
+       unsigned long long b11_10;
+       unsigned long long a11_10;
+       unsigned long long ricl_icl;
+       unsigned long  usp;             /* user stack pointer */
+       unsigned long  pc;              /* kernel pc */
+       unsigned long  wchan;
+};
+
+#define INIT_THREAD                                    \
+{                                                      \
+       .usp = 0,                                       \
+       .wchan = 0,                                     \
+}
+
+#define INIT_MMAP { \
+       &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, \
+       NULL, NULL }
+
+#define task_pt_regs(task) \
+       ((struct pt_regs *)(THREAD_START_SP + task_stack_page(task)) - 1)
+
+#define alloc_kernel_stack()   __get_free_page(GFP_KERNEL)
+#define free_kernel_stack(page) free_page((page))
+
+
+/* Forward declaration, a strange C thing */
+struct task_struct;
+
+extern void start_thread(struct pt_regs *regs, unsigned int pc,
+                        unsigned long usp);
+
+/* Free all resources held by a thread. */
+static inline void release_thread(struct task_struct *dead_task)
+{
+}
+
+/* Prepare to copy thread state - unlazy all lazy status */
+#define prepare_to_copy(tsk)   do { } while (0)
+
+extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
+
+#define copy_segments(tsk, mm)         do { } while (0)
+#define release_segments(mm)           do { } while (0)
+
+/*
+ * saved PC of a blocked thread.
+ */
+#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
+
+/*
+ * saved kernel SP and DP of a blocked thread.
+ */
+#ifdef _BIG_ENDIAN
+#define thread_saved_ksp(tsk) \
+       (*(unsigned long *)&(tsk)->thread.b15_14)
+#define thread_saved_dp(tsk) \
+       (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
+#else
+#define thread_saved_ksp(tsk) \
+       (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
+#define thread_saved_dp(tsk) \
+       (*(unsigned long *)&(tsk)->thread.b15_14)
+#endif
+
+extern unsigned long get_wchan(struct task_struct *p);
+
+#define KSTK_EIP(tsk)  (task_pt_regs(task)->pc)
+#define        KSTK_ESP(tsk)   (task_pt_regs(task)->sp)
+
+#define cpu_relax()            do { } while (0)
+
+extern const struct seq_operations cpuinfo_op;
+
+#endif /* ASM_C6X_PROCESSOR_H */
diff --git a/arch/c6x/include/asm/procinfo.h b/arch/c6x/include/asm/procinfo.h
new file mode 100644 (file)
index 0000000..c139d1e
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ *  Copyright (C) 2010 Texas Instruments Incorporated
+ *  Author: Mark Salter (msalter@redhat.com)
+ *
+ *
+ * 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_C6X_PROCINFO_H
+#define _ASM_C6X_PROCINFO_H
+
+#ifdef __KERNEL__
+
+struct proc_info_list {
+       unsigned int            cpu_val;
+       unsigned int            cpu_mask;
+       const char              *arch_name;
+       const char              *elf_name;
+       unsigned int            elf_hwcap;
+};
+
+#else  /* __KERNEL__ */
+#include <asm/elf.h>
+#warning "Please include asm/elf.h instead"
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_C6X_PROCINFO_H */
diff --git a/arch/c6x/include/asm/prom.h b/arch/c6x/include/asm/prom.h
new file mode 100644 (file)
index 0000000..b4ec95f
--- /dev/null
@@ -0,0 +1 @@
+/* dummy prom.h; here to make linux/of.h's #includes happy */
diff --git a/arch/c6x/include/asm/ptrace.h b/arch/c6x/include/asm/ptrace.h
new file mode 100644 (file)
index 0000000..21e8d79
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ *  Copyright (C) 2004, 2006, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Updated for 2.6.34: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_PTRACE_H
+#define _ASM_C6X_PTRACE_H
+
+#define BKPT_OPCODE    0x56454314      /* illegal opcode */
+
+#ifdef _BIG_ENDIAN
+#define PT_LO(odd, even)  odd
+#define PT_HI(odd, even)  even
+#else
+#define PT_LO(odd, even)  even
+#define PT_HI(odd, even)  odd
+#endif
+
+#define PT_A4_ORG  PT_LO(1, 0)
+#define PT_TSR    PT_HI(1, 0)
+#define PT_ILC    PT_LO(3, 2)
+#define PT_RILC    PT_HI(3, 2)
+#define PT_CSR    PT_LO(5, 4)
+#define PT_PC     PT_HI(5, 4)
+#define PT_B16    PT_LO(7, 6)
+#define PT_B17    PT_HI(7, 6)
+#define PT_B18    PT_LO(9, 8)
+#define PT_B19    PT_HI(9, 8)
+#define PT_B20    PT_LO(11, 10)
+#define PT_B21    PT_HI(11, 10)
+#define PT_B22    PT_LO(13, 12)
+#define PT_B23    PT_HI(13, 12)
+#define PT_B24    PT_LO(15, 14)
+#define PT_B25    PT_HI(15, 14)
+#define PT_B26    PT_LO(17, 16)
+#define PT_B27    PT_HI(17, 16)
+#define PT_B28    PT_LO(19, 18)
+#define PT_B29    PT_HI(19, 18)
+#define PT_B30    PT_LO(21, 20)
+#define PT_B31    PT_HI(21, 20)
+#define PT_B0     PT_LO(23, 22)
+#define PT_B1     PT_HI(23, 22)
+#define PT_B2     PT_LO(25, 24)
+#define PT_B3     PT_HI(25, 24)
+#define PT_B4     PT_LO(27, 26)
+#define PT_B5     PT_HI(27, 26)
+#define PT_B6     PT_LO(29, 28)
+#define PT_B7     PT_HI(29, 28)
+#define PT_B8     PT_LO(31, 30)
+#define PT_B9     PT_HI(31, 30)
+#define PT_B10    PT_LO(33, 32)
+#define PT_B11    PT_HI(33, 32)
+#define PT_B12    PT_LO(35, 34)
+#define PT_B13    PT_HI(35, 34)
+#define PT_A16    PT_LO(37, 36)
+#define PT_A17    PT_HI(37, 36)
+#define PT_A18    PT_LO(39, 38)
+#define PT_A19    PT_HI(39, 38)
+#define PT_A20    PT_LO(41, 40)
+#define PT_A21    PT_HI(41, 40)
+#define PT_A22    PT_LO(43, 42)
+#define PT_A23    PT_HI(43, 42)
+#define PT_A24    PT_LO(45, 44)
+#define PT_A25    PT_HI(45, 44)
+#define PT_A26    PT_LO(47, 46)
+#define PT_A27    PT_HI(47, 46)
+#define PT_A28    PT_LO(49, 48)
+#define PT_A29    PT_HI(49, 48)
+#define PT_A30    PT_LO(51, 50)
+#define PT_A31    PT_HI(51, 50)
+#define PT_A0     PT_LO(53, 52)
+#define PT_A1     PT_HI(53, 52)
+#define PT_A2     PT_LO(55, 54)
+#define PT_A3     PT_HI(55, 54)
+#define PT_A4     PT_LO(57, 56)
+#define PT_A5     PT_HI(57, 56)
+#define PT_A6     PT_LO(59, 58)
+#define PT_A7     PT_HI(59, 58)
+#define PT_A8     PT_LO(61, 60)
+#define PT_A9     PT_HI(61, 60)
+#define PT_A10    PT_LO(63, 62)
+#define PT_A11    PT_HI(63, 62)
+#define PT_A12    PT_LO(65, 64)
+#define PT_A13    PT_HI(65, 64)
+#define PT_A14    PT_LO(67, 66)
+#define PT_A15    PT_HI(67, 66)
+#define PT_B14    PT_LO(69, 68)
+#define PT_B15    PT_HI(69, 68)
+
+#define NR_PTREGS  70
+
+#define PT_DP     PT_B14  /* Data Segment Pointer (B14) */
+#define PT_SP     PT_B15  /* Stack Pointer (B15)  */
+
+#ifndef __ASSEMBLY__
+
+#ifdef _BIG_ENDIAN
+#define REG_PAIR(odd, even) unsigned long odd; unsigned long even
+#else
+#define REG_PAIR(odd, even) unsigned long even; unsigned long odd
+#endif
+
+/*
+ * this struct defines the way the registers are stored on the
+ * stack during a system call. fields defined with REG_PAIR
+ * are saved and restored using double-word memory operations
+ * which means the word ordering of the pair depends on endianess.
+ */
+struct pt_regs {
+       REG_PAIR(tsr, orig_a4);
+       REG_PAIR(rilc, ilc);
+       REG_PAIR(pc, csr);
+
+       REG_PAIR(b17, b16);
+       REG_PAIR(b19, b18);
+       REG_PAIR(b21, b20);
+       REG_PAIR(b23, b22);
+       REG_PAIR(b25, b24);
+       REG_PAIR(b27, b26);
+       REG_PAIR(b29, b28);
+       REG_PAIR(b31, b30);
+
+       REG_PAIR(b1, b0);
+       REG_PAIR(b3, b2);
+       REG_PAIR(b5, b4);
+       REG_PAIR(b7, b6);
+       REG_PAIR(b9, b8);
+       REG_PAIR(b11, b10);
+       REG_PAIR(b13, b12);
+
+       REG_PAIR(a17, a16);
+       REG_PAIR(a19, a18);
+       REG_PAIR(a21, a20);
+       REG_PAIR(a23, a22);
+       REG_PAIR(a25, a24);
+       REG_PAIR(a27, a26);
+       REG_PAIR(a29, a28);
+       REG_PAIR(a31, a30);
+
+       REG_PAIR(a1, a0);
+       REG_PAIR(a3, a2);
+       REG_PAIR(a5, a4);
+       REG_PAIR(a7, a6);
+       REG_PAIR(a9, a8);
+       REG_PAIR(a11, a10);
+       REG_PAIR(a13, a12);
+
+       REG_PAIR(a15, a14);
+       REG_PAIR(sp, dp);
+};
+
+#ifdef __KERNEL__
+
+#include <linux/linkage.h>
+
+#define user_mode(regs)        ((((regs)->tsr) & 0x40) != 0)
+
+#define instruction_pointer(regs) ((regs)->pc)
+#define profile_pc(regs) instruction_pointer(regs)
+#define user_stack_pointer(regs) ((regs)->sp)
+
+extern void show_regs(struct pt_regs *);
+
+extern asmlinkage unsigned long syscall_trace_entry(struct pt_regs *regs);
+extern asmlinkage void syscall_trace_exit(struct pt_regs *regs);
+
+#endif /* __KERNEL__ */
+#endif /* __ASSEMBLY__ */
+#endif /* _ASM_C6X_PTRACE_H */
diff --git a/arch/c6x/include/asm/sections.h b/arch/c6x/include/asm/sections.h
new file mode 100644 (file)
index 0000000..f703989
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _ASM_C6X_SECTIONS_H
+#define _ASM_C6X_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+extern char _vectors_start[];
+extern char _vectors_end[];
+
+extern char _data_lma[];
+extern char _fdt_start[], _fdt_end[];
+
+#endif /* _ASM_C6X_SECTIONS_H */
diff --git a/arch/c6x/include/asm/setup.h b/arch/c6x/include/asm/setup.h
new file mode 100644 (file)
index 0000000..1808f27
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_SETUP_H
+#define _ASM_C6X_SETUP_H
+
+#define COMMAND_LINE_SIZE   1024
+
+#ifndef __ASSEMBLY__
+extern char c6x_command_line[COMMAND_LINE_SIZE];
+
+extern int c6x_add_memory(phys_addr_t start, unsigned long size);
+
+extern unsigned long ram_start;
+extern unsigned long ram_end;
+
+extern int c6x_num_cores;
+extern unsigned int c6x_silicon_rev;
+extern unsigned int c6x_devstat;
+extern unsigned char c6x_fuse_mac[6];
+
+extern void machine_init(unsigned long dt_ptr);
+
+#endif /* !__ASSEMBLY__ */
+#endif /* _ASM_C6X_SETUP_H */
diff --git a/arch/c6x/include/asm/sigcontext.h b/arch/c6x/include/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..eb702f3
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_SIGCONTEXT_H
+#define _ASM_C6X_SIGCONTEXT_H
+
+
+struct sigcontext {
+       unsigned long  sc_mask;         /* old sigmask */
+       unsigned long  sc_sp;           /* old user stack pointer */
+
+       unsigned long  sc_a4;
+       unsigned long  sc_b4;
+       unsigned long  sc_a6;
+       unsigned long  sc_b6;
+       unsigned long  sc_a8;
+       unsigned long  sc_b8;
+
+       unsigned long  sc_a0;
+       unsigned long  sc_a1;
+       unsigned long  sc_a2;
+       unsigned long  sc_a3;
+       unsigned long  sc_a5;
+       unsigned long  sc_a7;
+       unsigned long  sc_a9;
+
+       unsigned long  sc_b0;
+       unsigned long  sc_b1;
+       unsigned long  sc_b2;
+       unsigned long  sc_b3;
+       unsigned long  sc_b5;
+       unsigned long  sc_b7;
+       unsigned long  sc_b9;
+
+       unsigned long  sc_a16;
+       unsigned long  sc_a17;
+       unsigned long  sc_a18;
+       unsigned long  sc_a19;
+       unsigned long  sc_a20;
+       unsigned long  sc_a21;
+       unsigned long  sc_a22;
+       unsigned long  sc_a23;
+       unsigned long  sc_a24;
+       unsigned long  sc_a25;
+       unsigned long  sc_a26;
+       unsigned long  sc_a27;
+       unsigned long  sc_a28;
+       unsigned long  sc_a29;
+       unsigned long  sc_a30;
+       unsigned long  sc_a31;
+
+       unsigned long  sc_b16;
+       unsigned long  sc_b17;
+       unsigned long  sc_b18;
+       unsigned long  sc_b19;
+       unsigned long  sc_b20;
+       unsigned long  sc_b21;
+       unsigned long  sc_b22;
+       unsigned long  sc_b23;
+       unsigned long  sc_b24;
+       unsigned long  sc_b25;
+       unsigned long  sc_b26;
+       unsigned long  sc_b27;
+       unsigned long  sc_b28;
+       unsigned long  sc_b29;
+       unsigned long  sc_b30;
+       unsigned long  sc_b31;
+
+       unsigned long  sc_csr;
+       unsigned long  sc_pc;
+};
+
+#endif /* _ASM_C6X_SIGCONTEXT_H */
diff --git a/arch/c6x/include/asm/signal.h b/arch/c6x/include/asm/signal.h
new file mode 100644 (file)
index 0000000..f1cd870
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef _ASM_C6X_SIGNAL_H
+#define _ASM_C6X_SIGNAL_H
+
+#include <asm-generic/signal.h>
+
+#ifndef __ASSEMBLY__
+#include <linux/linkage.h>
+
+struct pt_regs;
+
+extern asmlinkage int do_rt_sigreturn(struct pt_regs *regs);
+extern asmlinkage void do_notify_resume(struct pt_regs *regs,
+                                       u32 thread_info_flags,
+                                       int syscall);
+#endif
+
+#endif /* _ASM_C6X_SIGNAL_H */
diff --git a/arch/c6x/include/asm/soc.h b/arch/c6x/include/asm/soc.h
new file mode 100644 (file)
index 0000000..43f5015
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Miscellaneous SoC-specific hooks.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ * Author: Mark Salter <msalter@redhat.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 _ASM_C6X_SOC_H
+#define _ASM_C6X_SOC_H
+
+struct soc_ops {
+       /* Return active exception event or -1 if none */
+       int             (*get_exception)(void);
+
+       /* Assert an event */
+       void            (*assert_event)(unsigned int evt);
+};
+
+extern struct soc_ops soc_ops;
+
+extern int soc_get_exception(void);
+extern void soc_assert_event(unsigned int event);
+extern int soc_mac_addr(unsigned int index, u8 *addr);
+
+/*
+ * for mmio on SoC devices. regs are always same byte order as cpu.
+ */
+#define soc_readl(addr)    __raw_readl(addr)
+#define soc_writel(b, addr) __raw_writel((b), (addr))
+
+#endif /* _ASM_C6X_SOC_H */
diff --git a/arch/c6x/include/asm/string.h b/arch/c6x/include/asm/string.h
new file mode 100644 (file)
index 0000000..b21517c
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_STRING_H
+#define _ASM_C6X_STRING_H
+
+#include <asm/page.h>
+#include <linux/linkage.h>
+
+asmlinkage extern void *memcpy(void *to, const void *from, size_t n);
+
+#define __HAVE_ARCH_MEMCPY
+
+#endif /* _ASM_C6X_STRING_H */
diff --git a/arch/c6x/include/asm/swab.h b/arch/c6x/include/asm/swab.h
new file mode 100644 (file)
index 0000000..fd4bb05
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_SWAB_H
+#define _ASM_C6X_SWAB_H
+
+static inline __attribute_const__ __u16 __c6x_swab16(__u16 val)
+{
+       asm("swap4 .l1 %0,%0\n" : "+a"(val));
+       return val;
+}
+
+static inline __attribute_const__ __u32 __c6x_swab32(__u32 val)
+{
+       asm("swap4 .l1 %0,%0\n"
+           "swap2 .l1 %0,%0\n"
+           : "+a"(val));
+       return val;
+}
+
+static inline __attribute_const__ __u64 __c6x_swab64(__u64 val)
+{
+       asm("   swap2 .s1 %p0,%P0\n"
+           "|| swap2 .l1 %P0,%p0\n"
+           "   swap4 .l1 %p0,%p0\n"
+           "   swap4 .l1 %P0,%P0\n"
+           : "+a"(val));
+       return val;
+}
+
+static inline __attribute_const__ __u32 __c6x_swahw32(__u32 val)
+{
+       asm("swap2 .l1 %0,%0\n" : "+a"(val));
+       return val;
+}
+
+static inline __attribute_const__ __u32 __c6x_swahb32(__u32 val)
+{
+       asm("swap4 .l1 %0,%0\n" : "+a"(val));
+       return val;
+}
+
+#define __arch_swab16 __c6x_swab16
+#define __arch_swab32 __c6x_swab32
+#define __arch_swab64 __c6x_swab64
+#define __arch_swahw32 __c6x_swahw32
+#define __arch_swahb32 __c6x_swahb32
+
+#endif /* _ASM_C6X_SWAB_H */
diff --git a/arch/c6x/include/asm/syscall.h b/arch/c6x/include/asm/syscall.h
new file mode 100644 (file)
index 0000000..ae2be31
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ * Author: Mark Salter <msalter@redhat.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.
+ */
+
+#ifndef __ASM_C6X_SYSCALL_H
+#define __ASM_C6X_SYSCALL_H
+
+#include <linux/err.h>
+#include <linux/sched.h>
+
+static inline int syscall_get_nr(struct task_struct *task,
+                                struct pt_regs *regs)
+{
+       return regs->b0;
+}
+
+static inline void syscall_rollback(struct task_struct *task,
+                                   struct pt_regs *regs)
+{
+       /* do nothing */
+}
+
+static inline long syscall_get_error(struct task_struct *task,
+                                    struct pt_regs *regs)
+{
+       return IS_ERR_VALUE(regs->a4) ? regs->a4 : 0;
+}
+
+static inline long syscall_get_return_value(struct task_struct *task,
+                                           struct pt_regs *regs)
+{
+       return regs->a4;
+}
+
+static inline void syscall_set_return_value(struct task_struct *task,
+                                           struct pt_regs *regs,
+                                           int error, long val)
+{
+       regs->a4 = error ?: val;
+}
+
+static inline void syscall_get_arguments(struct task_struct *task,
+                                        struct pt_regs *regs, unsigned int i,
+                                        unsigned int n, unsigned long *args)
+{
+       switch (i) {
+       case 0:
+               if (!n--)
+                       break;
+               *args++ = regs->a4;
+       case 1:
+               if (!n--)
+                       break;
+               *args++ = regs->b4;
+       case 2:
+               if (!n--)
+                       break;
+               *args++ = regs->a6;
+       case 3:
+               if (!n--)
+                       break;
+               *args++ = regs->b6;
+       case 4:
+               if (!n--)
+                       break;
+               *args++ = regs->a8;
+       case 5:
+               if (!n--)
+                       break;
+               *args++ = regs->b8;
+       case 6:
+               if (!n--)
+                       break;
+       default:
+               BUG();
+       }
+}
+
+static inline void syscall_set_arguments(struct task_struct *task,
+                                        struct pt_regs *regs,
+                                        unsigned int i, unsigned int n,
+                                        const unsigned long *args)
+{
+       switch (i) {
+       case 0:
+               if (!n--)
+                       break;
+               regs->a4 = *args++;
+       case 1:
+               if (!n--)
+                       break;
+               regs->b4 = *args++;
+       case 2:
+               if (!n--)
+                       break;
+               regs->a6 = *args++;
+       case 3:
+               if (!n--)
+                       break;
+               regs->b6 = *args++;
+       case 4:
+               if (!n--)
+                       break;
+               regs->a8 = *args++;
+       case 5:
+               if (!n--)
+                       break;
+               regs->a9 = *args++;
+       case 6:
+               if (!n)
+                       break;
+       default:
+               BUG();
+       }
+}
+
+#endif /* __ASM_C6X_SYSCALLS_H */
diff --git a/arch/c6x/include/asm/syscalls.h b/arch/c6x/include/asm/syscalls.h
new file mode 100644 (file)
index 0000000..aed53da
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ * Author: Mark Salter <msalter@redhat.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, version 2.
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __ASM_C6X_SYSCALLS_H
+#define __ASM_C6X_SYSCALLS_H
+
+#include <linux/compiler.h>
+#include <linux/linkage.h>
+#include <linux/types.h>
+
+/* The array of function pointers for syscalls. */
+extern void *sys_call_table[];
+
+/* The following are trampolines in entry.S to handle 64-bit arguments */
+extern long sys_pread_c6x(unsigned int fd, char __user *buf,
+                         size_t count, off_t pos_low, off_t pos_high);
+extern long sys_pwrite_c6x(unsigned int fd, const char __user *buf,
+                          size_t count, off_t pos_low, off_t pos_high);
+extern long sys_truncate64_c6x(const char __user *path,
+                              off_t length_low, off_t length_high);
+extern long sys_ftruncate64_c6x(unsigned int fd,
+                              off_t length_low, off_t length_high);
+extern long sys_fadvise64_c6x(int fd, u32 offset_lo, u32 offset_hi,
+                             u32 len, int advice);
+extern long sys_fadvise64_64_c6x(int fd, u32 offset_lo, u32 offset_hi,
+                               u32 len_lo, u32 len_hi, int advice);
+extern long sys_fallocate_c6x(int fd, int mode,
+                             u32 offset_lo, u32 offset_hi,
+                             u32 len_lo, u32 len_hi);
+extern int sys_cache_sync(unsigned long s, unsigned long e);
+
+struct pt_regs;
+
+extern asmlinkage long sys_c6x_clone(struct pt_regs *regs);
+extern asmlinkage long sys_c6x_execve(const char __user *name,
+                                     const char __user *const __user *argv,
+                                     const char __user *const __user *envp,
+                                     struct pt_regs *regs);
+
+
+#include <asm-generic/syscalls.h>
+
+#endif /* __ASM_C6X_SYSCALLS_H */
diff --git a/arch/c6x/include/asm/system.h b/arch/c6x/include/asm/system.h
new file mode 100644 (file)
index 0000000..e076dc0
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_SYSTEM_H
+#define _ASM_C6X_SYSTEM_H
+
+#include <linux/linkage.h>
+#include <linux/irqflags.h>
+
+#define prepare_to_switch()    do { } while (0)
+
+struct task_struct;
+struct thread_struct;
+asmlinkage void *__switch_to(struct thread_struct *prev,
+                            struct thread_struct *next,
+                            struct task_struct *tsk);
+
+#define switch_to(prev, next, last)                            \
+       do {                                                    \
+               current->thread.wchan = (u_long) __builtin_return_address(0); \
+               (last) = __switch_to(&(prev)->thread,           \
+                                    &(next)->thread, (prev));  \
+               mb();                                           \
+               current->thread.wchan = 0;                      \
+       } while (0)
+
+/* Reset the board */
+#define HARD_RESET_NOW()
+
+#define get_creg(reg) \
+       ({ unsigned int __x; \
+          asm volatile ("mvc .s2 " #reg ",%0\n" : "=b"(__x)); __x; })
+
+#define set_creg(reg, v) \
+       do { unsigned int __x = (unsigned int)(v); \
+               asm volatile ("mvc .s2 %0," #reg "\n" : : "b"(__x)); \
+       } while (0)
+
+#define or_creg(reg, n) \
+       do { unsigned __x, __n = (unsigned)(n);           \
+               asm volatile ("mvc .s2 " #reg ",%0\n"     \
+                             "or  .l2 %1,%0,%0\n"        \
+                             "mvc .s2 %0," #reg "\n"     \
+                             "nop\n"                     \
+                             : "=&b"(__x) : "b"(__n));   \
+       } while (0)
+
+#define and_creg(reg, n) \
+       do { unsigned __x, __n = (unsigned)(n);           \
+               asm volatile ("mvc .s2 " #reg ",%0\n"     \
+                             "and .l2 %1,%0,%0\n"        \
+                             "mvc .s2 %0," #reg "\n"     \
+                             "nop\n"    \
+                             : "=&b"(__x) : "b"(__n));   \
+       } while (0)
+
+#define get_coreid() (get_creg(DNUM) & 0xff)
+
+/* Set/get IST */
+#define set_ist(x)     set_creg(ISTP, x)
+#define get_ist()       get_creg(ISTP)
+
+/*
+ * Exception management
+ */
+asmlinkage void enable_exception(void);
+#define disable_exception()
+#define get_except_type()        get_creg(EFR)
+#define ack_exception(type)      set_creg(ECR, 1 << (type))
+#define get_iexcept()            get_creg(IERR)
+#define set_iexcept(mask)        set_creg(IERR, (mask))
+
+/*
+ * Misc. functions
+ */
+#define nop()                    asm("NOP\n");
+#define mb()                     barrier()
+#define rmb()                    barrier()
+#define wmb()                    barrier()
+#define set_mb(var, value)       do { var = value;  mb(); } while (0)
+#define set_wmb(var, value)      do { var = value; wmb(); } while (0)
+
+#define smp_mb()                barrier()
+#define smp_rmb()               barrier()
+#define smp_wmb()               barrier()
+#define smp_read_barrier_depends()     do { } while (0)
+
+#define xchg(ptr, x) \
+       ((__typeof__(*(ptr)))__xchg((unsigned int)(x), (void *) (ptr), \
+                                   sizeof(*(ptr))))
+#define tas(ptr)    xchg((ptr), 1)
+
+unsigned int _lmbd(unsigned int, unsigned int);
+unsigned int _bitr(unsigned int);
+
+struct __xchg_dummy { unsigned int a[100]; };
+#define __xg(x) ((volatile struct __xchg_dummy *)(x))
+
+static inline unsigned int __xchg(unsigned int x, volatile void *ptr, int size)
+{
+       unsigned int tmp;
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       switch (size) {
+       case 1:
+               tmp = 0;
+               tmp = *((unsigned char *) ptr);
+               *((unsigned char *) ptr) = (unsigned char) x;
+               break;
+       case 2:
+               tmp = 0;
+               tmp = *((unsigned short *) ptr);
+               *((unsigned short *) ptr) = x;
+               break;
+       case 4:
+               tmp = 0;
+               tmp = *((unsigned int *) ptr);
+               *((unsigned int *) ptr) = x;
+               break;
+       }
+       local_irq_restore(flags);
+       return tmp;
+}
+
+#include <asm-generic/cmpxchg-local.h>
+
+/*
+ * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
+ * them available.
+ */
+#define cmpxchg_local(ptr, o, n)                                       \
+       ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr),             \
+                                                    (unsigned long)(o), \
+                                                    (unsigned long)(n), \
+                                                    sizeof(*(ptr))))
+#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
+
+#include <asm-generic/cmpxchg.h>
+
+#define _extu(x, s, e)                                                 \
+       ({      unsigned int __x;                                       \
+               asm volatile ("extu .S2 %3,%1,%2,%0\n" :                \
+                             "=b"(__x) : "n"(s), "n"(e), "b"(x));      \
+              __x; })
+
+
+extern unsigned int c6x_core_freq;
+
+struct pt_regs;
+
+extern void die(char *str, struct pt_regs *fp, int nr);
+extern asmlinkage int process_exception(struct pt_regs *regs);
+extern void time_init(void);
+extern void free_initmem(void);
+
+extern void (*c6x_restart)(void);
+extern void (*c6x_halt)(void);
+
+#endif /* _ASM_C6X_SYSTEM_H */
diff --git a/arch/c6x/include/asm/thread_info.h b/arch/c6x/include/asm/thread_info.h
new file mode 100644 (file)
index 0000000..fd99148
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Updated for 2.6.3x: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_THREAD_INFO_H
+#define _ASM_C6X_THREAD_INFO_H
+
+#ifdef __KERNEL__
+
+#include <asm/page.h>
+
+#ifdef CONFIG_4KSTACKS
+#define THREAD_SIZE            4096
+#define THREAD_SHIFT           12
+#define THREAD_ORDER           0
+#else
+#define THREAD_SIZE            8192
+#define THREAD_SHIFT           13
+#define THREAD_ORDER           1
+#endif
+
+#define THREAD_START_SP                (THREAD_SIZE - 8)
+
+#ifndef __ASSEMBLY__
+
+typedef struct {
+       unsigned long seg;
+} mm_segment_t;
+
+/*
+ * low level task data.
+ */
+struct thread_info {
+       struct task_struct      *task;          /* main task structure */
+       struct exec_domain      *exec_domain;   /* execution domain */
+       unsigned long           flags;          /* low level flags */
+       int                     cpu;            /* cpu we're on */
+       int                     preempt_count;  /* 0 = preemptable, <0 = BUG */
+       mm_segment_t            addr_limit;     /* thread address space */
+       struct restart_block    restart_block;
+};
+
+/*
+ * macros/functions for gaining access to the thread information structure
+ *
+ * preempt_count needs to be 1 initially, until the scheduler is functional.
+ */
+#define INIT_THREAD_INFO(tsk)                  \
+{                                              \
+       .task           = &tsk,                 \
+       .exec_domain    = &default_exec_domain, \
+       .flags          = 0,                    \
+       .cpu            = 0,                    \
+       .preempt_count  = INIT_PREEMPT_COUNT,   \
+       .addr_limit     = KERNEL_DS,            \
+       .restart_block  = {                     \
+               .fn = do_no_restart_syscall,    \
+       },                                      \
+}
+
+#define init_thread_info       (init_thread_union.thread_info)
+#define init_stack             (init_thread_union.stack)
+
+/* get the thread information struct of current task */
+static inline __attribute__((const))
+struct thread_info *current_thread_info(void)
+{
+       struct thread_info *ti;
+       asm volatile (" clr   .s2 B15,0,%1,%0\n"
+                     : "=b" (ti)
+                     : "Iu5" (THREAD_SHIFT - 1));
+       return ti;
+}
+
+#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
+
+/* thread information allocation */
+#ifdef CONFIG_DEBUG_STACK_USAGE
+#define THREAD_FLAGS (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
+#else
+#define THREAD_FLAGS (GFP_KERNEL | __GFP_NOTRACK)
+#endif
+
+#define alloc_thread_info_node(tsk, node)      \
+       ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER))
+
+#define free_thread_info(ti)   free_pages((unsigned long) (ti), THREAD_ORDER)
+#define get_thread_info(ti)    get_task_struct((ti)->task)
+#define put_thread_info(ti)    put_task_struct((ti)->task)
+#endif /* __ASSEMBLY__ */
+
+#define        PREEMPT_ACTIVE  0x10000000
+
+/*
+ * thread information flag bit numbers
+ * - pending work-to-be-done flags are in LSW
+ * - other flags in MSW
+ */
+#define TIF_SYSCALL_TRACE      0       /* syscall trace active */
+#define TIF_NOTIFY_RESUME      1       /* resumption notification requested */
+#define TIF_SIGPENDING         2       /* signal pending */
+#define TIF_NEED_RESCHED       3       /* rescheduling necessary */
+#define TIF_RESTORE_SIGMASK    4       /* restore signal mask in do_signal() */
+
+#define TIF_POLLING_NRFLAG     16      /* true if polling TIF_NEED_RESCHED */
+#define TIF_MEMDIE             17      /* OOM killer killed process */
+
+#define TIF_WORK_MASK          0x00007FFE /* work on irq/exception return */
+#define TIF_ALLWORK_MASK       0x00007FFF /* work on any return to u-space */
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_C6X_THREAD_INFO_H */
diff --git a/arch/c6x/include/asm/timer64.h b/arch/c6x/include/asm/timer64.h
new file mode 100644 (file)
index 0000000..bbe27bb
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _C6X_TIMER64_H
+#define _C6X_TIMER64_H
+
+extern void __init timer64_init(void);
+
+#endif /* _C6X_TIMER64_H */
diff --git a/arch/c6x/include/asm/timex.h b/arch/c6x/include/asm/timex.h
new file mode 100644 (file)
index 0000000..508c3ec
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Modified for 2.6.34: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_TIMEX_H
+#define _ASM_C6X_TIMEX_H
+
+#define CLOCK_TICK_RATE ((1000 * 1000000UL) / 6)
+
+/* 64-bit timestamp */
+typedef unsigned long long cycles_t;
+
+static inline cycles_t get_cycles(void)
+{
+       unsigned l, h;
+
+       asm volatile (" dint\n"
+                     " mvc .s2 TSCL,%0\n"
+                     " mvc .s2 TSCH,%1\n"
+                     " rint\n"
+                     : "=b"(l), "=b"(h));
+       return ((cycles_t)h << 32) | l;
+}
+
+#endif /* _ASM_C6X_TIMEX_H */
diff --git a/arch/c6x/include/asm/tlb.h b/arch/c6x/include/asm/tlb.h
new file mode 100644 (file)
index 0000000..8709e5e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _ASM_C6X_TLB_H
+#define _ASM_C6X_TLB_H
+
+#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
+
+#include <asm-generic/tlb.h>
+
+#endif /* _ASM_C6X_TLB_H */
diff --git a/arch/c6x/include/asm/traps.h b/arch/c6x/include/asm/traps.h
new file mode 100644 (file)
index 0000000..62124d7
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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_C6X_TRAPS_H
+#define _ASM_C6X_TRAPS_H
+
+#define EXCEPT_TYPE_NXF   31      /* NMI */
+#define EXCEPT_TYPE_EXC   30      /* external exception */
+#define EXCEPT_TYPE_IXF   1       /* internal exception */
+#define EXCEPT_TYPE_SXF   0       /* software exception */
+
+#define EXCEPT_CAUSE_LBX  (1 << 7) /* loop buffer exception */
+#define EXCEPT_CAUSE_PRX  (1 << 6) /* privilege exception */
+#define EXCEPT_CAUSE_RAX  (1 << 5) /* resource access exception */
+#define EXCEPT_CAUSE_RCX  (1 << 4) /* resource conflict exception */
+#define EXCEPT_CAUSE_OPX  (1 << 3) /* opcode exception */
+#define EXCEPT_CAUSE_EPX  (1 << 2) /* execute packet exception */
+#define EXCEPT_CAUSE_FPX  (1 << 1) /* fetch packet exception */
+#define EXCEPT_CAUSE_IFX  (1 << 0) /* instruction fetch exception */
+
+struct exception_info {
+       char *kernel_str;
+       int  signo;
+       int  code;
+};
+
+extern int (*c6x_nmi_handler)(struct pt_regs *regs);
+
+#endif /* _ASM_C6X_TRAPS_H */
diff --git a/arch/c6x/include/asm/uaccess.h b/arch/c6x/include/asm/uaccess.h
new file mode 100644 (file)
index 0000000..453dd26
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_UACCESS_H
+#define _ASM_C6X_UACCESS_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+#include <linux/string.h>
+
+#ifdef CONFIG_ACCESS_CHECK
+#define __access_ok _access_ok
+#endif
+
+/*
+ * __copy_from_user/copy_to_user are based on ones in asm-generic/uaccess.h
+ *
+ * C6X supports unaligned 32 and 64 bit loads and stores.
+ */
+static inline __must_check long __copy_from_user(void *to,
+               const void __user *from, unsigned long n)
+{
+       u32 tmp32;
+       u64 tmp64;
+
+       if (__builtin_constant_p(n)) {
+               switch (n) {
+               case 1:
+                       *(u8 *)to = *(u8 __force *)from;
+                       return 0;
+               case 4:
+                       asm volatile ("ldnw .d1t1 *%2,%0\n"
+                                     "nop  4\n"
+                                     "stnw .d1t1 %0,*%1\n"
+                                     : "=&a"(tmp32)
+                                     : "A"(to), "a"(from)
+                                     : "memory");
+                       return 0;
+               case 8:
+                       asm volatile ("ldndw .d1t1 *%2,%0\n"
+                                     "nop   4\n"
+                                     "stndw .d1t1 %0,*%1\n"
+                                     : "=&a"(tmp64)
+                                     : "a"(to), "a"(from)
+                                     : "memory");
+                       return 0;
+               default:
+                       break;
+               }
+       }
+
+       memcpy(to, (const void __force *)from, n);
+       return 0;
+}
+
+static inline __must_check long __copy_to_user(void __user *to,
+               const void *from, unsigned long n)
+{
+       u32 tmp32;
+       u64 tmp64;
+
+       if (__builtin_constant_p(n)) {
+               switch (n) {
+               case 1:
+                       *(u8 __force *)to = *(u8 *)from;
+                       return 0;
+               case 4:
+                       asm volatile ("ldnw .d1t1 *%2,%0\n"
+                                     "nop  4\n"
+                                     "stnw .d1t1 %0,*%1\n"
+                                     : "=&a"(tmp32)
+                                     : "a"(to), "a"(from)
+                                     : "memory");
+                       return 0;
+               case 8:
+                       asm volatile ("ldndw .d1t1 *%2,%0\n"
+                                     "nop   4\n"
+                                     "stndw .d1t1 %0,*%1\n"
+                                     : "=&a"(tmp64)
+                                     : "a"(to), "a"(from)
+                                     : "memory");
+                       return 0;
+               default:
+                       break;
+               }
+       }
+
+       memcpy((void __force *)to, from, n);
+       return 0;
+}
+
+#define __copy_to_user   __copy_to_user
+#define __copy_from_user __copy_from_user
+
+extern int _access_ok(unsigned long addr, unsigned long size);
+#ifdef CONFIG_ACCESS_CHECK
+#define __access_ok _access_ok
+#endif
+
+#include <asm-generic/uaccess.h>
+
+#endif /* _ASM_C6X_UACCESS_H */
diff --git a/arch/c6x/include/asm/unaligned.h b/arch/c6x/include/asm/unaligned.h
new file mode 100644 (file)
index 0000000..b976cb7
--- /dev/null
@@ -0,0 +1,170 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *  Rewritten for 2.6.3x: Mark Salter <msalter@redhat.com>
+ *
+ *  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_C6X_UNALIGNED_H
+#define _ASM_C6X_UNALIGNED_H
+
+#include <linux/swab.h>
+
+/*
+ * The C64x+ can do unaligned word and dword accesses in hardware
+ * using special load/store instructions.
+ */
+
+static inline u16 get_unaligned_le16(const void *p)
+{
+       const u8 *_p = p;
+       return _p[0] | _p[1] << 8;
+}
+
+static inline u16 get_unaligned_be16(const void *p)
+{
+       const u8 *_p = p;
+       return _p[0] << 8 | _p[1];
+}
+
+static inline void put_unaligned_le16(u16 val, void *p)
+{
+       u8 *_p = p;
+       _p[0] = val;
+       _p[1] = val >> 8;
+}
+
+static inline void put_unaligned_be16(u16 val, void *p)
+{
+       u8 *_p = p;
+       _p[0] = val >> 8;
+       _p[1] = val;
+}
+
+static inline u32 get_unaligned32(const void *p)
+{
+       u32 val = (u32) p;
+       asm (" ldnw     .d1t1   *%0,%0\n"
+            " nop     4\n"
+            : "+a"(val));
+       return val;
+}
+
+static inline void put_unaligned32(u32 val, void *p)
+{
+       asm volatile (" stnw    .d2t1   %0,*%1\n"
+                     : : "a"(val), "b"(p) : "memory");
+}
+
+static inline u64 get_unaligned64(const void *p)
+{
+       u64 val;
+       asm volatile (" ldndw   .d1t1   *%1,%0\n"
+                     " nop     4\n"
+                     : "=a"(val) : "a"(p));
+       return val;
+}
+
+static inline void put_unaligned64(u64 val, const void *p)
+{
+       asm volatile (" stndw   .d2t1   %0,*%1\n"
+                     : : "a"(val), "b"(p) : "memory");
+}
+
+#ifdef CONFIG_CPU_BIG_ENDIAN
+
+#define get_unaligned_le32(p)   __swab32(get_unaligned32(p))
+#define get_unaligned_le64(p)   __swab64(get_unaligned64(p))
+#define get_unaligned_be32(p)   get_unaligned32(p)
+#define get_unaligned_be64(p)   get_unaligned64(p)
+#define put_unaligned_le32(v, p) put_unaligned32(__swab32(v), (p))
+#define put_unaligned_le64(v, p) put_unaligned64(__swab64(v), (p))
+#define put_unaligned_be32(v, p) put_unaligned32((v), (p))
+#define put_unaligned_be64(v, p) put_unaligned64((v), (p))
+#define get_unaligned  __get_unaligned_be
+#define put_unaligned  __put_unaligned_be
+
+#else
+
+#define get_unaligned_le32(p)   get_unaligned32(p)
+#define get_unaligned_le64(p)   get_unaligned64(p)
+#define get_unaligned_be32(p)   __swab32(get_unaligned32(p))
+#define get_unaligned_be64(p)   __swab64(get_unaligned64(p))
+#define put_unaligned_le32(v, p) put_unaligned32((v), (p))
+#define put_unaligned_le64(v, p) put_unaligned64((v), (p))
+#define put_unaligned_be32(v, p) put_unaligned32(__swab32(v), (p))
+#define put_unaligned_be64(v, p) put_unaligned64(__swab64(v), (p))
+#define get_unaligned  __get_unaligned_le
+#define put_unaligned  __put_unaligned_le
+
+#endif
+
+/*
+ * Cause a link-time error if we try an unaligned access other than
+ * 1,2,4 or 8 bytes long
+ */
+extern int __bad_unaligned_access_size(void);
+
+#define __get_unaligned_le(ptr) (typeof(*(ptr)))({                     \
+       sizeof(*(ptr)) == 1 ? *(ptr) :                                  \
+         (sizeof(*(ptr)) == 2 ? get_unaligned_le16((ptr)) :            \
+            (sizeof(*(ptr)) == 4 ? get_unaligned_le32((ptr)) :         \
+               (sizeof(*(ptr)) == 8 ? get_unaligned_le64((ptr)) :      \
+                  __bad_unaligned_access_size())));                    \
+       })
+
+#define __get_unaligned_be(ptr) (__force typeof(*(ptr)))({     \
+       sizeof(*(ptr)) == 1 ? *(ptr) :                                  \
+         (sizeof(*(ptr)) == 2 ? get_unaligned_be16((ptr)) :            \
+            (sizeof(*(ptr)) == 4 ? get_unaligned_be32((ptr)) :         \
+               (sizeof(*(ptr)) == 8 ? get_unaligned_be64((ptr)) :      \
+                  __bad_unaligned_access_size())));                    \
+       })
+
+#define __put_unaligned_le(val, ptr) ({                                        \
+       void *__gu_p = (ptr);                                           \
+       switch (sizeof(*(ptr))) {                                       \
+       case 1:                                                         \
+               *(u8 *)__gu_p = (__force u8)(val);                      \
+               break;                                                  \
+       case 2:                                                         \
+               put_unaligned_le16((__force u16)(val), __gu_p);         \
+               break;                                                  \
+       case 4:                                                         \
+               put_unaligned_le32((__force u32)(val), __gu_p);         \
+               break;                                                  \
+       case 8:                                                         \
+               put_unaligned_le64((__force u64)(val), __gu_p);         \
+               break;                                                  \
+       default:                                                        \
+               __bad_unaligned_access_size();                          \
+               break;                                                  \
+       }                                                               \
+       (void)0; })
+
+#define __put_unaligned_be(val, ptr) ({                                        \
+       void *__gu_p = (ptr);                                           \
+       switch (sizeof(*(ptr))) {                                       \
+       case 1:                                                         \
+               *(u8 *)__gu_p = (__force u8)(val);                      \
+               break;                                                  \
+       case 2:                                                         \
+               put_unaligned_be16((__force u16)(val), __gu_p);         \
+               break;                                                  \
+       case 4:                                                         \
+               put_unaligned_be32((__force u32)(val), __gu_p);         \
+               break;                                                  \
+       case 8:                                                         \
+               put_unaligned_be64((__force u64)(val), __gu_p);         \
+               break;                                                  \
+       default:                                                        \
+               __bad_unaligned_access_size();                          \
+               break;                                                  \
+       }                                                               \
+       (void)0; })
+
+#endif /* _ASM_C6X_UNALIGNED_H */
diff --git a/arch/c6x/include/asm/unistd.h b/arch/c6x/include/asm/unistd.h
new file mode 100644 (file)
index 0000000..6d54ea4
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ * Based on arch/tile version.
+ *
+ *   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, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT. See the GNU General Public License for
+ *   more details.
+ */
+#if !defined(_ASM_C6X_UNISTD_H) || defined(__SYSCALL)
+#define _ASM_C6X_UNISTD_H
+
+/* Use the standard ABI for syscalls. */
+#include <asm-generic/unistd.h>
+
+/* C6X-specific syscalls. */
+#define __NR_cache_sync        (__NR_arch_specific_syscall + 0)
+__SYSCALL(__NR_cache_sync, sys_cache_sync)
+
+#endif /* _ASM_C6X_UNISTD_H */
diff --git a/arch/c6x/kernel/Makefile b/arch/c6x/kernel/Makefile
new file mode 100644 (file)
index 0000000..580a515
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Makefile for arch/c6x/kernel/
+#
+
+extra-y := head.o vmlinux.lds
+
+obj-y := process.o traps.o irq.o signal.o ptrace.o
+obj-y += setup.o sys_c6x.o time.o devicetree.o
+obj-y += switch_to.o entry.o vectors.o c6x_ksyms.o
+obj-y += soc.o dma.o
+
+obj-$(CONFIG_MODULES)           += module.o
diff --git a/arch/c6x/kernel/asm-offsets.c b/arch/c6x/kernel/asm-offsets.c
new file mode 100644 (file)
index 0000000..759ad6d
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+
+#include <linux/sched.h>
+#include <linux/thread_info.h>
+#include <asm/procinfo.h>
+#include <linux/kbuild.h>
+#include <linux/unistd.h>
+
+void foo(void)
+{
+       OFFSET(REGS_A16,        pt_regs, a16);
+       OFFSET(REGS_A17,        pt_regs, a17);
+       OFFSET(REGS_A18,        pt_regs, a18);
+       OFFSET(REGS_A19,        pt_regs, a19);
+       OFFSET(REGS_A20,        pt_regs, a20);
+       OFFSET(REGS_A21,        pt_regs, a21);
+       OFFSET(REGS_A22,        pt_regs, a22);
+       OFFSET(REGS_A23,        pt_regs, a23);
+       OFFSET(REGS_A24,        pt_regs, a24);
+       OFFSET(REGS_A25,        pt_regs, a25);
+       OFFSET(REGS_A26,        pt_regs, a26);
+       OFFSET(REGS_A27,        pt_regs, a27);
+       OFFSET(REGS_A28,        pt_regs, a28);
+       OFFSET(REGS_A29,        pt_regs, a29);
+       OFFSET(REGS_A30,        pt_regs, a30);
+       OFFSET(REGS_A31,        pt_regs, a31);
+
+       OFFSET(REGS_B16,        pt_regs, b16);
+       OFFSET(REGS_B17,        pt_regs, b17);
+       OFFSET(REGS_B18,        pt_regs, b18);
+       OFFSET(REGS_B19,        pt_regs, b19);
+       OFFSET(REGS_B20,        pt_regs, b20);
+       OFFSET(REGS_B21,        pt_regs, b21);
+       OFFSET(REGS_B22,        pt_regs, b22);
+       OFFSET(REGS_B23,        pt_regs, b23);
+       OFFSET(REGS_B24,        pt_regs, b24);
+       OFFSET(REGS_B25,        pt_regs, b25);
+       OFFSET(REGS_B26,        pt_regs, b26);
+       OFFSET(REGS_B27,        pt_regs, b27);
+       OFFSET(REGS_B28,        pt_regs, b28);
+       OFFSET(REGS_B29,        pt_regs, b29);
+       OFFSET(REGS_B30,        pt_regs, b30);
+       OFFSET(REGS_B31,        pt_regs, b31);
+
+       OFFSET(REGS_A0,         pt_regs, a0);
+       OFFSET(REGS_A1,         pt_regs, a1);
+       OFFSET(REGS_A2,         pt_regs, a2);
+       OFFSET(REGS_A3,         pt_regs, a3);
+       OFFSET(REGS_A4,         pt_regs, a4);
+       OFFSET(REGS_A5,         pt_regs, a5);
+       OFFSET(REGS_A6,         pt_regs, a6);
+       OFFSET(REGS_A7,         pt_regs, a7);
+       OFFSET(REGS_A8,         pt_regs, a8);
+       OFFSET(REGS_A9,         pt_regs, a9);
+       OFFSET(REGS_A10,        pt_regs, a10);
+       OFFSET(REGS_A11,        pt_regs, a11);
+       OFFSET(REGS_A12,        pt_regs, a12);
+       OFFSET(REGS_A13,        pt_regs, a13);
+       OFFSET(REGS_A14,        pt_regs, a14);
+       OFFSET(REGS_A15,        pt_regs, a15);
+
+       OFFSET(REGS_B0,         pt_regs, b0);
+       OFFSET(REGS_B1,         pt_regs, b1);
+       OFFSET(REGS_B2,         pt_regs, b2);
+       OFFSET(REGS_B3,         pt_regs, b3);
+       OFFSET(REGS_B4,         pt_regs, b4);
+       OFFSET(REGS_B5,         pt_regs, b5);
+       OFFSET(REGS_B6,         pt_regs, b6);
+       OFFSET(REGS_B7,         pt_regs, b7);
+       OFFSET(REGS_B8,         pt_regs, b8);
+       OFFSET(REGS_B9,         pt_regs, b9);
+       OFFSET(REGS_B10,        pt_regs, b10);
+       OFFSET(REGS_B11,        pt_regs, b11);
+       OFFSET(REGS_B12,        pt_regs, b12);
+       OFFSET(REGS_B13,        pt_regs, b13);
+       OFFSET(REGS_DP,         pt_regs, dp);
+       OFFSET(REGS_SP,         pt_regs, sp);
+
+       OFFSET(REGS_TSR,        pt_regs, tsr);
+       OFFSET(REGS_ORIG_A4,    pt_regs, orig_a4);
+
+       DEFINE(REGS__END,       sizeof(struct pt_regs));
+       BLANK();
+
+       OFFSET(THREAD_PC,       thread_struct, pc);
+       OFFSET(THREAD_B15_14,   thread_struct, b15_14);
+       OFFSET(THREAD_A15_14,   thread_struct, a15_14);
+       OFFSET(THREAD_B13_12,   thread_struct, b13_12);
+       OFFSET(THREAD_A13_12,   thread_struct, a13_12);
+       OFFSET(THREAD_B11_10,   thread_struct, b11_10);
+       OFFSET(THREAD_A11_10,   thread_struct, a11_10);
+       OFFSET(THREAD_RICL_ICL, thread_struct, ricl_icl);
+       BLANK();
+
+       OFFSET(TASK_STATE,      task_struct, state);
+       BLANK();
+
+       OFFSET(THREAD_INFO_FLAGS,       thread_info, flags);
+       OFFSET(THREAD_INFO_PREEMPT_COUNT, thread_info, preempt_count);
+       BLANK();
+
+       /* These would be unneccessary if we ran asm files
+        * through the preprocessor.
+        */
+       DEFINE(KTHREAD_SIZE, THREAD_SIZE);
+       DEFINE(KTHREAD_SHIFT, THREAD_SHIFT);
+       DEFINE(KTHREAD_START_SP, THREAD_START_SP);
+       DEFINE(ENOSYS_, ENOSYS);
+       DEFINE(NR_SYSCALLS_, __NR_syscalls);
+
+       DEFINE(_TIF_SYSCALL_TRACE, (1<<TIF_SYSCALL_TRACE));
+       DEFINE(_TIF_NOTIFY_RESUME, (1<<TIF_NOTIFY_RESUME));
+       DEFINE(_TIF_SIGPENDING, (1<<TIF_SIGPENDING));
+       DEFINE(_TIF_NEED_RESCHED, (1<<TIF_NEED_RESCHED));
+       DEFINE(_TIF_POLLING_NRFLAG, (1<<TIF_POLLING_NRFLAG));
+
+       DEFINE(_TIF_ALLWORK_MASK, TIF_ALLWORK_MASK);
+       DEFINE(_TIF_WORK_MASK, TIF_WORK_MASK);
+}
diff --git a/arch/c6x/kernel/c6x_ksyms.c b/arch/c6x/kernel/c6x_ksyms.c
new file mode 100644 (file)
index 0000000..0ba3e0b
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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/module.h>
+#include <asm/checksum.h>
+#include <linux/io.h>
+
+/*
+ * libgcc functions - used internally by the compiler...
+ */
+extern int __c6xabi_divi(int dividend, int divisor);
+EXPORT_SYMBOL(__c6xabi_divi);
+
+extern unsigned __c6xabi_divu(unsigned dividend, unsigned divisor);
+EXPORT_SYMBOL(__c6xabi_divu);
+
+extern int __c6xabi_remi(int dividend, int divisor);
+EXPORT_SYMBOL(__c6xabi_remi);
+
+extern unsigned __c6xabi_remu(unsigned dividend, unsigned divisor);
+EXPORT_SYMBOL(__c6xabi_remu);
+
+extern int __c6xabi_divremi(int dividend, int divisor);
+EXPORT_SYMBOL(__c6xabi_divremi);
+
+extern unsigned __c6xabi_divremu(unsigned  dividend, unsigned divisor);
+EXPORT_SYMBOL(__c6xabi_divremu);
+
+extern unsigned long long __c6xabi_mpyll(unsigned long long src1,
+                                        unsigned long long src2);
+EXPORT_SYMBOL(__c6xabi_mpyll);
+
+extern long long __c6xabi_negll(long long src);
+EXPORT_SYMBOL(__c6xabi_negll);
+
+extern unsigned long long __c6xabi_llshl(unsigned long long src1, uint src2);
+EXPORT_SYMBOL(__c6xabi_llshl);
+
+extern long long __c6xabi_llshr(long long src1, uint src2);
+EXPORT_SYMBOL(__c6xabi_llshr);
+
+extern unsigned long long __c6xabi_llshru(unsigned long long src1, uint src2);
+EXPORT_SYMBOL(__c6xabi_llshru);
+
+extern void __c6xabi_strasgi(int *dst, const int *src, unsigned cnt);
+EXPORT_SYMBOL(__c6xabi_strasgi);
+
+extern void __c6xabi_push_rts(void);
+EXPORT_SYMBOL(__c6xabi_push_rts);
+
+extern void __c6xabi_pop_rts(void);
+EXPORT_SYMBOL(__c6xabi_pop_rts);
+
+extern void __c6xabi_strasgi_64plus(int *dst, const int *src, unsigned cnt);
+EXPORT_SYMBOL(__c6xabi_strasgi_64plus);
+
+/* lib functions */
+EXPORT_SYMBOL(memcpy);
diff --git a/arch/c6x/kernel/devicetree.c b/arch/c6x/kernel/devicetree.c
new file mode 100644 (file)
index 0000000..bdb56f0
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ *  Architecture specific OF callbacks.
+ *
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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/init.h>
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+#include <linux/initrd.h>
+#include <linux/memblock.h>
+
+void __init early_init_devtree(void *params)
+{
+       /* Setup flat device-tree pointer */
+       initial_boot_params = params;
+
+       /* Retrieve various informations from the /chosen node of the
+        * device-tree, including the platform type, initrd location and
+        * size and more ...
+        */
+       of_scan_flat_dt(early_init_dt_scan_chosen, c6x_command_line);
+
+       /* Scan memory nodes and rebuild MEMBLOCKs */
+       of_scan_flat_dt(early_init_dt_scan_root, NULL);
+       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+}
+
+
+#ifdef CONFIG_BLK_DEV_INITRD
+void __init early_init_dt_setup_initrd_arch(unsigned long start,
+               unsigned long end)
+{
+       initrd_start = (unsigned long)__va(start);
+       initrd_end = (unsigned long)__va(end);
+       initrd_below_start_ok = 1;
+}
+#endif
+
+void __init early_init_dt_add_memory_arch(u64 base, u64 size)
+{
+       c6x_add_memory(base, size);
+}
+
+void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
+{
+       return __va(memblock_alloc(size, align));
+}
diff --git a/arch/c6x/kernel/dma.c b/arch/c6x/kernel/dma.c
new file mode 100644 (file)
index 0000000..ab7b12d
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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/module.h>
+#include <linux/dma-mapping.h>
+#include <linux/mm.h>
+#include <linux/mm_types.h>
+#include <linux/scatterlist.h>
+
+#include <asm/cacheflush.h>
+
+static void c6x_dma_sync(dma_addr_t handle, size_t size,
+                        enum dma_data_direction dir)
+{
+       unsigned long paddr = handle;
+
+       BUG_ON(!valid_dma_direction(dir));
+
+       switch (dir) {
+       case DMA_FROM_DEVICE:
+               L2_cache_block_invalidate(paddr, paddr + size);
+               break;
+       case DMA_TO_DEVICE:
+               L2_cache_block_writeback(paddr, paddr + size);
+               break;
+       case DMA_BIDIRECTIONAL:
+               L2_cache_block_writeback_invalidate(paddr, paddr + size);
+               break;
+       default:
+               break;
+       }
+}
+
+dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
+                         enum dma_data_direction dir)
+{
+       dma_addr_t addr = virt_to_phys(ptr);
+
+       c6x_dma_sync(addr, size, dir);
+
+       debug_dma_map_page(dev, virt_to_page(ptr),
+                          (unsigned long)ptr & ~PAGE_MASK, size,
+                          dir, addr, true);
+       return addr;
+}
+EXPORT_SYMBOL(dma_map_single);
+
+
+void dma_unmap_single(struct device *dev, dma_addr_t handle,
+                     size_t size, enum dma_data_direction dir)
+{
+       c6x_dma_sync(handle, size, dir);
+
+       debug_dma_unmap_page(dev, handle, size, dir, true);
+}
+EXPORT_SYMBOL(dma_unmap_single);
+
+
+int dma_map_sg(struct device *dev, struct scatterlist *sglist,
+              int nents, enum dma_data_direction dir)
+{
+       struct scatterlist *sg;
+       int i;
+
+       for_each_sg(sglist, sg, nents, i)
+               sg->dma_address = dma_map_single(dev, sg_virt(sg), sg->length,
+                                                dir);
+
+       debug_dma_map_sg(dev, sglist, nents, nents, dir);
+
+       return nents;
+}
+EXPORT_SYMBOL(dma_map_sg);
+
+
+void dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
+                 int nents, enum dma_data_direction dir)
+{
+       struct scatterlist *sg;
+       int i;
+
+       for_each_sg(sglist, sg, nents, i)
+               dma_unmap_single(dev, sg_dma_address(sg), sg->length, dir);
+
+       debug_dma_unmap_sg(dev, sglist, nents, dir);
+}
+EXPORT_SYMBOL(dma_unmap_sg);
+
+void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
+                            size_t size, enum dma_data_direction dir)
+{
+       c6x_dma_sync(handle, size, dir);
+
+       debug_dma_sync_single_for_cpu(dev, handle, size, dir);
+}
+EXPORT_SYMBOL(dma_sync_single_for_cpu);
+
+
+void dma_sync_single_for_device(struct device *dev, dma_addr_t handle,
+                               size_t size, enum dma_data_direction dir)
+{
+       c6x_dma_sync(handle, size, dir);
+
+       debug_dma_sync_single_for_device(dev, handle, size, dir);
+}
+EXPORT_SYMBOL(dma_sync_single_for_device);
+
+
+void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist,
+                        int nents, enum dma_data_direction dir)
+{
+       struct scatterlist *sg;
+       int i;
+
+       for_each_sg(sglist, sg, nents, i)
+               dma_sync_single_for_cpu(dev, sg_dma_address(sg),
+                                       sg->length, dir);
+
+       debug_dma_sync_sg_for_cpu(dev, sglist, nents, dir);
+}
+EXPORT_SYMBOL(dma_sync_sg_for_cpu);
+
+
+void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist,
+                           int nents, enum dma_data_direction dir)
+{
+       struct scatterlist *sg;
+       int i;
+
+       for_each_sg(sglist, sg, nents, i)
+               dma_sync_single_for_device(dev, sg_dma_address(sg),
+                                          sg->length, dir);
+
+       debug_dma_sync_sg_for_device(dev, sglist, nents, dir);
+}
+EXPORT_SYMBOL(dma_sync_sg_for_device);
+
+
+/* Number of entries preallocated for DMA-API debugging */
+#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
+
+static int __init dma_init(void)
+{
+       dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
+
+       return 0;
+}
+fs_initcall(dma_init);
diff --git a/arch/c6x/kernel/entry.S b/arch/c6x/kernel/entry.S
new file mode 100644 (file)
index 0000000..3e977cc
--- /dev/null
@@ -0,0 +1,803 @@
+;
+;  Port on Texas Instruments TMS320C6x architecture
+;
+;  Copyright (C) 2004-2011 Texas Instruments Incorporated
+;  Author: Aurelien Jacquiot (aurelien.jacquiot@virtuallogix.com)
+;  Updated for 2.6.34: Mark Salter <msalter@redhat.com>
+;
+;  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/sys.h>
+#include <linux/linkage.h>
+#include <asm/thread_info.h>
+#include <asm/asm-offsets.h>
+#include <asm/unistd.h>
+#include <asm/errno.h>
+
+; Registers naming
+#define DP     B14
+#define SP     B15
+
+#ifndef CONFIG_PREEMPT
+#define resume_kernel restore_all
+#endif
+
+       .altmacro
+
+       .macro MASK_INT reg
+       MVC     .S2     CSR,reg
+       CLR     .S2     reg,0,0,reg
+       MVC     .S2     reg,CSR
+       .endm
+
+       .macro UNMASK_INT reg
+       MVC     .S2     CSR,reg
+       SET     .S2     reg,0,0,reg
+       MVC     .S2     reg,CSR
+       .endm
+
+       .macro GET_THREAD_INFO reg
+       SHR     .S1X    SP,THREAD_SHIFT,reg
+       SHL     .S1     reg,THREAD_SHIFT,reg
+       .endm
+
+       ;;
+       ;;  This defines the normal kernel pt_regs layout.
+       ;;
+       .macro SAVE_ALL __rp __tsr
+       STW     .D2T2   B0,*SP--[2]             ; save original B0
+       MVKL    .S2     current_ksp,B0
+       MVKH    .S2     current_ksp,B0
+       LDW     .D2T2   *B0,B1                  ; KSP
+
+       NOP     3
+       STW     .D2T2   B1,*+SP[1]              ; save original B1
+       XOR     .D2     SP,B1,B0                ; (SP ^ KSP)
+       LDW     .D2T2   *+SP[1],B1              ; restore B0/B1
+       LDW     .D2T2   *++SP[2],B0
+       SHR     .S2     B0,THREAD_SHIFT,B0      ; 0 if already using kstack
+  [B0] STDW    .D2T2   SP:DP,*--B1[1]          ; user: save user sp/dp kstack
+  [B0] MV      .S2     B1,SP                   ;    and switch to kstack
+||[!B0] STDW   .D2T2   SP:DP,*--SP[1]          ; kernel: save on current stack
+
+       SUBAW   .D2     SP,2,SP
+
+       ADD     .D1X    SP,-8,A15
+ ||    STDW    .D2T1   A15:A14,*SP--[16]       ; save A15:A14
+
+       STDW    .D2T2   B13:B12,*SP--[1]
+ ||    STDW    .D1T1   A13:A12,*A15--[1]
+ ||    MVC     .S2     __rp,B13
+
+       STDW    .D2T2   B11:B10,*SP--[1]
+ ||    STDW    .D1T1   A11:A10,*A15--[1]
+ ||    MVC     .S2     CSR,B12
+
+       STDW    .D2T2   B9:B8,*SP--[1]
+ ||    STDW    .D1T1   A9:A8,*A15--[1]
+ ||    MVC     .S2     RILC,B11
+       STDW    .D2T2   B7:B6,*SP--[1]
+ ||    STDW    .D1T1   A7:A6,*A15--[1]
+ ||    MVC     .S2     ILC,B10
+
+       STDW    .D2T2   B5:B4,*SP--[1]
+ ||    STDW    .D1T1   A5:A4,*A15--[1]
+
+       STDW    .D2T2   B3:B2,*SP--[1]
+ ||    STDW    .D1T1   A3:A2,*A15--[1]
+ ||    MVC     .S2     __tsr,B5
+
+       STDW    .D2T2   B1:B0,*SP--[1]
+ ||    STDW    .D1T1   A1:A0,*A15--[1]
+ ||    MV      .S1X    B5,A5
+
+       STDW    .D2T2   B31:B30,*SP--[1]
+ ||    STDW    .D1T1   A31:A30,*A15--[1]
+       STDW    .D2T2   B29:B28,*SP--[1]
+ ||    STDW    .D1T1   A29:A28,*A15--[1]
+       STDW    .D2T2   B27:B26,*SP--[1]
+ ||    STDW    .D1T1   A27:A26,*A15--[1]
+       STDW    .D2T2   B25:B24,*SP--[1]
+ ||    STDW    .D1T1   A25:A24,*A15--[1]
+       STDW    .D2T2   B23:B22,*SP--[1]
+ ||    STDW    .D1T1   A23:A22,*A15--[1]
+       STDW    .D2T2   B21:B20,*SP--[1]
+ ||    STDW    .D1T1   A21:A20,*A15--[1]
+       STDW    .D2T2   B19:B18,*SP--[1]
+ ||    STDW    .D1T1   A19:A18,*A15--[1]
+       STDW    .D2T2   B17:B16,*SP--[1]
+ ||    STDW    .D1T1   A17:A16,*A15--[1]
+
+       STDW    .D2T2   B13:B12,*SP--[1]        ; save PC and CSR
+
+       STDW    .D2T2   B11:B10,*SP--[1]        ; save RILC and ILC
+       STDW    .D2T1   A5:A4,*SP--[1]          ; save TSR and orig A4
+
+       ;; We left an unused word on the stack just above pt_regs.
+       ;; It is used to save whether or not this frame is due to
+       ;; a syscall. It is cleared here, but the syscall handler
+       ;; sets it to a non-zero value.
+       MVK     .L2     0,B1
+       STW     .D2T2   B1,*+SP(REGS__END+8)    ; clear syscall flag
+       .endm
+
+       .macro RESTORE_ALL __rp __tsr
+       LDDW    .D2T2   *++SP[1],B9:B8          ; get TSR (B9)
+       LDDW    .D2T2   *++SP[1],B11:B10        ; get RILC (B11) and ILC (B10)
+       LDDW    .D2T2   *++SP[1],B13:B12        ; get PC (B13) and CSR (B12)
+
+       ADDAW   .D1X    SP,30,A15
+
+       LDDW    .D1T1   *++A15[1],A17:A16
+ ||    LDDW    .D2T2   *++SP[1],B17:B16
+       LDDW    .D1T1   *++A15[1],A19:A18
+ ||    LDDW    .D2T2   *++SP[1],B19:B18
+       LDDW    .D1T1   *++A15[1],A21:A20
+ ||    LDDW    .D2T2   *++SP[1],B21:B20
+       LDDW    .D1T1   *++A15[1],A23:A22
+ ||    LDDW    .D2T2   *++SP[1],B23:B22
+       LDDW    .D1T1   *++A15[1],A25:A24
+ ||    LDDW    .D2T2   *++SP[1],B25:B24
+       LDDW    .D1T1   *++A15[1],A27:A26
+ ||    LDDW    .D2T2   *++SP[1],B27:B26
+       LDDW    .D1T1   *++A15[1],A29:A28
+ ||    LDDW    .D2T2   *++SP[1],B29:B28
+       LDDW    .D1T1   *++A15[1],A31:A30
+ ||    LDDW    .D2T2   *++SP[1],B31:B30
+
+       LDDW    .D1T1   *++A15[1],A1:A0
+ ||    LDDW    .D2T2   *++SP[1],B1:B0
+
+       LDDW    .D1T1   *++A15[1],A3:A2
+ ||    LDDW    .D2T2   *++SP[1],B3:B2
+ ||    MVC     .S2     B9,__tsr
+       LDDW    .D1T1   *++A15[1],A5:A4
+ ||    LDDW    .D2T2   *++SP[1],B5:B4
+ ||    MVC     .S2     B11,RILC
+       LDDW    .D1T1   *++A15[1],A7:A6
+ ||    LDDW    .D2T2   *++SP[1],B7:B6
+ ||    MVC     .S2     B10,ILC
+
+       LDDW    .D1T1   *++A15[1],A9:A8
+ ||    LDDW    .D2T2   *++SP[1],B9:B8
+ ||    MVC     .S2     B13,__rp
+
+       LDDW    .D1T1   *++A15[1],A11:A10
+ ||    LDDW    .D2T2   *++SP[1],B11:B10
+ ||    MVC     .S2     B12,CSR
+
+       LDDW    .D1T1   *++A15[1],A13:A12
+ ||    LDDW    .D2T2   *++SP[1],B13:B12
+
+       MV      .D2X    A15,SP
+ ||    MVKL    .S1     current_ksp,A15
+       MVKH    .S1     current_ksp,A15
+ ||    ADDAW   .D1X    SP,6,A14
+       STW     .D1T1   A14,*A15        ; save kernel stack pointer
+
+       LDDW    .D2T1   *++SP[1],A15:A14
+
+       B       .S2     __rp            ; return from interruption
+       LDDW    .D2T2   *+SP[1],SP:DP
+       NOP     4
+       .endm
+
+       .section .text
+
+       ;;
+       ;; Jump to schedule() then return to ret_from_exception
+       ;;
+_reschedule:
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     schedule,A0
+       MVKH    .S1     schedule,A0
+       B       .S2X    A0
+#else
+       B       .S1     schedule
+#endif
+       ADDKPC  .S2     ret_from_exception,B3,4
+
+       ;;
+       ;; Called before syscall handler when process is being debugged
+       ;;
+tracesys_on:
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     syscall_trace_entry,A0
+       MVKH    .S1     syscall_trace_entry,A0
+       B       .S2X    A0
+#else
+       B       .S1     syscall_trace_entry
+#endif
+       ADDKPC  .S2     ret_from_syscall_trace,B3,3
+       ADD     .S1X    8,SP,A4
+
+ret_from_syscall_trace:
+       ;; tracing returns (possibly new) syscall number
+       MV      .D2X    A4,B0
+ ||    MVK     .S2     __NR_syscalls,B1
+       CMPLTU  .L2     B0,B1,B1
+
+ [!B1] BNOP    .S2     ret_from_syscall_function,5
+ ||    MVK     .S1     -ENOSYS,A4
+
+       ;; reload syscall args from (possibly modified) stack frame
+       ;; and get syscall handler addr from sys_call_table:
+       LDW     .D2T2   *+SP(REGS_B4+8),B4
+ ||    MVKL    .S2     sys_call_table,B1
+       LDW     .D2T1   *+SP(REGS_A6+8),A6
+ ||    MVKH    .S2     sys_call_table,B1
+       LDW     .D2T2   *+B1[B0],B0
+ ||    MVKL    .S2     ret_from_syscall_function,B3
+       LDW     .D2T2   *+SP(REGS_B6+8),B6
+ ||    MVKH    .S2     ret_from_syscall_function,B3
+       LDW     .D2T1   *+SP(REGS_A8+8),A8
+       LDW     .D2T2   *+SP(REGS_B8+8),B8
+       NOP
+       ; B0 = sys_call_table[__NR_*]
+       BNOP    .S2     B0,5                    ; branch to syscall handler
+ ||    LDW     .D2T1   *+SP(REGS_ORIG_A4+8),A4
+
+syscall_exit_work:
+       AND     .D1     _TIF_SYSCALL_TRACE,A2,A0
+ [!A0] BNOP    .S1     work_pending,5
+ [A0]  B       .S2     syscall_trace_exit
+       ADDKPC  .S2     resume_userspace,B3,1
+       MVC     .S2     CSR,B1
+       SET     .S2     B1,0,0,B1
+       MVC     .S2     B1,CSR          ; enable ints
+
+work_pending:
+       AND     .D1     _TIF_NEED_RESCHED,A2,A0
+ [!A0] BNOP    .S1     work_notifysig,5
+
+work_resched:
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     schedule,A1
+       MVKH    .S1     schedule,A1
+       B       .S2X    A1
+#else
+       B       .S2     schedule
+#endif
+       ADDKPC  .S2     work_rescheduled,B3,4
+work_rescheduled:
+       ;; make sure we don't miss an interrupt setting need_resched or
+       ;; sigpending between sampling and the rti
+       MASK_INT B2
+       GET_THREAD_INFO A12
+       LDW     .D1T1   *+A12(THREAD_INFO_FLAGS),A2
+       MVK     .S1     _TIF_WORK_MASK,A1
+       MVK     .S1     _TIF_NEED_RESCHED,A3
+       NOP     2
+       AND     .D1     A1,A2,A0
+ ||    AND     .S1     A3,A2,A1
+ [!A0] BNOP    .S1     restore_all,5
+ [A1]  BNOP    .S1     work_resched,5
+
+work_notifysig:
+       B       .S2     do_notify_resume
+       LDW     .D2T1   *+SP(REGS__END+8),A6 ; syscall flag
+       ADDKPC  .S2     resume_userspace,B3,1
+       ADD     .S1X    8,SP,A4         ; pt_regs pointer is first arg
+       MV      .D2X    A2,B4           ; thread_info flags is second arg
+
+       ;;
+       ;; On C64x+, the return way from exception and interrupt
+       ;; is a little bit different
+       ;;
+ENTRY(ret_from_exception)
+#ifdef CONFIG_PREEMPT
+       MASK_INT B2
+#endif
+
+ENTRY(ret_from_interrupt)
+       ;;
+       ;; Check if we are comming from user mode.
+       ;;
+       LDW     .D2T2   *+SP(REGS_TSR+8),B0
+       MVK     .S2     0x40,B1
+       NOP     3
+       AND     .D2     B0,B1,B0
+ [!B0] BNOP    .S2     resume_kernel,5
+
+resume_userspace:
+       ;; make sure we don't miss an interrupt setting need_resched or
+       ;; sigpending between sampling and the rti
+       MASK_INT B2
+       GET_THREAD_INFO A12
+       LDW     .D1T1   *+A12(THREAD_INFO_FLAGS),A2
+       MVK     .S1     _TIF_WORK_MASK,A1
+       MVK     .S1     _TIF_NEED_RESCHED,A3
+       NOP     2
+       AND     .D1     A1,A2,A0
+ [A0]  BNOP    .S1     work_pending,5
+       BNOP    .S1     restore_all,5
+
+       ;;
+       ;; System call handling
+       ;; B0 = syscall number (in sys_call_table)
+       ;; A4,B4,A6,B6,A8,B8 = arguments of the syscall function
+       ;; A4 is the return value register
+       ;;
+system_call_saved:
+       MVK     .L2     1,B2
+       STW     .D2T2   B2,*+SP(REGS__END+8)    ; set syscall flag
+       MVC     .S2     B2,ECR                  ; ack the software exception
+
+       UNMASK_INT B2                   ; re-enable global IT
+
+system_call_saved_noack:
+       ;; Check system call number
+       MVK     .S2     __NR_syscalls,B1
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     sys_ni_syscall,A0
+#endif
+       CMPLTU  .L2     B0,B1,B1
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKH    .S1     sys_ni_syscall,A0
+#endif
+
+       ;; Check for ptrace
+       GET_THREAD_INFO A12
+
+#ifdef CONFIG_C6X_BIG_KERNEL
+ [!B1] B       .S2X    A0
+#else
+ [!B1] B       .S2     sys_ni_syscall
+#endif
+ [!B1] ADDKPC  .S2     ret_from_syscall_function,B3,4
+
+       ;; Get syscall handler addr from sys_call_table
+       ;; call tracesys_on or call syscall handler
+       LDW     .D1T1   *+A12(THREAD_INFO_FLAGS),A2
+ ||    MVKL    .S2     sys_call_table,B1
+       MVKH    .S2     sys_call_table,B1
+       LDW     .D2T2   *+B1[B0],B0
+       NOP     2
+       ; A2 = thread_info flags
+       AND     .D1     _TIF_SYSCALL_TRACE,A2,A2
+ [A2]  BNOP    .S1     tracesys_on,5
+       ;; B0 = _sys_call_table[__NR_*]
+       B       .S2     B0
+       ADDKPC  .S2     ret_from_syscall_function,B3,4
+
+ret_from_syscall_function:
+       STW     .D2T1   A4,*+SP(REGS_A4+8)      ; save return value in A4
+                                               ; original A4 is in orig_A4
+syscall_exit:
+       ;; make sure we don't miss an interrupt setting need_resched or
+       ;; sigpending between sampling and the rti
+       MASK_INT B2
+       LDW     .D1T1   *+A12(THREAD_INFO_FLAGS),A2
+       MVK     .S1     _TIF_ALLWORK_MASK,A1
+       NOP     3
+       AND     .D1     A1,A2,A2 ; check for work to do
+ [A2]  BNOP    .S1     syscall_exit_work,5
+
+restore_all:
+       RESTORE_ALL NRP,NTSR
+
+       ;;
+       ;; After a fork we jump here directly from resume,
+       ;; so that A4 contains the previous task structure.
+       ;;
+ENTRY(ret_from_fork)
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     schedule_tail,A0
+       MVKH    .S1     schedule_tail,A0
+       B       .S2X    A0
+#else
+       B       .S2     schedule_tail
+#endif
+       ADDKPC  .S2     ret_from_fork_2,B3,4
+ret_from_fork_2:
+       ;; return 0 in A4 for child process
+       GET_THREAD_INFO A12
+       BNOP    .S2     syscall_exit,3
+       MVK     .L2     0,B0
+       STW     .D2T2   B0,*+SP(REGS_A4+8)
+ENDPROC(ret_from_fork)
+
+       ;;
+       ;; These are the interrupt handlers, responsible for calling __do_IRQ()
+       ;; int6 is used for syscalls (see _system_call entry)
+       ;;
+       .macro SAVE_ALL_INT
+       SAVE_ALL IRP,ITSR
+       .endm
+
+       .macro CALL_INT int
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     c6x_do_IRQ,A0
+       MVKH    .S1     c6x_do_IRQ,A0
+       BNOP    .S2X    A0,1
+       MVK     .S1     int,A4
+       ADDAW   .D2     SP,2,B4
+       MVKL    .S2     ret_from_interrupt,B3
+       MVKH    .S2     ret_from_interrupt,B3
+#else
+       CALLP   .S2     c6x_do_IRQ,B3
+ ||    MVK     .S1     int,A4
+ ||    ADDAW   .D2     SP,2,B4
+       B       .S1     ret_from_interrupt
+       NOP     5
+#endif
+       .endm
+
+ENTRY(_int4_handler)
+       SAVE_ALL_INT
+       CALL_INT 4
+ENDPROC(_int4_handler)
+
+ENTRY(_int5_handler)
+       SAVE_ALL_INT
+       CALL_INT 5
+ENDPROC(_int5_handler)
+
+ENTRY(_int6_handler)
+       SAVE_ALL_INT
+       CALL_INT 6
+ENDPROC(_int6_handler)
+
+ENTRY(_int7_handler)
+       SAVE_ALL_INT
+       CALL_INT 7
+ENDPROC(_int7_handler)
+
+ENTRY(_int8_handler)
+       SAVE_ALL_INT
+       CALL_INT 8
+ENDPROC(_int8_handler)
+
+ENTRY(_int9_handler)
+       SAVE_ALL_INT
+       CALL_INT 9
+ENDPROC(_int9_handler)
+
+ENTRY(_int10_handler)
+       SAVE_ALL_INT
+       CALL_INT 10
+ENDPROC(_int10_handler)
+
+ENTRY(_int11_handler)
+       SAVE_ALL_INT
+       CALL_INT 11
+ENDPROC(_int11_handler)
+
+ENTRY(_int12_handler)
+       SAVE_ALL_INT
+       CALL_INT 12
+ENDPROC(_int12_handler)
+
+ENTRY(_int13_handler)
+       SAVE_ALL_INT
+       CALL_INT 13
+ENDPROC(_int13_handler)
+
+ENTRY(_int14_handler)
+       SAVE_ALL_INT
+       CALL_INT 14
+ENDPROC(_int14_handler)
+
+ENTRY(_int15_handler)
+       SAVE_ALL_INT
+       CALL_INT 15
+ENDPROC(_int15_handler)
+
+       ;;
+       ;; Handler for uninitialized and spurious interrupts
+       ;;
+ENTRY(_bad_interrupt)
+       B       .S2     IRP
+       NOP     5
+ENDPROC(_bad_interrupt)
+
+       ;;
+       ;; Entry for NMI/exceptions/syscall
+       ;;
+ENTRY(_nmi_handler)
+       SAVE_ALL NRP,NTSR
+
+       MVC     .S2     EFR,B2
+       CMPEQ   .L2     1,B2,B2
+ ||    MVC     .S2     TSR,B1
+       CLR     .S2     B1,10,10,B1
+       MVC     .S2     B1,TSR
+#ifdef CONFIG_C6X_BIG_KERNEL
+ [!B2] MVKL    .S1     process_exception,A0
+ [!B2] MVKH    .S1     process_exception,A0
+ [!B2] B       .S2X    A0
+#else
+ [!B2] B       .S2     process_exception
+#endif
+ [B2]  B       .S2     system_call_saved
+ [!B2] ADDAW   .D2     SP,2,B1
+ [!B2] MV      .D1X    B1,A4
+       ADDKPC  .S2     ret_from_trap,B3,2
+
+ret_from_trap:
+       MV      .D2X    A4,B0
+ [!B0] BNOP    .S2     ret_from_exception,5
+
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S2     system_call_saved_noack,B3
+       MVKH    .S2     system_call_saved_noack,B3
+#endif
+       LDW     .D2T2   *+SP(REGS_B0+8),B0
+       LDW     .D2T1   *+SP(REGS_A4+8),A4
+       LDW     .D2T2   *+SP(REGS_B4+8),B4
+       LDW     .D2T1   *+SP(REGS_A6+8),A6
+       LDW     .D2T2   *+SP(REGS_B6+8),B6
+       LDW     .D2T1   *+SP(REGS_A8+8),A8
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    B       .S2     B3
+#else
+ ||    B       .S2     system_call_saved_noack
+#endif
+       LDW     .D2T2   *+SP(REGS_B8+8),B8
+       NOP     4
+ENDPROC(_nmi_handler)
+
+       ;;
+       ;; Jump to schedule() then return to ret_from_isr
+       ;;
+#ifdef CONFIG_PREEMPT
+resume_kernel:
+       GET_THREAD_INFO A12
+       LDW     .D1T1   *+A12(THREAD_INFO_PREEMPT_COUNT),A1
+       NOP     4
+ [A1]  BNOP    .S2     restore_all,5
+
+preempt_schedule:
+       GET_THREAD_INFO A2
+       LDW     .D1T1   *+A2(THREAD_INFO_FLAGS),A1
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S2     preempt_schedule_irq,B0
+       MVKH    .S2     preempt_schedule_irq,B0
+       NOP     2
+#else
+       NOP     4
+#endif
+       AND     .D1     _TIF_NEED_RESCHED,A1,A1
+ [!A1] BNOP    .S2     restore_all,5
+#ifdef CONFIG_C6X_BIG_KERNEL
+       B       .S2     B0
+#else
+       B       .S2     preempt_schedule_irq
+#endif
+       ADDKPC  .S2     preempt_schedule,B3,4
+#endif /* CONFIG_PREEMPT */
+
+ENTRY(enable_exception)
+       DINT
+       MVC     .S2     TSR,B0
+       MVC     .S2     B3,NRP
+       MVK     .L2     0xc,B1
+       OR      .D2     B0,B1,B0
+       MVC     .S2     B0,TSR                  ;  Set GEE and XEN in TSR
+       B       .S2     NRP
+       NOP     5
+ENDPROC(enable_exception)
+
+ENTRY(sys_sigaltstack)
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     do_sigaltstack,A0       ; branch to do_sigaltstack
+       MVKH    .S1     do_sigaltstack,A0
+       B       .S2X    A0
+#else
+       B       .S2     do_sigaltstack
+#endif
+       LDW     .D2T1   *+SP(REGS_SP+8),A6
+       NOP     4
+ENDPROC(sys_sigaltstack)
+
+       ;; kernel_execve
+ENTRY(kernel_execve)
+       MVK     .S2     __NR_execve,B0
+       SWE
+       BNOP    .S2     B3,5
+ENDPROC(kernel_execve)
+
+       ;;
+       ;; Special system calls
+       ;; return address is in B3
+       ;;
+ENTRY(sys_clone)
+       ADD     .D1X    SP,8,A4
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     sys_c6x_clone,A0
+       MVKH    .S1     sys_c6x_clone,A0
+       BNOP    .S2X    A0,5
+#else
+ ||    B       .S2     sys_c6x_clone
+       NOP     5
+#endif
+ENDPROC(sys_clone)
+
+ENTRY(sys_rt_sigreturn)
+       ADD     .D1X    SP,8,A4
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     do_rt_sigreturn,A0
+       MVKH    .S1     do_rt_sigreturn,A0
+       BNOP    .S2X    A0,5
+#else
+ ||    B       .S2     do_rt_sigreturn
+       NOP     5
+#endif
+ENDPROC(sys_rt_sigreturn)
+
+ENTRY(sys_execve)
+       ADDAW   .D2     SP,2,B6         ; put regs addr in 4th parameter
+                                       ; & adjust regs stack addr
+       LDW     .D2T2   *+SP(REGS_B4+8),B4
+
+       ;; c6x_execve(char *name, char **argv,
+       ;;            char **envp, struct pt_regs *regs)
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     sys_c6x_execve,A0
+       MVKH    .S1     sys_c6x_execve,A0
+       B       .S2X    A0
+#else
+ ||    B       .S2     sys_c6x_execve
+#endif
+       STW     .D2T2   B3,*SP--[2]
+       ADDKPC  .S2     ret_from_c6x_execve,B3,3
+
+ret_from_c6x_execve:
+       LDW     .D2T2   *++SP[2],B3
+       NOP     4
+       BNOP    .S2     B3,5
+ENDPROC(sys_execve)
+
+ENTRY(sys_pread_c6x)
+       MV      .D2X    A8,B7
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     sys_pread64,A0
+       MVKH    .S1     sys_pread64,A0
+       BNOP    .S2X    A0,5
+#else
+ ||    B       .S2     sys_pread64
+       NOP     5
+#endif
+ENDPROC(sys_pread_c6x)
+
+ENTRY(sys_pwrite_c6x)
+       MV      .D2X    A8,B7
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     sys_pwrite64,A0
+       MVKH    .S1     sys_pwrite64,A0
+       BNOP    .S2X    A0,5
+#else
+ ||    B       .S2     sys_pwrite64
+       NOP     5
+#endif
+ENDPROC(sys_pwrite_c6x)
+
+;; On Entry
+;;   A4 - path
+;;   B4 - offset_lo (LE), offset_hi (BE)
+;;   A6 - offset_lo (BE), offset_hi (LE)
+ENTRY(sys_truncate64_c6x)
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       MV      .S2     B4,B5
+       MV      .D2X    A6,B4
+#else
+       MV      .D2X    A6,B5
+#endif
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     sys_truncate64,A0
+       MVKH    .S1     sys_truncate64,A0
+       BNOP    .S2X    A0,5
+#else
+ ||    B       .S2     sys_truncate64
+       NOP     5
+#endif
+ENDPROC(sys_truncate64_c6x)
+
+;; On Entry
+;;   A4 - fd
+;;   B4 - offset_lo (LE), offset_hi (BE)
+;;   A6 - offset_lo (BE), offset_hi (LE)
+ENTRY(sys_ftruncate64_c6x)
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       MV      .S2     B4,B5
+       MV      .D2X    A6,B4
+#else
+       MV      .D2X    A6,B5
+#endif
+#ifdef CONFIG_C6X_BIG_KERNEL
+ ||    MVKL    .S1     sys_ftruncate64,A0
+       MVKH    .S1     sys_ftruncate64,A0
+       BNOP    .S2X    A0,5
+#else
+ ||    B       .S2     sys_ftruncate64
+       NOP     5
+#endif
+ENDPROC(sys_ftruncate64_c6x)
+
+#ifdef __ARCH_WANT_SYSCALL_OFF_T
+;; On Entry
+;;   A4 - fd
+;;   B4 - offset_lo (LE), offset_hi (BE)
+;;   A6 - offset_lo (BE), offset_hi (LE)
+;;   B6 - len
+;;   A8 - advice
+ENTRY(sys_fadvise64_c6x)
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     sys_fadvise64,A0
+       MVKH    .S1     sys_fadvise64,A0
+       BNOP    .S2X    A0,2
+#else
+       B       .S2     sys_fadvise64
+       NOP     2
+#endif
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       MV      .L2     B4,B5
+ ||    MV      .D2X    A6,B4
+#else
+       MV      .D2X    A6,B5
+#endif
+       MV      .D1X    B6,A6
+       MV      .D2X    A8,B6
+#endif
+ENDPROC(sys_fadvise64_c6x)
+
+;; On Entry
+;;   A4 - fd
+;;   B4 - offset_lo (LE), offset_hi (BE)
+;;   A6 - offset_lo (BE), offset_hi (LE)
+;;   B6 - len_lo (LE), len_hi (BE)
+;;   A8 - len_lo (BE), len_hi (LE)
+;;   B8 - advice
+ENTRY(sys_fadvise64_64_c6x)
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     sys_fadvise64_64,A0
+       MVKH    .S1     sys_fadvise64_64,A0
+       BNOP    .S2X    A0,2
+#else
+       B       .S2     sys_fadvise64_64
+       NOP     2
+#endif
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       MV      .L2     B4,B5
+ ||    MV      .D2X    A6,B4
+       MV      .L1     A8,A6
+ ||    MV      .D1X    B6,A7
+#else
+       MV      .D2X    A6,B5
+       MV      .L1     A8,A7
+ ||    MV      .D1X    B6,A6
+#endif
+       MV      .L2     B8,B6
+ENDPROC(sys_fadvise64_64_c6x)
+
+;; On Entry
+;;   A4 - fd
+;;   B4 - mode
+;;   A6 - offset_hi
+;;   B6 - offset_lo
+;;   A8 - len_hi
+;;   B8 - len_lo
+ENTRY(sys_fallocate_c6x)
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     sys_fallocate,A0
+       MVKH    .S1     sys_fallocate,A0
+       BNOP    .S2X    A0,1
+#else
+       B       .S2     sys_fallocate
+       NOP
+#endif
+       MV      .D1     A6,A7
+       MV      .D1X    B6,A6
+       MV      .D2X    A8,B7
+       MV      .D2     B8,B6
+ENDPROC(sys_fallocate_c6x)
+
+       ;; put this in .neardata for faster access when using DSBT mode
+       .section .neardata,"aw",@progbits
+       .global current_ksp
+       .hidden current_ksp
+current_ksp:
+       .word   init_thread_union + THREAD_START_SP
diff --git a/arch/c6x/kernel/head.S b/arch/c6x/kernel/head.S
new file mode 100644 (file)
index 0000000..133eab6
--- /dev/null
@@ -0,0 +1,84 @@
+;
+;  Port on Texas Instruments TMS320C6x architecture
+;
+;  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+;  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+;
+;  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/linkage.h>
+#include <linux/of_fdt.h>
+#include <asm/asm-offsets.h>
+
+       __HEAD
+ENTRY(_c_int00)
+       ;; Save magic and pointer
+       MV      .S1     A4,A10
+       MV      .S2     B4,B10
+       MVKL    .S2     __bss_start,B5
+       MVKH    .S2     __bss_start,B5
+       MVKL    .S2     __bss_stop,B6
+       MVKH    .S2     __bss_stop,B6
+       SUB     .L2     B6,B5,B6 ; bss size
+
+       ;; Set the stack pointer
+       MVKL    .S2     current_ksp,B0
+       MVKH    .S2     current_ksp,B0
+       LDW     .D2T2   *B0,B15
+
+       ;; clear bss
+       SHR     .S2     B6,3,B0   ; number of dwords to clear
+       ZERO    .L2     B13
+       ZERO    .L2     B12
+bss_loop:
+       BDEC    .S2     bss_loop,B0
+       NOP     3
+       CMPLT   .L2     B0,0,B1
+ [!B1] STDW    .D2T2   B13:B12,*B5++[1]
+
+       NOP     4
+       AND     .D2     ~7,B15,B15
+
+       ;; Clear GIE and PGIE
+       MVC     .S2     CSR,B2
+       CLR     .S2     B2,0,1,B2
+       MVC     .S2     B2,CSR
+       MVC     .S2     TSR,B2
+       CLR     .S2     B2,0,1,B2
+       MVC     .S2     B2,TSR
+       MVC     .S2     ITSR,B2
+       CLR     .S2     B2,0,1,B2
+       MVC     .S2     B2,ITSR
+       MVC     .S2     NTSR,B2
+       CLR     .S2     B2,0,1,B2
+       MVC     .S2     B2,NTSR
+
+       ;; pass DTB pointer to machine_init (or zero if none)
+       MVKL    .S1     OF_DT_HEADER,A0
+       MVKH    .S1     OF_DT_HEADER,A0
+       CMPEQ   .L1     A10,A0,A0
+  [A0] MV      .S1X    B10,A4
+  [!A0] MVK    .S1     0,A4
+
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     machine_init,A0
+       MVKH    .S1     machine_init,A0
+       B       .S2X    A0
+       ADDKPC  .S2     0f,B3,4
+0:
+#else
+       CALLP   .S2     machine_init,B3
+#endif
+
+       ;; Jump to Linux init
+#ifdef CONFIG_C6X_BIG_KERNEL
+       MVKL    .S1     start_kernel,A0
+       MVKH    .S1     start_kernel,A0
+       B       .S2X    A0
+#else
+       B       .S2     start_kernel
+#endif
+       NOP     5
+L1:    BNOP    .S2     L1,5
diff --git a/arch/c6x/kernel/irq.c b/arch/c6x/kernel/irq.c
new file mode 100644 (file)
index 0000000..0929e4b
--- /dev/null
@@ -0,0 +1,728 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ *  This borrows heavily from powerpc version, which is:
+ *
+ *  Derived from arch/i386/kernel/irq.c
+ *    Copyright (C) 1992 Linus Torvalds
+ *  Adapted from arch/i386 by Gary Thomas
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *  Updated and modified by Cort Dougan <cort@fsmlabs.com>
+ *    Copyright (C) 1996-2001 Cort Dougan
+ *  Adapted for Power Macintosh by Paul Mackerras
+ *    Copyright (C) 1996 Paul Mackerras (paulus@cs.anu.edu.au)
+ *
+ * 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.
+ */
+#include <linux/slab.h>
+#include <linux/seq_file.h>
+#include <linux/radix-tree.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
+
+#include <asm/megamod-pic.h>
+
+unsigned long irq_err_count;
+
+static DEFINE_RAW_SPINLOCK(core_irq_lock);
+
+static void mask_core_irq(struct irq_data *data)
+{
+       unsigned int prio = data->irq;
+
+       BUG_ON(prio < 4 || prio >= NR_PRIORITY_IRQS);
+
+       raw_spin_lock(&core_irq_lock);
+       and_creg(IER, ~(1 << prio));
+       raw_spin_unlock(&core_irq_lock);
+}
+
+static void unmask_core_irq(struct irq_data *data)
+{
+       unsigned int prio = data->irq;
+
+       raw_spin_lock(&core_irq_lock);
+       or_creg(IER, 1 << prio);
+       raw_spin_unlock(&core_irq_lock);
+}
+
+static struct irq_chip core_chip = {
+       .name           = "core",
+       .irq_mask       = mask_core_irq,
+       .irq_unmask     = unmask_core_irq,
+};
+
+asmlinkage void c6x_do_IRQ(unsigned int prio, struct pt_regs *regs)
+{
+       struct pt_regs *old_regs = set_irq_regs(regs);
+
+       irq_enter();
+
+       BUG_ON(prio < 4 || prio >= NR_PRIORITY_IRQS);
+
+       generic_handle_irq(prio);
+
+       irq_exit();
+
+       set_irq_regs(old_regs);
+}
+
+static struct irq_host *core_host;
+
+static int core_host_map(struct irq_host *h, unsigned int virq,
+                        irq_hw_number_t hw)
+{
+       if (hw < 4 || hw >= NR_PRIORITY_IRQS)
+               return -EINVAL;
+
+       irq_set_status_flags(virq, IRQ_LEVEL);
+       irq_set_chip_and_handler(virq, &core_chip, handle_level_irq);
+       return 0;
+}
+
+static struct irq_host_ops core_host_ops = {
+       .map = core_host_map,
+};
+
+void __init init_IRQ(void)
+{
+       struct device_node *np;
+
+       /* Mask all priority IRQs */
+       and_creg(IER, ~0xfff0);
+
+       np = of_find_compatible_node(NULL, NULL, "ti,c64x+core-pic");
+       if (np != NULL) {
+               /* create the core host */
+               core_host = irq_alloc_host(np, IRQ_HOST_MAP_PRIORITY, 0,
+                                          &core_host_ops, 0);
+               if (core_host)
+                       irq_set_default_host(core_host);
+               of_node_put(np);
+       }
+
+       printk(KERN_INFO "Core interrupt controller initialized\n");
+
+       /* now we're ready for other SoC controllers */
+       megamod_pic_init();
+
+       /* Clear all general IRQ flags */
+       set_creg(ICR, 0xfff0);
+}
+
+void ack_bad_irq(int irq)
+{
+       printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
+       irq_err_count++;
+}
+
+int arch_show_interrupts(struct seq_file *p, int prec)
+{
+       seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
+       return 0;
+}
+
+/*
+ * IRQ controller and virtual interrupts
+ */
+
+/* The main irq map itself is an array of NR_IRQ entries containing the
+ * associate host and irq number. An entry with a host of NULL is free.
+ * An entry can be allocated if it's free, the allocator always then sets
+ * hwirq first to the host's invalid irq number and then fills ops.
+ */
+struct irq_map_entry {
+       irq_hw_number_t hwirq;
+       struct irq_host *host;
+};
+
+static LIST_HEAD(irq_hosts);
+static DEFINE_RAW_SPINLOCK(irq_big_lock);
+static DEFINE_MUTEX(revmap_trees_mutex);
+static struct irq_map_entry irq_map[NR_IRQS];
+static unsigned int irq_virq_count = NR_IRQS;
+static struct irq_host *irq_default_host;
+
+irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
+{
+       return irq_map[d->irq].hwirq;
+}
+EXPORT_SYMBOL_GPL(irqd_to_hwirq);
+
+irq_hw_number_t virq_to_hw(unsigned int virq)
+{
+       return irq_map[virq].hwirq;
+}
+EXPORT_SYMBOL_GPL(virq_to_hw);
+
+bool virq_is_host(unsigned int virq, struct irq_host *host)
+{
+       return irq_map[virq].host == host;
+}
+EXPORT_SYMBOL_GPL(virq_is_host);
+
+static int default_irq_host_match(struct irq_host *h, struct device_node *np)
+{
+       return h->of_node != NULL && h->of_node == np;
+}
+
+struct irq_host *irq_alloc_host(struct device_node *of_node,
+                               unsigned int revmap_type,
+                               unsigned int revmap_arg,
+                               struct irq_host_ops *ops,
+                               irq_hw_number_t inval_irq)
+{
+       struct irq_host *host;
+       unsigned int size = sizeof(struct irq_host);
+       unsigned int i;
+       unsigned int *rmap;
+       unsigned long flags;
+
+       /* Allocate structure and revmap table if using linear mapping */
+       if (revmap_type == IRQ_HOST_MAP_LINEAR)
+               size += revmap_arg * sizeof(unsigned int);
+       host = kzalloc(size, GFP_KERNEL);
+       if (host == NULL)
+               return NULL;
+
+       /* Fill structure */
+       host->revmap_type = revmap_type;
+       host->inval_irq = inval_irq;
+       host->ops = ops;
+       host->of_node = of_node_get(of_node);
+
+       if (host->ops->match == NULL)
+               host->ops->match = default_irq_host_match;
+
+       raw_spin_lock_irqsave(&irq_big_lock, flags);
+
+       /* Check for the priority controller. */
+       if (revmap_type == IRQ_HOST_MAP_PRIORITY) {
+               if (irq_map[0].host != NULL) {
+                       raw_spin_unlock_irqrestore(&irq_big_lock, flags);
+                       of_node_put(host->of_node);
+                       kfree(host);
+                       return NULL;
+               }
+               irq_map[0].host = host;
+       }
+
+       list_add(&host->link, &irq_hosts);
+       raw_spin_unlock_irqrestore(&irq_big_lock, flags);
+
+       /* Additional setups per revmap type */
+       switch (revmap_type) {
+       case IRQ_HOST_MAP_PRIORITY:
+               /* 0 is always the invalid number for priority */
+               host->inval_irq = 0;
+               /* setup us as the host for all priority interrupts */
+               for (i = 1; i < NR_PRIORITY_IRQS; i++) {
+                       irq_map[i].hwirq = i;
+                       smp_wmb();
+                       irq_map[i].host = host;
+                       smp_wmb();
+
+                       ops->map(host, i, i);
+               }
+               break;
+       case IRQ_HOST_MAP_LINEAR:
+               rmap = (unsigned int *)(host + 1);
+               for (i = 0; i < revmap_arg; i++)
+                       rmap[i] = NO_IRQ;
+               host->revmap_data.linear.size = revmap_arg;
+               smp_wmb();
+               host->revmap_data.linear.revmap = rmap;
+               break;
+       case IRQ_HOST_MAP_TREE:
+               INIT_RADIX_TREE(&host->revmap_data.tree, GFP_KERNEL);
+               break;
+       default:
+               break;
+       }
+
+       pr_debug("irq: Allocated host of type %d @0x%p\n", revmap_type, host);
+
+       return host;
+}
+
+struct irq_host *irq_find_host(struct device_node *node)
+{
+       struct irq_host *h, *found = NULL;
+       unsigned long flags;
+
+       /* We might want to match the legacy controller last since
+        * it might potentially be set to match all interrupts in
+        * the absence of a device node. This isn't a problem so far
+        * yet though...
+        */
+       raw_spin_lock_irqsave(&irq_big_lock, flags);
+       list_for_each_entry(h, &irq_hosts, link)
+               if (h->ops->match(h, node)) {
+                       found = h;
+                       break;
+               }
+       raw_spin_unlock_irqrestore(&irq_big_lock, flags);
+       return found;
+}
+EXPORT_SYMBOL_GPL(irq_find_host);
+
+void irq_set_default_host(struct irq_host *host)
+{
+       pr_debug("irq: Default host set to @0x%p\n", host);
+
+       irq_default_host = host;
+}
+
+void irq_set_virq_count(unsigned int count)
+{
+       pr_debug("irq: Trying to set virq count to %d\n", count);
+
+       BUG_ON(count < NR_PRIORITY_IRQS);
+       if (count < NR_IRQS)
+               irq_virq_count = count;
+}
+
+static int irq_setup_virq(struct irq_host *host, unsigned int virq,
+                           irq_hw_number_t hwirq)
+{
+       int res;
+
+       res = irq_alloc_desc_at(virq, 0);
+       if (res != virq) {
+               pr_debug("irq: -> allocating desc failed\n");
+               goto error;
+       }
+
+       /* map it */
+       smp_wmb();
+       irq_map[virq].hwirq = hwirq;
+       smp_mb();
+
+       if (host->ops->map(host, virq, hwirq)) {
+               pr_debug("irq: -> mapping failed, freeing\n");
+               goto errdesc;
+       }
+
+       irq_clear_status_flags(virq, IRQ_NOREQUEST);
+
+       return 0;
+
+errdesc:
+       irq_free_descs(virq, 1);
+error:
+       irq_free_virt(virq, 1);
+       return -1;
+}
+
+unsigned int irq_create_direct_mapping(struct irq_host *host)
+{
+       unsigned int virq;
+
+       if (host == NULL)
+               host = irq_default_host;
+
+       BUG_ON(host == NULL);
+       WARN_ON(host->revmap_type != IRQ_HOST_MAP_NOMAP);
+
+       virq = irq_alloc_virt(host, 1, 0);
+       if (virq == NO_IRQ) {
+               pr_debug("irq: create_direct virq allocation failed\n");
+               return NO_IRQ;
+       }
+
+       pr_debug("irq: create_direct obtained virq %d\n", virq);
+
+       if (irq_setup_virq(host, virq, virq))
+               return NO_IRQ;
+
+       return virq;
+}
+
+unsigned int irq_create_mapping(struct irq_host *host,
+                               irq_hw_number_t hwirq)
+{
+       unsigned int virq, hint;
+
+       pr_debug("irq: irq_create_mapping(0x%p, 0x%lx)\n", host, hwirq);
+
+       /* Look for default host if nececssary */
+       if (host == NULL)
+               host = irq_default_host;
+       if (host == NULL) {
+               printk(KERN_WARNING "irq_create_mapping called for"
+                      " NULL host, hwirq=%lx\n", hwirq);
+               WARN_ON(1);
+               return NO_IRQ;
+       }
+       pr_debug("irq: -> using host @%p\n", host);
+
+       /* Check if mapping already exists */
+       virq = irq_find_mapping(host, hwirq);
+       if (virq != NO_IRQ) {
+               pr_debug("irq: -> existing mapping on virq %d\n", virq);
+               return virq;
+       }
+
+       /* Allocate a virtual interrupt number */
+       hint = hwirq % irq_virq_count;
+       virq = irq_alloc_virt(host, 1, hint);
+       if (virq == NO_IRQ) {
+               pr_debug("irq: -> virq allocation failed\n");
+               return NO_IRQ;
+       }
+
+       if (irq_setup_virq(host, virq, hwirq))
+               return NO_IRQ;
+
+       pr_debug("irq: irq %lu on host %s mapped to virtual irq %u\n",
+               hwirq, host->of_node ? host->of_node->full_name : "null", virq);
+
+       return virq;
+}
+EXPORT_SYMBOL_GPL(irq_create_mapping);
+
+unsigned int irq_create_of_mapping(struct device_node *controller,
+                                  const u32 *intspec, unsigned int intsize)
+{
+       struct irq_host *host;
+       irq_hw_number_t hwirq;
+       unsigned int type = IRQ_TYPE_NONE;
+       unsigned int virq;
+
+       if (controller == NULL)
+               host = irq_default_host;
+       else
+               host = irq_find_host(controller);
+       if (host == NULL) {
+               printk(KERN_WARNING "irq: no irq host found for %s !\n",
+                      controller->full_name);
+               return NO_IRQ;
+       }
+
+       /* If host has no translation, then we assume interrupt line */
+       if (host->ops->xlate == NULL)
+               hwirq = intspec[0];
+       else {
+               if (host->ops->xlate(host, controller, intspec, intsize,
+                                    &hwirq, &type))
+                       return NO_IRQ;
+       }
+
+       /* Create mapping */
+       virq = irq_create_mapping(host, hwirq);
+       if (virq == NO_IRQ)
+               return virq;
+
+       /* Set type if specified and different than the current one */
+       if (type != IRQ_TYPE_NONE &&
+           type != (irqd_get_trigger_type(irq_get_irq_data(virq))))
+               irq_set_irq_type(virq, type);
+       return virq;
+}
+EXPORT_SYMBOL_GPL(irq_create_of_mapping);
+
+void irq_dispose_mapping(unsigned int virq)
+{
+       struct irq_host *host;
+       irq_hw_number_t hwirq;
+
+       if (virq == NO_IRQ)
+               return;
+
+       /* Never unmap priority interrupts */
+       if (virq < NR_PRIORITY_IRQS)
+               return;
+
+       host = irq_map[virq].host;
+       if (WARN_ON(host == NULL))
+               return;
+
+       irq_set_status_flags(virq, IRQ_NOREQUEST);
+
+       /* remove chip and handler */
+       irq_set_chip_and_handler(virq, NULL, NULL);
+
+       /* Make sure it's completed */
+       synchronize_irq(virq);
+
+       /* Tell the PIC about it */
+       if (host->ops->unmap)
+               host->ops->unmap(host, virq);
+       smp_mb();
+
+       /* Clear reverse map */
+       hwirq = irq_map[virq].hwirq;
+       switch (host->revmap_type) {
+       case IRQ_HOST_MAP_LINEAR:
+               if (hwirq < host->revmap_data.linear.size)
+                       host->revmap_data.linear.revmap[hwirq] = NO_IRQ;
+               break;
+       case IRQ_HOST_MAP_TREE:
+               mutex_lock(&revmap_trees_mutex);
+               radix_tree_delete(&host->revmap_data.tree, hwirq);
+               mutex_unlock(&revmap_trees_mutex);
+               break;
+       }
+
+       /* Destroy map */
+       smp_mb();
+       irq_map[virq].hwirq = host->inval_irq;
+
+       irq_free_descs(virq, 1);
+       /* Free it */
+       irq_free_virt(virq, 1);
+}
+EXPORT_SYMBOL_GPL(irq_dispose_mapping);
+
+unsigned int irq_find_mapping(struct irq_host *host,
+                             irq_hw_number_t hwirq)
+{
+       unsigned int i;
+       unsigned int hint = hwirq % irq_virq_count;
+
+       /* Look for default host if nececssary */
+       if (host == NULL)
+               host = irq_default_host;
+       if (host == NULL)
+               return NO_IRQ;
+
+       /* Slow path does a linear search of the map */
+       i = hint;
+       do  {
+               if (irq_map[i].host == host &&
+                   irq_map[i].hwirq == hwirq)
+                       return i;
+               i++;
+               if (i >= irq_virq_count)
+                       i = 4;
+       } while (i != hint);
+       return NO_IRQ;
+}
+EXPORT_SYMBOL_GPL(irq_find_mapping);
+
+unsigned int irq_radix_revmap_lookup(struct irq_host *host,
+                                    irq_hw_number_t hwirq)
+{
+       struct irq_map_entry *ptr;
+       unsigned int virq;
+
+       if (WARN_ON_ONCE(host->revmap_type != IRQ_HOST_MAP_TREE))
+               return irq_find_mapping(host, hwirq);
+
+       /*
+        * The ptr returned references the static global irq_map.
+        * but freeing an irq can delete nodes along the path to
+        * do the lookup via call_rcu.
+        */
+       rcu_read_lock();
+       ptr = radix_tree_lookup(&host->revmap_data.tree, hwirq);
+       rcu_read_unlock();
+
+       /*
+        * If found in radix tree, then fine.
+        * Else fallback to linear lookup - this should not happen in practice
+        * as it means that we failed to insert the node in the radix tree.
+        */
+       if (ptr)
+               virq = ptr - irq_map;
+       else
+               virq = irq_find_mapping(host, hwirq);
+
+       return virq;
+}
+
+void irq_radix_revmap_insert(struct irq_host *host, unsigned int virq,
+                            irq_hw_number_t hwirq)
+{
+       if (WARN_ON(host->revmap_type != IRQ_HOST_MAP_TREE))
+               return;
+
+       if (virq != NO_IRQ) {
+               mutex_lock(&revmap_trees_mutex);
+               radix_tree_insert(&host->revmap_data.tree, hwirq,
+                                 &irq_map[virq]);
+               mutex_unlock(&revmap_trees_mutex);
+       }
+}
+
+unsigned int irq_linear_revmap(struct irq_host *host,
+                              irq_hw_number_t hwirq)
+{
+       unsigned int *revmap;
+
+       if (WARN_ON_ONCE(host->revmap_type != IRQ_HOST_MAP_LINEAR))
+               return irq_find_mapping(host, hwirq);
+
+       /* Check revmap bounds */
+       if (unlikely(hwirq >= host->revmap_data.linear.size))
+               return irq_find_mapping(host, hwirq);
+
+       /* Check if revmap was allocated */
+       revmap = host->revmap_data.linear.revmap;
+       if (unlikely(revmap == NULL))
+               return irq_find_mapping(host, hwirq);
+
+       /* Fill up revmap with slow path if no mapping found */
+       if (unlikely(revmap[hwirq] == NO_IRQ))
+               revmap[hwirq] = irq_find_mapping(host, hwirq);
+
+       return revmap[hwirq];
+}
+
+unsigned int irq_alloc_virt(struct irq_host *host,
+                           unsigned int count,
+                           unsigned int hint)
+{
+       unsigned long flags;
+       unsigned int i, j, found = NO_IRQ;
+
+       if (count == 0 || count > (irq_virq_count - NR_PRIORITY_IRQS))
+               return NO_IRQ;
+
+       raw_spin_lock_irqsave(&irq_big_lock, flags);
+
+       /* Use hint for 1 interrupt if any */
+       if (count == 1 && hint >= NR_PRIORITY_IRQS &&
+           hint < irq_virq_count && irq_map[hint].host == NULL) {
+               found = hint;
+               goto hint_found;
+       }
+
+       /* Look for count consecutive numbers in the allocatable
+        * (non-legacy) space
+        */
+       for (i = NR_PRIORITY_IRQS, j = 0; i < irq_virq_count; i++) {
+               if (irq_map[i].host != NULL)
+                       j = 0;
+               else
+                       j++;
+
+               if (j == count) {
+                       found = i - count + 1;
+                       break;
+               }
+       }
+       if (found == NO_IRQ) {
+               raw_spin_unlock_irqrestore(&irq_big_lock, flags);
+               return NO_IRQ;
+       }
+ hint_found:
+       for (i = found; i < (found + count); i++) {
+               irq_map[i].hwirq = host->inval_irq;
+               smp_wmb();
+               irq_map[i].host = host;
+       }
+       raw_spin_unlock_irqrestore(&irq_big_lock, flags);
+       return found;
+}
+
+void irq_free_virt(unsigned int virq, unsigned int count)
+{
+       unsigned long flags;
+       unsigned int i;
+
+       WARN_ON(virq < NR_PRIORITY_IRQS);
+       WARN_ON(count == 0 || (virq + count) > irq_virq_count);
+
+       if (virq < NR_PRIORITY_IRQS) {
+               if (virq + count < NR_PRIORITY_IRQS)
+                       return;
+               count  -= NR_PRIORITY_IRQS - virq;
+               virq = NR_PRIORITY_IRQS;
+       }
+
+       if (count > irq_virq_count || virq > irq_virq_count - count) {
+               if (virq > irq_virq_count)
+                       return;
+               count = irq_virq_count - virq;
+       }
+
+       raw_spin_lock_irqsave(&irq_big_lock, flags);
+       for (i = virq; i < (virq + count); i++) {
+               struct irq_host *host;
+
+               host = irq_map[i].host;
+               irq_map[i].hwirq = host->inval_irq;
+               smp_wmb();
+               irq_map[i].host = NULL;
+       }
+       raw_spin_unlock_irqrestore(&irq_big_lock, flags);
+}
+
+#ifdef CONFIG_VIRQ_DEBUG
+static int virq_debug_show(struct seq_file *m, void *private)
+{
+       unsigned long flags;
+       struct irq_desc *desc;
+       const char *p;
+       static const char none[] = "none";
+       void *data;
+       int i;
+
+       seq_printf(m, "%-5s  %-7s  %-15s  %-18s  %s\n", "virq", "hwirq",
+                     "chip name", "chip data", "host name");
+
+       for (i = 1; i < nr_irqs; i++) {
+               desc = irq_to_desc(i);
+               if (!desc)
+                       continue;
+
+               raw_spin_lock_irqsave(&desc->lock, flags);
+
+               if (desc->action && desc->action->handler) {
+                       struct irq_chip *chip;
+
+                       seq_printf(m, "%5d  ", i);
+                       seq_printf(m, "0x%05lx  ", irq_map[i].hwirq);
+
+                       chip = irq_desc_get_chip(desc);
+                       if (chip && chip->name)
+                               p = chip->name;
+                       else
+                               p = none;
+                       seq_printf(m, "%-15s  ", p);
+
+                       data = irq_desc_get_chip_data(desc);
+                       seq_printf(m, "0x%16p  ", data);
+
+                       if (irq_map[i].host && irq_map[i].host->of_node)
+                               p = irq_map[i].host->of_node->full_name;
+                       else
+                               p = none;
+                       seq_printf(m, "%s\n", p);
+               }
+
+               raw_spin_unlock_irqrestore(&desc->lock, flags);
+       }
+
+       return 0;
+}
+
+static int virq_debug_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, virq_debug_show, inode->i_private);
+}
+
+static const struct file_operations virq_debug_fops = {
+       .open = virq_debug_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
+static int __init irq_debugfs_init(void)
+{
+       if (debugfs_create_file("virq_mapping", S_IRUGO, powerpc_debugfs_root,
+                                NULL, &virq_debug_fops) == NULL)
+               return -ENOMEM;
+
+       return 0;
+}
+device_initcall(irq_debugfs_init);
+#endif /* CONFIG_VIRQ_DEBUG */
diff --git a/arch/c6x/kernel/module.c b/arch/c6x/kernel/module.c
new file mode 100644 (file)
index 0000000..5fc03f1
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2005, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Thomas Charleux (thomas.charleux@jaluna.com)
+ *
+ *  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/moduleloader.h>
+#include <linux/elf.h>
+#include <linux/vmalloc.h>
+#include <linux/kernel.h>
+
+static inline int fixup_pcr(u32 *ip, Elf32_Addr dest, u32 maskbits, int shift)
+{
+       u32 opcode;
+       long ep = (long)ip & ~31;
+       long delta = ((long)dest - ep) >> 2;
+       long mask = (1 << maskbits) - 1;
+
+       if ((delta >> (maskbits - 1)) == 0 ||
+           (delta >> (maskbits - 1)) == -1) {
+               opcode = *ip;
+               opcode &= ~(mask << shift);
+               opcode |= ((delta & mask) << shift);
+               *ip = opcode;
+
+               pr_debug("REL PCR_S%d[%p] dest[%p] opcode[%08x]\n",
+                        maskbits, ip, (void *)dest, opcode);
+
+               return 0;
+       }
+       pr_err("PCR_S%d reloc %p -> %p out of range!\n",
+              maskbits, ip, (void *)dest);
+
+       return -1;
+}
+
+/*
+ * apply a RELA relocation
+ */
+int apply_relocate_add(Elf32_Shdr *sechdrs,
+                      const char *strtab,
+                      unsigned int symindex,
+                      unsigned int relsec,
+                      struct module *me)
+{
+       Elf32_Rela *rel = (void *) sechdrs[relsec].sh_addr;
+       Elf_Sym *sym;
+       u32 *location, opcode;
+       unsigned int i;
+       Elf32_Addr v;
+       Elf_Addr offset = 0;
+
+       pr_debug("Applying relocate section %u to %u with offset 0x%x\n",
+                relsec, sechdrs[relsec].sh_info, offset);
+
+       for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
+               /* This is where to make the change */
+               location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
+                       + rel[i].r_offset - offset;
+
+               /* This is the symbol it is referring to.  Note that all
+                  undefined symbols have been resolved.  */
+               sym = (Elf_Sym *)sechdrs[symindex].sh_addr
+                       + ELF32_R_SYM(rel[i].r_info);
+
+               /* this is the adjustment to be made */
+               v = sym->st_value + rel[i].r_addend;
+
+               switch (ELF32_R_TYPE(rel[i].r_info)) {
+               case R_C6000_ABS32:
+                       pr_debug("RELA ABS32: [%p] = 0x%x\n", location, v);
+                       *location = v;
+                       break;
+               case R_C6000_ABS16:
+                       pr_debug("RELA ABS16: [%p] = 0x%x\n", location, v);
+                       *(u16 *)location = v;
+                       break;
+               case R_C6000_ABS8:
+                       pr_debug("RELA ABS8: [%p] = 0x%x\n", location, v);
+                       *(u8 *)location = v;
+                       break;
+               case R_C6000_ABS_L16:
+                       opcode = *location;
+                       opcode &= ~0x7fff80;
+                       opcode |= ((v & 0xffff) << 7);
+                       pr_debug("RELA ABS_L16[%p] v[0x%x] opcode[0x%x]\n",
+                                location, v, opcode);
+                       *location = opcode;
+                       break;
+               case R_C6000_ABS_H16:
+                       opcode = *location;
+                       opcode &= ~0x7fff80;
+                       opcode |= ((v >> 9) & 0x7fff80);
+                       pr_debug("RELA ABS_H16[%p] v[0x%x] opcode[0x%x]\n",
+                                location, v, opcode);
+                       *location = opcode;
+                       break;
+               case R_C6000_PCR_S21:
+                       if (fixup_pcr(location, v, 21, 7))
+                               return -ENOEXEC;
+                       break;
+               case R_C6000_PCR_S12:
+                       if (fixup_pcr(location, v, 12, 16))
+                               return -ENOEXEC;
+                       break;
+               case R_C6000_PCR_S10:
+                       if (fixup_pcr(location, v, 10, 13))
+                               return -ENOEXEC;
+                       break;
+               default:
+                       pr_err("module %s: Unknown RELA relocation: %u\n",
+                              me->name, ELF32_R_TYPE(rel[i].r_info));
+                       return -ENOEXEC;
+               }
+       }
+
+       return 0;
+}
diff --git a/arch/c6x/kernel/process.c b/arch/c6x/kernel/process.c
new file mode 100644 (file)
index 0000000..aa65c87
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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/module.h>
+#include <linux/unistd.h>
+#include <linux/ptrace.h>
+#include <linux/init_task.h>
+#include <linux/tick.h>
+#include <linux/mqueue.h>
+#include <linux/syscalls.h>
+#include <linux/reboot.h>
+
+#include <asm/syscalls.h>
+
+/* hooks for board specific support */
+void   (*c6x_restart)(void);
+void   (*c6x_halt)(void);
+
+extern asmlinkage void ret_from_fork(void);
+
+static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
+static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
+
+/*
+ * Initial thread structure.
+ */
+union thread_union init_thread_union __init_task_data =        {
+       INIT_THREAD_INFO(init_task)
+};
+
+/*
+ * Initial task structure.
+ */
+struct task_struct init_task = INIT_TASK(init_task);
+EXPORT_SYMBOL(init_task);
+
+/*
+ * power off function, if any
+ */
+void (*pm_power_off)(void);
+EXPORT_SYMBOL(pm_power_off);
+
+static void c6x_idle(void)
+{
+       unsigned long tmp;
+
+       /*
+        * Put local_irq_enable and idle in same execute packet
+        * to make them atomic and avoid race to idle with
+        * interrupts enabled.
+        */
+       asm volatile ("   mvc .s2 CSR,%0\n"
+                     "   or  .d2 1,%0,%0\n"
+                     "   mvc .s2 %0,CSR\n"
+                     "|| idle\n"
+                     : "=b"(tmp));
+}
+
+/*
+ * The idle loop for C64x
+ */
+void cpu_idle(void)
+{
+       /* endless idle loop with no priority at all */
+       while (1) {
+               tick_nohz_stop_sched_tick(1);
+               while (1) {
+                       local_irq_disable();
+                       if (need_resched()) {
+                               local_irq_enable();
+                               break;
+                       }
+                       c6x_idle(); /* enables local irqs */
+               }
+               tick_nohz_restart_sched_tick();
+
+               preempt_enable_no_resched();
+               schedule();
+               preempt_disable();
+       }
+}
+
+static void halt_loop(void)
+{
+       printk(KERN_EMERG "System Halted, OK to turn off power\n");
+       local_irq_disable();
+       while (1)
+               asm volatile("idle\n");
+}
+
+void machine_restart(char *__unused)
+{
+       if (c6x_restart)
+               c6x_restart();
+       halt_loop();
+}
+
+void machine_halt(void)
+{
+       if (c6x_halt)
+               c6x_halt();
+       halt_loop();
+}
+
+void machine_power_off(void)
+{
+       if (pm_power_off)
+               pm_power_off();
+       halt_loop();
+}
+
+static void kernel_thread_helper(int dummy, void *arg, int (*fn)(void *))
+{
+       do_exit(fn(arg));
+}
+
+/*
+ * Create a kernel thread
+ */
+int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
+{
+       struct pt_regs regs;
+
+       /*
+        * copy_thread sets a4 to zero (child return from fork)
+        * so we can't just set things up to directly return to
+        * fn.
+        */
+       memset(&regs, 0, sizeof(regs));
+       regs.b4 = (unsigned long) arg;
+       regs.a6 = (unsigned long) fn;
+       regs.pc = (unsigned long) kernel_thread_helper;
+       local_save_flags(regs.csr);
+       regs.csr |= 1;
+       regs.tsr = 5; /* Set GEE and GIE in TSR */
+
+       /* Ok, create the new process.. */
+       return do_fork(flags | CLONE_VM | CLONE_UNTRACED, -1, &regs,
+                      0, NULL, NULL);
+}
+EXPORT_SYMBOL(kernel_thread);
+
+void flush_thread(void)
+{
+}
+
+void exit_thread(void)
+{
+}
+
+SYSCALL_DEFINE1(c6x_clone, struct pt_regs *, regs)
+{
+       unsigned long clone_flags;
+       unsigned long newsp;
+
+       /* syscall puts clone_flags in A4 and usp in B4 */
+       clone_flags = regs->orig_a4;
+       if (regs->b4)
+               newsp = regs->b4;
+       else
+               newsp = regs->sp;
+
+       return do_fork(clone_flags, newsp, regs, 0, (int __user *)regs->a6,
+                      (int __user *)regs->b6);
+}
+
+/*
+ * Do necessary setup to start up a newly executed thread.
+ */
+void start_thread(struct pt_regs *regs, unsigned int pc, unsigned long usp)
+{
+       /*
+        * The binfmt loader will setup a "full" stack, but the C6X
+        * operates an "empty" stack. So we adjust the usp so that
+        * argc doesn't get destroyed if an interrupt is taken before
+        * it is read from the stack.
+        *
+        * NB: Library startup code needs to match this.
+        */
+       usp -= 8;
+
+       set_fs(USER_DS);
+       regs->pc  = pc;
+       regs->sp  = usp;
+       regs->tsr |= 0x40; /* set user mode */
+       current->thread.usp = usp;
+}
+
+/*
+ * Copy a new thread context in its stack.
+ */
+int copy_thread(unsigned long clone_flags, unsigned long usp,
+               unsigned long ustk_size,
+               struct task_struct *p, struct pt_regs *regs)
+{
+       struct pt_regs *childregs;
+
+       childregs = task_pt_regs(p);
+
+       *childregs = *regs;
+       childregs->a4 = 0;
+
+       if (usp == -1)
+               /* case of  __kernel_thread: we return to supervisor space */
+               childregs->sp = (unsigned long)(childregs + 1);
+       else
+               /* Otherwise use the given stack */
+               childregs->sp = usp;
+
+       /* Set usp/ksp */
+       p->thread.usp = childregs->sp;
+       /* switch_to uses stack to save/restore 14 callee-saved regs */
+       thread_saved_ksp(p) = (unsigned long)childregs - 8;
+       p->thread.pc = (unsigned int) ret_from_fork;
+       p->thread.wchan = (unsigned long) ret_from_fork;
+#ifdef __DSBT__
+       {
+               unsigned long dp;
+
+               asm volatile ("mv .S2 b14,%0\n" : "=b"(dp));
+
+               thread_saved_dp(p) = dp;
+               if (usp == -1)
+                       childregs->dp = dp;
+       }
+#endif
+       return 0;
+}
+
+/*
+ * c6x_execve() executes a new program.
+ */
+SYSCALL_DEFINE4(c6x_execve, const char __user *, name,
+               const char __user *const __user *, argv,
+               const char __user *const __user *, envp,
+               struct pt_regs *, regs)
+{
+       int error;
+       char *filename;
+
+       filename = getname(name);
+       error = PTR_ERR(filename);
+       if (IS_ERR(filename))
+               goto out;
+
+       error = do_execve(filename, argv, envp, regs);
+       putname(filename);
+out:
+       return error;
+}
+
+unsigned long get_wchan(struct task_struct *p)
+{
+       return p->thread.wchan;
+}
diff --git a/arch/c6x/kernel/ptrace.c b/arch/c6x/kernel/ptrace.c
new file mode 100644 (file)
index 0000000..3c494e8
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Updated for 2.6.34: Mark Salter <msalter@redhat.com>
+ *
+ *  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/ptrace.h>
+#include <linux/tracehook.h>
+#include <linux/regset.h>
+#include <linux/elf.h>
+
+#include <asm/cacheflush.h>
+
+#define PT_REG_SIZE      (sizeof(struct pt_regs))
+
+/*
+ * Called by kernel/ptrace.c when detaching.
+ */
+void ptrace_disable(struct task_struct *child)
+{
+       /* nothing to do */
+}
+
+/*
+ * Get a register number from live pt_regs for the specified task.
+ */
+static inline long get_reg(struct task_struct *task, int regno)
+{
+       long *addr = (long *)task_pt_regs(task);
+
+       if (regno == PT_TSR || regno == PT_CSR)
+               return 0;
+
+       return addr[regno];
+}
+
+/*
+ * Write contents of register REGNO in task TASK.
+ */
+static inline int put_reg(struct task_struct *task,
+                         int regno,
+                         unsigned long data)
+{
+       unsigned long *addr = (unsigned long *)task_pt_regs(task);
+
+       if (regno != PT_TSR && regno != PT_CSR)
+               addr[regno] = data;
+
+       return 0;
+}
+
+/* regset get/set implementations */
+
+static int gpr_get(struct task_struct *target,
+                  const struct user_regset *regset,
+                  unsigned int pos, unsigned int count,
+                  void *kbuf, void __user *ubuf)
+{
+       struct pt_regs *regs = task_pt_regs(target);
+
+       return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
+                                  regs,
+                                  0, sizeof(*regs));
+}
+
+static int gpr_set(struct task_struct *target,
+                  const struct user_regset *regset,
+                  unsigned int pos, unsigned int count,
+                  const void *kbuf, const void __user *ubuf)
+{
+       int ret;
+       struct pt_regs *regs = task_pt_regs(target);
+
+       /* Don't copyin TSR or CSR */
+       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                &regs,
+                                0, PT_TSR * sizeof(long));
+       if (ret)
+               return ret;
+
+       ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
+                                       PT_TSR * sizeof(long),
+                                       (PT_TSR + 1) * sizeof(long));
+       if (ret)
+               return ret;
+
+       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                &regs,
+                                (PT_TSR + 1) * sizeof(long),
+                                PT_CSR * sizeof(long));
+       if (ret)
+               return ret;
+
+       ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
+                                       PT_CSR * sizeof(long),
+                                       (PT_CSR + 1) * sizeof(long));
+       if (ret)
+               return ret;
+
+       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                &regs,
+                                (PT_CSR + 1) * sizeof(long), -1);
+       return ret;
+}
+
+enum c6x_regset {
+       REGSET_GPR,
+};
+
+static const struct user_regset c6x_regsets[] = {
+       [REGSET_GPR] = {
+               .core_note_type = NT_PRSTATUS,
+               .n = ELF_NGREG,
+               .size = sizeof(u32),
+               .align = sizeof(u32),
+               .get = gpr_get,
+               .set = gpr_set
+       },
+};
+
+static const struct user_regset_view user_c6x_native_view = {
+       .name           = "tic6x",
+       .e_machine      = EM_TI_C6000,
+       .regsets        = c6x_regsets,
+       .n              = ARRAY_SIZE(c6x_regsets),
+};
+
+const struct user_regset_view *task_user_regset_view(struct task_struct *task)
+{
+       return &user_c6x_native_view;
+}
+
+/*
+ * Perform ptrace request
+ */
+long arch_ptrace(struct task_struct *child, long request,
+                unsigned long addr, unsigned long data)
+{
+       int ret = 0;
+
+       switch (request) {
+               /*
+                * write the word at location addr.
+                */
+       case PTRACE_POKETEXT:
+               ret = generic_ptrace_pokedata(child, addr, data);
+               if (ret == 0 && request == PTRACE_POKETEXT)
+                       flush_icache_range(addr, addr + 4);
+               break;
+       default:
+               ret = ptrace_request(child, request, addr, data);
+               break;
+       }
+
+       return ret;
+}
+
+/*
+ * handle tracing of system call entry
+ * - return the revised system call number or ULONG_MAX to cause ENOSYS
+ */
+asmlinkage unsigned long syscall_trace_entry(struct pt_regs *regs)
+{
+       if (tracehook_report_syscall_entry(regs))
+               /* tracing decided this syscall should not happen, so
+                * We'll return a bogus call number to get an ENOSYS
+                * error, but leave the original number in
+                * regs->orig_a4
+                */
+               return ULONG_MAX;
+
+       return regs->b0;
+}
+
+/*
+ * handle tracing of system call exit
+ */
+asmlinkage void syscall_trace_exit(struct pt_regs *regs)
+{
+       tracehook_report_syscall_exit(regs, 0);
+}
diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c
new file mode 100644 (file)
index 0000000..3c2858f
--- /dev/null
@@ -0,0 +1,498 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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/dma-mapping.h>
+#include <linux/memblock.h>
+#include <linux/seq_file.h>
+#include <linux/bootmem.h>
+#include <linux/clkdev.h>
+#include <linux/initrd.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of_fdt.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/cache.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/clk.h>
+#include <linux/fs.h>
+#include <linux/of.h>
+
+
+#include <asm/sections.h>
+#include <asm/div64.h>
+#include <asm/setup.h>
+#include <asm/dscr.h>
+#include <asm/clock.h>
+#include <asm/soc.h>
+
+static const char *c6x_soc_name;
+
+int c6x_num_cores;
+EXPORT_SYMBOL_GPL(c6x_num_cores);
+
+unsigned int c6x_silicon_rev;
+EXPORT_SYMBOL_GPL(c6x_silicon_rev);
+
+/*
+ * Device status register. This holds information
+ * about device configuration needed by some drivers.
+ */
+unsigned int c6x_devstat;
+EXPORT_SYMBOL_GPL(c6x_devstat);
+
+/*
+ * Some SoCs have fuse registers holding a unique MAC
+ * address. This is parsed out of the device tree with
+ * the resulting MAC being held here.
+ */
+unsigned char c6x_fuse_mac[6];
+
+unsigned long memory_start;
+unsigned long memory_end;
+
+unsigned long ram_start;
+unsigned long ram_end;
+
+/* Uncached memory for DMA consistent use (memdma=) */
+static unsigned long dma_start __initdata;
+static unsigned long dma_size __initdata;
+
+char c6x_command_line[COMMAND_LINE_SIZE];
+
+#if defined(CONFIG_CMDLINE_BOOL)
+static const char default_command_line[COMMAND_LINE_SIZE] __section(.cmdline) =
+       CONFIG_CMDLINE;
+#endif
+
+struct cpuinfo_c6x {
+       const char *cpu_name;
+       const char *cpu_voltage;
+       const char *mmu;
+       const char *fpu;
+       char *cpu_rev;
+       unsigned int core_id;
+       char __cpu_rev[5];
+};
+
+static DEFINE_PER_CPU(struct cpuinfo_c6x, cpu_data);
+
+unsigned int ticks_per_ns_scaled;
+EXPORT_SYMBOL(ticks_per_ns_scaled);
+
+unsigned int c6x_core_freq;
+
+static void __init get_cpuinfo(void)
+{
+       unsigned cpu_id, rev_id, csr;
+       struct clk *coreclk = clk_get_sys(NULL, "core");
+       unsigned long core_khz;
+       u64 tmp;
+       struct cpuinfo_c6x *p;
+       struct device_node *node, *np;
+
+       p = &per_cpu(cpu_data, smp_processor_id());
+
+       if (!IS_ERR(coreclk))
+               c6x_core_freq = clk_get_rate(coreclk);
+       else {
+               printk(KERN_WARNING
+                      "Cannot find core clock frequency. Using 700MHz\n");
+               c6x_core_freq = 700000000;
+       }
+
+       core_khz = c6x_core_freq / 1000;
+
+       tmp = (uint64_t)core_khz << C6X_NDELAY_SCALE;
+       do_div(tmp, 1000000);
+       ticks_per_ns_scaled = tmp;
+
+       csr = get_creg(CSR);
+       cpu_id = csr >> 24;
+       rev_id = (csr >> 16) & 0xff;
+
+       p->mmu = "none";
+       p->fpu = "none";
+       p->cpu_voltage = "unknown";
+
+       switch (cpu_id) {
+       case 0:
+               p->cpu_name = "C67x";
+               p->fpu = "yes";
+               break;
+       case 2:
+               p->cpu_name = "C62x";
+               break;
+       case 8:
+               p->cpu_name = "C64x";
+               break;
+       case 12:
+               p->cpu_name = "C64x";
+               break;
+       case 16:
+               p->cpu_name = "C64x+";
+               p->cpu_voltage = "1.2";
+               break;
+       default:
+               p->cpu_name = "unknown";
+               break;
+       }
+
+       if (cpu_id < 16) {
+               switch (rev_id) {
+               case 0x1:
+                       if (cpu_id > 8) {
+                               p->cpu_rev = "DM640/DM641/DM642/DM643";
+                               p->cpu_voltage = "1.2 - 1.4";
+                       } else {
+                               p->cpu_rev = "C6201";
+                               p->cpu_voltage = "2.5";
+                       }
+                       break;
+               case 0x2:
+                       p->cpu_rev = "C6201B/C6202/C6211";
+                       p->cpu_voltage = "1.8";
+                       break;
+               case 0x3:
+                       p->cpu_rev = "C6202B/C6203/C6204/C6205";
+                       p->cpu_voltage = "1.5";
+                       break;
+               case 0x201:
+                       p->cpu_rev = "C6701 revision 0 (early CPU)";
+                       p->cpu_voltage = "1.8";
+                       break;
+               case 0x202:
+                       p->cpu_rev = "C6701/C6711/C6712";
+                       p->cpu_voltage = "1.8";
+                       break;
+               case 0x801:
+                       p->cpu_rev = "C64x";
+                       p->cpu_voltage = "1.5";
+                       break;
+               default:
+                       p->cpu_rev = "unknown";
+               }
+       } else {
+               p->cpu_rev = p->__cpu_rev;
+               snprintf(p->__cpu_rev, sizeof(p->__cpu_rev), "0x%x", cpu_id);
+       }
+
+       p->core_id = get_coreid();
+
+       node = of_find_node_by_name(NULL, "cpus");
+       if (node) {
+               for_each_child_of_node(node, np)
+                       if (!strcmp("cpu", np->name))
+                               ++c6x_num_cores;
+               of_node_put(node);
+       }
+
+       node = of_find_node_by_name(NULL, "soc");
+       if (node) {
+               if (of_property_read_string(node, "model", &c6x_soc_name))
+                       c6x_soc_name = "unknown";
+               of_node_put(node);
+       } else
+               c6x_soc_name = "unknown";
+
+       printk(KERN_INFO "CPU%d: %s rev %s, %s volts, %uMHz\n",
+              p->core_id, p->cpu_name, p->cpu_rev,
+              p->cpu_voltage, c6x_core_freq / 1000000);
+}
+
+/*
+ * Early parsing of the command line
+ */
+static u32 mem_size __initdata;
+
+/* "mem=" parsing. */
+static int __init early_mem(char *p)
+{
+       if (!p)
+               return -EINVAL;
+
+       mem_size = memparse(p, &p);
+       /* don't remove all of memory when handling "mem={invalid}" */
+       if (mem_size == 0)
+               return -EINVAL;
+
+       return 0;
+}
+early_param("mem", early_mem);
+
+/* "memdma=<size>[@<address>]" parsing. */
+static int __init early_memdma(char *p)
+{
+       if (!p)
+               return -EINVAL;
+
+       dma_size = memparse(p, &p);
+       if (*p == '@')
+               dma_start = memparse(p, &p);
+
+       return 0;
+}
+early_param("memdma", early_memdma);
+
+int __init c6x_add_memory(phys_addr_t start, unsigned long size)
+{
+       static int ram_found __initdata;
+
+       /* We only handle one bank (the one with PAGE_OFFSET) for now */
+       if (ram_found)
+               return -EINVAL;
+
+       if (start > PAGE_OFFSET || PAGE_OFFSET >= (start + size))
+               return 0;
+
+       ram_start = start;
+       ram_end = start + size;
+
+       ram_found = 1;
+       return 0;
+}
+
+/*
+ * Do early machine setup and device tree parsing. This is called very
+ * early on the boot process.
+ */
+notrace void __init machine_init(unsigned long dt_ptr)
+{
+       struct boot_param_header *dtb = __va(dt_ptr);
+       struct boot_param_header *fdt = (struct boot_param_header *)_fdt_start;
+
+       /* interrupts must be masked */
+       set_creg(IER, 2);
+
+       /*
+        * Set the Interrupt Service Table (IST) to the beginning of the
+        * vector table.
+        */
+       set_ist(_vectors_start);
+
+       lockdep_init();
+
+       /*
+        * dtb is passed in from bootloader.
+        * fdt is linked in blob.
+        */
+       if (dtb && dtb != fdt)
+               fdt = dtb;
+
+       /* Do some early initialization based on the flat device tree */
+       early_init_devtree(fdt);
+
+       /* parse_early_param needs a boot_command_line */
+       strlcpy(boot_command_line, c6x_command_line, COMMAND_LINE_SIZE);
+       parse_early_param();
+}
+
+void __init setup_arch(char **cmdline_p)
+{
+       int bootmap_size;
+       struct memblock_region *reg;
+
+       printk(KERN_INFO "Initializing kernel\n");
+
+       /* Initialize command line */
+       *cmdline_p = c6x_command_line;
+
+       memblock_init();
+
+       memory_end = ram_end;
+       memory_end &= ~(PAGE_SIZE - 1);
+
+       if (mem_size && (PAGE_OFFSET + PAGE_ALIGN(mem_size)) < memory_end)
+               memory_end = PAGE_OFFSET + PAGE_ALIGN(mem_size);
+
+       /* add block that this kernel can use */
+       memblock_add(PAGE_OFFSET, memory_end - PAGE_OFFSET);
+
+       /* reserve kernel text/data/bss */
+       memblock_reserve(PAGE_OFFSET,
+                        PAGE_ALIGN((unsigned long)&_end - PAGE_OFFSET));
+
+       if (dma_size) {
+               /* align to cacheability granularity */
+               dma_size = CACHE_REGION_END(dma_size);
+
+               if (!dma_start)
+                       dma_start = memory_end - dma_size;
+
+               /* align to cacheability granularity */
+               dma_start = CACHE_REGION_START(dma_start);
+
+               /* reserve DMA memory taken from kernel memory */
+               if (memblock_is_region_memory(dma_start, dma_size))
+                       memblock_reserve(dma_start, dma_size);
+       }
+
+       memory_start = PAGE_ALIGN((unsigned int) &_end);
+
+       printk(KERN_INFO "Memory Start=%08lx, Memory End=%08lx\n",
+              memory_start, memory_end);
+
+#ifdef CONFIG_BLK_DEV_INITRD
+       /*
+        * Reserve initrd memory if in kernel memory.
+        */
+       if (initrd_start < initrd_end)
+               if (memblock_is_region_memory(initrd_start,
+                                             initrd_end - initrd_start))
+                       memblock_reserve(initrd_start,
+                                        initrd_end - initrd_start);
+#endif
+
+       init_mm.start_code = (unsigned long) &_stext;
+       init_mm.end_code   = (unsigned long) &_etext;
+       init_mm.end_data   = memory_start;
+       init_mm.brk        = memory_start;
+
+       /*
+        * Give all the memory to the bootmap allocator,  tell it to put the
+        * boot mem_map at the start of memory
+        */
+       bootmap_size = init_bootmem_node(NODE_DATA(0),
+                                        memory_start >> PAGE_SHIFT,
+                                        PAGE_OFFSET >> PAGE_SHIFT,
+                                        memory_end >> PAGE_SHIFT);
+       memblock_reserve(memory_start, bootmap_size);
+
+       memblock_analyze();
+       unflatten_device_tree();
+
+       c6x_cache_init();
+
+       /* Set the whole external memory as non-cacheable */
+       disable_caching(ram_start, ram_end - 1);
+
+       /* Set caching of external RAM used by Linux */
+       for_each_memblock(memory, reg)
+               enable_caching(CACHE_REGION_START(reg->base),
+                              CACHE_REGION_START(reg->base + reg->size - 1));
+
+#ifdef CONFIG_BLK_DEV_INITRD
+       /*
+        * Enable caching for initrd which falls outside kernel memory.
+        */
+       if (initrd_start < initrd_end) {
+               if (!memblock_is_region_memory(initrd_start,
+                                              initrd_end - initrd_start))
+                       enable_caching(CACHE_REGION_START(initrd_start),
+                                      CACHE_REGION_START(initrd_end - 1));
+       }
+#endif
+
+       /*
+        * Disable caching for dma coherent memory taken from kernel memory.
+        */
+       if (dma_size && memblock_is_region_memory(dma_start, dma_size))
+               disable_caching(dma_start,
+                               CACHE_REGION_START(dma_start + dma_size - 1));
+
+       /* Initialize the coherent memory allocator */
+       coherent_mem_init(dma_start, dma_size);
+
+       /*
+        * Free all memory as a starting point.
+        */
+       free_bootmem(PAGE_OFFSET, memory_end - PAGE_OFFSET);
+
+       /*
+        * Then reserve memory which is already being used.
+        */
+       for_each_memblock(reserved, reg) {
+               pr_debug("reserved - 0x%08x-0x%08x\n",
+                        (u32) reg->base, (u32) reg->size);
+               reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
+       }
+
+       max_low_pfn = PFN_DOWN(memory_end);
+       min_low_pfn = PFN_UP(memory_start);
+       max_mapnr = max_low_pfn - min_low_pfn;
+
+       /* Get kmalloc into gear */
+       paging_init();
+
+       /*
+        * Probe for Device State Configuration Registers.
+        * We have to do this early in case timer needs to be enabled
+        * through DSCR.
+        */
+       dscr_probe();
+
+       /* We do this early for timer and core clock frequency */
+       c64x_setup_clocks();
+
+       /* Get CPU info */
+       get_cpuinfo();
+
+#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
+       conswitchp = &dummy_con;
+#endif
+}
+
+#define cpu_to_ptr(n) ((void *)((long)(n)+1))
+#define ptr_to_cpu(p) ((long)(p) - 1)
+
+static int show_cpuinfo(struct seq_file *m, void *v)
+{
+       int n = ptr_to_cpu(v);
+       struct cpuinfo_c6x *p = &per_cpu(cpu_data, n);
+
+       if (n == 0) {
+               seq_printf(m,
+                          "soc\t\t: %s\n"
+                          "soc revision\t: 0x%x\n"
+                          "soc cores\t: %d\n",
+                          c6x_soc_name, c6x_silicon_rev, c6x_num_cores);
+       }
+
+       seq_printf(m,
+                  "\n"
+                  "processor\t: %d\n"
+                  "cpu\t\t: %s\n"
+                  "core revision\t: %s\n"
+                  "core voltage\t: %s\n"
+                  "core id\t\t: %d\n"
+                  "mmu\t\t: %s\n"
+                  "fpu\t\t: %s\n"
+                  "cpu MHz\t\t: %u\n"
+                  "bogomips\t: %lu.%02lu\n\n",
+                  n,
+                  p->cpu_name, p->cpu_rev, p->cpu_voltage,
+                  p->core_id, p->mmu, p->fpu,
+                  (c6x_core_freq + 500000) / 1000000,
+                  (loops_per_jiffy/(500000/HZ)),
+                  (loops_per_jiffy/(5000/HZ))%100);
+
+       return 0;
+}
+
+static void *c_start(struct seq_file *m, loff_t *pos)
+{
+       return *pos < nr_cpu_ids ? cpu_to_ptr(*pos) : NULL;
+}
+static void *c_next(struct seq_file *m, void *v, loff_t *pos)
+{
+       ++*pos;
+       return NULL;
+}
+static void c_stop(struct seq_file *m, void *v)
+{
+}
+
+const struct seq_operations cpuinfo_op = {
+       c_start,
+       c_stop,
+       c_next,
+       show_cpuinfo
+};
diff --git a/arch/c6x/kernel/signal.c b/arch/c6x/kernel/signal.c
new file mode 100644 (file)
index 0000000..304f675
--- /dev/null
@@ -0,0 +1,377 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  Updated for 2.6.34: Mark Salter <msalter@redhat.com>
+ *
+ *  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/kernel.h>
+#include <linux/uaccess.h>
+#include <linux/syscalls.h>
+#include <linux/tracehook.h>
+
+#include <asm/ucontext.h>
+#include <asm/cacheflush.h>
+
+
+#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
+
+/*
+ * Do a signal return, undo the signal stack.
+ */
+
+#define RETCODE_SIZE (9 << 2)  /* 9 instructions = 36 bytes */
+
+struct rt_sigframe {
+       struct siginfo __user *pinfo;
+       void __user *puc;
+       struct siginfo info;
+       struct ucontext uc;
+       unsigned long retcode[RETCODE_SIZE >> 2];
+};
+
+static int restore_sigcontext(struct pt_regs *regs,
+                             struct sigcontext __user *sc)
+{
+       int err = 0;
+
+       /* The access_ok check was done by caller, so use __get_user here */
+#define COPY(x)  (err |= __get_user(regs->x, &sc->sc_##x))
+
+       COPY(sp); COPY(a4); COPY(b4); COPY(a6); COPY(b6); COPY(a8); COPY(b8);
+       COPY(a0); COPY(a1); COPY(a2); COPY(a3); COPY(a5); COPY(a7); COPY(a9);
+       COPY(b0); COPY(b1); COPY(b2); COPY(b3); COPY(b5); COPY(b7); COPY(b9);
+
+       COPY(a16); COPY(a17); COPY(a18); COPY(a19);
+       COPY(a20); COPY(a21); COPY(a22); COPY(a23);
+       COPY(a24); COPY(a25); COPY(a26); COPY(a27);
+       COPY(a28); COPY(a29); COPY(a30); COPY(a31);
+       COPY(b16); COPY(b17); COPY(b18); COPY(b19);
+       COPY(b20); COPY(b21); COPY(b22); COPY(b23);
+       COPY(b24); COPY(b25); COPY(b26); COPY(b27);
+       COPY(b28); COPY(b29); COPY(b30); COPY(b31);
+
+       COPY(csr); COPY(pc);
+
+#undef COPY
+
+       return err;
+}
+
+asmlinkage int do_rt_sigreturn(struct pt_regs *regs)
+{
+       struct rt_sigframe __user *frame;
+       sigset_t set;
+
+       /*
+        * Since we stacked the signal on a dword boundary,
+        * 'sp' should be dword aligned here.  If it's
+        * not, then the user is trying to mess with us.
+        */
+       if (regs->sp & 7)
+               goto badframe;
+
+       frame = (struct rt_sigframe __user *) ((unsigned long) regs->sp + 8);
+
+       if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
+               goto badframe;
+       if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
+               goto badframe;
+
+       sigdelsetmask(&set, ~_BLOCKABLE);
+       spin_lock_irq(&current->sighand->siglock);
+       current->blocked = set;
+       recalc_sigpending();
+       spin_unlock_irq(&current->sighand->siglock);
+
+       if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
+               goto badframe;
+
+       return regs->a4;
+
+badframe:
+       force_sig(SIGSEGV, current);
+       return 0;
+}
+
+static int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
+                           unsigned long mask)
+{
+       int err = 0;
+
+       err |= __put_user(mask, &sc->sc_mask);
+
+       /* The access_ok check was done by caller, so use __put_user here */
+#define COPY(x) (err |= __put_user(regs->x, &sc->sc_##x))
+
+       COPY(sp); COPY(a4); COPY(b4); COPY(a6); COPY(b6); COPY(a8); COPY(b8);
+       COPY(a0); COPY(a1); COPY(a2); COPY(a3); COPY(a5); COPY(a7); COPY(a9);
+       COPY(b0); COPY(b1); COPY(b2); COPY(b3); COPY(b5); COPY(b7); COPY(b9);
+
+       COPY(a16); COPY(a17); COPY(a18); COPY(a19);
+       COPY(a20); COPY(a21); COPY(a22); COPY(a23);
+       COPY(a24); COPY(a25); COPY(a26); COPY(a27);
+       COPY(a28); COPY(a29); COPY(a30); COPY(a31);
+       COPY(b16); COPY(b17); COPY(b18); COPY(b19);
+       COPY(b20); COPY(b21); COPY(b22); COPY(b23);
+       COPY(b24); COPY(b25); COPY(b26); COPY(b27);
+       COPY(b28); COPY(b29); COPY(b30); COPY(b31);
+
+       COPY(csr); COPY(pc);
+
+#undef COPY
+
+       return err;
+}
+
+static inline void __user *get_sigframe(struct k_sigaction *ka,
+                                       struct pt_regs *regs,
+                                       unsigned long framesize)
+{
+       unsigned long sp = regs->sp;
+
+       /*
+        * This is the X/Open sanctioned signal stack switching.
+        */
+       if ((ka->sa.sa_flags & SA_ONSTACK) && sas_ss_flags(sp) == 0)
+               sp = current->sas_ss_sp + current->sas_ss_size;
+
+       /*
+        * No matter what happens, 'sp' must be dword
+        * aligned. Otherwise, nasty things will happen
+        */
+       return (void __user *)((sp - framesize) & ~7);
+}
+
+static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
+                          sigset_t *set, struct pt_regs *regs)
+{
+       struct rt_sigframe __user *frame;
+       unsigned long __user *retcode;
+       int err = 0;
+
+       frame = get_sigframe(ka, regs, sizeof(*frame));
+
+       if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
+               goto segv_and_exit;
+
+       err |= __put_user(&frame->info, &frame->pinfo);
+       err |= __put_user(&frame->uc, &frame->puc);
+       err |= copy_siginfo_to_user(&frame->info, info);
+
+       /* Clear all the bits of the ucontext we don't use.  */
+       err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
+
+       err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
+       err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
+
+       /* Set up to return from userspace */
+       retcode = (unsigned long __user *) &frame->retcode;
+
+       /* The access_ok check was done above, so use __put_user here */
+#define COPY(x) (err |= __put_user(x, retcode++))
+
+       COPY(0x0000002AUL | (__NR_rt_sigreturn << 7));
+                               /* MVK __NR_rt_sigreturn,B0 */
+       COPY(0x10000000UL);     /* SWE */
+       COPY(0x00006000UL);     /* NOP 4 */
+       COPY(0x00006000UL);     /* NOP 4 */
+       COPY(0x00006000UL);     /* NOP 4 */
+       COPY(0x00006000UL);     /* NOP 4 */
+       COPY(0x00006000UL);     /* NOP 4 */
+       COPY(0x00006000UL);     /* NOP 4 */
+       COPY(0x00006000UL);     /* NOP 4 */
+
+#undef COPY
+
+       if (err)
+               goto segv_and_exit;
+
+       flush_icache_range((unsigned long) &frame->retcode,
+                          (unsigned long) &frame->retcode + RETCODE_SIZE);
+
+       retcode = (unsigned long __user *) &frame->retcode;
+
+       /* Change user context to branch to signal handler */
+       regs->sp = (unsigned long) frame - 8;
+       regs->b3 = (unsigned long) retcode;
+       regs->pc = (unsigned long) ka->sa.sa_handler;
+
+       /* Give the signal number to the handler */
+       regs->a4 = signr;
+
+       /*
+        * For realtime signals we must also set the second and third
+        * arguments for the signal handler.
+        *   -- Peter Maydell <pmaydell@chiark.greenend.org.uk> 2000-12-06
+        */
+       regs->b4 = (unsigned long)&frame->info;
+       regs->a6 = (unsigned long)&frame->uc;
+
+       return 0;
+
+segv_and_exit:
+       force_sigsegv(signr, current);
+       return -EFAULT;
+}
+
+static inline void
+handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
+{
+       switch (regs->a4) {
+       case -ERESTARTNOHAND:
+               if (!has_handler)
+                       goto do_restart;
+               regs->a4 = -EINTR;
+               break;
+
+       case -ERESTARTSYS:
+               if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) {
+                       regs->a4 = -EINTR;
+                       break;
+               }
+       /* fallthrough */
+       case -ERESTARTNOINTR:
+do_restart:
+               regs->a4 = regs->orig_a4;
+               regs->pc -= 4;
+               break;
+       }
+}
+
+/*
+ * handle the actual delivery of a signal to userspace
+ */
+static int handle_signal(int sig,
+                        siginfo_t *info, struct k_sigaction *ka,
+                        sigset_t *oldset, struct pt_regs *regs,
+                        int syscall)
+{
+       int ret;
+
+       /* Are we from a system call? */
+       if (syscall) {
+               /* If so, check system call restarting.. */
+               switch (regs->a4) {
+               case -ERESTART_RESTARTBLOCK:
+               case -ERESTARTNOHAND:
+                       regs->a4 = -EINTR;
+                       break;
+
+               case -ERESTARTSYS:
+                       if (!(ka->sa.sa_flags & SA_RESTART)) {
+                               regs->a4 = -EINTR;
+                               break;
+                       }
+
+                       /* fallthrough */
+               case -ERESTARTNOINTR:
+                       regs->a4 = regs->orig_a4;
+                       regs->pc -= 4;
+               }
+       }
+
+       /* Set up the stack frame */
+       ret = setup_rt_frame(sig, ka, info, oldset, regs);
+       if (ret == 0) {
+               spin_lock_irq(&current->sighand->siglock);
+               sigorsets(&current->blocked, &current->blocked,
+                         &ka->sa.sa_mask);
+               if (!(ka->sa.sa_flags & SA_NODEFER))
+                       sigaddset(&current->blocked, sig);
+               recalc_sigpending();
+               spin_unlock_irq(&current->sighand->siglock);
+       }
+
+       return ret;
+}
+
+/*
+ * handle a potential signal
+ */
+static void do_signal(struct pt_regs *regs, int syscall)
+{
+       struct k_sigaction ka;
+       siginfo_t info;
+       sigset_t *oldset;
+       int signr;
+
+       /* we want the common case to go fast, which is why we may in certain
+        * cases get here from kernel mode */
+       if (!user_mode(regs))
+               return;
+
+       if (test_thread_flag(TIF_RESTORE_SIGMASK))
+               oldset = &current->saved_sigmask;
+       else
+               oldset = &current->blocked;
+
+       signr = get_signal_to_deliver(&info, &ka, regs, NULL);
+       if (signr > 0) {
+               if (handle_signal(signr, &info, &ka, oldset,
+                                 regs, syscall) == 0) {
+                       /* a signal was successfully delivered; the saved
+                        * sigmask will have been stored in the signal frame,
+                        * and will be restored by sigreturn, so we can simply
+                        * clear the TIF_RESTORE_SIGMASK flag */
+                       if (test_thread_flag(TIF_RESTORE_SIGMASK))
+                               clear_thread_flag(TIF_RESTORE_SIGMASK);
+
+                       tracehook_signal_handler(signr, &info, &ka, regs, 0);
+               }
+
+               return;
+       }
+
+       /* did we come from a system call? */
+       if (syscall) {
+               /* restart the system call - no handlers present */
+               switch (regs->a4) {
+               case -ERESTARTNOHAND:
+               case -ERESTARTSYS:
+               case -ERESTARTNOINTR:
+                       regs->a4 = regs->orig_a4;
+                       regs->pc -= 4;
+                       break;
+
+               case -ERESTART_RESTARTBLOCK:
+                       regs->a4 = regs->orig_a4;
+                       regs->b0 = __NR_restart_syscall;
+                       regs->pc -= 4;
+                       break;
+               }
+       }
+
+       /* if there's no signal to deliver, we just put the saved sigmask
+        * back */
+       if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
+               clear_thread_flag(TIF_RESTORE_SIGMASK);
+               sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
+       }
+}
+
+/*
+ * notification of userspace execution resumption
+ * - triggered by current->work.notify_resume
+ */
+asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags,
+                                int syscall)
+{
+       /* deal with pending signal delivery */
+       if (thread_info_flags & ((1 << TIF_SIGPENDING) |
+                                (1 << TIF_RESTORE_SIGMASK)))
+               do_signal(regs, syscall);
+
+       if (thread_info_flags & (1 << TIF_NOTIFY_RESUME)) {
+               clear_thread_flag(TIF_NOTIFY_RESUME);
+               tracehook_notify_resume(regs);
+               if (current->replacement_session_keyring)
+                       key_replace_session_keyring();
+       }
+}
diff --git a/arch/c6x/kernel/soc.c b/arch/c6x/kernel/soc.c
new file mode 100644 (file)
index 0000000..dd45bc3
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ *  Miscellaneous SoC-specific hooks.
+ *
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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/module.h>
+#include <linux/ctype.h>
+#include <linux/etherdevice.h>
+#include <asm/system.h>
+#include <asm/setup.h>
+#include <asm/soc.h>
+
+struct soc_ops soc_ops;
+
+int soc_get_exception(void)
+{
+       if (!soc_ops.get_exception)
+               return -1;
+       return soc_ops.get_exception();
+}
+
+void soc_assert_event(unsigned int evt)
+{
+       if (soc_ops.assert_event)
+               soc_ops.assert_event(evt);
+}
+
+static u8 cmdline_mac[6];
+
+static int __init get_mac_addr_from_cmdline(char *str)
+{
+       int count, i, val;
+
+       for (count = 0; count < 6 && *str; count++, str += 3) {
+               if (!isxdigit(str[0]) || !isxdigit(str[1]))
+                       return 0;
+               if (str[2] != ((count < 5) ? ':' : '\0'))
+                       return 0;
+
+               for (i = 0, val = 0; i < 2; i++) {
+                       val = val << 4;
+                       val |= isdigit(str[i]) ?
+                               str[i] - '0' : toupper(str[i]) - 'A' + 10;
+               }
+               cmdline_mac[count] = val;
+       }
+       return 1;
+}
+__setup("emac_addr=", get_mac_addr_from_cmdline);
+
+/*
+ * Setup the MAC address for SoC ethernet devices.
+ *
+ * Before calling this function, the ethernet driver will have
+ * initialized the addr with local-mac-address from the device
+ * tree (if found). Allow command line to override, but not
+ * the fused address.
+ */
+int soc_mac_addr(unsigned int index, u8 *addr)
+{
+       int i, have_dt_mac = 0, have_cmdline_mac = 0, have_fuse_mac = 0;
+
+       for (i = 0; i < 6; i++) {
+               if (cmdline_mac[i])
+                       have_cmdline_mac = 1;
+               if (c6x_fuse_mac[i])
+                       have_fuse_mac = 1;
+               if (addr[i])
+                       have_dt_mac = 1;
+       }
+
+       /* cmdline overrides all */
+       if (have_cmdline_mac)
+               memcpy(addr, cmdline_mac, 6);
+       else if (!have_dt_mac) {
+               if (have_fuse_mac)
+                       memcpy(addr, c6x_fuse_mac, 6);
+               else
+                       random_ether_addr(addr);
+       }
+
+       /* adjust for specific EMAC device */
+       addr[5] += index * c6x_num_cores;
+       return 1;
+}
+EXPORT_SYMBOL_GPL(soc_mac_addr);
diff --git a/arch/c6x/kernel/switch_to.S b/arch/c6x/kernel/switch_to.S
new file mode 100644 (file)
index 0000000..09177ed
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter (msalter@redhat.com)
+ *
+ *  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/linkage.h>
+#include <asm/asm-offsets.h>
+
+#define SP     B15
+
+       /*
+        * void __switch_to(struct thread_info *prev,
+        *                  struct thread_info *next,
+        *                  struct task_struct *tsk) ;
+        */
+ENTRY(__switch_to)
+       LDDW    .D2T2   *+B4(THREAD_B15_14),B7:B6
+ ||    MV      .L2X    A4,B5   ; prev
+ ||    MV      .L1X    B4,A5   ; next
+ ||    MVC     .S2     RILC,B1
+
+       STW     .D2T2   B3,*+B5(THREAD_PC)
+ ||    STDW    .D1T1   A13:A12,*+A4(THREAD_A13_12)
+ ||    MVC     .S2     ILC,B0
+
+       LDW     .D2T2   *+B4(THREAD_PC),B3
+ ||    LDDW    .D1T1   *+A5(THREAD_A13_12),A13:A12
+
+       STDW    .D1T1   A11:A10,*+A4(THREAD_A11_10)
+ ||    STDW    .D2T2   B1:B0,*+B5(THREAD_RICL_ICL)
+#ifndef __DSBT__
+ ||    MVKL    .S2     current_ksp,B1
+#endif
+
+       STDW    .D2T2   B15:B14,*+B5(THREAD_B15_14)
+ ||    STDW    .D1T1   A15:A14,*+A4(THREAD_A15_14)
+#ifndef __DSBT__
+ ||    MVKH    .S2     current_ksp,B1
+#endif
+
+       ;; Switch to next SP
+       MV      .S2     B7,SP
+#ifdef __DSBT__
+ ||    STW     .D2T2   B7,*+B14(current_ksp)
+#else
+ ||    STW     .D2T2   B7,*B1
+ ||    MV      .L2     B6,B14
+#endif
+ ||    LDDW    .D1T1   *+A5(THREAD_RICL_ICL),A1:A0
+
+       STDW    .D2T2   B11:B10,*+B5(THREAD_B11_10)
+ ||    LDDW    .D1T1   *+A5(THREAD_A15_14),A15:A14
+
+       STDW    .D2T2   B13:B12,*+B5(THREAD_B13_12)
+ ||    LDDW    .D1T1   *+A5(THREAD_A11_10),A11:A10
+
+       B       .S2     B3              ; return in next E1
+ ||    LDDW    .D2T2   *+B4(THREAD_B13_12),B13:B12
+
+       LDDW    .D2T2   *+B4(THREAD_B11_10),B11:B10
+       NOP
+
+       MV      .L2X    A0,B0
+ ||    MV      .S1     A6,A4
+
+       MVC     .S2     B0,ILC
+ ||    MV      .L2X    A1,B1
+
+       MVC     .S2     B1,RILC
+ENDPROC(__switch_to)
diff --git a/arch/c6x/kernel/sys_c6x.c b/arch/c6x/kernel/sys_c6x.c
new file mode 100644 (file)
index 0000000..3e9bdfb
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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/module.h>
+#include <linux/syscalls.h>
+#include <linux/uaccess.h>
+
+#include <asm/syscalls.h>
+
+#ifdef CONFIG_ACCESS_CHECK
+int _access_ok(unsigned long addr, unsigned long size)
+{
+       if (!size)
+               return 1;
+
+       if (!addr || addr > (0xffffffffUL - (size - 1)))
+               goto _bad_access;
+
+       if (segment_eq(get_fs(), KERNEL_DS))
+               return 1;
+
+       if (memory_start <= addr && (addr + size - 1) < memory_end)
+               return 1;
+
+_bad_access:
+       pr_debug("Bad access attempt: pid[%d] addr[%08lx] size[0x%lx]\n",
+                current->pid, addr, size);
+       return 0;
+}
+EXPORT_SYMBOL(_access_ok);
+#endif
+
+/* sys_cache_sync -- sync caches over given range */
+asmlinkage int sys_cache_sync(unsigned long s, unsigned long e)
+{
+       L1D_cache_block_writeback_invalidate(s, e);
+       L1P_cache_block_invalidate(s, e);
+
+       return 0;
+}
+
+/* Provide the actual syscall number to call mapping. */
+#undef __SYSCALL
+#define __SYSCALL(nr, call) [nr] = (call),
+
+/*
+ * Use trampolines
+ */
+#define sys_pread64            sys_pread_c6x
+#define sys_pwrite64           sys_pwrite_c6x
+#define sys_truncate64         sys_truncate64_c6x
+#define sys_ftruncate64                sys_ftruncate64_c6x
+#define sys_fadvise64          sys_fadvise64_c6x
+#define sys_fadvise64_64       sys_fadvise64_64_c6x
+#define sys_fallocate          sys_fallocate_c6x
+
+/* Use sys_mmap_pgoff directly */
+#define sys_mmap2 sys_mmap_pgoff
+
+/*
+ * Note that we can't include <linux/unistd.h> here since the header
+ * guard will defeat us; <asm/unistd.h> checks for __SYSCALL as well.
+ */
+void *sys_call_table[__NR_syscalls] = {
+       [0 ... __NR_syscalls-1] = sys_ni_syscall,
+#include <asm/unistd.h>
+};
diff --git a/arch/c6x/kernel/time.c b/arch/c6x/kernel/time.c
new file mode 100644 (file)
index 0000000..4c9f136
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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/kernel.h>
+#include <linux/clocksource.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/timex.h>
+#include <linux/profile.h>
+
+#include <asm/timer64.h>
+
+static u32 sched_clock_multiplier;
+#define SCHED_CLOCK_SHIFT 16
+
+static cycle_t tsc_read(struct clocksource *cs)
+{
+       return get_cycles();
+}
+
+static struct clocksource clocksource_tsc = {
+       .name           = "timestamp",
+       .rating         = 300,
+       .read           = tsc_read,
+       .mask           = CLOCKSOURCE_MASK(64),
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+/*
+ * scheduler clock - returns current time in nanoseconds.
+ */
+u64 sched_clock(void)
+{
+       u64 tsc = get_cycles();
+
+       return (tsc * sched_clock_multiplier) >> SCHED_CLOCK_SHIFT;
+}
+
+void time_init(void)
+{
+       u64 tmp = (u64)NSEC_PER_SEC << SCHED_CLOCK_SHIFT;
+
+       do_div(tmp, c6x_core_freq);
+       sched_clock_multiplier = tmp;
+
+       clocksource_register_hz(&clocksource_tsc, c6x_core_freq);
+
+       /* write anything into TSCL to enable counting */
+       set_creg(TSCL, 0);
+
+       /* probe for timer64 event timer */
+       timer64_init();
+}
diff --git a/arch/c6x/kernel/traps.c b/arch/c6x/kernel/traps.c
new file mode 100644 (file)
index 0000000..f50e3ed
--- /dev/null
@@ -0,0 +1,423 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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/module.h>
+#include <linux/ptrace.h>
+#include <linux/kallsyms.h>
+#include <linux/bug.h>
+
+#include <asm/soc.h>
+#include <asm/traps.h>
+
+int (*c6x_nmi_handler)(struct pt_regs *regs);
+
+void __init trap_init(void)
+{
+       ack_exception(EXCEPT_TYPE_NXF);
+       ack_exception(EXCEPT_TYPE_EXC);
+       ack_exception(EXCEPT_TYPE_IXF);
+       ack_exception(EXCEPT_TYPE_SXF);
+       enable_exception();
+}
+
+void show_regs(struct pt_regs *regs)
+{
+       pr_err("\n");
+       pr_err("PC: %08lx SP: %08lx\n", regs->pc, regs->sp);
+       pr_err("Status: %08lx ORIG_A4: %08lx\n", regs->csr, regs->orig_a4);
+       pr_err("A0: %08lx  B0: %08lx\n", regs->a0, regs->b0);
+       pr_err("A1: %08lx  B1: %08lx\n", regs->a1, regs->b1);
+       pr_err("A2: %08lx  B2: %08lx\n", regs->a2, regs->b2);
+       pr_err("A3: %08lx  B3: %08lx\n", regs->a3, regs->b3);
+       pr_err("A4: %08lx  B4: %08lx\n", regs->a4, regs->b4);
+       pr_err("A5: %08lx  B5: %08lx\n", regs->a5, regs->b5);
+       pr_err("A6: %08lx  B6: %08lx\n", regs->a6, regs->b6);
+       pr_err("A7: %08lx  B7: %08lx\n", regs->a7, regs->b7);
+       pr_err("A8: %08lx  B8: %08lx\n", regs->a8, regs->b8);
+       pr_err("A9: %08lx  B9: %08lx\n", regs->a9, regs->b9);
+       pr_err("A10: %08lx  B10: %08lx\n", regs->a10, regs->b10);
+       pr_err("A11: %08lx  B11: %08lx\n", regs->a11, regs->b11);
+       pr_err("A12: %08lx  B12: %08lx\n", regs->a12, regs->b12);
+       pr_err("A13: %08lx  B13: %08lx\n", regs->a13, regs->b13);
+       pr_err("A14: %08lx  B14: %08lx\n", regs->a14, regs->dp);
+       pr_err("A15: %08lx  B15: %08lx\n", regs->a15, regs->sp);
+       pr_err("A16: %08lx  B16: %08lx\n", regs->a16, regs->b16);
+       pr_err("A17: %08lx  B17: %08lx\n", regs->a17, regs->b17);
+       pr_err("A18: %08lx  B18: %08lx\n", regs->a18, regs->b18);
+       pr_err("A19: %08lx  B19: %08lx\n", regs->a19, regs->b19);
+       pr_err("A20: %08lx  B20: %08lx\n", regs->a20, regs->b20);
+       pr_err("A21: %08lx  B21: %08lx\n", regs->a21, regs->b21);
+       pr_err("A22: %08lx  B22: %08lx\n", regs->a22, regs->b22);
+       pr_err("A23: %08lx  B23: %08lx\n", regs->a23, regs->b23);
+       pr_err("A24: %08lx  B24: %08lx\n", regs->a24, regs->b24);
+       pr_err("A25: %08lx  B25: %08lx\n", regs->a25, regs->b25);
+       pr_err("A26: %08lx  B26: %08lx\n", regs->a26, regs->b26);
+       pr_err("A27: %08lx  B27: %08lx\n", regs->a27, regs->b27);
+       pr_err("A28: %08lx  B28: %08lx\n", regs->a28, regs->b28);
+       pr_err("A29: %08lx  B29: %08lx\n", regs->a29, regs->b29);
+       pr_err("A30: %08lx  B30: %08lx\n", regs->a30, regs->b30);
+       pr_err("A31: %08lx  B31: %08lx\n", regs->a31, regs->b31);
+}
+
+void dump_stack(void)
+{
+       unsigned long stack;
+
+       show_stack(current, &stack);
+}
+EXPORT_SYMBOL(dump_stack);
+
+
+void die(char *str, struct pt_regs *fp, int nr)
+{
+       console_verbose();
+       pr_err("%s: %08x\n", str, nr);
+       show_regs(fp);
+
+       pr_err("Process %s (pid: %d, stackpage=%08lx)\n",
+              current->comm, current->pid, (PAGE_SIZE +
+                                            (unsigned long) current));
+
+       dump_stack();
+       while (1)
+               ;
+}
+
+static void die_if_kernel(char *str, struct pt_regs *fp, int nr)
+{
+       if (user_mode(fp))
+               return;
+
+       die(str, fp, nr);
+}
+
+
+/* Internal exceptions */
+static struct exception_info iexcept_table[10] = {
+       { "Oops - instruction fetch", SIGBUS, BUS_ADRERR },
+       { "Oops - fetch packet", SIGBUS, BUS_ADRERR },
+       { "Oops - execute packet", SIGILL, ILL_ILLOPC },
+       { "Oops - undefined instruction", SIGILL, ILL_ILLOPC },
+       { "Oops - resource conflict", SIGILL, ILL_ILLOPC },
+       { "Oops - resource access", SIGILL, ILL_PRVREG },
+       { "Oops - privilege", SIGILL, ILL_PRVOPC },
+       { "Oops - loops buffer", SIGILL, ILL_ILLOPC },
+       { "Oops - software exception", SIGILL, ILL_ILLTRP },
+       { "Oops - unknown exception", SIGILL, ILL_ILLOPC }
+};
+
+/* External exceptions */
+static struct exception_info eexcept_table[128] = {
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - external exception", SIGBUS, BUS_ADRERR },
+       { "Oops - CPU memory protection fault", SIGSEGV, SEGV_ACCERR },
+       { "Oops - CPU memory protection fault in L1P", SIGSEGV, SEGV_ACCERR },
+       { "Oops - DMA memory protection fault in L1P", SIGSEGV, SEGV_ACCERR },
+       { "Oops - CPU memory protection fault in L1D", SIGSEGV, SEGV_ACCERR },
+       { "Oops - DMA memory protection fault in L1D", SIGSEGV, SEGV_ACCERR },
+       { "Oops - CPU memory protection fault in L2", SIGSEGV, SEGV_ACCERR },
+       { "Oops - DMA memory protection fault in L2", SIGSEGV, SEGV_ACCERR },
+       { "Oops - EMC CPU memory protection fault", SIGSEGV, SEGV_ACCERR },
+       { "Oops - EMC bus error", SIGBUS, BUS_ADRERR }
+};
+
+static void do_trap(struct exception_info *except_info, struct pt_regs *regs)
+{
+       unsigned long addr = instruction_pointer(regs);
+       siginfo_t info;
+
+       if (except_info->code != TRAP_BRKPT)
+               pr_err("TRAP: %s PC[0x%lx] signo[%d] code[%d]\n",
+                      except_info->kernel_str, regs->pc,
+                      except_info->signo, except_info->code);
+
+       die_if_kernel(except_info->kernel_str, regs, addr);
+
+       info.si_signo = except_info->signo;
+       info.si_errno = 0;
+       info.si_code  = except_info->code;
+       info.si_addr  = (void __user *)addr;
+
+       force_sig_info(except_info->signo, &info, current);
+}
+
+/*
+ * Process an internal exception (non maskable)
+ */
+static int process_iexcept(struct pt_regs *regs)
+{
+       unsigned int iexcept_report = get_iexcept();
+       unsigned int iexcept_num;
+
+       ack_exception(EXCEPT_TYPE_IXF);
+
+       pr_err("IEXCEPT: PC[0x%lx]\n", regs->pc);
+
+       while (iexcept_report) {
+               iexcept_num = __ffs(iexcept_report);
+               iexcept_report &= ~(1 << iexcept_num);
+               set_iexcept(iexcept_report);
+               if (*(unsigned int *)regs->pc == BKPT_OPCODE) {
+                       /* This is a breakpoint */
+                       struct exception_info bkpt_exception = {
+                               "Oops - undefined instruction",
+                                 SIGTRAP, TRAP_BRKPT
+                       };
+                       do_trap(&bkpt_exception, regs);
+                       iexcept_report &= ~(0xFF);
+                       set_iexcept(iexcept_report);
+                       continue;
+               }
+
+               do_trap(&iexcept_table[iexcept_num], regs);
+       }
+       return 0;
+}
+
+/*
+ * Process an external exception (maskable)
+ */
+static void process_eexcept(struct pt_regs *regs)
+{
+       int evt;
+
+       pr_err("EEXCEPT: PC[0x%lx]\n", regs->pc);
+
+       while ((evt = soc_get_exception()) >= 0)
+               do_trap(&eexcept_table[evt], regs);
+
+       ack_exception(EXCEPT_TYPE_EXC);
+}
+
+/*
+ * Main exception processing
+ */
+asmlinkage int process_exception(struct pt_regs *regs)
+{
+       unsigned int type;
+       unsigned int type_num;
+       unsigned int ie_num = 9; /* default is unknown exception */
+
+       while ((type = get_except_type()) != 0) {
+               type_num = fls(type) - 1;
+
+               switch (type_num) {
+               case EXCEPT_TYPE_NXF:
+                       ack_exception(EXCEPT_TYPE_NXF);
+                       if (c6x_nmi_handler)
+                               (c6x_nmi_handler)(regs);
+                       else
+                               pr_alert("NMI interrupt!\n");
+                       break;
+
+               case EXCEPT_TYPE_IXF:
+                       if (process_iexcept(regs))
+                               return 1;
+                       break;
+
+               case EXCEPT_TYPE_EXC:
+                       process_eexcept(regs);
+                       break;
+
+               case EXCEPT_TYPE_SXF:
+                       ie_num = 8;
+               default:
+                       ack_exception(type_num);
+                       do_trap(&iexcept_table[ie_num], regs);
+                       break;
+               }
+       }
+       return 0;
+}
+
+static int kstack_depth_to_print = 48;
+
+static void show_trace(unsigned long *stack, unsigned long *endstack)
+{
+       unsigned long addr;
+       int i;
+
+       pr_debug("Call trace:");
+       i = 0;
+       while (stack + 1 <= endstack) {
+               addr = *stack++;
+               /*
+                * If the address is either in the text segment of the
+                * kernel, or in the region which contains vmalloc'ed
+                * memory, it *may* be the address of a calling
+                * routine; if so, print it so that someone tracing
+                * down the cause of the crash will be able to figure
+                * out the call path that was taken.
+                */
+               if (__kernel_text_address(addr)) {
+#ifndef CONFIG_KALLSYMS
+                       if (i % 5 == 0)
+                               pr_debug("\n        ");
+#endif
+                       pr_debug(" [<%08lx>]", addr);
+                       print_symbol(" %s\n", addr);
+                       i++;
+               }
+       }
+       pr_debug("\n");
+}
+
+void show_stack(struct task_struct *task, unsigned long *stack)
+{
+       unsigned long *p, *endstack;
+       int i;
+
+       if (!stack) {
+               if (task && task != current)
+                       /* We know this is a kernel stack,
+                          so this is the start/end */
+                       stack = (unsigned long *)thread_saved_ksp(task);
+               else
+                       stack = (unsigned long *)&stack;
+       }
+       endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1)
+                                    & -THREAD_SIZE);
+
+       pr_debug("Stack from %08lx:", (unsigned long)stack);
+       for (i = 0, p = stack; i < kstack_depth_to_print; i++) {
+               if (p + 1 > endstack)
+                       break;
+               if (i % 8 == 0)
+                       pr_cont("\n         ");
+               pr_cont(" %08lx", *p++);
+       }
+       pr_cont("\n");
+       show_trace(stack, endstack);
+}
+
+int is_valid_bugaddr(unsigned long addr)
+{
+       return __kernel_text_address(addr);
+}
diff --git a/arch/c6x/kernel/vectors.S b/arch/c6x/kernel/vectors.S
new file mode 100644 (file)
index 0000000..c95c66f
--- /dev/null
@@ -0,0 +1,81 @@
+;
+;  Port on Texas Instruments TMS320C6x architecture
+;
+;  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+;  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+;
+;  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.
+;
+;  This section handles all the interrupt vector routines.
+;  At RESET the processor sets up the DRAM timing parameters and
+;  branches to the label _c_int00 which handles initialization for the C code.
+;
+
+#define ALIGNMENT 5
+
+       .macro IRQVEC name, handler
+       .align ALIGNMENT
+       .hidden \name
+       .global \name
+\name:
+#ifdef CONFIG_C6X_BIG_KERNEL
+       STW     .D2T1   A0,*B15--[2]
+ ||    MVKL    .S1     \handler,A0
+       MVKH    .S1     \handler,A0
+       B       .S2X    A0
+       LDW     .D2T1   *++B15[2],A0
+       NOP     4
+       NOP
+       NOP
+       .endm
+#else /* CONFIG_C6X_BIG_KERNEL */
+       B       .S2     \handler
+       NOP
+       NOP
+       NOP
+       NOP
+       NOP
+       NOP
+       NOP
+       .endm
+#endif /* CONFIG_C6X_BIG_KERNEL */
+
+          .sect ".vectors","ax"
+          .align ALIGNMENT
+          .global RESET
+          .hidden RESET
+RESET:
+#ifdef CONFIG_C6X_BIG_KERNEL
+          MVKL .S1     _c_int00,A0             ; branch to _c_int00
+          MVKH .S1     _c_int00,A0
+          B    .S2X    A0
+#else
+          B    .S2     _c_int00
+          NOP
+          NOP
+#endif
+          NOP
+          NOP
+          NOP
+          NOP
+          NOP
+
+
+          IRQVEC NMI,_nmi_handler              ; NMI interrupt
+          IRQVEC AINT,_bad_interrupt           ; reserved
+          IRQVEC MSGINT,_bad_interrupt         ; reserved
+
+          IRQVEC INT4,_int4_handler
+          IRQVEC INT5,_int5_handler
+          IRQVEC INT6,_int6_handler
+          IRQVEC INT7,_int7_handler
+          IRQVEC INT8,_int8_handler
+          IRQVEC INT9,_int9_handler
+          IRQVEC INT10,_int10_handler
+          IRQVEC INT11,_int11_handler
+          IRQVEC INT12,_int12_handler
+          IRQVEC INT13,_int13_handler
+          IRQVEC INT14,_int14_handler
+          IRQVEC INT15,_int15_handler
diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S
new file mode 100644 (file)
index 0000000..1d81c4c
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * ld script for the c6x kernel
+ *
+ *  Copyright (C) 2010, 2011 Texas Instruments Incorporated
+ *  Mark Salter <msalter@redhat.com>
+ */
+#include <asm-generic/vmlinux.lds.h>
+#include <asm/thread_info.h>
+#include <asm/page.h>
+
+ENTRY(_c_int00)
+
+#if defined(CONFIG_CPU_BIG_ENDIAN)
+jiffies = jiffies_64 + 4;
+#else
+jiffies = jiffies_64;
+#endif
+
+#define        READONLY_SEGMENT_START  \
+       . = PAGE_OFFSET;
+#define        READWRITE_SEGMENT_START \
+       . = ALIGN(128);         \
+       _data_lma = .;
+
+SECTIONS
+{
+       /*
+        * Start kernel read only segment
+        */
+       READONLY_SEGMENT_START
+
+       .vectors :
+       {
+               _vectors_start = .;
+               *(.vectors)
+               . = ALIGN(0x400);
+               _vectors_end = .;
+       }
+
+       . = ALIGN(0x1000);
+       .cmdline :
+       {
+               *(.cmdline)
+       }
+
+       /*
+        * This section contains data which may be shared with other
+        * cores. It needs to be a fixed offset from PAGE_OFFSET
+        * regardless of kernel configuration.
+        */
+       .virtio_ipc_dev :
+       {
+               *(.virtio_ipc_dev)
+       }
+
+       . = ALIGN(PAGE_SIZE);
+       .init :
+       {
+               _stext = .;
+               _sinittext = .;
+               HEAD_TEXT
+               INIT_TEXT
+               _einittext = .;
+       }
+
+       __init_begin = _stext;
+       INIT_DATA_SECTION(16)
+
+       PERCPU_SECTION(128)
+
+       . = ALIGN(PAGE_SIZE);
+       __init_end = .;
+
+       .text :
+       {
+               _text = .;
+               TEXT_TEXT
+               SCHED_TEXT
+               LOCK_TEXT
+               IRQENTRY_TEXT
+               KPROBES_TEXT
+               *(.fixup)
+               *(.gnu.warning)
+       }
+
+       EXCEPTION_TABLE(16)
+       NOTES
+
+       RO_DATA_SECTION(PAGE_SIZE)
+       .const :
+       {
+               *(.const .const.* .gnu.linkonce.r.*)
+               *(.switch)
+       }
+
+       . = ALIGN (8) ;
+       __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET)
+       {
+               _fdt_start = . ;        /* place for fdt blob */
+               *(__fdt_blob) ;         /* Any link-placed DTB */
+               BYTE(0);                /* section always has contents */
+               . = _fdt_start + 0x4000;        /* Pad up to 16kbyte */
+               _fdt_end = . ;
+       }
+
+       _etext = .;
+
+       /*
+        * Start kernel read-write segment.
+        */
+       READWRITE_SEGMENT_START
+       _sdata = .;
+
+       .fardata : AT(ADDR(.fardata) - LOAD_OFFSET)
+       {
+               INIT_TASK_DATA(THREAD_SIZE)
+               NOSAVE_DATA
+               PAGE_ALIGNED_DATA(PAGE_SIZE)
+               CACHELINE_ALIGNED_DATA(128)
+               READ_MOSTLY_DATA(128)
+               DATA_DATA
+               CONSTRUCTORS
+               *(.data1)
+               *(.fardata .fardata.*)
+               *(.data.debug_bpt)
+       }
+
+       .neardata ALIGN(8) : AT(ADDR(.neardata) - LOAD_OFFSET)
+       {
+               *(.neardata2 .neardata2.* .gnu.linkonce.s2.*)
+               *(.neardata .neardata.* .gnu.linkonce.s.*)
+               . = ALIGN(8);
+       }
+
+       _edata = .;
+
+       __bss_start = .;
+       SBSS(8)
+       BSS(8)
+       .far :
+       {
+               . = ALIGN(8);
+               *(.dynfar)
+               *(.far .far.* .gnu.linkonce.b.*)
+               . = ALIGN(8);
+       }
+       __bss_stop = .;
+
+       _end = .;
+
+       DWARF_DEBUG
+
+       /DISCARD/ :
+       {
+                 EXIT_TEXT
+                 EXIT_DATA
+                 EXIT_CALL
+                 *(.discard)
+                 *(.discard.*)
+                 *(.interp)
+       }
+}
diff --git a/arch/c6x/lib/Makefile b/arch/c6x/lib/Makefile
new file mode 100644 (file)
index 0000000..ffd3c65
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Makefile for arch/c6x/lib/
+#
+
+lib-y := divu.o divi.o pop_rts.o push_rts.o remi.o remu.o strasgi.o llshru.o
+lib-y += llshr.o llshl.o negll.o mpyll.o divremi.o divremu.o
+lib-y += checksum.o csum_64plus.o memcpy_64plus.o strasgi_64plus.o
diff --git a/arch/c6x/lib/checksum.c b/arch/c6x/lib/checksum.c
new file mode 100644 (file)
index 0000000..67cc93b
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *             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.
+ */
+#include <linux/module.h>
+#include <net/checksum.h>
+
+#include <asm/byteorder.h>
+
+/*
+ * copy from fs while checksumming, otherwise like csum_partial
+ */
+__wsum
+csum_partial_copy_from_user(const void __user *src, void *dst, int len,
+                           __wsum sum, int *csum_err)
+{
+       int missing;
+
+       missing = __copy_from_user(dst, src, len);
+       if (missing) {
+               memset(dst + len - missing, 0, missing);
+               *csum_err = -EFAULT;
+       } else
+               *csum_err = 0;
+
+       return csum_partial(dst, len, sum);
+}
+EXPORT_SYMBOL(csum_partial_copy_from_user);
+
+/* These are from csum_64plus.S */
+EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(csum_partial_copy);
+EXPORT_SYMBOL(ip_compute_csum);
+EXPORT_SYMBOL(ip_fast_csum);
diff --git a/arch/c6x/lib/csum_64plus.S b/arch/c6x/lib/csum_64plus.S
new file mode 100644 (file)
index 0000000..6d25896
--- /dev/null
@@ -0,0 +1,419 @@
+;
+;  linux/arch/c6x/lib/csum_64plus.s
+;
+;  Port on Texas Instruments TMS320C6x architecture
+;
+;  Copyright (C) 2006, 2009, 2010, 2011 Texas Instruments Incorporated
+;  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+;
+;  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/linkage.h>
+
+;
+;unsigned int csum_partial_copy(const char *src, char * dst,
+;                              int len, int sum)
+;
+; A4:  src
+; B4:  dst
+; A6:  len
+; B6:  sum
+; return csum in A4
+;
+
+       .text
+ENTRY(csum_partial_copy)
+       MVC     .S2     ILC,B30
+
+       MV      .D1X    B6,A31          ; given csum
+       ZERO    .D1     A9              ; csum (a side)
+||     ZERO    .D2     B9              ; csum (b side)
+||     SHRU    .S2X    A6,2,B5         ; len / 4
+
+       ;; Check alignment and size
+       AND     .S1     3,A4,A1
+||     AND     .S2     3,B4,B0
+       OR      .L2X    B0,A1,B0        ; non aligned condition
+||     MVC     .S2     B5,ILC
+||     MVK     .D2     1,B2
+||     MV      .D1X    B5,A1           ; words condition
+  [!A1]        B       .S1     L8
+   [B0] BNOP   .S1     L6,5
+
+       SPLOOP          1
+
+       ;; Main loop for aligned words
+       LDW     .D1T1   *A4++,A7
+       NOP     4
+       MV      .S2X    A7,B7
+||     EXTU    .S1     A7,0,16,A16
+       STW     .D2T2   B7,*B4++
+||     MPYU    .M2     B7,B2,B8
+||     ADD     .L1     A16,A9,A9
+       NOP
+       SPKERNEL        8,0
+||     ADD     .L2     B8,B9,B9
+
+       ZERO    .D1     A1
+||     ADD     .L1X    A9,B9,A9        ;  add csum from a and b sides
+
+L6:
+  [!A1]        BNOP    .S1     L8,5
+
+       ;; Main loop for non-aligned words
+       SPLOOP          2
+ ||    MVK     .L1     1,A2
+
+       LDNW    .D1T1   *A4++,A7
+       NOP             3
+
+       NOP
+       MV      .S2X    A7,B7
+ ||    EXTU    .S1     A7,0,16,A16
+ ||    MPYU    .M1     A7,A2,A8
+
+       ADD     .L1     A16,A9,A9
+       SPKERNEL        6,0
+ ||    STNW    .D2T2   B7,*B4++
+ ||    ADD     .L1     A8,A9,A9
+
+L8:    AND     .S2X    2,A6,B5
+       CMPGT   .L2     B5,0,B0
+  [!B0]        BNOP    .S1     L82,4
+
+       ;; Manage half-word
+       ZERO    .L1     A7
+||     ZERO    .D1     A8
+
+#ifdef CONFIG_CPU_BIG_ENDIAN
+
+       LDBU    .D1T1   *A4++,A7
+       LDBU    .D1T1   *A4++,A8
+       NOP             3
+       SHL     .S1     A7,8,A0
+       ADD     .S1     A8,A9,A9
+       STB     .D2T1   A7,*B4++
+||     ADD     .S1     A0,A9,A9
+       STB     .D2T1   A8,*B4++
+
+#else
+
+       LDBU    .D1T1   *A4++,A7
+       LDBU    .D1T1   *A4++,A8
+       NOP             3
+       ADD     .S1     A7,A9,A9
+       SHL     .S1     A8,8,A0
+
+       STB     .D2T1   A7,*B4++
+||     ADD     .S1     A0,A9,A9
+       STB     .D2T1   A8,*B4++
+
+#endif
+
+       ;; Manage eventually the last byte
+L82:   AND     .S2X    1,A6,B0
+  [!B0]        BNOP    .S1     L9,5
+
+||     ZERO    .L1     A7
+
+L83:   LDBU    .D1T1   *A4++,A7
+       NOP             4
+
+       MV      .L2X    A7,B7
+
+#ifdef CONFIG_CPU_BIG_ENDIAN
+
+       STB     .D2T2   B7,*B4++
+||     SHL     .S1     A7,8,A7
+       ADD     .S1     A7,A9,A9
+
+#else
+
+       STB     .D2T2   B7,*B4++
+||     ADD     .S1     A7,A9,A9
+
+#endif
+
+       ;; Fold the csum
+L9:    SHRU    .S2X    A9,16,B0
+  [!B0]        BNOP    .S1     L10,5
+
+L91:   SHRU    .S2X    A9,16,B4
+||     EXTU    .S1     A9,16,16,A3
+       ADD     .D1X    A3,B4,A9
+
+       SHRU    .S1     A9,16,A0
+   [A0]        BNOP    .S1     L91,5
+
+L10:   ADD     .D1     A31,A9,A9
+       MV      .D1     A9,A4
+
+       BNOP    .S2     B3,4
+       MVC     .S2     B30,ILC
+ENDPROC(csum_partial_copy)
+
+;
+;unsigned short
+;ip_fast_csum(unsigned char *iph, unsigned int ihl)
+;{
+;      unsigned int checksum = 0;
+;      unsigned short *tosum = (unsigned short *) iph;
+;      int len;
+;
+;      len = ihl*4;
+;
+;      if (len <= 0)
+;              return 0;
+;
+;      while(len) {
+;              len -= 2;
+;              checksum += *tosum++;
+;      }
+;      if (len & 1)
+;              checksum += *(unsigned char*) tosum;
+;
+;      while(checksum >> 16)
+;              checksum = (checksum & 0xffff) + (checksum >> 16);
+;
+;      return ~checksum;
+;}
+;
+; A4:  iph
+; B4:  ihl
+; return checksum in A4
+;
+       .text
+
+ENTRY(ip_fast_csum)
+       ZERO    .D1     A5
+ ||    MVC     .S2     ILC,B30
+       SHL     .S2     B4,2,B0
+       CMPGT   .L2     B0,0,B1
+  [!B1] BNOP   .S1     L15,4
+  [!B1]        ZERO    .D1     A3
+
+  [!B0]        B       .S1     L12
+       SHRU    .S2     B0,1,B0
+       MVC     .S2     B0,ILC
+       NOP     3
+
+       SPLOOP  1
+       LDHU    .D1T1   *A4++,A3
+       NOP     3
+       NOP
+       SPKERNEL        5,0
+ ||    ADD     .L1     A3,A5,A5
+
+L12:   SHRU    .S1     A5,16,A0
+  [!A0]        BNOP    .S1     L14,5
+
+L13:   SHRU    .S2X    A5,16,B4
+       EXTU    .S1     A5,16,16,A3
+       ADD     .D1X    A3,B4,A5
+       SHRU    .S1     A5,16,A0
+  [A0] BNOP    .S1     L13,5
+
+L14:   NOT     .D1     A5,A3
+       EXTU    .S1     A3,16,16,A3
+
+L15:   BNOP    .S2     B3,3
+       MVC     .S2     B30,ILC
+       MV      .D1     A3,A4
+ENDPROC(ip_fast_csum)
+
+;
+;unsigned short
+;do_csum(unsigned char *buff, unsigned int len)
+;{
+;      int odd, count;
+;      unsigned int result = 0;
+;
+;      if (len <= 0)
+;              goto out;
+;      odd = 1 & (unsigned long) buff;
+;      if (odd) {
+;#ifdef __LITTLE_ENDIAN
+;              result += (*buff << 8);
+;#else
+;              result = *buff;
+;#endif
+;              len--;
+;              buff++;
+;      }
+;      count = len >> 1;               /* nr of 16-bit words.. */
+;      if (count) {
+;              if (2 & (unsigned long) buff) {
+;                      result += *(unsigned short *) buff;
+;                      count--;
+;                      len -= 2;
+;                      buff += 2;
+;              }
+;              count >>= 1;            /* nr of 32-bit words.. */
+;              if (count) {
+;                      unsigned int carry = 0;
+;                      do {
+;                              unsigned int w = *(unsigned int *) buff;
+;                              count--;
+;                              buff += 4;
+;                              result += carry;
+;                              result += w;
+;                              carry = (w > result);
+;                      } while (count);
+;                      result += carry;
+;                      result = (result & 0xffff) + (result >> 16);
+;              }
+;              if (len & 2) {
+;                      result += *(unsigned short *) buff;
+;                      buff += 2;
+;              }
+;      }
+;      if (len & 1)
+;#ifdef __LITTLE_ENDIAN
+;              result += *buff;
+;#else
+;              result += (*buff << 8);
+;#endif
+;      result = (result & 0xffff) + (result >> 16);
+;      /* add up carry.. */
+;      result = (result & 0xffff) + (result >> 16);
+;      if (odd)
+;              result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
+;out:
+;      return result;
+;}
+;
+; A4:  buff
+; B4:  len
+; return checksum in A4
+;
+
+ENTRY(do_csum)
+          CMPGT   .L2     B4,0,B0
+   [!B0]   BNOP    .S1    L26,3
+          EXTU    .S1     A4,31,31,A0
+
+          MV      .L1     A0,A3
+||        MV      .S1X    B3,A5
+||        MV      .L2     B4,B3
+||        ZERO    .D1     A1
+
+#ifdef CONFIG_CPU_BIG_ENDIAN
+   [A0]    SUB    .L2     B3,1,B3
+|| [A0]    LDBU    .D1T1   *A4++,A1
+#else
+   [!A0]   BNOP    .S1    L21,5
+|| [A0]    LDBU    .D1T1   *A4++,A0
+          SUB     .L2     B3,1,B3
+||        SHL     .S1     A0,8,A1
+L21:
+#endif
+          SHR     .S2     B3,1,B0
+   [!B0]   BNOP    .S1    L24,3
+          MVK     .L1     2,A0
+          AND     .L1     A4,A0,A0
+
+   [!A0]   BNOP    .S1    L22,5
+|| [A0]    LDHU    .D1T1   *A4++,A0
+          SUB     .L2     B0,1,B0
+||        SUB     .S2     B3,2,B3
+||        ADD     .L1     A0,A1,A1
+L22:
+          SHR     .S2     B0,1,B0
+||        ZERO    .L1     A0
+
+   [!B0]   BNOP    .S1    L23,5
+|| [B0]    MVC    .S2     B0,ILC
+
+          SPLOOP  3
+          SPMASK  L1
+||        MV      .L1     A1,A2
+||        LDW     .D1T1   *A4++,A1
+
+          NOP     4
+          ADD     .L1     A0,A1,A0
+          ADD     .L1     A2,A0,A2
+
+          SPKERNEL 1,2
+||        CMPGTU  .L1     A1,A2,A0
+
+          ADD     .L1     A0,A2,A6
+          EXTU    .S1     A6,16,16,A7
+          SHRU    .S2X    A6,16,B0
+          NOP             1
+          ADD     .L1X    A7,B0,A1
+L23:
+          MVK     .L2     2,B0
+          AND     .L2     B3,B0,B0
+   [B0]    LDHU    .D1T1   *A4++,A0
+          NOP     4
+   [B0]    ADD    .L1     A0,A1,A1
+L24:
+          EXTU    .S2     B3,31,31,B0
+#ifdef CONFIG_CPU_BIG_ENDIAN
+   [!B0]   BNOP    .S1    L25,4
+|| [B0]    LDBU    .D1T1   *A4,A0
+          SHL     .S1     A0,8,A0
+          ADD     .L1     A0,A1,A1
+L25:
+#else
+   [B0]    LDBU    .D1T1   *A4,A0
+          NOP     4
+   [B0]    ADD    .L1     A0,A1,A1
+#endif
+          EXTU    .S1     A1,16,16,A0
+          SHRU    .S2X    A1,16,B0
+          NOP     1
+          ADD     .L1X    A0,B0,A0
+          SHRU    .S1     A0,16,A1
+          ADD     .L1     A0,A1,A0
+          EXTU    .S1     A0,16,16,A1
+          EXTU    .S1     A1,16,24,A2
+
+          EXTU    .S1     A1,24,16,A0
+||        MV      .L2X    A3,B0
+
+   [B0]    OR     .L1     A0,A2,A1
+L26:
+          NOP     1
+          BNOP    .S2X    A5,4
+          MV      .L1     A1,A4
+ENDPROC(do_csum)
+
+;__wsum csum_partial(const void *buff, int len, __wsum wsum)
+;{
+;      unsigned int sum = (__force unsigned int)wsum;
+;      unsigned int result = do_csum(buff, len);
+;
+;      /* add in old sum, and carry.. */
+;      result += sum;
+;      if (sum > result)
+;              result += 1;
+;      return (__force __wsum)result;
+;}
+;
+ENTRY(csum_partial)
+          MV      .L1X    B3,A9
+||        CALLP   .S2     do_csum,B3
+||        MV      .S1     A6,A8
+          BNOP    .S2X    A9,2
+          ADD     .L1     A8,A4,A1
+          CMPGTU  .L1     A8,A1,A0
+          ADD     .L1     A1,A0,A4
+ENDPROC(csum_partial)
+
+;unsigned short
+;ip_compute_csum(unsigned char *buff, unsigned int len)
+;
+; A4:  buff
+; B4:  len
+; return checksum in A4
+
+ENTRY(ip_compute_csum)
+          MV      .L1X    B3,A9
+||        CALLP   .S2     do_csum,B3
+          BNOP    .S2X    A9,3
+          NOT     .S1     A4,A4
+          CLR     .S1     A4,16,31,A4
+ENDPROC(ip_compute_csum)
diff --git a/arch/c6x/lib/divi.S b/arch/c6x/lib/divi.S
new file mode 100644 (file)
index 0000000..4bde924
--- /dev/null
@@ -0,0 +1,53 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       ;; ABI considerations for the divide functions
+       ;; The following registers are call-used:
+       ;; __c6xabi_divi A0,A1,A2,A4,A6,B0,B1,B2,B4,B5
+       ;; __c6xabi_divu A0,A1,A2,A4,A6,B0,B1,B2,B4
+       ;; __c6xabi_remi A1,A2,A4,A5,A6,B0,B1,B2,B4
+       ;; __c6xabi_remu A1,A4,A5,A7,B0,B1,B2,B4
+       ;;
+       ;; In our implementation, divu and remu are leaf functions,
+       ;; while both divi and remi call into divu.
+       ;; A0 is not clobbered by any of the functions.
+       ;; divu does not clobber B2 either, which is taken advantage of
+       ;; in remi.
+       ;; divi uses B5 to hold the original return address during
+       ;; the call to divu.
+       ;; remi uses B2 and A5 to hold the input values during the
+       ;; call to divu.  It stores B3 in on the stack.
+
+       .text
+ENTRY(__c6xabi_divi)
+       call    .s2     __c6xabi_divu
+||     mv      .d2     B3, B5
+||     cmpgt   .l1     0, A4, A1
+||     cmpgt   .l2     0, B4, B1
+
+   [A1]        neg     .l1     A4, A4
+|| [B1]        neg     .l2     B4, B4
+||     xor     .s1x    A1, B1, A1
+   [A1] addkpc .s2     _divu_ret, B3, 4
+_divu_ret:
+       neg     .l1     A4, A4
+||     mv      .l2     B3,B5
+||     ret     .s2     B5
+       nop             5
+ENDPROC(__c6xabi_divi)
diff --git a/arch/c6x/lib/divremi.S b/arch/c6x/lib/divremi.S
new file mode 100644 (file)
index 0000000..64bc5aa
--- /dev/null
@@ -0,0 +1,46 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       .text
+ENTRY(__c6xabi_divremi)
+       stw     .d2t2   B3, *B15--[2]
+||     cmpgt   .l1     0, A4, A1
+||     cmpgt   .l2     0, B4, B2
+||     mv      .s1     A4, A5
+||     call    .s2     __c6xabi_divu
+
+   [A1]        neg     .l1     A4, A4
+|| [B2]        neg     .l2     B4, B4
+||     xor     .s2x    B2, A1, B0
+||     mv      .d2     B4, B2
+
+   [B0]        addkpc  .s2     _divu_ret_1, B3, 1
+  [!B0] addkpc .s2     _divu_ret_2, B3, 1
+       nop     2
+_divu_ret_1:
+       neg     .l1     A4, A4
+_divu_ret_2:
+       ldw     .d2t2   *++B15[2], B3
+
+       mpy32   .m1x    A4, B2, A6
+       nop             3
+       ret     .s2     B3
+       sub     .l1     A5, A6, A5
+       nop     4
+ENDPROC(__c6xabi_divremi)
diff --git a/arch/c6x/lib/divremu.S b/arch/c6x/lib/divremu.S
new file mode 100644 (file)
index 0000000..caa9f23
--- /dev/null
@@ -0,0 +1,87 @@
+;;  Copyright 2011  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       .text
+ENTRY(__c6xabi_divremu)
+       ;; We use a series of up to 31 subc instructions.  First, we find
+       ;; out how many leading zero bits there are in the divisor.  This
+       ;; gives us both a shift count for aligning (shifting) the divisor
+       ;; to the, and the number of times we have to execute subc.
+
+       ;; At the end, we have both the remainder and most of the quotient
+       ;; in A4.  The top bit of the quotient is computed first and is
+       ;; placed in A2.
+
+       ;; Return immediately if the dividend is zero.  Setting B4 to 1
+       ;; is a trick to allow us to leave the following insns in the jump
+       ;; delay slot without affecting the result.
+       mv      .s2x    A4, B1
+
+  [b1] lmbd    .l2     1, B4, B1
+||[!b1] b      .s2     B3      ; RETURN A
+||[!b1] mvk    .d2     1, B4
+
+||[!b1] zero   .s1     A5
+       mv      .l1x    B1, A6
+||     shl     .s2     B4, B1, B4
+
+       ;; The loop performs a maximum of 28 steps, so we do the
+       ;; first 3 here.
+       cmpltu  .l1x    A4, B4, A2
+  [!A2]        sub     .l1x    A4, B4, A4
+||     shru    .s2     B4, 1, B4
+||     xor     .s1     1, A2, A2
+
+       shl     .s1     A2, 31, A2
+|| [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+   [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+
+       ;; RETURN A may happen here (note: must happen before the next branch)
+__divremu0:
+       cmpgt   .l2     B1, 7, B0
+|| [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+   [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+|| [b0] b      .s1     __divremu0
+   [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+   [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+   [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+   [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+   [b1]        subc    .l1x    A4,B4,A4
+|| [b1]        add     .s2     -1, B1, B1
+       ;; loop backwards branch happens here
+
+       ret     .s2     B3
+||     mvk     .s1     32, A1
+       sub     .l1     A1, A6, A6
+||     extu    .s1     A4, A6, A5
+       shl     .s1     A4, A6, A4
+       shru    .s1     A4, 1, A4
+||     sub     .l1     A6, 1, A6
+       or      .l1     A2, A4, A4
+       shru    .s1     A4, A6, A4
+       nop
+ENDPROC(__c6xabi_divremu)
diff --git a/arch/c6x/lib/divu.S b/arch/c6x/lib/divu.S
new file mode 100644 (file)
index 0000000..64af3c0
--- /dev/null
@@ -0,0 +1,98 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       ;; ABI considerations for the divide functions
+       ;; The following registers are call-used:
+       ;; __c6xabi_divi A0,A1,A2,A4,A6,B0,B1,B2,B4,B5
+       ;; __c6xabi_divu A0,A1,A2,A4,A6,B0,B1,B2,B4
+       ;; __c6xabi_remi A1,A2,A4,A5,A6,B0,B1,B2,B4
+       ;; __c6xabi_remu A1,A4,A5,A7,B0,B1,B2,B4
+       ;;
+       ;; In our implementation, divu and remu are leaf functions,
+       ;; while both divi and remi call into divu.
+       ;; A0 is not clobbered by any of the functions.
+       ;; divu does not clobber B2 either, which is taken advantage of
+       ;; in remi.
+       ;; divi uses B5 to hold the original return address during
+       ;; the call to divu.
+       ;; remi uses B2 and A5 to hold the input values during the
+       ;; call to divu.  It stores B3 in on the stack.
+
+       .text
+ENTRY(__c6xabi_divu)
+       ;; We use a series of up to 31 subc instructions.  First, we find
+       ;; out how many leading zero bits there are in the divisor.  This
+       ;; gives us both a shift count for aligning (shifting) the divisor
+       ;; to the, and the number of times we have to execute subc.
+
+       ;; At the end, we have both the remainder and most of the quotient
+       ;; in A4.  The top bit of the quotient is computed first and is
+       ;; placed in A2.
+
+       ;; Return immediately if the dividend is zero.
+        mv     .s2x    A4, B1
+   [B1]         lmbd   .l2     1, B4, B1
+|| [!B1] b     .s2     B3      ; RETURN A
+|| [!B1] mvk   .d2     1, B4
+        mv     .l1x    B1, A6
+||      shl    .s2     B4, B1, B4
+
+       ;; The loop performs a maximum of 28 steps, so we do the
+       ;; first 3 here.
+        cmpltu .l1x    A4, B4, A2
+   [!A2] sub   .l1x    A4, B4, A4
+||      shru   .s2     B4, 1, B4
+||      xor    .s1     1, A2, A2
+
+        shl    .s1     A2, 31, A2
+|| [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+
+       ;; RETURN A may happen here (note: must happen before the next branch)
+_divu_loop:
+        cmpgt  .l2     B1, 7, B0
+|| [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+|| [B0]  b     .s1     _divu_loop
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+       ;; loop backwards branch happens here
+
+        ret    .s2     B3
+||      mvk    .s1     32, A1
+        sub    .l1     A1, A6, A6
+        shl    .s1     A4, A6, A4
+        shru   .s1     A4, 1, A4
+||      sub    .l1     A6, 1, A6
+        or     .l1     A2, A4, A4
+        shru   .s1     A4, A6, A4
+        nop
+ENDPROC(__c6xabi_divu)
diff --git a/arch/c6x/lib/llshl.S b/arch/c6x/lib/llshl.S
new file mode 100644 (file)
index 0000000..7b105e2
--- /dev/null
@@ -0,0 +1,37 @@
+;;  Copyright (C) 2010 Texas Instruments Incorporated
+;;  Contributed by Mark Salter <msalter@redhat.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.
+
+;;  uint64_t __c6xabi_llshl(uint64_t val, uint shift)
+
+#include <linux/linkage.h>
+
+       .text
+ENTRY(__c6xabi_llshl)
+        mv     .l1x    B4,A1
+   [!A1] b     .s2     B3              ; just return if zero shift
+        mvk    .s1     32,A0
+        sub    .d1     A0,A1,A0
+        cmplt  .l1     0,A0,A2
+   [A2]         shru   .s1     A4,A0,A0
+   [!A2] neg   .l1     A0,A5
+|| [A2]  shl   .s1     A5,A1,A5
+   [!A2] shl   .s1     A4,A5,A5
+|| [A2]  or    .d1     A5,A0,A5
+|| [!A2] mvk   .l1     0,A4
+   [A2]         shl    .s1     A4,A1,A4
+        bnop   .s2     B3,5
+ENDPROC(__c6xabi_llshl)
diff --git a/arch/c6x/lib/llshr.S b/arch/c6x/lib/llshr.S
new file mode 100644 (file)
index 0000000..fde1bec
--- /dev/null
@@ -0,0 +1,38 @@
+;;  Copyright (C) 2010 Texas Instruments Incorporated
+;;  Contributed by Mark Salter <msalter@redhat.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.
+
+;;  uint64_t __c6xabi_llshr(uint64_t val, uint shift)
+
+#include <linux/linkage.h>
+
+       .text
+ENTRY(__c6xabi_llshr)
+        mv     .l1x    B4,A1
+   [!A1] b     .s2     B3              ; return if zero shift count
+        mvk    .s1     32,A0
+        sub    .d1     A0,A1,A0
+        cmplt  .l1     0,A0,A2
+   [A2]  shl   .s1     A5,A0,A0
+        nop
+   [!A2] neg   .l1     A0,A4
+|| [A2]  shru  .s1     A4,A1,A4
+   [!A2] shr   .s1     A5,A4,A4
+|| [A2]  or    .d1     A4,A0,A4
+   [!A2] shr   .s1     A5,0x1f,A5
+   [A2]  shr   .s1     A5,A1,A5
+        bnop   .s2     B3,5
+ENDPROC(__c6xabi_llshr)
diff --git a/arch/c6x/lib/llshru.S b/arch/c6x/lib/llshru.S
new file mode 100644 (file)
index 0000000..596ae3f
--- /dev/null
@@ -0,0 +1,38 @@
+;;  Copyright (C) 2010 Texas Instruments Incorporated
+;;  Contributed by Mark Salter <msalter@redhat.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.
+
+;;  uint64_t __c6xabi_llshru(uint64_t val, uint shift)
+
+#include <linux/linkage.h>
+
+       .text
+ENTRY(__c6xabi_llshru)
+        mv     .l1x    B4,A1
+   [!A1] b     .s2     B3              ; return if zero shift count
+        mvk    .s1     32,A0
+        sub    .d1     A0,A1,A0
+        cmplt  .l1     0,A0,A2
+   [A2]  shl   .s1     A5,A0,A0
+        nop
+   [!A2] neg   .l1     A0,A4
+|| [A2]  shru  .s1     A4,A1,A4
+   [!A2] shru  .s1     A5,A4,A4
+|| [A2]  or    .d1     A4,A0,A4
+|| [!A2] mvk   .l1     0,A5
+   [A2]  shru  .s1     A5,A1,A5
+        bnop   .s2     B3,5
+ENDPROC(__c6xabi_llshru)
diff --git a/arch/c6x/lib/memcpy_64plus.S b/arch/c6x/lib/memcpy_64plus.S
new file mode 100644 (file)
index 0000000..0bbc2cb
--- /dev/null
@@ -0,0 +1,46 @@
+;  Port on Texas Instruments TMS320C6x architecture
+;
+;  Copyright (C) 2006, 2009, 2010 Texas Instruments Incorporated
+;  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+;
+;  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/linkage.h>
+
+       .text
+
+ENTRY(memcpy)
+       AND     .L1     0x1,A6,A0
+ ||    AND     .S1     0x2,A6,A1
+ ||    AND     .L2X    0x4,A6,B0
+ ||    MV      .D1     A4,A3
+ ||    MVC     .S2     ILC,B2
+
+   [A0] LDB    .D2T1   *B4++,A5
+   [A1] LDB    .D2T1   *B4++,A7
+   [A1] LDB    .D2T1   *B4++,A8
+   [B0] LDNW   .D2T1   *B4++,A9
+ ||    SHRU    .S2X    A6,0x3,B1
+  [!B1] BNOP   .S2     B3,1
+
+   [A0] STB    .D1T1   A5,*A3++
+ ||[B1] MVC    .S2     B1,ILC
+   [A1] STB    .D1T1   A7,*A3++
+   [A1] STB    .D1T1   A8,*A3++
+   [B0] STNW   .D1T1   A9,*A3++        ; return when len < 8
+
+       SPLOOP  2
+
+       LDNDW   .D2T1   *B4++,A9:A8
+       NOP     3
+
+       NOP
+       SPKERNEL        0,0
+ ||    STNDW   .D1T1   A9:A8,*A3++
+
+       BNOP    .S2     B3,4
+       MVC     .S2     B2,ILC
+ENDPROC(memcpy)
diff --git a/arch/c6x/lib/mpyll.S b/arch/c6x/lib/mpyll.S
new file mode 100644 (file)
index 0000000..f103441
--- /dev/null
@@ -0,0 +1,49 @@
+;;  Copyright (C) 2010 Texas Instruments Incorporated
+;;  Contributed by Mark Salter <msalter@redhat.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.
+
+#include <linux/linkage.h>
+
+       ;; uint64_t __c6xabi_mpyll(uint64_t x, uint64_t y)
+       ;;
+       ;; 64x64 multiply
+       ;; First compute partial results using 32-bit parts of x and y:
+       ;;
+       ;;   b63         b32 b31          b0
+       ;;    -----------------------------
+       ;;    |      1      |      0      |
+       ;;    -----------------------------
+       ;;
+       ;;   P0 = X0*Y0
+       ;;   P1 = X0*Y1 + X1*Y0
+       ;;   P2 = X1*Y1
+       ;;
+       ;;   result = (P2 << 64) + (P1 << 32) + P0
+       ;;
+       ;; Since the result is also 64-bit, we can skip the P2 term.
+
+       .text
+ENTRY(__c6xabi_mpyll)
+       mpy32u  .m1x    A4,B4,A1:A0     ; X0*Y0
+       b       .s2     B3
+ ||    mpy32u  .m2x    B5,A4,B1:B0     ; X0*Y1 (don't need upper 32-bits)
+ ||    mpy32u  .m1x    A5,B4,A3:A2     ; X1*Y0 (don't need upper 32-bits)
+       nop
+       nop
+       mv      .s1     A0,A4
+       add     .l1x    A2,B0,A5
+       add     .s1     A1,A5,A5
+ENDPROC(__c6xabi_mpyll)
diff --git a/arch/c6x/lib/negll.S b/arch/c6x/lib/negll.S
new file mode 100644 (file)
index 0000000..82f4bce
--- /dev/null
@@ -0,0 +1,31 @@
+;;  Copyright (C) 2010 Texas Instruments Incorporated
+;;  Contributed by Mark Salter <msalter@redhat.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.
+
+;;  int64_t __c6xabi_negll(int64_t val)
+
+#include <linux/linkage.h>
+
+       .text
+ENTRY(__c6xabi_negll)
+       b       .s2     B3
+       mvk     .l1     0,A0
+       subu    .l1     A0,A4,A3:A2
+       sub     .l1     A0,A5,A0
+||     ext     .s1     A3,24,24,A5
+       add     .l1     A5,A0,A5
+       mv      .s1     A2,A4
+ENDPROC(__c6xabi_negll)
diff --git a/arch/c6x/lib/pop_rts.S b/arch/c6x/lib/pop_rts.S
new file mode 100644 (file)
index 0000000..d7d96c7
--- /dev/null
@@ -0,0 +1,32 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       .text
+
+ENTRY(__c6xabi_pop_rts)
+       lddw    .d2t2   *++B15, B3:B2
+       lddw    .d2t1   *++B15, A11:A10
+       lddw    .d2t2   *++B15, B11:B10
+       lddw    .d2t1   *++B15, A13:A12
+       lddw    .d2t2   *++B15, B13:B12
+       lddw    .d2t1   *++B15, A15:A14
+||     b       .s2     B3
+       ldw     .d2t2   *++B15[2], B14
+       nop     4
+ENDPROC(__c6xabi_pop_rts)
diff --git a/arch/c6x/lib/push_rts.S b/arch/c6x/lib/push_rts.S
new file mode 100644 (file)
index 0000000..f6e3db3
--- /dev/null
@@ -0,0 +1,31 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       .text
+
+ENTRY(__c6xabi_push_rts)
+       stw     .d2t2   B14, *B15--[2]
+       stdw    .d2t1   A15:A14, *B15--
+||     b       .s2x    A3
+       stdw    .d2t2   B13:B12, *B15--
+       stdw    .d2t1   A13:A12, *B15--
+       stdw    .d2t2   B11:B10, *B15--
+       stdw    .d2t1   A11:A10, *B15--
+       stdw    .d2t2   B3:B2, *B15--
+ENDPROC(__c6xabi_push_rts)
diff --git a/arch/c6x/lib/remi.S b/arch/c6x/lib/remi.S
new file mode 100644 (file)
index 0000000..6f2ca18
--- /dev/null
@@ -0,0 +1,64 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       ;; ABI considerations for the divide functions
+       ;; The following registers are call-used:
+       ;; __c6xabi_divi A0,A1,A2,A4,A6,B0,B1,B2,B4,B5
+       ;; __c6xabi_divu A0,A1,A2,A4,A6,B0,B1,B2,B4
+       ;; __c6xabi_remi A1,A2,A4,A5,A6,B0,B1,B2,B4
+       ;; __c6xabi_remu A1,A4,A5,A7,B0,B1,B2,B4
+       ;;
+       ;; In our implementation, divu and remu are leaf functions,
+       ;; while both divi and remi call into divu.
+       ;; A0 is not clobbered by any of the functions.
+       ;; divu does not clobber B2 either, which is taken advantage of
+       ;; in remi.
+       ;; divi uses B5 to hold the original return address during
+       ;; the call to divu.
+       ;; remi uses B2 and A5 to hold the input values during the
+       ;; call to divu.  It stores B3 in on the stack.
+
+       .text
+
+ENTRY(__c6xabi_remi)
+       stw     .d2t2   B3, *B15--[2]
+||     cmpgt   .l1     0, A4, A1
+||     cmpgt   .l2     0, B4, B2
+||     mv      .s1     A4, A5
+||     call    .s2     __c6xabi_divu
+
+   [A1]        neg     .l1     A4, A4
+|| [B2]        neg     .l2     B4, B4
+||     xor     .s2x    B2, A1, B0
+||     mv      .d2     B4, B2
+
+   [B0]        addkpc  .s2     _divu_ret_1, B3, 1
+  [!B0] addkpc .s2     _divu_ret_2, B3, 1
+       nop     2
+_divu_ret_1:
+       neg     .l1     A4, A4
+_divu_ret_2:
+       ldw     .d2t2   *++B15[2], B3
+
+       mpy32   .m1x    A4, B2, A6
+       nop             3
+       ret     .s2     B3
+       sub     .l1     A5, A6, A4
+       nop     4
+ENDPROC(__c6xabi_remi)
diff --git a/arch/c6x/lib/remu.S b/arch/c6x/lib/remu.S
new file mode 100644 (file)
index 0000000..3fae719
--- /dev/null
@@ -0,0 +1,82 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       ;; ABI considerations for the divide functions
+       ;; The following registers are call-used:
+       ;; __c6xabi_divi A0,A1,A2,A4,A6,B0,B1,B2,B4,B5
+       ;; __c6xabi_divu A0,A1,A2,A4,A6,B0,B1,B2,B4
+       ;; __c6xabi_remi A1,A2,A4,A5,A6,B0,B1,B2,B4
+       ;; __c6xabi_remu A1,A4,A5,A7,B0,B1,B2,B4
+       ;;
+       ;; In our implementation, divu and remu are leaf functions,
+       ;; while both divi and remi call into divu.
+       ;; A0 is not clobbered by any of the functions.
+       ;; divu does not clobber B2 either, which is taken advantage of
+       ;; in remi.
+       ;; divi uses B5 to hold the original return address during
+       ;; the call to divu.
+       ;; remi uses B2 and A5 to hold the input values during the
+       ;; call to divu.  It stores B3 in on the stack.
+
+
+       .text
+
+ENTRY(__c6xabi_remu)
+       ;; The ABI seems designed to prevent these functions calling each other,
+       ;; so we duplicate most of the divsi3 code here.
+        mv     .s2x    A4, B1
+        lmbd   .l2     1, B4, B1
+|| [!B1] b     .s2     B3      ; RETURN A
+|| [!B1] mvk   .d2     1, B4
+
+        mv     .l1x    B1, A7
+||      shl    .s2     B4, B1, B4
+
+        cmpltu .l1x    A4, B4, A1
+   [!A1] sub   .l1x    A4, B4, A4
+        shru   .s2     B4, 1, B4
+
+_remu_loop:
+        cmpgt  .l2     B1, 7, B0
+|| [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+       ;; RETURN A may happen here (note: must happen before the next branch)
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+|| [B0]         b      .s1     _remu_loop
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+       ;; loop backwards branch happens here
+
+        ret    .s2     B3
+   [B1]         subc   .l1x    A4,B4,A4
+|| [B1]         add    .s2     -1, B1, B1
+   [B1]         subc   .l1x    A4,B4,A4
+
+        extu   .s1     A4, A7, A4
+        nop    2
+ENDPROC(__c6xabi_remu)
diff --git a/arch/c6x/lib/strasgi.S b/arch/c6x/lib/strasgi.S
new file mode 100644 (file)
index 0000000..de27407
--- /dev/null
@@ -0,0 +1,89 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       .text
+
+ENTRY(__c6xabi_strasgi)
+       ;; This is essentially memcpy, with alignment known to be at least
+       ;; 4, and the size a multiple of 4 greater than or equal to 28.
+        ldw    .d2t1   *B4++, A0
+||      mvk    .s2     16, B1
+        ldw    .d2t1   *B4++, A1
+||      mvk    .s2     20, B2
+||      sub    .d1     A6, 24, A6
+        ldw    .d2t1   *B4++, A5
+        ldw    .d2t1   *B4++, A7
+||      mv     .l2x    A6, B7
+        ldw    .d2t1   *B4++, A8
+        ldw    .d2t1   *B4++, A9
+||      mv     .s2x    A0, B5
+||      cmpltu .l2     B2, B7, B0
+
+_strasgi_loop:
+        stw    .d1t2   B5, *A4++
+|| [B0]         ldw    .d2t1   *B4++, A0
+||      mv     .s2x    A1, B5
+||      mv     .l2     B7, B6
+
+   [B0]         sub    .d2     B6, 24, B7
+|| [B0]         b      .s2     _strasgi_loop
+||      cmpltu .l2     B1, B6, B0
+
+   [B0]         ldw    .d2t1   *B4++, A1
+||      stw    .d1t2   B5, *A4++
+||      mv     .s2x    A5, B5
+||      cmpltu .l2     12, B6, B0
+
+   [B0]         ldw    .d2t1   *B4++, A5
+||      stw    .d1t2   B5, *A4++
+||      mv     .s2x    A7, B5
+||      cmpltu .l2     8, B6, B0
+
+   [B0]         ldw    .d2t1   *B4++, A7
+||      stw    .d1t2   B5, *A4++
+||      mv     .s2x    A8, B5
+||      cmpltu .l2     4, B6, B0
+
+   [B0]         ldw    .d2t1   *B4++, A8
+||      stw    .d1t2   B5, *A4++
+||      mv     .s2x    A9, B5
+||      cmpltu .l2     0, B6, B0
+
+   [B0]         ldw    .d2t1   *B4++, A9
+||      stw    .d1t2   B5, *A4++
+||      mv     .s2x    A0, B5
+||      cmpltu .l2     B2, B7, B0
+
+       ;; loop back branch happens here
+
+        cmpltu .l2     B1, B6, B0
+||      ret    .s2     b3
+
+   [B0]         stw    .d1t1   A1, *A4++
+||      cmpltu .l2     12, B6, B0
+   [B0]         stw    .d1t1   A5, *A4++
+||      cmpltu .l2     8, B6, B0
+   [B0]         stw    .d1t1   A7, *A4++
+||      cmpltu .l2     4, B6, B0
+   [B0]         stw    .d1t1   A8, *A4++
+||      cmpltu .l2     0, B6, B0
+   [B0]         stw    .d1t1   A9, *A4++
+
+       ;; return happens here
+ENDPROC(__c6xabi_strasgi)
diff --git a/arch/c6x/lib/strasgi_64plus.S b/arch/c6x/lib/strasgi_64plus.S
new file mode 100644 (file)
index 0000000..c9fd159
--- /dev/null
@@ -0,0 +1,39 @@
+;;  Copyright 2010  Free Software Foundation, Inc.
+;;  Contributed by Bernd Schmidt <bernds@codesourcery.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.
+
+#include <linux/linkage.h>
+
+       .text
+
+ENTRY(__c6xabi_strasgi_64plus)
+       shru    .s2x    a6, 2, b31
+||     mv      .s1     a4, a30
+||     mv      .d2     b4, b30
+
+       add     .s2     -4, b31, b31
+
+       sploopd         1
+||     mvc     .s2     b31, ilc
+       ldw     .d2t2   *b30++, b31
+       nop     4
+       mv      .s1x    b31,a31
+       spkernel        6, 0
+||     stw     .d1t1   a31, *a30++
+
+       ret     .s2     b3
+       nop 5
+ENDPROC(__c6xabi_strasgi_64plus)
diff --git a/arch/c6x/mm/Makefile b/arch/c6x/mm/Makefile
new file mode 100644 (file)
index 0000000..136a975
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the linux c6x-specific parts of the memory manager.
+#
+
+obj-y := init.o dma-coherent.o
diff --git a/arch/c6x/mm/dma-coherent.c b/arch/c6x/mm/dma-coherent.c
new file mode 100644 (file)
index 0000000..4187e51
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot <aurelien.jacquiot@ti.com>
+ *
+ *  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.
+ *
+ *  DMA uncached mapping support.
+ *
+ *  Using code pulled from ARM
+ *  Copyright (C) 2000-2004 Russell King
+ *
+ */
+#include <linux/slab.h>
+#include <linux/bitmap.h>
+#include <linux/bitops.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
+#include <linux/memblock.h>
+
+#include <asm/page.h>
+
+/*
+ * DMA coherent memory management, can be redefined using the memdma=
+ * kernel command line
+ */
+
+/* none by default */
+static phys_addr_t dma_base;
+static u32 dma_size;
+static u32 dma_pages;
+
+static unsigned long *dma_bitmap;
+
+/* bitmap lock */
+static DEFINE_SPINLOCK(dma_lock);
+
+/*
+ * Return a DMA coherent and contiguous memory chunk from the DMA memory
+ */
+static inline u32 __alloc_dma_pages(int order)
+{
+       unsigned long flags;
+       u32 pos;
+
+       spin_lock_irqsave(&dma_lock, flags);
+       pos = bitmap_find_free_region(dma_bitmap, dma_pages, order);
+       spin_unlock_irqrestore(&dma_lock, flags);
+
+       return dma_base + (pos << PAGE_SHIFT);
+}
+
+static void __free_dma_pages(u32 addr, int order)
+{
+       unsigned long flags;
+       u32 pos = (addr - dma_base) >> PAGE_SHIFT;
+
+       if (addr < dma_base || (pos + (1 << order)) >= dma_pages) {
+               printk(KERN_ERR "%s: freeing outside range.\n", __func__);
+               BUG();
+       }
+
+       spin_lock_irqsave(&dma_lock, flags);
+       bitmap_release_region(dma_bitmap, pos, order);
+       spin_unlock_irqrestore(&dma_lock, flags);
+}
+
+/*
+ * Allocate DMA coherent memory space and return both the kernel
+ * virtual and DMA address for that space.
+ */
+void *dma_alloc_coherent(struct device *dev, size_t size,
+                        dma_addr_t *handle, gfp_t gfp)
+{
+       u32 paddr;
+       int order;
+
+       if (!dma_size || !size)
+               return NULL;
+
+       order = get_count_order(((size - 1) >> PAGE_SHIFT) + 1);
+
+       paddr = __alloc_dma_pages(order);
+
+       if (handle)
+               *handle = paddr;
+
+       if (!paddr)
+               return NULL;
+
+       return phys_to_virt(paddr);
+}
+EXPORT_SYMBOL(dma_alloc_coherent);
+
+/*
+ * Free DMA coherent memory as defined by the above mapping.
+ */
+void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
+                      dma_addr_t dma_handle)
+{
+       int order;
+
+       if (!dma_size || !size)
+               return;
+
+       order = get_count_order(((size - 1) >> PAGE_SHIFT) + 1);
+
+       __free_dma_pages(virt_to_phys(vaddr), order);
+}
+EXPORT_SYMBOL(dma_free_coherent);
+
+/*
+ * Initialise the coherent DMA memory allocator using the given uncached region.
+ */
+void __init coherent_mem_init(phys_addr_t start, u32 size)
+{
+       phys_addr_t bitmap_phys;
+
+       if (!size)
+               return;
+
+       printk(KERN_INFO
+              "Coherent memory (DMA) region start=0x%x size=0x%x\n",
+              start, size);
+
+       dma_base = start;
+       dma_size = size;
+
+       /* allocate bitmap */
+       dma_pages = dma_size >> PAGE_SHIFT;
+       if (dma_size & (PAGE_SIZE - 1))
+               ++dma_pages;
+
+       bitmap_phys = memblock_alloc(BITS_TO_LONGS(dma_pages) * sizeof(long),
+                                    sizeof(long));
+
+       dma_bitmap = phys_to_virt(bitmap_phys);
+       memset(dma_bitmap, 0, dma_pages * PAGE_SIZE);
+}
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
new file mode 100644 (file)
index 0000000..89395f0
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
+ *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
+ *
+ *  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/mm.h>
+#include <linux/swap.h>
+#include <linux/module.h>
+#include <linux/bootmem.h>
+#ifdef CONFIG_BLK_DEV_RAM
+#include <linux/blkdev.h>
+#endif
+#include <linux/initrd.h>
+
+#include <asm/sections.h>
+
+/*
+ * ZERO_PAGE is a special page that is used for zero-initialized
+ * data and COW.
+ */
+unsigned long empty_zero_page;
+EXPORT_SYMBOL(empty_zero_page);
+
+/*
+ * paging_init() continues the virtual memory environment setup which
+ * was begun by the code in arch/head.S.
+ * The parameters are pointers to where to stick the starting and ending
+ * addresses  of available kernel virtual memory.
+ */
+void __init paging_init(void)
+{
+       struct pglist_data *pgdat = NODE_DATA(0);
+       unsigned long zones_size[MAX_NR_ZONES] = {0, };
+
+       empty_zero_page      = (unsigned long) alloc_bootmem_pages(PAGE_SIZE);
+       memset((void *)empty_zero_page, 0, PAGE_SIZE);
+
+       /*
+        * Set up user data space
+        */
+       set_fs(KERNEL_DS);
+
+       /*
+        * Define zones
+        */
+       zones_size[ZONE_NORMAL] = (memory_end - PAGE_OFFSET) >> PAGE_SHIFT;
+       pgdat->node_zones[ZONE_NORMAL].zone_start_pfn =
+               __pa(PAGE_OFFSET) >> PAGE_SHIFT;
+
+       free_area_init(zones_size);
+}
+
+void __init mem_init(void)
+{
+       int codek, datak;
+       unsigned long tmp;
+       unsigned long len = memory_end - memory_start;
+
+       high_memory = (void *)(memory_end & PAGE_MASK);
+
+       /* this will put all memory onto the freelists */
+       totalram_pages = free_all_bootmem();
+
+       codek = (_etext - _stext) >> 10;
+       datak = (_end - _sdata) >> 10;
+
+       tmp = nr_free_pages() << PAGE_SHIFT;
+       printk(KERN_INFO "Memory: %luk/%luk RAM (%dk kernel code, %dk data)\n",
+              tmp >> 10, len >> 10, codek, datak);
+}
+
+#ifdef CONFIG_BLK_DEV_INITRD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+       int pages = 0;
+       for (; start < end; start += PAGE_SIZE) {
+               ClearPageReserved(virt_to_page(start));
+               init_page_count(virt_to_page(start));
+               free_page(start);
+               totalram_pages++;
+               pages++;
+       }
+       printk(KERN_INFO "Freeing initrd memory: %luk freed\n",
+              (pages * PAGE_SIZE) >> 10);
+}
+#endif
+
+void __init free_initmem(void)
+{
+       unsigned long addr;
+
+       /*
+        * The following code should be cool even if these sections
+        * are not page aligned.
+        */
+       addr = PAGE_ALIGN((unsigned long)(__init_begin));
+
+       /* next to check that the page we free is not a partial page */
+       for (; addr + PAGE_SIZE < (unsigned long)(__init_end);
+            addr += PAGE_SIZE) {
+               ClearPageReserved(virt_to_page(addr));
+               init_page_count(virt_to_page(addr));
+               free_page(addr);
+               totalram_pages++;
+       }
+       printk(KERN_INFO "Freeing unused kernel memory: %dK freed\n",
+              (int) ((addr - PAGE_ALIGN((long) &__init_begin)) >> 10));
+}
diff --git a/arch/c6x/platforms/Kconfig b/arch/c6x/platforms/Kconfig
new file mode 100644 (file)
index 0000000..401ee67
--- /dev/null
@@ -0,0 +1,16 @@
+
+config SOC_TMS320C6455
+       bool "TMS320C6455"
+       default n
+
+config SOC_TMS320C6457
+       bool "TMS320C6457"
+       default n
+
+config SOC_TMS320C6472
+       bool "TMS320C6472"
+       default n
+
+config SOC_TMS320C6474
+       bool "TMS320C6474"
+       default n
diff --git a/arch/c6x/platforms/Makefile b/arch/c6x/platforms/Makefile
new file mode 100644 (file)
index 0000000..9a95b9b
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Makefile for arch/c6x/platforms
+#
+# Copyright 2010, 2011 Texas Instruments Incorporated
+#
+
+obj-y = platform.o cache.o megamod-pic.o pll.o plldata.o timer64.o
+obj-y += dscr.o
+
+# SoC objects
+obj-$(CONFIG_SOC_TMS320C6455)   += emif.o
+obj-$(CONFIG_SOC_TMS320C6457)   += emif.o
diff --git a/arch/c6x/platforms/cache.c b/arch/c6x/platforms/cache.c
new file mode 100644 (file)
index 0000000..86318a1
--- /dev/null
@@ -0,0 +1,445 @@
+/*
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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/of.h>
+#include <linux/of_address.h>
+#include <linux/io.h>
+
+#include <asm/cache.h>
+#include <asm/soc.h>
+
+/*
+ * Internal Memory Control Registers for caches
+ */
+#define IMCR_CCFG        0x0000
+#define IMCR_L1PCFG      0x0020
+#define IMCR_L1PCC       0x0024
+#define IMCR_L1DCFG      0x0040
+#define IMCR_L1DCC       0x0044
+#define IMCR_L2ALLOC0    0x2000
+#define IMCR_L2ALLOC1    0x2004
+#define IMCR_L2ALLOC2    0x2008
+#define IMCR_L2ALLOC3    0x200c
+#define IMCR_L2WBAR      0x4000
+#define IMCR_L2WWC       0x4004
+#define IMCR_L2WIBAR     0x4010
+#define IMCR_L2WIWC      0x4014
+#define IMCR_L2IBAR      0x4018
+#define IMCR_L2IWC       0x401c
+#define IMCR_L1PIBAR     0x4020
+#define IMCR_L1PIWC      0x4024
+#define IMCR_L1DWIBAR    0x4030
+#define IMCR_L1DWIWC     0x4034
+#define IMCR_L1DWBAR     0x4040
+#define IMCR_L1DWWC      0x4044
+#define IMCR_L1DIBAR     0x4048
+#define IMCR_L1DIWC      0x404c
+#define IMCR_L2WB        0x5000
+#define IMCR_L2WBINV     0x5004
+#define IMCR_L2INV       0x5008
+#define IMCR_L1PINV      0x5028
+#define IMCR_L1DWB       0x5040
+#define IMCR_L1DWBINV    0x5044
+#define IMCR_L1DINV      0x5048
+#define IMCR_MAR_BASE    0x8000
+#define IMCR_MAR96_111   0x8180
+#define IMCR_MAR128_191   0x8200
+#define IMCR_MAR224_239   0x8380
+#define IMCR_L2MPFAR     0xa000
+#define IMCR_L2MPFSR     0xa004
+#define IMCR_L2MPFCR     0xa008
+#define IMCR_L2MPLK0     0xa100
+#define IMCR_L2MPLK1     0xa104
+#define IMCR_L2MPLK2     0xa108
+#define IMCR_L2MPLK3     0xa10c
+#define IMCR_L2MPLKCMD   0xa110
+#define IMCR_L2MPLKSTAT   0xa114
+#define IMCR_L2MPPA_BASE  0xa200
+#define IMCR_L1PMPFAR    0xa400
+#define IMCR_L1PMPFSR    0xa404
+#define IMCR_L1PMPFCR    0xa408
+#define IMCR_L1PMPLK0    0xa500
+#define IMCR_L1PMPLK1    0xa504
+#define IMCR_L1PMPLK2    0xa508
+#define IMCR_L1PMPLK3    0xa50c
+#define IMCR_L1PMPLKCMD   0xa510
+#define IMCR_L1PMPLKSTAT  0xa514
+#define IMCR_L1PMPPA_BASE 0xa600
+#define IMCR_L1DMPFAR    0xac00
+#define IMCR_L1DMPFSR    0xac04
+#define IMCR_L1DMPFCR    0xac08
+#define IMCR_L1DMPLK0    0xad00
+#define IMCR_L1DMPLK1    0xad04
+#define IMCR_L1DMPLK2    0xad08
+#define IMCR_L1DMPLK3    0xad0c
+#define IMCR_L1DMPLKCMD   0xad10
+#define IMCR_L1DMPLKSTAT  0xad14
+#define IMCR_L1DMPPA_BASE 0xae00
+#define IMCR_L2PDWAKE0   0xc040
+#define IMCR_L2PDWAKE1   0xc044
+#define IMCR_L2PDSLEEP0   0xc050
+#define IMCR_L2PDSLEEP1   0xc054
+#define IMCR_L2PDSTAT0   0xc060
+#define IMCR_L2PDSTAT1   0xc064
+
+/*
+ * CCFG register values and bits
+ */
+#define L2MODE_0K_CACHE   0x0
+#define L2MODE_32K_CACHE  0x1
+#define L2MODE_64K_CACHE  0x2
+#define L2MODE_128K_CACHE 0x3
+#define L2MODE_256K_CACHE 0x7
+
+#define L2PRIO_URGENT     0x0
+#define L2PRIO_HIGH       0x1
+#define L2PRIO_MEDIUM     0x2
+#define L2PRIO_LOW        0x3
+
+#define CCFG_ID           0x100   /* Invalidate L1P bit */
+#define CCFG_IP           0x200   /* Invalidate L1D bit */
+
+static void __iomem *cache_base;
+
+/*
+ * L1 & L2 caches generic functions
+ */
+#define imcr_get(reg) soc_readl(cache_base + (reg))
+#define imcr_set(reg, value) \
+do {                                                           \
+       soc_writel((value), cache_base + (reg));                \
+       soc_readl(cache_base + (reg));                          \
+} while (0)
+
+static void cache_block_operation_wait(unsigned int wc_reg)
+{
+       /* Wait for completion */
+       while (imcr_get(wc_reg))
+               cpu_relax();
+}
+
+static DEFINE_SPINLOCK(cache_lock);
+
+/*
+ * Generic function to perform a block cache operation as
+ * invalidate or writeback/invalidate
+ */
+static void cache_block_operation(unsigned int *start,
+                                 unsigned int *end,
+                                 unsigned int bar_reg,
+                                 unsigned int wc_reg)
+{
+       unsigned long flags;
+       unsigned int wcnt =
+               (L2_CACHE_ALIGN_CNT((unsigned int) end)
+                - L2_CACHE_ALIGN_LOW((unsigned int) start)) >> 2;
+       unsigned int wc = 0;
+
+       for (; wcnt; wcnt -= wc, start += wc) {
+loop:
+               spin_lock_irqsave(&cache_lock, flags);
+
+               /*
+                * If another cache operation is occuring
+                */
+               if (unlikely(imcr_get(wc_reg))) {
+                       spin_unlock_irqrestore(&cache_lock, flags);
+
+                       /* Wait for previous operation completion */
+                       cache_block_operation_wait(wc_reg);
+
+                       /* Try again */
+                       goto loop;
+               }
+
+               imcr_set(bar_reg, L2_CACHE_ALIGN_LOW((unsigned int) start));
+
+               if (wcnt > 0xffff)
+                       wc = 0xffff;
+               else
+                       wc = wcnt;
+
+               /* Set word count value in the WC register */
+               imcr_set(wc_reg, wc & 0xffff);
+
+               spin_unlock_irqrestore(&cache_lock, flags);
+
+               /* Wait for completion */
+               cache_block_operation_wait(wc_reg);
+       }
+}
+
+static void cache_block_operation_nowait(unsigned int *start,
+                                        unsigned int *end,
+                                        unsigned int bar_reg,
+                                        unsigned int wc_reg)
+{
+       unsigned long flags;
+       unsigned int wcnt =
+               (L2_CACHE_ALIGN_CNT((unsigned int) end)
+                - L2_CACHE_ALIGN_LOW((unsigned int) start)) >> 2;
+       unsigned int wc = 0;
+
+       for (; wcnt; wcnt -= wc, start += wc) {
+
+               spin_lock_irqsave(&cache_lock, flags);
+
+               imcr_set(bar_reg, L2_CACHE_ALIGN_LOW((unsigned int) start));
+
+               if (wcnt > 0xffff)
+                       wc = 0xffff;
+               else
+                       wc = wcnt;
+
+               /* Set word count value in the WC register */
+               imcr_set(wc_reg, wc & 0xffff);
+
+               spin_unlock_irqrestore(&cache_lock, flags);
+
+               /* Don't wait for completion on last cache operation */
+               if (wcnt > 0xffff)
+                       cache_block_operation_wait(wc_reg);
+       }
+}
+
+/*
+ * L1 caches management
+ */
+
+/*
+ * Disable L1 caches
+ */
+void L1_cache_off(void)
+{
+       unsigned int dummy;
+
+       imcr_set(IMCR_L1PCFG, 0);
+       dummy = imcr_get(IMCR_L1PCFG);
+
+       imcr_set(IMCR_L1DCFG, 0);
+       dummy = imcr_get(IMCR_L1DCFG);
+}
+
+/*
+ * Enable L1 caches
+ */
+void L1_cache_on(void)
+{
+       unsigned int dummy;
+
+       imcr_set(IMCR_L1PCFG, 7);
+       dummy = imcr_get(IMCR_L1PCFG);
+
+       imcr_set(IMCR_L1DCFG, 7);
+       dummy = imcr_get(IMCR_L1DCFG);
+}
+
+/*
+ *  L1P global-invalidate all
+ */
+void L1P_cache_global_invalidate(void)
+{
+       unsigned int set = 1;
+       imcr_set(IMCR_L1PINV, set);
+       while (imcr_get(IMCR_L1PINV) & 1)
+               cpu_relax();
+}
+
+/*
+ *  L1D global-invalidate all
+ *
+ * Warning: this operation causes all updated data in L1D to
+ * be discarded rather than written back to the lower levels of
+ * memory
+ */
+void L1D_cache_global_invalidate(void)
+{
+       unsigned int set = 1;
+       imcr_set(IMCR_L1DINV, set);
+       while (imcr_get(IMCR_L1DINV) & 1)
+               cpu_relax();
+}
+
+void L1D_cache_global_writeback(void)
+{
+       unsigned int set = 1;
+       imcr_set(IMCR_L1DWB, set);
+       while (imcr_get(IMCR_L1DWB) & 1)
+               cpu_relax();
+}
+
+void L1D_cache_global_writeback_invalidate(void)
+{
+       unsigned int set = 1;
+       imcr_set(IMCR_L1DWBINV, set);
+       while (imcr_get(IMCR_L1DWBINV) & 1)
+               cpu_relax();
+}
+
+/*
+ * L2 caches management
+ */
+
+/*
+ * Set L2 operation mode
+ */
+void L2_cache_set_mode(unsigned int mode)
+{
+       unsigned int ccfg = imcr_get(IMCR_CCFG);
+
+       /* Clear and set the L2MODE bits in CCFG */
+       ccfg &= ~7;
+       ccfg |= (mode & 7);
+       imcr_set(IMCR_CCFG, ccfg);
+       ccfg = imcr_get(IMCR_CCFG);
+}
+
+/*
+ *  L2 global-writeback and global-invalidate all
+ */
+void L2_cache_global_writeback_invalidate(void)
+{
+       imcr_set(IMCR_L2WBINV, 1);
+       while (imcr_get(IMCR_L2WBINV))
+               cpu_relax();
+}
+
+/*
+ *  L2 global-writeback all
+ */
+void L2_cache_global_writeback(void)
+{
+       imcr_set(IMCR_L2WB, 1);
+       while (imcr_get(IMCR_L2WB))
+               cpu_relax();
+}
+
+/*
+ * Cacheability controls
+ */
+void enable_caching(unsigned long start, unsigned long end)
+{
+       unsigned int mar = IMCR_MAR_BASE + ((start >> 24) << 2);
+       unsigned int mar_e = IMCR_MAR_BASE + ((end >> 24) << 2);
+
+       for (; mar <= mar_e; mar += 4)
+               imcr_set(mar, imcr_get(mar) | 1);
+}
+
+void disable_caching(unsigned long start, unsigned long end)
+{
+       unsigned int mar = IMCR_MAR_BASE + ((start >> 24) << 2);
+       unsigned int mar_e = IMCR_MAR_BASE + ((end >> 24) << 2);
+
+       for (; mar <= mar_e; mar += 4)
+               imcr_set(mar, imcr_get(mar) & ~1);
+}
+
+
+/*
+ *  L1 block operations
+ */
+void L1P_cache_block_invalidate(unsigned int start, unsigned int end)
+{
+       cache_block_operation((unsigned int *) start,
+                             (unsigned int *) end,
+                             IMCR_L1PIBAR, IMCR_L1PIWC);
+}
+
+void L1D_cache_block_invalidate(unsigned int start, unsigned int end)
+{
+       cache_block_operation((unsigned int *) start,
+                             (unsigned int *) end,
+                             IMCR_L1DIBAR, IMCR_L1DIWC);
+}
+
+void L1D_cache_block_writeback_invalidate(unsigned int start, unsigned int end)
+{
+       cache_block_operation((unsigned int *) start,
+                             (unsigned int *) end,
+                             IMCR_L1DWIBAR, IMCR_L1DWIWC);
+}
+
+void L1D_cache_block_writeback(unsigned int start, unsigned int end)
+{
+       cache_block_operation((unsigned int *) start,
+                             (unsigned int *) end,
+                             IMCR_L1DWBAR, IMCR_L1DWWC);
+}
+
+/*
+ *  L2 block operations
+ */
+void L2_cache_block_invalidate(unsigned int start, unsigned int end)
+{
+       cache_block_operation((unsigned int *) start,
+                             (unsigned int *) end,
+                             IMCR_L2IBAR, IMCR_L2IWC);
+}
+
+void L2_cache_block_writeback(unsigned int start, unsigned int end)
+{
+       cache_block_operation((unsigned int *) start,
+                             (unsigned int *) end,
+                             IMCR_L2WBAR, IMCR_L2WWC);
+}
+
+void L2_cache_block_writeback_invalidate(unsigned int start, unsigned int end)
+{
+       cache_block_operation((unsigned int *) start,
+                             (unsigned int *) end,
+                             IMCR_L2WIBAR, IMCR_L2WIWC);
+}
+
+void L2_cache_block_invalidate_nowait(unsigned int start, unsigned int end)
+{
+       cache_block_operation_nowait((unsigned int *) start,
+                                    (unsigned int *) end,
+                                    IMCR_L2IBAR, IMCR_L2IWC);
+}
+
+void L2_cache_block_writeback_nowait(unsigned int start, unsigned int end)
+{
+       cache_block_operation_nowait((unsigned int *) start,
+                                    (unsigned int *) end,
+                                    IMCR_L2WBAR, IMCR_L2WWC);
+}
+
+void L2_cache_block_writeback_invalidate_nowait(unsigned int start,
+                                               unsigned int end)
+{
+       cache_block_operation_nowait((unsigned int *) start,
+                                    (unsigned int *) end,
+                                    IMCR_L2WIBAR, IMCR_L2WIWC);
+}
+
+
+/*
+ * L1 and L2 caches configuration
+ */
+void __init c6x_cache_init(void)
+{
+       struct device_node *node;
+
+       node = of_find_compatible_node(NULL, NULL, "ti,c64x+cache");
+       if (!node)
+               return;
+
+       cache_base = of_iomap(node, 0);
+
+       of_node_put(node);
+
+       if (!cache_base)
+               return;
+
+       /* Set L2 caches on the the whole L2 SRAM memory */
+       L2_cache_set_mode(L2MODE_SIZE);
+
+       /* Enable L1 */
+       L1_cache_on();
+}
diff --git a/arch/c6x/platforms/dscr.c b/arch/c6x/platforms/dscr.c
new file mode 100644 (file)
index 0000000..f848a65
--- /dev/null
@@ -0,0 +1,598 @@
+/*
+ *  Device State Control Registers driver
+ *
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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.
+ */
+
+/*
+ * The Device State Control Registers (DSCR) provide SoC level control over
+ * a number of peripherals. Details vary considerably among the various SoC
+ * parts. In general, the DSCR block will provide one or more configuration
+ * registers often protected by a lock register. One or more key values must
+ * be written to a lock register in order to unlock the configuration register.
+ * The configuration register may be used to enable (and disable in some
+ * cases) SoC pin drivers, peripheral clock sources (internal or pin), etc.
+ * In some cases, a configuration register is write once or the individual
+ * bits are write once. That is, you may be able to enable a device, but
+ * will not be able to disable it.
+ *
+ * In addition to device configuration, the DSCR block may provide registers
+ * which are used to reset SoC peripherals, provide device ID information,
+ * provide MAC addresses, and other miscellaneous functions.
+ */
+
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <asm/soc.h>
+#include <asm/dscr.h>
+
+#define MAX_DEVSTATE_IDS   32
+#define MAX_DEVCTL_REGS     8
+#define MAX_DEVSTAT_REGS    8
+#define MAX_LOCKED_REGS     4
+#define MAX_SOC_EMACS       2
+
+struct rmii_reset_reg {
+       u32 reg;
+       u32 mask;
+};
+
+/*
+ * Some registerd may be locked. In order to write to these
+ * registers, the key value must first be written to the lockreg.
+ */
+struct locked_reg {
+       u32 reg;        /* offset from base */
+       u32 lockreg;    /* offset from base */
+       u32 key;        /* unlock key */
+};
+
+/*
+ * This describes a contiguous area of like control bits used to enable/disable
+ * SoC devices. Each controllable device is given an ID which is used by the
+ * individual device drivers to control the device state. These IDs start at
+ * zero and are assigned sequentially to the control bitfield ranges described
+ * by this structure.
+ */
+struct devstate_ctl_reg {
+       u32 reg;                /* register holding the control bits */
+       u8  start_id;           /* start id of this range */
+       u8  num_ids;            /* number of devices in this range */
+       u8  enable_only;        /* bits are write-once to enable only */
+       u8  enable;             /* value used to enable device */
+       u8  disable;            /* value used to disable device */
+       u8  shift;              /* starting (rightmost) bit in range */
+       u8  nbits;              /* number of bits per device */
+};
+
+
+/*
+ * This describes a region of status bits indicating the state of
+ * various devices. This is used internally to wait for status
+ * change completion when enabling/disabling a device. Status is
+ * optional and not all device controls will have a corresponding
+ * status.
+ */
+struct devstate_stat_reg {
+       u32 reg;                /* register holding the status bits */
+       u8  start_id;           /* start id of this range */
+       u8  num_ids;            /* number of devices in this range */
+       u8  enable;             /* value indicating enabled state */
+       u8  disable;            /* value indicating disabled state */
+       u8  shift;              /* starting (rightmost) bit in range */
+       u8  nbits;              /* number of bits per device */
+};
+
+struct devstate_info {
+       struct devstate_ctl_reg *ctl;
+       struct devstate_stat_reg *stat;
+};
+
+/* These are callbacks to SOC-specific code. */
+struct dscr_ops {
+       void (*init)(struct device_node *node);
+};
+
+struct dscr_regs {
+       spinlock_t              lock;
+       void __iomem            *base;
+       u32                     kick_reg[2];
+       u32                     kick_key[2];
+       struct locked_reg       locked[MAX_LOCKED_REGS];
+       struct devstate_info    devstate_info[MAX_DEVSTATE_IDS];
+       struct rmii_reset_reg   rmii_resets[MAX_SOC_EMACS];
+       struct devstate_ctl_reg devctl[MAX_DEVCTL_REGS];
+       struct devstate_stat_reg devstat[MAX_DEVSTAT_REGS];
+};
+
+static struct dscr_regs        dscr;
+
+static struct locked_reg *find_locked_reg(u32 reg)
+{
+       int i;
+
+       for (i = 0; i < MAX_LOCKED_REGS; i++)
+               if (dscr.locked[i].key && reg == dscr.locked[i].reg)
+                       return &dscr.locked[i];
+       return NULL;
+}
+
+/*
+ * Write to a register with one lock
+ */
+static void dscr_write_locked1(u32 reg, u32 val,
+                              u32 lock, u32 key)
+{
+       void __iomem *reg_addr = dscr.base + reg;
+       void __iomem *lock_addr = dscr.base + lock;
+
+       /*
+        * For some registers, the lock is relocked after a short number
+        * of cycles. We have to put the lock write and register write in
+        * the same fetch packet to meet this timing. The .align ensures
+        * the two stw instructions are in the same fetch packet.
+        */
+       asm volatile ("b        .s2     0f\n"
+                     "nop      5\n"
+                     "    .align 5\n"
+                     "0:\n"
+                     "stw      .D1T2   %3,*%2\n"
+                     "stw      .D1T2   %1,*%0\n"
+                     :
+                     : "a"(reg_addr), "b"(val), "a"(lock_addr), "b"(key)
+               );
+
+       /* in case the hw doesn't reset the lock */
+       soc_writel(0, lock_addr);
+}
+
+/*
+ * Write to a register protected by two lock registers
+ */
+static void dscr_write_locked2(u32 reg, u32 val,
+                              u32 lock0, u32 key0,
+                              u32 lock1, u32 key1)
+{
+       soc_writel(key0, dscr.base + lock0);
+       soc_writel(key1, dscr.base + lock1);
+       soc_writel(val, dscr.base + reg);
+       soc_writel(0, dscr.base + lock0);
+       soc_writel(0, dscr.base + lock1);
+}
+
+static void dscr_write(u32 reg, u32 val)
+{
+       struct locked_reg *lock;
+
+       lock = find_locked_reg(reg);
+       if (lock)
+               dscr_write_locked1(reg, val, lock->lockreg, lock->key);
+       else if (dscr.kick_key[0])
+               dscr_write_locked2(reg, val, dscr.kick_reg[0], dscr.kick_key[0],
+                                  dscr.kick_reg[1], dscr.kick_key[1]);
+       else
+               soc_writel(val, dscr.base + reg);
+}
+
+
+/*
+ * Drivers can use this interface to enable/disable SoC IP blocks.
+ */
+void dscr_set_devstate(int id, enum dscr_devstate_t state)
+{
+       struct devstate_ctl_reg *ctl;
+       struct devstate_stat_reg *stat;
+       struct devstate_info *info;
+       u32 ctl_val, val;
+       int ctl_shift, ctl_mask;
+       unsigned long flags;
+
+       if (!dscr.base)
+               return;
+
+       if (id < 0 || id >= MAX_DEVSTATE_IDS)
+               return;
+
+       info = &dscr.devstate_info[id];
+       ctl = info->ctl;
+       stat = info->stat;
+
+       if (ctl == NULL)
+               return;
+
+       ctl_shift = ctl->shift + ctl->nbits * (id - ctl->start_id);
+       ctl_mask = ((1 << ctl->nbits) - 1) << ctl_shift;
+
+       switch (state) {
+       case DSCR_DEVSTATE_ENABLED:
+               ctl_val = ctl->enable << ctl_shift;
+               break;
+       case DSCR_DEVSTATE_DISABLED:
+               if (ctl->enable_only)
+                       return;
+               ctl_val = ctl->disable << ctl_shift;
+               break;
+       default:
+               return;
+       }
+
+       spin_lock_irqsave(&dscr.lock, flags);
+
+       val = soc_readl(dscr.base + ctl->reg);
+       val &= ~ctl_mask;
+       val |= ctl_val;
+
+       dscr_write(ctl->reg, val);
+
+       spin_unlock_irqrestore(&dscr.lock, flags);
+
+       if (!stat)
+               return;
+
+       ctl_shift = stat->shift + stat->nbits * (id - stat->start_id);
+
+       if (state == DSCR_DEVSTATE_ENABLED)
+               ctl_val = stat->enable;
+       else
+               ctl_val = stat->disable;
+
+       do {
+               val = soc_readl(dscr.base + stat->reg);
+               val >>= ctl_shift;
+               val &= ((1 << stat->nbits) - 1);
+       } while (val != ctl_val);
+}
+EXPORT_SYMBOL(dscr_set_devstate);
+
+/*
+ * Drivers can use this to reset RMII module.
+ */
+void dscr_rmii_reset(int id, int assert)
+{
+       struct rmii_reset_reg *r;
+       unsigned long flags;
+       u32 val;
+
+       if (id < 0 || id >= MAX_SOC_EMACS)
+               return;
+
+       r = &dscr.rmii_resets[id];
+       if (r->mask == 0)
+               return;
+
+       spin_lock_irqsave(&dscr.lock, flags);
+
+       val = soc_readl(dscr.base + r->reg);
+       if (assert)
+               dscr_write(r->reg, val | r->mask);
+       else
+               dscr_write(r->reg, val & ~(r->mask));
+
+       spin_unlock_irqrestore(&dscr.lock, flags);
+}
+EXPORT_SYMBOL(dscr_rmii_reset);
+
+static void __init dscr_parse_devstat(struct device_node *node,
+                                     void __iomem *base)
+{
+       u32 val;
+       int err;
+
+       err = of_property_read_u32_array(node, "ti,dscr-devstat", &val, 1);
+       if (!err)
+               c6x_devstat = soc_readl(base + val);
+       printk(KERN_INFO "DEVSTAT: %08x\n", c6x_devstat);
+}
+
+static void __init dscr_parse_silicon_rev(struct device_node *node,
+                                        void __iomem *base)
+{
+       u32 vals[3];
+       int err;
+
+       err = of_property_read_u32_array(node, "ti,dscr-silicon-rev", vals, 3);
+       if (!err) {
+               c6x_silicon_rev = soc_readl(base + vals[0]);
+               c6x_silicon_rev >>= vals[1];
+               c6x_silicon_rev &= vals[2];
+       }
+}
+
+/*
+ * Some SoCs will have a pair of fuse registers which hold
+ * an ethernet MAC address. The "ti,dscr-mac-fuse-regs"
+ * property is a mapping from fuse register bytes to MAC
+ * address bytes. The expected format is:
+ *
+ *     ti,dscr-mac-fuse-regs = <reg0 b3 b2 b1 b0
+ *                              reg1 b3 b2 b1 b0>
+ *
+ * reg0 and reg1 are the offsets of the two fuse registers.
+ * b3-b0 positionally represent bytes within the fuse register.
+ * b3 is the most significant byte and b0 is the least.
+ * Allowable values for b3-b0 are:
+ *
+ *       0 = fuse register byte not used in MAC address
+ *      1-6 = index+1 into c6x_fuse_mac[]
+ */
+static void __init dscr_parse_mac_fuse(struct device_node *node,
+                                      void __iomem *base)
+{
+       u32 vals[10], fuse;
+       int f, i, j, err;
+
+       err = of_property_read_u32_array(node, "ti,dscr-mac-fuse-regs",
+                                        vals, 10);
+       if (err)
+               return;
+
+       for (f = 0; f < 2; f++) {
+               fuse = soc_readl(base + vals[f * 5]);
+               for (j = (f * 5) + 1, i = 24; i >= 0; i -= 8, j++)
+                       if (vals[j] && vals[j] <= 6)
+                               c6x_fuse_mac[vals[j] - 1] = fuse >> i;
+       }
+}
+
+static void __init dscr_parse_rmii_resets(struct device_node *node,
+                                         void __iomem *base)
+{
+       const __be32 *p;
+       int i, size;
+
+       /* look for RMII reset registers */
+       p = of_get_property(node, "ti,dscr-rmii-resets", &size);
+       if (p) {
+               /* parse all the reg/mask pairs we can handle */
+               size /= (sizeof(*p) * 2);
+               if (size > MAX_SOC_EMACS)
+                       size = MAX_SOC_EMACS;
+
+               for (i = 0; i < size; i++) {
+                       dscr.rmii_resets[i].reg = be32_to_cpup(p++);
+                       dscr.rmii_resets[i].mask = be32_to_cpup(p++);
+               }
+       }
+}
+
+
+static void __init dscr_parse_privperm(struct device_node *node,
+                                      void __iomem *base)
+{
+       u32 vals[2];
+       int err;
+
+       err = of_property_read_u32_array(node, "ti,dscr-privperm", vals, 2);
+       if (err)
+               return;
+       dscr_write(vals[0], vals[1]);
+}
+
+/*
+ * SoCs may have "locked" DSCR registers which can only be written
+ * to only after writing a key value to a lock registers. These
+ * regisers can be described with the "ti,dscr-locked-regs" property.
+ * This property provides a list of register descriptions with each
+ * description consisting of three values.
+ *
+ *     ti,dscr-locked-regs = <reg0 lockreg0 key0
+ *                               ...
+ *                             regN lockregN keyN>;
+ *
+ * reg is the offset of the locked register
+ * lockreg is the offset of the lock register
+ * key is the unlock key written to lockreg
+ *
+ */
+static void __init dscr_parse_locked_regs(struct device_node *node,
+                                         void __iomem *base)
+{
+       struct locked_reg *r;
+       const __be32 *p;
+       int i, size;
+
+       p = of_get_property(node, "ti,dscr-locked-regs", &size);
+       if (p) {
+               /* parse all the register descriptions we can handle */
+               size /= (sizeof(*p) * 3);
+               if (size > MAX_LOCKED_REGS)
+                       size = MAX_LOCKED_REGS;
+
+               for (i = 0; i < size; i++) {
+                       r = &dscr.locked[i];
+
+                       r->reg = be32_to_cpup(p++);
+                       r->lockreg = be32_to_cpup(p++);
+                       r->key = be32_to_cpup(p++);
+               }
+       }
+}
+
+/*
+ * SoCs may have DSCR registers which are only write enabled after
+ * writing specific key values to two registers. The two key registers
+ * and the key values can be parsed from a "ti,dscr-kick-regs"
+ * propety with the following layout:
+ *
+ *     ti,dscr-kick-regs = <kickreg0 key0 kickreg1 key1>
+ *
+ * kickreg is the offset of the "kick" register
+ * key is the value which unlocks writing for protected regs
+ */
+static void __init dscr_parse_kick_regs(struct device_node *node,
+                                       void __iomem *base)
+{
+       u32 vals[4];
+       int err;
+
+       err = of_property_read_u32_array(node, "ti,dscr-kick-regs", vals, 4);
+       if (!err) {
+               dscr.kick_reg[0] = vals[0];
+               dscr.kick_key[0] = vals[1];
+               dscr.kick_reg[1] = vals[2];
+               dscr.kick_key[1] = vals[3];
+       }
+}
+
+
+/*
+ * SoCs may provide controls to enable/disable individual IP blocks. These
+ * controls in the DSCR usually control pin drivers but also may control
+ * clocking and or resets. The device tree is used to describe the bitfields
+ * in registers used to control device state. The number of bits and their
+ * values may vary even within the same register.
+ *
+ * The layout of these bitfields is described by the ti,dscr-devstate-ctl-regs
+ * property. This property is a list where each element describes a contiguous
+ * range of control fields with like properties. Each element of the list
+ * consists of 7 cells with the following values:
+ *
+ *   start_id num_ids reg enable disable start_bit nbits
+ *
+ * start_id is device id for the first device control in the range
+ * num_ids is the number of device controls in the range
+ * reg is the offset of the register holding the control bits
+ * enable is the value to enable a device
+ * disable is the value to disable a device (0xffffffff if cannot disable)
+ * start_bit is the bit number of the first bit in the range
+ * nbits is the number of bits per device control
+ */
+static void __init dscr_parse_devstate_ctl_regs(struct device_node *node,
+                                               void __iomem *base)
+{
+       struct devstate_ctl_reg *r;
+       const __be32 *p;
+       int i, j, size;
+
+       p = of_get_property(node, "ti,dscr-devstate-ctl-regs", &size);
+       if (p) {
+               /* parse all the ranges we can handle */
+               size /= (sizeof(*p) * 7);
+               if (size > MAX_DEVCTL_REGS)
+                       size = MAX_DEVCTL_REGS;
+
+               for (i = 0; i < size; i++) {
+                       r = &dscr.devctl[i];
+
+                       r->start_id = be32_to_cpup(p++);
+                       r->num_ids = be32_to_cpup(p++);
+                       r->reg = be32_to_cpup(p++);
+                       r->enable = be32_to_cpup(p++);
+                       r->disable = be32_to_cpup(p++);
+                       if (r->disable == 0xffffffff)
+                               r->enable_only = 1;
+                       r->shift = be32_to_cpup(p++);
+                       r->nbits = be32_to_cpup(p++);
+
+                       for (j = r->start_id;
+                            j < (r->start_id + r->num_ids);
+                            j++)
+                               dscr.devstate_info[j].ctl = r;
+               }
+       }
+}
+
+/*
+ * SoCs may provide status registers indicating the state (enabled/disabled) of
+ * devices on the SoC. The device tree is used to describe the bitfields in
+ * registers used to provide device status. The number of bits and their
+ * values used to provide status may vary even within the same register.
+ *
+ * The layout of these bitfields is described by the ti,dscr-devstate-stat-regs
+ * property. This property is a list where each element describes a contiguous
+ * range of status fields with like properties. Each element of the list
+ * consists of 7 cells with the following values:
+ *
+ *   start_id num_ids reg enable disable start_bit nbits
+ *
+ * start_id is device id for the first device status in the range
+ * num_ids is the number of devices covered by the range
+ * reg is the offset of the register holding the status bits
+ * enable is the value indicating device is enabled
+ * disable is the value indicating device is disabled
+ * start_bit is the bit number of the first bit in the range
+ * nbits is the number of bits per device status
+ */
+static void __init dscr_parse_devstate_stat_regs(struct device_node *node,
+                                                void __iomem *base)
+{
+       struct devstate_stat_reg *r;
+       const __be32 *p;
+       int i, j, size;
+
+       p = of_get_property(node, "ti,dscr-devstate-stat-regs", &size);
+       if (p) {
+               /* parse all the ranges we can handle */
+               size /= (sizeof(*p) * 7);
+               if (size > MAX_DEVSTAT_REGS)
+                       size = MAX_DEVSTAT_REGS;
+
+               for (i = 0; i < size; i++) {
+                       r = &dscr.devstat[i];
+
+                       r->start_id = be32_to_cpup(p++);
+                       r->num_ids = be32_to_cpup(p++);
+                       r->reg = be32_to_cpup(p++);
+                       r->enable = be32_to_cpup(p++);
+                       r->disable = be32_to_cpup(p++);
+                       r->shift = be32_to_cpup(p++);
+                       r->nbits = be32_to_cpup(p++);
+
+                       for (j = r->start_id;
+                            j < (r->start_id + r->num_ids);
+                            j++)
+                               dscr.devstate_info[j].stat = r;
+               }
+       }
+}
+
+static struct of_device_id dscr_ids[] __initdata = {
+       { .compatible = "ti,c64x+dscr" },
+       {}
+};
+
+/*
+ * Probe for DSCR area.
+ *
+ * This has to be done early on in case timer or interrupt controller
+ * needs something. e.g. On C6455 SoC, timer must be enabled through
+ * DSCR before it is functional.
+ */
+void __init dscr_probe(void)
+{
+       struct device_node *node;
+       void __iomem *base;
+
+       spin_lock_init(&dscr.lock);
+
+       node = of_find_matching_node(NULL, dscr_ids);
+       if (!node)
+               return;
+
+       base = of_iomap(node, 0);
+       if (!base) {
+               of_node_put(node);
+               return;
+       }
+
+       dscr.base = base;
+
+       dscr_parse_devstat(node, base);
+       dscr_parse_silicon_rev(node, base);
+       dscr_parse_mac_fuse(node, base);
+       dscr_parse_rmii_resets(node, base);
+       dscr_parse_locked_regs(node, base);
+       dscr_parse_kick_regs(node, base);
+       dscr_parse_devstate_ctl_regs(node, base);
+       dscr_parse_devstate_stat_regs(node, base);
+       dscr_parse_privperm(node, base);
+}
diff --git a/arch/c6x/platforms/emif.c b/arch/c6x/platforms/emif.c
new file mode 100644 (file)
index 0000000..6a0d4ff
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ *  External Memory Interface
+ *
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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/of.h>
+#include <linux/of_address.h>
+#include <linux/io.h>
+#include <asm/soc.h>
+#include <asm/dscr.h>
+
+#define NUM_EMIFA_CHIP_ENABLES 4
+
+struct emifa_regs {
+       u32     midr;
+       u32     stat;
+       u32     reserved1[6];
+       u32     bprio;
+       u32     reserved2[23];
+       u32     ce_config;
+       u32     cecfg[NUM_EMIFA_CHIP_ENABLES];
+       u32     reserved3[4];
+       u32     awcc;
+       u32     reserved4[7];
+       u32     intraw;
+       u32     intmsk;
+       u32     intmskset;
+       u32     intmskclr;
+};
+
+static struct of_device_id emifa_match[] __initdata = {
+       { .compatible = "ti,c64x+emifa" },
+       {}
+};
+
+/*
+ * Parse device tree for existence of an EMIF (External Memory Interface)
+ * and initialize it if found.
+ */
+static int __init c6x_emifa_init(void)
+{
+       struct emifa_regs __iomem *regs;
+       struct device_node *node;
+       const __be32 *p;
+       u32 val;
+       int i, len, err;
+
+       node = of_find_matching_node(NULL, emifa_match);
+       if (!node)
+               return 0;
+
+       regs = of_iomap(node, 0);
+       if (!regs)
+               return 0;
+
+       /* look for a dscr-based enable for emifa pin buffers */
+       err = of_property_read_u32_array(node, "ti,dscr-dev-enable", &val, 1);
+       if (!err)
+               dscr_set_devstate(val, DSCR_DEVSTATE_ENABLED);
+
+       /* set up the chip enables */
+       p = of_get_property(node, "ti,emifa-ce-config", &len);
+       if (p) {
+               len /= sizeof(u32);
+               if (len > NUM_EMIFA_CHIP_ENABLES)
+                       len = NUM_EMIFA_CHIP_ENABLES;
+               for (i = 0; i <= len; i++)
+                       soc_writel(be32_to_cpup(&p[i]), &regs->cecfg[i]);
+       }
+
+       err = of_property_read_u32_array(node, "ti,emifa-burst-priority", &val, 1);
+       if (!err)
+               soc_writel(val, &regs->bprio);
+
+       err = of_property_read_u32_array(node, "ti,emifa-async-wait-control", &val, 1);
+       if (!err)
+               soc_writel(val, &regs->awcc);
+
+       iounmap(regs);
+       of_node_put(node);
+       return 0;
+}
+pure_initcall(c6x_emifa_init);
diff --git a/arch/c6x/platforms/megamod-pic.c b/arch/c6x/platforms/megamod-pic.c
new file mode 100644 (file)
index 0000000..7c37a94
--- /dev/null
@@ -0,0 +1,349 @@
+/*
+ *  Support for C64x+ Megamodule Interrupt Controller
+ *
+ *  Copyright (C) 2010, 2011 Texas Instruments Incorporated
+ *  Contributed by: Mark Salter <msalter@redhat.com>
+ *
+ *  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/module.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_address.h>
+#include <linux/slab.h>
+#include <asm/soc.h>
+#include <asm/megamod-pic.h>
+
+#define NR_COMBINERS   4
+#define NR_MUX_OUTPUTS  12
+
+#define IRQ_UNMAPPED 0xffff
+
+/*
+ * Megamodule Interrupt Controller register layout
+ */
+struct megamod_regs {
+       u32     evtflag[8];
+       u32     evtset[8];
+       u32     evtclr[8];
+       u32     reserved0[8];
+       u32     evtmask[8];
+       u32     mevtflag[8];
+       u32     expmask[8];
+       u32     mexpflag[8];
+       u32     intmux_unused;
+       u32     intmux[7];
+       u32     reserved1[8];
+       u32     aegmux[2];
+       u32     reserved2[14];
+       u32     intxstat;
+       u32     intxclr;
+       u32     intdmask;
+       u32     reserved3[13];
+       u32     evtasrt;
+};
+
+struct megamod_pic {
+       struct irq_host *irqhost;
+       struct megamod_regs __iomem *regs;
+       raw_spinlock_t lock;
+
+       /* hw mux mapping */
+       unsigned int output_to_irq[NR_MUX_OUTPUTS];
+};
+
+static struct megamod_pic *mm_pic;
+
+struct megamod_cascade_data {
+       struct megamod_pic *pic;
+       int index;
+};
+
+static struct megamod_cascade_data cascade_data[NR_COMBINERS];
+
+static void mask_megamod(struct irq_data *data)
+{
+       struct megamod_pic *pic = irq_data_get_irq_chip_data(data);
+       irq_hw_number_t src = irqd_to_hwirq(data);
+       u32 __iomem *evtmask = &pic->regs->evtmask[src / 32];
+
+       raw_spin_lock(&pic->lock);
+       soc_writel(soc_readl(evtmask) | (1 << (src & 31)), evtmask);
+       raw_spin_unlock(&pic->lock);
+}
+
+static void unmask_megamod(struct irq_data *data)
+{
+       struct megamod_pic *pic = irq_data_get_irq_chip_data(data);
+       irq_hw_number_t src = irqd_to_hwirq(data);
+       u32 __iomem *evtmask = &pic->regs->evtmask[src / 32];
+
+       raw_spin_lock(&pic->lock);
+       soc_writel(soc_readl(evtmask) & ~(1 << (src & 31)), evtmask);
+       raw_spin_unlock(&pic->lock);
+}
+
+static struct irq_chip megamod_chip = {
+       .name           = "megamod",
+       .irq_mask       = mask_megamod,
+       .irq_unmask     = unmask_megamod,
+};
+
+static void megamod_irq_cascade(unsigned int irq, struct irq_desc *desc)
+{
+       struct megamod_cascade_data *cascade;
+       struct megamod_pic *pic;
+       u32 events;
+       int n, idx;
+
+       cascade = irq_desc_get_handler_data(desc);
+
+       pic = cascade->pic;
+       idx = cascade->index;
+
+       while ((events = soc_readl(&pic->regs->mevtflag[idx])) != 0) {
+               n = __ffs(events);
+
+               irq = irq_linear_revmap(pic->irqhost, idx * 32 + n);
+
+               soc_writel(1 << n, &pic->regs->evtclr[idx]);
+
+               generic_handle_irq(irq);
+       }
+}
+
+static int megamod_map(struct irq_host *h, unsigned int virq,
+                      irq_hw_number_t hw)
+{
+       struct megamod_pic *pic = h->host_data;
+       int i;
+
+       /* We shouldn't see a hwirq which is muxed to core controller */
+       for (i = 0; i < NR_MUX_OUTPUTS; i++)
+               if (pic->output_to_irq[i] == hw)
+                       return -1;
+
+       irq_set_chip_data(virq, pic);
+       irq_set_chip_and_handler(virq, &megamod_chip, handle_level_irq);
+
+       /* Set default irq type */
+       irq_set_irq_type(virq, IRQ_TYPE_NONE);
+
+       return 0;
+}
+
+static int megamod_xlate(struct irq_host *h, struct device_node *ct,
+                        const u32 *intspec, unsigned int intsize,
+                        irq_hw_number_t *out_hwirq, unsigned int *out_type)
+
+{
+       /* megamod intspecs must have 1 cell */
+       BUG_ON(intsize != 1);
+       *out_hwirq = intspec[0];
+       *out_type = IRQ_TYPE_NONE;
+       return 0;
+}
+
+static struct irq_host_ops megamod_host_ops = {
+       .map    = megamod_map,
+       .xlate  = megamod_xlate,
+};
+
+static void __init set_megamod_mux(struct megamod_pic *pic, int src, int output)
+{
+       int index, offset;
+       u32 val;
+
+       if (src < 0 || src >= (NR_COMBINERS * 32)) {
+               pic->output_to_irq[output] = IRQ_UNMAPPED;
+               return;
+       }
+
+       /* four mappings per mux register */
+       index = output / 4;
+       offset = (output & 3) * 8;
+
+       val = soc_readl(&pic->regs->intmux[index]);
+       val &= ~(0xff << offset);
+       val |= src << offset;
+       soc_writel(val, &pic->regs->intmux[index]);
+}
+
+/*
+ * Parse the MUX mapping, if one exists.
+ *
+ * The MUX map is an array of up to 12 cells; one for each usable core priority
+ * interrupt. The value of a given cell is the megamodule interrupt source
+ * which is to me MUXed to the output corresponding to the cell position
+ * withing the array. The first cell in the array corresponds to priority
+ * 4 and the last (12th) cell corresponds to priority 15. The allowed
+ * values are 4 - ((NR_COMBINERS * 32) - 1). Note that the combined interrupt
+ * sources (0 - 3) are not allowed to be mapped through this property. They
+ * are handled through the "interrupts" property. This allows us to use a
+ * value of zero as a "do not map" placeholder.
+ */
+static void __init parse_priority_map(struct megamod_pic *pic,
+                                     int *mapping, int size)
+{
+       struct device_node *np = pic->irqhost->of_node;
+       const __be32 *map;
+       int i, maplen;
+       u32 val;
+
+       map = of_get_property(np, "ti,c64x+megamod-pic-mux", &maplen);
+       if (map) {
+               maplen /= 4;
+               if (maplen > size)
+                       maplen = size;
+
+               for (i = 0; i < maplen; i++) {
+                       val = be32_to_cpup(map);
+                       if (val && val >= 4)
+                               mapping[i] = val;
+                       ++map;
+               }
+       }
+}
+
+static struct megamod_pic * __init init_megamod_pic(struct device_node *np)
+{
+       struct megamod_pic *pic;
+       int i, irq;
+       int mapping[NR_MUX_OUTPUTS];
+
+       pr_info("Initializing C64x+ Megamodule PIC\n");
+
+       pic = kzalloc(sizeof(struct megamod_pic), GFP_KERNEL);
+       if (!pic) {
+               pr_err("%s: Could not alloc PIC structure.\n", np->full_name);
+               return NULL;
+       }
+
+       pic->irqhost = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR,
+                                     NR_COMBINERS * 32, &megamod_host_ops,
+                                     IRQ_UNMAPPED);
+       if (!pic->irqhost) {
+               pr_err("%s: Could not alloc host.\n", np->full_name);
+               goto error_free;
+       }
+
+       pic->irqhost->host_data = pic;
+
+       raw_spin_lock_init(&pic->lock);
+
+       pic->regs = of_iomap(np, 0);
+       if (!pic->regs) {
+               pr_err("%s: Could not map registers.\n", np->full_name);
+               goto error_free;
+       }
+
+       /* Initialize MUX map */
+       for (i = 0; i < ARRAY_SIZE(mapping); i++)
+               mapping[i] = IRQ_UNMAPPED;
+
+       parse_priority_map(pic, mapping, ARRAY_SIZE(mapping));
+
+       /*
+        * We can have up to 12 interrupts cascading to the core controller.
+        * These cascades can be from the combined interrupt sources or for
+        * individual interrupt sources. The "interrupts" property only
+        * deals with the cascaded combined interrupts. The individual
+        * interrupts muxed to the core controller use the core controller
+        * as their interrupt parent.
+        */
+       for (i = 0; i < NR_COMBINERS; i++) {
+
+               irq = irq_of_parse_and_map(np, i);
+               if (irq == NO_IRQ)
+                       continue;
+
+               /*
+                * We count on the core priority interrupts (4 - 15) being
+                * direct mapped. Check that device tree provided something
+                * in that range.
+                */
+               if (irq < 4 || irq >= NR_PRIORITY_IRQS) {
+                       pr_err("%s: combiner-%d virq %d out of range!\n",
+                                np->full_name, i, irq);
+                       continue;
+               }
+
+               /* record the mapping */
+               mapping[irq - 4] = i;
+
+               pr_debug("%s: combiner-%d cascading to virq %d\n",
+                        np->full_name, i, irq);
+
+               cascade_data[i].pic = pic;
+               cascade_data[i].index = i;
+
+               /* mask and clear all events in combiner */
+               soc_writel(~0, &pic->regs->evtmask[i]);
+               soc_writel(~0, &pic->regs->evtclr[i]);
+
+               irq_set_handler_data(irq, &cascade_data[i]);
+               irq_set_chained_handler(irq, megamod_irq_cascade);
+       }
+
+       /* Finally, set up the MUX registers */
+       for (i = 0; i < NR_MUX_OUTPUTS; i++) {
+               if (mapping[i] != IRQ_UNMAPPED) {
+                       pr_debug("%s: setting mux %d to priority %d\n",
+                                np->full_name, mapping[i], i + 4);
+                       set_megamod_mux(pic, mapping[i], i);
+               }
+       }
+
+       return pic;
+
+error_free:
+       kfree(pic);
+
+       return NULL;
+}
+
+/*
+ * Return next active event after ACK'ing it.
+ * Return -1 if no events active.
+ */
+static int get_exception(void)
+{
+       int i, bit;
+       u32 mask;
+
+       for (i = 0; i < NR_COMBINERS; i++) {
+               mask = soc_readl(&mm_pic->regs->mexpflag[i]);
+               if (mask) {
+                       bit = __ffs(mask);
+                       soc_writel(1 << bit, &mm_pic->regs->evtclr[i]);
+                       return (i * 32) + bit;
+               }
+       }
+       return -1;
+}
+
+static void assert_event(unsigned int val)
+{
+       soc_writel(val, &mm_pic->regs->evtasrt);
+}
+
+void __init megamod_pic_init(void)
+{
+       struct device_node *np;
+
+       np = of_find_compatible_node(NULL, NULL, "ti,c64x+megamod-pic");
+       if (!np)
+               return;
+
+       mm_pic = init_megamod_pic(np);
+       of_node_put(np);
+
+       soc_ops.get_exception = get_exception;
+       soc_ops.assert_event = assert_event;
+
+       return;
+}
diff --git a/arch/c6x/platforms/platform.c b/arch/c6x/platforms/platform.c
new file mode 100644 (file)
index 0000000..26c1a35
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2011 Texas Instruments Incorporated
+ *
+ * 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_platform.h>
+
+static int __init c6x_device_probe(void)
+{
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+       return 0;
+}
+core_initcall(c6x_device_probe);
diff --git a/arch/c6x/platforms/pll.c b/arch/c6x/platforms/pll.c
new file mode 100644 (file)
index 0000000..3aa898f
--- /dev/null
@@ -0,0 +1,444 @@
+/*
+ * Clock and PLL control for C64x+ devices
+ *
+ * Copyright (C) 2010, 2011 Texas Instruments.
+ * Contributed by: Mark Salter <msalter@redhat.com>
+ *
+ * Copied heavily from arm/mach-davinci/clock.c, so:
+ *
+ * Copyright (C) 2006-2007 Texas Instruments.
+ * Copyright (C) 2008-2009 Deep Root Systems, LLC
+ *
+ * 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.
+ */
+
+#include <linux/module.h>
+#include <linux/clkdev.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/err.h>
+
+#include <asm/clock.h>
+#include <asm/soc.h>
+
+static LIST_HEAD(clocks);
+static DEFINE_MUTEX(clocks_mutex);
+static DEFINE_SPINLOCK(clockfw_lock);
+
+static void __clk_enable(struct clk *clk)
+{
+       if (clk->parent)
+               __clk_enable(clk->parent);
+       clk->usecount++;
+}
+
+static void __clk_disable(struct clk *clk)
+{
+       if (WARN_ON(clk->usecount == 0))
+               return;
+       --clk->usecount;
+
+       if (clk->parent)
+               __clk_disable(clk->parent);
+}
+
+int clk_enable(struct clk *clk)
+{
+       unsigned long flags;
+
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       __clk_enable(clk);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+EXPORT_SYMBOL(clk_enable);
+
+void clk_disable(struct clk *clk)
+{
+       unsigned long flags;
+
+       if (clk == NULL || IS_ERR(clk))
+               return;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       __clk_disable(clk);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+}
+EXPORT_SYMBOL(clk_disable);
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       return clk->rate;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       if (clk->round_rate)
+               return clk->round_rate(clk, rate);
+
+       return clk->rate;
+}
+EXPORT_SYMBOL(clk_round_rate);
+
+/* Propagate rate to children */
+static void propagate_rate(struct clk *root)
+{
+       struct clk *clk;
+
+       list_for_each_entry(clk, &root->children, childnode) {
+               if (clk->recalc)
+                       clk->rate = clk->recalc(clk);
+               propagate_rate(clk);
+       }
+}
+
+int clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long flags;
+       int ret = -EINVAL;
+
+       if (clk == NULL || IS_ERR(clk))
+               return ret;
+
+       if (clk->set_rate)
+               ret = clk->set_rate(clk, rate);
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       if (ret == 0) {
+               if (clk->recalc)
+                       clk->rate = clk->recalc(clk);
+               propagate_rate(clk);
+       }
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_set_rate);
+
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+       unsigned long flags;
+
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       /* Cannot change parent on enabled clock */
+       if (WARN_ON(clk->usecount))
+               return -EINVAL;
+
+       mutex_lock(&clocks_mutex);
+       clk->parent = parent;
+       list_del_init(&clk->childnode);
+       list_add(&clk->childnode, &clk->parent->children);
+       mutex_unlock(&clocks_mutex);
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       if (clk->recalc)
+               clk->rate = clk->recalc(clk);
+       propagate_rate(clk);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+EXPORT_SYMBOL(clk_set_parent);
+
+int clk_register(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       if (WARN(clk->parent && !clk->parent->rate,
+                "CLK: %s parent %s has no rate!\n",
+                clk->name, clk->parent->name))
+               return -EINVAL;
+
+       mutex_lock(&clocks_mutex);
+       list_add_tail(&clk->node, &clocks);
+       if (clk->parent)
+               list_add_tail(&clk->childnode, &clk->parent->children);
+       mutex_unlock(&clocks_mutex);
+
+       /* If rate is already set, use it */
+       if (clk->rate)
+               return 0;
+
+       /* Else, see if there is a way to calculate it */
+       if (clk->recalc)
+               clk->rate = clk->recalc(clk);
+
+       /* Otherwise, default to parent rate */
+       else if (clk->parent)
+               clk->rate = clk->parent->rate;
+
+       return 0;
+}
+EXPORT_SYMBOL(clk_register);
+
+void clk_unregister(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return;
+
+       mutex_lock(&clocks_mutex);
+       list_del(&clk->node);
+       list_del(&clk->childnode);
+       mutex_unlock(&clocks_mutex);
+}
+EXPORT_SYMBOL(clk_unregister);
+
+
+static u32 pll_read(struct pll_data *pll, int reg)
+{
+       return soc_readl(pll->base + reg);
+}
+
+static unsigned long clk_sysclk_recalc(struct clk *clk)
+{
+       u32 v, plldiv = 0;
+       struct pll_data *pll;
+       unsigned long rate = clk->rate;
+
+       if (WARN_ON(!clk->parent))
+               return rate;
+
+       rate = clk->parent->rate;
+
+       /* the parent must be a PLL */
+       if (WARN_ON(!clk->parent->pll_data))
+               return rate;
+
+       pll = clk->parent->pll_data;
+
+       /* If pre-PLL, source clock is before the multiplier and divider(s) */
+       if (clk->flags & PRE_PLL)
+               rate = pll->input_rate;
+
+       if (!clk->div) {
+               pr_debug("%s: (no divider) rate = %lu KHz\n",
+                        clk->name, rate / 1000);
+               return rate;
+       }
+
+       if (clk->flags & FIXED_DIV_PLL) {
+               rate /= clk->div;
+               pr_debug("%s: (fixed divide by %d) rate = %lu KHz\n",
+                        clk->name, clk->div, rate / 1000);
+               return rate;
+       }
+
+       v = pll_read(pll, clk->div);
+       if (v & PLLDIV_EN)
+               plldiv = (v & PLLDIV_RATIO_MASK) + 1;
+
+       if (plldiv == 0)
+               plldiv = 1;
+
+       rate /= plldiv;
+
+       pr_debug("%s: (divide by %d) rate = %lu KHz\n",
+                clk->name, plldiv, rate / 1000);
+
+       return rate;
+}
+
+static unsigned long clk_leafclk_recalc(struct clk *clk)
+{
+       if (WARN_ON(!clk->parent))
+               return clk->rate;
+
+       pr_debug("%s: (parent %s) rate = %lu KHz\n",
+                clk->name, clk->parent->name,  clk->parent->rate / 1000);
+
+       return clk->parent->rate;
+}
+
+static unsigned long clk_pllclk_recalc(struct clk *clk)
+{
+       u32 ctrl, mult = 0, prediv = 0, postdiv = 0;
+       u8 bypass;
+       struct pll_data *pll = clk->pll_data;
+       unsigned long rate = clk->rate;
+
+       if (clk->flags & FIXED_RATE_PLL)
+               return rate;
+
+       ctrl = pll_read(pll, PLLCTL);
+       rate = pll->input_rate = clk->parent->rate;
+
+       if (ctrl & PLLCTL_PLLEN)
+               bypass = 0;
+       else
+               bypass = 1;
+
+       if (pll->flags & PLL_HAS_MUL) {
+               mult = pll_read(pll, PLLM);
+               mult = (mult & PLLM_PLLM_MASK) + 1;
+       }
+       if (pll->flags & PLL_HAS_PRE) {
+               prediv = pll_read(pll, PLLPRE);
+               if (prediv & PLLDIV_EN)
+                       prediv = (prediv & PLLDIV_RATIO_MASK) + 1;
+               else
+                       prediv = 0;
+       }
+       if (pll->flags & PLL_HAS_POST) {
+               postdiv = pll_read(pll, PLLPOST);
+               if (postdiv & PLLDIV_EN)
+                       postdiv = (postdiv & PLLDIV_RATIO_MASK) + 1;
+               else
+                       postdiv = 1;
+       }
+
+       if (!bypass) {
+               if (prediv)
+                       rate /= prediv;
+               if (mult)
+                       rate *= mult;
+               if (postdiv)
+                       rate /= postdiv;
+
+               pr_debug("PLL%d: input = %luMHz, pre[%d] mul[%d] post[%d] "
+                        "--> %luMHz output.\n",
+                        pll->num, clk->parent->rate / 1000000,
+                        prediv, mult, postdiv, rate / 1000000);
+       } else
+               pr_debug("PLL%d: input = %luMHz, bypass mode.\n",
+                        pll->num, clk->parent->rate / 1000000);
+
+       return rate;
+}
+
+
+static void __init __init_clk(struct clk *clk)
+{
+       INIT_LIST_HEAD(&clk->node);
+       INIT_LIST_HEAD(&clk->children);
+       INIT_LIST_HEAD(&clk->childnode);
+
+       if (!clk->recalc) {
+
+               /* Check if clock is a PLL */
+               if (clk->pll_data)
+                       clk->recalc = clk_pllclk_recalc;
+
+               /* Else, if it is a PLL-derived clock */
+               else if (clk->flags & CLK_PLL)
+                       clk->recalc = clk_sysclk_recalc;
+
+               /* Otherwise, it is a leaf clock (PSC clock) */
+               else if (clk->parent)
+                       clk->recalc = clk_leafclk_recalc;
+       }
+}
+
+void __init c6x_clks_init(struct clk_lookup *clocks)
+{
+       struct clk_lookup *c;
+       struct clk *clk;
+       size_t num_clocks = 0;
+
+       for (c = clocks; c->clk; c++) {
+               clk = c->clk;
+
+               __init_clk(clk);
+               clk_register(clk);
+               num_clocks++;
+
+               /* Turn on clocks that Linux doesn't otherwise manage */
+               if (clk->flags & ALWAYS_ENABLED)
+                       clk_enable(clk);
+       }
+
+       clkdev_add_table(clocks, num_clocks);
+}
+
+#ifdef CONFIG_DEBUG_FS
+
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+
+#define CLKNAME_MAX    10              /* longest clock name */
+#define NEST_DELTA     2
+#define NEST_MAX       4
+
+static void
+dump_clock(struct seq_file *s, unsigned nest, struct clk *parent)
+{
+       char            *state;
+       char            buf[CLKNAME_MAX + NEST_DELTA * NEST_MAX];
+       struct clk      *clk;
+       unsigned        i;
+
+       if (parent->flags & CLK_PLL)
+               state = "pll";
+       else
+               state = "";
+
+       /* <nest spaces> name <pad to end> */
+       memset(buf, ' ', sizeof(buf) - 1);
+       buf[sizeof(buf) - 1] = 0;
+       i = strlen(parent->name);
+       memcpy(buf + nest, parent->name,
+              min(i, (unsigned)(sizeof(buf) - 1 - nest)));
+
+       seq_printf(s, "%s users=%2d %-3s %9ld Hz\n",
+                  buf, parent->usecount, state, clk_get_rate(parent));
+       /* REVISIT show device associations too */
+
+       /* cost is now small, but not linear... */
+       list_for_each_entry(clk, &parent->children, childnode) {
+               dump_clock(s, nest + NEST_DELTA, clk);
+       }
+}
+
+static int c6x_ck_show(struct seq_file *m, void *v)
+{
+       struct clk *clk;
+
+       /*
+        * Show clock tree; We trust nonzero usecounts equate to PSC enables...
+        */
+       mutex_lock(&clocks_mutex);
+       list_for_each_entry(clk, &clocks, node)
+               if (!clk->parent)
+                       dump_clock(m, 0, clk);
+       mutex_unlock(&clocks_mutex);
+
+       return 0;
+}
+
+static int c6x_ck_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, c6x_ck_show, NULL);
+}
+
+static const struct file_operations c6x_ck_operations = {
+       .open           = c6x_ck_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+};
+
+static int __init c6x_clk_debugfs_init(void)
+{
+       debugfs_create_file("c6x_clocks", S_IFREG | S_IRUGO, NULL, NULL,
+                           &c6x_ck_operations);
+
+       return 0;
+}
+device_initcall(c6x_clk_debugfs_init);
+#endif /* CONFIG_DEBUG_FS */
diff --git a/arch/c6x/platforms/plldata.c b/arch/c6x/platforms/plldata.c
new file mode 100644 (file)
index 0000000..2cfd6f4
--- /dev/null
@@ -0,0 +1,404 @@
+/*
+ *  Port on Texas Instruments TMS320C6x architecture
+ *
+ *  Copyright (C) 2011 Texas Instruments Incorporated
+ *  Author: Mark Salter <msalter@redhat.com>
+ *
+ *  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/kernel.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/ioport.h>
+#include <linux/clkdev.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+#include <asm/clock.h>
+#include <asm/setup.h>
+#include <asm/irq.h>
+
+/*
+ * Common SoC clock support.
+ */
+
+/* Default input for PLL1 */
+struct clk clkin1 = {
+       .name = "clkin1",
+       .node = LIST_HEAD_INIT(clkin1.node),
+       .children = LIST_HEAD_INIT(clkin1.children),
+       .childnode = LIST_HEAD_INIT(clkin1.childnode),
+};
+
+struct pll_data c6x_soc_pll1 = {
+       .num       = 1,
+       .sysclks   = {
+               {
+                       .name = "pll1",
+                       .parent = &clkin1,
+                       .pll_data = &c6x_soc_pll1,
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk1",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk2",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk3",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk4",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk5",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk6",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk7",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk8",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk9",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk10",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk11",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk12",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk13",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk14",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk15",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+               {
+                       .name = "pll1_sysclk16",
+                       .parent = &c6x_soc_pll1.sysclks[0],
+                       .flags = CLK_PLL,
+               },
+       },
+};
+
+/* CPU core clock */
+struct clk c6x_core_clk = {
+       .name = "core",
+};
+
+/* miscellaneous IO clocks */
+struct clk c6x_i2c_clk = {
+       .name = "i2c",
+};
+
+struct clk c6x_watchdog_clk = {
+       .name = "watchdog",
+};
+
+struct clk c6x_mcbsp1_clk = {
+       .name = "mcbsp1",
+};
+
+struct clk c6x_mcbsp2_clk = {
+       .name = "mcbsp2",
+};
+
+struct clk c6x_mdio_clk = {
+       .name = "mdio",
+};
+
+
+#ifdef CONFIG_SOC_TMS320C6455
+static struct clk_lookup c6455_clks[] = {
+       CLK(NULL, "pll1", &c6x_soc_pll1.sysclks[0]),
+       CLK(NULL, "pll1_sysclk2", &c6x_soc_pll1.sysclks[2]),
+       CLK(NULL, "pll1_sysclk3", &c6x_soc_pll1.sysclks[3]),
+       CLK(NULL, "pll1_sysclk4", &c6x_soc_pll1.sysclks[4]),
+       CLK(NULL, "pll1_sysclk5", &c6x_soc_pll1.sysclks[5]),
+       CLK(NULL, "core", &c6x_core_clk),
+       CLK("i2c_davinci.1", NULL, &c6x_i2c_clk),
+       CLK("watchdog", NULL, &c6x_watchdog_clk),
+       CLK("2c81800.mdio", NULL, &c6x_mdio_clk),
+       CLK("", NULL, NULL)
+};
+
+
+static void __init c6455_setup_clocks(struct device_node *node)
+{
+       struct pll_data *pll = &c6x_soc_pll1;
+       struct clk *sysclks = pll->sysclks;
+
+       pll->flags = PLL_HAS_PRE | PLL_HAS_MUL;
+
+       sysclks[2].flags |= FIXED_DIV_PLL;
+       sysclks[2].div = 3;
+       sysclks[3].flags |= FIXED_DIV_PLL;
+       sysclks[3].div = 6;
+       sysclks[4].div = PLLDIV4;
+       sysclks[5].div = PLLDIV5;
+
+       c6x_core_clk.parent = &sysclks[0];
+       c6x_i2c_clk.parent = &sysclks[3];
+       c6x_watchdog_clk.parent = &sysclks[3];
+       c6x_mdio_clk.parent = &sysclks[3];
+
+       c6x_clks_init(c6455_clks);
+}
+#endif /* CONFIG_SOC_TMS320C6455 */
+
+#ifdef CONFIG_SOC_TMS320C6457
+static struct clk_lookup c6457_clks[] = {
+       CLK(NULL, "pll1", &c6x_soc_pll1.sysclks[0]),
+       CLK(NULL, "pll1_sysclk1", &c6x_soc_pll1.sysclks[1]),
+       CLK(NULL, "pll1_sysclk2", &c6x_soc_pll1.sysclks[2]),
+       CLK(NULL, "pll1_sysclk3", &c6x_soc_pll1.sysclks[3]),
+       CLK(NULL, "pll1_sysclk4", &c6x_soc_pll1.sysclks[4]),
+       CLK(NULL, "pll1_sysclk5", &c6x_soc_pll1.sysclks[5]),
+       CLK(NULL, "core", &c6x_core_clk),
+       CLK("i2c_davinci.1", NULL, &c6x_i2c_clk),
+       CLK("watchdog", NULL, &c6x_watchdog_clk),
+       CLK("2c81800.mdio", NULL, &c6x_mdio_clk),
+       CLK("", NULL, NULL)
+};
+
+static void __init c6457_setup_clocks(struct device_node *node)
+{
+       struct pll_data *pll = &c6x_soc_pll1;
+       struct clk *sysclks = pll->sysclks;
+
+       pll->flags = PLL_HAS_MUL | PLL_HAS_POST;
+
+       sysclks[1].flags |= FIXED_DIV_PLL;
+       sysclks[1].div = 1;
+       sysclks[2].flags |= FIXED_DIV_PLL;
+       sysclks[2].div = 3;
+       sysclks[3].flags |= FIXED_DIV_PLL;
+       sysclks[3].div = 6;
+       sysclks[4].div = PLLDIV4;
+       sysclks[5].div = PLLDIV5;
+
+       c6x_core_clk.parent = &sysclks[1];
+       c6x_i2c_clk.parent = &sysclks[3];
+       c6x_watchdog_clk.parent = &sysclks[5];
+       c6x_mdio_clk.parent = &sysclks[5];
+
+       c6x_clks_init(c6457_clks);
+}
+#endif /* CONFIG_SOC_TMS320C6455 */
+
+#ifdef CONFIG_SOC_TMS320C6472
+static struct clk_lookup c6472_clks[] = {
+       CLK(NULL, "pll1", &c6x_soc_pll1.sysclks[0]),
+       CLK(NULL, "pll1_sysclk1", &c6x_soc_pll1.sysclks[1]),
+       CLK(NULL, "pll1_sysclk2", &c6x_soc_pll1.sysclks[2]),
+       CLK(NULL, "pll1_sysclk3", &c6x_soc_pll1.sysclks[3]),
+       CLK(NULL, "pll1_sysclk4", &c6x_soc_pll1.sysclks[4]),
+       CLK(NULL, "pll1_sysclk5", &c6x_soc_pll1.sysclks[5]),
+       CLK(NULL, "pll1_sysclk6", &c6x_soc_pll1.sysclks[6]),
+       CLK(NULL, "pll1_sysclk7", &c6x_soc_pll1.sysclks[7]),
+       CLK(NULL, "pll1_sysclk8", &c6x_soc_pll1.sysclks[8]),
+       CLK(NULL, "pll1_sysclk9", &c6x_soc_pll1.sysclks[9]),
+       CLK(NULL, "pll1_sysclk10", &c6x_soc_pll1.sysclks[10]),
+       CLK(NULL, "core", &c6x_core_clk),
+       CLK("i2c_davinci.1", NULL, &c6x_i2c_clk),
+       CLK("watchdog", NULL, &c6x_watchdog_clk),
+       CLK("2c81800.mdio", NULL, &c6x_mdio_clk),
+       CLK("", NULL, NULL)
+};
+
+/* assumptions used for delay loop calculations */
+#define MIN_CLKIN1_KHz 15625
+#define MAX_CORE_KHz   700000
+#define MIN_PLLOUT_KHz MIN_CLKIN1_KHz
+
+static void __init c6472_setup_clocks(struct device_node *node)
+{
+       struct pll_data *pll = &c6x_soc_pll1;
+       struct clk *sysclks = pll->sysclks;
+       int i;
+
+       pll->flags = PLL_HAS_MUL;
+
+       for (i = 1; i <= 6; i++) {
+               sysclks[i].flags |= FIXED_DIV_PLL;
+               sysclks[i].div = 1;
+       }
+
+       sysclks[7].flags |= FIXED_DIV_PLL;
+       sysclks[7].div = 3;
+       sysclks[8].flags |= FIXED_DIV_PLL;
+       sysclks[8].div = 6;
+       sysclks[9].flags |= FIXED_DIV_PLL;
+       sysclks[9].div = 2;
+       sysclks[10].div = PLLDIV10;
+
+       c6x_core_clk.parent = &sysclks[get_coreid() + 1];
+       c6x_i2c_clk.parent = &sysclks[8];
+       c6x_watchdog_clk.parent = &sysclks[8];
+       c6x_mdio_clk.parent = &sysclks[5];
+
+       c6x_clks_init(c6472_clks);
+}
+#endif /* CONFIG_SOC_TMS320C6472 */
+
+
+#ifdef CONFIG_SOC_TMS320C6474
+static struct clk_lookup c6474_clks[] = {
+       CLK(NULL, "pll1", &c6x_soc_pll1.sysclks[0]),
+       CLK(NULL, "pll1_sysclk7", &c6x_soc_pll1.sysclks[7]),
+       CLK(NULL, "pll1_sysclk9", &c6x_soc_pll1.sysclks[9]),
+       CLK(NULL, "pll1_sysclk10", &c6x_soc_pll1.sysclks[10]),
+       CLK(NULL, "pll1_sysclk11", &c6x_soc_pll1.sysclks[11]),
+       CLK(NULL, "pll1_sysclk12", &c6x_soc_pll1.sysclks[12]),
+       CLK(NULL, "pll1_sysclk13", &c6x_soc_pll1.sysclks[13]),
+       CLK(NULL, "core", &c6x_core_clk),
+       CLK("i2c_davinci.1", NULL, &c6x_i2c_clk),
+       CLK("mcbsp.1", NULL, &c6x_mcbsp1_clk),
+       CLK("mcbsp.2", NULL, &c6x_mcbsp2_clk),
+       CLK("watchdog", NULL, &c6x_watchdog_clk),
+       CLK("2c81800.mdio", NULL, &c6x_mdio_clk),
+       CLK("", NULL, NULL)
+};
+
+static void __init c6474_setup_clocks(struct device_node *node)
+{
+       struct pll_data *pll = &c6x_soc_pll1;
+       struct clk *sysclks = pll->sysclks;
+
+       pll->flags = PLL_HAS_MUL;
+
+       sysclks[7].flags |= FIXED_DIV_PLL;
+       sysclks[7].div = 1;
+       sysclks[9].flags |= FIXED_DIV_PLL;
+       sysclks[9].div = 3;
+       sysclks[10].flags |= FIXED_DIV_PLL;
+       sysclks[10].div = 6;
+
+       sysclks[11].div = PLLDIV11;
+
+       sysclks[12].flags |= FIXED_DIV_PLL;
+       sysclks[12].div = 2;
+
+       sysclks[13].div = PLLDIV13;
+
+       c6x_core_clk.parent = &sysclks[7];
+       c6x_i2c_clk.parent = &sysclks[10];
+       c6x_watchdog_clk.parent = &sysclks[10];
+       c6x_mcbsp1_clk.parent = &sysclks[10];
+       c6x_mcbsp2_clk.parent = &sysclks[10];
+
+       c6x_clks_init(c6474_clks);
+}
+#endif /* CONFIG_SOC_TMS320C6474 */
+
+static struct of_device_id c6x_clkc_match[] __initdata = {
+#ifdef CONFIG_SOC_TMS320C6455
+       { .compatible = "ti,c6455-pll", .data = c6455_setup_clocks },
+#endif
+#ifdef CONFIG_SOC_TMS320C6457
+       { .compatible = "ti,c6457-pll", .data = c6457_setup_clocks },
+#endif
+#ifdef CONFIG_SOC_TMS320C6472
+       { .compatible = "ti,c6472-pll", .data = c6472_setup_clocks },
+#endif
+#ifdef CONFIG_SOC_TMS320C6474
+       { .compatible = "ti,c6474-pll", .data = c6474_setup_clocks },
+#endif
+       { .compatible = "ti,c64x+pll" },
+       {}
+};
+
+void __init c64x_setup_clocks(void)
+{
+       void (*__setup_clocks)(struct device_node *np);
+       struct pll_data *pll = &c6x_soc_pll1;
+       struct device_node *node;
+       const struct of_device_id *id;
+       int err;
+       u32 val;
+
+       node = of_find_matching_node(NULL, c6x_clkc_match);
+       if (!node)
+               return;
+
+       pll->base = of_iomap(node, 0);
+       if (!pll->base)
+               goto out;
+
+       err = of_property_read_u32(node, "clock-frequency", &val);
+       if (err || val == 0) {
+               pr_err("%s: no clock-frequency found! Using %dMHz\n",
+                      node->full_name, (int)val / 1000000);
+               val = 25000000;
+       }
+       clkin1.rate = val;
+
+       err = of_property_read_u32(node, "ti,c64x+pll-bypass-delay", &val);
+       if (err)
+               val = 5000;
+       pll->bypass_delay = val;
+
+       err = of_property_read_u32(node, "ti,c64x+pll-reset-delay", &val);
+       if (err)
+               val = 30000;
+       pll->reset_delay = val;
+
+       err = of_property_read_u32(node, "ti,c64x+pll-lock-delay", &val);
+       if (err)
+               val = 30000;
+       pll->lock_delay = val;
+
+       /* id->data is a pointer to SoC-specific setup */
+       id = of_match_node(c6x_clkc_match, node);
+       if (id && id->data) {
+               __setup_clocks = id->data;
+               __setup_clocks(node);
+       }
+
+out:
+       of_node_put(node);
+}
diff --git a/arch/c6x/platforms/timer64.c b/arch/c6x/platforms/timer64.c
new file mode 100644 (file)
index 0000000..7834158
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ *  Copyright (C) 2010, 2011 Texas Instruments Incorporated
+ *  Contributed by: Mark Salter (msalter@redhat.com)
+ *
+ *  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/interrupt.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_address.h>
+#include <asm/soc.h>
+#include <asm/dscr.h>
+#include <asm/timer64.h>
+
+struct timer_regs {
+       u32     reserved0;
+       u32     emumgt;
+       u32     reserved1;
+       u32     reserved2;
+       u32     cntlo;
+       u32     cnthi;
+       u32     prdlo;
+       u32     prdhi;
+       u32     tcr;
+       u32     tgcr;
+       u32     wdtcr;
+};
+
+static struct timer_regs __iomem *timer;
+
+#define TCR_TSTATLO         0x001
+#define TCR_INVOUTPLO       0x002
+#define TCR_INVINPLO        0x004
+#define TCR_CPLO            0x008
+#define TCR_ENAMODELO_ONCE   0x040
+#define TCR_ENAMODELO_CONT   0x080
+#define TCR_ENAMODELO_MASK   0x0c0
+#define TCR_PWIDLO_MASK      0x030
+#define TCR_CLKSRCLO        0x100
+#define TCR_TIENLO          0x200
+#define TCR_TSTATHI         (0x001 << 16)
+#define TCR_INVOUTPHI       (0x002 << 16)
+#define TCR_CPHI            (0x008 << 16)
+#define TCR_PWIDHI_MASK      (0x030 << 16)
+#define TCR_ENAMODEHI_ONCE   (0x040 << 16)
+#define TCR_ENAMODEHI_CONT   (0x080 << 16)
+#define TCR_ENAMODEHI_MASK   (0x0c0 << 16)
+
+#define TGCR_TIMLORS        0x001
+#define TGCR_TIMHIRS        0x002
+#define TGCR_TIMMODE_UD32    0x004
+#define TGCR_TIMMODE_WDT64   0x008
+#define TGCR_TIMMODE_CD32    0x00c
+#define TGCR_TIMMODE_MASK    0x00c
+#define TGCR_PSCHI_MASK      (0x00f << 8)
+#define TGCR_TDDRHI_MASK     (0x00f << 12)
+
+/*
+ * Timer clocks are divided down from the CPU clock
+ * The divisor is in the EMUMGTCLKSPD register
+ */
+#define TIMER_DIVISOR \
+       ((soc_readl(&timer->emumgt) & (0xf << 16)) >> 16)
+
+#define TIMER64_RATE (c6x_core_freq / TIMER_DIVISOR)
+
+#define TIMER64_MODE_DISABLED 0
+#define TIMER64_MODE_ONE_SHOT TCR_ENAMODELO_ONCE
+#define TIMER64_MODE_PERIODIC TCR_ENAMODELO_CONT
+
+static int timer64_mode;
+static int timer64_devstate_id = -1;
+
+static void timer64_config(unsigned long period)
+{
+       u32 tcr = soc_readl(&timer->tcr) & ~TCR_ENAMODELO_MASK;
+
+       soc_writel(tcr, &timer->tcr);
+       soc_writel(period - 1, &timer->prdlo);
+       soc_writel(0, &timer->cntlo);
+       tcr |= timer64_mode;
+       soc_writel(tcr, &timer->tcr);
+}
+
+static void timer64_enable(void)
+{
+       u32 val;
+
+       if (timer64_devstate_id >= 0)
+               dscr_set_devstate(timer64_devstate_id, DSCR_DEVSTATE_ENABLED);
+
+       /* disable timer, reset count */
+       soc_writel(soc_readl(&timer->tcr) & ~TCR_ENAMODELO_MASK, &timer->tcr);
+       soc_writel(0, &timer->prdlo);
+
+       /* use internal clock and 1 cycle pulse width */
+       val = soc_readl(&timer->tcr);
+       soc_writel(val & ~(TCR_CLKSRCLO | TCR_PWIDLO_MASK), &timer->tcr);
+
+       /* dual 32-bit unchained mode */
+       val = soc_readl(&timer->tgcr) & ~TGCR_TIMMODE_MASK;
+       soc_writel(val, &timer->tgcr);
+       soc_writel(val | (TGCR_TIMLORS | TGCR_TIMMODE_UD32), &timer->tgcr);
+}
+
+static void timer64_disable(void)
+{
+       /* disable timer, reset count */
+       soc_writel(soc_readl(&timer->tcr) & ~TCR_ENAMODELO_MASK, &timer->tcr);
+       soc_writel(0, &timer->prdlo);
+
+       if (timer64_devstate_id >= 0)
+               dscr_set_devstate(timer64_devstate_id, DSCR_DEVSTATE_DISABLED);
+}
+
+static int next_event(unsigned long delta,
+                     struct clock_event_device *evt)
+{
+       timer64_config(delta);
+       return 0;
+}
+
+static void set_clock_mode(enum clock_event_mode mode,
+                          struct clock_event_device *evt)
+{
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               timer64_enable();
+               timer64_mode = TIMER64_MODE_PERIODIC;
+               timer64_config(TIMER64_RATE / HZ);
+               break;
+       case CLOCK_EVT_MODE_ONESHOT:
+               timer64_enable();
+               timer64_mode = TIMER64_MODE_ONE_SHOT;
+               break;
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_SHUTDOWN:
+               timer64_mode = TIMER64_MODE_DISABLED;
+               timer64_disable();
+               break;
+       case CLOCK_EVT_MODE_RESUME:
+               break;
+       }
+}
+
+static struct clock_event_device t64_clockevent_device = {
+       .name           = "TIMER64_EVT32_TIMER",
+       .features       = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
+       .rating         = 200,
+       .set_mode       = set_clock_mode,
+       .set_next_event = next_event,
+};
+
+static irqreturn_t timer_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *cd = &t64_clockevent_device;
+
+       cd->event_handler(cd);
+
+       return IRQ_HANDLED;
+}
+
+static struct irqaction timer_iact = {
+       .name           = "timer",
+       .flags          = IRQF_TIMER,
+       .handler        = timer_interrupt,
+       .dev_id         = &t64_clockevent_device,
+};
+
+void __init timer64_init(void)
+{
+       struct clock_event_device *cd = &t64_clockevent_device;
+       struct device_node *np, *first = NULL;
+       u32 val;
+       int err, found = 0;
+
+       for_each_compatible_node(np, NULL, "ti,c64x+timer64") {
+               err = of_property_read_u32(np, "ti,core-mask", &val);
+               if (!err) {
+                       if (val & (1 << get_coreid())) {
+                               found = 1;
+                               break;
+                       }
+               } else if (!first)
+                       first = np;
+       }
+       if (!found) {
+               /* try first one with no core-mask */
+               if (first)
+                       np = of_node_get(first);
+               else {
+                       pr_debug("Cannot find ti,c64x+timer64 timer.\n");
+                       return;
+               }
+       }
+
+       timer = of_iomap(np, 0);
+       if (!timer) {
+               pr_debug("%s: Cannot map timer registers.\n", np->full_name);
+               goto out;
+       }
+       pr_debug("%s: Timer registers=%p.\n", np->full_name, timer);
+
+       cd->irq = irq_of_parse_and_map(np, 0);
+       if (cd->irq == NO_IRQ) {
+               pr_debug("%s: Cannot find interrupt.\n", np->full_name);
+               iounmap(timer);
+               goto out;
+       }
+
+       /* If there is a device state control, save the ID. */
+       err = of_property_read_u32(np, "ti,dscr-dev-enable", &val);
+       if (!err)
+               timer64_devstate_id = val;
+
+       pr_debug("%s: Timer irq=%d.\n", np->full_name, cd->irq);
+
+       clockevents_calc_mult_shift(cd, c6x_core_freq / TIMER_DIVISOR, 5);
+
+       cd->max_delta_ns        = clockevent_delta2ns(0x7fffffff, cd);
+       cd->min_delta_ns        = clockevent_delta2ns(250, cd);
+
+       cd->cpumask             = cpumask_of(smp_processor_id());
+
+       clockevents_register_device(cd);
+       setup_irq(cd->irq, &timer_iact);
+
+out:
+       of_node_put(np);
+       return;
+}
index 642c6fed43d753b4375ff97ffa3f215eec849349..f8476d9e856b9d06da038eb49c90db2c60f053af 100644 (file)
@@ -1394,11 +1394,10 @@ static int create_md5_pad(int alloc_flag, unsigned long long hashed_length, char
 
        if (padlen < MD5_MIN_PAD_LENGTH) padlen += MD5_BLOCK_LENGTH;
 
-       p = kmalloc(padlen, alloc_flag);
+       p = kzalloc(padlen, alloc_flag);
        if (!p) return -ENOMEM;
 
        *p = 0x80;
-       memset(p+1, 0, padlen - 1);
 
        DEBUG(printk("create_md5_pad: hashed_length=%lld bits == %lld bytes\n", bit_length, hashed_length));
 
@@ -1426,11 +1425,10 @@ static int create_sha1_pad(int alloc_flag, unsigned long long hashed_length, cha
 
        if (padlen < SHA1_MIN_PAD_LENGTH) padlen += SHA1_BLOCK_LENGTH;
 
-       p = kmalloc(padlen, alloc_flag);
+       p = kzalloc(padlen, alloc_flag);
        if (!p) return -ENOMEM;
 
        *p = 0x80;
-       memset(p+1, 0, padlen - 1);
 
        DEBUG(printk("create_sha1_pad: hashed_length=%lld bits == %lld bytes\n", bit_length, hashed_length));
 
index 511ece94a574a7b6ae2538774923e3d8e760140f..42ed6c7970667ce42266559eebce92c13263c755 100644 (file)
@@ -115,8 +115,6 @@ void user_disable_single_step(struct task_struct *child)
 void
 ptrace_disable(struct task_struct *child)
 {
-       unsigned long tmp;
-
        /* Deconfigure SPC and S-bit. */
        user_disable_single_step(child);
        put_reg(child, PT_SPC, 0);
index 1de779f4f240e6747bc86828896cc2c06971a0c0..7caf25d58e6b6e3b76f75251e0831e1251ced43a 100644 (file)
@@ -7,7 +7,7 @@
 #define L1_CACHE_BYTES 32
 #define L1_CACHE_SHIFT 5
 
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
 
 void flush_dma_list(dma_descr_data *descr);
 void flush_dma_descr(dma_descr_data *descr, int flush_buf);
index 02513c2dd5ec99a9e6d0b4c0e4613465c8110a32..a35ec474d0c18e048b1c5461321e68c20701080d 100644 (file)
@@ -13,20 +13,18 @@ config HEXAGON
        # select ARCH_REQUIRE_GPIOLIB
        # select HAVE_CLK
        # select IRQ_PER_CPU
-       select HAVE_IRQ_WORK
        # select GENERIC_PENDING_IRQ if SMP
+       select HAVE_IRQ_WORK
        select GENERIC_ATOMIC64
        select HAVE_PERF_EVENTS
        select HAVE_GENERIC_HARDIRQS
-       select GENERIC_HARDIRQS_NO__DO_IRQ
-       select GENERIC_HARDIRQS_NO_DEPRECATED
        # GENERIC_ALLOCATOR is used by dma_alloc_coherent()
        select GENERIC_ALLOCATOR
        select GENERIC_IRQ_SHOW
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_TRACEHOOK
        select NO_IOPORT
-       # mostly generic routines, with some accelerated ones
+       select STACKTRACE_SUPPORT
        ---help---
          Qualcomm Hexagon is a processor architecture designed for high
          performance and low power across a wide variety of applications.
@@ -76,15 +74,6 @@ config GENERIC_IRQ_PROBE
 config GENERIC_IOMAP
        def_bool y
 
-#config ZONE_DMA
-#      bool
-#      default y
-
-config HAS_DMA
-       bool
-       select HAVE_DMA_ATTRS
-       default y
-
 config NEED_SG_DMA_LENGTH
        def_bool y
 
@@ -117,14 +106,11 @@ config GENERIC_BUG
        def_bool y
        depends on BUG
 
-config BUG
-       def_bool y
-
 menu "Machine selection"
 
 choice
        prompt "System type"
-       default HEXAGON_ARCH_V2
+       default HEXAGON_COMET
 
 config HEXAGON_COMET
        bool "Comet Board"
@@ -197,8 +183,7 @@ source "kernel/Kconfig.hz"
 source "kernel/time/Kconfig"
 
 config GENERIC_GPIO
-       bool "Generic GPIO support"
-       default n
+       def_bool n
 
 endmenu
 
index 0c4de8790fd54fce3477cf5c0f0227dba3351839..9dfe1b95e8a7b40dab00a8ecbba33f39b79da5c5 100644 (file)
@@ -52,7 +52,3 @@ core-y += arch/hexagon/kernel/ \
        arch/hexagon/mm/ \
        arch/hexagon/lib/
 
-#      arch/hexagon/platform/common/
-#
-#core-$(CONFIG_HEXAGON_COMET)          += arch/hexagon/platform/comet/
-#machine-$(CONFIG_HEXAGON_COMET)               := comet
index 5e937af1c4ad7ae0ae20734a6851d6738b8cd42f..99b5a7575c21416449c856e17e9a85b15088a6fc 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef _ASM_SPINLOCK_TYPES_H
 #define _ASM_SPINLOCK_TYPES_H
 
-#include <linux/version.h>
-
 #ifndef __LINUX_SPINLOCK_TYPES_H
 # error "please don't include this file directly"
 #endif
index e711ace62fdf9b60eb93d97cf0de193d936cce35..54891e1eca51180f6ab39ac840b62936c7e40056 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/bootmem.h>
 #include <linux/genalloc.h>
 #include <asm/dma-mapping.h>
+#include <linux/module.h>
 
 struct dma_map_ops *dma_ops;
 EXPORT_SYMBOL(dma_ops);
index bea3f08470fd226c7c5bf7024b906d1feb676468..8fe03494aa664c543a645b58be8dea96dd11ed4a 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/ptrace.h>
 #include <linux/regset.h>
 #include <linux/user.h>
+#include <linux/elf.h>
 
 #include <asm/system.h>
 #include <asm/user.h>
index 6bee15c9c113d7854991597fa0d2f0b7af4f9b91..36ba641857112e1382579d16bd8badf1942115ae 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
+#include <linux/module.h>
 
 #include <asm/timer-regs.h>
 #include <asm/hexagon_vm.h>
@@ -200,12 +201,10 @@ void __init time_init_deferred(void)
                resource = rtos_timer_device.resource;
 
        /*  ioremap here means this has to run later, after paging init  */
-       rtos_timer = ioremap(resource->start, resource->end
-               - resource->start + 1);
+       rtos_timer = ioremap(resource->start, resource_size(resource));
 
        if (!rtos_timer) {
-               release_mem_region(resource->start, resource->end
-                       - resource->start + 1);
+               release_mem_region(resource->start, resource_size(resource));
        }
        clocksource_register_khz(&hexagon_clocksource, pcycle_freq_mhz * 1000);
 
index 16277c33308af1cd6a735735bd24932bd76dff9e..e4ceedb97fcc814a88274f679b3ed760b4e58ac1 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/err.h>
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
+#include <linux/binfmts.h>
 
 #include <asm/vdso.h>
 
index af4fd5f8f8d5c9852359a47f9657bf32c395a2f9..9d4008fee6d80e9a04f022fa2cf8e078df7a366d 100644 (file)
@@ -2,6 +2,17 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config EARLY_PRINTK
+       bool "Early printk" if EMBEDDED
+       depends on MVME16x || MAC
+       default y
+       help
+          Write kernel log output directly to a serial port.
+
+          This is useful for kernel debugging when your machine crashes very
+          early before the console code is initialized.
+          You should normally say N here, unless you want to debug such a crash.
+
 config BOOTPARAM
        bool 'Compiled-in Kernel Boot Parameter'
 
index 6033f5d4e67e50a4b993cbdf9d0bb85cdd5cbba9..e01eeb263321d2e26235a33aed2ff85f39c63e95 100644 (file)
@@ -128,7 +128,7 @@ config DN_SERIAL
 
 config SERIAL_CONSOLE
        bool "Support for serial port console"
-       depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || MULTIFACE_III_TTY=y || SERIAL=y || SERIAL167 || DN_SERIAL)
+       depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || MULTIFACE_III_TTY=y || SERIAL=y || DN_SERIAL)
        ---help---
          If you say Y here, it will be possible to use a serial port as the
          system console (the system console is the device which receives all
index 6d196dadfdbc3dae5edca91a509527709ea8092c..8048e1b7e5528c9b9e50de5930350a375e6b5770 100644 (file)
@@ -82,8 +82,6 @@ __ALIGN_STR "\n\t"
 
 extern void atari_microwire_cmd(int cmd);
 
-extern int atari_SCC_reset_done;
-
 static unsigned int atari_irq_startup(struct irq_data *data)
 {
        unsigned int irq = data->irq;
index 5a484247e493ebb8b6f9be142cdcdfe0db978c92..a547ba9683d14a551c9d4a18632d3c3a5d7a1bed 100644 (file)
@@ -202,7 +202,6 @@ static void __init atari_init_mfp_port(int cflag)
 
 static void __init atari_init_scc_port(int cflag)
 {
-       extern int atari_SCC_reset_done;
        static int clksrc_table[9] =
                /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
                { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
index ad9e85760e34ce5b8e4748092b23df6add8238f9..958a7ce49dee695f3ff1e0f5c5b9f2b6f2cd2f17 100644 (file)
@@ -323,7 +323,6 @@ CONFIG_ATARI_MIDI=y
 CONFIG_ATARI_DSP56K=m
 CONFIG_AMIGA_BUILTIN_SERIAL=y
 CONFIG_MULTIFACE_III_TTY=m
-CONFIG_SERIAL167=y
 CONFIG_DN_SERIAL=y
 CONFIG_SERIAL_CONSOLE=y
 CONFIG_EXT2_FS=y
index c45aaf3b816f3a5af596f149d421d7e69335e260..6dd12e62b41b13e33e93f24af121b13fcbfc37eb 100644 (file)
@@ -218,7 +218,6 @@ CONFIG_GEN_RTC_X=y
 CONFIG_HID=m
 CONFIG_HIDRAW=y
 # CONFIG_USB_SUPPORT is not set
-CONFIG_SERIAL167=y
 CONFIG_SERIAL_CONSOLE=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
index c5748bb4ea718291f856591a6b417c2b82a6abd9..a985a7e87d45a76a3f07e2c2bd849bc0a06e628c 100644 (file)
@@ -39,7 +39,7 @@ enum {
 #define MAX_UNIT       8
 
 /* These identify the driver base version and may not be removed. */
-static const char version[] __devinitdata =
+static const char version[] __devinitconst =
        KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE
        " S.Opichal, M.Jurik, P.Stehlik\n"
        KERN_INFO " http://aranym.org/\n";
index 1c05a6260546482ea365e9f6ef9c2e68f065c9bd..bf16af1edacfe8fb9c91a5f19673042cf0664dd6 100644 (file)
@@ -24,7 +24,8 @@
 
 unsigned long hp300_model;
 unsigned long hp300_uart_scode = -1;
-unsigned char ledstate;
+unsigned char hp300_ledstate;
+EXPORT_SYMBOL(hp300_ledstate);
 
 static char s_hp330[] __initdata = "330";
 static char s_hp340[] __initdata = "340";
index 0392b28656abb306e330fe5d4edcf44a9b5f2a7e..c0cb363507754af5028d284d9cd89f39fffeb699 100644 (file)
@@ -30,6 +30,8 @@ extern u_long atari_switches;
 extern int atari_rtc_year_offset;
 extern int atari_dont_touch_floppy_select;
 
+extern int atari_SCC_reset_done;
+
 /* convenience macros for testing machine type */
 #define MACH_IS_ST     ((atari_mch_cookie >> 16) == ATARI_MCH_ST)
 #define MACH_IS_STE    ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
index 1a749cf7b06d6982d224232eb40602eca03347c7..0626582a7db4ab2944182c37a1439896b2249688 100644 (file)
 
 #define HP300_LEDS             0xf001ffff
 
-extern unsigned char ledstate;
+extern unsigned char hp300_ledstate;
 
 static __inline__ void blinken_leds(int on, int off)
 {
        if (MACH_IS_HP300)
        {
-               ledstate |= on;
-               ledstate &= ~off;
-               out_8(HP300_LEDS, ~ledstate);
+               hp300_ledstate |= on;
+               hp300_ledstate &= ~off;
+               out_8(HP300_LEDS, ~hp300_ledstate);
        }
 }
 
index c2a042b8c34908ca3ed5516b874e04fa360a02c2..a2d32f6589f948703462903ec844e2f4d59233cb 100644 (file)
@@ -29,4 +29,10 @@ struct baboon {
                                 */
 };
 
+extern int baboon_present;
+
+extern void baboon_register_interrupts(void);
+extern void baboon_irq_enable(int);
+extern void baboon_irq_disable(int);
+
 #endif /* __ASSEMBLY **/
index a2c7e6fcca38c7bce09d665af394d1ac7015c480..fde874a01e20fe001f78d5f4f5e440786f614d48 100644 (file)
@@ -159,4 +159,6 @@ extern void iop_upload_code(uint, __u8 *, uint, __u16);
 extern void iop_download_code(uint, __u8 *, uint, __u16);
 extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16);
 
+extern void iop_register_interrupts(void);
+
 #endif /* __ASSEMBLY__ */
index 3cf2b6ed685ab6e6d041c4375cdf55abbcdd9ae4..425fbff4f4d80dce4cf1b172aa9e0d66a72b1860 100644 (file)
 
 #define OSS_POWEROFF   0x80
 
-/*
- * OSS Interrupt levels for various sub-systems
- *
- * This mapping is laid out with two things in mind: first, we try to keep
- * things on their own levels to avoid having to do double-dispatches. Second,
- * the levels match as closely as possible the alternate IRQ mapping mode (aka
- * "A/UX mode") available on some VIA machines.
- */
-
-#define OSS_IRQLEV_DISABLED    0
-#define OSS_IRQLEV_IOPISM      1       /* ADB? */
-#define OSS_IRQLEV_SCSI                IRQ_AUTO_2
-#define OSS_IRQLEV_NUBUS       IRQ_AUTO_3      /* keep this on its own level */
-#define OSS_IRQLEV_IOPSCC      IRQ_AUTO_4      /* matches VIA alternate mapping */
-#define OSS_IRQLEV_SOUND       IRQ_AUTO_5      /* matches VIA alternate mapping */
-#define OSS_IRQLEV_60HZ                6       /* matches VIA alternate mapping */
-#define OSS_IRQLEV_VIA1                IRQ_AUTO_6      /* matches VIA alternate mapping */
-#define OSS_IRQLEV_PARITY      7       /* matches VIA alternate mapping */
-
 #ifndef __ASSEMBLY__
 
 struct mac_oss {
@@ -91,4 +72,8 @@ struct mac_oss {
 extern volatile struct mac_oss *oss;
 extern int oss_present;
 
+extern void oss_register_interrupts(void);
+extern void oss_irq_enable(int);
+extern void oss_irq_disable(int);
+
 #endif /* __ASSEMBLY__ */
index 7808bb0b23236e266739d85700bdd667040506e3..e5c0d71d154324bf39fcb2e038de4d78bd8526de 100644 (file)
 extern volatile __u8 *psc;
 extern int psc_present;
 
+extern void psc_register_interrupts(void);
+extern void psc_irq_enable(int);
+extern void psc_irq_disable(int);
+
 /*
  *     Access functions
  */
index a59665e1d41be7d0b4e595672a4a009886d66ea5..aeeedf8b2d259d6f9736d4bb946252055f8138f5 100644 (file)
 extern volatile __u8 *via1,*via2;
 extern int rbv_present,via_alt_mapping;
 
+extern void via_register_interrupts(void);
+extern void via_irq_enable(int);
+extern void via_irq_disable(int);
+extern void via_nubus_irq_startup(int irq);
+extern void via_nubus_irq_shutdown(int irq);
+extern void via1_irq(unsigned int irq, struct irq_desc *desc);
+extern void via1_set_head(int);
+extern int via2_scsi_drq_pending(void);
+
 static inline int rbv_set_video_bpp(int bpp)
 {
        char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
index 12ebe43b008b511839eb5825e08ee16d3fb7adaf..682a1a2ff55f931ceeeac2f812d5254a75d1810b 100644 (file)
 extern void mac_reset(void);
 extern void mac_poweroff(void);
 extern void mac_init_IRQ(void);
-extern int mac_irq_pending(unsigned int);
+
 extern void mac_irq_enable(struct irq_data *data);
 extern void mac_irq_disable(struct irq_data *data);
 
-/*
- *     Floppy driver magic hook - probably shouldn't be here
- */
-
-extern void via1_set_head(int);
-
 /*
  *     Macintosh Table
  */
@@ -48,7 +42,7 @@ struct mac_model
 #define MAC_ADB_IOP            6
 
 #define MAC_VIA_II             1
-#define MAC_VIA_IIci           2
+#define MAC_VIA_IICI           2
 #define MAC_VIA_QUADRA         3
 
 #define MAC_SCSI_NONE          0
index ebe1b70fe90c822e5e2f4aad3ed95f51f56e5188..92aa8a4c2d03f3d1594da73ca85357528158f514 100644 (file)
 #define IRQ_PSC4_3       (35)
 #define IRQ_MAC_MACE_DMA  IRQ_PSC4_3
 
+/* OSS Level 4 interrupts */
+#define IRQ_MAC_SCC      (33)
+
 /* Level 5 (PSC, AV Macs only) interrupts */
 #define IRQ_PSC5_0       (40)
 #define IRQ_PSC5_1       (41)
 #define IRQ_BABOON_2     (66)
 #define IRQ_BABOON_3     (67)
 
-/* On non-PSC machines, the serial ports share an IRQ */
-#define IRQ_MAC_SCC      IRQ_AUTO_4
-
 #define SLOT2IRQ(x)      (x + 47)
 #define IRQ2SLOT(x)      (x - 47)
 
index 2b90d6e690700ba66e85370268b0aa2284794043..7267536adbcc48d01b0afee6f7d1741bc6c24b42 100644 (file)
 #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
 #endif
 
+#ifdef CONFIG_ISA
 #define SERIAL_PORT_DFNS                       \
        /* UART CLK   PORT IRQ     FLAGS        */                      \
        { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },      /* ttyS0 */     \
        { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },      /* ttyS1 */     \
        { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },      /* ttyS2 */     \
        { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },     /* ttyS3 */
+#endif
index 303192fc9260d50f44cdf6e7ef0371a2fc41d9da..ea0b502f845ebf69843b90c5534ab11b36fcd2b9 100644 (file)
 #define __NR_adjtimex          124
 #define __NR_mprotect          125
 #define __NR_sigprocmask       126
-/*#define __NR_create_module   127*/
+#define __NR_create_module     127
 #define __NR_init_module       128
 #define __NR_delete_module     129
-/*#define __NR_get_kernel_syms 130*/
+#define __NR_get_kernel_syms   130
 #define __NR_quotactl          131
 #define __NR_getpgid           132
 #define __NR_fchdir            133
 #define __NR_setresuid         164
 #define __NR_getresuid         165
 #define __NR_getpagesize       166
-/*#define __NR_query_module    167*/
+#define __NR_query_module      167
 #define __NR_poll              168
 #define __NR_nfsservctl                169
 #define __NR_setresgid         170
 #define __NR_capset            185
 #define __NR_sigaltstack       186
 #define __NR_sendfile          187
-/*#define __NR_getpmsg         188*/   /* some people actually want streams */
-/*#define __NR_putpmsg         189*/   /* some people actually want streams */
+#define __NR_getpmsg           188     /* some people actually want streams */
+#define __NR_putpmsg           189     /* some people actually want streams */
 #define __NR_vfork             190
 #define __NR_ugetrlimit                191
 #define __NR_mmap2             192
index 27622b3273c1b1b9d54567435c4996f7a6580e8e..d197e7ff62c5635535db183ac46077d1478eacf9 100644 (file)
  * USE_MFP:    Use the ST-MFP port (Modem1) for serial debug.
  *
  * Macintosh constants:
- * MAC_SERIAL_DEBUG:   Turns on serial debug output for the Macintosh.
- * MAC_USE_SCC_A:      Use the SCC port A (modem) for serial debug.
- * MAC_USE_SCC_B:      Use the SCC port B (printer) for serial debug (default).
+ * MAC_USE_SCC_A: Use SCC port A (modem) for serial debug and early console.
+ * MAC_USE_SCC_B: Use SCC port B (printer) for serial debug and early console.
  */
 
 #include <linux/linkage.h>
 
 #include <asm/machw.h>
 
-/*
- * Macintosh console support
- */
-
 #ifdef CONFIG_FRAMEBUFFER_CONSOLE
 #define CONSOLE
 #define CONSOLE_PENGUIN
 #endif
 
-/*
- * Macintosh serial debug support; outputs boot info to the printer
- *   and/or modem serial ports
- */
-#undef MAC_SERIAL_DEBUG
+#ifdef CONFIG_EARLY_PRINTK
+#define SERIAL_DEBUG
+#else
+#undef SERIAL_DEBUG
+#endif
 
-/*
- * Macintosh serial debug port selection; define one or both;
- *   requires MAC_SERIAL_DEBUG to be defined
- */
-#define MAC_USE_SCC_A          /* Macintosh modem serial port */
-#define MAC_USE_SCC_B          /* Macintosh printer serial port */
+#else /* !CONFIG_MAC */
 
-#endif /* CONFIG_MAC */
+#define SERIAL_DEBUG
+
+#endif /* !CONFIG_MAC */
 
 #undef MMU_PRINT
 #undef MMU_NOCACHE_KERNEL
-#define SERIAL_DEBUG
 #undef DEBUG
 
 /*
@@ -655,11 +646,11 @@ ENTRY(__start)
        lea     %pc@(L(mac_rowbytes)),%a1
        movel   %a0@,%a1@
 
-#ifdef MAC_SERIAL_DEBUG
+#ifdef SERIAL_DEBUG
        get_bi_record   BI_MAC_SCCBASE
        lea     %pc@(L(mac_sccbase)),%a1
        movel   %a0@,%a1@
-#endif /* MAC_SERIAL_DEBUG */
+#endif
 
 #if 0
        /*
@@ -1427,7 +1418,7 @@ L(mmu_fixup_done):
        subl    %d0,L(console_font)
        subl    %d0,L(console_font_data)
 #endif
-#ifdef MAC_SERIAL_DEBUG
+#ifdef SERIAL_DEBUG
        orl     #0x50000000,L(mac_sccbase)
 #endif
 1:
@@ -1917,7 +1908,7 @@ mmu_030_print:
        jbne    30b
 
 mmu_print_done:
-       puts    "\n\n"
+       puts    "\n"
 
 func_return    mmu_print
 
@@ -2768,7 +2759,7 @@ L(scc_initable_mac):
        .byte   9,0             /* no interrupts */
        .byte   10,0            /* NRZ */
        .byte   11,0x50         /* use baud rate generator */
-       .byte   12,10,13,0      /* 9600 baud */
+       .byte   12,1,13,0       /* 38400 baud */
        .byte   14,1            /* Baud rate generator enable */
        .byte   3,0xc1          /* enable receiver */
        .byte   5,0xea          /* enable transmitter */
@@ -2906,10 +2897,12 @@ func_start      serial_init,%d0/%d1/%a0/%a1
 #endif
 #ifdef CONFIG_MAC
        is_not_mac(L(serial_init_not_mac))
-#ifdef MAC_SERIAL_DEBUG
-#if !defined(MAC_USE_SCC_A) && !defined(MAC_USE_SCC_B)
-#define MAC_USE_SCC_B
-#endif
+
+#ifdef SERIAL_DEBUG
+/* You may define either or both of these. */
+#define MAC_USE_SCC_A /* Modem port */
+#define MAC_USE_SCC_B /* Printer port */
+
 #define mac_scc_cha_b_ctrl_offset      0x0
 #define mac_scc_cha_a_ctrl_offset      0x2
 #define mac_scc_cha_b_data_offset      0x4
@@ -2940,7 +2933,7 @@ func_start        serial_init,%d0/%d1/%a0/%a1
        jra     7b
 8:
 #endif /* MAC_USE_SCC_B */
-#endif /* MAC_SERIAL_DEBUG */
+#endif /* SERIAL_DEBUG */
 
        jra     L(serial_init_done)
 L(serial_init_not_mac):
@@ -3011,7 +3004,7 @@ func_start        serial_putc,%d0/%d1/%a0/%a1
 #ifdef CONFIG_MAC
        is_not_mac(5f)
 
-#ifdef MAC_SERIAL_DEBUG
+#ifdef SERIAL_DEBUG
 
 #ifdef MAC_USE_SCC_A
        movel   %pc@(L(mac_sccbase)),%a1
@@ -3029,7 +3022,7 @@ func_start        serial_putc,%d0/%d1/%a0/%a1
        moveb   %d0,%a1@(mac_scc_cha_b_data_offset)
 #endif /* MAC_USE_SCC_B */
 
-#endif /* MAC_SERIAL_DEBUG */
+#endif /* SERIAL_DEBUG */
 
        jra     L(serial_putc_done)
 5:
@@ -3248,33 +3241,39 @@ func_return     putn
 
 #ifdef CONFIG_MAC
 /*
- *     mac_serial_print
+ *     mac_early_print
  *
  *     This routine takes its parameters on the stack.  It then
- *     turns around and calls the internal routine.  This routine
- *     is used until the Linux console driver initializes itself.
+ *     turns around and calls the internal routines.  This routine
+ *     is used by the boot console.
  *
  *     The calling parameters are:
- *             void mac_serial_print(const char *str);
+ *             void mac_early_print(const char *str, unsigned length);
  *
  *     This routine does NOT understand variable arguments only
  *     simple strings!
  */
-ENTRY(mac_serial_print)
-       moveml  %d0/%a0,%sp@-
-#if 1
-       move    %sr,%sp@-
+ENTRY(mac_early_print)
+       moveml  %d0/%d1/%a0,%sp@-
+       movew   %sr,%sp@-
        ori     #0x0700,%sr
-#endif
-       movel   %sp@(10),%a0            /* fetch parameter */
+       movel   %sp@(18),%a0            /* fetch parameter */
+       movel   %sp@(22),%d1            /* fetch parameter */
        jra     2f
-1:     serial_putc     %d0
-2:     moveb   %a0@+,%d0
-       jne     1b
-#if 1
-       move    %sp@+,%sr
+1:
+#ifdef CONSOLE
+       console_putc    %d0
 #endif
-       moveml  %sp@+,%d0/%a0
+#ifdef SERIAL_DEBUG
+       serial_putc     %d0
+#endif
+       subq    #1,%d1
+2:     jeq     3f
+       moveb   %a0@+,%d0
+       jne     1b
+3:
+       movew   %sp@+,%sr
+       moveml  %sp@+,%d0/%d1/%a0
        rts
 #endif /* CONFIG_MAC */
 
@@ -3409,10 +3408,10 @@ func_start      console_put_stats,%a0/%d7
         *              a0 = pointer to boot_info
         *              d7 = value of boot_info fields
         */
-       puts    "\nMacLinux\n\n"
+       puts    "\nMacLinux\n"
 
 #ifdef SERIAL_DEBUG
-       puts    " vidaddr:"
+       puts    "\n vidaddr:"
        putn    %pc@(L(mac_videobase))          /* video addr. */
 
        puts    "\n  _stext:"
@@ -3423,19 +3422,21 @@ func_start      console_put_stats,%a0/%d7
        lea     %pc@(_end),%a0
        putn    %a0
 
-       puts    "\ncpuid:"
+       puts    "\n   cpuid:"
        putn    %pc@(L(cputype))
-       putc    '\n'
 
-#ifdef MAC_SERIAL_DEBUG
+#  ifdef CONFIG_MAC
+       puts    "\n sccbase:"
        putn    %pc@(L(mac_sccbase))
+#  endif
+#  ifdef MMU_PRINT
        putc    '\n'
-#endif
-#  if defined(MMU_PRINT)
        jbsr    mmu_print_machine_cpu_types
-#  endif /* MMU_PRINT */
+#  endif
 #endif /* SERIAL_DEBUG */
 
+       putc    '\n'
+
 func_return    console_put_stats
 
 #ifdef CONSOLE_PENGUIN
@@ -3896,11 +3897,11 @@ L(mac_dimensions):
        .long   0
 L(mac_rowbytes):
        .long   0
-#ifdef MAC_SERIAL_DEBUG
+#ifdef SERIAL_DEBUG
 L(mac_sccbase):
        .long   0
-#endif /* MAC_SERIAL_DEBUG */
 #endif
+#endif /* CONFIG_MAC */
 
 #if defined (CONFIG_APOLLO)
 LSRB0        = 0x10412
index b403924a1cad16f8ddeaf35da8003a3803041eca..3fe0e43d44f630dafea61dcdaa44835e0e84bbcd 100644 (file)
@@ -8,13 +8,8 @@
 
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/init.h>
 #include <linux/irq.h>
 
-#include <asm/traps.h>
-#include <asm/bootinfo.h>
 #include <asm/macintosh.h>
 #include <asm/macints.h>
 #include <asm/mac_baboon.h>
@@ -23,7 +18,6 @@
 
 int baboon_present;
 static volatile struct baboon *baboon;
-static unsigned char baboon_disabled;
 
 #if 0
 extern int macide_ack_intr(struct ata_channel *);
@@ -89,51 +83,32 @@ static void baboon_irq(unsigned int irq, struct irq_desc *desc)
 
 void __init baboon_register_interrupts(void)
 {
-       baboon_disabled = 0;
        irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq);
 }
 
 /*
- * The means for masking individual baboon interrupts remains a mystery, so
- * enable the umbrella interrupt only when no baboon interrupt is disabled.
+ * The means for masking individual Baboon interrupts remains a mystery.
+ * However, since we only use the IDE IRQ, we can just enable/disable all
+ * Baboon interrupts. If/when we handle more than one Baboon IRQ, we must
+ * either figure out how to mask them individually or else implement the
+ * same workaround that's used for NuBus slots (see nubus_disabled and
+ * via_nubus_irq_shutdown).
  */
 
 void baboon_irq_enable(int irq)
 {
-       int irq_idx = IRQ_IDX(irq);
-
 #ifdef DEBUG_IRQUSE
        printk("baboon_irq_enable(%d)\n", irq);
 #endif
 
-       baboon_disabled &= ~(1 << irq_idx);
-       if (!baboon_disabled)
-               mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
+       mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
 }
 
 void baboon_irq_disable(int irq)
 {
-       int irq_idx = IRQ_IDX(irq);
-
 #ifdef DEBUG_IRQUSE
        printk("baboon_irq_disable(%d)\n", irq);
 #endif
 
-       baboon_disabled |= 1 << irq_idx;
-       if (baboon_disabled)
-               mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
-}
-
-void baboon_irq_clear(int irq)
-{
-       int irq_idx = IRQ_IDX(irq);
-
-       baboon->mb_ifr &= ~(1 << irq_idx);
-}
-
-int baboon_irq_pending(int irq)
-{
-       int irq_idx = IRQ_IDX(irq);
-
-       return baboon->mb_ifr & (1 << irq_idx);
+       mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
 }
index c247de02bc7e2fe0c49cc09522f75b9f4d0b3a67..f60ff5f59205c1f2285f53fd2c1ae08bae9d6d93 100644 (file)
@@ -71,6 +71,31 @@ static void mac_get_model(char *str);
 static void mac_identify(void);
 static void mac_report_hardware(void);
 
+#ifdef CONFIG_EARLY_PRINTK
+asmlinkage void __init mac_early_print(const char *s, unsigned n);
+
+static void __init mac_early_cons_write(struct console *con,
+                                 const char *s, unsigned n)
+{
+       mac_early_print(s, n);
+}
+
+static struct console __initdata mac_early_cons = {
+       .name  = "early",
+       .write = mac_early_cons_write,
+       .flags = CON_PRINTBUFFER | CON_BOOT,
+       .index = -1
+};
+
+int __init mac_unregister_early_cons(void)
+{
+       /* mac_early_print can't be used after init sections are discarded */
+       return unregister_console(&mac_early_cons);
+}
+
+late_initcall(mac_unregister_early_cons);
+#endif
+
 static void __init mac_sched_init(irq_handler_t vector)
 {
        via_init_clock(vector);
@@ -164,6 +189,10 @@ void __init config_mac(void)
        mach_beep = mac_mksound;
 #endif
 
+#ifdef CONFIG_EARLY_PRINTK
+       register_console(&mac_early_cons);
+#endif
+
        /*
         * Determine hardware present
         */
@@ -192,7 +221,7 @@ void __init config_mac(void)
  * inaccurate, so look here if a new Mac model won't run. Example: if
  * a Mac crashes immediately after the VIA1 registers have been dumped
  * to the screen, it probably died attempting to read DirB on a RBV.
- * Meaning it should have MAC_VIA_IIci here :-)
+ * Meaning it should have MAC_VIA_IICI here :-)
  */
 
 struct mac_model *macintosh_config;
@@ -267,7 +296,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_IICI,
                .name           = "IIci",
                .adb_type       = MAC_ADB_II,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -276,7 +305,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_IIFX,
                .name           = "IIfx",
                .adb_type       = MAC_ADB_IOP,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_IOP,
                .nubus_type     = MAC_NUBUS,
@@ -285,7 +314,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_IISI,
                .name           = "IIsi",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -294,7 +323,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_IIVI,
                .name           = "IIvi",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -303,7 +332,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_IIVX,
                .name           = "IIvx",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -318,7 +347,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_CLII,
                .name           = "Classic II",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -327,7 +356,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_CCL,
                .name           = "Color Classic",
                .adb_type       = MAC_ADB_CUDA,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -336,7 +365,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_CCLII,
                .name           = "Color Classic II",
                .adb_type       = MAC_ADB_CUDA,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -351,7 +380,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_LC,
                .name           = "LC",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -360,7 +389,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_LCII,
                .name           = "LC II",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -369,7 +398,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_LCIII,
                .name           = "LC III",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -497,7 +526,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_P460,
                .name           = "Performa 460",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -524,7 +553,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_P520,
                .name           = "Performa 520",
                .adb_type       = MAC_ADB_CUDA,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -533,7 +562,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_P550,
                .name           = "Performa 550",
                .adb_type       = MAC_ADB_CUDA,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -565,7 +594,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_TV,
                .name           = "TV",
                .adb_type       = MAC_ADB_CUDA,
-               .via_type       = MAC_VIA_QUADRA,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -574,7 +603,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_P600,
                .name           = "Performa 600",
                .adb_type       = MAC_ADB_IISI,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_II,
                .nubus_type     = MAC_NUBUS,
@@ -645,8 +674,8 @@ static struct mac_model mac_data_table[] = {
        }, {
                .ident          = MAC_MODEL_PB150,
                .name           = "PowerBook 150",
-               .adb_type       = MAC_ADB_PB1,
-               .via_type       = MAC_VIA_IIci,
+               .adb_type       = MAC_ADB_PB2,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .ide_type       = MAC_IDE_PB,
                .scc_type       = MAC_SCC_QUADRA,
@@ -732,17 +761,13 @@ static struct mac_model mac_data_table[] = {
         * PowerBook Duos are pretty much like normal PowerBooks
         * All of these probably have onboard SONIC in the Dock which
         * means we'll have to probe for it eventually.
-        *
-        * Are these really MAC_VIA_IIci? The developer notes for the
-        * Duos show pretty much the same custom parts as in most of
-        * the other PowerBooks which would imply MAC_VIA_QUADRA.
         */
 
        {
                .ident          = MAC_MODEL_PB210,
                .name           = "PowerBook Duo 210",
                .adb_type       = MAC_ADB_PB2,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_QUADRA,
                .nubus_type     = MAC_NUBUS,
@@ -751,7 +776,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_PB230,
                .name           = "PowerBook Duo 230",
                .adb_type       = MAC_ADB_PB2,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_QUADRA,
                .nubus_type     = MAC_NUBUS,
@@ -760,7 +785,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_PB250,
                .name           = "PowerBook Duo 250",
                .adb_type       = MAC_ADB_PB2,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_QUADRA,
                .nubus_type     = MAC_NUBUS,
@@ -769,7 +794,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_PB270C,
                .name           = "PowerBook Duo 270c",
                .adb_type       = MAC_ADB_PB2,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_QUADRA,
                .nubus_type     = MAC_NUBUS,
@@ -778,7 +803,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_PB280,
                .name           = "PowerBook Duo 280",
                .adb_type       = MAC_ADB_PB2,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_QUADRA,
                .nubus_type     = MAC_NUBUS,
@@ -787,7 +812,7 @@ static struct mac_model mac_data_table[] = {
                .ident          = MAC_MODEL_PB280C,
                .name           = "PowerBook Duo 280c",
                .adb_type       = MAC_ADB_PB2,
-               .via_type       = MAC_VIA_IIci,
+               .via_type       = MAC_VIA_IICI,
                .scsi_type      = MAC_SCSI_OLD,
                .scc_type       = MAC_SCC_QUADRA,
                .nubus_type     = MAC_NUBUS,
@@ -864,8 +889,14 @@ static void __init mac_identify(void)
                scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
                break;
        default:
-               scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
-               scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
+               /* On non-PSC machines, the serial ports share an IRQ. */
+               if (macintosh_config->ident == MAC_MODEL_IIFX) {
+                       scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
+                       scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
+               } else {
+                       scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4;
+                       scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4;
+               }
                break;
        }
 
index a5462cc0bfd65b70da36089b4ba6c45ef9b8c5cf..7d8d46127ad9fc91717dcb660ac9647d0b9708e4 100644 (file)
 #include <asm/macintosh.h>
 #include <asm/macints.h>
 #include <asm/mac_iop.h>
-#include <asm/mac_oss.h>
 
 /*#define DEBUG_IOP*/
 
@@ -149,8 +148,6 @@ static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN];
 
 irqreturn_t iop_ism_irq(int, void *);
 
-extern void oss_irq_enable(int);
-
 /*
  * Private access functions
  */
@@ -304,11 +301,10 @@ void __init iop_init(void)
 void __init iop_register_interrupts(void)
 {
        if (iop_ism_present) {
-               if (oss_present) {
-                       if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, 0,
+               if (macintosh_config->ident == MAC_MODEL_IIFX) {
+                       if (request_irq(IRQ_MAC_ADB, iop_ism_irq, 0,
                                        "ISM IOP", (void *)IOP_NUM_ISM))
                                pr_err("Couldn't register ISM IOP interrupt\n");
-                       oss_irq_enable(IRQ_MAC_ADB);
                } else {
                        if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP",
                                        (void *)IOP_NUM_ISM))
index ba220b70ab8cc5ea150c54707f366de876afa934..5c1a6b2ff0afc131e7ef49f048c94a1e7f9512e8 100644 (file)
  *               - slot 6: timer 1 (not on IIci)
  *               - slot 7: status of IRQ; signals 'any enabled int.'
  *
- *     2       - OSS (IIfx only?)
- *               - slot 0: SCSI interrupt
- *               - slot 1: Sound interrupt
- *
  * Levels 3-6 vary by machine type. For VIA or RBV Macintoshes:
  *
  *     3       - unused (?)
  *
  *     6       - off switch (?)
  *
- * For OSS Macintoshes (IIfx only at this point):
+ * Machines with Quadra-like VIA hardware, except PSC and PMU machines, support
+ * an alternate interrupt mapping, as used by A/UX. It spreads ethernet and
+ * sound out to their own autovector IRQs and gives VIA1 a higher priority:
  *
- *     3       - Nubus interrupt
- *               - slot 0: Slot $9
- *               - slot 1: Slot $A
- *               - slot 2: Slot $B
- *               - slot 3: Slot $C
- *               - slot 4: Slot $D
- *               - slot 5: Slot $E
+ *     1       - unused (?)
  *
- *     4       - SCC IOP
+ *     3       - on-board SONIC
+ *
+ *     5       - Apple Sound Chip (ASC)
+ *
+ *     6       - VIA1
+ *
+ * For OSS Macintoshes (IIfx only), we apply an interrupt mapping similar to
+ * the Quadra (A/UX) mapping:
+ *
+ *     1       - ISM IOP (ADB)
  *
- *     5       - ISM IOP (ADB?)
+ *     2       - SCSI
  *
- *     6       - unused
+ *     3       - NuBus
+ *
+ *     4       - SCC IOP
+ *
+ *     6       - VIA1
  *
  * For PSC Macintoshes (660AV, 840AV):
  *
  *   case. They're hidden behind the Nubus slot $C interrupt thus adding a
  *   third layer of indirection. Why oh why did the Apple engineers do that?
  *
- * - We support "fast" and "slow" handlers, just like the Amiga port. The
- *   fast handlers are called first and with all interrupts disabled. They
- *   are expected to execute quickly (hence the name). The slow handlers are
- *   called last with interrupts enabled and the interrupt level restored.
- *   They must therefore be reentrant.
- *
- *   TODO:
- *
  */
 
-#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/kernel_stat.h>
-#include <linux/interrupt.h> /* for intr_count */
+#include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/delay.h>
-#include <linux/seq_file.h>
 
-#include <asm/system.h>
 #include <asm/irq.h>
-#include <asm/traps.h>
-#include <asm/bootinfo.h>
 #include <asm/macintosh.h>
+#include <asm/macints.h>
 #include <asm/mac_via.h>
 #include <asm/mac_psc.h>
+#include <asm/mac_oss.h>
+#include <asm/mac_iop.h>
+#include <asm/mac_baboon.h>
 #include <asm/hwtest.h>
-#include <asm/errno.h>
-#include <asm/macints.h>
 #include <asm/irq_regs.h>
-#include <asm/mac_oss.h>
 
 #define SHUTUP_SONIC
 
-/*
- * VIA/RBV hooks
- */
-
-extern void via_register_interrupts(void);
-extern void via_irq_enable(int);
-extern void via_irq_disable(int);
-extern void via_irq_clear(int);
-extern int  via_irq_pending(int);
-
-/*
- * OSS hooks
- */
-
-extern void oss_register_interrupts(void);
-extern void oss_irq_enable(int);
-extern void oss_irq_disable(int);
-extern void oss_irq_clear(int);
-extern int  oss_irq_pending(int);
-
-/*
- * PSC hooks
- */
-
-extern void psc_register_interrupts(void);
-extern void psc_irq_enable(int);
-extern void psc_irq_disable(int);
-extern void psc_irq_clear(int);
-extern int  psc_irq_pending(int);
-
-/*
- * IOP hooks
- */
-
-extern void iop_register_interrupts(void);
-
-/*
- * Baboon hooks
- */
-
-extern int baboon_present;
-
-extern void baboon_register_interrupts(void);
-extern void baboon_irq_enable(int);
-extern void baboon_irq_disable(int);
-extern void baboon_irq_clear(int);
-
 /*
  * console_loglevel determines NMI handler function
  */
@@ -190,10 +136,15 @@ irqreturn_t mac_debug_handler(int, void *);
 
 /* #define DEBUG_MACINTS */
 
+static unsigned int mac_irq_startup(struct irq_data *);
+static void mac_irq_shutdown(struct irq_data *);
+
 static struct irq_chip mac_irq_chip = {
        .name           = "mac",
        .irq_enable     = mac_irq_enable,
        .irq_disable    = mac_irq_disable,
+       .irq_startup    = mac_irq_startup,
+       .irq_shutdown   = mac_irq_shutdown,
 };
 
 void __init mac_init_IRQ(void)
@@ -239,8 +190,6 @@ void __init mac_init_IRQ(void)
 /*
  *  mac_irq_enable - enable an interrupt source
  * mac_irq_disable - disable an interrupt source
- *   mac_clear_irq - clears a pending interrupt
- * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending)
  *
  * These routines are just dispatchers to the VIA/OSS/PSC routines.
  */
@@ -252,8 +201,6 @@ void mac_irq_enable(struct irq_data *data)
 
        switch(irq_src) {
        case 1:
-               via_irq_enable(irq);
-               break;
        case 2:
        case 7:
                if (oss_present)
@@ -262,6 +209,7 @@ void mac_irq_enable(struct irq_data *data)
                        via_irq_enable(irq);
                break;
        case 3:
+       case 4:
        case 5:
        case 6:
                if (psc_present)
@@ -269,10 +217,6 @@ void mac_irq_enable(struct irq_data *data)
                else if (oss_present)
                        oss_irq_enable(irq);
                break;
-       case 4:
-               if (psc_present)
-                       psc_irq_enable(irq);
-               break;
        case 8:
                if (baboon_present)
                        baboon_irq_enable(irq);
@@ -287,8 +231,6 @@ void mac_irq_disable(struct irq_data *data)
 
        switch(irq_src) {
        case 1:
-               via_irq_disable(irq);
-               break;
        case 2:
        case 7:
                if (oss_present)
@@ -297,6 +239,7 @@ void mac_irq_disable(struct irq_data *data)
                        via_irq_disable(irq);
                break;
        case 3:
+       case 4:
        case 5:
        case 6:
                if (psc_present)
@@ -304,10 +247,6 @@ void mac_irq_disable(struct irq_data *data)
                else if (oss_present)
                        oss_irq_disable(irq);
                break;
-       case 4:
-               if (psc_present)
-                       psc_irq_disable(irq);
-               break;
        case 8:
                if (baboon_present)
                        baboon_irq_disable(irq);
@@ -315,65 +254,27 @@ void mac_irq_disable(struct irq_data *data)
        }
 }
 
-void mac_clear_irq(unsigned int irq)
+static unsigned int mac_irq_startup(struct irq_data *data)
 {
-       switch(IRQ_SRC(irq)) {
-       case 1:
-               via_irq_clear(irq);
-               break;
-       case 2:
-       case 7:
-               if (oss_present)
-                       oss_irq_clear(irq);
-               else
-                       via_irq_clear(irq);
-               break;
-       case 3:
-       case 5:
-       case 6:
-               if (psc_present)
-                       psc_irq_clear(irq);
-               else if (oss_present)
-                       oss_irq_clear(irq);
-               break;
-       case 4:
-               if (psc_present)
-                       psc_irq_clear(irq);
-               break;
-       case 8:
-               if (baboon_present)
-                       baboon_irq_clear(irq);
-               break;
-       }
+       int irq = data->irq;
+
+       if (IRQ_SRC(irq) == 7 && !oss_present)
+               via_nubus_irq_startup(irq);
+       else
+               mac_irq_enable(data);
+
+       return 0;
 }
 
-int mac_irq_pending(unsigned int irq)
+static void mac_irq_shutdown(struct irq_data *data)
 {
-       switch(IRQ_SRC(irq)) {
-       case 1:
-               return via_irq_pending(irq);
-       case 2:
-       case 7:
-               if (oss_present)
-                       return oss_irq_pending(irq);
-               else
-                       return via_irq_pending(irq);
-       case 3:
-       case 5:
-       case 6:
-               if (psc_present)
-                       return psc_irq_pending(irq);
-               else if (oss_present)
-                       return oss_irq_pending(irq);
-               break;
-       case 4:
-               if (psc_present)
-                       return psc_irq_pending(irq);
-               break;
-       }
-       return 0;
+       int irq = data->irq;
+
+       if (IRQ_SRC(irq) == 7 && !oss_present)
+               via_nubus_irq_shutdown(irq);
+       else
+               mac_irq_disable(data);
 }
-EXPORT_SYMBOL(mac_irq_pending);
 
 static int num_debug[8];
 
index a4c82dab9ff1acd3d9d5f90aafa8fb2c55a913f9..6c4c882c126e826e2d1b114f39acaf3e8b9ddc15 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     OSS handling
+ *     Operating System Services (OSS) chip handling
  *     Written by Joshua M. Thompson (funaho@jurai.org)
  *
  *
@@ -30,8 +30,6 @@
 int oss_present;
 volatile struct mac_oss *oss;
 
-extern void via1_irq(unsigned int irq, struct irq_desc *desc);
-
 /*
  * Initialize the OSS
  *
@@ -51,10 +49,8 @@ void __init oss_init(void)
        /* do this by setting the source's interrupt level to zero. */
 
        for (i = 0; i <= OSS_NUM_SOURCES; i++) {
-               oss->irq_level[i] = OSS_IRQLEV_DISABLED;
+               oss->irq_level[i] = 0;
        }
-       /* If we disable VIA1 here, we never really handle it... */
-       oss->irq_level[OSS_VIA1] = OSS_IRQLEV_VIA1;
 }
 
 /*
@@ -66,17 +62,13 @@ void __init oss_nubus_init(void)
 }
 
 /*
- * Handle miscellaneous OSS interrupts. Right now that's just sound
- * and SCSI; everything else is routed to its own autovector IRQ.
+ * Handle miscellaneous OSS interrupts.
  */
 
 static void oss_irq(unsigned int irq, struct irq_desc *desc)
 {
-       int events;
-
-       events = oss->irq_pending & (OSS_IP_SOUND|OSS_IP_SCSI);
-       if (!events)
-               return;
+       int events = oss->irq_pending &
+                    (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM);
 
 #ifdef DEBUG_IRQS
        if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) {
@@ -84,16 +76,20 @@ static void oss_irq(unsigned int irq, struct irq_desc *desc)
                        (int) oss->irq_pending);
        }
 #endif
-       /* FIXME: how do you clear a pending IRQ?    */
 
-       if (events & OSS_IP_SOUND) {
-               oss->irq_pending &= ~OSS_IP_SOUND;
-               /* FIXME: call sound handler */
-       } else if (events & OSS_IP_SCSI) {
+       if (events & OSS_IP_IOPSCC) {
+               oss->irq_pending &= ~OSS_IP_IOPSCC;
+               generic_handle_irq(IRQ_MAC_SCC);
+       }
+
+       if (events & OSS_IP_SCSI) {
                oss->irq_pending &= ~OSS_IP_SCSI;
                generic_handle_irq(IRQ_MAC_SCSI);
-       } else {
-               /* FIXME: error check here? */
+       }
+
+       if (events & OSS_IP_IOPISM) {
+               oss->irq_pending &= ~OSS_IP_IOPISM;
+               generic_handle_irq(IRQ_MAC_ADB);
        }
 }
 
@@ -132,14 +128,29 @@ static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc)
 
 /*
  * Register the OSS and NuBus interrupt dispatchers.
+ *
+ * This IRQ mapping is laid out with two things in mind: first, we try to keep
+ * things on their own levels to avoid having to do double-dispatches. Second,
+ * the levels match as closely as possible the alternate IRQ mapping mode (aka
+ * "A/UX mode") available on some VIA machines.
  */
 
+#define OSS_IRQLEV_IOPISM    IRQ_AUTO_1
+#define OSS_IRQLEV_SCSI      IRQ_AUTO_2
+#define OSS_IRQLEV_NUBUS     IRQ_AUTO_3
+#define OSS_IRQLEV_IOPSCC    IRQ_AUTO_4
+#define OSS_IRQLEV_VIA1      IRQ_AUTO_6
+
 void __init oss_register_interrupts(void)
 {
-       irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq);
-       irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq);
-       irq_set_chained_handler(OSS_IRQLEV_SOUND, oss_irq);
-       irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_irq);
+       irq_set_chained_handler(OSS_IRQLEV_IOPISM, oss_irq);
+       irq_set_chained_handler(OSS_IRQLEV_SCSI,   oss_irq);
+       irq_set_chained_handler(OSS_IRQLEV_NUBUS,  oss_nubus_irq);
+       irq_set_chained_handler(OSS_IRQLEV_IOPSCC, oss_irq);
+       irq_set_chained_handler(OSS_IRQLEV_VIA1,   via1_irq);
+
+       /* OSS_VIA1 gets enabled here because it has no machspec interrupt. */
+       oss->irq_level[OSS_VIA1] = IRQ_AUTO_6;
 }
 
 /*
@@ -158,13 +169,13 @@ void oss_irq_enable(int irq) {
        switch(irq) {
                case IRQ_MAC_SCC:
                        oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC;
-                       break;
+                       return;
                case IRQ_MAC_ADB:
                        oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_IOPISM;
-                       break;
+                       return;
                case IRQ_MAC_SCSI:
                        oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI;
-                       break;
+                       return;
                case IRQ_NUBUS_9:
                case IRQ_NUBUS_A:
                case IRQ_NUBUS_B:
@@ -173,13 +184,11 @@ void oss_irq_enable(int irq) {
                case IRQ_NUBUS_E:
                        irq -= NUBUS_SOURCE_BASE;
                        oss->irq_level[irq] = OSS_IRQLEV_NUBUS;
-                       break;
-#ifdef DEBUG_IRQUSE
-               default:
-                       printk("%s unknown irq %d\n", __func__, irq);
-                       break;
-#endif
+                       return;
        }
+
+       if (IRQ_SRC(irq) == 1)
+               via_irq_enable(irq);
 }
 
 /*
@@ -195,50 +204,14 @@ void oss_irq_disable(int irq) {
 #endif
        switch(irq) {
                case IRQ_MAC_SCC:
-                       oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED;
-                       break;
-               case IRQ_MAC_ADB:
-                       oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_DISABLED;
-                       break;
-               case IRQ_MAC_SCSI:
-                       oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED;
-                       break;
-               case IRQ_NUBUS_9:
-               case IRQ_NUBUS_A:
-               case IRQ_NUBUS_B:
-               case IRQ_NUBUS_C:
-               case IRQ_NUBUS_D:
-               case IRQ_NUBUS_E:
-                       irq -= NUBUS_SOURCE_BASE;
-                       oss->irq_level[irq] = OSS_IRQLEV_DISABLED;
-                       break;
-#ifdef DEBUG_IRQUSE
-               default:
-                       printk("%s unknown irq %d\n", __func__, irq);
-                       break;
-#endif
-       }
-}
-
-/*
- * Clear an OSS interrupt
- *
- * Not sure if this works or not but it's the only method I could
- * think of based on the contents of the mac_oss structure.
- */
-
-void oss_irq_clear(int irq) {
-       /* FIXME: how to do this on OSS? */
-       switch(irq) {
-               case IRQ_MAC_SCC:
-                       oss->irq_pending &= ~OSS_IP_IOPSCC;
-                       break;
+                       oss->irq_level[OSS_IOPSCC] = 0;
+                       return;
                case IRQ_MAC_ADB:
-                       oss->irq_pending &= ~OSS_IP_IOPISM;
-                       break;
+                       oss->irq_level[OSS_IOPISM] = 0;
+                       return;
                case IRQ_MAC_SCSI:
-                       oss->irq_pending &= ~OSS_IP_SCSI;
-                       break;
+                       oss->irq_level[OSS_SCSI] = 0;
+                       return;
                case IRQ_NUBUS_9:
                case IRQ_NUBUS_A:
                case IRQ_NUBUS_B:
@@ -246,36 +219,10 @@ void oss_irq_clear(int irq) {
                case IRQ_NUBUS_D:
                case IRQ_NUBUS_E:
                        irq -= NUBUS_SOURCE_BASE;
-                       oss->irq_pending &= ~(1 << irq);
-                       break;
+                       oss->irq_level[irq] = 0;
+                       return;
        }
-}
-
-/*
- * Check to see if a specific OSS interrupt is pending
- */
 
-int oss_irq_pending(int irq)
-{
-       switch(irq) {
-               case IRQ_MAC_SCC:
-                       return oss->irq_pending & OSS_IP_IOPSCC;
-                       break;
-               case IRQ_MAC_ADB:
-                       return oss->irq_pending & OSS_IP_IOPISM;
-                       break;
-               case IRQ_MAC_SCSI:
-                       return oss->irq_pending & OSS_IP_SCSI;
-                       break;
-               case IRQ_NUBUS_9:
-               case IRQ_NUBUS_A:
-               case IRQ_NUBUS_B:
-               case IRQ_NUBUS_C:
-               case IRQ_NUBUS_D:
-               case IRQ_NUBUS_E:
-                       irq -= NUBUS_SOURCE_BASE;
-                       return oss->irq_pending & (1 << irq);
-                       break;
-       }
-       return 0;
+       if (IRQ_SRC(irq) == 1)
+               via_irq_disable(irq);
 }
index e6c2d20f328d0599192994721fe72b3f1adaf90a..6f026fc302fab3ca70f6e05386a732ac52e1d985 100644 (file)
@@ -180,20 +180,3 @@ void psc_irq_disable(int irq) {
 #endif
        psc_write_byte(pIER, 1 << irq_idx);
 }
-
-void psc_irq_clear(int irq) {
-       int irq_src     = IRQ_SRC(irq);
-       int irq_idx     = IRQ_IDX(irq);
-       int pIFR        = pIERbase + (irq_src << 4);
-
-       psc_write_byte(pIFR, 1 << irq_idx);
-}
-
-int psc_irq_pending(int irq)
-{
-       int irq_src     = IRQ_SRC(irq);
-       int irq_idx     = IRQ_IDX(irq);
-       int pIFR        = pIERbase + (irq_src << 4);
-
-       return psc_read_byte(pIFR) & (1 << irq_idx);
-}
index f1600ad2662113979a16631613e6b8135c1a09e2..2d85662715fba3a9d6332c19a45eecd4c428e141 100644 (file)
@@ -63,24 +63,50 @@ static int gIER,gIFR,gBufA,gBufB;
 #define MAC_CLOCK_LOW          (MAC_CLOCK_TICK&0xFF)
 #define MAC_CLOCK_HIGH         (MAC_CLOCK_TICK>>8)
 
-/* To disable a NuBus slot on Quadras we make that slot IRQ line an output set
- * high. On RBV we just use the slot interrupt enable register. On Macs with
- * genuine VIA chips we must use nubus_disabled to keep track of disabled slot
- * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1
- * or "SLOTS" interrupt. When no slot is disabled, we unmask the CA1 interrupt.
- * So, on genuine VIAs, having more than one NuBus IRQ can mean trouble,
- * because closing one of those drivers can mask all of the NuBus interrupts.
- * Also, since we can't mask the unregistered slot IRQs on genuine VIAs, it's
- * possible to get interrupts from cards that MacOS or the ROM has configured
- * but we have not. FWIW, "Designing Cards and Drivers for Macintosh II and
- * Macintosh SE", page 9-8, says, a slot IRQ with no driver would crash MacOS.
+
+/*
+ * On Macs with a genuine VIA chip there is no way to mask an individual slot
+ * interrupt. This limitation also seems to apply to VIA clone logic cores in
+ * Quadra-like ASICs. (RBV and OSS machines don't have this limitation.)
+ *
+ * We used to fake it by configuring the relevent VIA pin as an output
+ * (to mask the interrupt) or input (to unmask). That scheme did not work on
+ * (at least) the Quadra 700. A NuBus card's /NMRQ signal is an open-collector
+ * circuit (see Designing Cards and Drivers for Macintosh II and Macintosh SE,
+ * p. 10-11 etc) but VIA outputs are not (see datasheet).
+ *
+ * Driving these outputs high must cause the VIA to source current and the
+ * card to sink current when it asserts /NMRQ. Current will flow but the pin
+ * voltage is uncertain and so the /NMRQ condition may still cause a transition
+ * at the VIA2 CA1 input (which explains the lost interrupts). A side effect
+ * is that a disabled slot IRQ can never be tested as pending or not.
+ *
+ * Driving these outputs low doesn't work either. All the slot /NMRQ lines are
+ * (active low) OR'd together to generate the CA1 (aka "SLOTS") interrupt (see
+ * The Guide To Macintosh Family Hardware, 2nd edition p. 167). If we drive a
+ * disabled /NMRQ line low, the falling edge immediately triggers a CA1
+ * interrupt and all slot interrupts after that will generate no transition
+ * and therefore no interrupt, even after being re-enabled.
+ *
+ * So we make the VIA port A I/O lines inputs and use nubus_disabled to keep
+ * track of their states. When any slot IRQ becomes disabled we mask the CA1
+ * umbrella interrupt. Only when all slot IRQs become enabled do we unmask
+ * the CA1 interrupt. It must remain enabled even when cards have no interrupt
+ * handler registered. Drivers must therefore disable a slot interrupt at the
+ * device before they call free_irq (like shared and autovector interrupts).
+ *
+ * There is also a related problem when MacOS is used to boot Linux. A network
+ * card brought up by a MacOS driver may raise an interrupt while Linux boots.
+ * This can be fatal since it can't be handled until the right driver loads
+ * (if such a driver exists at all). Apparently related to this hardware
+ * limitation, "Designing Cards and Drivers", p. 9-8, says that a slot
+ * interrupt with no driver would crash MacOS (the book was written before
+ * the appearance of Macs with RBV or OSS).
  */
+
 static u8 nubus_disabled;
 
 void via_debug_dump(void);
-void via_irq_enable(int irq);
-void via_irq_disable(int irq);
-void via_irq_clear(int irq);
 
 /*
  * Initialize the VIAs
@@ -100,7 +126,7 @@ void __init via_init(void)
 
                /* IIci, IIsi, IIvx, IIvi (P6xx), LC series */
 
-               case MAC_VIA_IIci:
+               case MAC_VIA_IICI:
                        via1 = (void *) VIA1_BASE;
                        if (macintosh_config->ident == MAC_MODEL_IIFX) {
                                via2 = NULL;
@@ -197,38 +223,17 @@ void __init via_init(void)
        if (oss_present)
                return;
 
-       /* Some machines support an alternate IRQ mapping that spreads  */
-       /* Ethernet and Sound out to their own autolevel IRQs and moves */
-       /* VIA1 to level 6. A/UX uses this mapping and we do too.  Note */
-       /* that the IIfx emulates this alternate mapping using the OSS. */
-
-       via_alt_mapping = 0;
-       if (macintosh_config->via_type == MAC_VIA_QUADRA)
-               switch (macintosh_config->ident) {
-               case MAC_MODEL_C660:
-               case MAC_MODEL_Q840:
-                       /* not applicable */
-                       break;
-               case MAC_MODEL_P588:
-               case MAC_MODEL_TV:
-               case MAC_MODEL_PB140:
-               case MAC_MODEL_PB145:
-               case MAC_MODEL_PB160:
-               case MAC_MODEL_PB165:
-               case MAC_MODEL_PB165C:
-               case MAC_MODEL_PB170:
-               case MAC_MODEL_PB180:
-               case MAC_MODEL_PB180C:
-               case MAC_MODEL_PB190:
-               case MAC_MODEL_PB520:
-                       /* not yet tested */
-                       break;
-               default:
-                       via_alt_mapping = 1;
-                       via1[vDirB] |= 0x40;
-                       via1[vBufB] &= ~0x40;
-                       break;
-               }
+       if ((macintosh_config->via_type == MAC_VIA_QUADRA) &&
+           (macintosh_config->adb_type != MAC_ADB_PB1) &&
+           (macintosh_config->adb_type != MAC_ADB_PB2) &&
+           (macintosh_config->ident    != MAC_MODEL_C660) &&
+           (macintosh_config->ident    != MAC_MODEL_Q840)) {
+               via_alt_mapping = 1;
+               via1[vDirB] |= 0x40;
+               via1[vBufB] &= ~0x40;
+       } else {
+               via_alt_mapping = 0;
+       }
 
        /*
         * Now initialize VIA2. For RBV we just kill all interrupts;
@@ -248,22 +253,28 @@ void __init via_init(void)
                via2[vACR] &= ~0x03; /* disable port A & B latches */
        }
 
+       /* Everything below this point is VIA2 only... */
+
+       if (rbv_present)
+               return;
+
        /*
-        * Set vPCR for control line interrupts (but not on RBV)
+        * Set vPCR for control line interrupts.
+        *
+        * CA1 (SLOTS IRQ), CB1 (ASC IRQ): negative edge trigger.
+        *
+        * Macs with ESP SCSI have a negative edge triggered SCSI interrupt.
+        * Testing reveals that PowerBooks do too. However, the SE/30
+        * schematic diagram shows an active high NCR5380 IRQ line.
         */
-       if (!rbv_present) {
-               /* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ)
-                * are made negative edge triggered here.
-                */
-               if (macintosh_config->scsi_type == MAC_SCSI_OLD) {
-                       /* CB2 (IRQ) indep. input, positive edge */
-                       /* CA2 (DRQ) indep. input, positive edge */
-                       via2[vPCR] = 0x66;
-               } else {
-                       /* CB2 (IRQ) indep. input, negative edge */
-                       /* CA2 (DRQ) indep. input, negative edge */
-                       via2[vPCR] = 0x22;
-               }
+
+       pr_debug("VIA2 vPCR is 0x%02X\n", via2[vPCR]);
+       if (macintosh_config->via_type == MAC_VIA_II) {
+               /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, pos. edge */
+               via2[vPCR] = 0x66;
+       } else {
+               /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, neg. edge */
+               via2[vPCR] = 0x22;
        }
 }
 
@@ -378,34 +389,55 @@ void __init via_nubus_init(void)
                via2[gBufB] |= 0x02;
        }
 
-       /* Disable all the slot interrupts (where possible). */
+       /*
+        * Disable the slot interrupts. On some hardware that's not possible.
+        * On some hardware it's unclear what all of these I/O lines do.
+        */
 
        switch (macintosh_config->via_type) {
        case MAC_VIA_II:
-               /* Just make the port A lines inputs. */
-               switch(macintosh_config->ident) {
-               case MAC_MODEL_II:
-               case MAC_MODEL_IIX:
-               case MAC_MODEL_IICX:
-               case MAC_MODEL_SE30:
-                       /* The top two bits are RAM size outputs. */
-                       via2[vDirA] &= 0xC0;
-                       break;
-               default:
-                       via2[vDirA] &= 0x80;
-               }
+       case MAC_VIA_QUADRA:
+               pr_debug("VIA2 vDirA is 0x%02X\n", via2[vDirA]);
                break;
-       case MAC_VIA_IIci:
+       case MAC_VIA_IICI:
                /* RBV. Disable all the slot interrupts. SIER works like IER. */
                via2[rSIER] = 0x7F;
                break;
+       }
+}
+
+void via_nubus_irq_startup(int irq)
+{
+       int irq_idx = IRQ_IDX(irq);
+
+       switch (macintosh_config->via_type) {
+       case MAC_VIA_II:
        case MAC_VIA_QUADRA:
-               /* Disable the inactive slot interrupts by making those lines outputs. */
-               if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
-                   (macintosh_config->adb_type != MAC_ADB_PB2)) {
-                       via2[vBufA] |= 0x7F;
-                       via2[vDirA] |= 0x7F;
+               /* Make the port A line an input. Probably redundant. */
+               if (macintosh_config->via_type == MAC_VIA_II) {
+                       /* The top two bits are RAM size outputs. */
+                       via2[vDirA] &= 0xC0 | ~(1 << irq_idx);
+               } else {
+                       /* Allow NuBus slots 9 through F. */
+                       via2[vDirA] &= 0x80 | ~(1 << irq_idx);
                }
+               /* fall through */
+       case MAC_VIA_IICI:
+               via_irq_enable(irq);
+               break;
+       }
+}
+
+void via_nubus_irq_shutdown(int irq)
+{
+       switch (macintosh_config->via_type) {
+       case MAC_VIA_II:
+       case MAC_VIA_QUADRA:
+               /* Ensure that the umbrella CA1 interrupt remains enabled. */
+               via_irq_enable(irq);
+               break;
+       case MAC_VIA_IICI:
+               via_irq_disable(irq);
                break;
        }
 }
@@ -531,25 +563,18 @@ void via_irq_enable(int irq) {
        } else if (irq_src == 7) {
                switch (macintosh_config->via_type) {
                case MAC_VIA_II:
+               case MAC_VIA_QUADRA:
                        nubus_disabled &= ~(1 << irq_idx);
                        /* Enable the CA1 interrupt when no slot is disabled. */
                        if (!nubus_disabled)
                                via2[gIER] = IER_SET_BIT(1);
                        break;
-               case MAC_VIA_IIci:
+               case MAC_VIA_IICI:
                        /* On RBV, enable the slot interrupt.
                         * SIER works like IER.
                         */
                        via2[rSIER] = IER_SET_BIT(irq_idx);
                        break;
-               case MAC_VIA_QUADRA:
-                       /* Make the port A line an input to enable the slot irq.
-                        * But not on PowerBooks, that's ADB.
-                        */
-                       if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
-                           (macintosh_config->adb_type != MAC_ADB_PB2))
-                               via2[vDirA] &= ~(1 << irq_idx);
-                       break;
                }
        }
 }
@@ -569,60 +594,18 @@ void via_irq_disable(int irq) {
        } else if (irq_src == 7) {
                switch (macintosh_config->via_type) {
                case MAC_VIA_II:
+               case MAC_VIA_QUADRA:
                        nubus_disabled |= 1 << irq_idx;
                        if (nubus_disabled)
                                via2[gIER] = IER_CLR_BIT(1);
                        break;
-               case MAC_VIA_IIci:
+               case MAC_VIA_IICI:
                        via2[rSIER] = IER_CLR_BIT(irq_idx);
                        break;
-               case MAC_VIA_QUADRA:
-                       if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
-                           (macintosh_config->adb_type != MAC_ADB_PB2))
-                               via2[vDirA] |= 1 << irq_idx;
-                       break;
                }
        }
 }
 
-void via_irq_clear(int irq) {
-       int irq_src     = IRQ_SRC(irq);
-       int irq_idx     = IRQ_IDX(irq);
-       int irq_bit     = 1 << irq_idx;
-
-       if (irq_src == 1) {
-               via1[vIFR] = irq_bit;
-       } else if (irq_src == 2) {
-               via2[gIFR] = irq_bit | rbv_clear;
-       } else if (irq_src == 7) {
-               /* FIXME: There is no way to clear an individual nubus slot
-                * IRQ flag, other than getting the device to do it.
-                */
-       }
-}
-
-/*
- * Returns nonzero if an interrupt is pending on the given
- * VIA/IRQ combination.
- */
-
-int via_irq_pending(int irq)
-{
-       int irq_src     = IRQ_SRC(irq);
-       int irq_idx     = IRQ_IDX(irq);
-       int irq_bit     = 1 << irq_idx;
-
-       if (irq_src == 1) {
-               return via1[vIFR] & irq_bit;
-       } else if (irq_src == 2) {
-               return via2[gIFR] & irq_bit;
-       } else if (irq_src == 7) {
-               /* Always 0 for MAC_VIA_QUADRA if the slot irq is disabled. */
-               return ~via2[gBufA] & irq_bit;
-       }
-       return 0;
-}
-
 void via1_set_head(int head)
 {
        if (head == 0)
@@ -631,3 +614,9 @@ void via1_set_head(int head)
                via1[vBufA] |= VIA1A_vHeadSel;
 }
 EXPORT_SYMBOL(via1_set_head);
+
+int via2_scsi_drq_pending(void)
+{
+       return via2[gIFR] & (1 << IRQ_IDX(IRQ_MAC_SCSIDRQ));
+}
+EXPORT_SYMBOL(via2_scsi_drq_pending);
index 31a66d99cbca3a7fb4bb66960f849c7f0c7d7f0a..c3fb3bdd7ed9271b563650cb16c62d904f91c3bc 100644 (file)
@@ -124,6 +124,163 @@ static void __init mvme16x_init_IRQ (void)
 #define PccSCCMICR     0x1d
 #define PccSCCTICR     0x1e
 #define PccSCCRICR     0x1f
+#define PccTPIACKR     0x25
+
+#ifdef CONFIG_EARLY_PRINTK
+
+/**** cd2401 registers ****/
+#define CD2401_ADDR    (0xfff45000)
+
+#define CyGFRCR         (0x81)
+#define CyCCR          (0x13)
+#define      CyCLR_CHAN                (0x40)
+#define      CyINIT_CHAN       (0x20)
+#define      CyCHIP_RESET      (0x10)
+#define      CyENB_XMTR                (0x08)
+#define      CyDIS_XMTR                (0x04)
+#define      CyENB_RCVR                (0x02)
+#define      CyDIS_RCVR                (0x01)
+#define CyCAR          (0xee)
+#define CyIER          (0x11)
+#define      CyMdmCh           (0x80)
+#define      CyRxExc           (0x20)
+#define      CyRxData          (0x08)
+#define      CyTxMpty          (0x02)
+#define      CyTxRdy           (0x01)
+#define CyLICR         (0x26)
+#define CyRISR         (0x89)
+#define      CyTIMEOUT         (0x80)
+#define      CySPECHAR         (0x70)
+#define      CyOVERRUN         (0x08)
+#define      CyPARITY          (0x04)
+#define      CyFRAME           (0x02)
+#define      CyBREAK           (0x01)
+#define CyREOIR                (0x84)
+#define CyTEOIR                (0x85)
+#define CyMEOIR                (0x86)
+#define      CyNOTRANS         (0x08)
+#define CyRFOC         (0x30)
+#define CyRDR          (0xf8)
+#define CyTDR          (0xf8)
+#define CyMISR         (0x8b)
+#define CyRISR         (0x89)
+#define CyTISR         (0x8a)
+#define CyMSVR1                (0xde)
+#define CyMSVR2                (0xdf)
+#define      CyDSR             (0x80)
+#define      CyDCD             (0x40)
+#define      CyCTS             (0x20)
+#define      CyDTR             (0x02)
+#define      CyRTS             (0x01)
+#define CyRTPRL                (0x25)
+#define CyRTPRH                (0x24)
+#define CyCOR1         (0x10)
+#define      CyPARITY_NONE     (0x00)
+#define      CyPARITY_E                (0x40)
+#define      CyPARITY_O                (0xC0)
+#define      Cy_5_BITS         (0x04)
+#define      Cy_6_BITS         (0x05)
+#define      Cy_7_BITS         (0x06)
+#define      Cy_8_BITS         (0x07)
+#define CyCOR2         (0x17)
+#define      CyETC             (0x20)
+#define      CyCtsAE           (0x02)
+#define CyCOR3         (0x16)
+#define      Cy_1_STOP         (0x02)
+#define      Cy_2_STOP         (0x04)
+#define CyCOR4         (0x15)
+#define      CyREC_FIFO                (0x0F)  /* Receive FIFO threshold */
+#define CyCOR5         (0x14)
+#define CyCOR6         (0x18)
+#define CyCOR7         (0x07)
+#define CyRBPR         (0xcb)
+#define CyRCOR         (0xc8)
+#define CyTBPR         (0xc3)
+#define CyTCOR         (0xc0)
+#define CySCHR1                (0x1f)
+#define CySCHR2        (0x1e)
+#define CyTPR          (0xda)
+#define CyPILR1                (0xe3)
+#define CyPILR2                (0xe0)
+#define CyPILR3                (0xe1)
+#define CyCMR          (0x1b)
+#define      CyASYNC           (0x02)
+#define CyLICR          (0x26)
+#define CyLIVR          (0x09)
+#define CySCRL         (0x23)
+#define CySCRH         (0x22)
+#define CyTFTC         (0x80)
+
+static void cons_write(struct console *co, const char *str, unsigned count)
+{
+       volatile unsigned char *base_addr = (u_char *)CD2401_ADDR;
+       volatile u_char sink;
+       u_char ier;
+       int port;
+       u_char do_lf = 0;
+       int i = 0;
+
+       /* Ensure transmitter is enabled! */
+
+       port = 0;
+       base_addr[CyCAR] = (u_char)port;
+       while (base_addr[CyCCR])
+               ;
+       base_addr[CyCCR] = CyENB_XMTR;
+
+       ier = base_addr[CyIER];
+       base_addr[CyIER] = CyTxMpty;
+
+       while (1) {
+               if (pcc2chip[PccSCCTICR] & 0x20)
+               {
+                       /* We have a Tx int. Acknowledge it */
+                       sink = pcc2chip[PccTPIACKR];
+                       if ((base_addr[CyLICR] >> 2) == port) {
+                               if (i == count) {
+                                       /* Last char of string is now output */
+                                       base_addr[CyTEOIR] = CyNOTRANS;
+                                       break;
+                               }
+                               if (do_lf) {
+                                       base_addr[CyTDR] = '\n';
+                                       str++;
+                                       i++;
+                                       do_lf = 0;
+                               }
+                               else if (*str == '\n') {
+                                       base_addr[CyTDR] = '\r';
+                                       do_lf = 1;
+                               }
+                               else {
+                                       base_addr[CyTDR] = *str++;
+                                       i++;
+                               }
+                               base_addr[CyTEOIR] = 0;
+                       }
+                       else
+                               base_addr[CyTEOIR] = CyNOTRANS;
+               }
+       }
+
+       base_addr[CyIER] = ier;
+}
+
+static struct console cons_info =
+{
+       .name   = "sercon",
+       .write  = cons_write,
+       .flags  = CON_PRINTBUFFER | CON_BOOT,
+       .index  = -1,
+};
+
+static void __init mvme16x_early_console(void)
+{
+       register_console(&cons_info);
+
+       printk(KERN_INFO "MVME16x: early console registered\n");
+}
+#endif
 
 void __init config_mvme16x(void)
 {
@@ -183,6 +340,9 @@ void __init config_mvme16x(void)
        pcc2chip[PccSCCMICR] = 0x10;
        pcc2chip[PccSCCTICR] = 0x10;
        pcc2chip[PccSCCRICR] = 0x10;
+#ifdef CONFIG_EARLY_PRINTK
+       mvme16x_early_console();
+#endif
     }
 }
 
index 7429b47c3acad8adb97ff177c4459fafcb1ae1e3..381edcd5bc2946471e2c47e4f73a607272d25c09 100644 (file)
@@ -1181,13 +1181,11 @@ static int __devinit ds_probe(struct vio_dev *vdev,
 
        dp->rcv_buf_len = 4096;
 
-       dp->ds_states = kzalloc(sizeof(ds_states_template),
-                               GFP_KERNEL);
+       dp->ds_states = kmemdup(ds_states_template,
+                               sizeof(ds_states_template), GFP_KERNEL);
        if (!dp->ds_states)
                goto out_free_rcv_buf;
 
-       memcpy(dp->ds_states, ds_states_template,
-              sizeof(ds_states_template));
        dp->num_ds_states = ARRAY_SIZE(ds_states_template);
 
        for (i = 0; i < dp->num_ds_states; i++)
index 46614807a57f45150f89dbb1cb5ee115beaad28c..741df916c124b10b12751da38bf7d3dac335c5dd 100644 (file)
@@ -58,12 +58,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
        void *new_val;
        int err;
 
-       new_val = kmalloc(len, GFP_KERNEL);
+       new_val = kmemdup(val, len, GFP_KERNEL);
        if (!new_val)
                return -ENOMEM;
 
-       memcpy(new_val, val, len);
-
        err = -ENODEV;
 
        mutex_lock(&of_set_property_mutex);
index 631b9477b99c02f827103aa00a8d3a83c380d359..6a9e3bad13f418d93572faff72d18a4df124f8e8 100644 (file)
@@ -934,7 +934,8 @@ static int erst_close_pstore(struct pstore_info *psi);
 static ssize_t erst_reader(u64 *id, enum pstore_type_id *type,
                           struct timespec *time, char **buf,
                           struct pstore_info *psi);
-static int erst_writer(enum pstore_type_id type, u64 *id, unsigned int part,
+static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
+                      u64 *id, unsigned int part,
                       size_t size, struct pstore_info *psi);
 static int erst_clearer(enum pstore_type_id type, u64 id,
                        struct pstore_info *psi);
@@ -1053,7 +1054,8 @@ out:
        return (rc < 0) ? rc : (len - sizeof(*rcd));
 }
 
-static int erst_writer(enum pstore_type_id type, u64 *id, unsigned int part,
+static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
+                      u64 *id, unsigned int part,
                       size_t size, struct pstore_info *psi)
 {
        struct cper_pstore_record *rcd = (struct cper_pstore_record *)
index a76f24a8e5db95a98b3f9dda9ecfc7dcab3eb4ce..5249e6d918a3831e0a899b6768e1a71695ebc2d3 100644 (file)
@@ -360,7 +360,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev)
        ap->flags |= ATA_FLAG_SLAVE_POSS;
        ap->pio_mask = ATA_PIO4;
 
-       if (!irq) {
+       if (!gpio_is_valid(irq)) {
                ap->flags |= ATA_FLAG_PIO_POLLING;
                ata_port_desc(ap, "no IRQ, using PIO polling");
        }
@@ -414,8 +414,8 @@ static int __devinit pata_at91_probe(struct platform_device *pdev)
 
        host->private_data = info;
 
-       ret = ata_host_activate(host, irq ? gpio_to_irq(irq) : 0,
-                       irq ? ata_sff_interrupt : NULL,
+       return ata_host_activate(host, gpio_is_valid(irq) ? gpio_to_irq(irq) : 0,
+                       gpio_is_valid(irq) ? ata_sff_interrupt : NULL,
                        irq_flags, &pata_at91_sht);
 
        if (!ret)
index fd5adcd55944ac3a9384f86bbe3d7507df0f9964..6d5a914b9619c98a12475222d0bc75be80e603ee 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 
-#include <asm/macintosh.h>
 #include <asm/mac_via.h>
 
 #define CARDNAME "swim"
index 11b41fd40c275b0f61aa77120dfab5b14219564a..5ccf142ef0b8139f47a95b75b13bdb5086b034a7 100644 (file)
@@ -188,7 +188,7 @@ config BT_MRVL
          The core driver to support Marvell Bluetooth devices.
 
          This driver is required if you want to support
-         Marvell Bluetooth devices, such as 8688/8787.
+         Marvell Bluetooth devices, such as 8688/8787/8797.
 
          Say Y here to compile Marvell Bluetooth driver
          into the kernel or say M to compile it as module.
@@ -201,8 +201,8 @@ config BT_MRVL_SDIO
          The driver for Marvell Bluetooth chipsets with SDIO interface.
 
          This driver is required if you want to use Marvell Bluetooth
-         devices with SDIO interface. Currently SD8688/SD8787 chipsets are
-         supported.
+         devices with SDIO interface. Currently SD8688/SD8787/SD8797
+         chipsets are supported.
 
          Say Y here to compile support for Marvell BT-over-SDIO driver
          into the kernel or say M to compile it as module.
index 9ef48167e2cf8ba64c790d4846a2d297e84c6fd0..27b74b0d547b540043fd318917e2cb5d6ebe0591 100644 (file)
@@ -65,7 +65,7 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8688 = {
        .io_port_1 = 0x01,
        .io_port_2 = 0x02,
 };
-static const struct btmrvl_sdio_card_reg btmrvl_reg_8787 = {
+static const struct btmrvl_sdio_card_reg btmrvl_reg_87xx = {
        .cfg = 0x00,
        .host_int_mask = 0x02,
        .host_intstatus = 0x03,
@@ -92,7 +92,14 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
 static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = {
        .helper         = NULL,
        .firmware       = "mrvl/sd8787_uapsta.bin",
-       .reg            = &btmrvl_reg_8787,
+       .reg            = &btmrvl_reg_87xx,
+       .sd_blksz_fw_dl = 256,
+};
+
+static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = {
+       .helper         = NULL,
+       .firmware       = "mrvl/sd8797_uapsta.bin",
+       .reg            = &btmrvl_reg_87xx,
        .sd_blksz_fw_dl = 256,
 };
 
@@ -103,6 +110,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = {
        /* Marvell SD8787 Bluetooth device */
        { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A),
                        .driver_data = (unsigned long) &btmrvl_sdio_sd8787 },
+       /* Marvell SD8797 Bluetooth device */
+       { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912A),
+                       .driver_data = (unsigned long) &btmrvl_sdio_sd8797 },
 
        { }     /* Terminating entry */
 };
@@ -1076,3 +1086,4 @@ MODULE_LICENSE("GPL v2");
 MODULE_FIRMWARE("sd8688_helper.bin");
 MODULE_FIRMWARE("sd8688.bin");
 MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
+MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
index fe4ebc375b3dafd274da41c803cbb9ac37754146..eabc437ce5002a507b3fcf17973abc1b4baffc59 100644 (file)
@@ -777,9 +777,8 @@ skip_waking:
                usb_mark_last_busy(data->udev);
        }
 
-       usb_free_urb(urb);
-
 done:
+       usb_free_urb(urb);
        return err;
 }
 
index 571041477ab2984230fb1d6f4f9849276f0f046f..a626e15799a5b4a3cd3fd8fe323286c6e23e3b91 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/amba/pl330.h>
 #include <linux/pm_runtime.h>
 #include <linux/scatterlist.h>
+#include <linux/of.h>
 
 #define NR_DEFAULT_DESC        16
 
@@ -116,6 +117,9 @@ struct dma_pl330_desc {
        struct dma_pl330_chan *pchan;
 };
 
+/* forward declaration */
+static struct amba_driver pl330_driver;
+
 static inline struct dma_pl330_chan *
 to_pchan(struct dma_chan *ch)
 {
@@ -267,6 +271,32 @@ static void dma_pl330_rqcb(void *token, enum pl330_op_err err)
        tasklet_schedule(&pch->task);
 }
 
+bool pl330_filter(struct dma_chan *chan, void *param)
+{
+       u8 *peri_id;
+
+       if (chan->device->dev->driver != &pl330_driver.drv)
+               return false;
+
+#ifdef CONFIG_OF
+       if (chan->device->dev->of_node) {
+               const __be32 *prop_value;
+               phandle phandle;
+               struct device_node *node;
+
+               prop_value = ((struct property *)param)->value;
+               phandle = be32_to_cpup(prop_value++);
+               node = of_find_node_by_phandle(phandle);
+               return ((chan->private == node) &&
+                               (chan->chan_id == be32_to_cpup(prop_value)));
+       }
+#endif
+
+       peri_id = chan->private;
+       return *peri_id == (unsigned)param;
+}
+EXPORT_SYMBOL(pl330_filter);
+
 static int pl330_alloc_chan_resources(struct dma_chan *chan)
 {
        struct dma_pl330_chan *pch = to_pchan(chan);
@@ -497,7 +527,7 @@ pluck_desc(struct dma_pl330_dmac *pdmac)
 static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
 {
        struct dma_pl330_dmac *pdmac = pch->dmac;
-       struct dma_pl330_peri *peri = pch->chan.private;
+       u8 *peri_id = pch->chan.private;
        struct dma_pl330_desc *desc;
 
        /* Pluck one desc from the pool of DMAC */
@@ -522,13 +552,7 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
        desc->txd.cookie = 0;
        async_tx_ack(&desc->txd);
 
-       if (peri) {
-               desc->req.rqtype = peri->rqtype;
-               desc->req.peri = pch->chan.chan_id;
-       } else {
-               desc->req.rqtype = MEMTOMEM;
-               desc->req.peri = 0;
-       }
+       desc->req.peri = peri_id ? pch->chan.chan_id : 0;
 
        dma_async_tx_descriptor_init(&desc->txd, &pch->chan);
 
@@ -615,12 +639,14 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
        case DMA_TO_DEVICE:
                desc->rqcfg.src_inc = 1;
                desc->rqcfg.dst_inc = 0;
+               desc->req.rqtype = MEMTODEV;
                src = dma_addr;
                dst = pch->fifo_addr;
                break;
        case DMA_FROM_DEVICE:
                desc->rqcfg.src_inc = 0;
                desc->rqcfg.dst_inc = 1;
+               desc->req.rqtype = DEVTOMEM;
                src = pch->fifo_addr;
                dst = dma_addr;
                break;
@@ -646,16 +672,12 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
 {
        struct dma_pl330_desc *desc;
        struct dma_pl330_chan *pch = to_pchan(chan);
-       struct dma_pl330_peri *peri = chan->private;
        struct pl330_info *pi;
        int burst;
 
        if (unlikely(!pch || !len))
                return NULL;
 
-       if (peri && peri->rqtype != MEMTOMEM)
-               return NULL;
-
        pi = &pch->dmac->pif;
 
        desc = __pl330_prep_dma_memcpy(pch, dst, src, len);
@@ -664,6 +686,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
 
        desc->rqcfg.src_inc = 1;
        desc->rqcfg.dst_inc = 1;
+       desc->req.rqtype = MEMTOMEM;
 
        /* Select max possible burst size */
        burst = pi->pcfg.data_bus_width / 8;
@@ -692,25 +715,14 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 {
        struct dma_pl330_desc *first, *desc = NULL;
        struct dma_pl330_chan *pch = to_pchan(chan);
-       struct dma_pl330_peri *peri = chan->private;
        struct scatterlist *sg;
        unsigned long flags;
        int i;
        dma_addr_t addr;
 
-       if (unlikely(!pch || !sgl || !sg_len || !peri))
+       if (unlikely(!pch || !sgl || !sg_len))
                return NULL;
 
-       /* Make sure the direction is consistent */
-       if ((direction == DMA_TO_DEVICE &&
-                               peri->rqtype != MEMTODEV) ||
-                       (direction == DMA_FROM_DEVICE &&
-                               peri->rqtype != DEVTOMEM)) {
-               dev_err(pch->dmac->pif.dev, "%s:%d Invalid Direction\n",
-                               __func__, __LINE__);
-               return NULL;
-       }
-
        addr = pch->fifo_addr;
 
        first = NULL;
@@ -750,11 +762,13 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
                if (direction == DMA_TO_DEVICE) {
                        desc->rqcfg.src_inc = 1;
                        desc->rqcfg.dst_inc = 0;
+                       desc->req.rqtype = MEMTODEV;
                        fill_px(&desc->px,
                                addr, sg_dma_address(sg), sg_dma_len(sg));
                } else {
                        desc->rqcfg.src_inc = 0;
                        desc->rqcfg.dst_inc = 1;
+                       desc->req.rqtype = DEVTOMEM;
                        fill_px(&desc->px,
                                sg_dma_address(sg), addr, sg_dma_len(sg));
                }
@@ -856,32 +870,16 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
        INIT_LIST_HEAD(&pd->channels);
 
        /* Initialize channel parameters */
-       num_chan = max(pdat ? pdat->nr_valid_peri : 0, (u8)pi->pcfg.num_chan);
+       num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri,
+                       (u8)pi->pcfg.num_chan);
        pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
 
        for (i = 0; i < num_chan; i++) {
                pch = &pdmac->peripherals[i];
-               if (pdat) {
-                       struct dma_pl330_peri *peri = &pdat->peri[i];
-
-                       switch (peri->rqtype) {
-                       case MEMTOMEM:
-                               dma_cap_set(DMA_MEMCPY, pd->cap_mask);
-                               break;
-                       case MEMTODEV:
-                       case DEVTOMEM:
-                               dma_cap_set(DMA_SLAVE, pd->cap_mask);
-                               dma_cap_set(DMA_CYCLIC, pd->cap_mask);
-                               break;
-                       default:
-                               dev_err(&adev->dev, "DEVTODEV Not Supported\n");
-                               continue;
-                       }
-                       pch->chan.private = peri;
-               } else {
-                       dma_cap_set(DMA_MEMCPY, pd->cap_mask);
-                       pch->chan.private = NULL;
-               }
+               if (!adev->dev.of_node)
+                       pch->chan.private = pdat ? &pdat->peri_id[i] : NULL;
+               else
+                       pch->chan.private = adev->dev.of_node;
 
                INIT_LIST_HEAD(&pch->work_list);
                spin_lock_init(&pch->lock);
@@ -894,6 +892,15 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
        }
 
        pd->dev = &adev->dev;
+       if (pdat) {
+               pd->cap_mask = pdat->cap_mask;
+       } else {
+               dma_cap_set(DMA_MEMCPY, pd->cap_mask);
+               if (pi->pcfg.num_peri) {
+                       dma_cap_set(DMA_SLAVE, pd->cap_mask);
+                       dma_cap_set(DMA_CYCLIC, pd->cap_mask);
+               }
+       }
 
        pd->device_alloc_chan_resources = pl330_alloc_chan_resources;
        pd->device_free_chan_resources = pl330_free_chan_resources;
index b0a81173a268175f71606e1aad2ab6067b67f698..d25599f2a3f8bbb882ada61957239f030a06fa18 100644 (file)
@@ -495,7 +495,8 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
        return 0;
 }
 
-static int efi_pstore_write(enum pstore_type_id type, u64 *id,
+static int efi_pstore_write(enum pstore_type_id type,
+               enum kmsg_dump_reason reason, u64 *id,
                unsigned int part, size_t size, struct pstore_info *psi)
 {
        char name[DUMP_NAME_LEN];
@@ -565,7 +566,7 @@ static int efi_pstore_write(enum pstore_type_id type, u64 *id,
 static int efi_pstore_erase(enum pstore_type_id type, u64 id,
                            struct pstore_info *psi)
 {
-       efi_pstore_write(type, &id, (unsigned int)id, 0, psi);
+       efi_pstore_write(type, 0, &id, (unsigned int)id, 0, psi);
 
        return 0;
 }
@@ -587,7 +588,8 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
        return -1;
 }
 
-static int efi_pstore_write(enum pstore_type_id type, u64 *id,
+static int efi_pstore_write(enum pstore_type_id type,
+               enum kmsg_dump_reason reason, u64 *id,
                unsigned int part, size_t size, struct pstore_info *psi)
 {
        return 0;
index 8482a23887dc4e8a64f12783fad08c658d8b1ddb..aa0b94ff36d0d32ea941b9300d605c48e3b3944c 100644 (file)
@@ -141,6 +141,12 @@ config GPIO_PL061
        help
          Say yes here to support the PrimeCell PL061 GPIO device
 
+config GPIO_PXA
+       bool "PXA GPIO support"
+       depends on ARCH_PXA || ARCH_MMP
+       help
+         Say yes here to support the PXA GPIO device
+
 config GPIO_XILINX
        bool "Xilinx GPIO support"
        depends on PPC_OF || MICROBLAZE
index 4e018d6a763996127cd370a6a3908273024f37a8..8ef9e9abe97082d26acb915bc169b053a6ff30bb 100644 (file)
@@ -40,7 +40,7 @@ obj-$(CONFIG_GPIO_PCA953X)    += gpio-pca953x.o
 obj-$(CONFIG_GPIO_PCF857X)     += gpio-pcf857x.o
 obj-$(CONFIG_GPIO_PCH)         += gpio-pch.o
 obj-$(CONFIG_GPIO_PL061)       += gpio-pl061.o
-obj-$(CONFIG_PLAT_PXA)         += gpio-pxa.o
+obj-$(CONFIG_GPIO_PXA)         += gpio-pxa.o
 obj-$(CONFIG_GPIO_RDC321X)     += gpio-rdc321x.o
 obj-$(CONFIG_PLAT_SAMSUNG)     += gpio-samsung.o
 obj-$(CONFIG_ARCH_SA1100)      += gpio-sa1100.o
index ee137712f9db2cc1820343b210ce00556ee0b003..b2d3ee1d183a50b2da33ac819d2a74375966b726 100644 (file)
  *  it under the terms of the GNU General Public License version 2 as
  *  published by the Free Software Foundation.
  */
+#include <linux/clk.h>
+#include <linux/err.h>
 #include <linux/gpio.h>
+#include <linux/gpio-pxa.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 #include <linux/syscore_ops.h>
 #include <linux/slab.h>
 
-#include <mach/gpio-pxa.h>
+/*
+ * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with
+ * one set of registers. The register offsets are organized below:
+ *
+ *           GPLR    GPDR    GPSR    GPCR    GRER    GFER    GEDR
+ * BANK 0 - 0x0000  0x000C  0x0018  0x0024  0x0030  0x003C  0x0048
+ * BANK 1 - 0x0004  0x0010  0x001C  0x0028  0x0034  0x0040  0x004C
+ * BANK 2 - 0x0008  0x0014  0x0020  0x002C  0x0038  0x0044  0x0050
+ *
+ * BANK 3 - 0x0100  0x010C  0x0118  0x0124  0x0130  0x013C  0x0148
+ * BANK 4 - 0x0104  0x0110  0x011C  0x0128  0x0134  0x0140  0x014C
+ * BANK 5 - 0x0108  0x0114  0x0120  0x012C  0x0138  0x0144  0x0150
+ *
+ * NOTE:
+ *   BANK 3 is only available on PXA27x and later processors.
+ *   BANK 4 and 5 are only available on PXA935
+ */
+
+#define GPLR_OFFSET    0x00
+#define GPDR_OFFSET    0x0C
+#define GPSR_OFFSET    0x18
+#define GPCR_OFFSET    0x24
+#define GRER_OFFSET    0x30
+#define GFER_OFFSET    0x3C
+#define GEDR_OFFSET    0x48
+#define GAFR_OFFSET    0x54
+#define ED_MASK_OFFSET 0x9C    /* GPIO edge detection for AP side */
+
+#define BANK_OFF(n)    (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
 
 int pxa_last_gpio;
 
@@ -39,8 +71,20 @@ struct pxa_gpio_chip {
 #endif
 };
 
+enum {
+       PXA25X_GPIO = 0,
+       PXA26X_GPIO,
+       PXA27X_GPIO,
+       PXA3XX_GPIO,
+       PXA93X_GPIO,
+       MMP_GPIO = 0x10,
+       MMP2_GPIO,
+};
+
 static DEFINE_SPINLOCK(gpio_lock);
 static struct pxa_gpio_chip *pxa_gpio_chips;
+static int gpio_type;
+static void __iomem *gpio_reg_base;
 
 #define for_each_gpio_chip(i, c)                       \
        for (i = 0, c = &pxa_gpio_chips[0]; i <= pxa_last_gpio; i += 32, c++)
@@ -55,6 +99,122 @@ static inline struct pxa_gpio_chip *gpio_to_pxachip(unsigned gpio)
        return &pxa_gpio_chips[gpio_to_bank(gpio)];
 }
 
+static inline int gpio_is_pxa_type(int type)
+{
+       return (type & MMP_GPIO) == 0;
+}
+
+static inline int gpio_is_mmp_type(int type)
+{
+       return (type & MMP_GPIO) != 0;
+}
+
+/* GPIO86/87/88/89 on PXA26x have their direction bits in PXA_GPDR(2 inverted,
+ * as well as their Alternate Function value being '1' for GPIO in GAFRx.
+ */
+static inline int __gpio_is_inverted(int gpio)
+{
+       if ((gpio_type == PXA26X_GPIO) && (gpio > 85))
+               return 1;
+       return 0;
+}
+
+/*
+ * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate
+ * function of a GPIO, and GPDRx cannot be altered once configured. It
+ * is attributed as "occupied" here (I know this terminology isn't
+ * accurate, you are welcome to propose a better one :-)
+ */
+static inline int __gpio_is_occupied(unsigned gpio)
+{
+       struct pxa_gpio_chip *pxachip;
+       void __iomem *base;
+       unsigned long gafr = 0, gpdr = 0;
+       int ret, af = 0, dir = 0;
+
+       pxachip = gpio_to_pxachip(gpio);
+       base = gpio_chip_base(&pxachip->chip);
+       gpdr = readl_relaxed(base + GPDR_OFFSET);
+
+       switch (gpio_type) {
+       case PXA25X_GPIO:
+       case PXA26X_GPIO:
+       case PXA27X_GPIO:
+               gafr = readl_relaxed(base + GAFR_OFFSET);
+               af = (gafr >> ((gpio & 0xf) * 2)) & 0x3;
+               dir = gpdr & GPIO_bit(gpio);
+
+               if (__gpio_is_inverted(gpio))
+                       ret = (af != 1) || (dir == 0);
+               else
+                       ret = (af != 0) || (dir != 0);
+               break;
+       default:
+               ret = gpdr & GPIO_bit(gpio);
+               break;
+       }
+       return ret;
+}
+
+#ifdef CONFIG_ARCH_PXA
+static inline int __pxa_gpio_to_irq(int gpio)
+{
+       if (gpio_is_pxa_type(gpio_type))
+               return PXA_GPIO_TO_IRQ(gpio);
+       return -1;
+}
+
+static inline int __pxa_irq_to_gpio(int irq)
+{
+       if (gpio_is_pxa_type(gpio_type))
+               return irq - PXA_GPIO_TO_IRQ(0);
+       return -1;
+}
+#else
+static inline int __pxa_gpio_to_irq(int gpio) { return -1; }
+static inline int __pxa_irq_to_gpio(int irq) { return -1; }
+#endif
+
+#ifdef CONFIG_ARCH_MMP
+static inline int __mmp_gpio_to_irq(int gpio)
+{
+       if (gpio_is_mmp_type(gpio_type))
+               return MMP_GPIO_TO_IRQ(gpio);
+       return -1;
+}
+
+static inline int __mmp_irq_to_gpio(int irq)
+{
+       if (gpio_is_mmp_type(gpio_type))
+               return irq - MMP_GPIO_TO_IRQ(0);
+       return -1;
+}
+#else
+static inline int __mmp_gpio_to_irq(int gpio) { return -1; }
+static inline int __mmp_irq_to_gpio(int irq) { return -1; }
+#endif
+
+static int pxa_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+       int gpio, ret;
+
+       gpio = chip->base + offset;
+       ret = __pxa_gpio_to_irq(gpio);
+       if (ret >= 0)
+               return ret;
+       return __mmp_gpio_to_irq(gpio);
+}
+
+int pxa_irq_to_gpio(int irq)
+{
+       int ret;
+
+       ret = __pxa_irq_to_gpio(irq);
+       if (ret >= 0)
+               return ret;
+       return __mmp_irq_to_gpio(irq);
+}
+
 static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 {
        void __iomem *base = gpio_chip_base(chip);
@@ -63,12 +223,12 @@ static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 
        spin_lock_irqsave(&gpio_lock, flags);
 
-       value = __raw_readl(base + GPDR_OFFSET);
+       value = readl_relaxed(base + GPDR_OFFSET);
        if (__gpio_is_inverted(chip->base + offset))
                value |= mask;
        else
                value &= ~mask;
-       __raw_writel(value, base + GPDR_OFFSET);
+       writel_relaxed(value, base + GPDR_OFFSET);
 
        spin_unlock_irqrestore(&gpio_lock, flags);
        return 0;
@@ -81,16 +241,16 @@ static int pxa_gpio_direction_output(struct gpio_chip *chip,
        uint32_t tmp, mask = 1 << offset;
        unsigned long flags;
 
-       __raw_writel(mask, base + (value ? GPSR_OFFSET : GPCR_OFFSET));
+       writel_relaxed(mask, base + (value ? GPSR_OFFSET : GPCR_OFFSET));
 
        spin_lock_irqsave(&gpio_lock, flags);
 
-       tmp = __raw_readl(base + GPDR_OFFSET);
+       tmp = readl_relaxed(base + GPDR_OFFSET);
        if (__gpio_is_inverted(chip->base + offset))
                tmp &= ~mask;
        else
                tmp |= mask;
-       __raw_writel(tmp, base + GPDR_OFFSET);
+       writel_relaxed(tmp, base + GPDR_OFFSET);
 
        spin_unlock_irqrestore(&gpio_lock, flags);
        return 0;
@@ -98,16 +258,16 @@ static int pxa_gpio_direction_output(struct gpio_chip *chip,
 
 static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
-       return __raw_readl(gpio_chip_base(chip) + GPLR_OFFSET) & (1 << offset);
+       return readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET) & (1 << offset);
 }
 
 static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 {
-       __raw_writel(1 << offset, gpio_chip_base(chip) +
+       writel_relaxed(1 << offset, gpio_chip_base(chip) +
                                (value ? GPSR_OFFSET : GPCR_OFFSET));
 }
 
-static int __init pxa_init_gpio_chip(int gpio_end)
+static int __devinit pxa_init_gpio_chip(int gpio_end)
 {
        int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1;
        struct pxa_gpio_chip *chips;
@@ -122,7 +282,7 @@ static int __init pxa_init_gpio_chip(int gpio_end)
                struct gpio_chip *c = &chips[i].chip;
 
                sprintf(chips[i].label, "gpio-%d", i);
-               chips[i].regbase = GPIO_BANK(i);
+               chips[i].regbase = gpio_reg_base + BANK_OFF(i);
 
                c->base  = gpio;
                c->label = chips[i].label;
@@ -131,6 +291,7 @@ static int __init pxa_init_gpio_chip(int gpio_end)
                c->direction_output = pxa_gpio_direction_output;
                c->get = pxa_gpio_get;
                c->set = pxa_gpio_set;
+               c->to_irq = pxa_gpio_to_irq;
 
                /* number of GPIOs on last bank may be less than 32 */
                c->ngpio = (gpio + 31 > gpio_end) ? (gpio_end - gpio + 1) : 32;
@@ -147,18 +308,18 @@ static inline void update_edge_detect(struct pxa_gpio_chip *c)
 {
        uint32_t grer, gfer;
 
-       grer = __raw_readl(c->regbase + GRER_OFFSET) & ~c->irq_mask;
-       gfer = __raw_readl(c->regbase + GFER_OFFSET) & ~c->irq_mask;
+       grer = readl_relaxed(c->regbase + GRER_OFFSET) & ~c->irq_mask;
+       gfer = readl_relaxed(c->regbase + GFER_OFFSET) & ~c->irq_mask;
        grer |= c->irq_edge_rise & c->irq_mask;
        gfer |= c->irq_edge_fall & c->irq_mask;
-       __raw_writel(grer, c->regbase + GRER_OFFSET);
-       __raw_writel(gfer, c->regbase + GFER_OFFSET);
+       writel_relaxed(grer, c->regbase + GRER_OFFSET);
+       writel_relaxed(gfer, c->regbase + GFER_OFFSET);
 }
 
 static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type)
 {
        struct pxa_gpio_chip *c;
-       int gpio = irq_to_gpio(d->irq);
+       int gpio = pxa_irq_to_gpio(d->irq);
        unsigned long gpdr, mask = GPIO_bit(gpio);
 
        c = gpio_to_pxachip(gpio);
@@ -176,12 +337,12 @@ static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type)
                type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
        }
 
-       gpdr = __raw_readl(c->regbase + GPDR_OFFSET);
+       gpdr = readl_relaxed(c->regbase + GPDR_OFFSET);
 
        if (__gpio_is_inverted(gpio))
-               __raw_writel(gpdr | mask,  c->regbase + GPDR_OFFSET);
+               writel_relaxed(gpdr | mask,  c->regbase + GPDR_OFFSET);
        else
-               __raw_writel(gpdr & ~mask, c->regbase + GPDR_OFFSET);
+               writel_relaxed(gpdr & ~mask, c->regbase + GPDR_OFFSET);
 
        if (type & IRQ_TYPE_EDGE_RISING)
                c->irq_edge_rise |= mask;
@@ -212,9 +373,9 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
                for_each_gpio_chip(gpio, c) {
                        gpio_base = c->chip.base;
 
-                       gedr = __raw_readl(c->regbase + GEDR_OFFSET);
+                       gedr = readl_relaxed(c->regbase + GEDR_OFFSET);
                        gedr = gedr & c->irq_mask;
-                       __raw_writel(gedr, c->regbase + GEDR_OFFSET);
+                       writel_relaxed(gedr, c->regbase + GEDR_OFFSET);
 
                        n = find_first_bit(&gedr, BITS_PER_LONG);
                        while (n < BITS_PER_LONG) {
@@ -229,29 +390,29 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
 
 static void pxa_ack_muxed_gpio(struct irq_data *d)
 {
-       int gpio = irq_to_gpio(d->irq);
+       int gpio = pxa_irq_to_gpio(d->irq);
        struct pxa_gpio_chip *c = gpio_to_pxachip(gpio);
 
-       __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET);
+       writel_relaxed(GPIO_bit(gpio), c->regbase + GEDR_OFFSET);
 }
 
 static void pxa_mask_muxed_gpio(struct irq_data *d)
 {
-       int gpio = irq_to_gpio(d->irq);
+       int gpio = pxa_irq_to_gpio(d->irq);
        struct pxa_gpio_chip *c = gpio_to_pxachip(gpio);
        uint32_t grer, gfer;
 
        c->irq_mask &= ~GPIO_bit(gpio);
 
-       grer = __raw_readl(c->regbase + GRER_OFFSET) & ~GPIO_bit(gpio);
-       gfer = __raw_readl(c->regbase + GFER_OFFSET) & ~GPIO_bit(gpio);
-       __raw_writel(grer, c->regbase + GRER_OFFSET);
-       __raw_writel(gfer, c->regbase + GFER_OFFSET);
+       grer = readl_relaxed(c->regbase + GRER_OFFSET) & ~GPIO_bit(gpio);
+       gfer = readl_relaxed(c->regbase + GFER_OFFSET) & ~GPIO_bit(gpio);
+       writel_relaxed(grer, c->regbase + GRER_OFFSET);
+       writel_relaxed(gfer, c->regbase + GFER_OFFSET);
 }
 
 static void pxa_unmask_muxed_gpio(struct irq_data *d)
 {
-       int gpio = irq_to_gpio(d->irq);
+       int gpio = pxa_irq_to_gpio(d->irq);
        struct pxa_gpio_chip *c = gpio_to_pxachip(gpio);
 
        c->irq_mask |= GPIO_bit(gpio);
@@ -266,34 +427,143 @@ static struct irq_chip pxa_muxed_gpio_chip = {
        .irq_set_type   = pxa_gpio_irq_type,
 };
 
-void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn)
+static int pxa_gpio_nums(void)
 {
-       struct pxa_gpio_chip *c;
-       int gpio, irq;
+       int count = 0;
+
+#ifdef CONFIG_ARCH_PXA
+       if (cpu_is_pxa25x()) {
+#ifdef CONFIG_CPU_PXA26x
+               count = 89;
+               gpio_type = PXA26X_GPIO;
+#elif defined(CONFIG_PXA25x)
+               count = 84;
+               gpio_type = PXA26X_GPIO;
+#endif /* CONFIG_CPU_PXA26x */
+       } else if (cpu_is_pxa27x()) {
+               count = 120;
+               gpio_type = PXA27X_GPIO;
+       } else if (cpu_is_pxa93x() || cpu_is_pxa95x()) {
+               count = 191;
+               gpio_type = PXA93X_GPIO;
+       } else if (cpu_is_pxa3xx()) {
+               count = 127;
+               gpio_type = PXA3XX_GPIO;
+       }
+#endif /* CONFIG_ARCH_PXA */
+
+#ifdef CONFIG_ARCH_MMP
+       if (cpu_is_pxa168() || cpu_is_pxa910()) {
+               count = 127;
+               gpio_type = MMP_GPIO;
+       } else if (cpu_is_mmp2()) {
+               count = 191;
+               gpio_type = MMP2_GPIO;
+       }
+#endif /* CONFIG_ARCH_MMP */
+       return count;
+}
 
-       pxa_last_gpio = end;
+static int __devinit pxa_gpio_probe(struct platform_device *pdev)
+{
+       struct pxa_gpio_chip *c;
+       struct resource *res;
+       struct clk *clk;
+       int gpio, irq, ret;
+       int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0;
+
+       pxa_last_gpio = pxa_gpio_nums();
+       if (!pxa_last_gpio)
+               return -EINVAL;
+
+       irq0 = platform_get_irq_byname(pdev, "gpio0");
+       irq1 = platform_get_irq_byname(pdev, "gpio1");
+       irq_mux = platform_get_irq_byname(pdev, "gpio_mux");
+       if ((irq0 > 0 && irq1 <= 0) || (irq0 <= 0 && irq1 > 0)
+               || (irq_mux <= 0))
+               return -EINVAL;
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res)
+               return -EINVAL;
+       gpio_reg_base = ioremap(res->start, resource_size(res));
+       if (!gpio_reg_base)
+               return -EINVAL;
+
+       if (irq0 > 0)
+               gpio_offset = 2;
+
+       clk = clk_get(&pdev->dev, NULL);
+       if (IS_ERR(clk)) {
+               dev_err(&pdev->dev, "Error %ld to get gpio clock\n",
+                       PTR_ERR(clk));
+               iounmap(gpio_reg_base);
+               return PTR_ERR(clk);
+       }
+       ret = clk_prepare(clk);
+       if (ret) {
+               clk_put(clk);
+               iounmap(gpio_reg_base);
+               return ret;
+       }
+       ret = clk_enable(clk);
+       if (ret) {
+               clk_unprepare(clk);
+               clk_put(clk);
+               iounmap(gpio_reg_base);
+               return ret;
+       }
 
        /* Initialize GPIO chips */
-       pxa_init_gpio_chip(end);
+       pxa_init_gpio_chip(pxa_last_gpio);
 
        /* clear all GPIO edge detects */
        for_each_gpio_chip(gpio, c) {
-               __raw_writel(0, c->regbase + GFER_OFFSET);
-               __raw_writel(0, c->regbase + GRER_OFFSET);
-               __raw_writel(~0,c->regbase + GEDR_OFFSET);
+               writel_relaxed(0, c->regbase + GFER_OFFSET);
+               writel_relaxed(0, c->regbase + GRER_OFFSET);
+               writel_relaxed(~0,c->regbase + GEDR_OFFSET);
+               /* unmask GPIO edge detect for AP side */
+               if (gpio_is_mmp_type(gpio_type))
+                       writel_relaxed(~0, c->regbase + ED_MASK_OFFSET);
        }
 
-       for (irq  = gpio_to_irq(start); irq <= gpio_to_irq(end); irq++) {
+#ifdef CONFIG_ARCH_PXA
+       irq = gpio_to_irq(0);
+       irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
+                                handle_edge_irq);
+       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       irq_set_chained_handler(IRQ_GPIO0, pxa_gpio_demux_handler);
+
+       irq = gpio_to_irq(1);
+       irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
+                                handle_edge_irq);
+       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       irq_set_chained_handler(IRQ_GPIO1, pxa_gpio_demux_handler);
+#endif
+
+       for (irq  = gpio_to_irq(gpio_offset);
+               irq <= gpio_to_irq(pxa_last_gpio); irq++) {
                irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
                                         handle_edge_irq);
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }
 
-       /* Install handler for GPIO>=2 edge detect interrupts */
-       irq_set_chained_handler(mux_irq, pxa_gpio_demux_handler);
-       pxa_muxed_gpio_chip.irq_set_wake = fn;
+       irq_set_chained_handler(irq_mux, pxa_gpio_demux_handler);
+       return 0;
 }
 
+static struct platform_driver pxa_gpio_driver = {
+       .probe          = pxa_gpio_probe,
+       .driver         = {
+               .name   = "pxa-gpio",
+       },
+};
+
+static int __init pxa_gpio_init(void)
+{
+       return platform_driver_register(&pxa_gpio_driver);
+}
+postcore_initcall(pxa_gpio_init);
+
 #ifdef CONFIG_PM
 static int pxa_gpio_suspend(void)
 {
@@ -301,13 +571,13 @@ static int pxa_gpio_suspend(void)
        int gpio;
 
        for_each_gpio_chip(gpio, c) {
-               c->saved_gplr = __raw_readl(c->regbase + GPLR_OFFSET);
-               c->saved_gpdr = __raw_readl(c->regbase + GPDR_OFFSET);
-               c->saved_grer = __raw_readl(c->regbase + GRER_OFFSET);
-               c->saved_gfer = __raw_readl(c->regbase + GFER_OFFSET);
+               c->saved_gplr = readl_relaxed(c->regbase + GPLR_OFFSET);
+               c->saved_gpdr = readl_relaxed(c->regbase + GPDR_OFFSET);
+               c->saved_grer = readl_relaxed(c->regbase + GRER_OFFSET);
+               c->saved_gfer = readl_relaxed(c->regbase + GFER_OFFSET);
 
                /* Clear GPIO transition detect bits */
-               __raw_writel(0xffffffff, c->regbase + GEDR_OFFSET);
+               writel_relaxed(0xffffffff, c->regbase + GEDR_OFFSET);
        }
        return 0;
 }
@@ -319,12 +589,12 @@ static void pxa_gpio_resume(void)
 
        for_each_gpio_chip(gpio, c) {
                /* restore level with set/clear */
-               __raw_writel( c->saved_gplr, c->regbase + GPSR_OFFSET);
-               __raw_writel(~c->saved_gplr, c->regbase + GPCR_OFFSET);
+               writel_relaxed( c->saved_gplr, c->regbase + GPSR_OFFSET);
+               writel_relaxed(~c->saved_gplr, c->regbase + GPCR_OFFSET);
 
-               __raw_writel(c->saved_grer, c->regbase + GRER_OFFSET);
-               __raw_writel(c->saved_gfer, c->regbase + GFER_OFFSET);
-               __raw_writel(c->saved_gpdr, c->regbase + GPDR_OFFSET);
+               writel_relaxed(c->saved_grer, c->regbase + GRER_OFFSET);
+               writel_relaxed(c->saved_gfer, c->regbase + GFER_OFFSET);
+               writel_relaxed(c->saved_gpdr, c->regbase + GPDR_OFFSET);
        }
 }
 #else
@@ -336,3 +606,10 @@ struct syscore_ops pxa_gpio_syscore_ops = {
        .suspend        = pxa_gpio_suspend,
        .resume         = pxa_gpio_resume,
 };
+
+static int __init pxa_gpio_sysinit(void)
+{
+       register_syscore_ops(&pxa_gpio_syscore_ops);
+       return 0;
+}
+postcore_initcall(pxa_gpio_sysinit);
index 866251852719c2723868eefd94443f362c952210..6b4d23fd158eb599a9167ae30a441fb63796d72c 100644 (file)
@@ -24,6 +24,9 @@
 #include <linux/interrupt.h>
 #include <linux/sysdev.h>
 #include <linux/ioport.h>
+#include <linux/of.h>
+#include <linux/slab.h>
+#include <linux/of_address.h>
 
 #include <asm/irq.h>
 
@@ -2374,6 +2377,63 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = {
 #endif
 };
 
+#if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF)
+static int exynos4_gpio_xlate(struct gpio_chip *gc, struct device_node *np,
+                             const void *gpio_spec, u32 *flags)
+{
+       const __be32 *gpio = gpio_spec;
+       const u32 n = be32_to_cpup(gpio);
+       unsigned int pin = gc->base + be32_to_cpu(gpio[0]);
+
+       if (WARN_ON(gc->of_gpio_n_cells < 4))
+               return -EINVAL;
+
+       if (n > gc->ngpio)
+               return -EINVAL;
+
+       if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(be32_to_cpu(gpio[1]))))
+               pr_warn("gpio_xlate: failed to set pin function\n");
+       if (s3c_gpio_setpull(pin, be32_to_cpu(gpio[2])))
+               pr_warn("gpio_xlate: failed to set pin pull up/down\n");
+       if (s5p_gpio_set_drvstr(pin, be32_to_cpu(gpio[3])))
+               pr_warn("gpio_xlate: failed to set pin drive strength\n");
+
+       return n;
+}
+
+static const struct of_device_id exynos4_gpio_dt_match[] __initdata = {
+       { .compatible = "samsung,exynos4-gpio", },
+       {}
+};
+
+static __init void exynos4_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip,
+                                                u64 base, u64 offset)
+{
+       struct gpio_chip *gc =  &chip->chip;
+       u64 address;
+
+       if (!of_have_populated_dt())
+               return;
+
+       address = chip->base ? base + ((u32)chip->base & 0xfff) : base + offset;
+       gc->of_node = of_find_matching_node_by_address(NULL,
+                       exynos4_gpio_dt_match, address);
+       if (!gc->of_node) {
+               pr_info("gpio: device tree node not found for gpio controller"
+                       " with base address %08llx\n", address);
+               return;
+       }
+       gc->of_gpio_n_cells = 4;
+       gc->of_xlate = exynos4_gpio_xlate;
+}
+#elif defined(CONFIG_ARCH_EXYNOS4)
+static __init void exynos4_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip,
+                                                u64 base, u64 offset)
+{
+       return;
+}
+#endif /* defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF) */
+
 /* TODO: cleanup soc_is_* */
 static __init int samsung_gpiolib_init(void)
 {
@@ -2455,6 +2515,10 @@ static __init int samsung_gpiolib_init(void)
                                chip->config = &exynos4_gpio_cfg;
                                chip->group = group++;
                        }
+#ifdef CONFIG_CPU_EXYNOS4210
+                       exynos4_gpiolib_attach_ofnode(chip,
+                                       EXYNOS4_PA_GPIO1, i * 0x20);
+#endif
                }
                samsung_gpiolib_add_4bit_chips(exynos4_gpios_1, nr_chips, S5P_VA_GPIO1);
 
@@ -2467,6 +2531,10 @@ static __init int samsung_gpiolib_init(void)
                                chip->config = &exynos4_gpio_cfg;
                                chip->group = group++;
                        }
+#ifdef CONFIG_CPU_EXYNOS4210
+                       exynos4_gpiolib_attach_ofnode(chip,
+                                       EXYNOS4_PA_GPIO2, i * 0x20);
+#endif
                }
                samsung_gpiolib_add_4bit_chips(exynos4_gpios_2, nr_chips, S5P_VA_GPIO2);
 
@@ -2479,6 +2547,10 @@ static __init int samsung_gpiolib_init(void)
                                chip->config = &exynos4_gpio_cfg;
                                chip->group = group++;
                        }
+#ifdef CONFIG_CPU_EXYNOS4210
+                       exynos4_gpiolib_attach_ofnode(chip,
+                                       EXYNOS4_PA_GPIO3, i * 0x20);
+#endif
                }
                samsung_gpiolib_add_4bit_chips(exynos4_gpios_3, nr_chips, S5P_VA_GPIO3);
 
index 6dede8f366c59417b3283cc03b220f6b5c58c97b..41d4155294793f0d204068a7410f4c02090a5c67 100644 (file)
@@ -314,7 +314,7 @@ static int __init at91_ide_probe(struct platform_device *pdev)
        apply_timings(board->chipselect, 0, ide_timing_find_mode(XFER_PIO_0), 0);
 
        /* with GPIO interrupt we have to do quirks in handler */
-       if (board->irq_pin >= PIN_BASE)
+       if (gpio_is_valid(board->irq_pin))
                host->irq_handler = at91_irq_handler;
 
        host->ports[0]->select_data = board->chipselect;
index f689f49e31093d406a8a93e78827d797f9d9aa4f..8a0060cd398277d0fe209fc8c3e7227f14d386e1 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
 #include <linux/sched.h>
 #include <plat/keypad.h>
 
@@ -68,31 +70,26 @@ struct samsung_keypad {
        wait_queue_head_t wait;
        bool stopped;
        int irq;
+       enum samsung_keypad_type type;
        unsigned int row_shift;
        unsigned int rows;
        unsigned int cols;
        unsigned int row_state[SAMSUNG_MAX_COLS];
+#ifdef CONFIG_OF
+       int row_gpios[SAMSUNG_MAX_ROWS];
+       int col_gpios[SAMSUNG_MAX_COLS];
+#endif
        unsigned short keycodes[];
 };
 
-static int samsung_keypad_is_s5pv210(struct device *dev)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-       enum samsung_keypad_type type =
-               platform_get_device_id(pdev)->driver_data;
-
-       return type == KEYPAD_TYPE_S5PV210;
-}
-
 static void samsung_keypad_scan(struct samsung_keypad *keypad,
                                unsigned int *row_state)
 {
-       struct device *dev = keypad->input_dev->dev.parent;
        unsigned int col;
        unsigned int val;
 
        for (col = 0; col < keypad->cols; col++) {
-               if (samsung_keypad_is_s5pv210(dev)) {
+               if (keypad->type == KEYPAD_TYPE_S5PV210) {
                        val = S5PV210_KEYIFCOLEN_MASK;
                        val &= ~(1 << col) << 8;
                } else {
@@ -235,6 +232,126 @@ static void samsung_keypad_close(struct input_dev *input_dev)
        samsung_keypad_stop(keypad);
 }
 
+#ifdef CONFIG_OF
+static struct samsung_keypad_platdata *samsung_keypad_parse_dt(
+                               struct device *dev)
+{
+       struct samsung_keypad_platdata *pdata;
+       struct matrix_keymap_data *keymap_data;
+       uint32_t *keymap, num_rows = 0, num_cols = 0;
+       struct device_node *np = dev->of_node, *key_np;
+       unsigned int key_count = 0;
+
+       pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+       if (!pdata) {
+               dev_err(dev, "could not allocate memory for platform data\n");
+               return NULL;
+       }
+
+       of_property_read_u32(np, "samsung,keypad-num-rows", &num_rows);
+       of_property_read_u32(np, "samsung,keypad-num-columns", &num_cols);
+       if (!num_rows || !num_cols) {
+               dev_err(dev, "number of keypad rows/columns not specified\n");
+               return NULL;
+       }
+       pdata->rows = num_rows;
+       pdata->cols = num_cols;
+
+       keymap_data = devm_kzalloc(dev, sizeof(*keymap_data), GFP_KERNEL);
+       if (!keymap_data) {
+               dev_err(dev, "could not allocate memory for keymap data\n");
+               return NULL;
+       }
+       pdata->keymap_data = keymap_data;
+
+       for_each_child_of_node(np, key_np)
+               key_count++;
+
+       keymap_data->keymap_size = key_count;
+       keymap = devm_kzalloc(dev, sizeof(uint32_t) * key_count, GFP_KERNEL);
+       if (!keymap) {
+               dev_err(dev, "could not allocate memory for keymap\n");
+               return NULL;
+       }
+       keymap_data->keymap = keymap;
+
+       for_each_child_of_node(np, key_np) {
+               u32 row, col, key_code;
+               of_property_read_u32(key_np, "keypad,row", &row);
+               of_property_read_u32(key_np, "keypad,column", &col);
+               of_property_read_u32(key_np, "linux,code", &key_code);
+               *keymap++ = KEY(row, col, key_code);
+       }
+
+       if (of_get_property(np, "linux,input-no-autorepeat", NULL))
+               pdata->no_autorepeat = true;
+       if (of_get_property(np, "linux,input-wakeup", NULL))
+               pdata->wakeup = true;
+
+       return pdata;
+}
+
+static void samsung_keypad_parse_dt_gpio(struct device *dev,
+                               struct samsung_keypad *keypad)
+{
+       struct device_node *np = dev->of_node;
+       int gpio, ret, row, col;
+
+       for (row = 0; row < keypad->rows; row++) {
+               gpio = of_get_named_gpio(np, "row-gpios", row);
+               keypad->row_gpios[row] = gpio;
+               if (!gpio_is_valid(gpio)) {
+                       dev_err(dev, "keypad row[%d]: invalid gpio %d\n",
+                                       row, gpio);
+                       continue;
+               }
+
+               ret = gpio_request(gpio, "keypad-row");
+               if (ret)
+                       dev_err(dev, "keypad row[%d] gpio request failed\n",
+                                       row);
+       }
+
+       for (col = 0; col < keypad->cols; col++) {
+               gpio = of_get_named_gpio(np, "col-gpios", col);
+               keypad->col_gpios[col] = gpio;
+               if (!gpio_is_valid(gpio)) {
+                       dev_err(dev, "keypad column[%d]: invalid gpio %d\n",
+                                       col, gpio);
+                       continue;
+               }
+
+               ret = gpio_request(gpio, "keypad-col");
+               if (ret)
+                       dev_err(dev, "keypad column[%d] gpio request failed\n",
+                                       col);
+       }
+}
+
+static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad)
+{
+       int cnt;
+
+       for (cnt = 0; cnt < keypad->rows; cnt++)
+               if (gpio_is_valid(keypad->row_gpios[cnt]))
+                       gpio_free(keypad->row_gpios[cnt]);
+
+       for (cnt = 0; cnt < keypad->cols; cnt++)
+               if (gpio_is_valid(keypad->col_gpios[cnt]))
+                       gpio_free(keypad->col_gpios[cnt]);
+}
+#else
+static
+struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev)
+{
+       return NULL;
+}
+
+static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad)
+{
+}
+#endif
+
 static int __devinit samsung_keypad_probe(struct platform_device *pdev)
 {
        const struct samsung_keypad_platdata *pdata;
@@ -246,7 +363,10 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
        unsigned int keymap_size;
        int error;
 
-       pdata = pdev->dev.platform_data;
+       if (pdev->dev.of_node)
+               pdata = samsung_keypad_parse_dt(&pdev->dev);
+       else
+               pdata = pdev->dev.platform_data;
        if (!pdata) {
                dev_err(&pdev->dev, "no platform data defined\n");
                return -EINVAL;
@@ -303,6 +423,16 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
        keypad->cols = pdata->cols;
        init_waitqueue_head(&keypad->wait);
 
+       if (pdev->dev.of_node) {
+#ifdef CONFIG_OF
+               samsung_keypad_parse_dt_gpio(&pdev->dev, keypad);
+               keypad->type = of_device_is_compatible(pdev->dev.of_node,
+                                       "samsung,s5pv210-keypad");
+#endif
+       } else {
+               keypad->type = platform_get_device_id(pdev)->driver_data;
+       }
+
        input_dev->name = pdev->name;
        input_dev->id.bustype = BUS_HOST;
        input_dev->dev.parent = &pdev->dev;
@@ -343,12 +473,19 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
 
        device_init_wakeup(&pdev->dev, pdata->wakeup);
        platform_set_drvdata(pdev, keypad);
+
+       if (pdev->dev.of_node) {
+               devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap);
+               devm_kfree(&pdev->dev, (void *)pdata->keymap_data);
+               devm_kfree(&pdev->dev, (void *)pdata);
+       }
        return 0;
 
 err_free_irq:
        free_irq(keypad->irq, keypad);
 err_put_clk:
        clk_put(keypad->clk);
+       samsung_keypad_dt_gpio_free(keypad);
 err_unmap_base:
        iounmap(keypad->base);
 err_free_mem:
@@ -374,6 +511,7 @@ static int __devexit samsung_keypad_remove(struct platform_device *pdev)
        free_irq(keypad->irq, keypad);
 
        clk_put(keypad->clk);
+       samsung_keypad_dt_gpio_free(keypad);
 
        iounmap(keypad->base);
        kfree(keypad);
@@ -447,6 +585,17 @@ static const struct dev_pm_ops samsung_keypad_pm_ops = {
 };
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id samsung_keypad_dt_match[] = {
+       { .compatible = "samsung,s3c6410-keypad" },
+       { .compatible = "samsung,s5pv210-keypad" },
+       {},
+};
+MODULE_DEVICE_TABLE(of, samsung_keypad_dt_match);
+#else
+#define samsung_keypad_dt_match NULL
+#endif
+
 static struct platform_device_id samsung_keypad_driver_ids[] = {
        {
                .name           = "samsung-keypad",
@@ -465,6 +614,7 @@ static struct platform_driver samsung_keypad_driver = {
        .driver         = {
                .name   = "samsung-keypad",
                .owner  = THIS_MODULE,
+               .of_match_table = samsung_keypad_dt_match,
 #ifdef CONFIG_PM
                .pm     = &samsung_keypad_pm_ops,
 #endif
index 80793f1608eb0d1fd2eaff655cba48ffcc037709..06517e60e50c1e64742083eb1371fb7a328bd929 100644 (file)
@@ -115,8 +115,8 @@ static void decode_mg(struct cma3000_accl_data *data, int *datax,
 static irqreturn_t cma3000_thread_irq(int irq, void *dev_id)
 {
        struct cma3000_accl_data *data = dev_id;
-       int datax, datay, dataz;
-       u8 ctrl, mode, range, intr_status;
+       int datax, datay, dataz, intr_status;
+       u8 ctrl, mode, range;
 
        intr_status = CMA3000_READ(data, CMA3000_INTSTATUS, "interrupt status");
        if (intr_status < 0)
index c080b828e5dc5e2f69c8cf859deebe3d6abbae61..a6dcd18e9adf93b5b97cd00e04b6419a6788e1e5 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <linux/dmi.h>
 #include <linux/input/mt.h>
 #include <linux/serio.h>
@@ -1220,6 +1221,16 @@ static int synaptics_reconnect(struct psmouse *psmouse)
 
        do {
                psmouse_reset(psmouse);
+               if (retry) {
+                       /*
+                        * On some boxes, right after resuming, the touchpad
+                        * needs some time to finish initializing (I assume
+                        * it needs time to calibrate) and start responding
+                        * to Synaptics-specific queries, so let's wait a
+                        * bit.
+                        */
+                       ssleep(1);
+               }
                error = synaptics_detect(psmouse, 0);
        } while (error && ++retry < 3);
 
index da0d8761e778cfd8f79e64b26a0ce3acd8cf60c5..2ee47d01a3b4ecde112b07ac95ccd798f053e4f4 100644 (file)
@@ -1470,6 +1470,9 @@ static const struct wacom_features wacom_features_0xE3 =
 static const struct wacom_features wacom_features_0xE6 =
        { "Wacom ISDv4 E6",       WACOM_PKGLEN_TPC2FG,    27760, 15694,  255,
          0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0xEC =
+       { "Wacom ISDv4 EC",       WACOM_PKGLEN_GRAPHIRE,  25710, 14500,  255,
+         0, TABLETPC,    WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 static const struct wacom_features wacom_features_0x47 =
        { "Wacom Intuos2 6x8",    WACOM_PKGLEN_INTUOS,    20320, 16240, 1023,
          31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1611,6 +1614,7 @@ const struct usb_device_id wacom_ids[] = {
        { USB_DEVICE_WACOM(0xE2) },
        { USB_DEVICE_WACOM(0xE3) },
        { USB_DEVICE_WACOM(0xE6) },
+       { USB_DEVICE_WACOM(0xEC) },
        { USB_DEVICE_WACOM(0x47) },
        { USB_DEVICE_LENOVO(0x6004) },
        { }
index a8b4d2aa18e510817a6e83409558078639dd862d..f437c3e6f3aaa9b5cf5b96df2d5128c6029dfac1 100644 (file)
@@ -741,7 +741,7 @@ static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        at91_mci_write(host, AT91_MCI_MR, (at91_mci_read(host, AT91_MCI_MR) & ~AT91_MCI_CLKDIV) | clkdiv);
 
        /* maybe switch power to the card */
-       if (host->board->vcc_pin) {
+       if (gpio_is_valid(host->board->vcc_pin)) {
                switch (ios->power_mode) {
                        case MMC_POWER_OFF:
                                gpio_set_value(host->board->vcc_pin, 0);
@@ -897,7 +897,7 @@ static int at91_mci_get_ro(struct mmc_host *mmc)
 {
        struct at91mci_host *host = mmc_priv(mmc);
 
-       if (host->board->wp_pin)
+       if (gpio_is_valid(host->board->wp_pin))
                return !!gpio_get_value(host->board->wp_pin);
        /*
         * Board doesn't support read only detection; let the mmc core
@@ -991,21 +991,21 @@ static int __init at91_mci_probe(struct platform_device *pdev)
         * Reserve GPIOs ... board init code makes sure these pins are set
         * up as GPIOs with the right direction (input, except for vcc)
         */
-       if (host->board->det_pin) {
+       if (gpio_is_valid(host->board->det_pin)) {
                ret = gpio_request(host->board->det_pin, "mmc_detect");
                if (ret < 0) {
                        dev_dbg(&pdev->dev, "couldn't claim card detect pin\n");
                        goto fail4b;
                }
        }
-       if (host->board->wp_pin) {
+       if (gpio_is_valid(host->board->wp_pin)) {
                ret = gpio_request(host->board->wp_pin, "mmc_wp");
                if (ret < 0) {
                        dev_dbg(&pdev->dev, "couldn't claim wp sense pin\n");
                        goto fail4;
                }
        }
-       if (host->board->vcc_pin) {
+       if (gpio_is_valid(host->board->vcc_pin)) {
                ret = gpio_request(host->board->vcc_pin, "mmc_vcc");
                if (ret < 0) {
                        dev_dbg(&pdev->dev, "couldn't claim vcc switch pin\n");
@@ -1057,7 +1057,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
        /*
         * Add host to MMC layer
         */
-       if (host->board->det_pin) {
+       if (gpio_is_valid(host->board->det_pin)) {
                host->present = !gpio_get_value(host->board->det_pin);
        }
        else
@@ -1068,7 +1068,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
        /*
         * monitor card insertion/removal if we can
         */
-       if (host->board->det_pin) {
+       if (gpio_is_valid(host->board->det_pin)) {
                ret = request_irq(gpio_to_irq(host->board->det_pin),
                                at91_mmc_det_irq, 0, mmc_hostname(mmc), host);
                if (ret)
@@ -1087,13 +1087,13 @@ fail0:
 fail1:
        clk_put(host->mci_clk);
 fail2:
-       if (host->board->vcc_pin)
+       if (gpio_is_valid(host->board->vcc_pin))
                gpio_free(host->board->vcc_pin);
 fail3:
-       if (host->board->wp_pin)
+       if (gpio_is_valid(host->board->wp_pin))
                gpio_free(host->board->wp_pin);
 fail4:
-       if (host->board->det_pin)
+       if (gpio_is_valid(host->board->det_pin))
                gpio_free(host->board->det_pin);
 fail4b:
        if (host->buffer)
@@ -1125,7 +1125,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
                dma_free_coherent(&pdev->dev, MCI_BUFSIZE,
                                host->buffer, host->physical_address);
 
-       if (host->board->det_pin) {
+       if (gpio_is_valid(host->board->det_pin)) {
                if (device_can_wakeup(&pdev->dev))
                        free_irq(gpio_to_irq(host->board->det_pin), host);
                device_init_wakeup(&pdev->dev, 0);
@@ -1140,9 +1140,9 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
        clk_disable(host->mci_clk);                     /* Disable the peripheral clock */
        clk_put(host->mci_clk);
 
-       if (host->board->vcc_pin)
+       if (gpio_is_valid(host->board->vcc_pin))
                gpio_free(host->board->vcc_pin);
-       if (host->board->wp_pin)
+       if (gpio_is_valid(host->board->wp_pin))
                gpio_free(host->board->wp_pin);
 
        iounmap(host->baseaddr);
@@ -1163,7 +1163,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
        struct at91mci_host *host = mmc_priv(mmc);
        int ret = 0;
 
-       if (host->board->det_pin && device_may_wakeup(&pdev->dev))
+       if (gpio_is_valid(host->board->det_pin) && device_may_wakeup(&pdev->dev))
                enable_irq_wake(host->board->det_pin);
 
        if (mmc)
@@ -1178,7 +1178,7 @@ static int at91_mci_resume(struct platform_device *pdev)
        struct at91mci_host *host = mmc_priv(mmc);
        int ret = 0;
 
-       if (host->board->det_pin && device_may_wakeup(&pdev->dev))
+       if (gpio_is_valid(host->board->det_pin) && device_may_wakeup(&pdev->dev))
                disable_irq_wake(host->board->det_pin);
 
        if (mmc)
index 3d00e722efc9cec34e9cbdd1807863326f58e828..7551468bfc9a168810d8e97556507c377971d53d 100644 (file)
@@ -435,14 +435,11 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 
        for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
                struct clk *clk;
-               char *name = pdata->clocks[ptr];
-
-               if (name == NULL)
-                       continue;
+               char name[14];
 
+               snprintf(name, 14, "mmc_busclk.%d", ptr);
                clk = clk_get(dev, name);
                if (IS_ERR(clk)) {
-                       dev_err(dev, "failed to get clock %s\n", name);
                        continue;
                }
 
index 23e5d77c39fcaf998f81125e51d22ccf1ce9b2d3..4dd056e2e16ac3e6798300e4b1cb13dde0948fb1 100644 (file)
@@ -113,7 +113,7 @@ static int cpu_has_dma(void)
  */
 static void atmel_nand_enable(struct atmel_nand_host *host)
 {
-       if (host->board->enable_pin)
+       if (gpio_is_valid(host->board->enable_pin))
                gpio_set_value(host->board->enable_pin, 0);
 }
 
@@ -122,7 +122,7 @@ static void atmel_nand_enable(struct atmel_nand_host *host)
  */
 static void atmel_nand_disable(struct atmel_nand_host *host)
 {
-       if (host->board->enable_pin)
+       if (gpio_is_valid(host->board->enable_pin))
                gpio_set_value(host->board->enable_pin, 1);
 }
 
@@ -492,7 +492,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
        nand_chip->IO_ADDR_W = host->io_base;
        nand_chip->cmd_ctrl = atmel_nand_cmd_ctrl;
 
-       if (host->board->rdy_pin)
+       if (gpio_is_valid(host->board->rdy_pin))
                nand_chip->dev_ready = atmel_nand_device_ready;
 
        regs = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -530,7 +530,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, host);
        atmel_nand_enable(host);
 
-       if (host->board->det_pin) {
+       if (gpio_is_valid(host->board->det_pin)) {
                if (gpio_get_value(host->board->det_pin)) {
                        printk(KERN_INFO "No SmartMedia card inserted.\n");
                        res = -ENXIO;
index 7cb2785e209dd0f52a70bfe9581aa267283b3cf8..c7e1df9910fa4df9cd3074b873a2ddba357cfb1c 100644 (file)
@@ -1132,7 +1132,6 @@ static irqreturn_t
 e100rxtx_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
-       struct net_local *np = netdev_priv(dev);
        unsigned long irqbits;
 
        /*
index be5dde040261b748e75535e4521cc5974f946b75..94b7f287d6c52a1a0031e32726478759800a10d5 100644 (file)
@@ -10,7 +10,7 @@ obj-$(CONFIG_NET_VENDOR_ALTEON) += alteon/
 obj-$(CONFIG_NET_VENDOR_AMD) += amd/
 obj-$(CONFIG_NET_VENDOR_APPLE) += apple/
 obj-$(CONFIG_NET_VENDOR_ATHEROS) += atheros/
-obj-$(CONFIG_NET_ATMEL) += cadence/
+obj-$(CONFIG_NET_CADENCE) += cadence/
 obj-$(CONFIG_NET_BFIN) += adi/
 obj-$(CONFIG_NET_VENDOR_BROADCOM) += broadcom/
 obj-$(CONFIG_NET_VENDOR_BROCADE) += brocade/
index b48378a41e492ce3df245214235c25b901a436c1..db931916da08c8ddfd26b9068a94b7dddd1bfb46 100644 (file)
@@ -5,8 +5,8 @@
 config HAVE_NET_MACB
        bool
 
-config NET_ATMEL
-       bool "Atmel devices"
+config NET_CADENCE
+       bool "Cadence devices"
        default y
        depends on HAVE_NET_MACB || (ARM && ARCH_AT91RM9200)
        ---help---
@@ -21,7 +21,7 @@ config NET_ATMEL
          the remaining Atmel network card questions. If you say Y, you will be
          asked for your specific card in the following questions.
 
-if NET_ATMEL
+if NET_CADENCE
 
 config ARM_AT91_ETHER
        tristate "AT91RM9200 Ethernet support"
@@ -33,14 +33,16 @@ config ARM_AT91_ETHER
          ethernet support, then you should always answer Y to this.
 
 config MACB
-       tristate "Atmel MACB support"
+       tristate "Cadence MACB/GEM support"
        depends on HAVE_NET_MACB
        select PHYLIB
        ---help---
-         The Atmel MACB ethernet interface is found on many AT32 and AT91
-         parts. Say Y to include support for the MACB chip.
+         The Cadence MACB ethernet interface is found on many Atmel AT32 and
+         AT91 parts.  This driver also supports the Cadence GEM (Gigabit
+         Ethernet MAC found in some ARM SoC devices).  Note: the Gigabit mode
+         is not yet supported.  Say Y to include support for the MACB/GEM chip.
 
          To compile this driver as a module, choose M here: the module
          will be called macb.
 
-endif # NET_ATMEL
+endif # NET_CADENCE
index 56624d3034871c4988ddd3e4963206133eaab517..dfeb46cb3f74aca61753789a697ae767bd9012b4 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/skbuff.h>
 #include <linux/dma-mapping.h>
 #include <linux/ethtool.h>
+#include <linux/platform_data/macb.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/gfp.h>
@@ -984,7 +985,7 @@ static const struct net_device_ops at91ether_netdev_ops = {
 static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address,
                        struct platform_device *pdev, struct clk *ether_clk)
 {
-       struct at91_eth_data *board_data = pdev->dev.platform_data;
+       struct macb_platform_data *board_data = pdev->dev.platform_data;
        struct net_device *dev;
        struct at91_private *lp;
        unsigned int val;
index 353f4dab62be492b0310ec497a1b8481d9bb63ea..3725fbb0defe541e3f1428015093797617491280 100644 (file)
@@ -85,7 +85,9 @@ struct recv_desc_bufs
 struct at91_private
 {
        struct mii_if_info mii;                 /* ethtool support */
-       struct at91_eth_data board_data;        /* board-specific configuration */
+       struct macb_platform_data board_data;   /* board-specific
+                                                * configuration (shared with
+                                                * macb for common data */
        struct clk *ether_clk;                  /* clock */
 
        /* PHY */
index a437b46e5490f8770707a5e4373c1bb4c9302fca..64d61461bdc78b65cac6d8995475909fbdd0bd98 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Atmel MACB Ethernet Controller driver
+ * Cadence MACB/GEM Ethernet Controller driver
  *
  * Copyright (C) 2004-2006 Atmel Corporation
  *
@@ -8,6 +8,7 @@
  * published by the Free Software Foundation.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/clk.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/dma-mapping.h>
+#include <linux/platform_data/macb.h>
 #include <linux/platform_device.h>
 #include <linux/phy.h>
 
-#include <mach/board.h>
-#include <mach/cpu.h>
-
 #include "macb.h"
 
 #define RX_BUFFER_SIZE         128
@@ -60,9 +59,9 @@ static void __macb_set_hwaddr(struct macb *bp)
        u16 top;
 
        bottom = cpu_to_le32(*((u32 *)bp->dev->dev_addr));
-       macb_writel(bp, SA1B, bottom);
+       macb_or_gem_writel(bp, SA1B, bottom);
        top = cpu_to_le16(*((u16 *)(bp->dev->dev_addr + 4)));
-       macb_writel(bp, SA1T, top);
+       macb_or_gem_writel(bp, SA1T, top);
 }
 
 static void __init macb_get_hwaddr(struct macb *bp)
@@ -71,8 +70,8 @@ static void __init macb_get_hwaddr(struct macb *bp)
        u16 top;
        u8 addr[6];
 
-       bottom = macb_readl(bp, SA1B);
-       top = macb_readl(bp, SA1T);
+       bottom = macb_or_gem_readl(bp, SA1B);
+       top = macb_or_gem_readl(bp, SA1T);
 
        addr[0] = bottom & 0xff;
        addr[1] = (bottom >> 8) & 0xff;
@@ -84,7 +83,7 @@ static void __init macb_get_hwaddr(struct macb *bp)
        if (is_valid_ether_addr(addr)) {
                memcpy(bp->dev->dev_addr, addr, sizeof(addr));
        } else {
-               dev_info(&bp->pdev->dev, "invalid hw address, using random\n");
+               netdev_info(bp->dev, "invalid hw address, using random\n");
                random_ether_addr(bp->dev->dev_addr);
        }
 }
@@ -178,11 +177,12 @@ static void macb_handle_link_change(struct net_device *dev)
 
        if (status_change) {
                if (phydev->link)
-                       printk(KERN_INFO "%s: link up (%d/%s)\n",
-                              dev->name, phydev->speed,
-                              DUPLEX_FULL == phydev->duplex ? "Full":"Half");
+                       netdev_info(dev, "link up (%d/%s)\n",
+                                   phydev->speed,
+                                   phydev->duplex == DUPLEX_FULL ?
+                                   "Full" : "Half");
                else
-                       printk(KERN_INFO "%s: link down\n", dev->name);
+                       netdev_info(dev, "link down\n");
        }
 }
 
@@ -191,12 +191,12 @@ static int macb_mii_probe(struct net_device *dev)
 {
        struct macb *bp = netdev_priv(dev);
        struct phy_device *phydev;
-       struct eth_platform_data *pdata;
+       struct macb_platform_data *pdata;
        int ret;
 
        phydev = phy_find_first(bp->mii_bus);
        if (!phydev) {
-               printk (KERN_ERR "%s: no PHY found\n", dev->name);
+               netdev_err(dev, "no PHY found\n");
                return -1;
        }
 
@@ -209,7 +209,7 @@ static int macb_mii_probe(struct net_device *dev)
                                 PHY_INTERFACE_MODE_RMII :
                                 PHY_INTERFACE_MODE_MII);
        if (ret) {
-               printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
+               netdev_err(dev, "Could not attach to PHY\n");
                return ret;
        }
 
@@ -228,7 +228,7 @@ static int macb_mii_probe(struct net_device *dev)
 
 static int macb_mii_init(struct macb *bp)
 {
-       struct eth_platform_data *pdata;
+       struct macb_platform_data *pdata;
        int err = -ENXIO, i;
 
        /* Enable management port */
@@ -285,8 +285,8 @@ err_out:
 static void macb_update_stats(struct macb *bp)
 {
        u32 __iomem *reg = bp->regs + MACB_PFR;
-       u32 *p = &bp->hw_stats.rx_pause_frames;
-       u32 *end = &bp->hw_stats.tx_pause_frames + 1;
+       u32 *p = &bp->hw_stats.macb.rx_pause_frames;
+       u32 *end = &bp->hw_stats.macb.tx_pause_frames + 1;
 
        WARN_ON((unsigned long)(end - p - 1) != (MACB_TPF - MACB_PFR) / 4);
 
@@ -303,14 +303,13 @@ static void macb_tx(struct macb *bp)
        status = macb_readl(bp, TSR);
        macb_writel(bp, TSR, status);
 
-       dev_dbg(&bp->pdev->dev, "macb_tx status = %02lx\n",
-               (unsigned long)status);
+       netdev_dbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status);
 
        if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) {
                int i;
-               printk(KERN_ERR "%s: TX %s, resetting buffers\n",
-                       bp->dev->name, status & MACB_BIT(UND) ?
-                       "underrun" : "retry limit exceeded");
+               netdev_err(bp->dev, "TX %s, resetting buffers\n",
+                          status & MACB_BIT(UND) ?
+                          "underrun" : "retry limit exceeded");
 
                /* Transfer ongoing, disable transmitter, to avoid confusion */
                if (status & MACB_BIT(TGO))
@@ -369,8 +368,8 @@ static void macb_tx(struct macb *bp)
                if (!(bufstat & MACB_BIT(TX_USED)))
                        break;
 
-               dev_dbg(&bp->pdev->dev, "skb %u (data %p) TX complete\n",
-                       tail, skb->data);
+               netdev_dbg(bp->dev, "skb %u (data %p) TX complete\n",
+                          tail, skb->data);
                dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len,
                                 DMA_TO_DEVICE);
                bp->stats.tx_packets++;
@@ -395,8 +394,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
 
        len = MACB_BFEXT(RX_FRMLEN, bp->rx_ring[last_frag].ctrl);
 
-       dev_dbg(&bp->pdev->dev, "macb_rx_frame frags %u - %u (len %u)\n",
-               first_frag, last_frag, len);
+       netdev_dbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n",
+                  first_frag, last_frag, len);
 
        skb = dev_alloc_skb(len + RX_OFFSET);
        if (!skb) {
@@ -437,8 +436,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
 
        bp->stats.rx_packets++;
        bp->stats.rx_bytes += len;
-       dev_dbg(&bp->pdev->dev, "received skb of length %u, csum: %08x\n",
-               skb->len, skb->csum);
+       netdev_dbg(bp->dev, "received skb of length %u, csum: %08x\n",
+                  skb->len, skb->csum);
        netif_receive_skb(skb);
 
        return 0;
@@ -515,8 +514,8 @@ static int macb_poll(struct napi_struct *napi, int budget)
 
        work_done = 0;
 
-       dev_dbg(&bp->pdev->dev, "poll: status = %08lx, budget = %d\n",
-               (unsigned long)status, budget);
+       netdev_dbg(bp->dev, "poll: status = %08lx, budget = %d\n",
+                  (unsigned long)status, budget);
 
        work_done = macb_rx(bp, budget);
        if (work_done < budget) {
@@ -565,8 +564,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
                        macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
 
                        if (napi_schedule_prep(&bp->napi)) {
-                               dev_dbg(&bp->pdev->dev,
-                                       "scheduling RX softirq\n");
+                               netdev_dbg(bp->dev, "scheduling RX softirq\n");
                                __napi_schedule(&bp->napi);
                        }
                }
@@ -582,16 +580,19 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
 
                if (status & MACB_BIT(ISR_ROVR)) {
                        /* We missed at least one packet */
-                       bp->hw_stats.rx_overruns++;
+                       if (macb_is_gem(bp))
+                               bp->hw_stats.gem.rx_overruns++;
+                       else
+                               bp->hw_stats.macb.rx_overruns++;
                }
 
                if (status & MACB_BIT(HRESP)) {
                        /*
-                        * TODO: Reset the hardware, and maybe move the printk
-                        * to a lower-priority context as well (work queue?)
+                        * TODO: Reset the hardware, and maybe move the
+                        * netdev_err to a lower-priority context as well
+                        * (work queue?)
                         */
-                       printk(KERN_ERR "%s: DMA bus error: HRESP not OK\n",
-                              dev->name);
+                       netdev_err(dev, "DMA bus error: HRESP not OK\n");
                }
 
                status = macb_readl(bp, ISR);
@@ -626,16 +627,12 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
        unsigned long flags;
 
 #ifdef DEBUG
-       int i;
-       dev_dbg(&bp->pdev->dev,
-               "start_xmit: len %u head %p data %p tail %p end %p\n",
-               skb->len, skb->head, skb->data,
-               skb_tail_pointer(skb), skb_end_pointer(skb));
-       dev_dbg(&bp->pdev->dev,
-               "data:");
-       for (i = 0; i < 16; i++)
-               printk(" %02x", (unsigned int)skb->data[i]);
-       printk("\n");
+       netdev_dbg(bp->dev,
+                  "start_xmit: len %u head %p data %p tail %p end %p\n",
+                  skb->len, skb->head, skb->data,
+                  skb_tail_pointer(skb), skb_end_pointer(skb));
+       print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_OFFSET, 16, 1,
+                      skb->data, 16, true);
 #endif
 
        len = skb->len;
@@ -645,21 +642,20 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (TX_BUFFS_AVAIL(bp) < 1) {
                netif_stop_queue(dev);
                spin_unlock_irqrestore(&bp->lock, flags);
-               dev_err(&bp->pdev->dev,
-                       "BUG! Tx Ring full when queue awake!\n");
-               dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n",
-                       bp->tx_head, bp->tx_tail);
+               netdev_err(bp->dev, "BUG! Tx Ring full when queue awake!\n");
+               netdev_dbg(bp->dev, "tx_head = %u, tx_tail = %u\n",
+                          bp->tx_head, bp->tx_tail);
                return NETDEV_TX_BUSY;
        }
 
        entry = bp->tx_head;
-       dev_dbg(&bp->pdev->dev, "Allocated ring entry %u\n", entry);
+       netdev_dbg(bp->dev, "Allocated ring entry %u\n", entry);
        mapping = dma_map_single(&bp->pdev->dev, skb->data,
                                 len, DMA_TO_DEVICE);
        bp->tx_skb[entry].skb = skb;
        bp->tx_skb[entry].mapping = mapping;
-       dev_dbg(&bp->pdev->dev, "Mapped skb data %p to DMA addr %08lx\n",
-               skb->data, (unsigned long)mapping);
+       netdev_dbg(bp->dev, "Mapped skb data %p to DMA addr %08lx\n",
+                  skb->data, (unsigned long)mapping);
 
        ctrl = MACB_BF(TX_FRMLEN, len);
        ctrl |= MACB_BIT(TX_LAST);
@@ -723,27 +719,27 @@ static int macb_alloc_consistent(struct macb *bp)
                                         &bp->rx_ring_dma, GFP_KERNEL);
        if (!bp->rx_ring)
                goto out_err;
-       dev_dbg(&bp->pdev->dev,
-               "Allocated RX ring of %d bytes at %08lx (mapped %p)\n",
-               size, (unsigned long)bp->rx_ring_dma, bp->rx_ring);
+       netdev_dbg(bp->dev,
+                  "Allocated RX ring of %d bytes at %08lx (mapped %p)\n",
+                  size, (unsigned long)bp->rx_ring_dma, bp->rx_ring);
 
        size = TX_RING_BYTES;
        bp->tx_ring = dma_alloc_coherent(&bp->pdev->dev, size,
                                         &bp->tx_ring_dma, GFP_KERNEL);
        if (!bp->tx_ring)
                goto out_err;
-       dev_dbg(&bp->pdev->dev,
-               "Allocated TX ring of %d bytes at %08lx (mapped %p)\n",
-               size, (unsigned long)bp->tx_ring_dma, bp->tx_ring);
+       netdev_dbg(bp->dev,
+                  "Allocated TX ring of %d bytes at %08lx (mapped %p)\n",
+                  size, (unsigned long)bp->tx_ring_dma, bp->tx_ring);
 
        size = RX_RING_SIZE * RX_BUFFER_SIZE;
        bp->rx_buffers = dma_alloc_coherent(&bp->pdev->dev, size,
                                            &bp->rx_buffers_dma, GFP_KERNEL);
        if (!bp->rx_buffers)
                goto out_err;
-       dev_dbg(&bp->pdev->dev,
-               "Allocated RX buffers of %d bytes at %08lx (mapped %p)\n",
-               size, (unsigned long)bp->rx_buffers_dma, bp->rx_buffers);
+       netdev_dbg(bp->dev,
+                  "Allocated RX buffers of %d bytes at %08lx (mapped %p)\n",
+                  size, (unsigned long)bp->rx_buffers_dma, bp->rx_buffers);
 
        return 0;
 
@@ -797,6 +793,84 @@ static void macb_reset_hw(struct macb *bp)
        macb_readl(bp, ISR);
 }
 
+static u32 gem_mdc_clk_div(struct macb *bp)
+{
+       u32 config;
+       unsigned long pclk_hz = clk_get_rate(bp->pclk);
+
+       if (pclk_hz <= 20000000)
+               config = GEM_BF(CLK, GEM_CLK_DIV8);
+       else if (pclk_hz <= 40000000)
+               config = GEM_BF(CLK, GEM_CLK_DIV16);
+       else if (pclk_hz <= 80000000)
+               config = GEM_BF(CLK, GEM_CLK_DIV32);
+       else if (pclk_hz <= 120000000)
+               config = GEM_BF(CLK, GEM_CLK_DIV48);
+       else if (pclk_hz <= 160000000)
+               config = GEM_BF(CLK, GEM_CLK_DIV64);
+       else
+               config = GEM_BF(CLK, GEM_CLK_DIV96);
+
+       return config;
+}
+
+static u32 macb_mdc_clk_div(struct macb *bp)
+{
+       u32 config;
+       unsigned long pclk_hz;
+
+       if (macb_is_gem(bp))
+               return gem_mdc_clk_div(bp);
+
+       pclk_hz = clk_get_rate(bp->pclk);
+       if (pclk_hz <= 20000000)
+               config = MACB_BF(CLK, MACB_CLK_DIV8);
+       else if (pclk_hz <= 40000000)
+               config = MACB_BF(CLK, MACB_CLK_DIV16);
+       else if (pclk_hz <= 80000000)
+               config = MACB_BF(CLK, MACB_CLK_DIV32);
+       else
+               config = MACB_BF(CLK, MACB_CLK_DIV64);
+
+       return config;
+}
+
+/*
+ * Get the DMA bus width field of the network configuration register that we
+ * should program.  We find the width from decoding the design configuration
+ * register to find the maximum supported data bus width.
+ */
+static u32 macb_dbw(struct macb *bp)
+{
+       if (!macb_is_gem(bp))
+               return 0;
+
+       switch (GEM_BFEXT(DBWDEF, gem_readl(bp, DCFG1))) {
+       case 4:
+               return GEM_BF(DBW, GEM_DBW128);
+       case 2:
+               return GEM_BF(DBW, GEM_DBW64);
+       case 1:
+       default:
+               return GEM_BF(DBW, GEM_DBW32);
+       }
+}
+
+/*
+ * Configure the receive DMA engine to use the correct receive buffer size.
+ * This is a configurable parameter for GEM.
+ */
+static void macb_configure_dma(struct macb *bp)
+{
+       u32 dmacfg;
+
+       if (macb_is_gem(bp)) {
+               dmacfg = gem_readl(bp, DMACFG) & ~GEM_BF(RXBS, -1L);
+               dmacfg |= GEM_BF(RXBS, RX_BUFFER_SIZE / 64);
+               gem_writel(bp, DMACFG, dmacfg);
+       }
+}
+
 static void macb_init_hw(struct macb *bp)
 {
        u32 config;
@@ -804,7 +878,7 @@ static void macb_init_hw(struct macb *bp)
        macb_reset_hw(bp);
        __macb_set_hwaddr(bp);
 
-       config = macb_readl(bp, NCFGR) & MACB_BF(CLK, -1L);
+       config = macb_mdc_clk_div(bp);
        config |= MACB_BIT(PAE);                /* PAuse Enable */
        config |= MACB_BIT(DRFCS);              /* Discard Rx FCS */
        config |= MACB_BIT(BIG);                /* Receive oversized frames */
@@ -812,8 +886,11 @@ static void macb_init_hw(struct macb *bp)
                config |= MACB_BIT(CAF);        /* Copy All Frames */
        if (!(bp->dev->flags & IFF_BROADCAST))
                config |= MACB_BIT(NBC);        /* No BroadCast */
+       config |= macb_dbw(bp);
        macb_writel(bp, NCFGR, config);
 
+       macb_configure_dma(bp);
+
        /* Initialize TX and RX buffers */
        macb_writel(bp, RBQP, bp->rx_ring_dma);
        macb_writel(bp, TBQP, bp->tx_ring_dma);
@@ -909,8 +986,8 @@ static void macb_sethashtable(struct net_device *dev)
                mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
        }
 
-       macb_writel(bp, HRB, mc_filter[0]);
-       macb_writel(bp, HRT, mc_filter[1]);
+       macb_or_gem_writel(bp, HRB, mc_filter[0]);
+       macb_or_gem_writel(bp, HRT, mc_filter[1]);
 }
 
 /*
@@ -932,8 +1009,8 @@ static void macb_set_rx_mode(struct net_device *dev)
 
        if (dev->flags & IFF_ALLMULTI) {
                /* Enable all multicast mode */
-               macb_writel(bp, HRB, -1);
-               macb_writel(bp, HRT, -1);
+               macb_or_gem_writel(bp, HRB, -1);
+               macb_or_gem_writel(bp, HRT, -1);
                cfg |= MACB_BIT(NCFGR_MTI);
        } else if (!netdev_mc_empty(dev)) {
                /* Enable specific multicasts */
@@ -941,8 +1018,8 @@ static void macb_set_rx_mode(struct net_device *dev)
                cfg |= MACB_BIT(NCFGR_MTI);
        } else if (dev->flags & (~IFF_ALLMULTI)) {
                /* Disable all multicast mode */
-               macb_writel(bp, HRB, 0);
-               macb_writel(bp, HRT, 0);
+               macb_or_gem_writel(bp, HRB, 0);
+               macb_or_gem_writel(bp, HRT, 0);
                cfg &= ~MACB_BIT(NCFGR_MTI);
        }
 
@@ -954,7 +1031,7 @@ static int macb_open(struct net_device *dev)
        struct macb *bp = netdev_priv(dev);
        int err;
 
-       dev_dbg(&bp->pdev->dev, "open\n");
+       netdev_dbg(bp->dev, "open\n");
 
        /* if the phy is not yet register, retry later*/
        if (!bp->phy_dev)
@@ -965,9 +1042,8 @@ static int macb_open(struct net_device *dev)
 
        err = macb_alloc_consistent(bp);
        if (err) {
-               printk(KERN_ERR
-                      "%s: Unable to allocate DMA memory (error %d)\n",
-                      dev->name, err);
+               netdev_err(dev, "Unable to allocate DMA memory (error %d)\n",
+                          err);
                return err;
        }
 
@@ -1005,11 +1081,62 @@ static int macb_close(struct net_device *dev)
        return 0;
 }
 
+static void gem_update_stats(struct macb *bp)
+{
+       u32 __iomem *reg = bp->regs + GEM_OTX;
+       u32 *p = &bp->hw_stats.gem.tx_octets_31_0;
+       u32 *end = &bp->hw_stats.gem.rx_udp_checksum_errors + 1;
+
+       for (; p < end; p++, reg++)
+               *p += __raw_readl(reg);
+}
+
+static struct net_device_stats *gem_get_stats(struct macb *bp)
+{
+       struct gem_stats *hwstat = &bp->hw_stats.gem;
+       struct net_device_stats *nstat = &bp->stats;
+
+       gem_update_stats(bp);
+
+       nstat->rx_errors = (hwstat->rx_frame_check_sequence_errors +
+                           hwstat->rx_alignment_errors +
+                           hwstat->rx_resource_errors +
+                           hwstat->rx_overruns +
+                           hwstat->rx_oversize_frames +
+                           hwstat->rx_jabbers +
+                           hwstat->rx_undersized_frames +
+                           hwstat->rx_length_field_frame_errors);
+       nstat->tx_errors = (hwstat->tx_late_collisions +
+                           hwstat->tx_excessive_collisions +
+                           hwstat->tx_underrun +
+                           hwstat->tx_carrier_sense_errors);
+       nstat->multicast = hwstat->rx_multicast_frames;
+       nstat->collisions = (hwstat->tx_single_collision_frames +
+                            hwstat->tx_multiple_collision_frames +
+                            hwstat->tx_excessive_collisions);
+       nstat->rx_length_errors = (hwstat->rx_oversize_frames +
+                                  hwstat->rx_jabbers +
+                                  hwstat->rx_undersized_frames +
+                                  hwstat->rx_length_field_frame_errors);
+       nstat->rx_over_errors = hwstat->rx_resource_errors;
+       nstat->rx_crc_errors = hwstat->rx_frame_check_sequence_errors;
+       nstat->rx_frame_errors = hwstat->rx_alignment_errors;
+       nstat->rx_fifo_errors = hwstat->rx_overruns;
+       nstat->tx_aborted_errors = hwstat->tx_excessive_collisions;
+       nstat->tx_carrier_errors = hwstat->tx_carrier_sense_errors;
+       nstat->tx_fifo_errors = hwstat->tx_underrun;
+
+       return nstat;
+}
+
 static struct net_device_stats *macb_get_stats(struct net_device *dev)
 {
        struct macb *bp = netdev_priv(dev);
        struct net_device_stats *nstat = &bp->stats;
-       struct macb_stats *hwstat = &bp->hw_stats;
+       struct macb_stats *hwstat = &bp->hw_stats.macb;
+
+       if (macb_is_gem(bp))
+               return gem_get_stats(bp);
 
        /* read stats from hardware */
        macb_update_stats(bp);
@@ -1119,12 +1246,11 @@ static const struct net_device_ops macb_netdev_ops = {
 
 static int __init macb_probe(struct platform_device *pdev)
 {
-       struct eth_platform_data *pdata;
+       struct macb_platform_data *pdata;
        struct resource *regs;
        struct net_device *dev;
        struct macb *bp;
        struct phy_device *phydev;
-       unsigned long pclk_hz;
        u32 config;
        int err = -ENXIO;
 
@@ -1152,28 +1278,19 @@ static int __init macb_probe(struct platform_device *pdev)
 
        spin_lock_init(&bp->lock);
 
-#if defined(CONFIG_ARCH_AT91)
-       bp->pclk = clk_get(&pdev->dev, "macb_clk");
+       bp->pclk = clk_get(&pdev->dev, "pclk");
        if (IS_ERR(bp->pclk)) {
                dev_err(&pdev->dev, "failed to get macb_clk\n");
                goto err_out_free_dev;
        }
        clk_enable(bp->pclk);
-#else
-       bp->pclk = clk_get(&pdev->dev, "pclk");
-       if (IS_ERR(bp->pclk)) {
-               dev_err(&pdev->dev, "failed to get pclk\n");
-               goto err_out_free_dev;
-       }
+
        bp->hclk = clk_get(&pdev->dev, "hclk");
        if (IS_ERR(bp->hclk)) {
                dev_err(&pdev->dev, "failed to get hclk\n");
                goto err_out_put_pclk;
        }
-
-       clk_enable(bp->pclk);
        clk_enable(bp->hclk);
-#endif
 
        bp->regs = ioremap(regs->start, resource_size(regs));
        if (!bp->regs) {
@@ -1185,9 +1302,8 @@ static int __init macb_probe(struct platform_device *pdev)
        dev->irq = platform_get_irq(pdev, 0);
        err = request_irq(dev->irq, macb_interrupt, 0, dev->name, dev);
        if (err) {
-               printk(KERN_ERR
-                      "%s: Unable to request IRQ %d (error %d)\n",
-                      dev->name, dev->irq, err);
+               dev_err(&pdev->dev, "Unable to request IRQ %d (error %d)\n",
+                       dev->irq, err);
                goto err_out_iounmap;
        }
 
@@ -1198,15 +1314,8 @@ static int __init macb_probe(struct platform_device *pdev)
        dev->base_addr = regs->start;
 
        /* Set MII management clock divider */
-       pclk_hz = clk_get_rate(bp->pclk);
-       if (pclk_hz <= 20000000)
-               config = MACB_BF(CLK, MACB_CLK_DIV8);
-       else if (pclk_hz <= 40000000)
-               config = MACB_BF(CLK, MACB_CLK_DIV16);
-       else if (pclk_hz <= 80000000)
-               config = MACB_BF(CLK, MACB_CLK_DIV32);
-       else
-               config = MACB_BF(CLK, MACB_CLK_DIV64);
+       config = macb_mdc_clk_div(bp);
+       config |= macb_dbw(bp);
        macb_writel(bp, NCFGR, config);
 
        macb_get_hwaddr(bp);
@@ -1214,15 +1323,16 @@ static int __init macb_probe(struct platform_device *pdev)
 
        if (pdata && pdata->is_rmii)
 #if defined(CONFIG_ARCH_AT91)
-               macb_writel(bp, USRIO, (MACB_BIT(RMII) | MACB_BIT(CLKEN)) );
+               macb_or_gem_writel(bp, USRIO, (MACB_BIT(RMII) |
+                                              MACB_BIT(CLKEN)));
 #else
-               macb_writel(bp, USRIO, 0);
+               macb_or_gem_writel(bp, USRIO, 0);
 #endif
        else
 #if defined(CONFIG_ARCH_AT91)
-               macb_writel(bp, USRIO, MACB_BIT(CLKEN));
+               macb_or_gem_writel(bp, USRIO, MACB_BIT(CLKEN));
 #else
-               macb_writel(bp, USRIO, MACB_BIT(MII));
+               macb_or_gem_writel(bp, USRIO, MACB_BIT(MII));
 #endif
 
        bp->tx_pending = DEF_TX_RING_PENDING;
@@ -1239,13 +1349,13 @@ static int __init macb_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, dev);
 
-       printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d (%pM)\n",
-              dev->name, dev->base_addr, dev->irq, dev->dev_addr);
+       netdev_info(dev, "Cadence %s at 0x%08lx irq %d (%pM)\n",
+                   macb_is_gem(bp) ? "GEM" : "MACB", dev->base_addr,
+                   dev->irq, dev->dev_addr);
 
        phydev = bp->phy_dev;
-       printk(KERN_INFO "%s: attached PHY driver [%s] "
-               "(mii_bus:phy_addr=%s, irq=%d)\n", dev->name,
-               phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
+       netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
+                   phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
 
        return 0;
 
@@ -1256,14 +1366,10 @@ err_out_free_irq:
 err_out_iounmap:
        iounmap(bp->regs);
 err_out_disable_clocks:
-#ifndef CONFIG_ARCH_AT91
        clk_disable(bp->hclk);
        clk_put(bp->hclk);
-#endif
        clk_disable(bp->pclk);
-#ifndef CONFIG_ARCH_AT91
 err_out_put_pclk:
-#endif
        clk_put(bp->pclk);
 err_out_free_dev:
        free_netdev(dev);
@@ -1289,10 +1395,8 @@ static int __exit macb_remove(struct platform_device *pdev)
                unregister_netdev(dev);
                free_irq(dev->irq, dev);
                iounmap(bp->regs);
-#ifndef CONFIG_ARCH_AT91
                clk_disable(bp->hclk);
                clk_put(bp->hclk);
-#endif
                clk_disable(bp->pclk);
                clk_put(bp->pclk);
                free_netdev(dev);
@@ -1310,9 +1414,7 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state)
 
        netif_device_detach(netdev);
 
-#ifndef CONFIG_ARCH_AT91
        clk_disable(bp->hclk);
-#endif
        clk_disable(bp->pclk);
 
        return 0;
@@ -1324,9 +1426,7 @@ static int macb_resume(struct platform_device *pdev)
        struct macb *bp = netdev_priv(netdev);
 
        clk_enable(bp->pclk);
-#ifndef CONFIG_ARCH_AT91
        clk_enable(bp->hclk);
-#endif
 
        netif_device_attach(netdev);
 
@@ -1361,6 +1461,6 @@ module_init(macb_init);
 module_exit(macb_exit);
 
 MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Atmel MACB Ethernet driver");
+MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");
 MODULE_AUTHOR("Haavard Skinnemoen (Atmel)");
 MODULE_ALIAS("platform:macb");
index d3212f6db70325a53917b380e4f4ab05f8abd9b4..193107884a5af4c2e2d7eb1a787d557f5fb2aa67 100644 (file)
 #define MACB_TPQ                               0x00bc
 #define MACB_USRIO                             0x00c0
 #define MACB_WOL                               0x00c4
+#define MACB_MID                               0x00fc
+
+/* GEM register offsets. */
+#define GEM_NCFGR                              0x0004
+#define GEM_USRIO                              0x000c
+#define GEM_DMACFG                             0x0010
+#define GEM_HRB                                        0x0080
+#define GEM_HRT                                        0x0084
+#define GEM_SA1B                               0x0088
+#define GEM_SA1T                               0x008C
+#define GEM_OTX                                        0x0100
+#define GEM_DCFG1                              0x0280
+#define GEM_DCFG2                              0x0284
+#define GEM_DCFG3                              0x0288
+#define GEM_DCFG4                              0x028c
+#define GEM_DCFG5                              0x0290
+#define GEM_DCFG6                              0x0294
+#define GEM_DCFG7                              0x0298
 
 /* Bitfields in NCR */
 #define MACB_LB_OFFSET                         0
 #define MACB_IRXFCS_OFFSET                     19
 #define MACB_IRXFCS_SIZE                       1
 
+/* GEM specific NCFGR bitfields. */
+#define GEM_CLK_OFFSET                         18
+#define GEM_CLK_SIZE                           3
+#define GEM_DBW_OFFSET                         21
+#define GEM_DBW_SIZE                           2
+
+/* Constants for data bus width. */
+#define GEM_DBW32                              0
+#define GEM_DBW64                              1
+#define GEM_DBW128                             2
+
+/* Bitfields in DMACFG. */
+#define GEM_RXBS_OFFSET                                16
+#define GEM_RXBS_SIZE                          8
+
 /* Bitfields in NSR */
 #define MACB_NSR_LINK_OFFSET                   0
 #define MACB_NSR_LINK_SIZE                     1
 #define MACB_WOL_MTI_OFFSET                    19
 #define MACB_WOL_MTI_SIZE                      1
 
+/* Bitfields in MID */
+#define MACB_IDNUM_OFFSET                      16
+#define MACB_IDNUM_SIZE                                16
+#define MACB_REV_OFFSET                                0
+#define MACB_REV_SIZE                          16
+
+/* Bitfields in DCFG1. */
+#define GEM_DBWDEF_OFFSET                      25
+#define GEM_DBWDEF_SIZE                                3
+
 /* Constants for CLK */
 #define MACB_CLK_DIV8                          0
 #define MACB_CLK_DIV16                         1
 #define MACB_CLK_DIV32                         2
 #define MACB_CLK_DIV64                         3
 
+/* GEM specific constants for CLK. */
+#define GEM_CLK_DIV8                           0
+#define GEM_CLK_DIV16                          1
+#define GEM_CLK_DIV32                          2
+#define GEM_CLK_DIV48                          3
+#define GEM_CLK_DIV64                          4
+#define GEM_CLK_DIV96                          5
+
 /* Constants for MAN register */
 #define MACB_MAN_SOF                           1
 #define MACB_MAN_WRITE                         1
                    << MACB_##name##_OFFSET))           \
         | MACB_BF(name,value))
 
+#define GEM_BIT(name)                                  \
+       (1 << GEM_##name##_OFFSET)
+#define GEM_BF(name, value)                            \
+       (((value) & ((1 << GEM_##name##_SIZE) - 1))     \
+        << GEM_##name##_OFFSET)
+#define GEM_BFEXT(name, value)\
+       (((value) >> GEM_##name##_OFFSET)               \
+        & ((1 << GEM_##name##_SIZE) - 1))
+#define GEM_BFINS(name, value, old)                    \
+       (((old) & ~(((1 << GEM_##name##_SIZE) - 1)      \
+                   << GEM_##name##_OFFSET))            \
+        | GEM_BF(name, value))
+
 /* Register access macros */
 #define macb_readl(port,reg)                           \
        __raw_readl((port)->regs + MACB_##reg)
 #define macb_writel(port,reg,value)                    \
        __raw_writel((value), (port)->regs + MACB_##reg)
+#define gem_readl(port, reg)                           \
+       __raw_readl((port)->regs + GEM_##reg)
+#define gem_writel(port, reg, value)                   \
+       __raw_writel((value), (port)->regs + GEM_##reg)
+
+/*
+ * Conditional GEM/MACB macros.  These perform the operation to the correct
+ * register dependent on whether the device is a GEM or a MACB.  For registers
+ * and bitfields that are common across both devices, use macb_{read,write}l
+ * to avoid the cost of the conditional.
+ */
+#define macb_or_gem_writel(__bp, __reg, __value) \
+       ({ \
+               if (macb_is_gem((__bp))) \
+                       gem_writel((__bp), __reg, __value); \
+               else \
+                       macb_writel((__bp), __reg, __value); \
+       })
+
+#define macb_or_gem_readl(__bp, __reg) \
+       ({ \
+               u32 __v; \
+               if (macb_is_gem((__bp))) \
+                       __v = gem_readl((__bp), __reg); \
+               else \
+                       __v = macb_readl((__bp), __reg); \
+               __v; \
+       })
 
 struct dma_desc {
        u32     addr;
@@ -358,6 +450,54 @@ struct macb_stats {
        u32     tx_pause_frames;
 };
 
+struct gem_stats {
+       u32     tx_octets_31_0;
+       u32     tx_octets_47_32;
+       u32     tx_frames;
+       u32     tx_broadcast_frames;
+       u32     tx_multicast_frames;
+       u32     tx_pause_frames;
+       u32     tx_64_byte_frames;
+       u32     tx_65_127_byte_frames;
+       u32     tx_128_255_byte_frames;
+       u32     tx_256_511_byte_frames;
+       u32     tx_512_1023_byte_frames;
+       u32     tx_1024_1518_byte_frames;
+       u32     tx_greater_than_1518_byte_frames;
+       u32     tx_underrun;
+       u32     tx_single_collision_frames;
+       u32     tx_multiple_collision_frames;
+       u32     tx_excessive_collisions;
+       u32     tx_late_collisions;
+       u32     tx_deferred_frames;
+       u32     tx_carrier_sense_errors;
+       u32     rx_octets_31_0;
+       u32     rx_octets_47_32;
+       u32     rx_frames;
+       u32     rx_broadcast_frames;
+       u32     rx_multicast_frames;
+       u32     rx_pause_frames;
+       u32     rx_64_byte_frames;
+       u32     rx_65_127_byte_frames;
+       u32     rx_128_255_byte_frames;
+       u32     rx_256_511_byte_frames;
+       u32     rx_512_1023_byte_frames;
+       u32     rx_1024_1518_byte_frames;
+       u32     rx_greater_than_1518_byte_frames;
+       u32     rx_undersized_frames;
+       u32     rx_oversize_frames;
+       u32     rx_jabbers;
+       u32     rx_frame_check_sequence_errors;
+       u32     rx_length_field_frame_errors;
+       u32     rx_symbol_errors;
+       u32     rx_alignment_errors;
+       u32     rx_resource_errors;
+       u32     rx_overruns;
+       u32     rx_ip_header_checksum_errors;
+       u32     rx_tcp_checksum_errors;
+       u32     rx_udp_checksum_errors;
+};
+
 struct macb {
        void __iomem            *regs;
 
@@ -376,7 +516,10 @@ struct macb {
        struct net_device       *dev;
        struct napi_struct      napi;
        struct net_device_stats stats;
-       struct macb_stats       hw_stats;
+       union {
+               struct macb_stats       macb;
+               struct gem_stats        gem;
+       }                       hw_stats;
 
        dma_addr_t              rx_ring_dma;
        dma_addr_t              tx_ring_dma;
@@ -391,4 +534,9 @@ struct macb {
        unsigned int            duplex;
 };
 
+static inline bool macb_is_gem(struct macb *bp)
+{
+       return MACB_BFEXT(IDNUM, macb_readl(bp, MID)) == 0x2;
+}
+
 #endif /* _MACB_H */
index 1124ce0a15944a36dd119efae6fe47a101264b72..c136230d50bb125e6ca1f4de21ae72485e0dbec2 100644 (file)
@@ -232,6 +232,7 @@ struct fec_enet_private {
        struct  platform_device *pdev;
 
        int     opened;
+       int     dev_id;
 
        /* Phylib and MDIO interface */
        struct  mii_bus *mii_bus;
@@ -837,7 +838,7 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
 
        /* Adjust MAC if using macaddr */
        if (iap == macaddr)
-                ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->pdev->id;
+                ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->dev_id;
 }
 
 /* ------------------------------------------------------------------------- */
@@ -953,7 +954,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
        char mdio_bus_id[MII_BUS_ID_SIZE];
        char phy_name[MII_BUS_ID_SIZE + 3];
        int phy_id;
-       int dev_id = fep->pdev->id;
+       int dev_id = fep->dev_id;
 
        fep->phy_dev = NULL;
 
@@ -1031,7 +1032,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
         * mdio interface in board design, and need to be configured by
         * fec0 mii_bus.
         */
-       if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) {
+       if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && fep->dev_id > 0) {
                /* fec1 uses fec0 mii_bus */
                fep->mii_bus = fec0_mii_bus;
                return 0;
@@ -1063,7 +1064,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
        fep->mii_bus->read = fec_enet_mdio_read;
        fep->mii_bus->write = fec_enet_mdio_write;
        fep->mii_bus->reset = fec_enet_mdio_reset;
-       snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id + 1);
+       snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%x", fep->dev_id + 1);
        fep->mii_bus->priv = fep;
        fep->mii_bus->parent = &pdev->dev;
 
@@ -1521,6 +1522,7 @@ fec_probe(struct platform_device *pdev)
        int i, irq, ret = 0;
        struct resource *r;
        const struct of_device_id *of_id;
+       static int dev_id;
 
        of_id = of_match_device(fec_dt_ids, &pdev->dev);
        if (of_id)
@@ -1548,6 +1550,7 @@ fec_probe(struct platform_device *pdev)
 
        fep->hwp = ioremap(r->start, resource_size(r));
        fep->pdev = pdev;
+       fep->dev_id = dev_id++;
 
        if (!fep->hwp) {
                ret = -ENOMEM;
index 52f4e8ad48e77c84b8bd4ed9cd52faa3f5adb419..4d9f84b8ab9773ef91d75f395907fd9b3f9c25de 100644 (file)
@@ -183,28 +183,10 @@ void fsl_pq_mdio_bus_name(char *name, struct device_node *np)
 }
 EXPORT_SYMBOL_GPL(fsl_pq_mdio_bus_name);
 
-/* Scan the bus in reverse, looking for an empty spot */
-static int fsl_pq_mdio_find_free(struct mii_bus *new_bus)
-{
-       int i;
-
-       for (i = PHY_MAX_ADDR; i > 0; i--) {
-               u32 phy_id;
-
-               if (get_phy_id(new_bus, i, &phy_id))
-                       return -1;
-
-               if (phy_id == 0xffffffff)
-                       break;
-       }
-
-       return i;
-}
-
 
-#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
 static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct device_node *np)
 {
+#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
        struct gfar __iomem *enet_regs;
 
        /*
@@ -220,15 +202,15 @@ static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct devi
        } else if (of_device_is_compatible(np, "fsl,etsec2-mdio") ||
                        of_device_is_compatible(np, "fsl,etsec2-tbi")) {
                return of_iomap(np, 1);
-       } else
-               return NULL;
-}
+       }
 #endif
+       return NULL;
+}
 
 
-#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
 static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
 {
+#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
        struct device_node *np = NULL;
        int err = 0;
 
@@ -261,9 +243,10 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
                return err;
        else
                return -EINVAL;
-}
+#else
+       return -ENODEV;
 #endif
-
+}
 
 static int fsl_pq_mdio_probe(struct platform_device *ofdev)
 {
@@ -339,19 +322,13 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
                        of_device_is_compatible(np, "fsl,etsec2-mdio") ||
                        of_device_is_compatible(np, "fsl,etsec2-tbi") ||
                        of_device_is_compatible(np, "gianfar")) {
-#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
                tbipa = get_gfar_tbipa(regs, np);
                if (!tbipa) {
                        err = -EINVAL;
                        goto err_free_irqs;
                }
-#else
-               err = -ENODEV;
-               goto err_free_irqs;
-#endif
        } else if (of_device_is_compatible(np, "fsl,ucc-mdio") ||
                        of_device_is_compatible(np, "ucc_geth_phy")) {
-#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
                u32 id;
                static u32 mii_mng_master;
 
@@ -364,10 +341,6 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
                        mii_mng_master = id;
                        ucc_set_qe_mux_mii_mng(id - 1);
                }
-#else
-               err = -ENODEV;
-               goto err_free_irqs;
-#endif
        } else {
                err = -ENODEV;
                goto err_free_irqs;
@@ -386,16 +359,6 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)
        }
 
        if (tbiaddr == -1) {
-               out_be32(tbipa, 0);
-
-               tbiaddr = fsl_pq_mdio_find_free(new_bus);
-       }
-
-       /*
-        * We define TBIPA at 0 to be illegal, opting to fail for boards that
-        * have PHYs at 1-31, rather than change tbipa and rescan.
-        */
-       if (tbiaddr == 0) {
                err = -EBUSY;
 
                goto err_free_irqs;
index 89f829f5f7257fcacd54902d3963520ab5b47525..f8a6853b692ed3edf29e996739d70261988bc80b 100644 (file)
@@ -423,10 +423,8 @@ static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,
        lock_sock(sk);
 
        opt->src_addr = sp->sa_addr.pptp;
-       if (add_chan(po)) {
-               release_sock(sk);
+       if (add_chan(po))
                error = -EBUSY;
-       }
 
        release_sock(sk);
        return error;
index 93fbe6f4089890df98b98904921879ab97835b98..d2348a5a7809bd1e2233f39a2b6f192443234f2f 100644 (file)
@@ -286,7 +286,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
                        ath_start_ani(common);
        }
 
-       if (ath9k_hw_ops(ah)->antdiv_comb_conf_get && sc->ant_rx != 3) {
+       if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3) {
                struct ath_hw_antcomb_conf div_ant_conf;
                u8 lna_conf;
 
index 888abc2be3a547d6f85ad32723fd2d2910c5582e..528d5f3e868c712a7b2372dc8616e1581205bddc 100644 (file)
@@ -1271,7 +1271,9 @@ static void ath_rc_init(struct ath_softc *sc,
 
        ath_rc_priv->max_valid_rate = k;
        ath_rc_sort_validrates(rate_table, ath_rc_priv);
-       ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
+       ath_rc_priv->rate_max_phy = (k > 4) ?
+                                       ath_rc_priv->valid_rate_index[k-4] :
+                                       ath_rc_priv->valid_rate_index[k-1];
        ath_rc_priv->rate_table = rate_table;
 
        ath_dbg(common, ATH_DBG_CONFIG,
index 35a6b71f358ce7a563f6507b58f0743eb6ded16a..df1540ca6102f641ed491cd50899e5eec17b8963 100644 (file)
@@ -91,7 +91,10 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv,
                tx_cmd->tid_tspec = qc[0] & 0xf;
                tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK;
        } else {
-               tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
+               if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
+                       tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
+               else
+                       tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK;
        }
 
        iwlagn_tx_cmd_protection(priv, info, fc, &tx_flags);
index 592a10ac59299ba0b243bdbf6ddfd676b4dfcf79..3b585aadabfcdae61bc7aed6b8b2694266ed1f14 100644 (file)
@@ -569,7 +569,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
                }
        case ERFSLEEP:{
                        if (ppsc->rfpwr_state == ERFOFF)
-                               break;
+                               return false;
                        for (queue_id = 0, i = 0;
                             queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
                                ring = &pcipriv->dev.tx_ring[queue_id];
index 72852900df84f4dbcd40d40887ae67a645731816..e49cf2244c7568af1958a57608804a61763cd23d 100644 (file)
@@ -548,7 +548,7 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
                break;
        case ERFSLEEP:
                if (ppsc->rfpwr_state == ERFOFF)
-                       break;
+                       return false;
                for (queue_id = 0, i = 0;
                     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
                        ring = &pcipriv->dev.tx_ring[queue_id];
index 3ac7af1c5509c3eec85943a5f570c24e542e473d..0883349e1c8371f9828deee3bb78ac04ccf0c4d9 100644 (file)
@@ -3374,7 +3374,7 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
                break;
        case ERFSLEEP:
                if (ppsc->rfpwr_state == ERFOFF)
-                       break;
+                       return false;
 
                for (queue_id = 0, i = 0;
                     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
index f27171af979cd7716d23d48614116a2ab74677cd..f10ac1ad9087e594747d9e4c71b29863fe623da8 100644 (file)
@@ -602,7 +602,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
                }
        case ERFSLEEP:
                        if (ppsc->rfpwr_state == ERFOFF)
-                               break;
+                               return false;
 
                        for (queue_id = 0, i = 0;
                             queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
index cbd5d701c7e086f632f74bf8bec29fe1a23e6a55..63b3ec48c203a43f3d8a9d395e459d765fd7f7b0 100644 (file)
@@ -314,7 +314,7 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
        if (!lookup)
                return NULL;
 
-       for(; lookup->name != NULL; lookup++) {
+       for(; lookup->compatible != NULL; lookup++) {
                if (!of_device_is_compatible(np, lookup->compatible))
                        continue;
                if (of_address_to_resource(np, 0, &res))
index 7ec56fb0bd78aca5aec916aefd8788cc1b101027..b0dd08e6a9da1cc4f8ee78ebf53f1e4e5f1de2b2 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/export.h>
 #include <linux/pci-ats.h>
 #include <linux/pci.h>
+#include <linux/slab.h>
 
 #include "pci.h"
 
index b82c155d7b37f539eb85ce28512219a6b701cf52..1969a3ee3058328e469a0fc6e529f9841f5708ab 100644 (file)
@@ -283,6 +283,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
        struct resource *res;
        struct pci_dev *pdev;
        struct pci_sriov *iov = dev->sriov;
+       int bars = 0;
 
        if (!nr_virtfn)
                return 0;
@@ -307,6 +308,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
 
        nres = 0;
        for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
+               bars |= (1 << (i + PCI_IOV_RESOURCES));
                res = dev->resource + PCI_IOV_RESOURCES + i;
                if (res->parent)
                        nres++;
@@ -324,6 +326,11 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
                return -ENOMEM;
        }
 
+       if (pci_enable_resources(dev, bars)) {
+               dev_err(&dev->dev, "SR-IOV: IOV BARS not allocated\n");
+               return -ENOMEM;
+       }
+
        if (iov->link != dev->devfn) {
                pdev = pci_get_slot(dev->bus, iov->link);
                if (!pdev)
index 6f45a73c6e9fa38c9e09fbf3d5a4853d8cc3396c..4788413f43d798f2e714619c12af69883317ebe5 100644 (file)
@@ -1126,7 +1126,7 @@ static int __pci_enable_device_flags(struct pci_dev *dev,
        if (atomic_add_return(1, &dev->enable_cnt) > 1)
                return 0;               /* already enabled */
 
-       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
+       for (i = 0; i < PCI_ROM_RESOURCE; i++)
                if (dev->resource[i].flags & flags)
                        bars |= (1 << i);
 
index 0b4f946cf13aa6126f9b55a371cd9279fe5a8c3e..31ab6ddf52c932c1791e87a874a2c6ace211e073 100644 (file)
@@ -16,8 +16,6 @@
 #include <linux/gpio.h>
 #include <linux/export.h>
 
-#include <asm/mach-types.h>
-
 #include "soc_common.h"
 
 #define GPIO_PCMCIA_SKTSEL     (54)
 #define GPIO_PCMCIA_S1_RDYINT  (8)
 #define GPIO_PCMCIA_RESET      (9)
 
-#define PCMCIA_S0_CD_VALID     IRQ_GPIO(GPIO_PCMCIA_S0_CD_VALID)
-#define PCMCIA_S1_CD_VALID     IRQ_GPIO(GPIO_PCMCIA_S1_CD_VALID)
-#define PCMCIA_S0_RDYINT       IRQ_GPIO(GPIO_PCMCIA_S0_RDYINT)
-#define PCMCIA_S1_RDYINT       IRQ_GPIO(GPIO_PCMCIA_S1_RDYINT)
+#define PCMCIA_S0_CD_VALID     gpio_to_irq(GPIO_PCMCIA_S0_CD_VALID)
+#define PCMCIA_S1_CD_VALID     gpio_to_irq(GPIO_PCMCIA_S1_CD_VALID)
+#define PCMCIA_S0_RDYINT       gpio_to_irq(GPIO_PCMCIA_S0_RDYINT)
+#define PCMCIA_S1_RDYINT       gpio_to_irq(GPIO_PCMCIA_S1_RDYINT)
 
 
 static struct pcmcia_irqs irqs[] = {
-       { 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" },
-       { 1, PCMCIA_S1_CD_VALID, "PCMCIA1 CD" },
+       { .sock = 0, .str = "PCMCIA0 CD" },
+       { .sock = 1, .str = "PCMCIA1 CD" },
 };
 
 static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
@@ -46,6 +44,8 @@ static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
        gpio_direction_output(GPIO_PCMCIA_RESET, 0);
 
        skt->socket.pci_irq = skt->nr == 0 ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT;
+       irqs[0].irq = PCMCIA_S0_CD_VALID;
+       irqs[1].irq = PCMCIA_S1_CD_VALID;
        ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
        if (!ret)
                gpio_free(GPIO_PCMCIA_RESET);
index 923f315926ef478dc4793924f7349074baed8d5a..3dc7621a076701a843fe0722d0340db703830fa8 100644 (file)
 #include <linux/gpio.h>
 #include <linux/export.h>
 
-#include <asm/mach-types.h>
-
 #include "soc_common.h"
 
 #define GPIO_PCMCIA_S0_CD_VALID        (84)
 #define GPIO_PCMCIA_S0_RDYINT  (82)
 #define GPIO_PCMCIA_RESET      (53)
 
-#define PCMCIA_S0_CD_VALID     IRQ_GPIO(GPIO_PCMCIA_S0_CD_VALID)
-#define PCMCIA_S0_RDYINT       IRQ_GPIO(GPIO_PCMCIA_S0_RDYINT)
+#define PCMCIA_S0_CD_VALID     gpio_to_irq(GPIO_PCMCIA_S0_CD_VALID)
+#define PCMCIA_S0_RDYINT       gpio_to_irq(GPIO_PCMCIA_S0_RDYINT)
 
 
 static struct pcmcia_irqs irqs[] = {
-       { 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" },
+       { .sock = 0, .str = "PCMCIA0 CD" },
 };
 
 static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
@@ -40,6 +38,7 @@ static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
        gpio_direction_output(GPIO_PCMCIA_RESET, 0);
 
        skt->socket.pci_irq = PCMCIA_S0_RDYINT;
+       irqs[0].irq = PCMCIA_S0_CD_VALID;
        ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
        if (!ret)
                gpio_free(GPIO_PCMCIA_RESET);
index e39b77a4609af46902dc71ec2f2c6c72b6426c0a..dc474bc6522de1d44295f67ad3ddb1f7bc33a771 100644 (file)
 
 #include <mach/at91_rtc.h>
 
+#define at91_rtc_read(field) \
+       __raw_readl(at91_rtc_regs + field)
+#define at91_rtc_write(field, val) \
+       __raw_writel((val), at91_rtc_regs + field)
 
 #define AT91_RTC_EPOCH         1900UL  /* just like arch/arm/common/rtctime.c */
 
 static DECLARE_COMPLETION(at91_rtc_updated);
 static unsigned int at91_alarm_year = AT91_RTC_EPOCH;
+static void __iomem *at91_rtc_regs;
+static int irq;
 
 /*
  * Decode time/date into rtc_time structure
@@ -48,10 +54,10 @@ static void at91_rtc_decodetime(unsigned int timereg, unsigned int calreg,
 
        /* must read twice in case it changes */
        do {
-               time = at91_sys_read(timereg);
-               date = at91_sys_read(calreg);
-       } while ((time != at91_sys_read(timereg)) ||
-                       (date != at91_sys_read(calreg)));
+               time = at91_rtc_read(timereg);
+               date = at91_rtc_read(calreg);
+       } while ((time != at91_rtc_read(timereg)) ||
+                       (date != at91_rtc_read(calreg)));
 
        tm->tm_sec  = bcd2bin((time & AT91_RTC_SEC) >> 0);
        tm->tm_min  = bcd2bin((time & AT91_RTC_MIN) >> 8);
@@ -98,19 +104,19 @@ static int at91_rtc_settime(struct device *dev, struct rtc_time *tm)
                tm->tm_hour, tm->tm_min, tm->tm_sec);
 
        /* Stop Time/Calendar from counting */
-       cr = at91_sys_read(AT91_RTC_CR);
-       at91_sys_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM);
+       cr = at91_rtc_read(AT91_RTC_CR);
+       at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM);
 
-       at91_sys_write(AT91_RTC_IER, AT91_RTC_ACKUPD);
+       at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD);
        wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */
-       at91_sys_write(AT91_RTC_IDR, AT91_RTC_ACKUPD);
+       at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD);
 
-       at91_sys_write(AT91_RTC_TIMR,
+       at91_rtc_write(AT91_RTC_TIMR,
                          bin2bcd(tm->tm_sec) << 0
                        | bin2bcd(tm->tm_min) << 8
                        | bin2bcd(tm->tm_hour) << 16);
 
-       at91_sys_write(AT91_RTC_CALR,
+       at91_rtc_write(AT91_RTC_CALR,
                          bin2bcd((tm->tm_year + 1900) / 100)   /* century */
                        | bin2bcd(tm->tm_year % 100) << 8       /* year */
                        | bin2bcd(tm->tm_mon + 1) << 16         /* tm_mon starts at zero */
@@ -118,8 +124,8 @@ static int at91_rtc_settime(struct device *dev, struct rtc_time *tm)
                        | bin2bcd(tm->tm_mday) << 24);
 
        /* Restart Time/Calendar */
-       cr = at91_sys_read(AT91_RTC_CR);
-       at91_sys_write(AT91_RTC_CR, cr & ~(AT91_RTC_UPDCAL | AT91_RTC_UPDTIM));
+       cr = at91_rtc_read(AT91_RTC_CR);
+       at91_rtc_write(AT91_RTC_CR, cr & ~(AT91_RTC_UPDCAL | AT91_RTC_UPDTIM));
 
        return 0;
 }
@@ -135,7 +141,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
        tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year);
        tm->tm_year = at91_alarm_year - 1900;
 
-       alrm->enabled = (at91_sys_read(AT91_RTC_IMR) & AT91_RTC_ALARM)
+       alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM)
                        ? 1 : 0;
 
        pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__,
@@ -160,20 +166,20 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
        tm.tm_min = alrm->time.tm_min;
        tm.tm_sec = alrm->time.tm_sec;
 
-       at91_sys_write(AT91_RTC_IDR, AT91_RTC_ALARM);
-       at91_sys_write(AT91_RTC_TIMALR,
+       at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM);
+       at91_rtc_write(AT91_RTC_TIMALR,
                  bin2bcd(tm.tm_sec) << 0
                | bin2bcd(tm.tm_min) << 8
                | bin2bcd(tm.tm_hour) << 16
                | AT91_RTC_HOUREN | AT91_RTC_MINEN | AT91_RTC_SECEN);
-       at91_sys_write(AT91_RTC_CALALR,
+       at91_rtc_write(AT91_RTC_CALALR,
                  bin2bcd(tm.tm_mon + 1) << 16          /* tm_mon starts at zero */
                | bin2bcd(tm.tm_mday) << 24
                | AT91_RTC_DATEEN | AT91_RTC_MTHEN);
 
        if (alrm->enabled) {
-               at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
-               at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM);
+               at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
+               at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM);
        }
 
        pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__,
@@ -188,10 +194,10 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
        pr_debug("%s(): cmd=%08x\n", __func__, enabled);
 
        if (enabled) {
-               at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
-               at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM);
+               at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
+               at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM);
        } else
-               at91_sys_write(AT91_RTC_IDR, AT91_RTC_ALARM);
+               at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM);
 
        return 0;
 }
@@ -200,7 +206,7 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
  */
 static int at91_rtc_proc(struct device *dev, struct seq_file *seq)
 {
-       unsigned long imr = at91_sys_read(AT91_RTC_IMR);
+       unsigned long imr = at91_rtc_read(AT91_RTC_IMR);
 
        seq_printf(seq, "update_IRQ\t: %s\n",
                        (imr & AT91_RTC_ACKUPD) ? "yes" : "no");
@@ -220,7 +226,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id)
        unsigned int rtsr;
        unsigned long events = 0;
 
-       rtsr = at91_sys_read(AT91_RTC_SR) & at91_sys_read(AT91_RTC_IMR);
+       rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_read(AT91_RTC_IMR);
        if (rtsr) {             /* this interrupt is shared!  Is it ours? */
                if (rtsr & AT91_RTC_ALARM)
                        events |= (RTC_AF | RTC_IRQF);
@@ -229,7 +235,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id)
                if (rtsr & AT91_RTC_ACKUPD)
                        complete(&at91_rtc_updated);
 
-               at91_sys_write(AT91_RTC_SCCR, rtsr);    /* clear status reg */
+               at91_rtc_write(AT91_RTC_SCCR, rtsr);    /* clear status reg */
 
                rtc_update_irq(rtc, 1, events);
 
@@ -256,22 +262,41 @@ static const struct rtc_class_ops at91_rtc_ops = {
 static int __init at91_rtc_probe(struct platform_device *pdev)
 {
        struct rtc_device *rtc;
-       int ret;
+       struct resource *regs;
+       int ret = 0;
 
-       at91_sys_write(AT91_RTC_CR, 0);
-       at91_sys_write(AT91_RTC_MR, 0);         /* 24 hour mode */
+       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!regs) {
+               dev_err(&pdev->dev, "no mmio resource defined\n");
+               return -ENXIO;
+       }
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               dev_err(&pdev->dev, "no irq resource defined\n");
+               return -ENXIO;
+       }
+
+       at91_rtc_regs = ioremap(regs->start, resource_size(regs));
+       if (!at91_rtc_regs) {
+               dev_err(&pdev->dev, "failed to map registers, aborting.\n");
+               return -ENOMEM;
+       }
+
+       at91_rtc_write(AT91_RTC_CR, 0);
+       at91_rtc_write(AT91_RTC_MR, 0);         /* 24 hour mode */
 
        /* Disable all interrupts */
-       at91_sys_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM |
+       at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM |
                                        AT91_RTC_SECEV | AT91_RTC_TIMEV |
                                        AT91_RTC_CALEV);
 
-       ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
+       ret = request_irq(irq, at91_rtc_interrupt,
                                IRQF_SHARED,
                                "at91_rtc", pdev);
        if (ret) {
                printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n",
-                               AT91_ID_SYS);
+                               irq);
                return ret;
        }
 
@@ -284,7 +309,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
        rtc = rtc_device_register(pdev->name, &pdev->dev,
                                &at91_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc)) {
-               free_irq(AT91_ID_SYS, pdev);
+               free_irq(irq, pdev);
                return PTR_ERR(rtc);
        }
        platform_set_drvdata(pdev, rtc);
@@ -301,10 +326,10 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
        struct rtc_device *rtc = platform_get_drvdata(pdev);
 
        /* Disable all interrupts */
-       at91_sys_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM |
+       at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM |
                                        AT91_RTC_SECEV | AT91_RTC_TIMEV |
                                        AT91_RTC_CALEV);
-       free_irq(AT91_ID_SYS, pdev);
+       free_irq(irq, pdev);
 
        rtc_device_unregister(rtc);
        platform_set_drvdata(pdev, NULL);
@@ -323,13 +348,13 @@ static int at91_rtc_suspend(struct device *dev)
        /* this IRQ is shared with DBGU and other hardware which isn't
         * necessarily doing PM like we are...
         */
-       at91_rtc_imr = at91_sys_read(AT91_RTC_IMR)
+       at91_rtc_imr = at91_rtc_read(AT91_RTC_IMR)
                        & (AT91_RTC_ALARM|AT91_RTC_SECEV);
        if (at91_rtc_imr) {
                if (device_may_wakeup(dev))
-                       enable_irq_wake(AT91_ID_SYS);
+                       enable_irq_wake(irq);
                else
-                       at91_sys_write(AT91_RTC_IDR, at91_rtc_imr);
+                       at91_rtc_write(AT91_RTC_IDR, at91_rtc_imr);
        }
        return 0;
 }
@@ -338,9 +363,9 @@ static int at91_rtc_resume(struct device *dev)
 {
        if (at91_rtc_imr) {
                if (device_may_wakeup(dev))
-                       disable_irq_wake(AT91_ID_SYS);
+                       disable_irq_wake(irq);
                else
-                       at91_sys_write(AT91_RTC_IER, at91_rtc_imr);
+                       at91_rtc_write(AT91_RTC_IER, at91_rtc_imr);
        }
        return 0;
 }
index 5b979d9cc3324ffccd455da21e09a35b88f753ad..175067a17c46f31ccc7af5382859f0cfa0ec9e64 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/clk.h>
 #include <linux/log2.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #include <mach/hardware.h>
 #include <asm/uaccess.h>
@@ -507,7 +508,13 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
                goto err_nortc;
        }
 
-       s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
+#ifdef CONFIG_OF
+       if (pdev->dev.of_node)
+               s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
+                       "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
+       else
+#endif
+               s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
 
        /* Check RTC Time */
 
@@ -629,6 +636,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
 #define s3c_rtc_resume  NULL
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id s3c_rtc_dt_match[] = {
+       { .compatible = "samsung,s3c2410-rtc" },
+       { .compatible = "samsung,s3c6410-rtc" },
+       {},
+};
+MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
+#else
+#define s3c_rtc_dt_match NULL
+#endif
+
 static struct platform_device_id s3c_rtc_driver_ids[] = {
        {
                .name           = "s3c2410-rtc",
@@ -651,6 +669,7 @@ static struct platform_driver s3c_rtc_driver = {
        .driver         = {
                .name   = "s3c-rtc",
                .owner  = THIS_MODULE,
+               .of_match_table = s3c_rtc_dt_match,
        },
 };
 
index 11f07f888223d92748e684b4000155b7e37eae9c..b79576b64f451e72352bbc3c92582f23e9a92191 100644 (file)
@@ -55,6 +55,10 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdev)
 {
        struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
 
+       /* if previous slave_alloc returned early, there is nothing to do */
+       if (!zfcp_sdev->port)
+               return;
+
        zfcp_erp_lun_shutdown_wait(sdev, "scssd_1");
        put_device(&zfcp_sdev->port->dev);
 }
index 5f94d22c491ecbf1c619e79b0e1ff8a75e23ccd4..542668292900fa9fe2e5afca92215f46104e0520 100644 (file)
@@ -233,13 +233,9 @@ int bbc_i2c_write_buf(struct bbc_i2c_client *client,
        int ret = 0;
 
        while (len > 0) {
-               int err = bbc_i2c_writeb(client, *buf, off);
-
-               if (err < 0) {
-                       ret = err;
+               ret = bbc_i2c_writeb(client, *buf, off);
+               if (ret < 0)
                        break;
-               }
-
                len--;
                buf++;
                off++;
@@ -253,11 +249,9 @@ int bbc_i2c_read_buf(struct bbc_i2c_client *client,
        int ret = 0;
 
        while (len > 0) {
-               int err = bbc_i2c_readb(client, buf, off);
-               if (err < 0) {
-                       ret = err;
+               ret = bbc_i2c_readb(client, buf, off);
+               if (ret < 0)
                        break;
-               }
                len--;
                buf++;
                off++;
@@ -422,17 +416,6 @@ static struct platform_driver bbc_i2c_driver = {
        .remove         = __devexit_p(bbc_i2c_remove),
 };
 
-static int __init bbc_i2c_init(void)
-{
-       return platform_driver_register(&bbc_i2c_driver);
-}
-
-static void __exit bbc_i2c_exit(void)
-{
-       platform_driver_unregister(&bbc_i2c_driver);
-}
-
-module_init(bbc_i2c_init);
-module_exit(bbc_i2c_exit);
+module_platform_driver(bbc_i2c_driver);
 
 MODULE_LICENSE("GPL");
index 965a1fccd66a8898270d45756468e868a4f8acc5..4b9939726c342f3b5e32b1cc5f3ebfe5c88ef945 100644 (file)
@@ -275,15 +275,4 @@ static struct platform_driver d7s_driver = {
        .remove         = __devexit_p(d7s_remove),
 };
 
-static int __init d7s_init(void)
-{
-       return platform_driver_register(&d7s_driver);
-}
-
-static void __exit d7s_exit(void)
-{
-       platform_driver_unregister(&d7s_driver);
-}
-
-module_init(d7s_init);
-module_exit(d7s_exit);
+module_platform_driver(d7s_driver);
index be7b4e56154f9da35b81bee8fcbc2a238180f314..339fd6f65eda7ff3ba3d90914e8b79c73ae15d34 100644 (file)
@@ -1138,16 +1138,6 @@ static struct platform_driver envctrl_driver = {
        .remove         = __devexit_p(envctrl_remove),
 };
 
-static int __init envctrl_init(void)
-{
-       return platform_driver_register(&envctrl_driver);
-}
-
-static void __exit envctrl_exit(void)
-{
-       platform_driver_unregister(&envctrl_driver);
-}
+module_platform_driver(envctrl_driver);
 
-module_init(envctrl_init);
-module_exit(envctrl_exit);
 MODULE_LICENSE("GPL");
index 73dd4e7afaaa0b84fb8a6fd9de3552cab37a8a19..826157f386943940367f663b20415e2c01fc571f 100644 (file)
@@ -216,16 +216,6 @@ static struct platform_driver flash_driver = {
        .remove         = __devexit_p(flash_remove),
 };
 
-static int __init flash_init(void)
-{
-       return platform_driver_register(&flash_driver);
-}
-
-static void __exit flash_cleanup(void)
-{
-       platform_driver_unregister(&flash_driver);
-}
+module_platform_driver(flash_driver);
 
-module_init(flash_init);
-module_exit(flash_cleanup);
 MODULE_LICENSE("GPL");
index ebce9639a26abba176a3aff226a89abc3d13f8bc..0b31658ccde5cd8be14d3b1f54a06670c1c375df 100644 (file)
@@ -435,16 +435,6 @@ static struct platform_driver uctrl_driver = {
 };
 
 
-static int __init uctrl_init(void)
-{
-       return platform_driver_register(&uctrl_driver);
-}
-
-static void __exit uctrl_exit(void)
-{
-       platform_driver_unregister(&uctrl_driver);
-}
+module_platform_driver(uctrl_driver);
 
-module_init(uctrl_init);
-module_exit(uctrl_exit);
 MODULE_LICENSE("GPL");
index cefbe44bb84a1293db665510543ab8cccaec1622..f3f440c955f3e60e2efe9deaf12002b304f625f5 100644 (file)
@@ -1624,6 +1624,7 @@ static inline int fcoe_filter_frames(struct fc_lport *lport,
        stats->InvalidCRCCount++;
        if (stats->InvalidCRCCount < 5)
                printk(KERN_WARNING "fcoe: dropping frame with CRC error\n");
+       put_cpu();
        return -EINVAL;
 }
 
index 590ce1ef20167d407dde187924a9a0ccf2def68e..4ceeace804533c42b287aa9c54a3f952176dab9f 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/dma.h>
 #include <asm/macints.h>
 #include <asm/macintosh.h>
+#include <asm/mac_via.h>
 
 #include <scsi/scsi_host.h>
 
@@ -149,7 +150,7 @@ static inline int mac_esp_wait_for_dreq(struct esp *esp)
 
        do {
                if (mep->pdma_regs == NULL) {
-                       if (mac_irq_pending(IRQ_MAC_SCSIDRQ))
+                       if (via2_scsi_drq_pending())
                                return 0;
                } else {
                        if (nubus_readl(mep->pdma_regs) & 0x200)
index 4e041f6d808cd6e49666b35c8d8aec0f1b0a76c5..d570573b7963ec47179d15ec7ac613221f0ce4bc 100644 (file)
@@ -4335,7 +4335,7 @@ _scsih_smart_predicted_fault(struct MPT2SAS_ADAPTER *ioc, u16 handle)
        /* insert into event log */
        sz = offsetof(Mpi2EventNotificationReply_t, EventData) +
             sizeof(Mpi2EventDataSasDeviceStatusChange_t);
-       event_reply = kzalloc(sz, GFP_KERNEL);
+       event_reply = kzalloc(sz, GFP_ATOMIC);
        if (!event_reply) {
                printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
                    ioc->name, __FILE__, __LINE__, __func__);
index ac326c41e931dcba508c6357708be557986b8d88..6465dae5883a9dcb44ddde60b9c5f6f98fafd89b 100644 (file)
@@ -1762,12 +1762,31 @@ qla2x00_get_host_port_state(struct Scsi_Host *shost)
        scsi_qla_host_t *vha = shost_priv(shost);
        struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev);
 
-       if (!base_vha->flags.online)
+       if (!base_vha->flags.online) {
                fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
-       else if (atomic_read(&base_vha->loop_state) == LOOP_TIMEOUT)
-               fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
-       else
+               return;
+       }
+
+       switch (atomic_read(&base_vha->loop_state)) {
+       case LOOP_UPDATE:
+               fc_host_port_state(shost) = FC_PORTSTATE_DIAGNOSTICS;
+               break;
+       case LOOP_DOWN:
+               if (test_bit(LOOP_RESYNC_NEEDED, &base_vha->dpc_flags))
+                       fc_host_port_state(shost) = FC_PORTSTATE_DIAGNOSTICS;
+               else
+                       fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN;
+               break;
+       case LOOP_DEAD:
+               fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN;
+               break;
+       case LOOP_READY:
                fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
+               break;
+       default:
+               fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
+               break;
+       }
 }
 
 static int
index 9df4787715c0828df3dadd48cb149550600919e5..f3cddd5800c307e219bb8a8c6a84db569117df03 100644 (file)
  * |             Level            |   Last Value Used  |     Holes     |
  * ----------------------------------------------------------------------
  * | Module Init and Probe        |       0x0116       |               |
- * | Mailbox commands             |       0x1129       |               |
+ * | Mailbox commands             |       0x112b       |               |
  * | Device Discovery             |       0x2083       |               |
  * | Queue Command and IO tracing |       0x302e       |     0x3008     |
  * | DPC Thread                   |       0x401c       |               |
  * | Async Events                 |       0x5059       |               |
- * | Timer Routines               |       0x600d       |               |
+ * | Timer Routines               |       0x6010       | 0x600e,0x600f  |
  * | User Space Interactions      |       0x709d       |               |
- * | Task Management              |       0x8041       |               |
+ * | Task Management              |       0x8041       | 0x800b         |
  * | AER/EEH                      |       0x900f       |               |
  * | Virtual Port                 |       0xa007       |               |
- * | ISP82XX Specific             |       0xb051       |               |
+ * | ISP82XX Specific             |       0xb052       |               |
  * | MultiQ                       |       0xc00b       |               |
  * | Misc                         |       0xd00b       |               |
  * ----------------------------------------------------------------------
index ce32d8135c9e36335f53722664eab61db46a0f18..c0c11afb685c450e473faaaf711b00d8ec0d7d82 100644 (file)
@@ -578,6 +578,7 @@ extern int qla82xx_check_md_needed(scsi_qla_host_t *);
 extern void qla82xx_chip_reset_cleanup(scsi_qla_host_t *);
 extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int);
 extern char *qdev_state(uint32_t);
+extern void qla82xx_clear_pending_mbx(scsi_qla_host_t *);
 
 /* BSG related functions */
 extern int qla24xx_bsg_request(struct fc_bsg_job *);
index f03e915f187729f6b208a0e89398b2a0b8642214..54ea68cec4c58c3cd0ee80c48bfaeb3f96e637d4 100644 (file)
@@ -1509,7 +1509,8 @@ enable_82xx_npiv:
                                    &ha->fw_xcb_count, NULL, NULL,
                                    &ha->max_npiv_vports, NULL);
 
-                               if (!fw_major_version && ql2xallocfwdump)
+                               if (!fw_major_version && ql2xallocfwdump
+                                   && !IS_QLA82XX(ha))
                                        qla2x00_alloc_fw_dump(vha);
                        }
                } else {
index dbec89622a0fa09d77ae6ad6c45e7df9237da3e0..a4b267e60a352b7cb72f620bd099ef19e12ddd13 100644 (file)
@@ -120,11 +120,10 @@ qla2x00_prep_cont_type0_iocb(struct scsi_qla_host *vha)
  * Returns a pointer to the continuation type 1 IOCB packet.
  */
 static inline cont_a64_entry_t *
-qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *vha)
+qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *vha, struct req_que *req)
 {
        cont_a64_entry_t *cont_pkt;
 
-       struct req_que *req = vha->req;
        /* Adjust ring index. */
        req->ring_index++;
        if (req->ring_index == req->length) {
@@ -292,7 +291,7 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
                         * Five DSDs are available in the Continuation
                         * Type 1 IOCB.
                         */
-                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
+                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha, vha->req);
                        cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
                        avail_dsds = 5;
                }
@@ -684,7 +683,7 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
                         * Five DSDs are available in the Continuation
                         * Type 1 IOCB.
                         */
-                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
+                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha, vha->req);
                        cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
                        avail_dsds = 5;
                }
@@ -2070,7 +2069,8 @@ qla2x00_ct_iocb(srb_t *sp, ms_iocb_entry_t *ct_iocb)
                        * Five DSDs are available in the Cont.
                        * Type 1 IOCB.
                               */
-                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
+                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha,
+                           vha->hw->req_q_map[0]);
                        cur_dsd = (uint32_t *) cont_pkt->dseg_0_address;
                        avail_dsds = 5;
                        cont_iocb_prsnt = 1;
@@ -2096,6 +2096,7 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
        int index;
        uint16_t tot_dsds;
         scsi_qla_host_t *vha = sp->fcport->vha;
+       struct qla_hw_data *ha = vha->hw;
        struct fc_bsg_job *bsg_job = ((struct srb_ctx *)sp->ctx)->u.bsg_job;
        int loop_iterartion = 0;
        int cont_iocb_prsnt = 0;
@@ -2141,7 +2142,8 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
                        * Five DSDs are available in the Cont.
                        * Type 1 IOCB.
                               */
-                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
+                       cont_pkt = qla2x00_prep_cont_type1_iocb(vha,
+                           ha->req_q_map[0]);
                        cur_dsd = (uint32_t *) cont_pkt->dseg_0_address;
                        avail_dsds = 5;
                        cont_iocb_prsnt = 1;
index 2516adf1aeeaa946372ac137da595d37466418c7..7b91b290ffd6bd23c1b137a7a3c73074f3f1580a 100644 (file)
@@ -1741,7 +1741,7 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                                    resid, scsi_bufflen(cp));
 
                                cp->result = DID_ERROR << 16 | lscsi_status;
-                               break;
+                               goto check_scsi_status;
                        }
 
                        if (!lscsi_status &&
index 3b3cec9f6ac295dab131050b8a92d47eadb06999..82a33533ed26c25dc87e90cfe1a35f95c33ccb44 100644 (file)
@@ -79,8 +79,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                mcp->mb[0] = MBS_LINK_DOWN_ERROR;
                ql_log(ql_log_warn, base_vha, 0x1004,
                    "FW hung = %d.\n", ha->flags.isp82xx_fw_hung);
-               rval = QLA_FUNCTION_FAILED;
-               goto premature_exit;
+               return QLA_FUNCTION_TIMEOUT;
        }
 
        /*
@@ -163,6 +162,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                                HINT_MBX_INT_PENDING) {
                                spin_unlock_irqrestore(&ha->hardware_lock,
                                        flags);
+                               ha->flags.mbox_busy = 0;
                                ql_dbg(ql_dbg_mbx, base_vha, 0x1010,
                                    "Pending mailbox timeout, exiting.\n");
                                rval = QLA_FUNCTION_TIMEOUT;
@@ -188,6 +188,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                                HINT_MBX_INT_PENDING) {
                                spin_unlock_irqrestore(&ha->hardware_lock,
                                        flags);
+                               ha->flags.mbox_busy = 0;
                                ql_dbg(ql_dbg_mbx, base_vha, 0x1012,
                                    "Pending mailbox timeout, exiting.\n");
                                rval = QLA_FUNCTION_TIMEOUT;
@@ -302,7 +303,15 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                        if (!test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) &&
                            !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) &&
                            !test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
-
+                               if (IS_QLA82XX(ha)) {
+                                       ql_dbg(ql_dbg_mbx, vha, 0x112a,
+                                           "disabling pause transmit on port "
+                                           "0 & 1.\n");
+                                       qla82xx_wr_32(ha,
+                                           QLA82XX_CRB_NIU + 0x98,
+                                           CRB_NIU_XG_PAUSE_CTL_P0|
+                                           CRB_NIU_XG_PAUSE_CTL_P1);
+                               }
                                ql_log(ql_log_info, base_vha, 0x101c,
                                    "Mailbox cmd timeout occured. "
                                    "Scheduling ISP abort eeh_busy=0x%x.\n",
@@ -318,7 +327,15 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                        if (!test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) &&
                            !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) &&
                            !test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
-
+                               if (IS_QLA82XX(ha)) {
+                                       ql_dbg(ql_dbg_mbx, vha, 0x112b,
+                                           "disabling pause transmit on port "
+                                           "0 & 1.\n");
+                                       qla82xx_wr_32(ha,
+                                           QLA82XX_CRB_NIU + 0x98,
+                                           CRB_NIU_XG_PAUSE_CTL_P0|
+                                           CRB_NIU_XG_PAUSE_CTL_P1);
+                               }
                                ql_log(ql_log_info, base_vha, 0x101e,
                                    "Mailbox cmd timeout occured. "
                                    "Scheduling ISP abort.\n");
index 94bded5ddce4fe2f958dcdb8387c471eeaf790cf..03554934b0a58629848117649737a6fbabc15713 100644 (file)
@@ -3817,6 +3817,20 @@ exit:
        return rval;
 }
 
+void qla82xx_clear_pending_mbx(scsi_qla_host_t *vha)
+{
+       struct qla_hw_data *ha = vha->hw;
+
+       if (ha->flags.mbox_busy) {
+               ha->flags.mbox_int = 1;
+               ha->flags.mbox_busy = 0;
+               ql_log(ql_log_warn, vha, 0x6010,
+                   "Doing premature completion of mbx command.\n");
+               if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags))
+                       complete(&ha->mbx_intr_comp);
+       }
+}
+
 void qla82xx_watchdog(scsi_qla_host_t *vha)
 {
        uint32_t dev_state, halt_status;
@@ -3839,9 +3853,13 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
                        qla2xxx_wake_dpc(vha);
                } else {
                        if (qla82xx_check_fw_alive(vha)) {
+                               ql_dbg(ql_dbg_timer, vha, 0x6011,
+                                   "disabling pause transmit on port 0 & 1.\n");
+                               qla82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x98,
+                                   CRB_NIU_XG_PAUSE_CTL_P0|CRB_NIU_XG_PAUSE_CTL_P1);
                                halt_status = qla82xx_rd_32(ha,
                                    QLA82XX_PEG_HALT_STATUS1);
-                               ql_dbg(ql_dbg_timer, vha, 0x6005,
+                               ql_log(ql_log_info, vha, 0x6005,
                                    "dumping hw/fw registers:.\n "
                                    " PEG_HALT_STATUS1: 0x%x, PEG_HALT_STATUS2: 0x%x,.\n "
                                    " PEG_NET_0_PC: 0x%x, PEG_NET_1_PC: 0x%x,.\n "
@@ -3858,6 +3876,11 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
                                            QLA82XX_CRB_PEG_NET_3 + 0x3c),
                                    qla82xx_rd_32(ha,
                                            QLA82XX_CRB_PEG_NET_4 + 0x3c));
+                               if (LSW(MSB(halt_status)) == 0x67)
+                                       ql_log(ql_log_warn, vha, 0xb052,
+                                           "Firmware aborted with "
+                                           "error code 0x00006700. Device is "
+                                           "being reset.\n");
                                if (halt_status & HALT_STATUS_UNRECOVERABLE) {
                                        set_bit(ISP_UNRECOVERABLE,
                                            &vha->dpc_flags);
@@ -3869,16 +3892,8 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
                                }
                                qla2xxx_wake_dpc(vha);
                                ha->flags.isp82xx_fw_hung = 1;
-                               if (ha->flags.mbox_busy) {
-                                       ha->flags.mbox_int = 1;
-                                       ql_log(ql_log_warn, vha, 0x6007,
-                                           "Due to FW hung, doing "
-                                           "premature completion of mbx "
-                                           "command.\n");
-                                       if (test_bit(MBX_INTR_WAIT,
-                                           &ha->mbx_cmd_flags))
-                                               complete(&ha->mbx_intr_comp);
-                               }
+                               ql_log(ql_log_warn, vha, 0x6007, "Firmware hung.\n");
+                               qla82xx_clear_pending_mbx(vha);
                        }
                }
        }
@@ -4073,10 +4088,7 @@ qla82xx_chip_reset_cleanup(scsi_qla_host_t *vha)
                        msleep(1000);
                        if (qla82xx_check_fw_alive(vha)) {
                                ha->flags.isp82xx_fw_hung = 1;
-                               if (ha->flags.mbox_busy) {
-                                       ha->flags.mbox_int = 1;
-                                       complete(&ha->mbx_intr_comp);
-                               }
+                               qla82xx_clear_pending_mbx(vha);
                                break;
                        }
                }
index 57820c199bc225858b836feb1d38b457dce14430..57a226be339aa2fe438c6a40a5674062552b006c 100644 (file)
@@ -1173,4 +1173,8 @@ struct qla82xx_md_entry_queue {
 
 static const int MD_MIU_TEST_AGT_RDDATA[] = { 0x410000A8, 0x410000AC,
        0x410000B8, 0x410000BC };
+
+#define CRB_NIU_XG_PAUSE_CTL_P0        0x1
+#define CRB_NIU_XG_PAUSE_CTL_P1        0x8
+
 #endif
index fd14c7bfc62665f698d9950210dfa3b2e1cf1f42..f9e5b85e84d83e6d147eebca647e2e986358cc0c 100644 (file)
@@ -201,12 +201,12 @@ MODULE_PARM_DESC(ql2xmdcapmask,
                "Set the Minidump driver capture mask level. "
                "Default is 0x7F - Can be set to 0x3, 0x7, 0xF, 0x1F, 0x7F.");
 
-int ql2xmdenable;
+int ql2xmdenable = 1;
 module_param(ql2xmdenable, int, S_IRUGO);
 MODULE_PARM_DESC(ql2xmdenable,
                "Enable/disable MiniDump. "
-               "0 (Default) - MiniDump disabled. "
-               "1 - MiniDump enabled.");
+               "0 - MiniDump disabled. "
+               "1 (Default) - MiniDump enabled.");
 
 /*
  * SCSI host template entry points
@@ -423,6 +423,7 @@ fail2:
        qla25xx_delete_queues(vha);
        destroy_workqueue(ha->wq);
        ha->wq = NULL;
+       vha->req = ha->req_q_map[0];
 fail:
        ha->mqenable = 0;
        kfree(ha->req_q_map);
@@ -814,49 +815,6 @@ qla2x00_wait_for_chip_reset(scsi_qla_host_t *vha)
        return return_status;
 }
 
-/*
- * qla2x00_wait_for_loop_ready
- *    Wait for MAX_LOOP_TIMEOUT(5 min) value for loop
- *    to be in LOOP_READY state.
- * Input:
- *     ha - pointer to host adapter structure
- *
- * Note:
- *    Does context switching-Release SPIN_LOCK
- *    (if any) before calling this routine.
- *
- *
- * Return:
- *    Success (LOOP_READY) : 0
- *    Failed  (LOOP_NOT_READY) : 1
- */
-static inline int
-qla2x00_wait_for_loop_ready(scsi_qla_host_t *vha)
-{
-       int      return_status = QLA_SUCCESS;
-       unsigned long loop_timeout ;
-       struct qla_hw_data *ha = vha->hw;
-       scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
-
-       /* wait for 5 min at the max for loop to be ready */
-       loop_timeout = jiffies + (MAX_LOOP_TIMEOUT * HZ);
-
-       while ((!atomic_read(&base_vha->loop_down_timer) &&
-           atomic_read(&base_vha->loop_state) == LOOP_DOWN) ||
-           atomic_read(&base_vha->loop_state) != LOOP_READY) {
-               if (atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
-                       return_status = QLA_FUNCTION_FAILED;
-                       break;
-               }
-               msleep(1000);
-               if (time_after_eq(jiffies, loop_timeout)) {
-                       return_status = QLA_FUNCTION_FAILED;
-                       break;
-               }
-       }
-       return (return_status);
-}
-
 static void
 sp_get(struct srb *sp)
 {
@@ -1035,12 +993,6 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type,
                    "Wait for hba online failed for cmd=%p.\n", cmd);
                goto eh_reset_failed;
        }
-       err = 1;
-       if (qla2x00_wait_for_loop_ready(vha) != QLA_SUCCESS) {
-               ql_log(ql_log_warn, vha, 0x800b,
-                   "Wait for loop ready failed for cmd=%p.\n", cmd);
-               goto eh_reset_failed;
-       }
        err = 2;
        if (do_reset(fcport, cmd->device->lun, cmd->request->cpu + 1)
                != QLA_SUCCESS) {
@@ -1137,10 +1089,9 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
                goto eh_bus_reset_done;
        }
 
-       if (qla2x00_wait_for_loop_ready(vha) == QLA_SUCCESS) {
-               if (qla2x00_loop_reset(vha) == QLA_SUCCESS)
-                       ret = SUCCESS;
-       }
+       if (qla2x00_loop_reset(vha) == QLA_SUCCESS)
+               ret = SUCCESS;
+
        if (ret == FAILED)
                goto eh_bus_reset_done;
 
@@ -1206,15 +1157,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
        if (qla2x00_wait_for_reset_ready(vha) != QLA_SUCCESS)
                goto eh_host_reset_lock;
 
-       /*
-        * Fixme-may be dpc thread is active and processing
-        * loop_resync,so wait a while for it to
-        * be completed and then issue big hammer.Otherwise
-        * it may cause I/O failure as big hammer marks the
-        * devices as lost kicking of the port_down_timer
-        * while dpc is stuck for the mailbox to complete.
-        */
-       qla2x00_wait_for_loop_ready(vha);
        if (vha != base_vha) {
                if (qla2x00_vp_abort_isp(vha))
                        goto eh_host_reset_lock;
@@ -1297,16 +1239,13 @@ qla2x00_loop_reset(scsi_qla_host_t *vha)
                atomic_set(&vha->loop_state, LOOP_DOWN);
                atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
                qla2x00_mark_all_devices_lost(vha, 0);
-               qla2x00_wait_for_loop_ready(vha);
        }
 
        if (ha->flags.enable_lip_reset) {
                ret = qla2x00_lip_reset(vha);
-               if (ret != QLA_SUCCESS) {
+               if (ret != QLA_SUCCESS)
                        ql_dbg(ql_dbg_taskm, vha, 0x802e,
                            "lip_reset failed (%d).\n", ret);
-               } else
-                       qla2x00_wait_for_loop_ready(vha);
        }
 
        /* Issue marker command only when we are going to start the I/O */
@@ -4070,13 +4009,8 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
                /* For ISP82XX complete any pending mailbox cmd */
                if (IS_QLA82XX(ha)) {
                        ha->flags.isp82xx_fw_hung = 1;
-                       if (ha->flags.mbox_busy) {
-                               ha->flags.mbox_int = 1;
-                               ql_dbg(ql_dbg_aer, vha, 0x9001,
-                                   "Due to pci channel io frozen, doing premature "
-                                   "completion of mbx command.\n");
-                               complete(&ha->mbx_intr_comp);
-                       }
+                       ql_dbg(ql_dbg_aer, vha, 0x9001, "Pci channel io frozen\n");
+                       qla82xx_clear_pending_mbx(vha);
                }
                qla2x00_free_irqs(vha);
                pci_disable_device(pdev);
index 13b6357c1fa2ae297c811b7588b3fb1172f4dd3f..23f33a6d52d7278b5cf5d1d42a5bf44330aba183 100644 (file)
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.03.07.07-k"
+#define QLA2XXX_VERSION      "8.03.07.12-k"
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   3
index ace637bf254e1ca2b8c9d8be7490f41027945044..fd5edc6e166dec140854e737912fec75a4eebf20 100644 (file)
 #define ISCSI_ALIAS_SIZE               32      /* ISCSI Alias name size */
 #define ISCSI_NAME_SIZE                        0xE0    /* ISCSI Name size */
 
-#define QL4_SESS_RECOVERY_TMO          30      /* iSCSI session */
+#define QL4_SESS_RECOVERY_TMO          120     /* iSCSI session */
                                                /* recovery timeout */
 
 #define LSDW(x) ((u32)((u64)(x)))
 #define ISNS_DEREG_TOV                 5
 #define HBA_ONLINE_TOV                 30
 #define DISABLE_ACB_TOV                        30
+#define IP_CONFIG_TOV                  30
+#define LOGIN_TOV                      12
 
 #define MAX_RESET_HA_RETRIES           2
 
@@ -240,6 +242,45 @@ struct ddb_entry {
 
        uint16_t fw_ddb_index;  /* DDB firmware index */
        uint32_t fw_ddb_device_state; /* F/W Device State  -- see ql4_fw.h */
+       uint16_t ddb_type;
+#define FLASH_DDB 0x01
+
+       struct dev_db_entry fw_ddb_entry;
+       int (*unblock_sess)(struct iscsi_cls_session *cls_session);
+       int (*ddb_change)(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
+                         struct ddb_entry *ddb_entry, uint32_t state);
+
+       /* Driver Re-login  */
+       unsigned long flags;              /* DDB Flags */
+       uint16_t default_relogin_timeout; /*  Max time to wait for
+                                          *  relogin to complete */
+       atomic_t retry_relogin_timer;     /* Min Time between relogins
+                                          * (4000 only) */
+       atomic_t relogin_timer;           /* Max Time to wait for
+                                          * relogin to complete */
+       atomic_t relogin_retry_count;     /* Num of times relogin has been
+                                          * retried */
+       uint32_t default_time2wait;       /* Default Min time between
+                                          * relogins (+aens) */
+
+};
+
+struct qla_ddb_index {
+       struct list_head list;
+       uint16_t fw_ddb_idx;
+       struct dev_db_entry fw_ddb;
+};
+
+#define DDB_IPADDR_LEN 64
+
+struct ql4_tuple_ddb {
+       int port;
+       int tpgt;
+       char ip_addr[DDB_IPADDR_LEN];
+       char iscsi_name[ISCSI_NAME_SIZE];
+       uint16_t options;
+#define DDB_OPT_IPV6 0x0e0e
+#define DDB_OPT_IPV4 0x0f0f
 };
 
 /*
@@ -411,7 +452,7 @@ struct scsi_qla_host {
 #define AF_FW_RECOVERY                 19 /* 0x00080000 */
 #define AF_EEH_BUSY                    20 /* 0x00100000 */
 #define AF_PCI_CHANNEL_IO_PERM_FAILURE 21 /* 0x00200000 */
-
+#define AF_BUILD_DDB_LIST              22 /* 0x00400000 */
        unsigned long dpc_flags;
 
 #define DPC_RESET_HA                   1 /* 0x00000002 */
@@ -604,6 +645,7 @@ struct scsi_qla_host {
        uint16_t bootload_minor;
        uint16_t bootload_patch;
        uint16_t bootload_build;
+       uint16_t def_timeout; /* Default login timeout */
 
        uint32_t flash_state;
 #define        QLFLASH_WAITING         0
@@ -623,6 +665,11 @@ struct scsi_qla_host {
        uint16_t iscsi_pci_func_cnt;
        uint8_t model_name[16];
        struct completion disable_acb_comp;
+       struct dma_pool *fw_ddb_dma_pool;
+#define DDB_DMA_BLOCK_SIZE 512
+       uint16_t pri_ddb_idx;
+       uint16_t sec_ddb_idx;
+       int is_reset;
 };
 
 struct ql4_task_data {
@@ -835,6 +882,10 @@ static inline int ql4xxx_reset_active(struct scsi_qla_host *ha)
 /*---------------------------------------------------------------------------*/
 
 /* Defines for qla4xxx_initialize_adapter() and qla4xxx_recover_adapter() */
+
+#define INIT_ADAPTER    0
+#define RESET_ADAPTER   1
+
 #define PRESERVE_DDB_LIST      0
 #define REBUILD_DDB_LIST       1
 
index cbd5a20dbbd150c7a1fbe4840b7a547a1097dc2a..4ac07f882521307ef0f018806408e4dded971499 100644 (file)
@@ -12,6 +12,7 @@
 #define MAX_PRST_DEV_DB_ENTRIES                64
 #define MIN_DISC_DEV_DB_ENTRY          MAX_PRST_DEV_DB_ENTRIES
 #define MAX_DEV_DB_ENTRIES             512
+#define MAX_DEV_DB_ENTRIES_40XX                256
 
 /*************************************************************************
  *
@@ -604,6 +605,13 @@ struct addr_ctrl_blk {
        uint8_t res14[140];     /* 274-2FF */
 };
 
+#define IP_ADDR_COUNT  4 /* Total 4 IP address supported in one interface
+                          * One IPv4, one IPv6 link local and 2 IPv6
+                          */
+
+#define IP_STATE_MASK  0x0F000000
+#define IP_STATE_SHIFT 24
+
 struct init_fw_ctrl_blk {
        struct addr_ctrl_blk pri;
 /*     struct addr_ctrl_blk sec;*/
index 160db9d5ea2101e8ccb2ef4772c81429747a4b0d..d0dd4b33020643dd5bad1cf7d3c30a1d5d02575c 100644 (file)
@@ -13,7 +13,7 @@ struct iscsi_cls_conn;
 int qla4xxx_hw_reset(struct scsi_qla_host *ha);
 int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a);
 int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb *srb);
-int qla4xxx_initialize_adapter(struct scsi_qla_host *ha);
+int qla4xxx_initialize_adapter(struct scsi_qla_host *ha, int is_reset);
 int qla4xxx_soft_reset(struct scsi_qla_host *ha);
 irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id);
 
@@ -153,10 +153,13 @@ int qla4xxx_req_ddb_entry(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
                          uint32_t *mbx_sts);
 int qla4xxx_clear_ddb_entry(struct scsi_qla_host *ha, uint32_t fw_ddb_index);
 int qla4xxx_send_passthru0(struct iscsi_task *task);
+void qla4xxx_free_ddb_index(struct scsi_qla_host *ha);
 int qla4xxx_get_mgmt_data(struct scsi_qla_host *ha, uint16_t fw_ddb_index,
                          uint16_t stats_size, dma_addr_t stats_dma);
 void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
                                       struct ddb_entry *ddb_entry);
+void qla4xxx_update_session_conn_fwddb_param(struct scsi_qla_host *ha,
+                                            struct ddb_entry *ddb_entry);
 int qla4xxx_bootdb_by_index(struct scsi_qla_host *ha,
                            struct dev_db_entry *fw_ddb_entry,
                            dma_addr_t fw_ddb_entry_dma, uint16_t ddb_index);
@@ -169,11 +172,22 @@ int qla4xxx_set_nvram(struct scsi_qla_host *ha, dma_addr_t nvram_dma,
 int qla4xxx_restore_factory_defaults(struct scsi_qla_host *ha,
                                     uint32_t region, uint32_t field0,
                                     uint32_t field1);
+int qla4xxx_get_ddb_index(struct scsi_qla_host *ha, uint16_t *ddb_index);
+void qla4xxx_login_flash_ddb(struct iscsi_cls_session *cls_session);
+int qla4xxx_unblock_ddb(struct iscsi_cls_session *cls_session);
+int qla4xxx_unblock_flash_ddb(struct iscsi_cls_session *cls_session);
+int qla4xxx_flash_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
+                            struct ddb_entry *ddb_entry, uint32_t state);
+int qla4xxx_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
+                      struct ddb_entry *ddb_entry, uint32_t state);
+void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset);
 
 /* BSG Functions */
 int qla4xxx_bsg_request(struct bsg_job *bsg_job);
 int qla4xxx_process_vendor_specific(struct bsg_job *bsg_job);
 
+void qla4xxx_arm_relogin_timer(struct ddb_entry *ddb_entry);
+
 extern int ql4xextended_error_logging;
 extern int ql4xdontresethba;
 extern int ql4xenablemsix;
index 3075fbaef5533d6574cedce72f9c24b722696afa..1bdfa8120ac888c65c304c28dc3f3aba806ea403 100644 (file)
@@ -773,22 +773,24 @@ int qla4xxx_start_firmware(struct scsi_qla_host *ha)
  * be freed so that when login happens from user space there are free DDB
  * indices available.
  **/
-static void qla4xxx_free_ddb_index(struct scsi_qla_host *ha)
+void qla4xxx_free_ddb_index(struct scsi_qla_host *ha)
 {
        int max_ddbs;
        int ret;
        uint32_t idx = 0, next_idx = 0;
        uint32_t state = 0, conn_err = 0;
 
-       max_ddbs =  is_qla40XX(ha) ? MAX_PRST_DEV_DB_ENTRIES :
+       max_ddbs =  is_qla40XX(ha) ? MAX_DEV_DB_ENTRIES_40XX :
                                     MAX_DEV_DB_ENTRIES;
 
        for (idx = 0; idx < max_ddbs; idx = next_idx) {
                ret = qla4xxx_get_fwddb_entry(ha, idx, NULL, 0, NULL,
                                              &next_idx, &state, &conn_err,
                                                NULL, NULL);
-               if (ret == QLA_ERROR)
+               if (ret == QLA_ERROR) {
+                       next_idx++;
                        continue;
+               }
                if (state == DDB_DS_NO_CONNECTION_ACTIVE ||
                    state == DDB_DS_SESSION_FAILED) {
                        DEBUG2(ql4_printk(KERN_INFO, ha,
@@ -804,7 +806,6 @@ static void qla4xxx_free_ddb_index(struct scsi_qla_host *ha)
        }
 }
 
-
 /**
  * qla4xxx_initialize_adapter - initiailizes hba
  * @ha: Pointer to host adapter structure.
@@ -812,7 +813,7 @@ static void qla4xxx_free_ddb_index(struct scsi_qla_host *ha)
  * This routine parforms all of the steps necessary to initialize the adapter.
  *
  **/
-int qla4xxx_initialize_adapter(struct scsi_qla_host *ha)
+int qla4xxx_initialize_adapter(struct scsi_qla_host *ha, int is_reset)
 {
        int status = QLA_ERROR;
 
@@ -840,7 +841,8 @@ int qla4xxx_initialize_adapter(struct scsi_qla_host *ha)
        if (status == QLA_ERROR)
                goto exit_init_hba;
 
-       qla4xxx_free_ddb_index(ha);
+       if (is_reset == RESET_ADAPTER)
+               qla4xxx_build_ddb_list(ha, is_reset);
 
        set_bit(AF_ONLINE, &ha->flags);
 exit_init_hba:
@@ -855,38 +857,12 @@ exit_init_hba:
        return status;
 }
 
-/**
- * qla4xxx_process_ddb_changed - process ddb state change
- * @ha - Pointer to host adapter structure.
- * @fw_ddb_index - Firmware's device database index
- * @state - Device state
- *
- * This routine processes a Decive Database Changed AEN Event.
- **/
-int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
-               uint32_t state, uint32_t conn_err)
+int qla4xxx_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
+                      struct ddb_entry *ddb_entry, uint32_t state)
 {
-       struct ddb_entry * ddb_entry;
        uint32_t old_fw_ddb_device_state;
        int status = QLA_ERROR;
 
-       /* check for out of range index */
-       if (fw_ddb_index >= MAX_DDB_ENTRIES)
-               goto exit_ddb_event;
-
-       /* Get the corresponging ddb entry */
-       ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, fw_ddb_index);
-       /* Device does not currently exist in our database. */
-       if (ddb_entry == NULL) {
-               ql4_printk(KERN_ERR, ha, "%s: No ddb_entry at FW index [%d]\n",
-                          __func__, fw_ddb_index);
-
-               if (state == DDB_DS_NO_CONNECTION_ACTIVE)
-                       clear_bit(fw_ddb_index, ha->ddb_idx_map);
-
-               goto exit_ddb_event;
-       }
-
        old_fw_ddb_device_state = ddb_entry->fw_ddb_device_state;
        DEBUG2(ql4_printk(KERN_INFO, ha,
                          "%s: DDB - old state = 0x%x, new state = 0x%x for "
@@ -900,9 +876,7 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
                switch (state) {
                case DDB_DS_SESSION_ACTIVE:
                case DDB_DS_DISCOVERY:
-                       iscsi_conn_start(ddb_entry->conn);
-                       iscsi_conn_login_event(ddb_entry->conn,
-                                              ISCSI_CONN_STATE_LOGGED_IN);
+                       ddb_entry->unblock_sess(ddb_entry->sess);
                        qla4xxx_update_session_conn_param(ha, ddb_entry);
                        status = QLA_SUCCESS;
                        break;
@@ -936,9 +910,7 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
                switch (state) {
                case DDB_DS_SESSION_ACTIVE:
                case DDB_DS_DISCOVERY:
-                       iscsi_conn_start(ddb_entry->conn);
-                       iscsi_conn_login_event(ddb_entry->conn,
-                                              ISCSI_CONN_STATE_LOGGED_IN);
+                       ddb_entry->unblock_sess(ddb_entry->sess);
                        qla4xxx_update_session_conn_param(ha, ddb_entry);
                        status = QLA_SUCCESS;
                        break;
@@ -954,7 +926,198 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
                                __func__));
                break;
        }
+       return status;
+}
+
+void qla4xxx_arm_relogin_timer(struct ddb_entry *ddb_entry)
+{
+       /*
+        * This triggers a relogin.  After the relogin_timer
+        * expires, the relogin gets scheduled.  We must wait a
+        * minimum amount of time since receiving an 0x8014 AEN
+        * with failed device_state or a logout response before
+        * we can issue another relogin.
+        *
+        * Firmware pads this timeout: (time2wait +1).
+        * Driver retry to login should be longer than F/W.
+        * Otherwise F/W will fail
+        * set_ddb() mbx cmd with 0x4005 since it still
+        * counting down its time2wait.
+        */
+       atomic_set(&ddb_entry->relogin_timer, 0);
+       atomic_set(&ddb_entry->retry_relogin_timer,
+                  ddb_entry->default_time2wait + 4);
+
+}
+
+int qla4xxx_flash_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
+                            struct ddb_entry *ddb_entry, uint32_t state)
+{
+       uint32_t old_fw_ddb_device_state;
+       int status = QLA_ERROR;
+
+       old_fw_ddb_device_state = ddb_entry->fw_ddb_device_state;
+       DEBUG2(ql4_printk(KERN_INFO, ha,
+                         "%s: DDB - old state = 0x%x, new state = 0x%x for "
+                         "index [%d]\n", __func__,
+                         ddb_entry->fw_ddb_device_state, state, fw_ddb_index));
+
+       ddb_entry->fw_ddb_device_state = state;
+
+       switch (old_fw_ddb_device_state) {
+       case DDB_DS_LOGIN_IN_PROCESS:
+       case DDB_DS_NO_CONNECTION_ACTIVE:
+               switch (state) {
+               case DDB_DS_SESSION_ACTIVE:
+                       ddb_entry->unblock_sess(ddb_entry->sess);
+                       qla4xxx_update_session_conn_fwddb_param(ha, ddb_entry);
+                       status = QLA_SUCCESS;
+                       break;
+               case DDB_DS_SESSION_FAILED:
+                       iscsi_block_session(ddb_entry->sess);
+                       if (!test_bit(DF_RELOGIN, &ddb_entry->flags))
+                               qla4xxx_arm_relogin_timer(ddb_entry);
+                       status = QLA_SUCCESS;
+                       break;
+               }
+               break;
+       case DDB_DS_SESSION_ACTIVE:
+               switch (state) {
+               case DDB_DS_SESSION_FAILED:
+                       iscsi_block_session(ddb_entry->sess);
+                       if (!test_bit(DF_RELOGIN, &ddb_entry->flags))
+                               qla4xxx_arm_relogin_timer(ddb_entry);
+                       status = QLA_SUCCESS;
+                       break;
+               }
+               break;
+       case DDB_DS_SESSION_FAILED:
+               switch (state) {
+               case DDB_DS_SESSION_ACTIVE:
+                       ddb_entry->unblock_sess(ddb_entry->sess);
+                       qla4xxx_update_session_conn_fwddb_param(ha, ddb_entry);
+                       status = QLA_SUCCESS;
+                       break;
+               case DDB_DS_SESSION_FAILED:
+                       if (!test_bit(DF_RELOGIN, &ddb_entry->flags))
+                               qla4xxx_arm_relogin_timer(ddb_entry);
+                       status = QLA_SUCCESS;
+                       break;
+               }
+               break;
+       default:
+               DEBUG2(ql4_printk(KERN_INFO, ha, "%s: Unknown Event\n",
+                                 __func__));
+               break;
+       }
+       return status;
+}
+
+/**
+ * qla4xxx_process_ddb_changed - process ddb state change
+ * @ha - Pointer to host adapter structure.
+ * @fw_ddb_index - Firmware's device database index
+ * @state - Device state
+ *
+ * This routine processes a Decive Database Changed AEN Event.
+ **/
+int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha,
+                               uint32_t fw_ddb_index,
+                               uint32_t state, uint32_t conn_err)
+{
+       struct ddb_entry *ddb_entry;
+       int status = QLA_ERROR;
+
+       /* check for out of range index */
+       if (fw_ddb_index >= MAX_DDB_ENTRIES)
+               goto exit_ddb_event;
+
+       /* Get the corresponging ddb entry */
+       ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, fw_ddb_index);
+       /* Device does not currently exist in our database. */
+       if (ddb_entry == NULL) {
+               ql4_printk(KERN_ERR, ha, "%s: No ddb_entry at FW index [%d]\n",
+                          __func__, fw_ddb_index);
+
+               if (state == DDB_DS_NO_CONNECTION_ACTIVE)
+                       clear_bit(fw_ddb_index, ha->ddb_idx_map);
+
+               goto exit_ddb_event;
+       }
+
+       ddb_entry->ddb_change(ha, fw_ddb_index, ddb_entry, state);
 
 exit_ddb_event:
        return status;
 }
+
+/**
+ * qla4xxx_login_flash_ddb - Login to target (DDB)
+ * @cls_session: Pointer to the session to login
+ *
+ * This routine logins to the target.
+ * Issues setddb and conn open mbx
+ **/
+void qla4xxx_login_flash_ddb(struct iscsi_cls_session *cls_session)
+{
+       struct iscsi_session *sess;
+       struct ddb_entry *ddb_entry;
+       struct scsi_qla_host *ha;
+       struct dev_db_entry *fw_ddb_entry = NULL;
+       dma_addr_t fw_ddb_dma;
+       uint32_t mbx_sts = 0;
+       int ret;
+
+       sess = cls_session->dd_data;
+       ddb_entry = sess->dd_data;
+       ha =  ddb_entry->ha;
+
+       if (!test_bit(AF_LINK_UP, &ha->flags))
+               return;
+
+       if (ddb_entry->ddb_type != FLASH_DDB) {
+               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                 "Skipping login to non FLASH DB"));
+               goto exit_login;
+       }
+
+       fw_ddb_entry = dma_pool_alloc(ha->fw_ddb_dma_pool, GFP_KERNEL,
+                                     &fw_ddb_dma);
+       if (fw_ddb_entry == NULL) {
+               DEBUG2(ql4_printk(KERN_ERR, ha, "Out of memory\n"));
+               goto exit_login;
+       }
+
+       if (ddb_entry->fw_ddb_index == INVALID_ENTRY) {
+               ret = qla4xxx_get_ddb_index(ha, &ddb_entry->fw_ddb_index);
+               if (ret == QLA_ERROR)
+                       goto exit_login;
+
+               ha->fw_ddb_index_map[ddb_entry->fw_ddb_index] = ddb_entry;
+               ha->tot_ddbs++;
+       }
+
+       memcpy(fw_ddb_entry, &ddb_entry->fw_ddb_entry,
+              sizeof(struct dev_db_entry));
+       ddb_entry->sess->target_id = ddb_entry->fw_ddb_index;
+
+       ret = qla4xxx_set_ddb_entry(ha, ddb_entry->fw_ddb_index,
+                                   fw_ddb_dma, &mbx_sts);
+       if (ret == QLA_ERROR) {
+               DEBUG2(ql4_printk(KERN_ERR, ha, "Set DDB failed\n"));
+               goto exit_login;
+       }
+
+       ddb_entry->fw_ddb_device_state = DDB_DS_LOGIN_IN_PROCESS;
+       ret = qla4xxx_conn_open(ha, ddb_entry->fw_ddb_index);
+       if (ret == QLA_ERROR) {
+               ql4_printk(KERN_ERR, ha, "%s: Login failed: %s\n", __func__,
+                          sess->targetname);
+               goto exit_login;
+       }
+
+exit_login:
+       if (fw_ddb_entry)
+               dma_pool_free(ha->fw_ddb_dma_pool, fw_ddb_entry, fw_ddb_dma);
+}
+
index 4c2b84870392e16f1ed03428aa7ed9c004c9cbd9..c2593782fbbef8c203148b1661c92a3e1dbe35f6 100644 (file)
@@ -41,6 +41,16 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
                return status;
        }
 
+       if (is_qla40XX(ha)) {
+               if (test_bit(AF_HA_REMOVAL, &ha->flags)) {
+                       DEBUG2(ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: "
+                                         "prematurely completing mbx cmd as "
+                                         "adapter removal detected\n",
+                                         ha->host_no, __func__));
+                       return status;
+               }
+       }
+
        if (is_qla8022(ha)) {
                if (test_bit(AF_FW_RECOVERY, &ha->flags)) {
                        DEBUG2(ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: "
@@ -413,6 +423,7 @@ qla4xxx_update_local_ifcb(struct scsi_qla_host *ha,
        memcpy(ha->name_string, init_fw_cb->iscsi_name,
                min(sizeof(ha->name_string),
                sizeof(init_fw_cb->iscsi_name)));
+       ha->def_timeout = le16_to_cpu(init_fw_cb->def_timeout);
        /*memcpy(ha->alias, init_fw_cb->Alias,
               min(sizeof(ha->alias), sizeof(init_fw_cb->Alias)));*/
 
index 30f31b127f33750dd384770cb5b1ba1b3e33807d..4169c8baa112a41266b4a05335290f7b1fdf90fd 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/slab.h>
 #include <linux/blkdev.h>
 #include <linux/iscsi_boot_sysfs.h>
+#include <linux/inet.h>
 
 #include <scsi/scsi_tcq.h>
 #include <scsi/scsicam.h>
@@ -31,6 +32,13 @@ static struct kmem_cache *srb_cachep;
 /*
  * Module parameter information and variables
  */
+int ql4xdisablesysfsboot = 1;
+module_param(ql4xdisablesysfsboot, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(ql4xdisablesysfsboot,
+               "Set to disable exporting boot targets to sysfs\n"
+               " 0 - Export boot targets\n"
+               " 1 - Do not export boot targets (Default)");
+
 int ql4xdontresethba = 0;
 module_param(ql4xdontresethba, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(ql4xdontresethba,
@@ -63,7 +71,7 @@ static int ql4xsess_recovery_tmo = QL4_SESS_RECOVERY_TMO;
 module_param(ql4xsess_recovery_tmo, int, S_IRUGO);
 MODULE_PARM_DESC(ql4xsess_recovery_tmo,
                "Target Session Recovery Timeout.\n"
-               " Default: 30 sec.");
+               " Default: 120 sec.");
 
 static int qla4xxx_wait_for_hba_online(struct scsi_qla_host *ha);
 /*
@@ -415,7 +423,7 @@ static int qla4xxx_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
        qla_ep = ep->dd_data;
        ha = to_qla_host(qla_ep->host);
 
-       if (adapter_up(ha))
+       if (adapter_up(ha) && !test_bit(AF_BUILD_DDB_LIST, &ha->flags))
                ret = 1;
 
        return ret;
@@ -975,6 +983,150 @@ static int qla4xxx_conn_get_param(struct iscsi_cls_conn *cls_conn,
 
 }
 
+int qla4xxx_get_ddb_index(struct scsi_qla_host *ha, uint16_t *ddb_index)
+{
+       uint32_t mbx_sts = 0;
+       uint16_t tmp_ddb_index;
+       int ret;
+
+get_ddb_index:
+       tmp_ddb_index = find_first_zero_bit(ha->ddb_idx_map, MAX_DDB_ENTRIES);
+
+       if (tmp_ddb_index >= MAX_DDB_ENTRIES) {
+               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                 "Free DDB index not available\n"));
+               ret = QLA_ERROR;
+               goto exit_get_ddb_index;
+       }
+
+       if (test_and_set_bit(tmp_ddb_index, ha->ddb_idx_map))
+               goto get_ddb_index;
+
+       DEBUG2(ql4_printk(KERN_INFO, ha,
+                         "Found a free DDB index at %d\n", tmp_ddb_index));
+       ret = qla4xxx_req_ddb_entry(ha, tmp_ddb_index, &mbx_sts);
+       if (ret == QLA_ERROR) {
+               if (mbx_sts == MBOX_STS_COMMAND_ERROR) {
+                       ql4_printk(KERN_INFO, ha,
+                                  "DDB index = %d not available trying next\n",
+                                  tmp_ddb_index);
+                       goto get_ddb_index;
+               }
+               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                 "Free FW DDB not available\n"));
+       }
+
+       *ddb_index = tmp_ddb_index;
+
+exit_get_ddb_index:
+       return ret;
+}
+
+static int qla4xxx_match_ipaddress(struct scsi_qla_host *ha,
+                                  struct ddb_entry *ddb_entry,
+                                  char *existing_ipaddr,
+                                  char *user_ipaddr)
+{
+       uint8_t dst_ipaddr[IPv6_ADDR_LEN];
+       char formatted_ipaddr[DDB_IPADDR_LEN];
+       int status = QLA_SUCCESS, ret = 0;
+
+       if (ddb_entry->fw_ddb_entry.options & DDB_OPT_IPV6_DEVICE) {
+               ret = in6_pton(user_ipaddr, strlen(user_ipaddr), dst_ipaddr,
+                              '\0', NULL);
+               if (ret == 0) {
+                       status = QLA_ERROR;
+                       goto out_match;
+               }
+               ret = sprintf(formatted_ipaddr, "%pI6", dst_ipaddr);
+       } else {
+               ret = in4_pton(user_ipaddr, strlen(user_ipaddr), dst_ipaddr,
+                              '\0', NULL);
+               if (ret == 0) {
+                       status = QLA_ERROR;
+                       goto out_match;
+               }
+               ret = sprintf(formatted_ipaddr, "%pI4", dst_ipaddr);
+       }
+
+       if (strcmp(existing_ipaddr, formatted_ipaddr))
+               status = QLA_ERROR;
+
+out_match:
+       return status;
+}
+
+static int qla4xxx_match_fwdb_session(struct scsi_qla_host *ha,
+                                     struct iscsi_cls_conn *cls_conn)
+{
+       int idx = 0, max_ddbs, rval;
+       struct iscsi_cls_session *cls_sess = iscsi_conn_to_session(cls_conn);
+       struct iscsi_session *sess, *existing_sess;
+       struct iscsi_conn *conn, *existing_conn;
+       struct ddb_entry *ddb_entry;
+
+       sess = cls_sess->dd_data;
+       conn = cls_conn->dd_data;
+
+       if (sess->targetname == NULL ||
+           conn->persistent_address == NULL ||
+           conn->persistent_port == 0)
+               return QLA_ERROR;
+
+       max_ddbs =  is_qla40XX(ha) ? MAX_DEV_DB_ENTRIES_40XX :
+                                    MAX_DEV_DB_ENTRIES;
+
+       for (idx = 0; idx < max_ddbs; idx++) {
+               ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, idx);
+               if (ddb_entry == NULL)
+                       continue;
+
+               if (ddb_entry->ddb_type != FLASH_DDB)
+                       continue;
+
+               existing_sess = ddb_entry->sess->dd_data;
+               existing_conn = ddb_entry->conn->dd_data;
+
+               if (existing_sess->targetname == NULL ||
+                   existing_conn->persistent_address == NULL ||
+                   existing_conn->persistent_port == 0)
+                       continue;
+
+               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                 "IQN = %s User IQN = %s\n",
+                                 existing_sess->targetname,
+                                 sess->targetname));
+
+               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                 "IP = %s User IP = %s\n",
+                                 existing_conn->persistent_address,
+                                 conn->persistent_address));
+
+               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                 "Port = %d User Port = %d\n",
+                                 existing_conn->persistent_port,
+                                 conn->persistent_port));
+
+               if (strcmp(existing_sess->targetname, sess->targetname))
+                       continue;
+               rval = qla4xxx_match_ipaddress(ha, ddb_entry,
+                                       existing_conn->persistent_address,
+                                       conn->persistent_address);
+               if (rval == QLA_ERROR)
+                       continue;
+               if (existing_conn->persistent_port != conn->persistent_port)
+                       continue;
+               break;
+       }
+
+       if (idx == max_ddbs)
+               return QLA_ERROR;
+
+       DEBUG2(ql4_printk(KERN_INFO, ha,
+                         "Match found in fwdb sessions\n"));
+       return QLA_SUCCESS;
+}
+
 static struct iscsi_cls_session *
 qla4xxx_session_create(struct iscsi_endpoint *ep,
                        uint16_t cmds_max, uint16_t qdepth,
@@ -984,8 +1136,7 @@ qla4xxx_session_create(struct iscsi_endpoint *ep,
        struct scsi_qla_host *ha;
        struct qla_endpoint *qla_ep;
        struct ddb_entry *ddb_entry;
-       uint32_t ddb_index;
-       uint32_t mbx_sts = 0;
+       uint16_t ddb_index;
        struct iscsi_session *sess;
        struct sockaddr *dst_addr;
        int ret;
@@ -1000,32 +1151,9 @@ qla4xxx_session_create(struct iscsi_endpoint *ep,
        dst_addr = (struct sockaddr *)&qla_ep->dst_addr;
        ha = to_qla_host(qla_ep->host);
 
-get_ddb_index:
-       ddb_index = find_first_zero_bit(ha->ddb_idx_map, MAX_DDB_ENTRIES);
-
-       if (ddb_index >= MAX_DDB_ENTRIES) {
-               DEBUG2(ql4_printk(KERN_INFO, ha,
-                                 "Free DDB index not available\n"));
-               return NULL;
-       }
-
-       if (test_and_set_bit(ddb_index, ha->ddb_idx_map))
-               goto get_ddb_index;
-
-       DEBUG2(ql4_printk(KERN_INFO, ha,
-                         "Found a free DDB index at %d\n", ddb_index));
-       ret = qla4xxx_req_ddb_entry(ha, ddb_index, &mbx_sts);
-       if (ret == QLA_ERROR) {
-               if (mbx_sts == MBOX_STS_COMMAND_ERROR) {
-                       ql4_printk(KERN_INFO, ha,
-                                  "DDB index = %d not available trying next\n",
-                                  ddb_index);
-                       goto get_ddb_index;
-               }
-               DEBUG2(ql4_printk(KERN_INFO, ha,
-                                 "Free FW DDB not available\n"));
+       ret = qla4xxx_get_ddb_index(ha, &ddb_index);
+       if (ret == QLA_ERROR)
                return NULL;
-       }
 
        cls_sess = iscsi_session_setup(&qla4xxx_iscsi_transport, qla_ep->host,
                                       cmds_max, sizeof(struct ddb_entry),
@@ -1040,6 +1168,8 @@ get_ddb_index:
        ddb_entry->fw_ddb_device_state = DDB_DS_NO_CONNECTION_ACTIVE;
        ddb_entry->ha = ha;
        ddb_entry->sess = cls_sess;
+       ddb_entry->unblock_sess = qla4xxx_unblock_ddb;
+       ddb_entry->ddb_change = qla4xxx_ddb_change;
        cls_sess->recovery_tmo = ql4xsess_recovery_tmo;
        ha->fw_ddb_index_map[ddb_entry->fw_ddb_index] = ddb_entry;
        ha->tot_ddbs++;
@@ -1077,6 +1207,9 @@ qla4xxx_conn_create(struct iscsi_cls_session *cls_sess, uint32_t conn_idx)
        DEBUG2(printk(KERN_INFO "Func: %s\n", __func__));
        cls_conn = iscsi_conn_setup(cls_sess, sizeof(struct qla_conn),
                                    conn_idx);
+       if (!cls_conn)
+               return NULL;
+
        sess = cls_sess->dd_data;
        ddb_entry = sess->dd_data;
        ddb_entry->conn = cls_conn;
@@ -1109,7 +1242,7 @@ static int qla4xxx_conn_start(struct iscsi_cls_conn *cls_conn)
        struct iscsi_session *sess;
        struct ddb_entry *ddb_entry;
        struct scsi_qla_host *ha;
-       struct dev_db_entry *fw_ddb_entry;
+       struct dev_db_entry *fw_ddb_entry = NULL;
        dma_addr_t fw_ddb_entry_dma;
        uint32_t mbx_sts = 0;
        int ret = 0;
@@ -1120,12 +1253,25 @@ static int qla4xxx_conn_start(struct iscsi_cls_conn *cls_conn)
        ddb_entry = sess->dd_data;
        ha = ddb_entry->ha;
 
+       /* Check if we have  matching FW DDB, if yes then do not
+        * login to this target. This could cause target to logout previous
+        * connection
+        */
+       ret = qla4xxx_match_fwdb_session(ha, cls_conn);
+       if (ret == QLA_SUCCESS) {
+               ql4_printk(KERN_INFO, ha,
+                          "Session already exist in FW.\n");
+               ret = -EEXIST;
+               goto exit_conn_start;
+       }
+
        fw_ddb_entry = dma_alloc_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry),
                                          &fw_ddb_entry_dma, GFP_KERNEL);
        if (!fw_ddb_entry) {
                ql4_printk(KERN_ERR, ha,
                           "%s: Unable to allocate dma buffer\n", __func__);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto exit_conn_start;
        }
 
        ret = qla4xxx_set_param_ddbentry(ha, ddb_entry, cls_conn, &mbx_sts);
@@ -1138,9 +1284,7 @@ static int qla4xxx_conn_start(struct iscsi_cls_conn *cls_conn)
                if (mbx_sts)
                        if (ddb_entry->fw_ddb_device_state ==
                                                DDB_DS_SESSION_ACTIVE) {
-                               iscsi_conn_start(ddb_entry->conn);
-                               iscsi_conn_login_event(ddb_entry->conn,
-                                               ISCSI_CONN_STATE_LOGGED_IN);
+                               ddb_entry->unblock_sess(ddb_entry->sess);
                                goto exit_set_param;
                        }
 
@@ -1167,8 +1311,9 @@ exit_set_param:
        ret = 0;
 
 exit_conn_start:
-       dma_free_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry),
-                         fw_ddb_entry, fw_ddb_entry_dma);
+       if (fw_ddb_entry)
+               dma_free_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry),
+                                 fw_ddb_entry, fw_ddb_entry_dma);
        return ret;
 }
 
@@ -1344,6 +1489,101 @@ static int qla4xxx_task_xmit(struct iscsi_task *task)
        return -ENOSYS;
 }
 
+static void qla4xxx_copy_fwddb_param(struct scsi_qla_host *ha,
+                                    struct dev_db_entry *fw_ddb_entry,
+                                    struct iscsi_cls_session *cls_sess,
+                                    struct iscsi_cls_conn *cls_conn)
+{
+       int buflen = 0;
+       struct iscsi_session *sess;
+       struct iscsi_conn *conn;
+       char ip_addr[DDB_IPADDR_LEN];
+       uint16_t options = 0;
+
+       sess = cls_sess->dd_data;
+       conn = cls_conn->dd_data;
+
+       conn->max_recv_dlength = BYTE_UNITS *
+                         le16_to_cpu(fw_ddb_entry->iscsi_max_rcv_data_seg_len);
+
+       conn->max_xmit_dlength = BYTE_UNITS *
+                         le16_to_cpu(fw_ddb_entry->iscsi_max_snd_data_seg_len);
+
+       sess->initial_r2t_en =
+                           (BIT_10 & le16_to_cpu(fw_ddb_entry->iscsi_options));
+
+       sess->max_r2t = le16_to_cpu(fw_ddb_entry->iscsi_max_outsnd_r2t);
+
+       sess->imm_data_en = (BIT_11 & le16_to_cpu(fw_ddb_entry->iscsi_options));
+
+       sess->first_burst = BYTE_UNITS *
+                              le16_to_cpu(fw_ddb_entry->iscsi_first_burst_len);
+
+       sess->max_burst = BYTE_UNITS *
+                                le16_to_cpu(fw_ddb_entry->iscsi_max_burst_len);
+
+       sess->time2wait = le16_to_cpu(fw_ddb_entry->iscsi_def_time2wait);
+
+       sess->time2retain = le16_to_cpu(fw_ddb_entry->iscsi_def_time2retain);
+
+       conn->persistent_port = le16_to_cpu(fw_ddb_entry->port);
+
+       sess->tpgt = le32_to_cpu(fw_ddb_entry->tgt_portal_grp);
+
+       options = le16_to_cpu(fw_ddb_entry->options);
+       if (options & DDB_OPT_IPV6_DEVICE)
+               sprintf(ip_addr, "%pI6", fw_ddb_entry->ip_addr);
+       else
+               sprintf(ip_addr, "%pI4", fw_ddb_entry->ip_addr);
+
+       iscsi_set_param(cls_conn, ISCSI_PARAM_TARGET_NAME,
+                       (char *)fw_ddb_entry->iscsi_name, buflen);
+       iscsi_set_param(cls_conn, ISCSI_PARAM_INITIATOR_NAME,
+                       (char *)ha->name_string, buflen);
+       iscsi_set_param(cls_conn, ISCSI_PARAM_PERSISTENT_ADDRESS,
+                       (char *)ip_addr, buflen);
+}
+
+void qla4xxx_update_session_conn_fwddb_param(struct scsi_qla_host *ha,
+                                            struct ddb_entry *ddb_entry)
+{
+       struct iscsi_cls_session *cls_sess;
+       struct iscsi_cls_conn *cls_conn;
+       uint32_t ddb_state;
+       dma_addr_t fw_ddb_entry_dma;
+       struct dev_db_entry *fw_ddb_entry;
+
+       fw_ddb_entry = dma_alloc_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry),
+                                         &fw_ddb_entry_dma, GFP_KERNEL);
+       if (!fw_ddb_entry) {
+               ql4_printk(KERN_ERR, ha,
+                          "%s: Unable to allocate dma buffer\n", __func__);
+               goto exit_session_conn_fwddb_param;
+       }
+
+       if (qla4xxx_get_fwddb_entry(ha, ddb_entry->fw_ddb_index, fw_ddb_entry,
+                                   fw_ddb_entry_dma, NULL, NULL, &ddb_state,
+                                   NULL, NULL, NULL) == QLA_ERROR) {
+               DEBUG2(ql4_printk(KERN_ERR, ha, "scsi%ld: %s: failed "
+                                 "get_ddb_entry for fw_ddb_index %d\n",
+                                 ha->host_no, __func__,
+                                 ddb_entry->fw_ddb_index));
+               goto exit_session_conn_fwddb_param;
+       }
+
+       cls_sess = ddb_entry->sess;
+
+       cls_conn = ddb_entry->conn;
+
+       /* Update params */
+       qla4xxx_copy_fwddb_param(ha, fw_ddb_entry, cls_sess, cls_conn);
+
+exit_session_conn_fwddb_param:
+       if (fw_ddb_entry)
+               dma_free_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry),
+                                 fw_ddb_entry, fw_ddb_entry_dma);
+}
+
 void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
                                       struct ddb_entry *ddb_entry)
 {
@@ -1360,7 +1600,7 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
        if (!fw_ddb_entry) {
                ql4_printk(KERN_ERR, ha,
                           "%s: Unable to allocate dma buffer\n", __func__);
-               return;
+               goto exit_session_conn_param;
        }
 
        if (qla4xxx_get_fwddb_entry(ha, ddb_entry->fw_ddb_index, fw_ddb_entry,
@@ -1370,7 +1610,7 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
                                  "get_ddb_entry for fw_ddb_index %d\n",
                                  ha->host_no, __func__,
                                  ddb_entry->fw_ddb_index));
-               return;
+               goto exit_session_conn_param;
        }
 
        cls_sess = ddb_entry->sess;
@@ -1379,6 +1619,12 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
        cls_conn = ddb_entry->conn;
        conn = cls_conn->dd_data;
 
+       /* Update timers after login */
+       ddb_entry->default_relogin_timeout =
+                               le16_to_cpu(fw_ddb_entry->def_timeout);
+       ddb_entry->default_time2wait =
+                               le16_to_cpu(fw_ddb_entry->iscsi_def_time2wait);
+
        /* Update params */
        conn->max_recv_dlength = BYTE_UNITS *
                          le16_to_cpu(fw_ddb_entry->iscsi_max_rcv_data_seg_len);
@@ -1407,6 +1653,11 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
 
        memcpy(sess->initiatorname, ha->name_string,
               min(sizeof(ha->name_string), sizeof(sess->initiatorname)));
+
+exit_session_conn_param:
+       if (fw_ddb_entry)
+               dma_free_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry),
+                                 fw_ddb_entry, fw_ddb_entry_dma);
 }
 
 /*
@@ -1607,6 +1858,9 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
                vfree(ha->chap_list);
        ha->chap_list = NULL;
 
+       if (ha->fw_ddb_dma_pool)
+               dma_pool_destroy(ha->fw_ddb_dma_pool);
+
        /* release io space registers  */
        if (is_qla8022(ha)) {
                if (ha->nx_pcibase)
@@ -1689,6 +1943,16 @@ static int qla4xxx_mem_alloc(struct scsi_qla_host *ha)
                goto mem_alloc_error_exit;
        }
 
+       ha->fw_ddb_dma_pool = dma_pool_create("ql4_fw_ddb", &ha->pdev->dev,
+                                             DDB_DMA_BLOCK_SIZE, 8, 0);
+
+       if (ha->fw_ddb_dma_pool == NULL) {
+               ql4_printk(KERN_WARNING, ha,
+                          "%s: fw_ddb_dma_pool allocation failed..\n",
+                          __func__);
+               goto mem_alloc_error_exit;
+       }
+
        return QLA_SUCCESS;
 
 mem_alloc_error_exit:
@@ -1800,6 +2064,60 @@ void qla4_8xxx_watchdog(struct scsi_qla_host *ha)
        }
 }
 
+void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
+{
+       struct iscsi_session *sess;
+       struct ddb_entry *ddb_entry;
+       struct scsi_qla_host *ha;
+
+       sess = cls_sess->dd_data;
+       ddb_entry = sess->dd_data;
+       ha = ddb_entry->ha;
+
+       if (!(ddb_entry->ddb_type == FLASH_DDB))
+               return;
+
+       if (adapter_up(ha) && !test_bit(DF_RELOGIN, &ddb_entry->flags) &&
+           !iscsi_is_session_online(cls_sess)) {
+               if (atomic_read(&ddb_entry->retry_relogin_timer) !=
+                   INVALID_ENTRY) {
+                       if (atomic_read(&ddb_entry->retry_relogin_timer) ==
+                                       0) {
+                               atomic_set(&ddb_entry->retry_relogin_timer,
+                                          INVALID_ENTRY);
+                               set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags);
+                               set_bit(DF_RELOGIN, &ddb_entry->flags);
+                               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                      "%s: index [%d] login device\n",
+                                       __func__, ddb_entry->fw_ddb_index));
+                       } else
+                               atomic_dec(&ddb_entry->retry_relogin_timer);
+               }
+       }
+
+       /* Wait for relogin to timeout */
+       if (atomic_read(&ddb_entry->relogin_timer) &&
+           (atomic_dec_and_test(&ddb_entry->relogin_timer) != 0)) {
+               /*
+                * If the relogin times out and the device is
+                * still NOT ONLINE then try and relogin again.
+                */
+               if (!iscsi_is_session_online(cls_sess)) {
+                       /* Reset retry relogin timer */
+                       atomic_inc(&ddb_entry->relogin_retry_count);
+                       DEBUG2(ql4_printk(KERN_INFO, ha,
+                               "%s: index[%d] relogin timed out-retrying"
+                               " relogin (%d), retry (%d)\n", __func__,
+                               ddb_entry->fw_ddb_index,
+                               atomic_read(&ddb_entry->relogin_retry_count),
+                               ddb_entry->default_time2wait + 4));
+                       set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags);
+                       atomic_set(&ddb_entry->retry_relogin_timer,
+                                  ddb_entry->default_time2wait + 4);
+               }
+       }
+}
+
 /**
  * qla4xxx_timer - checks every second for work to do.
  * @ha: Pointer to host adapter structure.
@@ -1809,6 +2127,8 @@ static void qla4xxx_timer(struct scsi_qla_host *ha)
        int start_dpc = 0;
        uint16_t w;
 
+       iscsi_host_for_each_session(ha->host, qla4xxx_check_relogin_flash_ddb);
+
        /* If we are in the middle of AER/EEH processing
         * skip any processing and reschedule the timer
         */
@@ -2078,7 +2398,12 @@ static void qla4xxx_fail_session(struct iscsi_cls_session *cls_session)
        sess = cls_session->dd_data;
        ddb_entry = sess->dd_data;
        ddb_entry->fw_ddb_device_state = DDB_DS_SESSION_FAILED;
-       iscsi_session_failure(cls_session->dd_data, ISCSI_ERR_CONN_FAILED);
+
+       if (ddb_entry->ddb_type == FLASH_DDB)
+               iscsi_block_session(ddb_entry->sess);
+       else
+               iscsi_session_failure(cls_session->dd_data,
+                                     ISCSI_ERR_CONN_FAILED);
 }
 
 /**
@@ -2163,7 +2488,7 @@ recover_ha_init_adapter:
 
                /* NOTE: AF_ONLINE flag set upon successful completion of
                 *       qla4xxx_initialize_adapter */
-               status = qla4xxx_initialize_adapter(ha);
+               status = qla4xxx_initialize_adapter(ha, RESET_ADAPTER);
        }
 
        /* Retry failed adapter initialization, if necessary
@@ -2245,17 +2570,108 @@ static void qla4xxx_relogin_devices(struct iscsi_cls_session *cls_session)
                        iscsi_unblock_session(ddb_entry->sess);
                } else {
                        /* Trigger relogin */
-                       iscsi_session_failure(cls_session->dd_data,
-                                             ISCSI_ERR_CONN_FAILED);
+                       if (ddb_entry->ddb_type == FLASH_DDB) {
+                               if (!test_bit(DF_RELOGIN, &ddb_entry->flags))
+                                       qla4xxx_arm_relogin_timer(ddb_entry);
+                       } else
+                               iscsi_session_failure(cls_session->dd_data,
+                                                     ISCSI_ERR_CONN_FAILED);
                }
        }
 }
 
+int qla4xxx_unblock_flash_ddb(struct iscsi_cls_session *cls_session)
+{
+       struct iscsi_session *sess;
+       struct ddb_entry *ddb_entry;
+       struct scsi_qla_host *ha;
+
+       sess = cls_session->dd_data;
+       ddb_entry = sess->dd_data;
+       ha = ddb_entry->ha;
+       ql4_printk(KERN_INFO, ha, "scsi%ld: %s: ddb[%d]"
+                  " unblock session\n", ha->host_no, __func__,
+                  ddb_entry->fw_ddb_index);
+
+       iscsi_unblock_session(ddb_entry->sess);
+
+       /* Start scan target */
+       if (test_bit(AF_ONLINE, &ha->flags)) {
+               ql4_printk(KERN_INFO, ha, "scsi%ld: %s: ddb[%d]"
+                          " start scan\n", ha->host_no, __func__,
+                          ddb_entry->fw_ddb_index);
+               scsi_queue_work(ha->host, &ddb_entry->sess->scan_work);
+       }
+       return QLA_SUCCESS;
+}
+
+int qla4xxx_unblock_ddb(struct iscsi_cls_session *cls_session)
+{
+       struct iscsi_session *sess;
+       struct ddb_entry *ddb_entry;
+       struct scsi_qla_host *ha;
+
+       sess = cls_session->dd_data;
+       ddb_entry = sess->dd_data;
+       ha = ddb_entry->ha;
+       ql4_printk(KERN_INFO, ha, "scsi%ld: %s: ddb[%d]"
+                  " unblock user space session\n", ha->host_no, __func__,
+                  ddb_entry->fw_ddb_index);
+       iscsi_conn_start(ddb_entry->conn);
+       iscsi_conn_login_event(ddb_entry->conn,
+                              ISCSI_CONN_STATE_LOGGED_IN);
+
+       return QLA_SUCCESS;
+}
+
 static void qla4xxx_relogin_all_devices(struct scsi_qla_host *ha)
 {
        iscsi_host_for_each_session(ha->host, qla4xxx_relogin_devices);
 }
 
+static void qla4xxx_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
+{
+       uint16_t relogin_timer;
+       struct iscsi_session *sess;
+       struct ddb_entry *ddb_entry;
+       struct scsi_qla_host *ha;
+
+       sess = cls_sess->dd_data;
+       ddb_entry = sess->dd_data;
+       ha = ddb_entry->ha;
+
+       relogin_timer = max(ddb_entry->default_relogin_timeout,
+                           (uint16_t)RELOGIN_TOV);
+       atomic_set(&ddb_entry->relogin_timer, relogin_timer);
+
+       DEBUG2(ql4_printk(KERN_INFO, ha,
+                         "scsi%ld: Relogin index [%d]. TOV=%d\n", ha->host_no,
+                         ddb_entry->fw_ddb_index, relogin_timer));
+
+       qla4xxx_login_flash_ddb(cls_sess);
+}
+
+static void qla4xxx_dpc_relogin(struct iscsi_cls_session *cls_sess)
+{
+       struct iscsi_session *sess;
+       struct ddb_entry *ddb_entry;
+       struct scsi_qla_host *ha;
+
+       sess = cls_sess->dd_data;
+       ddb_entry = sess->dd_data;
+       ha = ddb_entry->ha;
+
+       if (!(ddb_entry->ddb_type == FLASH_DDB))
+               return;
+
+       if (test_and_clear_bit(DF_RELOGIN, &ddb_entry->flags) &&
+           !iscsi_is_session_online(cls_sess)) {
+               DEBUG2(ql4_printk(KERN_INFO, ha,
+                                 "relogin issued\n"));
+               qla4xxx_relogin_flash_ddb(cls_sess);
+       }
+}
+
 void qla4xxx_wake_dpc(struct scsi_qla_host *ha)
 {
        if (ha->dpc_thread)
@@ -2356,6 +2772,12 @@ dpc_post_reset_ha:
        if (test_and_clear_bit(DPC_GET_DHCP_IP_ADDR, &ha->dpc_flags))
                qla4xxx_get_dhcp_ip_address(ha);
 
+       /* ---- relogin device? --- */
+       if (adapter_up(ha) &&
+           test_and_clear_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags)) {
+               iscsi_host_for_each_session(ha->host, qla4xxx_dpc_relogin);
+       }
+
        /* ---- link change? --- */
        if (test_and_clear_bit(DPC_LINK_CHANGED, &ha->dpc_flags)) {
                if (!test_bit(AF_LINK_UP, &ha->flags)) {
@@ -2368,8 +2790,12 @@ dpc_post_reset_ha:
                         * fatal error recovery.  Therefore, the driver must
                         * manually relogin to devices when recovering from
                         * connection failures, logouts, expired KATO, etc. */
-
-                       qla4xxx_relogin_all_devices(ha);
+                       if (test_and_clear_bit(AF_BUILD_DDB_LIST, &ha->flags)) {
+                               qla4xxx_build_ddb_list(ha, ha->is_reset);
+                               iscsi_host_for_each_session(ha->host,
+                                               qla4xxx_login_flash_ddb);
+                       } else
+                               qla4xxx_relogin_all_devices(ha);
                }
        }
 }
@@ -2867,6 +3293,9 @@ static int get_fw_boot_info(struct scsi_qla_host *ha, uint16_t ddb_index[])
                          " target ID %d\n", __func__, ddb_index[0],
                          ddb_index[1]));
 
+       ha->pri_ddb_idx = ddb_index[0];
+       ha->sec_ddb_idx = ddb_index[1];
+
 exit_boot_info_free:
        dma_free_coherent(&ha->pdev->dev, size, buf, buf_dma);
 exit_boot_info:
@@ -3034,6 +3463,9 @@ static int qla4xxx_get_boot_info(struct scsi_qla_host *ha)
                return ret;
        }
 
+       if (ql4xdisablesysfsboot)
+               return QLA_SUCCESS;
+
        if (ddb_index[0] == 0xffff)
                goto sec_target;
 
@@ -3066,7 +3498,15 @@ static int qla4xxx_setup_boot_info(struct scsi_qla_host *ha)
        struct iscsi_boot_kobj *boot_kobj;
 
        if (qla4xxx_get_boot_info(ha) != QLA_SUCCESS)
-               return 0;
+               return QLA_ERROR;
+
+       if (ql4xdisablesysfsboot) {
+               ql4_printk(KERN_INFO, ha,
+                          "%s: syfsboot disabled - driver will trigger login"
+                          "and publish session for discovery .\n", __func__);
+               return QLA_SUCCESS;
+       }
+
 
        ha->boot_kset = iscsi_boot_create_host_kset(ha->host->host_no);
        if (!ha->boot_kset)
@@ -3108,7 +3548,7 @@ static int qla4xxx_setup_boot_info(struct scsi_qla_host *ha)
        if (!boot_kobj)
                goto put_host;
 
-       return 0;
+       return QLA_SUCCESS;
 
 put_host:
        scsi_host_put(ha->host);
@@ -3174,9 +3614,507 @@ static void qla4xxx_create_chap_list(struct scsi_qla_host *ha)
 exit_chap_list:
        dma_free_coherent(&ha->pdev->dev, chap_size,
                        chap_flash_data, chap_dma);
-       return;
 }
 
+static void qla4xxx_get_param_ddb(struct ddb_entry *ddb_entry,
+                                 struct ql4_tuple_ddb *tddb)
+{
+       struct scsi_qla_host *ha;
+       struct iscsi_cls_session *cls_sess;
+       struct iscsi_cls_conn *cls_conn;
+       struct iscsi_session *sess;
+       struct iscsi_conn *conn;
+
+       DEBUG2(printk(KERN_INFO "Func: %s\n", __func__));
+       ha = ddb_entry->ha;
+       cls_sess = ddb_entry->sess;
+       sess = cls_sess->dd_data;
+       cls_conn = ddb_entry->conn;
+       conn = cls_conn->dd_data;
+
+       tddb->tpgt = sess->tpgt;
+       tddb->port = conn->persistent_port;
+       strncpy(tddb->iscsi_name, sess->targetname, ISCSI_NAME_SIZE);
+       strncpy(tddb->ip_addr, conn->persistent_address, DDB_IPADDR_LEN);
+}
+
+static void qla4xxx_convert_param_ddb(struct dev_db_entry *fw_ddb_entry,
+                                     struct ql4_tuple_ddb *tddb)
+{
+       uint16_t options = 0;
+
+       tddb->tpgt = le32_to_cpu(fw_ddb_entry->tgt_portal_grp);
+       memcpy(&tddb->iscsi_name[0], &fw_ddb_entry->iscsi_name[0],
+              min(sizeof(tddb->iscsi_name), sizeof(fw_ddb_entry->iscsi_name)));
+
+       options = le16_to_cpu(fw_ddb_entry->options);
+       if (options & DDB_OPT_IPV6_DEVICE)
+               sprintf(tddb->ip_addr, "%pI6", fw_ddb_entry->ip_addr);
+       else
+               sprintf(tddb->ip_addr, "%pI4", fw_ddb_entry->ip_addr);
+
+       tddb->port = le16_to_cpu(fw_ddb_entry->port);
+}
+
+static int qla4xxx_compare_tuple_ddb(struct scsi_qla_host *ha,
+                                    struct ql4_tuple_ddb *old_tddb,
+                                    struct ql4_tuple_ddb *new_tddb)
+{
+       if (strcmp(old_tddb->iscsi_name, new_tddb->iscsi_name))
+               return QLA_ERROR;
+
+       if (strcmp(old_tddb->ip_addr, new_tddb->ip_addr))
+               return QLA_ERROR;
+
+       if (old_tddb->port != new_tddb->port)
+               return QLA_ERROR;
+
+       DEBUG2(ql4_printk(KERN_INFO, ha,
+                         "Match Found, fw[%d,%d,%s,%s], [%d,%d,%s,%s]",
+                         old_tddb->port, old_tddb->tpgt, old_tddb->ip_addr,
+                         old_tddb->iscsi_name, new_tddb->port, new_tddb->tpgt,
+                         new_tddb->ip_addr, new_tddb->iscsi_name));
+
+       return QLA_SUCCESS;
+}
+
+static int qla4xxx_is_session_exists(struct scsi_qla_host *ha,
+                                    struct dev_db_entry *fw_ddb_entry)
+{
+       struct ddb_entry *ddb_entry;
+       struct ql4_tuple_ddb *fw_tddb = NULL;
+       struct ql4_tuple_ddb *tmp_tddb = NULL;
+       int idx;
+       int ret = QLA_ERROR;
+
+       fw_tddb = vzalloc(sizeof(*fw_tddb));
+       if (!fw_tddb) {
+               DEBUG2(ql4_printk(KERN_WARNING, ha,
+                                 "Memory Allocation failed.\n"));
+               ret = QLA_SUCCESS;
+               goto exit_check;
+       }
+
+       tmp_tddb = vzalloc(sizeof(*tmp_tddb));
+       if (!tmp_tddb) {
+               DEBUG2(ql4_printk(KERN_WARNING, ha,
+                                 "Memory Allocation failed.\n"));
+               ret = QLA_SUCCESS;
+               goto exit_check;
+       }
+
+       qla4xxx_convert_param_ddb(fw_ddb_entry, fw_tddb);
+
+       for (idx = 0; idx < MAX_DDB_ENTRIES; idx++) {
+               ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, idx);
+               if (ddb_entry == NULL)
+                       continue;
+
+               qla4xxx_get_param_ddb(ddb_entry, tmp_tddb);
+               if (!qla4xxx_compare_tuple_ddb(ha, fw_tddb, tmp_tddb)) {
+                       ret = QLA_SUCCESS; /* found */
+                       goto exit_check;
+               }
+       }
+
+exit_check:
+       if (fw_tddb)
+               vfree(fw_tddb);
+       if (tmp_tddb)
+               vfree(tmp_tddb);
+       return ret;
+}
+
+static int qla4xxx_is_flash_ddb_exists(struct scsi_qla_host *ha,
+                                      struct list_head *list_nt,
+                                      struct dev_db_entry *fw_ddb_entry)
+{
+       struct qla_ddb_index  *nt_ddb_idx, *nt_ddb_idx_tmp;
+       struct ql4_tuple_ddb *fw_tddb = NULL;
+       struct ql4_tuple_ddb *tmp_tddb = NULL;
+       int ret = QLA_ERROR;
+
+       fw_tddb = vzalloc(sizeof(*fw_tddb));
+       if (!fw_tddb) {
+               DEBUG2(ql4_printk(KERN_WARNING, ha,
+                                 "Memory Allocation failed.\n"));
+               ret = QLA_SUCCESS;
+               goto exit_check;
+       }
+
+       tmp_tddb = vzalloc(sizeof(*tmp_tddb));
+       if (!tmp_tddb) {
+               DEBUG2(ql4_printk(KERN_WARNING, ha,
+                                 "Memory Allocation failed.\n"));
+               ret = QLA_SUCCESS;
+               goto exit_check;
+       }
+
+       qla4xxx_convert_param_ddb(fw_ddb_entry, fw_tddb);
+
+       list_for_each_entry_safe(nt_ddb_idx, nt_ddb_idx_tmp, list_nt, list) {
+               qla4xxx_convert_param_ddb(&nt_ddb_idx->fw_ddb, tmp_tddb);
+               if (!qla4xxx_compare_tuple_ddb(ha, fw_tddb, tmp_tddb)) {
+                       ret = QLA_SUCCESS; /* found */
+                       goto exit_check;
+               }
+       }
+
+exit_check:
+       if (fw_tddb)
+               vfree(fw_tddb);
+       if (tmp_tddb)
+               vfree(tmp_tddb);
+       return ret;
+}
+
+static void qla4xxx_free_nt_list(struct list_head *list_nt)
+{
+       struct qla_ddb_index  *nt_ddb_idx, *nt_ddb_idx_tmp;
+
+       /* Free up the normaltargets list */
+       list_for_each_entry_safe(nt_ddb_idx, nt_ddb_idx_tmp, list_nt, list) {
+               list_del_init(&nt_ddb_idx->list);
+               vfree(nt_ddb_idx);
+       }
+
+}
+
+static struct iscsi_endpoint *qla4xxx_get_ep_fwdb(struct scsi_qla_host *ha,
+                                       struct dev_db_entry *fw_ddb_entry)
+{
+       struct iscsi_endpoint *ep;
+       struct sockaddr_in *addr;
+       struct sockaddr_in6 *addr6;
+       struct sockaddr *dst_addr;
+       char *ip;
+
+       /* TODO: need to destroy on unload iscsi_endpoint*/
+       dst_addr = vmalloc(sizeof(*dst_addr));
+       if (!dst_addr)
+               return NULL;
+
+       if (fw_ddb_entry->options & DDB_OPT_IPV6_DEVICE) {
+               dst_addr->sa_family = AF_INET6;
+               addr6 = (struct sockaddr_in6 *)dst_addr;
+               ip = (char *)&addr6->sin6_addr;
+               memcpy(ip, fw_ddb_entry->ip_addr, IPv6_ADDR_LEN);
+               addr6->sin6_port = htons(le16_to_cpu(fw_ddb_entry->port));
+
+       } else {
+               dst_addr->sa_family = AF_INET;
+               addr = (struct sockaddr_in *)dst_addr;
+               ip = (char *)&addr->sin_addr;
+               memcpy(ip, fw_ddb_entry->ip_addr, IP_ADDR_LEN);
+               addr->sin_port = htons(le16_to_cpu(fw_ddb_entry->port));
+       }
+
+       ep = qla4xxx_ep_connect(ha->host, dst_addr, 0);
+       vfree(dst_addr);
+       return ep;
+}
+
+static int qla4xxx_verify_boot_idx(struct scsi_qla_host *ha, uint16_t idx)
+{
+       if (ql4xdisablesysfsboot)
+               return QLA_SUCCESS;
+       if (idx == ha->pri_ddb_idx || idx == ha->sec_ddb_idx)
+               return QLA_ERROR;
+       return QLA_SUCCESS;
+}
+
+static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
+                                         struct ddb_entry *ddb_entry)
+{
+       ddb_entry->ddb_type = FLASH_DDB;
+       ddb_entry->fw_ddb_index = INVALID_ENTRY;
+       ddb_entry->fw_ddb_device_state = DDB_DS_NO_CONNECTION_ACTIVE;
+       ddb_entry->ha = ha;
+       ddb_entry->unblock_sess = qla4xxx_unblock_flash_ddb;
+       ddb_entry->ddb_change = qla4xxx_flash_ddb_change;
+
+       atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
+       atomic_set(&ddb_entry->relogin_timer, 0);
+       atomic_set(&ddb_entry->relogin_retry_count, 0);
+
+       ddb_entry->default_relogin_timeout =
+               le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout);
+       ddb_entry->default_time2wait =
+               le16_to_cpu(ddb_entry->fw_ddb_entry.iscsi_def_time2wait);
+}
+
+static void qla4xxx_wait_for_ip_configuration(struct scsi_qla_host *ha)
+{
+       uint32_t idx = 0;
+       uint32_t ip_idx[IP_ADDR_COUNT] = {0, 1, 2, 3}; /* 4 IP interfaces */
+       uint32_t sts[MBOX_REG_COUNT];
+       uint32_t ip_state;
+       unsigned long wtime;
+       int ret;
+
+       wtime = jiffies + (HZ * IP_CONFIG_TOV);
+       do {
+               for (idx = 0; idx < IP_ADDR_COUNT; idx++) {
+                       if (ip_idx[idx] == -1)
+                               continue;
+
+                       ret = qla4xxx_get_ip_state(ha, 0, ip_idx[idx], sts);
+
+                       if (ret == QLA_ERROR) {
+                               ip_idx[idx] = -1;
+                               continue;
+                       }
+
+                       ip_state = (sts[1] & IP_STATE_MASK) >> IP_STATE_SHIFT;
+
+                       DEBUG2(ql4_printk(KERN_INFO, ha,
+                                         "Waiting for IP state for idx = %d, state = 0x%x\n",
+                                         ip_idx[idx], ip_state));
+                       if (ip_state == IP_ADDRSTATE_UNCONFIGURED ||
+                           ip_state == IP_ADDRSTATE_INVALID ||
+                           ip_state == IP_ADDRSTATE_PREFERRED ||
+                           ip_state == IP_ADDRSTATE_DEPRICATED ||
+                           ip_state == IP_ADDRSTATE_DISABLING)
+                               ip_idx[idx] = -1;
+
+               }
+
+               /* Break if all IP states checked */
+               if ((ip_idx[0] == -1) &&
+                   (ip_idx[1] == -1) &&
+                   (ip_idx[2] == -1) &&
+                   (ip_idx[3] == -1))
+                       break;
+               schedule_timeout_uninterruptible(HZ);
+       } while (time_after(wtime, jiffies));
+}
+
+void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset)
+{
+       int max_ddbs;
+       int ret;
+       uint32_t idx = 0, next_idx = 0;
+       uint32_t state = 0, conn_err = 0;
+       uint16_t conn_id;
+       struct dev_db_entry *fw_ddb_entry;
+       struct ddb_entry *ddb_entry = NULL;
+       dma_addr_t fw_ddb_dma;
+       struct iscsi_cls_session *cls_sess;
+       struct iscsi_session *sess;
+       struct iscsi_cls_conn *cls_conn;
+       struct iscsi_endpoint *ep;
+       uint16_t cmds_max = 32, tmo = 0;
+       uint32_t initial_cmdsn = 0;
+       struct list_head list_st, list_nt; /* List of sendtargets */
+       struct qla_ddb_index  *st_ddb_idx, *st_ddb_idx_tmp;
+       int fw_idx_size;
+       unsigned long wtime;
+       struct qla_ddb_index  *nt_ddb_idx;
+
+       if (!test_bit(AF_LINK_UP, &ha->flags)) {
+               set_bit(AF_BUILD_DDB_LIST, &ha->flags);
+               ha->is_reset = is_reset;
+               return;
+       }
+       max_ddbs =  is_qla40XX(ha) ? MAX_DEV_DB_ENTRIES_40XX :
+                                    MAX_DEV_DB_ENTRIES;
+
+       fw_ddb_entry = dma_pool_alloc(ha->fw_ddb_dma_pool, GFP_KERNEL,
+                                     &fw_ddb_dma);
+       if (fw_ddb_entry == NULL) {
+               DEBUG2(ql4_printk(KERN_ERR, ha, "Out of memory\n"));
+               goto exit_ddb_list;
+       }
+
+       INIT_LIST_HEAD(&list_st);
+       INIT_LIST_HEAD(&list_nt);
+       fw_idx_size = sizeof(struct qla_ddb_index);
+
+       for (idx = 0; idx < max_ddbs; idx = next_idx) {
+               ret = qla4xxx_get_fwddb_entry(ha, idx, fw_ddb_entry,
+                                             fw_ddb_dma, NULL,
+                                             &next_idx, &state, &conn_err,
+                                             NULL, &conn_id);
+               if (ret == QLA_ERROR)
+                       break;
+
+               if (qla4xxx_verify_boot_idx(ha, idx) != QLA_SUCCESS)
+                       goto continue_next_st;
+
+               /* Check if ST, add to the list_st */
+               if (strlen((char *) fw_ddb_entry->iscsi_name) != 0)
+                       goto continue_next_st;
+
+               st_ddb_idx = vzalloc(fw_idx_size);
+               if (!st_ddb_idx)
+                       break;
+
+               st_ddb_idx->fw_ddb_idx = idx;
+
+               list_add_tail(&st_ddb_idx->list, &list_st);
+continue_next_st:
+               if (next_idx == 0)
+                       break;
+       }
+
+       /* Before issuing conn open mbox, ensure all IPs states are configured
+        * Note, conn open fails if IPs are not configured
+        */
+       qla4xxx_wait_for_ip_configuration(ha);
+
+       /* Go thru the STs and fire the sendtargets by issuing conn open mbx */
+       list_for_each_entry_safe(st_ddb_idx, st_ddb_idx_tmp, &list_st, list) {
+               qla4xxx_conn_open(ha, st_ddb_idx->fw_ddb_idx);
+       }
+
+       /* Wait to ensure all sendtargets are done for min 12 sec wait */
+       tmo = ((ha->def_timeout < LOGIN_TOV) ? LOGIN_TOV : ha->def_timeout);
+       DEBUG2(ql4_printk(KERN_INFO, ha,
+                         "Default time to wait for build ddb %d\n", tmo));
+
+       wtime = jiffies + (HZ * tmo);
+       do {
+               list_for_each_entry_safe(st_ddb_idx, st_ddb_idx_tmp, &list_st,
+                                        list) {
+                       ret = qla4xxx_get_fwddb_entry(ha,
+                                                     st_ddb_idx->fw_ddb_idx,
+                                                     NULL, 0, NULL, &next_idx,
+                                                     &state, &conn_err, NULL,
+                                                     NULL);
+                       if (ret == QLA_ERROR)
+                               continue;
+
+                       if (state == DDB_DS_NO_CONNECTION_ACTIVE ||
+                           state == DDB_DS_SESSION_FAILED) {
+                               list_del_init(&st_ddb_idx->list);
+                               vfree(st_ddb_idx);
+                       }
+               }
+               schedule_timeout_uninterruptible(HZ / 10);
+       } while (time_after(wtime, jiffies));
+
+       /* Free up the sendtargets list */
+       list_for_each_entry_safe(st_ddb_idx, st_ddb_idx_tmp, &list_st, list) {
+               list_del_init(&st_ddb_idx->list);
+               vfree(st_ddb_idx);
+       }
+
+       for (idx = 0; idx < max_ddbs; idx = next_idx) {
+               ret = qla4xxx_get_fwddb_entry(ha, idx, fw_ddb_entry,
+                                             fw_ddb_dma, NULL,
+                                             &next_idx, &state, &conn_err,
+                                             NULL, &conn_id);
+               if (ret == QLA_ERROR)
+                       break;
+
+               if (qla4xxx_verify_boot_idx(ha, idx) != QLA_SUCCESS)
+                       goto continue_next_nt;
+
+               /* Check if NT, then add to list it */
+               if (strlen((char *) fw_ddb_entry->iscsi_name) == 0)
+                       goto continue_next_nt;
+
+               if (state == DDB_DS_NO_CONNECTION_ACTIVE ||
+                   state == DDB_DS_SESSION_FAILED) {
+                       DEBUG2(ql4_printk(KERN_INFO, ha,
+                                         "Adding  DDB to session = 0x%x\n",
+                                         idx));
+                       if (is_reset == INIT_ADAPTER) {
+                               nt_ddb_idx = vmalloc(fw_idx_size);
+                               if (!nt_ddb_idx)
+                                       break;
+
+                               nt_ddb_idx->fw_ddb_idx = idx;
+
+                               memcpy(&nt_ddb_idx->fw_ddb, fw_ddb_entry,
+                                      sizeof(struct dev_db_entry));
+
+                               if (qla4xxx_is_flash_ddb_exists(ha, &list_nt,
+                                               fw_ddb_entry) == QLA_SUCCESS) {
+                                       vfree(nt_ddb_idx);
+                                       goto continue_next_nt;
+                               }
+                               list_add_tail(&nt_ddb_idx->list, &list_nt);
+                       } else if (is_reset == RESET_ADAPTER) {
+                               if (qla4xxx_is_session_exists(ha,
+                                                  fw_ddb_entry) == QLA_SUCCESS)
+                                       goto continue_next_nt;
+                       }
+
+                       /* Create session object, with INVALID_ENTRY,
+                        * the targer_id would get set when we issue the login
+                        */
+                       cls_sess = iscsi_session_setup(&qla4xxx_iscsi_transport,
+                                               ha->host, cmds_max,
+                                               sizeof(struct ddb_entry),
+                                               sizeof(struct ql4_task_data),
+                                               initial_cmdsn, INVALID_ENTRY);
+                       if (!cls_sess)
+                               goto exit_ddb_list;
+
+                       /*
+                        * iscsi_session_setup increments the driver reference
+                        * count which wouldn't let the driver to be unloaded.
+                        * so calling module_put function to decrement the
+                        * reference count.
+                        **/
+                       module_put(qla4xxx_iscsi_transport.owner);
+                       sess = cls_sess->dd_data;
+                       ddb_entry = sess->dd_data;
+                       ddb_entry->sess = cls_sess;
+
+                       cls_sess->recovery_tmo = ql4xsess_recovery_tmo;
+                       memcpy(&ddb_entry->fw_ddb_entry, fw_ddb_entry,
+                              sizeof(struct dev_db_entry));
+
+                       qla4xxx_setup_flash_ddb_entry(ha, ddb_entry);
+
+                       cls_conn = iscsi_conn_setup(cls_sess,
+                                                   sizeof(struct qla_conn),
+                                                   conn_id);
+                       if (!cls_conn)
+                               goto exit_ddb_list;
+
+                       ddb_entry->conn = cls_conn;
+
+                       /* Setup ep, for displaying attributes in sysfs */
+                       ep = qla4xxx_get_ep_fwdb(ha, fw_ddb_entry);
+                       if (ep) {
+                               ep->conn = cls_conn;
+                               cls_conn->ep = ep;
+                       } else {
+                               DEBUG2(ql4_printk(KERN_ERR, ha,
+                                                 "Unable to get ep\n"));
+                       }
+
+                       /* Update sess/conn params */
+                       qla4xxx_copy_fwddb_param(ha, fw_ddb_entry, cls_sess,
+                                                cls_conn);
+
+                       if (is_reset == RESET_ADAPTER) {
+                               iscsi_block_session(cls_sess);
+                               /* Use the relogin path to discover new devices
+                                *  by short-circuting the logic of setting
+                                *  timer to relogin - instead set the flags
+                                *  to initiate login right away.
+                                */
+                               set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags);
+                               set_bit(DF_RELOGIN, &ddb_entry->flags);
+                       }
+               }
+continue_next_nt:
+               if (next_idx == 0)
+                       break;
+       }
+exit_ddb_list:
+       qla4xxx_free_nt_list(&list_nt);
+       if (fw_ddb_entry)
+               dma_pool_free(ha->fw_ddb_dma_pool, fw_ddb_entry, fw_ddb_dma);
+
+       qla4xxx_free_ddb_index(ha);
+}
+
+
 /**
  * qla4xxx_probe_adapter - callback function to probe HBA
  * @pdev: pointer to pci_dev structure
@@ -3298,7 +4236,7 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
         * firmware
         * NOTE: interrupts enabled upon successful completion
         */
-       status = qla4xxx_initialize_adapter(ha);
+       status = qla4xxx_initialize_adapter(ha, INIT_ADAPTER);
        while ((!test_bit(AF_ONLINE, &ha->flags)) &&
            init_retry_count++ < MAX_INIT_RETRIES) {
 
@@ -3319,7 +4257,7 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
                if (ha->isp_ops->reset_chip(ha) == QLA_ERROR)
                        continue;
 
-               status = qla4xxx_initialize_adapter(ha);
+               status = qla4xxx_initialize_adapter(ha, INIT_ADAPTER);
        }
 
        if (!test_bit(AF_ONLINE, &ha->flags)) {
@@ -3386,12 +4324,16 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
               ha->host_no, ha->firmware_version[0], ha->firmware_version[1],
               ha->patch_number, ha->build_number);
 
-       qla4xxx_create_chap_list(ha);
-
        if (qla4xxx_setup_boot_info(ha))
                ql4_printk(KERN_ERR, ha, "%s:ISCSI boot info setup failed\n",
                           __func__);
 
+               /* Perform the build ddb list and login to each */
+       qla4xxx_build_ddb_list(ha, INIT_ADAPTER);
+       iscsi_host_for_each_session(ha->host, qla4xxx_login_flash_ddb);
+
+       qla4xxx_create_chap_list(ha);
+
        qla4xxx_create_ifaces(ha);
        return 0;
 
@@ -3449,6 +4391,38 @@ static void qla4xxx_prevent_other_port_reinit(struct scsi_qla_host *ha)
        }
 }
 
+static void qla4xxx_destroy_fw_ddb_session(struct scsi_qla_host *ha)
+{
+       struct ddb_entry *ddb_entry;
+       int options;
+       int idx;
+
+       for (idx = 0; idx < MAX_DDB_ENTRIES; idx++) {
+
+               ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, idx);
+               if ((ddb_entry != NULL) &&
+                   (ddb_entry->ddb_type == FLASH_DDB)) {
+
+                       options = LOGOUT_OPTION_CLOSE_SESSION;
+                       if (qla4xxx_session_logout_ddb(ha, ddb_entry, options)
+                           == QLA_ERROR)
+                               ql4_printk(KERN_ERR, ha, "%s: Logout failed\n",
+                                          __func__);
+
+                       qla4xxx_clear_ddb_entry(ha, ddb_entry->fw_ddb_index);
+                       /*
+                        * we have decremented the reference count of the driver
+                        * when we setup the session to have the driver unload
+                        * to be seamless without actually destroying the
+                        * session
+                        **/
+                       try_module_get(qla4xxx_iscsi_transport.owner);
+                       iscsi_destroy_endpoint(ddb_entry->conn->ep);
+                       qla4xxx_free_ddb(ha, ddb_entry);
+                       iscsi_session_teardown(ddb_entry->sess);
+               }
+       }
+}
 /**
  * qla4xxx_remove_adapter - calback function to remove adapter.
  * @pci_dev: PCI device pointer
@@ -3465,9 +4439,11 @@ static void __devexit qla4xxx_remove_adapter(struct pci_dev *pdev)
        /* destroy iface from sysfs */
        qla4xxx_destroy_ifaces(ha);
 
-       if (ha->boot_kset)
+       if ((!ql4xdisablesysfsboot) && ha->boot_kset)
                iscsi_boot_destroy_kset(ha->boot_kset);
 
+       qla4xxx_destroy_fw_ddb_session(ha);
+
        scsi_remove_host(ha->host);
 
        qla4xxx_free_adapter(ha);
@@ -4115,7 +5091,7 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
 
                qla4_8xxx_idc_unlock(ha);
                clear_bit(AF_FW_RECOVERY, &ha->flags);
-               rval = qla4xxx_initialize_adapter(ha);
+               rval = qla4xxx_initialize_adapter(ha, RESET_ADAPTER);
                qla4_8xxx_idc_lock(ha);
 
                if (rval != QLA_SUCCESS) {
@@ -4151,7 +5127,7 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
                if ((qla4_8xxx_rd_32(ha, QLA82XX_CRB_DEV_STATE) ==
                    QLA82XX_DEV_READY)) {
                        clear_bit(AF_FW_RECOVERY, &ha->flags);
-                       rval = qla4xxx_initialize_adapter(ha);
+                       rval = qla4xxx_initialize_adapter(ha, RESET_ADAPTER);
                        if (rval == QLA_SUCCESS) {
                                ret = qla4xxx_request_irqs(ha);
                                if (ret) {
index c15347d3f532099ef70127371a91caef2d90c3ee..5254e57968f5cf64a24c04731fe9ef2e240c4068 100644 (file)
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION "5.02.00-k8"
+#define QLA4XXX_DRIVER_VERSION "5.02.00-k9"
index 019a7163572f460fd5d36f61a88a352d598d51a1..dcf7e1006426d2fef19c8c62a38dac5b5a8b55b2 100644 (file)
@@ -971,6 +971,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
        struct s3c64xx_spi_info *sci;
        struct spi_master *master;
        int ret;
+       char clk_name[16];
 
        if (pdev->id < 0) {
                dev_err(&pdev->dev,
@@ -984,11 +985,6 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
        }
 
        sci = pdev->dev.platform_data;
-       if (!sci->src_clk_name) {
-               dev_err(&pdev->dev,
-                       "Board init must call s3c64xx_spi_set_info()\n");
-               return -EINVAL;
-       }
 
        /* Check for availability of necessary resource */
 
@@ -1073,17 +1069,17 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
                goto err4;
        }
 
-       sdd->src_clk = clk_get(&pdev->dev, sci->src_clk_name);
+       sprintf(clk_name, "spi_busclk%d", sci->src_clk_nr);
+       sdd->src_clk = clk_get(&pdev->dev, clk_name);
        if (IS_ERR(sdd->src_clk)) {
                dev_err(&pdev->dev,
-                       "Unable to acquire clock '%s'\n", sci->src_clk_name);
+                       "Unable to acquire clock '%s'\n", clk_name);
                ret = PTR_ERR(sdd->src_clk);
                goto err5;
        }
 
        if (clk_enable(sdd->src_clk)) {
-               dev_err(&pdev->dev, "Couldn't enable clock '%s'\n",
-                                                       sci->src_clk_name);
+               dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name);
                ret = -EBUSY;
                goto err6;
        }
index 84c934c0a5455950f1244de76ebcfe3b8b5a4aaf..520e8286db28f92cee618acdbaa00a310e5d41ab 100644 (file)
@@ -517,10 +517,14 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
 
 static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
 {
-       ssb_pcicore_fix_sprom_core_index(pc);
+       struct ssb_device *pdev = pc->dev;
+       struct ssb_bus *bus = pdev->bus;
+
+       if (bus->bustype == SSB_BUSTYPE_PCI)
+               ssb_pcicore_fix_sprom_core_index(pc);
 
        /* Disable PCI interrupts. */
-       ssb_write32(pc->dev, SSB_INTVEC, 0);
+       ssb_write32(pdev, SSB_INTVEC, 0);
 
        /* Additional PCIe always once-executed workarounds */
        if (pc->dev->id.coreid == SSB_DEV_PCIE) {
index 925a1e547a834f10942ab878357a0568254b6ae8..fb89b85d0d81a47cd46a3d30f6a3064b41a7f0a2 100644 (file)
@@ -457,7 +457,7 @@ config SERIAL_SAMSUNG
 config SERIAL_SAMSUNG_UARTS_4
        bool
        depends on ARM && PLAT_SAMSUNG
-       default y if CPU_S3C2443
+       default y if !(CPU_S3C2410 || SERIAL_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
        help
          Internal node for the common case of 4 Samsung compatible UARTs
 
@@ -465,7 +465,7 @@ config SERIAL_SAMSUNG_UARTS
        int
        depends on ARM && PLAT_SAMSUNG
        default 6 if ARCH_S5P6450
-       default 4 if SERIAL_SAMSUNG_UARTS_4
+       default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
        default 3
        help
          Select the number of available UART ports for the Samsung S3C
@@ -495,47 +495,6 @@ config SERIAL_SAMSUNG_CONSOLE
          your boot loader about how to pass options to the kernel at
          boot time.)
 
-config SERIAL_S3C2410
-       tristate "Samsung S3C2410 Serial port support"
-       depends on SERIAL_SAMSUNG && CPU_S3C2410
-       default y if CPU_S3C2410
-       help
-         Serial port support for the Samsung S3C2410 SoC
-
-config SERIAL_S3C2412
-       tristate "Samsung S3C2412/S3C2413 Serial port support"
-       depends on SERIAL_SAMSUNG && CPU_S3C2412
-       default y if CPU_S3C2412
-       help
-         Serial port support for the Samsung S3C2412 and S3C2413 SoC
-
-config SERIAL_S3C2440
-       tristate "Samsung S3C2440/S3C2442/S3C2416 Serial port support"
-       depends on SERIAL_SAMSUNG && (CPU_S3C2440 || CPU_S3C2442 || CPU_S3C2416)
-       default y if CPU_S3C2440
-       default y if CPU_S3C2442
-       select SERIAL_SAMSUNG_UARTS_4 if CPU_S3C2416
-       help
-         Serial port support for the Samsung S3C2440, S3C2416 and S3C2442 SoC
-
-config SERIAL_S3C6400
-       tristate "Samsung S3C6400/S3C6410/S5P6440/S5P6450/S5PC100 Serial port support"
-       depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5P6450 || CPU_S5PC100)
-       select SERIAL_SAMSUNG_UARTS_4
-       default y
-       help
-         Serial port support for the Samsung S3C6400, S3C6410, S5P6440, S5P6450
-         and S5PC100 SoCs
-
-config SERIAL_S5PV210
-       tristate "Samsung S5PV210 Serial port support"
-       depends on SERIAL_SAMSUNG && (CPU_S5PV210 || CPU_EXYNOS4210 || SOC_EXYNOS4212)
-       select SERIAL_SAMSUNG_UARTS_4 if (CPU_S5PV210 || CPU_EXYNOS4210 || SOC_EXYNOS4212)
-       default y
-       help
-         Serial port support for Samsung's S5P Family of SoC's
-
-
 config SERIAL_MAX3100
        tristate "MAX3100 support"
        depends on SPI
index e10cf5b54b6dbc70109b29c447bbe5668048a0d2..84bc2e5a57be383dd09fc5484d436e1e039e493a 100644 (file)
@@ -39,11 +39,6 @@ obj-$(CONFIG_SERIAL_BCM63XX) += bcm63xx_uart.o
 obj-$(CONFIG_SERIAL_BFIN) += bfin_uart.o
 obj-$(CONFIG_SERIAL_BFIN_SPORT) += bfin_sport_uart.o
 obj-$(CONFIG_SERIAL_SAMSUNG) += samsung.o
-obj-$(CONFIG_SERIAL_S3C2410) += s3c2410.o
-obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o
-obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
-obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
-obj-$(CONFIG_SERIAL_S5PV210) += s5pv210.o
 obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
 obj-$(CONFIG_SERIAL_MAX3107) += max3107.o
 obj-$(CONFIG_SERIAL_MAX3107_AAVA) += max3107-aava.o
diff --git a/drivers/tty/serial/s3c2410.c b/drivers/tty/serial/s3c2410.c
deleted file mode 100644 (file)
index b1d7e7c..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Driver for Samsung S3C2410 SoC onboard UARTs.
- *
- * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *
- * 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/module.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/serial_core.h>
-#include <linux/serial.h>
-
-#include <asm/irq.h>
-#include <mach/hardware.h>
-
-#include <plat/regs-serial.h>
-#include <mach/regs-gpio.h>
-
-#include "samsung.h"
-
-static int s3c2410_serial_setsource(struct uart_port *port,
-                                   struct s3c24xx_uart_clksrc *clk)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       if (strcmp(clk->name, "uclk") == 0)
-               ucon |= S3C2410_UCON_UCLK;
-       else
-               ucon &= ~S3C2410_UCON_UCLK;
-
-       wr_regl(port, S3C2410_UCON, ucon);
-       return 0;
-}
-
-static int s3c2410_serial_getsource(struct uart_port *port,
-                                   struct s3c24xx_uart_clksrc *clk)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       clk->divisor = 1;
-       clk->name = (ucon & S3C2410_UCON_UCLK) ? "uclk" : "pclk";
-
-       return 0;
-}
-
-static int s3c2410_serial_resetport(struct uart_port *port,
-                                   struct s3c2410_uartcfg *cfg)
-{
-       dbg("s3c2410_serial_resetport: port=%p (%08lx), cfg=%p\n",
-           port, port->mapbase, cfg);
-
-       wr_regl(port, S3C2410_UCON,  cfg->ucon);
-       wr_regl(port, S3C2410_ULCON, cfg->ulcon);
-
-       /* reset both fifos */
-
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon);
-
-       return 0;
-}
-
-static struct s3c24xx_uart_info s3c2410_uart_inf = {
-       .name           = "Samsung S3C2410 UART",
-       .type           = PORT_S3C2410,
-       .fifosize       = 16,
-       .rx_fifomask    = S3C2410_UFSTAT_RXMASK,
-       .rx_fifoshift   = S3C2410_UFSTAT_RXSHIFT,
-       .rx_fifofull    = S3C2410_UFSTAT_RXFULL,
-       .tx_fifofull    = S3C2410_UFSTAT_TXFULL,
-       .tx_fifomask    = S3C2410_UFSTAT_TXMASK,
-       .tx_fifoshift   = S3C2410_UFSTAT_TXSHIFT,
-       .get_clksrc     = s3c2410_serial_getsource,
-       .set_clksrc     = s3c2410_serial_setsource,
-       .reset_port     = s3c2410_serial_resetport,
-};
-
-static int s3c2410_serial_probe(struct platform_device *dev)
-{
-       return s3c24xx_serial_probe(dev, &s3c2410_uart_inf);
-}
-
-static struct platform_driver s3c2410_serial_driver = {
-       .probe          = s3c2410_serial_probe,
-       .remove         = __devexit_p(s3c24xx_serial_remove),
-       .driver         = {
-               .name   = "s3c2410-uart",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __init s3c2410_serial_init(void)
-{
-       return s3c24xx_serial_init(&s3c2410_serial_driver, &s3c2410_uart_inf);
-}
-
-static void __exit s3c2410_serial_exit(void)
-{
-       platform_driver_unregister(&s3c2410_serial_driver);
-}
-
-module_init(s3c2410_serial_init);
-module_exit(s3c2410_serial_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
-MODULE_DESCRIPTION("Samsung S3C2410 SoC Serial port driver");
-MODULE_ALIAS("platform:s3c2410-uart");
diff --git a/drivers/tty/serial/s3c2412.c b/drivers/tty/serial/s3c2412.c
deleted file mode 100644 (file)
index 2234bf9..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Driver for Samsung S3C2412 and S3C2413 SoC onboard UARTs.
- *
- * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *
- * 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/module.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/serial_core.h>
-#include <linux/serial.h>
-
-#include <asm/irq.h>
-#include <mach/hardware.h>
-
-#include <plat/regs-serial.h>
-#include <mach/regs-gpio.h>
-
-#include "samsung.h"
-
-static int s3c2412_serial_setsource(struct uart_port *port,
-                                    struct s3c24xx_uart_clksrc *clk)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       ucon &= ~S3C2412_UCON_CLKMASK;
-
-       if (strcmp(clk->name, "uclk") == 0)
-               ucon |= S3C2440_UCON_UCLK;
-       else if (strcmp(clk->name, "pclk") == 0)
-               ucon |= S3C2440_UCON_PCLK;
-       else if (strcmp(clk->name, "usysclk") == 0)
-               ucon |= S3C2412_UCON_USYSCLK;
-       else {
-               printk(KERN_ERR "unknown clock source %s\n", clk->name);
-               return -EINVAL;
-       }
-
-       wr_regl(port, S3C2410_UCON, ucon);
-       return 0;
-}
-
-
-static int s3c2412_serial_getsource(struct uart_port *port,
-                                   struct s3c24xx_uart_clksrc *clk)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       switch (ucon & S3C2412_UCON_CLKMASK) {
-       case S3C2412_UCON_UCLK:
-               clk->divisor = 1;
-               clk->name = "uclk";
-               break;
-
-       case S3C2412_UCON_PCLK:
-       case S3C2412_UCON_PCLK2:
-               clk->divisor = 1;
-               clk->name = "pclk";
-               break;
-
-       case S3C2412_UCON_USYSCLK:
-               clk->divisor = 1;
-               clk->name = "usysclk";
-               break;
-       }
-
-       return 0;
-}
-
-static int s3c2412_serial_resetport(struct uart_port *port,
-                                   struct s3c2410_uartcfg *cfg)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       dbg("%s: port=%p (%08lx), cfg=%p\n",
-           __func__, port, port->mapbase, cfg);
-
-       /* ensure we don't change the clock settings... */
-
-       ucon &= S3C2412_UCON_CLKMASK;
-
-       wr_regl(port, S3C2410_UCON,  ucon | cfg->ucon);
-       wr_regl(port, S3C2410_ULCON, cfg->ulcon);
-
-       /* reset both fifos */
-
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon);
-
-       return 0;
-}
-
-static struct s3c24xx_uart_info s3c2412_uart_inf = {
-       .name           = "Samsung S3C2412 UART",
-       .type           = PORT_S3C2412,
-       .fifosize       = 64,
-       .has_divslot    = 1,
-       .rx_fifomask    = S3C2440_UFSTAT_RXMASK,
-       .rx_fifoshift   = S3C2440_UFSTAT_RXSHIFT,
-       .rx_fifofull    = S3C2440_UFSTAT_RXFULL,
-       .tx_fifofull    = S3C2440_UFSTAT_TXFULL,
-       .tx_fifomask    = S3C2440_UFSTAT_TXMASK,
-       .tx_fifoshift   = S3C2440_UFSTAT_TXSHIFT,
-       .get_clksrc     = s3c2412_serial_getsource,
-       .set_clksrc     = s3c2412_serial_setsource,
-       .reset_port     = s3c2412_serial_resetport,
-};
-
-/* device management */
-
-static int s3c2412_serial_probe(struct platform_device *dev)
-{
-       dbg("s3c2440_serial_probe: dev=%p\n", dev);
-       return s3c24xx_serial_probe(dev, &s3c2412_uart_inf);
-}
-
-static struct platform_driver s3c2412_serial_driver = {
-       .probe          = s3c2412_serial_probe,
-       .remove         = __devexit_p(s3c24xx_serial_remove),
-       .driver         = {
-               .name   = "s3c2412-uart",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static inline int s3c2412_serial_init(void)
-{
-       return s3c24xx_serial_init(&s3c2412_serial_driver, &s3c2412_uart_inf);
-}
-
-static inline void s3c2412_serial_exit(void)
-{
-       platform_driver_unregister(&s3c2412_serial_driver);
-}
-
-module_init(s3c2412_serial_init);
-module_exit(s3c2412_serial_exit);
-
-MODULE_DESCRIPTION("Samsung S3C2412,S3C2413 SoC Serial port driver");
-MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:s3c2412-uart");
diff --git a/drivers/tty/serial/s3c2440.c b/drivers/tty/serial/s3c2440.c
deleted file mode 100644 (file)
index 1d0c324..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Driver for Samsung S3C2440 and S3C2442 SoC onboard UARTs.
- *
- * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *
- * 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/module.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/serial_core.h>
-#include <linux/serial.h>
-
-#include <asm/irq.h>
-#include <mach/hardware.h>
-
-#include <plat/regs-serial.h>
-#include <mach/regs-gpio.h>
-
-#include "samsung.h"
-
-
-static int s3c2440_serial_setsource(struct uart_port *port,
-                                    struct s3c24xx_uart_clksrc *clk)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       /* todo - proper fclk<>nonfclk switch. */
-
-       ucon &= ~S3C2440_UCON_CLKMASK;
-
-       if (strcmp(clk->name, "uclk") == 0)
-               ucon |= S3C2440_UCON_UCLK;
-       else if (strcmp(clk->name, "pclk") == 0)
-               ucon |= S3C2440_UCON_PCLK;
-       else if (strcmp(clk->name, "fclk") == 0)
-               ucon |= S3C2440_UCON_FCLK;
-       else {
-               printk(KERN_ERR "unknown clock source %s\n", clk->name);
-               return -EINVAL;
-       }
-
-       wr_regl(port, S3C2410_UCON, ucon);
-       return 0;
-}
-
-
-static int s3c2440_serial_getsource(struct uart_port *port,
-                                   struct s3c24xx_uart_clksrc *clk)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-       unsigned long ucon0, ucon1, ucon2;
-
-       switch (ucon & S3C2440_UCON_CLKMASK) {
-       case S3C2440_UCON_UCLK:
-               clk->divisor = 1;
-               clk->name = "uclk";
-               break;
-
-       case S3C2440_UCON_PCLK:
-       case S3C2440_UCON_PCLK2:
-               clk->divisor = 1;
-               clk->name = "pclk";
-               break;
-
-       case S3C2440_UCON_FCLK:
-               /* the fun of calculating the uart divisors on
-                * the s3c2440 */
-
-               ucon0 = __raw_readl(S3C24XX_VA_UART0 + S3C2410_UCON);
-               ucon1 = __raw_readl(S3C24XX_VA_UART1 + S3C2410_UCON);
-               ucon2 = __raw_readl(S3C24XX_VA_UART2 + S3C2410_UCON);
-
-               printk("ucons: %08lx, %08lx, %08lx\n", ucon0, ucon1, ucon2);
-
-               ucon0 &= S3C2440_UCON0_DIVMASK;
-               ucon1 &= S3C2440_UCON1_DIVMASK;
-               ucon2 &= S3C2440_UCON2_DIVMASK;
-
-               if (ucon0 != 0) {
-                       clk->divisor = ucon0 >> S3C2440_UCON_DIVSHIFT;
-                       clk->divisor += 6;
-               } else if (ucon1 != 0) {
-                       clk->divisor = ucon1 >> S3C2440_UCON_DIVSHIFT;
-                       clk->divisor += 21;
-               } else if (ucon2 != 0) {
-                       clk->divisor = ucon2 >> S3C2440_UCON_DIVSHIFT;
-                       clk->divisor += 36;
-               } else {
-                       /* manual calims 44, seems to be 9 */
-                       clk->divisor = 9;
-               }
-
-               clk->name = "fclk";
-               break;
-       }
-
-       return 0;
-}
-
-static int s3c2440_serial_resetport(struct uart_port *port,
-                                   struct s3c2410_uartcfg *cfg)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       dbg("s3c2440_serial_resetport: port=%p (%08lx), cfg=%p\n",
-           port, port->mapbase, cfg);
-
-       /* ensure we don't change the clock settings... */
-
-       ucon &= (S3C2440_UCON0_DIVMASK | (3<<10));
-
-       wr_regl(port, S3C2410_UCON,  ucon | cfg->ucon);
-       wr_regl(port, S3C2410_ULCON, cfg->ulcon);
-
-       /* reset both fifos */
-
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon);
-
-       return 0;
-}
-
-static struct s3c24xx_uart_info s3c2440_uart_inf = {
-       .name           = "Samsung S3C2440 UART",
-       .type           = PORT_S3C2440,
-       .fifosize       = 64,
-       .rx_fifomask    = S3C2440_UFSTAT_RXMASK,
-       .rx_fifoshift   = S3C2440_UFSTAT_RXSHIFT,
-       .rx_fifofull    = S3C2440_UFSTAT_RXFULL,
-       .tx_fifofull    = S3C2440_UFSTAT_TXFULL,
-       .tx_fifomask    = S3C2440_UFSTAT_TXMASK,
-       .tx_fifoshift   = S3C2440_UFSTAT_TXSHIFT,
-       .get_clksrc     = s3c2440_serial_getsource,
-       .set_clksrc     = s3c2440_serial_setsource,
-       .reset_port     = s3c2440_serial_resetport,
-};
-
-/* device management */
-
-static int s3c2440_serial_probe(struct platform_device *dev)
-{
-       dbg("s3c2440_serial_probe: dev=%p\n", dev);
-       return s3c24xx_serial_probe(dev, &s3c2440_uart_inf);
-}
-
-static struct platform_driver s3c2440_serial_driver = {
-       .probe          = s3c2440_serial_probe,
-       .remove         = __devexit_p(s3c24xx_serial_remove),
-       .driver         = {
-               .name   = "s3c2440-uart",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __init s3c2440_serial_init(void)
-{
-       return s3c24xx_serial_init(&s3c2440_serial_driver, &s3c2440_uart_inf);
-}
-
-static void __exit s3c2440_serial_exit(void)
-{
-       platform_driver_unregister(&s3c2440_serial_driver);
-}
-
-module_init(s3c2440_serial_init);
-module_exit(s3c2440_serial_exit);
-
-MODULE_DESCRIPTION("Samsung S3C2440,S3C2442 SoC Serial port driver");
-MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:s3c2440-uart");
diff --git a/drivers/tty/serial/s3c6400.c b/drivers/tty/serial/s3c6400.c
deleted file mode 100644 (file)
index e2f6913..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Driver for Samsung S3C6400 and S3C6410 SoC onboard UARTs.
- *
- * Copyright 2008 Openmoko,  Inc.
- * Copyright 2008 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *     http://armlinux.simtec.co.uk/
- *
- * 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/module.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/serial_core.h>
-#include <linux/serial.h>
-
-#include <asm/irq.h>
-#include <mach/hardware.h>
-
-#include <plat/regs-serial.h>
-
-#include "samsung.h"
-
-static int s3c6400_serial_setsource(struct uart_port *port,
-                                   struct s3c24xx_uart_clksrc *clk)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       if (strcmp(clk->name, "uclk0") == 0) {
-               ucon &= ~S3C6400_UCON_CLKMASK;
-               ucon |= S3C6400_UCON_UCLK0;
-       } else if (strcmp(clk->name, "uclk1") == 0)
-               ucon |= S3C6400_UCON_UCLK1;
-       else if (strcmp(clk->name, "pclk") == 0) {
-               /* See notes about transitioning from UCLK to PCLK */
-               ucon &= ~S3C6400_UCON_UCLK0;
-       } else {
-               printk(KERN_ERR "unknown clock source %s\n", clk->name);
-               return -EINVAL;
-       }
-
-       wr_regl(port, S3C2410_UCON, ucon);
-       return 0;
-}
-
-
-static int s3c6400_serial_getsource(struct uart_port *port,
-                                   struct s3c24xx_uart_clksrc *clk)
-{
-       u32 ucon = rd_regl(port, S3C2410_UCON);
-
-       clk->divisor = 1;
-
-       switch (ucon & S3C6400_UCON_CLKMASK) {
-       case S3C6400_UCON_UCLK0:
-               clk->name = "uclk0";
-               break;
-
-       case S3C6400_UCON_UCLK1:
-               clk->name = "uclk1";
-               break;
-
-       case S3C6400_UCON_PCLK:
-       case S3C6400_UCON_PCLK2:
-               clk->name = "pclk";
-               break;
-       }
-
-       return 0;
-}
-
-static int s3c6400_serial_resetport(struct uart_port *port,
-                                   struct s3c2410_uartcfg *cfg)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       dbg("s3c6400_serial_resetport: port=%p (%08lx), cfg=%p\n",
-           port, port->mapbase, cfg);
-
-       /* ensure we don't change the clock settings... */
-
-       ucon &= S3C6400_UCON_CLKMASK;
-
-       wr_regl(port, S3C2410_UCON,  ucon | cfg->ucon);
-       wr_regl(port, S3C2410_ULCON, cfg->ulcon);
-
-       /* reset both fifos */
-
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon);
-
-       return 0;
-}
-
-static struct s3c24xx_uart_info s3c6400_uart_inf = {
-       .name           = "Samsung S3C6400 UART",
-       .type           = PORT_S3C6400,
-       .fifosize       = 64,
-       .has_divslot    = 1,
-       .rx_fifomask    = S3C2440_UFSTAT_RXMASK,
-       .rx_fifoshift   = S3C2440_UFSTAT_RXSHIFT,
-       .rx_fifofull    = S3C2440_UFSTAT_RXFULL,
-       .tx_fifofull    = S3C2440_UFSTAT_TXFULL,
-       .tx_fifomask    = S3C2440_UFSTAT_TXMASK,
-       .tx_fifoshift   = S3C2440_UFSTAT_TXSHIFT,
-       .get_clksrc     = s3c6400_serial_getsource,
-       .set_clksrc     = s3c6400_serial_setsource,
-       .reset_port     = s3c6400_serial_resetport,
-};
-
-/* device management */
-
-static int s3c6400_serial_probe(struct platform_device *dev)
-{
-       dbg("s3c6400_serial_probe: dev=%p\n", dev);
-       return s3c24xx_serial_probe(dev, &s3c6400_uart_inf);
-}
-
-static struct platform_driver s3c6400_serial_driver = {
-       .probe          = s3c6400_serial_probe,
-       .remove         = __devexit_p(s3c24xx_serial_remove),
-       .driver         = {
-               .name   = "s3c6400-uart",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __init s3c6400_serial_init(void)
-{
-       return s3c24xx_serial_init(&s3c6400_serial_driver, &s3c6400_uart_inf);
-}
-
-static void __exit s3c6400_serial_exit(void)
-{
-       platform_driver_unregister(&s3c6400_serial_driver);
-}
-
-module_init(s3c6400_serial_init);
-module_exit(s3c6400_serial_exit);
-
-MODULE_DESCRIPTION("Samsung S3C6400,S3C6410 SoC Serial port driver");
-MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:s3c6400-uart");
diff --git a/drivers/tty/serial/s5pv210.c b/drivers/tty/serial/s5pv210.c
deleted file mode 100644 (file)
index 8b0b888..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com/
- *
- * Based on drivers/serial/s3c6400.c
- *
- * Driver for Samsung S5PV210 SoC UARTs.
- *
- * 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/module.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/serial_core.h>
-#include <linux/serial.h>
-#include <linux/delay.h>
-
-#include <asm/irq.h>
-#include <mach/hardware.h>
-#include <plat/regs-serial.h>
-#include "samsung.h"
-
-static int s5pv210_serial_setsource(struct uart_port *port,
-                                       struct s3c24xx_uart_clksrc *clk)
-{
-       struct s3c2410_uartcfg *cfg = port->dev->platform_data;
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       if (cfg->flags & NO_NEED_CHECK_CLKSRC)
-               return 0;
-
-       if (strcmp(clk->name, "pclk") == 0)
-               ucon &= ~S5PV210_UCON_CLKMASK;
-       else if (strcmp(clk->name, "uclk1") == 0)
-               ucon |= S5PV210_UCON_CLKMASK;
-       else {
-               printk(KERN_ERR "unknown clock source %s\n", clk->name);
-               return -EINVAL;
-       }
-
-       wr_regl(port, S3C2410_UCON, ucon);
-       return 0;
-}
-
-
-static int s5pv210_serial_getsource(struct uart_port *port,
-                                       struct s3c24xx_uart_clksrc *clk)
-{
-       struct s3c2410_uartcfg *cfg = port->dev->platform_data;
-       u32 ucon = rd_regl(port, S3C2410_UCON);
-
-       clk->divisor = 1;
-
-       if (cfg->flags & NO_NEED_CHECK_CLKSRC)
-               return 0;
-
-       switch (ucon & S5PV210_UCON_CLKMASK) {
-       case S5PV210_UCON_PCLK:
-               clk->name = "pclk";
-               break;
-       case S5PV210_UCON_UCLK:
-               clk->name = "uclk1";
-               break;
-       }
-
-       return 0;
-}
-
-static int s5pv210_serial_resetport(struct uart_port *port,
-                                       struct s3c2410_uartcfg *cfg)
-{
-       unsigned long ucon = rd_regl(port, S3C2410_UCON);
-
-       ucon &= S5PV210_UCON_CLKMASK;
-       wr_regl(port, S3C2410_UCON,  ucon | cfg->ucon);
-       wr_regl(port, S3C2410_ULCON, cfg->ulcon);
-
-       /* reset both fifos */
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
-       wr_regl(port, S3C2410_UFCON, cfg->ufcon);
-
-       /* It is need to delay When reset FIFO register */
-       udelay(1);
-
-       return 0;
-}
-
-#define S5PV210_UART_DEFAULT_INFO(fifo_size)                   \
-               .name           = "Samsung S5PV210 UART0",      \
-               .type           = PORT_S3C6400,                 \
-               .fifosize       = fifo_size,                    \
-               .has_divslot    = 1,                            \
-               .rx_fifomask    = S5PV210_UFSTAT_RXMASK,        \
-               .rx_fifoshift   = S5PV210_UFSTAT_RXSHIFT,       \
-               .rx_fifofull    = S5PV210_UFSTAT_RXFULL,        \
-               .tx_fifofull    = S5PV210_UFSTAT_TXFULL,        \
-               .tx_fifomask    = S5PV210_UFSTAT_TXMASK,        \
-               .tx_fifoshift   = S5PV210_UFSTAT_TXSHIFT,       \
-               .get_clksrc     = s5pv210_serial_getsource,     \
-               .set_clksrc     = s5pv210_serial_setsource,     \
-               .reset_port     = s5pv210_serial_resetport
-
-static struct s3c24xx_uart_info s5p_port_fifo256 = {
-       S5PV210_UART_DEFAULT_INFO(256),
-};
-
-static struct s3c24xx_uart_info s5p_port_fifo64 = {
-       S5PV210_UART_DEFAULT_INFO(64),
-};
-
-static struct s3c24xx_uart_info s5p_port_fifo16 = {
-       S5PV210_UART_DEFAULT_INFO(16),
-};
-
-static struct s3c24xx_uart_info *s5p_uart_inf[] = {
-       [0] = &s5p_port_fifo256,
-       [1] = &s5p_port_fifo64,
-       [2] = &s5p_port_fifo16,
-       [3] = &s5p_port_fifo16,
-};
-
-/* device management */
-static int s5p_serial_probe(struct platform_device *pdev)
-{
-       return s3c24xx_serial_probe(pdev, s5p_uart_inf[pdev->id]);
-}
-
-static struct platform_driver s5p_serial_driver = {
-       .probe          = s5p_serial_probe,
-       .remove         = __devexit_p(s3c24xx_serial_remove),
-       .driver         = {
-               .name   = "s5pv210-uart",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __init s5p_serial_init(void)
-{
-       return s3c24xx_serial_init(&s5p_serial_driver, *s5p_uart_inf);
-}
-
-static void __exit s5p_serial_exit(void)
-{
-       platform_driver_unregister(&s5p_serial_driver);
-}
-
-module_init(s5p_serial_init);
-module_exit(s5p_serial_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:s5pv210-uart");
-MODULE_DESCRIPTION("Samsung S5PV210 UART Driver support");
-MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>");
index b31f1c3a2c4c607268b795641bf6b9f8b1d10c0b..f96f37b5fec624566a9fef34754140189c84964d 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/delay.h>
 #include <linux/clk.h>
 #include <linux/cpufreq.h>
+#include <linux/of.h>
 
 #include <asm/irq.h>
 
@@ -49,6 +50,7 @@
 #include <mach/map.h>
 
 #include <plat/regs-serial.h>
+#include <plat/clock.h>
 
 #include "samsung.h"
 
@@ -190,10 +192,13 @@ static inline struct s3c24xx_uart_info *s3c24xx_port_to_info(struct uart_port *p
 
 static inline struct s3c2410_uartcfg *s3c24xx_port_to_cfg(struct uart_port *port)
 {
+       struct s3c24xx_uart_port *ourport;
+
        if (port->dev == NULL)
                return NULL;
 
-       return (struct s3c2410_uartcfg *)port->dev->platform_data;
+       ourport = container_of(port, struct s3c24xx_uart_port, port);
+       return ourport->cfg;
 }
 
 static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport,
@@ -202,7 +207,7 @@ static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport,
        struct s3c24xx_uart_info *info = ourport->info;
 
        if (ufstat & info->rx_fifofull)
-               return info->fifosize;
+               return ourport->port.fifosize;
 
        return (ufstat & info->rx_fifomask) >> info->rx_fifoshift;
 }
@@ -555,154 +560,98 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
  *
 */
 
+#define MAX_CLK_NAME_LENGTH 15
 
-#define MAX_CLKS (8)
-
-static struct s3c24xx_uart_clksrc tmp_clksrc = {
-       .name           = "pclk",
-       .min_baud       = 0,
-       .max_baud       = 0,
-       .divisor        = 1,
-};
-
-static inline int
-s3c24xx_serial_getsource(struct uart_port *port, struct s3c24xx_uart_clksrc *c)
+static inline int s3c24xx_serial_getsource(struct uart_port *port)
 {
        struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
+       unsigned int ucon;
 
-       return (info->get_clksrc)(port, c);
-}
-
-static inline int
-s3c24xx_serial_setsource(struct uart_port *port, struct s3c24xx_uart_clksrc *c)
-{
-       struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
+       if (info->num_clks == 1)
+               return 0;
 
-       return (info->set_clksrc)(port, c);
+       ucon = rd_regl(port, S3C2410_UCON);
+       ucon &= info->clksel_mask;
+       return ucon >> info->clksel_shift;
 }
 
-struct baud_calc {
-       struct s3c24xx_uart_clksrc      *clksrc;
-       unsigned int                     calc;
-       unsigned int                     divslot;
-       unsigned int                     quot;
-       struct clk                      *src;
-};
-
-static int s3c24xx_serial_calcbaud(struct baud_calc *calc,
-                                  struct uart_port *port,
-                                  struct s3c24xx_uart_clksrc *clksrc,
-                                  unsigned int baud)
+static void s3c24xx_serial_setsource(struct uart_port *port,
+                       unsigned int clk_sel)
 {
-       struct s3c24xx_uart_port *ourport = to_ourport(port);
-       unsigned long rate;
-
-       calc->src = clk_get(port->dev, clksrc->name);
-       if (calc->src == NULL || IS_ERR(calc->src))
-               return 0;
-
-       rate = clk_get_rate(calc->src);
-       rate /= clksrc->divisor;
+       struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
+       unsigned int ucon;
 
-       calc->clksrc = clksrc;
+       if (info->num_clks == 1)
+               return;
 
-       if (ourport->info->has_divslot) {
-               unsigned long div = rate / baud;
-
-               /* The UDIVSLOT register on the newer UARTs allows us to
-                * get a divisor adjustment of 1/16th on the baud clock.
-                *
-                * We don't keep the UDIVSLOT value (the 16ths we calculated
-                * by not multiplying the baud by 16) as it is easy enough
-                * to recalculate.
-                */
-
-               calc->quot = div / 16;
-               calc->calc = rate / div;
-       } else {
-               calc->quot = (rate + (8 * baud)) / (16 * baud);
-               calc->calc = (rate / (calc->quot * 16));
-       }
+       ucon = rd_regl(port, S3C2410_UCON);
+       if ((ucon & info->clksel_mask) >> info->clksel_shift == clk_sel)
+               return;
 
-       calc->quot--;
-       return 1;
+       ucon &= ~info->clksel_mask;
+       ucon |= clk_sel << info->clksel_shift;
+       wr_regl(port, S3C2410_UCON, ucon);
 }
 
-static unsigned int s3c24xx_serial_getclk(struct uart_port *port,
-                                         struct s3c24xx_uart_clksrc **clksrc,
-                                         struct clk **clk,
-                                         unsigned int baud)
+static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport,
+                       unsigned int req_baud, struct clk **best_clk,
+                       unsigned int *clk_num)
 {
-       struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
-       struct s3c24xx_uart_clksrc *clkp;
-       struct baud_calc res[MAX_CLKS];
-       struct baud_calc *resptr, *best, *sptr;
-       int i;
-
-       clkp = cfg->clocks;
-       best = NULL;
-
-       if (cfg->clocks_size < 2) {
-               if (cfg->clocks_size == 0)
-                       clkp = &tmp_clksrc;
-
-               /* check to see if we're sourcing fclk, and if so we're
-                * going to have to update the clock source
-                */
-
-               if (strcmp(clkp->name, "fclk") == 0) {
-                       struct s3c24xx_uart_clksrc src;
-
-                       s3c24xx_serial_getsource(port, &src);
-
-                       /* check that the port already using fclk, and if
-                        * not, then re-select fclk
+       struct s3c24xx_uart_info *info = ourport->info;
+       struct clk *clk;
+       unsigned long rate;
+       unsigned int cnt, baud, quot, clk_sel, best_quot = 0;
+       char clkname[MAX_CLK_NAME_LENGTH];
+       int calc_deviation, deviation = (1 << 30) - 1;
+
+       *best_clk = NULL;
+       clk_sel = (ourport->cfg->clk_sel) ? ourport->cfg->clk_sel :
+                       ourport->info->def_clk_sel;
+       for (cnt = 0; cnt < info->num_clks; cnt++) {
+               if (!(clk_sel & (1 << cnt)))
+                       continue;
+
+               sprintf(clkname, "clk_uart_baud%d", cnt);
+               clk = clk_get(ourport->port.dev, clkname);
+               if (IS_ERR_OR_NULL(clk))
+                       continue;
+
+               rate = clk_get_rate(clk);
+               if (!rate)
+                       continue;
+
+               if (ourport->info->has_divslot) {
+                       unsigned long div = rate / req_baud;
+
+                       /* The UDIVSLOT register on the newer UARTs allows us to
+                        * get a divisor adjustment of 1/16th on the baud clock.
+                        *
+                        * We don't keep the UDIVSLOT value (the 16ths we
+                        * calculated by not multiplying the baud by 16) as it
+                        * is easy enough to recalculate.
                         */
 
-                       if (strcmp(src.name, clkp->name) == 0) {
-                               s3c24xx_serial_setsource(port, clkp);
-                               s3c24xx_serial_getsource(port, &src);
-                       }
-
-                       clkp->divisor = src.divisor;
-               }
-
-               s3c24xx_serial_calcbaud(res, port, clkp, baud);
-               best = res;
-               resptr = best + 1;
-       } else {
-               resptr = res;
-
-               for (i = 0; i < cfg->clocks_size; i++, clkp++) {
-                       if (s3c24xx_serial_calcbaud(resptr, port, clkp, baud))
-                               resptr++;
+                       quot = div / 16;
+                       baud = rate / div;
+               } else {
+                       quot = (rate + (8 * req_baud)) / (16 * req_baud);
+                       baud = rate / (quot * 16);
                }
-       }
-
-       /* ok, we now need to select the best clock we found */
-
-       if (!best) {
-               unsigned int deviation = (1<<30)|((1<<30)-1);
-               int calc_deviation;
+               quot--;
 
-               for (sptr = res; sptr < resptr; sptr++) {
-                       calc_deviation = baud - sptr->calc;
-                       if (calc_deviation < 0)
-                               calc_deviation = -calc_deviation;
+               calc_deviation = req_baud - baud;
+               if (calc_deviation < 0)
+                       calc_deviation = -calc_deviation;
 
-                       if (calc_deviation < deviation) {
-                               best = sptr;
-                               deviation = calc_deviation;
-                       }
+               if (calc_deviation < deviation) {
+                       *best_clk = clk;
+                       best_quot = quot;
+                       *clk_num = cnt;
+                       deviation = calc_deviation;
                }
        }
 
-       /* store results to pass back */
-
-       *clksrc = best->clksrc;
-       *clk    = best->src;
-
-       return best->quot;
+       return best_quot;
 }
 
 /* udivslot_table[]
@@ -735,10 +684,9 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
 {
        struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
        struct s3c24xx_uart_port *ourport = to_ourport(port);
-       struct s3c24xx_uart_clksrc *clksrc = NULL;
        struct clk *clk = NULL;
        unsigned long flags;
-       unsigned int baud, quot;
+       unsigned int baud, quot, clk_sel = 0;
        unsigned int ulcon;
        unsigned int umcon;
        unsigned int udivslot = 0;
@@ -754,17 +702,16 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
         */
 
        baud = uart_get_baud_rate(port, termios, old, 0, 115200*8);
-
+       quot = s3c24xx_serial_getclk(ourport, baud, &clk, &clk_sel);
        if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST)
                quot = port->custom_divisor;
-       else
-               quot = s3c24xx_serial_getclk(port, &clksrc, &clk, baud);
+       if (!clk)
+               return;
 
        /* check to see if we need  to change clock source */
 
-       if (ourport->clksrc != clksrc || ourport->baudclk != clk) {
-               dbg("selecting clock %p\n", clk);
-               s3c24xx_serial_setsource(port, clksrc);
+       if (ourport->baudclk != clk) {
+               s3c24xx_serial_setsource(port, clk_sel);
 
                if (ourport->baudclk != NULL && !IS_ERR(ourport->baudclk)) {
                        clk_disable(ourport->baudclk);
@@ -773,7 +720,6 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
 
                clk_enable(clk);
 
-               ourport->clksrc = clksrc;
                ourport->baudclk = clk;
                ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;
        }
@@ -1020,16 +966,29 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
 
 /* s3c24xx_serial_resetport
  *
- * wrapper to call the specific reset for this port (reset the fifos
- * and the settings)
+ * reset the fifos and other the settings.
 */
 
-static inline int s3c24xx_serial_resetport(struct uart_port *port,
-                                          struct s3c2410_uartcfg *cfg)
+static void s3c24xx_serial_resetport(struct uart_port *port,
+                                  struct s3c2410_uartcfg *cfg)
 {
        struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
+       unsigned long ucon = rd_regl(port, S3C2410_UCON);
+       unsigned int ucon_mask;
+
+       ucon_mask = info->clksel_mask;
+       if (info->type == PORT_S3C2440)
+               ucon_mask |= S3C2440_UCON0_DIVMASK;
 
-       return (info->reset_port)(port, cfg);
+       ucon &= ucon_mask;
+       wr_regl(port, S3C2410_UCON,  ucon | cfg->ucon);
+
+       /* reset both fifos */
+       wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
+       wr_regl(port, S3C2410_UFCON, cfg->ufcon);
+
+       /* some delay is required after fifo reset */
+       udelay(1);
 }
 
 
@@ -1121,11 +1080,10 @@ static inline void s3c24xx_serial_cpufreq_deregister(struct s3c24xx_uart_port *p
  */
 
 static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
-                                   struct s3c24xx_uart_info *info,
                                    struct platform_device *platdev)
 {
        struct uart_port *port = &ourport->port;
-       struct s3c2410_uartcfg *cfg;
+       struct s3c2410_uartcfg *cfg = ourport->cfg;
        struct resource *res;
        int ret;
 
@@ -1134,30 +1092,16 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
        if (platdev == NULL)
                return -ENODEV;
 
-       cfg = s3c24xx_dev_to_cfg(&platdev->dev);
-
        if (port->mapbase != 0)
                return 0;
 
-       if (cfg->hwport > CONFIG_SERIAL_SAMSUNG_UARTS) {
-               printk(KERN_ERR "%s: port %d bigger than %d\n", __func__,
-                      cfg->hwport, CONFIG_SERIAL_SAMSUNG_UARTS);
-               return -ERANGE;
-       }
-
        /* setup info for port */
        port->dev       = &platdev->dev;
-       ourport->info   = info;
 
        /* Startup sequence is different for s3c64xx and higher SoC's */
        if (s3c24xx_serial_has_interrupt_mask(port))
                s3c24xx_serial_ops.startup = s3c64xx_serial_startup;
 
-       /* copy the info in from provided structure */
-       ourport->port.fifosize = info->fifosize;
-
-       dbg("s3c24xx_serial_init_port: %p (hw %d)...\n", port, cfg->hwport);
-
        port->uartclk = 1;
 
        if (cfg->uart_flags & UPF_CONS_FLOW) {
@@ -1215,43 +1159,74 @@ static ssize_t s3c24xx_serial_show_clksrc(struct device *dev,
        struct uart_port *port = s3c24xx_dev_to_port(dev);
        struct s3c24xx_uart_port *ourport = to_ourport(port);
 
-       return snprintf(buf, PAGE_SIZE, "* %s\n", ourport->clksrc->name);
+       return snprintf(buf, PAGE_SIZE, "* %s\n", ourport->baudclk->name);
 }
 
 static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL);
 
+
 /* Device driver serial port probe */
 
+static const struct of_device_id s3c24xx_uart_dt_match[];
 static int probe_index;
 
-int s3c24xx_serial_probe(struct platform_device *dev,
-                        struct s3c24xx_uart_info *info)
+static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data(
+                       struct platform_device *pdev)
+{
+#ifdef CONFIG_OF
+       if (pdev->dev.of_node) {
+               const struct of_device_id *match;
+               match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node);
+               return (struct s3c24xx_serial_drv_data *)match->data;
+       }
+#endif
+       return (struct s3c24xx_serial_drv_data *)
+                       platform_get_device_id(pdev)->driver_data;
+}
+
+static int s3c24xx_serial_probe(struct platform_device *pdev)
 {
        struct s3c24xx_uart_port *ourport;
        int ret;
 
-       dbg("s3c24xx_serial_probe(%p, %p) %d\n", dev, info, probe_index);
+       dbg("s3c24xx_serial_probe(%p) %d\n", pdev, probe_index);
 
        ourport = &s3c24xx_serial_ports[probe_index];
+
+       ourport->drv_data = s3c24xx_get_driver_data(pdev);
+       if (!ourport->drv_data) {
+               dev_err(&pdev->dev, "could not find driver data\n");
+               return -ENODEV;
+       }
+
+       ourport->info = ourport->drv_data->info;
+       ourport->cfg = (pdev->dev.platform_data) ?
+                       (struct s3c2410_uartcfg *)pdev->dev.platform_data :
+                       ourport->drv_data->def_cfg;
+
+       ourport->port.fifosize = (ourport->info->fifosize) ?
+               ourport->info->fifosize :
+               ourport->drv_data->fifosize[probe_index];
+
        probe_index++;
 
        dbg("%s: initialising port %p...\n", __func__, ourport);
 
-       ret = s3c24xx_serial_init_port(ourport, info, dev);
+       ret = s3c24xx_serial_init_port(ourport, pdev);
        if (ret < 0)
                goto probe_err;
 
        dbg("%s: adding port\n", __func__);
        uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
-       platform_set_drvdata(dev, &ourport->port);
+       platform_set_drvdata(pdev, &ourport->port);
 
-       ret = device_create_file(&dev->dev, &dev_attr_clock_source);
+       ret = device_create_file(&pdev->dev, &dev_attr_clock_source);
        if (ret < 0)
-               printk(KERN_ERR "%s: failed to add clksrc attr.\n", __func__);
+               dev_err(&pdev->dev, "failed to add clock source attr.\n");
 
        ret = s3c24xx_serial_cpufreq_register(ourport);
        if (ret < 0)
-               dev_err(&dev->dev, "failed to add cpufreq notifier\n");
+               dev_err(&pdev->dev, "failed to add cpufreq notifier\n");
 
        return 0;
 
@@ -1259,9 +1234,7 @@ int s3c24xx_serial_probe(struct platform_device *dev,
        return ret;
 }
 
-EXPORT_SYMBOL_GPL(s3c24xx_serial_probe);
-
-int __devexit s3c24xx_serial_remove(struct platform_device *dev)
+static int __devexit s3c24xx_serial_remove(struct platform_device *dev)
 {
        struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
 
@@ -1274,8 +1247,6 @@ int __devexit s3c24xx_serial_remove(struct platform_device *dev)
        return 0;
 }
 
-EXPORT_SYMBOL_GPL(s3c24xx_serial_remove);
-
 /* UART power management code */
 #ifdef CONFIG_PM_SLEEP
 static int s3c24xx_serial_suspend(struct device *dev)
@@ -1315,41 +1286,6 @@ static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
 #define SERIAL_SAMSUNG_PM_OPS  NULL
 #endif /* CONFIG_PM_SLEEP */
 
-int s3c24xx_serial_init(struct platform_driver *drv,
-                       struct s3c24xx_uart_info *info)
-{
-       dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
-
-       drv->driver.pm = SERIAL_SAMSUNG_PM_OPS;
-
-       return platform_driver_register(drv);
-}
-
-EXPORT_SYMBOL_GPL(s3c24xx_serial_init);
-
-/* module initialisation code */
-
-static int __init s3c24xx_serial_modinit(void)
-{
-       int ret;
-
-       ret = uart_register_driver(&s3c24xx_uart_drv);
-       if (ret < 0) {
-               printk(KERN_ERR "failed to register UART driver\n");
-               return -1;
-       }
-
-       return 0;
-}
-
-static void __exit s3c24xx_serial_modexit(void)
-{
-       uart_unregister_driver(&s3c24xx_uart_drv);
-}
-
-module_init(s3c24xx_serial_modinit);
-module_exit(s3c24xx_serial_modexit);
-
 /* Console code */
 
 #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
@@ -1395,12 +1331,13 @@ static void __init
 s3c24xx_serial_get_options(struct uart_port *port, int *baud,
                           int *parity, int *bits)
 {
-       struct s3c24xx_uart_clksrc clksrc;
        struct clk *clk;
        unsigned int ulcon;
        unsigned int ucon;
        unsigned int ubrdiv;
        unsigned long rate;
+       unsigned int clk_sel;
+       char clk_name[MAX_CLK_NAME_LENGTH];
 
        ulcon  = rd_regl(port, S3C2410_ULCON);
        ucon   = rd_regl(port, S3C2410_UCON);
@@ -1445,44 +1382,21 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
 
                /* now calculate the baud rate */
 
-               s3c24xx_serial_getsource(port, &clksrc);
+               clk_sel = s3c24xx_serial_getsource(port);
+               sprintf(clk_name, "clk_uart_baud%d", clk_sel);
 
-               clk = clk_get(port->dev, clksrc.name);
+               clk = clk_get(port->dev, clk_name);
                if (!IS_ERR(clk) && clk != NULL)
-                       rate = clk_get_rate(clk) / clksrc.divisor;
+                       rate = clk_get_rate(clk);
                else
                        rate = 1;
 
-
                *baud = rate / (16 * (ubrdiv + 1));
                dbg("calculated baud %d\n", *baud);
        }
 
 }
 
-/* s3c24xx_serial_init_ports
- *
- * initialise the serial ports from the machine provided initialisation
- * data.
-*/
-
-static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
-{
-       struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
-       struct platform_device **platdev_ptr;
-       int i;
-
-       dbg("s3c24xx_serial_init_ports: initialising ports...\n");
-
-       platdev_ptr = s3c24xx_uart_devs;
-
-       for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
-               s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
-       }
-
-       return 0;
-}
-
 static int __init
 s3c24xx_serial_console_setup(struct console *co, char *options)
 {
@@ -1526,11 +1440,6 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
        return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
-/* s3c24xx_serial_initconsole
- *
- * initialise the console from one of the uart drivers
-*/
-
 static struct console s3c24xx_serial_console = {
        .name           = S3C24XX_SERIAL_NAME,
        .device         = uart_console_device,
@@ -1540,34 +1449,250 @@ static struct console s3c24xx_serial_console = {
        .setup          = s3c24xx_serial_console_setup,
        .data           = &s3c24xx_uart_drv,
 };
+#endif /* CONFIG_SERIAL_SAMSUNG_CONSOLE */
 
-int s3c24xx_serial_initconsole(struct platform_driver *drv,
-                              struct s3c24xx_uart_info **info)
+#ifdef CONFIG_CPU_S3C2410
+static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
+       .info = &(struct s3c24xx_uart_info) {
+               .name           = "Samsung S3C2410 UART",
+               .type           = PORT_S3C2410,
+               .fifosize       = 16,
+               .rx_fifomask    = S3C2410_UFSTAT_RXMASK,
+               .rx_fifoshift   = S3C2410_UFSTAT_RXSHIFT,
+               .rx_fifofull    = S3C2410_UFSTAT_RXFULL,
+               .tx_fifofull    = S3C2410_UFSTAT_TXFULL,
+               .tx_fifomask    = S3C2410_UFSTAT_TXMASK,
+               .tx_fifoshift   = S3C2410_UFSTAT_TXSHIFT,
+               .def_clk_sel    = S3C2410_UCON_CLKSEL0,
+               .num_clks       = 2,
+               .clksel_mask    = S3C2410_UCON_CLKMASK,
+               .clksel_shift   = S3C2410_UCON_CLKSHIFT,
+       },
+       .def_cfg = &(struct s3c2410_uartcfg) {
+               .ucon           = S3C2410_UCON_DEFAULT,
+               .ufcon          = S3C2410_UFCON_DEFAULT,
+       },
+};
+#define S3C2410_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2410_serial_drv_data)
+#else
+#define S3C2410_SERIAL_DRV_DATA (kernel_ulong_t)NULL
+#endif
 
-{
-       struct platform_device *dev = s3c24xx_uart_devs[0];
+#ifdef CONFIG_CPU_S3C2412
+static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
+       .info = &(struct s3c24xx_uart_info) {
+               .name           = "Samsung S3C2412 UART",
+               .type           = PORT_S3C2412,
+               .fifosize       = 64,
+               .has_divslot    = 1,
+               .rx_fifomask    = S3C2440_UFSTAT_RXMASK,
+               .rx_fifoshift   = S3C2440_UFSTAT_RXSHIFT,
+               .rx_fifofull    = S3C2440_UFSTAT_RXFULL,
+               .tx_fifofull    = S3C2440_UFSTAT_TXFULL,
+               .tx_fifomask    = S3C2440_UFSTAT_TXMASK,
+               .tx_fifoshift   = S3C2440_UFSTAT_TXSHIFT,
+               .def_clk_sel    = S3C2410_UCON_CLKSEL2,
+               .num_clks       = 4,
+               .clksel_mask    = S3C2412_UCON_CLKMASK,
+               .clksel_shift   = S3C2412_UCON_CLKSHIFT,
+       },
+       .def_cfg = &(struct s3c2410_uartcfg) {
+               .ucon           = S3C2410_UCON_DEFAULT,
+               .ufcon          = S3C2410_UFCON_DEFAULT,
+       },
+};
+#define S3C2412_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2412_serial_drv_data)
+#else
+#define S3C2412_SERIAL_DRV_DATA (kernel_ulong_t)NULL
+#endif
 
-       dbg("s3c24xx_serial_initconsole\n");
+#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \
+       defined(CONFIG_CPU_S3C2443)
+static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
+       .info = &(struct s3c24xx_uart_info) {
+               .name           = "Samsung S3C2440 UART",
+               .type           = PORT_S3C2440,
+               .fifosize       = 64,
+               .has_divslot    = 1,
+               .rx_fifomask    = S3C2440_UFSTAT_RXMASK,
+               .rx_fifoshift   = S3C2440_UFSTAT_RXSHIFT,
+               .rx_fifofull    = S3C2440_UFSTAT_RXFULL,
+               .tx_fifofull    = S3C2440_UFSTAT_TXFULL,
+               .tx_fifomask    = S3C2440_UFSTAT_TXMASK,
+               .tx_fifoshift   = S3C2440_UFSTAT_TXSHIFT,
+               .def_clk_sel    = S3C2410_UCON_CLKSEL2,
+               .num_clks       = 4,
+               .clksel_mask    = S3C2412_UCON_CLKMASK,
+               .clksel_shift   = S3C2412_UCON_CLKSHIFT,
+       },
+       .def_cfg = &(struct s3c2410_uartcfg) {
+               .ucon           = S3C2410_UCON_DEFAULT,
+               .ufcon          = S3C2410_UFCON_DEFAULT,
+       },
+};
+#define S3C2440_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2440_serial_drv_data)
+#else
+#define S3C2440_SERIAL_DRV_DATA (kernel_ulong_t)NULL
+#endif
 
-       /* select driver based on the cpu */
+#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) || \
+       defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) || \
+       defined(CONFIG_CPU_S5PC100)
+static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
+       .info = &(struct s3c24xx_uart_info) {
+               .name           = "Samsung S3C6400 UART",
+               .type           = PORT_S3C6400,
+               .fifosize       = 64,
+               .has_divslot    = 1,
+               .rx_fifomask    = S3C2440_UFSTAT_RXMASK,
+               .rx_fifoshift   = S3C2440_UFSTAT_RXSHIFT,
+               .rx_fifofull    = S3C2440_UFSTAT_RXFULL,
+               .tx_fifofull    = S3C2440_UFSTAT_TXFULL,
+               .tx_fifomask    = S3C2440_UFSTAT_TXMASK,
+               .tx_fifoshift   = S3C2440_UFSTAT_TXSHIFT,
+               .def_clk_sel    = S3C2410_UCON_CLKSEL2,
+               .num_clks       = 4,
+               .clksel_mask    = S3C6400_UCON_CLKMASK,
+               .clksel_shift   = S3C6400_UCON_CLKSHIFT,
+       },
+       .def_cfg = &(struct s3c2410_uartcfg) {
+               .ucon           = S3C2410_UCON_DEFAULT,
+               .ufcon          = S3C2410_UFCON_DEFAULT,
+       },
+};
+#define S3C6400_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c6400_serial_drv_data)
+#else
+#define S3C6400_SERIAL_DRV_DATA (kernel_ulong_t)NULL
+#endif
 
-       if (dev == NULL) {
-               printk(KERN_ERR "s3c24xx: no devices for console init\n");
-               return 0;
-       }
+#ifdef CONFIG_CPU_S5PV210
+static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
+       .info = &(struct s3c24xx_uart_info) {
+               .name           = "Samsung S5PV210 UART",
+               .type           = PORT_S3C6400,
+               .has_divslot    = 1,
+               .rx_fifomask    = S5PV210_UFSTAT_RXMASK,
+               .rx_fifoshift   = S5PV210_UFSTAT_RXSHIFT,
+               .rx_fifofull    = S5PV210_UFSTAT_RXFULL,
+               .tx_fifofull    = S5PV210_UFSTAT_TXFULL,
+               .tx_fifomask    = S5PV210_UFSTAT_TXMASK,
+               .tx_fifoshift   = S5PV210_UFSTAT_TXSHIFT,
+               .def_clk_sel    = S3C2410_UCON_CLKSEL0,
+               .num_clks       = 2,
+               .clksel_mask    = S5PV210_UCON_CLKMASK,
+               .clksel_shift   = S5PV210_UCON_CLKSHIFT,
+       },
+       .def_cfg = &(struct s3c2410_uartcfg) {
+               .ucon           = S5PV210_UCON_DEFAULT,
+               .ufcon          = S5PV210_UFCON_DEFAULT,
+       },
+       .fifosize = { 256, 64, 16, 16 },
+};
+#define S5PV210_SERIAL_DRV_DATA ((kernel_ulong_t)&s5pv210_serial_drv_data)
+#else
+#define S5PV210_SERIAL_DRV_DATA        (kernel_ulong_t)NULL
+#endif
 
-       if (strcmp(dev->name, drv->driver.name) != 0)
-               return 0;
+#ifdef CONFIG_CPU_EXYNOS4210
+static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
+       .info = &(struct s3c24xx_uart_info) {
+               .name           = "Samsung Exynos4 UART",
+               .type           = PORT_S3C6400,
+               .has_divslot    = 1,
+               .rx_fifomask    = S5PV210_UFSTAT_RXMASK,
+               .rx_fifoshift   = S5PV210_UFSTAT_RXSHIFT,
+               .rx_fifofull    = S5PV210_UFSTAT_RXFULL,
+               .tx_fifofull    = S5PV210_UFSTAT_TXFULL,
+               .tx_fifomask    = S5PV210_UFSTAT_TXMASK,
+               .tx_fifoshift   = S5PV210_UFSTAT_TXSHIFT,
+               .def_clk_sel    = S3C2410_UCON_CLKSEL0,
+               .num_clks       = 1,
+               .clksel_mask    = 0,
+               .clksel_shift   = 0,
+       },
+       .def_cfg = &(struct s3c2410_uartcfg) {
+               .ucon           = S5PV210_UCON_DEFAULT,
+               .ufcon          = S5PV210_UFCON_DEFAULT,
+               .has_fracval    = 1,
+       },
+       .fifosize = { 256, 64, 16, 16 },
+};
+#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data)
+#else
+#define EXYNOS4210_SERIAL_DRV_DATA (kernel_ulong_t)NULL
+#endif
 
-       s3c24xx_serial_console.data = &s3c24xx_uart_drv;
-       s3c24xx_serial_init_ports(info);
+static struct platform_device_id s3c24xx_serial_driver_ids[] = {
+       {
+               .name           = "s3c2410-uart",
+               .driver_data    = S3C2410_SERIAL_DRV_DATA,
+       }, {
+               .name           = "s3c2412-uart",
+               .driver_data    = S3C2412_SERIAL_DRV_DATA,
+       }, {
+               .name           = "s3c2440-uart",
+               .driver_data    = S3C2440_SERIAL_DRV_DATA,
+       }, {
+               .name           = "s3c6400-uart",
+               .driver_data    = S3C6400_SERIAL_DRV_DATA,
+       }, {
+               .name           = "s5pv210-uart",
+               .driver_data    = S5PV210_SERIAL_DRV_DATA,
+       }, {
+               .name           = "exynos4210-uart",
+               .driver_data    = EXYNOS4210_SERIAL_DRV_DATA,
+       },
+       { },
+};
+MODULE_DEVICE_TABLE(platform, s3c24xx_serial_driver_ids);
 
-       register_console(&s3c24xx_serial_console);
-       return 0;
+#ifdef CONFIG_OF
+static const struct of_device_id s3c24xx_uart_dt_match[] = {
+       { .compatible = "samsung,exynos4210-uart",
+               .data = (void *)EXYNOS4210_SERIAL_DRV_DATA },
+       {},
+};
+MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
+#else
+#define s3c24xx_uart_dt_match NULL
+#endif
+
+static struct platform_driver samsung_serial_driver = {
+       .probe          = s3c24xx_serial_probe,
+       .remove         = __devexit_p(s3c24xx_serial_remove),
+       .id_table       = s3c24xx_serial_driver_ids,
+       .driver         = {
+               .name   = "samsung-uart",
+               .owner  = THIS_MODULE,
+               .pm     = SERIAL_SAMSUNG_PM_OPS,
+               .of_match_table = s3c24xx_uart_dt_match,
+       },
+};
+
+/* module initialisation code */
+
+static int __init s3c24xx_serial_modinit(void)
+{
+       int ret;
+
+       ret = uart_register_driver(&s3c24xx_uart_drv);
+       if (ret < 0) {
+               printk(KERN_ERR "failed to register UART driver\n");
+               return -1;
+       }
+
+       return platform_driver_register(&samsung_serial_driver);
 }
 
-#endif /* CONFIG_SERIAL_SAMSUNG_CONSOLE */
+static void __exit s3c24xx_serial_modexit(void)
+{
+       uart_unregister_driver(&s3c24xx_uart_drv);
+}
+
+module_init(s3c24xx_serial_modinit);
+module_exit(s3c24xx_serial_modexit);
 
+MODULE_ALIAS("platform:samsung-uart");
 MODULE_DESCRIPTION("Samsung SoC Serial port driver");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
 MODULE_LICENSE("GPL v2");
index 8e87b788e5c6a62d65c2cf727008736486401160..1a4bca3e41797583e1fb4fca5d90b58c8676bffe 100644 (file)
@@ -19,20 +19,25 @@ struct s3c24xx_uart_info {
        unsigned long           tx_fifomask;
        unsigned long           tx_fifoshift;
        unsigned long           tx_fifofull;
+       unsigned int            def_clk_sel;
+       unsigned long           num_clks;
+       unsigned long           clksel_mask;
+       unsigned long           clksel_shift;
 
        /* uart port features */
 
        unsigned int            has_divslot:1;
 
-       /* clock source control */
-
-       int (*get_clksrc)(struct uart_port *, struct s3c24xx_uart_clksrc *clk);
-       int (*set_clksrc)(struct uart_port *, struct s3c24xx_uart_clksrc *clk);
-
        /* uart controls */
        int (*reset_port)(struct uart_port *, struct s3c2410_uartcfg *);
 };
 
+struct s3c24xx_serial_drv_data {
+       struct s3c24xx_uart_info        *info;
+       struct s3c2410_uartcfg          *def_cfg;
+       unsigned int                    fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
+};
+
 struct s3c24xx_uart_port {
        unsigned char                   rx_claimed;
        unsigned char                   tx_claimed;
@@ -43,10 +48,13 @@ struct s3c24xx_uart_port {
        unsigned int                    tx_irq;
 
        struct s3c24xx_uart_info        *info;
-       struct s3c24xx_uart_clksrc      *clksrc;
        struct clk                      *clk;
        struct clk                      *baudclk;
        struct uart_port                port;
+       struct s3c24xx_serial_drv_data  *drv_data;
+
+       /* reference to platform data */
+       struct s3c2410_uartcfg          *cfg;
 
 #ifdef CONFIG_CPU_FREQ
        struct notifier_block           freq_transition;
@@ -56,7 +64,6 @@ struct s3c24xx_uart_port {
 /* conversion functions */
 
 #define s3c24xx_dev_to_port(__dev) (struct uart_port *)dev_get_drvdata(__dev)
-#define s3c24xx_dev_to_cfg(__dev) (struct s3c2410_uartcfg *)((__dev)->platform_data)
 
 /* register access controls */
 
@@ -69,17 +76,6 @@ struct s3c24xx_uart_port {
 #define wr_regb(port, reg, val) __raw_writeb(val, portaddr(port, reg))
 #define wr_regl(port, reg, val) __raw_writel(val, portaddr(port, reg))
 
-extern int s3c24xx_serial_probe(struct platform_device *dev,
-                               struct s3c24xx_uart_info *uart);
-
-extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);
-
-extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
-                                     struct s3c24xx_uart_info **uart);
-
-extern int s3c24xx_serial_init(struct platform_driver *drv,
-                              struct s3c24xx_uart_info *info);
-
 #ifdef CONFIG_SERIAL_SAMSUNG_DEBUG
 
 extern void printascii(const char *);
index e8c564a533469f00f7e40435933ae496187aa20a..a8078d0638fa09de0f0c0be43c70dd1d94909ee5 100644 (file)
@@ -1458,6 +1458,16 @@ static const struct usb_device_id acm_ids[] = {
        },
        { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
        },
+       /* Motorola H24 HSPA module: */
+       { USB_DEVICE(0x22b8, 0x2d91) }, /* modem                                */
+       { USB_DEVICE(0x22b8, 0x2d92) }, /* modem           + diagnostics        */
+       { USB_DEVICE(0x22b8, 0x2d93) }, /* modem + AT port                      */
+       { USB_DEVICE(0x22b8, 0x2d95) }, /* modem + AT port + diagnostics        */
+       { USB_DEVICE(0x22b8, 0x2d96) }, /* modem                         + NMEA */
+       { USB_DEVICE(0x22b8, 0x2d97) }, /* modem           + diagnostics + NMEA */
+       { USB_DEVICE(0x22b8, 0x2d99) }, /* modem + AT port               + NMEA */
+       { USB_DEVICE(0x22b8, 0x2d9a) }, /* modem + AT port + diagnostics + NMEA */
+
        { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
        .driver_info = NO_UNION_NORMAL, /* union descriptor misplaced on
                                           data interface instead of
index 8efe0fa9228dc737f1623fd18cf8e4411208f67b..1ed56d8492d7366adc965d99800a85e58bc6bbe7 100644 (file)
@@ -1748,7 +1748,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
 
        /* rm9200 needs manual D+ pullup; off by default */
        if (cpu_is_at91rm9200()) {
-               if (udc->board.pullup_pin <= 0) {
+               if (gpio_is_valid(udc->board.pullup_pin)) {
                        DBG("no D+ pullup?\n");
                        retval = -ENODEV;
                        goto fail0;
@@ -1815,7 +1815,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
                DBG("request irq %d failed\n", udc->udp_irq);
                goto fail1;
        }
-       if (udc->board.vbus_pin > 0) {
+       if (gpio_is_valid(udc->board.vbus_pin)) {
                retval = gpio_request(udc->board.vbus_pin, "udc_vbus");
                if (retval < 0) {
                        DBG("request vbus pin failed\n");
@@ -1859,10 +1859,10 @@ static int __init at91udc_probe(struct platform_device *pdev)
        INFO("%s version %s\n", driver_name, DRIVER_VERSION);
        return 0;
 fail4:
-       if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled)
+       if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled)
                free_irq(udc->board.vbus_pin, udc);
 fail3:
-       if (udc->board.vbus_pin > 0)
+       if (gpio_is_valid(udc->board.vbus_pin))
                gpio_free(udc->board.vbus_pin);
 fail2:
        free_irq(udc->udp_irq, udc);
@@ -1897,7 +1897,7 @@ static int __exit at91udc_remove(struct platform_device *pdev)
 
        device_init_wakeup(&pdev->dev, 0);
        remove_debug_file(udc);
-       if (udc->board.vbus_pin > 0) {
+       if (gpio_is_valid(udc->board.vbus_pin)) {
                free_irq(udc->board.vbus_pin, udc);
                gpio_free(udc->board.vbus_pin);
        }
@@ -1941,7 +1941,7 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)
                enable_irq_wake(udc->udp_irq);
 
        udc->active_suspend = wake;
-       if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled && wake)
+       if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled && wake)
                enable_irq_wake(udc->board.vbus_pin);
        return 0;
 }
@@ -1951,7 +1951,7 @@ static int at91udc_resume(struct platform_device *pdev)
        struct at91_udc *udc = platform_get_drvdata(pdev);
        unsigned long   flags;
 
-       if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled &&
+       if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled &&
            udc->active_suspend)
                disable_irq_wake(udc->board.vbus_pin);
 
index c39d58860fa0414a2c862941dbc4382ddb2e1b0f..1a6f415c0d022f34d94e6a609658e47c5a31ed06 100644 (file)
@@ -2975,6 +2975,7 @@ static void fsg_unbind(struct usb_configuration *c, struct usb_function *f)
        fsg_common_put(common);
        usb_free_descriptors(fsg->function.descriptors);
        usb_free_descriptors(fsg->function.hs_descriptors);
+       usb_free_descriptors(fsg->function.ss_descriptors);
        kfree(fsg);
 }
 
index db9d1b4bfbdc4eda2e4243cc43e31c4ed498adf5..dbc7fe8ca9e7d692dc750d58e49e3bbcc13b6140 100644 (file)
 #include <linux/platform_data/tegra_usb.h>
 #include <linux/irq.h>
 #include <linux/usb/otg.h>
+#include <linux/gpio.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+
 #include <mach/usb_phy.h>
+#include <mach/iomap.h>
 
 #define TEGRA_USB_DMA_ALIGN 32
 
@@ -574,6 +579,35 @@ static const struct hc_driver tegra_ehci_hc_driver = {
        .port_handed_over       = ehci_port_handed_over,
 };
 
+static int setup_vbus_gpio(struct platform_device *pdev)
+{
+       int err = 0;
+       int gpio;
+
+       if (!pdev->dev.of_node)
+               return 0;
+
+       gpio = of_get_named_gpio(pdev->dev.of_node, "nvidia,vbus-gpio", 0);
+       if (!gpio_is_valid(gpio))
+               return 0;
+
+       err = gpio_request(gpio, "vbus_gpio");
+       if (err) {
+               dev_err(&pdev->dev, "can't request vbus gpio %d", gpio);
+               return err;
+       }
+       err = gpio_direction_output(gpio, 1);
+       if (err) {
+               dev_err(&pdev->dev, "can't enable vbus\n");
+               return err;
+       }
+       gpio_set_value(gpio, 1);
+
+       return err;
+}
+
+static u64 tegra_ehci_dma_mask = DMA_BIT_MASK(32);
+
 static int tegra_ehci_probe(struct platform_device *pdev)
 {
        struct resource *res;
@@ -590,6 +624,15 @@ static int tegra_ehci_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
+       /* Right now device-tree probed devices don't get dma_mask set.
+        * Since shared usb code relies on it, set it here for now.
+        * Once we have dma capability bindings this can go away.
+        */
+       if (!pdev->dev.dma_mask)
+               pdev->dev.dma_mask = &tegra_ehci_dma_mask;
+
+       setup_vbus_gpio(pdev);
+
        tegra = kzalloc(sizeof(struct tegra_ehci_hcd), GFP_KERNEL);
        if (!tegra)
                return -ENOMEM;
@@ -640,6 +683,28 @@ static int tegra_ehci_probe(struct platform_device *pdev)
                goto fail_io;
        }
 
+       /* This is pretty ugly and needs to be fixed when we do only
+        * device-tree probing. Old code relies on the platform_device
+        * numbering that we lack for device-tree-instantiated devices.
+        */
+       if (instance < 0) {
+               switch (res->start) {
+               case TEGRA_USB_BASE:
+                       instance = 0;
+                       break;
+               case TEGRA_USB2_BASE:
+                       instance = 1;
+                       break;
+               case TEGRA_USB3_BASE:
+                       instance = 2;
+                       break;
+               default:
+                       err = -ENODEV;
+                       dev_err(&pdev->dev, "unknown usb instance\n");
+                       goto fail_phy;
+               }
+       }
+
        tegra->phy = tegra_usb_phy_open(instance, hcd->regs, pdata->phy_config,
                                                TEGRA_USB_PHY_MODE_HOST);
        if (IS_ERR(tegra->phy)) {
@@ -773,6 +838,11 @@ static void tegra_ehci_hcd_shutdown(struct platform_device *pdev)
                hcd->driver->shutdown(hcd);
 }
 
+static struct of_device_id tegra_ehci_of_match[] __devinitdata = {
+       { .compatible = "nvidia,tegra20-ehci", },
+       { },
+};
+
 static struct platform_driver tegra_ehci_driver = {
        .probe          = tegra_ehci_probe,
        .remove         = tegra_ehci_remove,
@@ -783,5 +853,6 @@ static struct platform_driver tegra_ehci_driver = {
        .shutdown       = tegra_ehci_hcd_shutdown,
        .driver         = {
                .name   = "tegra-ehci",
+               .of_match_table = tegra_ehci_of_match,
        }
 };
index 95a9fec38e89b4e8a6daff8a3c0c75fd73315d4c..5df0b0e3392bed244a414bcc58f4da104822b49c 100644 (file)
@@ -223,7 +223,7 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int
        if (port < 0 || port >= 2)
                return;
 
-       if (pdata->vbus_pin[port] <= 0)
+       if (!gpio_is_valid(pdata->vbus_pin[port]))
                return;
 
        gpio_set_value(pdata->vbus_pin[port], !pdata->vbus_pin_inverted ^ enable);
@@ -234,7 +234,7 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port)
        if (port < 0 || port >= 2)
                return -EINVAL;
 
-       if (pdata->vbus_pin[port] <= 0)
+       if (!gpio_is_valid(pdata->vbus_pin[port]))
                return -EINVAL;
 
        return gpio_get_value(pdata->vbus_pin[port]) ^ !pdata->vbus_pin_inverted;
@@ -465,7 +465,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
 
        if (pdata) {
                for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
-                       if (pdata->vbus_pin[i] <= 0)
+                       if (!gpio_is_valid(pdata->vbus_pin[i]))
                                continue;
                        gpio_request(pdata->vbus_pin[i], "ohci_vbus");
                        ohci_at91_usb_set_power(pdata, i, 1);
@@ -474,7 +474,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
                for (i = 0; i < ARRAY_SIZE(pdata->overcurrent_pin); i++) {
                        int ret;
 
-                       if (pdata->overcurrent_pin[i] <= 0)
+                       if (!gpio_is_valid(pdata->overcurrent_pin[i]))
                                continue;
                        gpio_request(pdata->overcurrent_pin[i], "ohci_overcurrent");
 
@@ -499,14 +499,14 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
 
        if (pdata) {
                for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
-                       if (pdata->vbus_pin[i] <= 0)
+                       if (!gpio_is_valid(pdata->vbus_pin[i]))
                                continue;
                        ohci_at91_usb_set_power(pdata, i, 0);
                        gpio_free(pdata->vbus_pin[i]);
                }
 
                for (i = 0; i < ARRAY_SIZE(pdata->overcurrent_pin); i++) {
-                       if (pdata->overcurrent_pin[i] <= 0)
+                       if (!gpio_is_valid(pdata->overcurrent_pin[i]))
                                continue;
                        free_irq(gpio_to_irq(pdata->overcurrent_pin[i]), pdev);
                        gpio_free(pdata->overcurrent_pin[i]);
index 053f86d70009f4a5616c2b303c72c4988fd12d74..ad96a38967299f4895b74ae0fa7bb416384706f8 100644 (file)
@@ -349,7 +349,7 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod)
                if (mod->irq_attch)
                        intenb1 |= ATTCHE;
 
-               if (mod->irq_attch)
+               if (mod->irq_dtch)
                        intenb1 |= DTCHE;
 
                if (mod->irq_sign)
index bade761a1e52b783a63dfb462f8b11ef4c111999..7955de5899512ecff50c099ab084a35a36a10f07 100644 (file)
@@ -1267,6 +1267,7 @@ int usbhs_mod_host_probe(struct usbhs_priv *priv)
                dev_err(dev, "Failed to create hcd\n");
                return -ENOMEM;
        }
+       hcd->has_tt = 1; /* for low/full speed */
 
        pipe_info = kzalloc(sizeof(*pipe_info) * pipe_size, GFP_KERNEL);
        if (!pipe_info) {
index e3426602dc8274dc5536f26e80f74a481eeaacd3..29907482261fd8261f66fe3e582943c53d683994 100644 (file)
@@ -664,6 +664,9 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x02) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x03) },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x08) },
+       { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x01) },  /* E398 3G Modem */
+       { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x02) },  /* E398 3G PC UI Interface */
+       { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x03) },  /* E398 3G Application Interface */
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },
index 87445b2d72a7375f36290ab7c74a404e0dbeaa21..00562566ef5f2773b006c80a7981cb5da56c7867 100644 (file)
 
 #define DRV_NAME "AT91SAM9 Watchdog"
 
+#define wdt_read(field) \
+       __raw_readl(at91wdt_private.base + field)
+#define wdt_write(field, val) \
+       __raw_writel((val), at91wdt_private.base + field)
+
 /* AT91SAM9 watchdog runs a 12bit counter @ 256Hz,
  * use this to convert a watchdog
  * value from/to milliseconds.
@@ -63,6 +68,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
 static void at91_ping(unsigned long data);
 
 static struct {
+       void __iomem *base;
        unsigned long next_heartbeat;   /* the next_heartbeat for the timer */
        unsigned long open;
        char expect_close;
@@ -77,7 +83,7 @@ static struct {
  */
 static inline void at91_wdt_reset(void)
 {
-       at91_sys_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
+       wdt_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
 }
 
 /*
@@ -132,7 +138,7 @@ static int at91_wdt_settimeout(unsigned int timeout)
        unsigned int mr;
 
        /* Check if disabled */
-       mr = at91_sys_read(AT91_WDT_MR);
+       mr = wdt_read(AT91_WDT_MR);
        if (mr & AT91_WDT_WDDIS) {
                printk(KERN_ERR DRV_NAME": sorry, watchdog is disabled\n");
                return -EIO;
@@ -149,7 +155,7 @@ static int at91_wdt_settimeout(unsigned int timeout)
                | AT91_WDT_WDDBGHLT     /* disabled in debug mode */
                | AT91_WDT_WDD          /* restart at any time */
                | (timeout & AT91_WDT_WDV);  /* timer value */
-       at91_sys_write(AT91_WDT_MR, reg);
+       wdt_write(AT91_WDT_MR, reg);
 
        return 0;
 }
@@ -248,12 +254,22 @@ static struct miscdevice at91wdt_miscdev = {
 
 static int __init at91wdt_probe(struct platform_device *pdev)
 {
+       struct resource *r;
        int res;
 
        if (at91wdt_miscdev.parent)
                return -EBUSY;
        at91wdt_miscdev.parent = &pdev->dev;
 
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!r)
+               return -ENODEV;
+       at91wdt_private.base = ioremap(r->start, resource_size(r));
+       if (!at91wdt_private.base) {
+               dev_err(&pdev->dev, "failed to map registers, aborting.\n");
+               return -ENOMEM;
+       }
+
        /* Set watchdog */
        res = at91_wdt_settimeout(ms_to_ticks(WDT_HW_TIMEOUT * 1000));
        if (res)
index 757f9cab5c820f6de79ab8e4cb3c682901b3aedb..c6fbb2e6c41baa55d46cb054928097ec4e892eff 100644 (file)
 #ifndef AT91_WDT_H
 #define AT91_WDT_H
 
-#define AT91_WDT_CR            (AT91_WDT + 0x00)       /* Watchdog Control Register */
+#define AT91_WDT_CR            0x00                    /* Watchdog Control Register */
 #define                AT91_WDT_WDRSTT         (1    << 0)             /* Restart */
 #define                AT91_WDT_KEY            (0xa5 << 24)            /* KEY Password */
 
-#define AT91_WDT_MR            (AT91_WDT + 0x04)       /* Watchdog Mode Register */
+#define AT91_WDT_MR            0x04                    /* Watchdog Mode Register */
 #define                AT91_WDT_WDV            (0xfff << 0)            /* Counter Value */
 #define                AT91_WDT_WDFIEN         (1     << 12)           /* Fault Interrupt Enable */
 #define                AT91_WDT_WDRSTEN        (1     << 13)           /* Reset Processor */
@@ -30,7 +30,7 @@
 #define                AT91_WDT_WDDBGHLT       (1     << 28)           /* Debug Halt */
 #define                AT91_WDT_WDIDLEHLT      (1     << 29)           /* Idle Halt */
 
-#define AT91_WDT_SR            (AT91_WDT + 0x08)       /* Watchdog Status Register */
+#define AT91_WDT_SR            0x08                    /* Watchdog Status Register */
 #define                AT91_WDT_WDUNF          (1 << 0)                /* Watchdog Underflow */
 #define                AT91_WDT_WDERR          (1 << 1)                /* Watchdog Error */
 
index 379a02dc1217adf24450af7bae64279e78d85793..b3b426edb2fd7b341b8ab1940f891114e752615f 100644 (file)
@@ -80,7 +80,8 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
 {
        struct pstore_private *p = dentry->d_inode->i_private;
 
-       p->psi->erase(p->type, p->id, p->psi);
+       if (p->psi->erase)
+               p->psi->erase(p->type, p->id, p->psi);
 
        return simple_unlink(dir, dentry);
 }
index 57bbf9078ac8f327be28e88b38e10eeff1f9bfc0..9ec22d3b4293f3c2d2c994927fd7102e4a20baec 100644 (file)
@@ -122,7 +122,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,
                memcpy(dst, s1 + s1_start, l1_cpy);
                memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy);
 
-               ret = psinfo->write(PSTORE_TYPE_DMESG, &id, part,
+               ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part,
                                   hsize + l1_cpy + l2_cpy, psinfo);
                if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted())
                        pstore_new_entry = 1;
@@ -207,8 +207,7 @@ void pstore_get_records(int quiet)
                return;
 
        mutex_lock(&psi->read_mutex);
-       rc = psi->open(psi);
-       if (rc)
+       if (psi->open && psi->open(psi))
                goto out;
 
        while ((size = psi->read(&id, &type, &time, &buf, psi)) > 0) {
@@ -219,7 +218,8 @@ void pstore_get_records(int quiet)
                if (rc && (rc != -EEXIST || !quiet))
                        failed++;
        }
-       psi->close(psi);
+       if (psi->close)
+               psi->close(psi);
 out:
        mutex_unlock(&psi->read_mutex);
 
@@ -243,33 +243,5 @@ static void pstore_timefunc(unsigned long dummy)
        mod_timer(&pstore_timer, jiffies + PSTORE_INTERVAL);
 }
 
-/*
- * Call platform driver to write a record to the
- * persistent store.
- */
-int pstore_write(enum pstore_type_id type, char *buf, size_t size)
-{
-       u64             id;
-       int             ret;
-       unsigned long   flags;
-
-       if (!psinfo)
-               return -ENODEV;
-
-       if (size > psinfo->bufsize)
-               return -EFBIG;
-
-       spin_lock_irqsave(&psinfo->buf_lock, flags);
-       memcpy(psinfo->buf, buf, size);
-       ret = psinfo->write(type, &id, 0, size, psinfo);
-       if (ret == 0 && pstore_is_mounted())
-               pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id, psinfo->buf,
-                             size, CURRENT_TIME, psinfo);
-       spin_unlock_irqrestore(&psinfo->buf_lock, flags);
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(pstore_write);
-
 module_param(backend, charp, 0444);
 MODULE_PARM_DESC(backend, "Pstore backend to use");
index 912088773a69ef55b5313d7a6ccd5acebbc1de36..c2cf2eda062635f56c982547bd87c2796ad62a44 100644 (file)
@@ -327,7 +327,7 @@ static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
 #define ioremap_wc ioremap_nocache
 #endif
 
-static inline void iounmap(void *addr)
+static inline void iounmap(void __iomem *addr)
 {
 }
 #endif /* CONFIG_MMU */
index 351889d1de19282fdb10155d06d32301d148ba13..37d1fe28960a8ae7d82b2f804008b444c7fde556 100644 (file)
@@ -71,10 +71,14 @@ extern unsigned long memory_end;
 #define PAGE_OFFSET            (0)
 #endif
 
+#ifndef ARCH_PFN_OFFSET
+#define ARCH_PFN_OFFSET                (PAGE_OFFSET >> PAGE_SHIFT)
+#endif
+
 #ifndef __ASSEMBLY__
 
-#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
-#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
+#define __va(x) ((void *)((unsigned long) (x)))
+#define __pa(x) ((unsigned long) (x))
 
 #define virt_to_pfn(kaddr)     (__pa(kaddr) >> PAGE_SHIFT)
 #define pfn_to_virt(pfn)       __va((pfn) << PAGE_SHIFT)
@@ -86,7 +90,7 @@ extern unsigned long memory_end;
 #define page_to_phys(page)      ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
 #endif
 
-#define pfn_valid(pfn)         ((pfn) < max_mapnr)
+#define pfn_valid(pfn)         ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
 
 #define        virt_addr_valid(kaddr)  (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
                                ((void *)(kaddr) < (void *)memory_end))
index ac68c999b6c2165bbba9bea374505cbc60f5abf9..9788568f79782befb0be7cf29d148220f9c898c4 100644 (file)
@@ -289,9 +289,14 @@ strncpy_from_user(char *dst, const char __user *src, long count)
  * Return 0 on exception, a value greater than N if too long
  */
 #ifndef __strnlen_user
-#define __strnlen_user strnlen
+#define __strnlen_user(s, n) (strnlen((s), (n)) + 1)
 #endif
 
+/*
+ * Unlike strnlen, strnlen_user includes the nul terminator in
+ * its returned count. Callers should check for a returned value
+ * greater than N as an indication the string is too long.
+ */
 static inline long strnlen_user(const char __user *src, long n)
 {
        if (!access_ok(VERIFY_READ, src, 1))
index d12f077a6dafb7eb505eb5142c13327558001800..12e023c19ac18270adf34d0ddf9675af3e3cc609 100644 (file)
 #ifndef        __AMBA_PL330_H_
 #define        __AMBA_PL330_H_
 
+#include <linux/dmaengine.h>
 #include <asm/hardware/pl330.h>
 
-struct dma_pl330_peri {
-       /*
-        * Peri_Req i/f of the DMAC that is
-        * peripheral could be reached from.
-        */
-       u8 peri_id; /* specific dma id */
-       enum pl330_reqtype rqtype;
-};
-
 struct dma_pl330_platdata {
        /*
         * Number of valid peripherals connected to DMAC.
@@ -33,9 +25,12 @@ struct dma_pl330_platdata {
         */
        u8 nr_valid_peri;
        /* Array of valid peripherals */
-       struct dma_pl330_peri *peri;
+       u8 *peri_id;
+       /* Operational capabilities */
+       dma_cap_mask_t cap_mask;
        /* Bytes to allocate for MC buffer */
        unsigned mcbuf_sz;
 };
 
+extern bool pl330_filter(struct dma_chan *chan, void *param);
 #endif /* __AMBA_PL330_H_ */
index 18bea78fe47b3e5ce97f98bac45fd6e1e6acd785..8e2b7bac437869d8058427d513115e457a57752d 100644 (file)
@@ -33,6 +33,7 @@
 #define EM_H8_300      46      /* Renesas H8/300,300H,H8S */
 #define EM_MN10300     89      /* Panasonic/MEI MN10300, AM33 */
 #define EM_BLACKFIN     106     /* ADI Blackfin Processor */
+#define EM_TI_C6000    140     /* TI C6X DSPs */
 #define EM_FRV         0x5441  /* Fujitsu FR-V */
 #define EM_AVR32       0x18ad  /* Atmel AVR32 */
 
diff --git a/include/linux/gpio-pxa.h b/include/linux/gpio-pxa.h
new file mode 100644 (file)
index 0000000..05071ee
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef __GPIO_PXA_H
+#define __GPIO_PXA_H
+
+#define GPIO_bit(x)    (1 << ((x) & 0x1f))
+
+#define gpio_to_bank(gpio)     ((gpio) >> 5)
+
+/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
+ * Those cases currently cause holes in the GPIO number space, the
+ * actual number of the last GPIO is recorded by 'pxa_last_gpio'.
+ */
+extern int pxa_last_gpio;
+
+extern int pxa_irq_to_gpio(int irq);
+
+#endif /* __GPIO_PXA_H */
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h
new file mode 100644 (file)
index 0000000..b081c72
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2004-2006 Atmel Corporation
+ *
+ * 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 __MACB_PDATA_H__
+#define __MACB_PDATA_H__
+
+struct macb_platform_data {
+       u32             phy_mask;
+       int             phy_irq_pin;    /* PHY IRQ */
+       u8              is_rmii;        /* using RMII interface? */
+};
+
+#endif /* __MACB_PDATA_H__ */
index 2ca8cde5459d3445b2897c02d58ac2d12dba5bba..e1461e143be27f66522d33e4cebc020351404e4c 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef _LINUX_PSTORE_H
 #define _LINUX_PSTORE_H
 
+#include <linux/time.h>
+#include <linux/kmsg_dump.h>
+
 /* types */
 enum pstore_type_id {
        PSTORE_TYPE_DMESG       = 0,
@@ -41,7 +44,8 @@ struct pstore_info {
        ssize_t         (*read)(u64 *id, enum pstore_type_id *type,
                        struct timespec *time, char **buf,
                        struct pstore_info *psi);
-       int             (*write)(enum pstore_type_id type, u64 *id,
+       int             (*write)(enum pstore_type_id type,
+                       enum kmsg_dump_reason reason, u64 *id,
                        unsigned int part, size_t size, struct pstore_info *psi);
        int             (*erase)(enum pstore_type_id type, u64 id,
                        struct pstore_info *psi);
@@ -50,18 +54,12 @@ struct pstore_info {
 
 #ifdef CONFIG_PSTORE
 extern int pstore_register(struct pstore_info *);
-extern int pstore_write(enum pstore_type_id type, char *buf, size_t size);
 #else
 static inline int
 pstore_register(struct pstore_info *psi)
 {
        return -ENODEV;
 }
-static inline int
-pstore_write(enum pstore_type_id type, char *buf, size_t size)
-{
-       return -ENODEV;
-}
 #endif
 
 #endif /*_LINUX_PSTORE_H*/
index 4bde182fcf93f23bb8f1b8b68d2a087ba20ae2c3..dcdfc2bda922eb7012d59fe7eb330aabd1a5c24e 100644 (file)
@@ -131,6 +131,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count);
  */
 extern rwlock_t vmlist_lock;
 extern struct vm_struct *vmlist;
+extern __init void vm_area_add_early(struct vm_struct *vm);
 extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
 
 #ifdef CONFIG_SMP
index d0e0de7984ecb300b160bd6523e70a566d14636f..f22f3e16edf46d082b49849116001f65be8fde73 100644 (file)
@@ -10,7 +10,7 @@
 #define __SOUND_SAIF_H__
 
 struct mxs_saif_platform_data {
-       int (*init) (void);
-       int (*get_master_id) (unsigned int saif_id);
+       bool master_mode;       /* if true use master mode */
+       int master_id;          /* id of the master if in slave mode */
 };
 #endif
index 1d8b32f0713977ad2e3aeb6ba3d2554bb1389b53..f87577042a8665103339758d5a91addb6f92274a 100644 (file)
@@ -1117,6 +1117,32 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
 }
 EXPORT_SYMBOL(vm_map_ram);
 
+/**
+ * vm_area_add_early - add vmap area early during boot
+ * @vm: vm_struct to add
+ *
+ * This function is used to add fixed kernel vm area to vmlist before
+ * vmalloc_init() is called.  @vm->addr, @vm->size, and @vm->flags
+ * should contain proper values and the other fields should be zero.
+ *
+ * DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.
+ */
+void __init vm_area_add_early(struct vm_struct *vm)
+{
+       struct vm_struct *tmp, **p;
+
+       BUG_ON(vmap_initialized);
+       for (p = &vmlist; (tmp = *p) != NULL; p = &tmp->next) {
+               if (tmp->addr >= vm->addr) {
+                       BUG_ON(tmp->addr < vm->addr + vm->size);
+                       break;
+               } else
+                       BUG_ON(tmp->addr + tmp->size > vm->addr);
+       }
+       vm->next = *p;
+       *p = vm;
+}
+
 /**
  * vm_area_register_early - register vmap area early during boot
  * @vm: vm_struct to register
@@ -1139,8 +1165,7 @@ void __init vm_area_register_early(struct vm_struct *vm, size_t align)
 
        vm->addr = (void *)addr;
 
-       vm->next = vmlist;
-       vmlist = vm;
+       vm_area_add_early(vm);
 }
 
 void __init vmalloc_init(void)
index c7aafc7c5ed4854b2a46f6e37b5386ef937fee8e..5f09a578d49d00d86dc78d73af89588c85c79371 100644 (file)
@@ -245,9 +245,11 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
        if (tt_global_entry) {
                /* This node is probably going to update its tt table */
                tt_global_entry->orig_node->tt_poss_change = true;
-               /* The global entry has to be marked as PENDING and has to be
+               /* The global entry has to be marked as ROAMING and has to be
                 * kept for consistency purpose */
-               tt_global_entry->flags |= TT_CLIENT_PENDING;
+               tt_global_entry->flags |= TT_CLIENT_ROAM;
+               tt_global_entry->roam_at = jiffies;
+
                send_roam_adv(bat_priv, tt_global_entry->addr,
                              tt_global_entry->orig_node);
        }
@@ -694,6 +696,7 @@ void tt_global_del(struct bat_priv *bat_priv,
                   const char *message, bool roaming)
 {
        struct tt_global_entry *tt_global_entry = NULL;
+       struct tt_local_entry *tt_local_entry = NULL;
 
        tt_global_entry = tt_global_hash_find(bat_priv, addr);
        if (!tt_global_entry)
@@ -701,15 +704,29 @@ void tt_global_del(struct bat_priv *bat_priv,
 
        if (tt_global_entry->orig_node == orig_node) {
                if (roaming) {
-                       tt_global_entry->flags |= TT_CLIENT_ROAM;
-                       tt_global_entry->roam_at = jiffies;
-                       goto out;
+                       /* if we are deleting a global entry due to a roam
+                        * event, there are two possibilities:
+                        * 1) the client roamed from node A to node B => we mark
+                        *    it with TT_CLIENT_ROAM, we start a timer and we
+                        *    wait for node B to claim it. In case of timeout
+                        *    the entry is purged.
+                        * 2) the client roamed to us => we can directly delete
+                        *    the global entry, since it is useless now. */
+                       tt_local_entry = tt_local_hash_find(bat_priv,
+                                                       tt_global_entry->addr);
+                       if (!tt_local_entry) {
+                               tt_global_entry->flags |= TT_CLIENT_ROAM;
+                               tt_global_entry->roam_at = jiffies;
+                               goto out;
+                       }
                }
                _tt_global_del(bat_priv, tt_global_entry, message);
        }
 out:
        if (tt_global_entry)
                tt_global_entry_free_ref(tt_global_entry);
+       if (tt_local_entry)
+               tt_local_entry_free_ref(tt_local_entry);
 }
 
 void tt_global_del_orig(struct bat_priv *bat_priv,
index 91bcd3a961ec22c501451ef588fe86b171c55ae3..1eea8208b2cc760fc36bd56b8531ba81faccc481 100644 (file)
@@ -79,17 +79,12 @@ static struct bnep_session *__bnep_get_session(u8 *dst)
 
 static void __bnep_link_session(struct bnep_session *s)
 {
-       /* It's safe to call __module_get() here because sessions are added
-          by the socket layer which has to hold the reference to this module.
-        */
-       __module_get(THIS_MODULE);
        list_add(&s->list, &bnep_session_list);
 }
 
 static void __bnep_unlink_session(struct bnep_session *s)
 {
        list_del(&s->list);
-       module_put(THIS_MODULE);
 }
 
 static int bnep_send(struct bnep_session *s, void *data, size_t len)
@@ -530,6 +525,7 @@ static int bnep_session(void *arg)
 
        up_write(&bnep_session_sem);
        free_netdev(dev);
+       module_put_and_exit(0);
        return 0;
 }
 
@@ -616,9 +612,11 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
 
        __bnep_link_session(s);
 
+       __module_get(THIS_MODULE);
        s->task = kthread_run(bnep_session, s, "kbnepd %s", dev->name);
        if (IS_ERR(s->task)) {
                /* Session thread start failed, gotta cleanup. */
+               module_put(THIS_MODULE);
                unregister_netdev(dev);
                __bnep_unlink_session(s);
                err = PTR_ERR(s->task);
index 7d00ddf9e9dcb55ab74cf768db31a3e15af647ac..5a6e634f7fca53015c51c9d8fcdbad1dbd41b3a1 100644 (file)
@@ -67,14 +67,12 @@ static struct cmtp_session *__cmtp_get_session(bdaddr_t *bdaddr)
 
 static void __cmtp_link_session(struct cmtp_session *session)
 {
-       __module_get(THIS_MODULE);
        list_add(&session->list, &cmtp_session_list);
 }
 
 static void __cmtp_unlink_session(struct cmtp_session *session)
 {
        list_del(&session->list);
-       module_put(THIS_MODULE);
 }
 
 static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci)
@@ -327,6 +325,7 @@ static int cmtp_session(void *arg)
        up_write(&cmtp_session_sem);
 
        kfree(session);
+       module_put_and_exit(0);
        return 0;
 }
 
@@ -376,9 +375,11 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
 
        __cmtp_link_session(session);
 
+       __module_get(THIS_MODULE);
        session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d",
                                                                session->num);
        if (IS_ERR(session->task)) {
+               module_put(THIS_MODULE);
                err = PTR_ERR(session->task);
                goto unlink;
        }
index d7d96b6b1f0d63b338e5ed58fb125fbc6290aff5..643a41b76e2eadf1f8f783eba1881392b563beda 100644 (file)
@@ -545,7 +545,7 @@ static void hci_setup(struct hci_dev *hdev)
 {
        hci_setup_event_mask(hdev);
 
-       if (hdev->lmp_ver > 1)
+       if (hdev->hci_ver > 1)
                hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);
 
        if (hdev->features[6] & LMP_SIMPLE_PAIR) {
index 065effd8349a81689828927c84142a778aebb650..0b2e7329abdadaafd112e736bc6f19bdb21373f6 100644 (file)
@@ -285,6 +285,8 @@ static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
        if (register_netdevice(dev) < 0)
                goto failed_free;
 
+       strcpy(nt->parms.name, dev->name);
+
        dev_hold(dev);
        ipip_tunnel_link(ipn, nt);
        return nt;
@@ -759,7 +761,6 @@ static int ipip_tunnel_init(struct net_device *dev)
        struct ip_tunnel *tunnel = netdev_priv(dev);
 
        tunnel->dev = dev;
-       strcpy(tunnel->parms.name, dev->name);
 
        memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
        memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
@@ -825,6 +826,7 @@ static void ipip_destroy_tunnels(struct ipip_net *ipn, struct list_head *head)
 static int __net_init ipip_init_net(struct net *net)
 {
        struct ipip_net *ipn = net_generic(net, ipip_net_id);
+       struct ip_tunnel *t;
        int err;
 
        ipn->tunnels[0] = ipn->tunnels_wc;
@@ -848,6 +850,9 @@ static int __net_init ipip_init_net(struct net *net)
        if ((err = register_netdev(ipn->fb_tunnel_dev)))
                goto err_reg_dev;
 
+       t = netdev_priv(ipn->fb_tunnel_dev);
+
+       strcpy(t->parms.name, ipn->fb_tunnel_dev->name);
        return 0;
 
 err_reg_dev:
index cf88df82e2c21ca21da8184f0370096b094dffba..36806def8cfd5c1b185fc6ebfe06bf91fb6403c9 100644 (file)
@@ -1805,7 +1805,8 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
                return ERR_PTR(-EACCES);
 
        /* Add default multicast route */
-       addrconf_add_mroute(dev);
+       if (!(dev->flags & IFF_LOOPBACK))
+               addrconf_add_mroute(dev);
 
        /* Add link local route */
        addrconf_add_lroute(dev);
index a7a18602a046e1ffe5f0f00883844459802f4a25..96f3623618e31a648e765eb68fd506942420f55b 100644 (file)
@@ -263,6 +263,8 @@ static struct ip_tunnel *ipip6_tunnel_locate(struct net *net,
        if (register_netdevice(dev) < 0)
                goto failed_free;
 
+       strcpy(nt->parms.name, dev->name);
+
        dev_hold(dev);
 
        ipip6_tunnel_link(sitn, nt);
@@ -1144,7 +1146,6 @@ static int ipip6_tunnel_init(struct net_device *dev)
        struct ip_tunnel *tunnel = netdev_priv(dev);
 
        tunnel->dev = dev;
-       strcpy(tunnel->parms.name, dev->name);
 
        memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
        memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
@@ -1207,6 +1208,7 @@ static void __net_exit sit_destroy_tunnels(struct sit_net *sitn, struct list_hea
 static int __net_init sit_init_net(struct net *net)
 {
        struct sit_net *sitn = net_generic(net, sit_net_id);
+       struct ip_tunnel *t;
        int err;
 
        sitn->tunnels[0] = sitn->tunnels_wc;
@@ -1231,6 +1233,9 @@ static int __net_init sit_init_net(struct net *net)
        if ((err = register_netdev(sitn->fb_tunnel_dev)))
                goto err_reg_dev;
 
+       t = netdev_priv(sitn->fb_tunnel_dev);
+
+       strcpy(t->parms.name, sitn->fb_tunnel_dev->name);
        return 0;
 
 err_reg_dev:
index b064e4df12c6d03a0534f5a8b026b9785befc190..2e4b961648d4352f46594291065ec5ec7af1ab0c 100644 (file)
@@ -303,6 +303,38 @@ ieee80211_wake_queue_agg(struct ieee80211_local *local, int tid)
        __release(agg_queue);
 }
 
+/*
+ * splice packets from the STA's pending to the local pending,
+ * requires a call to ieee80211_agg_splice_finish later
+ */
+static void __acquires(agg_queue)
+ieee80211_agg_splice_packets(struct ieee80211_local *local,
+                            struct tid_ampdu_tx *tid_tx, u16 tid)
+{
+       int queue = ieee80211_ac_from_tid(tid);
+       unsigned long flags;
+
+       ieee80211_stop_queue_agg(local, tid);
+
+       if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates"
+                         " from the pending queue\n", tid))
+               return;
+
+       if (!skb_queue_empty(&tid_tx->pending)) {
+               spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
+               /* copy over remaining packets */
+               skb_queue_splice_tail_init(&tid_tx->pending,
+                                          &local->pending[queue]);
+               spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
+       }
+}
+
+static void __releases(agg_queue)
+ieee80211_agg_splice_finish(struct ieee80211_local *local, u16 tid)
+{
+       ieee80211_wake_queue_agg(local, tid);
+}
+
 void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
 {
        struct tid_ampdu_tx *tid_tx;
@@ -314,19 +346,17 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
        tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
 
        /*
-        * While we're asking the driver about the aggregation,
-        * stop the AC queue so that we don't have to worry
-        * about frames that came in while we were doing that,
-        * which would require us to put them to the AC pending
-        * afterwards which just makes the code more complex.
+        * Start queuing up packets for this aggregation session.
+        * We're going to release them once the driver is OK with
+        * that.
         */
-       ieee80211_stop_queue_agg(local, tid);
-
        clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state);
 
        /*
-        * make sure no packets are being processed to get
-        * valid starting sequence number
+        * Make sure no packets are being processed. This ensures that
+        * we have a valid starting sequence number and that in-flight
+        * packets have been flushed out and no packets for this TID
+        * will go into the driver during the ampdu_action call.
         */
        synchronize_net();
 
@@ -340,17 +370,15 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
                                        " tid %d\n", tid);
 #endif
                spin_lock_bh(&sta->lock);
+               ieee80211_agg_splice_packets(local, tid_tx, tid);
                ieee80211_assign_tid_tx(sta, tid, NULL);
+               ieee80211_agg_splice_finish(local, tid);
                spin_unlock_bh(&sta->lock);
 
-               ieee80211_wake_queue_agg(local, tid);
                kfree_rcu(tid_tx, rcu_head);
                return;
        }
 
-       /* we can take packets again now */
-       ieee80211_wake_queue_agg(local, tid);
-
        /* activate the timer for the recipient's addBA response */
        mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
 #ifdef CONFIG_MAC80211_HT_DEBUG
@@ -466,38 +494,6 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
 }
 EXPORT_SYMBOL(ieee80211_start_tx_ba_session);
 
-/*
- * splice packets from the STA's pending to the local pending,
- * requires a call to ieee80211_agg_splice_finish later
- */
-static void __acquires(agg_queue)
-ieee80211_agg_splice_packets(struct ieee80211_local *local,
-                            struct tid_ampdu_tx *tid_tx, u16 tid)
-{
-       int queue = ieee80211_ac_from_tid(tid);
-       unsigned long flags;
-
-       ieee80211_stop_queue_agg(local, tid);
-
-       if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates"
-                         " from the pending queue\n", tid))
-               return;
-
-       if (!skb_queue_empty(&tid_tx->pending)) {
-               spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
-               /* copy over remaining packets */
-               skb_queue_splice_tail_init(&tid_tx->pending,
-                                          &local->pending[queue]);
-               spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
-       }
-}
-
-static void __releases(agg_queue)
-ieee80211_agg_splice_finish(struct ieee80211_local *local, u16 tid)
-{
-       ieee80211_wake_queue_agg(local, tid);
-}
-
 static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
                                         struct sta_info *sta, u16 tid)
 {
index 3925c6578767ea61be8cc66933d38a6c500cd1d2..ea66034499ce6bf54c3be5f02ec66ff2140f69a8 100644 (file)
@@ -69,7 +69,7 @@ static int __nci_request(struct nci_dev *ndev,
        __u32 timeout)
 {
        int rc = 0;
-       unsigned long completion_rc;
+       long completion_rc;
 
        ndev->req_status = NCI_REQ_PEND;
 
index 7d98240def0b768d4f35e5f5cd33136794559b7f..84d11d7ed710b3da6b860739c6b3be070d1c308f 100644 (file)
@@ -2507,6 +2507,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
        SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
+       SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS 1101HA", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB),
index 76dc74d24fc2ff7b50b9665b7443c56372c70b7c..1ef697fe17317a6860bddf14982841440bdeb87c 100644 (file)
@@ -625,13 +625,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
        if (pdev->id >= ARRAY_SIZE(mxs_saif))
                return -EINVAL;
 
-       pdata = pdev->dev.platform_data;
-       if (pdata && pdata->init) {
-               ret = pdata->init();
-               if (ret)
-                       return ret;
-       }
-
        saif = kzalloc(sizeof(*saif), GFP_KERNEL);
        if (!saif)
                return -ENOMEM;
@@ -639,12 +632,17 @@ static int mxs_saif_probe(struct platform_device *pdev)
        mxs_saif[pdev->id] = saif;
        saif->id = pdev->id;
 
-       saif->master_id = saif->id;
-       if (pdata && pdata->get_master_id) {
-               saif->master_id = pdata->get_master_id(saif->id);
+       pdata = pdev->dev.platform_data;
+       if (pdata && !pdata->master_mode) {
+               saif->master_id = pdata->master_id;
                if (saif->master_id < 0 ||
-                       saif->master_id >= ARRAY_SIZE(mxs_saif))
+                       saif->master_id >= ARRAY_SIZE(mxs_saif) ||
+                       saif->master_id == saif->id) {
+                       dev_err(&pdev->dev, "get wrong master id\n");
                        return -EINVAL;
+               }
+       } else {
+               saif->master_id = saif->id;
        }
 
        saif->clk = clk_get(&pdev->dev, NULL);