aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-01-08 19:56:37 -0500
committerPaul Mundt <lethal@linux-sh.org>2012-01-08 19:56:37 -0500
commit04cf399640b7acfa9abe2eb7900cd934db8af697 (patch)
treef9a055f2f0170550f5f0b0507b06ffce8d98945d /arch
parent17f0056e6a2f3d1818801705f5e12b71217bf4ef (diff)
parenta0e86bd4252519321b0d102dc4ed90557aa7bee9 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into rmobile-latest
Conflicts: arch/arm/mach-shmobile/Makefile Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig4
-rw-r--r--arch/alpha/include/asm/ipcbuf.h29
-rw-r--r--arch/alpha/include/asm/socket.h3
-rw-r--r--arch/alpha/include/asm/thread_info.h2
-rw-r--r--arch/alpha/include/asm/types.h5
-rw-r--r--arch/arm/Kconfig88
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/boot/Makefile2
-rw-r--r--arch/arm/boot/compressed/Makefile3
-rw-r--r--arch/arm/boot/compressed/head.S1
-rw-r--r--arch/arm/boot/dts/testcases/tests-phandle.dtsi37
-rw-r--r--arch/arm/boot/dts/testcases/tests.dtsi1
-rw-r--r--arch/arm/boot/dts/versatile-pb.dts2
-rw-r--r--arch/arm/common/Kconfig6
-rw-r--r--arch/arm/common/gic.c179
-rw-r--r--arch/arm/common/pl330.c136
-rw-r--r--arch/arm/common/timer-sp.c7
-rw-r--r--arch/arm/common/vic.c148
-rw-r--r--arch/arm/configs/at91cap9_defconfig (renamed from arch/arm/configs/at91cap9adk_defconfig)7
-rw-r--r--arch/arm/configs/at91rm9200_defconfig47
-rw-r--r--arch/arm/configs/at91sam9260_defconfig (renamed from arch/arm/configs/at91sam9260ek_defconfig)16
-rw-r--r--arch/arm/configs/at91sam9g20_defconfig (renamed from arch/arm/configs/at91sam9g20ek_defconfig)23
-rw-r--r--arch/arm/configs/at91sam9g45_defconfig7
-rw-r--r--arch/arm/configs/at91sam9rl_defconfig (renamed from arch/arm/configs/at91sam9rlek_defconfig)5
-rw-r--r--arch/arm/configs/ezx_defconfig2
-rw-r--r--arch/arm/configs/imote2_defconfig2
-rw-r--r--arch/arm/configs/imx_v4_v5_defconfig12
-rw-r--r--arch/arm/configs/magician_defconfig2
-rw-r--r--arch/arm/configs/omap1_defconfig6
-rw-r--r--arch/arm/configs/u300_defconfig13
-rw-r--r--arch/arm/configs/u8500_defconfig14
-rw-r--r--arch/arm/configs/zeus_defconfig2
-rw-r--r--arch/arm/include/asm/assembler.h11
-rw-r--r--arch/arm/include/asm/bug.h1
-rw-r--r--arch/arm/include/asm/cti.h179
-rw-r--r--arch/arm/include/asm/edac.h48
-rw-r--r--arch/arm/include/asm/entry-macro-vic2.S57
-rw-r--r--arch/arm/include/asm/gpio.h4
-rw-r--r--arch/arm/include/asm/hardirq.h17
-rw-r--r--arch/arm/include/asm/hardware/cache-l2x0.h2
-rw-r--r--arch/arm/include/asm/hardware/entry-macro-gic.S60
-rw-r--r--arch/arm/include/asm/hardware/gic.h26
-rw-r--r--arch/arm/include/asm/hardware/iop3xx.h1
-rw-r--r--arch/arm/include/asm/hardware/vic.h10
-rw-r--r--arch/arm/include/asm/idmap.h14
-rw-r--r--arch/arm/include/asm/ipcbuf.h30
-rw-r--r--arch/arm/include/asm/mach/arch.h12
-rw-r--r--arch/arm/include/asm/mach/time.h2
-rw-r--r--arch/arm/include/asm/opcodes.h20
-rw-r--r--arch/arm/include/asm/page.h4
-rw-r--r--arch/arm/include/asm/perf_event.h3
-rw-r--r--arch/arm/include/asm/pgalloc.h26
-rw-r--r--arch/arm/include/asm/pgtable-2level.h41
-rw-r--r--arch/arm/include/asm/pgtable-3level-hwdef.h77
-rw-r--r--arch/arm/include/asm/pgtable-3level-types.h70
-rw-r--r--arch/arm/include/asm/pgtable-3level.h155
-rw-r--r--arch/arm/include/asm/pgtable-hwdef.h4
-rw-r--r--arch/arm/include/asm/pgtable.h55
-rw-r--r--arch/arm/include/asm/pmu.h25
-rw-r--r--arch/arm/include/asm/proc-fns.h21
-rw-r--r--arch/arm/include/asm/processor.h2
-rw-r--r--arch/arm/include/asm/prom.h1
-rw-r--r--arch/arm/include/asm/sched_clock.h108
-rw-r--r--arch/arm/include/asm/setup.h6
-rw-r--r--arch/arm/include/asm/socket.h3
-rw-r--r--arch/arm/include/asm/swab.h5
-rw-r--r--arch/arm/include/asm/system.h10
-rw-r--r--arch/arm/include/asm/thread_info.h2
-rw-r--r--arch/arm/include/asm/tlb.h12
-rw-r--r--arch/arm/include/asm/topology.h2
-rw-r--r--arch/arm/include/asm/types.h6
-rw-r--r--arch/arm/include/asm/unistd.h2
-rw-r--r--arch/arm/include/asm/unwind.h16
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/calls.S2
-rw-r--r--arch/arm/kernel/entry-armv.S9
-rw-r--r--arch/arm/kernel/head.S67
-rw-r--r--arch/arm/kernel/hw_breakpoint.c8
-rw-r--r--arch/arm/kernel/kprobes-arm.c4
-rw-r--r--arch/arm/kernel/kprobes-test-arm.c27
-rw-r--r--arch/arm/kernel/kprobes-test-thumb.c16
-rw-r--r--arch/arm/kernel/kprobes-test.c66
-rw-r--r--arch/arm/kernel/kprobes-test.h100
-rw-r--r--arch/arm/kernel/leds.c21
-rw-r--r--arch/arm/kernel/machine_kexec.c50
-rw-r--r--arch/arm/kernel/opcodes.c72
-rw-r--r--arch/arm/kernel/perf_event.c39
-rw-r--r--arch/arm/kernel/perf_event_v6.c32
-rw-r--r--arch/arm/kernel/perf_event_v7.c401
-rw-r--r--arch/arm/kernel/perf_event_xscale.c16
-rw-r--r--arch/arm/kernel/pmu.c1
-rw-r--r--arch/arm/kernel/process.c86
-rw-r--r--arch/arm/kernel/sched_clock.c118
-rw-r--r--arch/arm/kernel/setup.c36
-rw-r--r--arch/arm/kernel/sleep.S4
-rw-r--r--arch/arm/kernel/smp.c36
-rw-r--r--arch/arm/kernel/smp_twd.c95
-rw-r--r--arch/arm/kernel/suspend.c18
-rw-r--r--arch/arm/kernel/swp_emulate.c16
-rw-r--r--arch/arm/kernel/tcm.c22
-rw-r--r--arch/arm/kernel/topology.c2
-rw-r--r--arch/arm/kernel/unwind.c129
-rw-r--r--arch/arm/kernel/vmlinux.lds.S7
-rw-r--r--arch/arm/lib/Makefile3
-rw-r--r--arch/arm/lib/bitops.h26
-rw-r--r--arch/arm/lib/call_with_stack.S44
-rw-r--r--arch/arm/lib/changebit.S4
-rw-r--r--arch/arm/lib/clearbit.S4
-rw-r--r--arch/arm/lib/setbit.S4
-rw-r--r--arch/arm/lib/testchangebit.S4
-rw-r--r--arch/arm/lib/testclearbit.S4
-rw-r--r--arch/arm/lib/testsetbit.S4
-rw-r--r--arch/arm/mach-at91/at91cap9.c4
-rw-r--r--arch/arm/mach-at91/at91rm9200.c4
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c2
-rw-r--r--arch/arm/mach-at91/at91sam9260.c8
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c2
-rw-r--r--arch/arm/mach-at91/at91sam9261.c2
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c2
-rw-r--r--arch/arm/mach-at91/at91sam9263.c2
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c2
-rw-r--r--arch/arm/mach-at91/at91sam9_alt_reset.S9
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c4
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c2
-rw-r--r--arch/arm/mach-at91/generic.h3
-rw-r--r--arch/arm/mach-at91/include/mach/io.h8
-rw-r--r--arch/arm/mach-at91/include/mach/system.h9
-rw-r--r--arch/arm/mach-at91/include/mach/system_rev.h2
-rw-r--r--arch/arm/mach-at91/include/mach/vmalloc.h28
-rw-r--r--arch/arm/mach-at91/setup.c18
-rw-r--r--arch/arm/mach-bcmring/arch.c25
-rw-r--r--arch/arm/mach-bcmring/core.c3
-rw-r--r--arch/arm/mach-bcmring/dma.c3
-rw-r--r--arch/arm/mach-bcmring/include/mach/system.h26
-rw-r--r--arch/arm/mach-bcmring/include/mach/vmalloc.h25
-rw-r--r--arch/arm/mach-clps711x/Makefile2
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c1
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c1
-rw-r--r--arch/arm/mach-clps711x/ceiva.c1
-rw-r--r--arch/arm/mach-clps711x/clep7312.c1
-rw-r--r--arch/arm/mach-clps711x/common.c (renamed from arch/arm/mach-clps711x/irq.c)100
-rw-r--r--arch/arm/mach-clps711x/common.h1
-rw-r--r--arch/arm/mach-clps711x/edb7211-arch.c1
-rw-r--r--arch/arm/mach-clps711x/fortunet.c1
-rw-r--r--arch/arm/mach-clps711x/include/mach/system.h5
-rw-r--r--arch/arm/mach-clps711x/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-clps711x/mm.c48
-rw-r--r--arch/arm/mach-clps711x/p720t.c1
-rw-r--r--arch/arm/mach-clps711x/time.c84
-rw-r--r--arch/arm/mach-cns3xxx/cns3420vb.c3
-rw-r--r--arch/arm/mach-cns3xxx/core.h1
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/system.h3
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/vmalloc.h11
-rw-r--r--arch/arm/mach-cns3xxx/pm.c4
-rw-r--r--arch/arm/mach-davinci/Makefile2
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c3
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c1
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c3
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c8
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c1
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c1
-rw-r--r--arch/arm/mach-davinci/board-omapl138-hawk.c1
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c1
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c1
-rw-r--r--arch/arm/mach-davinci/common.c3
-rw-r--r--arch/arm/mach-davinci/da830.c1
-rw-r--r--arch/arm/mach-davinci/da850.c1
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c5
-rw-r--r--arch/arm/mach-davinci/devices.c5
-rw-r--r--arch/arm/mach-davinci/dm355.c1
-rw-r--r--arch/arm/mach-davinci/dm365.c1
-rw-r--r--arch/arm/mach-davinci/dm644x.c1
-rw-r--r--arch/arm/mach-davinci/dm646x.c2
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/io.h8
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h5
-rw-r--r--arch/arm/mach-davinci/include/mach/system.h6
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/vmalloc.h14
-rw-r--r--arch/arm/mach-davinci/io.c48
-rw-r--r--arch/arm/mach-davinci/psc.c18
-rw-r--r--arch/arm/mach-davinci/tnetv107x.c7
-rw-r--r--arch/arm/mach-dove/cm-a510.c1
-rw-r--r--arch/arm/mach-dove/common.c16
-rw-r--r--arch/arm/mach-dove/common.h1
-rw-r--r--arch/arm/mach-dove/dove-db-setup.c1
-rw-r--r--arch/arm/mach-dove/include/mach/dove.h2
-rw-r--r--arch/arm/mach-dove/include/mach/system.h19
-rw-r--r--arch/arm/mach-dove/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-ebsa110/core.c8
-rw-r--r--arch/arm/mach-ebsa110/include/mach/system.h2
-rw-r--r--arch/arm/mach-ebsa110/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-ep93xx/adssphere.c3
-rw-r--r--arch/arm/mach-ep93xx/core.c12
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c17
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c3
-rw-r--r--arch/arm/mach-ep93xx/include/mach/entry-macro.S42
-rw-r--r--arch/arm/mach-ep93xx/include/mach/platform.h2
-rw-r--r--arch/arm/mach-ep93xx/include/mach/system.h17
-rw-r--r--arch/arm/mach-ep93xx/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-ep93xx/micro9.c9
-rw-r--r--arch/arm/mach-ep93xx/simone.c3
-rw-r--r--arch/arm/mach-ep93xx/snappercl15.c3
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c3
-rw-r--r--arch/arm/mach-ep93xx/vision_ep9307.c1
-rw-r--r--arch/arm/mach-exynos/Kconfig2
-rw-r--r--arch/arm/mach-exynos/Makefile9
-rw-r--r--arch/arm/mach-exynos/clock-exynos4210.c3
-rw-r--r--arch/arm/mach-exynos/clock-exynos4212.c3
-rw-r--r--arch/arm/mach-exynos/clock.c3
-rw-r--r--arch/arm/mach-exynos/common.c714
-rw-r--r--arch/arm/mach-exynos/common.h41
-rw-r--r--arch/arm/mach-exynos/cpu.c298
-rw-r--r--arch/arm/mach-exynos/cpuidle.c2
-rw-r--r--arch/arm/mach-exynos/include/mach/entry-macro.S75
-rw-r--r--arch/arm/mach-exynos/include/mach/map.h12
-rw-r--r--arch/arm/mach-exynos/include/mach/system.h2
-rw-r--r--arch/arm/mach-exynos/include/mach/vmalloc.h22
-rw-r--r--arch/arm/mach-exynos/init.c42
-rw-r--r--arch/arm/mach-exynos/irq-combiner.c124
-rw-r--r--arch/arm/mach-exynos/irq-eint.c237
-rw-r--r--arch/arm/mach-exynos/mach-armlex4210.c8
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c8
-rw-r--r--arch/arm/mach-exynos/mach-origen.c8
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c10
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c10
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c8
-rw-r--r--arch/arm/mach-exynos/mct.c13
-rw-r--r--arch/arm/mach-exynos/platsmp.c28
-rw-r--r--arch/arm/mach-exynos/pm.c10
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c3
-rw-r--r--arch/arm/mach-footbridge/common.c27
-rw-r--r--arch/arm/mach-footbridge/common.h1
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c1
-rw-r--r--arch/arm/mach-footbridge/include/mach/system.h56
-rw-r--r--arch/arm/mach-footbridge/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c27
-rw-r--r--arch/arm/mach-footbridge/personal.c1
-rw-r--r--arch/arm/mach-gemini/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-h720x/common.c5
-rw-r--r--arch/arm/mach-h720x/common.h1
-rw-r--r--arch/arm/mach-h720x/h7201-eval.c1
-rw-r--r--arch/arm/mach-h720x/h7202-eval.c1
-rw-r--r--arch/arm/mach-h720x/include/mach/system.h6
-rw-r--r--arch/arm/mach-h720x/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-highbank/core.h1
-rw-r--r--arch/arm/mach-highbank/highbank.c6
-rw-r--r--arch/arm/mach-highbank/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-highbank/include/mach/system.h2
-rw-r--r--arch/arm/mach-highbank/include/mach/vmalloc.h1
-rw-r--r--arch/arm/mach-highbank/system.c2
-rw-r--r--arch/arm/mach-imx/Kconfig23
-rw-r--r--arch/arm/mach-imx/Makefile4
-rw-r--r--arch/arm/mach-imx/clock-imx35.c20
-rw-r--r--arch/arm/mach-imx/clock-imx6q.c9
-rw-r--r--arch/arm/mach-imx/mach-apf9328.c1
-rw-r--r--arch/arm/mach-imx/mach-armadillo5x0.c1
-rw-r--r--arch/arm/mach-imx/mach-bug.c1
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c1
-rw-r--r--arch/arm/mach-imx/mach-cpuimx35.c9
-rw-r--r--arch/arm/mach-imx/mach-eukrea_cpuimx25.c1
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c1
-rw-r--r--arch/arm/mach-imx/mach-imx27ipcam.c1
-rw-r--r--arch/arm/mach-imx/mach-imx27lite.c1
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c44
-rw-r--r--arch/arm/mach-imx/mach-kzm_arm11_01.c1
-rw-r--r--arch/arm/mach-imx/mach-mx1ads.c2
-rw-r--r--arch/arm/mach-imx/mach-mx21ads.c1
-rw-r--r--arch/arm/mach-imx/mach-mx25_3ds.c1
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c1
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c1
-rw-r--r--arch/arm/mach-imx/mach-mx31_3ds.c1
-rw-r--r--arch/arm/mach-imx/mach-mx31ads.c1
-rw-r--r--arch/arm/mach-imx/mach-mx31lilly.c1
-rw-r--r--arch/arm/mach-imx/mach-mx31lite.c1
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c1
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c1
-rw-r--r--arch/arm/mach-imx/mach-mxt_td60.c1
-rw-r--r--arch/arm/mach-imx/mach-pca100.c1
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c1
-rw-r--r--arch/arm/mach-imx/mach-pcm038.c1
-rw-r--r--arch/arm/mach-imx/mach-pcm043.c1
-rw-r--r--arch/arm/mach-imx/mach-qong.c1
-rw-r--r--arch/arm/mach-imx/mach-scb9328.c1
-rw-r--r--arch/arm/mach-imx/mach-vpr200.c1
-rw-r--r--arch/arm/mach-imx/mm-imx3.c109
-rw-r--r--arch/arm/mach-imx/src.c30
-rw-r--r--arch/arm/mach-integrator/Kconfig4
-rw-r--r--arch/arm/mach-integrator/common.h1
-rw-r--r--arch/arm/mach-integrator/core.c27
-rw-r--r--arch/arm/mach-integrator/include/mach/system.h11
-rw-r--r--arch/arm/mach-integrator/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c1
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c3
-rw-r--r--arch/arm/mach-iop13xx/include/mach/iop13xx.h1
-rw-r--r--arch/arm/mach-iop13xx/include/mach/system.h14
-rw-r--r--arch/arm/mach-iop13xx/include/mach/vmalloc.h4
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c1
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c1
-rw-r--r--arch/arm/mach-iop13xx/setup.c11
-rw-r--r--arch/arm/mach-iop32x/em7210.c1
-rw-r--r--arch/arm/mach-iop32x/glantank.c1
-rw-r--r--arch/arm/mach-iop32x/include/mach/io.h7
-rw-r--r--arch/arm/mach-iop32x/include/mach/system.h21
-rw-r--r--arch/arm/mach-iop32x/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-iop32x/iq31244.c2
-rw-r--r--arch/arm/mach-iop32x/iq80321.c1
-rw-r--r--arch/arm/mach-iop32x/n2100.c9
-rw-r--r--arch/arm/mach-iop33x/include/mach/io.h7
-rw-r--r--arch/arm/mach-iop33x/include/mach/system.h10
-rw-r--r--arch/arm/mach-iop33x/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-iop33x/iq80331.c1
-rw-r--r--arch/arm/mach-iop33x/iq80332.c1
-rw-r--r--arch/arm/mach-ixp2000/core.c4
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c1
-rw-r--r--arch/arm/mach-ixp2000/include/mach/platform.h1
-rw-r--r--arch/arm/mach-ixp2000/include/mach/system.h35
-rw-r--r--arch/arm/mach-ixp2000/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c32
-rw-r--r--arch/arm/mach-ixp23xx/core.c6
-rw-r--r--arch/arm/mach-ixp23xx/espresso.c1
-rw-r--r--arch/arm/mach-ixp23xx/include/mach/io.h29
-rw-r--r--arch/arm/mach-ixp23xx/include/mach/platform.h1
-rw-r--r--arch/arm/mach-ixp23xx/include/mach/system.h17
-rw-r--r--arch/arm/mach-ixp23xx/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-ixp23xx/ixdp2351.c12
-rw-r--r--arch/arm/mach-ixp23xx/roadrunner.c1
-rw-r--r--arch/arm/mach-ixp4xx/avila-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/common.c36
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/fsg-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/gateway7001-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/goramo_mlr.c1
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/platform.h1
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/system.h25
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/omixp-setup.c3
-rw-r--r--arch/arm/mach-ixp4xx/vulcan-setup.c1
-rw-r--r--arch/arm/mach-ixp4xx/wg302v2-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/common.c16
-rw-r--r--arch/arm/mach-kirkwood/common.h1
-rw-r--r--arch/arm/mach-kirkwood/d2net_v2-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/dockstar-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/guruplug-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/include/mach/io.h25
-rw-r--r--arch/arm/mach-kirkwood/include/mach/system.h19
-rw-r--r--arch/arm/mach-kirkwood/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c3
-rw-r--r--arch/arm/mach-kirkwood/netxbig_v2-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/openrd-setup.c3
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c8
-rw-r--r--arch/arm/mach-kirkwood/t5325-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/ts219-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/ts41x-setup.c1
-rw-r--r--arch/arm/mach-ks8695/board-acs5k.c1
-rw-r--r--arch/arm/mach-ks8695/board-dsm320.c1
-rw-r--r--arch/arm/mach-ks8695/board-micrel.c1
-rw-r--r--arch/arm/mach-ks8695/generic.h1
-rw-r--r--arch/arm/mach-ks8695/include/mach/system.h21
-rw-r--r--arch/arm/mach-ks8695/include/mach/vmalloc.h19
-rw-r--r--arch/arm/mach-ks8695/irq.c2
-rw-r--r--arch/arm/mach-ks8695/time.c18
-rw-r--r--arch/arm/mach-lpc32xx/common.c20
-rw-r--r--arch/arm/mach-lpc32xx/common.h2
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/system.h25
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/vmalloc.h24
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c3
-rw-r--r--arch/arm/mach-mmp/aspenite.c2
-rw-r--r--arch/arm/mach-mmp/avengers_lite.c1
-rw-r--r--arch/arm/mach-mmp/brownstone.c1
-rw-r--r--arch/arm/mach-mmp/common.c5
-rw-r--r--arch/arm/mach-mmp/common.h1
-rw-r--r--arch/arm/mach-mmp/flint.c1
-rw-r--r--arch/arm/mach-mmp/gplugd.c3
-rw-r--r--arch/arm/mach-mmp/include/mach/gpio-pxa.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h1
-rw-r--r--arch/arm/mach-mmp/include/mach/system.h10
-rw-r--r--arch/arm/mach-mmp/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-mmp/jasper.c1
-rw-r--r--arch/arm/mach-mmp/pxa168.c5
-rw-r--r--arch/arm/mach-mmp/tavorevb.c1
-rw-r--r--arch/arm/mach-mmp/teton_bga.c1
-rw-r--r--arch/arm/mach-mmp/time.c16
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c1
-rw-r--r--arch/arm/mach-msm/Kconfig1
-rw-r--r--arch/arm/mach-msm/board-msm8960.c2
-rw-r--r--arch/arm/mach-msm/board-msm8x60.c4
-rw-r--r--arch/arm/mach-msm/board-sapphire.c2
-rw-r--r--arch/arm/mach-msm/devices-iommu.c1
-rw-r--r--arch/arm/mach-msm/include/mach/entry-macro-qgic.S17
-rw-r--r--arch/arm/mach-msm/include/mach/entry-macro-vic.S37
-rw-r--r--arch/arm/mach-msm/include/mach/entry-macro.S27
-rw-r--r--arch/arm/mach-msm/include/mach/system.h8
-rw-r--r--arch/arm/mach-msm/include/mach/vmalloc.h22
-rw-r--r--arch/arm/mach-msm/smd_debug.c2
-rw-r--r--arch/arm/mach-mv78xx0/buffalo-wxl-setup.c1
-rw-r--r--arch/arm/mach-mv78xx0/common.c16
-rw-r--r--arch/arm/mach-mv78xx0/common.h1
-rw-r--r--arch/arm/mach-mv78xx0/db78x00-bp-setup.c1
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/system.h19
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-mv78xx0/rd78x00-masa-setup.c1
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51.c1
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51sd.c1
-rw-r--r--arch/arm/mach-mx5/board-mx50_rdp.c1
-rw-r--r--arch/arm/mach-mx5/board-mx51_3ds.c1
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c3
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikamx.c3
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikasb.c1
-rw-r--r--arch/arm/mach-mx5/board-mx53_ard.c1
-rw-r--r--arch/arm/mach-mx5/board-mx53_evk.c3
-rw-r--r--arch/arm/mach-mx5/board-mx53_loco.c3
-rw-r--r--arch/arm/mach-mx5/board-mx53_smd.c3
-rw-r--r--arch/arm/mach-mx5/cpu.c5
-rw-r--r--arch/arm/mach-mx5/imx51-dt.c13
-rw-r--r--arch/arm/mach-mx5/imx53-dt.c13
-rw-r--r--arch/arm/mach-mx5/mm.c6
-rw-r--r--arch/arm/mach-mxs/clock-mx28.c2
-rw-r--r--arch/arm/mach-mxs/include/mach/common.h1
-rw-r--r--arch/arm/mach-mxs/include/mach/mx28.h4
-rw-r--r--arch/arm/mach-mxs/include/mach/mxs.h1
-rw-r--r--arch/arm/mach-mxs/include/mach/system.h2
-rw-r--r--arch/arm/mach-mxs/include/mach/vmalloc.h22
-rw-r--r--arch/arm/mach-mxs/mach-m28evk.c3
-rw-r--r--arch/arm/mach-mxs/mach-mx23evk.c1
-rw-r--r--arch/arm/mach-mxs/mach-mx28evk.c1
-rw-r--r--arch/arm/mach-mxs/mach-stmp378x_devb.c3
-rw-r--r--arch/arm/mach-mxs/mach-tx28.c1
-rw-r--r--arch/arm/mach-mxs/module-tx28.c4
-rw-r--r--arch/arm/mach-mxs/system.c4
-rw-r--r--arch/arm/mach-netx/generic.c5
-rw-r--r--arch/arm/mach-netx/generic.h1
-rw-r--r--arch/arm/mach-netx/include/mach/entry-macro.S13
-rw-r--r--arch/arm/mach-netx/include/mach/system.h10
-rw-r--r--arch/arm/mach-netx/include/mach/vmalloc.h19
-rw-r--r--arch/arm/mach-netx/nxdb500.c3
-rw-r--r--arch/arm/mach-netx/nxdkn.c3
-rw-r--r--arch/arm/mach-netx/nxeb500hmi.c3
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c5
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c12
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.h4
-rw-r--r--arch/arm/mach-nomadik/include/mach/entry-macro.S30
-rw-r--r--arch/arm/mach-nomadik/include/mach/setup.h3
-rw-r--r--arch/arm/mach-nomadik/include/mach/system.h13
-rw-r--r--arch/arm/mach-nomadik/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-omap1/Kconfig8
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c13
-rw-r--r--arch/arm/mach-omap1/board-fsample.c3
-rw-r--r--arch/arm/mach-omap1/board-generic.c3
-rw-r--r--arch/arm/mach-omap1/board-h2.c3
-rw-r--r--arch/arm/mach-omap1/board-h3.c3
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c3
-rw-r--r--arch/arm/mach-omap1/board-innovator.c3
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c3
-rw-r--r--arch/arm/mach-omap1/board-osk.c3
-rw-r--r--arch/arm/mach-omap1/board-palmte.c3
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c3
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c3
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c3
-rw-r--r--arch/arm/mach-omap1/board-sx1.c3
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c8
-rw-r--r--arch/arm/mach-omap1/clock.h3
-rw-r--r--arch/arm/mach-omap1/clock_data.c61
-rw-r--r--arch/arm/mach-omap1/common.h62
-rw-r--r--arch/arm/mach-omap1/devices.c5
-rw-r--r--arch/arm/mach-omap1/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-omap1/io.c1
-rw-r--r--arch/arm/mach-omap1/reset.c5
-rw-r--r--arch/arm/mach-omap1/time.c60
-rw-r--r--arch/arm/mach-omap1/timer32k.c2
-rw-r--r--arch/arm/mach-omap2/Kconfig5
-rw-r--r--arch/arm/mach-omap2/Makefile5
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c4
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c4
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c4
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c6
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c4
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c4
-rw-r--r--arch/arm/mach-omap2/board-apollon.c4
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c6
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c4
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c4
-rw-r--r--arch/arm/mach-omap2/board-generic.c8
-rw-r--r--arch/arm/mach-omap2/board-h4.c4
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c6
-rw-r--r--arch/arm/mach-omap2/board-ldp.c4
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c8
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c4
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c6
-rw-r--r--arch/arm/mach-omap2/board-overo.c4
-rw-r--r--arch/arm/mach-omap2/board-rm680.c4
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c4
-rw-r--r--arch/arm/mach-omap2/board-rx51.c4
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c3
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c2
-rw-r--r--arch/arm/mach-omap2/board-zoom.c6
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c2
-rw-r--r--arch/arm/mach-omap2/cm44xx.c2
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c2
-rw-r--r--arch/arm/mach-omap2/common.c2
-rw-r--r--arch/arm/mach-omap2/common.h186
-rw-r--r--arch/arm/mach-omap2/control.c2
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c2
-rw-r--r--arch/arm/mach-omap2/display.c160
-rw-r--r--arch/arm/mach-omap2/display.h29
-rw-r--r--arch/arm/mach-omap2/i2c.c2
-rw-r--r--arch/arm/mach-omap2/id.c2
-rw-r--r--arch/arm/mach-omap2/include/mach/entry-macro.S137
-rw-r--r--arch/arm/mach-omap2/include/mach/omap4-common.h43
-rw-r--r--arch/arm/mach-omap2/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-omap2/io.c8
-rw-r--r--arch/arm/mach-omap2/io.h0
-rw-r--r--arch/arm/mach-omap2/irq.c51
-rw-r--r--arch/arm/mach-omap2/mcbsp.c6
-rw-r--r--arch/arm/mach-omap2/omap-hotplug.c3
-rw-r--r--arch/arm/mach-omap2/omap-smp.c3
-rw-r--r--arch/arm/mach-omap2/omap4-common.c9
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c8
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c17
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c17
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c5
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c41
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c24
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.h4
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.c2
-rw-r--r--arch/arm/mach-omap2/pm.c8
-rw-r--r--arch/arm/mach-omap2/pm24xx.c1
-rw-r--r--arch/arm/mach-omap2/pm34xx.c1
-rw-r--r--arch/arm/mach-omap2/pm44xx.c2
-rw-r--r--arch/arm/mach-omap2/prcm.c7
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.c2
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c2
-rw-r--r--arch/arm/mach-omap2/prm44xx.c2
-rw-r--r--arch/arm/mach-omap2/prminst44xx.c2
-rw-r--r--arch/arm/mach-omap2/sdram-nokia.c2
-rw-r--r--arch/arm/mach-omap2/sdrc.c2
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c2
-rw-r--r--arch/arm/mach-omap2/serial.c2
-rw-r--r--arch/arm/mach-omap2/smartreflex.c4
-rw-r--r--arch/arm/mach-omap2/timer.c22
-rw-r--r--arch/arm/mach-omap2/twl-common.c11
-rw-r--r--arch/arm/mach-omap2/twl-common.h3
-rw-r--r--arch/arm/mach-omap2/vc3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/vc44xx_data.c2
-rw-r--r--arch/arm/mach-omap2/voltage.c2
-rw-r--r--arch/arm/mach-omap2/voltagedomains3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/voltagedomains44xx_data.c2
-rw-r--r--arch/arm/mach-omap2/vp.c2
-rw-r--r--arch/arm/mach-omap2/vp3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/vp44xx_data.c2
-rw-r--r--arch/arm/mach-orion5x/common.c12
-rw-r--r--arch/arm/mach-orion5x/common.h1
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c2
-rw-r--r--arch/arm/mach-orion5x/db88f5281-setup.c1
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c1
-rw-r--r--arch/arm/mach-orion5x/edmini_v2-setup.c1
-rw-r--r--arch/arm/mach-orion5x/include/mach/io.h25
-rw-r--r--arch/arm/mach-orion5x/include/mach/system.h14
-rw-r--r--arch/arm/mach-orion5x/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c2
-rw-r--r--arch/arm/mach-orion5x/ls-chl-setup.c3
-rw-r--r--arch/arm/mach-orion5x/ls_hgl-setup.c3
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c3
-rw-r--r--arch/arm/mach-orion5x/mss2-setup.c3
-rw-r--r--arch/arm/mach-orion5x/mv2120-setup.c3
-rw-r--r--arch/arm/mach-orion5x/net2big-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5182-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c1
-rw-r--r--arch/arm/mach-orion5x/terastation_pro2-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c3
-rw-r--r--arch/arm/mach-orion5x/ts409-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c1
-rw-r--r--arch/arm/mach-orion5x/wnr854t-setup.c1
-rw-r--r--arch/arm/mach-orion5x/wrt350n-v2-setup.c1
-rw-r--r--arch/arm/mach-picoxcell/common.c9
-rw-r--r--arch/arm/mach-picoxcell/include/mach/entry-macro.S11
-rw-r--r--arch/arm/mach-picoxcell/include/mach/system.h5
-rw-r--r--arch/arm/mach-picoxcell/include/mach/vmalloc.h14
-rw-r--r--arch/arm/mach-picoxcell/time.c17
-rw-r--r--arch/arm/mach-pnx4008/core.c6
-rw-r--r--arch/arm/mach-pnx4008/include/mach/system.h9
-rw-r--r--arch/arm/mach-pnx4008/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-prima2/common.h1
-rw-r--r--arch/arm/mach-prima2/include/mach/map.h6
-rw-r--r--arch/arm/mach-prima2/include/mach/system.h12
-rw-r--r--arch/arm/mach-prima2/include/mach/vmalloc.h16
-rw-r--r--arch/arm/mach-prima2/pm.c1
-rw-r--r--arch/arm/mach-prima2/prima2.c2
-rw-r--r--arch/arm/mach-prima2/rstc.c7
-rw-r--r--arch/arm/mach-pxa/balloon3.c3
-rw-r--r--arch/arm/mach-pxa/capc7117.c3
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c1
-rw-r--r--arch/arm/mach-pxa/cm-x300.c1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c2
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c2
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c3
-rw-r--r--arch/arm/mach-pxa/corgi.c8
-rw-r--r--arch/arm/mach-pxa/csb726.c1
-rw-r--r--arch/arm/mach-pxa/em-x270.c2
-rw-r--r--arch/arm/mach-pxa/eseries.c6
-rw-r--r--arch/arm/mach-pxa/ezx.c6
-rw-r--r--arch/arm/mach-pxa/generic.h2
-rw-r--r--arch/arm/mach-pxa/gumstix.c3
-rw-r--r--arch/arm/mach-pxa/h5000.c1
-rw-r--r--arch/arm/mach-pxa/himalaya.c1
-rw-r--r--arch/arm/mach-pxa/hx4700.c1
-rw-r--r--arch/arm/mach-pxa/icontrol.c3
-rw-r--r--arch/arm/mach-pxa/idp.c1
-rw-r--r--arch/arm/mach-pxa/include/mach/entry-macro.S36
-rw-r--r--arch/arm/mach-pxa/include/mach/palm27x.h4
-rw-r--r--arch/arm/mach-pxa/include/mach/system.h8
-rw-r--r--arch/arm/mach-pxa/include/mach/vmalloc.h11
-rw-r--r--arch/arm/mach-pxa/littleton.c1
-rw-r--r--arch/arm/mach-pxa/lpd270.c1
-rw-r--r--arch/arm/mach-pxa/lubbock.c1
-rw-r--r--arch/arm/mach-pxa/magician.c1
-rw-r--r--arch/arm/mach-pxa/mainstone.c1
-rw-r--r--arch/arm/mach-pxa/mioa701.c7
-rw-r--r--arch/arm/mach-pxa/mp900.c1
-rw-r--r--arch/arm/mach-pxa/palm27x.c4
-rw-r--r--arch/arm/mach-pxa/palmld.c3
-rw-r--r--arch/arm/mach-pxa/palmt5.c3
-rw-r--r--arch/arm/mach-pxa/palmtc.c5
-rw-r--r--arch/arm/mach-pxa/palmte2.c3
-rw-r--r--arch/arm/mach-pxa/palmtreo.c2
-rw-r--r--arch/arm/mach-pxa/palmtx.c3
-rw-r--r--arch/arm/mach-pxa/palmz72.c3
-rw-r--r--arch/arm/mach-pxa/pcm027.c1
-rw-r--r--arch/arm/mach-pxa/poodle.c9
-rw-r--r--arch/arm/mach-pxa/raumfeld.c3
-rw-r--r--arch/arm/mach-pxa/reset.c7
-rw-r--r--arch/arm/mach-pxa/saar.c1
-rw-r--r--arch/arm/mach-pxa/saarb.c1
-rw-r--r--arch/arm/mach-pxa/spitz.c9
-rw-r--r--arch/arm/mach-pxa/stargate2.c2
-rw-r--r--arch/arm/mach-pxa/tavorevb.c1
-rw-r--r--arch/arm/mach-pxa/tavorevb3.c1
-rw-r--r--arch/arm/mach-pxa/time.c15
-rw-r--r--arch/arm/mach-pxa/tosa.c5
-rw-r--r--arch/arm/mach-pxa/trizeps4.c2
-rw-r--r--arch/arm/mach-pxa/viper.c1
-rw-r--r--arch/arm/mach-pxa/vpac270.c5
-rw-r--r--arch/arm/mach-pxa/xcep.c1
-rw-r--r--arch/arm/mach-pxa/z2.c1
-rw-r--r--arch/arm/mach-pxa/zeus.c1
-rw-r--r--arch/arm/mach-pxa/zylonite.c1
-rw-r--r--arch/arm/mach-realview/Kconfig9
-rw-r--r--arch/arm/mach-realview/core.c2
-rw-r--r--arch/arm/mach-realview/core.h1
-rw-r--r--arch/arm/mach-realview/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-realview/include/mach/system.h17
-rw-r--r--arch/arm/mach-realview/include/mach/vmalloc.h21
-rw-r--r--arch/arm/mach-realview/realview_eb.c12
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c8
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c8
-rw-r--r--arch/arm/mach-realview/realview_pba8.c8
-rw-r--r--arch/arm/mach-realview/realview_pbx.c12
-rw-r--r--arch/arm/mach-rpc/include/mach/system.h14
-rw-r--r--arch/arm/mach-rpc/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-rpc/riscpc.c12
-rw-r--r--arch/arm/mach-s3c2410/bast-irq.c2
-rw-r--r--arch/arm/mach-s3c2410/common.h17
-rw-r--r--arch/arm/mach-s3c2410/cpu-freq.c26
-rw-r--r--arch/arm/mach-s3c2410/dma.c28
-rw-r--r--arch/arm/mach-s3c2410/include/mach/dma.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/reset.h22
-rw-r--r--arch/arm/mach-s3c2410/include/mach/system-reset.h32
-rw-r--r--arch/arm/mach-s3c2410/include/mach/system.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c7
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c5
-rw-r--r--arch/arm/mach-s3c2410/mach-tct_hammer.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c2
-rw-r--r--arch/arm/mach-s3c2410/pll.c20
-rw-r--r--arch/arm/mach-s3c2410/pm.c36
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c37
-rw-r--r--arch/arm/mach-s3c2412/clock.c2
-rw-r--r--arch/arm/mach-s3c2412/cpu-freq.c13
-rw-r--r--arch/arm/mach-s3c2412/dma.c12
-rw-r--r--arch/arm/mach-s3c2412/irq.c12
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c2
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c3
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c1
-rw-r--r--arch/arm/mach-s3c2412/pm.c12
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c25
-rw-r--r--arch/arm/mach-s3c2416/irq.c12
-rw-r--r--arch/arm/mach-s3c2416/mach-smdk2416.c1
-rw-r--r--arch/arm/mach-s3c2416/pm.c12
-rw-r--r--arch/arm/mach-s3c2416/s3c2416.c22
-rw-r--r--arch/arm/mach-s3c2440/clock.c15
-rw-r--r--arch/arm/mach-s3c2440/common.h17
-rw-r--r--arch/arm/mach-s3c2440/dma.c12
-rw-r--r--arch/arm/mach-s3c2440/irq.c12
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c3
-rw-r--r--arch/arm/mach-s3c2440/mach-at2440evb.c3
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c3
-rw-r--r--arch/arm/mach-s3c2440/mach-nexcoder.c3
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c3
-rw-r--r--arch/arm/mach-s3c2440/mach-rx1950.c5
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c5
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c3
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-cpufreq.c22
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-pll-12000000.c20
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-pll-16934400.c24
-rw-r--r--arch/arm/mach-s3c2440/s3c2440.c21
-rw-r--r--arch/arm/mach-s3c2440/s3c2442.c17
-rw-r--r--arch/arm/mach-s3c2440/s3c244x-clock.c19
-rw-r--r--arch/arm/mach-s3c2440/s3c244x-irq.c20
-rw-r--r--arch/arm/mach-s3c2440/s3c244x.c16
-rw-r--r--arch/arm/mach-s3c2443/clock.c2
-rw-r--r--arch/arm/mach-s3c2443/dma.c12
-rw-r--r--arch/arm/mach-s3c2443/irq.c12
-rw-r--r--arch/arm/mach-s3c2443/mach-smdk2443.c1
-rw-r--r--arch/arm/mach-s3c2443/s3c2443.c23
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig1
-rw-r--r--arch/arm/mach-s3c64xx/Makefile65
-rw-r--r--arch/arm/mach-s3c64xx/clock.c4
-rw-r--r--arch/arm/mach-s3c64xx/common.c385
-rw-r--r--arch/arm/mach-s3c64xx/common.h56
-rw-r--r--arch/arm/mach-s3c64xx/cpu.c161
-rw-r--r--arch/arm/mach-s3c64xx/dev-spi.c1
-rw-r--r--arch/arm/mach-s3c64xx/dma.c23
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/entry-macro.S7
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/system.h11
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-s3c64xx/irq-eint.c213
-rw-r--r--arch/arm/mach-s3c64xx/irq.c47
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c8
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq5.c5
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq7.c5
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6400.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/pm.c176
-rw-r--r--arch/arm/mach-s3c64xx/s3c6400.c20
-rw-r--r--arch/arm/mach-s3c64xx/s3c6410.c21
-rw-r--r--arch/arm/mach-s3c64xx/setup-fb-24bpp.c2
-rw-r--r--arch/arm/mach-s5p64x0/Makefile9
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6440.c5
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6450.c5
-rw-r--r--arch/arm/mach-s5p64x0/clock.c6
-rw-r--r--arch/arm/mach-s5p64x0/common.c469
-rw-r--r--arch/arm/mach-s5p64x0/common.h57
-rw-r--r--arch/arm/mach-s5p64x0/cpu.c215
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/entry-macro.S7
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/system.h2
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-s5p64x0/init.c73
-rw-r--r--arch/arm/mach-s5p64x0/irq-eint.c155
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c8
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c8
-rw-r--r--arch/arm/mach-s5p64x0/pm.c10
-rw-r--r--arch/arm/mach-s5pc100/Makefile29
-rw-r--r--arch/arm/mach-s5pc100/clock.c3
-rw-r--r--arch/arm/mach-s5pc100/common.c (renamed from arch/arm/mach-s5pc100/cpu.c)118
-rw-r--r--arch/arm/mach-s5pc100/common.h37
-rw-r--r--arch/arm/mach-s5pc100/include/mach/entry-macro.S25
-rw-r--r--arch/arm/mach-s5pc100/include/mach/system.h2
-rw-r--r--arch/arm/mach-s5pc100/include/mach/vmalloc.h17
-rw-r--r--arch/arm/mach-s5pc100/init.c24
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c8
-rw-r--r--arch/arm/mach-s5pv210/Makefile19
-rw-r--r--arch/arm/mach-s5pv210/clock.c5
-rw-r--r--arch/arm/mach-s5pv210/common.c (renamed from arch/arm/mach-s5pv210/cpu.c)126
-rw-r--r--arch/arm/mach-s5pv210/common.h37
-rw-r--r--arch/arm/mach-s5pv210/include/mach/entry-macro.S37
-rw-r--r--arch/arm/mach-s5pv210/include/mach/system.h2
-rw-r--r--arch/arm/mach-s5pv210/include/mach/vmalloc.h22
-rw-r--r--arch/arm/mach-s5pv210/init.c44
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c8
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c8
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c10
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c11
-rw-r--r--arch/arm/mach-s5pv210/mach-torbreck.c8
-rw-r--r--arch/arm/mach-s5pv210/pm.c10
-rw-r--r--arch/arm/mach-sa1100/Makefile.boot4
-rw-r--r--arch/arm/mach-sa1100/assabet.c1
-rw-r--r--arch/arm/mach-sa1100/badge4.c1
-rw-r--r--arch/arm/mach-sa1100/cerf.c1
-rw-r--r--arch/arm/mach-sa1100/collie.c1
-rw-r--r--arch/arm/mach-sa1100/generic.c11
-rw-r--r--arch/arm/mach-sa1100/generic.h1
-rw-r--r--arch/arm/mach-sa1100/h3100.c1
-rw-r--r--arch/arm/mach-sa1100/h3600.c1
-rw-r--r--arch/arm/mach-sa1100/hackkit.c1
-rw-r--r--arch/arm/mach-sa1100/include/mach/system.h13
-rw-r--r--arch/arm/mach-sa1100/include/mach/vmalloc.h4
-rw-r--r--arch/arm/mach-sa1100/jornada720.c1
-rw-r--r--arch/arm/mach-sa1100/lart.c1
-rw-r--r--arch/arm/mach-sa1100/nanoengine.c2
-rw-r--r--arch/arm/mach-sa1100/pleb.c1
-rw-r--r--arch/arm/mach-sa1100/shannon.c1
-rw-r--r--arch/arm/mach-sa1100/simpad.c1
-rw-r--r--arch/arm/mach-sa1100/time.c28
-rw-r--r--arch/arm/mach-shark/core.c4
-rw-r--r--arch/arm/mach-shark/include/mach/system.h3
-rw-r--r--arch/arm/mach-shark/include/mach/vmalloc.h4
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c4
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c2
-rw-r--r--arch/arm/mach-shmobile/board-g3evm.c2
-rw-r--r--arch/arm/mach-shmobile/board-g4evm.c2
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c2
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c2
-rw-r--r--arch/arm/mach-shmobile/entry-gic.S18
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h5
-rw-r--r--arch/arm/mach-shmobile/include/mach/entry-macro.S9
-rw-r--r--arch/arm/mach-shmobile/include/mach/gpio.h2
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h6
-rw-r--r--arch/arm/mach-shmobile/include/mach/system.h2
-rw-r--r--arch/arm/mach-shmobile/include/mach/vmalloc.h7
-rw-r--r--arch/arm/mach-shmobile/intc-sh7372.c50
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c215
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c6
-rw-r--r--arch/arm/mach-shmobile/sleep-sh7372.S21
-rw-r--r--arch/arm/mach-spear3xx/include/mach/entry-macro.S27
-rw-r--r--arch/arm/mach-spear3xx/include/mach/generic.h2
-rw-r--r--arch/arm/mach-spear3xx/include/mach/vmalloc.h19
-rw-r--r--arch/arm/mach-spear3xx/spear300_evb.c3
-rw-r--r--arch/arm/mach-spear3xx/spear310_evb.c3
-rw-r--r--arch/arm/mach-spear3xx/spear320_evb.c3
-rw-r--r--arch/arm/mach-spear6xx/include/mach/entry-macro.S36
-rw-r--r--arch/arm/mach-spear6xx/include/mach/generic.h2
-rw-r--r--arch/arm/mach-spear6xx/include/mach/vmalloc.h19
-rw-r--r--arch/arm/mach-spear6xx/spear600_evb.c3
-rw-r--r--arch/arm/mach-tcc8k/Kconfig11
-rw-r--r--arch/arm/mach-tcc8k/Makefile9
-rw-r--r--arch/arm/mach-tcc8k/Makefile.boot3
-rw-r--r--arch/arm/mach-tcc8k/board-tcc8000-sdk.c81
-rw-r--r--arch/arm/mach-tcc8k/clock.c580
-rw-r--r--arch/arm/mach-tcc8k/common.h15
-rw-r--r--arch/arm/mach-tcc8k/devices.c239
-rw-r--r--arch/arm/mach-tcc8k/io.c62
-rw-r--r--arch/arm/mach-tcc8k/irq.c111
-rw-r--r--arch/arm/mach-tcc8k/time.c134
-rw-r--r--arch/arm/mach-tegra/board-dt.c3
-rw-r--r--arch/arm/mach-tegra/board-harmony.c3
-rw-r--r--arch/arm/mach-tegra/board-paz00.c3
-rw-r--r--arch/arm/mach-tegra/board-seaboard.c7
-rw-r--r--arch/arm/mach-tegra/board-trimslice.c3
-rw-r--r--arch/arm/mach-tegra/common.c2
-rw-r--r--arch/arm/mach-tegra/include/mach/entry-macro.S22
-rw-r--r--arch/arm/mach-tegra/include/mach/io.h6
-rw-r--r--arch/arm/mach-tegra/include/mach/system.h4
-rw-r--r--arch/arm/mach-tegra/include/mach/vmalloc.h28
-rw-r--r--arch/arm/mach-tegra/io.c21
-rw-r--r--arch/arm/mach-tegra/timer.c24
-rw-r--r--arch/arm/mach-u300/core.c20
-rw-r--r--arch/arm/mach-u300/include/mach/entry-macro.S24
-rw-r--r--arch/arm/mach-u300/include/mach/platform.h1
-rw-r--r--arch/arm/mach-u300/include/mach/system.h28
-rw-r--r--arch/arm/mach-u300/include/mach/vmalloc.h12
-rw-r--r--arch/arm/mach-u300/timer.c15
-rw-r--r--arch/arm/mach-u300/u300.c3
-rw-r--r--arch/arm/mach-ux500/board-mop500.c4
-rw-r--r--arch/arm/mach-ux500/board-u5500.c2
-rw-r--r--arch/arm/mach-ux500/cpu-db5500.c5
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c5
-rw-r--r--arch/arm/mach-ux500/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-ux500/include/mach/gpio.h5
-rw-r--r--arch/arm/mach-ux500/include/mach/system.h5
-rw-r--r--arch/arm/mach-ux500/include/mach/vmalloc.h18
-rw-r--r--arch/arm/mach-versatile/core.c19
-rw-r--r--arch/arm/mach-versatile/core.h1
-rw-r--r--arch/arm/mach-versatile/include/mach/entry-macro.S30
-rw-r--r--arch/arm/mach-versatile/include/mach/system.h16
-rw-r--r--arch/arm/mach-versatile/include/mach/vmalloc.h21
-rw-r--r--arch/arm/mach-versatile/versatile_ab.c4
-rw-r--r--arch/arm/mach-versatile/versatile_dt.c3
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c4
-rw-r--r--arch/arm/mach-vexpress/Kconfig2
-rw-r--r--arch/arm/mach-vexpress/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-vexpress/include/mach/system.h4
-rw-r--r--arch/arm/mach-vexpress/include/mach/vmalloc.h21
-rw-r--r--arch/arm/mach-vexpress/v2m.c6
-rw-r--r--arch/arm/mach-vt8500/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-w90x900/cpu.c16
-rw-r--r--arch/arm/mach-w90x900/dev.c4
-rw-r--r--arch/arm/mach-w90x900/include/mach/mfp.h3
-rw-r--r--arch/arm/mach-w90x900/include/mach/nuc900_spi.h2
-rw-r--r--arch/arm/mach-w90x900/include/mach/system.h22
-rw-r--r--arch/arm/mach-w90x900/include/mach/vmalloc.h23
-rw-r--r--arch/arm/mach-w90x900/irq.c4
-rw-r--r--arch/arm/mach-w90x900/mach-nuc910evb.c1
-rw-r--r--arch/arm/mach-w90x900/mach-nuc950evb.c1
-rw-r--r--arch/arm/mach-w90x900/mach-nuc960evb.c1
-rw-r--r--arch/arm/mach-w90x900/mfp.c48
-rw-r--r--arch/arm/mach-w90x900/nuc910.h9
-rw-r--r--arch/arm/mach-w90x900/nuc950.h9
-rw-r--r--arch/arm/mach-w90x900/nuc960.h9
-rw-r--r--arch/arm/mach-w90x900/nuc9xx.h24
-rw-r--r--arch/arm/mach-w90x900/time.c2
-rw-r--r--arch/arm/mach-zynq/common.c1
-rw-r--r--arch/arm/mach-zynq/include/mach/entry-macro.S3
-rw-r--r--arch/arm/mach-zynq/include/mach/system.h5
-rw-r--r--arch/arm/mach-zynq/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mm/Kconfig40
-rw-r--r--arch/arm/mm/alignment.c2
-rw-r--r--arch/arm/mm/cache-l2x0.c2
-rw-r--r--arch/arm/mm/context.c19
-rw-r--r--arch/arm/mm/dma-mapping.c11
-rw-r--r--arch/arm/mm/fault.c169
-rw-r--r--arch/arm/mm/fault.h27
-rw-r--r--arch/arm/mm/fsr-2level.c78
-rw-r--r--arch/arm/mm/fsr-3level.c68
-rw-r--r--arch/arm/mm/idmap.c93
-rw-r--r--arch/arm/mm/init.c44
-rw-r--r--arch/arm/mm/ioremap.c119
-rw-r--r--arch/arm/mm/mm.h14
-rw-r--r--arch/arm/mm/mmap.c196
-rw-r--r--arch/arm/mm/mmu.c97
-rw-r--r--arch/arm/mm/nommu.c4
-rw-r--r--arch/arm/mm/pgd.c51
-rw-r--r--arch/arm/mm/proc-arm1020.S3
-rw-r--r--arch/arm/mm/proc-arm1020e.S3
-rw-r--r--arch/arm/mm/proc-arm1022.S3
-rw-r--r--arch/arm/mm/proc-arm1026.S3
-rw-r--r--arch/arm/mm/proc-arm6_7.S4
-rw-r--r--arch/arm/mm/proc-arm720.S3
-rw-r--r--arch/arm/mm/proc-arm740.S3
-rw-r--r--arch/arm/mm/proc-arm7tdmi.S3
-rw-r--r--arch/arm/mm/proc-arm920.S3
-rw-r--r--arch/arm/mm/proc-arm922.S3
-rw-r--r--arch/arm/mm/proc-arm925.S3
-rw-r--r--arch/arm/mm/proc-arm926.S3
-rw-r--r--arch/arm/mm/proc-arm940.S3
-rw-r--r--arch/arm/mm/proc-arm946.S3
-rw-r--r--arch/arm/mm/proc-arm9tdmi.S3
-rw-r--r--arch/arm/mm/proc-fa526.S3
-rw-r--r--arch/arm/mm/proc-feroceon.S3
-rw-r--r--arch/arm/mm/proc-macros.S5
-rw-r--r--arch/arm/mm/proc-mohawk.S3
-rw-r--r--arch/arm/mm/proc-sa110.S3
-rw-r--r--arch/arm/mm/proc-sa1100.S3
-rw-r--r--arch/arm/mm/proc-v6.S3
-rw-r--r--arch/arm/mm/proc-v7-2level.S171
-rw-r--r--arch/arm/mm/proc-v7-3level.S150
-rw-r--r--arch/arm/mm/proc-v7.S196
-rw-r--r--arch/arm/mm/proc-xsc3.S3
-rw-r--r--arch/arm/mm/proc-xscale.S3
-rw-r--r--arch/arm/nwfpe/entry.S8
-rw-r--r--arch/arm/nwfpe/fpopcode.c26
-rw-r--r--arch/arm/nwfpe/fpopcode.h3
-rw-r--r--arch/arm/oprofile/common.c2
-rw-r--r--arch/arm/plat-iop/Makefile4
-rw-r--r--arch/arm/plat-iop/io.c59
-rw-r--r--arch/arm/plat-iop/restart.c19
-rw-r--r--arch/arm/plat-iop/time.c16
-rw-r--r--arch/arm/plat-mxc/Kconfig1
-rw-r--r--arch/arm/plat-mxc/Makefile1
-rw-r--r--arch/arm/plat-mxc/cpufreq.c3
-rw-r--r--arch/arm/plat-mxc/gic.c41
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/entry-macro.S11
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc.h14
-rw-r--r--arch/arm/plat-mxc/include/mach/system.h9
-rw-r--r--arch/arm/plat-mxc/include/mach/uncompress.h1
-rw-r--r--arch/arm/plat-mxc/include/mach/vmalloc.h22
-rw-r--r--arch/arm/plat-mxc/pwm.c16
-rw-r--r--arch/arm/plat-mxc/system.c14
-rw-r--r--arch/arm/plat-mxc/time.c15
-rw-r--r--arch/arm/plat-nomadik/timer.c20
-rw-r--r--arch/arm/plat-omap/Makefile2
-rw-r--r--arch/arm/plat-omap/common.c8
-rw-r--r--arch/arm/plat-omap/counter_32k.c40
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h2
-rw-r--r--arch/arm/plat-omap/include/plat/common.h84
-rw-r--r--arch/arm/plat-omap/include/plat/io.h76
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h14
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h2
-rw-r--r--arch/arm/plat-omap/include/plat/system.h2
-rw-r--r--arch/arm/plat-omap/io.c159
-rw-r--r--arch/arm/plat-orion/gpio.c6
-rw-r--r--arch/arm/plat-orion/time.c21
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq-debugfs.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c23
-rw-r--r--arch/arm/plat-s3c24xx/irq.c2
-rw-r--r--arch/arm/plat-s3c24xx/pm-simtec.c1
-rw-r--r--arch/arm/plat-s3c24xx/s3c2410-clock.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2412-iotiming.c2
-rw-r--r--arch/arm/plat-s5p/Kconfig1
-rw-r--r--arch/arm/plat-s5p/Makefile1
-rw-r--r--arch/arm/plat-s5p/clock.c2
-rw-r--r--arch/arm/plat-s5p/cpu.c144
-rw-r--r--arch/arm/plat-s5p/irq-eint.c2
-rw-r--r--arch/arm/plat-s5p/s5p-time.c19
-rw-r--r--arch/arm/plat-s5p/sysmmu.c1
-rw-r--r--arch/arm/plat-samsung/clock-clksrc.c2
-rw-r--r--arch/arm/plat-samsung/clock.c2
-rw-r--r--arch/arm/plat-samsung/dev-backlight.c1
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu-freq-core.h25
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h34
-rw-r--r--arch/arm/plat-samsung/include/plat/dma-s3c24xx.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/exynos4.h35
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-cfg.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h8
-rw-r--r--arch/arm/plat-samsung/include/plat/reset.h16
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2412.h3
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2416.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2443.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c6400.h36
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c6410.h29
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p6440.h36
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p6450.h36
-rw-r--r--arch/arm/plat-samsung/include/plat/s5pc100.h33
-rw-r--r--arch/arm/plat-samsung/include/plat/s5pv210.h33
-rw-r--r--arch/arm/plat-samsung/include/plat/system-reset.h31
-rw-r--r--arch/arm/plat-samsung/include/plat/watchdog-reset.h1
-rw-r--r--arch/arm/plat-samsung/pd.c2
-rw-r--r--arch/arm/plat-samsung/pm-gpio.c2
-rw-r--r--arch/arm/plat-samsung/pwm.c2
-rw-r--r--arch/arm/plat-samsung/wakeup-mask.c2
-rw-r--r--arch/arm/plat-spear/Makefile2
-rw-r--r--arch/arm/plat-spear/include/plat/system.h15
-rw-r--r--arch/arm/plat-spear/include/plat/vmalloc.h19
-rw-r--r--arch/arm/plat-spear/restart.c27
-rw-r--r--arch/arm/plat-tcc/Kconfig20
-rw-r--r--arch/arm/plat-tcc/Makefile3
-rw-r--r--arch/arm/plat-tcc/clock.c179
-rw-r--r--arch/arm/plat-tcc/include/mach/clock.h48
-rw-r--r--arch/arm/plat-tcc/include/mach/debug-macro.S32
-rw-r--r--arch/arm/plat-tcc/include/mach/entry-macro.S68
-rw-r--r--arch/arm/plat-tcc/include/mach/hardware.h43
-rw-r--r--arch/arm/plat-tcc/include/mach/io.h23
-rw-r--r--arch/arm/plat-tcc/include/mach/irqs.h83
-rw-r--r--arch/arm/plat-tcc/include/mach/system.h31
-rw-r--r--arch/arm/plat-tcc/include/mach/tcc8k-regs.h807
-rw-r--r--arch/arm/plat-tcc/include/mach/timex.h5
-rw-r--r--arch/arm/plat-tcc/include/mach/uncompress.h34
-rw-r--r--arch/arm/plat-tcc/include/mach/vmalloc.h10
-rw-r--r--arch/arm/plat-tcc/system.c25
-rw-r--r--arch/arm/plat-versatile/sched-clock.c29
-rw-r--r--arch/arm/tools/mach-types714
-rw-r--r--arch/avr32/boards/merisc/merisc_sysfs.c1
-rw-r--r--arch/avr32/include/asm/ipcbuf.h30
-rw-r--r--arch/avr32/include/asm/socket.h3
-rw-r--r--arch/avr32/include/asm/thread_info.h2
-rw-r--r--arch/avr32/include/asm/types.h6
-rw-r--r--arch/avr32/kernel/cpu.c74
-rw-r--r--arch/avr32/kernel/irq.c2
-rw-r--r--arch/avr32/kernel/process.c6
-rw-r--r--arch/blackfin/include/asm/thread_info.h2
-rw-r--r--arch/blackfin/kernel/process.c6
-rw-r--r--arch/cris/Kconfig.debug1
-rw-r--r--arch/cris/arch-v10/drivers/Kconfig2
-rw-r--r--arch/cris/arch-v32/drivers/Kconfig2
-rw-r--r--arch/cris/arch-v32/kernel/time.c4
-rw-r--r--arch/cris/include/asm/ipcbuf.h30
-rw-r--r--arch/cris/include/asm/socket.h3
-rw-r--r--arch/cris/include/asm/thread_info.h2
-rw-r--r--arch/cris/include/asm/types.h6
-rw-r--r--arch/frv/Kconfig10
-rw-r--r--arch/frv/include/asm/ipcbuf.h31
-rw-r--r--arch/frv/include/asm/socket.h3
-rw-r--r--arch/frv/include/asm/thread_info.h2
-rw-r--r--arch/frv/include/asm/types.h6
-rw-r--r--arch/h8300/include/asm/ipcbuf.h30
-rw-r--r--arch/h8300/include/asm/socket.h3
-rw-r--r--arch/h8300/include/asm/thread_info.h2
-rw-r--r--arch/h8300/include/asm/types.h17
-rw-r--r--arch/ia64/Kconfig6
-rw-r--r--arch/ia64/include/asm/cputime.h71
-rw-r--r--arch/ia64/include/asm/ipcbuf.h29
-rw-r--r--arch/ia64/include/asm/socket.h3
-rw-r--r--arch/ia64/include/asm/thread_info.h2
-rw-r--r--arch/ia64/include/asm/types.h2
-rw-r--r--arch/ia64/kernel/err_inject.c52
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/setup.c19
-rw-r--r--arch/ia64/kernel/topology.c10
-rw-r--r--arch/ia64/mm/contig.c3
-rw-r--r--arch/ia64/mm/init.c4
-rw-r--r--arch/ia64/sn/kernel/irq.c5
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c3
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c4
-rw-r--r--arch/m32r/include/asm/ipcbuf.h30
-rw-r--r--arch/m32r/include/asm/socket.h3
-rw-r--r--arch/m32r/include/asm/thread_info.h2
-rw-r--r--arch/m32r/include/asm/types.h6
-rw-r--r--arch/m68k/Kconfig17
-rw-r--r--arch/m68k/Kconfig.cpu78
-rw-r--r--arch/m68k/Kconfig.debug27
-rw-r--r--arch/m68k/Kconfig.devices46
-rw-r--r--arch/m68k/Kconfig.machine4
-rw-r--r--arch/m68k/atari/ataints.c2
-rw-r--r--arch/m68k/atari/debug.c1
-rw-r--r--arch/m68k/configs/amiga_defconfig1
-rw-r--r--arch/m68k/configs/apollo_defconfig2
-rw-r--r--arch/m68k/configs/atari_defconfig3
-rw-r--r--arch/m68k/configs/multi_defconfig5
-rw-r--r--arch/m68k/configs/mvme16x_defconfig2
-rw-r--r--arch/m68k/emu/nfeth.c2
-rw-r--r--arch/m68k/hp300/config.c3
-rw-r--r--arch/m68k/include/asm/anchor.h112
-rw-r--r--arch/m68k/include/asm/atarihw.h2
-rw-r--r--arch/m68k/include/asm/atomic.h10
-rw-r--r--arch/m68k/include/asm/blinken.h8
-rw-r--r--arch/m68k/include/asm/cacheflush_mm.h88
-rw-r--r--arch/m68k/include/asm/checksum.h31
-rw-r--r--arch/m68k/include/asm/div64.h8
-rw-r--r--arch/m68k/include/asm/elf.h6
-rw-r--r--arch/m68k/include/asm/entry.h10
-rw-r--r--arch/m68k/include/asm/fpu.h2
-rw-r--r--arch/m68k/include/asm/gpio.h3
-rw-r--r--arch/m68k/include/asm/ipcbuf.h30
-rw-r--r--arch/m68k/include/asm/irq.h5
-rw-r--r--arch/m68k/include/asm/m54xxacr.h32
-rw-r--r--arch/m68k/include/asm/mac_baboon.h6
-rw-r--r--arch/m68k/include/asm/mac_iop.h2
-rw-r--r--arch/m68k/include/asm/mac_oss.h23
-rw-r--r--arch/m68k/include/asm/mac_psc.h4
-rw-r--r--arch/m68k/include/asm/mac_via.h9
-rw-r--r--arch/m68k/include/asm/macintosh.h10
-rw-r--r--arch/m68k/include/asm/macints.h6
-rw-r--r--arch/m68k/include/asm/mcf_pgalloc.h102
-rw-r--r--arch/m68k/include/asm/mcf_pgtable.h425
-rw-r--r--arch/m68k/include/asm/mcfmmu.h112
-rw-r--r--arch/m68k/include/asm/mmu_context.h250
-rw-r--r--arch/m68k/include/asm/motorola_pgtable.h1
-rw-r--r--arch/m68k/include/asm/page.h10
-rw-r--r--arch/m68k/include/asm/page_no.h3
-rw-r--r--arch/m68k/include/asm/page_offset.h10
-rw-r--r--arch/m68k/include/asm/pgalloc.h4
-rw-r--r--arch/m68k/include/asm/pgtable_mm.h30
-rw-r--r--arch/m68k/include/asm/processor.h18
-rw-r--r--arch/m68k/include/asm/segment.h30
-rw-r--r--arch/m68k/include/asm/serial.h2
-rw-r--r--arch/m68k/include/asm/setup.h14
-rw-r--r--arch/m68k/include/asm/sigcontext.h4
-rw-r--r--arch/m68k/include/asm/socket.h3
-rw-r--r--arch/m68k/include/asm/thread_info.h34
-rw-r--r--arch/m68k/include/asm/tlbflush.h23
-rw-r--r--arch/m68k/include/asm/traps.h1
-rw-r--r--arch/m68k/include/asm/types.h6
-rw-r--r--arch/m68k/include/asm/uaccess_mm.h42
-rw-r--r--arch/m68k/include/asm/ucontext.h4
-rw-r--r--arch/m68k/include/asm/unistd.h14
-rw-r--r--arch/m68k/kernel/Makefile21
-rw-r--r--arch/m68k/kernel/asm-offsets.c3
-rw-r--r--arch/m68k/kernel/entry.S2
-rw-r--r--arch/m68k/kernel/entry_mm.S31
-rw-r--r--arch/m68k/kernel/entry_no.S9
-rw-r--r--arch/m68k/kernel/head.S117
-rw-r--r--arch/m68k/kernel/init_task.c3
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c2
-rw-r--r--arch/m68k/kernel/process_mm.c75
-rw-r--r--arch/m68k/kernel/ptrace_mm.c18
-rw-r--r--arch/m68k/kernel/setup_mm.c22
-rw-r--r--arch/m68k/kernel/setup_no.c1
-rw-r--r--arch/m68k/kernel/signal_mm.c204
-rw-r--r--arch/m68k/kernel/syscalltable.S2
-rw-r--r--arch/m68k/kernel/time.c2
-rw-r--r--arch/m68k/kernel/time_no.c3
-rw-r--r--arch/m68k/kernel/traps.c104
-rw-r--r--arch/m68k/kernel/vmlinux-nommu.lds (renamed from arch/m68k/kernel/vmlinux.lds_no.S)8
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds2
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds2
-rw-r--r--arch/m68k/kernel/vmlinux.lds.S15
-rw-r--r--arch/m68k/kernel/vmlinux.lds_mm.S10
-rw-r--r--arch/m68k/lib/Makefile10
-rw-r--r--arch/m68k/lib/checksum.c (renamed from arch/m68k/lib/checksum_mm.c)0
-rw-r--r--arch/m68k/lib/checksum_no.c156
-rw-r--r--arch/m68k/lib/uaccess.c22
-rw-r--r--arch/m68k/mac/baboon.c41
-rw-r--r--arch/m68k/mac/config.c93
-rw-r--r--arch/m68k/mac/iop.c8
-rw-r--r--arch/m68k/mac/macints.c197
-rw-r--r--arch/m68k/mac/oss.c157
-rw-r--r--arch/m68k/mac/psc.c17
-rw-r--r--arch/m68k/mac/via.c255
-rw-r--r--arch/m68k/mm/Makefile8
-rw-r--r--arch/m68k/mm/cache.c24
-rw-r--r--arch/m68k/mm/init_mm.c36
-rw-r--r--arch/m68k/mm/kmap.c3
-rw-r--r--arch/m68k/mm/mcfmmu.c198
-rw-r--r--arch/m68k/mm/memory.c8
-rw-r--r--arch/m68k/mvme16x/config.c160
-rw-r--r--arch/m68k/platform/54xx/config.c47
-rw-r--r--arch/m68k/platform/68328/Makefile6
-rw-r--r--arch/m68k/platform/68328/bootlogo.h2
-rw-r--r--arch/m68k/platform/68328/bootlogo.pl10
-rw-r--r--arch/m68k/platform/68328/config.c3
-rw-r--r--arch/m68k/platform/68328/head-pilot.S19
-rw-r--r--arch/m68k/platform/68328/head-rom.S9
-rw-r--r--arch/m68k/platform/68328/timers.c4
-rw-r--r--arch/m68k/platform/coldfire/dma_timer.c5
-rw-r--r--arch/m68k/platform/coldfire/entry.S7
-rw-r--r--arch/m68k/platform/coldfire/gpio.c9
-rw-r--r--arch/m68k/platform/coldfire/head.S53
-rw-r--r--arch/m68k/platform/coldfire/pit.c4
-rw-r--r--arch/m68k/platform/coldfire/sltimers.c13
-rw-r--r--arch/m68k/platform/coldfire/timers.c4
-rw-r--r--arch/microblaze/include/asm/memblock.h14
-rw-r--r--arch/microblaze/include/asm/namei.h22
-rw-r--r--arch/microblaze/include/asm/thread_info.h2
-rw-r--r--arch/microblaze/kernel/process.c6
-rw-r--r--arch/microblaze/kernel/prom.c3
-rw-r--r--arch/microblaze/kernel/reset.c43
-rw-r--r--arch/mips/Kconfig11
-rw-r--r--arch/mips/include/asm/ip32/mace.h2
-rw-r--r--arch/mips/include/asm/ipcbuf.h29
-rw-r--r--arch/mips/include/asm/socket.h3
-rw-r--r--arch/mips/include/asm/thread_info.h2
-rw-r--r--arch/mips/include/asm/types.h6
-rw-r--r--arch/mips/kernel/perf_event_mipsxx.c8
-rw-r--r--arch/mips/kernel/process.c6
-rw-r--r--arch/mips/kernel/setup.c3
-rw-r--r--arch/mips/sgi-ip27/Kconfig6
-rw-r--r--arch/mips/sgi-ip27/ip27-memory.c5
-rw-r--r--arch/mips/sibyte/Kconfig1
-rw-r--r--arch/mips/txx9/generic/7segled.c44
-rw-r--r--arch/mips/txx9/generic/setup.c34
-rw-r--r--arch/mips/txx9/generic/setup_tx4939.c2
-rw-r--r--arch/mn10300/include/asm/ipcbuf.h30
-rw-r--r--arch/mn10300/include/asm/socket.h3
-rw-r--r--arch/mn10300/include/asm/thread_info.h2
-rw-r--r--arch/mn10300/include/asm/types.h6
-rw-r--r--arch/openrisc/include/asm/memblock.h24
-rw-r--r--arch/openrisc/kernel/idle.c6
-rw-r--r--arch/openrisc/kernel/prom.c3
-rw-r--r--arch/parisc/hpux/sys_hpux.c9
-rw-r--r--arch/parisc/include/asm/socket.h3
-rw-r--r--arch/parisc/include/asm/thread_info.h2
-rw-r--r--arch/parisc/include/asm/types.h6
-rw-r--r--arch/parisc/kernel/time.c6
-rw-r--r--arch/powerpc/Kconfig60
-rw-r--r--arch/powerpc/Kconfig.debug12
-rw-r--r--arch/powerpc/Makefile17
-rw-r--r--arch/powerpc/boot/Makefile12
-rw-r--r--arch/powerpc/boot/dcr.h6
-rw-r--r--arch/powerpc/boot/div64.S52
-rw-r--r--arch/powerpc/boot/dts/asp834x-redboot.dts4
-rw-r--r--arch/powerpc/boot/dts/currituck.dts237
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8536si-post.dtsi248
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8536si-pre.dtsi63
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8544si-post.dtsi191
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8544si-pre.dtsi63
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8548si-post.dtsi143
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8548si-pre.dtsi62
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8568si-post.dtsi270
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8568si-pre.dtsi65
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8569si-post.dtsi304
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8569si-pre.dtsi64
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8572si-post.dtsi196
-rw-r--r--arch/powerpc/boot/dts/fsl/mpc8572si-pre.dtsi70
-rw-r--r--arch/powerpc/boot/dts/fsl/p1010si-post.dtsi198
-rw-r--r--arch/powerpc/boot/dts/fsl/p1010si-pre.dtsi64
-rw-r--r--arch/powerpc/boot/dts/fsl/p1020si-post.dtsi174
-rw-r--r--arch/powerpc/boot/dts/fsl/p1020si-pre.dtsi68
-rw-r--r--arch/powerpc/boot/dts/fsl/p1021si-post.dtsi225
-rw-r--r--arch/powerpc/boot/dts/fsl/p1021si-pre.dtsi68
-rw-r--r--arch/powerpc/boot/dts/fsl/p1022si-post.dtsi235
-rw-r--r--arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi68
-rw-r--r--arch/powerpc/boot/dts/fsl/p1023si-post.dtsi224
-rw-r--r--arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi76
-rw-r--r--arch/powerpc/boot/dts/fsl/p2020si-post.dtsi194
-rw-r--r--arch/powerpc/boot/dts/fsl/p2020si-pre.dtsi69
-rw-r--r--arch/powerpc/boot/dts/fsl/p2041si-post.dtsi325
-rw-r--r--arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi111
-rw-r--r--arch/powerpc/boot/dts/fsl/p3041si-post.dtsi352
-rw-r--r--arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi112
-rw-r--r--arch/powerpc/boot/dts/fsl/p3060si-post.dtsi296
-rw-r--r--arch/powerpc/boot/dts/fsl/p3060si-pre.dtsi125
-rw-r--r--arch/powerpc/boot/dts/fsl/p4080si-post.dtsi350
-rw-r--r--arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi143
-rw-r--r--arch/powerpc/boot/dts/fsl/p5020si-post.dtsi355
-rw-r--r--arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi96
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-dma-0.dtsi66
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-dma-1.dtsi66
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-duart-0.dtsi51
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-esdhc-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-espi-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec1-0.dtsi53
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec1-1.dtsi53
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec1-2.dtsi53
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec1-3.dtsi53
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec1-timer-0.dtsi39
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi60
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi60
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi59
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-0.dtsi42
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-1.dtsi42
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-2.dtsi42
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-i2c-0.dtsi43
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-i2c-1.dtsi43
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-mpic-timer-B.dtsi42
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi66
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-rmu-0.dtsi68
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-sata2-0.dtsi40
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-sata2-1.dtsi40
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-sec2.1-0.dtsi43
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-sec3.0-0.dtsi45
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-sec3.1-0.dtsi45
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-sec3.3-0.dtsi45
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-sec4.4-0.dtsi65
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-usb2-dr-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-usb2-dr-1.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-dma-0.dtsi66
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-dma-1.dtsi66
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-duart-0.dtsi51
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-duart-1.dtsi51
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-esdhc-0.dtsi40
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-espi-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-gpio-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi53
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-i2c-1.dtsi53
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-mpic.dtsi106
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-rmu-0.dtsi68
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-sata2-0.dtsi39
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-sata2-1.dtsi39
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-sec4.0-0.dtsi100
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-sec4.1-0.dtsi109
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi109
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-usb2-dr-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/fsl/qoriq-usb2-mph-0.dtsi41
-rw-r--r--arch/powerpc/boot/dts/gef_ppc9a.dts4
-rw-r--r--arch/powerpc/boot/dts/gef_sbc310.dts4
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts4
-rw-r--r--arch/powerpc/boot/dts/klondike.dts227
-rw-r--r--arch/powerpc/boot/dts/kmeter1.dts2
-rw-r--r--arch/powerpc/boot/dts/kuroboxHD.dts4
-rw-r--r--arch/powerpc/boot/dts/kuroboxHG.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8308_p1m.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8308rdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8313erdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8315erdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc832x_mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc832x_rdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitx.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitxgp.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc834x_mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc836x_mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc836x_rdk.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8377_mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8377_rdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8377_wlan.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8378_mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8378_rdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8379_mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8379_rdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8536ds.dts456
-rw-r--r--arch/powerpc/boot/dts/mpc8536ds.dtsi141
-rw-r--r--arch/powerpc/boot/dts/mpc8536ds_36b.dts410
-rw-r--r--arch/powerpc/boot/dts/mpc8540ads.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8541cds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts473
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dtsi161
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts505
-rw-r--r--arch/powerpc/boot/dts/mpc8555cds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts482
-rw-r--r--arch/powerpc/boot/dts/mpc8569mds.dts414
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts757
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dtsi397
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_36b.dts746
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts487
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts245
-rw-r--r--arch/powerpc/boot/dts/mpc8610_hpcd.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn.dts73
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts4
-rw-r--r--arch/powerpc/boot/dts/obs600.dts314
-rw-r--r--arch/powerpc/boot/dts/p1010rdb.dts228
-rw-r--r--arch/powerpc/boot/dts/p1010rdb.dtsi234
-rw-r--r--arch/powerpc/boot/dts/p1010rdb_36b.dts89
-rw-r--r--arch/powerpc/boot/dts/p1010si.dtsi374
-rw-r--r--arch/powerpc/boot/dts/p1020rdb.dts262
-rw-r--r--arch/powerpc/boot/dts/p1020rdb.dtsi247
-rw-r--r--arch/powerpc/boot/dts/p1020rdb_36b.dts66
-rw-r--r--arch/powerpc/boot/dts/p1020rdb_camp_core0.dts154
-rw-r--r--arch/powerpc/boot/dts/p1020rdb_camp_core1.dts11
-rw-r--r--arch/powerpc/boot/dts/p1020si.dtsi377
-rw-r--r--arch/powerpc/boot/dts/p1021mds.dts425
-rw-r--r--arch/powerpc/boot/dts/p1022ds.dts459
-rw-r--r--arch/powerpc/boot/dts/p1023rds.dts383
-rw-r--r--arch/powerpc/boot/dts/p2020ds.dts353
-rw-r--r--arch/powerpc/boot/dts/p2020ds.dtsi316
-rw-r--r--arch/powerpc/boot/dts/p2020rdb.dts71
-rw-r--r--arch/powerpc/boot/dts/p2020rdb_camp_core0.dts141
-rw-r--r--arch/powerpc/boot/dts/p2020rdb_camp_core1.dts107
-rw-r--r--arch/powerpc/boot/dts/p2020si.dtsi382
-rw-r--r--arch/powerpc/boot/dts/p2041rdb.dts22
-rw-r--r--arch/powerpc/boot/dts/p2041si.dtsi692
-rw-r--r--arch/powerpc/boot/dts/p3041ds.dts23
-rw-r--r--arch/powerpc/boot/dts/p3041si.dtsi729
-rw-r--r--arch/powerpc/boot/dts/p3060qds.dts12
-rw-r--r--arch/powerpc/boot/dts/p3060si.dtsi719
-rw-r--r--arch/powerpc/boot/dts/p4080ds.dts24
-rw-r--r--arch/powerpc/boot/dts/p4080si.dtsi755
-rw-r--r--arch/powerpc/boot/dts/p5020ds.dts24
-rw-r--r--arch/powerpc/boot/dts/p5020si.dtsi716
-rw-r--r--arch/powerpc/boot/dts/sbc8349.dts4
-rw-r--r--arch/powerpc/boot/dts/sbc8548.dts4
-rw-r--r--arch/powerpc/boot/dts/sbc8641d.dts4
-rw-r--r--arch/powerpc/boot/dts/socrates.dts4
-rw-r--r--arch/powerpc/boot/dts/storcenter.dts4
-rw-r--r--arch/powerpc/boot/dts/stxssa8555.dts4
-rw-r--r--arch/powerpc/boot/dts/tqm8540.dts4
-rw-r--r--arch/powerpc/boot/dts/tqm8541.dts4
-rw-r--r--arch/powerpc/boot/dts/tqm8548-bigflash.dts23
-rw-r--r--arch/powerpc/boot/dts/tqm8548.dts23
-rw-r--r--arch/powerpc/boot/dts/tqm8555.dts4
-rw-r--r--arch/powerpc/boot/dts/tqm8xx.dts25
-rw-r--r--arch/powerpc/boot/dts/xcalibur1501.dts4
-rw-r--r--arch/powerpc/boot/dts/xpedite5200.dts4
-rw-r--r--arch/powerpc/boot/dts/xpedite5200_xmon.dts4
-rw-r--r--arch/powerpc/boot/dts/xpedite5301.dts4
-rw-r--r--arch/powerpc/boot/dts/xpedite5330.dts4
-rw-r--r--arch/powerpc/boot/dts/xpedite5370.dts4
-rw-r--r--arch/powerpc/boot/treeboot-currituck.c119
-rwxr-xr-xarch/powerpc/boot/wrapper45
-rw-r--r--arch/powerpc/configs/40x/klondike_defconfig55
-rw-r--r--arch/powerpc/configs/40x/obs600_defconfig83
-rw-r--r--arch/powerpc/configs/44x/currituck_defconfig110
-rw-r--r--arch/powerpc/configs/44x/iss476-smp_defconfig3
-rw-r--r--arch/powerpc/configs/chroma_defconfig307
-rw-r--r--arch/powerpc/configs/corenet32_smp_defconfig11
-rw-r--r--arch/powerpc/configs/corenet64_smp_defconfig4
-rw-r--r--arch/powerpc/configs/mpc85xx_defconfig17
-rw-r--r--arch/powerpc/configs/mpc85xx_smp_defconfig18
-rw-r--r--arch/powerpc/configs/ppc44x_defconfig2
-rw-r--r--arch/powerpc/configs/ppc64_defconfig5
-rw-r--r--arch/powerpc/configs/ps3_defconfig39
-rw-r--r--arch/powerpc/configs/pseries_defconfig5
-rw-r--r--arch/powerpc/include/asm/Kbuild2
-rw-r--r--arch/powerpc/include/asm/atomic.h48
-rw-r--r--arch/powerpc/include/asm/bitops.h12
-rw-r--r--arch/powerpc/include/asm/cputable.h5
-rw-r--r--arch/powerpc/include/asm/cputime.h76
-rw-r--r--arch/powerpc/include/asm/fsl_ifc.h834
-rw-r--r--arch/powerpc/include/asm/fsl_lbc.h7
-rw-r--r--arch/powerpc/include/asm/futex.h7
-rw-r--r--arch/powerpc/include/asm/hugetlb.h38
-rw-r--r--arch/powerpc/include/asm/io.h2
-rw-r--r--arch/powerpc/include/asm/kdump.h4
-rw-r--r--arch/powerpc/include/asm/kexec.h7
-rw-r--r--arch/powerpc/include/asm/keylargo.h2
-rw-r--r--arch/powerpc/include/asm/kvm.h8
-rw-r--r--arch/powerpc/include/asm/kvm_book3s.h35
-rw-r--r--arch/powerpc/include/asm/kvm_book3s_64.h33
-rw-r--r--arch/powerpc/include/asm/lv1call.h10
-rw-r--r--arch/powerpc/include/asm/machdep.h3
-rw-r--r--arch/powerpc/include/asm/memblock.h8
-rw-r--r--arch/powerpc/include/asm/mmu-book3e.h11
-rw-r--r--arch/powerpc/include/asm/mmu-hash64.h7
-rw-r--r--arch/powerpc/include/asm/mpic.h14
-rw-r--r--arch/powerpc/include/asm/opal.h131
-rw-r--r--arch/powerpc/include/asm/paca.h1
-rw-r--r--arch/powerpc/include/asm/page.h90
-rw-r--r--arch/powerpc/include/asm/page_64.h2
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h6
-rw-r--r--arch/powerpc/include/asm/pci.h2
-rw-r--r--arch/powerpc/include/asm/pgtable.h3
-rw-r--r--arch/powerpc/include/asm/processor.h3
-rw-r--r--arch/powerpc/include/asm/reg.h1
-rw-r--r--arch/powerpc/include/asm/reg_booke.h6
-rw-r--r--arch/powerpc/include/asm/rtas.h18
-rw-r--r--arch/powerpc/include/asm/rwsem.h132
-rw-r--r--arch/powerpc/include/asm/sections.h2
-rw-r--r--arch/powerpc/include/asm/socket.h3
-rw-r--r--arch/powerpc/include/asm/spu.h14
-rw-r--r--arch/powerpc/include/asm/synch.h9
-rw-r--r--arch/powerpc/include/asm/system.h11
-rw-r--r--arch/powerpc/include/asm/tce.h10
-rw-r--r--arch/powerpc/include/asm/thread_info.h2
-rw-r--r--arch/powerpc/include/asm/time.h2
-rw-r--r--arch/powerpc/include/asm/topology.h10
-rw-r--r--arch/powerpc/include/asm/types.h11
-rw-r--r--arch/powerpc/kernel/Makefile2
-rw-r--r--arch/powerpc/kernel/asm-offsets.c1
-rw-r--r--arch/powerpc/kernel/cacheinfo.c10
-rw-r--r--arch/powerpc/kernel/cpu_setup_a2.S10
-rw-r--r--arch/powerpc/kernel/cputable.c27
-rw-r--r--arch/powerpc/kernel/crash.c220
-rw-r--r--arch/powerpc/kernel/crash_dump.c4
-rw-r--r--arch/powerpc/kernel/entry_32.S15
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S2
-rw-r--r--arch/powerpc/kernel/head_44x.S107
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S2
-rw-r--r--arch/powerpc/kernel/idle.c42
-rw-r--r--arch/powerpc/kernel/idle_power7.S4
-rw-r--r--arch/powerpc/kernel/irq.c28
-rw-r--r--arch/powerpc/kernel/jump_label.c2
-rw-r--r--arch/powerpc/kernel/kvm.c1
-rw-r--r--arch/powerpc/kernel/lparcfg.c2
-rw-r--r--arch/powerpc/kernel/machine_kexec.c5
-rw-r--r--arch/powerpc/kernel/misc_32.S2
-rw-r--r--arch/powerpc/kernel/pci-common.c78
-rw-r--r--arch/powerpc/kernel/pci_dn.c3
-rw-r--r--arch/powerpc/kernel/process.c46
-rw-r--r--arch/powerpc/kernel/prom.c20
-rw-r--r--arch/powerpc/kernel/prom_init.c43
-rw-r--r--arch/powerpc/kernel/reloc_32.S208
-rw-r--r--arch/powerpc/kernel/rtas_flash.c6
-rw-r--r--arch/powerpc/kernel/rtasd.c7
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/setup_64.c11
-rw-r--r--arch/powerpc/kernel/signal_32.c2
-rw-r--r--arch/powerpc/kernel/smp.c5
-rw-r--r--arch/powerpc/kernel/sysfs.c271
-rw-r--r--arch/powerpc/kernel/time.c105
-rw-r--r--arch/powerpc/kernel/traps.c175
-rw-r--r--arch/powerpc/kernel/vio.c1
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S8
-rw-r--r--arch/powerpc/kvm/book3s_hv.c3
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S3
-rw-r--r--arch/powerpc/kvm/book3s_pr.c16
-rw-r--r--arch/powerpc/kvm/e500.c1
-rw-r--r--arch/powerpc/kvm/powerpc.c1
-rw-r--r--arch/powerpc/lib/Makefile4
-rw-r--r--arch/powerpc/lib/copyuser_64.S6
-rw-r--r--arch/powerpc/lib/copyuser_power7.S683
-rw-r--r--arch/powerpc/lib/copyuser_power7_vmx.c50
-rw-r--r--arch/powerpc/lib/feature-fixups.c23
-rw-r--r--arch/powerpc/mm/44x_mmu.c6
-rw-r--r--arch/powerpc/mm/Makefile2
-rw-r--r--arch/powerpc/mm/fault.c17
-rw-r--r--arch/powerpc/mm/hugetlbpage-book3e.c21
-rw-r--r--arch/powerpc/mm/hugetlbpage.c117
-rw-r--r--arch/powerpc/mm/icswx.c273
-rw-r--r--arch/powerpc/mm/icswx.h62
-rw-r--r--arch/powerpc/mm/icswx_pid.c87
-rw-r--r--arch/powerpc/mm/init_32.c11
-rw-r--r--arch/powerpc/mm/mem.c25
-rw-r--r--arch/powerpc/mm/mmap_64.c14
-rw-r--r--arch/powerpc/mm/mmu_context_hash64.c195
-rw-r--r--arch/powerpc/mm/numa.c74
-rw-r--r--arch/powerpc/mm/tlb_low_64e.S36
-rw-r--r--arch/powerpc/mm/tlb_nohash.c3
-rw-r--r--arch/powerpc/platforms/40x/Kconfig55
-rw-r--r--arch/powerpc/platforms/40x/ppc40x_simple.c4
-rw-r--r--arch/powerpc/platforms/44x/Kconfig32
-rw-r--r--arch/powerpc/platforms/44x/Makefile1
-rw-r--r--arch/powerpc/platforms/44x/currituck.c204
-rw-r--r--arch/powerpc/platforms/44x/iss4xx.c2
-rw-r--r--arch/powerpc/platforms/512x/Kconfig1
-rw-r--r--arch/powerpc/platforms/83xx/asp834x.c35
-rw-r--r--arch/powerpc/platforms/83xx/km83xx.c58
-rw-r--r--arch/powerpc/platforms/83xx/misc.c77
-rw-r--r--arch/powerpc/platforms/83xx/mpc830x_rdb.c40
-rw-r--r--arch/powerpc/platforms/83xx/mpc831x_rdb.c43
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c53
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c56
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c30
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c42
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c53
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_rdk.c48
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_mds.c46
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_rdb.c47
-rw-r--r--arch/powerpc/platforms/83xx/mpc83xx.h16
-rw-r--r--arch/powerpc/platforms/83xx/sbc834x.c49
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig2
-rw-r--r--arch/powerpc/platforms/85xx/Makefile2
-rw-r--r--arch/powerpc/platforms/85xx/common.c66
-rw-r--r--arch/powerpc/platforms/85xx/corenet_ds.c28
-rw-r--r--arch/powerpc/platforms/85xx/ksi8560.c69
-rw-r--r--arch/powerpc/platforms/85xx/mpc8536_ds.c38
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx.h11
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c74
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c42
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c50
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c73
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_rdb.c49
-rw-r--r--arch/powerpc/platforms/85xx/p1010rdb.c38
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c37
-rw-r--r--arch/powerpc/platforms/85xx/p1023_rds.c47
-rw-r--r--arch/powerpc/platforms/85xx/p3060_qds.c2
-rw-r--r--arch/powerpc/platforms/85xx/sbc8548.c43
-rw-r--r--arch/powerpc/platforms/85xx/sbc8560.c74
-rw-r--r--arch/powerpc/platforms/85xx/smp.c1
-rw-r--r--arch/powerpc/platforms/85xx/smp.h15
-rw-r--r--arch/powerpc/platforms/85xx/socrates.c33
-rw-r--r--arch/powerpc/platforms/85xx/stx_gp3.c73
-rw-r--r--arch/powerpc/platforms/85xx/tqm85xx.c73
-rw-r--r--arch/powerpc/platforms/85xx/xes_mpc85xx.c48
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c2
-rw-r--r--arch/powerpc/platforms/86xx/pic.c18
-rw-r--r--arch/powerpc/platforms/Kconfig8
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype25
-rw-r--r--arch/powerpc/platforms/cell/cbe_thermal.c144
-rw-r--r--arch/powerpc/platforms/cell/iommu.c2
-rw-r--r--arch/powerpc/platforms/cell/setup.c25
-rw-r--r--arch/powerpc/platforms/cell/smp.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c61
-rw-r--r--arch/powerpc/platforms/cell/spu_syscalls.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c17
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h4
-rw-r--r--arch/powerpc/platforms/cell/spufs/syscalls.c2
-rw-r--r--arch/powerpc/platforms/chrp/setup.c3
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c23
-rw-r--r--arch/powerpc/platforms/embedded6xx/linkstation.c20
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c24
-rw-r--r--arch/powerpc/platforms/embedded6xx/storcenter.c26
-rw-r--r--arch/powerpc/platforms/embedded6xx/wii.c23
-rw-r--r--arch/powerpc/platforms/iseries/setup.c12
-rw-r--r--arch/powerpc/platforms/iseries/smp.c2
-rw-r--r--arch/powerpc/platforms/maple/pci.c55
-rw-r--r--arch/powerpc/platforms/maple/setup.c2
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c4
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c2
-rw-r--r--arch/powerpc/platforms/powermac/pic.c80
-rw-r--r--arch/powerpc/platforms/powermac/setup.c8
-rw-r--r--arch/powerpc/platforms/powermac/smp.c6
-rw-r--r--arch/powerpc/platforms/powernv/Makefile2
-rw-r--r--arch/powerpc/platforms/powernv/opal-wrappers.S8
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c1330
-rw-r--r--arch/powerpc/platforms/powernv/pci-p5ioc2.c1
-rw-r--r--arch/powerpc/platforms/powernv/pci.c228
-rw-r--r--arch/powerpc/platforms/powernv/pci.h100
-rw-r--r--arch/powerpc/platforms/powernv/smp.c2
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c126
-rw-r--r--arch/powerpc/platforms/ps3/mm.c1
-rw-r--r--arch/powerpc/platforms/ps3/platform.h1
-rw-r--r--arch/powerpc/platforms/ps3/repository.c137
-rw-r--r--arch/powerpc/platforms/ps3/setup.c4
-rw-r--r--arch/powerpc/platforms/ps3/smp.c64
-rw-r--r--arch/powerpc/platforms/ps3/spu.c2
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig9
-rw-r--r--arch/powerpc/platforms/pseries/Makefile1
-rw-r--r--arch/powerpc/platforms/pseries/cmm.c67
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c4
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c61
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c6
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c7
-rw-r--r--arch/powerpc/platforms/pseries/processor_idle.c329
-rw-r--r--arch/powerpc/platforms/pseries/pseries.h3
-rw-r--r--arch/powerpc/platforms/pseries/pseries_energy.c71
-rw-r--r--arch/powerpc/platforms/pseries/setup.c109
-rw-r--r--arch/powerpc/platforms/pseries/smp.c3
-rw-r--r--arch/powerpc/platforms/pseries/suspend.c33
-rw-r--r--arch/powerpc/platforms/wsp/Kconfig12
-rw-r--r--arch/powerpc/platforms/wsp/Makefile8
-rw-r--r--arch/powerpc/platforms/wsp/chroma.c56
-rw-r--r--arch/powerpc/platforms/wsp/h8.c134
-rw-r--r--arch/powerpc/platforms/wsp/opb_pic.c3
-rw-r--r--arch/powerpc/platforms/wsp/psr2.c56
-rw-r--r--arch/powerpc/platforms/wsp/wsp.c115
-rw-r--r--arch/powerpc/platforms/wsp/wsp.h16
-rwxr-xr-xarch/powerpc/relocs_check.pl14
-rw-r--r--arch/powerpc/sysdev/Makefile3
-rw-r--r--arch/powerpc/sysdev/axonram.c1
-rw-r--r--arch/powerpc/sysdev/ehv_pic.c1
-rw-r--r--arch/powerpc/sysdev/fsl_ifc.c310
-rw-r--r--arch/powerpc/sysdev/fsl_lbc.c37
-rw-r--r--arch/powerpc/sysdev/fsl_msi.c99
-rw-r--r--arch/powerpc/sysdev/fsl_msi.h10
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c84
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c1519
-rw-r--r--arch/powerpc/sysdev/fsl_rio.h135
-rw-r--r--arch/powerpc/sysdev/fsl_rmu.c1104
-rw-r--r--arch/powerpc/sysdev/mpic.c201
-rw-r--r--arch/powerpc/sysdev/ppc4xx_cpm.c6
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c85
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.h7
-rw-r--r--arch/powerpc/sysdev/qe_lib/gpio.c42
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c2
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c12
-rw-r--r--arch/powerpc/sysdev/uic.c1
-rw-r--r--arch/powerpc/sysdev/xics/icp-hv.c47
-rw-r--r--arch/powerpc/sysdev/xics/xics-common.c2
-rw-r--r--arch/powerpc/xmon/xmon.c16
-rw-r--r--arch/s390/Kconfig7
-rw-r--r--arch/s390/appldata/appldata_os.c16
-rw-r--r--arch/s390/hypfs/inode.c14
-rw-r--r--arch/s390/include/asm/cputime.h142
-rw-r--r--arch/s390/include/asm/debug.h4
-rw-r--r--arch/s390/include/asm/kvm_host.h3
-rw-r--r--arch/s390/include/asm/pgtable.h8
-rw-r--r--arch/s390/include/asm/socket.h3
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/types.h2
-rw-r--r--arch/s390/kernel/debug.c8
-rw-r--r--arch/s390/kernel/process.c6
-rw-r--r--arch/s390/kernel/ptrace.c30
-rw-r--r--arch/s390/kernel/setup.c6
-rw-r--r--arch/s390/kernel/signal.c8
-rw-r--r--arch/s390/kernel/smp.c76
-rw-r--r--arch/s390/kernel/time.c260
-rw-r--r--arch/s390/kernel/topology.c6
-rw-r--r--arch/s390/kvm/diag.c2
-rw-r--r--arch/s390/kvm/intercept.c3
-rw-r--r--arch/s390/kvm/interrupt.c1
-rw-r--r--arch/s390/kvm/kvm-s390.c12
-rw-r--r--arch/s390/kvm/priv.c10
-rw-r--r--arch/s390/kvm/sigp.c45
-rw-r--r--arch/s390/oprofile/hwsampler.c7
-rw-r--r--arch/s390/oprofile/init.c375
-rw-r--r--arch/s390/oprofile/op_counter.h23
-rw-r--r--arch/score/Kconfig6
-rw-r--r--arch/score/kernel/setup.c4
-rw-r--r--arch/sh/Kconfig1
-rw-r--r--arch/sh/boards/board-sh7757lcr.c16
-rw-r--r--arch/sh/drivers/dma/dma-sysfs.c81
-rw-r--r--arch/sh/include/asm/dma.h4
-rw-r--r--arch/sh/include/asm/memblock.h4
-rw-r--r--arch/sh/include/asm/thread_info.h2
-rw-r--r--arch/sh/kernel/cpu/sh4/sq.c24
-rw-r--r--arch/sh/kernel/idle.c6
-rw-r--r--arch/sh/kernel/machine_kexec.c3
-rw-r--r--arch/sh/kernel/setup.c3
-rw-r--r--arch/sh/mm/Kconfig3
-rw-r--r--arch/sh/mm/init.c3
-rw-r--r--arch/sh/oprofile/common.c4
-rw-r--r--arch/sparc/Kconfig4
-rw-r--r--arch/sparc/include/asm/memblock.h8
-rw-r--r--arch/sparc/include/asm/pgtable_32.h20
-rw-r--r--arch/sparc/include/asm/pgtable_64.h20
-rw-r--r--arch/sparc/include/asm/posix_types.h2
-rw-r--r--arch/sparc/include/asm/socket.h3
-rw-r--r--arch/sparc/include/asm/thread_info_32.h2
-rw-r--r--arch/sparc/include/asm/thread_info_64.h2
-rw-r--r--arch/sparc/include/asm/types.h6
-rw-r--r--arch/sparc/kernel/ds.c6
-rw-r--r--arch/sparc/kernel/entry.h7
-rw-r--r--arch/sparc/kernel/module.c27
-rw-r--r--arch/sparc/kernel/pci_sun4v.c4
-rw-r--r--arch/sparc/kernel/process_64.c6
-rw-r--r--arch/sparc/kernel/prom_common.c4
-rw-r--r--arch/sparc/kernel/setup_32.c2
-rw-r--r--arch/sparc/kernel/setup_64.c48
-rw-r--r--arch/sparc/kernel/signal32.c18
-rw-r--r--arch/sparc/kernel/signal_32.c30
-rw-r--r--arch/sparc/kernel/signal_64.c42
-rw-r--r--arch/sparc/kernel/sigutil_64.c1
-rw-r--r--arch/sparc/kernel/smp_64.c2
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c6
-rw-r--r--arch/sparc/kernel/sysfs.c122
-rw-r--r--arch/sparc/mm/Makefile1
-rw-r--r--arch/sparc/mm/btfixup.c3
-rw-r--r--arch/sparc/mm/generic_32.c99
-rw-r--r--arch/sparc/mm/generic_64.c165
-rw-r--r--arch/sparc/mm/init_64.c32
-rw-r--r--arch/tile/include/asm/irq.h10
-rw-r--r--arch/tile/kernel/irq.c16
-rw-r--r--arch/tile/kernel/pci-dma.c1
-rw-r--r--arch/tile/kernel/pci.c1
-rw-r--r--arch/tile/kernel/process.c6
-rw-r--r--arch/tile/kernel/sysfs.c62
-rw-r--r--arch/tile/lib/exports.c3
-rw-r--r--arch/tile/mm/fault.c4
-rw-r--r--arch/tile/mm/homecache.c9
-rw-r--r--arch/um/include/asm/thread_info.h2
-rw-r--r--arch/um/kernel/process.c6
-rw-r--r--arch/um/kernel/time.c6
-rw-r--r--arch/unicore32/Kconfig4
-rw-r--r--arch/unicore32/Kconfig.debug14
-rw-r--r--arch/unicore32/boot/compressed/Makefile4
-rw-r--r--arch/unicore32/include/asm/bitops.h12
-rw-r--r--arch/unicore32/include/asm/processor.h1
-rw-r--r--arch/unicore32/include/asm/thread_info.h2
-rw-r--r--arch/unicore32/kernel/ksyms.c4
-rw-r--r--arch/unicore32/kernel/process.c6
-rw-r--r--arch/unicore32/kernel/puv3-core.c1
-rw-r--r--arch/unicore32/kernel/puv3-nb0916.c1
-rw-r--r--arch/unicore32/kernel/setup.c1
-rw-r--r--arch/unicore32/lib/findbit.S14
-rw-r--r--arch/unicore32/mm/init.c4
-rw-r--r--arch/unicore32/mm/mmu.c1
-rw-r--r--arch/x86/Kconfig28
-rw-r--r--arch/x86/ia32/ia32entry.S43
-rw-r--r--arch/x86/include/asm/alternative-asm.h4
-rw-r--r--arch/x86/include/asm/apic.h7
-rw-r--r--arch/x86/include/asm/apic_flat_64.h7
-rw-r--r--arch/x86/include/asm/apicdef.h1
-rw-r--r--arch/x86/include/asm/bitops.h76
-rw-r--r--arch/x86/include/asm/cmpxchg.h163
-rw-r--r--arch/x86/include/asm/cmpxchg_32.h46
-rw-r--r--arch/x86/include/asm/cmpxchg_64.h43
-rw-r--r--arch/x86/include/asm/div64.h22
-rw-r--r--arch/x86/include/asm/e820.h2
-rw-r--r--arch/x86/include/asm/hardirq.h1
-rw-r--r--arch/x86/include/asm/i387.h2
-rw-r--r--arch/x86/include/asm/insn.h7
-rw-r--r--arch/x86/include/asm/intel_scu_ipc.h14
-rw-r--r--arch/x86/include/asm/mach_timer.h2
-rw-r--r--arch/x86/include/asm/mach_traps.h2
-rw-r--r--arch/x86/include/asm/mc146818rtc.h4
-rw-r--r--arch/x86/include/asm/mce.h19
-rw-r--r--arch/x86/include/asm/memblock.h23
-rw-r--r--arch/x86/include/asm/microcode.h2
-rw-r--r--arch/x86/include/asm/mrst.h16
-rw-r--r--arch/x86/include/asm/msr.h9
-rw-r--r--arch/x86/include/asm/numachip/numachip_csr.h167
-rw-r--r--arch/x86/include/asm/percpu.h53
-rw-r--r--arch/x86/include/asm/perf_event.h44
-rw-r--r--arch/x86/include/asm/pgtable.h2
-rw-r--r--arch/x86/include/asm/processor-flags.h1
-rw-r--r--arch/x86/include/asm/processor.h2
-rw-r--r--arch/x86/include/asm/spinlock.h15
-rw-r--r--arch/x86/include/asm/system.h1
-rw-r--r--arch/x86/include/asm/thread_info.h11
-rw-r--r--arch/x86/include/asm/timer.h23
-rw-r--r--arch/x86/include/asm/topology.h2
-rw-r--r--arch/x86/include/asm/tsc.h2
-rw-r--r--arch/x86/include/asm/uaccess.h2
-rw-r--r--arch/x86/include/asm/uv/uv_mmrs.h1
-rw-r--r--arch/x86/include/asm/x86_init.h6
-rw-r--r--arch/x86/kernel/acpi/boot.c10
-rw-r--r--arch/x86/kernel/alternative.c2
-rw-r--r--arch/x86/kernel/amd_nb.c8
-rw-r--r--arch/x86/kernel/aperture_64.c4
-rw-r--r--arch/x86/kernel/apic/Makefile1
-rw-r--r--arch/x86/kernel/apic/apic.c146
-rw-r--r--arch/x86/kernel/apic/apic_flat_64.c9
-rw-r--r--arch/x86/kernel/apic/apic_numachip.c294
-rw-r--r--arch/x86/kernel/apic/io_apic.c15
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c2
-rw-r--r--arch/x86/kernel/check.c34
-rw-r--r--arch/x86/kernel/cpu/amd.c17
-rw-r--r--arch/x86/kernel/cpu/centaur.c2
-rw-r--r--arch/x86/kernel/cpu/common.c14
-rw-r--r--arch/x86/kernel/cpu/cpu.h5
-rw-r--r--arch/x86/kernel/cpu/intel.c2
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c25
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-inject.c36
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-internal.h4
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c219
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c18
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c94
-rw-r--r--arch/x86/kernel/cpu/mcheck/threshold.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c2
-rw-r--r--arch/x86/kernel/cpu/perf_event.c278
-rw-r--r--arch/x86/kernel/cpu/perf_event.h51
-rw-r--r--arch/x86/kernel/cpu/perf_event_amd.c2
-rw-r--r--arch/x86/kernel/cpu/perf_event_amd_ibs.c29
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c94
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_ds.c6
-rw-r--r--arch/x86/kernel/cpu/perf_event_p4.c2
-rw-r--r--arch/x86/kernel/cpu/powerflags.c3
-rw-r--r--arch/x86/kernel/cpu/proc.c4
-rw-r--r--arch/x86/kernel/cpuid.c2
-rw-r--r--arch/x86/kernel/dumpstack_32.c8
-rw-r--r--arch/x86/kernel/dumpstack_64.c8
-rw-r--r--arch/x86/kernel/e820.c58
-rw-r--r--arch/x86/kernel/entry_32.S4
-rw-r--r--arch/x86/kernel/entry_64.S31
-rw-r--r--arch/x86/kernel/head.c2
-rw-r--r--arch/x86/kernel/head32.c7
-rw-r--r--arch/x86/kernel/head64.c7
-rw-r--r--arch/x86/kernel/hpet.c29
-rw-r--r--arch/x86/kernel/irq.c11
-rw-r--r--arch/x86/kernel/irq_64.c3
-rw-r--r--arch/x86/kernel/irqinit.c2
-rw-r--r--arch/x86/kernel/jump_label.c2
-rw-r--r--arch/x86/kernel/kvmclock.c5
-rw-r--r--arch/x86/kernel/microcode_amd.c209
-rw-r--r--arch/x86/kernel/microcode_core.c91
-rw-r--r--arch/x86/kernel/mpparse.c14
-rw-r--r--arch/x86/kernel/msr.c2
-rw-r--r--arch/x86/kernel/nmi.c3
-rw-r--r--arch/x86/kernel/process.c10
-rw-r--r--arch/x86/kernel/process_32.c6
-rw-r--r--arch/x86/kernel/process_64.c15
-rw-r--r--arch/x86/kernel/ptrace.c3
-rw-r--r--arch/x86/kernel/quirks.c13
-rw-r--r--arch/x86/kernel/reboot.c21
-rw-r--r--arch/x86/kernel/rtc.c5
-rw-r--r--arch/x86/kernel/setup.c23
-rw-r--r--arch/x86/kernel/smpboot.c3
-rw-r--r--arch/x86/kernel/trampoline.c4
-rw-r--r--arch/x86/kernel/traps.c7
-rw-r--r--arch/x86/kernel/tsc.c6
-rw-r--r--arch/x86/kernel/tsc_sync.c4
-rw-r--r--arch/x86/kernel/vsyscall_64.c77
-rw-r--r--arch/x86/kernel/x86_init.c5
-rw-r--r--arch/x86/kvm/i8254.c10
-rw-r--r--arch/x86/kvm/vmx.c131
-rw-r--r--arch/x86/kvm/x86.c19
-rw-r--r--arch/x86/lib/inat.c9
-rw-r--r--arch/x86/lib/insn.c4
-rw-r--r--arch/x86/lib/string_32.c8
-rw-r--r--arch/x86/lib/x86-opcode-map.txt606
-rw-r--r--arch/x86/mm/Makefile2
-rw-r--r--arch/x86/mm/extable.c2
-rw-r--r--arch/x86/mm/fault.c22
-rw-r--r--arch/x86/mm/gup.c2
-rw-r--r--arch/x86/mm/highmem_32.c2
-rw-r--r--arch/x86/mm/init.c8
-rw-r--r--arch/x86/mm/init_32.c36
-rw-r--r--arch/x86/mm/init_64.c2
-rw-r--r--arch/x86/mm/memblock.c348
-rw-r--r--arch/x86/mm/memtest.c33
-rw-r--r--arch/x86/mm/numa.c37
-rw-r--r--arch/x86/mm/numa_32.c10
-rw-r--r--arch/x86/mm/numa_64.c2
-rw-r--r--arch/x86/mm/numa_emulation.c36
-rw-r--r--arch/x86/mm/pageattr.c2
-rw-r--r--arch/x86/mm/srat.c7
-rw-r--r--arch/x86/net/bpf_jit_comp.c4
-rw-r--r--arch/x86/oprofile/Makefile3
-rw-r--r--arch/x86/oprofile/init.c25
-rw-r--r--arch/x86/oprofile/nmi_int.c27
-rw-r--r--arch/x86/oprofile/nmi_timer_int.c50
-rw-r--r--arch/x86/pci/pcbios.c2
-rw-r--r--arch/x86/platform/efi/efi.c12
-rw-r--r--arch/x86/platform/efi/efi_32.c48
-rw-r--r--arch/x86/platform/mrst/mrst.c108
-rw-r--r--arch/x86/platform/uv/uv_sysfs.c2
-rw-r--r--arch/x86/tools/Makefile11
-rw-r--r--arch/x86/tools/gen-insn-attr-x86.awk21
-rw-r--r--arch/x86/tools/insn_sanity.c275
-rw-r--r--arch/x86/um/asm/processor.h2
-rw-r--r--arch/x86/xen/debugfs.c2
-rw-r--r--arch/x86/xen/debugfs.h2
-rw-r--r--arch/x86/xen/enlighten.c5
-rw-r--r--arch/x86/xen/grant-table.c2
-rw-r--r--arch/x86/xen/mmu.c12
-rw-r--r--arch/x86/xen/setup.c27
-rw-r--r--arch/xtensa/include/asm/socket.h3
-rw-r--r--arch/xtensa/include/asm/thread_info.h2
-rw-r--r--arch/xtensa/include/asm/types.h2
-rw-r--r--arch/xtensa/kernel/time.c13
1951 files changed, 38534 insertions, 33000 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 4b0669cbb3b0..2505740b81d2 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -30,6 +30,10 @@ config OPROFILE_EVENT_MULTIPLEX
30config HAVE_OPROFILE 30config HAVE_OPROFILE
31 bool 31 bool
32 32
33config OPROFILE_NMI_TIMER
34 def_bool y
35 depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI
36
33config KPROBES 37config KPROBES
34 bool "Kprobes" 38 bool "Kprobes"
35 depends on MODULES 39 depends on MODULES
diff --git a/arch/alpha/include/asm/ipcbuf.h b/arch/alpha/include/asm/ipcbuf.h
index d9c0e1a50702..84c7e51cb6d0 100644
--- a/arch/alpha/include/asm/ipcbuf.h
+++ b/arch/alpha/include/asm/ipcbuf.h
@@ -1,28 +1 @@
1#ifndef _ALPHA_IPCBUF_H #include <asm-generic/ipcbuf.h>
2#define _ALPHA_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for alpha architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit seq
11 * - 2 miscellaneous 64-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid_t uid;
18 __kernel_gid_t gid;
19 __kernel_uid_t cuid;
20 __kernel_gid_t cgid;
21 __kernel_mode_t mode;
22 unsigned short seq;
23 unsigned short __pad1;
24 unsigned long __unused1;
25 unsigned long __unused2;
26};
27
28#endif /* _ALPHA_IPCBUF_H */
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h
index 06edfefc3373..082355f159e6 100644
--- a/arch/alpha/include/asm/socket.h
+++ b/arch/alpha/include/asm/socket.h
@@ -69,6 +69,9 @@
69 69
70#define SO_RXQ_OVFL 40 70#define SO_RXQ_OVFL 40
71 71
72#define SO_WIFI_STATUS 41
73#define SCM_WIFI_STATUS SO_WIFI_STATUS
74
72/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 75/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
73 * have to define SOCK_NONBLOCK to a different value here. 76 * have to define SOCK_NONBLOCK to a different value here.
74 */ 77 */
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index ff73db022342..28335bd40e40 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -79,7 +79,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
79#define TIF_UAC_SIGBUS 12 /* ! userspace part of 'osf_sysinfo' */ 79#define TIF_UAC_SIGBUS 12 /* ! userspace part of 'osf_sysinfo' */
80#define TIF_MEMDIE 13 /* is terminating due to OOM killer */ 80#define TIF_MEMDIE 13 /* is terminating due to OOM killer */
81#define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */ 81#define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */
82#define TIF_FREEZE 16 /* is freezing for suspend */
83 82
84#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 83#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
85#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 84#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
@@ -87,7 +86,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
87#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 86#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
88#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 87#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
89#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 88#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
90#define _TIF_FREEZE (1<<TIF_FREEZE)
91 89
92/* Work to do on interrupt/exception return. */ 90/* Work to do on interrupt/exception return. */
93#define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ 91#define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
diff --git a/arch/alpha/include/asm/types.h b/arch/alpha/include/asm/types.h
index 881544339c21..0a0579076f4a 100644
--- a/arch/alpha/include/asm/types.h
+++ b/arch/alpha/include/asm/types.h
@@ -15,9 +15,4 @@
15#include <asm-generic/int-l64.h> 15#include <asm-generic/int-l64.h>
16#endif 16#endif
17 17
18#ifndef __ASSEMBLY__
19
20typedef unsigned int umode_t;
21
22#endif /* __ASSEMBLY__ */
23#endif /* _ALPHA_TYPES_H */ 18#endif /* _ALPHA_TYPES_H */
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 44789eff983f..f72e1707d463 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -220,8 +220,9 @@ config NEED_MACH_MEMORY_H
220 be avoided when possible. 220 be avoided when possible.
221 221
222config PHYS_OFFSET 222config PHYS_OFFSET
223 hex "Physical address of main memory" 223 hex "Physical address of main memory" if MMU
224 depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H 224 depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
225 default DRAM_BASE if !MMU
225 help 226 help
226 Please provide the physical address corresponding to the 227 Please provide the physical address corresponding to the
227 location of main memory in your system. 228 location of main memory in your system.
@@ -257,6 +258,7 @@ config ARCH_INTEGRATOR
257 select ARCH_HAS_CPUFREQ 258 select ARCH_HAS_CPUFREQ
258 select CLKDEV_LOOKUP 259 select CLKDEV_LOOKUP
259 select HAVE_MACH_CLKDEV 260 select HAVE_MACH_CLKDEV
261 select HAVE_TCM
260 select ICST 262 select ICST
261 select GENERIC_CLOCKEVENTS 263 select GENERIC_CLOCKEVENTS
262 select PLAT_VERSATILE 264 select PLAT_VERSATILE
@@ -340,10 +342,12 @@ config ARCH_HIGHBANK
340 select ARM_AMBA 342 select ARM_AMBA
341 select ARM_GIC 343 select ARM_GIC
342 select ARM_TIMER_SP804 344 select ARM_TIMER_SP804
345 select CACHE_L2X0
343 select CLKDEV_LOOKUP 346 select CLKDEV_LOOKUP
344 select CPU_V7 347 select CPU_V7
345 select GENERIC_CLOCKEVENTS 348 select GENERIC_CLOCKEVENTS
346 select HAVE_ARM_SCU 349 select HAVE_ARM_SCU
350 select HAVE_SMP
347 select USE_OF 351 select USE_OF
348 help 352 help
349 Support for the Calxeda Highbank SoC based boards. 353 Support for the Calxeda Highbank SoC based boards.
@@ -361,6 +365,7 @@ config ARCH_CNS3XXX
361 select CPU_V6K 365 select CPU_V6K
362 select GENERIC_CLOCKEVENTS 366 select GENERIC_CLOCKEVENTS
363 select ARM_GIC 367 select ARM_GIC
368 select MIGHT_HAVE_CACHE_L2X0
364 select MIGHT_HAVE_PCI 369 select MIGHT_HAVE_PCI
365 select PCI_DOMAINS if PCI 370 select PCI_DOMAINS if PCI
366 help 371 help
@@ -381,6 +386,7 @@ config ARCH_PRIMA2
381 select GENERIC_CLOCKEVENTS 386 select GENERIC_CLOCKEVENTS
382 select CLKDEV_LOOKUP 387 select CLKDEV_LOOKUP
383 select GENERIC_IRQ_CHIP 388 select GENERIC_IRQ_CHIP
389 select MIGHT_HAVE_CACHE_L2X0
384 select USE_OF 390 select USE_OF
385 select ZONE_DMA 391 select ZONE_DMA
386 help 392 help
@@ -633,6 +639,8 @@ config ARCH_TEGRA
633 select GENERIC_GPIO 639 select GENERIC_GPIO
634 select HAVE_CLK 640 select HAVE_CLK
635 select HAVE_SCHED_CLOCK 641 select HAVE_SCHED_CLOCK
642 select HAVE_SMP
643 select MIGHT_HAVE_CACHE_L2X0
636 select ARCH_HAS_CPUFREQ 644 select ARCH_HAS_CPUFREQ
637 help 645 help
638 This enables support for NVIDIA Tegra based systems (Tegra APX, 646 This enables support for NVIDIA Tegra based systems (Tegra APX,
@@ -702,7 +710,9 @@ config ARCH_SHMOBILE
702 select HAVE_CLK 710 select HAVE_CLK
703 select CLKDEV_LOOKUP 711 select CLKDEV_LOOKUP
704 select HAVE_MACH_CLKDEV 712 select HAVE_MACH_CLKDEV
713 select HAVE_SMP
705 select GENERIC_CLOCKEVENTS 714 select GENERIC_CLOCKEVENTS
715 select MIGHT_HAVE_CACHE_L2X0
706 select NO_IOPORT 716 select NO_IOPORT
707 select SPARSE_IRQ 717 select SPARSE_IRQ
708 select MULTI_IRQ_HANDLER 718 select MULTI_IRQ_HANDLER
@@ -867,16 +877,6 @@ config ARCH_SHARK
867 Support for the StrongARM based Digital DNARD machine, also known 877 Support for the StrongARM based Digital DNARD machine, also known
868 as "Shark" (<http://www.shark-linux.de/shark.html>). 878 as "Shark" (<http://www.shark-linux.de/shark.html>).
869 879
870config ARCH_TCC_926
871 bool "Telechips TCC ARM926-based systems"
872 select CLKSRC_MMIO
873 select CPU_ARM926T
874 select HAVE_CLK
875 select CLKDEV_LOOKUP
876 select GENERIC_CLOCKEVENTS
877 help
878 Support for Telechips TCC ARM926-based systems.
879
880config ARCH_U300 880config ARCH_U300
881 bool "ST-Ericsson U300 Series" 881 bool "ST-Ericsson U300 Series"
882 depends on MMU 882 depends on MMU
@@ -904,6 +904,8 @@ config ARCH_U8500
904 select CLKDEV_LOOKUP 904 select CLKDEV_LOOKUP
905 select ARCH_REQUIRE_GPIOLIB 905 select ARCH_REQUIRE_GPIOLIB
906 select ARCH_HAS_CPUFREQ 906 select ARCH_HAS_CPUFREQ
907 select HAVE_SMP
908 select MIGHT_HAVE_CACHE_L2X0
907 help 909 help
908 Support for ST-Ericsson's Ux500 architecture 910 Support for ST-Ericsson's Ux500 architecture
909 911
@@ -914,6 +916,7 @@ config ARCH_NOMADIK
914 select CPU_ARM926T 916 select CPU_ARM926T
915 select CLKDEV_LOOKUP 917 select CLKDEV_LOOKUP
916 select GENERIC_CLOCKEVENTS 918 select GENERIC_CLOCKEVENTS
919 select MIGHT_HAVE_CACHE_L2X0
917 select ARCH_REQUIRE_GPIOLIB 920 select ARCH_REQUIRE_GPIOLIB
918 help 921 help
919 Support for the Nomadik platform by ST-Ericsson 922 Support for the Nomadik platform by ST-Ericsson
@@ -973,6 +976,7 @@ config ARCH_ZYNQ
973 select ARM_GIC 976 select ARM_GIC
974 select ARM_AMBA 977 select ARM_AMBA
975 select ICST 978 select ICST
979 select MIGHT_HAVE_CACHE_L2X0
976 select USE_OF 980 select USE_OF
977 help 981 help
978 Support for Xilinx Zynq ARM Cortex A9 Platform 982 Support for Xilinx Zynq ARM Cortex A9 Platform
@@ -1059,8 +1063,6 @@ source "arch/arm/plat-s5p/Kconfig"
1059 1063
1060source "arch/arm/plat-spear/Kconfig" 1064source "arch/arm/plat-spear/Kconfig"
1061 1065
1062source "arch/arm/plat-tcc/Kconfig"
1063
1064if ARCH_S3C2410 1066if ARCH_S3C2410
1065source "arch/arm/mach-s3c2410/Kconfig" 1067source "arch/arm/mach-s3c2410/Kconfig"
1066source "arch/arm/mach-s3c2412/Kconfig" 1068source "arch/arm/mach-s3c2412/Kconfig"
@@ -1125,6 +1127,11 @@ config ARM_TIMER_SP804
1125 1127
1126source arch/arm/mm/Kconfig 1128source arch/arm/mm/Kconfig
1127 1129
1130config ARM_NR_BANKS
1131 int
1132 default 16 if ARCH_EP93XX
1133 default 8
1134
1128config IWMMXT 1135config IWMMXT
1129 bool "Enable iWMMXt support" 1136 bool "Enable iWMMXt support"
1130 depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 1137 depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4
@@ -1133,10 +1140,9 @@ config IWMMXT
1133 Enable support for iWMMXt context switching at run time if 1140 Enable support for iWMMXt context switching at run time if
1134 running on a CPU that supports it. 1141 running on a CPU that supports it.
1135 1142
1136# bool 'Use XScale PMU as timer source' CONFIG_XSCALE_PMU_TIMER
1137config XSCALE_PMU 1143config XSCALE_PMU
1138 bool 1144 bool
1139 depends on CPU_XSCALE && !XSCALE_PMU_TIMER 1145 depends on CPU_XSCALE
1140 default y 1146 default y
1141 1147
1142config CPU_HAS_PMU 1148config CPU_HAS_PMU
@@ -1231,7 +1237,7 @@ config ARM_ERRATA_742231
1231 capabilities of the processor. 1237 capabilities of the processor.
1232 1238
1233config PL310_ERRATA_588369 1239config PL310_ERRATA_588369
1234 bool "Clean & Invalidate maintenance operations do not invalidate clean lines" 1240 bool "PL310 errata: Clean & Invalidate maintenance operations do not invalidate clean lines"
1235 depends on CACHE_L2X0 1241 depends on CACHE_L2X0
1236 help 1242 help
1237 The PL310 L2 cache controller implements three types of Clean & 1243 The PL310 L2 cache controller implements three types of Clean &
@@ -1245,7 +1251,7 @@ config PL310_ERRATA_588369
1245 1251
1246config ARM_ERRATA_720789 1252config ARM_ERRATA_720789
1247 bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID" 1253 bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID"
1248 depends on CPU_V7 && SMP 1254 depends on CPU_V7
1249 help 1255 help
1250 This option enables the workaround for the 720789 Cortex-A9 (prior to 1256 This option enables the workaround for the 720789 Cortex-A9 (prior to
1251 r2p0) erratum. A faulty ASID can be sent to the other CPUs for the 1257 r2p0) erratum. A faulty ASID can be sent to the other CPUs for the
@@ -1256,7 +1262,7 @@ config ARM_ERRATA_720789
1256 entries regardless of the ASID. 1262 entries regardless of the ASID.
1257 1263
1258config PL310_ERRATA_727915 1264config PL310_ERRATA_727915
1259 bool "Background Clean & Invalidate by Way operation can cause data corruption" 1265 bool "PL310 errata: Background Clean & Invalidate by Way operation can cause data corruption"
1260 depends on CACHE_L2X0 1266 depends on CACHE_L2X0
1261 help 1267 help
1262 PL310 implements the Clean & Invalidate by Way L2 cache maintenance 1268 PL310 implements the Clean & Invalidate by Way L2 cache maintenance
@@ -1281,7 +1287,7 @@ config ARM_ERRATA_743622
1281 1287
1282config ARM_ERRATA_751472 1288config ARM_ERRATA_751472
1283 bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation" 1289 bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation"
1284 depends on CPU_V7 && SMP 1290 depends on CPU_V7
1285 help 1291 help
1286 This option enables the workaround for the 751472 Cortex-A9 (prior 1292 This option enables the workaround for the 751472 Cortex-A9 (prior
1287 to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the 1293 to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the
@@ -1289,8 +1295,8 @@ config ARM_ERRATA_751472
1289 operation is received by a CPU before the ICIALLUIS has completed, 1295 operation is received by a CPU before the ICIALLUIS has completed,
1290 potentially leading to corrupted entries in the cache or TLB. 1296 potentially leading to corrupted entries in the cache or TLB.
1291 1297
1292config ARM_ERRATA_753970 1298config PL310_ERRATA_753970
1293 bool "ARM errata: cache sync operation may be faulty" 1299 bool "PL310 errata: cache sync operation may be faulty"
1294 depends on CACHE_PL310 1300 depends on CACHE_PL310
1295 help 1301 help
1296 This option enables the workaround for the 753970 PL310 (r3p0) erratum. 1302 This option enables the workaround for the 753970 PL310 (r3p0) erratum.
@@ -1352,6 +1358,18 @@ config ARM_ERRATA_764369
1352 relevant cache maintenance functions and sets a specific bit 1358 relevant cache maintenance functions and sets a specific bit
1353 in the diagnostic control register of the SCU. 1359 in the diagnostic control register of the SCU.
1354 1360
1361config PL310_ERRATA_769419
1362 bool "PL310 errata: no automatic Store Buffer drain"
1363 depends on CACHE_L2X0
1364 help
1365 On revisions of the PL310 prior to r3p2, the Store Buffer does
1366 not automatically drain. This can cause normal, non-cacheable
1367 writes to be retained when the memory system is idle, leading
1368 to suboptimal I/O performance for drivers using coherent DMA.
1369 This option adds a write barrier to the cpu_idle loop so that,
1370 on systems with an outer cache, the store buffer is drained
1371 explicitly.
1372
1355endmenu 1373endmenu
1356 1374
1357source "arch/arm/common/Kconfig" 1375source "arch/arm/common/Kconfig"
@@ -1422,14 +1440,20 @@ menu "Kernel Features"
1422 1440
1423source "kernel/time/Kconfig" 1441source "kernel/time/Kconfig"
1424 1442
1443config HAVE_SMP
1444 bool
1445 help
1446 This option should be selected by machines which have an SMP-
1447 capable CPU.
1448
1449 The only effect of this option is to make the SMP-related
1450 options available to the user for configuration.
1451
1425config SMP 1452config SMP
1426 bool "Symmetric Multi-Processing" 1453 bool "Symmetric Multi-Processing"
1427 depends on CPU_V6K || CPU_V7 1454 depends on CPU_V6K || CPU_V7
1428 depends on GENERIC_CLOCKEVENTS 1455 depends on GENERIC_CLOCKEVENTS
1429 depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \ 1456 depends on HAVE_SMP
1430 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
1431 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \
1432 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE || ARCH_HIGHBANK || SOC_IMX6Q
1433 depends on MMU 1457 depends on MMU
1434 select USE_GENERIC_SMP_HELPERS 1458 select USE_GENERIC_SMP_HELPERS
1435 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP 1459 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
@@ -1547,6 +1571,16 @@ config LOCAL_TIMERS
1547 accounting to be spread across the timer interval, preventing a 1571 accounting to be spread across the timer interval, preventing a
1548 "thundering herd" at every timer tick. 1572 "thundering herd" at every timer tick.
1549 1573
1574config ARCH_NR_GPIO
1575 int
1576 default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
1577 default 350 if ARCH_U8500
1578 default 0
1579 help
1580 Maximum number of GPIOs in the system.
1581
1582 If unsure, leave the default value.
1583
1550source kernel/Kconfig.preempt 1584source kernel/Kconfig.preempt
1551 1585
1552config HZ 1586config HZ
@@ -1959,7 +1993,7 @@ endchoice
1959 1993
1960config XIP_KERNEL 1994config XIP_KERNEL
1961 bool "Kernel Execute-In-Place from ROM" 1995 bool "Kernel Execute-In-Place from ROM"
1962 depends on !ZBOOT_ROM 1996 depends on !ZBOOT_ROM && !ARM_LPAE
1963 help 1997 help
1964 Execute-In-Place allows the kernel to run from non-volatile storage 1998 Execute-In-Place allows the kernel to run from non-volatile storage
1965 directly addressable by the CPU, such as NOR flash. This saves RAM 1999 directly addressable by the CPU, such as NOR flash. This saves RAM
@@ -1989,7 +2023,7 @@ config XIP_PHYS_ADDR
1989 2023
1990config KEXEC 2024config KEXEC
1991 bool "Kexec system call (EXPERIMENTAL)" 2025 bool "Kexec system call (EXPERIMENTAL)"
1992 depends on EXPERIMENTAL 2026 depends on EXPERIMENTAL && (!SMP || HOTPLUG_CPU)
1993 help 2027 help
1994 kexec is a system call that implements the ability to shutdown your 2028 kexec is a system call that implements the ability to shutdown your
1995 current kernel, and to start another kernel. It is like a reboot 2029 current kernel, and to start another kernel. It is like a reboot
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index dfcf3b033e10..40319d91bb7f 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -184,7 +184,6 @@ machine-$(CONFIG_ARCH_EXYNOS4) := exynos
184machine-$(CONFIG_ARCH_SA1100) := sa1100 184machine-$(CONFIG_ARCH_SA1100) := sa1100
185machine-$(CONFIG_ARCH_SHARK) := shark 185machine-$(CONFIG_ARCH_SHARK) := shark
186machine-$(CONFIG_ARCH_SHMOBILE) := shmobile 186machine-$(CONFIG_ARCH_SHMOBILE) := shmobile
187machine-$(CONFIG_ARCH_TCC8K) := tcc8k
188machine-$(CONFIG_ARCH_TEGRA) := tegra 187machine-$(CONFIG_ARCH_TEGRA) := tegra
189machine-$(CONFIG_ARCH_U300) := u300 188machine-$(CONFIG_ARCH_U300) := u300
190machine-$(CONFIG_ARCH_U8500) := ux500 189machine-$(CONFIG_ARCH_U8500) := ux500
@@ -204,7 +203,6 @@ machine-$(CONFIG_ARCH_ZYNQ) := zynq
204plat-$(CONFIG_ARCH_MXC) := mxc 203plat-$(CONFIG_ARCH_MXC) := mxc
205plat-$(CONFIG_ARCH_OMAP) := omap 204plat-$(CONFIG_ARCH_OMAP) := omap
206plat-$(CONFIG_ARCH_S3C64XX) := samsung 205plat-$(CONFIG_ARCH_S3C64XX) := samsung
207plat-$(CONFIG_ARCH_TCC_926) := tcc
208plat-$(CONFIG_ARCH_ZYNQ) := versatile 206plat-$(CONFIG_ARCH_ZYNQ) := versatile
209plat-$(CONFIG_PLAT_IOP) := iop 207plat-$(CONFIG_PLAT_IOP) := iop
210plat-$(CONFIG_PLAT_NOMADIK) := nomadik 208plat-$(CONFIG_PLAT_NOMADIK) := nomadik
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 176062ac7f07..5df26a9976a2 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -65,6 +65,8 @@ $(obj)/%.dtb: $(src)/dts/%.dts
65 65
66$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) 66$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
67 67
68clean-files := *.dtb
69
68quiet_cmd_uimage = UIMAGE $@ 70quiet_cmd_uimage = UIMAGE $@
69 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ 71 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
70 -C none -a $(LOADADDR) -e $(STARTADDR) \ 72 -C none -a $(LOADADDR) -e $(STARTADDR) \
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 21f56ff32797..cf0a64ce4b83 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -126,7 +126,8 @@ ccflags-y := -fpic -fno-builtin -I$(obj)
126asflags-y := -Wa,-march=all 126asflags-y := -Wa,-march=all
127 127
128# Supply kernel BSS size to the decompressor via a linker symbol. 128# Supply kernel BSS size to the decompressor via a linker symbol.
129KBSS_SZ = $(shell size $(obj)/../../../../vmlinux | awk 'END{print $$3}') 129KBSS_SZ = $(shell $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \
130 awk 'END{print $$3}')
130LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) 131LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
131# Supply ZRELADDR to the decompressor via a linker symbol. 132# Supply ZRELADDR to the decompressor via a linker symbol.
132ifneq ($(CONFIG_AUTO_ZRELADDR),y) 133ifneq ($(CONFIG_AUTO_ZRELADDR),y)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index c2effc917254..c5d60250d43d 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -659,6 +659,7 @@ __armv7_mmu_cache_on:
659 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer 659 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer
660 mcrne p15, 0, r1, c3, c0, 0 @ load domain access control 660 mcrne p15, 0, r1, c3, c0, 0 @ load domain access control
661#endif 661#endif
662 mcr p15, 0, r0, c7, c5, 4 @ ISB
662 mcr p15, 0, r0, c1, c0, 0 @ load control register 663 mcr p15, 0, r0, c1, c0, 0 @ load control register
663 mrc p15, 0, r0, c1, c0, 0 @ and read it back 664 mrc p15, 0, r0, c1, c0, 0 @ and read it back
664 mov r0, #0 665 mov r0, #0
diff --git a/arch/arm/boot/dts/testcases/tests-phandle.dtsi b/arch/arm/boot/dts/testcases/tests-phandle.dtsi
new file mode 100644
index 000000000000..ec0c4e6212c9
--- /dev/null
+++ b/arch/arm/boot/dts/testcases/tests-phandle.dtsi
@@ -0,0 +1,37 @@
1
2/ {
3 testcase-data {
4 phandle-tests {
5 provider0: provider0 {
6 #phandle-cells = <0>;
7 };
8
9 provider1: provider1 {
10 #phandle-cells = <1>;
11 };
12
13 provider2: provider2 {
14 #phandle-cells = <2>;
15 };
16
17 provider3: provider3 {
18 #phandle-cells = <3>;
19 };
20
21 consumer-a {
22 phandle-list = <&provider1 1>,
23 <&provider2 2 0>,
24 <0>,
25 <&provider3 4 4 3>,
26 <&provider2 5 100>,
27 <&provider0>,
28 <&provider1 7>;
29 phandle-list-names = "first", "second", "third";
30
31 phandle-list-bad-phandle = <12345678 0 0>;
32 phandle-list-bad-args = <&provider2 1 0>,
33 <&provider3 0>;
34 };
35 };
36 };
37};
diff --git a/arch/arm/boot/dts/testcases/tests.dtsi b/arch/arm/boot/dts/testcases/tests.dtsi
new file mode 100644
index 000000000000..a7c5067622e8
--- /dev/null
+++ b/arch/arm/boot/dts/testcases/tests.dtsi
@@ -0,0 +1 @@
/include/ "tests-phandle.dtsi"
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts
index 8a614e398004..166461073b78 100644
--- a/arch/arm/boot/dts/versatile-pb.dts
+++ b/arch/arm/boot/dts/versatile-pb.dts
@@ -46,3 +46,5 @@
46 }; 46 };
47 }; 47 };
48}; 48};
49
50/include/ "testcases/tests.dtsi"
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 74df9ca2be31..81a933eb0903 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -1,8 +1,14 @@
1config ARM_GIC 1config ARM_GIC
2 select IRQ_DOMAIN 2 select IRQ_DOMAIN
3 select MULTI_IRQ_HANDLER
4 bool
5
6config GIC_NON_BANKED
3 bool 7 bool
4 8
5config ARM_VIC 9config ARM_VIC
10 select IRQ_DOMAIN
11 select MULTI_IRQ_HANDLER
6 bool 12 bool
7 13
8config ARM_VIC_NR 14config ARM_VIC_NR
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 0e6ae470c94f..b2dc2dd7f1df 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -40,13 +40,36 @@
40#include <linux/slab.h> 40#include <linux/slab.h>
41 41
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/exception.h>
43#include <asm/mach/irq.h> 44#include <asm/mach/irq.h>
44#include <asm/hardware/gic.h> 45#include <asm/hardware/gic.h>
45 46
46static DEFINE_RAW_SPINLOCK(irq_controller_lock); 47union gic_base {
48 void __iomem *common_base;
49 void __percpu __iomem **percpu_base;
50};
51
52struct gic_chip_data {
53 unsigned int irq_offset;
54 union gic_base dist_base;
55 union gic_base cpu_base;
56#ifdef CONFIG_CPU_PM
57 u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
58 u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
59 u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
60 u32 __percpu *saved_ppi_enable;
61 u32 __percpu *saved_ppi_conf;
62#endif
63#ifdef CONFIG_IRQ_DOMAIN
64 struct irq_domain domain;
65#endif
66 unsigned int gic_irqs;
67#ifdef CONFIG_GIC_NON_BANKED
68 void __iomem *(*get_base)(union gic_base *);
69#endif
70};
47 71
48/* Address of GIC 0 CPU interface */ 72static DEFINE_RAW_SPINLOCK(irq_controller_lock);
49void __iomem *gic_cpu_base_addr __read_mostly;
50 73
51/* 74/*
52 * Supported arch specific GIC irq extension. 75 * Supported arch specific GIC irq extension.
@@ -67,16 +90,48 @@ struct irq_chip gic_arch_extn = {
67 90
68static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly; 91static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly;
69 92
93#ifdef CONFIG_GIC_NON_BANKED
94static void __iomem *gic_get_percpu_base(union gic_base *base)
95{
96 return *__this_cpu_ptr(base->percpu_base);
97}
98
99static void __iomem *gic_get_common_base(union gic_base *base)
100{
101 return base->common_base;
102}
103
104static inline void __iomem *gic_data_dist_base(struct gic_chip_data *data)
105{
106 return data->get_base(&data->dist_base);
107}
108
109static inline void __iomem *gic_data_cpu_base(struct gic_chip_data *data)
110{
111 return data->get_base(&data->cpu_base);
112}
113
114static inline void gic_set_base_accessor(struct gic_chip_data *data,
115 void __iomem *(*f)(union gic_base *))
116{
117 data->get_base = f;
118}
119#else
120#define gic_data_dist_base(d) ((d)->dist_base.common_base)
121#define gic_data_cpu_base(d) ((d)->cpu_base.common_base)
122#define gic_set_base_accessor(d,f)
123#endif
124
70static inline void __iomem *gic_dist_base(struct irq_data *d) 125static inline void __iomem *gic_dist_base(struct irq_data *d)
71{ 126{
72 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 127 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
73 return gic_data->dist_base; 128 return gic_data_dist_base(gic_data);
74} 129}
75 130
76static inline void __iomem *gic_cpu_base(struct irq_data *d) 131static inline void __iomem *gic_cpu_base(struct irq_data *d)
77{ 132{
78 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 133 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
79 return gic_data->cpu_base; 134 return gic_data_cpu_base(gic_data);
80} 135}
81 136
82static inline unsigned int gic_irq(struct irq_data *d) 137static 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)
215#define gic_set_wake NULL 270#define gic_set_wake NULL
216#endif 271#endif
217 272
273asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
274{
275 u32 irqstat, irqnr;
276 struct gic_chip_data *gic = &gic_data[0];
277 void __iomem *cpu_base = gic_data_cpu_base(gic);
278
279 do {
280 irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
281 irqnr = irqstat & ~0x1c00;
282
283 if (likely(irqnr > 15 && irqnr < 1021)) {
284 irqnr = irq_domain_to_irq(&gic->domain, irqnr);
285 handle_IRQ(irqnr, regs);
286 continue;
287 }
288 if (irqnr < 16) {
289 writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
290#ifdef CONFIG_SMP
291 handle_IPI(irqnr, regs);
292#endif
293 continue;
294 }
295 break;
296 } while (1);
297}
298
218static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) 299static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
219{ 300{
220 struct gic_chip_data *chip_data = irq_get_handler_data(irq); 301 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)
225 chained_irq_enter(chip, desc); 306 chained_irq_enter(chip, desc);
226 307
227 raw_spin_lock(&irq_controller_lock); 308 raw_spin_lock(&irq_controller_lock);
228 status = readl_relaxed(chip_data->cpu_base + GIC_CPU_INTACK); 309 status = readl_relaxed(gic_data_cpu_base(chip_data) + GIC_CPU_INTACK);
229 raw_spin_unlock(&irq_controller_lock); 310 raw_spin_unlock(&irq_controller_lock);
230 311
231 gic_irq = (status & 0x3ff); 312 gic_irq = (status & 0x3ff);
@@ -270,7 +351,7 @@ static void __init gic_dist_init(struct gic_chip_data *gic)
270 u32 cpumask; 351 u32 cpumask;
271 unsigned int gic_irqs = gic->gic_irqs; 352 unsigned int gic_irqs = gic->gic_irqs;
272 struct irq_domain *domain = &gic->domain; 353 struct irq_domain *domain = &gic->domain;
273 void __iomem *base = gic->dist_base; 354 void __iomem *base = gic_data_dist_base(gic);
274 u32 cpu = 0; 355 u32 cpu = 0;
275 356
276#ifdef CONFIG_SMP 357#ifdef CONFIG_SMP
@@ -330,8 +411,8 @@ static void __init gic_dist_init(struct gic_chip_data *gic)
330 411
331static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) 412static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
332{ 413{
333 void __iomem *dist_base = gic->dist_base; 414 void __iomem *dist_base = gic_data_dist_base(gic);
334 void __iomem *base = gic->cpu_base; 415 void __iomem *base = gic_data_cpu_base(gic);
335 int i; 416 int i;
336 417
337 /* 418 /*
@@ -368,7 +449,7 @@ static void gic_dist_save(unsigned int gic_nr)
368 BUG(); 449 BUG();
369 450
370 gic_irqs = gic_data[gic_nr].gic_irqs; 451 gic_irqs = gic_data[gic_nr].gic_irqs;
371 dist_base = gic_data[gic_nr].dist_base; 452 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
372 453
373 if (!dist_base) 454 if (!dist_base)
374 return; 455 return;
@@ -403,7 +484,7 @@ static void gic_dist_restore(unsigned int gic_nr)
403 BUG(); 484 BUG();
404 485
405 gic_irqs = gic_data[gic_nr].gic_irqs; 486 gic_irqs = gic_data[gic_nr].gic_irqs;
406 dist_base = gic_data[gic_nr].dist_base; 487 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
407 488
408 if (!dist_base) 489 if (!dist_base)
409 return; 490 return;
@@ -439,8 +520,8 @@ static void gic_cpu_save(unsigned int gic_nr)
439 if (gic_nr >= MAX_GIC_NR) 520 if (gic_nr >= MAX_GIC_NR)
440 BUG(); 521 BUG();
441 522
442 dist_base = gic_data[gic_nr].dist_base; 523 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
443 cpu_base = gic_data[gic_nr].cpu_base; 524 cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
444 525
445 if (!dist_base || !cpu_base) 526 if (!dist_base || !cpu_base)
446 return; 527 return;
@@ -465,8 +546,8 @@ static void gic_cpu_restore(unsigned int gic_nr)
465 if (gic_nr >= MAX_GIC_NR) 546 if (gic_nr >= MAX_GIC_NR)
466 BUG(); 547 BUG();
467 548
468 dist_base = gic_data[gic_nr].dist_base; 549 dist_base = gic_data_dist_base(&gic_data[gic_nr]);
469 cpu_base = gic_data[gic_nr].cpu_base; 550 cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
470 551
471 if (!dist_base || !cpu_base) 552 if (!dist_base || !cpu_base)
472 return; 553 return;
@@ -491,6 +572,11 @@ static int gic_notifier(struct notifier_block *self, unsigned long cmd, void *v)
491 int i; 572 int i;
492 573
493 for (i = 0; i < MAX_GIC_NR; i++) { 574 for (i = 0; i < MAX_GIC_NR; i++) {
575#ifdef CONFIG_GIC_NON_BANKED
576 /* Skip over unused GICs */
577 if (!gic_data[i].get_base)
578 continue;
579#endif
494 switch (cmd) { 580 switch (cmd) {
495 case CPU_PM_ENTER: 581 case CPU_PM_ENTER:
496 gic_cpu_save(i); 582 gic_cpu_save(i);
@@ -526,7 +612,8 @@ static void __init gic_pm_init(struct gic_chip_data *gic)
526 sizeof(u32)); 612 sizeof(u32));
527 BUG_ON(!gic->saved_ppi_conf); 613 BUG_ON(!gic->saved_ppi_conf);
528 614
529 cpu_pm_register_notifier(&gic_notifier_block); 615 if (gic == &gic_data[0])
616 cpu_pm_register_notifier(&gic_notifier_block);
530} 617}
531#else 618#else
532static void __init gic_pm_init(struct gic_chip_data *gic) 619static void __init gic_pm_init(struct gic_chip_data *gic)
@@ -563,8 +650,9 @@ const struct irq_domain_ops gic_irq_domain_ops = {
563#endif 650#endif
564}; 651};
565 652
566void __init gic_init(unsigned int gic_nr, int irq_start, 653void __init gic_init_bases(unsigned int gic_nr, int irq_start,
567 void __iomem *dist_base, void __iomem *cpu_base) 654 void __iomem *dist_base, void __iomem *cpu_base,
655 u32 percpu_offset)
568{ 656{
569 struct gic_chip_data *gic; 657 struct gic_chip_data *gic;
570 struct irq_domain *domain; 658 struct irq_domain *domain;
@@ -574,26 +662,55 @@ void __init gic_init(unsigned int gic_nr, int irq_start,
574 662
575 gic = &gic_data[gic_nr]; 663 gic = &gic_data[gic_nr];
576 domain = &gic->domain; 664 domain = &gic->domain;
577 gic->dist_base = dist_base; 665#ifdef CONFIG_GIC_NON_BANKED
578 gic->cpu_base = cpu_base; 666 if (percpu_offset) { /* Frankein-GIC without banked registers... */
667 unsigned int cpu;
668
669 gic->dist_base.percpu_base = alloc_percpu(void __iomem *);
670 gic->cpu_base.percpu_base = alloc_percpu(void __iomem *);
671 if (WARN_ON(!gic->dist_base.percpu_base ||
672 !gic->cpu_base.percpu_base)) {
673 free_percpu(gic->dist_base.percpu_base);
674 free_percpu(gic->cpu_base.percpu_base);
675 return;
676 }
677
678 for_each_possible_cpu(cpu) {
679 unsigned long offset = percpu_offset * cpu_logical_map(cpu);
680 *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset;
681 *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset;
682 }
683
684 gic_set_base_accessor(gic, gic_get_percpu_base);
685 } else
686#endif
687 { /* Normal, sane GIC... */
688 WARN(percpu_offset,
689 "GIC_NON_BANKED not enabled, ignoring %08x offset!",
690 percpu_offset);
691 gic->dist_base.common_base = dist_base;
692 gic->cpu_base.common_base = cpu_base;
693 gic_set_base_accessor(gic, gic_get_common_base);
694 }
579 695
580 /* 696 /*
581 * For primary GICs, skip over SGIs. 697 * For primary GICs, skip over SGIs.
582 * For secondary GICs, skip over PPIs, too. 698 * For secondary GICs, skip over PPIs, too.
583 */ 699 */
700 domain->hwirq_base = 32;
584 if (gic_nr == 0) { 701 if (gic_nr == 0) {
585 gic_cpu_base_addr = cpu_base; 702 if ((irq_start & 31) > 0) {
586 domain->hwirq_base = 16; 703 domain->hwirq_base = 16;
587 if (irq_start > 0) 704 if (irq_start != -1)
588 irq_start = (irq_start & ~31) + 16; 705 irq_start = (irq_start & ~31) + 16;
589 } else 706 }
590 domain->hwirq_base = 32; 707 }
591 708
592 /* 709 /*
593 * Find out how many interrupts are supported. 710 * Find out how many interrupts are supported.
594 * The GIC only supports up to 1020 interrupt sources. 711 * The GIC only supports up to 1020 interrupt sources.
595 */ 712 */
596 gic_irqs = readl_relaxed(dist_base + GIC_DIST_CTR) & 0x1f; 713 gic_irqs = readl_relaxed(gic_data_dist_base(gic) + GIC_DIST_CTR) & 0x1f;
597 gic_irqs = (gic_irqs + 1) * 32; 714 gic_irqs = (gic_irqs + 1) * 32;
598 if (gic_irqs > 1020) 715 if (gic_irqs > 1020)
599 gic_irqs = 1020; 716 gic_irqs = 1020;
@@ -641,7 +758,7 @@ void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
641 dsb(); 758 dsb();
642 759
643 /* this always happens on GIC0 */ 760 /* this always happens on GIC0 */
644 writel_relaxed(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT); 761 writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
645} 762}
646#endif 763#endif
647 764
@@ -652,6 +769,7 @@ int __init gic_of_init(struct device_node *node, struct device_node *parent)
652{ 769{
653 void __iomem *cpu_base; 770 void __iomem *cpu_base;
654 void __iomem *dist_base; 771 void __iomem *dist_base;
772 u32 percpu_offset;
655 int irq; 773 int irq;
656 struct irq_domain *domain = &gic_data[gic_cnt].domain; 774 struct irq_domain *domain = &gic_data[gic_cnt].domain;
657 775
@@ -664,9 +782,12 @@ int __init gic_of_init(struct device_node *node, struct device_node *parent)
664 cpu_base = of_iomap(node, 1); 782 cpu_base = of_iomap(node, 1);
665 WARN(!cpu_base, "unable to map gic cpu registers\n"); 783 WARN(!cpu_base, "unable to map gic cpu registers\n");
666 784
785 if (of_property_read_u32(node, "cpu-offset", &percpu_offset))
786 percpu_offset = 0;
787
667 domain->of_node = of_node_get(node); 788 domain->of_node = of_node_get(node);
668 789
669 gic_init(gic_cnt, -1, dist_base, cpu_base); 790 gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset);
670 791
671 if (parent) { 792 if (parent) {
672 irq = irq_of_parse_and_map(node, 0); 793 irq = irq_of_parse_and_map(node, 0);
diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c
index 7129cfbdacd6..d8e44a43047c 100644
--- a/arch/arm/common/pl330.c
+++ b/arch/arm/common/pl330.c
@@ -221,17 +221,6 @@
221 */ 221 */
222#define MCODE_BUFF_PER_REQ 256 222#define MCODE_BUFF_PER_REQ 256
223 223
224/*
225 * Mark a _pl330_req as free.
226 * We do it by writing DMAEND as the first instruction
227 * because no valid request is going to have DMAEND as
228 * its first instruction to execute.
229 */
230#define MARK_FREE(req) do { \
231 _emit_END(0, (req)->mc_cpu); \
232 (req)->mc_len = 0; \
233 } while (0)
234
235/* If the _pl330_req is available to the client */ 224/* If the _pl330_req is available to the client */
236#define IS_FREE(req) (*((u8 *)((req)->mc_cpu)) == CMD_DMAEND) 225#define IS_FREE(req) (*((u8 *)((req)->mc_cpu)) == CMD_DMAEND)
237 226
@@ -301,8 +290,10 @@ struct pl330_thread {
301 struct pl330_dmac *dmac; 290 struct pl330_dmac *dmac;
302 /* Only two at a time */ 291 /* Only two at a time */
303 struct _pl330_req req[2]; 292 struct _pl330_req req[2];
304 /* Index of the last submitted request */ 293 /* Index of the last enqueued request */
305 unsigned lstenq; 294 unsigned lstenq;
295 /* Index of the last submitted request or -1 if the DMA is stopped */
296 int req_running;
306}; 297};
307 298
308enum pl330_dmac_state { 299enum pl330_dmac_state {
@@ -778,6 +769,22 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
778 writel(0, regs + DBGCMD); 769 writel(0, regs + DBGCMD);
779} 770}
780 771
772/*
773 * Mark a _pl330_req as free.
774 * We do it by writing DMAEND as the first instruction
775 * because no valid request is going to have DMAEND as
776 * its first instruction to execute.
777 */
778static void mark_free(struct pl330_thread *thrd, int idx)
779{
780 struct _pl330_req *req = &thrd->req[idx];
781
782 _emit_END(0, req->mc_cpu);
783 req->mc_len = 0;
784
785 thrd->req_running = -1;
786}
787
781static inline u32 _state(struct pl330_thread *thrd) 788static inline u32 _state(struct pl330_thread *thrd)
782{ 789{
783 void __iomem *regs = thrd->dmac->pinfo->base; 790 void __iomem *regs = thrd->dmac->pinfo->base;
@@ -836,31 +843,6 @@ static inline u32 _state(struct pl330_thread *thrd)
836 } 843 }
837} 844}
838 845
839/* If the request 'req' of thread 'thrd' is currently active */
840static inline bool _req_active(struct pl330_thread *thrd,
841 struct _pl330_req *req)
842{
843 void __iomem *regs = thrd->dmac->pinfo->base;
844 u32 buf = req->mc_bus, pc = readl(regs + CPC(thrd->id));
845
846 if (IS_FREE(req))
847 return false;
848
849 return (pc >= buf && pc <= buf + req->mc_len) ? true : false;
850}
851
852/* Returns 0 if the thread is inactive, ID of active req + 1 otherwise */
853static inline unsigned _thrd_active(struct pl330_thread *thrd)
854{
855 if (_req_active(thrd, &thrd->req[0]))
856 return 1; /* First req active */
857
858 if (_req_active(thrd, &thrd->req[1]))
859 return 2; /* Second req active */
860
861 return 0;
862}
863
864static void _stop(struct pl330_thread *thrd) 846static void _stop(struct pl330_thread *thrd)
865{ 847{
866 void __iomem *regs = thrd->dmac->pinfo->base; 848 void __iomem *regs = thrd->dmac->pinfo->base;
@@ -892,17 +874,22 @@ static bool _trigger(struct pl330_thread *thrd)
892 struct _arg_GO go; 874 struct _arg_GO go;
893 unsigned ns; 875 unsigned ns;
894 u8 insn[6] = {0, 0, 0, 0, 0, 0}; 876 u8 insn[6] = {0, 0, 0, 0, 0, 0};
877 int idx;
895 878
896 /* Return if already ACTIVE */ 879 /* Return if already ACTIVE */
897 if (_state(thrd) != PL330_STATE_STOPPED) 880 if (_state(thrd) != PL330_STATE_STOPPED)
898 return true; 881 return true;
899 882
900 if (!IS_FREE(&thrd->req[1 - thrd->lstenq])) 883 idx = 1 - thrd->lstenq;
901 req = &thrd->req[1 - thrd->lstenq]; 884 if (!IS_FREE(&thrd->req[idx]))
902 else if (!IS_FREE(&thrd->req[thrd->lstenq])) 885 req = &thrd->req[idx];
903 req = &thrd->req[thrd->lstenq]; 886 else {
904 else 887 idx = thrd->lstenq;
905 req = NULL; 888 if (!IS_FREE(&thrd->req[idx]))
889 req = &thrd->req[idx];
890 else
891 req = NULL;
892 }
906 893
907 /* Return if no request */ 894 /* Return if no request */
908 if (!req || !req->r) 895 if (!req || !req->r)
@@ -933,6 +920,8 @@ static bool _trigger(struct pl330_thread *thrd)
933 /* Only manager can execute GO */ 920 /* Only manager can execute GO */
934 _execute_DBGINSN(thrd, insn, true); 921 _execute_DBGINSN(thrd, insn, true);
935 922
923 thrd->req_running = idx;
924
936 return true; 925 return true;
937} 926}
938 927
@@ -1211,8 +1200,8 @@ static inline u32 _prepare_ccr(const struct pl330_reqcfg *rqc)
1211 ccr |= (rqc->brst_size << CC_SRCBRSTSIZE_SHFT); 1200 ccr |= (rqc->brst_size << CC_SRCBRSTSIZE_SHFT);
1212 ccr |= (rqc->brst_size << CC_DSTBRSTSIZE_SHFT); 1201 ccr |= (rqc->brst_size << CC_DSTBRSTSIZE_SHFT);
1213 1202
1214 ccr |= (rqc->dcctl << CC_SRCCCTRL_SHFT); 1203 ccr |= (rqc->scctl << CC_SRCCCTRL_SHFT);
1215 ccr |= (rqc->scctl << CC_DSTCCTRL_SHFT); 1204 ccr |= (rqc->dcctl << CC_DSTCCTRL_SHFT);
1216 1205
1217 ccr |= (rqc->swap << CC_SWAP_SHFT); 1206 ccr |= (rqc->swap << CC_SWAP_SHFT);
1218 1207
@@ -1382,8 +1371,8 @@ static void pl330_dotask(unsigned long data)
1382 1371
1383 thrd->req[0].r = NULL; 1372 thrd->req[0].r = NULL;
1384 thrd->req[1].r = NULL; 1373 thrd->req[1].r = NULL;
1385 MARK_FREE(&thrd->req[0]); 1374 mark_free(thrd, 0);
1386 MARK_FREE(&thrd->req[1]); 1375 mark_free(thrd, 1);
1387 1376
1388 /* Clear the reset flag */ 1377 /* Clear the reset flag */
1389 pl330->dmac_tbd.reset_chan &= ~(1 << i); 1378 pl330->dmac_tbd.reset_chan &= ~(1 << i);
@@ -1461,14 +1450,12 @@ int pl330_update(const struct pl330_info *pi)
1461 1450
1462 thrd = &pl330->channels[id]; 1451 thrd = &pl330->channels[id];
1463 1452
1464 active = _thrd_active(thrd); 1453 active = thrd->req_running;
1465 if (!active) /* Aborted */ 1454 if (active == -1) /* Aborted */
1466 continue; 1455 continue;
1467 1456
1468 active -= 1;
1469
1470 rqdone = &thrd->req[active]; 1457 rqdone = &thrd->req[active];
1471 MARK_FREE(rqdone); 1458 mark_free(thrd, active);
1472 1459
1473 /* Get going again ASAP */ 1460 /* Get going again ASAP */
1474 _start(thrd); 1461 _start(thrd);
@@ -1480,13 +1467,19 @@ int pl330_update(const struct pl330_info *pi)
1480 1467
1481 /* Now that we are in no hurry, do the callbacks */ 1468 /* Now that we are in no hurry, do the callbacks */
1482 while (!list_empty(&pl330->req_done)) { 1469 while (!list_empty(&pl330->req_done)) {
1470 struct pl330_req *r;
1471
1483 rqdone = container_of(pl330->req_done.next, 1472 rqdone = container_of(pl330->req_done.next,
1484 struct _pl330_req, rqd); 1473 struct _pl330_req, rqd);
1485 1474
1486 list_del_init(&rqdone->rqd); 1475 list_del_init(&rqdone->rqd);
1487 1476
1477 /* Detach the req */
1478 r = rqdone->r;
1479 rqdone->r = NULL;
1480
1488 spin_unlock_irqrestore(&pl330->lock, flags); 1481 spin_unlock_irqrestore(&pl330->lock, flags);
1489 _callback(rqdone->r, PL330_ERR_NONE); 1482 _callback(r, PL330_ERR_NONE);
1490 spin_lock_irqsave(&pl330->lock, flags); 1483 spin_lock_irqsave(&pl330->lock, flags);
1491 } 1484 }
1492 1485
@@ -1509,7 +1502,7 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
1509 struct pl330_thread *thrd = ch_id; 1502 struct pl330_thread *thrd = ch_id;
1510 struct pl330_dmac *pl330; 1503 struct pl330_dmac *pl330;
1511 unsigned long flags; 1504 unsigned long flags;
1512 int ret = 0, active; 1505 int ret = 0, active = thrd->req_running;
1513 1506
1514 if (!thrd || thrd->free || thrd->dmac->state == DYING) 1507 if (!thrd || thrd->free || thrd->dmac->state == DYING)
1515 return -EINVAL; 1508 return -EINVAL;
@@ -1525,28 +1518,24 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
1525 1518
1526 thrd->req[0].r = NULL; 1519 thrd->req[0].r = NULL;
1527 thrd->req[1].r = NULL; 1520 thrd->req[1].r = NULL;
1528 MARK_FREE(&thrd->req[0]); 1521 mark_free(thrd, 0);
1529 MARK_FREE(&thrd->req[1]); 1522 mark_free(thrd, 1);
1530 break; 1523 break;
1531 1524
1532 case PL330_OP_ABORT: 1525 case PL330_OP_ABORT:
1533 active = _thrd_active(thrd);
1534
1535 /* Make sure the channel is stopped */ 1526 /* Make sure the channel is stopped */
1536 _stop(thrd); 1527 _stop(thrd);
1537 1528
1538 /* ABORT is only for the active req */ 1529 /* ABORT is only for the active req */
1539 if (!active) 1530 if (active == -1)
1540 break; 1531 break;
1541 1532
1542 active--;
1543
1544 thrd->req[active].r = NULL; 1533 thrd->req[active].r = NULL;
1545 MARK_FREE(&thrd->req[active]); 1534 mark_free(thrd, active);
1546 1535
1547 /* Start the next */ 1536 /* Start the next */
1548 case PL330_OP_START: 1537 case PL330_OP_START:
1549 if (!_thrd_active(thrd) && !_start(thrd)) 1538 if ((active == -1) && !_start(thrd))
1550 ret = -EIO; 1539 ret = -EIO;
1551 break; 1540 break;
1552 1541
@@ -1587,14 +1576,13 @@ int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus)
1587 else 1576 else
1588 pstatus->faulting = false; 1577 pstatus->faulting = false;
1589 1578
1590 active = _thrd_active(thrd); 1579 active = thrd->req_running;
1591 1580
1592 if (!active) { 1581 if (active == -1) {
1593 /* Indicate that the thread is not running */ 1582 /* Indicate that the thread is not running */
1594 pstatus->top_req = NULL; 1583 pstatus->top_req = NULL;
1595 pstatus->wait_req = NULL; 1584 pstatus->wait_req = NULL;
1596 } else { 1585 } else {
1597 active--;
1598 pstatus->top_req = thrd->req[active].r; 1586 pstatus->top_req = thrd->req[active].r;
1599 pstatus->wait_req = !IS_FREE(&thrd->req[1 - active]) 1587 pstatus->wait_req = !IS_FREE(&thrd->req[1 - active])
1600 ? thrd->req[1 - active].r : NULL; 1588 ? thrd->req[1 - active].r : NULL;
@@ -1623,6 +1611,11 @@ static inline int _alloc_event(struct pl330_thread *thrd)
1623 return -1; 1611 return -1;
1624} 1612}
1625 1613
1614static bool _chan_ns(const struct pl330_info *pi, int i)
1615{
1616 return pi->pcfg.irq_ns & (1 << i);
1617}
1618
1626/* Upon success, returns IdentityToken for the 1619/* Upon success, returns IdentityToken for the
1627 * allocated channel, NULL otherwise. 1620 * allocated channel, NULL otherwise.
1628 */ 1621 */
@@ -1647,15 +1640,16 @@ void *pl330_request_channel(const struct pl330_info *pi)
1647 1640
1648 for (i = 0; i < chans; i++) { 1641 for (i = 0; i < chans; i++) {
1649 thrd = &pl330->channels[i]; 1642 thrd = &pl330->channels[i];
1650 if (thrd->free) { 1643 if ((thrd->free) && (!_manager_ns(thrd) ||
1644 _chan_ns(pi, i))) {
1651 thrd->ev = _alloc_event(thrd); 1645 thrd->ev = _alloc_event(thrd);
1652 if (thrd->ev >= 0) { 1646 if (thrd->ev >= 0) {
1653 thrd->free = false; 1647 thrd->free = false;
1654 thrd->lstenq = 1; 1648 thrd->lstenq = 1;
1655 thrd->req[0].r = NULL; 1649 thrd->req[0].r = NULL;
1656 MARK_FREE(&thrd->req[0]); 1650 mark_free(thrd, 0);
1657 thrd->req[1].r = NULL; 1651 thrd->req[1].r = NULL;
1658 MARK_FREE(&thrd->req[1]); 1652 mark_free(thrd, 1);
1659 break; 1653 break;
1660 } 1654 }
1661 } 1655 }
@@ -1761,14 +1755,14 @@ static inline void _reset_thread(struct pl330_thread *thrd)
1761 thrd->req[0].mc_bus = pl330->mcode_bus 1755 thrd->req[0].mc_bus = pl330->mcode_bus
1762 + (thrd->id * pi->mcbufsz); 1756 + (thrd->id * pi->mcbufsz);
1763 thrd->req[0].r = NULL; 1757 thrd->req[0].r = NULL;
1764 MARK_FREE(&thrd->req[0]); 1758 mark_free(thrd, 0);
1765 1759
1766 thrd->req[1].mc_cpu = thrd->req[0].mc_cpu 1760 thrd->req[1].mc_cpu = thrd->req[0].mc_cpu
1767 + pi->mcbufsz / 2; 1761 + pi->mcbufsz / 2;
1768 thrd->req[1].mc_bus = thrd->req[0].mc_bus 1762 thrd->req[1].mc_bus = thrd->req[0].mc_bus
1769 + pi->mcbufsz / 2; 1763 + pi->mcbufsz / 2;
1770 thrd->req[1].r = NULL; 1764 thrd->req[1].r = NULL;
1771 MARK_FREE(&thrd->req[1]); 1765 mark_free(thrd, 1);
1772} 1766}
1773 1767
1774static int dmac_alloc_threads(struct pl330_dmac *pl330) 1768static int dmac_alloc_threads(struct pl330_dmac *pl330)
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 2393b5bc96fa..8794a34eae61 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -143,7 +143,6 @@ static int sp804_set_next_event(unsigned long next,
143} 143}
144 144
145static struct clock_event_device sp804_clockevent = { 145static struct clock_event_device sp804_clockevent = {
146 .shift = 32,
147 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 146 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
148 .set_mode = sp804_set_mode, 147 .set_mode = sp804_set_mode,
149 .set_next_event = sp804_set_next_event, 148 .set_next_event = sp804_set_next_event,
@@ -169,13 +168,9 @@ void __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
169 168
170 clkevt_base = base; 169 clkevt_base = base;
171 clkevt_reload = DIV_ROUND_CLOSEST(rate, HZ); 170 clkevt_reload = DIV_ROUND_CLOSEST(rate, HZ);
172
173 evt->name = name; 171 evt->name = name;
174 evt->irq = irq; 172 evt->irq = irq;
175 evt->mult = div_sc(rate, NSEC_PER_SEC, evt->shift);
176 evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt);
177 evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
178 173
179 setup_irq(irq, &sp804_timer_irq); 174 setup_irq(irq, &sp804_timer_irq);
180 clockevents_register_device(evt); 175 clockevents_config_and_register(evt, rate, 0xf, 0xffffffff);
181} 176}
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 01f18a421b17..dcb004a804c7 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -19,17 +19,22 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <linux/export.h>
22#include <linux/init.h> 23#include <linux/init.h>
23#include <linux/list.h> 24#include <linux/list.h>
24#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/irqdomain.h>
27#include <linux/of.h>
28#include <linux/of_address.h>
29#include <linux/of_irq.h>
25#include <linux/syscore_ops.h> 30#include <linux/syscore_ops.h>
26#include <linux/device.h> 31#include <linux/device.h>
27#include <linux/amba/bus.h> 32#include <linux/amba/bus.h>
28 33
34#include <asm/exception.h>
29#include <asm/mach/irq.h> 35#include <asm/mach/irq.h>
30#include <asm/hardware/vic.h> 36#include <asm/hardware/vic.h>
31 37
32#ifdef CONFIG_PM
33/** 38/**
34 * struct vic_device - VIC PM device 39 * struct vic_device - VIC PM device
35 * @irq: The IRQ number for the base of the VIC. 40 * @irq: The IRQ number for the base of the VIC.
@@ -40,6 +45,7 @@
40 * @int_enable: Save for VIC_INT_ENABLE. 45 * @int_enable: Save for VIC_INT_ENABLE.
41 * @soft_int: Save for VIC_INT_SOFT. 46 * @soft_int: Save for VIC_INT_SOFT.
42 * @protect: Save for VIC_PROTECT. 47 * @protect: Save for VIC_PROTECT.
48 * @domain: The IRQ domain for the VIC.
43 */ 49 */
44struct vic_device { 50struct vic_device {
45 void __iomem *base; 51 void __iomem *base;
@@ -50,13 +56,13 @@ struct vic_device {
50 u32 int_enable; 56 u32 int_enable;
51 u32 soft_int; 57 u32 soft_int;
52 u32 protect; 58 u32 protect;
59 struct irq_domain domain;
53}; 60};
54 61
55/* we cannot allocate memory when VICs are initially registered */ 62/* we cannot allocate memory when VICs are initially registered */
56static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; 63static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
57 64
58static int vic_id; 65static int vic_id;
59#endif /* CONFIG_PM */
60 66
61/** 67/**
62 * vic_init2 - common initialisation code 68 * vic_init2 - common initialisation code
@@ -156,39 +162,50 @@ static int __init vic_pm_init(void)
156 return 0; 162 return 0;
157} 163}
158late_initcall(vic_pm_init); 164late_initcall(vic_pm_init);
165#endif /* CONFIG_PM */
159 166
160/** 167/**
161 * vic_pm_register - Register a VIC for later power management control 168 * vic_register() - Register a VIC.
162 * @base: The base address of the VIC. 169 * @base: The base address of the VIC.
163 * @irq: The base IRQ for the VIC. 170 * @irq: The base IRQ for the VIC.
164 * @resume_sources: bitmask of interrupts allowed for resume sources. 171 * @resume_sources: bitmask of interrupts allowed for resume sources.
172 * @node: The device tree node associated with the VIC.
165 * 173 *
166 * Register the VIC with the system device tree so that it can be notified 174 * Register the VIC with the system device tree so that it can be notified
167 * of suspend and resume requests and ensure that the correct actions are 175 * of suspend and resume requests and ensure that the correct actions are
168 * taken to re-instate the settings on resume. 176 * taken to re-instate the settings on resume.
177 *
178 * This also configures the IRQ domain for the VIC.
169 */ 179 */
170static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources) 180static void __init vic_register(void __iomem *base, unsigned int irq,
181 u32 resume_sources, struct device_node *node)
171{ 182{
172 struct vic_device *v; 183 struct vic_device *v;
173 184
174 if (vic_id >= ARRAY_SIZE(vic_devices)) 185 if (vic_id >= ARRAY_SIZE(vic_devices)) {
175 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); 186 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
176 else { 187 return;
177 v = &vic_devices[vic_id];
178 v->base = base;
179 v->resume_sources = resume_sources;
180 v->irq = irq;
181 vic_id++;
182 } 188 }
189
190 v = &vic_devices[vic_id];
191 v->base = base;
192 v->resume_sources = resume_sources;
193 v->irq = irq;
194 vic_id++;
195
196 v->domain.irq_base = irq;
197 v->domain.nr_irq = 32;
198#ifdef CONFIG_OF_IRQ
199 v->domain.of_node = of_node_get(node);
200#endif /* CONFIG_OF */
201 v->domain.ops = &irq_domain_simple_ops;
202 irq_domain_add(&v->domain);
183} 203}
184#else
185static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { }
186#endif /* CONFIG_PM */
187 204
188static void vic_ack_irq(struct irq_data *d) 205static void vic_ack_irq(struct irq_data *d)
189{ 206{
190 void __iomem *base = irq_data_get_irq_chip_data(d); 207 void __iomem *base = irq_data_get_irq_chip_data(d);
191 unsigned int irq = d->irq & 31; 208 unsigned int irq = d->hwirq;
192 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 209 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
193 /* moreover, clear the soft-triggered, in case it was the reason */ 210 /* moreover, clear the soft-triggered, in case it was the reason */
194 writel(1 << irq, base + VIC_INT_SOFT_CLEAR); 211 writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
@@ -197,14 +214,14 @@ static void vic_ack_irq(struct irq_data *d)
197static void vic_mask_irq(struct irq_data *d) 214static void vic_mask_irq(struct irq_data *d)
198{ 215{
199 void __iomem *base = irq_data_get_irq_chip_data(d); 216 void __iomem *base = irq_data_get_irq_chip_data(d);
200 unsigned int irq = d->irq & 31; 217 unsigned int irq = d->hwirq;
201 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 218 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
202} 219}
203 220
204static void vic_unmask_irq(struct irq_data *d) 221static void vic_unmask_irq(struct irq_data *d)
205{ 222{
206 void __iomem *base = irq_data_get_irq_chip_data(d); 223 void __iomem *base = irq_data_get_irq_chip_data(d);
207 unsigned int irq = d->irq & 31; 224 unsigned int irq = d->hwirq;
208 writel(1 << irq, base + VIC_INT_ENABLE); 225 writel(1 << irq, base + VIC_INT_ENABLE);
209} 226}
210 227
@@ -226,7 +243,7 @@ static struct vic_device *vic_from_irq(unsigned int irq)
226static int vic_set_wake(struct irq_data *d, unsigned int on) 243static int vic_set_wake(struct irq_data *d, unsigned int on)
227{ 244{
228 struct vic_device *v = vic_from_irq(d->irq); 245 struct vic_device *v = vic_from_irq(d->irq);
229 unsigned int off = d->irq & 31; 246 unsigned int off = d->hwirq;
230 u32 bit = 1 << off; 247 u32 bit = 1 << off;
231 248
232 if (!v) 249 if (!v)
@@ -301,7 +318,7 @@ static void __init vic_set_irq_sources(void __iomem *base,
301 * and 020 within the page. We call this "second block". 318 * and 020 within the page. We call this "second block".
302 */ 319 */
303static void __init vic_init_st(void __iomem *base, unsigned int irq_start, 320static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
304 u32 vic_sources) 321 u32 vic_sources, struct device_node *node)
305{ 322{
306 unsigned int i; 323 unsigned int i;
307 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; 324 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,
328 } 345 }
329 346
330 vic_set_irq_sources(base, irq_start, vic_sources); 347 vic_set_irq_sources(base, irq_start, vic_sources);
348 vic_register(base, irq_start, 0, node);
331} 349}
332 350
333/** 351static void __init __vic_init(void __iomem *base, unsigned int irq_start,
334 * vic_init - initialise a vectored interrupt controller 352 u32 vic_sources, u32 resume_sources,
335 * @base: iomem base address 353 struct device_node *node)
336 * @irq_start: starting interrupt number, must be muliple of 32
337 * @vic_sources: bitmask of interrupt sources to allow
338 * @resume_sources: bitmask of interrupt sources to allow for resume
339 */
340void __init vic_init(void __iomem *base, unsigned int irq_start,
341 u32 vic_sources, u32 resume_sources)
342{ 354{
343 unsigned int i; 355 unsigned int i;
344 u32 cellid = 0; 356 u32 cellid = 0;
@@ -356,7 +368,7 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
356 368
357 switch(vendor) { 369 switch(vendor) {
358 case AMBA_VENDOR_ST: 370 case AMBA_VENDOR_ST:
359 vic_init_st(base, irq_start, vic_sources); 371 vic_init_st(base, irq_start, vic_sources, node);
360 return; 372 return;
361 default: 373 default:
362 printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n"); 374 printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
@@ -375,5 +387,81 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
375 387
376 vic_set_irq_sources(base, irq_start, vic_sources); 388 vic_set_irq_sources(base, irq_start, vic_sources);
377 389
378 vic_pm_register(base, irq_start, resume_sources); 390 vic_register(base, irq_start, resume_sources, node);
391}
392
393/**
394 * vic_init() - initialise a vectored interrupt controller
395 * @base: iomem base address
396 * @irq_start: starting interrupt number, must be muliple of 32
397 * @vic_sources: bitmask of interrupt sources to allow
398 * @resume_sources: bitmask of interrupt sources to allow for resume
399 */
400void __init vic_init(void __iomem *base, unsigned int irq_start,
401 u32 vic_sources, u32 resume_sources)
402{
403 __vic_init(base, irq_start, vic_sources, resume_sources, NULL);
404}
405
406#ifdef CONFIG_OF
407int __init vic_of_init(struct device_node *node, struct device_node *parent)
408{
409 void __iomem *regs;
410 int irq_base;
411
412 if (WARN(parent, "non-root VICs are not supported"))
413 return -EINVAL;
414
415 regs = of_iomap(node, 0);
416 if (WARN_ON(!regs))
417 return -EIO;
418
419 irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
420 if (WARN_ON(irq_base < 0))
421 goto out_unmap;
422
423 __vic_init(regs, irq_base, ~0, ~0, node);
424
425 return 0;
426
427 out_unmap:
428 iounmap(regs);
429
430 return -EIO;
431}
432#endif /* CONFIG OF */
433
434/*
435 * Handle each interrupt in a single VIC. Returns non-zero if we've
436 * handled at least one interrupt. This does a single read of the
437 * status register and handles all interrupts in order from LSB first.
438 */
439static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
440{
441 u32 stat, irq;
442 int handled = 0;
443
444 stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
445 while (stat) {
446 irq = ffs(stat) - 1;
447 handle_IRQ(irq_domain_to_irq(&vic->domain, irq), regs);
448 stat &= ~(1 << irq);
449 handled = 1;
450 }
451
452 return handled;
453}
454
455/*
456 * Keep iterating over all registered VIC's until there are no pending
457 * interrupts.
458 */
459asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)
460{
461 int i, handled;
462
463 do {
464 for (i = 0, handled = 0; i < vic_id; ++i)
465 handled |= handle_one_vic(&vic_devices[i], regs);
466 } while (handled);
379} 467}
diff --git a/arch/arm/configs/at91cap9adk_defconfig b/arch/arm/configs/at91cap9_defconfig
index ffb1edd93363..8826eb218e73 100644
--- a/arch/arm/configs/at91cap9adk_defconfig
+++ b/arch/arm/configs/at91cap9_defconfig
@@ -38,7 +38,6 @@ CONFIG_IP_PNP_RARP=y
38# CONFIG_IPV6 is not set 38# CONFIG_IPV6 is not set
39CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 39CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
40CONFIG_MTD=y 40CONFIG_MTD=y
41CONFIG_MTD_PARTITIONS=y
42CONFIG_MTD_CMDLINE_PARTS=y 41CONFIG_MTD_CMDLINE_PARTS=y
43CONFIG_MTD_CHAR=y 42CONFIG_MTD_CHAR=y
44CONFIG_MTD_BLOCK=y 43CONFIG_MTD_BLOCK=y
@@ -52,16 +51,12 @@ CONFIG_MTD_NAND_ATMEL=y
52CONFIG_BLK_DEV_LOOP=y 51CONFIG_BLK_DEV_LOOP=y
53CONFIG_BLK_DEV_RAM=y 52CONFIG_BLK_DEV_RAM=y
54CONFIG_BLK_DEV_RAM_SIZE=8192 53CONFIG_BLK_DEV_RAM_SIZE=8192
55CONFIG_ATMEL_SSC=y
56CONFIG_SCSI=y 54CONFIG_SCSI=y
57CONFIG_BLK_DEV_SD=y 55CONFIG_BLK_DEV_SD=y
58CONFIG_SCSI_MULTI_LUN=y 56CONFIG_SCSI_MULTI_LUN=y
59CONFIG_NETDEVICES=y 57CONFIG_NETDEVICES=y
60CONFIG_NET_ETHERNET=y
61CONFIG_MII=y 58CONFIG_MII=y
62CONFIG_MACB=y 59CONFIG_MACB=y
63# CONFIG_NETDEV_1000 is not set
64# CONFIG_NETDEV_10000 is not set
65# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 60# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
66CONFIG_INPUT_EVDEV=y 61CONFIG_INPUT_EVDEV=y
67# CONFIG_INPUT_KEYBOARD is not set 62# CONFIG_INPUT_KEYBOARD is not set
@@ -81,7 +76,6 @@ CONFIG_WATCHDOG=y
81CONFIG_WATCHDOG_NOWAYOUT=y 76CONFIG_WATCHDOG_NOWAYOUT=y
82CONFIG_FB=y 77CONFIG_FB=y
83CONFIG_FB_ATMEL=y 78CONFIG_FB_ATMEL=y
84# CONFIG_VGA_CONSOLE is not set
85CONFIG_LOGO=y 79CONFIG_LOGO=y
86# CONFIG_LOGO_LINUX_MONO is not set 80# CONFIG_LOGO_LINUX_MONO is not set
87# CONFIG_LOGO_LINUX_CLUT224 is not set 81# CONFIG_LOGO_LINUX_CLUT224 is not set
@@ -99,7 +93,6 @@ CONFIG_MMC_AT91=m
99CONFIG_RTC_CLASS=y 93CONFIG_RTC_CLASS=y
100CONFIG_RTC_DRV_AT91SAM9=y 94CONFIG_RTC_DRV_AT91SAM9=y
101CONFIG_EXT2_FS=y 95CONFIG_EXT2_FS=y
102CONFIG_INOTIFY=y
103CONFIG_VFAT_FS=y 96CONFIG_VFAT_FS=y
104CONFIG_TMPFS=y 97CONFIG_TMPFS=y
105CONFIG_JFFS2_FS=y 98CONFIG_JFFS2_FS=y
diff --git a/arch/arm/configs/at91rm9200_defconfig b/arch/arm/configs/at91rm9200_defconfig
index 38cb7c985426..bbe4e1a1f5d8 100644
--- a/arch/arm/configs/at91rm9200_defconfig
+++ b/arch/arm/configs/at91rm9200_defconfig
@@ -5,7 +5,6 @@ CONFIG_SYSVIPC=y
5CONFIG_IKCONFIG=y 5CONFIG_IKCONFIG=y
6CONFIG_IKCONFIG_PROC=y 6CONFIG_IKCONFIG_PROC=y
7CONFIG_LOG_BUF_SHIFT=14 7CONFIG_LOG_BUF_SHIFT=14
8CONFIG_SYSFS_DEPRECATED_V2=y
9CONFIG_BLK_DEV_INITRD=y 8CONFIG_BLK_DEV_INITRD=y
10CONFIG_MODULES=y 9CONFIG_MODULES=y
11CONFIG_MODULE_FORCE_LOAD=y 10CONFIG_MODULE_FORCE_LOAD=y
@@ -56,7 +55,6 @@ CONFIG_IP_PNP=y
56CONFIG_IP_PNP_DHCP=y 55CONFIG_IP_PNP_DHCP=y
57CONFIG_IP_PNP_BOOTP=y 56CONFIG_IP_PNP_BOOTP=y
58CONFIG_NET_IPIP=m 57CONFIG_NET_IPIP=m
59CONFIG_NET_IPGRE=m
60CONFIG_INET_AH=m 58CONFIG_INET_AH=m
61CONFIG_INET_ESP=m 59CONFIG_INET_ESP=m
62CONFIG_INET_IPCOMP=m 60CONFIG_INET_IPCOMP=m
@@ -75,18 +73,8 @@ CONFIG_IPV6_TUNNEL=m
75CONFIG_BRIDGE=m 73CONFIG_BRIDGE=m
76CONFIG_VLAN_8021Q=m 74CONFIG_VLAN_8021Q=m
77CONFIG_BT=m 75CONFIG_BT=m
78CONFIG_BT_L2CAP=m
79CONFIG_BT_SCO=m
80CONFIG_BT_RFCOMM=m
81CONFIG_BT_RFCOMM_TTY=y
82CONFIG_BT_BNEP=m
83CONFIG_BT_BNEP_MC_FILTER=y
84CONFIG_BT_BNEP_PROTO_FILTER=y
85CONFIG_BT_HIDP=m
86CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 76CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
87CONFIG_MTD=y 77CONFIG_MTD=y
88CONFIG_MTD_CONCAT=y
89CONFIG_MTD_PARTITIONS=y
90CONFIG_MTD_CMDLINE_PARTS=y 78CONFIG_MTD_CMDLINE_PARTS=y
91CONFIG_MTD_AFS_PARTS=y 79CONFIG_MTD_AFS_PARTS=y
92CONFIG_MTD_CHAR=y 80CONFIG_MTD_CHAR=y
@@ -108,8 +96,6 @@ CONFIG_BLK_DEV_LOOP=y
108CONFIG_BLK_DEV_NBD=y 96CONFIG_BLK_DEV_NBD=y
109CONFIG_BLK_DEV_RAM=y 97CONFIG_BLK_DEV_RAM=y
110CONFIG_BLK_DEV_RAM_SIZE=8192 98CONFIG_BLK_DEV_RAM_SIZE=8192
111CONFIG_ATMEL_TCLIB=y
112CONFIG_EEPROM_LEGACY=m
113CONFIG_SCSI=y 99CONFIG_SCSI=y
114CONFIG_BLK_DEV_SD=y 100CONFIG_BLK_DEV_SD=y
115CONFIG_BLK_DEV_SR=m 101CONFIG_BLK_DEV_SR=m
@@ -119,14 +105,23 @@ CONFIG_SCSI_MULTI_LUN=y
119# CONFIG_SCSI_LOWLEVEL is not set 105# CONFIG_SCSI_LOWLEVEL is not set
120CONFIG_NETDEVICES=y 106CONFIG_NETDEVICES=y
121CONFIG_TUN=m 107CONFIG_TUN=m
108CONFIG_ARM_AT91_ETHER=y
122CONFIG_PHYLIB=y 109CONFIG_PHYLIB=y
123CONFIG_DAVICOM_PHY=y 110CONFIG_DAVICOM_PHY=y
124CONFIG_SMSC_PHY=y 111CONFIG_SMSC_PHY=y
125CONFIG_MICREL_PHY=y 112CONFIG_MICREL_PHY=y
126CONFIG_NET_ETHERNET=y 113CONFIG_PPP=y
127CONFIG_ARM_AT91_ETHER=y 114CONFIG_PPP_BSDCOMP=y
128# CONFIG_NETDEV_1000 is not set 115CONFIG_PPP_DEFLATE=y
129# CONFIG_NETDEV_10000 is not set 116CONFIG_PPP_FILTER=y
117CONFIG_PPP_MPPE=m
118CONFIG_PPP_MULTILINK=y
119CONFIG_PPPOE=m
120CONFIG_PPP_ASYNC=y
121CONFIG_SLIP=m
122CONFIG_SLIP_COMPRESSED=y
123CONFIG_SLIP_SMART=y
124CONFIG_SLIP_MODE_SLIP6=y
130CONFIG_USB_CATC=m 125CONFIG_USB_CATC=m
131CONFIG_USB_KAWETH=m 126CONFIG_USB_KAWETH=m
132CONFIG_USB_PEGASUS=m 127CONFIG_USB_PEGASUS=m
@@ -139,18 +134,6 @@ CONFIG_USB_NET_RNDIS_HOST=m
139CONFIG_USB_ALI_M5632=y 134CONFIG_USB_ALI_M5632=y
140CONFIG_USB_AN2720=y 135CONFIG_USB_AN2720=y
141CONFIG_USB_EPSON2888=y 136CONFIG_USB_EPSON2888=y
142CONFIG_PPP=y
143CONFIG_PPP_MULTILINK=y
144CONFIG_PPP_FILTER=y
145CONFIG_PPP_ASYNC=y
146CONFIG_PPP_DEFLATE=y
147CONFIG_PPP_BSDCOMP=y
148CONFIG_PPP_MPPE=m
149CONFIG_PPPOE=m
150CONFIG_SLIP=m
151CONFIG_SLIP_COMPRESSED=y
152CONFIG_SLIP_SMART=y
153CONFIG_SLIP_MODE_SLIP6=y
154# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 137# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
155CONFIG_INPUT_MOUSEDEV_SCREEN_X=640 138CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
156CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480 139CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
@@ -158,9 +141,9 @@ CONFIG_INPUT_EVDEV=y
158CONFIG_KEYBOARD_GPIO=y 141CONFIG_KEYBOARD_GPIO=y
159# CONFIG_INPUT_MOUSE is not set 142# CONFIG_INPUT_MOUSE is not set
160CONFIG_INPUT_TOUCHSCREEN=y 143CONFIG_INPUT_TOUCHSCREEN=y
144CONFIG_LEGACY_PTY_COUNT=32
161CONFIG_SERIAL_ATMEL=y 145CONFIG_SERIAL_ATMEL=y
162CONFIG_SERIAL_ATMEL_CONSOLE=y 146CONFIG_SERIAL_ATMEL_CONSOLE=y
163CONFIG_LEGACY_PTY_COUNT=32
164CONFIG_HW_RANDOM=y 147CONFIG_HW_RANDOM=y
165CONFIG_I2C=y 148CONFIG_I2C=y
166CONFIG_I2C_CHARDEV=y 149CONFIG_I2C_CHARDEV=y
@@ -290,7 +273,6 @@ CONFIG_NFS_V3_ACL=y
290CONFIG_NFS_V4=y 273CONFIG_NFS_V4=y
291CONFIG_ROOT_NFS=y 274CONFIG_ROOT_NFS=y
292CONFIG_NFSD=y 275CONFIG_NFSD=y
293CONFIG_SMB_FS=m
294CONFIG_CIFS=m 276CONFIG_CIFS=m
295CONFIG_PARTITION_ADVANCED=y 277CONFIG_PARTITION_ADVANCED=y
296CONFIG_MAC_PARTITION=y 278CONFIG_MAC_PARTITION=y
@@ -335,7 +317,6 @@ CONFIG_NLS_UTF8=y
335CONFIG_MAGIC_SYSRQ=y 317CONFIG_MAGIC_SYSRQ=y
336CONFIG_DEBUG_FS=y 318CONFIG_DEBUG_FS=y
337CONFIG_DEBUG_KERNEL=y 319CONFIG_DEBUG_KERNEL=y
338# CONFIG_RCU_CPU_STALL_DETECTOR is not set
339# CONFIG_FTRACE is not set 320# CONFIG_FTRACE is not set
340CONFIG_CRYPTO_PCBC=y 321CONFIG_CRYPTO_PCBC=y
341CONFIG_CRYPTO_SHA1=y 322CONFIG_CRYPTO_SHA1=y
diff --git a/arch/arm/configs/at91sam9260ek_defconfig b/arch/arm/configs/at91sam9260_defconfig
index f8a9226413bf..505b3765f87e 100644
--- a/arch/arm/configs/at91sam9260ek_defconfig
+++ b/arch/arm/configs/at91sam9260_defconfig
@@ -12,11 +12,23 @@ CONFIG_MODULE_UNLOAD=y
12# CONFIG_IOSCHED_CFQ is not set 12# CONFIG_IOSCHED_CFQ is not set
13CONFIG_ARCH_AT91=y 13CONFIG_ARCH_AT91=y
14CONFIG_ARCH_AT91SAM9260=y 14CONFIG_ARCH_AT91SAM9260=y
15CONFIG_ARCH_AT91SAM9260_SAM9XE=y
15CONFIG_MACH_AT91SAM9260EK=y 16CONFIG_MACH_AT91SAM9260EK=y
17CONFIG_MACH_CAM60=y
18CONFIG_MACH_SAM9_L9260=y
19CONFIG_MACH_AFEB9260=y
20CONFIG_MACH_USB_A9260=y
21CONFIG_MACH_QIL_A9260=y
22CONFIG_MACH_CPU9260=y
23CONFIG_MACH_FLEXIBITY=y
24CONFIG_MACH_SNAPPER_9260=y
25CONFIG_MACH_AT91SAM_DT=y
16CONFIG_AT91_PROGRAMMABLE_CLOCKS=y 26CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
17# CONFIG_ARM_THUMB is not set 27# CONFIG_ARM_THUMB is not set
18CONFIG_ZBOOT_ROM_TEXT=0x0 28CONFIG_ZBOOT_ROM_TEXT=0x0
19CONFIG_ZBOOT_ROM_BSS=0x0 29CONFIG_ZBOOT_ROM_BSS=0x0
30CONFIG_ARM_APPENDED_DTB=y
31CONFIG_ARM_ATAG_DTB_COMPAT=y
20CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw" 32CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
21CONFIG_FPE_NWFPE=y 33CONFIG_FPE_NWFPE=y
22CONFIG_NET=y 34CONFIG_NET=y
@@ -33,12 +45,10 @@ CONFIG_IP_PNP_BOOTP=y
33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 45CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34CONFIG_BLK_DEV_RAM=y 46CONFIG_BLK_DEV_RAM=y
35CONFIG_BLK_DEV_RAM_SIZE=8192 47CONFIG_BLK_DEV_RAM_SIZE=8192
36CONFIG_ATMEL_SSC=y
37CONFIG_SCSI=y 48CONFIG_SCSI=y
38CONFIG_BLK_DEV_SD=y 49CONFIG_BLK_DEV_SD=y
39CONFIG_SCSI_MULTI_LUN=y 50CONFIG_SCSI_MULTI_LUN=y
40CONFIG_NETDEVICES=y 51CONFIG_NETDEVICES=y
41CONFIG_NET_ETHERNET=y
42CONFIG_MII=y 52CONFIG_MII=y
43CONFIG_MACB=y 53CONFIG_MACB=y
44# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 54# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
@@ -55,7 +65,6 @@ CONFIG_I2C_GPIO=y
55CONFIG_WATCHDOG=y 65CONFIG_WATCHDOG=y
56CONFIG_WATCHDOG_NOWAYOUT=y 66CONFIG_WATCHDOG_NOWAYOUT=y
57CONFIG_AT91SAM9X_WATCHDOG=y 67CONFIG_AT91SAM9X_WATCHDOG=y
58# CONFIG_VGA_CONSOLE is not set
59# CONFIG_USB_HID is not set 68# CONFIG_USB_HID is not set
60CONFIG_USB=y 69CONFIG_USB=y
61CONFIG_USB_DEVICEFS=y 70CONFIG_USB_DEVICEFS=y
@@ -71,7 +80,6 @@ CONFIG_USB_G_SERIAL=m
71CONFIG_RTC_CLASS=y 80CONFIG_RTC_CLASS=y
72CONFIG_RTC_DRV_AT91SAM9=y 81CONFIG_RTC_DRV_AT91SAM9=y
73CONFIG_EXT2_FS=y 82CONFIG_EXT2_FS=y
74CONFIG_INOTIFY=y
75CONFIG_VFAT_FS=y 83CONFIG_VFAT_FS=y
76CONFIG_TMPFS=y 84CONFIG_TMPFS=y
77CONFIG_CRAMFS=y 85CONFIG_CRAMFS=y
diff --git a/arch/arm/configs/at91sam9g20ek_defconfig b/arch/arm/configs/at91sam9g20_defconfig
index 9e90e6d79297..9123568d9a8d 100644
--- a/arch/arm/configs/at91sam9g20ek_defconfig
+++ b/arch/arm/configs/at91sam9g20_defconfig
@@ -14,6 +14,15 @@ CONFIG_ARCH_AT91=y
14CONFIG_ARCH_AT91SAM9G20=y 14CONFIG_ARCH_AT91SAM9G20=y
15CONFIG_MACH_AT91SAM9G20EK=y 15CONFIG_MACH_AT91SAM9G20EK=y
16CONFIG_MACH_AT91SAM9G20EK_2MMC=y 16CONFIG_MACH_AT91SAM9G20EK_2MMC=y
17CONFIG_MACH_CPU9G20=y
18CONFIG_MACH_ACMENETUSFOXG20=y
19CONFIG_MACH_PORTUXG20=y
20CONFIG_MACH_STAMP9G20=y
21CONFIG_MACH_PCONTROL_G20=y
22CONFIG_MACH_GSIA18S=y
23CONFIG_MACH_USB_A9G20=y
24CONFIG_MACH_SNAPPER_9260=y
25CONFIG_MACH_AT91SAM_DT=y
17CONFIG_AT91_PROGRAMMABLE_CLOCKS=y 26CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
18# CONFIG_ARM_THUMB is not set 27# CONFIG_ARM_THUMB is not set
19CONFIG_AEABI=y 28CONFIG_AEABI=y
@@ -21,9 +30,10 @@ CONFIG_LEDS=y
21CONFIG_LEDS_CPU=y 30CONFIG_LEDS_CPU=y
22CONFIG_ZBOOT_ROM_TEXT=0x0 31CONFIG_ZBOOT_ROM_TEXT=0x0
23CONFIG_ZBOOT_ROM_BSS=0x0 32CONFIG_ZBOOT_ROM_BSS=0x0
33CONFIG_ARM_APPENDED_DTB=y
34CONFIG_ARM_ATAG_DTB_COMPAT=y
24CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw" 35CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
25CONFIG_FPE_NWFPE=y 36CONFIG_FPE_NWFPE=y
26CONFIG_PM=y
27CONFIG_NET=y 37CONFIG_NET=y
28CONFIG_PACKET=y 38CONFIG_PACKET=y
29CONFIG_UNIX=y 39CONFIG_UNIX=y
@@ -37,8 +47,6 @@ CONFIG_IP_PNP_BOOTP=y
37# CONFIG_IPV6 is not set 47# CONFIG_IPV6 is not set
38CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 48CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
39CONFIG_MTD=y 49CONFIG_MTD=y
40CONFIG_MTD_CONCAT=y
41CONFIG_MTD_PARTITIONS=y
42CONFIG_MTD_CMDLINE_PARTS=y 50CONFIG_MTD_CMDLINE_PARTS=y
43CONFIG_MTD_CHAR=y 51CONFIG_MTD_CHAR=y
44CONFIG_MTD_BLOCK=y 52CONFIG_MTD_BLOCK=y
@@ -48,17 +56,13 @@ CONFIG_MTD_NAND_ATMEL=y
48CONFIG_BLK_DEV_LOOP=y 56CONFIG_BLK_DEV_LOOP=y
49CONFIG_BLK_DEV_RAM=y 57CONFIG_BLK_DEV_RAM=y
50CONFIG_BLK_DEV_RAM_SIZE=8192 58CONFIG_BLK_DEV_RAM_SIZE=8192
51CONFIG_ATMEL_SSC=y
52CONFIG_SCSI=y 59CONFIG_SCSI=y
53CONFIG_BLK_DEV_SD=y 60CONFIG_BLK_DEV_SD=y
54CONFIG_SCSI_MULTI_LUN=y 61CONFIG_SCSI_MULTI_LUN=y
55# CONFIG_SCSI_LOWLEVEL is not set 62# CONFIG_SCSI_LOWLEVEL is not set
56CONFIG_NETDEVICES=y 63CONFIG_NETDEVICES=y
57CONFIG_NET_ETHERNET=y
58CONFIG_MII=y 64CONFIG_MII=y
59CONFIG_MACB=y 65CONFIG_MACB=y
60# CONFIG_NETDEV_1000 is not set
61# CONFIG_NETDEV_10000 is not set
62# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 66# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
63CONFIG_INPUT_MOUSEDEV_SCREEN_X=320 67CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
64CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240 68CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
@@ -66,15 +70,14 @@ CONFIG_INPUT_EVDEV=y
66# CONFIG_KEYBOARD_ATKBD is not set 70# CONFIG_KEYBOARD_ATKBD is not set
67CONFIG_KEYBOARD_GPIO=y 71CONFIG_KEYBOARD_GPIO=y
68# CONFIG_INPUT_MOUSE is not set 72# CONFIG_INPUT_MOUSE is not set
73CONFIG_LEGACY_PTY_COUNT=16
69CONFIG_SERIAL_ATMEL=y 74CONFIG_SERIAL_ATMEL=y
70CONFIG_SERIAL_ATMEL_CONSOLE=y 75CONFIG_SERIAL_ATMEL_CONSOLE=y
71CONFIG_LEGACY_PTY_COUNT=16
72CONFIG_HW_RANDOM=y 76CONFIG_HW_RANDOM=y
73CONFIG_SPI=y 77CONFIG_SPI=y
74CONFIG_SPI_ATMEL=y 78CONFIG_SPI_ATMEL=y
75CONFIG_SPI_SPIDEV=y 79CONFIG_SPI_SPIDEV=y
76# CONFIG_HWMON is not set 80# CONFIG_HWMON is not set
77# CONFIG_VGA_CONSOLE is not set
78CONFIG_SOUND=y 81CONFIG_SOUND=y
79CONFIG_SND=y 82CONFIG_SND=y
80CONFIG_SND_SEQUENCER=y 83CONFIG_SND_SEQUENCER=y
@@ -82,7 +85,6 @@ CONFIG_SND_MIXER_OSS=y
82CONFIG_SND_PCM_OSS=y 85CONFIG_SND_PCM_OSS=y
83CONFIG_SND_SEQUENCER_OSS=y 86CONFIG_SND_SEQUENCER_OSS=y
84# CONFIG_SND_VERBOSE_PROCFS is not set 87# CONFIG_SND_VERBOSE_PROCFS is not set
85CONFIG_SND_AT73C213=y
86CONFIG_USB=y 88CONFIG_USB=y
87CONFIG_USB_DEVICEFS=y 89CONFIG_USB_DEVICEFS=y
88# CONFIG_USB_DEVICE_CLASS is not set 90# CONFIG_USB_DEVICE_CLASS is not set
@@ -105,7 +107,6 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y
105CONFIG_RTC_CLASS=y 107CONFIG_RTC_CLASS=y
106CONFIG_RTC_DRV_AT91SAM9=y 108CONFIG_RTC_DRV_AT91SAM9=y
107CONFIG_EXT2_FS=y 109CONFIG_EXT2_FS=y
108CONFIG_INOTIFY=y
109CONFIG_MSDOS_FS=y 110CONFIG_MSDOS_FS=y
110CONFIG_VFAT_FS=y 111CONFIG_VFAT_FS=y
111CONFIG_TMPFS=y 112CONFIG_TMPFS=y
diff --git a/arch/arm/configs/at91sam9g45_defconfig b/arch/arm/configs/at91sam9g45_defconfig
index c5876d244f4b..606d48f3b8f8 100644
--- a/arch/arm/configs/at91sam9g45_defconfig
+++ b/arch/arm/configs/at91sam9g45_defconfig
@@ -18,6 +18,7 @@ CONFIG_MODULE_UNLOAD=y
18CONFIG_ARCH_AT91=y 18CONFIG_ARCH_AT91=y
19CONFIG_ARCH_AT91SAM9G45=y 19CONFIG_ARCH_AT91SAM9G45=y
20CONFIG_MACH_AT91SAM9M10G45EK=y 20CONFIG_MACH_AT91SAM9M10G45EK=y
21CONFIG_MACH_AT91SAM_DT=y
21CONFIG_AT91_PROGRAMMABLE_CLOCKS=y 22CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
22CONFIG_AT91_SLOW_CLOCK=y 23CONFIG_AT91_SLOW_CLOCK=y
23CONFIG_AEABI=y 24CONFIG_AEABI=y
@@ -73,11 +74,8 @@ CONFIG_SCSI_MULTI_LUN=y
73# CONFIG_SCSI_LOWLEVEL is not set 74# CONFIG_SCSI_LOWLEVEL is not set
74CONFIG_NETDEVICES=y 75CONFIG_NETDEVICES=y
75CONFIG_MII=y 76CONFIG_MII=y
76CONFIG_DAVICOM_PHY=y
77CONFIG_NET_ETHERNET=y
78CONFIG_MACB=y 77CONFIG_MACB=y
79# CONFIG_NETDEV_1000 is not set 78CONFIG_DAVICOM_PHY=y
80# CONFIG_NETDEV_10000 is not set
81CONFIG_LIBERTAS_THINFIRM=m 79CONFIG_LIBERTAS_THINFIRM=m
82CONFIG_LIBERTAS_THINFIRM_USB=m 80CONFIG_LIBERTAS_THINFIRM_USB=m
83CONFIG_AT76C50X_USB=m 81CONFIG_AT76C50X_USB=m
@@ -131,7 +129,6 @@ CONFIG_I2C_GPIO=y
131CONFIG_SPI=y 129CONFIG_SPI=y
132CONFIG_SPI_ATMEL=y 130CONFIG_SPI_ATMEL=y
133# CONFIG_HWMON is not set 131# CONFIG_HWMON is not set
134# CONFIG_MFD_SUPPORT is not set
135CONFIG_FB=y 132CONFIG_FB=y
136CONFIG_FB_ATMEL=y 133CONFIG_FB_ATMEL=y
137CONFIG_FB_UDL=m 134CONFIG_FB_UDL=m
diff --git a/arch/arm/configs/at91sam9rlek_defconfig b/arch/arm/configs/at91sam9rl_defconfig
index 75621e4d03fc..ad562ee64209 100644
--- a/arch/arm/configs/at91sam9rlek_defconfig
+++ b/arch/arm/configs/at91sam9rl_defconfig
@@ -23,8 +23,6 @@ CONFIG_NET=y
23CONFIG_UNIX=y 23CONFIG_UNIX=y
24CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 24CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
25CONFIG_MTD=y 25CONFIG_MTD=y
26CONFIG_MTD_CONCAT=y
27CONFIG_MTD_PARTITIONS=y
28CONFIG_MTD_CMDLINE_PARTS=y 26CONFIG_MTD_CMDLINE_PARTS=y
29CONFIG_MTD_CHAR=y 27CONFIG_MTD_CHAR=y
30CONFIG_MTD_BLOCK=y 28CONFIG_MTD_BLOCK=y
@@ -35,7 +33,6 @@ CONFIG_BLK_DEV_LOOP=y
35CONFIG_BLK_DEV_RAM=y 33CONFIG_BLK_DEV_RAM=y
36CONFIG_BLK_DEV_RAM_COUNT=4 34CONFIG_BLK_DEV_RAM_COUNT=4
37CONFIG_BLK_DEV_RAM_SIZE=24576 35CONFIG_BLK_DEV_RAM_SIZE=24576
38CONFIG_ATMEL_SSC=y
39CONFIG_SCSI=y 36CONFIG_SCSI=y
40CONFIG_BLK_DEV_SD=y 37CONFIG_BLK_DEV_SD=y
41CONFIG_SCSI_MULTI_LUN=y 38CONFIG_SCSI_MULTI_LUN=y
@@ -62,13 +59,11 @@ CONFIG_WATCHDOG_NOWAYOUT=y
62CONFIG_AT91SAM9X_WATCHDOG=y 59CONFIG_AT91SAM9X_WATCHDOG=y
63CONFIG_FB=y 60CONFIG_FB=y
64CONFIG_FB_ATMEL=y 61CONFIG_FB_ATMEL=y
65# CONFIG_VGA_CONSOLE is not set
66CONFIG_MMC=y 62CONFIG_MMC=y
67CONFIG_MMC_AT91=m 63CONFIG_MMC_AT91=m
68CONFIG_RTC_CLASS=y 64CONFIG_RTC_CLASS=y
69CONFIG_RTC_DRV_AT91SAM9=y 65CONFIG_RTC_DRV_AT91SAM9=y
70CONFIG_EXT2_FS=y 66CONFIG_EXT2_FS=y
71CONFIG_INOTIFY=y
72CONFIG_MSDOS_FS=y 67CONFIG_MSDOS_FS=y
73CONFIG_VFAT_FS=y 68CONFIG_VFAT_FS=y
74CONFIG_TMPFS=y 69CONFIG_TMPFS=y
diff --git a/arch/arm/configs/ezx_defconfig b/arch/arm/configs/ezx_defconfig
index 227a477346ed..d95763d5f0d8 100644
--- a/arch/arm/configs/ezx_defconfig
+++ b/arch/arm/configs/ezx_defconfig
@@ -287,7 +287,7 @@ CONFIG_USB=y
287# CONFIG_USB_DEVICE_CLASS is not set 287# CONFIG_USB_DEVICE_CLASS is not set
288CONFIG_USB_OHCI_HCD=y 288CONFIG_USB_OHCI_HCD=y
289CONFIG_USB_GADGET=y 289CONFIG_USB_GADGET=y
290CONFIG_USB_GADGET_PXA27X=y 290CONFIG_USB_PXA27X=y
291CONFIG_USB_ETH=m 291CONFIG_USB_ETH=m
292# CONFIG_USB_ETH_RNDIS is not set 292# CONFIG_USB_ETH_RNDIS is not set
293CONFIG_MMC=y 293CONFIG_MMC=y
diff --git a/arch/arm/configs/imote2_defconfig b/arch/arm/configs/imote2_defconfig
index 176ec22af034..fd996bb13022 100644
--- a/arch/arm/configs/imote2_defconfig
+++ b/arch/arm/configs/imote2_defconfig
@@ -263,7 +263,7 @@ CONFIG_USB=y
263# CONFIG_USB_DEVICE_CLASS is not set 263# CONFIG_USB_DEVICE_CLASS is not set
264CONFIG_USB_OHCI_HCD=y 264CONFIG_USB_OHCI_HCD=y
265CONFIG_USB_GADGET=y 265CONFIG_USB_GADGET=y
266CONFIG_USB_GADGET_PXA27X=y 266CONFIG_USB_PXA27X=y
267CONFIG_USB_ETH=m 267CONFIG_USB_ETH=m
268# CONFIG_USB_ETH_RNDIS is not set 268# CONFIG_USB_ETH_RNDIS is not set
269CONFIG_MMC=y 269CONFIG_MMC=y
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index 11a4192197c8..cf497ce41dfe 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -18,9 +18,10 @@ CONFIG_ARCH_MXC=y
18CONFIG_ARCH_IMX_V4_V5=y 18CONFIG_ARCH_IMX_V4_V5=y
19CONFIG_ARCH_MX1ADS=y 19CONFIG_ARCH_MX1ADS=y
20CONFIG_MACH_SCB9328=y 20CONFIG_MACH_SCB9328=y
21CONFIG_MACH_APF9328=y
21CONFIG_MACH_MX21ADS=y 22CONFIG_MACH_MX21ADS=y
22CONFIG_MACH_MX25_3DS=y 23CONFIG_MACH_MX25_3DS=y
23CONFIG_MACH_EUKREA_CPUIMX25=y 24CONFIG_MACH_EUKREA_CPUIMX25SD=y
24CONFIG_MACH_MX27ADS=y 25CONFIG_MACH_MX27ADS=y
25CONFIG_MACH_PCM038=y 26CONFIG_MACH_PCM038=y
26CONFIG_MACH_CPUIMX27=y 27CONFIG_MACH_CPUIMX27=y
@@ -72,17 +73,16 @@ CONFIG_MTD_CFI_GEOMETRY=y
72CONFIG_MTD_CFI_INTELEXT=y 73CONFIG_MTD_CFI_INTELEXT=y
73CONFIG_MTD_PHYSMAP=y 74CONFIG_MTD_PHYSMAP=y
74CONFIG_MTD_NAND=y 75CONFIG_MTD_NAND=y
76CONFIG_MTD_NAND_MXC=y
75CONFIG_MTD_UBI=y 77CONFIG_MTD_UBI=y
76CONFIG_MISC_DEVICES=y 78CONFIG_MISC_DEVICES=y
77CONFIG_EEPROM_AT24=y 79CONFIG_EEPROM_AT24=y
78CONFIG_EEPROM_AT25=y 80CONFIG_EEPROM_AT25=y
79CONFIG_NETDEVICES=y 81CONFIG_NETDEVICES=y
80CONFIG_NET_ETHERNET=y
81CONFIG_SMC91X=y
82CONFIG_DM9000=y 82CONFIG_DM9000=y
83CONFIG_SMC91X=y
83CONFIG_SMC911X=y 84CONFIG_SMC911X=y
84# CONFIG_NETDEV_1000 is not set 85CONFIG_SMSC_PHY=y
85# CONFIG_NETDEV_10000 is not set
86# CONFIG_INPUT_MOUSEDEV is not set 86# CONFIG_INPUT_MOUSEDEV is not set
87CONFIG_INPUT_EVDEV=y 87CONFIG_INPUT_EVDEV=y
88# CONFIG_INPUT_KEYBOARD is not set 88# CONFIG_INPUT_KEYBOARD is not set
@@ -100,6 +100,7 @@ CONFIG_I2C_CHARDEV=y
100CONFIG_I2C_IMX=y 100CONFIG_I2C_IMX=y
101CONFIG_SPI=y 101CONFIG_SPI=y
102CONFIG_SPI_IMX=y 102CONFIG_SPI_IMX=y
103CONFIG_SPI_SPIDEV=y
103CONFIG_W1=y 104CONFIG_W1=y
104CONFIG_W1_MASTER_MXC=y 105CONFIG_W1_MASTER_MXC=y
105CONFIG_W1_SLAVE_THERM=y 106CONFIG_W1_SLAVE_THERM=y
@@ -139,6 +140,7 @@ CONFIG_MMC=y
139CONFIG_MMC_MXC=y 140CONFIG_MMC_MXC=y
140CONFIG_NEW_LEDS=y 141CONFIG_NEW_LEDS=y
141CONFIG_LEDS_CLASS=y 142CONFIG_LEDS_CLASS=y
143CONFIG_LEDS_GPIO=y
142CONFIG_LEDS_MC13783=y 144CONFIG_LEDS_MC13783=y
143CONFIG_LEDS_TRIGGERS=y 145CONFIG_LEDS_TRIGGERS=y
144CONFIG_LEDS_TRIGGER_TIMER=y 146CONFIG_LEDS_TRIGGER_TIMER=y
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
index a88e64d4e9a5..443675d317e6 100644
--- a/arch/arm/configs/magician_defconfig
+++ b/arch/arm/configs/magician_defconfig
@@ -132,7 +132,7 @@ CONFIG_USB_MON=m
132CONFIG_USB_OHCI_HCD=y 132CONFIG_USB_OHCI_HCD=y
133CONFIG_USB_GADGET=y 133CONFIG_USB_GADGET=y
134CONFIG_USB_GADGET_VBUS_DRAW=500 134CONFIG_USB_GADGET_VBUS_DRAW=500
135CONFIG_USB_GADGET_PXA27X=y 135CONFIG_USB_PXA27X=y
136CONFIG_USB_ETH=m 136CONFIG_USB_ETH=m
137# CONFIG_USB_ETH_RNDIS is not set 137# CONFIG_USB_ETH_RNDIS is not set
138CONFIG_USB_GADGETFS=m 138CONFIG_USB_GADGETFS=m
diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig
index 7b63462b349d..945a34f2a34d 100644
--- a/arch/arm/configs/omap1_defconfig
+++ b/arch/arm/configs/omap1_defconfig
@@ -48,13 +48,7 @@ CONFIG_MACH_SX1=y
48CONFIG_MACH_NOKIA770=y 48CONFIG_MACH_NOKIA770=y
49CONFIG_MACH_AMS_DELTA=y 49CONFIG_MACH_AMS_DELTA=y
50CONFIG_MACH_OMAP_GENERIC=y 50CONFIG_MACH_OMAP_GENERIC=y
51CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
52CONFIG_OMAP_ARM_216MHZ=y
53CONFIG_OMAP_ARM_195MHZ=y
54CONFIG_OMAP_ARM_192MHZ=y
55CONFIG_OMAP_ARM_182MHZ=y 51CONFIG_OMAP_ARM_182MHZ=y
56CONFIG_OMAP_ARM_168MHZ=y
57# CONFIG_OMAP_ARM_60MHZ is not set
58# CONFIG_ARM_THUMB is not set 52# CONFIG_ARM_THUMB is not set
59CONFIG_PCCARD=y 53CONFIG_PCCARD=y
60CONFIG_OMAP_CF=y 54CONFIG_OMAP_CF=y
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig
index 4a5a12681be2..374000ec4e4e 100644
--- a/arch/arm/configs/u300_defconfig
+++ b/arch/arm/configs/u300_defconfig
@@ -14,8 +14,6 @@ CONFIG_MODULE_UNLOAD=y
14CONFIG_ARCH_U300=y 14CONFIG_ARCH_U300=y
15CONFIG_MACH_U300=y 15CONFIG_MACH_U300=y
16CONFIG_MACH_U300_BS335=y 16CONFIG_MACH_U300_BS335=y
17CONFIG_MACH_U300_DUAL_RAM=y
18CONFIG_U300_DEBUG=y
19CONFIG_MACH_U300_SPIDUMMY=y 17CONFIG_MACH_U300_SPIDUMMY=y
20CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
21CONFIG_HIGH_RES_TIMERS=y 19CONFIG_HIGH_RES_TIMERS=y
@@ -26,19 +24,21 @@ CONFIG_ZBOOT_ROM_BSS=0x0
26CONFIG_CMDLINE="root=/dev/ram0 rw rootfstype=rootfs console=ttyAMA0,115200n8 lpj=515072" 24CONFIG_CMDLINE="root=/dev/ram0 rw rootfstype=rootfs console=ttyAMA0,115200n8 lpj=515072"
27CONFIG_CPU_IDLE=y 25CONFIG_CPU_IDLE=y
28CONFIG_FPE_NWFPE=y 26CONFIG_FPE_NWFPE=y
29CONFIG_PM=y
30# CONFIG_SUSPEND is not set 27# CONFIG_SUSPEND is not set
31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 28CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32# CONFIG_PREVENT_FIRMWARE_BUILD is not set 29# CONFIG_PREVENT_FIRMWARE_BUILD is not set
33# CONFIG_MISC_DEVICES is not set 30CONFIG_MTD=y
31CONFIG_MTD_CMDLINE_PARTS=y
32CONFIG_MTD_NAND=y
33CONFIG_MTD_NAND_FSMC=y
34# CONFIG_INPUT_MOUSEDEV is not set 34# CONFIG_INPUT_MOUSEDEV is not set
35CONFIG_INPUT_EVDEV=y 35CONFIG_INPUT_EVDEV=y
36# CONFIG_KEYBOARD_ATKBD is not set 36# CONFIG_KEYBOARD_ATKBD is not set
37# CONFIG_INPUT_MOUSE is not set 37# CONFIG_INPUT_MOUSE is not set
38# CONFIG_SERIO is not set 38# CONFIG_SERIO is not set
39CONFIG_LEGACY_PTY_COUNT=16
39CONFIG_SERIAL_AMBA_PL011=y 40CONFIG_SERIAL_AMBA_PL011=y
40CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 41CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
41CONFIG_LEGACY_PTY_COUNT=16
42# CONFIG_HW_RANDOM is not set 42# CONFIG_HW_RANDOM is not set
43CONFIG_I2C=y 43CONFIG_I2C=y
44# CONFIG_HWMON is not set 44# CONFIG_HWMON is not set
@@ -51,6 +51,7 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
51# CONFIG_HID_SUPPORT is not set 51# CONFIG_HID_SUPPORT is not set
52# CONFIG_USB_SUPPORT is not set 52# CONFIG_USB_SUPPORT is not set
53CONFIG_MMC=y 53CONFIG_MMC=y
54CONFIG_MMC_CLKGATE=y
54CONFIG_MMC_ARMMMCI=y 55CONFIG_MMC_ARMMMCI=y
55CONFIG_RTC_CLASS=y 56CONFIG_RTC_CLASS=y
56# CONFIG_RTC_HCTOSYS is not set 57# CONFIG_RTC_HCTOSYS is not set
@@ -65,10 +66,8 @@ CONFIG_NLS_CODEPAGE_437=y
65CONFIG_NLS_ISO8859_1=y 66CONFIG_NLS_ISO8859_1=y
66CONFIG_PRINTK_TIME=y 67CONFIG_PRINTK_TIME=y
67CONFIG_DEBUG_FS=y 68CONFIG_DEBUG_FS=y
68CONFIG_DEBUG_KERNEL=y
69# CONFIG_SCHED_DEBUG is not set 69# CONFIG_SCHED_DEBUG is not set
70CONFIG_TIMER_STATS=y 70CONFIG_TIMER_STATS=y
71# CONFIG_DEBUG_PREEMPT is not set 71# CONFIG_DEBUG_PREEMPT is not set
72CONFIG_DEBUG_INFO=y 72CONFIG_DEBUG_INFO=y
73# CONFIG_RCU_CPU_STALL_DETECTOR is not set
74# CONFIG_CRC32 is not set 73# CONFIG_CRC32 is not set
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index 97d31a4663da..2d7b6e7b7271 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -10,7 +10,7 @@ CONFIG_MODULE_UNLOAD=y
10CONFIG_ARCH_U8500=y 10CONFIG_ARCH_U8500=y
11CONFIG_UX500_SOC_DB5500=y 11CONFIG_UX500_SOC_DB5500=y
12CONFIG_UX500_SOC_DB8500=y 12CONFIG_UX500_SOC_DB8500=y
13CONFIG_MACH_U8500=y 13CONFIG_MACH_HREFV60=y
14CONFIG_MACH_SNOWBALL=y 14CONFIG_MACH_SNOWBALL=y
15CONFIG_MACH_U5500=y 15CONFIG_MACH_U5500=y
16CONFIG_NO_HZ=y 16CONFIG_NO_HZ=y
@@ -24,6 +24,7 @@ CONFIG_CPU_FREQ=y
24CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 24CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
25CONFIG_VFP=y 25CONFIG_VFP=y
26CONFIG_NEON=y 26CONFIG_NEON=y
27CONFIG_PM_RUNTIME=y
27CONFIG_NET=y 28CONFIG_NET=y
28CONFIG_PACKET=y 29CONFIG_PACKET=y
29CONFIG_UNIX=y 30CONFIG_UNIX=y
@@ -41,11 +42,8 @@ CONFIG_MISC_DEVICES=y
41CONFIG_AB8500_PWM=y 42CONFIG_AB8500_PWM=y
42CONFIG_SENSORS_BH1780=y 43CONFIG_SENSORS_BH1780=y
43CONFIG_NETDEVICES=y 44CONFIG_NETDEVICES=y
44CONFIG_SMSC_PHY=y
45CONFIG_NET_ETHERNET=y
46CONFIG_SMSC911X=y 45CONFIG_SMSC911X=y
47# CONFIG_NETDEV_1000 is not set 46CONFIG_SMSC_PHY=y
48# CONFIG_NETDEV_10000 is not set
49# CONFIG_WLAN is not set 47# CONFIG_WLAN is not set
50# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 48# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
51CONFIG_INPUT_EVDEV=y 49CONFIG_INPUT_EVDEV=y
@@ -72,15 +70,12 @@ CONFIG_SPI=y
72CONFIG_SPI_PL022=y 70CONFIG_SPI_PL022=y
73CONFIG_GPIO_STMPE=y 71CONFIG_GPIO_STMPE=y
74CONFIG_GPIO_TC3589X=y 72CONFIG_GPIO_TC3589X=y
75# CONFIG_HWMON is not set
76CONFIG_MFD_STMPE=y 73CONFIG_MFD_STMPE=y
77CONFIG_MFD_TC3589X=y 74CONFIG_MFD_TC3589X=y
75CONFIG_AB5500_CORE=y
78CONFIG_AB8500_CORE=y 76CONFIG_AB8500_CORE=y
79CONFIG_REGULATOR_AB8500=y 77CONFIG_REGULATOR_AB8500=y
80# CONFIG_HID_SUPPORT is not set 78# CONFIG_HID_SUPPORT is not set
81CONFIG_USB_MUSB_HDRC=y
82CONFIG_USB_GADGET_MUSB_HDRC=y
83CONFIG_MUSB_PIO_ONLY=y
84CONFIG_USB_GADGET=y 79CONFIG_USB_GADGET=y
85CONFIG_AB8500_USB=y 80CONFIG_AB8500_USB=y
86CONFIG_MMC=y 81CONFIG_MMC=y
@@ -97,6 +92,7 @@ CONFIG_DMADEVICES=y
97CONFIG_STE_DMA40=y 92CONFIG_STE_DMA40=y
98CONFIG_STAGING=y 93CONFIG_STAGING=y
99CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y 94CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y
95CONFIG_HSEM_U8500=y
100CONFIG_EXT2_FS=y 96CONFIG_EXT2_FS=y
101CONFIG_EXT2_FS_XATTR=y 97CONFIG_EXT2_FS_XATTR=y
102CONFIG_EXT2_FS_POSIX_ACL=y 98CONFIG_EXT2_FS_POSIX_ACL=y
diff --git a/arch/arm/configs/zeus_defconfig b/arch/arm/configs/zeus_defconfig
index 59577ad3f4ef..547a3c1e59db 100644
--- a/arch/arm/configs/zeus_defconfig
+++ b/arch/arm/configs/zeus_defconfig
@@ -140,7 +140,7 @@ CONFIG_USB_SERIAL=m
140CONFIG_USB_SERIAL_GENERIC=y 140CONFIG_USB_SERIAL_GENERIC=y
141CONFIG_USB_SERIAL_MCT_U232=m 141CONFIG_USB_SERIAL_MCT_U232=m
142CONFIG_USB_GADGET=m 142CONFIG_USB_GADGET=m
143CONFIG_USB_GADGET_PXA27X=y 143CONFIG_USB_PXA27X=y
144CONFIG_USB_ETH=m 144CONFIG_USB_ETH=m
145CONFIG_USB_GADGETFS=m 145CONFIG_USB_GADGETFS=m
146CONFIG_USB_FILE_STORAGE=m 146CONFIG_USB_FILE_STORAGE=m
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 29035e86a59d..b6e65dedfd71 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -187,6 +187,17 @@
187#endif 187#endif
188 188
189/* 189/*
190 * Instruction barrier
191 */
192 .macro instr_sync
193#if __LINUX_ARM_ARCH__ >= 7
194 isb
195#elif __LINUX_ARM_ARCH__ == 6
196 mcr p15, 0, r0, c7, c5, 4
197#endif
198 .endm
199
200/*
190 * SMP data memory barrier 201 * SMP data memory barrier
191 */ 202 */
192 .macro smp_dmb mode 203 .macro smp_dmb mode
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 9abe7a07d5ac..fac79dceb736 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -32,7 +32,6 @@
32 32
33#define __BUG(__file, __line, __value) \ 33#define __BUG(__file, __line, __value) \
34do { \ 34do { \
35 BUILD_BUG_ON(sizeof(struct bug_entry) != 12); \
36 asm volatile("1:\t" BUG_INSTR_TYPE #__value "\n" \ 35 asm volatile("1:\t" BUG_INSTR_TYPE #__value "\n" \
37 ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \ 36 ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \
38 "2:\t.asciz " #__file "\n" \ 37 "2:\t.asciz " #__file "\n" \
diff --git a/arch/arm/include/asm/cti.h b/arch/arm/include/asm/cti.h
new file mode 100644
index 000000000000..a0ada3ea4358
--- /dev/null
+++ b/arch/arm/include/asm/cti.h
@@ -0,0 +1,179 @@
1#ifndef __ASMARM_CTI_H
2#define __ASMARM_CTI_H
3
4#include <asm/io.h>
5
6/* The registers' definition is from section 3.2 of
7 * Embedded Cross Trigger Revision: r0p0
8 */
9#define CTICONTROL 0x000
10#define CTISTATUS 0x004
11#define CTILOCK 0x008
12#define CTIPROTECTION 0x00C
13#define CTIINTACK 0x010
14#define CTIAPPSET 0x014
15#define CTIAPPCLEAR 0x018
16#define CTIAPPPULSE 0x01c
17#define CTIINEN 0x020
18#define CTIOUTEN 0x0A0
19#define CTITRIGINSTATUS 0x130
20#define CTITRIGOUTSTATUS 0x134
21#define CTICHINSTATUS 0x138
22#define CTICHOUTSTATUS 0x13c
23#define CTIPERIPHID0 0xFE0
24#define CTIPERIPHID1 0xFE4
25#define CTIPERIPHID2 0xFE8
26#define CTIPERIPHID3 0xFEC
27#define CTIPCELLID0 0xFF0
28#define CTIPCELLID1 0xFF4
29#define CTIPCELLID2 0xFF8
30#define CTIPCELLID3 0xFFC
31
32/* The below are from section 3.6.4 of
33 * CoreSight v1.0 Architecture Specification
34 */
35#define LOCKACCESS 0xFB0
36#define LOCKSTATUS 0xFB4
37
38/* write this value to LOCKACCESS will unlock the module, and
39 * other value will lock the module
40 */
41#define LOCKCODE 0xC5ACCE55
42
43/**
44 * struct cti - cross trigger interface struct
45 * @base: mapped virtual address for the cti base
46 * @irq: irq number for the cti
47 * @trig_out_for_irq: triger out number which will cause
48 * the @irq happen
49 *
50 * cti struct used to operate cti registers.
51 */
52struct cti {
53 void __iomem *base;
54 int irq;
55 int trig_out_for_irq;
56};
57
58/**
59 * cti_init - initialize the cti instance
60 * @cti: cti instance
61 * @base: mapped virtual address for the cti base
62 * @irq: irq number for the cti
63 * @trig_out: triger out number which will cause
64 * the @irq happen
65 *
66 * called by machine code to pass the board dependent
67 * @base, @irq and @trig_out to cti.
68 */
69static inline void cti_init(struct cti *cti,
70 void __iomem *base, int irq, int trig_out)
71{
72 cti->base = base;
73 cti->irq = irq;
74 cti->trig_out_for_irq = trig_out;
75}
76
77/**
78 * cti_map_trigger - use the @chan to map @trig_in to @trig_out
79 * @cti: cti instance
80 * @trig_in: trigger in number
81 * @trig_out: trigger out number
82 * @channel: channel number
83 *
84 * This function maps one trigger in of @trig_in to one trigger
85 * out of @trig_out using the channel @chan.
86 */
87static inline void cti_map_trigger(struct cti *cti,
88 int trig_in, int trig_out, int chan)
89{
90 void __iomem *base = cti->base;
91 unsigned long val;
92
93 val = __raw_readl(base + CTIINEN + trig_in * 4);
94 val |= BIT(chan);
95 __raw_writel(val, base + CTIINEN + trig_in * 4);
96
97 val = __raw_readl(base + CTIOUTEN + trig_out * 4);
98 val |= BIT(chan);
99 __raw_writel(val, base + CTIOUTEN + trig_out * 4);
100}
101
102/**
103 * cti_enable - enable the cti module
104 * @cti: cti instance
105 *
106 * enable the cti module
107 */
108static inline void cti_enable(struct cti *cti)
109{
110 __raw_writel(0x1, cti->base + CTICONTROL);
111}
112
113/**
114 * cti_disable - disable the cti module
115 * @cti: cti instance
116 *
117 * enable the cti module
118 */
119static inline void cti_disable(struct cti *cti)
120{
121 __raw_writel(0, cti->base + CTICONTROL);
122}
123
124/**
125 * cti_irq_ack - clear the cti irq
126 * @cti: cti instance
127 *
128 * clear the cti irq
129 */
130static inline void cti_irq_ack(struct cti *cti)
131{
132 void __iomem *base = cti->base;
133 unsigned long val;
134
135 val = __raw_readl(base + CTIINTACK);
136 val |= BIT(cti->trig_out_for_irq);
137 __raw_writel(val, base + CTIINTACK);
138}
139
140/**
141 * cti_unlock - unlock cti module
142 * @cti: cti instance
143 *
144 * unlock the cti module, or else any writes to the cti
145 * module is not allowed.
146 */
147static inline void cti_unlock(struct cti *cti)
148{
149 void __iomem *base = cti->base;
150 unsigned long val;
151
152 val = __raw_readl(base + LOCKSTATUS);
153
154 if (val & 1) {
155 val = LOCKCODE;
156 __raw_writel(val, base + LOCKACCESS);
157 }
158}
159
160/**
161 * cti_lock - lock cti module
162 * @cti: cti instance
163 *
164 * lock the cti module, so any writes to the cti
165 * module will be not allowed.
166 */
167static inline void cti_lock(struct cti *cti)
168{
169 void __iomem *base = cti->base;
170 unsigned long val;
171
172 val = __raw_readl(base + LOCKSTATUS);
173
174 if (!(val & 1)) {
175 val = ~LOCKCODE;
176 __raw_writel(val, base + LOCKACCESS);
177 }
178}
179#endif
diff --git a/arch/arm/include/asm/edac.h b/arch/arm/include/asm/edac.h
new file mode 100644
index 000000000000..0df7a2c1fc3d
--- /dev/null
+++ b/arch/arm/include/asm/edac.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright 2011 Calxeda, Inc.
3 * Based on PPC version Copyright 2007 MontaVista Software, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef ASM_EDAC_H
18#define ASM_EDAC_H
19/*
20 * ECC atomic, DMA, SMP and interrupt safe scrub function.
21 * Implements the per arch atomic_scrub() that EDAC use for software
22 * ECC scrubbing. It reads memory and then writes back the original
23 * value, allowing the hardware to detect and correct memory errors.
24 */
25static inline void atomic_scrub(void *va, u32 size)
26{
27#if __LINUX_ARM_ARCH__ >= 6
28 unsigned int *virt_addr = va;
29 unsigned int temp, temp2;
30 unsigned int i;
31
32 for (i = 0; i < size / sizeof(*virt_addr); i++, virt_addr++) {
33 /* Very carefully read and write to memory atomically
34 * so we are interrupt, DMA and SMP safe.
35 */
36 __asm__ __volatile__("\n"
37 "1: ldrex %0, [%2]\n"
38 " strex %1, %0, [%2]\n"
39 " teq %1, #0\n"
40 " bne 1b\n"
41 : "=&r"(temp), "=&r"(temp2)
42 : "r"(virt_addr)
43 : "cc");
44 }
45#endif
46}
47
48#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
index 3ceb85e43850..000000000000
--- a/arch/arm/include/asm/entry-macro-vic2.S
+++ /dev/null
@@ -1,57 +0,0 @@
1/* arch/arm/include/asm/entry-macro-vic2.S
2 *
3 * Originally arch/arm/mach-s3c6400/include/mach/entry-macro.S
4 *
5 * Copyright 2008 Openmoko, Inc.
6 * Copyright 2008 Simtec Electronics
7 * http://armlinux.simtec.co.uk/
8 * Ben Dooks <ben@simtec.co.uk>
9 *
10 * Low-level IRQ helper macros for a device with two VICs
11 *
12 * This file is licensed under the terms of the GNU General Public
13 * License version 2. This program is licensed "as is" without any
14 * warranty of any kind, whether express or implied.
15*/
16
17/* This should be included from <mach/entry-macro.S> with the necessary
18 * defines for virtual addresses and IRQ bases for the two vics.
19 *
20 * The code needs the following defined:
21 * IRQ_VIC0_BASE IRQ number of VIC0's first IRQ
22 * IRQ_VIC1_BASE IRQ number of VIC1's first IRQ
23 * VA_VIC0 Virtual address of VIC0
24 * VA_VIC1 Virtual address of VIC1
25 *
26 * Note, code assumes VIC0's virtual address is an ARM immediate constant
27 * away from VIC1.
28*/
29
30#include <asm/hardware/vic.h>
31
32 .macro disable_fiq
33 .endm
34
35 .macro get_irqnr_preamble, base, tmp
36 ldr \base, =VA_VIC0
37 .endm
38
39 .macro arch_ret_to_user, tmp1, tmp2
40 .endm
41
42 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
43
44 @ check the vic0
45 mov \irqnr, #IRQ_VIC0_BASE + 31
46 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
47 teq \irqstat, #0
48
49 @ otherwise try vic1
50 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
51 addeq \irqnr, \irqnr, #(IRQ_VIC1_BASE - IRQ_VIC0_BASE)
52 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
53 teqeq \irqstat, #0
54
55 clzne \irqstat, \irqstat
56 subne \irqnr, \irqnr, \irqstat
57 .endm
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 11ad0bfbb0ad..7151753b0989 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -1,6 +1,10 @@
1#ifndef _ARCH_ARM_GPIO_H 1#ifndef _ARCH_ARM_GPIO_H
2#define _ARCH_ARM_GPIO_H 2#define _ARCH_ARM_GPIO_H
3 3
4#if CONFIG_ARCH_NR_GPIO > 0
5#define ARCH_NR_GPIO CONFIG_ARCH_NR_GPIO
6#endif
7
4/* not all ARM platforms necessarily support this API ... */ 8/* not all ARM platforms necessarily support this API ... */
5#include <mach/gpio.h> 9#include <mach/gpio.h>
6 10
diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h
index ddf07a92a6c8..436e60b2cf7a 100644
--- a/arch/arm/include/asm/hardirq.h
+++ b/arch/arm/include/asm/hardirq.h
@@ -27,23 +27,6 @@ u64 smp_irq_stat_cpu(unsigned int cpu);
27 27
28#define arch_irq_stat_cpu smp_irq_stat_cpu 28#define arch_irq_stat_cpu smp_irq_stat_cpu
29 29
30#if NR_IRQS > 512
31#define HARDIRQ_BITS 10
32#elif NR_IRQS > 256
33#define HARDIRQ_BITS 9
34#else
35#define HARDIRQ_BITS 8
36#endif
37
38/*
39 * The hardirq mask has to be large enough to have space
40 * for potentially all IRQ sources in the system nesting
41 * on a single CPU:
42 */
43#if (1 << HARDIRQ_BITS) < NR_IRQS
44# error HARDIRQ_BITS is too low!
45#endif
46
47#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 30#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
48 31
49#endif /* __ASM_HARDIRQ_H */ 32#endif /* __ASM_HARDIRQ_H */
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 1db1143a9483..7df239bcdf27 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -20,6 +20,8 @@
20#ifndef __ASM_ARM_HARDWARE_L2X0_H 20#ifndef __ASM_ARM_HARDWARE_L2X0_H
21#define __ASM_ARM_HARDWARE_L2X0_H 21#define __ASM_ARM_HARDWARE_L2X0_H
22 22
23#include <linux/errno.h>
24
23#define L2X0_CACHE_ID 0x000 25#define L2X0_CACHE_ID 0x000
24#define L2X0_CACHE_TYPE 0x004 26#define L2X0_CACHE_TYPE 0x004
25#define L2X0_CTRL 0x100 27#define L2X0_CTRL 0x100
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
index 74ebc803904d..000000000000
--- a/arch/arm/include/asm/hardware/entry-macro-gic.S
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * arch/arm/include/asm/hardware/entry-macro-gic.S
3 *
4 * Low-level IRQ helper macros for GIC
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <asm/hardware/gic.h>
12
13#ifndef HAVE_GET_IRQNR_PREAMBLE
14 .macro get_irqnr_preamble, base, tmp
15 ldr \base, =gic_cpu_base_addr
16 ldr \base, [\base]
17 .endm
18#endif
19
20/*
21 * The interrupt numbering scheme is defined in the
22 * interrupt controller spec. To wit:
23 *
24 * Interrupts 0-15 are IPI
25 * 16-31 are local. We allow 30 to be used for the watchdog.
26 * 32-1020 are global
27 * 1021-1022 are reserved
28 * 1023 is "spurious" (no interrupt)
29 *
30 * A simple read from the controller will tell us the number of the highest
31 * priority enabled interrupt. We then just need to check whether it is in the
32 * valid range for an IRQ (30-1020 inclusive).
33 */
34
35 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
36
37 ldr \irqstat, [\base, #GIC_CPU_INTACK]
38 /* bits 12-10 = src CPU, 9-0 = int # */
39
40 ldr \tmp, =1021
41 bic \irqnr, \irqstat, #0x1c00
42 cmp \irqnr, #15
43 cmpcc \irqnr, \irqnr
44 cmpne \irqnr, \tmp
45 cmpcs \irqnr, \irqnr
46 .endm
47
48/* We assume that irqstat (the raw value of the IRQ acknowledge
49 * register) is preserved from the macro above.
50 * If there is an IPI, we immediately signal end of interrupt on the
51 * controller, since this requires the original irqstat value which
52 * we won't easily be able to recreate later.
53 */
54
55 .macro test_for_ipi, irqnr, irqstat, base, tmp
56 bic \irqnr, \irqstat, #0x1c00
57 cmp \irqnr, #16
58 strcc \irqstat, [\base, #GIC_CPU_EOI]
59 cmpcs \irqnr, \irqnr
60 .endm
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
index 3e91f22046f5..4bdfe0018696 100644
--- a/arch/arm/include/asm/hardware/gic.h
+++ b/arch/arm/include/asm/hardware/gic.h
@@ -36,30 +36,22 @@
36#include <linux/irqdomain.h> 36#include <linux/irqdomain.h>
37struct device_node; 37struct device_node;
38 38
39extern void __iomem *gic_cpu_base_addr;
40extern struct irq_chip gic_arch_extn; 39extern struct irq_chip gic_arch_extn;
41 40
42void gic_init(unsigned int, int, void __iomem *, void __iomem *); 41void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
42 u32 offset);
43int gic_of_init(struct device_node *node, struct device_node *parent); 43int gic_of_init(struct device_node *node, struct device_node *parent);
44void gic_secondary_init(unsigned int); 44void gic_secondary_init(unsigned int);
45void gic_handle_irq(struct pt_regs *regs);
45void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); 46void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
46void gic_raise_softirq(const struct cpumask *mask, unsigned int irq); 47void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
47 48
48struct gic_chip_data { 49static inline void gic_init(unsigned int nr, int start,
49 void __iomem *dist_base; 50 void __iomem *dist , void __iomem *cpu)
50 void __iomem *cpu_base; 51{
51#ifdef CONFIG_CPU_PM 52 gic_init_bases(nr, start, dist, cpu, 0);
52 u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)]; 53}
53 u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)]; 54
54 u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
55 u32 __percpu *saved_ppi_enable;
56 u32 __percpu *saved_ppi_conf;
57#endif
58#ifdef CONFIG_IRQ_DOMAIN
59 struct irq_domain domain;
60#endif
61 unsigned int gic_irqs;
62};
63#endif 55#endif
64 56
65#endif 57#endif
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h
index 5daea2961d48..077c32326c63 100644
--- a/arch/arm/include/asm/hardware/iop3xx.h
+++ b/arch/arm/include/asm/hardware/iop3xx.h
@@ -234,6 +234,7 @@ extern int iop3xx_get_init_atu(void);
234void iop3xx_map_io(void); 234void iop3xx_map_io(void);
235void iop_init_cp6_handler(void); 235void iop_init_cp6_handler(void);
236void iop_init_time(unsigned long tickrate); 236void iop_init_time(unsigned long tickrate);
237void iop3xx_restart(char, const char *);
237 238
238static inline u32 read_tmr0(void) 239static inline u32 read_tmr0(void)
239{ 240{
diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h
index 5d72550a8097..f42ebd619590 100644
--- a/arch/arm/include/asm/hardware/vic.h
+++ b/arch/arm/include/asm/hardware/vic.h
@@ -41,7 +41,15 @@
41#define VIC_PL192_VECT_ADDR 0xF00 41#define VIC_PL192_VECT_ADDR 0xF00
42 42
43#ifndef __ASSEMBLY__ 43#ifndef __ASSEMBLY__
44#include <linux/compiler.h>
45#include <linux/types.h>
46
47struct device_node;
48struct pt_regs;
49
44void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); 50void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
45#endif 51int vic_of_init(struct device_node *node, struct device_node *parent);
52void vic_handle_irq(struct pt_regs *regs);
46 53
54#endif /* __ASSEMBLY__ */
47#endif 55#endif
diff --git a/arch/arm/include/asm/idmap.h b/arch/arm/include/asm/idmap.h
new file mode 100644
index 000000000000..bf863edb517d
--- /dev/null
+++ b/arch/arm/include/asm/idmap.h
@@ -0,0 +1,14 @@
1#ifndef __ASM_IDMAP_H
2#define __ASM_IDMAP_H
3
4#include <linux/compiler.h>
5#include <asm/pgtable.h>
6
7/* Tag a function as requiring to be executed via an identity mapping. */
8#define __idmap __section(.idmap.text) noinline notrace
9
10extern pgd_t *idmap_pgd;
11
12void setup_mm_for_reboot(void);
13
14#endif /* __ASM_IDMAP_H */
diff --git a/arch/arm/include/asm/ipcbuf.h b/arch/arm/include/asm/ipcbuf.h
index 97683975f7df..84c7e51cb6d0 100644
--- a/arch/arm/include/asm/ipcbuf.h
+++ b/arch/arm/include/asm/ipcbuf.h
@@ -1,29 +1 @@
1#ifndef __ASMARM_IPCBUF_H #include <asm-generic/ipcbuf.h>
2#define __ASMARM_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __ASMARM_IPCBUF_H */
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 7d19425dd496..d7692cafde7f 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -13,12 +13,13 @@
13struct tag; 13struct tag;
14struct meminfo; 14struct meminfo;
15struct sys_timer; 15struct sys_timer;
16struct pt_regs;
16 17
17struct machine_desc { 18struct machine_desc {
18 unsigned int nr; /* architecture number */ 19 unsigned int nr; /* architecture number */
19 const char *name; /* architecture name */ 20 const char *name; /* architecture name */
20 unsigned long atag_offset; /* tagged list (relative) */ 21 unsigned long atag_offset; /* tagged list (relative) */
21 const char **dt_compat; /* array of device tree 22 const char *const *dt_compat; /* array of device tree
22 * 'compatible' strings */ 23 * 'compatible' strings */
23 24
24 unsigned int nr_irqs; /* number of IRQs */ 25 unsigned int nr_irqs; /* number of IRQs */
@@ -30,10 +31,10 @@ struct machine_desc {
30 unsigned int video_start; /* start of video RAM */ 31 unsigned int video_start; /* start of video RAM */
31 unsigned int video_end; /* end of video RAM */ 32 unsigned int video_end; /* end of video RAM */
32 33
33 unsigned int reserve_lp0 :1; /* never has lp0 */ 34 unsigned char reserve_lp0 :1; /* never has lp0 */
34 unsigned int reserve_lp1 :1; /* never has lp1 */ 35 unsigned char reserve_lp1 :1; /* never has lp1 */
35 unsigned int reserve_lp2 :1; /* never has lp2 */ 36 unsigned char reserve_lp2 :1; /* never has lp2 */
36 unsigned int soft_reboot :1; /* soft reboot */ 37 char restart_mode; /* default restart mode */
37 void (*fixup)(struct tag *, char **, 38 void (*fixup)(struct tag *, char **,
38 struct meminfo *); 39 struct meminfo *);
39 void (*reserve)(void);/* reserve mem blocks */ 40 void (*reserve)(void);/* reserve mem blocks */
@@ -45,6 +46,7 @@ struct machine_desc {
45#ifdef CONFIG_MULTI_IRQ_HANDLER 46#ifdef CONFIG_MULTI_IRQ_HANDLER
46 void (*handle_irq)(struct pt_regs *); 47 void (*handle_irq)(struct pt_regs *);
47#endif 48#endif
49 void (*restart)(char, const char *);
48}; 50};
49 51
50/* 52/*
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h
index d5adaae5ee2c..f73c908b7fa0 100644
--- a/arch/arm/include/asm/mach/time.h
+++ b/arch/arm/include/asm/mach/time.h
@@ -10,8 +10,6 @@
10#ifndef __ASM_ARM_MACH_TIME_H 10#ifndef __ASM_ARM_MACH_TIME_H
11#define __ASM_ARM_MACH_TIME_H 11#define __ASM_ARM_MACH_TIME_H
12 12
13#include <linux/sysdev.h>
14
15/* 13/*
16 * This is our kernel timer structure. 14 * This is our kernel timer structure.
17 * 15 *
diff --git a/arch/arm/include/asm/opcodes.h b/arch/arm/include/asm/opcodes.h
new file mode 100644
index 000000000000..c0efdd60966f
--- /dev/null
+++ b/arch/arm/include/asm/opcodes.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/include/asm/opcodes.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __ASM_ARM_OPCODES_H
10#define __ASM_ARM_OPCODES_H
11
12#ifndef __ASSEMBLY__
13extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);
14#endif
15
16#define ARM_OPCODE_CONDTEST_FAIL 0
17#define ARM_OPCODE_CONDTEST_PASS 1
18#define ARM_OPCODE_CONDTEST_UNCOND 2
19
20#endif /* __ASM_ARM_OPCODES_H */
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index ca94653f1ecb..97b440c25c58 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -151,7 +151,11 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
151#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) 151#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
152extern void copy_page(void *to, const void *from); 152extern void copy_page(void *to, const void *from);
153 153
154#ifdef CONFIG_ARM_LPAE
155#include <asm/pgtable-3level-types.h>
156#else
154#include <asm/pgtable-2level-types.h> 157#include <asm/pgtable-2level-types.h>
158#endif
155 159
156#endif /* CONFIG_MMU */ 160#endif /* CONFIG_MMU */
157 161
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h
index 0f8e3827a89b..99cfe3607989 100644
--- a/arch/arm/include/asm/perf_event.h
+++ b/arch/arm/include/asm/perf_event.h
@@ -32,7 +32,4 @@ enum arm_perf_pmu_ids {
32extern enum arm_perf_pmu_ids 32extern enum arm_perf_pmu_ids
33armpmu_get_pmu_id(void); 33armpmu_get_pmu_id(void);
34 34
35extern int
36armpmu_get_max_events(void);
37
38#endif /* __ARM_PERF_EVENT_H__ */ 35#endif /* __ARM_PERF_EVENT_H__ */
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
index 3e08fd3fbb6b..943504f53f57 100644
--- a/arch/arm/include/asm/pgalloc.h
+++ b/arch/arm/include/asm/pgalloc.h
@@ -25,12 +25,34 @@
25#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER)) 25#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))
26#define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL)) 26#define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL))
27 27
28#ifdef CONFIG_ARM_LPAE
29
30static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
31{
32 return (pmd_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT);
33}
34
35static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
36{
37 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
38 free_page((unsigned long)pmd);
39}
40
41static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
42{
43 set_pud(pud, __pud(__pa(pmd) | PMD_TYPE_TABLE));
44}
45
46#else /* !CONFIG_ARM_LPAE */
47
28/* 48/*
29 * Since we have only two-level page tables, these are trivial 49 * Since we have only two-level page tables, these are trivial
30 */ 50 */
31#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) 51#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); })
32#define pmd_free(mm, pmd) do { } while (0) 52#define pmd_free(mm, pmd) do { } while (0)
33#define pgd_populate(mm,pmd,pte) BUG() 53#define pud_populate(mm,pmd,pte) BUG()
54
55#endif /* CONFIG_ARM_LPAE */
34 56
35extern pgd_t *pgd_alloc(struct mm_struct *mm); 57extern pgd_t *pgd_alloc(struct mm_struct *mm);
36extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); 58extern 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,
109{ 131{
110 pmdval_t pmdval = (pte + PTE_HWTABLE_OFF) | prot; 132 pmdval_t pmdval = (pte + PTE_HWTABLE_OFF) | prot;
111 pmdp[0] = __pmd(pmdval); 133 pmdp[0] = __pmd(pmdval);
134#ifndef CONFIG_ARM_LPAE
112 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t)); 135 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
136#endif
113 flush_pmd_entry(pmdp); 137 flush_pmd_entry(pmdp);
114} 138}
115 139
diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
index 470457e1cfc5..2317a71c8f8e 100644
--- a/arch/arm/include/asm/pgtable-2level.h
+++ b/arch/arm/include/asm/pgtable-2level.h
@@ -140,4 +140,45 @@
140#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */ 140#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */
141#define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) 141#define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2)
142 142
143#ifndef __ASSEMBLY__
144
145/*
146 * The "pud_xxx()" functions here are trivial when the pmd is folded into
147 * the pud: the pud entry is never bad, always exists, and can't be set or
148 * cleared.
149 */
150#define pud_none(pud) (0)
151#define pud_bad(pud) (0)
152#define pud_present(pud) (1)
153#define pud_clear(pudp) do { } while (0)
154#define set_pud(pud,pudp) do { } while (0)
155
156static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
157{
158 return (pmd_t *)pud;
159}
160
161#define pmd_bad(pmd) (pmd_val(pmd) & 2)
162
163#define copy_pmd(pmdpd,pmdps) \
164 do { \
165 pmdpd[0] = pmdps[0]; \
166 pmdpd[1] = pmdps[1]; \
167 flush_pmd_entry(pmdpd); \
168 } while (0)
169
170#define pmd_clear(pmdp) \
171 do { \
172 pmdp[0] = __pmd(0); \
173 pmdp[1] = __pmd(0); \
174 clean_pmd_entry(pmdp); \
175 } while (0)
176
177/* we don't need complex calculations here as the pmd is folded into the pgd */
178#define pmd_addr_end(addr,end) (end)
179
180#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
181
182#endif /* __ASSEMBLY__ */
183
143#endif /* _ASM_PGTABLE_2LEVEL_H */ 184#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
index 000000000000..d7952824c5c4
--- /dev/null
+++ b/arch/arm/include/asm/pgtable-3level-hwdef.h
@@ -0,0 +1,77 @@
1/*
2 * arch/arm/include/asm/pgtable-3level-hwdef.h
3 *
4 * Copyright (C) 2011 ARM Ltd.
5 * Author: Catalin Marinas <catalin.marinas@arm.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef _ASM_PGTABLE_3LEVEL_HWDEF_H
21#define _ASM_PGTABLE_3LEVEL_HWDEF_H
22
23/*
24 * Hardware page table definitions.
25 *
26 * + Level 1/2 descriptor
27 * - common
28 */
29#define PMD_TYPE_MASK (_AT(pmdval_t, 3) << 0)
30#define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0)
31#define PMD_TYPE_TABLE (_AT(pmdval_t, 3) << 0)
32#define PMD_TYPE_SECT (_AT(pmdval_t, 1) << 0)
33#define PMD_BIT4 (_AT(pmdval_t, 0))
34#define PMD_DOMAIN(x) (_AT(pmdval_t, 0))
35
36/*
37 * - section
38 */
39#define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2)
40#define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3)
41#define PMD_SECT_S (_AT(pmdval_t, 3) << 8)
42#define PMD_SECT_AF (_AT(pmdval_t, 1) << 10)
43#define PMD_SECT_nG (_AT(pmdval_t, 1) << 11)
44#define PMD_SECT_XN (_AT(pmdval_t, 1) << 54)
45#define PMD_SECT_AP_WRITE (_AT(pmdval_t, 0))
46#define PMD_SECT_AP_READ (_AT(pmdval_t, 0))
47#define PMD_SECT_TEX(x) (_AT(pmdval_t, 0))
48
49/*
50 * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).
51 */
52#define PMD_SECT_UNCACHED (_AT(pmdval_t, 0) << 2) /* strongly ordered */
53#define PMD_SECT_BUFFERED (_AT(pmdval_t, 1) << 2) /* normal non-cacheable */
54#define PMD_SECT_WT (_AT(pmdval_t, 2) << 2) /* normal inner write-through */
55#define PMD_SECT_WB (_AT(pmdval_t, 3) << 2) /* normal inner write-back */
56#define PMD_SECT_WBWA (_AT(pmdval_t, 7) << 2) /* normal inner write-alloc */
57
58/*
59 * + Level 3 descriptor (PTE)
60 */
61#define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0)
62#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)
63#define PTE_TYPE_PAGE (_AT(pteval_t, 3) << 0)
64#define PTE_BUFFERABLE (_AT(pteval_t, 1) << 2) /* AttrIndx[0] */
65#define PTE_CACHEABLE (_AT(pteval_t, 1) << 3) /* AttrIndx[1] */
66#define PTE_EXT_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */
67#define PTE_EXT_AF (_AT(pteval_t, 1) << 10) /* Access Flag */
68#define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* nG */
69#define PTE_EXT_XN (_AT(pteval_t, 1) << 54) /* XN */
70
71/*
72 * 40-bit physical address supported.
73 */
74#define PHYS_MASK_SHIFT (40)
75#define PHYS_MASK ((1ULL << PHYS_MASK_SHIFT) - 1)
76
77#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
index 000000000000..921aa30259c4
--- /dev/null
+++ b/arch/arm/include/asm/pgtable-3level-types.h
@@ -0,0 +1,70 @@
1/*
2 * arch/arm/include/asm/pgtable-3level-types.h
3 *
4 * Copyright (C) 2011 ARM Ltd.
5 * Author: Catalin Marinas <catalin.marinas@arm.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef _ASM_PGTABLE_3LEVEL_TYPES_H
21#define _ASM_PGTABLE_3LEVEL_TYPES_H
22
23#include <asm/types.h>
24
25typedef u64 pteval_t;
26typedef u64 pmdval_t;
27typedef u64 pgdval_t;
28
29#undef STRICT_MM_TYPECHECKS
30
31#ifdef STRICT_MM_TYPECHECKS
32
33/*
34 * These are used to make use of C type-checking..
35 */
36typedef struct { pteval_t pte; } pte_t;
37typedef struct { pmdval_t pmd; } pmd_t;
38typedef struct { pgdval_t pgd; } pgd_t;
39typedef struct { pteval_t pgprot; } pgprot_t;
40
41#define pte_val(x) ((x).pte)
42#define pmd_val(x) ((x).pmd)
43#define pgd_val(x) ((x).pgd)
44#define pgprot_val(x) ((x).pgprot)
45
46#define __pte(x) ((pte_t) { (x) } )
47#define __pmd(x) ((pmd_t) { (x) } )
48#define __pgd(x) ((pgd_t) { (x) } )
49#define __pgprot(x) ((pgprot_t) { (x) } )
50
51#else /* !STRICT_MM_TYPECHECKS */
52
53typedef pteval_t pte_t;
54typedef pmdval_t pmd_t;
55typedef pgdval_t pgd_t;
56typedef pteval_t pgprot_t;
57
58#define pte_val(x) (x)
59#define pmd_val(x) (x)
60#define pgd_val(x) (x)
61#define pgprot_val(x) (x)
62
63#define __pte(x) (x)
64#define __pmd(x) (x)
65#define __pgd(x) (x)
66#define __pgprot(x) (x)
67
68#endif /* STRICT_MM_TYPECHECKS */
69
70#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
index 000000000000..759af70f9a0a
--- /dev/null
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -0,0 +1,155 @@
1/*
2 * arch/arm/include/asm/pgtable-3level.h
3 *
4 * Copyright (C) 2011 ARM Ltd.
5 * Author: Catalin Marinas <catalin.marinas@arm.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef _ASM_PGTABLE_3LEVEL_H
21#define _ASM_PGTABLE_3LEVEL_H
22
23/*
24 * With LPAE, there are 3 levels of page tables. Each level has 512 entries of
25 * 8 bytes each, occupying a 4K page. The first level table covers a range of
26 * 512GB, each entry representing 1GB. Since we are limited to 4GB input
27 * address range, only 4 entries in the PGD are used.
28 *
29 * There are enough spare bits in a page table entry for the kernel specific
30 * state.
31 */
32#define PTRS_PER_PTE 512
33#define PTRS_PER_PMD 512
34#define PTRS_PER_PGD 4
35
36#define PTE_HWTABLE_PTRS (PTRS_PER_PTE)
37#define PTE_HWTABLE_OFF (0)
38#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u64))
39
40/*
41 * PGDIR_SHIFT determines the size a top-level page table entry can map.
42 */
43#define PGDIR_SHIFT 30
44
45/*
46 * PMD_SHIFT determines the size a middle-level page table entry can map.
47 */
48#define PMD_SHIFT 21
49
50#define PMD_SIZE (1UL << PMD_SHIFT)
51#define PMD_MASK (~(PMD_SIZE-1))
52#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
53#define PGDIR_MASK (~(PGDIR_SIZE-1))
54
55/*
56 * section address mask and size definitions.
57 */
58#define SECTION_SHIFT 21
59#define SECTION_SIZE (1UL << SECTION_SHIFT)
60#define SECTION_MASK (~(SECTION_SIZE-1))
61
62#define USER_PTRS_PER_PGD (PAGE_OFFSET / PGDIR_SIZE)
63
64/*
65 * "Linux" PTE definitions for LPAE.
66 *
67 * These bits overlap with the hardware bits but the naming is preserved for
68 * consistency with the classic page table format.
69 */
70#define L_PTE_PRESENT (_AT(pteval_t, 3) << 0) /* Valid */
71#define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !PRESENT */
72#define L_PTE_BUFFERABLE (_AT(pteval_t, 1) << 2) /* AttrIndx[0] */
73#define L_PTE_CACHEABLE (_AT(pteval_t, 1) << 3) /* AttrIndx[1] */
74#define L_PTE_USER (_AT(pteval_t, 1) << 6) /* AP[1] */
75#define L_PTE_RDONLY (_AT(pteval_t, 1) << 7) /* AP[2] */
76#define L_PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */
77#define L_PTE_YOUNG (_AT(pteval_t, 1) << 10) /* AF */
78#define L_PTE_XN (_AT(pteval_t, 1) << 54) /* XN */
79#define L_PTE_DIRTY (_AT(pteval_t, 1) << 55) /* unused */
80#define L_PTE_SPECIAL (_AT(pteval_t, 1) << 56) /* unused */
81
82/*
83 * To be used in assembly code with the upper page attributes.
84 */
85#define L_PTE_XN_HIGH (1 << (54 - 32))
86#define L_PTE_DIRTY_HIGH (1 << (55 - 32))
87
88/*
89 * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).
90 */
91#define L_PTE_MT_UNCACHED (_AT(pteval_t, 0) << 2) /* strongly ordered */
92#define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 1) << 2) /* normal non-cacheable */
93#define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 2) << 2) /* normal inner write-through */
94#define L_PTE_MT_WRITEBACK (_AT(pteval_t, 3) << 2) /* normal inner write-back */
95#define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 7) << 2) /* normal inner write-alloc */
96#define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 4) << 2) /* device */
97#define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 4) << 2) /* device */
98#define L_PTE_MT_DEV_WC (_AT(pteval_t, 1) << 2) /* normal non-cacheable */
99#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 3) << 2) /* normal inner write-back */
100#define L_PTE_MT_MASK (_AT(pteval_t, 7) << 2)
101
102/*
103 * Software PGD flags.
104 */
105#define L_PGD_SWAPPER (_AT(pgdval_t, 1) << 55) /* swapper_pg_dir entry */
106
107#ifndef __ASSEMBLY__
108
109#define pud_none(pud) (!pud_val(pud))
110#define pud_bad(pud) (!(pud_val(pud) & 2))
111#define pud_present(pud) (pud_val(pud))
112
113#define pud_clear(pudp) \
114 do { \
115 *pudp = __pud(0); \
116 clean_pmd_entry(pudp); \
117 } while (0)
118
119#define set_pud(pudp, pud) \
120 do { \
121 *pudp = pud; \
122 flush_pmd_entry(pudp); \
123 } while (0)
124
125static inline pmd_t *pud_page_vaddr(pud_t pud)
126{
127 return __va(pud_val(pud) & PHYS_MASK & (s32)PAGE_MASK);
128}
129
130/* Find an entry in the second-level page table.. */
131#define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
132static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
133{
134 return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr);
135}
136
137#define pmd_bad(pmd) (!(pmd_val(pmd) & 2))
138
139#define copy_pmd(pmdpd,pmdps) \
140 do { \
141 *pmdpd = *pmdps; \
142 flush_pmd_entry(pmdpd); \
143 } while (0)
144
145#define pmd_clear(pmdp) \
146 do { \
147 *pmdp = __pmd(0); \
148 clean_pmd_entry(pmdp); \
149 } while (0)
150
151#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,__pte(pte_val(pte)|(ext)))
152
153#endif /* __ASSEMBLY__ */
154
155#endif /* _ASM_PGTABLE_3LEVEL_H */
diff --git a/arch/arm/include/asm/pgtable-hwdef.h b/arch/arm/include/asm/pgtable-hwdef.h
index 183111164ce9..8426229ba292 100644
--- a/arch/arm/include/asm/pgtable-hwdef.h
+++ b/arch/arm/include/asm/pgtable-hwdef.h
@@ -10,6 +10,10 @@
10#ifndef _ASMARM_PGTABLE_HWDEF_H 10#ifndef _ASMARM_PGTABLE_HWDEF_H
11#define _ASMARM_PGTABLE_HWDEF_H 11#define _ASMARM_PGTABLE_HWDEF_H
12 12
13#ifdef CONFIG_ARM_LPAE
14#include <asm/pgtable-3level-hwdef.h>
15#else
13#include <asm/pgtable-2level-hwdef.h> 16#include <asm/pgtable-2level-hwdef.h>
17#endif
14 18
15#endif 19#endif
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 9451dce3a553..f66626d71e7d 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -11,20 +11,24 @@
11#define _ASMARM_PGTABLE_H 11#define _ASMARM_PGTABLE_H
12 12
13#include <linux/const.h> 13#include <linux/const.h>
14#include <asm-generic/4level-fixup.h>
15#include <asm/proc-fns.h> 14#include <asm/proc-fns.h>
16 15
17#ifndef CONFIG_MMU 16#ifndef CONFIG_MMU
18 17
18#include <asm-generic/4level-fixup.h>
19#include "pgtable-nommu.h" 19#include "pgtable-nommu.h"
20 20
21#else 21#else
22 22
23#include <asm-generic/pgtable-nopud.h>
23#include <asm/memory.h> 24#include <asm/memory.h>
24#include <mach/vmalloc.h>
25#include <asm/pgtable-hwdef.h> 25#include <asm/pgtable-hwdef.h>
26 26
27#ifdef CONFIG_ARM_LPAE
28#include <asm/pgtable-3level.h>
29#else
27#include <asm/pgtable-2level.h> 30#include <asm/pgtable-2level.h>
31#endif
28 32
29/* 33/*
30 * Just any arbitrary offset to the start of the vmalloc VM area: the 34 * Just any arbitrary offset to the start of the vmalloc VM area: the
@@ -33,15 +37,10 @@
33 * any out-of-bounds memory accesses will hopefully be caught. 37 * any out-of-bounds memory accesses will hopefully be caught.
34 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 38 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
35 * area for the same reason. ;) 39 * area for the same reason. ;)
36 *
37 * Note that platforms may override VMALLOC_START, but they must provide
38 * VMALLOC_END. VMALLOC_END defines the (exclusive) limit of this space,
39 * which may not overlap IO space.
40 */ 40 */
41#ifndef VMALLOC_START
42#define VMALLOC_OFFSET (8*1024*1024) 41#define VMALLOC_OFFSET (8*1024*1024)
43#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) 42#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
44#endif 43#define VMALLOC_END 0xff000000UL
45 44
46#define LIBRARY_TEXT_START 0x0c000000 45#define LIBRARY_TEXT_START 0x0c000000
47 46
@@ -163,39 +162,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
163/* to find an entry in a kernel page-table-directory */ 162/* to find an entry in a kernel page-table-directory */
164#define pgd_offset_k(addr) pgd_offset(&init_mm, addr) 163#define pgd_offset_k(addr) pgd_offset(&init_mm, addr)
165 164
166/*
167 * The "pgd_xxx()" functions here are trivial for a folded two-level
168 * setup: the pgd is never bad, and a pmd always exists (as it's folded
169 * into the pgd entry)
170 */
171#define pgd_none(pgd) (0)
172#define pgd_bad(pgd) (0)
173#define pgd_present(pgd) (1)
174#define pgd_clear(pgdp) do { } while (0)
175#define set_pgd(pgd,pgdp) do { } while (0)
176#define set_pud(pud,pudp) do { } while (0)
177
178
179/* Find an entry in the second-level page table.. */
180#define pmd_offset(dir, addr) ((pmd_t *)(dir))
181
182#define pmd_none(pmd) (!pmd_val(pmd)) 165#define pmd_none(pmd) (!pmd_val(pmd))
183#define pmd_present(pmd) (pmd_val(pmd)) 166#define pmd_present(pmd) (pmd_val(pmd))
184#define pmd_bad(pmd) (pmd_val(pmd) & 2)
185
186#define copy_pmd(pmdpd,pmdps) \
187 do { \
188 pmdpd[0] = pmdps[0]; \
189 pmdpd[1] = pmdps[1]; \
190 flush_pmd_entry(pmdpd); \
191 } while (0)
192
193#define pmd_clear(pmdp) \
194 do { \
195 pmdp[0] = __pmd(0); \
196 pmdp[1] = __pmd(0); \
197 clean_pmd_entry(pmdp); \
198 } while (0)
199 167
200static inline pte_t *pmd_page_vaddr(pmd_t pmd) 168static inline pte_t *pmd_page_vaddr(pmd_t pmd)
201{ 169{
@@ -204,10 +172,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
204 172
205#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) 173#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
206 174
207/* we don't need complex calculations here as the pmd is folded into the pgd */
208#define pmd_addr_end(addr,end) (end)
209
210
211#ifndef CONFIG_HIGHPTE 175#ifndef CONFIG_HIGHPTE
212#define __pte_map(pmd) pmd_page_vaddr(*(pmd)) 176#define __pte_map(pmd) pmd_page_vaddr(*(pmd))
213#define __pte_unmap(pte) do { } while (0) 177#define __pte_unmap(pte) do { } while (0)
@@ -229,7 +193,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
229#define pte_page(pte) pfn_to_page(pte_pfn(pte)) 193#define pte_page(pte) pfn_to_page(pte_pfn(pte))
230#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot) 194#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot)
231 195
232#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
233#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0) 196#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0)
234 197
235#if __LINUX_ARM_ARCH__ < 6 198#if __LINUX_ARM_ARCH__ < 6
@@ -336,6 +299,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
336 * We provide our own arch_get_unmapped_area to cope with VIPT caches. 299 * We provide our own arch_get_unmapped_area to cope with VIPT caches.
337 */ 300 */
338#define HAVE_ARCH_UNMAPPED_AREA 301#define HAVE_ARCH_UNMAPPED_AREA
302#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
339 303
340/* 304/*
341 * remap a physical page `pfn' of size `size' with page protection `prot' 305 * remap a physical page `pfn' of size `size' with page protection `prot'
@@ -346,9 +310,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
346 310
347#define pgtable_cache_init() do { } while (0) 311#define pgtable_cache_init() do { } while (0)
348 312
349void identity_mapping_add(pgd_t *, unsigned long, unsigned long);
350void identity_mapping_del(pgd_t *, unsigned long, unsigned long);
351
352#endif /* !__ASSEMBLY__ */ 313#endif /* !__ASSEMBLY__ */
353 314
354#endif /* CONFIG_MMU */ 315#endif /* CONFIG_MMU */
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 71d99b83cdb9..b5a5be2536c1 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -27,13 +27,22 @@ enum arm_pmu_type {
27/* 27/*
28 * struct arm_pmu_platdata - ARM PMU platform data 28 * struct arm_pmu_platdata - ARM PMU platform data
29 * 29 *
30 * @handle_irq: an optional handler which will be called from the interrupt and 30 * @handle_irq: an optional handler which will be called from the
31 * passed the address of the low level handler, and can be used to implement 31 * interrupt and passed the address of the low level handler,
32 * any platform specific handling before or after calling it. 32 * and can be used to implement any platform specific handling
33 * before or after calling it.
34 * @enable_irq: an optional handler which will be called after
35 * request_irq and be used to handle some platform specific
36 * irq enablement
37 * @disable_irq: an optional handler which will be called before
38 * free_irq and be used to handle some platform specific
39 * irq disablement
33 */ 40 */
34struct arm_pmu_platdata { 41struct arm_pmu_platdata {
35 irqreturn_t (*handle_irq)(int irq, void *dev, 42 irqreturn_t (*handle_irq)(int irq, void *dev,
36 irq_handler_t pmu_handler); 43 irq_handler_t pmu_handler);
44 void (*enable_irq)(int irq);
45 void (*disable_irq)(int irq);
37}; 46};
38 47
39#ifdef CONFIG_CPU_HAS_PMU 48#ifdef CONFIG_CPU_HAS_PMU
@@ -55,16 +64,6 @@ reserve_pmu(enum arm_pmu_type type);
55extern void 64extern void
56release_pmu(enum arm_pmu_type type); 65release_pmu(enum arm_pmu_type type);
57 66
58/**
59 * init_pmu() - Initialise the PMU.
60 *
61 * Initialise the system ready for PMU enabling. This should typically set the
62 * IRQ affinity and nothing else. The users (oprofile/perf events etc) will do
63 * the actual hardware initialisation.
64 */
65extern int
66init_pmu(enum arm_pmu_type type);
67
68#else /* CONFIG_CPU_HAS_PMU */ 67#else /* CONFIG_CPU_HAS_PMU */
69 68
70#include <linux/err.h> 69#include <linux/err.h>
diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h
index 9e92cb205e65..f3628fb3d2b3 100644
--- a/arch/arm/include/asm/proc-fns.h
+++ b/arch/arm/include/asm/proc-fns.h
@@ -65,7 +65,11 @@ extern struct processor {
65 * Set a possibly extended PTE. Non-extended PTEs should 65 * Set a possibly extended PTE. Non-extended PTEs should
66 * ignore 'ext'. 66 * ignore 'ext'.
67 */ 67 */
68#ifdef CONFIG_ARM_LPAE
69 void (*set_pte_ext)(pte_t *ptep, pte_t pte);
70#else
68 void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext); 71 void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
72#endif
69 73
70 /* Suspend/resume */ 74 /* Suspend/resume */
71 unsigned int suspend_size; 75 unsigned int suspend_size;
@@ -79,7 +83,11 @@ extern void cpu_proc_fin(void);
79extern int cpu_do_idle(void); 83extern int cpu_do_idle(void);
80extern void cpu_dcache_clean_area(void *, int); 84extern void cpu_dcache_clean_area(void *, int);
81extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); 85extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
86#ifdef CONFIG_ARM_LPAE
87extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte);
88#else
82extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext); 89extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
90#endif
83extern void cpu_reset(unsigned long addr) __attribute__((noreturn)); 91extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
84 92
85/* These three are private to arch/arm/kernel/suspend.c */ 93/* These three are private to arch/arm/kernel/suspend.c */
@@ -107,6 +115,18 @@ extern void cpu_resume(void);
107 115
108#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) 116#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
109 117
118#ifdef CONFIG_ARM_LPAE
119#define cpu_get_pgd() \
120 ({ \
121 unsigned long pg, pg2; \
122 __asm__("mrrc p15, 0, %0, %1, c2" \
123 : "=r" (pg), "=r" (pg2) \
124 : \
125 : "cc"); \
126 pg &= ~(PTRS_PER_PGD*sizeof(pgd_t)-1); \
127 (pgd_t *)phys_to_virt(pg); \
128 })
129#else
110#define cpu_get_pgd() \ 130#define cpu_get_pgd() \
111 ({ \ 131 ({ \
112 unsigned long pg; \ 132 unsigned long pg; \
@@ -115,6 +135,7 @@ extern void cpu_resume(void);
115 pg &= ~0x3fff; \ 135 pg &= ~0x3fff; \
116 (pgd_t *)phys_to_virt(pg); \ 136 (pgd_t *)phys_to_virt(pg); \
117 }) 137 })
138#endif
118 139
119#endif 140#endif
120 141
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index b2d9df5667af..ce280b8d613c 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -123,6 +123,8 @@ static inline void prefetch(const void *ptr)
123 123
124#endif 124#endif
125 125
126#define HAVE_ARCH_PICK_MMAP_LAYOUT
127
126#endif 128#endif
127 129
128#endif /* __ASM_ARM_PROCESSOR_H */ 130#endif /* __ASM_ARM_PROCESSOR_H */
diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h
index 6f65ca86a5ec..ee0363307918 100644
--- a/arch/arm/include/asm/prom.h
+++ b/arch/arm/include/asm/prom.h
@@ -13,7 +13,6 @@
13 13
14#ifdef CONFIG_OF 14#ifdef CONFIG_OF
15 15
16#include <asm/setup.h>
17#include <asm/irq.h> 16#include <asm/irq.h>
18 17
19extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); 18extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h
index c8e6ddf3e860..e3f757263438 100644
--- a/arch/arm/include/asm/sched_clock.h
+++ b/arch/arm/include/asm/sched_clock.h
@@ -8,113 +8,7 @@
8#ifndef ASM_SCHED_CLOCK 8#ifndef ASM_SCHED_CLOCK
9#define ASM_SCHED_CLOCK 9#define ASM_SCHED_CLOCK
10 10
11#include <linux/kernel.h>
12#include <linux/types.h>
13
14struct clock_data {
15 u64 epoch_ns;
16 u32 epoch_cyc;
17 u32 epoch_cyc_copy;
18 u32 mult;
19 u32 shift;
20};
21
22#define DEFINE_CLOCK_DATA(name) struct clock_data name
23
24static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
25{
26 return (cyc * mult) >> shift;
27}
28
29/*
30 * Atomically update the sched_clock epoch. Your update callback will
31 * be called from a timer before the counter wraps - read the current
32 * counter value, and call this function to safely move the epochs
33 * forward. Only use this from the update callback.
34 */
35static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
36{
37 unsigned long flags;
38 u64 ns = cd->epoch_ns +
39 cyc_to_ns((cyc - cd->epoch_cyc) & mask, cd->mult, cd->shift);
40
41 /*
42 * Write epoch_cyc and epoch_ns in a way that the update is
43 * detectable in cyc_to_fixed_sched_clock().
44 */
45 raw_local_irq_save(flags);
46 cd->epoch_cyc = cyc;
47 smp_wmb();
48 cd->epoch_ns = ns;
49 smp_wmb();
50 cd->epoch_cyc_copy = cyc;
51 raw_local_irq_restore(flags);
52}
53
54/*
55 * If your clock rate is known at compile time, using this will allow
56 * you to optimize the mult/shift loads away. This is paired with
57 * init_fixed_sched_clock() to ensure that your mult/shift are correct.
58 */
59static inline unsigned long long cyc_to_fixed_sched_clock(struct clock_data *cd,
60 u32 cyc, u32 mask, u32 mult, u32 shift)
61{
62 u64 epoch_ns;
63 u32 epoch_cyc;
64
65 /*
66 * Load the epoch_cyc and epoch_ns atomically. We do this by
67 * ensuring that we always write epoch_cyc, epoch_ns and
68 * epoch_cyc_copy in strict order, and read them in strict order.
69 * If epoch_cyc and epoch_cyc_copy are not equal, then we're in
70 * the middle of an update, and we should repeat the load.
71 */
72 do {
73 epoch_cyc = cd->epoch_cyc;
74 smp_rmb();
75 epoch_ns = cd->epoch_ns;
76 smp_rmb();
77 } while (epoch_cyc != cd->epoch_cyc_copy);
78
79 return epoch_ns + cyc_to_ns((cyc - epoch_cyc) & mask, mult, shift);
80}
81
82/*
83 * Otherwise, you need to use this, which will obtain the mult/shift
84 * from the clock_data structure. Use init_sched_clock() with this.
85 */
86static inline unsigned long long cyc_to_sched_clock(struct clock_data *cd,
87 u32 cyc, u32 mask)
88{
89 return cyc_to_fixed_sched_clock(cd, cyc, mask, cd->mult, cd->shift);
90}
91
92/*
93 * Initialize the clock data - calculate the appropriate multiplier
94 * and shift. Also setup a timer to ensure that the epoch is refreshed
95 * at the appropriate time interval, which will call your update
96 * handler.
97 */
98void init_sched_clock(struct clock_data *, void (*)(void),
99 unsigned int, unsigned long);
100
101/*
102 * Use this initialization function rather than init_sched_clock() if
103 * you're using cyc_to_fixed_sched_clock, which will warn if your
104 * constants are incorrect.
105 */
106static inline void init_fixed_sched_clock(struct clock_data *cd,
107 void (*update)(void), unsigned int bits, unsigned long rate,
108 u32 mult, u32 shift)
109{
110 init_sched_clock(cd, update, bits, rate);
111 if (cd->mult != mult || cd->shift != shift) {
112 pr_crit("sched_clock: wrong multiply/shift: %u>>%u vs calculated %u>>%u\n"
113 "sched_clock: fix multiply/shift to avoid scheduler hiccups\n",
114 mult, shift, cd->mult, cd->shift);
115 }
116}
117
118extern void sched_clock_postinit(void); 11extern void sched_clock_postinit(void);
12extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
119 13
120#endif 14#endif
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 915696dd9c7c..23ebc0c82a39 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -192,11 +192,7 @@ static const struct tagtable __tagtable_##fn __tag = { tag, fn }
192/* 192/*
193 * Memory map description 193 * Memory map description
194 */ 194 */
195#ifdef CONFIG_ARCH_EP93XX 195#define NR_BANKS CONFIG_ARM_NR_BANKS
196# define NR_BANKS 16
197#else
198# define NR_BANKS 8
199#endif
200 196
201struct membank { 197struct membank {
202 phys_addr_t start; 198 phys_addr_t start;
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
index 90ffd04b8e74..dec6f9afb3cf 100644
--- a/arch/arm/include/asm/socket.h
+++ b/arch/arm/include/asm/socket.h
@@ -62,4 +62,7 @@
62 62
63#define SO_RXQ_OVFL 40 63#define SO_RXQ_OVFL 40
64 64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67
65#endif /* _ASM_SOCKET_H */ 68#endif /* _ASM_SOCKET_H */
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index 9997ad20eff1..32ee164a2f6b 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -24,12 +24,13 @@
24 24
25#if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6 25#if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6
26 26
27static inline __attribute_const__ __u16 __arch_swab16(__u16 x) 27static inline __attribute_const__ __u32 __arch_swahb32(__u32 x)
28{ 28{
29 __asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x)); 29 __asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x));
30 return x; 30 return x;
31} 31}
32#define __arch_swab16 __arch_swab16 32#define __arch_swahb32 __arch_swahb32
33#define __arch_swab16(x) ((__u16)__arch_swahb32(x))
33 34
34static inline __attribute_const__ __u32 __arch_swab32(__u32 x) 35static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
35{ 36{
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 984014b92647..e4c96cc6ec0c 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -80,6 +80,14 @@ struct siginfo;
80void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, 80void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
81 unsigned long err, unsigned long trap); 81 unsigned long err, unsigned long trap);
82 82
83#ifdef CONFIG_ARM_LPAE
84#define FAULT_CODE_ALIGNMENT 33
85#define FAULT_CODE_DEBUG 34
86#else
87#define FAULT_CODE_ALIGNMENT 1
88#define FAULT_CODE_DEBUG 2
89#endif
90
83void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, 91void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
84 struct pt_regs *), 92 struct pt_regs *),
85 int sig, int code, const char *name); 93 int sig, int code, const char *name);
@@ -100,7 +108,7 @@ extern void __show_regs(struct pt_regs *);
100extern int __pure cpu_architecture(void); 108extern int __pure cpu_architecture(void);
101extern void cpu_init(void); 109extern void cpu_init(void);
102 110
103void arm_machine_restart(char mode, const char *cmd); 111void soft_restart(unsigned long);
104extern void (*arm_pm_restart)(char str, const char *cmd); 112extern void (*arm_pm_restart)(char str, const char *cmd);
105 113
106#define UDBG_UNDEFINED (1 << 0) 114#define UDBG_UNDEFINED (1 << 0)
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 7b5cc8dae06e..0f30c3a78fc1 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -142,7 +142,6 @@ extern void vfp_flush_hwstate(struct thread_info *);
142#define TIF_POLLING_NRFLAG 16 142#define TIF_POLLING_NRFLAG 16
143#define TIF_USING_IWMMXT 17 143#define TIF_USING_IWMMXT 17
144#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 144#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
145#define TIF_FREEZE 19
146#define TIF_RESTORE_SIGMASK 20 145#define TIF_RESTORE_SIGMASK 20
147#define TIF_SECCOMP 21 146#define TIF_SECCOMP 21
148 147
@@ -152,7 +151,6 @@ extern void vfp_flush_hwstate(struct thread_info *);
152#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 151#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
153#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 152#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
154#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) 153#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
155#define _TIF_FREEZE (1 << TIF_FREEZE)
156#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 154#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
157#define _TIF_SECCOMP (1 << TIF_SECCOMP) 155#define _TIF_SECCOMP (1 << TIF_SECCOMP)
158 156
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 265f908c4a6e..5d3ed7e38561 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -202,8 +202,18 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
202 tlb_remove_page(tlb, pte); 202 tlb_remove_page(tlb, pte);
203} 203}
204 204
205static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
206 unsigned long addr)
207{
208#ifdef CONFIG_ARM_LPAE
209 tlb_add_flush(tlb, addr);
210 tlb_remove_page(tlb, virt_to_page(pmdp));
211#endif
212}
213
205#define pte_free_tlb(tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr) 214#define pte_free_tlb(tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr)
206#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp) 215#define pmd_free_tlb(tlb, pmdp, addr) __pmd_free_tlb(tlb, pmdp, addr)
216#define pud_free_tlb(tlb, pudp, addr) pud_free((tlb)->mm, pudp)
207 217
208#define tlb_migrate_finish(mm) do { } while (0) 218#define tlb_migrate_finish(mm) do { } while (0)
209 219
diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h
index a7e457ed27c3..58b8b84adcd2 100644
--- a/arch/arm/include/asm/topology.h
+++ b/arch/arm/include/asm/topology.h
@@ -25,7 +25,7 @@ extern struct cputopo_arm cpu_topology[NR_CPUS];
25 25
26void init_cpu_topology(void); 26void init_cpu_topology(void);
27void store_cpu_topology(unsigned int cpuid); 27void store_cpu_topology(unsigned int cpuid);
28const struct cpumask *cpu_coregroup_mask(unsigned int cpu); 28const struct cpumask *cpu_coregroup_mask(int cpu);
29 29
30#else 30#else
31 31
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
index 48192ac3a23a..28beab917ffc 100644
--- a/arch/arm/include/asm/types.h
+++ b/arch/arm/include/asm/types.h
@@ -3,12 +3,6 @@
3 3
4#include <asm-generic/int-ll64.h> 4#include <asm-generic/int-ll64.h>
5 5
6#ifndef __ASSEMBLY__
7
8typedef unsigned short umode_t;
9
10#endif /* __ASSEMBLY__ */
11
12/* 6/*
13 * These aren't exported outside the kernel to avoid name space clashes 7 * These aren't exported outside the kernel to avoid name space clashes
14 */ 8 */
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index c60a2944f95b..4a1123783806 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -402,6 +402,8 @@
402#define __NR_syncfs (__NR_SYSCALL_BASE+373) 402#define __NR_syncfs (__NR_SYSCALL_BASE+373)
403#define __NR_sendmmsg (__NR_SYSCALL_BASE+374) 403#define __NR_sendmmsg (__NR_SYSCALL_BASE+374)
404#define __NR_setns (__NR_SYSCALL_BASE+375) 404#define __NR_setns (__NR_SYSCALL_BASE+375)
405#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
406#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
405 407
406/* 408/*
407 * The following SWIs are ARM private. 409 * The following SWIs are ARM private.
diff --git a/arch/arm/include/asm/unwind.h b/arch/arm/include/asm/unwind.h
index a5edf421005c..d1c3f3a71c94 100644
--- a/arch/arm/include/asm/unwind.h
+++ b/arch/arm/include/asm/unwind.h
@@ -30,14 +30,15 @@ enum unwind_reason_code {
30}; 30};
31 31
32struct unwind_idx { 32struct unwind_idx {
33 unsigned long addr; 33 unsigned long addr_offset;
34 unsigned long insn; 34 unsigned long insn;
35}; 35};
36 36
37struct unwind_table { 37struct unwind_table {
38 struct list_head list; 38 struct list_head list;
39 struct unwind_idx *start; 39 const struct unwind_idx *start;
40 struct unwind_idx *stop; 40 const struct unwind_idx *origin;
41 const struct unwind_idx *stop;
41 unsigned long begin_addr; 42 unsigned long begin_addr;
42 unsigned long end_addr; 43 unsigned long end_addr;
43}; 44};
@@ -49,15 +50,6 @@ extern struct unwind_table *unwind_table_add(unsigned long start,
49extern void unwind_table_del(struct unwind_table *tab); 50extern void unwind_table_del(struct unwind_table *tab);
50extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk); 51extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk);
51 52
52#ifdef CONFIG_ARM_UNWIND
53extern int __init unwind_init(void);
54#else
55static inline int __init unwind_init(void)
56{
57 return 0;
58}
59#endif
60
61#endif /* !__ASSEMBLY__ */ 53#endif /* !__ASSEMBLY__ */
62 54
63#ifdef CONFIG_ARM_UNWIND 55#ifdef CONFIG_ARM_UNWIND
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 16eed6aebfa4..43b740d0e374 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -13,7 +13,7 @@ CFLAGS_REMOVE_return_address.o = -pg
13 13
14# Object file lists. 14# Object file lists.
15 15
16obj-y := elf.o entry-armv.o entry-common.o irq.o \ 16obj-y := elf.o entry-armv.o entry-common.o irq.o opcodes.o \
17 process.o ptrace.o return_address.o setup.o signal.o \ 17 process.o ptrace.o return_address.o setup.o signal.o \
18 sys_arm.o stacktrace.o time.o traps.o 18 sys_arm.o stacktrace.o time.o traps.o
19 19
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 9943e9e74a1b..463ff4a0ec8a 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -385,6 +385,8 @@
385 CALL(sys_syncfs) 385 CALL(sys_syncfs)
386 CALL(sys_sendmmsg) 386 CALL(sys_sendmmsg)
387/* 375 */ CALL(sys_setns) 387/* 375 */ CALL(sys_setns)
388 CALL(sys_process_vm_readv)
389 CALL(sys_process_vm_writev)
388#ifndef syscalls_counted 390#ifndef syscalls_counted
389.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 391.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
390#define syscalls_counted 392#define syscalls_counted
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 9ad50c4208ae..3a456c6c7005 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -36,12 +36,11 @@
36#ifdef CONFIG_MULTI_IRQ_HANDLER 36#ifdef CONFIG_MULTI_IRQ_HANDLER
37 ldr r1, =handle_arch_irq 37 ldr r1, =handle_arch_irq
38 mov r0, sp 38 mov r0, sp
39 ldr r1, [r1]
40 adr lr, BSYM(9997f) 39 adr lr, BSYM(9997f)
41 teq r1, #0 40 ldr pc, [r1]
42 movne pc, r1 41#else
43#endif
44 arch_irq_handler_default 42 arch_irq_handler_default
43#endif
459997: 449997:
46 .endm 45 .endm
47 46
@@ -497,7 +496,7 @@ ENDPROC(__und_usr)
497 .popsection 496 .popsection
498 .pushsection __ex_table,"a" 497 .pushsection __ex_table,"a"
499 .long 1b, 4b 498 .long 1b, 4b
500#if __LINUX_ARM_ARCH__ >= 7 499#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
501 .long 2b, 4b 500 .long 2b, 4b
502 .long 3b, 4b 501 .long 3b, 4b
503#endif 502#endif
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 566c54c2a1fe..14e277d2ff91 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -39,8 +39,14 @@
39#error KERNEL_RAM_VADDR must start at 0xXXXX8000 39#error KERNEL_RAM_VADDR must start at 0xXXXX8000
40#endif 40#endif
41 41
42#ifdef CONFIG_ARM_LPAE
43 /* LPAE requires an additional page for the PGD */
44#define PG_DIR_SIZE 0x5000
45#define PMD_ORDER 3
46#else
42#define PG_DIR_SIZE 0x4000 47#define PG_DIR_SIZE 0x4000
43#define PMD_ORDER 2 48#define PMD_ORDER 2
49#endif
44 50
45 .globl swapper_pg_dir 51 .globl swapper_pg_dir
46 .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE 52 .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE
@@ -164,17 +170,36 @@ __create_page_tables:
164 teq r0, r6 170 teq r0, r6
165 bne 1b 171 bne 1b
166 172
173#ifdef CONFIG_ARM_LPAE
174 /*
175 * Build the PGD table (first level) to point to the PMD table. A PGD
176 * entry is 64-bit wide.
177 */
178 mov r0, r4
179 add r3, r4, #0x1000 @ first PMD table address
180 orr r3, r3, #3 @ PGD block type
181 mov r6, #4 @ PTRS_PER_PGD
182 mov r7, #1 << (55 - 32) @ L_PGD_SWAPPER
1831: str r3, [r0], #4 @ set bottom PGD entry bits
184 str r7, [r0], #4 @ set top PGD entry bits
185 add r3, r3, #0x1000 @ next PMD table
186 subs r6, r6, #1
187 bne 1b
188
189 add r4, r4, #0x1000 @ point to the PMD tables
190#endif
191
167 ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags 192 ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags
168 193
169 /* 194 /*
170 * Create identity mapping to cater for __enable_mmu. 195 * Create identity mapping to cater for __enable_mmu.
171 * This identity mapping will be removed by paging_init(). 196 * This identity mapping will be removed by paging_init().
172 */ 197 */
173 adr r0, __enable_mmu_loc 198 adr r0, __turn_mmu_on_loc
174 ldmia r0, {r3, r5, r6} 199 ldmia r0, {r3, r5, r6}
175 sub r0, r0, r3 @ virt->phys offset 200 sub r0, r0, r3 @ virt->phys offset
176 add r5, r5, r0 @ phys __enable_mmu 201 add r5, r5, r0 @ phys __turn_mmu_on
177 add r6, r6, r0 @ phys __enable_mmu_end 202 add r6, r6, r0 @ phys __turn_mmu_on_end
178 mov r5, r5, lsr #SECTION_SHIFT 203 mov r5, r5, lsr #SECTION_SHIFT
179 mov r6, r6, lsr #SECTION_SHIFT 204 mov r6, r6, lsr #SECTION_SHIFT
180 205
@@ -219,8 +244,8 @@ __create_page_tables:
219#endif 244#endif
220 245
221 /* 246 /*
222 * Then map boot params address in r2 or 247 * Then map boot params address in r2 or the first 1MB (2MB with LPAE)
223 * the first 1MB of ram if boot params address is not specified. 248 * of ram if boot params address is not specified.
224 */ 249 */
225 mov r0, r2, lsr #SECTION_SHIFT 250 mov r0, r2, lsr #SECTION_SHIFT
226 movs r0, r0, lsl #SECTION_SHIFT 251 movs r0, r0, lsl #SECTION_SHIFT
@@ -251,7 +276,15 @@ __create_page_tables:
251 mov r3, r7, lsr #SECTION_SHIFT 276 mov r3, r7, lsr #SECTION_SHIFT
252 ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags 277 ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags
253 orr r3, r7, r3, lsl #SECTION_SHIFT 278 orr r3, r7, r3, lsl #SECTION_SHIFT
279#ifdef CONFIG_ARM_LPAE
280 mov r7, #1 << (54 - 32) @ XN
281#else
282 orr r3, r3, #PMD_SECT_XN
283#endif
2541: str r3, [r0], #4 2841: str r3, [r0], #4
285#ifdef CONFIG_ARM_LPAE
286 str r7, [r0], #4
287#endif
255 add r3, r3, #1 << SECTION_SHIFT 288 add r3, r3, #1 << SECTION_SHIFT
256 cmp r0, r6 289 cmp r0, r6
257 blo 1b 290 blo 1b
@@ -283,14 +316,17 @@ __create_page_tables:
283 str r3, [r0] 316 str r3, [r0]
284#endif 317#endif
285#endif 318#endif
319#ifdef CONFIG_ARM_LPAE
320 sub r4, r4, #0x1000 @ point to the PGD table
321#endif
286 mov pc, lr 322 mov pc, lr
287ENDPROC(__create_page_tables) 323ENDPROC(__create_page_tables)
288 .ltorg 324 .ltorg
289 .align 325 .align
290__enable_mmu_loc: 326__turn_mmu_on_loc:
291 .long . 327 .long .
292 .long __enable_mmu 328 .long __turn_mmu_on
293 .long __enable_mmu_end 329 .long __turn_mmu_on_end
294 330
295#if defined(CONFIG_SMP) 331#if defined(CONFIG_SMP)
296 __CPUINIT 332 __CPUINIT
@@ -360,7 +396,7 @@ __secondary_data:
360 * r13 = *virtual* address to jump to upon completion 396 * r13 = *virtual* address to jump to upon completion
361 */ 397 */
362__enable_mmu: 398__enable_mmu:
363#ifdef CONFIG_ALIGNMENT_TRAP 399#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
364 orr r0, r0, #CR_A 400 orr r0, r0, #CR_A
365#else 401#else
366 bic r0, r0, #CR_A 402 bic r0, r0, #CR_A
@@ -374,12 +410,17 @@ __enable_mmu:
374#ifdef CONFIG_CPU_ICACHE_DISABLE 410#ifdef CONFIG_CPU_ICACHE_DISABLE
375 bic r0, r0, #CR_I 411 bic r0, r0, #CR_I
376#endif 412#endif
413#ifdef CONFIG_ARM_LPAE
414 mov r5, #0
415 mcrr p15, 0, r4, r5, c2 @ load TTBR0
416#else
377 mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ 417 mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
378 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ 418 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
379 domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \ 419 domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \
380 domain_val(DOMAIN_IO, DOMAIN_CLIENT)) 420 domain_val(DOMAIN_IO, DOMAIN_CLIENT))
381 mcr p15, 0, r5, c3, c0, 0 @ load domain access register 421 mcr p15, 0, r5, c3, c0, 0 @ load domain access register
382 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer 422 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
423#endif
383 b __turn_mmu_on 424 b __turn_mmu_on
384ENDPROC(__enable_mmu) 425ENDPROC(__enable_mmu)
385 426
@@ -398,15 +439,19 @@ ENDPROC(__enable_mmu)
398 * other registers depend on the function called upon completion 439 * other registers depend on the function called upon completion
399 */ 440 */
400 .align 5 441 .align 5
401__turn_mmu_on: 442 .pushsection .idmap.text, "ax"
443ENTRY(__turn_mmu_on)
402 mov r0, r0 444 mov r0, r0
445 instr_sync
403 mcr p15, 0, r0, c1, c0, 0 @ write control reg 446 mcr p15, 0, r0, c1, c0, 0 @ write control reg
404 mrc p15, 0, r3, c0, c0, 0 @ read id reg 447 mrc p15, 0, r3, c0, c0, 0 @ read id reg
448 instr_sync
405 mov r3, r3 449 mov r3, r3
406 mov r3, r13 450 mov r3, r13
407 mov pc, r3 451 mov pc, r3
408__enable_mmu_end: 452__turn_mmu_on_end:
409ENDPROC(__turn_mmu_on) 453ENDPROC(__turn_mmu_on)
454 .popsection
410 455
411 456
412#ifdef CONFIG_SMP_ON_UP 457#ifdef CONFIG_SMP_ON_UP
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 814a52a9dc39..d6a95ef9131d 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -1016,10 +1016,10 @@ static int __init arch_hw_breakpoint_init(void)
1016 } 1016 }
1017 1017
1018 /* Register debug fault handler. */ 1018 /* Register debug fault handler. */
1019 hook_fault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT, 1019 hook_fault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP,
1020 "watchpoint debug exception"); 1020 TRAP_HWBKPT, "watchpoint debug exception");
1021 hook_ifault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT, 1021 hook_ifault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP,
1022 "breakpoint debug exception"); 1022 TRAP_HWBKPT, "breakpoint debug exception");
1023 1023
1024 /* Register hotplug notifier. */ 1024 /* Register hotplug notifier. */
1025 register_cpu_notifier(&dbg_reset_nb); 1025 register_cpu_notifier(&dbg_reset_nb);
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c
index 9fe8910308af..8a30c89da70e 100644
--- a/arch/arm/kernel/kprobes-arm.c
+++ b/arch/arm/kernel/kprobes-arm.c
@@ -519,10 +519,12 @@ static const union decode_item arm_cccc_0000_____1001_table[] = {
519static const union decode_item arm_cccc_0001_____1001_table[] = { 519static const union decode_item arm_cccc_0001_____1001_table[] = {
520 /* Synchronization primitives */ 520 /* Synchronization primitives */
521 521
522#if __LINUX_ARM_ARCH__ < 6
523 /* Deprecated on ARMv6 and may be UNDEFINED on v7 */
522 /* SMP/SWPB cccc 0001 0x00 xxxx xxxx xxxx 1001 xxxx */ 524 /* SMP/SWPB cccc 0001 0x00 xxxx xxxx xxxx 1001 xxxx */
523 DECODE_EMULATEX (0x0fb000f0, 0x01000090, emulate_rd12rn16rm0_rwflags_nopc, 525 DECODE_EMULATEX (0x0fb000f0, 0x01000090, emulate_rd12rn16rm0_rwflags_nopc,
524 REGS(NOPC, NOPC, 0, 0, NOPC)), 526 REGS(NOPC, NOPC, 0, 0, NOPC)),
525 527#endif
526 /* LDREX/STREX{,D,B,H} cccc 0001 1xxx xxxx xxxx xxxx 1001 xxxx */ 528 /* LDREX/STREX{,D,B,H} cccc 0001 1xxx xxxx xxxx xxxx 1001 xxxx */
527 /* And unallocated instructions... */ 529 /* And unallocated instructions... */
528 DECODE_END 530 DECODE_END
diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
index fc82de8bdcce..ba32b393b3f0 100644
--- a/arch/arm/kernel/kprobes-test-arm.c
+++ b/arch/arm/kernel/kprobes-test-arm.c
@@ -427,18 +427,25 @@ void kprobe_arm_test_cases(void)
427 427
428 TEST_GROUP("Synchronization primitives") 428 TEST_GROUP("Synchronization primitives")
429 429
430 /* 430#if __LINUX_ARM_ARCH__ < 6
431 * Use hard coded constants for SWP instructions to avoid warnings 431 TEST_RP("swp lr, r",7,VAL2,", [r",8,0,"]")
432 * about deprecated instructions. 432 TEST_R( "swpvs r0, r",1,VAL1,", [sp]")
433 */ 433 TEST_RP("swp sp, r",14,VAL2,", [r",12,13*4,"]")
434 TEST_RP( ".word 0xe108e097 @ swp lr, r",7,VAL2,", [r",8,0,"]") 434#else
435 TEST_R( ".word 0x610d0091 @ swpvs r0, r",1,VAL1,", [sp]") 435 TEST_UNSUPPORTED(".word 0xe108e097 @ swp lr, r7, [r8]")
436 TEST_RP( ".word 0xe10cd09e @ swp sp, r",14,VAL2,", [r",12,13*4,"]") 436 TEST_UNSUPPORTED(".word 0x610d0091 @ swpvs r0, r1, [sp]")
437 TEST_UNSUPPORTED(".word 0xe10cd09e @ swp sp, r14 [r12]")
438#endif
437 TEST_UNSUPPORTED(".word 0xe102f091 @ swp pc, r1, [r2]") 439 TEST_UNSUPPORTED(".word 0xe102f091 @ swp pc, r1, [r2]")
438 TEST_UNSUPPORTED(".word 0xe102009f @ swp r0, pc, [r2]") 440 TEST_UNSUPPORTED(".word 0xe102009f @ swp r0, pc, [r2]")
439 TEST_UNSUPPORTED(".word 0xe10f0091 @ swp r0, r1, [pc]") 441 TEST_UNSUPPORTED(".word 0xe10f0091 @ swp r0, r1, [pc]")
440 TEST_RP( ".word 0xe148e097 @ swpb lr, r",7,VAL2,", [r",8,0,"]") 442#if __LINUX_ARM_ARCH__ < 6
441 TEST_R( ".word 0x614d0091 @ swpvsb r0, r",1,VAL1,", [sp]") 443 TEST_RP("swpb lr, r",7,VAL2,", [r",8,0,"]")
444 TEST_R( "swpvsb r0, r",1,VAL1,", [sp]")
445#else
446 TEST_UNSUPPORTED(".word 0xe148e097 @ swpb lr, r7, [r8]")
447 TEST_UNSUPPORTED(".word 0x614d0091 @ swpvsb r0, r1, [sp]")
448#endif
442 TEST_UNSUPPORTED(".word 0xe142f091 @ swpb pc, r1, [r2]") 449 TEST_UNSUPPORTED(".word 0xe142f091 @ swpb pc, r1, [r2]")
443 450
444 TEST_UNSUPPORTED(".word 0xe1100090") /* Unallocated space */ 451 TEST_UNSUPPORTED(".word 0xe1100090") /* Unallocated space */
@@ -550,7 +557,7 @@ void kprobe_arm_test_cases(void)
550 TEST_RPR( "strccd r",8, VAL2,", [r",13,0, ", r",12,48,"]") 557 TEST_RPR( "strccd r",8, VAL2,", [r",13,0, ", r",12,48,"]")
551 TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!") 558 TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!")
552 TEST_RPR( "strcsd r",12,VAL2,", [r",11,48,", -r",10,24,"]!") 559 TEST_RPR( "strcsd r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
553 TEST_RPR( "strd r",2, VAL1,", [r",3, 24,"], r",4,48,"") 560 TEST_RPR( "strd r",2, VAL1,", [r",5, 24,"], r",4,48,"")
554 TEST_RPR( "strd r",10,VAL2,", [r",9, 48,"], -r",7,24,"") 561 TEST_RPR( "strd r",10,VAL2,", [r",9, 48,"], -r",7,24,"")
555 TEST_UNSUPPORTED(".word 0xe1afc0fa @ strd r12, [pc, r10]!") 562 TEST_UNSUPPORTED(".word 0xe1afc0fa @ strd r12, [pc, r10]!")
556 563
diff --git a/arch/arm/kernel/kprobes-test-thumb.c b/arch/arm/kernel/kprobes-test-thumb.c
index 5e726c31c45a..5d8b85792222 100644
--- a/arch/arm/kernel/kprobes-test-thumb.c
+++ b/arch/arm/kernel/kprobes-test-thumb.c
@@ -222,8 +222,8 @@ void kprobe_thumb16_test_cases(void)
222DONT_TEST_IN_ITBLOCK( 222DONT_TEST_IN_ITBLOCK(
223 TEST_BF_R( "cbnz r",0,0, ", 2f") 223 TEST_BF_R( "cbnz r",0,0, ", 2f")
224 TEST_BF_R( "cbz r",2,-1,", 2f") 224 TEST_BF_R( "cbz r",2,-1,", 2f")
225 TEST_BF_RX( "cbnz r",4,1, ", 2f",0x20) 225 TEST_BF_RX( "cbnz r",4,1, ", 2f", SPACE_0x20)
226 TEST_BF_RX( "cbz r",7,0, ", 2f",0x40) 226 TEST_BF_RX( "cbz r",7,0, ", 2f", SPACE_0x40)
227) 227)
228 TEST_R("sxth r0, r",7, HH1,"") 228 TEST_R("sxth r0, r",7, HH1,"")
229 TEST_R("sxth r7, r",0, HH2,"") 229 TEST_R("sxth r7, r",0, HH2,"")
@@ -246,7 +246,7 @@ DONT_TEST_IN_ITBLOCK(
246 TESTCASE_START(code) \ 246 TESTCASE_START(code) \
247 TEST_ARG_PTR(13, offset) \ 247 TEST_ARG_PTR(13, offset) \
248 TEST_ARG_END("") \ 248 TEST_ARG_END("") \
249 TEST_BRANCH_F(code,0) \ 249 TEST_BRANCH_F(code) \
250 TESTCASE_END 250 TESTCASE_END
251 251
252 TEST("push {r0}") 252 TEST("push {r0}")
@@ -319,8 +319,8 @@ CONDITION_INSTRUCTIONS(8,
319 319
320 TEST_BF( "b 2f") 320 TEST_BF( "b 2f")
321 TEST_BB( "b 2b") 321 TEST_BB( "b 2b")
322 TEST_BF_X("b 2f", 0x400) 322 TEST_BF_X("b 2f", SPACE_0x400)
323 TEST_BB_X("b 2b", 0x400) 323 TEST_BB_X("b 2b", SPACE_0x400)
324 324
325 TEST_GROUP("Testing instructions in IT blocks") 325 TEST_GROUP("Testing instructions in IT blocks")
326 326
@@ -746,7 +746,7 @@ CONDITION_INSTRUCTIONS(22,
746 TEST_BB("bne.w 2b") 746 TEST_BB("bne.w 2b")
747 TEST_BF("bgt.w 2f") 747 TEST_BF("bgt.w 2f")
748 TEST_BB("blt.w 2b") 748 TEST_BB("blt.w 2b")
749 TEST_BF_X("bpl.w 2f",0x1000) 749 TEST_BF_X("bpl.w 2f", SPACE_0x1000)
750) 750)
751 751
752 TEST_UNSUPPORTED("msr cpsr, r0") 752 TEST_UNSUPPORTED("msr cpsr, r0")
@@ -786,11 +786,11 @@ CONDITION_INSTRUCTIONS(22,
786 786
787 TEST_BF( "b.w 2f") 787 TEST_BF( "b.w 2f")
788 TEST_BB( "b.w 2b") 788 TEST_BB( "b.w 2b")
789 TEST_BF_X("b.w 2f", 0x1000) 789 TEST_BF_X("b.w 2f", SPACE_0x1000)
790 790
791 TEST_BF( "bl.w 2f") 791 TEST_BF( "bl.w 2f")
792 TEST_BB( "bl.w 2b") 792 TEST_BB( "bl.w 2b")
793 TEST_BB_X("bl.w 2b", 0x1000) 793 TEST_BB_X("bl.w 2b", SPACE_0x1000)
794 794
795 TEST_X( "blx __dummy_arm_subroutine", 795 TEST_X( "blx __dummy_arm_subroutine",
796 ".arm \n\t" 796 ".arm \n\t"
diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
index e17cdd6d90d8..1862d8f2fd44 100644
--- a/arch/arm/kernel/kprobes-test.c
+++ b/arch/arm/kernel/kprobes-test.c
@@ -202,6 +202,8 @@
202#include <linux/slab.h> 202#include <linux/slab.h>
203#include <linux/kprobes.h> 203#include <linux/kprobes.h>
204 204
205#include <asm/opcodes.h>
206
205#include "kprobes.h" 207#include "kprobes.h"
206#include "kprobes-test.h" 208#include "kprobes-test.h"
207 209
@@ -1050,65 +1052,9 @@ static int test_instance;
1050 1052
1051static unsigned long test_check_cc(int cc, unsigned long cpsr) 1053static unsigned long test_check_cc(int cc, unsigned long cpsr)
1052{ 1054{
1053 unsigned long temp; 1055 int ret = arm_check_condition(cc << 28, cpsr);
1054
1055 switch (cc) {
1056 case 0x0: /* eq */
1057 return cpsr & PSR_Z_BIT;
1058
1059 case 0x1: /* ne */
1060 return (~cpsr) & PSR_Z_BIT;
1061
1062 case 0x2: /* cs */
1063 return cpsr & PSR_C_BIT;
1064
1065 case 0x3: /* cc */
1066 return (~cpsr) & PSR_C_BIT;
1067
1068 case 0x4: /* mi */
1069 return cpsr & PSR_N_BIT;
1070
1071 case 0x5: /* pl */
1072 return (~cpsr) & PSR_N_BIT;
1073
1074 case 0x6: /* vs */
1075 return cpsr & PSR_V_BIT;
1076
1077 case 0x7: /* vc */
1078 return (~cpsr) & PSR_V_BIT;
1079 1056
1080 case 0x8: /* hi */ 1057 return (ret != ARM_OPCODE_CONDTEST_FAIL);
1081 cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
1082 return cpsr & PSR_C_BIT;
1083
1084 case 0x9: /* ls */
1085 cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
1086 return (~cpsr) & PSR_C_BIT;
1087
1088 case 0xa: /* ge */
1089 cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1090 return (~cpsr) & PSR_N_BIT;
1091
1092 case 0xb: /* lt */
1093 cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1094 return cpsr & PSR_N_BIT;
1095
1096 case 0xc: /* gt */
1097 temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1098 temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
1099 return (~temp) & PSR_N_BIT;
1100
1101 case 0xd: /* le */
1102 temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1103 temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
1104 return temp & PSR_N_BIT;
1105
1106 case 0xe: /* al */
1107 case 0xf: /* unconditional */
1108 return true;
1109 }
1110 BUG();
1111 return false;
1112} 1058}
1113 1059
1114static int is_last_scenario; 1060static int is_last_scenario;
@@ -1128,7 +1074,9 @@ static unsigned long test_context_cpsr(int scenario)
1128 1074
1129 if (!test_case_is_thumb) { 1075 if (!test_case_is_thumb) {
1130 /* Testing ARM code */ 1076 /* Testing ARM code */
1131 probe_should_run = test_check_cc(current_instruction >> 28, cpsr) != 0; 1077 int cc = current_instruction >> 28;
1078
1079 probe_should_run = test_check_cc(cc, cpsr) != 0;
1132 if (scenario == 15) 1080 if (scenario == 15)
1133 is_last_scenario = true; 1081 is_last_scenario = true;
1134 1082
diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h
index 0dc5d77b9356..e28a869b1ae4 100644
--- a/arch/arm/kernel/kprobes-test.h
+++ b/arch/arm/kernel/kprobes-test.h
@@ -149,23 +149,31 @@ struct test_arg_end {
149 "1: "instruction" \n\t" \ 149 "1: "instruction" \n\t" \
150 " nop \n\t" 150 " nop \n\t"
151 151
152#define TEST_BRANCH_F(instruction, xtra_dist) \ 152#define TEST_BRANCH_F(instruction) \
153 TEST_INSTRUCTION(instruction) \ 153 TEST_INSTRUCTION(instruction) \
154 ".if "#xtra_dist" \n\t" \
155 " b 99f \n\t" \ 154 " b 99f \n\t" \
156 ".space "#xtra_dist" \n\t" \ 155 "2: nop \n\t"
157 ".endif \n\t" \ 156
157#define TEST_BRANCH_B(instruction) \
158 " b 50f \n\t" \
159 " b 99f \n\t" \
160 "2: nop \n\t" \
161 " b 99f \n\t" \
162 TEST_INSTRUCTION(instruction)
163
164#define TEST_BRANCH_FX(instruction, codex) \
165 TEST_INSTRUCTION(instruction) \
166 " b 99f \n\t" \
167 codex" \n\t" \
158 " b 99f \n\t" \ 168 " b 99f \n\t" \
159 "2: nop \n\t" 169 "2: nop \n\t"
160 170
161#define TEST_BRANCH_B(instruction, xtra_dist) \ 171#define TEST_BRANCH_BX(instruction, codex) \
162 " b 50f \n\t" \ 172 " b 50f \n\t" \
163 " b 99f \n\t" \ 173 " b 99f \n\t" \
164 "2: nop \n\t" \ 174 "2: nop \n\t" \
165 " b 99f \n\t" \ 175 " b 99f \n\t" \
166 ".if "#xtra_dist" \n\t" \ 176 codex" \n\t" \
167 ".space "#xtra_dist" \n\t" \
168 ".endif \n\t" \
169 TEST_INSTRUCTION(instruction) 177 TEST_INSTRUCTION(instruction)
170 178
171#define TESTCASE_END \ 179#define TESTCASE_END \
@@ -301,47 +309,60 @@ struct test_arg_end {
301 TESTCASE_START(code1 #reg1 code2) \ 309 TESTCASE_START(code1 #reg1 code2) \
302 TEST_ARG_PTR(reg1, val1) \ 310 TEST_ARG_PTR(reg1, val1) \
303 TEST_ARG_END("") \ 311 TEST_ARG_END("") \
304 TEST_BRANCH_F(code1 #reg1 code2, 0) \ 312 TEST_BRANCH_F(code1 #reg1 code2) \
305 TESTCASE_END 313 TESTCASE_END
306 314
307#define TEST_BF_X(code, xtra_dist) \ 315#define TEST_BF(code) \
308 TESTCASE_START(code) \ 316 TESTCASE_START(code) \
309 TEST_ARG_END("") \ 317 TEST_ARG_END("") \
310 TEST_BRANCH_F(code, xtra_dist) \ 318 TEST_BRANCH_F(code) \
311 TESTCASE_END 319 TESTCASE_END
312 320
313#define TEST_BB_X(code, xtra_dist) \ 321#define TEST_BB(code) \
314 TESTCASE_START(code) \ 322 TESTCASE_START(code) \
315 TEST_ARG_END("") \ 323 TEST_ARG_END("") \
316 TEST_BRANCH_B(code, xtra_dist) \ 324 TEST_BRANCH_B(code) \
317 TESTCASE_END 325 TESTCASE_END
318 326
319#define TEST_BF_RX(code1, reg, val, code2, xtra_dist) \ 327#define TEST_BF_R(code1, reg, val, code2) \
320 TESTCASE_START(code1 #reg code2) \ 328 TESTCASE_START(code1 #reg code2) \
321 TEST_ARG_REG(reg, val) \ 329 TEST_ARG_REG(reg, val) \
322 TEST_ARG_END("") \ 330 TEST_ARG_END("") \
323 TEST_BRANCH_F(code1 #reg code2, xtra_dist) \ 331 TEST_BRANCH_F(code1 #reg code2) \
324 TESTCASE_END 332 TESTCASE_END
325 333
326#define TEST_BB_RX(code1, reg, val, code2, xtra_dist) \ 334#define TEST_BB_R(code1, reg, val, code2) \
327 TESTCASE_START(code1 #reg code2) \ 335 TESTCASE_START(code1 #reg code2) \
328 TEST_ARG_REG(reg, val) \ 336 TEST_ARG_REG(reg, val) \
329 TEST_ARG_END("") \ 337 TEST_ARG_END("") \
330 TEST_BRANCH_B(code1 #reg code2, xtra_dist) \ 338 TEST_BRANCH_B(code1 #reg code2) \
331 TESTCASE_END 339 TESTCASE_END
332 340
333#define TEST_BF(code) TEST_BF_X(code, 0)
334#define TEST_BB(code) TEST_BB_X(code, 0)
335
336#define TEST_BF_R(code1, reg, val, code2) TEST_BF_RX(code1, reg, val, code2, 0)
337#define TEST_BB_R(code1, reg, val, code2) TEST_BB_RX(code1, reg, val, code2, 0)
338
339#define TEST_BF_RR(code1, reg1, val1, code2, reg2, val2, code3) \ 341#define TEST_BF_RR(code1, reg1, val1, code2, reg2, val2, code3) \
340 TESTCASE_START(code1 #reg1 code2 #reg2 code3) \ 342 TESTCASE_START(code1 #reg1 code2 #reg2 code3) \
341 TEST_ARG_REG(reg1, val1) \ 343 TEST_ARG_REG(reg1, val1) \
342 TEST_ARG_REG(reg2, val2) \ 344 TEST_ARG_REG(reg2, val2) \
343 TEST_ARG_END("") \ 345 TEST_ARG_END("") \
344 TEST_BRANCH_F(code1 #reg1 code2 #reg2 code3, 0) \ 346 TEST_BRANCH_F(code1 #reg1 code2 #reg2 code3) \
347 TESTCASE_END
348
349#define TEST_BF_X(code, codex) \
350 TESTCASE_START(code) \
351 TEST_ARG_END("") \
352 TEST_BRANCH_FX(code, codex) \
353 TESTCASE_END
354
355#define TEST_BB_X(code, codex) \
356 TESTCASE_START(code) \
357 TEST_ARG_END("") \
358 TEST_BRANCH_BX(code, codex) \
359 TESTCASE_END
360
361#define TEST_BF_RX(code1, reg, val, code2, codex) \
362 TESTCASE_START(code1 #reg code2) \
363 TEST_ARG_REG(reg, val) \
364 TEST_ARG_END("") \
365 TEST_BRANCH_FX(code1 #reg code2, codex) \
345 TESTCASE_END 366 TESTCASE_END
346 367
347#define TEST_X(code, codex) \ 368#define TEST_X(code, codex) \
@@ -372,6 +393,25 @@ struct test_arg_end {
372 TESTCASE_END 393 TESTCASE_END
373 394
374 395
396/*
397 * Macros for defining space directives spread over multiple lines.
398 * These are required so the compiler guesses better the length of inline asm
399 * code and will spill the literal pool early enough to avoid generating PC
400 * relative loads with out of range offsets.
401 */
402#define TWICE(x) x x
403#define SPACE_0x8 TWICE(".space 4\n\t")
404#define SPACE_0x10 TWICE(SPACE_0x8)
405#define SPACE_0x20 TWICE(SPACE_0x10)
406#define SPACE_0x40 TWICE(SPACE_0x20)
407#define SPACE_0x80 TWICE(SPACE_0x40)
408#define SPACE_0x100 TWICE(SPACE_0x80)
409#define SPACE_0x200 TWICE(SPACE_0x100)
410#define SPACE_0x400 TWICE(SPACE_0x200)
411#define SPACE_0x800 TWICE(SPACE_0x400)
412#define SPACE_0x1000 TWICE(SPACE_0x800)
413
414
375/* Various values used in test cases... */ 415/* Various values used in test cases... */
376#define N(val) (val ^ 0xffffffff) 416#define N(val) (val ^ 0xffffffff)
377#define VAL1 0x12345678 417#define VAL1 0x12345678
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c
index 0bcd38341573..1911dae19e4f 100644
--- a/arch/arm/kernel/leds.c
+++ b/arch/arm/kernel/leds.c
@@ -9,7 +9,7 @@
9 */ 9 */
10#include <linux/export.h> 10#include <linux/export.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/sysdev.h> 12#include <linux/device.h>
13#include <linux/syscore_ops.h> 13#include <linux/syscore_ops.h>
14#include <linux/string.h> 14#include <linux/string.h>
15 15
@@ -34,8 +34,8 @@ static const struct leds_evt_name evt_names[] = {
34 { "red", led_red_on, led_red_off }, 34 { "red", led_red_on, led_red_off },
35}; 35};
36 36
37static ssize_t leds_store(struct sys_device *dev, 37static ssize_t leds_store(struct device *dev,
38 struct sysdev_attribute *attr, 38 struct device_attribute *attr,
39 const char *buf, size_t size) 39 const char *buf, size_t size)
40{ 40{
41 int ret = -EINVAL, len = strcspn(buf, " "); 41 int ret = -EINVAL, len = strcspn(buf, " ");
@@ -69,15 +69,16 @@ static ssize_t leds_store(struct sys_device *dev,
69 return ret; 69 return ret;
70} 70}
71 71
72static SYSDEV_ATTR(event, 0200, NULL, leds_store); 72static DEVICE_ATTR(event, 0200, NULL, leds_store);
73 73
74static struct sysdev_class leds_sysclass = { 74static struct bus_type leds_subsys = {
75 .name = "leds", 75 .name = "leds",
76 .dev_name = "leds",
76}; 77};
77 78
78static struct sys_device leds_device = { 79static struct device leds_device = {
79 .id = 0, 80 .id = 0,
80 .cls = &leds_sysclass, 81 .bus = &leds_subsys,
81}; 82};
82 83
83static int leds_suspend(void) 84static int leds_suspend(void)
@@ -105,11 +106,11 @@ static struct syscore_ops leds_syscore_ops = {
105static int __init leds_init(void) 106static int __init leds_init(void)
106{ 107{
107 int ret; 108 int ret;
108 ret = sysdev_class_register(&leds_sysclass); 109 ret = subsys_system_register(&leds_subsys, NULL);
109 if (ret == 0) 110 if (ret == 0)
110 ret = sysdev_register(&leds_device); 111 ret = device_register(&leds_device);
111 if (ret == 0) 112 if (ret == 0)
112 ret = sysdev_create_file(&leds_device, &attr_event); 113 ret = device_create_file(&leds_device, &dev_attr_event);
113 if (ret == 0) 114 if (ret == 0)
114 register_syscore_ops(&leds_syscore_ops); 115 register_syscore_ops(&leds_syscore_ops);
115 return ret; 116 return ret;
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index c1b4463dcc83..764bd456d84f 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -12,12 +12,11 @@
12#include <asm/mmu_context.h> 12#include <asm/mmu_context.h>
13#include <asm/cacheflush.h> 13#include <asm/cacheflush.h>
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15#include <asm/system.h>
15 16
16extern const unsigned char relocate_new_kernel[]; 17extern const unsigned char relocate_new_kernel[];
17extern const unsigned int relocate_new_kernel_size; 18extern const unsigned int relocate_new_kernel_size;
18 19
19extern void setup_mm_for_reboot(char mode);
20
21extern unsigned long kexec_start_address; 20extern unsigned long kexec_start_address;
22extern unsigned long kexec_indirection_page; 21extern unsigned long kexec_indirection_page;
23extern unsigned long kexec_mach_type; 22extern unsigned long kexec_mach_type;
@@ -32,24 +31,6 @@ static atomic_t waiting_for_crash_ipi;
32 31
33int machine_kexec_prepare(struct kimage *image) 32int machine_kexec_prepare(struct kimage *image)
34{ 33{
35 unsigned long page_list;
36 void *reboot_code_buffer;
37 page_list = image->head & PAGE_MASK;
38
39 reboot_code_buffer = page_address(image->control_code_page);
40
41 /* Prepare parameters for reboot_code_buffer*/
42 kexec_start_address = image->start;
43 kexec_indirection_page = page_list;
44 kexec_mach_type = machine_arch_type;
45 kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
46
47 /* copy our kernel relocation code to the control code page */
48 memcpy(reboot_code_buffer,
49 relocate_new_kernel, relocate_new_kernel_size);
50
51 flush_icache_range((unsigned long) reboot_code_buffer,
52 (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
53 return 0; 34 return 0;
54} 35}
55 36
@@ -100,26 +81,35 @@ void (*kexec_reinit)(void);
100 81
101void machine_kexec(struct kimage *image) 82void machine_kexec(struct kimage *image)
102{ 83{
84 unsigned long page_list;
103 unsigned long reboot_code_buffer_phys; 85 unsigned long reboot_code_buffer_phys;
104 void *reboot_code_buffer; 86 void *reboot_code_buffer;
105 87
88
89 page_list = image->head & PAGE_MASK;
90
106 /* we need both effective and real address here */ 91 /* we need both effective and real address here */
107 reboot_code_buffer_phys = 92 reboot_code_buffer_phys =
108 page_to_pfn(image->control_code_page) << PAGE_SHIFT; 93 page_to_pfn(image->control_code_page) << PAGE_SHIFT;
109 reboot_code_buffer = page_address(image->control_code_page); 94 reboot_code_buffer = page_address(image->control_code_page);
110 95
96 /* Prepare parameters for reboot_code_buffer*/
97 kexec_start_address = image->start;
98 kexec_indirection_page = page_list;
99 kexec_mach_type = machine_arch_type;
100 kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
101
102 /* copy our kernel relocation code to the control code page */
103 memcpy(reboot_code_buffer,
104 relocate_new_kernel, relocate_new_kernel_size);
105
106
107 flush_icache_range((unsigned long) reboot_code_buffer,
108 (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
111 printk(KERN_INFO "Bye!\n"); 109 printk(KERN_INFO "Bye!\n");
112 110
113 if (kexec_reinit) 111 if (kexec_reinit)
114 kexec_reinit(); 112 kexec_reinit();
115 local_irq_disable(); 113
116 local_fiq_disable(); 114 soft_restart(reboot_code_buffer_phys);
117 setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
118 flush_cache_all();
119 outer_flush_all();
120 outer_disable();
121 cpu_proc_fin();
122 outer_inv_all();
123 flush_cache_all();
124 cpu_reset(reboot_code_buffer_phys);
125} 115}
diff --git a/arch/arm/kernel/opcodes.c b/arch/arm/kernel/opcodes.c
new file mode 100644
index 000000000000..f8179c6a817f
--- /dev/null
+++ b/arch/arm/kernel/opcodes.c
@@ -0,0 +1,72 @@
1/*
2 * linux/arch/arm/kernel/opcodes.c
3 *
4 * A32 condition code lookup feature moved from nwfpe/fpopcode.c
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
12#include <asm/opcodes.h>
13
14#define ARM_OPCODE_CONDITION_UNCOND 0xf
15
16/*
17 * condition code lookup table
18 * index into the table is test code: EQ, NE, ... LT, GT, AL, NV
19 *
20 * bit position in short is condition code: NZCV
21 */
22static const unsigned short cc_map[16] = {
23 0xF0F0, /* EQ == Z set */
24 0x0F0F, /* NE */
25 0xCCCC, /* CS == C set */
26 0x3333, /* CC */
27 0xFF00, /* MI == N set */
28 0x00FF, /* PL */
29 0xAAAA, /* VS == V set */
30 0x5555, /* VC */
31 0x0C0C, /* HI == C set && Z clear */
32 0xF3F3, /* LS == C clear || Z set */
33 0xAA55, /* GE == (N==V) */
34 0x55AA, /* LT == (N!=V) */
35 0x0A05, /* GT == (!Z && (N==V)) */
36 0xF5FA, /* LE == (Z || (N!=V)) */
37 0xFFFF, /* AL always */
38 0 /* NV */
39};
40
41/*
42 * Returns:
43 * ARM_OPCODE_CONDTEST_FAIL - if condition fails
44 * ARM_OPCODE_CONDTEST_PASS - if condition passes (including AL)
45 * ARM_OPCODE_CONDTEST_UNCOND - if NV condition, or separate unconditional
46 * opcode space from v5 onwards
47 *
48 * Code that tests whether a conditional instruction would pass its condition
49 * check should check that return value == ARM_OPCODE_CONDTEST_PASS.
50 *
51 * Code that tests if a condition means that the instruction would be executed
52 * (regardless of conditional or unconditional) should instead check that the
53 * return value != ARM_OPCODE_CONDTEST_FAIL.
54 */
55asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr)
56{
57 u32 cc_bits = opcode >> 28;
58 u32 psr_cond = psr >> 28;
59 unsigned int ret;
60
61 if (cc_bits != ARM_OPCODE_CONDITION_UNCOND) {
62 if ((cc_map[cc_bits] >> (psr_cond)) & 1)
63 ret = ARM_OPCODE_CONDTEST_PASS;
64 else
65 ret = ARM_OPCODE_CONDTEST_FAIL;
66 } else {
67 ret = ARM_OPCODE_CONDTEST_UNCOND;
68 }
69
70 return ret;
71}
72EXPORT_SYMBOL_GPL(arm_check_condition);
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 24e2347be6b1..5bb91bf3d47f 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -59,8 +59,7 @@ armpmu_get_pmu_id(void)
59} 59}
60EXPORT_SYMBOL_GPL(armpmu_get_pmu_id); 60EXPORT_SYMBOL_GPL(armpmu_get_pmu_id);
61 61
62int 62int perf_num_counters(void)
63armpmu_get_max_events(void)
64{ 63{
65 int max_events = 0; 64 int max_events = 0;
66 65
@@ -69,12 +68,6 @@ armpmu_get_max_events(void)
69 68
70 return max_events; 69 return max_events;
71} 70}
72EXPORT_SYMBOL_GPL(armpmu_get_max_events);
73
74int perf_num_counters(void)
75{
76 return armpmu_get_max_events();
77}
78EXPORT_SYMBOL_GPL(perf_num_counters); 71EXPORT_SYMBOL_GPL(perf_num_counters);
79 72
80#define HW_OP_UNSUPPORTED 0xFFFF 73#define HW_OP_UNSUPPORTED 0xFFFF
@@ -343,19 +336,25 @@ validate_group(struct perf_event *event)
343{ 336{
344 struct perf_event *sibling, *leader = event->group_leader; 337 struct perf_event *sibling, *leader = event->group_leader;
345 struct pmu_hw_events fake_pmu; 338 struct pmu_hw_events fake_pmu;
339 DECLARE_BITMAP(fake_used_mask, ARMPMU_MAX_HWEVENTS);
346 340
347 memset(&fake_pmu, 0, sizeof(fake_pmu)); 341 /*
342 * Initialise the fake PMU. We only need to populate the
343 * used_mask for the purposes of validation.
344 */
345 memset(fake_used_mask, 0, sizeof(fake_used_mask));
346 fake_pmu.used_mask = fake_used_mask;
348 347
349 if (!validate_event(&fake_pmu, leader)) 348 if (!validate_event(&fake_pmu, leader))
350 return -ENOSPC; 349 return -EINVAL;
351 350
352 list_for_each_entry(sibling, &leader->sibling_list, group_entry) { 351 list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
353 if (!validate_event(&fake_pmu, sibling)) 352 if (!validate_event(&fake_pmu, sibling))
354 return -ENOSPC; 353 return -EINVAL;
355 } 354 }
356 355
357 if (!validate_event(&fake_pmu, event)) 356 if (!validate_event(&fake_pmu, event))
358 return -ENOSPC; 357 return -EINVAL;
359 358
360 return 0; 359 return 0;
361} 360}
@@ -374,6 +373,8 @@ armpmu_release_hardware(struct arm_pmu *armpmu)
374{ 373{
375 int i, irq, irqs; 374 int i, irq, irqs;
376 struct platform_device *pmu_device = armpmu->plat_device; 375 struct platform_device *pmu_device = armpmu->plat_device;
376 struct arm_pmu_platdata *plat =
377 dev_get_platdata(&pmu_device->dev);
377 378
378 irqs = min(pmu_device->num_resources, num_possible_cpus()); 379 irqs = min(pmu_device->num_resources, num_possible_cpus());
379 380
@@ -381,8 +382,11 @@ armpmu_release_hardware(struct arm_pmu *armpmu)
381 if (!cpumask_test_and_clear_cpu(i, &armpmu->active_irqs)) 382 if (!cpumask_test_and_clear_cpu(i, &armpmu->active_irqs))
382 continue; 383 continue;
383 irq = platform_get_irq(pmu_device, i); 384 irq = platform_get_irq(pmu_device, i);
384 if (irq >= 0) 385 if (irq >= 0) {
386 if (plat && plat->disable_irq)
387 plat->disable_irq(irq);
385 free_irq(irq, armpmu); 388 free_irq(irq, armpmu);
389 }
386 } 390 }
387 391
388 release_pmu(armpmu->type); 392 release_pmu(armpmu->type);
@@ -396,6 +400,9 @@ armpmu_reserve_hardware(struct arm_pmu *armpmu)
396 int i, err, irq, irqs; 400 int i, err, irq, irqs;
397 struct platform_device *pmu_device = armpmu->plat_device; 401 struct platform_device *pmu_device = armpmu->plat_device;
398 402
403 if (!pmu_device)
404 return -ENODEV;
405
399 err = reserve_pmu(armpmu->type); 406 err = reserve_pmu(armpmu->type);
400 if (err) { 407 if (err) {
401 pr_warning("unable to reserve pmu\n"); 408 pr_warning("unable to reserve pmu\n");
@@ -439,7 +446,8 @@ armpmu_reserve_hardware(struct arm_pmu *armpmu)
439 irq); 446 irq);
440 armpmu_release_hardware(armpmu); 447 armpmu_release_hardware(armpmu);
441 return err; 448 return err;
442 } 449 } else if (plat && plat->enable_irq)
450 plat->enable_irq(irq);
443 451
444 cpumask_set_cpu(i, &armpmu->active_irqs); 452 cpumask_set_cpu(i, &armpmu->active_irqs);
445 } 453 }
@@ -631,6 +639,9 @@ static struct platform_device_id armpmu_plat_device_ids[] = {
631 639
632static int __devinit armpmu_device_probe(struct platform_device *pdev) 640static int __devinit armpmu_device_probe(struct platform_device *pdev)
633{ 641{
642 if (!cpu_pmu)
643 return -ENODEV;
644
634 cpu_pmu->plat_device = pdev; 645 cpu_pmu->plat_device = pdev;
635 return 0; 646 return 0;
636} 647}
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c
index e63d8115c01b..533be9930ec2 100644
--- a/arch/arm/kernel/perf_event_v6.c
+++ b/arch/arm/kernel/perf_event_v6.c
@@ -65,13 +65,15 @@ enum armv6_counters {
65 * accesses/misses in hardware. 65 * accesses/misses in hardware.
66 */ 66 */
67static const unsigned armv6_perf_map[PERF_COUNT_HW_MAX] = { 67static const unsigned armv6_perf_map[PERF_COUNT_HW_MAX] = {
68 [PERF_COUNT_HW_CPU_CYCLES] = ARMV6_PERFCTR_CPU_CYCLES, 68 [PERF_COUNT_HW_CPU_CYCLES] = ARMV6_PERFCTR_CPU_CYCLES,
69 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6_PERFCTR_INSTR_EXEC, 69 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6_PERFCTR_INSTR_EXEC,
70 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, 70 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
71 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, 71 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
72 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6_PERFCTR_BR_EXEC, 72 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6_PERFCTR_BR_EXEC,
73 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6_PERFCTR_BR_MISPREDICT, 73 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6_PERFCTR_BR_MISPREDICT,
74 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, 74 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
75 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV6_PERFCTR_IBUF_STALL,
76 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = ARMV6_PERFCTR_LSU_FULL_STALL,
75}; 77};
76 78
77static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] 79static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
@@ -218,13 +220,15 @@ enum armv6mpcore_perf_types {
218 * accesses/misses in hardware. 220 * accesses/misses in hardware.
219 */ 221 */
220static const unsigned armv6mpcore_perf_map[PERF_COUNT_HW_MAX] = { 222static const unsigned armv6mpcore_perf_map[PERF_COUNT_HW_MAX] = {
221 [PERF_COUNT_HW_CPU_CYCLES] = ARMV6MPCORE_PERFCTR_CPU_CYCLES, 223 [PERF_COUNT_HW_CPU_CYCLES] = ARMV6MPCORE_PERFCTR_CPU_CYCLES,
222 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_INSTR_EXEC, 224 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_INSTR_EXEC,
223 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, 225 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
224 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, 226 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
225 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_BR_EXEC, 227 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_BR_EXEC,
226 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6MPCORE_PERFCTR_BR_MISPREDICT, 228 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6MPCORE_PERFCTR_BR_MISPREDICT,
227 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, 229 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
230 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV6MPCORE_PERFCTR_IBUF_STALL,
231 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = ARMV6MPCORE_PERFCTR_LSU_FULL_STALL,
228}; 232};
229 233
230static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] 234static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 1ef6d0034b85..460bbbb6b885 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -28,165 +28,87 @@ static struct arm_pmu armv7pmu;
28 * they are not available. 28 * they are not available.
29 */ 29 */
30enum armv7_perf_types { 30enum armv7_perf_types {
31 ARMV7_PERFCTR_PMNC_SW_INCR = 0x00, 31 ARMV7_PERFCTR_PMNC_SW_INCR = 0x00,
32 ARMV7_PERFCTR_IFETCH_MISS = 0x01, 32 ARMV7_PERFCTR_L1_ICACHE_REFILL = 0x01,
33 ARMV7_PERFCTR_ITLB_MISS = 0x02, 33 ARMV7_PERFCTR_ITLB_REFILL = 0x02,
34 ARMV7_PERFCTR_DCACHE_REFILL = 0x03, /* L1 */ 34 ARMV7_PERFCTR_L1_DCACHE_REFILL = 0x03,
35 ARMV7_PERFCTR_DCACHE_ACCESS = 0x04, /* L1 */ 35 ARMV7_PERFCTR_L1_DCACHE_ACCESS = 0x04,
36 ARMV7_PERFCTR_DTLB_REFILL = 0x05, 36 ARMV7_PERFCTR_DTLB_REFILL = 0x05,
37 ARMV7_PERFCTR_DREAD = 0x06, 37 ARMV7_PERFCTR_MEM_READ = 0x06,
38 ARMV7_PERFCTR_DWRITE = 0x07, 38 ARMV7_PERFCTR_MEM_WRITE = 0x07,
39 ARMV7_PERFCTR_INSTR_EXECUTED = 0x08, 39 ARMV7_PERFCTR_INSTR_EXECUTED = 0x08,
40 ARMV7_PERFCTR_EXC_TAKEN = 0x09, 40 ARMV7_PERFCTR_EXC_TAKEN = 0x09,
41 ARMV7_PERFCTR_EXC_EXECUTED = 0x0A, 41 ARMV7_PERFCTR_EXC_EXECUTED = 0x0A,
42 ARMV7_PERFCTR_CID_WRITE = 0x0B, 42 ARMV7_PERFCTR_CID_WRITE = 0x0B,
43 /* ARMV7_PERFCTR_PC_WRITE is equivalent to HW_BRANCH_INSTRUCTIONS. 43
44 /*
45 * ARMV7_PERFCTR_PC_WRITE is equivalent to HW_BRANCH_INSTRUCTIONS.
44 * It counts: 46 * It counts:
45 * - all branch instructions, 47 * - all (taken) branch instructions,
46 * - instructions that explicitly write the PC, 48 * - instructions that explicitly write the PC,
47 * - exception generating instructions. 49 * - exception generating instructions.
48 */ 50 */
49 ARMV7_PERFCTR_PC_WRITE = 0x0C, 51 ARMV7_PERFCTR_PC_WRITE = 0x0C,
50 ARMV7_PERFCTR_PC_IMM_BRANCH = 0x0D, 52 ARMV7_PERFCTR_PC_IMM_BRANCH = 0x0D,
51 ARMV7_PERFCTR_PC_PROC_RETURN = 0x0E, 53 ARMV7_PERFCTR_PC_PROC_RETURN = 0x0E,
52 ARMV7_PERFCTR_UNALIGNED_ACCESS = 0x0F, 54 ARMV7_PERFCTR_MEM_UNALIGNED_ACCESS = 0x0F,
55 ARMV7_PERFCTR_PC_BRANCH_MIS_PRED = 0x10,
56 ARMV7_PERFCTR_CLOCK_CYCLES = 0x11,
57 ARMV7_PERFCTR_PC_BRANCH_PRED = 0x12,
53 58
54 /* These events are defined by the PMUv2 supplement (ARM DDI 0457A). */ 59 /* These events are defined by the PMUv2 supplement (ARM DDI 0457A). */
55 ARMV7_PERFCTR_PC_BRANCH_MIS_PRED = 0x10, 60 ARMV7_PERFCTR_MEM_ACCESS = 0x13,
56 ARMV7_PERFCTR_CLOCK_CYCLES = 0x11, 61 ARMV7_PERFCTR_L1_ICACHE_ACCESS = 0x14,
57 ARMV7_PERFCTR_PC_BRANCH_PRED = 0x12, 62 ARMV7_PERFCTR_L1_DCACHE_WB = 0x15,
58 ARMV7_PERFCTR_MEM_ACCESS = 0x13, 63 ARMV7_PERFCTR_L2_CACHE_ACCESS = 0x16,
59 ARMV7_PERFCTR_L1_ICACHE_ACCESS = 0x14, 64 ARMV7_PERFCTR_L2_CACHE_REFILL = 0x17,
60 ARMV7_PERFCTR_L1_DCACHE_WB = 0x15, 65 ARMV7_PERFCTR_L2_CACHE_WB = 0x18,
61 ARMV7_PERFCTR_L2_DCACHE_ACCESS = 0x16, 66 ARMV7_PERFCTR_BUS_ACCESS = 0x19,
62 ARMV7_PERFCTR_L2_DCACHE_REFILL = 0x17, 67 ARMV7_PERFCTR_MEM_ERROR = 0x1A,
63 ARMV7_PERFCTR_L2_DCACHE_WB = 0x18, 68 ARMV7_PERFCTR_INSTR_SPEC = 0x1B,
64 ARMV7_PERFCTR_BUS_ACCESS = 0x19, 69 ARMV7_PERFCTR_TTBR_WRITE = 0x1C,
65 ARMV7_PERFCTR_MEMORY_ERROR = 0x1A, 70 ARMV7_PERFCTR_BUS_CYCLES = 0x1D,
66 ARMV7_PERFCTR_INSTR_SPEC = 0x1B, 71
67 ARMV7_PERFCTR_TTBR_WRITE = 0x1C, 72 ARMV7_PERFCTR_CPU_CYCLES = 0xFF
68 ARMV7_PERFCTR_BUS_CYCLES = 0x1D,
69
70 ARMV7_PERFCTR_CPU_CYCLES = 0xFF
71}; 73};
72 74
73/* ARMv7 Cortex-A8 specific event types */ 75/* ARMv7 Cortex-A8 specific event types */
74enum armv7_a8_perf_types { 76enum armv7_a8_perf_types {
75 ARMV7_PERFCTR_WRITE_BUFFER_FULL = 0x40, 77 ARMV7_A8_PERFCTR_L2_CACHE_ACCESS = 0x43,
76 ARMV7_PERFCTR_L2_STORE_MERGED = 0x41, 78 ARMV7_A8_PERFCTR_L2_CACHE_REFILL = 0x44,
77 ARMV7_PERFCTR_L2_STORE_BUFF = 0x42, 79 ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS = 0x50,
78 ARMV7_PERFCTR_L2_ACCESS = 0x43, 80 ARMV7_A8_PERFCTR_STALL_ISIDE = 0x56,
79 ARMV7_PERFCTR_L2_CACH_MISS = 0x44,
80 ARMV7_PERFCTR_AXI_READ_CYCLES = 0x45,
81 ARMV7_PERFCTR_AXI_WRITE_CYCLES = 0x46,
82 ARMV7_PERFCTR_MEMORY_REPLAY = 0x47,
83 ARMV7_PERFCTR_UNALIGNED_ACCESS_REPLAY = 0x48,
84 ARMV7_PERFCTR_L1_DATA_MISS = 0x49,
85 ARMV7_PERFCTR_L1_INST_MISS = 0x4A,
86 ARMV7_PERFCTR_L1_DATA_COLORING = 0x4B,
87 ARMV7_PERFCTR_L1_NEON_DATA = 0x4C,
88 ARMV7_PERFCTR_L1_NEON_CACH_DATA = 0x4D,
89 ARMV7_PERFCTR_L2_NEON = 0x4E,
90 ARMV7_PERFCTR_L2_NEON_HIT = 0x4F,
91 ARMV7_PERFCTR_L1_INST = 0x50,
92 ARMV7_PERFCTR_PC_RETURN_MIS_PRED = 0x51,
93 ARMV7_PERFCTR_PC_BRANCH_FAILED = 0x52,
94 ARMV7_PERFCTR_PC_BRANCH_TAKEN = 0x53,
95 ARMV7_PERFCTR_PC_BRANCH_EXECUTED = 0x54,
96 ARMV7_PERFCTR_OP_EXECUTED = 0x55,
97 ARMV7_PERFCTR_CYCLES_INST_STALL = 0x56,
98 ARMV7_PERFCTR_CYCLES_INST = 0x57,
99 ARMV7_PERFCTR_CYCLES_NEON_DATA_STALL = 0x58,
100 ARMV7_PERFCTR_CYCLES_NEON_INST_STALL = 0x59,
101 ARMV7_PERFCTR_NEON_CYCLES = 0x5A,
102
103 ARMV7_PERFCTR_PMU0_EVENTS = 0x70,
104 ARMV7_PERFCTR_PMU1_EVENTS = 0x71,
105 ARMV7_PERFCTR_PMU_EVENTS = 0x72,
106}; 81};
107 82
108/* ARMv7 Cortex-A9 specific event types */ 83/* ARMv7 Cortex-A9 specific event types */
109enum armv7_a9_perf_types { 84enum armv7_a9_perf_types {
110 ARMV7_PERFCTR_JAVA_HW_BYTECODE_EXEC = 0x40, 85 ARMV7_A9_PERFCTR_INSTR_CORE_RENAME = 0x68,
111 ARMV7_PERFCTR_JAVA_SW_BYTECODE_EXEC = 0x41, 86 ARMV7_A9_PERFCTR_STALL_ICACHE = 0x60,
112 ARMV7_PERFCTR_JAZELLE_BRANCH_EXEC = 0x42, 87 ARMV7_A9_PERFCTR_STALL_DISPATCH = 0x66,
113
114 ARMV7_PERFCTR_COHERENT_LINE_MISS = 0x50,
115 ARMV7_PERFCTR_COHERENT_LINE_HIT = 0x51,
116
117 ARMV7_PERFCTR_ICACHE_DEP_STALL_CYCLES = 0x60,
118 ARMV7_PERFCTR_DCACHE_DEP_STALL_CYCLES = 0x61,
119 ARMV7_PERFCTR_TLB_MISS_DEP_STALL_CYCLES = 0x62,
120 ARMV7_PERFCTR_STREX_EXECUTED_PASSED = 0x63,
121 ARMV7_PERFCTR_STREX_EXECUTED_FAILED = 0x64,
122 ARMV7_PERFCTR_DATA_EVICTION = 0x65,
123 ARMV7_PERFCTR_ISSUE_STAGE_NO_INST = 0x66,
124 ARMV7_PERFCTR_ISSUE_STAGE_EMPTY = 0x67,
125 ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE = 0x68,
126
127 ARMV7_PERFCTR_PREDICTABLE_FUNCT_RETURNS = 0x6E,
128
129 ARMV7_PERFCTR_MAIN_UNIT_EXECUTED_INST = 0x70,
130 ARMV7_PERFCTR_SECOND_UNIT_EXECUTED_INST = 0x71,
131 ARMV7_PERFCTR_LD_ST_UNIT_EXECUTED_INST = 0x72,
132 ARMV7_PERFCTR_FP_EXECUTED_INST = 0x73,
133 ARMV7_PERFCTR_NEON_EXECUTED_INST = 0x74,
134
135 ARMV7_PERFCTR_PLD_FULL_DEP_STALL_CYCLES = 0x80,
136 ARMV7_PERFCTR_DATA_WR_DEP_STALL_CYCLES = 0x81,
137 ARMV7_PERFCTR_ITLB_MISS_DEP_STALL_CYCLES = 0x82,
138 ARMV7_PERFCTR_DTLB_MISS_DEP_STALL_CYCLES = 0x83,
139 ARMV7_PERFCTR_MICRO_ITLB_MISS_DEP_STALL_CYCLES = 0x84,
140 ARMV7_PERFCTR_MICRO_DTLB_MISS_DEP_STALL_CYCLES = 0x85,
141 ARMV7_PERFCTR_DMB_DEP_STALL_CYCLES = 0x86,
142
143 ARMV7_PERFCTR_INTGR_CLK_ENABLED_CYCLES = 0x8A,
144 ARMV7_PERFCTR_DATA_ENGINE_CLK_EN_CYCLES = 0x8B,
145
146 ARMV7_PERFCTR_ISB_INST = 0x90,
147 ARMV7_PERFCTR_DSB_INST = 0x91,
148 ARMV7_PERFCTR_DMB_INST = 0x92,
149 ARMV7_PERFCTR_EXT_INTERRUPTS = 0x93,
150
151 ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_COMPLETED = 0xA0,
152 ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_SKIPPED = 0xA1,
153 ARMV7_PERFCTR_PLE_FIFO_FLUSH = 0xA2,
154 ARMV7_PERFCTR_PLE_RQST_COMPLETED = 0xA3,
155 ARMV7_PERFCTR_PLE_FIFO_OVERFLOW = 0xA4,
156 ARMV7_PERFCTR_PLE_RQST_PROG = 0xA5
157}; 88};
158 89
159/* ARMv7 Cortex-A5 specific event types */ 90/* ARMv7 Cortex-A5 specific event types */
160enum armv7_a5_perf_types { 91enum armv7_a5_perf_types {
161 ARMV7_PERFCTR_IRQ_TAKEN = 0x86, 92 ARMV7_A5_PERFCTR_PREFETCH_LINEFILL = 0xc2,
162 ARMV7_PERFCTR_FIQ_TAKEN = 0x87, 93 ARMV7_A5_PERFCTR_PREFETCH_LINEFILL_DROP = 0xc3,
163
164 ARMV7_PERFCTR_EXT_MEM_RQST = 0xc0,
165 ARMV7_PERFCTR_NC_EXT_MEM_RQST = 0xc1,
166 ARMV7_PERFCTR_PREFETCH_LINEFILL = 0xc2,
167 ARMV7_PERFCTR_PREFETCH_LINEFILL_DROP = 0xc3,
168 ARMV7_PERFCTR_ENTER_READ_ALLOC = 0xc4,
169 ARMV7_PERFCTR_READ_ALLOC = 0xc5,
170
171 ARMV7_PERFCTR_STALL_SB_FULL = 0xc9,
172}; 94};
173 95
174/* ARMv7 Cortex-A15 specific event types */ 96/* ARMv7 Cortex-A15 specific event types */
175enum armv7_a15_perf_types { 97enum armv7_a15_perf_types {
176 ARMV7_PERFCTR_L1_DCACHE_READ_ACCESS = 0x40, 98 ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_READ = 0x40,
177 ARMV7_PERFCTR_L1_DCACHE_WRITE_ACCESS = 0x41, 99 ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_WRITE = 0x41,
178 ARMV7_PERFCTR_L1_DCACHE_READ_REFILL = 0x42, 100 ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_READ = 0x42,
179 ARMV7_PERFCTR_L1_DCACHE_WRITE_REFILL = 0x43, 101 ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_WRITE = 0x43,
180 102
181 ARMV7_PERFCTR_L1_DTLB_READ_REFILL = 0x4C, 103 ARMV7_A15_PERFCTR_DTLB_REFILL_L1_READ = 0x4C,
182 ARMV7_PERFCTR_L1_DTLB_WRITE_REFILL = 0x4D, 104 ARMV7_A15_PERFCTR_DTLB_REFILL_L1_WRITE = 0x4D,
183 105
184 ARMV7_PERFCTR_L2_DCACHE_READ_ACCESS = 0x50, 106 ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_READ = 0x50,
185 ARMV7_PERFCTR_L2_DCACHE_WRITE_ACCESS = 0x51, 107 ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_WRITE = 0x51,
186 ARMV7_PERFCTR_L2_DCACHE_READ_REFILL = 0x52, 108 ARMV7_A15_PERFCTR_L2_CACHE_REFILL_READ = 0x52,
187 ARMV7_PERFCTR_L2_DCACHE_WRITE_REFILL = 0x53, 109 ARMV7_A15_PERFCTR_L2_CACHE_REFILL_WRITE = 0x53,
188 110
189 ARMV7_PERFCTR_SPEC_PC_WRITE = 0x76, 111 ARMV7_A15_PERFCTR_PC_WRITE_SPEC = 0x76,
190}; 112};
191 113
192/* 114/*
@@ -197,13 +119,15 @@ enum armv7_a15_perf_types {
197 * accesses/misses in hardware. 119 * accesses/misses in hardware.
198 */ 120 */
199static const unsigned armv7_a8_perf_map[PERF_COUNT_HW_MAX] = { 121static const unsigned armv7_a8_perf_map[PERF_COUNT_HW_MAX] = {
200 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, 122 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
201 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED, 123 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
202 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, 124 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
203 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, 125 [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
204 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, 126 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
205 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, 127 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
206 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES, 128 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
129 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV7_A8_PERFCTR_STALL_ISIDE,
130 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED,
207}; 131};
208 132
209static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] 133static 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]
217 * combined. 141 * combined.
218 */ 142 */
219 [C(OP_READ)] = { 143 [C(OP_READ)] = {
220 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, 144 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
221 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, 145 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
222 }, 146 },
223 [C(OP_WRITE)] = { 147 [C(OP_WRITE)] = {
224 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, 148 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
225 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, 149 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
226 }, 150 },
227 [C(OP_PREFETCH)] = { 151 [C(OP_PREFETCH)] = {
228 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 152 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -231,12 +155,12 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
231 }, 155 },
232 [C(L1I)] = { 156 [C(L1I)] = {
233 [C(OP_READ)] = { 157 [C(OP_READ)] = {
234 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST, 158 [C(RESULT_ACCESS)] = ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS,
235 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS, 159 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
236 }, 160 },
237 [C(OP_WRITE)] = { 161 [C(OP_WRITE)] = {
238 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST, 162 [C(RESULT_ACCESS)] = ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS,
239 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS, 163 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
240 }, 164 },
241 [C(OP_PREFETCH)] = { 165 [C(OP_PREFETCH)] = {
242 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 166 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -245,12 +169,12 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
245 }, 169 },
246 [C(LL)] = { 170 [C(LL)] = {
247 [C(OP_READ)] = { 171 [C(OP_READ)] = {
248 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS, 172 [C(RESULT_ACCESS)] = ARMV7_A8_PERFCTR_L2_CACHE_ACCESS,
249 [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS, 173 [C(RESULT_MISS)] = ARMV7_A8_PERFCTR_L2_CACHE_REFILL,
250 }, 174 },
251 [C(OP_WRITE)] = { 175 [C(OP_WRITE)] = {
252 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS, 176 [C(RESULT_ACCESS)] = ARMV7_A8_PERFCTR_L2_CACHE_ACCESS,
253 [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS, 177 [C(RESULT_MISS)] = ARMV7_A8_PERFCTR_L2_CACHE_REFILL,
254 }, 178 },
255 [C(OP_PREFETCH)] = { 179 [C(OP_PREFETCH)] = {
256 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 180 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -274,11 +198,11 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
274 [C(ITLB)] = { 198 [C(ITLB)] = {
275 [C(OP_READ)] = { 199 [C(OP_READ)] = {
276 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 200 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
277 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 201 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
278 }, 202 },
279 [C(OP_WRITE)] = { 203 [C(OP_WRITE)] = {
280 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 204 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
281 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 205 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
282 }, 206 },
283 [C(OP_PREFETCH)] = { 207 [C(OP_PREFETCH)] = {
284 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 208 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -287,14 +211,12 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
287 }, 211 },
288 [C(BPU)] = { 212 [C(BPU)] = {
289 [C(OP_READ)] = { 213 [C(OP_READ)] = {
290 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, 214 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
291 [C(RESULT_MISS)] 215 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
292 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
293 }, 216 },
294 [C(OP_WRITE)] = { 217 [C(OP_WRITE)] = {
295 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, 218 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
296 [C(RESULT_MISS)] 219 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
297 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
298 }, 220 },
299 [C(OP_PREFETCH)] = { 221 [C(OP_PREFETCH)] = {
300 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 222 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -321,14 +243,15 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
321 * Cortex-A9 HW events mapping 243 * Cortex-A9 HW events mapping
322 */ 244 */
323static const unsigned armv7_a9_perf_map[PERF_COUNT_HW_MAX] = { 245static const unsigned armv7_a9_perf_map[PERF_COUNT_HW_MAX] = {
324 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, 246 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
325 [PERF_COUNT_HW_INSTRUCTIONS] = 247 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_A9_PERFCTR_INSTR_CORE_RENAME,
326 ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE, 248 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
327 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_DCACHE_ACCESS, 249 [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
328 [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_DCACHE_REFILL, 250 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
329 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, 251 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
330 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, 252 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
331 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES, 253 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV7_A9_PERFCTR_STALL_ICACHE,
254 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = ARMV7_A9_PERFCTR_STALL_DISPATCH,
332}; 255};
333 256
334static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] 257static 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]
342 * combined. 265 * combined.
343 */ 266 */
344 [C(OP_READ)] = { 267 [C(OP_READ)] = {
345 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, 268 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
346 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, 269 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
347 }, 270 },
348 [C(OP_WRITE)] = { 271 [C(OP_WRITE)] = {
349 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, 272 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
350 [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, 273 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
351 }, 274 },
352 [C(OP_PREFETCH)] = { 275 [C(OP_PREFETCH)] = {
353 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 276 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -357,11 +280,11 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
357 [C(L1I)] = { 280 [C(L1I)] = {
358 [C(OP_READ)] = { 281 [C(OP_READ)] = {
359 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 282 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
360 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, 283 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
361 }, 284 },
362 [C(OP_WRITE)] = { 285 [C(OP_WRITE)] = {
363 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 286 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
364 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, 287 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
365 }, 288 },
366 [C(OP_PREFETCH)] = { 289 [C(OP_PREFETCH)] = {
367 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 290 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -399,11 +322,11 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
399 [C(ITLB)] = { 322 [C(ITLB)] = {
400 [C(OP_READ)] = { 323 [C(OP_READ)] = {
401 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 324 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
402 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 325 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
403 }, 326 },
404 [C(OP_WRITE)] = { 327 [C(OP_WRITE)] = {
405 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 328 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
406 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 329 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
407 }, 330 },
408 [C(OP_PREFETCH)] = { 331 [C(OP_PREFETCH)] = {
409 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 332 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -412,14 +335,12 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
412 }, 335 },
413 [C(BPU)] = { 336 [C(BPU)] = {
414 [C(OP_READ)] = { 337 [C(OP_READ)] = {
415 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, 338 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
416 [C(RESULT_MISS)] 339 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
417 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
418 }, 340 },
419 [C(OP_WRITE)] = { 341 [C(OP_WRITE)] = {
420 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, 342 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
421 [C(RESULT_MISS)] 343 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
422 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
423 }, 344 },
424 [C(OP_PREFETCH)] = { 345 [C(OP_PREFETCH)] = {
425 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 346 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -446,13 +367,15 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
446 * Cortex-A5 HW events mapping 367 * Cortex-A5 HW events mapping
447 */ 368 */
448static const unsigned armv7_a5_perf_map[PERF_COUNT_HW_MAX] = { 369static const unsigned armv7_a5_perf_map[PERF_COUNT_HW_MAX] = {
449 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, 370 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
450 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED, 371 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
451 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, 372 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
452 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, 373 [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
453 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, 374 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
454 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, 375 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
455 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, 376 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
377 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED,
378 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED,
456}; 379};
457 380
458static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] 381static 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]
460 [PERF_COUNT_HW_CACHE_RESULT_MAX] = { 383 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
461 [C(L1D)] = { 384 [C(L1D)] = {
462 [C(OP_READ)] = { 385 [C(OP_READ)] = {
463 [C(RESULT_ACCESS)] 386 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
464 = ARMV7_PERFCTR_DCACHE_ACCESS, 387 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
465 [C(RESULT_MISS)]
466 = ARMV7_PERFCTR_DCACHE_REFILL,
467 }, 388 },
468 [C(OP_WRITE)] = { 389 [C(OP_WRITE)] = {
469 [C(RESULT_ACCESS)] 390 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
470 = ARMV7_PERFCTR_DCACHE_ACCESS, 391 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
471 [C(RESULT_MISS)]
472 = ARMV7_PERFCTR_DCACHE_REFILL,
473 }, 392 },
474 [C(OP_PREFETCH)] = { 393 [C(OP_PREFETCH)] = {
475 [C(RESULT_ACCESS)] 394 [C(RESULT_ACCESS)] = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL,
476 = ARMV7_PERFCTR_PREFETCH_LINEFILL, 395 [C(RESULT_MISS)] = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL_DROP,
477 [C(RESULT_MISS)]
478 = ARMV7_PERFCTR_PREFETCH_LINEFILL_DROP,
479 }, 396 },
480 }, 397 },
481 [C(L1I)] = { 398 [C(L1I)] = {
482 [C(OP_READ)] = { 399 [C(OP_READ)] = {
483 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, 400 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
484 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, 401 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
485 }, 402 },
486 [C(OP_WRITE)] = { 403 [C(OP_WRITE)] = {
487 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, 404 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
488 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, 405 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
489 }, 406 },
490 /* 407 /*
491 * The prefetch counters don't differentiate between the I 408 * The prefetch counters don't differentiate between the I
492 * side and the D side. 409 * side and the D side.
493 */ 410 */
494 [C(OP_PREFETCH)] = { 411 [C(OP_PREFETCH)] = {
495 [C(RESULT_ACCESS)] 412 [C(RESULT_ACCESS)] = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL,
496 = ARMV7_PERFCTR_PREFETCH_LINEFILL, 413 [C(RESULT_MISS)] = ARMV7_A5_PERFCTR_PREFETCH_LINEFILL_DROP,
497 [C(RESULT_MISS)]
498 = ARMV7_PERFCTR_PREFETCH_LINEFILL_DROP,
499 }, 414 },
500 }, 415 },
501 [C(LL)] = { 416 [C(LL)] = {
@@ -529,11 +444,11 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
529 [C(ITLB)] = { 444 [C(ITLB)] = {
530 [C(OP_READ)] = { 445 [C(OP_READ)] = {
531 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 446 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
532 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 447 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
533 }, 448 },
534 [C(OP_WRITE)] = { 449 [C(OP_WRITE)] = {
535 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 450 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
536 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 451 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
537 }, 452 },
538 [C(OP_PREFETCH)] = { 453 [C(OP_PREFETCH)] = {
539 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 454 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -543,13 +458,11 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
543 [C(BPU)] = { 458 [C(BPU)] = {
544 [C(OP_READ)] = { 459 [C(OP_READ)] = {
545 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED, 460 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
546 [C(RESULT_MISS)] 461 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
547 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
548 }, 462 },
549 [C(OP_WRITE)] = { 463 [C(OP_WRITE)] = {
550 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED, 464 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
551 [C(RESULT_MISS)] 465 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
552 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
553 }, 466 },
554 [C(OP_PREFETCH)] = { 467 [C(OP_PREFETCH)] = {
555 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 468 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -562,13 +475,15 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
562 * Cortex-A15 HW events mapping 475 * Cortex-A15 HW events mapping
563 */ 476 */
564static const unsigned armv7_a15_perf_map[PERF_COUNT_HW_MAX] = { 477static const unsigned armv7_a15_perf_map[PERF_COUNT_HW_MAX] = {
565 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, 478 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
566 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED, 479 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
567 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, 480 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
568 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, 481 [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
569 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_SPEC_PC_WRITE, 482 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_A15_PERFCTR_PC_WRITE_SPEC,
570 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, 483 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
571 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_BUS_CYCLES, 484 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_BUS_CYCLES,
485 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED,
486 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED,
572}; 487};
573 488
574static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] 489static 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]
576 [PERF_COUNT_HW_CACHE_RESULT_MAX] = { 491 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
577 [C(L1D)] = { 492 [C(L1D)] = {
578 [C(OP_READ)] = { 493 [C(OP_READ)] = {
579 [C(RESULT_ACCESS)] 494 [C(RESULT_ACCESS)] = ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_READ,
580 = ARMV7_PERFCTR_L1_DCACHE_READ_ACCESS, 495 [C(RESULT_MISS)] = ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_READ,
581 [C(RESULT_MISS)]
582 = ARMV7_PERFCTR_L1_DCACHE_READ_REFILL,
583 }, 496 },
584 [C(OP_WRITE)] = { 497 [C(OP_WRITE)] = {
585 [C(RESULT_ACCESS)] 498 [C(RESULT_ACCESS)] = ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_WRITE,
586 = ARMV7_PERFCTR_L1_DCACHE_WRITE_ACCESS, 499 [C(RESULT_MISS)] = ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_WRITE,
587 [C(RESULT_MISS)]
588 = ARMV7_PERFCTR_L1_DCACHE_WRITE_REFILL,
589 }, 500 },
590 [C(OP_PREFETCH)] = { 501 [C(OP_PREFETCH)] = {
591 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 502 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -601,11 +512,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
601 */ 512 */
602 [C(OP_READ)] = { 513 [C(OP_READ)] = {
603 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, 514 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
604 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, 515 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
605 }, 516 },
606 [C(OP_WRITE)] = { 517 [C(OP_WRITE)] = {
607 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, 518 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
608 [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, 519 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
609 }, 520 },
610 [C(OP_PREFETCH)] = { 521 [C(OP_PREFETCH)] = {
611 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 522 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -614,16 +525,12 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
614 }, 525 },
615 [C(LL)] = { 526 [C(LL)] = {
616 [C(OP_READ)] = { 527 [C(OP_READ)] = {
617 [C(RESULT_ACCESS)] 528 [C(RESULT_ACCESS)] = ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_READ,
618 = ARMV7_PERFCTR_L2_DCACHE_READ_ACCESS, 529 [C(RESULT_MISS)] = ARMV7_A15_PERFCTR_L2_CACHE_REFILL_READ,
619 [C(RESULT_MISS)]
620 = ARMV7_PERFCTR_L2_DCACHE_READ_REFILL,
621 }, 530 },
622 [C(OP_WRITE)] = { 531 [C(OP_WRITE)] = {
623 [C(RESULT_ACCESS)] 532 [C(RESULT_ACCESS)] = ARMV7_A15_PERFCTR_L2_CACHE_ACCESS_WRITE,
624 = ARMV7_PERFCTR_L2_DCACHE_WRITE_ACCESS, 533 [C(RESULT_MISS)] = ARMV7_A15_PERFCTR_L2_CACHE_REFILL_WRITE,
625 [C(RESULT_MISS)]
626 = ARMV7_PERFCTR_L2_DCACHE_WRITE_REFILL,
627 }, 534 },
628 [C(OP_PREFETCH)] = { 535 [C(OP_PREFETCH)] = {
629 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 536 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -633,13 +540,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
633 [C(DTLB)] = { 540 [C(DTLB)] = {
634 [C(OP_READ)] = { 541 [C(OP_READ)] = {
635 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 542 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
636 [C(RESULT_MISS)] 543 [C(RESULT_MISS)] = ARMV7_A15_PERFCTR_DTLB_REFILL_L1_READ,
637 = ARMV7_PERFCTR_L1_DTLB_READ_REFILL,
638 }, 544 },
639 [C(OP_WRITE)] = { 545 [C(OP_WRITE)] = {
640 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 546 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
641 [C(RESULT_MISS)] 547 [C(RESULT_MISS)] = ARMV7_A15_PERFCTR_DTLB_REFILL_L1_WRITE,
642 = ARMV7_PERFCTR_L1_DTLB_WRITE_REFILL,
643 }, 548 },
644 [C(OP_PREFETCH)] = { 549 [C(OP_PREFETCH)] = {
645 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 550 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -649,11 +554,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
649 [C(ITLB)] = { 554 [C(ITLB)] = {
650 [C(OP_READ)] = { 555 [C(OP_READ)] = {
651 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 556 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
652 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 557 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
653 }, 558 },
654 [C(OP_WRITE)] = { 559 [C(OP_WRITE)] = {
655 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 560 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
656 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, 561 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
657 }, 562 },
658 [C(OP_PREFETCH)] = { 563 [C(OP_PREFETCH)] = {
659 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 564 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -663,13 +568,11 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
663 [C(BPU)] = { 568 [C(BPU)] = {
664 [C(OP_READ)] = { 569 [C(OP_READ)] = {
665 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED, 570 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
666 [C(RESULT_MISS)] 571 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
667 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
668 }, 572 },
669 [C(OP_WRITE)] = { 573 [C(OP_WRITE)] = {
670 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED, 574 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
671 [C(RESULT_MISS)] 575 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
672 = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
673 }, 576 },
674 [C(OP_PREFETCH)] = { 577 [C(OP_PREFETCH)] = {
675 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, 578 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c
index e0cca10a8411..3b99d8269829 100644
--- a/arch/arm/kernel/perf_event_xscale.c
+++ b/arch/arm/kernel/perf_event_xscale.c
@@ -48,13 +48,15 @@ enum xscale_counters {
48}; 48};
49 49
50static const unsigned xscale_perf_map[PERF_COUNT_HW_MAX] = { 50static const unsigned xscale_perf_map[PERF_COUNT_HW_MAX] = {
51 [PERF_COUNT_HW_CPU_CYCLES] = XSCALE_PERFCTR_CCNT, 51 [PERF_COUNT_HW_CPU_CYCLES] = XSCALE_PERFCTR_CCNT,
52 [PERF_COUNT_HW_INSTRUCTIONS] = XSCALE_PERFCTR_INSTRUCTION, 52 [PERF_COUNT_HW_INSTRUCTIONS] = XSCALE_PERFCTR_INSTRUCTION,
53 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, 53 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
54 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, 54 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
55 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = XSCALE_PERFCTR_BRANCH, 55 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = XSCALE_PERFCTR_BRANCH,
56 [PERF_COUNT_HW_BRANCH_MISSES] = XSCALE_PERFCTR_BRANCH_MISS, 56 [PERF_COUNT_HW_BRANCH_MISSES] = XSCALE_PERFCTR_BRANCH_MISS,
57 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, 57 [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED,
58 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = XSCALE_PERFCTR_ICACHE_NO_DELIVER,
59 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED,
58}; 60};
59 61
60static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] 62static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c
index 2c3407ee8576..2334bf8a650a 100644
--- a/arch/arm/kernel/pmu.c
+++ b/arch/arm/kernel/pmu.c
@@ -33,3 +33,4 @@ release_pmu(enum arm_pmu_type type)
33{ 33{
34 clear_bit_unlock(type, pmu_lock); 34 clear_bit_unlock(type, pmu_lock);
35} 35}
36EXPORT_SYMBOL_GPL(release_pmu);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 75316f0dd02a..971d65c253a9 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -57,7 +57,7 @@ static const char *isa_modes[] = {
57 "ARM" , "Thumb" , "Jazelle", "ThumbEE" 57 "ARM" , "Thumb" , "Jazelle", "ThumbEE"
58}; 58};
59 59
60extern void setup_mm_for_reboot(char mode); 60extern void setup_mm_for_reboot(void);
61 61
62static volatile int hlt_counter; 62static volatile int hlt_counter;
63 63
@@ -92,18 +92,24 @@ static int __init hlt_setup(char *__unused)
92__setup("nohlt", nohlt_setup); 92__setup("nohlt", nohlt_setup);
93__setup("hlt", hlt_setup); 93__setup("hlt", hlt_setup);
94 94
95void arm_machine_restart(char mode, const char *cmd) 95extern void call_with_stack(void (*fn)(void *), void *arg, void *sp);
96typedef void (*phys_reset_t)(unsigned long);
97
98/*
99 * A temporary stack to use for CPU reset. This is static so that we
100 * don't clobber it with the identity mapping. When running with this
101 * stack, any references to the current task *will not work* so you
102 * should really do as little as possible before jumping to your reset
103 * code.
104 */
105static u64 soft_restart_stack[16];
106
107static void __soft_restart(void *addr)
96{ 108{
97 /* Disable interrupts first */ 109 phys_reset_t phys_reset;
98 local_irq_disable();
99 local_fiq_disable();
100 110
101 /* 111 /* Take out a flat memory mapping. */
102 * Tell the mm system that we are going to reboot - 112 setup_mm_for_reboot();
103 * we may need it to insert some 1:1 mappings so that
104 * soft boot works.
105 */
106 setup_mm_for_reboot(mode);
107 113
108 /* Clean and invalidate caches */ 114 /* Clean and invalidate caches */
109 flush_cache_all(); 115 flush_cache_all();
@@ -114,18 +120,35 @@ void arm_machine_restart(char mode, const char *cmd)
114 /* Push out any further dirty data, and ensure cache is empty */ 120 /* Push out any further dirty data, and ensure cache is empty */
115 flush_cache_all(); 121 flush_cache_all();
116 122
117 /* 123 /* Switch to the identity mapping. */
118 * Now call the architecture specific reboot code. 124 phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
119 */ 125 phys_reset((unsigned long)addr);
120 arch_reset(mode, cmd);
121 126
122 /* 127 /* Should never get here. */
123 * Whoops - the architecture was unable to reboot. 128 BUG();
124 * Tell the user! 129}
125 */ 130
126 mdelay(1000); 131void soft_restart(unsigned long addr)
127 printk("Reboot failed -- System halted\n"); 132{
128 while (1); 133 u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack);
134
135 /* Disable interrupts first */
136 local_irq_disable();
137 local_fiq_disable();
138
139 /* Disable the L2 if we're the last man standing. */
140 if (num_online_cpus() == 1)
141 outer_disable();
142
143 /* Change to the new stack and continue with the reset. */
144 call_with_stack(__soft_restart, (void *)addr, (void *)stack);
145
146 /* Should never get here. */
147 BUG();
148}
149
150static void null_restart(char mode, const char *cmd)
151{
129} 152}
130 153
131/* 154/*
@@ -134,7 +157,7 @@ void arm_machine_restart(char mode, const char *cmd)
134void (*pm_power_off)(void); 157void (*pm_power_off)(void);
135EXPORT_SYMBOL(pm_power_off); 158EXPORT_SYMBOL(pm_power_off);
136 159
137void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart; 160void (*arm_pm_restart)(char str, const char *cmd) = null_restart;
138EXPORT_SYMBOL_GPL(arm_pm_restart); 161EXPORT_SYMBOL_GPL(arm_pm_restart);
139 162
140static void do_nothing(void *unused) 163static void do_nothing(void *unused)
@@ -183,7 +206,8 @@ void cpu_idle(void)
183 206
184 /* endless idle loop with no priority at all */ 207 /* endless idle loop with no priority at all */
185 while (1) { 208 while (1) {
186 tick_nohz_stop_sched_tick(1); 209 tick_nohz_idle_enter();
210 rcu_idle_enter();
187 leds_event(led_idle_start); 211 leds_event(led_idle_start);
188 while (!need_resched()) { 212 while (!need_resched()) {
189#ifdef CONFIG_HOTPLUG_CPU 213#ifdef CONFIG_HOTPLUG_CPU
@@ -192,6 +216,9 @@ void cpu_idle(void)
192#endif 216#endif
193 217
194 local_irq_disable(); 218 local_irq_disable();
219#ifdef CONFIG_PL310_ERRATA_769419
220 wmb();
221#endif
195 if (hlt_counter) { 222 if (hlt_counter) {
196 local_irq_enable(); 223 local_irq_enable();
197 cpu_relax(); 224 cpu_relax();
@@ -210,7 +237,8 @@ void cpu_idle(void)
210 } 237 }
211 } 238 }
212 leds_event(led_idle_end); 239 leds_event(led_idle_end);
213 tick_nohz_restart_sched_tick(); 240 rcu_idle_exit();
241 tick_nohz_idle_exit();
214 preempt_enable_no_resched(); 242 preempt_enable_no_resched();
215 schedule(); 243 schedule();
216 preempt_disable(); 244 preempt_disable();
@@ -250,7 +278,15 @@ void machine_power_off(void)
250void machine_restart(char *cmd) 278void machine_restart(char *cmd)
251{ 279{
252 machine_shutdown(); 280 machine_shutdown();
281
253 arm_pm_restart(reboot_mode, cmd); 282 arm_pm_restart(reboot_mode, cmd);
283
284 /* Give a grace period for failure to restart of 1s */
285 mdelay(1000);
286
287 /* Whoops - the platform was unable to reboot. Tell the user! */
288 printk("Reboot failed -- System halted\n");
289 while (1);
254} 290}
255 291
256void __show_regs(struct pt_regs *regs) 292void __show_regs(struct pt_regs *regs)
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index 9a46370fe9da..5416c7c12528 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -14,61 +14,153 @@
14 14
15#include <asm/sched_clock.h> 15#include <asm/sched_clock.h>
16 16
17struct clock_data {
18 u64 epoch_ns;
19 u32 epoch_cyc;
20 u32 epoch_cyc_copy;
21 u32 mult;
22 u32 shift;
23};
24
17static void sched_clock_poll(unsigned long wrap_ticks); 25static void sched_clock_poll(unsigned long wrap_ticks);
18static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); 26static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0);
19static void (*sched_clock_update_fn)(void); 27
28static struct clock_data cd = {
29 .mult = NSEC_PER_SEC / HZ,
30};
31
32static u32 __read_mostly sched_clock_mask = 0xffffffff;
33
34static u32 notrace jiffy_sched_clock_read(void)
35{
36 return (u32)(jiffies - INITIAL_JIFFIES);
37}
38
39static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
40
41static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
42{
43 return (cyc * mult) >> shift;
44}
45
46static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
47{
48 u64 epoch_ns;
49 u32 epoch_cyc;
50
51 /*
52 * Load the epoch_cyc and epoch_ns atomically. We do this by
53 * ensuring that we always write epoch_cyc, epoch_ns and
54 * epoch_cyc_copy in strict order, and read them in strict order.
55 * If epoch_cyc and epoch_cyc_copy are not equal, then we're in
56 * the middle of an update, and we should repeat the load.
57 */
58 do {
59 epoch_cyc = cd.epoch_cyc;
60 smp_rmb();
61 epoch_ns = cd.epoch_ns;
62 smp_rmb();
63 } while (epoch_cyc != cd.epoch_cyc_copy);
64
65 return epoch_ns + cyc_to_ns((cyc - epoch_cyc) & mask, cd.mult, cd.shift);
66}
67
68/*
69 * Atomically update the sched_clock epoch.
70 */
71static void notrace update_sched_clock(void)
72{
73 unsigned long flags;
74 u32 cyc;
75 u64 ns;
76
77 cyc = read_sched_clock();
78 ns = cd.epoch_ns +
79 cyc_to_ns((cyc - cd.epoch_cyc) & sched_clock_mask,
80 cd.mult, cd.shift);
81 /*
82 * Write epoch_cyc and epoch_ns in a way that the update is
83 * detectable in cyc_to_fixed_sched_clock().
84 */
85 raw_local_irq_save(flags);
86 cd.epoch_cyc = cyc;
87 smp_wmb();
88 cd.epoch_ns = ns;
89 smp_wmb();
90 cd.epoch_cyc_copy = cyc;
91 raw_local_irq_restore(flags);
92}
20 93
21static void sched_clock_poll(unsigned long wrap_ticks) 94static void sched_clock_poll(unsigned long wrap_ticks)
22{ 95{
23 mod_timer(&sched_clock_timer, round_jiffies(jiffies + wrap_ticks)); 96 mod_timer(&sched_clock_timer, round_jiffies(jiffies + wrap_ticks));
24 sched_clock_update_fn(); 97 update_sched_clock();
25} 98}
26 99
27void __init init_sched_clock(struct clock_data *cd, void (*update)(void), 100void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
28 unsigned int clock_bits, unsigned long rate)
29{ 101{
30 unsigned long r, w; 102 unsigned long r, w;
31 u64 res, wrap; 103 u64 res, wrap;
32 char r_unit; 104 char r_unit;
33 105
34 sched_clock_update_fn = update; 106 BUG_ON(bits > 32);
107 WARN_ON(!irqs_disabled());
108 WARN_ON(read_sched_clock != jiffy_sched_clock_read);
109 read_sched_clock = read;
110 sched_clock_mask = (1 << bits) - 1;
35 111
36 /* calculate the mult/shift to convert counter ticks to ns. */ 112 /* calculate the mult/shift to convert counter ticks to ns. */
37 clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 0); 113 clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0);
38 114
39 r = rate; 115 r = rate;
40 if (r >= 4000000) { 116 if (r >= 4000000) {
41 r /= 1000000; 117 r /= 1000000;
42 r_unit = 'M'; 118 r_unit = 'M';
43 } else { 119 } else if (r >= 1000) {
44 r /= 1000; 120 r /= 1000;
45 r_unit = 'k'; 121 r_unit = 'k';
46 } 122 } else
123 r_unit = ' ';
47 124
48 /* calculate how many ns until we wrap */ 125 /* calculate how many ns until we wrap */
49 wrap = cyc_to_ns((1ULL << clock_bits) - 1, cd->mult, cd->shift); 126 wrap = cyc_to_ns((1ULL << bits) - 1, cd.mult, cd.shift);
50 do_div(wrap, NSEC_PER_MSEC); 127 do_div(wrap, NSEC_PER_MSEC);
51 w = wrap; 128 w = wrap;
52 129
53 /* calculate the ns resolution of this counter */ 130 /* calculate the ns resolution of this counter */
54 res = cyc_to_ns(1ULL, cd->mult, cd->shift); 131 res = cyc_to_ns(1ULL, cd.mult, cd.shift);
55 pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lums\n", 132 pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lums\n",
56 clock_bits, r, r_unit, res, w); 133 bits, r, r_unit, res, w);
57 134
58 /* 135 /*
59 * Start the timer to keep sched_clock() properly updated and 136 * Start the timer to keep sched_clock() properly updated and
60 * sets the initial epoch. 137 * sets the initial epoch.
61 */ 138 */
62 sched_clock_timer.data = msecs_to_jiffies(w - (w / 10)); 139 sched_clock_timer.data = msecs_to_jiffies(w - (w / 10));
63 update(); 140 update_sched_clock();
64 141
65 /* 142 /*
66 * Ensure that sched_clock() starts off at 0ns 143 * Ensure that sched_clock() starts off at 0ns
67 */ 144 */
68 cd->epoch_ns = 0; 145 cd.epoch_ns = 0;
146
147 pr_debug("Registered %pF as sched_clock source\n", read);
148}
149
150unsigned long long notrace sched_clock(void)
151{
152 u32 cyc = read_sched_clock();
153 return cyc_to_sched_clock(cyc, sched_clock_mask);
69} 154}
70 155
71void __init sched_clock_postinit(void) 156void __init sched_clock_postinit(void)
72{ 157{
158 /*
159 * If no sched_clock function has been provided at that point,
160 * make it the final one one.
161 */
162 if (read_sched_clock == jiffy_sched_clock_read)
163 setup_sched_clock(jiffy_sched_clock_read, 32, HZ);
164
73 sched_clock_poll(sched_clock_timer.data); 165 sched_clock_poll(sched_clock_timer.data);
74} 166}
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 7e7977ab994f..129fbd55bde8 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -31,6 +31,7 @@
31#include <linux/memblock.h> 31#include <linux/memblock.h>
32#include <linux/bug.h> 32#include <linux/bug.h>
33#include <linux/compiler.h> 33#include <linux/compiler.h>
34#include <linux/sort.h>
34 35
35#include <asm/unified.h> 36#include <asm/unified.h>
36#include <asm/cpu.h> 37#include <asm/cpu.h>
@@ -52,6 +53,7 @@
52#include <asm/mach/time.h> 53#include <asm/mach/time.h>
53#include <asm/traps.h> 54#include <asm/traps.h>
54#include <asm/unwind.h> 55#include <asm/unwind.h>
56#include <asm/memblock.h>
55 57
56#if defined(CONFIG_DEPRECATED_PARAM_STRUCT) 58#if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
57#include "compat.h" 59#include "compat.h"
@@ -461,8 +463,10 @@ static void __init setup_processor(void)
461 cpu_name, read_cpuid_id(), read_cpuid_id() & 15, 463 cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
462 proc_arch[cpu_architecture()], cr_alignment); 464 proc_arch[cpu_architecture()], cr_alignment);
463 465
464 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS); 466 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
465 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); 467 list->arch_name, ENDIANNESS);
468 snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c",
469 list->elf_name, ENDIANNESS);
466 elf_hwcap = list->elf_hwcap; 470 elf_hwcap = list->elf_hwcap;
467#ifndef CONFIG_ARM_THUMB 471#ifndef CONFIG_ARM_THUMB
468 elf_hwcap &= ~HWCAP_THUMB; 472 elf_hwcap &= ~HWCAP_THUMB;
@@ -888,13 +892,17 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
888 return mdesc; 892 return mdesc;
889} 893}
890 894
895static int __init meminfo_cmp(const void *_a, const void *_b)
896{
897 const struct membank *a = _a, *b = _b;
898 long cmp = bank_pfn_start(a) - bank_pfn_start(b);
899 return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
900}
891 901
892void __init setup_arch(char **cmdline_p) 902void __init setup_arch(char **cmdline_p)
893{ 903{
894 struct machine_desc *mdesc; 904 struct machine_desc *mdesc;
895 905
896 unwind_init();
897
898 setup_processor(); 906 setup_processor();
899 mdesc = setup_machine_fdt(__atags_pointer); 907 mdesc = setup_machine_fdt(__atags_pointer);
900 if (!mdesc) 908 if (!mdesc)
@@ -902,8 +910,14 @@ void __init setup_arch(char **cmdline_p)
902 machine_desc = mdesc; 910 machine_desc = mdesc;
903 machine_name = mdesc->name; 911 machine_name = mdesc->name;
904 912
905 if (mdesc->soft_reboot) 913#ifdef CONFIG_ZONE_DMA
906 reboot_setup("s"); 914 if (mdesc->dma_zone_size) {
915 extern unsigned long arm_dma_zone_size;
916 arm_dma_zone_size = mdesc->dma_zone_size;
917 }
918#endif
919 if (mdesc->restart_mode)
920 reboot_setup(&mdesc->restart_mode);
907 921
908 init_mm.start_code = (unsigned long) _text; 922 init_mm.start_code = (unsigned long) _text;
909 init_mm.end_code = (unsigned long) _etext; 923 init_mm.end_code = (unsigned long) _etext;
@@ -916,12 +930,16 @@ void __init setup_arch(char **cmdline_p)
916 930
917 parse_early_param(); 931 parse_early_param();
918 932
933 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
919 sanity_check_meminfo(); 934 sanity_check_meminfo();
920 arm_memblock_init(&meminfo, mdesc); 935 arm_memblock_init(&meminfo, mdesc);
921 936
922 paging_init(mdesc); 937 paging_init(mdesc);
923 request_standard_resources(mdesc); 938 request_standard_resources(mdesc);
924 939
940 if (mdesc->restart)
941 arm_pm_restart = mdesc->restart;
942
925 unflatten_device_tree(); 943 unflatten_device_tree();
926 944
927#ifdef CONFIG_SMP 945#ifdef CONFIG_SMP
@@ -932,12 +950,6 @@ void __init setup_arch(char **cmdline_p)
932 950
933 tcm_init(); 951 tcm_init();
934 952
935#ifdef CONFIG_ZONE_DMA
936 if (mdesc->dma_zone_size) {
937 extern unsigned long arm_dma_zone_size;
938 arm_dma_zone_size = mdesc->dma_zone_size;
939 }
940#endif
941#ifdef CONFIG_MULTI_IRQ_HANDLER 953#ifdef CONFIG_MULTI_IRQ_HANDLER
942 handle_arch_irq = mdesc->handle_irq; 954 handle_arch_irq = mdesc->handle_irq;
943#endif 955#endif
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 020e99c845e7..1f268bda4552 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -54,14 +54,18 @@ ENDPROC(cpu_suspend_abort)
54 * r0 = control register value 54 * r0 = control register value
55 */ 55 */
56 .align 5 56 .align 5
57 .pushsection .idmap.text,"ax"
57ENTRY(cpu_resume_mmu) 58ENTRY(cpu_resume_mmu)
58 ldr r3, =cpu_resume_after_mmu 59 ldr r3, =cpu_resume_after_mmu
60 instr_sync
59 mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc 61 mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc
60 mrc p15, 0, r0, c0, c0, 0 @ read id reg 62 mrc p15, 0, r0, c0, c0, 0 @ read id reg
63 instr_sync
61 mov r0, r0 64 mov r0, r0
62 mov r0, r0 65 mov r0, r0
63 mov pc, r3 @ jump to virtual address 66 mov pc, r3 @ jump to virtual address
64ENDPROC(cpu_resume_mmu) 67ENDPROC(cpu_resume_mmu)
68 .popsection
65cpu_resume_after_mmu: 69cpu_resume_after_mmu:
66 bl cpu_init @ restore the und/abt/irq banked regs 70 bl cpu_init @ restore the und/abt/irq banked regs
67 mov r0, #0 @ return zero on success 71 mov r0, #0 @ return zero on success
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index ef5640b9e218..57db122a4f62 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -31,6 +31,7 @@
31#include <asm/cpu.h> 31#include <asm/cpu.h>
32#include <asm/cputype.h> 32#include <asm/cputype.h>
33#include <asm/exception.h> 33#include <asm/exception.h>
34#include <asm/idmap.h>
34#include <asm/topology.h> 35#include <asm/topology.h>
35#include <asm/mmu_context.h> 36#include <asm/mmu_context.h>
36#include <asm/pgtable.h> 37#include <asm/pgtable.h>
@@ -61,7 +62,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
61{ 62{
62 struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); 63 struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
63 struct task_struct *idle = ci->idle; 64 struct task_struct *idle = ci->idle;
64 pgd_t *pgd;
65 int ret; 65 int ret;
66 66
67 /* 67 /*
@@ -84,29 +84,11 @@ int __cpuinit __cpu_up(unsigned int cpu)
84 } 84 }
85 85
86 /* 86 /*
87 * Allocate initial page tables to allow the new CPU to
88 * enable the MMU safely. This essentially means a set
89 * of our "standard" page tables, with the addition of
90 * a 1:1 mapping for the physical address of the kernel.
91 */
92 pgd = pgd_alloc(&init_mm);
93 if (!pgd)
94 return -ENOMEM;
95
96 if (PHYS_OFFSET != PAGE_OFFSET) {
97#ifndef CONFIG_HOTPLUG_CPU
98 identity_mapping_add(pgd, __pa(__init_begin), __pa(__init_end));
99#endif
100 identity_mapping_add(pgd, __pa(_stext), __pa(_etext));
101 identity_mapping_add(pgd, __pa(_sdata), __pa(_edata));
102 }
103
104 /*
105 * We need to tell the secondary core where to find 87 * We need to tell the secondary core where to find
106 * its stack and the page tables. 88 * its stack and the page tables.
107 */ 89 */
108 secondary_data.stack = task_stack_page(idle) + THREAD_START_SP; 90 secondary_data.stack = task_stack_page(idle) + THREAD_START_SP;
109 secondary_data.pgdir = virt_to_phys(pgd); 91 secondary_data.pgdir = virt_to_phys(idmap_pgd);
110 secondary_data.swapper_pg_dir = virt_to_phys(swapper_pg_dir); 92 secondary_data.swapper_pg_dir = virt_to_phys(swapper_pg_dir);
111 __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data)); 93 __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data));
112 outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1)); 94 outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
@@ -142,16 +124,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
142 secondary_data.stack = NULL; 124 secondary_data.stack = NULL;
143 secondary_data.pgdir = 0; 125 secondary_data.pgdir = 0;
144 126
145 if (PHYS_OFFSET != PAGE_OFFSET) {
146#ifndef CONFIG_HOTPLUG_CPU
147 identity_mapping_del(pgd, __pa(__init_begin), __pa(__init_end));
148#endif
149 identity_mapping_del(pgd, __pa(_stext), __pa(_etext));
150 identity_mapping_del(pgd, __pa(_sdata), __pa(_edata));
151 }
152
153 pgd_free(&init_mm, pgd);
154
155 return ret; 127 return ret;
156} 128}
157 129
@@ -550,6 +522,10 @@ static void ipi_cpu_stop(unsigned int cpu)
550 local_fiq_disable(); 522 local_fiq_disable();
551 local_irq_disable(); 523 local_irq_disable();
552 524
525#ifdef CONFIG_HOTPLUG_CPU
526 platform_cpu_kill(cpu);
527#endif
528
553 while (1) 529 while (1)
554 cpu_relax(); 530 cpu_relax();
555} 531}
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index a8a6682d6b52..c8e938553d47 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -10,8 +10,11 @@
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/clk.h>
14#include <linux/cpufreq.h>
13#include <linux/delay.h> 15#include <linux/delay.h>
14#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/err.h>
15#include <linux/smp.h> 18#include <linux/smp.h>
16#include <linux/jiffies.h> 19#include <linux/jiffies.h>
17#include <linux/clockchips.h> 20#include <linux/clockchips.h>
@@ -25,6 +28,7 @@
25/* set up by the platform code */ 28/* set up by the platform code */
26void __iomem *twd_base; 29void __iomem *twd_base;
27 30
31static struct clk *twd_clk;
28static unsigned long twd_timer_rate; 32static unsigned long twd_timer_rate;
29 33
30static struct clock_event_device __percpu **twd_evt; 34static struct clock_event_device __percpu **twd_evt;
@@ -89,6 +93,52 @@ void twd_timer_stop(struct clock_event_device *clk)
89 disable_percpu_irq(clk->irq); 93 disable_percpu_irq(clk->irq);
90} 94}
91 95
96#ifdef CONFIG_CPU_FREQ
97
98/*
99 * Updates clockevent frequency when the cpu frequency changes.
100 * Called on the cpu that is changing frequency with interrupts disabled.
101 */
102static void twd_update_frequency(void *data)
103{
104 twd_timer_rate = clk_get_rate(twd_clk);
105
106 clockevents_update_freq(*__this_cpu_ptr(twd_evt), twd_timer_rate);
107}
108
109static int twd_cpufreq_transition(struct notifier_block *nb,
110 unsigned long state, void *data)
111{
112 struct cpufreq_freqs *freqs = data;
113
114 /*
115 * The twd clock events must be reprogrammed to account for the new
116 * frequency. The timer is local to a cpu, so cross-call to the
117 * changing cpu.
118 */
119 if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE)
120 smp_call_function_single(freqs->cpu, twd_update_frequency,
121 NULL, 1);
122
123 return NOTIFY_OK;
124}
125
126static struct notifier_block twd_cpufreq_nb = {
127 .notifier_call = twd_cpufreq_transition,
128};
129
130static int twd_cpufreq_init(void)
131{
132 if (!IS_ERR(twd_clk))
133 return cpufreq_register_notifier(&twd_cpufreq_nb,
134 CPUFREQ_TRANSITION_NOTIFIER);
135
136 return 0;
137}
138core_initcall(twd_cpufreq_init);
139
140#endif
141
92static void __cpuinit twd_calibrate_rate(void) 142static void __cpuinit twd_calibrate_rate(void)
93{ 143{
94 unsigned long count; 144 unsigned long count;
@@ -140,6 +190,35 @@ static irqreturn_t twd_handler(int irq, void *dev_id)
140 return IRQ_NONE; 190 return IRQ_NONE;
141} 191}
142 192
193static struct clk *twd_get_clock(void)
194{
195 struct clk *clk;
196 int err;
197
198 clk = clk_get_sys("smp_twd", NULL);
199 if (IS_ERR(clk)) {
200 pr_err("smp_twd: clock not found: %d\n", (int)PTR_ERR(clk));
201 return clk;
202 }
203
204 err = clk_prepare(clk);
205 if (err) {
206 pr_err("smp_twd: clock failed to prepare: %d\n", err);
207 clk_put(clk);
208 return ERR_PTR(err);
209 }
210
211 err = clk_enable(clk);
212 if (err) {
213 pr_err("smp_twd: clock failed to enable: %d\n", err);
214 clk_unprepare(clk);
215 clk_put(clk);
216 return ERR_PTR(err);
217 }
218
219 return clk;
220}
221
143/* 222/*
144 * Setup the local clock events for a CPU. 223 * Setup the local clock events for a CPU.
145 */ 224 */
@@ -165,7 +244,13 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
165 } 244 }
166 } 245 }
167 246
168 twd_calibrate_rate(); 247 if (!twd_clk)
248 twd_clk = twd_get_clock();
249
250 if (!IS_ERR_OR_NULL(twd_clk))
251 twd_timer_rate = clk_get_rate(twd_clk);
252 else
253 twd_calibrate_rate();
169 254
170 clk->name = "local_timer"; 255 clk->name = "local_timer";
171 clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | 256 clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
@@ -173,15 +258,11 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
173 clk->rating = 350; 258 clk->rating = 350;
174 clk->set_mode = twd_set_mode; 259 clk->set_mode = twd_set_mode;
175 clk->set_next_event = twd_set_next_event; 260 clk->set_next_event = twd_set_next_event;
176 clk->shift = 20;
177 clk->mult = div_sc(twd_timer_rate, NSEC_PER_SEC, clk->shift);
178 clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
179 clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
180 261
181 this_cpu_clk = __this_cpu_ptr(twd_evt); 262 this_cpu_clk = __this_cpu_ptr(twd_evt);
182 *this_cpu_clk = clk; 263 *this_cpu_clk = clk;
183 264
184 clockevents_register_device(clk); 265 clockevents_config_and_register(clk, twd_timer_rate,
185 266 0xf, 0xffffffff);
186 enable_percpu_irq(clk->irq, 0); 267 enable_percpu_irq(clk->irq, 0);
187} 268}
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
index 93a22d282c16..1794cc3b0f18 100644
--- a/arch/arm/kernel/suspend.c
+++ b/arch/arm/kernel/suspend.c
@@ -1,13 +1,12 @@
1#include <linux/init.h> 1#include <linux/init.h>
2 2
3#include <asm/idmap.h>
3#include <asm/pgalloc.h> 4#include <asm/pgalloc.h>
4#include <asm/pgtable.h> 5#include <asm/pgtable.h>
5#include <asm/memory.h> 6#include <asm/memory.h>
6#include <asm/suspend.h> 7#include <asm/suspend.h>
7#include <asm/tlbflush.h> 8#include <asm/tlbflush.h>
8 9
9static pgd_t *suspend_pgd;
10
11extern int __cpu_suspend(unsigned long, int (*)(unsigned long)); 10extern int __cpu_suspend(unsigned long, int (*)(unsigned long));
12extern void cpu_resume_mmu(void); 11extern void cpu_resume_mmu(void);
13 12
@@ -21,7 +20,7 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
21 *save_ptr = virt_to_phys(ptr); 20 *save_ptr = virt_to_phys(ptr);
22 21
23 /* This must correspond to the LDM in cpu_resume() assembly */ 22 /* This must correspond to the LDM in cpu_resume() assembly */
24 *ptr++ = virt_to_phys(suspend_pgd); 23 *ptr++ = virt_to_phys(idmap_pgd);
25 *ptr++ = sp; 24 *ptr++ = sp;
26 *ptr++ = virt_to_phys(cpu_do_resume); 25 *ptr++ = virt_to_phys(cpu_do_resume);
27 26
@@ -42,7 +41,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
42 struct mm_struct *mm = current->active_mm; 41 struct mm_struct *mm = current->active_mm;
43 int ret; 42 int ret;
44 43
45 if (!suspend_pgd) 44 if (!idmap_pgd)
46 return -EINVAL; 45 return -EINVAL;
47 46
48 /* 47 /*
@@ -59,14 +58,3 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
59 58
60 return ret; 59 return ret;
61} 60}
62
63static int __init cpu_suspend_init(void)
64{
65 suspend_pgd = pgd_alloc(&init_mm);
66 if (suspend_pgd) {
67 unsigned long addr = virt_to_phys(cpu_resume_mmu);
68 identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE);
69 }
70 return suspend_pgd ? 0 : -ENOMEM;
71}
72core_initcall(cpu_suspend_init);
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c
index 5f452f8fde05..df745188f5de 100644
--- a/arch/arm/kernel/swp_emulate.c
+++ b/arch/arm/kernel/swp_emulate.c
@@ -25,6 +25,7 @@
25#include <linux/syscalls.h> 25#include <linux/syscalls.h>
26#include <linux/perf_event.h> 26#include <linux/perf_event.h>
27 27
28#include <asm/opcodes.h>
28#include <asm/traps.h> 29#include <asm/traps.h>
29#include <asm/uaccess.h> 30#include <asm/uaccess.h>
30 31
@@ -185,6 +186,21 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr)
185 186
186 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc); 187 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc);
187 188
189 res = arm_check_condition(instr, regs->ARM_cpsr);
190 switch (res) {
191 case ARM_OPCODE_CONDTEST_PASS:
192 break;
193 case ARM_OPCODE_CONDTEST_FAIL:
194 /* Condition failed - return to next instruction */
195 regs->ARM_pc += 4;
196 return 0;
197 case ARM_OPCODE_CONDTEST_UNCOND:
198 /* If unconditional encoding - not a SWP, undef */
199 return -EFAULT;
200 default:
201 return -EINVAL;
202 }
203
188 if (current->pid != previous_pid) { 204 if (current->pid != previous_pid) {
189 pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n", 205 pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n",
190 current->comm, (unsigned long)current->pid); 206 current->comm, (unsigned long)current->pid);
diff --git a/arch/arm/kernel/tcm.c b/arch/arm/kernel/tcm.c
index 30e302d33e0a..01ec453bb924 100644
--- a/arch/arm/kernel/tcm.c
+++ b/arch/arm/kernel/tcm.c
@@ -180,9 +180,9 @@ static int __init setup_tcm_bank(u8 type, u8 bank, u8 banks,
180 */ 180 */
181void __init tcm_init(void) 181void __init tcm_init(void)
182{ 182{
183 u32 tcm_status = read_cpuid_tcmstatus(); 183 u32 tcm_status;
184 u8 dtcm_banks = (tcm_status >> 16) & 0x03; 184 u8 dtcm_banks;
185 u8 itcm_banks = (tcm_status & 0x03); 185 u8 itcm_banks;
186 size_t dtcm_code_sz = &__edtcm_data - &__sdtcm_data; 186 size_t dtcm_code_sz = &__edtcm_data - &__sdtcm_data;
187 size_t itcm_code_sz = &__eitcm_text - &__sitcm_text; 187 size_t itcm_code_sz = &__eitcm_text - &__sitcm_text;
188 char *start; 188 char *start;
@@ -191,6 +191,22 @@ void __init tcm_init(void)
191 int ret; 191 int ret;
192 int i; 192 int i;
193 193
194 /*
195 * Prior to ARMv5 there is no TCM, and trying to read the status
196 * register will hang the processor.
197 */
198 if (cpu_architecture() < CPU_ARCH_ARMv5) {
199 if (dtcm_code_sz || itcm_code_sz)
200 pr_info("CPU TCM: %u bytes of DTCM and %u bytes of "
201 "ITCM code compiled in, but no TCM present "
202 "in pre-v5 CPU\n", dtcm_code_sz, itcm_code_sz);
203 return;
204 }
205
206 tcm_status = read_cpuid_tcmstatus();
207 dtcm_banks = (tcm_status >> 16) & 0x03;
208 itcm_banks = (tcm_status & 0x03);
209
194 /* Values greater than 2 for D/ITCM banks are "reserved" */ 210 /* Values greater than 2 for D/ITCM banks are "reserved" */
195 if (dtcm_banks > 2) 211 if (dtcm_banks > 2)
196 dtcm_banks = 0; 212 dtcm_banks = 0;
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 1040c00405d0..8200deaa14f6 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -43,7 +43,7 @@
43 43
44struct cputopo_arm cpu_topology[NR_CPUS]; 44struct cputopo_arm cpu_topology[NR_CPUS];
45 45
46const struct cpumask *cpu_coregroup_mask(unsigned int cpu) 46const struct cpumask *cpu_coregroup_mask(int cpu)
47{ 47{
48 return &cpu_topology[cpu].core_sibling; 48 return &cpu_topology[cpu].core_sibling;
49} 49}
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
index e7e8365795c3..00df012c4678 100644
--- a/arch/arm/kernel/unwind.c
+++ b/arch/arm/kernel/unwind.c
@@ -67,7 +67,7 @@ EXPORT_SYMBOL(__aeabi_unwind_cpp_pr2);
67 67
68struct unwind_ctrl_block { 68struct unwind_ctrl_block {
69 unsigned long vrs[16]; /* virtual register set */ 69 unsigned long vrs[16]; /* virtual register set */
70 unsigned long *insn; /* pointer to the current instructions word */ 70 const unsigned long *insn; /* pointer to the current instructions word */
71 int entries; /* number of entries left to interpret */ 71 int entries; /* number of entries left to interpret */
72 int byte; /* current byte number in the instructions word */ 72 int byte; /* current byte number in the instructions word */
73}; 73};
@@ -83,8 +83,9 @@ enum regs {
83 PC = 15 83 PC = 15
84}; 84};
85 85
86extern struct unwind_idx __start_unwind_idx[]; 86extern const struct unwind_idx __start_unwind_idx[];
87extern struct unwind_idx __stop_unwind_idx[]; 87static const struct unwind_idx *__origin_unwind_idx;
88extern const struct unwind_idx __stop_unwind_idx[];
88 89
89static DEFINE_SPINLOCK(unwind_lock); 90static DEFINE_SPINLOCK(unwind_lock);
90static LIST_HEAD(unwind_tables); 91static LIST_HEAD(unwind_tables);
@@ -98,45 +99,99 @@ static LIST_HEAD(unwind_tables);
98}) 99})
99 100
100/* 101/*
101 * Binary search in the unwind index. The entries entries are 102 * Binary search in the unwind index. The entries are
102 * guaranteed to be sorted in ascending order by the linker. 103 * guaranteed to be sorted in ascending order by the linker.
104 *
105 * start = first entry
106 * origin = first entry with positive offset (or stop if there is no such entry)
107 * stop - 1 = last entry
103 */ 108 */
104static struct unwind_idx *search_index(unsigned long addr, 109static const struct unwind_idx *search_index(unsigned long addr,
105 struct unwind_idx *first, 110 const struct unwind_idx *start,
106 struct unwind_idx *last) 111 const struct unwind_idx *origin,
112 const struct unwind_idx *stop)
107{ 113{
108 pr_debug("%s(%08lx, %p, %p)\n", __func__, addr, first, last); 114 unsigned long addr_prel31;
115
116 pr_debug("%s(%08lx, %p, %p, %p)\n",
117 __func__, addr, start, origin, stop);
118
119 /*
120 * only search in the section with the matching sign. This way the
121 * prel31 numbers can be compared as unsigned longs.
122 */
123 if (addr < (unsigned long)start)
124 /* negative offsets: [start; origin) */
125 stop = origin;
126 else
127 /* positive offsets: [origin; stop) */
128 start = origin;
129
130 /* prel31 for address relavive to start */
131 addr_prel31 = (addr - (unsigned long)start) & 0x7fffffff;
109 132
110 if (addr < first->addr) { 133 while (start < stop - 1) {
134 const struct unwind_idx *mid = start + ((stop - start) >> 1);
135
136 /*
137 * As addr_prel31 is relative to start an offset is needed to
138 * make it relative to mid.
139 */
140 if (addr_prel31 - ((unsigned long)mid - (unsigned long)start) <
141 mid->addr_offset)
142 stop = mid;
143 else {
144 /* keep addr_prel31 relative to start */
145 addr_prel31 -= ((unsigned long)mid -
146 (unsigned long)start);
147 start = mid;
148 }
149 }
150
151 if (likely(start->addr_offset <= addr_prel31))
152 return start;
153 else {
111 pr_warning("unwind: Unknown symbol address %08lx\n", addr); 154 pr_warning("unwind: Unknown symbol address %08lx\n", addr);
112 return NULL; 155 return NULL;
113 } else if (addr >= last->addr) 156 }
114 return last; 157}
115 158
116 while (first < last - 1) { 159static const struct unwind_idx *unwind_find_origin(
117 struct unwind_idx *mid = first + ((last - first + 1) >> 1); 160 const struct unwind_idx *start, const struct unwind_idx *stop)
161{
162 pr_debug("%s(%p, %p)\n", __func__, start, stop);
163 while (start < stop) {
164 const struct unwind_idx *mid = start + ((stop - start) >> 1);
118 165
119 if (addr < mid->addr) 166 if (mid->addr_offset >= 0x40000000)
120 last = mid; 167 /* negative offset */
168 start = mid + 1;
121 else 169 else
122 first = mid; 170 /* positive offset */
171 stop = mid;
123 } 172 }
124 173 pr_debug("%s -> %p\n", __func__, stop);
125 return first; 174 return stop;
126} 175}
127 176
128static struct unwind_idx *unwind_find_idx(unsigned long addr) 177static const struct unwind_idx *unwind_find_idx(unsigned long addr)
129{ 178{
130 struct unwind_idx *idx = NULL; 179 const struct unwind_idx *idx = NULL;
131 unsigned long flags; 180 unsigned long flags;
132 181
133 pr_debug("%s(%08lx)\n", __func__, addr); 182 pr_debug("%s(%08lx)\n", __func__, addr);
134 183
135 if (core_kernel_text(addr)) 184 if (core_kernel_text(addr)) {
185 if (unlikely(!__origin_unwind_idx))
186 __origin_unwind_idx =
187 unwind_find_origin(__start_unwind_idx,
188 __stop_unwind_idx);
189
136 /* main unwind table */ 190 /* main unwind table */
137 idx = search_index(addr, __start_unwind_idx, 191 idx = search_index(addr, __start_unwind_idx,
138 __stop_unwind_idx - 1); 192 __origin_unwind_idx,
139 else { 193 __stop_unwind_idx);
194 } else {
140 /* module unwind tables */ 195 /* module unwind tables */
141 struct unwind_table *table; 196 struct unwind_table *table;
142 197
@@ -145,7 +200,8 @@ static struct unwind_idx *unwind_find_idx(unsigned long addr)
145 if (addr >= table->begin_addr && 200 if (addr >= table->begin_addr &&
146 addr < table->end_addr) { 201 addr < table->end_addr) {
147 idx = search_index(addr, table->start, 202 idx = search_index(addr, table->start,
148 table->stop - 1); 203 table->origin,
204 table->stop);
149 /* Move-to-front to exploit common traces */ 205 /* Move-to-front to exploit common traces */
150 list_move(&table->list, &unwind_tables); 206 list_move(&table->list, &unwind_tables);
151 break; 207 break;
@@ -274,7 +330,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
274int unwind_frame(struct stackframe *frame) 330int unwind_frame(struct stackframe *frame)
275{ 331{
276 unsigned long high, low; 332 unsigned long high, low;
277 struct unwind_idx *idx; 333 const struct unwind_idx *idx;
278 struct unwind_ctrl_block ctrl; 334 struct unwind_ctrl_block ctrl;
279 335
280 /* only go to a higher address on the stack */ 336 /* 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,
399 unsigned long text_size) 455 unsigned long text_size)
400{ 456{
401 unsigned long flags; 457 unsigned long flags;
402 struct unwind_idx *idx;
403 struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL); 458 struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL);
404 459
405 pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size, 460 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,
408 if (!tab) 463 if (!tab)
409 return tab; 464 return tab;
410 465
411 tab->start = (struct unwind_idx *)start; 466 tab->start = (const struct unwind_idx *)start;
412 tab->stop = (struct unwind_idx *)(start + size); 467 tab->stop = (const struct unwind_idx *)(start + size);
468 tab->origin = unwind_find_origin(tab->start, tab->stop);
413 tab->begin_addr = text_addr; 469 tab->begin_addr = text_addr;
414 tab->end_addr = text_addr + text_size; 470 tab->end_addr = text_addr + text_size;
415 471
416 /* Convert the symbol addresses to absolute values */
417 for (idx = tab->start; idx < tab->stop; idx++)
418 idx->addr = prel31_to_addr(&idx->addr);
419
420 spin_lock_irqsave(&unwind_lock, flags); 472 spin_lock_irqsave(&unwind_lock, flags);
421 list_add_tail(&tab->list, &unwind_tables); 473 list_add_tail(&tab->list, &unwind_tables);
422 spin_unlock_irqrestore(&unwind_lock, flags); 474 spin_unlock_irqrestore(&unwind_lock, flags);
@@ -437,16 +489,3 @@ void unwind_table_del(struct unwind_table *tab)
437 489
438 kfree(tab); 490 kfree(tab);
439} 491}
440
441int __init unwind_init(void)
442{
443 struct unwind_idx *idx;
444
445 /* Convert the symbol addresses to absolute values */
446 for (idx = __start_unwind_idx; idx < __stop_unwind_idx; idx++)
447 idx->addr = prel31_to_addr(&idx->addr);
448
449 pr_debug("unwind: ARM stack unwinding initialised\n");
450
451 return 0;
452}
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 20b3041e0860..f76e75548670 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -13,6 +13,12 @@
13 *(.proc.info.init) \ 13 *(.proc.info.init) \
14 VMLINUX_SYMBOL(__proc_info_end) = .; 14 VMLINUX_SYMBOL(__proc_info_end) = .;
15 15
16#define IDMAP_TEXT \
17 ALIGN_FUNCTION(); \
18 VMLINUX_SYMBOL(__idmap_text_start) = .; \
19 *(.idmap.text) \
20 VMLINUX_SYMBOL(__idmap_text_end) = .;
21
16#ifdef CONFIG_HOTPLUG_CPU 22#ifdef CONFIG_HOTPLUG_CPU
17#define ARM_CPU_DISCARD(x) 23#define ARM_CPU_DISCARD(x)
18#define ARM_CPU_KEEP(x) x 24#define ARM_CPU_KEEP(x) x
@@ -92,6 +98,7 @@ SECTIONS
92 SCHED_TEXT 98 SCHED_TEXT
93 LOCK_TEXT 99 LOCK_TEXT
94 KPROBES_TEXT 100 KPROBES_TEXT
101 IDMAP_TEXT
95#ifdef CONFIG_MMU 102#ifdef CONFIG_MMU
96 *(.fixup) 103 *(.fixup)
97#endif 104#endif
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index cf73a7f742dd..0ade0acc1ed9 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -13,7 +13,8 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
13 testchangebit.o testclearbit.o testsetbit.o \ 13 testchangebit.o testclearbit.o testsetbit.o \
14 ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ 14 ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
15 ucmpdi2.o lib1funcs.o div64.o \ 15 ucmpdi2.o lib1funcs.o div64.o \
16 io-readsb.o io-writesb.o io-readsl.o io-writesl.o 16 io-readsb.o io-writesb.o io-readsl.o io-writesl.o \
17 call_with_stack.o
17 18
18mmu-y := clear_user.o copy_page.o getuser.o putuser.o 19mmu-y := clear_user.o copy_page.o getuser.o putuser.o
19 20
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 10d868a5a481..d6408d1ee543 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -1,5 +1,9 @@
1#include <asm/unwind.h>
2
1#if __LINUX_ARM_ARCH__ >= 6 3#if __LINUX_ARM_ARCH__ >= 6
2 .macro bitop, instr 4 .macro bitop, name, instr
5ENTRY( \name )
6UNWIND( .fnstart )
3 ands ip, r1, #3 7 ands ip, r1, #3
4 strneb r1, [ip] @ assert word-aligned 8 strneb r1, [ip] @ assert word-aligned
5 mov r2, #1 9 mov r2, #1
@@ -13,9 +17,13 @@
13 cmp r0, #0 17 cmp r0, #0
14 bne 1b 18 bne 1b
15 bx lr 19 bx lr
20UNWIND( .fnend )
21ENDPROC(\name )
16 .endm 22 .endm
17 23
18 .macro testop, instr, store 24 .macro testop, name, instr, store
25ENTRY( \name )
26UNWIND( .fnstart )
19 ands ip, r1, #3 27 ands ip, r1, #3
20 strneb r1, [ip] @ assert word-aligned 28 strneb r1, [ip] @ assert word-aligned
21 mov r2, #1 29 mov r2, #1
@@ -34,9 +42,13 @@
34 cmp r0, #0 42 cmp r0, #0
35 movne r0, #1 43 movne r0, #1
362: bx lr 442: bx lr
45UNWIND( .fnend )
46ENDPROC(\name )
37 .endm 47 .endm
38#else 48#else
39 .macro bitop, instr 49 .macro bitop, name, instr
50ENTRY( \name )
51UNWIND( .fnstart )
40 ands ip, r1, #3 52 ands ip, r1, #3
41 strneb r1, [ip] @ assert word-aligned 53 strneb r1, [ip] @ assert word-aligned
42 and r2, r0, #31 54 and r2, r0, #31
@@ -49,6 +61,8 @@
49 str r2, [r1, r0, lsl #2] 61 str r2, [r1, r0, lsl #2]
50 restore_irqs ip 62 restore_irqs ip
51 mov pc, lr 63 mov pc, lr
64UNWIND( .fnend )
65ENDPROC(\name )
52 .endm 66 .endm
53 67
54/** 68/**
@@ -59,7 +73,9 @@
59 * Note: we can trivially conditionalise the store instruction 73 * Note: we can trivially conditionalise the store instruction
60 * to avoid dirtying the data cache. 74 * to avoid dirtying the data cache.
61 */ 75 */
62 .macro testop, instr, store 76 .macro testop, name, instr, store
77ENTRY( \name )
78UNWIND( .fnstart )
63 ands ip, r1, #3 79 ands ip, r1, #3
64 strneb r1, [ip] @ assert word-aligned 80 strneb r1, [ip] @ assert word-aligned
65 and r3, r0, #31 81 and r3, r0, #31
@@ -73,5 +89,7 @@
73 moveq r0, #0 89 moveq r0, #0
74 restore_irqs ip 90 restore_irqs ip
75 mov pc, lr 91 mov pc, lr
92UNWIND( .fnend )
93ENDPROC(\name )
76 .endm 94 .endm
77#endif 95#endif
diff --git a/arch/arm/lib/call_with_stack.S b/arch/arm/lib/call_with_stack.S
new file mode 100644
index 000000000000..916c80f13ae7
--- /dev/null
+++ b/arch/arm/lib/call_with_stack.S
@@ -0,0 +1,44 @@
1/*
2 * arch/arm/lib/call_with_stack.S
3 *
4 * Copyright (C) 2011 ARM Ltd.
5 * Written by Will Deacon <will.deacon@arm.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/linkage.h>
22#include <asm/assembler.h>
23
24/*
25 * void call_with_stack(void (*fn)(void *), void *arg, void *sp)
26 *
27 * Change the stack to that pointed at by sp, then invoke fn(arg) with
28 * the new stack.
29 */
30ENTRY(call_with_stack)
31 str sp, [r2, #-4]!
32 str lr, [r2, #-4]!
33
34 mov sp, r2
35 mov r2, r0
36 mov r0, r1
37
38 adr lr, BSYM(1f)
39 mov pc, r2
40
411: ldr lr, [sp]
42 ldr sp, [sp, #4]
43 mov pc, lr
44ENDPROC(call_with_stack)
diff --git a/arch/arm/lib/changebit.S b/arch/arm/lib/changebit.S
index 68ed5b62e839..f4027862172f 100644
--- a/arch/arm/lib/changebit.S
+++ b/arch/arm/lib/changebit.S
@@ -12,6 +12,4 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_change_bit) 15bitop _change_bit, eor
16 bitop eor
17ENDPROC(_change_bit)
diff --git a/arch/arm/lib/clearbit.S b/arch/arm/lib/clearbit.S
index 4c04c3b51eeb..f6b75fb64d30 100644
--- a/arch/arm/lib/clearbit.S
+++ b/arch/arm/lib/clearbit.S
@@ -12,6 +12,4 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_clear_bit) 15bitop _clear_bit, bic
16 bitop bic
17ENDPROC(_clear_bit)
diff --git a/arch/arm/lib/setbit.S b/arch/arm/lib/setbit.S
index bbee5c66a23e..618fedae4b37 100644
--- a/arch/arm/lib/setbit.S
+++ b/arch/arm/lib/setbit.S
@@ -12,6 +12,4 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_set_bit) 15bitop _set_bit, orr
16 bitop orr
17ENDPROC(_set_bit)
diff --git a/arch/arm/lib/testchangebit.S b/arch/arm/lib/testchangebit.S
index 15a4d431f229..4becdc3a59cb 100644
--- a/arch/arm/lib/testchangebit.S
+++ b/arch/arm/lib/testchangebit.S
@@ -12,6 +12,4 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_test_and_change_bit) 15testop _test_and_change_bit, eor, str
16 testop eor, str
17ENDPROC(_test_and_change_bit)
diff --git a/arch/arm/lib/testclearbit.S b/arch/arm/lib/testclearbit.S
index 521b66b5b95d..918841dcce7a 100644
--- a/arch/arm/lib/testclearbit.S
+++ b/arch/arm/lib/testclearbit.S
@@ -12,6 +12,4 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_test_and_clear_bit) 15testop _test_and_clear_bit, bicne, strne
16 testop bicne, strne
17ENDPROC(_test_and_clear_bit)
diff --git a/arch/arm/lib/testsetbit.S b/arch/arm/lib/testsetbit.S
index 1c98cc2185bb..8d1b2fe9e487 100644
--- a/arch/arm/lib/testsetbit.S
+++ b/arch/arm/lib/testsetbit.S
@@ -12,6 +12,4 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_test_and_set_bit) 15testop _test_and_set_bit, orreq, streq
16 testop orreq, streq
17ENDPROC(_test_and_set_bit)
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index ecdd54dd68c6..29373397d2df 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -313,7 +313,7 @@ static struct at91_gpio_bank at91cap9_gpio[] = {
313 } 313 }
314}; 314};
315 315
316static void at91cap9_reset(void) 316static void at91cap9_restart(char mode, const char *cmd)
317{ 317{
318 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); 318 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
319} 319}
@@ -335,7 +335,7 @@ static void __init at91cap9_map_io(void)
335 335
336static void __init at91cap9_initialize(void) 336static void __init at91cap9_initialize(void)
337{ 337{
338 at91_arch_reset = at91cap9_reset; 338 arm_pm_restart = at91cap9_restart;
339 pm_power_off = at91cap9_poweroff; 339 pm_power_off = at91cap9_poweroff;
340 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); 340 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
341 341
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 713d3bdbd284..430a9fdc3dbf 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -288,7 +288,7 @@ static struct at91_gpio_bank at91rm9200_gpio[] = {
288 } 288 }
289}; 289};
290 290
291static void at91rm9200_reset(void) 291static void at91rm9200_restart(char mode, const char *cmd)
292{ 292{
293 /* 293 /*
294 * Perform a hardware reset with the use of the Watchdog timer. 294 * Perform a hardware reset with the use of the Watchdog timer.
@@ -309,7 +309,7 @@ static void __init at91rm9200_map_io(void)
309 309
310static void __init at91rm9200_initialize(void) 310static void __init at91rm9200_initialize(void)
311{ 311{
312 at91_arch_reset = at91rm9200_reset; 312 arm_pm_restart = at91rm9200_restart;
313 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) 313 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
314 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3) 314 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
315 | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5) 315 | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 66591fa53e05..ad930688358c 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -83,7 +83,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
83 * USB Device (Gadget) 83 * USB Device (Gadget)
84 * -------------------------------------------------------------------- */ 84 * -------------------------------------------------------------------- */
85 85
86#ifdef CONFIG_USB_GADGET_AT91 86#ifdef CONFIG_USB_AT91
87static struct at91_udc_data udc_data; 87static struct at91_udc_data udc_data;
88 88
89static struct resource udc_resources[] = { 89static struct resource udc_resources[] = {
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index b84a9f642f59..e76cd49ebc9e 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -195,9 +195,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), 195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
196 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), 196 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
197 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), 197 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
198 CLKDEV_CON_DEV_ID("t3_clk", "atmel_tcb.1", &tc3_clk), 198 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
199 CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk), 199 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
200 CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk), 200 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
201 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), 201 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
202 /* more usart lookup table for DT entries */ 202 /* more usart lookup table for DT entries */
203 CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), 203 CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
@@ -327,7 +327,7 @@ static void __init at91sam9260_map_io(void)
327 327
328static void __init at91sam9260_initialize(void) 328static void __init at91sam9260_initialize(void)
329{ 329{
330 at91_arch_reset = at91sam9_alt_reset; 330 arm_pm_restart = at91sam9_alt_restart;
331 pm_power_off = at91sam9260_poweroff; 331 pm_power_off = at91sam9260_poweroff;
332 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) 332 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
333 | (1 << AT91SAM9260_ID_IRQ2); 333 | (1 << AT91SAM9260_ID_IRQ2);
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 25e3464fb07f..629fa9774972 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -84,7 +84,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
84 * USB Device (Gadget) 84 * USB Device (Gadget)
85 * -------------------------------------------------------------------- */ 85 * -------------------------------------------------------------------- */
86 86
87#ifdef CONFIG_USB_GADGET_AT91 87#ifdef CONFIG_USB_AT91
88static struct at91_udc_data udc_data; 88static struct at91_udc_data udc_data;
89 89
90static struct resource udc_resources[] = { 90static struct resource udc_resources[] = {
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 658a5185abfd..19ac7c0729a0 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -287,7 +287,7 @@ static void __init at91sam9261_map_io(void)
287 287
288static void __init at91sam9261_initialize(void) 288static void __init at91sam9261_initialize(void)
289{ 289{
290 at91_arch_reset = at91sam9_alt_reset; 290 arm_pm_restart = at91sam9_alt_restart;
291 pm_power_off = at91sam9261_poweroff; 291 pm_power_off = at91sam9261_poweroff;
292 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) 292 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
293 | (1 << AT91SAM9261_ID_IRQ2); 293 | (1 << AT91SAM9261_ID_IRQ2);
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index ae78f4d03b73..a178b58b0b9c 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -87,7 +87,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
87 * USB Device (Gadget) 87 * USB Device (Gadget)
88 * -------------------------------------------------------------------- */ 88 * -------------------------------------------------------------------- */
89 89
90#ifdef CONFIG_USB_GADGET_AT91 90#ifdef CONFIG_USB_AT91
91static struct at91_udc_data udc_data; 91static struct at91_udc_data udc_data;
92 92
93static struct resource udc_resources[] = { 93static struct resource udc_resources[] = {
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index f83fbb0ee0c5..50d016310031 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -305,7 +305,7 @@ static void __init at91sam9263_map_io(void)
305 305
306static void __init at91sam9263_initialize(void) 306static void __init at91sam9263_initialize(void)
307{ 307{
308 at91_arch_reset = at91sam9_alt_reset; 308 arm_pm_restart = at91sam9_alt_restart;
309 pm_power_off = at91sam9263_poweroff; 309 pm_power_off = at91sam9263_poweroff;
310 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); 310 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
311 311
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index ad017eb1f8df..d5fbac9ff4fa 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
92 * USB Device (Gadget) 92 * USB Device (Gadget)
93 * -------------------------------------------------------------------- */ 93 * -------------------------------------------------------------------- */
94 94
95#ifdef CONFIG_USB_GADGET_AT91 95#ifdef CONFIG_USB_AT91
96static struct at91_udc_data udc_data; 96static struct at91_udc_data udc_data;
97 97
98static struct resource udc_resources[] = { 98static struct resource udc_resources[] = {
diff --git a/arch/arm/mach-at91/at91sam9_alt_reset.S b/arch/arm/mach-at91/at91sam9_alt_reset.S
index e0256deb91fb..d3f931c5942e 100644
--- a/arch/arm/mach-at91/at91sam9_alt_reset.S
+++ b/arch/arm/mach-at91/at91sam9_alt_reset.S
@@ -14,20 +14,15 @@
14 */ 14 */
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <asm/system.h>
18#include <mach/hardware.h> 17#include <mach/hardware.h>
19#include <mach/at91sam9_sdramc.h> 18#include <mach/at91sam9_sdramc.h>
20#include <mach/at91_rstc.h> 19#include <mach/at91_rstc.h>
21 20
22 .arm 21 .arm
23 22
24 .globl at91sam9_alt_reset 23 .globl at91sam9_alt_restart
25 24
26at91sam9_alt_reset: mrc p15, 0, r0, c1, c0, 0 25at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants
27 orr r0, r0, #CR_I
28 mcr p15, 0, r0, c1, c0, 0 @ enable I-cache
29
30 ldr r0, .at91_va_base_sdramc @ preload constants
31 ldr r1, .at91_va_base_rstc_cr 26 ldr r1, .at91_va_base_rstc_cr
32 27
33 mov r2, #1 28 mov r2, #1
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 318b0407ea04..ff21f7a60c63 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -317,7 +317,7 @@ static struct at91_gpio_bank at91sam9g45_gpio[] = {
317 } 317 }
318}; 318};
319 319
320static void at91sam9g45_reset(void) 320static void at91sam9g45_restart(char mode, const char *cmd)
321{ 321{
322 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); 322 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
323} 323}
@@ -340,7 +340,7 @@ static void __init at91sam9g45_map_io(void)
340 340
341static void __init at91sam9g45_initialize(void) 341static void __init at91sam9g45_initialize(void)
342{ 342{
343 at91_arch_reset = at91sam9g45_reset; 343 arm_pm_restart = at91sam9g45_restart;
344 pm_power_off = at91sam9g45_poweroff; 344 pm_power_off = at91sam9g45_poweroff;
345 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); 345 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
346 346
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index a238105d2c11..61cbb46f5b0e 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -292,7 +292,7 @@ static void __init at91sam9rl_map_io(void)
292 292
293static void __init at91sam9rl_initialize(void) 293static void __init at91sam9rl_initialize(void)
294{ 294{
295 at91_arch_reset = at91sam9_alt_reset; 295 arm_pm_restart = at91sam9_alt_restart;
296 pm_power_off = at91sam9rl_poweroff; 296 pm_power_off = at91sam9rl_poweroff;
297 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); 297 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
298 298
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 938b34f57741..7f4503bc4cbb 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -57,7 +57,7 @@ extern void at91_irq_suspend(void);
57extern void at91_irq_resume(void); 57extern void at91_irq_resume(void);
58 58
59/* reset */ 59/* reset */
60extern void at91sam9_alt_reset(void); 60extern void at91sam9_alt_restart(char, const char *);
61 61
62 /* GPIO */ 62 /* GPIO */
63#define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ 63#define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */
@@ -71,5 +71,4 @@ struct at91_gpio_bank {
71extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks); 71extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
72extern void __init at91_gpio_irq_setup(void); 72extern void __init at91_gpio_irq_setup(void);
73 73
74extern void (*at91_arch_reset)(void);
75extern int at91_extern_irq; 74extern int at91_extern_irq;
diff --git a/arch/arm/mach-at91/include/mach/io.h b/arch/arm/mach-at91/include/mach/io.h
index 4298e7806c76..4ca09ef7ca29 100644
--- a/arch/arm/mach-at91/include/mach/io.h
+++ b/arch/arm/mach-at91/include/mach/io.h
@@ -30,14 +30,6 @@
30 30
31#ifndef __ASSEMBLY__ 31#ifndef __ASSEMBLY__
32 32
33#ifndef CONFIG_ARCH_AT91X40
34#define __arch_ioremap at91_ioremap
35#define __arch_iounmap at91_iounmap
36#endif
37
38void __iomem *at91_ioremap(unsigned long phys, size_t size, unsigned int type);
39void at91_iounmap(volatile void __iomem *addr);
40
41static inline unsigned int at91_sys_read(unsigned int reg_offset) 33static inline unsigned int at91_sys_read(unsigned int reg_offset)
42{ 34{
43 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; 35 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h
index 36af14bc13bb..cbd64f3bcecd 100644
--- a/arch/arm/mach-at91/include/mach/system.h
+++ b/arch/arm/mach-at91/include/mach/system.h
@@ -47,13 +47,4 @@ static inline void arch_idle(void)
47#endif 47#endif
48} 48}
49 49
50void (*at91_arch_reset)(void);
51
52static inline void arch_reset(char mode, const char *cmd)
53{
54 /* call the CPU-specific reset function */
55 if (at91_arch_reset)
56 (at91_arch_reset)();
57}
58
59#endif 50#endif
diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
index 8f4866045b41..ec164a4124c9 100644
--- a/arch/arm/mach-at91/include/mach/system_rev.h
+++ b/arch/arm/mach-at91/include/mach/system_rev.h
@@ -19,7 +19,7 @@
19#define BOARD_HAVE_NAND_16BIT (1 << 31) 19#define BOARD_HAVE_NAND_16BIT (1 << 31)
20static inline int board_have_nand_16bit(void) 20static inline int board_have_nand_16bit(void)
21{ 21{
22 return system_rev & BOARD_HAVE_NAND_16BIT; 22 return (system_rev & BOARD_HAVE_NAND_16BIT) ? 1 : 0;
23} 23}
24 24
25#endif /* __ARCH_SYSTEM_REV_H__ */ 25#endif /* __ARCH_SYSTEM_REV_H__ */
diff --git a/arch/arm/mach-at91/include/mach/vmalloc.h b/arch/arm/mach-at91/include/mach/vmalloc.h
deleted file mode 100644
index 8e4a1bd0ab1d..000000000000
--- a/arch/arm/mach-at91/include/mach/vmalloc.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * arch/arm/mach-at91/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2003 SAN People
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __ASM_ARCH_VMALLOC_H
22#define __ASM_ARCH_VMALLOC_H
23
24#include <mach/hardware.h>
25
26#define VMALLOC_END (AT91_VIRT_BASE & PGDIR_MASK)
27
28#endif
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index aa64294c7db3..cf98a8f94dc5 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -73,24 +73,6 @@ static struct map_desc at91_io_desc __initdata = {
73 .type = MT_DEVICE, 73 .type = MT_DEVICE,
74}; 74};
75 75
76void __iomem *at91_ioremap(unsigned long p, size_t size, unsigned int type)
77{
78 if (p >= AT91_BASE_SYS && p <= (AT91_BASE_SYS + SZ_16K - 1))
79 return (void __iomem *)AT91_IO_P2V(p);
80
81 return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
82}
83EXPORT_SYMBOL(at91_ioremap);
84
85void at91_iounmap(volatile void __iomem *addr)
86{
87 unsigned long virt = (unsigned long)addr;
88
89 if (virt >= VMALLOC_START && virt < VMALLOC_END)
90 __iounmap(addr);
91}
92EXPORT_SYMBOL(at91_iounmap);
93
94#define AT91_DBGU0 0xfffff200 76#define AT91_DBGU0 0xfffff200
95#define AT91_DBGU1 0xffffee00 77#define AT91_DBGU1 0xffffee00
96 78
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c
index 31a143592c81..9e5e7552498c 100644
--- a/arch/arm/mach-bcmring/arch.c
+++ b/arch/arm/mach-bcmring/arch.c
@@ -49,7 +49,29 @@ HW_DECLARE_SPINLOCK(gpio)
49#endif 49#endif
50 50
51/* sysctl */ 51/* sysctl */
52int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */ 52static int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */
53
54static void bcmring_restart(char mode, const char *cmd)
55{
56 printk("arch_reset:%c %x\n", mode, bcmring_arch_warm_reboot);
57
58 if (mode == 'h') {
59 /* Reboot configured in proc entry */
60 if (bcmring_arch_warm_reboot) {
61 printk("warm reset\n");
62 /* Issue Warm reset (do not reset ethernet switch, keep alive) */
63 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_WARM);
64 } else {
65 /* Force reset of everything */
66 printk("force reset\n");
67 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
68 }
69 } else {
70 /* Force reset of everything */
71 printk("force reset\n");
72 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
73 }
74}
53 75
54static struct ctl_table_header *bcmring_sysctl_header; 76static struct ctl_table_header *bcmring_sysctl_header;
55 77
@@ -173,4 +195,5 @@ MACHINE_START(BCMRING, "BCMRING")
173 .init_irq = bcmring_init_irq, 195 .init_irq = bcmring_init_irq,
174 .timer = &bcmring_timer, 196 .timer = &bcmring_timer,
175 .init_machine = bcmring_init_machine 197 .init_machine = bcmring_init_machine
198 .restart = bcmring_restart,
176MACHINE_END 199MACHINE_END
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
index 43eadbcc29ed..6b67b7e8426c 100644
--- a/arch/arm/mach-bcmring/core.c
+++ b/arch/arm/mach-bcmring/core.c
@@ -25,7 +25,6 @@
25#include <linux/device.h> 25#include <linux/device.h>
26#include <linux/dma-mapping.h> 26#include <linux/dma-mapping.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/sysdev.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
30#include <linux/amba/bus.h> 29#include <linux/amba/bus.h>
31#include <linux/clkdev.h> 30#include <linux/clkdev.h>
@@ -235,7 +234,7 @@ void __init bcmring_init_timer(void)
235 */ 234 */
236 bcmring_clocksource_init(); 235 bcmring_clocksource_init();
237 236
238 sp804_clockevents_register(TIMER0_VA_BASE, IRQ_TIMER0, "timer0"); 237 sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMER0, "timer0");
239} 238}
240 239
241struct sys_timer bcmring_timer = { 240struct sys_timer bcmring_timer = {
diff --git a/arch/arm/mach-bcmring/dma.c b/arch/arm/mach-bcmring/dma.c
index b52b8de91bde..1a1a27dd5654 100644
--- a/arch/arm/mach-bcmring/dma.c
+++ b/arch/arm/mach-bcmring/dma.c
@@ -36,6 +36,7 @@
36#include <linux/mm.h> 36#include <linux/mm.h>
37#include <linux/pfn.h> 37#include <linux/pfn.h>
38#include <linux/atomic.h> 38#include <linux/atomic.h>
39#include <linux/sched.h>
39#include <mach/dma.h> 40#include <mach/dma.h>
40 41
41/* I don't quite understand why dc4 fails when this is set to 1 and DMA is enabled */ 42/* I don't quite understand why dc4 fails when this is set to 1 and DMA is enabled */
@@ -1614,7 +1615,7 @@ DMA_MemType_t dma_mem_type(void *addr)
1614{ 1615{
1615 unsigned long addrVal = (unsigned long)addr; 1616 unsigned long addrVal = (unsigned long)addr;
1616 1617
1617 if (addrVal >= VMALLOC_END) { 1618 if (addrVal >= CONSISTENT_BASE) {
1618 /* NOTE: DMA virtual memory space starts at 0xFFxxxxxx */ 1619 /* NOTE: DMA virtual memory space starts at 0xFFxxxxxx */
1619 1620
1620 /* dma_alloc_xxx pages are physically and virtually contiguous */ 1621 /* dma_alloc_xxx pages are physically and virtually contiguous */
diff --git a/arch/arm/mach-bcmring/include/mach/system.h b/arch/arm/mach-bcmring/include/mach/system.h
index 38b37060d426..cb78250db649 100644
--- a/arch/arm/mach-bcmring/include/mach/system.h
+++ b/arch/arm/mach-bcmring/include/mach/system.h
@@ -20,35 +20,9 @@
20#ifndef __ASM_ARCH_SYSTEM_H 20#ifndef __ASM_ARCH_SYSTEM_H
21#define __ASM_ARCH_SYSTEM_H 21#define __ASM_ARCH_SYSTEM_H
22 22
23#include <mach/csp/chipcHw_inline.h>
24
25extern int bcmring_arch_warm_reboot;
26
27static inline void arch_idle(void) 23static inline void arch_idle(void)
28{ 24{
29 cpu_do_idle(); 25 cpu_do_idle();
30} 26}
31 27
32static inline void arch_reset(char mode, const char *cmd)
33{
34 printk("arch_reset:%c %x\n", mode, bcmring_arch_warm_reboot);
35
36 if (mode == 'h') {
37 /* Reboot configured in proc entry */
38 if (bcmring_arch_warm_reboot) {
39 printk("warm reset\n");
40 /* Issue Warm reset (do not reset ethernet switch, keep alive) */
41 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_WARM);
42 } else {
43 /* Force reset of everything */
44 printk("force reset\n");
45 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
46 }
47 } else {
48 /* Force reset of everything */
49 printk("force reset\n");
50 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
51 }
52}
53
54#endif 28#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
index 7397bd7817d9..000000000000
--- a/arch/arm/mach-bcmring/include/mach/vmalloc.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 *
3 * Copyright (C) 2000 Russell King.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20/*
21 * Move VMALLOC_END to 0xf0000000 so that the vm space can range from
22 * 0xe0000000 to 0xefffffff. This gives us 256 MB of vm space and handles
23 * larger physical memory designs better.
24 */
25#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile
index 4a197315f0cf..f2f0256232e3 100644
--- a/arch/arm/mach-clps711x/Makefile
+++ b/arch/arm/mach-clps711x/Makefile
@@ -4,7 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := irq.o mm.o time.o 7obj-y := common.o
8obj-m := 8obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
index 0276091b7f86..3fb79a1d0bde 100644
--- a/arch/arm/mach-clps711x/autcpu12.c
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -68,5 +68,6 @@ MACHINE_START(AUTCPU12, "autronix autcpu12")
68 .map_io = autcpu12_map_io, 68 .map_io = autcpu12_map_io,
69 .init_irq = clps711x_init_irq, 69 .init_irq = clps711x_init_irq,
70 .timer = &clps711x_timer, 70 .timer = &clps711x_timer,
71 .restart = clps711x_restart,
71MACHINE_END 72MACHINE_END
72 73
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index 25b3bfd0e85a..c314f49d6ef6 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -59,4 +59,5 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712")
59 .map_io = cdb89712_map_io, 59 .map_io = cdb89712_map_io,
60 .init_irq = clps711x_init_irq, 60 .init_irq = clps711x_init_irq,
61 .timer = &clps711x_timer, 61 .timer = &clps711x_timer,
62 .restart = clps711x_restart,
62MACHINE_END 63MACHINE_END
diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
index 1df9ec67aa92..a70147e347ac 100644
--- a/arch/arm/mach-clps711x/ceiva.c
+++ b/arch/arm/mach-clps711x/ceiva.c
@@ -60,4 +60,5 @@ MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
60 .map_io = ceiva_map_io, 60 .map_io = ceiva_map_io,
61 .init_irq = clps711x_init_irq, 61 .init_irq = clps711x_init_irq,
62 .timer = &clps711x_timer, 62 .timer = &clps711x_timer,
63 .restart = clps711x_restart,
63MACHINE_END 64MACHINE_END
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index 80496c09ac59..dbc7842639dc 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -41,5 +41,6 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
41 .map_io = clps711x_map_io, 41 .map_io = clps711x_map_io,
42 .init_irq = clps711x_init_irq, 42 .init_irq = clps711x_init_irq,
43 .timer = &clps711x_timer, 43 .timer = &clps711x_timer,
44 .restart = clps711x_restart,
44MACHINE_END 45MACHINE_END
45 46
diff --git a/arch/arm/mach-clps711x/irq.c b/arch/arm/mach-clps711x/common.c
index c2eceee645e3..ab1711b9b4d6 100644
--- a/arch/arm/mach-clps711x/irq.c
+++ b/arch/arm/mach-clps711x/common.c
@@ -1,7 +1,9 @@
1/* 1/*
2 * linux/arch/arm/mach-clps711x/irq.c 2 * linux/arch/arm/mach-clps711x/core.c
3 * 3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd. 4 * Core support for the CLPS711x-based machines.
5 *
6 * Copyright (C) 2001,2011 Deep Blue Solutions Ltd
5 * 7 *
6 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -17,16 +19,42 @@
17 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 21 */
22#include <linux/kernel.h>
23#include <linux/mm.h>
20#include <linux/init.h> 24#include <linux/init.h>
21#include <linux/list.h> 25#include <linux/interrupt.h>
22#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/irq.h>
28#include <linux/sched.h>
29#include <linux/timex.h>
23 30
24#include <asm/mach/irq.h> 31#include <asm/sizes.h>
25#include <mach/hardware.h> 32#include <mach/hardware.h>
26#include <asm/irq.h> 33#include <asm/irq.h>
27 34#include <asm/leds.h>
35#include <asm/pgtable.h>
36#include <asm/page.h>
37#include <asm/mach/map.h>
38#include <asm/mach/time.h>
28#include <asm/hardware/clps7111.h> 39#include <asm/hardware/clps7111.h>
29 40
41/*
42 * This maps the generic CLPS711x registers
43 */
44static struct map_desc clps711x_io_desc[] __initdata = {
45 {
46 .virtual = CLPS7111_VIRT_BASE,
47 .pfn = __phys_to_pfn(CLPS7111_PHYS_BASE),
48 .length = SZ_1M,
49 .type = MT_DEVICE
50 }
51};
52
53void __init clps711x_map_io(void)
54{
55 iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
56}
57
30static void int1_mask(struct irq_data *d) 58static void int1_mask(struct irq_data *d)
31{ 59{
32 u32 intmr1; 60 u32 intmr1;
@@ -112,15 +140,15 @@ void __init clps711x_init_irq(void)
112 140
113 for (i = 0; i < NR_IRQS; i++) { 141 for (i = 0; i < NR_IRQS; i++) {
114 if (INT1_IRQS & (1 << i)) { 142 if (INT1_IRQS & (1 << i)) {
115 irq_set_chip_and_handler(i, &int1_chip, 143 irq_set_chip_and_handler(i, &int1_chip,
116 handle_level_irq); 144 handle_level_irq);
117 set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 145 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
118 } 146 }
119 if (INT2_IRQS & (1 << i)) { 147 if (INT2_IRQS & (1 << i)) {
120 irq_set_chip_and_handler(i, &int2_chip, 148 irq_set_chip_and_handler(i, &int2_chip,
121 handle_level_irq); 149 handle_level_irq);
122 set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 150 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
123 } 151 }
124 } 152 }
125 153
126 /* 154 /*
@@ -141,3 +169,59 @@ void __init clps711x_init_irq(void)
141 clps_writel(0, SYNCIO); 169 clps_writel(0, SYNCIO);
142 clps_writel(0, KBDEOI); 170 clps_writel(0, KBDEOI);
143} 171}
172
173/*
174 * gettimeoffset() returns time since last timer tick, in usecs.
175 *
176 * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
177 * 'tick' is usecs per jiffy.
178 */
179static unsigned long clps711x_gettimeoffset(void)
180{
181 unsigned long hwticks;
182 hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */
183 return (hwticks * (tick_nsec / 1000)) / LATCH;
184}
185
186/*
187 * IRQ handler for the timer
188 */
189static irqreturn_t p720t_timer_interrupt(int irq, void *dev_id)
190{
191 timer_tick();
192 return IRQ_HANDLED;
193}
194
195static struct irqaction clps711x_timer_irq = {
196 .name = "CLPS711x Timer Tick",
197 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
198 .handler = p720t_timer_interrupt,
199};
200
201static void __init clps711x_timer_init(void)
202{
203 struct timespec tv;
204 unsigned int syscon;
205
206 syscon = clps_readl(SYSCON1);
207 syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
208 clps_writel(syscon, SYSCON1);
209
210 clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
211
212 setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
213
214 tv.tv_nsec = 0;
215 tv.tv_sec = clps_readl(RTCDR);
216 do_settimeofday(&tv);
217}
218
219struct sys_timer clps711x_timer = {
220 .init = clps711x_timer_init,
221 .offset = clps711x_gettimeoffset,
222};
223
224void clps711x_restart(char mode, const char *cmd)
225{
226 soft_restart(0);
227}
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h
index 2b8b801f1dc3..fc0f0650dcb5 100644
--- a/arch/arm/mach-clps711x/common.h
+++ b/arch/arm/mach-clps711x/common.h
@@ -9,3 +9,4 @@ struct sys_timer;
9extern void clps711x_map_io(void); 9extern void clps711x_map_io(void);
10extern void clps711x_init_irq(void); 10extern void clps711x_init_irq(void);
11extern struct sys_timer clps711x_timer; 11extern struct sys_timer clps711x_timer;
12extern void clps711x_restart(char mode, const char *cmd);
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
index 9721f6111dc0..5fad0b4f40ad 100644
--- a/arch/arm/mach-clps711x/edb7211-arch.c
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -62,4 +62,5 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
62 .reserve = edb7211_reserve, 62 .reserve = edb7211_reserve,
63 .init_irq = clps711x_init_irq, 63 .init_irq = clps711x_init_irq,
64 .timer = &clps711x_timer, 64 .timer = &clps711x_timer,
65 .restart = clps711x_restart,
65MACHINE_END 66MACHINE_END
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index d99256687298..3a3f0b702cb4 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -78,4 +78,5 @@ MACHINE_START(FORTUNET, "ARM-FortuNet")
78 .map_io = clps711x_map_io, 78 .map_io = clps711x_map_io,
79 .init_irq = clps711x_init_irq, 79 .init_irq = clps711x_init_irq,
80 .timer = &clps711x_timer, 80 .timer = &clps711x_timer,
81 .restart = clps711x_restart,
81MACHINE_END 82MACHINE_END
diff --git a/arch/arm/mach-clps711x/include/mach/system.h b/arch/arm/mach-clps711x/include/mach/system.h
index f916cd7a477d..23d6ef8c84da 100644
--- a/arch/arm/mach-clps711x/include/mach/system.h
+++ b/arch/arm/mach-clps711x/include/mach/system.h
@@ -32,9 +32,4 @@ static inline void arch_idle(void)
32 mov r0, r0"); 32 mov r0, r0");
33} 33}
34 34
35static inline void arch_reset(char mode, const char *cmd)
36{
37 cpu_reset(0);
38}
39
40#endif 35#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
index 467b96137e47..000000000000
--- a/arch/arm/mach-clps711x/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-clps711x/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END 0xd0000000UL
diff --git a/arch/arm/mach-clps711x/mm.c b/arch/arm/mach-clps711x/mm.c
deleted file mode 100644
index 986592176767..000000000000
--- a/arch/arm/mach-clps711x/mm.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * linux/arch/arm/mach-clps711x/mm.c
3 *
4 * Generic MM setup for the CLPS711x-based machines.
5 *
6 * Copyright (C) 2001 Deep Blue Solutions Ltd
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/mm.h>
24#include <linux/init.h>
25
26#include <asm/sizes.h>
27#include <mach/hardware.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/mach/map.h>
31#include <asm/hardware/clps7111.h>
32
33/*
34 * This maps the generic CLPS711x registers
35 */
36static struct map_desc clps711x_io_desc[] __initdata = {
37 {
38 .virtual = CLPS7111_VIRT_BASE,
39 .pfn = __phys_to_pfn(CLPS7111_PHYS_BASE),
40 .length = SZ_1M,
41 .type = MT_DEVICE
42 }
43};
44
45void __init clps711x_map_io(void)
46{
47 iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
48}
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index 6ecea95f38b2..42ee8f33eafb 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -93,6 +93,7 @@ MACHINE_START(P720T, "ARM-Prospector720T")
93 .map_io = p720t_map_io, 93 .map_io = p720t_map_io,
94 .init_irq = clps711x_init_irq, 94 .init_irq = clps711x_init_irq,
95 .timer = &clps711x_timer, 95 .timer = &clps711x_timer,
96 .restart = clps711x_restart,
96MACHINE_END 97MACHINE_END
97 98
98static int p720t_hw_init(void) 99static 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
index d581ef0bcd24..000000000000
--- a/arch/arm/mach-clps711x/time.c
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * linux/arch/arm/mach-clps711x/time.c
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/timex.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/sched.h>
24#include <linux/io.h>
25
26#include <mach/hardware.h>
27#include <asm/irq.h>
28#include <asm/leds.h>
29#include <asm/hardware/clps7111.h>
30
31#include <asm/mach/time.h>
32
33
34/*
35 * gettimeoffset() returns time since last timer tick, in usecs.
36 *
37 * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
38 * 'tick' is usecs per jiffy.
39 */
40static unsigned long clps711x_gettimeoffset(void)
41{
42 unsigned long hwticks;
43 hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */
44 return (hwticks * (tick_nsec / 1000)) / LATCH;
45}
46
47/*
48 * IRQ handler for the timer
49 */
50static irqreturn_t
51p720t_timer_interrupt(int irq, void *dev_id)
52{
53 timer_tick();
54 return IRQ_HANDLED;
55}
56
57static struct irqaction clps711x_timer_irq = {
58 .name = "CLPS711x Timer Tick",
59 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
60 .handler = p720t_timer_interrupt,
61};
62
63static void __init clps711x_timer_init(void)
64{
65 struct timespec tv;
66 unsigned int syscon;
67
68 syscon = clps_readl(SYSCON1);
69 syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
70 clps_writel(syscon, SYSCON1);
71
72 clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
73
74 setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
75
76 tv.tv_nsec = 0;
77 tv.tv_sec = clps_readl(RTCDR);
78 do_settimeofday(&tv);
79}
80
81struct sys_timer clps711x_timer = {
82 .init = clps711x_timer_init,
83 .offset = clps711x_gettimeoffset,
84};
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c
index 55f7b4b08ab9..2c5fb4c7e509 100644
--- a/arch/arm/mach-cns3xxx/cns3420vb.c
+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
@@ -26,6 +26,7 @@
26#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/mach-types.h> 28#include <asm/mach-types.h>
29#include <asm/hardware/gic.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
31#include <asm/mach/time.h> 32#include <asm/mach/time.h>
@@ -201,5 +202,7 @@ MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
201 .map_io = cns3420_map_io, 202 .map_io = cns3420_map_io,
202 .init_irq = cns3xxx_init_irq, 203 .init_irq = cns3xxx_init_irq,
203 .timer = &cns3xxx_timer, 204 .timer = &cns3xxx_timer,
205 .handle_irq = gic_handle_irq,
204 .init_machine = cns3420_init, 206 .init_machine = cns3420_init,
207 .restart = cns3xxx_restart,
205MACHINE_END 208MACHINE_END
diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h
index fcd225343c61..4894b8c17151 100644
--- a/arch/arm/mach-cns3xxx/core.h
+++ b/arch/arm/mach-cns3xxx/core.h
@@ -22,5 +22,6 @@ static inline void cns3xxx_l2x0_init(void) {}
22void __init cns3xxx_map_io(void); 22void __init cns3xxx_map_io(void);
23void __init cns3xxx_init_irq(void); 23void __init cns3xxx_init_irq(void);
24void cns3xxx_power_off(void); 24void cns3xxx_power_off(void);
25void cns3xxx_restart(char, const char *);
25 26
26#endif /* __CNS3XXX_CORE_H */ 27#endif /* __CNS3XXX_CORE_H */
diff --git a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S
index d87bfc397d39..01c57df5f716 100644
--- a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S
+++ b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S
@@ -8,8 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <asm/hardware/entry-macro-gic.S>
12
13 .macro disable_fiq 11 .macro disable_fiq
14 .endm 12 .endm
15 13
diff --git a/arch/arm/mach-cns3xxx/include/mach/system.h b/arch/arm/mach-cns3xxx/include/mach/system.h
index 4f16c9b79f78..9e56b7dc133a 100644
--- a/arch/arm/mach-cns3xxx/include/mach/system.h
+++ b/arch/arm/mach-cns3xxx/include/mach/system.h
@@ -11,7 +11,6 @@
11#ifndef __MACH_SYSTEM_H 11#ifndef __MACH_SYSTEM_H
12#define __MACH_SYSTEM_H 12#define __MACH_SYSTEM_H
13 13
14#include <linux/io.h>
15#include <asm/proc-fns.h> 14#include <asm/proc-fns.h>
16 15
17static inline void arch_idle(void) 16static inline void arch_idle(void)
@@ -23,6 +22,4 @@ static inline void arch_idle(void)
23 cpu_do_idle(); 22 cpu_do_idle();
24} 23}
25 24
26void arch_reset(char mode, const char *cmd);
27
28#endif 25#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
index 1dd231d2f772..000000000000
--- a/arch/arm/mach-cns3xxx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * Copyright 2000 Russell King.
3 * Copyright 2003 ARM Limited
4 * Copyright 2008 Cavium Networks
5 *
6 * This file is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, Version 2, as
8 * published by the Free Software Foundation.
9 */
10
11#define VMALLOC_END 0xd8000000UL
diff --git a/arch/arm/mach-cns3xxx/pm.c b/arch/arm/mach-cns3xxx/pm.c
index 0c04678615ce..36458080332a 100644
--- a/arch/arm/mach-cns3xxx/pm.c
+++ b/arch/arm/mach-cns3xxx/pm.c
@@ -11,9 +11,9 @@
11#include <linux/io.h> 11#include <linux/io.h>
12#include <linux/delay.h> 12#include <linux/delay.h>
13#include <linux/atomic.h> 13#include <linux/atomic.h>
14#include <mach/system.h>
15#include <mach/cns3xxx.h> 14#include <mach/cns3xxx.h>
16#include <mach/pm.h> 15#include <mach/pm.h>
16#include "core.h"
17 17
18void cns3xxx_pwr_clk_en(unsigned int block) 18void cns3xxx_pwr_clk_en(unsigned int block)
19{ 19{
@@ -89,7 +89,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block)
89} 89}
90EXPORT_SYMBOL(cns3xxx_pwr_soft_rst); 90EXPORT_SYMBOL(cns3xxx_pwr_soft_rst);
91 91
92void arch_reset(char mode, const char *cmd) 92void cns3xxx_restart(char mode, const char *cmd)
93{ 93{
94 /* 94 /*
95 * To reset, we hit the on-board reset register 95 * To reset, we hit the on-board reset register
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 495e31306fc0..2db78bd5c835 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -4,7 +4,7 @@
4# 4#
5 5
6# Common objects 6# Common objects
7obj-y := time.o clock.o serial.o io.o psc.o \ 7obj-y := time.o clock.o serial.o psc.o \
8 dma.o usb.o common.o sram.o aemif.o 8 dma.o usb.o common.o sram.o aemif.o
9 9
10obj-$(CONFIG_DAVINCI_MUX) += mux.o 10obj-$(CONFIG_DAVINCI_MUX) += mux.o
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 11c3db985285..dc1afe5be20c 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -682,4 +682,5 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
682 .timer = &davinci_timer, 682 .timer = &davinci_timer,
683 .init_machine = da830_evm_init, 683 .init_machine = da830_evm_init,
684 .dma_zone_size = SZ_128M, 684 .dma_zone_size = SZ_128M,
685 .restart = da8xx_restart,
685MACHINE_END 686MACHINE_END
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 1d7d24995226..f8a682f60a42 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -753,7 +753,7 @@ static struct snd_platform_data da850_evm_snd_data = {
753 .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), 753 .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
754 .tdm_slots = 2, 754 .tdm_slots = 2,
755 .serial_dir = da850_iis_serializer_direction, 755 .serial_dir = da850_iis_serializer_direction,
756 .asp_chan_q = EVENTQ_1, 756 .asp_chan_q = EVENTQ_0,
757 .version = MCASP_VERSION_2, 757 .version = MCASP_VERSION_2,
758 .txnumevt = 1, 758 .txnumevt = 1,
759 .rxnumevt = 1, 759 .rxnumevt = 1,
@@ -1411,4 +1411,5 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
1411 .timer = &davinci_timer, 1411 .timer = &davinci_timer,
1412 .init_machine = da850_evm_init, 1412 .init_machine = da850_evm_init,
1413 .dma_zone_size = SZ_128M, 1413 .dma_zone_size = SZ_128M,
1414 .restart = da8xx_restart,
1414MACHINE_END 1415MACHINE_END
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 4e0e707c313d..275341f159fb 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -357,4 +357,5 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
357 .timer = &davinci_timer, 357 .timer = &davinci_timer,
358 .init_machine = dm355_evm_init, 358 .init_machine = dm355_evm_init,
359 .dma_zone_size = SZ_128M, 359 .dma_zone_size = SZ_128M,
360 .restart = davinci_restart,
360MACHINE_END 361MACHINE_END
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index ff2d2413279a..e99db28181ae 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -276,4 +276,5 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
276 .timer = &davinci_timer, 276 .timer = &davinci_timer,
277 .init_machine = dm355_leopard_init, 277 .init_machine = dm355_leopard_init,
278 .dma_zone_size = SZ_128M, 278 .dma_zone_size = SZ_128M,
279 .restart = davinci_restart,
279MACHINE_END 280MACHINE_END
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 1918ae711428..346e1de2f5a8 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -107,7 +107,7 @@ static struct mtd_partition davinci_nand_partitions[] = {
107 /* UBL (a few copies) plus U-Boot */ 107 /* UBL (a few copies) plus U-Boot */
108 .name = "bootloader", 108 .name = "bootloader",
109 .offset = 0, 109 .offset = 0,
110 .size = 28 * NAND_BLOCK_SIZE, 110 .size = 30 * NAND_BLOCK_SIZE,
111 .mask_flags = MTD_WRITEABLE, /* force read-only */ 111 .mask_flags = MTD_WRITEABLE, /* force read-only */
112 }, { 112 }, {
113 /* U-Boot environment */ 113 /* U-Boot environment */
@@ -618,5 +618,6 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
618 .timer = &davinci_timer, 618 .timer = &davinci_timer,
619 .init_machine = dm365_evm_init, 619 .init_machine = dm365_evm_init,
620 .dma_zone_size = SZ_128M, 620 .dma_zone_size = SZ_128M,
621 .restart = davinci_restart,
621MACHINE_END 622MACHINE_END
622 623
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 0cf8abf78d33..a64b49cfedca 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -719,4 +719,5 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
719 .timer = &davinci_timer, 719 .timer = &davinci_timer,
720 .init_machine = davinci_evm_init, 720 .init_machine = davinci_evm_init,
721 .dma_zone_size = SZ_128M, 721 .dma_zone_size = SZ_128M,
722 .restart = davinci_restart,
722MACHINE_END 723MACHINE_END
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index e574d7f837a8..64017558860b 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -564,7 +564,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
564 int val; 564 int val;
565 u32 value; 565 u32 value;
566 566
567 if (!vpif_vsclkdis_reg || !cpld_client) 567 if (!vpif_vidclkctl_reg || !cpld_client)
568 return -ENXIO; 568 return -ENXIO;
569 569
570 val = i2c_smbus_read_byte(cpld_client); 570 val = i2c_smbus_read_byte(cpld_client);
@@ -572,7 +572,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
572 return val; 572 return val;
573 573
574 spin_lock_irqsave(&vpif_reg_lock, flags); 574 spin_lock_irqsave(&vpif_reg_lock, flags);
575 value = __raw_readl(vpif_vsclkdis_reg); 575 value = __raw_readl(vpif_vidclkctl_reg);
576 if (mux_mode) { 576 if (mux_mode) {
577 val &= VPIF_INPUT_TWO_CHANNEL; 577 val &= VPIF_INPUT_TWO_CHANNEL;
578 value |= VIDCH1CLK; 578 value |= VIDCH1CLK;
@@ -580,7 +580,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
580 val |= VPIF_INPUT_ONE_CHANNEL; 580 val |= VPIF_INPUT_ONE_CHANNEL;
581 value &= ~VIDCH1CLK; 581 value &= ~VIDCH1CLK;
582 } 582 }
583 __raw_writel(value, vpif_vsclkdis_reg); 583 __raw_writel(value, vpif_vidclkctl_reg);
584 spin_unlock_irqrestore(&vpif_reg_lock, flags); 584 spin_unlock_irqrestore(&vpif_reg_lock, flags);
585 585
586 err = i2c_smbus_write_byte(cpld_client, val); 586 err = i2c_smbus_write_byte(cpld_client, val);
@@ -799,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
799 .timer = &davinci_timer, 799 .timer = &davinci_timer,
800 .init_machine = evm_init, 800 .init_machine = evm_init,
801 .dma_zone_size = SZ_128M, 801 .dma_zone_size = SZ_128M,
802 .restart = davinci_restart,
802MACHINE_END 803MACHINE_END
803 804
804MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") 805MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
@@ -808,5 +809,6 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
808 .timer = &davinci_timer, 809 .timer = &davinci_timer,
809 .init_machine = evm_init, 810 .init_machine = evm_init,
810 .dma_zone_size = SZ_128M, 811 .dma_zone_size = SZ_128M,
812 .restart = davinci_restart,
811MACHINE_END 813MACHINE_END
812 814
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 3cfff555e8f2..672d820e2aa4 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -573,4 +573,5 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
573 .timer = &davinci_timer, 573 .timer = &davinci_timer,
574 .init_machine = mityomapl138_init, 574 .init_machine = mityomapl138_init,
575 .dma_zone_size = SZ_128M, 575 .dma_zone_size = SZ_128M,
576 .restart = da8xx_restart,
576MACHINE_END 577MACHINE_END
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index e5f231aefee4..6c4a16415d47 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -278,4 +278,5 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
278 .timer = &davinci_timer, 278 .timer = &davinci_timer,
279 .init_machine = davinci_ntosd2_init, 279 .init_machine = davinci_ntosd2_init,
280 .dma_zone_size = SZ_128M, 280 .dma_zone_size = SZ_128M,
281 .restart = davinci_restart,
281MACHINE_END 282MACHINE_END
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index c6701e4a795c..e7c0c7c53493 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -344,4 +344,5 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
344 .timer = &davinci_timer, 344 .timer = &davinci_timer,
345 .init_machine = omapl138_hawk_init, 345 .init_machine = omapl138_hawk_init,
346 .dma_zone_size = SZ_128M, 346 .dma_zone_size = SZ_128M,
347 .restart = da8xx_restart,
347MACHINE_END 348MACHINE_END
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 5dd4da9d2308..0b136a831c59 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -157,4 +157,5 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
157 .timer = &davinci_timer, 157 .timer = &davinci_timer,
158 .init_machine = davinci_sffsdr_init, 158 .init_machine = davinci_sffsdr_init,
159 .dma_zone_size = SZ_128M, 159 .dma_zone_size = SZ_128M,
160 .restart = davinci_restart,
160MACHINE_END 161MACHINE_END
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index f69e40a29e02..5f14e30b00d8 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -283,4 +283,5 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
283 .timer = &davinci_timer, 283 .timer = &davinci_timer,
284 .init_machine = tnetv107x_evm_board_init, 284 .init_machine = tnetv107x_evm_board_init,
285 .dma_zone_size = SZ_128M, 285 .dma_zone_size = SZ_128M,
286 .restart = tnetv107x_restart,
286MACHINE_END 287MACHINE_END
diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index 865ffe5899ac..cb9b2e47510c 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -97,9 +97,6 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
97 local_flush_tlb_all(); 97 local_flush_tlb_all();
98 flush_cache_all(); 98 flush_cache_all();
99 99
100 if (!davinci_soc_info.reset)
101 davinci_soc_info.reset = davinci_watchdog_reset;
102
103 /* 100 /*
104 * We want to check CPU revision early for cpu_is_xxxx() macros. 101 * We want to check CPU revision early for cpu_is_xxxx() macros.
105 * IO space mapping must be initialized before we can do that. 102 * IO space mapping must be initialized before we can do that.
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index a6bf5dcaef13..deee5c2da754 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -1201,7 +1201,6 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
1201 .gpio_irq = IRQ_DA8XX_GPIO0, 1201 .gpio_irq = IRQ_DA8XX_GPIO0,
1202 .serial_dev = &da8xx_serial_device, 1202 .serial_dev = &da8xx_serial_device,
1203 .emac_pdata = &da8xx_emac_pdata, 1203 .emac_pdata = &da8xx_emac_pdata,
1204 .reset_device = &da8xx_wdt_device,
1205}; 1204};
1206 1205
1207void __init da830_init(void) 1206void __init da830_init(void)
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index b047f8702278..0ed7fdb64efb 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -1121,7 +1121,6 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
1121 .emac_pdata = &da8xx_emac_pdata, 1121 .emac_pdata = &da8xx_emac_pdata,
1122 .sram_dma = DA8XX_ARM_RAM_BASE, 1122 .sram_dma = DA8XX_ARM_RAM_BASE,
1123 .sram_len = SZ_8K, 1123 .sram_len = SZ_8K,
1124 .reset_device = &da8xx_wdt_device,
1125}; 1124};
1126 1125
1127void __init da850_init(void) 1126void __init da850_init(void)
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 68def7188868..42dbf3dc11ab 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -363,6 +363,11 @@ struct platform_device da8xx_wdt_device = {
363 .resource = da8xx_watchdog_resources, 363 .resource = da8xx_watchdog_resources,
364}; 364};
365 365
366void da8xx_restart(char mode, const char *cmd)
367{
368 davinci_watchdog_reset(&da8xx_wdt_device);
369}
370
366int __init da8xx_register_watchdog(void) 371int __init da8xx_register_watchdog(void)
367{ 372{
368 return platform_device_register(&da8xx_wdt_device); 373 return platform_device_register(&da8xx_wdt_device);
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 806a2f02b980..50c0156b4262 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -291,6 +291,11 @@ struct platform_device davinci_wdt_device = {
291 .resource = wdt_resources, 291 .resource = wdt_resources,
292}; 292};
293 293
294void davinci_restart(char mode, const char *cmd)
295{
296 davinci_watchdog_reset(&davinci_wdt_device);
297}
298
294static void davinci_init_wdt(void) 299static void davinci_init_wdt(void)
295{ 300{
296 platform_device_register(&davinci_wdt_device); 301 platform_device_register(&davinci_wdt_device);
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index fe520d4167a2..19667cfc5de0 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -853,7 +853,6 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
853 .serial_dev = &dm355_serial_device, 853 .serial_dev = &dm355_serial_device,
854 .sram_dma = 0x00010000, 854 .sram_dma = 0x00010000,
855 .sram_len = SZ_32K, 855 .sram_len = SZ_32K,
856 .reset_device = &davinci_wdt_device,
857}; 856};
858 857
859void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata) 858void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 679e168dce34..f15b435cc655 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1083,7 +1083,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
1083 .emac_pdata = &dm365_emac_pdata, 1083 .emac_pdata = &dm365_emac_pdata,
1084 .sram_dma = 0x00010000, 1084 .sram_dma = 0x00010000,
1085 .sram_len = SZ_32K, 1085 .sram_len = SZ_32K,
1086 .reset_device = &davinci_wdt_device,
1087}; 1086};
1088 1087
1089void __init dm365_init_asp(struct snd_platform_data *pdata) 1088void __init dm365_init_asp(struct snd_platform_data *pdata)
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 3470983aa343..0800f9cf33bb 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -767,7 +767,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
767 .emac_pdata = &dm644x_emac_pdata, 767 .emac_pdata = &dm644x_emac_pdata,
768 .sram_dma = 0x00008000, 768 .sram_dma = 0x00008000,
769 .sram_len = SZ_16K, 769 .sram_len = SZ_16K,
770 .reset_device = &davinci_wdt_device,
771}; 770};
772 771
773void __init dm644x_init_asp(struct snd_platform_data *pdata) 772void __init dm644x_init_asp(struct snd_platform_data *pdata)
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 0b68ed534f8e..00f774394b16 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -161,7 +161,6 @@ static struct clk dsp_clk = {
161 .name = "dsp", 161 .name = "dsp",
162 .parent = &pll1_sysclk1, 162 .parent = &pll1_sysclk1,
163 .lpsc = DM646X_LPSC_C64X_CPU, 163 .lpsc = DM646X_LPSC_C64X_CPU,
164 .flags = PSC_DSP,
165 .usecount = 1, /* REVISIT how to disable? */ 164 .usecount = 1, /* REVISIT how to disable? */
166}; 165};
167 166
@@ -855,7 +854,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
855 .emac_pdata = &dm646x_emac_pdata, 854 .emac_pdata = &dm646x_emac_pdata,
856 .sram_dma = 0x10010000, 855 .sram_dma = 0x10010000,
857 .sram_len = SZ_32K, 856 .sram_len = SZ_32K,
858 .reset_device = &davinci_wdt_device,
859}; 857};
860 858
861void __init dm646x_init_mcasp0(struct snd_platform_data *pdata) 859void __init dm646x_init_mcasp0(struct snd_platform_data *pdata)
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index a57cba21e21e..5cd39a4e0c96 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -77,14 +77,13 @@ struct davinci_soc_info {
77 struct emac_platform_data *emac_pdata; 77 struct emac_platform_data *emac_pdata;
78 dma_addr_t sram_dma; 78 dma_addr_t sram_dma;
79 unsigned sram_len; 79 unsigned sram_len;
80 struct platform_device *reset_device;
81 void (*reset)(struct platform_device *);
82}; 80};
83 81
84extern struct davinci_soc_info davinci_soc_info; 82extern struct davinci_soc_info davinci_soc_info;
85 83
86extern void davinci_common_init(struct davinci_soc_info *soc_info); 84extern void davinci_common_init(struct davinci_soc_info *soc_info);
87extern void davinci_init_ide(void); 85extern void davinci_init_ide(void);
86void davinci_restart(char mode, const char *cmd);
88 87
89/* standard place to map on-chip SRAMs; they *may* support DMA */ 88/* standard place to map on-chip SRAMs; they *may* support DMA */
90#define SRAM_VIRT 0xfffe0000 89#define SRAM_VIRT 0xfffe0000
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index eaca7d8b9d68..ee3461d7ec1b 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -91,6 +91,7 @@ int da8xx_register_cpuidle(void);
91void __iomem * __init da8xx_get_mem_ctlr(void); 91void __iomem * __init da8xx_get_mem_ctlr(void);
92int da850_register_pm(struct platform_device *pdev); 92int da850_register_pm(struct platform_device *pdev);
93int __init da850_register_sata(unsigned long refclkpn); 93int __init da850_register_sata(unsigned long refclkpn);
94void da8xx_restart(char mode, const char *cmd);
94 95
95extern struct platform_device da8xx_serial_device; 96extern struct platform_device da8xx_serial_device;
96extern struct emac_platform_data da8xx_emac_pdata; 97extern struct emac_platform_data da8xx_emac_pdata;
diff --git a/arch/arm/mach-davinci/include/mach/io.h b/arch/arm/mach-davinci/include/mach/io.h
index d1b954955c12..b2267d1e1a71 100644
--- a/arch/arm/mach-davinci/include/mach/io.h
+++ b/arch/arm/mach-davinci/include/mach/io.h
@@ -21,12 +21,4 @@
21#define __mem_pci(a) (a) 21#define __mem_pci(a) (a)
22#define __mem_isa(a) (a) 22#define __mem_isa(a) (a)
23 23
24#ifndef __ASSEMBLER__
25#define __arch_ioremap davinci_ioremap
26#define __arch_iounmap davinci_iounmap
27
28void __iomem *davinci_ioremap(unsigned long phys, size_t size,
29 unsigned int type);
30void davinci_iounmap(volatile void __iomem *addr);
31#endif
32#endif /* __ASM_ARCH_IO_H */ 24#endif /* __ASM_ARCH_IO_H */
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index fa59c097223d..8bc3fc256171 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -233,7 +233,7 @@
233#define PTCMD 0x120 233#define PTCMD 0x120
234#define PTSTAT 0x128 234#define PTSTAT 0x128
235#define PDSTAT 0x200 235#define PDSTAT 0x200
236#define PDCTL1 0x304 236#define PDCTL 0x300
237#define MDSTAT 0x800 237#define MDSTAT 0x800
238#define MDCTL 0xA00 238#define MDCTL 0xA00
239 239
@@ -244,7 +244,10 @@
244#define PSC_STATE_ENABLE 3 244#define PSC_STATE_ENABLE 3
245 245
246#define MDSTAT_STATE_MASK 0x3f 246#define MDSTAT_STATE_MASK 0x3f
247#define PDSTAT_STATE_MASK 0x1f
247#define MDCTL_FORCE BIT(31) 248#define MDCTL_FORCE BIT(31)
249#define PDCTL_NEXT BIT(1)
250#define PDCTL_EPCGOOD BIT(8)
248 251
249#ifndef __ASSEMBLER__ 252#ifndef __ASSEMBLER__
250 253
diff --git a/arch/arm/mach-davinci/include/mach/system.h b/arch/arm/mach-davinci/include/mach/system.h
index e65629c20769..fcb7a015aba5 100644
--- a/arch/arm/mach-davinci/include/mach/system.h
+++ b/arch/arm/mach-davinci/include/mach/system.h
@@ -18,10 +18,4 @@ static inline void arch_idle(void)
18 cpu_do_idle(); 18 cpu_do_idle();
19} 19}
20 20
21static inline void arch_reset(char mode, const char *cmd)
22{
23 if (davinci_soc_info.reset)
24 davinci_soc_info.reset(davinci_soc_info.reset_device);
25}
26
27#endif /* __ASM_ARCH_SYSTEM_H */ 21#endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
index 89c1fdc63c0b..83e5926f3c46 100644
--- a/arch/arm/mach-davinci/include/mach/tnetv107x.h
+++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h
@@ -54,6 +54,7 @@ extern struct platform_device tnetv107x_serial_device;
54extern void __init tnetv107x_init(void); 54extern void __init tnetv107x_init(void);
55extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *); 55extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *);
56extern void __init tnetv107x_irq_init(void); 56extern void __init tnetv107x_irq_init(void);
57void tnetv107x_restart(char mode, const char *cmd);
57 58
58#endif 59#endif
59 60
diff --git a/arch/arm/mach-davinci/include/mach/vmalloc.h b/arch/arm/mach-davinci/include/mach/vmalloc.h
deleted file mode 100644
index d49646a8e206..000000000000
--- a/arch/arm/mach-davinci/include/mach/vmalloc.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * DaVinci vmalloc definitions
3 *
4 * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#include <mach/hardware.h>
12
13/* Allow vmalloc range until the IO virtual range minus a 2M "hole" */
14#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
index 8ea60a8b2495..000000000000
--- a/arch/arm/mach-davinci/io.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * DaVinci I/O mapping code
3 *
4 * Copyright (C) 2005-2006 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
12#include <linux/io.h>
13
14#include <asm/tlb.h>
15#include <asm/mach/map.h>
16
17#include <mach/common.h>
18
19/*
20 * Intercept ioremap() requests for addresses in our fixed mapping regions.
21 */
22void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)
23{
24 struct map_desc *desc = davinci_soc_info.io_desc;
25 int desc_num = davinci_soc_info.io_desc_num;
26 int i;
27
28 for (i = 0; i < desc_num; i++, desc++) {
29 unsigned long iophys = __pfn_to_phys(desc->pfn);
30 unsigned long iosize = desc->length;
31
32 if (p >= iophys && (p + size) <= (iophys + iosize))
33 return __io(desc->virtual + p - iophys);
34 }
35
36 return __arm_ioremap_caller(p, size, type,
37 __builtin_return_address(0));
38}
39EXPORT_SYMBOL(davinci_ioremap);
40
41void davinci_iounmap(volatile void __iomem *addr)
42{
43 unsigned long virt = (unsigned long)addr;
44
45 if (virt >= VMALLOC_START && virt < VMALLOC_END)
46 __iounmap(addr);
47}
48EXPORT_SYMBOL(davinci_iounmap);
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c
index 1fb6bdff38c1..d7e210f4b55c 100644
--- a/arch/arm/mach-davinci/psc.c
+++ b/arch/arm/mach-davinci/psc.c
@@ -52,7 +52,7 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
52void davinci_psc_config(unsigned int domain, unsigned int ctlr, 52void davinci_psc_config(unsigned int domain, unsigned int ctlr,
53 unsigned int id, bool enable, u32 flags) 53 unsigned int id, bool enable, u32 flags)
54{ 54{
55 u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl; 55 u32 epcpr, ptcmd, ptstat, pdstat, pdctl, mdstat, mdctl;
56 void __iomem *psc_base; 56 void __iomem *psc_base;
57 struct davinci_soc_info *soc_info = &davinci_soc_info; 57 struct davinci_soc_info *soc_info = &davinci_soc_info;
58 u32 next_state = PSC_STATE_ENABLE; 58 u32 next_state = PSC_STATE_ENABLE;
@@ -79,11 +79,11 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
79 mdctl |= MDCTL_FORCE; 79 mdctl |= MDCTL_FORCE;
80 __raw_writel(mdctl, psc_base + MDCTL + 4 * id); 80 __raw_writel(mdctl, psc_base + MDCTL + 4 * id);
81 81
82 pdstat = __raw_readl(psc_base + PDSTAT); 82 pdstat = __raw_readl(psc_base + PDSTAT + 4 * domain);
83 if ((pdstat & 0x00000001) == 0) { 83 if ((pdstat & PDSTAT_STATE_MASK) == 0) {
84 pdctl1 = __raw_readl(psc_base + PDCTL1); 84 pdctl = __raw_readl(psc_base + PDCTL + 4 * domain);
85 pdctl1 |= 0x1; 85 pdctl |= PDCTL_NEXT;
86 __raw_writel(pdctl1, psc_base + PDCTL1); 86 __raw_writel(pdctl, psc_base + PDCTL + 4 * domain);
87 87
88 ptcmd = 1 << domain; 88 ptcmd = 1 << domain;
89 __raw_writel(ptcmd, psc_base + PTCMD); 89 __raw_writel(ptcmd, psc_base + PTCMD);
@@ -92,9 +92,9 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
92 epcpr = __raw_readl(psc_base + EPCPR); 92 epcpr = __raw_readl(psc_base + EPCPR);
93 } while ((((epcpr >> domain) & 1) == 0)); 93 } while ((((epcpr >> domain) & 1) == 0));
94 94
95 pdctl1 = __raw_readl(psc_base + PDCTL1); 95 pdctl = __raw_readl(psc_base + PDCTL + 4 * domain);
96 pdctl1 |= 0x100; 96 pdctl |= PDCTL_EPCGOOD;
97 __raw_writel(pdctl1, psc_base + PDCTL1); 97 __raw_writel(pdctl, psc_base + PDCTL + 4 * domain);
98 } else { 98 } else {
99 ptcmd = 1 << domain; 99 ptcmd = 1 << domain;
100 __raw_writel(ptcmd, psc_base + PTCMD); 100 __raw_writel(ptcmd, psc_base + PTCMD);
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c
index 409bb869c7c7..dc1a209b9b66 100644
--- a/arch/arm/mach-davinci/tnetv107x.c
+++ b/arch/arm/mach-davinci/tnetv107x.c
@@ -730,6 +730,11 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev)
730 __raw_writel(1, &regs->kick); 730 __raw_writel(1, &regs->kick);
731} 731}
732 732
733void tnetv107x_restart(char mode, const char *cmd)
734{
735 tnetv107x_watchdog_reset(&tnetv107x_wdt_device);
736}
737
733static struct davinci_soc_info tnetv107x_soc_info = { 738static struct davinci_soc_info tnetv107x_soc_info = {
734 .io_desc = io_desc, 739 .io_desc = io_desc,
735 .io_desc_num = ARRAY_SIZE(io_desc), 740 .io_desc_num = ARRAY_SIZE(io_desc),
@@ -752,8 +757,6 @@ static struct davinci_soc_info tnetv107x_soc_info = {
752 .gpio_num = TNETV107X_N_GPIO, 757 .gpio_num = TNETV107X_N_GPIO,
753 .timer_info = &timer_info, 758 .timer_info = &timer_info,
754 .serial_dev = &tnetv107x_serial_device, 759 .serial_dev = &tnetv107x_serial_device,
755 .reset = tnetv107x_watchdog_reset,
756 .reset_device = &tnetv107x_wdt_device,
757}; 760};
758 761
759void __init tnetv107x_init(void) 762void __init tnetv107x_init(void)
diff --git a/arch/arm/mach-dove/cm-a510.c b/arch/arm/mach-dove/cm-a510.c
index c8a406f7e946..792b4e2e24f1 100644
--- a/arch/arm/mach-dove/cm-a510.c
+++ b/arch/arm/mach-dove/cm-a510.c
@@ -93,4 +93,5 @@ MACHINE_START(CM_A510, "Compulab CM-A510 Board")
93 .init_early = dove_init_early, 93 .init_early = dove_init_early,
94 .init_irq = dove_init_irq, 94 .init_irq = dove_init_irq,
95 .timer = &dove_timer, 95 .timer = &dove_timer,
96 .restart = dove_restart,
96MACHINE_END 97MACHINE_END
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index a9e0dae86a26..13bb236cd0cd 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -292,3 +292,19 @@ void __init dove_init(void)
292 dove_xor0_init(); 292 dove_xor0_init();
293 dove_xor1_init(); 293 dove_xor1_init();
294} 294}
295
296void dove_restart(char mode, const char *cmd)
297{
298 /*
299 * Enable soft reset to assert RSTOUTn.
300 */
301 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
302
303 /*
304 * Assert soft reset.
305 */
306 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
307
308 while (1)
309 ;
310}
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index 6a2046e44706..42027305c107 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -39,5 +39,6 @@ void dove_spi1_init(void);
39void dove_i2c_init(void); 39void dove_i2c_init(void);
40void dove_sdio0_init(void); 40void dove_sdio0_init(void);
41void dove_sdio1_init(void); 41void dove_sdio1_init(void);
42void dove_restart(char, const char *);
42 43
43#endif 44#endif
diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c
index 11ea34e4fc76..ea77ae430b2d 100644
--- a/arch/arm/mach-dove/dove-db-setup.c
+++ b/arch/arm/mach-dove/dove-db-setup.c
@@ -100,4 +100,5 @@ MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
100 .init_early = dove_init_early, 100 .init_early = dove_init_early,
101 .init_irq = dove_init_irq, 101 .init_irq = dove_init_irq,
102 .timer = &dove_timer, 102 .timer = &dove_timer,
103 .restart = dove_restart,
103MACHINE_END 104MACHINE_END
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
index b20ec9af7882..ad1165d488c1 100644
--- a/arch/arm/mach-dove/include/mach/dove.h
+++ b/arch/arm/mach-dove/include/mach/dove.h
@@ -11,8 +11,6 @@
11#ifndef __ASM_ARCH_DOVE_H 11#ifndef __ASM_ARCH_DOVE_H
12#define __ASM_ARCH_DOVE_H 12#define __ASM_ARCH_DOVE_H
13 13
14#include <mach/vmalloc.h>
15
16/* 14/*
17 * Marvell Dove address maps. 15 * Marvell Dove address maps.
18 * 16 *
diff --git a/arch/arm/mach-dove/include/mach/system.h b/arch/arm/mach-dove/include/mach/system.h
index 356afda56853..3027954f6162 100644
--- a/arch/arm/mach-dove/include/mach/system.h
+++ b/arch/arm/mach-dove/include/mach/system.h
@@ -9,28 +9,9 @@
9#ifndef __ASM_ARCH_SYSTEM_H 9#ifndef __ASM_ARCH_SYSTEM_H
10#define __ASM_ARCH_SYSTEM_H 10#define __ASM_ARCH_SYSTEM_H
11 11
12#include <mach/bridge-regs.h>
13
14static inline void arch_idle(void) 12static inline void arch_idle(void)
15{ 13{
16 cpu_do_idle(); 14 cpu_do_idle();
17} 15}
18 16
19static inline void arch_reset(char mode, const char *cmd)
20{
21 /*
22 * Enable soft reset to assert RSTOUTn.
23 */
24 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
25
26 /*
27 * Assert soft reset.
28 */
29 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
30
31 while (1)
32 ;
33}
34
35
36#endif 17#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
index a28792cf761e..000000000000
--- a/arch/arm/mach-dove/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-dove/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfd800000UL
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index d0ce8abdd4b6..294aad07f7a0 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -278,13 +278,19 @@ static int __init ebsa110_init(void)
278 278
279arch_initcall(ebsa110_init); 279arch_initcall(ebsa110_init);
280 280
281static void ebsa110_restart(char mode, const char *cmd)
282{
283 soft_restart(0x80000000);
284}
285
281MACHINE_START(EBSA110, "EBSA110") 286MACHINE_START(EBSA110, "EBSA110")
282 /* Maintainer: Russell King */ 287 /* Maintainer: Russell King */
283 .atag_offset = 0x400, 288 .atag_offset = 0x400,
284 .reserve_lp0 = 1, 289 .reserve_lp0 = 1,
285 .reserve_lp2 = 1, 290 .reserve_lp2 = 1,
286 .soft_reboot = 1, 291 .restart_mode = 's',
287 .map_io = ebsa110_map_io, 292 .map_io = ebsa110_map_io,
288 .init_irq = ebsa110_init_irq, 293 .init_irq = ebsa110_init_irq,
289 .timer = &ebsa110_timer, 294 .timer = &ebsa110_timer,
295 .restart = ebsa110_restart,
290MACHINE_END 296MACHINE_END
diff --git a/arch/arm/mach-ebsa110/include/mach/system.h b/arch/arm/mach-ebsa110/include/mach/system.h
index 9a26245bf1fc..2e4af65edb6f 100644
--- a/arch/arm/mach-ebsa110/include/mach/system.h
+++ b/arch/arm/mach-ebsa110/include/mach/system.h
@@ -34,6 +34,4 @@ static inline void arch_idle(void)
34 asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc"); 34 asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
35} 35}
36 36
37#define arch_reset(mode, cmd) cpu_reset(0x80000000)
38
39#endif 37#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
index ea141b7a3e03..000000000000
--- a/arch/arm/mach-ebsa110/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * arch/arm/mach-ebsa110/include/mach/vmalloc.h
3 *
4 * Copyright (C) 1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#define VMALLOC_END 0xdf000000UL
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c
index 0713448206a5..681e939407d4 100644
--- a/arch/arm/mach-ep93xx/adssphere.c
+++ b/arch/arm/mach-ep93xx/adssphere.c
@@ -16,6 +16,7 @@
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18 18
19#include <asm/hardware/vic.h>
19#include <asm/mach-types.h> 20#include <asm/mach-types.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
21 22
@@ -36,6 +37,8 @@ MACHINE_START(ADSSPHERE, "ADS Sphere board")
36 .atag_offset = 0x100, 37 .atag_offset = 0x100,
37 .map_io = ep93xx_map_io, 38 .map_io = ep93xx_map_io,
38 .init_irq = ep93xx_init_irq, 39 .init_irq = ep93xx_init_irq,
40 .handle_irq = vic_handle_irq,
39 .timer = &ep93xx_timer, 41 .timer = &ep93xx_timer,
40 .init_machine = adssphere_init_machine, 42 .init_machine = adssphere_init_machine,
43 .restart = ep93xx_restart,
41MACHINE_END 44MACHINE_END
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 2432a6b7dcac..24203f9a6796 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -906,3 +906,15 @@ void __init ep93xx_init_devices(void)
906 platform_device_register(&ep93xx_ohci_device); 906 platform_device_register(&ep93xx_ohci_device);
907 platform_device_register(&ep93xx_leds); 907 platform_device_register(&ep93xx_leds);
908} 908}
909
910void ep93xx_restart(char mode, const char *cmd)
911{
912 /*
913 * Set then clear the SWRST bit to initiate a software reset
914 */
915 ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_SWRST);
916 ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_SWRST);
917
918 while (1)
919 ;
920}
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 70ef8c527d27..d115653edca3 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -39,6 +39,7 @@
39#include <mach/ep93xx_spi.h> 39#include <mach/ep93xx_spi.h>
40#include <mach/gpio-ep93xx.h> 40#include <mach/gpio-ep93xx.h>
41 41
42#include <asm/hardware/vic.h>
42#include <asm/mach-types.h> 43#include <asm/mach-types.h>
43#include <asm/mach/arch.h> 44#include <asm/mach/arch.h>
44 45
@@ -250,8 +251,10 @@ MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
250 .atag_offset = 0x100, 251 .atag_offset = 0x100,
251 .map_io = ep93xx_map_io, 252 .map_io = ep93xx_map_io,
252 .init_irq = ep93xx_init_irq, 253 .init_irq = ep93xx_init_irq,
254 .handle_irq = vic_handle_irq,
253 .timer = &ep93xx_timer, 255 .timer = &ep93xx_timer,
254 .init_machine = edb93xx_init_machine, 256 .init_machine = edb93xx_init_machine,
257 .restart = ep93xx_restart,
255MACHINE_END 258MACHINE_END
256#endif 259#endif
257 260
@@ -261,8 +264,10 @@ MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
261 .atag_offset = 0x100, 264 .atag_offset = 0x100,
262 .map_io = ep93xx_map_io, 265 .map_io = ep93xx_map_io,
263 .init_irq = ep93xx_init_irq, 266 .init_irq = ep93xx_init_irq,
267 .handle_irq = vic_handle_irq,
264 .timer = &ep93xx_timer, 268 .timer = &ep93xx_timer,
265 .init_machine = edb93xx_init_machine, 269 .init_machine = edb93xx_init_machine,
270 .restart = ep93xx_restart,
266MACHINE_END 271MACHINE_END
267#endif 272#endif
268 273
@@ -272,8 +277,10 @@ MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
272 .atag_offset = 0x100, 277 .atag_offset = 0x100,
273 .map_io = ep93xx_map_io, 278 .map_io = ep93xx_map_io,
274 .init_irq = ep93xx_init_irq, 279 .init_irq = ep93xx_init_irq,
280 .handle_irq = vic_handle_irq,
275 .timer = &ep93xx_timer, 281 .timer = &ep93xx_timer,
276 .init_machine = edb93xx_init_machine, 282 .init_machine = edb93xx_init_machine,
283 .restart = ep93xx_restart,
277MACHINE_END 284MACHINE_END
278#endif 285#endif
279 286
@@ -283,8 +290,10 @@ MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
283 .atag_offset = 0x100, 290 .atag_offset = 0x100,
284 .map_io = ep93xx_map_io, 291 .map_io = ep93xx_map_io,
285 .init_irq = ep93xx_init_irq, 292 .init_irq = ep93xx_init_irq,
293 .handle_irq = vic_handle_irq,
286 .timer = &ep93xx_timer, 294 .timer = &ep93xx_timer,
287 .init_machine = edb93xx_init_machine, 295 .init_machine = edb93xx_init_machine,
296 .restart = ep93xx_restart,
288MACHINE_END 297MACHINE_END
289#endif 298#endif
290 299
@@ -294,8 +303,10 @@ MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
294 .atag_offset = 0x100, 303 .atag_offset = 0x100,
295 .map_io = ep93xx_map_io, 304 .map_io = ep93xx_map_io,
296 .init_irq = ep93xx_init_irq, 305 .init_irq = ep93xx_init_irq,
306 .handle_irq = vic_handle_irq,
297 .timer = &ep93xx_timer, 307 .timer = &ep93xx_timer,
298 .init_machine = edb93xx_init_machine, 308 .init_machine = edb93xx_init_machine,
309 .restart = ep93xx_restart,
299MACHINE_END 310MACHINE_END
300#endif 311#endif
301 312
@@ -305,8 +316,10 @@ MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
305 .atag_offset = 0x100, 316 .atag_offset = 0x100,
306 .map_io = ep93xx_map_io, 317 .map_io = ep93xx_map_io,
307 .init_irq = ep93xx_init_irq, 318 .init_irq = ep93xx_init_irq,
319 .handle_irq = vic_handle_irq,
308 .timer = &ep93xx_timer, 320 .timer = &ep93xx_timer,
309 .init_machine = edb93xx_init_machine, 321 .init_machine = edb93xx_init_machine,
322 .restart = ep93xx_restart,
310MACHINE_END 323MACHINE_END
311#endif 324#endif
312 325
@@ -316,8 +329,10 @@ MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
316 .atag_offset = 0x100, 329 .atag_offset = 0x100,
317 .map_io = ep93xx_map_io, 330 .map_io = ep93xx_map_io,
318 .init_irq = ep93xx_init_irq, 331 .init_irq = ep93xx_init_irq,
332 .handle_irq = vic_handle_irq,
319 .timer = &ep93xx_timer, 333 .timer = &ep93xx_timer,
320 .init_machine = edb93xx_init_machine, 334 .init_machine = edb93xx_init_machine,
335 .restart = ep93xx_restart,
321MACHINE_END 336MACHINE_END
322#endif 337#endif
323 338
@@ -327,7 +342,9 @@ MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
327 .atag_offset = 0x100, 342 .atag_offset = 0x100,
328 .map_io = ep93xx_map_io, 343 .map_io = ep93xx_map_io,
329 .init_irq = ep93xx_init_irq, 344 .init_irq = ep93xx_init_irq,
345 .handle_irq = vic_handle_irq,
330 .timer = &ep93xx_timer, 346 .timer = &ep93xx_timer,
331 .init_machine = edb93xx_init_machine, 347 .init_machine = edb93xx_init_machine,
348 .restart = ep93xx_restart,
332MACHINE_END 349MACHINE_END
333#endif 350#endif
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c
index 45ee205856f8..af46970dc58e 100644
--- a/arch/arm/mach-ep93xx/gesbc9312.c
+++ b/arch/arm/mach-ep93xx/gesbc9312.c
@@ -16,6 +16,7 @@
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18 18
19#include <asm/hardware/vic.h>
19#include <asm/mach-types.h> 20#include <asm/mach-types.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
21 22
@@ -36,6 +37,8 @@ MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
36 .atag_offset = 0x100, 37 .atag_offset = 0x100,
37 .map_io = ep93xx_map_io, 38 .map_io = ep93xx_map_io,
38 .init_irq = ep93xx_init_irq, 39 .init_irq = ep93xx_init_irq,
40 .handle_irq = vic_handle_irq,
39 .timer = &ep93xx_timer, 41 .timer = &ep93xx_timer,
40 .init_machine = gesbc9312_init_machine, 42 .init_machine = gesbc9312_init_machine,
43 .restart = ep93xx_restart,
41MACHINE_END 44MACHINE_END
diff --git a/arch/arm/mach-ep93xx/include/mach/entry-macro.S b/arch/arm/mach-ep93xx/include/mach/entry-macro.S
index 96b85e2c2c0b..9be6edcf9045 100644
--- a/arch/arm/mach-ep93xx/include/mach/entry-macro.S
+++ b/arch/arm/mach-ep93xx/include/mach/entry-macro.S
@@ -9,51 +9,9 @@
9 * the Free Software Foundation; either version 2 of the License, or (at 9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version. 10 * your option) any later version.
11 */ 11 */
12#include <mach/ep93xx-regs.h>
13 12
14 .macro disable_fiq 13 .macro disable_fiq
15 .endm 14 .endm
16 15
17 .macro get_irqnr_preamble, base, tmp
18 .endm
19
20 .macro arch_ret_to_user, tmp1, tmp2 16 .macro arch_ret_to_user, tmp1, tmp2
21 .endm 17 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 ldr \base, =(EP93XX_AHB_VIRT_BASE)
25 orr \base, \base, #0x000b0000
26 mov \irqnr, #0
27 ldr \irqstat, [\base] @ lower 32 interrupts
28 cmp \irqstat, #0
29 bne 1001f
30
31 eor \base, \base, #0x00070000
32 ldr \irqstat, [\base] @ upper 32 interrupts
33 cmp \irqstat, #0
34 beq 1002f
35 mov \irqnr, #0x20
36
371001:
38 movs \tmp, \irqstat, lsl #16
39 movne \irqstat, \tmp
40 addeq \irqnr, \irqnr, #16
41
42 movs \tmp, \irqstat, lsl #8
43 movne \irqstat, \tmp
44 addeq \irqnr, \irqnr, #8
45
46 movs \tmp, \irqstat, lsl #4
47 movne \irqstat, \tmp
48 addeq \irqnr, \irqnr, #4
49
50 movs \tmp, \irqstat, lsl #2
51 movne \irqstat, \tmp
52 addeq \irqnr, \irqnr, #2
53
54 movs \tmp, \irqstat, lsl #1
55 addeq \irqnr, \irqnr, #1
56 orrs \base, \base, #1
57
581002:
59 .endm
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h
index 50660455b1d8..d4c934931f9d 100644
--- a/arch/arm/mach-ep93xx/include/mach/platform.h
+++ b/arch/arm/mach-ep93xx/include/mach/platform.h
@@ -66,4 +66,6 @@ void ep93xx_register_ac97(void);
66void ep93xx_init_devices(void); 66void ep93xx_init_devices(void);
67extern struct sys_timer ep93xx_timer; 67extern struct sys_timer ep93xx_timer;
68 68
69void ep93xx_restart(char, const char *);
70
69#endif 71#endif
diff --git a/arch/arm/mach-ep93xx/include/mach/system.h b/arch/arm/mach-ep93xx/include/mach/system.h
index 6d661fe9d66c..b5bec7cb9b52 100644
--- a/arch/arm/mach-ep93xx/include/mach/system.h
+++ b/arch/arm/mach-ep93xx/include/mach/system.h
@@ -1,24 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ep93xx/include/mach/system.h 2 * arch/arm/mach-ep93xx/include/mach/system.h
3 */ 3 */
4
5#include <mach/hardware.h>
6
7static inline void arch_idle(void) 4static inline void arch_idle(void)
8{ 5{
9 cpu_do_idle(); 6 cpu_do_idle();
10} 7}
11
12static inline void arch_reset(char mode, const char *cmd)
13{
14 local_irq_disable();
15
16 /*
17 * Set then clear the SWRST bit to initiate a software reset
18 */
19 ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_SWRST);
20 ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_SWRST);
21
22 while (1)
23 ;
24}
diff --git a/arch/arm/mach-ep93xx/include/mach/vmalloc.h b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
deleted file mode 100644
index 1b3f25d03d39..000000000000
--- a/arch/arm/mach-ep93xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe800000UL
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index e72f7368876e..7b98084f0c97 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -18,6 +18,7 @@
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20 20
21#include <asm/hardware/vic.h>
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23 24
@@ -80,8 +81,10 @@ MACHINE_START(MICRO9, "Contec Micro9-High")
80 .atag_offset = 0x100, 81 .atag_offset = 0x100,
81 .map_io = ep93xx_map_io, 82 .map_io = ep93xx_map_io,
82 .init_irq = ep93xx_init_irq, 83 .init_irq = ep93xx_init_irq,
84 .handle_irq = vic_handle_irq,
83 .timer = &ep93xx_timer, 85 .timer = &ep93xx_timer,
84 .init_machine = micro9_init_machine, 86 .init_machine = micro9_init_machine,
87 .restart = ep93xx_restart,
85MACHINE_END 88MACHINE_END
86#endif 89#endif
87 90
@@ -91,8 +94,10 @@ MACHINE_START(MICRO9M, "Contec Micro9-Mid")
91 .atag_offset = 0x100, 94 .atag_offset = 0x100,
92 .map_io = ep93xx_map_io, 95 .map_io = ep93xx_map_io,
93 .init_irq = ep93xx_init_irq, 96 .init_irq = ep93xx_init_irq,
97 .handle_irq = vic_handle_irq,
94 .timer = &ep93xx_timer, 98 .timer = &ep93xx_timer,
95 .init_machine = micro9_init_machine, 99 .init_machine = micro9_init_machine,
100 .restart = ep93xx_restart,
96MACHINE_END 101MACHINE_END
97#endif 102#endif
98 103
@@ -102,8 +107,10 @@ MACHINE_START(MICRO9L, "Contec Micro9-Lite")
102 .atag_offset = 0x100, 107 .atag_offset = 0x100,
103 .map_io = ep93xx_map_io, 108 .map_io = ep93xx_map_io,
104 .init_irq = ep93xx_init_irq, 109 .init_irq = ep93xx_init_irq,
110 .handle_irq = vic_handle_irq,
105 .timer = &ep93xx_timer, 111 .timer = &ep93xx_timer,
106 .init_machine = micro9_init_machine, 112 .init_machine = micro9_init_machine,
113 .restart = ep93xx_restart,
107MACHINE_END 114MACHINE_END
108#endif 115#endif
109 116
@@ -113,7 +120,9 @@ MACHINE_START(MICRO9S, "Contec Micro9-Slim")
113 .atag_offset = 0x100, 120 .atag_offset = 0x100,
114 .map_io = ep93xx_map_io, 121 .map_io = ep93xx_map_io,
115 .init_irq = ep93xx_init_irq, 122 .init_irq = ep93xx_init_irq,
123 .handle_irq = vic_handle_irq,
116 .timer = &ep93xx_timer, 124 .timer = &ep93xx_timer,
117 .init_machine = micro9_init_machine, 125 .init_machine = micro9_init_machine,
126 .restart = ep93xx_restart,
118MACHINE_END 127MACHINE_END
119#endif 128#endif
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index 52e090dc9d27..f4e553eca21c 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -25,6 +25,7 @@
25#include <mach/fb.h> 25#include <mach/fb.h>
26#include <mach/gpio-ep93xx.h> 26#include <mach/gpio-ep93xx.h>
27 27
28#include <asm/hardware/vic.h>
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30 31
@@ -80,6 +81,8 @@ MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
80 .atag_offset = 0x100, 81 .atag_offset = 0x100,
81 .map_io = ep93xx_map_io, 82 .map_io = ep93xx_map_io,
82 .init_irq = ep93xx_init_irq, 83 .init_irq = ep93xx_init_irq,
84 .handle_irq = vic_handle_irq,
83 .timer = &ep93xx_timer, 85 .timer = &ep93xx_timer,
84 .init_machine = simone_init_machine, 86 .init_machine = simone_init_machine,
87 .restart = ep93xx_restart,
85MACHINE_END 88MACHINE_END
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c
index 8121e3aedc0a..fd846331ddff 100644
--- a/arch/arm/mach-ep93xx/snappercl15.c
+++ b/arch/arm/mach-ep93xx/snappercl15.c
@@ -31,6 +31,7 @@
31#include <mach/fb.h> 31#include <mach/fb.h>
32#include <mach/gpio-ep93xx.h> 32#include <mach/gpio-ep93xx.h>
33 33
34#include <asm/hardware/vic.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
36 37
@@ -177,6 +178,8 @@ MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
177 .atag_offset = 0x100, 178 .atag_offset = 0x100,
178 .map_io = ep93xx_map_io, 179 .map_io = ep93xx_map_io,
179 .init_irq = ep93xx_init_irq, 180 .init_irq = ep93xx_init_irq,
181 .handle_irq = vic_handle_irq,
180 .timer = &ep93xx_timer, 182 .timer = &ep93xx_timer,
181 .init_machine = snappercl15_init_machine, 183 .init_machine = snappercl15_init_machine,
184 .restart = ep93xx_restart,
182MACHINE_END 185MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8b2f1435bcac..79f8ecf07a19 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -23,6 +23,7 @@
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/ts72xx.h> 24#include <mach/ts72xx.h>
25 25
26#include <asm/hardware/vic.h>
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
@@ -247,6 +248,8 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
247 .atag_offset = 0x100, 248 .atag_offset = 0x100,
248 .map_io = ts72xx_map_io, 249 .map_io = ts72xx_map_io,
249 .init_irq = ep93xx_init_irq, 250 .init_irq = ep93xx_init_irq,
251 .handle_irq = vic_handle_irq,
250 .timer = &ep93xx_timer, 252 .timer = &ep93xx_timer,
251 .init_machine = ts72xx_init_machine, 253 .init_machine = ts72xx_init_machine,
254 .restart = ep93xx_restart,
252MACHINE_END 255MACHINE_END
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index d96e4dbec6a8..03dd4012043e 100644
--- a/arch/arm/mach-ep93xx/vision_ep9307.c
+++ b/arch/arm/mach-ep93xx/vision_ep9307.c
@@ -361,4 +361,5 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
361 .init_irq = ep93xx_init_irq, 361 .init_irq = ep93xx_init_irq,
362 .timer = &ep93xx_timer, 362 .timer = &ep93xx_timer,
363 .init_machine = vision_init_machine, 363 .init_machine = vision_init_machine,
364 .restart = ep93xx_restart,
364MACHINE_END 365MACHINE_END
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 724ec0f3560d..e1efbca2a539 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -17,6 +17,8 @@ choice
17 17
18config ARCH_EXYNOS4 18config ARCH_EXYNOS4
19 bool "SAMSUNG EXYNOS4" 19 bool "SAMSUNG EXYNOS4"
20 select HAVE_SMP
21 select MIGHT_HAVE_CACHE_L2X0
20 help 22 help
21 Samsung EXYNOS4 SoCs based systems 23 Samsung EXYNOS4 SoCs based systems
22 24
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 59069a35e40b..bcb9efc576e9 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -10,15 +10,17 @@ obj-m :=
10obj-n := 10obj-n :=
11obj- := 11obj- :=
12 12
13# Core support for EXYNOS4 system 13# Core
14 14
15obj-$(CONFIG_ARCH_EXYNOS4) += cpu.o init.o clock.o irq-combiner.o setup-i2c0.o 15obj-$(CONFIG_ARCH_EXYNOS4) += common.o clock.o
16obj-$(CONFIG_ARCH_EXYNOS4) += irq-eint.o dma.o pmu.o
17obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o 16obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o
18obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o 17obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o
18
19obj-$(CONFIG_PM) += pm.o 19obj-$(CONFIG_PM) += pm.o
20obj-$(CONFIG_CPU_IDLE) += cpuidle.o 20obj-$(CONFIG_CPU_IDLE) += cpuidle.o
21 21
22obj-$(CONFIG_ARCH_EXYNOS4) += dma.o pmu.o
23
22obj-$(CONFIG_SMP) += platsmp.o headsmp.o 24obj-$(CONFIG_SMP) += platsmp.o headsmp.o
23 25
24obj-$(CONFIG_EXYNOS4_MCT) += mct.o 26obj-$(CONFIG_EXYNOS4_MCT) += mct.o
@@ -45,6 +47,7 @@ obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o
45obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o 47obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o
46obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o 48obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
47 49
50obj-$(CONFIG_ARCH_EXYNOS4) += setup-i2c0.o
48obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o 51obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
49obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o 52obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o
50obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o 53obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o
diff --git a/arch/arm/mach-exynos/clock-exynos4210.c b/arch/arm/mach-exynos/clock-exynos4210.c
index b9d5ef670eb4..a5823a7f249e 100644
--- a/arch/arm/mach-exynos/clock-exynos4210.c
+++ b/arch/arm/mach-exynos/clock-exynos4210.c
@@ -23,7 +23,6 @@
23#include <plat/pll.h> 23#include <plat/pll.h>
24#include <plat/s5p-clock.h> 24#include <plat/s5p-clock.h>
25#include <plat/clock-clksrc.h> 25#include <plat/clock-clksrc.h>
26#include <plat/exynos4.h>
27#include <plat/pm.h> 26#include <plat/pm.h>
28 27
29#include <mach/hardware.h> 28#include <mach/hardware.h>
@@ -31,6 +30,8 @@
31#include <mach/regs-clock.h> 30#include <mach/regs-clock.h>
32#include <mach/exynos4-clock.h> 31#include <mach/exynos4-clock.h>
33 32
33#include "common.h"
34
34static struct sleep_save exynos4210_clock_save[] = { 35static struct sleep_save exynos4210_clock_save[] = {
35 SAVE_ITEM(S5P_CLKSRC_IMAGE), 36 SAVE_ITEM(S5P_CLKSRC_IMAGE),
36 SAVE_ITEM(S5P_CLKSRC_LCD1), 37 SAVE_ITEM(S5P_CLKSRC_LCD1),
diff --git a/arch/arm/mach-exynos/clock-exynos4212.c b/arch/arm/mach-exynos/clock-exynos4212.c
index 77d5decb34fd..26a668b0d101 100644
--- a/arch/arm/mach-exynos/clock-exynos4212.c
+++ b/arch/arm/mach-exynos/clock-exynos4212.c
@@ -23,7 +23,6 @@
23#include <plat/pll.h> 23#include <plat/pll.h>
24#include <plat/s5p-clock.h> 24#include <plat/s5p-clock.h>
25#include <plat/clock-clksrc.h> 25#include <plat/clock-clksrc.h>
26#include <plat/exynos4.h>
27#include <plat/pm.h> 26#include <plat/pm.h>
28 27
29#include <mach/hardware.h> 28#include <mach/hardware.h>
@@ -31,6 +30,8 @@
31#include <mach/regs-clock.h> 30#include <mach/regs-clock.h>
32#include <mach/exynos4-clock.h> 31#include <mach/exynos4-clock.h>
33 32
33#include "common.h"
34
34static struct sleep_save exynos4212_clock_save[] = { 35static struct sleep_save exynos4212_clock_save[] = {
35 SAVE_ITEM(S5P_CLKSRC_IMAGE), 36 SAVE_ITEM(S5P_CLKSRC_IMAGE),
36 SAVE_ITEM(S5P_CLKDIV_IMAGE), 37 SAVE_ITEM(S5P_CLKDIV_IMAGE),
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 2894f0adef5c..83616a039b15 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -21,7 +21,6 @@
21#include <plat/pll.h> 21#include <plat/pll.h>
22#include <plat/s5p-clock.h> 22#include <plat/s5p-clock.h>
23#include <plat/clock-clksrc.h> 23#include <plat/clock-clksrc.h>
24#include <plat/exynos4.h>
25#include <plat/pm.h> 24#include <plat/pm.h>
26 25
27#include <mach/map.h> 26#include <mach/map.h>
@@ -29,6 +28,8 @@
29#include <mach/sysmmu.h> 28#include <mach/sysmmu.h>
30#include <mach/exynos4-clock.h> 29#include <mach/exynos4-clock.h>
31 30
31#include "common.h"
32
32static struct sleep_save exynos4_clock_save[] = { 33static struct sleep_save exynos4_clock_save[] = {
33 SAVE_ITEM(S5P_CLKDIV_LEFTBUS), 34 SAVE_ITEM(S5P_CLKDIV_LEFTBUS),
34 SAVE_ITEM(S5P_CLKGATE_IP_LEFTBUS), 35 SAVE_ITEM(S5P_CLKGATE_IP_LEFTBUS),
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
new file mode 100644
index 000000000000..b6ac6ee658c0
--- /dev/null
+++ b/arch/arm/mach-exynos/common.c
@@ -0,0 +1,714 @@
1/*
2 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Codes for EXYNOS
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/interrupt.h>
14#include <linux/irq.h>
15#include <linux/io.h>
16#include <linux/device.h>
17#include <linux/gpio.h>
18#include <linux/sched.h>
19#include <linux/serial_core.h>
20
21#include <asm/proc-fns.h>
22#include <asm/hardware/cache-l2x0.h>
23#include <asm/hardware/gic.h>
24#include <asm/mach/map.h>
25#include <asm/mach/irq.h>
26
27#include <mach/regs-irq.h>
28#include <mach/regs-pmu.h>
29#include <mach/regs-gpio.h>
30
31#include <plat/cpu.h>
32#include <plat/clock.h>
33#include <plat/devs.h>
34#include <plat/pm.h>
35#include <plat/sdhci.h>
36#include <plat/gpio-cfg.h>
37#include <plat/adc-core.h>
38#include <plat/fb-core.h>
39#include <plat/fimc-core.h>
40#include <plat/iic-core.h>
41#include <plat/tv-core.h>
42#include <plat/regs-serial.h>
43
44#include "common.h"
45
46unsigned int gic_bank_offset __read_mostly;
47
48static const char name_exynos4210[] = "EXYNOS4210";
49static const char name_exynos4212[] = "EXYNOS4212";
50static const char name_exynos4412[] = "EXYNOS4412";
51
52static struct cpu_table cpu_ids[] __initdata = {
53 {
54 .idcode = EXYNOS4210_CPU_ID,
55 .idmask = EXYNOS4_CPU_MASK,
56 .map_io = exynos4_map_io,
57 .init_clocks = exynos4_init_clocks,
58 .init_uarts = exynos4_init_uarts,
59 .init = exynos_init,
60 .name = name_exynos4210,
61 }, {
62 .idcode = EXYNOS4212_CPU_ID,
63 .idmask = EXYNOS4_CPU_MASK,
64 .map_io = exynos4_map_io,
65 .init_clocks = exynos4_init_clocks,
66 .init_uarts = exynos4_init_uarts,
67 .init = exynos_init,
68 .name = name_exynos4212,
69 }, {
70 .idcode = EXYNOS4412_CPU_ID,
71 .idmask = EXYNOS4_CPU_MASK,
72 .map_io = exynos4_map_io,
73 .init_clocks = exynos4_init_clocks,
74 .init_uarts = exynos4_init_uarts,
75 .init = exynos_init,
76 .name = name_exynos4412,
77 },
78};
79
80/* Initial IO mappings */
81
82static struct map_desc exynos_iodesc[] __initdata = {
83 {
84 .virtual = (unsigned long)S5P_VA_CHIPID,
85 .pfn = __phys_to_pfn(EXYNOS4_PA_CHIPID),
86 .length = SZ_4K,
87 .type = MT_DEVICE,
88 }, {
89 .virtual = (unsigned long)S3C_VA_SYS,
90 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSCON),
91 .length = SZ_64K,
92 .type = MT_DEVICE,
93 }, {
94 .virtual = (unsigned long)S3C_VA_TIMER,
95 .pfn = __phys_to_pfn(EXYNOS4_PA_TIMER),
96 .length = SZ_16K,
97 .type = MT_DEVICE,
98 }, {
99 .virtual = (unsigned long)S3C_VA_WATCHDOG,
100 .pfn = __phys_to_pfn(EXYNOS4_PA_WATCHDOG),
101 .length = SZ_4K,
102 .type = MT_DEVICE,
103 }, {
104 .virtual = (unsigned long)S5P_VA_SROMC,
105 .pfn = __phys_to_pfn(EXYNOS4_PA_SROMC),
106 .length = SZ_4K,
107 .type = MT_DEVICE,
108 }, {
109 .virtual = (unsigned long)S5P_VA_SYSTIMER,
110 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSTIMER),
111 .length = SZ_4K,
112 .type = MT_DEVICE,
113 }, {
114 .virtual = (unsigned long)S5P_VA_PMU,
115 .pfn = __phys_to_pfn(EXYNOS4_PA_PMU),
116 .length = SZ_64K,
117 .type = MT_DEVICE,
118 }, {
119 .virtual = (unsigned long)S5P_VA_COMBINER_BASE,
120 .pfn = __phys_to_pfn(EXYNOS4_PA_COMBINER),
121 .length = SZ_4K,
122 .type = MT_DEVICE,
123 }, {
124 .virtual = (unsigned long)S5P_VA_GIC_CPU,
125 .pfn = __phys_to_pfn(EXYNOS4_PA_GIC_CPU),
126 .length = SZ_64K,
127 .type = MT_DEVICE,
128 }, {
129 .virtual = (unsigned long)S5P_VA_GIC_DIST,
130 .pfn = __phys_to_pfn(EXYNOS4_PA_GIC_DIST),
131 .length = SZ_64K,
132 .type = MT_DEVICE,
133 }, {
134 .virtual = (unsigned long)S3C_VA_UART,
135 .pfn = __phys_to_pfn(EXYNOS4_PA_UART),
136 .length = SZ_512K,
137 .type = MT_DEVICE,
138 },
139};
140
141static struct map_desc exynos4_iodesc[] __initdata = {
142 {
143 .virtual = (unsigned long)S5P_VA_CMU,
144 .pfn = __phys_to_pfn(EXYNOS4_PA_CMU),
145 .length = SZ_128K,
146 .type = MT_DEVICE,
147 }, {
148 .virtual = (unsigned long)S5P_VA_COREPERI_BASE,
149 .pfn = __phys_to_pfn(EXYNOS4_PA_COREPERI),
150 .length = SZ_8K,
151 .type = MT_DEVICE,
152 }, {
153 .virtual = (unsigned long)S5P_VA_L2CC,
154 .pfn = __phys_to_pfn(EXYNOS4_PA_L2CC),
155 .length = SZ_4K,
156 .type = MT_DEVICE,
157 }, {
158 .virtual = (unsigned long)S5P_VA_GPIO1,
159 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO1),
160 .length = SZ_4K,
161 .type = MT_DEVICE,
162 }, {
163 .virtual = (unsigned long)S5P_VA_GPIO2,
164 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO2),
165 .length = SZ_4K,
166 .type = MT_DEVICE,
167 }, {
168 .virtual = (unsigned long)S5P_VA_GPIO3,
169 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO3),
170 .length = SZ_256,
171 .type = MT_DEVICE,
172 }, {
173 .virtual = (unsigned long)S5P_VA_DMC0,
174 .pfn = __phys_to_pfn(EXYNOS4_PA_DMC0),
175 .length = SZ_4K,
176 .type = MT_DEVICE,
177 }, {
178 .virtual = (unsigned long)S3C_VA_USB_HSPHY,
179 .pfn = __phys_to_pfn(EXYNOS4_PA_HSPHY),
180 .length = SZ_4K,
181 .type = MT_DEVICE,
182 },
183};
184
185static struct map_desc exynos4_iodesc0[] __initdata = {
186 {
187 .virtual = (unsigned long)S5P_VA_SYSRAM,
188 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM0),
189 .length = SZ_4K,
190 .type = MT_DEVICE,
191 },
192};
193
194static struct map_desc exynos4_iodesc1[] __initdata = {
195 {
196 .virtual = (unsigned long)S5P_VA_SYSRAM,
197 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM1),
198 .length = SZ_4K,
199 .type = MT_DEVICE,
200 },
201};
202
203static void exynos_idle(void)
204{
205 if (!need_resched())
206 cpu_do_idle();
207
208 local_irq_enable();
209}
210
211void exynos4_restart(char mode, const char *cmd)
212{
213 __raw_writel(0x1, S5P_SWRESET);
214}
215
216/*
217 * exynos_map_io
218 *
219 * register the standard cpu IO areas
220 */
221
222void __init exynos_init_io(struct map_desc *mach_desc, int size)
223{
224 /* initialize the io descriptors we need for initialization */
225 iotable_init(exynos_iodesc, ARRAY_SIZE(exynos_iodesc));
226 if (mach_desc)
227 iotable_init(mach_desc, size);
228
229 /* detect cpu id and rev. */
230 s5p_init_cpu(S5P_VA_CHIPID);
231
232 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
233}
234
235void __init exynos4_map_io(void)
236{
237 iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
238
239 if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_0)
240 iotable_init(exynos4_iodesc0, ARRAY_SIZE(exynos4_iodesc0));
241 else
242 iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
243
244 /* initialize device information early */
245 exynos4_default_sdhci0();
246 exynos4_default_sdhci1();
247 exynos4_default_sdhci2();
248 exynos4_default_sdhci3();
249
250 s3c_adc_setname("samsung-adc-v3");
251
252 s3c_fimc_setname(0, "exynos4-fimc");
253 s3c_fimc_setname(1, "exynos4-fimc");
254 s3c_fimc_setname(2, "exynos4-fimc");
255 s3c_fimc_setname(3, "exynos4-fimc");
256
257 /* The I2C bus controllers are directly compatible with s3c2440 */
258 s3c_i2c0_setname("s3c2440-i2c");
259 s3c_i2c1_setname("s3c2440-i2c");
260 s3c_i2c2_setname("s3c2440-i2c");
261
262 s5p_fb_setname(0, "exynos4-fb");
263 s5p_hdmi_setname("exynos4-hdmi");
264}
265
266void __init exynos4_init_clocks(int xtal)
267{
268 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
269
270 s3c24xx_register_baseclocks(xtal);
271 s5p_register_clocks(xtal);
272
273 if (soc_is_exynos4210())
274 exynos4210_register_clocks();
275 else if (soc_is_exynos4212() || soc_is_exynos4412())
276 exynos4212_register_clocks();
277
278 exynos4_register_clocks();
279 exynos4_setup_clocks();
280}
281
282#define COMBINER_ENABLE_SET 0x0
283#define COMBINER_ENABLE_CLEAR 0x4
284#define COMBINER_INT_STATUS 0xC
285
286static DEFINE_SPINLOCK(irq_controller_lock);
287
288struct combiner_chip_data {
289 unsigned int irq_offset;
290 unsigned int irq_mask;
291 void __iomem *base;
292};
293
294static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
295
296static inline void __iomem *combiner_base(struct irq_data *data)
297{
298 struct combiner_chip_data *combiner_data =
299 irq_data_get_irq_chip_data(data);
300
301 return combiner_data->base;
302}
303
304static void combiner_mask_irq(struct irq_data *data)
305{
306 u32 mask = 1 << (data->irq % 32);
307
308 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR);
309}
310
311static void combiner_unmask_irq(struct irq_data *data)
312{
313 u32 mask = 1 << (data->irq % 32);
314
315 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
316}
317
318static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
319{
320 struct combiner_chip_data *chip_data = irq_get_handler_data(irq);
321 struct irq_chip *chip = irq_get_chip(irq);
322 unsigned int cascade_irq, combiner_irq;
323 unsigned long status;
324
325 chained_irq_enter(chip, desc);
326
327 spin_lock(&irq_controller_lock);
328 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS);
329 spin_unlock(&irq_controller_lock);
330 status &= chip_data->irq_mask;
331
332 if (status == 0)
333 goto out;
334
335 combiner_irq = __ffs(status);
336
337 cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
338 if (unlikely(cascade_irq >= NR_IRQS))
339 do_bad_IRQ(cascade_irq, desc);
340 else
341 generic_handle_irq(cascade_irq);
342
343 out:
344 chained_irq_exit(chip, desc);
345}
346
347static struct irq_chip combiner_chip = {
348 .name = "COMBINER",
349 .irq_mask = combiner_mask_irq,
350 .irq_unmask = combiner_unmask_irq,
351};
352
353static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq)
354{
355 if (combiner_nr >= MAX_COMBINER_NR)
356 BUG();
357 if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
358 BUG();
359 irq_set_chained_handler(irq, combiner_handle_cascade_irq);
360}
361
362static void __init combiner_init(unsigned int combiner_nr, void __iomem *base,
363 unsigned int irq_start)
364{
365 unsigned int i;
366
367 if (combiner_nr >= MAX_COMBINER_NR)
368 BUG();
369
370 combiner_data[combiner_nr].base = base;
371 combiner_data[combiner_nr].irq_offset = irq_start;
372 combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
373
374 /* Disable all interrupts */
375
376 __raw_writel(combiner_data[combiner_nr].irq_mask,
377 base + COMBINER_ENABLE_CLEAR);
378
379 /* Setup the Linux IRQ subsystem */
380
381 for (i = irq_start; i < combiner_data[combiner_nr].irq_offset
382 + MAX_IRQ_IN_COMBINER; i++) {
383 irq_set_chip_and_handler(i, &combiner_chip, handle_level_irq);
384 irq_set_chip_data(i, &combiner_data[combiner_nr]);
385 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
386 }
387}
388
389static void exynos4_gic_irq_fix_base(struct irq_data *d)
390{
391 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
392
393 gic_data->cpu_base = S5P_VA_GIC_CPU +
394 (gic_bank_offset * smp_processor_id());
395
396 gic_data->dist_base = S5P_VA_GIC_DIST +
397 (gic_bank_offset * smp_processor_id());
398}
399
400void __init exynos4_init_irq(void)
401{
402 int irq;
403
404 gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
405
406 gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU);
407 gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base;
408 gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base;
409 gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base;
410
411 for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
412
413 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
414 COMBINER_IRQ(irq, 0));
415 combiner_cascade_irq(irq, IRQ_SPI(irq));
416 }
417
418 /*
419 * The parameters of s5p_init_irq() are for VIC init.
420 * Theses parameters should be NULL and 0 because EXYNOS4
421 * uses GIC instead of VIC.
422 */
423 s5p_init_irq(NULL, 0);
424}
425
426struct bus_type exynos4_subsys = {
427 .name = "exynos4-core",
428 .dev_name = "exynos4-core",
429};
430
431static struct device exynos4_dev = {
432 .bus = &exynos4_subsys,
433};
434
435static int __init exynos4_core_init(void)
436{
437 return subsys_system_register(&exynos4_subsys, NULL);
438}
439core_initcall(exynos4_core_init);
440
441#ifdef CONFIG_CACHE_L2X0
442static int __init exynos4_l2x0_cache_init(void)
443{
444 /* TAG, Data Latency Control: 2cycle */
445 __raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
446
447 if (soc_is_exynos4210())
448 __raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
449 else if (soc_is_exynos4212() || soc_is_exynos4412())
450 __raw_writel(0x120, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
451
452 /* L2X0 Prefetch Control */
453 __raw_writel(0x30000007, S5P_VA_L2CC + L2X0_PREFETCH_CTRL);
454
455 /* L2X0 Power Control */
456 __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN,
457 S5P_VA_L2CC + L2X0_POWER_CTRL);
458
459 l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200ffff);
460
461 return 0;
462}
463
464early_initcall(exynos4_l2x0_cache_init);
465#endif
466
467int __init exynos_init(void)
468{
469 printk(KERN_INFO "EXYNOS: Initializing architecture\n");
470
471 /* set idle function */
472 pm_idle = exynos_idle;
473
474 return device_register(&exynos4_dev);
475}
476
477static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = {
478 [0] = {
479 .name = "uclk1",
480 .divisor = 1,
481 .min_baud = 0,
482 .max_baud = 0,
483 },
484};
485
486/* uart registration process */
487
488void __init exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no)
489{
490 struct s3c2410_uartcfg *tcfg = cfg;
491 u32 ucnt;
492
493 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
494 if (!tcfg->clocks) {
495 tcfg->has_fracval = 1;
496 tcfg->clocks = exynos4_serial_clocks;
497 tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
498 }
499 tcfg->flags |= NO_NEED_CHECK_CLKSRC;
500 }
501
502 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
503}
504
505static DEFINE_SPINLOCK(eint_lock);
506
507static unsigned int eint0_15_data[16];
508
509static unsigned int exynos4_get_irq_nr(unsigned int number)
510{
511 u32 ret = 0;
512
513 switch (number) {
514 case 0 ... 3:
515 ret = (number + IRQ_EINT0);
516 break;
517 case 4 ... 7:
518 ret = (number + (IRQ_EINT4 - 4));
519 break;
520 case 8 ... 15:
521 ret = (number + (IRQ_EINT8 - 8));
522 break;
523 default:
524 printk(KERN_ERR "number available : %d\n", number);
525 }
526
527 return ret;
528}
529
530static inline void exynos4_irq_eint_mask(struct irq_data *data)
531{
532 u32 mask;
533
534 spin_lock(&eint_lock);
535 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq)));
536 mask |= eint_irq_to_bit(data->irq);
537 __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq)));
538 spin_unlock(&eint_lock);
539}
540
541static void exynos4_irq_eint_unmask(struct irq_data *data)
542{
543 u32 mask;
544
545 spin_lock(&eint_lock);
546 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq)));
547 mask &= ~(eint_irq_to_bit(data->irq));
548 __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq)));
549 spin_unlock(&eint_lock);
550}
551
552static inline void exynos4_irq_eint_ack(struct irq_data *data)
553{
554 __raw_writel(eint_irq_to_bit(data->irq),
555 S5P_EINT_PEND(EINT_REG_NR(data->irq)));
556}
557
558static void exynos4_irq_eint_maskack(struct irq_data *data)
559{
560 exynos4_irq_eint_mask(data);
561 exynos4_irq_eint_ack(data);
562}
563
564static int exynos4_irq_eint_set_type(struct irq_data *data, unsigned int type)
565{
566 int offs = EINT_OFFSET(data->irq);
567 int shift;
568 u32 ctrl, mask;
569 u32 newvalue = 0;
570
571 switch (type) {
572 case IRQ_TYPE_EDGE_RISING:
573 newvalue = S5P_IRQ_TYPE_EDGE_RISING;
574 break;
575
576 case IRQ_TYPE_EDGE_FALLING:
577 newvalue = S5P_IRQ_TYPE_EDGE_FALLING;
578 break;
579
580 case IRQ_TYPE_EDGE_BOTH:
581 newvalue = S5P_IRQ_TYPE_EDGE_BOTH;
582 break;
583
584 case IRQ_TYPE_LEVEL_LOW:
585 newvalue = S5P_IRQ_TYPE_LEVEL_LOW;
586 break;
587
588 case IRQ_TYPE_LEVEL_HIGH:
589 newvalue = S5P_IRQ_TYPE_LEVEL_HIGH;
590 break;
591
592 default:
593 printk(KERN_ERR "No such irq type %d", type);
594 return -EINVAL;
595 }
596
597 shift = (offs & 0x7) * 4;
598 mask = 0x7 << shift;
599
600 spin_lock(&eint_lock);
601 ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq)));
602 ctrl &= ~mask;
603 ctrl |= newvalue << shift;
604 __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq)));
605 spin_unlock(&eint_lock);
606
607 switch (offs) {
608 case 0 ... 7:
609 s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE);
610 break;
611 case 8 ... 15:
612 s3c_gpio_cfgpin(EINT_GPIO_1(offs & 0x7), EINT_MODE);
613 break;
614 case 16 ... 23:
615 s3c_gpio_cfgpin(EINT_GPIO_2(offs & 0x7), EINT_MODE);
616 break;
617 case 24 ... 31:
618 s3c_gpio_cfgpin(EINT_GPIO_3(offs & 0x7), EINT_MODE);
619 break;
620 default:
621 printk(KERN_ERR "No such irq number %d", offs);
622 }
623
624 return 0;
625}
626
627static struct irq_chip exynos4_irq_eint = {
628 .name = "exynos4-eint",
629 .irq_mask = exynos4_irq_eint_mask,
630 .irq_unmask = exynos4_irq_eint_unmask,
631 .irq_mask_ack = exynos4_irq_eint_maskack,
632 .irq_ack = exynos4_irq_eint_ack,
633 .irq_set_type = exynos4_irq_eint_set_type,
634#ifdef CONFIG_PM
635 .irq_set_wake = s3c_irqext_wake,
636#endif
637};
638
639/*
640 * exynos4_irq_demux_eint
641 *
642 * This function demuxes the IRQ from from EINTs 16 to 31.
643 * It is designed to be inlined into the specific handler
644 * s5p_irq_demux_eintX_Y.
645 *
646 * Each EINT pend/mask registers handle eight of them.
647 */
648static inline void exynos4_irq_demux_eint(unsigned int start)
649{
650 unsigned int irq;
651
652 u32 status = __raw_readl(S5P_EINT_PEND(EINT_REG_NR(start)));
653 u32 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(start)));
654
655 status &= ~mask;
656 status &= 0xff;
657
658 while (status) {
659 irq = fls(status) - 1;
660 generic_handle_irq(irq + start);
661 status &= ~(1 << irq);
662 }
663}
664
665static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
666{
667 struct irq_chip *chip = irq_get_chip(irq);
668 chained_irq_enter(chip, desc);
669 exynos4_irq_demux_eint(IRQ_EINT(16));
670 exynos4_irq_demux_eint(IRQ_EINT(24));
671 chained_irq_exit(chip, desc);
672}
673
674static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
675{
676 u32 *irq_data = irq_get_handler_data(irq);
677 struct irq_chip *chip = irq_get_chip(irq);
678
679 chained_irq_enter(chip, desc);
680 chip->irq_mask(&desc->irq_data);
681
682 if (chip->irq_ack)
683 chip->irq_ack(&desc->irq_data);
684
685 generic_handle_irq(*irq_data);
686
687 chip->irq_unmask(&desc->irq_data);
688 chained_irq_exit(chip, desc);
689}
690
691int __init exynos4_init_irq_eint(void)
692{
693 int irq;
694
695 for (irq = 0 ; irq <= 31 ; irq++) {
696 irq_set_chip_and_handler(IRQ_EINT(irq), &exynos4_irq_eint,
697 handle_level_irq);
698 set_irq_flags(IRQ_EINT(irq), IRQF_VALID);
699 }
700
701 irq_set_chained_handler(IRQ_EINT16_31, exynos4_irq_demux_eint16_31);
702
703 for (irq = 0 ; irq <= 15 ; irq++) {
704 eint0_15_data[irq] = IRQ_EINT(irq);
705
706 irq_set_handler_data(exynos4_get_irq_nr(irq),
707 &eint0_15_data[irq]);
708 irq_set_chained_handler(exynos4_get_irq_nr(irq),
709 exynos4_irq_eint0_15);
710 }
711
712 return 0;
713}
714arch_initcall(exynos4_init_irq_eint);
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
new file mode 100644
index 000000000000..1ac49de0f398
--- /dev/null
+++ b/arch/arm/mach-exynos/common.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Header for EXYNOS machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
13#define __ARCH_ARM_MACH_EXYNOS_COMMON_H
14
15void exynos_init_io(struct map_desc *mach_desc, int size);
16void exynos4_init_irq(void);
17
18void exynos4_register_clocks(void);
19void exynos4_setup_clocks(void);
20
21void exynos4210_register_clocks(void);
22void exynos4212_register_clocks(void);
23
24void exynos4_restart(char mode, const char *cmd);
25
26extern struct sys_timer exynos4_timer;
27
28#ifdef CONFIG_ARCH_EXYNOS
29extern int exynos_init(void);
30extern void exynos4_map_io(void);
31extern void exynos4_init_clocks(int xtal);
32extern void exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no);
33
34#else
35#define exynos4_init_clocks NULL
36#define exynos4_init_uarts NULL
37#define exynos4_map_io NULL
38#define exynos_init NULL
39#endif
40
41#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/cpu.c b/arch/arm/mach-exynos/cpu.c
deleted file mode 100644
index 90ec247f3b37..000000000000
--- a/arch/arm/mach-exynos/cpu.c
+++ /dev/null
@@ -1,298 +0,0 @@
1/* linux/arch/arm/mach-exynos/cpu.c
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/sched.h>
12#include <linux/sysdev.h>
13
14#include <asm/mach/map.h>
15#include <asm/mach/irq.h>
16
17#include <asm/proc-fns.h>
18#include <asm/hardware/cache-l2x0.h>
19#include <asm/hardware/gic.h>
20
21#include <plat/cpu.h>
22#include <plat/clock.h>
23#include <plat/devs.h>
24#include <plat/exynos4.h>
25#include <plat/adc-core.h>
26#include <plat/sdhci.h>
27#include <plat/fb-core.h>
28#include <plat/fimc-core.h>
29#include <plat/iic-core.h>
30#include <plat/reset.h>
31#include <plat/tv-core.h>
32
33#include <mach/regs-irq.h>
34#include <mach/regs-pmu.h>
35
36unsigned int gic_bank_offset __read_mostly;
37
38extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
39 unsigned int irq_start);
40extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
41
42/* Initial IO mappings */
43static struct map_desc exynos_iodesc[] __initdata = {
44 {
45 .virtual = (unsigned long)S5P_VA_SYSTIMER,
46 .pfn = __phys_to_pfn(EXYNOS_PA_SYSTIMER),
47 .length = SZ_4K,
48 .type = MT_DEVICE,
49 }, {
50 .virtual = (unsigned long)S5P_VA_PMU,
51 .pfn = __phys_to_pfn(EXYNOS_PA_PMU),
52 .length = SZ_64K,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = (unsigned long)S5P_VA_COMBINER_BASE,
56 .pfn = __phys_to_pfn(EXYNOS_PA_COMBINER),
57 .length = SZ_4K,
58 .type = MT_DEVICE,
59 }, {
60 .virtual = (unsigned long)S5P_VA_GIC_CPU,
61 .pfn = __phys_to_pfn(EXYNOS_PA_GIC_CPU),
62 .length = SZ_64K,
63 .type = MT_DEVICE,
64 }, {
65 .virtual = (unsigned long)S5P_VA_GIC_DIST,
66 .pfn = __phys_to_pfn(EXYNOS_PA_GIC_DIST),
67 .length = SZ_64K,
68 .type = MT_DEVICE,
69 }, {
70 .virtual = (unsigned long)S3C_VA_UART,
71 .pfn = __phys_to_pfn(S3C_PA_UART),
72 .length = SZ_512K,
73 .type = MT_DEVICE,
74 },
75};
76
77static struct map_desc exynos4_iodesc[] __initdata = {
78 {
79 .virtual = (unsigned long)S5P_VA_CMU,
80 .pfn = __phys_to_pfn(EXYNOS4_PA_CMU),
81 .length = SZ_128K,
82 .type = MT_DEVICE,
83 }, {
84 .virtual = (unsigned long)S5P_VA_COREPERI_BASE,
85 .pfn = __phys_to_pfn(EXYNOS4_PA_COREPERI),
86 .length = SZ_8K,
87 .type = MT_DEVICE,
88 }, {
89 .virtual = (unsigned long)S5P_VA_L2CC,
90 .pfn = __phys_to_pfn(EXYNOS4_PA_L2CC),
91 .length = SZ_4K,
92 .type = MT_DEVICE,
93 }, {
94 .virtual = (unsigned long)S5P_VA_GPIO1,
95 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO1),
96 .length = SZ_4K,
97 .type = MT_DEVICE,
98 }, {
99 .virtual = (unsigned long)S5P_VA_GPIO2,
100 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO2),
101 .length = SZ_4K,
102 .type = MT_DEVICE,
103 }, {
104 .virtual = (unsigned long)S5P_VA_GPIO3,
105 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO3),
106 .length = SZ_256,
107 .type = MT_DEVICE,
108 }, {
109 .virtual = (unsigned long)S5P_VA_DMC0,
110 .pfn = __phys_to_pfn(EXYNOS4_PA_DMC0),
111 .length = SZ_4K,
112 .type = MT_DEVICE,
113 }, {
114 .virtual = (unsigned long)S5P_VA_SROMC,
115 .pfn = __phys_to_pfn(EXYNOS4_PA_SROMC),
116 .length = SZ_4K,
117 .type = MT_DEVICE,
118 }, {
119 .virtual = (unsigned long)S3C_VA_USB_HSPHY,
120 .pfn = __phys_to_pfn(EXYNOS4_PA_HSPHY),
121 .length = SZ_4K,
122 .type = MT_DEVICE,
123 },
124};
125
126static struct map_desc exynos4_iodesc0[] __initdata = {
127 {
128 .virtual = (unsigned long)S5P_VA_SYSRAM,
129 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM0),
130 .length = SZ_4K,
131 .type = MT_DEVICE,
132 },
133};
134
135static struct map_desc exynos4_iodesc1[] __initdata = {
136 {
137 .virtual = (unsigned long)S5P_VA_SYSRAM,
138 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM1),
139 .length = SZ_4K,
140 .type = MT_DEVICE,
141 },
142};
143
144static void exynos_idle(void)
145{
146 if (!need_resched())
147 cpu_do_idle();
148
149 local_irq_enable();
150}
151
152static void exynos4_sw_reset(void)
153{
154 __raw_writel(0x1, S5P_SWRESET);
155}
156
157/*
158 * exynos_map_io
159 *
160 * register the standard cpu IO areas
161 */
162void __init exynos4_map_io(void)
163{
164 iotable_init(exynos_iodesc, ARRAY_SIZE(exynos_iodesc));
165 iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
166
167 if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_0)
168 iotable_init(exynos4_iodesc0, ARRAY_SIZE(exynos4_iodesc0));
169 else
170 iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
171
172 /* initialize device information early */
173 exynos4_default_sdhci0();
174 exynos4_default_sdhci1();
175 exynos4_default_sdhci2();
176 exynos4_default_sdhci3();
177
178 s3c_adc_setname("samsung-adc-v3");
179
180 s3c_fimc_setname(0, "exynos4-fimc");
181 s3c_fimc_setname(1, "exynos4-fimc");
182 s3c_fimc_setname(2, "exynos4-fimc");
183 s3c_fimc_setname(3, "exynos4-fimc");
184
185 /* The I2C bus controllers are directly compatible with s3c2440 */
186 s3c_i2c0_setname("s3c2440-i2c");
187 s3c_i2c1_setname("s3c2440-i2c");
188 s3c_i2c2_setname("s3c2440-i2c");
189
190 s5p_fb_setname(0, "exynos4-fb");
191 s5p_hdmi_setname("exynos4-hdmi");
192}
193
194void __init exynos4_init_clocks(int xtal)
195{
196 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
197
198 s3c24xx_register_baseclocks(xtal);
199 s5p_register_clocks(xtal);
200
201 if (soc_is_exynos4210())
202 exynos4210_register_clocks();
203 else if (soc_is_exynos4212() || soc_is_exynos4412())
204 exynos4212_register_clocks();
205
206 exynos4_register_clocks();
207 exynos4_setup_clocks();
208}
209
210static void exynos4_gic_irq_fix_base(struct irq_data *d)
211{
212 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
213
214 gic_data->cpu_base = S5P_VA_GIC_CPU +
215 (gic_bank_offset * smp_processor_id());
216
217 gic_data->dist_base = S5P_VA_GIC_DIST +
218 (gic_bank_offset * smp_processor_id());
219}
220
221void __init exynos4_init_irq(void)
222{
223 int irq;
224
225 gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
226
227 gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU);
228 gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base;
229 gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base;
230 gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base;
231
232 for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
233
234 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
235 COMBINER_IRQ(irq, 0));
236 combiner_cascade_irq(irq, IRQ_SPI(irq));
237 }
238
239 /* The parameters of s5p_init_irq() are for VIC init.
240 * Theses parameters should be NULL and 0 because EXYNOS4
241 * uses GIC instead of VIC.
242 */
243 s5p_init_irq(NULL, 0);
244}
245
246struct sysdev_class exynos4_sysclass = {
247 .name = "exynos4-core",
248};
249
250static struct sys_device exynos4_sysdev = {
251 .cls = &exynos4_sysclass,
252};
253
254static int __init exynos4_core_init(void)
255{
256 return sysdev_class_register(&exynos4_sysclass);
257}
258core_initcall(exynos4_core_init);
259
260#ifdef CONFIG_CACHE_L2X0
261static int __init exynos4_l2x0_cache_init(void)
262{
263 /* TAG, Data Latency Control: 2cycle */
264 __raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
265
266 if (soc_is_exynos4210())
267 __raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
268 else if (soc_is_exynos4212() || soc_is_exynos4412())
269 __raw_writel(0x120, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
270
271 /* L2X0 Prefetch Control */
272 __raw_writel(0x30000007, S5P_VA_L2CC + L2X0_PREFETCH_CTRL);
273
274 /* L2X0 Power Control */
275 __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN,
276 S5P_VA_L2CC + L2X0_POWER_CTRL);
277
278 l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200ffff);
279
280 return 0;
281}
282
283early_initcall(exynos4_l2x0_cache_init);
284#endif
285
286int __init exynos_init(void)
287{
288 printk(KERN_INFO "EXYNOS: Initializing architecture\n");
289
290 /* set idle function */
291 pm_idle = exynos_idle;
292
293 /* set sw_reset function */
294 if (soc_is_exynos4210() || soc_is_exynos4212() || soc_is_exynos4412())
295 s5p_reset_hook = exynos4_sw_reset;
296
297 return sysdev_register(&exynos4_sysdev);
298}
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 35f6502144ae..4ebb382c5979 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -12,6 +12,8 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/cpuidle.h> 13#include <linux/cpuidle.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/export.h>
16#include <linux/time.h>
15 17
16#include <asm/proc-fns.h> 18#include <asm/proc-fns.h>
17 19
diff --git a/arch/arm/mach-exynos/include/mach/entry-macro.S b/arch/arm/mach-exynos/include/mach/entry-macro.S
index f5e9fd8e37b4..3ba4f547534b 100644
--- a/arch/arm/mach-exynos/include/mach/entry-macro.S
+++ b/arch/arm/mach-exynos/include/mach/entry-macro.S
@@ -9,83 +9,8 @@
9 * warranty of any kind, whether express or implied. 9 * warranty of any kind, whether express or implied.
10*/ 10*/
11 11
12#include <mach/hardware.h>
13#include <mach/map.h>
14#include <asm/hardware/gic.h>
15
16 .macro disable_fiq 12 .macro disable_fiq
17 .endm 13 .endm
18 14
19 .macro get_irqnr_preamble, base, tmp
20 mov \tmp, #0
21
22 mrc p15, 0, \base, c0, c0, 5
23 and \base, \base, #3
24 cmp \base, #0
25 beq 1f
26
27 ldr \tmp, =gic_bank_offset
28 ldr \tmp, [\tmp]
29 cmp \base, #1
30 beq 1f
31
32 cmp \base, #2
33 addeq \tmp, \tmp, \tmp
34 addne \tmp, \tmp, \tmp, LSL #1
35
361: ldr \base, =gic_cpu_base_addr
37 ldr \base, [\base]
38 add \base, \base, \tmp
39 .endm
40
41 .macro arch_ret_to_user, tmp1, tmp2 15 .macro arch_ret_to_user, tmp1, tmp2
42 .endm 16 .endm
43
44 /*
45 * The interrupt numbering scheme is defined in the
46 * interrupt controller spec. To wit:
47 *
48 * Interrupts 0-15 are IPI
49 * 16-28 are reserved
50 * 29-31 are local. We allow 30 to be used for the watchdog.
51 * 32-1020 are global
52 * 1021-1022 are reserved
53 * 1023 is "spurious" (no interrupt)
54 *
55 * For now, we ignore all local interrupts so only return an interrupt if it's
56 * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs.
57 *
58 * A simple read from the controller will tell us the number of the highest
59 * priority enabled interrupt. We then just need to check whether it is in the
60 * valid range for an IRQ (30-1020 inclusive).
61 */
62
63 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
64
65 ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */
66
67 ldr \tmp, =1021
68
69 bic \irqnr, \irqstat, #0x1c00
70
71 cmp \irqnr, #15
72 cmpcc \irqnr, \irqnr
73 cmpne \irqnr, \tmp
74 cmpcs \irqnr, \irqnr
75 addne \irqnr, \irqnr, #32
76
77 .endm
78
79 /* We assume that irqstat (the raw value of the IRQ acknowledge
80 * register) is preserved from the macro above.
81 * If there is an IPI, we immediately signal end of interrupt on the
82 * controller, since this requires the original irqstat value which
83 * we won't easily be able to recreate later.
84 */
85
86 .macro test_for_ipi, irqnr, irqstat, base, tmp
87 bic \irqnr, \irqstat, #0x1c00
88 cmp \irqnr, #16
89 strcc \irqstat, [\base, #GIC_CPU_EOI]
90 cmpcs \irqnr, \irqnr
91 .endm
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 058541d45af0..d1829860a0ec 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -149,7 +149,6 @@
149#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG 149#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG
150#define S3C_PA_UART EXYNOS4_PA_UART 150#define S3C_PA_UART EXYNOS4_PA_UART
151 151
152#define S5P_PA_CHIPID EXYNOS4_PA_CHIPID
153#define S5P_PA_EHCI EXYNOS4_PA_EHCI 152#define S5P_PA_EHCI EXYNOS4_PA_EHCI
154#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0 153#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0
155#define S5P_PA_FIMC1 EXYNOS4_PA_FIMC1 154#define S5P_PA_FIMC1 EXYNOS4_PA_FIMC1
@@ -166,26 +165,17 @@
166#define S5P_PA_ONENAND_DMA EXYNOS4_PA_ONENAND_DMA 165#define S5P_PA_ONENAND_DMA EXYNOS4_PA_ONENAND_DMA
167#define S5P_PA_SDO EXYNOS4_PA_SDO 166#define S5P_PA_SDO EXYNOS4_PA_SDO
168#define S5P_PA_SDRAM EXYNOS4_PA_SDRAM 167#define S5P_PA_SDRAM EXYNOS4_PA_SDRAM
169#define S5P_PA_SROMC EXYNOS4_PA_SROMC
170#define S5P_PA_SYSCON EXYNOS4_PA_SYSCON
171#define S5P_PA_TIMER EXYNOS4_PA_TIMER
172#define S5P_PA_VP EXYNOS4_PA_VP 168#define S5P_PA_VP EXYNOS4_PA_VP
173 169
174#define SAMSUNG_PA_ADC EXYNOS4_PA_ADC 170#define SAMSUNG_PA_ADC EXYNOS4_PA_ADC
175#define SAMSUNG_PA_ADC1 EXYNOS4_PA_ADC1 171#define SAMSUNG_PA_ADC1 EXYNOS4_PA_ADC1
176#define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD 172#define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD
177 173
178#define EXYNOS_PA_COMBINER EXYNOS4_PA_COMBINER
179#define EXYNOS_PA_GIC_CPU EXYNOS4_PA_GIC_CPU
180#define EXYNOS_PA_GIC_DIST EXYNOS4_PA_GIC_DIST
181#define EXYNOS_PA_PMU EXYNOS4_PA_PMU
182#define EXYNOS_PA_SYSTIMER EXYNOS4_PA_SYSTIMER
183
184/* Compatibility UART */ 174/* Compatibility UART */
185 175
186#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) 176#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
187 177
188#define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET)) 178#define S5P_PA_UART(x) (EXYNOS4_PA_UART + ((x) * S3C_UART_OFFSET))
189#define S5P_PA_UART0 S5P_PA_UART(0) 179#define S5P_PA_UART0 S5P_PA_UART(0)
190#define S5P_PA_UART1 S5P_PA_UART(1) 180#define S5P_PA_UART1 S5P_PA_UART(1)
191#define S5P_PA_UART2 S5P_PA_UART(2) 181#define S5P_PA_UART2 S5P_PA_UART(2)
diff --git a/arch/arm/mach-exynos/include/mach/system.h b/arch/arm/mach-exynos/include/mach/system.h
index 5e3220c18fc7..0063a6de3dc8 100644
--- a/arch/arm/mach-exynos/include/mach/system.h
+++ b/arch/arm/mach-exynos/include/mach/system.h
@@ -13,8 +13,6 @@
13#ifndef __ASM_ARCH_SYSTEM_H 13#ifndef __ASM_ARCH_SYSTEM_H
14#define __ASM_ARCH_SYSTEM_H __FILE__ 14#define __ASM_ARCH_SYSTEM_H __FILE__
15 15
16#include <plat/system-reset.h>
17
18static void arch_idle(void) 16static void arch_idle(void)
19{ 17{
20 /* nothing here yet */ 18 /* nothing here yet */
diff --git a/arch/arm/mach-exynos/include/mach/vmalloc.h b/arch/arm/mach-exynos/include/mach/vmalloc.h
deleted file mode 100644
index 284330e571d2..000000000000
--- a/arch/arm/mach-exynos/include/mach/vmalloc.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/vmalloc.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
7 *
8 * Based on arch/arm/mach-s5p6440/include/mach/vmalloc.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * EXYNOS4 vmalloc definition
15*/
16
17#ifndef __ASM_ARCH_VMALLOC_H
18#define __ASM_ARCH_VMALLOC_H __FILE__
19
20#define VMALLOC_END 0xF6000000UL
21
22#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-exynos/init.c b/arch/arm/mach-exynos/init.c
deleted file mode 100644
index a8a83e3881a4..000000000000
--- a/arch/arm/mach-exynos/init.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/* linux/arch/arm/mach-exynos4/init.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/serial_core.h>
12
13#include <plat/cpu.h>
14#include <plat/devs.h>
15#include <plat/regs-serial.h>
16
17static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = {
18 [0] = {
19 .name = "uclk1",
20 .divisor = 1,
21 .min_baud = 0,
22 .max_baud = 0,
23 },
24};
25
26/* uart registration process */
27void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
28{
29 struct s3c2410_uartcfg *tcfg = cfg;
30 u32 ucnt;
31
32 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
33 if (!tcfg->clocks) {
34 tcfg->has_fracval = 1;
35 tcfg->clocks = exynos4_serial_clocks;
36 tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
37 }
38 tcfg->flags |= NO_NEED_CHECK_CLKSRC;
39 }
40
41 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
42}
diff --git a/arch/arm/mach-exynos/irq-combiner.c b/arch/arm/mach-exynos/irq-combiner.c
deleted file mode 100644
index 5a2758ab055e..000000000000
--- a/arch/arm/mach-exynos/irq-combiner.c
+++ /dev/null
@@ -1,124 +0,0 @@
1/* linux/arch/arm/mach-exynos4/irq-combiner.c
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Based on arch/arm/common/gic.c
7 *
8 * IRQ COMBINER support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/io.h>
16
17#include <asm/mach/irq.h>
18
19#define COMBINER_ENABLE_SET 0x0
20#define COMBINER_ENABLE_CLEAR 0x4
21#define COMBINER_INT_STATUS 0xC
22
23static DEFINE_SPINLOCK(irq_controller_lock);
24
25struct combiner_chip_data {
26 unsigned int irq_offset;
27 unsigned int irq_mask;
28 void __iomem *base;
29};
30
31static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
32
33static inline void __iomem *combiner_base(struct irq_data *data)
34{
35 struct combiner_chip_data *combiner_data =
36 irq_data_get_irq_chip_data(data);
37
38 return combiner_data->base;
39}
40
41static void combiner_mask_irq(struct irq_data *data)
42{
43 u32 mask = 1 << (data->irq % 32);
44
45 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR);
46}
47
48static void combiner_unmask_irq(struct irq_data *data)
49{
50 u32 mask = 1 << (data->irq % 32);
51
52 __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
53}
54
55static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
56{
57 struct combiner_chip_data *chip_data = irq_get_handler_data(irq);
58 struct irq_chip *chip = irq_get_chip(irq);
59 unsigned int cascade_irq, combiner_irq;
60 unsigned long status;
61
62 chained_irq_enter(chip, desc);
63
64 spin_lock(&irq_controller_lock);
65 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS);
66 spin_unlock(&irq_controller_lock);
67 status &= chip_data->irq_mask;
68
69 if (status == 0)
70 goto out;
71
72 combiner_irq = __ffs(status);
73
74 cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
75 if (unlikely(cascade_irq >= NR_IRQS))
76 do_bad_IRQ(cascade_irq, desc);
77 else
78 generic_handle_irq(cascade_irq);
79
80 out:
81 chained_irq_exit(chip, desc);
82}
83
84static struct irq_chip combiner_chip = {
85 .name = "COMBINER",
86 .irq_mask = combiner_mask_irq,
87 .irq_unmask = combiner_unmask_irq,
88};
89
90void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq)
91{
92 if (combiner_nr >= MAX_COMBINER_NR)
93 BUG();
94 if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
95 BUG();
96 irq_set_chained_handler(irq, combiner_handle_cascade_irq);
97}
98
99void __init combiner_init(unsigned int combiner_nr, void __iomem *base,
100 unsigned int irq_start)
101{
102 unsigned int i;
103
104 if (combiner_nr >= MAX_COMBINER_NR)
105 BUG();
106
107 combiner_data[combiner_nr].base = base;
108 combiner_data[combiner_nr].irq_offset = irq_start;
109 combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
110
111 /* Disable all interrupts */
112
113 __raw_writel(combiner_data[combiner_nr].irq_mask,
114 base + COMBINER_ENABLE_CLEAR);
115
116 /* Setup the Linux IRQ subsystem */
117
118 for (i = irq_start; i < combiner_data[combiner_nr].irq_offset
119 + MAX_IRQ_IN_COMBINER; i++) {
120 irq_set_chip_and_handler(i, &combiner_chip, handle_level_irq);
121 irq_set_chip_data(i, &combiner_data[combiner_nr]);
122 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
123 }
124}
diff --git a/arch/arm/mach-exynos/irq-eint.c b/arch/arm/mach-exynos/irq-eint.c
deleted file mode 100644
index badb8c66fc9b..000000000000
--- a/arch/arm/mach-exynos/irq-eint.c
+++ /dev/null
@@ -1,237 +0,0 @@
1/* linux/arch/arm/mach-exynos4/irq-eint.c
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 - IRQ EINT support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <linux/sysdev.h>
18#include <linux/gpio.h>
19
20#include <plat/pm.h>
21#include <plat/cpu.h>
22#include <plat/gpio-cfg.h>
23
24#include <mach/regs-gpio.h>
25
26#include <asm/mach/irq.h>
27
28static DEFINE_SPINLOCK(eint_lock);
29
30static unsigned int eint0_15_data[16];
31
32static unsigned int exynos4_get_irq_nr(unsigned int number)
33{
34 u32 ret = 0;
35
36 switch (number) {
37 case 0 ... 3:
38 ret = (number + IRQ_EINT0);
39 break;
40 case 4 ... 7:
41 ret = (number + (IRQ_EINT4 - 4));
42 break;
43 case 8 ... 15:
44 ret = (number + (IRQ_EINT8 - 8));
45 break;
46 default:
47 printk(KERN_ERR "number available : %d\n", number);
48 }
49
50 return ret;
51}
52
53static inline void exynos4_irq_eint_mask(struct irq_data *data)
54{
55 u32 mask;
56
57 spin_lock(&eint_lock);
58 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq)));
59 mask |= eint_irq_to_bit(data->irq);
60 __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq)));
61 spin_unlock(&eint_lock);
62}
63
64static void exynos4_irq_eint_unmask(struct irq_data *data)
65{
66 u32 mask;
67
68 spin_lock(&eint_lock);
69 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq)));
70 mask &= ~(eint_irq_to_bit(data->irq));
71 __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq)));
72 spin_unlock(&eint_lock);
73}
74
75static inline void exynos4_irq_eint_ack(struct irq_data *data)
76{
77 __raw_writel(eint_irq_to_bit(data->irq),
78 S5P_EINT_PEND(EINT_REG_NR(data->irq)));
79}
80
81static void exynos4_irq_eint_maskack(struct irq_data *data)
82{
83 exynos4_irq_eint_mask(data);
84 exynos4_irq_eint_ack(data);
85}
86
87static int exynos4_irq_eint_set_type(struct irq_data *data, unsigned int type)
88{
89 int offs = EINT_OFFSET(data->irq);
90 int shift;
91 u32 ctrl, mask;
92 u32 newvalue = 0;
93
94 switch (type) {
95 case IRQ_TYPE_EDGE_RISING:
96 newvalue = S5P_IRQ_TYPE_EDGE_RISING;
97 break;
98
99 case IRQ_TYPE_EDGE_FALLING:
100 newvalue = S5P_IRQ_TYPE_EDGE_FALLING;
101 break;
102
103 case IRQ_TYPE_EDGE_BOTH:
104 newvalue = S5P_IRQ_TYPE_EDGE_BOTH;
105 break;
106
107 case IRQ_TYPE_LEVEL_LOW:
108 newvalue = S5P_IRQ_TYPE_LEVEL_LOW;
109 break;
110
111 case IRQ_TYPE_LEVEL_HIGH:
112 newvalue = S5P_IRQ_TYPE_LEVEL_HIGH;
113 break;
114
115 default:
116 printk(KERN_ERR "No such irq type %d", type);
117 return -EINVAL;
118 }
119
120 shift = (offs & 0x7) * 4;
121 mask = 0x7 << shift;
122
123 spin_lock(&eint_lock);
124 ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq)));
125 ctrl &= ~mask;
126 ctrl |= newvalue << shift;
127 __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq)));
128 spin_unlock(&eint_lock);
129
130 switch (offs) {
131 case 0 ... 7:
132 s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE);
133 break;
134 case 8 ... 15:
135 s3c_gpio_cfgpin(EINT_GPIO_1(offs & 0x7), EINT_MODE);
136 break;
137 case 16 ... 23:
138 s3c_gpio_cfgpin(EINT_GPIO_2(offs & 0x7), EINT_MODE);
139 break;
140 case 24 ... 31:
141 s3c_gpio_cfgpin(EINT_GPIO_3(offs & 0x7), EINT_MODE);
142 break;
143 default:
144 printk(KERN_ERR "No such irq number %d", offs);
145 }
146
147 return 0;
148}
149
150static struct irq_chip exynos4_irq_eint = {
151 .name = "exynos4-eint",
152 .irq_mask = exynos4_irq_eint_mask,
153 .irq_unmask = exynos4_irq_eint_unmask,
154 .irq_mask_ack = exynos4_irq_eint_maskack,
155 .irq_ack = exynos4_irq_eint_ack,
156 .irq_set_type = exynos4_irq_eint_set_type,
157#ifdef CONFIG_PM
158 .irq_set_wake = s3c_irqext_wake,
159#endif
160};
161
162/* exynos4_irq_demux_eint
163 *
164 * This function demuxes the IRQ from from EINTs 16 to 31.
165 * It is designed to be inlined into the specific handler
166 * s5p_irq_demux_eintX_Y.
167 *
168 * Each EINT pend/mask registers handle eight of them.
169 */
170static inline void exynos4_irq_demux_eint(unsigned int start)
171{
172 unsigned int irq;
173
174 u32 status = __raw_readl(S5P_EINT_PEND(EINT_REG_NR(start)));
175 u32 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(start)));
176
177 status &= ~mask;
178 status &= 0xff;
179
180 while (status) {
181 irq = fls(status) - 1;
182 generic_handle_irq(irq + start);
183 status &= ~(1 << irq);
184 }
185}
186
187static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
188{
189 struct irq_chip *chip = irq_get_chip(irq);
190 chained_irq_enter(chip, desc);
191 exynos4_irq_demux_eint(IRQ_EINT(16));
192 exynos4_irq_demux_eint(IRQ_EINT(24));
193 chained_irq_exit(chip, desc);
194}
195
196static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
197{
198 u32 *irq_data = irq_get_handler_data(irq);
199 struct irq_chip *chip = irq_get_chip(irq);
200
201 chained_irq_enter(chip, desc);
202 chip->irq_mask(&desc->irq_data);
203
204 if (chip->irq_ack)
205 chip->irq_ack(&desc->irq_data);
206
207 generic_handle_irq(*irq_data);
208
209 chip->irq_unmask(&desc->irq_data);
210 chained_irq_exit(chip, desc);
211}
212
213int __init exynos4_init_irq_eint(void)
214{
215 int irq;
216
217 for (irq = 0 ; irq <= 31 ; irq++) {
218 irq_set_chip_and_handler(IRQ_EINT(irq), &exynos4_irq_eint,
219 handle_level_irq);
220 set_irq_flags(IRQ_EINT(irq), IRQF_VALID);
221 }
222
223 irq_set_chained_handler(IRQ_EINT16_31, exynos4_irq_demux_eint16_31);
224
225 for (irq = 0 ; irq <= 15 ; irq++) {
226 eint0_15_data[irq] = IRQ_EINT(irq);
227
228 irq_set_handler_data(exynos4_get_irq_nr(irq),
229 &eint0_15_data[irq]);
230 irq_set_chained_handler(exynos4_get_irq_nr(irq),
231 exynos4_irq_eint0_15);
232 }
233
234 return 0;
235}
236
237arch_initcall(exynos4_init_irq_eint);
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c
index f0ca6c157d29..d726fcd3acf9 100644
--- a/arch/arm/mach-exynos/mach-armlex4210.c
+++ b/arch/arm/mach-exynos/mach-armlex4210.c
@@ -16,11 +16,11 @@
16#include <linux/smsc911x.h> 16#include <linux/smsc911x.h>
17 17
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
19#include <asm/mach-types.h> 20#include <asm/mach-types.h>
20 21
21#include <plat/cpu.h> 22#include <plat/cpu.h>
22#include <plat/devs.h> 23#include <plat/devs.h>
23#include <plat/exynos4.h>
24#include <plat/gpio-cfg.h> 24#include <plat/gpio-cfg.h>
25#include <plat/regs-serial.h> 25#include <plat/regs-serial.h>
26#include <plat/regs-srom.h> 26#include <plat/regs-srom.h>
@@ -28,6 +28,8 @@
28 28
29#include <mach/map.h> 29#include <mach/map.h>
30 30
31#include "common.h"
32
31/* Following are default values for UCON, ULCON and UFCON UART registers */ 33/* Following are default values for UCON, ULCON and UFCON UART registers */
32#define ARMLEX4210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 34#define ARMLEX4210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
33 S3C2410_UCON_RXILEVEL | \ 35 S3C2410_UCON_RXILEVEL | \
@@ -187,7 +189,7 @@ static void __init armlex4210_smsc911x_init(void)
187 189
188static void __init armlex4210_map_io(void) 190static void __init armlex4210_map_io(void)
189{ 191{
190 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 192 exynos_init_io(NULL, 0);
191 s3c24xx_init_clocks(24000000); 193 s3c24xx_init_clocks(24000000);
192 s3c24xx_init_uarts(armlex4210_uartcfgs, 194 s3c24xx_init_uarts(armlex4210_uartcfgs,
193 ARRAY_SIZE(armlex4210_uartcfgs)); 195 ARRAY_SIZE(armlex4210_uartcfgs));
@@ -210,6 +212,8 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
210 .atag_offset = 0x100, 212 .atag_offset = 0x100,
211 .init_irq = exynos4_init_irq, 213 .init_irq = exynos4_init_irq,
212 .map_io = armlex4210_map_io, 214 .map_io = armlex4210_map_io,
215 .handle_irq = gic_handle_irq,
213 .init_machine = armlex4210_machine_init, 216 .init_machine = armlex4210_machine_init,
214 .timer = &exynos4_timer, 217 .timer = &exynos4_timer,
218 .restart = exynos4_restart,
215MACHINE_END 219MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 236bbe187163..635fb97e31ab 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -32,12 +32,12 @@
32#include <media/v4l2-mediabus.h> 32#include <media/v4l2-mediabus.h>
33 33
34#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
35#include <asm/hardware/gic.h>
35#include <asm/mach-types.h> 36#include <asm/mach-types.h>
36 37
37#include <plat/adc.h> 38#include <plat/adc.h>
38#include <plat/regs-fb-v4.h> 39#include <plat/regs-fb-v4.h>
39#include <plat/regs-serial.h> 40#include <plat/regs-serial.h>
40#include <plat/exynos4.h>
41#include <plat/cpu.h> 41#include <plat/cpu.h>
42#include <plat/devs.h> 42#include <plat/devs.h>
43#include <plat/fb.h> 43#include <plat/fb.h>
@@ -54,6 +54,8 @@
54 54
55#include <mach/map.h> 55#include <mach/map.h>
56 56
57#include "common.h"
58
57/* Following are default values for UCON, ULCON and UFCON UART registers */ 59/* Following are default values for UCON, ULCON and UFCON UART registers */
58#define NURI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 60#define NURI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
59 S3C2410_UCON_RXILEVEL | \ 61 S3C2410_UCON_RXILEVEL | \
@@ -1283,7 +1285,7 @@ static struct platform_device *nuri_devices[] __initdata = {
1283 1285
1284static void __init nuri_map_io(void) 1286static void __init nuri_map_io(void)
1285{ 1287{
1286 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 1288 exynos_init_io(NULL, 0);
1287 s3c24xx_init_clocks(24000000); 1289 s3c24xx_init_clocks(24000000);
1288 s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs)); 1290 s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs));
1289} 1291}
@@ -1333,7 +1335,9 @@ MACHINE_START(NURI, "NURI")
1333 .atag_offset = 0x100, 1335 .atag_offset = 0x100,
1334 .init_irq = exynos4_init_irq, 1336 .init_irq = exynos4_init_irq,
1335 .map_io = nuri_map_io, 1337 .map_io = nuri_map_io,
1338 .handle_irq = gic_handle_irq,
1336 .init_machine = nuri_machine_init, 1339 .init_machine = nuri_machine_init,
1337 .timer = &exynos4_timer, 1340 .timer = &exynos4_timer,
1338 .reserve = &nuri_reserve, 1341 .reserve = &nuri_reserve,
1342 .restart = exynos4_restart,
1339MACHINE_END 1343MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index f80b563f2be7..586eb995aa96 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -22,13 +22,13 @@
22#include <linux/lcd.h> 22#include <linux/lcd.h>
23 23
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/hardware/gic.h>
25#include <asm/mach-types.h> 26#include <asm/mach-types.h>
26 27
27#include <video/platform_lcd.h> 28#include <video/platform_lcd.h>
28 29
29#include <plat/regs-serial.h> 30#include <plat/regs-serial.h>
30#include <plat/regs-fb-v4.h> 31#include <plat/regs-fb-v4.h>
31#include <plat/exynos4.h>
32#include <plat/cpu.h> 32#include <plat/cpu.h>
33#include <plat/devs.h> 33#include <plat/devs.h>
34#include <plat/sdhci.h> 34#include <plat/sdhci.h>
@@ -43,6 +43,8 @@
43 43
44#include <mach/map.h> 44#include <mach/map.h>
45 45
46#include "common.h"
47
46/* Following are default values for UCON, ULCON and UFCON UART registers */ 48/* Following are default values for UCON, ULCON and UFCON UART registers */
47#define ORIGEN_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 49#define ORIGEN_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
48 S3C2410_UCON_RXILEVEL | \ 50 S3C2410_UCON_RXILEVEL | \
@@ -638,7 +640,7 @@ static void s5p_tv_setup(void)
638 640
639static void __init origen_map_io(void) 641static void __init origen_map_io(void)
640{ 642{
641 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 643 exynos_init_io(NULL, 0);
642 s3c24xx_init_clocks(24000000); 644 s3c24xx_init_clocks(24000000);
643 s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs)); 645 s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
644} 646}
@@ -694,7 +696,9 @@ MACHINE_START(ORIGEN, "ORIGEN")
694 .atag_offset = 0x100, 696 .atag_offset = 0x100,
695 .init_irq = exynos4_init_irq, 697 .init_irq = exynos4_init_irq,
696 .map_io = origen_map_io, 698 .map_io = origen_map_io,
699 .handle_irq = gic_handle_irq,
697 .init_machine = origen_machine_init, 700 .init_machine = origen_machine_init,
698 .timer = &exynos4_timer, 701 .timer = &exynos4_timer,
699 .reserve = &origen_reserve, 702 .reserve = &origen_reserve,
703 .restart = exynos4_restart,
700MACHINE_END 704MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index fcf2e0e23d53..d00e4f016a68 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -21,13 +21,13 @@
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22 22
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/hardware/gic.h>
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25 26
26#include <plat/backlight.h> 27#include <plat/backlight.h>
27#include <plat/clock.h> 28#include <plat/clock.h>
28#include <plat/cpu.h> 29#include <plat/cpu.h>
29#include <plat/devs.h> 30#include <plat/devs.h>
30#include <plat/exynos4.h>
31#include <plat/gpio-cfg.h> 31#include <plat/gpio-cfg.h>
32#include <plat/iic.h> 32#include <plat/iic.h>
33#include <plat/keypad.h> 33#include <plat/keypad.h>
@@ -36,6 +36,8 @@
36 36
37#include <mach/map.h> 37#include <mach/map.h>
38 38
39#include "common.h"
40
39/* Following are default values for UCON, ULCON and UFCON UART registers */ 41/* Following are default values for UCON, ULCON and UFCON UART registers */
40#define SMDK4X12_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 42#define SMDK4X12_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
41 S3C2410_UCON_RXILEVEL | \ 43 S3C2410_UCON_RXILEVEL | \
@@ -249,7 +251,7 @@ static void __init smdk4x12_map_io(void)
249{ 251{
250 clk_xusbxti.rate = 24000000; 252 clk_xusbxti.rate = 24000000;
251 253
252 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 254 exynos_init_io(NULL, 0);
253 s3c24xx_init_clocks(clk_xusbxti.rate); 255 s3c24xx_init_clocks(clk_xusbxti.rate);
254 s3c24xx_init_uarts(smdk4x12_uartcfgs, ARRAY_SIZE(smdk4x12_uartcfgs)); 256 s3c24xx_init_uarts(smdk4x12_uartcfgs, ARRAY_SIZE(smdk4x12_uartcfgs));
255} 257}
@@ -287,8 +289,10 @@ MACHINE_START(SMDK4212, "SMDK4212")
287 .atag_offset = 0x100, 289 .atag_offset = 0x100,
288 .init_irq = exynos4_init_irq, 290 .init_irq = exynos4_init_irq,
289 .map_io = smdk4x12_map_io, 291 .map_io = smdk4x12_map_io,
292 .handle_irq = gic_handle_irq,
290 .init_machine = smdk4x12_machine_init, 293 .init_machine = smdk4x12_machine_init,
291 .timer = &exynos4_timer, 294 .timer = &exynos4_timer,
295 .restart = exynos4_restart,
292MACHINE_END 296MACHINE_END
293 297
294MACHINE_START(SMDK4412, "SMDK4412") 298MACHINE_START(SMDK4412, "SMDK4412")
@@ -297,6 +301,8 @@ MACHINE_START(SMDK4412, "SMDK4412")
297 .atag_offset = 0x100, 301 .atag_offset = 0x100,
298 .init_irq = exynos4_init_irq, 302 .init_irq = exynos4_init_irq,
299 .map_io = smdk4x12_map_io, 303 .map_io = smdk4x12_map_io,
304 .handle_irq = gic_handle_irq,
300 .init_machine = smdk4x12_machine_init, 305 .init_machine = smdk4x12_machine_init,
301 .timer = &exynos4_timer, 306 .timer = &exynos4_timer,
307 .restart = exynos4_restart,
302MACHINE_END 308MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index cec2afabe7b4..5b365613b470 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -21,13 +21,13 @@
21#include <linux/pwm_backlight.h> 21#include <linux/pwm_backlight.h>
22 22
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/hardware/gic.h>
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25 26
26#include <video/platform_lcd.h> 27#include <video/platform_lcd.h>
27#include <plat/regs-serial.h> 28#include <plat/regs-serial.h>
28#include <plat/regs-srom.h> 29#include <plat/regs-srom.h>
29#include <plat/regs-fb-v4.h> 30#include <plat/regs-fb-v4.h>
30#include <plat/exynos4.h>
31#include <plat/cpu.h> 31#include <plat/cpu.h>
32#include <plat/devs.h> 32#include <plat/devs.h>
33#include <plat/fb.h> 33#include <plat/fb.h>
@@ -43,6 +43,8 @@
43 43
44#include <mach/map.h> 44#include <mach/map.h>
45 45
46#include "common.h"
47
46/* Following are default values for UCON, ULCON and UFCON UART registers */ 48/* Following are default values for UCON, ULCON and UFCON UART registers */
47#define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 49#define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
48 S3C2410_UCON_RXILEVEL | \ 50 S3C2410_UCON_RXILEVEL | \
@@ -332,7 +334,7 @@ static void s5p_tv_setup(void)
332 334
333static void __init smdkv310_map_io(void) 335static void __init smdkv310_map_io(void)
334{ 336{
335 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 337 exynos_init_io(NULL, 0);
336 s3c24xx_init_clocks(24000000); 338 s3c24xx_init_clocks(24000000);
337 s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs)); 339 s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
338} 340}
@@ -375,9 +377,11 @@ MACHINE_START(SMDKV310, "SMDKV310")
375 .atag_offset = 0x100, 377 .atag_offset = 0x100,
376 .init_irq = exynos4_init_irq, 378 .init_irq = exynos4_init_irq,
377 .map_io = smdkv310_map_io, 379 .map_io = smdkv310_map_io,
380 .handle_irq = gic_handle_irq,
378 .init_machine = smdkv310_machine_init, 381 .init_machine = smdkv310_machine_init,
379 .timer = &exynos4_timer, 382 .timer = &exynos4_timer,
380 .reserve = &smdkv310_reserve, 383 .reserve = &smdkv310_reserve,
384 .restart = exynos4_restart,
381MACHINE_END 385MACHINE_END
382 386
383MACHINE_START(SMDKC210, "SMDKC210") 387MACHINE_START(SMDKC210, "SMDKC210")
@@ -385,6 +389,8 @@ MACHINE_START(SMDKC210, "SMDKC210")
385 .atag_offset = 0x100, 389 .atag_offset = 0x100,
386 .init_irq = exynos4_init_irq, 390 .init_irq = exynos4_init_irq,
387 .map_io = smdkv310_map_io, 391 .map_io = smdkv310_map_io,
392 .handle_irq = gic_handle_irq,
388 .init_machine = smdkv310_machine_init, 393 .init_machine = smdkv310_machine_init,
389 .timer = &exynos4_timer, 394 .timer = &exynos4_timer,
395 .restart = exynos4_restart,
390MACHINE_END 396MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index a2a177ff4b44..52aea972746a 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -24,10 +24,10 @@
24#include <linux/i2c/atmel_mxt_ts.h> 24#include <linux/i2c/atmel_mxt_ts.h>
25 25
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include <asm/hardware/gic.h>
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28 29
29#include <plat/regs-serial.h> 30#include <plat/regs-serial.h>
30#include <plat/exynos4.h>
31#include <plat/cpu.h> 31#include <plat/cpu.h>
32#include <plat/devs.h> 32#include <plat/devs.h>
33#include <plat/iic.h> 33#include <plat/iic.h>
@@ -47,6 +47,8 @@
47#include <media/s5p_fimc.h> 47#include <media/s5p_fimc.h>
48#include <media/m5mols.h> 48#include <media/m5mols.h>
49 49
50#include "common.h"
51
50/* Following are default values for UCON, ULCON and UFCON UART registers */ 52/* Following are default values for UCON, ULCON and UFCON UART registers */
51#define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 53#define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
52 S3C2410_UCON_RXILEVEL | \ 54 S3C2410_UCON_RXILEVEL | \
@@ -992,7 +994,7 @@ static struct platform_device *universal_devices[] __initdata = {
992 994
993static void __init universal_map_io(void) 995static void __init universal_map_io(void)
994{ 996{
995 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 997 exynos_init_io(NULL, 0);
996 s3c24xx_init_clocks(24000000); 998 s3c24xx_init_clocks(24000000);
997 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 999 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
998} 1000}
@@ -1058,7 +1060,9 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1058 .atag_offset = 0x100, 1060 .atag_offset = 0x100,
1059 .init_irq = exynos4_init_irq, 1061 .init_irq = exynos4_init_irq,
1060 .map_io = universal_map_io, 1062 .map_io = universal_map_io,
1063 .handle_irq = gic_handle_irq,
1061 .init_machine = universal_machine_init, 1064 .init_machine = universal_machine_init,
1062 .timer = &exynos4_timer, 1065 .timer = &exynos4_timer,
1063 .reserve = &universal_reserve, 1066 .reserve = &universal_reserve,
1067 .restart = exynos4_restart,
1064MACHINE_END 1068MACHINE_END
diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c
index 97343df8f132..85b5527d0918 100644
--- a/arch/arm/mach-exynos/mct.c
+++ b/arch/arm/mach-exynos/mct.c
@@ -44,8 +44,6 @@ struct mct_clock_event_device {
44 char name[10]; 44 char name[10];
45}; 45};
46 46
47static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick);
48
49static void exynos4_mct_write(unsigned int value, void *addr) 47static void exynos4_mct_write(unsigned int value, void *addr)
50{ 48{
51 void __iomem *stat_addr; 49 void __iomem *stat_addr;
@@ -264,6 +262,9 @@ static void exynos4_clockevent_init(void)
264} 262}
265 263
266#ifdef CONFIG_LOCAL_TIMERS 264#ifdef CONFIG_LOCAL_TIMERS
265
266static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick);
267
267/* Clock event handling */ 268/* Clock event handling */
268static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt) 269static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt)
269{ 270{
@@ -428,9 +429,13 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt)
428 429
429void local_timer_stop(struct clock_event_device *evt) 430void local_timer_stop(struct clock_event_device *evt)
430{ 431{
432 unsigned int cpu = smp_processor_id();
431 evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); 433 evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
432 if (mct_int_type == MCT_INT_SPI) 434 if (mct_int_type == MCT_INT_SPI)
433 disable_irq(evt->irq); 435 if (cpu == 0)
436 remove_irq(evt->irq, &mct_tick0_event_irq);
437 else
438 remove_irq(evt->irq, &mct_tick1_event_irq);
434 else 439 else
435 disable_percpu_irq(IRQ_MCT_LOCALTIMER); 440 disable_percpu_irq(IRQ_MCT_LOCALTIMER);
436} 441}
@@ -443,6 +448,7 @@ static void __init exynos4_timer_resources(void)
443 448
444 clk_rate = clk_get_rate(mct_clk); 449 clk_rate = clk_get_rate(mct_clk);
445 450
451#ifdef CONFIG_LOCAL_TIMERS
446 if (mct_int_type == MCT_INT_PPI) { 452 if (mct_int_type == MCT_INT_PPI) {
447 int err; 453 int err;
448 454
@@ -452,6 +458,7 @@ static void __init exynos4_timer_resources(void)
452 WARN(err, "MCT: can't request IRQ %d (%d)\n", 458 WARN(err, "MCT: can't request IRQ %d (%d)\n",
453 IRQ_MCT_LOCALTIMER, err); 459 IRQ_MCT_LOCALTIMER, err);
454 } 460 }
461#endif /* CONFIG_LOCAL_TIMERS */
455} 462}
456 463
457static void __init exynos4_timer_init(void) 464static void __init exynos4_timer_init(void)
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 69ffb2fb3875..60bc45e3e709 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -32,7 +32,6 @@
32 32
33#include <plat/cpu.h> 33#include <plat/cpu.h>
34 34
35extern unsigned int gic_bank_offset;
36extern void exynos4_secondary_startup(void); 35extern void exynos4_secondary_startup(void);
37 36
38#define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ 37#define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \
@@ -65,31 +64,6 @@ static void __iomem *scu_base_addr(void)
65 64
66static DEFINE_SPINLOCK(boot_lock); 65static DEFINE_SPINLOCK(boot_lock);
67 66
68static void __cpuinit exynos4_gic_secondary_init(void)
69{
70 void __iomem *dist_base = S5P_VA_GIC_DIST +
71 (gic_bank_offset * smp_processor_id());
72 void __iomem *cpu_base = S5P_VA_GIC_CPU +
73 (gic_bank_offset * smp_processor_id());
74 int i;
75
76 /*
77 * Deal with the banked PPI and SGI interrupts - disable all
78 * PPI interrupts, ensure all SGI interrupts are enabled.
79 */
80 __raw_writel(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);
81 __raw_writel(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);
82
83 /*
84 * Set priority on PPI and SGI interrupts
85 */
86 for (i = 0; i < 32; i += 4)
87 __raw_writel(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);
88
89 __raw_writel(0xf0, cpu_base + GIC_CPU_PRIMASK);
90 __raw_writel(1, cpu_base + GIC_CPU_CTRL);
91}
92
93void __cpuinit platform_secondary_init(unsigned int cpu) 67void __cpuinit platform_secondary_init(unsigned int cpu)
94{ 68{
95 /* 69 /*
@@ -97,7 +71,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
97 * core (e.g. timer irq), then they will not have been enabled 71 * core (e.g. timer irq), then they will not have been enabled
98 * for us: do so 72 * for us: do so
99 */ 73 */
100 exynos4_gic_secondary_init(); 74 gic_secondary_init(0);
101 75
102 /* 76 /*
103 * let the primary processor know we're out of the 77 * let the primary processor know we're out of the
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 509a435afd4b..c4f792dcad19 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -205,7 +205,7 @@ static void exynos4_pm_prepare(void)
205 205
206} 206}
207 207
208static int exynos4_pm_add(struct sys_device *sysdev) 208static int exynos4_pm_add(struct device *dev)
209{ 209{
210 pm_cpu_prep = exynos4_pm_prepare; 210 pm_cpu_prep = exynos4_pm_prepare;
211 pm_cpu_sleep = exynos4_cpu_suspend; 211 pm_cpu_sleep = exynos4_cpu_suspend;
@@ -301,8 +301,10 @@ static void exynos4_restore_pll(void)
301 } while (epll_wait || vpll_wait); 301 } while (epll_wait || vpll_wait);
302} 302}
303 303
304static struct sysdev_driver exynos4_pm_driver = { 304static struct subsys_interface exynos4_pm_interface = {
305 .add = exynos4_pm_add, 305 .name = "exynos4_pm",
306 .subsys = &exynos4_subsys,
307 .add_dev = exynos4_pm_add,
306}; 308};
307 309
308static __init int exynos4_pm_drvinit(void) 310static __init int exynos4_pm_drvinit(void)
@@ -325,7 +327,7 @@ static __init int exynos4_pm_drvinit(void)
325 clk_put(pll_base); 327 clk_put(pll_base);
326 } 328 }
327 329
328 return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver); 330 return subsys_interface_register(&exynos4_pm_interface);
329} 331}
330arch_initcall(exynos4_pm_drvinit); 332arch_initcall(exynos4_pm_drvinit);
331 333
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index d5f178540928..25b453601acc 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -86,9 +86,10 @@ fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)
86MACHINE_START(CATS, "Chalice-CATS") 86MACHINE_START(CATS, "Chalice-CATS")
87 /* Maintainer: Philip Blundell */ 87 /* Maintainer: Philip Blundell */
88 .atag_offset = 0x100, 88 .atag_offset = 0x100,
89 .soft_reboot = 1, 89 .restart_mode = 's',
90 .fixup = fixup_cats, 90 .fixup = fixup_cats,
91 .map_io = footbridge_map_io, 91 .map_io = footbridge_map_io,
92 .init_irq = footbridge_init_irq, 92 .init_irq = footbridge_init_irq,
93 .timer = &isa_timer, 93 .timer = &isa_timer,
94 .restart = footbridge_restart,
94MACHINE_END 95MACHINE_END
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index 38a44f9b9da2..41978ee4f9d0 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -199,6 +199,33 @@ void __init footbridge_map_io(void)
199 iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); 199 iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc));
200} 200}
201 201
202void footbridge_restart(char mode, const char *cmd)
203{
204 if (mode == 's') {
205 /* Jump into the ROM */
206 soft_restart(0x41000000);
207 } else {
208 /*
209 * Force the watchdog to do a CPU reset.
210 *
211 * After making sure that the watchdog is disabled
212 * (so we can change the timer registers) we first
213 * enable the timer to autoreload itself. Next, the
214 * timer interval is set really short and any
215 * current interrupt request is cleared (so we can
216 * see an edge transition). Finally, TIMER4 is
217 * enabled as the watchdog.
218 */
219 *CSR_SA110_CNTL &= ~(1 << 13);
220 *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE |
221 TIMER_CNTL_AUTORELOAD |
222 TIMER_CNTL_DIV16;
223 *CSR_TIMER4_LOAD = 0x2;
224 *CSR_TIMER4_CLR = 0;
225 *CSR_SA110_CNTL |= (1 << 13);
226 }
227}
228
202#ifdef CONFIG_FOOTBRIDGE_ADDIN 229#ifdef CONFIG_FOOTBRIDGE_ADDIN
203 230
204static inline unsigned long fb_bus_sdram_offset(void) 231static inline unsigned long fb_bus_sdram_offset(void)
diff --git a/arch/arm/mach-footbridge/common.h b/arch/arm/mach-footbridge/common.h
index b05e662d21ad..c9767b892cb2 100644
--- a/arch/arm/mach-footbridge/common.h
+++ b/arch/arm/mach-footbridge/common.h
@@ -8,3 +8,4 @@ extern void footbridge_map_io(void);
8extern void footbridge_init_irq(void); 8extern void footbridge_init_irq(void);
9 9
10extern void isa_init_irq(unsigned int irq); 10extern void isa_init_irq(unsigned int irq);
11extern void footbridge_restart(char, const char *);
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
index 012210cf7d16..27716a7e5fc1 100644
--- a/arch/arm/mach-footbridge/ebsa285.c
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -21,5 +21,6 @@ MACHINE_START(EBSA285, "EBSA285")
21 .map_io = footbridge_map_io, 21 .map_io = footbridge_map_io,
22 .init_irq = footbridge_init_irq, 22 .init_irq = footbridge_init_irq,
23 .timer = &footbridge_timer, 23 .timer = &footbridge_timer,
24 .restart = footbridge_restart,
24MACHINE_END 25MACHINE_END
25 26
diff --git a/arch/arm/mach-footbridge/include/mach/system.h b/arch/arm/mach-footbridge/include/mach/system.h
index 0b2931566209..a174a5841bc2 100644
--- a/arch/arm/mach-footbridge/include/mach/system.h
+++ b/arch/arm/mach-footbridge/include/mach/system.h
@@ -7,63 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/io.h>
11#include <asm/hardware/dec21285.h>
12#include <mach/hardware.h>
13#include <asm/leds.h>
14#include <asm/mach-types.h>
15
16static inline void arch_idle(void) 10static inline void arch_idle(void)
17{ 11{
18 cpu_do_idle(); 12 cpu_do_idle();
19} 13}
20
21static inline void arch_reset(char mode, const char *cmd)
22{
23 if (mode == 's') {
24 /*
25 * Jump into the ROM
26 */
27 cpu_reset(0x41000000);
28 } else {
29 if (machine_is_netwinder()) {
30 /* open up the SuperIO chip
31 */
32 outb(0x87, 0x370);
33 outb(0x87, 0x370);
34
35 /* aux function group 1 (logical device 7)
36 */
37 outb(0x07, 0x370);
38 outb(0x07, 0x371);
39
40 /* set GP16 for WD-TIMER output
41 */
42 outb(0xe6, 0x370);
43 outb(0x00, 0x371);
44
45 /* set a RED LED and toggle WD_TIMER for rebooting
46 */
47 outb(0xc4, 0x338);
48 } else {
49 /*
50 * Force the watchdog to do a CPU reset.
51 *
52 * After making sure that the watchdog is disabled
53 * (so we can change the timer registers) we first
54 * enable the timer to autoreload itself. Next, the
55 * timer interval is set really short and any
56 * current interrupt request is cleared (so we can
57 * see an edge transition). Finally, TIMER4 is
58 * enabled as the watchdog.
59 */
60 *CSR_SA110_CNTL &= ~(1 << 13);
61 *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE |
62 TIMER_CNTL_AUTORELOAD |
63 TIMER_CNTL_DIV16;
64 *CSR_TIMER4_LOAD = 0x2;
65 *CSR_TIMER4_CLR = 0;
66 *CSR_SA110_CNTL |= (1 << 13);
67 }
68 }
69}
diff --git a/arch/arm/mach-footbridge/include/mach/vmalloc.h b/arch/arm/mach-footbridge/include/mach/vmalloc.h
deleted file mode 100644
index 40ba78e5782b..000000000000
--- a/arch/arm/mach-footbridge/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * arch/arm/mach-footbridge/include/mach/vmalloc.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9
10#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index 0d3846f3b60d..80a1c5cc9071 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -645,6 +645,32 @@ fixup_netwinder(struct tag *tags, char **cmdline, struct meminfo *mi)
645#endif 645#endif
646} 646}
647 647
648static void netwinder_restart(char mode, const char *cmd)
649{
650 if (mode == 's') {
651 /* Jump into the ROM */
652 soft_restart(0x41000000);
653 } else {
654 local_irq_disable();
655 local_fiq_disable();
656
657 /* open up the SuperIO chip */
658 outb(0x87, 0x370);
659 outb(0x87, 0x370);
660
661 /* aux function group 1 (logical device 7) */
662 outb(0x07, 0x370);
663 outb(0x07, 0x371);
664
665 /* set GP16 for WD-TIMER output */
666 outb(0xe6, 0x370);
667 outb(0x00, 0x371);
668
669 /* set a RED LED and toggle WD_TIMER for rebooting */
670 outb(0xc4, 0x338);
671 }
672}
673
648MACHINE_START(NETWINDER, "Rebel-NetWinder") 674MACHINE_START(NETWINDER, "Rebel-NetWinder")
649 /* Maintainer: Russell King/Rebel.com */ 675 /* Maintainer: Russell King/Rebel.com */
650 .atag_offset = 0x100, 676 .atag_offset = 0x100,
@@ -656,4 +682,5 @@ MACHINE_START(NETWINDER, "Rebel-NetWinder")
656 .map_io = footbridge_map_io, 682 .map_io = footbridge_map_io,
657 .init_irq = footbridge_init_irq, 683 .init_irq = footbridge_init_irq,
658 .timer = &isa_timer, 684 .timer = &isa_timer,
685 .restart = netwinder_restart,
659MACHINE_END 686MACHINE_END
diff --git a/arch/arm/mach-footbridge/personal.c b/arch/arm/mach-footbridge/personal.c
index f41dba39b327..e1e9990fa957 100644
--- a/arch/arm/mach-footbridge/personal.c
+++ b/arch/arm/mach-footbridge/personal.c
@@ -19,5 +19,6 @@ MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
19 .map_io = footbridge_map_io, 19 .map_io = footbridge_map_io,
20 .init_irq = footbridge_init_irq, 20 .init_irq = footbridge_init_irq,
21 .timer = &footbridge_timer, 21 .timer = &footbridge_timer,
22 .restart = footbridge_restart,
22MACHINE_END 23MACHINE_END
23 24
diff --git a/arch/arm/mach-gemini/include/mach/vmalloc.h b/arch/arm/mach-gemini/include/mach/vmalloc.h
deleted file mode 100644
index 45371eb86fcb..000000000000
--- a/arch/arm/mach-gemini/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c
index 51d4e44ab973..f8a2f6bb5483 100644
--- a/arch/arm/mach-h720x/common.c
+++ b/arch/arm/mach-h720x/common.c
@@ -242,3 +242,8 @@ void __init h720x_map_io(void)
242{ 242{
243 iotable_init(h720x_io_desc,ARRAY_SIZE(h720x_io_desc)); 243 iotable_init(h720x_io_desc,ARRAY_SIZE(h720x_io_desc));
244} 244}
245
246void h720x_restart(char mode, const char *cmd)
247{
248 CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
249}
diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h
index 7dd5fa604efc..2489537d33dd 100644
--- a/arch/arm/mach-h720x/common.h
+++ b/arch/arm/mach-h720x/common.h
@@ -16,6 +16,7 @@
16extern unsigned long h720x_gettimeoffset(void); 16extern unsigned long h720x_gettimeoffset(void);
17extern void __init h720x_init_irq(void); 17extern void __init h720x_init_irq(void);
18extern void __init h720x_map_io(void); 18extern void __init h720x_map_io(void);
19extern void h720x_restart(char, const char *);
19 20
20#ifdef CONFIG_ARCH_H7202 21#ifdef CONFIG_ARCH_H7202
21extern struct sys_timer h7202_timer; 22extern struct sys_timer h7202_timer;
diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c
index 9886f19805f4..5fdb20c855e2 100644
--- a/arch/arm/mach-h720x/h7201-eval.c
+++ b/arch/arm/mach-h720x/h7201-eval.c
@@ -34,4 +34,5 @@ MACHINE_START(H7201, "Hynix GMS30C7201")
34 .init_irq = h720x_init_irq, 34 .init_irq = h720x_init_irq,
35 .timer = &h7201_timer, 35 .timer = &h7201_timer,
36 .dma_zone_size = SZ_256M, 36 .dma_zone_size = SZ_256M,
37 .restart = h720x_restart,
37MACHINE_END 38MACHINE_END
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c
index 284a134819e1..169673036c59 100644
--- a/arch/arm/mach-h720x/h7202-eval.c
+++ b/arch/arm/mach-h720x/h7202-eval.c
@@ -77,4 +77,5 @@ MACHINE_START(H7202, "Hynix HMS30C7202")
77 .timer = &h7202_timer, 77 .timer = &h7202_timer,
78 .init_machine = init_eval_h7202, 78 .init_machine = init_eval_h7202,
79 .dma_zone_size = SZ_256M, 79 .dma_zone_size = SZ_256M,
80 .restart = h720x_restart,
80MACHINE_END 81MACHINE_END
diff --git a/arch/arm/mach-h720x/include/mach/system.h b/arch/arm/mach-h720x/include/mach/system.h
index a708d24ee46d..16ac46e239aa 100644
--- a/arch/arm/mach-h720x/include/mach/system.h
+++ b/arch/arm/mach-h720x/include/mach/system.h
@@ -24,10 +24,4 @@ static void arch_idle(void)
24 nop(); 24 nop();
25} 25}
26 26
27
28static __inline__ void arch_reset(char mode, const char *cmd)
29{
30 CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
31}
32
33#endif 27#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
index 8520b4a4d4e6..000000000000
--- a/arch/arm/mach-h720x/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * arch/arm/mach-h720x/include/mach/vmalloc.h
3 */
4
5#ifndef __ARCH_ARM_VMALLOC_H
6#define __ARCH_ARM_VMALLOC_H
7
8#define VMALLOC_END 0xd0000000UL
9
10#endif
diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h
index 7e33fc94cd1e..d8e2d0be64ac 100644
--- a/arch/arm/mach-highbank/core.h
+++ b/arch/arm/mach-highbank/core.h
@@ -1,5 +1,6 @@
1extern void highbank_set_cpu_jump(int cpu, void *jump_addr); 1extern void highbank_set_cpu_jump(int cpu, void *jump_addr);
2extern void highbank_clocks_init(void); 2extern void highbank_clocks_init(void);
3extern void highbank_restart(char, const char *);
3extern void __iomem *scu_base_addr; 4extern void __iomem *scu_base_addr;
4#ifdef CONFIG_DEBUG_HIGHBANK_UART 5#ifdef CONFIG_DEBUG_HIGHBANK_UART
5extern void highbank_lluart_map_io(void); 6extern void highbank_lluart_map_io(void);
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index b82dcf08e747..804c4a55f803 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -22,6 +22,7 @@
22#include <linux/of_irq.h> 22#include <linux/of_irq.h>
23#include <linux/of_platform.h> 23#include <linux/of_platform.h>
24#include <linux/of_address.h> 24#include <linux/of_address.h>
25#include <linux/smp.h>
25 26
26#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
27#include <asm/unified.h> 28#include <asm/unified.h>
@@ -72,6 +73,9 @@ static void __init highbank_map_io(void)
72 73
73void highbank_set_cpu_jump(int cpu, void *jump_addr) 74void highbank_set_cpu_jump(int cpu, void *jump_addr)
74{ 75{
76#ifdef CONFIG_SMP
77 cpu = cpu_logical_map(cpu);
78#endif
75 writel(BSYM(virt_to_phys(jump_addr)), HB_JUMP_TABLE_VIRT(cpu)); 79 writel(BSYM(virt_to_phys(jump_addr)), HB_JUMP_TABLE_VIRT(cpu));
76 __cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16); 80 __cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16);
77 outer_clean_range(HB_JUMP_TABLE_PHYS(cpu), 81 outer_clean_range(HB_JUMP_TABLE_PHYS(cpu),
@@ -140,6 +144,8 @@ DT_MACHINE_START(HIGHBANK, "Highbank")
140 .map_io = highbank_map_io, 144 .map_io = highbank_map_io,
141 .init_irq = highbank_init_irq, 145 .init_irq = highbank_init_irq,
142 .timer = &highbank_timer, 146 .timer = &highbank_timer,
147 .handle_irq = gic_handle_irq,
143 .init_machine = highbank_init, 148 .init_machine = highbank_init,
144 .dt_compat = highbank_match, 149 .dt_compat = highbank_match,
150 .restart = highbank_restart,
145MACHINE_END 151MACHINE_END
diff --git a/arch/arm/mach-highbank/include/mach/entry-macro.S b/arch/arm/mach-highbank/include/mach/entry-macro.S
index 73c11297509e..a14f9e62ca92 100644
--- a/arch/arm/mach-highbank/include/mach/entry-macro.S
+++ b/arch/arm/mach-highbank/include/mach/entry-macro.S
@@ -1,5 +1,3 @@
1#include <asm/hardware/entry-macro-gic.S>
2
3 .macro disable_fiq 1 .macro disable_fiq
4 .endm 2 .endm
5 3
diff --git a/arch/arm/mach-highbank/include/mach/system.h b/arch/arm/mach-highbank/include/mach/system.h
index 7e8192296cae..b1d8b5fbe373 100644
--- a/arch/arm/mach-highbank/include/mach/system.h
+++ b/arch/arm/mach-highbank/include/mach/system.h
@@ -21,6 +21,4 @@ static inline void arch_idle(void)
21 cpu_do_idle(); 21 cpu_do_idle();
22} 22}
23 23
24extern void arch_reset(char mode, const char *cmd);
25
26#endif 24#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
index 1969e954277a..000000000000
--- a/arch/arm/mach-highbank/include/mach/vmalloc.h
+++ /dev/null
@@ -1 +0,0 @@
1#define VMALLOC_END 0xFEE00000UL
diff --git a/arch/arm/mach-highbank/system.c b/arch/arm/mach-highbank/system.c
index 53f0c4c5ef1c..82c27230d4a9 100644
--- a/arch/arm/mach-highbank/system.c
+++ b/arch/arm/mach-highbank/system.c
@@ -20,7 +20,7 @@
20#include "core.h" 20#include "core.h"
21#include "sysregs.h" 21#include "sysregs.h"
22 22
23void arch_reset(char mode, const char *cmd) 23void highbank_restart(char mode, const char *cmd)
24{ 24{
25 if (mode == 'h') 25 if (mode == 'h')
26 hignbank_set_pwr_hard_reset(); 26 hignbank_set_pwr_hard_reset();
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 5f7f9c2a34ae..35a218cb5c7e 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -10,11 +10,6 @@ config HAVE_IMX_MMDC
10config HAVE_IMX_SRC 10config HAVE_IMX_SRC
11 bool 11 bool
12 12
13#
14# ARCH_MX31 and ARCH_MX35 are left for compatibility
15# Some usages assume that having one of them implies not having (e.g.) ARCH_MX2.
16# To easily distinguish good and reviewed from unreviewed usages new (and IMHO
17# more sensible) names are used: SOC_IMX31 and SOC_IMX35
18config ARCH_MX1 13config ARCH_MX1
19 bool 14 bool
20 15
@@ -27,12 +22,6 @@ config ARCH_MX25
27config MACH_MX27 22config MACH_MX27
28 bool 23 bool
29 24
30config ARCH_MX31
31 bool
32
33config ARCH_MX35
34 bool
35
36config SOC_IMX1 25config SOC_IMX1
37 bool 26 bool
38 select ARCH_MX1 27 select ARCH_MX1
@@ -72,7 +61,6 @@ config SOC_IMX31
72 select CPU_V6 61 select CPU_V6
73 select IMX_HAVE_PLATFORM_MXC_RNGA 62 select IMX_HAVE_PLATFORM_MXC_RNGA
74 select ARCH_MXC_AUDMUX_V2 63 select ARCH_MXC_AUDMUX_V2
75 select ARCH_MX31
76 select MXC_AVIC 64 select MXC_AVIC
77 select SMP_ON_UP if SMP 65 select SMP_ON_UP if SMP
78 66
@@ -82,7 +70,6 @@ config SOC_IMX35
82 select ARCH_MXC_IOMUX_V3 70 select ARCH_MXC_IOMUX_V3
83 select ARCH_MXC_AUDMUX_V2 71 select ARCH_MXC_AUDMUX_V2
84 select HAVE_EPIT 72 select HAVE_EPIT
85 select ARCH_MX35
86 select MXC_AVIC 73 select MXC_AVIC
87 select SMP_ON_UP if SMP 74 select SMP_ON_UP if SMP
88 75
@@ -145,7 +132,7 @@ config MACH_MX25_3DS
145 select IMX_HAVE_PLATFORM_MXC_NAND 132 select IMX_HAVE_PLATFORM_MXC_NAND
146 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 133 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
147 134
148config MACH_EUKREA_CPUIMX25 135config MACH_EUKREA_CPUIMX25SD
149 bool "Support Eukrea CPUIMX25 Platform" 136 bool "Support Eukrea CPUIMX25 Platform"
150 select SOC_IMX25 137 select SOC_IMX25
151 select IMX_HAVE_PLATFORM_FLEXCAN 138 select IMX_HAVE_PLATFORM_FLEXCAN
@@ -161,7 +148,7 @@ config MACH_EUKREA_CPUIMX25
161 148
162choice 149choice
163 prompt "Baseboard" 150 prompt "Baseboard"
164 depends on MACH_EUKREA_CPUIMX25 151 depends on MACH_EUKREA_CPUIMX25SD
165 default MACH_EUKREA_MBIMXSD25_BASEBOARD 152 default MACH_EUKREA_MBIMXSD25_BASEBOARD
166 153
167config MACH_EUKREA_MBIMXSD25_BASEBOARD 154config MACH_EUKREA_MBIMXSD25_BASEBOARD
@@ -555,7 +542,7 @@ config MACH_MX35_3DS
555 Include support for MX35PDK platform. This includes specific 542 Include support for MX35PDK platform. This includes specific
556 configurations for the board and its peripherals. 543 configurations for the board and its peripherals.
557 544
558config MACH_EUKREA_CPUIMX35 545config MACH_EUKREA_CPUIMX35SD
559 bool "Support Eukrea CPUIMX35 Platform" 546 bool "Support Eukrea CPUIMX35 Platform"
560 select SOC_IMX35 547 select SOC_IMX35
561 select IMX_HAVE_PLATFORM_FLEXCAN 548 select IMX_HAVE_PLATFORM_FLEXCAN
@@ -573,7 +560,7 @@ config MACH_EUKREA_CPUIMX35
573 560
574choice 561choice
575 prompt "Baseboard" 562 prompt "Baseboard"
576 depends on MACH_EUKREA_CPUIMX35 563 depends on MACH_EUKREA_CPUIMX35SD
577 default MACH_EUKREA_MBIMXSD35_BASEBOARD 564 default MACH_EUKREA_MBIMXSD35_BASEBOARD
578 565
579config MACH_EUKREA_MBIMXSD35_BASEBOARD 566config MACH_EUKREA_MBIMXSD35_BASEBOARD
@@ -609,12 +596,12 @@ comment "i.MX6 family:"
609config SOC_IMX6Q 596config SOC_IMX6Q
610 bool "i.MX6 Quad support" 597 bool "i.MX6 Quad support"
611 select ARM_GIC 598 select ARM_GIC
612 select CACHE_L2X0
613 select CPU_V7 599 select CPU_V7
614 select HAVE_ARM_SCU 600 select HAVE_ARM_SCU
615 select HAVE_IMX_GPC 601 select HAVE_IMX_GPC
616 select HAVE_IMX_MMDC 602 select HAVE_IMX_MMDC
617 select HAVE_IMX_SRC 603 select HAVE_IMX_SRC
604 select HAVE_SMP
618 select USE_OF 605 select USE_OF
619 606
620 help 607 help
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index aba73214c2a8..d97f409ce98b 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -24,7 +24,7 @@ obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
24 24
25# i.MX25 based machines 25# i.MX25 based machines
26obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o 26obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o
27obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-eukrea_cpuimx25.o 27obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o
28obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o 28obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o
29 29
30# i.MX27 based machines 30# i.MX27 based machines
@@ -57,7 +57,7 @@ obj-$(CONFIG_MACH_BUG) += mach-bug.o
57# i.MX35 based machines 57# i.MX35 based machines
58obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o 58obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o
59obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o 59obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o
60obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o 60obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o
61obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o 61obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o
62obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o 62obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
63 63
diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c
index 8116f119517d..ac8238caecb9 100644
--- a/arch/arm/mach-imx/clock-imx35.c
+++ b/arch/arm/mach-imx/clock-imx35.c
@@ -507,7 +507,7 @@ static struct clk_lookup lookups[] = {
507 507
508int __init mx35_clocks_init() 508int __init mx35_clocks_init()
509{ 509{
510 unsigned int cgr2 = 3 << 26, cgr3 = 0; 510 unsigned int cgr2 = 3 << 26;
511 511
512#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) 512#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
513 cgr2 |= 3 << 16; 513 cgr2 |= 3 << 16;
@@ -521,6 +521,12 @@ int __init mx35_clocks_init()
521 __raw_writel((3 << 18), CCM_BASE + CCM_CGR0); 521 __raw_writel((3 << 18), CCM_BASE + CCM_CGR0);
522 __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16), 522 __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16),
523 CCM_BASE + CCM_CGR1); 523 CCM_BASE + CCM_CGR1);
524 __raw_writel(cgr2, CCM_BASE + CCM_CGR2);
525 __raw_writel(0, CCM_BASE + CCM_CGR3);
526
527 clk_enable(&iim_clk);
528 imx_print_silicon_rev("i.MX35", mx35_revision());
529 clk_disable(&iim_clk);
524 530
525 /* 531 /*
526 * Check if we came up in internal boot mode. If yes, we need some 532 * Check if we came up in internal boot mode. If yes, we need some
@@ -529,17 +535,11 @@ int __init mx35_clocks_init()
529 */ 535 */
530 if (!(__raw_readl(CCM_BASE + CCM_RCSR) & (3 << 10))) { 536 if (!(__raw_readl(CCM_BASE + CCM_RCSR) & (3 << 10))) {
531 /* Additionally turn on UART1, SCC, and IIM clocks */ 537 /* Additionally turn on UART1, SCC, and IIM clocks */
532 cgr2 |= 3 << 16 | 3 << 4; 538 clk_enable(&iim_clk);
533 cgr3 |= 3 << 2; 539 clk_enable(&uart1_clk);
540 clk_enable(&scc_clk);
534 } 541 }
535 542
536 __raw_writel(cgr2, CCM_BASE + CCM_CGR2);
537 __raw_writel(cgr3, CCM_BASE + CCM_CGR3);
538
539 clk_enable(&iim_clk);
540 imx_print_silicon_rev("i.MX35", mx35_revision());
541 clk_disable(&iim_clk);
542
543#ifdef CONFIG_MXC_USE_EPIT 543#ifdef CONFIG_MXC_USE_EPIT
544 epit_timer_init(&epit1_clk, 544 epit_timer_init(&epit1_clk,
545 MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1); 545 MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1);
diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
index 613a1b993bff..9273c2a24b54 100644
--- a/arch/arm/mach-imx/clock-imx6q.c
+++ b/arch/arm/mach-imx/clock-imx6q.c
@@ -1931,14 +1931,12 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
1931 val |= 0x1 << BP_CLPCR_LPM; 1931 val |= 0x1 << BP_CLPCR_LPM;
1932 val &= ~BM_CLPCR_VSTBY; 1932 val &= ~BM_CLPCR_VSTBY;
1933 val &= ~BM_CLPCR_SBYOS; 1933 val &= ~BM_CLPCR_SBYOS;
1934 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
1935 break; 1934 break;
1936 case STOP_POWER_OFF: 1935 case STOP_POWER_OFF:
1937 val |= 0x2 << BP_CLPCR_LPM; 1936 val |= 0x2 << BP_CLPCR_LPM;
1938 val |= 0x3 << BP_CLPCR_STBY_COUNT; 1937 val |= 0x3 << BP_CLPCR_STBY_COUNT;
1939 val |= BM_CLPCR_VSTBY; 1938 val |= BM_CLPCR_VSTBY;
1940 val |= BM_CLPCR_SBYOS; 1939 val |= BM_CLPCR_SBYOS;
1941 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
1942 break; 1940 break;
1943 default: 1941 default:
1944 return -EINVAL; 1942 return -EINVAL;
@@ -1953,14 +1951,17 @@ static struct map_desc imx6q_clock_desc[] = {
1953 imx_map_entry(MX6Q, ANATOP, MT_DEVICE), 1951 imx_map_entry(MX6Q, ANATOP, MT_DEVICE),
1954}; 1952};
1955 1953
1954void __init imx6q_clock_map_io(void)
1955{
1956 iotable_init(imx6q_clock_desc, ARRAY_SIZE(imx6q_clock_desc));
1957}
1958
1956int __init mx6q_clocks_init(void) 1959int __init mx6q_clocks_init(void)
1957{ 1960{
1958 struct device_node *np; 1961 struct device_node *np;
1959 void __iomem *base; 1962 void __iomem *base;
1960 int i, irq; 1963 int i, irq;
1961 1964
1962 iotable_init(imx6q_clock_desc, ARRAY_SIZE(imx6q_clock_desc));
1963
1964 /* retrieve the freqency of fixed clocks from device tree */ 1965 /* retrieve the freqency of fixed clocks from device tree */
1965 for_each_compatible_node(np, NULL, "fixed-clock") { 1966 for_each_compatible_node(np, NULL, "fixed-clock") {
1966 u32 rate; 1967 u32 rate;
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index 1e486e67dabb..146a4f073464 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -139,4 +139,5 @@ MACHINE_START(APF9328, "Armadeus APF9328")
139 .handle_irq = imx1_handle_irq, 139 .handle_irq = imx1_handle_irq,
140 .timer = &apf9328_timer, 140 .timer = &apf9328_timer,
141 .init_machine = apf9328_init, 141 .init_machine = apf9328_init,
142 .restart = mxc_restart,
142MACHINE_END 143MACHINE_END
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index c9a9cf67755e..e4f426a09899 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -561,4 +561,5 @@ MACHINE_START(ARMADILLO5X0, "Armadillo-500")
561 .handle_irq = imx31_handle_irq, 561 .handle_irq = imx31_handle_irq,
562 .timer = &armadillo5x0_timer, 562 .timer = &armadillo5x0_timer,
563 .init_machine = armadillo5x0_init, 563 .init_machine = armadillo5x0_init,
564 .restart = mxc_restart,
564MACHINE_END 565MACHINE_END
diff --git a/arch/arm/mach-imx/mach-bug.c b/arch/arm/mach-imx/mach-bug.c
index 313f62ddc1ef..9a9897749dd6 100644
--- a/arch/arm/mach-imx/mach-bug.c
+++ b/arch/arm/mach-imx/mach-bug.c
@@ -65,4 +65,5 @@ MACHINE_START(BUG, "BugLabs BUGBase")
65 .handle_irq = imx31_handle_irq, 65 .handle_irq = imx31_handle_irq,
66 .timer = &bug_timer, 66 .timer = &bug_timer,
67 .init_machine = bug_board_init, 67 .init_machine = bug_board_init,
68 .restart = mxc_restart,
68MACHINE_END 69MACHINE_END
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index edb373052576..d085aea08709 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -318,4 +318,5 @@ MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27")
318 .handle_irq = imx27_handle_irq, 318 .handle_irq = imx27_handle_irq,
319 .timer = &eukrea_cpuimx27_timer, 319 .timer = &eukrea_cpuimx27_timer,
320 .init_machine = eukrea_cpuimx27_init, 320 .init_machine = eukrea_cpuimx27_init,
321 .restart = mxc_restart,
321MACHINE_END 322MACHINE_END
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index 66af2e8f7e57..8ecc872b2547 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -53,12 +53,18 @@ static const struct imxi2c_platform_data
53 .bitrate = 100000, 53 .bitrate = 100000,
54}; 54};
55 55
56#define TSC2007_IRQGPIO IMX_GPIO_NR(3, 2)
57static int tsc2007_get_pendown_state(void)
58{
59 return !gpio_get_value(TSC2007_IRQGPIO);
60}
61
56static struct tsc2007_platform_data tsc2007_info = { 62static struct tsc2007_platform_data tsc2007_info = {
57 .model = 2007, 63 .model = 2007,
58 .x_plate_ohms = 180, 64 .x_plate_ohms = 180,
65 .get_pendown_state = tsc2007_get_pendown_state,
59}; 66};
60 67
61#define TSC2007_IRQGPIO IMX_GPIO_NR(3, 2)
62static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { 68static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
63 { 69 {
64 I2C_BOARD_INFO("pcf8563", 0x51), 70 I2C_BOARD_INFO("pcf8563", 0x51),
@@ -201,4 +207,5 @@ MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
201 .handle_irq = imx35_handle_irq, 207 .handle_irq = imx35_handle_irq,
202 .timer = &eukrea_cpuimx35_timer, 208 .timer = &eukrea_cpuimx35_timer,
203 .init_machine = eukrea_cpuimx35_init, 209 .init_machine = eukrea_cpuimx35_init,
210 .restart = mxc_restart,
204MACHINE_END 211MACHINE_END
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index ab8fbcc472b5..76a97a598b9e 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -170,4 +170,5 @@ MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
170 .handle_irq = imx25_handle_irq, 170 .handle_irq = imx25_handle_irq,
171 .timer = &eukrea_cpuimx25_timer, 171 .timer = &eukrea_cpuimx25_timer,
172 .init_machine = eukrea_cpuimx25_init, 172 .init_machine = eukrea_cpuimx25_init,
173 .restart = mxc_restart,
173MACHINE_END 174MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 38eb9e45110b..c2766ae02b4f 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -282,4 +282,5 @@ MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
282 .handle_irq = imx27_handle_irq, 282 .handle_irq = imx27_handle_irq,
283 .timer = &visstrim_m10_timer, 283 .timer = &visstrim_m10_timer,
284 .init_machine = visstrim_m10_board_init, 284 .init_machine = visstrim_m10_board_init,
285 .restart = mxc_restart,
285MACHINE_END 286MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
index 7052155d0557..c9d350c5dcc8 100644
--- a/arch/arm/mach-imx/mach-imx27ipcam.c
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -78,4 +78,5 @@ MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
78 .handle_irq = imx27_handle_irq, 78 .handle_irq = imx27_handle_irq,
79 .timer = &mx27ipcam_timer, 79 .timer = &mx27ipcam_timer,
80 .init_machine = mx27ipcam_init, 80 .init_machine = mx27ipcam_init,
81 .restart = mxc_restart,
81MACHINE_END 82MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index 8d6a63521f17..1f45b9189229 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -84,4 +84,5 @@ MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
84 .handle_irq = imx27_handle_irq, 84 .handle_irq = imx27_handle_irq,
85 .timer = &mx27lite_timer, 85 .timer = &mx27lite_timer,
86 .init_machine = mx27lite_init, 86 .init_machine = mx27lite_init,
87 .restart = mxc_restart,
87MACHINE_END 88MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 8bf5fa349484..05b49bb5d677 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -10,10 +10,13 @@
10 * http://www.gnu.org/copyleft/gpl.html 10 * http://www.gnu.org/copyleft/gpl.html
11 */ 11 */
12 12
13#include <linux/delay.h>
13#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/io.h>
14#include <linux/irq.h> 16#include <linux/irq.h>
15#include <linux/irqdomain.h> 17#include <linux/irqdomain.h>
16#include <linux/of.h> 18#include <linux/of.h>
19#include <linux/of_address.h>
17#include <linux/of_irq.h> 20#include <linux/of_irq.h>
18#include <linux/of_platform.h> 21#include <linux/of_platform.h>
19#include <asm/hardware/cache-l2x0.h> 22#include <asm/hardware/cache-l2x0.h>
@@ -23,6 +26,36 @@
23#include <mach/common.h> 26#include <mach/common.h>
24#include <mach/hardware.h> 27#include <mach/hardware.h>
25 28
29void imx6q_restart(char mode, const char *cmd)
30{
31 struct device_node *np;
32 void __iomem *wdog_base;
33
34 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-wdt");
35 wdog_base = of_iomap(np, 0);
36 if (!wdog_base)
37 goto soft;
38
39 imx_src_prepare_restart();
40
41 /* enable wdog */
42 writew_relaxed(1 << 2, wdog_base);
43 /* write twice to ensure the request will not get ignored */
44 writew_relaxed(1 << 2, wdog_base);
45
46 /* wait for reset to assert ... */
47 mdelay(500);
48
49 pr_err("Watchdog reset failed to assert reset\n");
50
51 /* delay to allow the serial port to show the message */
52 mdelay(50);
53
54soft:
55 /* we'll take a jump through zero as a poor second */
56 soft_restart(0);
57}
58
26static void __init imx6q_init_machine(void) 59static void __init imx6q_init_machine(void)
27{ 60{
28 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 61 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
@@ -34,16 +67,18 @@ static void __init imx6q_map_io(void)
34{ 67{
35 imx_lluart_map_io(); 68 imx_lluart_map_io();
36 imx_scu_map_io(); 69 imx_scu_map_io();
70 imx6q_clock_map_io();
37} 71}
38 72
39static void __init imx6q_gpio_add_irq_domain(struct device_node *np, 73static int __init imx6q_gpio_add_irq_domain(struct device_node *np,
40 struct device_node *interrupt_parent) 74 struct device_node *interrupt_parent)
41{ 75{
42 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - 76 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
43 32 * 7; /* imx6q gets 7 gpio ports */
44 77
78 gpio_irq_base -= 32;
45 irq_domain_add_simple(np, gpio_irq_base); 79 irq_domain_add_simple(np, gpio_irq_base);
46 gpio_irq_base += 32; 80
81 return 0;
47} 82}
48 83
49static const struct of_device_id imx6q_irq_match[] __initconst = { 84static const struct of_device_id imx6q_irq_match[] __initconst = {
@@ -81,4 +116,5 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
81 .timer = &imx6q_timer, 116 .timer = &imx6q_timer,
82 .init_machine = imx6q_init_machine, 117 .init_machine = imx6q_init_machine,
83 .dt_compat = imx6q_dt_compat, 118 .dt_compat = imx6q_dt_compat,
119 .restart = imx6q_restart,
84MACHINE_END 120MACHINE_END
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 5f37f89e40fa..fc78e8071cd1 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -279,4 +279,5 @@ MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
279 .handle_irq = imx31_handle_irq, 279 .handle_irq = imx31_handle_irq,
280 .timer = &kzm_timer, 280 .timer = &kzm_timer,
281 .init_machine = kzm_board_init, 281 .init_machine = kzm_board_init,
282 .restart = mxc_restart,
282MACHINE_END 283MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index fc49785e7340..97046088ff1a 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -147,6 +147,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS")
147 .handle_irq = imx1_handle_irq, 147 .handle_irq = imx1_handle_irq,
148 .timer = &mx1ads_timer, 148 .timer = &mx1ads_timer,
149 .init_machine = mx1ads_init, 149 .init_machine = mx1ads_init,
150 .restart = mxc_restart,
150MACHINE_END 151MACHINE_END
151 152
152MACHINE_START(MXLADS, "Freescale MXLADS") 153MACHINE_START(MXLADS, "Freescale MXLADS")
@@ -157,4 +158,5 @@ MACHINE_START(MXLADS, "Freescale MXLADS")
157 .handle_irq = imx1_handle_irq, 158 .handle_irq = imx1_handle_irq,
158 .timer = &mx1ads_timer, 159 .timer = &mx1ads_timer,
159 .init_machine = mx1ads_init, 160 .init_machine = mx1ads_init,
161 .restart = mxc_restart,
160MACHINE_END 162MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 25f84028d055..8d9f95514b1f 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -312,4 +312,5 @@ MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
312 .handle_irq = imx21_handle_irq, 312 .handle_irq = imx21_handle_irq,
313 .timer = &mx21ads_timer, 313 .timer = &mx21ads_timer,
314 .init_machine = mx21ads_board_init, 314 .init_machine = mx21ads_board_init,
315 .restart = mxc_restart,
315MACHINE_END 316MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index 88dccf122243..f26734298aa6 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -270,4 +270,5 @@ MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
270 .handle_irq = imx25_handle_irq, 270 .handle_irq = imx25_handle_irq,
271 .timer = &mx25pdk_timer, 271 .timer = &mx25pdk_timer,
272 .init_machine = mx25pdk_init, 272 .init_machine = mx25pdk_init,
273 .restart = mxc_restart,
273MACHINE_END 274MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index ba232d79fa81..18f35816706a 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -425,4 +425,5 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
425 .handle_irq = imx27_handle_irq, 425 .handle_irq = imx27_handle_irq,
426 .timer = &mx27pdk_timer, 426 .timer = &mx27pdk_timer,
427 .init_machine = mx27pdk_init, 427 .init_machine = mx27pdk_init,
428 .restart = mxc_restart,
428MACHINE_END 429MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 74dd5731eb61..0228d2e07fe0 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -351,4 +351,5 @@ MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
351 .handle_irq = imx27_handle_irq, 351 .handle_irq = imx27_handle_irq,
352 .timer = &mx27ads_timer, 352 .timer = &mx27ads_timer,
353 .init_machine = mx27ads_board_init, 353 .init_machine = mx27ads_board_init,
354 .restart = mxc_restart,
354MACHINE_END 355MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index b8c54b840185..2b565c381347 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -770,4 +770,5 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
770 .timer = &mx31_3ds_timer, 770 .timer = &mx31_3ds_timer,
771 .init_machine = mx31_3ds_init, 771 .init_machine = mx31_3ds_init,
772 .reserve = mx31_3ds_reserve, 772 .reserve = mx31_3ds_reserve,
773 .restart = mxc_restart,
773MACHINE_END 774MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index 9cc1a49053bb..4917aab0e253 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -542,4 +542,5 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS")
542 .handle_irq = imx31_handle_irq, 542 .handle_irq = imx31_handle_irq,
543 .timer = &mx31ads_timer, 543 .timer = &mx31ads_timer,
544 .init_machine = mx31ads_init, 544 .init_machine = mx31ads_init,
545 .restart = mxc_restart,
545MACHINE_END 546MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 102ec99357cc..02401bbd6d53 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -303,4 +303,5 @@ MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
303 .handle_irq = imx31_handle_irq, 303 .handle_irq = imx31_handle_irq,
304 .timer = &mx31lilly_timer, 304 .timer = &mx31lilly_timer,
305 .init_machine = mx31lilly_board_init, 305 .init_machine = mx31lilly_board_init,
306 .restart = mxc_restart,
306MACHINE_END 307MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index 5366d2de18fd..ef80751712e7 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -287,4 +287,5 @@ MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
287 .handle_irq = imx31_handle_irq, 287 .handle_irq = imx31_handle_irq,
288 .timer = &mx31lite_timer, 288 .timer = &mx31lite_timer,
289 .init_machine = mx31lite_init, 289 .init_machine = mx31lite_init,
290 .restart = mxc_restart,
290MACHINE_END 291MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 93269150309c..b95981dacb2b 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -600,4 +600,5 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
600 .handle_irq = imx31_handle_irq, 600 .handle_irq = imx31_handle_irq,
601 .timer = &mx31moboard_timer, 601 .timer = &mx31moboard_timer,
602 .init_machine = mx31moboard_init, 602 .init_machine = mx31moboard_init,
603 .restart = mxc_restart,
603MACHINE_END 604MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 7a462025a0f7..0af6c9c5b3fd 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -224,4 +224,5 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK")
224 .handle_irq = imx35_handle_irq, 224 .handle_irq = imx35_handle_irq,
225 .timer = &mx35pdk_timer, 225 .timer = &mx35pdk_timer,
226 .init_machine = mx35_3ds_init, 226 .init_machine = mx35_3ds_init,
227 .restart = mxc_restart,
227MACHINE_END 228MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index 125c19643b0f..8b3d3f07d894 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -274,4 +274,5 @@ MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
274 .handle_irq = imx27_handle_irq, 274 .handle_irq = imx27_handle_irq,
275 .timer = &mxt_td60_timer, 275 .timer = &mxt_td60_timer,
276 .init_machine = mxt_td60_board_init, 276 .init_machine = mxt_td60_board_init,
277 .restart = mxc_restart,
277MACHINE_END 278MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index 26072f4b02e3..d3b9c6b5edde 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -442,4 +442,5 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
442 .handle_irq = imx27_handle_irq, 442 .handle_irq = imx27_handle_irq,
443 .init_machine = pca100_init, 443 .init_machine = pca100_init,
444 .timer = &pca100_timer, 444 .timer = &pca100_timer,
445 .restart = mxc_restart,
445MACHINE_END 446MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index efd6b536ef6a..d7e151669ed3 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -696,4 +696,5 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
696 .handle_irq = imx31_handle_irq, 696 .handle_irq = imx31_handle_irq,
697 .timer = &pcm037_timer, 697 .timer = &pcm037_timer,
698 .init_machine = pcm037_init, 698 .init_machine = pcm037_init,
699 .restart = mxc_restart,
699MACHINE_END 700MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index a17e9c7dfca0..16f126da9f8f 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -357,4 +357,5 @@ MACHINE_START(PCM038, "phyCORE-i.MX27")
357 .handle_irq = imx27_handle_irq, 357 .handle_irq = imx27_handle_irq,
358 .timer = &pcm038_timer, 358 .timer = &pcm038_timer,
359 .init_machine = pcm038_init, 359 .init_machine = pcm038_init,
360 .restart = mxc_restart,
360MACHINE_END 361MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 7366c2ae3ea5..06dc106519ae 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -425,4 +425,5 @@ MACHINE_START(PCM043, "Phytec Phycore pcm043")
425 .handle_irq = imx35_handle_irq, 425 .handle_irq = imx35_handle_irq,
426 .timer = &pcm043_timer, 426 .timer = &pcm043_timer,
427 .init_machine = pcm043_init, 427 .init_machine = pcm043_init,
428 .restart = mxc_restart,
428MACHINE_END 429MACHINE_END
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index 4ff5faf102a8..260621055b6b 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -273,4 +273,5 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
273 .handle_irq = imx31_handle_irq, 273 .handle_irq = imx31_handle_irq,
274 .timer = &qong_timer, 274 .timer = &qong_timer,
275 .init_machine = qong_init, 275 .init_machine = qong_init,
276 .restart = mxc_restart,
276MACHINE_END 277MACHINE_END
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index bb6e5b25d8d0..cb9ceae2f648 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -144,4 +144,5 @@ MACHINE_START(SCB9328, "Synertronixx scb9328")
144 .handle_irq = imx1_handle_irq, 144 .handle_irq = imx1_handle_irq,
145 .timer = &scb9328_timer, 145 .timer = &scb9328_timer,
146 .init_machine = scb9328_init, 146 .init_machine = scb9328_init,
147 .restart = mxc_restart,
147MACHINE_END 148MACHINE_END
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 69092458f2d9..033257e553ef 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -322,4 +322,5 @@ MACHINE_START(VPR200, "VPR200")
322 .handle_irq = imx35_handle_irq, 322 .handle_irq = imx35_handle_irq,
323 .timer = &vpr200_timer, 323 .timer = &vpr200_timer,
324 .init_machine = vpr200_board_init, 324 .init_machine = vpr200_board_init,
325 .restart = mxc_restart,
325MACHINE_END 326MACHINE_END
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 9f0e82ec3398..31807d2a8b7b 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -33,29 +33,32 @@
33static void imx3_idle(void) 33static void imx3_idle(void)
34{ 34{
35 unsigned long reg = 0; 35 unsigned long reg = 0;
36 __asm__ __volatile__( 36
37 /* disable I and D cache */ 37 if (!need_resched())
38 "mrc p15, 0, %0, c1, c0, 0\n" 38 __asm__ __volatile__(
39 "bic %0, %0, #0x00001000\n" 39 /* disable I and D cache */
40 "bic %0, %0, #0x00000004\n" 40 "mrc p15, 0, %0, c1, c0, 0\n"
41 "mcr p15, 0, %0, c1, c0, 0\n" 41 "bic %0, %0, #0x00001000\n"
42 /* invalidate I cache */ 42 "bic %0, %0, #0x00000004\n"
43 "mov %0, #0\n" 43 "mcr p15, 0, %0, c1, c0, 0\n"
44 "mcr p15, 0, %0, c7, c5, 0\n" 44 /* invalidate I cache */
45 /* clear and invalidate D cache */ 45 "mov %0, #0\n"
46 "mov %0, #0\n" 46 "mcr p15, 0, %0, c7, c5, 0\n"
47 "mcr p15, 0, %0, c7, c14, 0\n" 47 /* clear and invalidate D cache */
48 /* WFI */ 48 "mov %0, #0\n"
49 "mov %0, #0\n" 49 "mcr p15, 0, %0, c7, c14, 0\n"
50 "mcr p15, 0, %0, c7, c0, 4\n" 50 /* WFI */
51 "nop\n" "nop\n" "nop\n" "nop\n" 51 "mov %0, #0\n"
52 "nop\n" "nop\n" "nop\n" 52 "mcr p15, 0, %0, c7, c0, 4\n"
53 /* enable I and D cache */ 53 "nop\n" "nop\n" "nop\n" "nop\n"
54 "mrc p15, 0, %0, c1, c0, 0\n" 54 "nop\n" "nop\n" "nop\n"
55 "orr %0, %0, #0x00001000\n" 55 /* enable I and D cache */
56 "orr %0, %0, #0x00000004\n" 56 "mrc p15, 0, %0, c1, c0, 0\n"
57 "mcr p15, 0, %0, c1, c0, 0\n" 57 "orr %0, %0, #0x00001000\n"
58 : "=r" (reg)); 58 "orr %0, %0, #0x00000004\n"
59 "mcr p15, 0, %0, c1, c0, 0\n"
60 : "=r" (reg));
61 local_irq_enable();
59} 62}
60 63
61static void __iomem *imx3_ioremap(unsigned long phys_addr, size_t size, 64static void __iomem *imx3_ioremap(unsigned long phys_addr, size_t size,
@@ -108,6 +111,7 @@ void imx3_init_l2x0(void)
108 l2x0_init(l2x0_base, 0x00030024, 0x00000000); 111 l2x0_init(l2x0_base, 0x00030024, 0x00000000);
109} 112}
110 113
114#ifdef CONFIG_SOC_IMX31
111static struct map_desc mx31_io_desc[] __initdata = { 115static struct map_desc mx31_io_desc[] __initdata = {
112 imx_map_entry(MX31, X_MEMC, MT_DEVICE), 116 imx_map_entry(MX31, X_MEMC, MT_DEVICE),
113 imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED), 117 imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED),
@@ -126,33 +130,11 @@ void __init mx31_map_io(void)
126 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc)); 130 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
127} 131}
128 132
129static struct map_desc mx35_io_desc[] __initdata = {
130 imx_map_entry(MX35, X_MEMC, MT_DEVICE),
131 imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED),
132 imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED),
133 imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED),
134 imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED),
135};
136
137void __init mx35_map_io(void)
138{
139 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
140}
141
142void __init imx31_init_early(void) 133void __init imx31_init_early(void)
143{ 134{
144 mxc_set_cpu_type(MXC_CPU_MX31); 135 mxc_set_cpu_type(MXC_CPU_MX31);
145 mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); 136 mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
146 imx_idle = imx3_idle; 137 pm_idle = imx3_idle;
147 imx_ioremap = imx3_ioremap;
148}
149
150void __init imx35_init_early(void)
151{
152 mxc_set_cpu_type(MXC_CPU_MX35);
153 mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
154 mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
155 imx_idle = imx3_idle;
156 imx_ioremap = imx3_ioremap; 138 imx_ioremap = imx3_ioremap;
157} 139}
158 140
@@ -161,11 +143,6 @@ void __init mx31_init_irq(void)
161 mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR)); 143 mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR));
162} 144}
163 145
164void __init mx35_init_irq(void)
165{
166 mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
167}
168
169static struct sdma_script_start_addrs imx31_to1_sdma_script __initdata = { 146static struct sdma_script_start_addrs imx31_to1_sdma_script __initdata = {
170 .per_2_per_addr = 1677, 147 .per_2_per_addr = 1677,
171}; 148};
@@ -199,6 +176,35 @@ void __init imx31_soc_init(void)
199 176
200 imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); 177 imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
201} 178}
179#endif /* ifdef CONFIG_SOC_IMX31 */
180
181#ifdef CONFIG_SOC_IMX35
182static struct map_desc mx35_io_desc[] __initdata = {
183 imx_map_entry(MX35, X_MEMC, MT_DEVICE),
184 imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED),
185 imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED),
186 imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED),
187 imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED),
188};
189
190void __init mx35_map_io(void)
191{
192 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
193}
194
195void __init imx35_init_early(void)
196{
197 mxc_set_cpu_type(MXC_CPU_MX35);
198 mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
199 mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
200 pm_idle = imx3_idle;
201 imx_ioremap = imx3_ioremap;
202}
203
204void __init mx35_init_irq(void)
205{
206 mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
207}
202 208
203static struct sdma_script_start_addrs imx35_to1_sdma_script __initdata = { 209static struct sdma_script_start_addrs imx35_to1_sdma_script __initdata = {
204 .ap_2_ap_addr = 642, 210 .ap_2_ap_addr = 642,
@@ -254,3 +260,4 @@ void __init imx35_soc_init(void)
254 260
255 imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata); 261 imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
256} 262}
263#endif /* ifdef CONFIG_SOC_IMX35 */
diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c
index 36cacbd0dcc2..4bde04f99e38 100644
--- a/arch/arm/mach-imx/src.c
+++ b/arch/arm/mach-imx/src.c
@@ -14,19 +14,26 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_address.h> 16#include <linux/of_address.h>
17#include <linux/smp.h>
17#include <asm/unified.h> 18#include <asm/unified.h>
18 19
19#define SRC_SCR 0x000 20#define SRC_SCR 0x000
20#define SRC_GPR1 0x020 21#define SRC_GPR1 0x020
22#define BP_SRC_SCR_WARM_RESET_ENABLE 0
21#define BP_SRC_SCR_CORE1_RST 14 23#define BP_SRC_SCR_CORE1_RST 14
22#define BP_SRC_SCR_CORE1_ENABLE 22 24#define BP_SRC_SCR_CORE1_ENABLE 22
23 25
24static void __iomem *src_base; 26static void __iomem *src_base;
25 27
28#ifndef CONFIG_SMP
29#define cpu_logical_map(cpu) 0
30#endif
31
26void imx_enable_cpu(int cpu, bool enable) 32void imx_enable_cpu(int cpu, bool enable)
27{ 33{
28 u32 mask, val; 34 u32 mask, val;
29 35
36 cpu = cpu_logical_map(cpu);
30 mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1); 37 mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1);
31 val = readl_relaxed(src_base + SRC_SCR); 38 val = readl_relaxed(src_base + SRC_SCR);
32 val = enable ? val | mask : val & ~mask; 39 val = enable ? val | mask : val & ~mask;
@@ -35,15 +42,38 @@ void imx_enable_cpu(int cpu, bool enable)
35 42
36void imx_set_cpu_jump(int cpu, void *jump_addr) 43void imx_set_cpu_jump(int cpu, void *jump_addr)
37{ 44{
45 cpu = cpu_logical_map(cpu);
38 writel_relaxed(BSYM(virt_to_phys(jump_addr)), 46 writel_relaxed(BSYM(virt_to_phys(jump_addr)),
39 src_base + SRC_GPR1 + cpu * 8); 47 src_base + SRC_GPR1 + cpu * 8);
40} 48}
41 49
50void imx_src_prepare_restart(void)
51{
52 u32 val;
53
54 /* clear enable bits of secondary cores */
55 val = readl_relaxed(src_base + SRC_SCR);
56 val &= ~(0x7 << BP_SRC_SCR_CORE1_ENABLE);
57 writel_relaxed(val, src_base + SRC_SCR);
58
59 /* clear persistent entry register of primary core */
60 writel_relaxed(0, src_base + SRC_GPR1);
61}
62
42void __init imx_src_init(void) 63void __init imx_src_init(void)
43{ 64{
44 struct device_node *np; 65 struct device_node *np;
66 u32 val;
45 67
46 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-src"); 68 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-src");
47 src_base = of_iomap(np, 0); 69 src_base = of_iomap(np, 0);
48 WARN_ON(!src_base); 70 WARN_ON(!src_base);
71
72 /*
73 * force warm reset sources to generate cold reset
74 * for a more reliable restart
75 */
76 val = readl_relaxed(src_base + SRC_SCR);
77 val &= ~(1 << BP_SRC_SCR_WARM_RESET_ENABLE);
78 writel_relaxed(val, src_base + SRC_SCR);
49} 79}
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index dfd18f3b50e8..350e26636a06 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -6,6 +6,8 @@ config ARCH_INTEGRATOR_AP
6 bool "Support Integrator/AP and Integrator/PP2 platforms" 6 bool "Support Integrator/AP and Integrator/PP2 platforms"
7 select CLKSRC_MMIO 7 select CLKSRC_MMIO
8 select MIGHT_HAVE_PCI 8 select MIGHT_HAVE_PCI
9 select SERIAL_AMBA_PL010
10 select SERIAL_AMBA_PL010_CONSOLE
9 help 11 help
10 Include support for the ARM(R) Integrator/AP and 12 Include support for the ARM(R) Integrator/AP and
11 Integrator/PP2 platforms. 13 Integrator/PP2 platforms.
@@ -15,6 +17,8 @@ config ARCH_INTEGRATOR_CP
15 select ARCH_CINTEGRATOR 17 select ARCH_CINTEGRATOR
16 select ARM_TIMER_SP804 18 select ARM_TIMER_SP804
17 select PLAT_VERSATILE_CLCD 19 select PLAT_VERSATILE_CLCD
20 select SERIAL_AMBA_PL011
21 select SERIAL_AMBA_PL011_CONSOLE
18 help 22 help
19 Include support for the ARM(R) Integrator CP platform. 23 Include support for the ARM(R) Integrator CP platform.
20 24
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h
index a08f9b0299df..899561d8db28 100644
--- a/arch/arm/mach-integrator/common.h
+++ b/arch/arm/mach-integrator/common.h
@@ -1,2 +1,3 @@
1void integrator_init_early(void); 1void integrator_init_early(void);
2void integrator_reserve(void); 2void integrator_reserve(void);
3void integrator_restart(char, const char *);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 4b38e13667ac..019f0ab08f66 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -29,6 +29,7 @@
29#include <mach/cm.h> 29#include <mach/cm.h>
30#include <asm/system.h> 30#include <asm/system.h>
31#include <asm/leds.h> 31#include <asm/leds.h>
32#include <asm/mach-types.h>
32#include <asm/mach/time.h> 33#include <asm/mach/time.h>
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
34 35
@@ -44,7 +45,6 @@ static struct amba_device rtc_device = {
44 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
45 }, 46 },
46 .irq = { IRQ_RTCINT, NO_IRQ }, 47 .irq = { IRQ_RTCINT, NO_IRQ },
47 .periphid = 0x00041030,
48}; 48};
49 49
50static struct amba_device uart0_device = { 50static struct amba_device uart0_device = {
@@ -58,7 +58,6 @@ static struct amba_device uart0_device = {
58 .flags = IORESOURCE_MEM, 58 .flags = IORESOURCE_MEM,
59 }, 59 },
60 .irq = { IRQ_UARTINT0, NO_IRQ }, 60 .irq = { IRQ_UARTINT0, NO_IRQ },
61 .periphid = 0x0041010,
62}; 61};
63 62
64static struct amba_device uart1_device = { 63static struct amba_device uart1_device = {
@@ -72,7 +71,6 @@ static struct amba_device uart1_device = {
72 .flags = IORESOURCE_MEM, 71 .flags = IORESOURCE_MEM,
73 }, 72 },
74 .irq = { IRQ_UARTINT1, NO_IRQ }, 73 .irq = { IRQ_UARTINT1, NO_IRQ },
75 .periphid = 0x0041010,
76}; 74};
77 75
78static struct amba_device kmi0_device = { 76static struct amba_device kmi0_device = {
@@ -85,7 +83,6 @@ static struct amba_device kmi0_device = {
85 .flags = IORESOURCE_MEM, 83 .flags = IORESOURCE_MEM,
86 }, 84 },
87 .irq = { IRQ_KMIINT0, NO_IRQ }, 85 .irq = { IRQ_KMIINT0, NO_IRQ },
88 .periphid = 0x00041050,
89}; 86};
90 87
91static struct amba_device kmi1_device = { 88static struct amba_device kmi1_device = {
@@ -98,7 +95,6 @@ static struct amba_device kmi1_device = {
98 .flags = IORESOURCE_MEM, 95 .flags = IORESOURCE_MEM,
99 }, 96 },
100 .irq = { IRQ_KMIINT1, NO_IRQ }, 97 .irq = { IRQ_KMIINT1, NO_IRQ },
101 .periphid = 0x00041050,
102}; 98};
103 99
104static struct amba_device *amba_devs[] __initdata = { 100static struct amba_device *amba_devs[] __initdata = {
@@ -157,6 +153,19 @@ static int __init integrator_init(void)
157{ 153{
158 int i; 154 int i;
159 155
156 /*
157 * The Integrator/AP lacks necessary AMBA PrimeCell IDs, so we need to
158 * hard-code them. The Integator/CP and forward have proper cell IDs.
159 * Else we leave them undefined to the bus driver can autoprobe them.
160 */
161 if (machine_is_integrator()) {
162 rtc_device.periphid = 0x00041030;
163 uart0_device.periphid = 0x00041010;
164 uart1_device.periphid = 0x00041010;
165 kmi0_device.periphid = 0x00041050;
166 kmi1_device.periphid = 0x00041050;
167 }
168
160 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 169 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
161 struct amba_device *d = amba_devs[i]; 170 struct amba_device *d = amba_devs[i];
162 amba_device_register(d, &iomem_resource); 171 amba_device_register(d, &iomem_resource);
@@ -238,3 +247,11 @@ void __init integrator_reserve(void)
238{ 247{
239 memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET); 248 memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
240} 249}
250
251/*
252 * To reset, we hit the on-board reset register in the system FPGA
253 */
254void integrator_restart(char mode, const char *cmd)
255{
256 cm_control(CM_CTRL_RESET, CM_CTRL_RESET);
257}
diff --git a/arch/arm/mach-integrator/include/mach/system.h b/arch/arm/mach-integrator/include/mach/system.h
index e1551b8dab77..901514eba4a6 100644
--- a/arch/arm/mach-integrator/include/mach/system.h
+++ b/arch/arm/mach-integrator/include/mach/system.h
@@ -21,8 +21,6 @@
21#ifndef __ASM_ARCH_SYSTEM_H 21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H 22#define __ASM_ARCH_SYSTEM_H
23 23
24#include <mach/cm.h>
25
26static inline void arch_idle(void) 24static inline void arch_idle(void)
27{ 25{
28 /* 26 /*
@@ -32,13 +30,4 @@ static inline void arch_idle(void)
32 cpu_do_idle(); 30 cpu_do_idle();
33} 31}
34 32
35static inline void arch_reset(char mode, const char *cmd)
36{
37 /*
38 * To reset, we hit the on-board reset register
39 * in the system FPGA
40 */
41 cm_control(CM_CTRL_RESET, CM_CTRL_RESET);
42}
43
44#endif 33#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
index 2f5a2bafb11f..000000000000
--- a/arch/arm/mach-integrator/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-integrator/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END 0xd0000000UL
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index a1769f35a86e..21a1d6cbef40 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -472,4 +472,5 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
472 .init_irq = ap_init_irq, 472 .init_irq = ap_init_irq,
473 .timer = &ap_timer, 473 .timer = &ap_timer,
474 .init_machine = ap_init, 474 .init_machine = ap_init,
475 .restart = integrator_restart,
475MACHINE_END 476MACHINE_END
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 5de49c33e4d4..a8b6aa6003f3 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -14,7 +14,7 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/amba/bus.h> 18#include <linux/amba/bus.h>
19#include <linux/amba/kmi.h> 19#include <linux/amba/kmi.h>
20#include <linux/amba/clcd.h> 20#include <linux/amba/clcd.h>
@@ -499,4 +499,5 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
499 .init_irq = intcp_init_irq, 499 .init_irq = intcp_init_irq,
500 .timer = &cp_timer, 500 .timer = &cp_timer,
501 .init_machine = intcp_init, 501 .init_machine = intcp_init,
502 .restart = integrator_restart,
502MACHINE_END 503MACHINE_END
diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
index 52b7fab7ef60..07e9ff7adafb 100644
--- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h
+++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
@@ -10,6 +10,7 @@ void iop13xx_map_io(void);
10void iop13xx_platform_init(void); 10void iop13xx_platform_init(void);
11void iop13xx_add_tpmi_devices(void); 11void iop13xx_add_tpmi_devices(void);
12void iop13xx_init_irq(void); 12void iop13xx_init_irq(void);
13void iop13xx_restart(char, const char *);
13 14
14/* CPUID CP6 R0 Page 0 */ 15/* CPUID CP6 R0 Page 0 */
15static inline int iop13xx_cpu_id(void) 16static inline int iop13xx_cpu_id(void)
diff --git a/arch/arm/mach-iop13xx/include/mach/system.h b/arch/arm/mach-iop13xx/include/mach/system.h
index d0c66ef450a7..1f31ed3f8ae2 100644
--- a/arch/arm/mach-iop13xx/include/mach/system.h
+++ b/arch/arm/mach-iop13xx/include/mach/system.h
@@ -7,21 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <mach/iop13xx.h>
11static inline void arch_idle(void) 10static inline void arch_idle(void)
12{ 11{
13 cpu_do_idle(); 12 cpu_do_idle();
14} 13}
15
16static inline void arch_reset(char mode, const char *cmd)
17{
18 /*
19 * Reset the internal bus (warning both cores are reset)
20 */
21 write_wdtcr(IOP_WDTCR_EN_ARM);
22 write_wdtcr(IOP_WDTCR_EN);
23 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
24 write_wdtcr(0x1000);
25
26 for(;;);
27}
diff --git a/arch/arm/mach-iop13xx/include/mach/vmalloc.h b/arch/arm/mach-iop13xx/include/mach/vmalloc.h
deleted file mode 100644
index c53456740345..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef _VMALLOC_H_
2#define _VMALLOC_H_
3#define VMALLOC_END 0xfa000000UL
4#endif
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index 4cf2cc477eae..abaee8833588 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -96,4 +96,5 @@ MACHINE_START(IQ81340MC, "Intel IQ81340MC")
96 .init_irq = iop13xx_init_irq, 96 .init_irq = iop13xx_init_irq,
97 .timer = &iq81340mc_timer, 97 .timer = &iq81340mc_timer,
98 .init_machine = iq81340mc_init, 98 .init_machine = iq81340mc_init,
99 .restart = iop13xx_restart,
99MACHINE_END 100MACHINE_END
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index cd9e27499a1e..690916a09dc6 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -98,4 +98,5 @@ MACHINE_START(IQ81340SC, "Intel IQ81340SC")
98 .init_irq = iop13xx_init_irq, 98 .init_irq = iop13xx_init_irq,
99 .timer = &iq81340sc_timer, 99 .timer = &iq81340sc_timer,
100 .init_machine = iq81340sc_init, 100 .init_machine = iq81340sc_init,
101 .restart = iop13xx_restart,
101MACHINE_END 102MACHINE_END
diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
index a5b989728b9e..daabb1fa6c2c 100644
--- a/arch/arm/mach-iop13xx/setup.c
+++ b/arch/arm/mach-iop13xx/setup.c
@@ -606,3 +606,14 @@ static int __init iop13xx_init_adma_setup(char *str)
606__setup("iop13xx_init_adma", iop13xx_init_adma_setup); 606__setup("iop13xx_init_adma", iop13xx_init_adma_setup);
607__setup("iop13xx_init_uart", iop13xx_init_uart_setup); 607__setup("iop13xx_init_uart", iop13xx_init_uart_setup);
608__setup("iop13xx_init_i2c", iop13xx_init_i2c_setup); 608__setup("iop13xx_init_i2c", iop13xx_init_i2c_setup);
609
610void iop13xx_restart(char mode, const char *cmd)
611{
612 /*
613 * Reset the internal bus (warning both cores are reset)
614 */
615 write_wdtcr(IOP_WDTCR_EN_ARM);
616 write_wdtcr(IOP_WDTCR_EN);
617 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
618 write_wdtcr(0x1000);
619}
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
index 4325055d4e19..24069e03fdc1 100644
--- a/arch/arm/mach-iop32x/em7210.c
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -208,4 +208,5 @@ MACHINE_START(EM7210, "Lanner EM7210")
208 .init_irq = iop32x_init_irq, 208 .init_irq = iop32x_init_irq,
209 .timer = &em7210_timer, 209 .timer = &em7210_timer,
210 .init_machine = em7210_init_machine, 210 .init_machine = em7210_init_machine,
211 .restart = iop3xx_restart,
211MACHINE_END 212MACHINE_END
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index 0edc88020577..204e1d1cd766 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -212,4 +212,5 @@ MACHINE_START(GLANTANK, "GLAN Tank")
212 .init_irq = iop32x_init_irq, 212 .init_irq = iop32x_init_irq,
213 .timer = &glantank_timer, 213 .timer = &glantank_timer,
214 .init_machine = glantank_init_machine, 214 .init_machine = glantank_init_machine,
215 .restart = iop3xx_restart,
215MACHINE_END 216MACHINE_END
diff --git a/arch/arm/mach-iop32x/include/mach/io.h b/arch/arm/mach-iop32x/include/mach/io.h
index 059c783ce0b2..2d88264b9863 100644
--- a/arch/arm/mach-iop32x/include/mach/io.h
+++ b/arch/arm/mach-iop32x/include/mach/io.h
@@ -13,15 +13,8 @@
13 13
14#include <asm/hardware/iop3xx.h> 14#include <asm/hardware/iop3xx.h>
15 15
16extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
17 unsigned int mtype);
18extern void __iop3xx_iounmap(void __iomem *addr);
19
20#define IO_SPACE_LIMIT 0xffffffff 16#define IO_SPACE_LIMIT 0xffffffff
21#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) 17#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
22#define __mem_pci(a) (a) 18#define __mem_pci(a) (a)
23 19
24#define __arch_ioremap __iop3xx_ioremap
25#define __arch_iounmap __iop3xx_iounmap
26
27#endif 20#endif
diff --git a/arch/arm/mach-iop32x/include/mach/system.h b/arch/arm/mach-iop32x/include/mach/system.h
index a4b808fe0d81..4a88727bca98 100644
--- a/arch/arm/mach-iop32x/include/mach/system.h
+++ b/arch/arm/mach-iop32x/include/mach/system.h
@@ -7,28 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <asm/mach-types.h>
11#include <asm/hardware/iop3xx.h>
12#include <mach/n2100.h>
13
14static inline void arch_idle(void) 10static inline void arch_idle(void)
15{ 11{
16 cpu_do_idle(); 12 cpu_do_idle();
17} 13}
18
19static inline void arch_reset(char mode, const char *cmd)
20{
21 local_irq_disable();
22
23 if (machine_is_n2100()) {
24 gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW);
25 gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT);
26 while (1)
27 ;
28 }
29
30 *IOP3XX_PCSR = 0x30;
31
32 /* Jump into ROM at address 0 */
33 cpu_reset(0);
34}
diff --git a/arch/arm/mach-iop32x/include/mach/vmalloc.h b/arch/arm/mach-iop32x/include/mach/vmalloc.h
deleted file mode 100644
index c4862d48e583..000000000000
--- a/arch/arm/mach-iop32x/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-iop32x/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index 9e7aaccfeba0..3eb642af1cdc 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -318,6 +318,7 @@ MACHINE_START(IQ31244, "Intel IQ31244")
318 .init_irq = iop32x_init_irq, 318 .init_irq = iop32x_init_irq,
319 .timer = &iq31244_timer, 319 .timer = &iq31244_timer,
320 .init_machine = iq31244_init_machine, 320 .init_machine = iq31244_init_machine,
321 .restart = iop3xx_restart,
321MACHINE_END 322MACHINE_END
322 323
323/* There should have been an ep80219 machine identifier from the beginning. 324/* There should have been an ep80219 machine identifier from the beginning.
@@ -332,4 +333,5 @@ MACHINE_START(EP80219, "Intel EP80219")
332 .init_irq = iop32x_init_irq, 333 .init_irq = iop32x_init_irq,
333 .timer = &iq31244_timer, 334 .timer = &iq31244_timer,
334 .init_machine = iq31244_init_machine, 335 .init_machine = iq31244_init_machine,
336 .restart = iop3xx_restart,
335MACHINE_END 337MACHINE_END
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index 53ea86f649dd..2ec724b58a2c 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -191,4 +191,5 @@ MACHINE_START(IQ80321, "Intel IQ80321")
191 .init_irq = iop32x_init_irq, 191 .init_irq = iop32x_init_irq,
192 .timer = &iq80321_timer, 192 .timer = &iq80321_timer,
193 .init_machine = iq80321_init_machine, 193 .init_machine = iq80321_init_machine,
194 .restart = iop3xx_restart,
194MACHINE_END 195MACHINE_END
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index d7269279968c..6b6d55912444 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -291,6 +291,14 @@ static void n2100_power_off(void)
291 ; 291 ;
292} 292}
293 293
294static void n2100_restart(char mode, const char *cmd)
295{
296 gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW);
297 gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT);
298 while (1)
299 ;
300}
301
294 302
295static struct timer_list power_button_poll_timer; 303static struct timer_list power_button_poll_timer;
296 304
@@ -332,4 +340,5 @@ MACHINE_START(N2100, "Thecus N2100")
332 .init_irq = iop32x_init_irq, 340 .init_irq = iop32x_init_irq,
333 .timer = &n2100_timer, 341 .timer = &n2100_timer,
334 .init_machine = n2100_init_machine, 342 .init_machine = n2100_init_machine,
343 .restart = n2100_restart,
335MACHINE_END 344MACHINE_END
diff --git a/arch/arm/mach-iop33x/include/mach/io.h b/arch/arm/mach-iop33x/include/mach/io.h
index 39e893e97c21..a8a66fc8fbdb 100644
--- a/arch/arm/mach-iop33x/include/mach/io.h
+++ b/arch/arm/mach-iop33x/include/mach/io.h
@@ -13,15 +13,8 @@
13 13
14#include <asm/hardware/iop3xx.h> 14#include <asm/hardware/iop3xx.h>
15 15
16extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
17 unsigned int mtype);
18extern void __iop3xx_iounmap(void __iomem *addr);
19
20#define IO_SPACE_LIMIT 0xffffffff 16#define IO_SPACE_LIMIT 0xffffffff
21#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) 17#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
22#define __mem_pci(a) (a) 18#define __mem_pci(a) (a)
23 19
24#define __arch_ioremap __iop3xx_ioremap
25#define __arch_iounmap __iop3xx_iounmap
26
27#endif 20#endif
diff --git a/arch/arm/mach-iop33x/include/mach/system.h b/arch/arm/mach-iop33x/include/mach/system.h
index f192a34be073..4f98e765397c 100644
--- a/arch/arm/mach-iop33x/include/mach/system.h
+++ b/arch/arm/mach-iop33x/include/mach/system.h
@@ -7,17 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <asm/hardware/iop3xx.h>
11
12static inline void arch_idle(void) 10static inline void arch_idle(void)
13{ 11{
14 cpu_do_idle(); 12 cpu_do_idle();
15} 13}
16
17static inline void arch_reset(char mode, const char *cmd)
18{
19 *IOP3XX_PCSR = 0x30;
20
21 /* Jump into ROM at address 0 */
22 cpu_reset(0);
23}
diff --git a/arch/arm/mach-iop33x/include/mach/vmalloc.h b/arch/arm/mach-iop33x/include/mach/vmalloc.h
deleted file mode 100644
index 48331dc23704..000000000000
--- a/arch/arm/mach-iop33x/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-iop33x/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index 9e14ccc56f8e..abce934f3816 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -146,4 +146,5 @@ MACHINE_START(IQ80331, "Intel IQ80331")
146 .init_irq = iop33x_init_irq, 146 .init_irq = iop33x_init_irq,
147 .timer = &iq80331_timer, 147 .timer = &iq80331_timer,
148 .init_machine = iq80331_init_machine, 148 .init_machine = iq80331_init_machine,
149 .restart = iop3xx_restart,
149MACHINE_END 150MACHINE_END
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index 09c899a2523f..7513559e25bb 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -146,4 +146,5 @@ MACHINE_START(IQ80332, "Intel IQ80332")
146 .init_irq = iop33x_init_irq, 146 .init_irq = iop33x_init_irq,
147 .timer = &iq80332_timer, 147 .timer = &iq80332_timer,
148 .init_machine = iq80332_init_machine, 148 .init_machine = iq80332_init_machine,
149 .restart = iop3xx_restart,
149MACHINE_END 150MACHINE_END
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 24f0fe35f4ad..81c45370a4e6 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -515,3 +515,7 @@ void __init ixp2000_init_irq(void)
515 } 515 }
516} 516}
517 517
518void ixp2000_restart(char mode, const char *cmd)
519{
520 ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
521}
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index af9994537e01..ee525416f0d2 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -259,6 +259,7 @@ MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
259 .init_irq = ixp2000_init_irq, 259 .init_irq = ixp2000_init_irq,
260 .timer = &enp2611_timer, 260 .timer = &enp2611_timer,
261 .init_machine = enp2611_init_machine, 261 .init_machine = enp2611_init_machine,
262 .restart = ixp2000_restart,
262MACHINE_END 263MACHINE_END
263 264
264 265
diff --git a/arch/arm/mach-ixp2000/include/mach/platform.h b/arch/arm/mach-ixp2000/include/mach/platform.h
index 42182c79ed90..bb0f8dcf9ee1 100644
--- a/arch/arm/mach-ixp2000/include/mach/platform.h
+++ b/arch/arm/mach-ixp2000/include/mach/platform.h
@@ -122,6 +122,7 @@ void ixp2000_map_io(void);
122void ixp2000_uart_init(void); 122void ixp2000_uart_init(void);
123void ixp2000_init_irq(void); 123void ixp2000_init_irq(void);
124void ixp2000_init_time(unsigned long); 124void ixp2000_init_time(unsigned long);
125void ixp2000_restart(char, const char *);
125unsigned long ixp2000_gettimeoffset(void); 126unsigned long ixp2000_gettimeoffset(void);
126 127
127struct pci_sys_data; 128struct pci_sys_data;
diff --git a/arch/arm/mach-ixp2000/include/mach/system.h b/arch/arm/mach-ixp2000/include/mach/system.h
index de370992c848..a7fb08b2b8e7 100644
--- a/arch/arm/mach-ixp2000/include/mach/system.h
+++ b/arch/arm/mach-ixp2000/include/mach/system.h
@@ -8,42 +8,7 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11
12#include <mach/hardware.h>
13#include <asm/mach-types.h>
14
15static inline void arch_idle(void) 11static inline void arch_idle(void)
16{ 12{
17 cpu_do_idle(); 13 cpu_do_idle();
18} 14}
19
20static inline void arch_reset(char mode, const char *cmd)
21{
22 local_irq_disable();
23
24 /*
25 * Reset flash banking register so that we are pointing at
26 * RedBoot bank.
27 */
28 if (machine_is_ixdp2401()) {
29 ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
30 ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
31 | IXDP2X01_CPLD_FLASH_INTERN));
32 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
33 }
34
35 /*
36 * On IXDP2801 we need to write this magic sequence to the CPLD
37 * to cause a complete reset of the CPU and all external devices
38 * and move the flash bank register back to 0.
39 */
40 if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
41 unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
42
43 reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
44 ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
45 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
46 }
47
48 ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
49}
diff --git a/arch/arm/mach-ixp2000/include/mach/vmalloc.h b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
deleted file mode 100644
index 61c8dae24f95..000000000000
--- a/arch/arm/mach-ixp2000/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-ixp2000/include/mach/vmalloc.h
3 *
4 * Author: Naeem Afzal <naeem.m.afzal@intel.com>
5 *
6 * Copyright 2002 Intel Corp.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * Just any arbitrary offset to the start of the vmalloc VM area: the
14 * current 8MB value just means that there will be a 8MB "hole" after the
15 * physical memory until the kernel virtual memory starts. That means that
16 * any out-of-bounds memory accesses will hopefully be caught.
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;)
19 */
20#define VMALLOC_END 0xfb000000UL
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index f7dfd9700141..f53e911ec94a 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -176,5 +176,6 @@ MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
176 .init_irq = ixdp2400_init_irq, 176 .init_irq = ixdp2400_init_irq,
177 .timer = &ixdp2400_timer, 177 .timer = &ixdp2400_timer,
178 .init_machine = ixdp2x00_init_machine, 178 .init_machine = ixdp2x00_init_machine,
179 .restart = ixp2000_restart,
179MACHINE_END 180MACHINE_END
180 181
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index d33bcac1ec92..a2e7c393e74f 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -291,5 +291,6 @@ MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
291 .init_irq = ixdp2800_init_irq, 291 .init_irq = ixdp2800_init_irq,
292 .timer = &ixdp2800_timer, 292 .timer = &ixdp2800_timer,
293 .init_machine = ixdp2x00_init_machine, 293 .init_machine = ixdp2x00_init_machine,
294 .restart = ixp2000_restart,
294MACHINE_END 295MACHINE_END
295 296
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index 61a28676b5be..7632beadabf6 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -413,6 +413,35 @@ static void __init ixdp2x01_init_machine(void)
413 ixdp2x01_uart_init(); 413 ixdp2x01_uart_init();
414} 414}
415 415
416static void ixdp2401_restart(char mode, const char *cmd)
417{
418 /*
419 * Reset flash banking register so that we are pointing at
420 * RedBoot bank.
421 */
422 ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
423 ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
424 | IXDP2X01_CPLD_FLASH_INTERN));
425 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
426
427 ixp2000_restart(mode, cmd);
428}
429
430static void ixdp280x_restart(char mode, const char *cmd)
431{
432 /*
433 * On IXDP2801 we need to write this magic sequence to the CPLD
434 * to cause a complete reset of the CPU and all external devices
435 * and move the flash bank register back to 0.
436 */
437 unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
438
439 reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
440 ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
441 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
442
443 ixp2000_restart(mode, cmd);
444}
416 445
417#ifdef CONFIG_ARCH_IXDP2401 446#ifdef CONFIG_ARCH_IXDP2401
418MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform") 447MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
@@ -422,6 +451,7 @@ MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
422 .init_irq = ixdp2x01_init_irq, 451 .init_irq = ixdp2x01_init_irq,
423 .timer = &ixdp2x01_timer, 452 .timer = &ixdp2x01_timer,
424 .init_machine = ixdp2x01_init_machine, 453 .init_machine = ixdp2x01_init_machine,
454 .restart = ixdp2401_restart,
425MACHINE_END 455MACHINE_END
426#endif 456#endif
427 457
@@ -433,6 +463,7 @@ MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
433 .init_irq = ixdp2x01_init_irq, 463 .init_irq = ixdp2x01_init_irq,
434 .timer = &ixdp2x01_timer, 464 .timer = &ixdp2x01_timer,
435 .init_machine = ixdp2x01_init_machine, 465 .init_machine = ixdp2x01_init_machine,
466 .restart = ixdp280x_restart,
436MACHINE_END 467MACHINE_END
437 468
438/* 469/*
@@ -446,6 +477,7 @@ MACHINE_START(IXDP28X5, "Intel IXDP2805/2855 Development Platform")
446 .init_irq = ixdp2x01_init_irq, 477 .init_irq = ixdp2x01_init_irq,
447 .timer = &ixdp2x01_timer, 478 .timer = &ixdp2x01_timer,
448 .init_machine = ixdp2x01_init_machine, 479 .init_machine = ixdp2x01_init_machine,
480 .restart = ixdp280x_restart,
449MACHINE_END 481MACHINE_END
450#endif 482#endif
451 483
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
index a1bee33d183e..0923bb905cc0 100644
--- a/arch/arm/mach-ixp23xx/core.c
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -444,3 +444,9 @@ void __init ixp23xx_sys_init(void)
444 *IXP23XX_EXP_UNIT_FUSE |= 0xf; 444 *IXP23XX_EXP_UNIT_FUSE |= 0xf;
445 platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices)); 445 platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices));
446} 446}
447
448void ixp23xx_restart(char mode, const char *cmd)
449{
450 /* Use on-chip reset capability */
451 *IXP23XX_RESET0 |= IXP23XX_RST_ALL;
452}
diff --git a/arch/arm/mach-ixp23xx/espresso.c b/arch/arm/mach-ixp23xx/espresso.c
index 30dd31652e9d..8f2487e1fc4e 100644
--- a/arch/arm/mach-ixp23xx/espresso.c
+++ b/arch/arm/mach-ixp23xx/espresso.c
@@ -90,4 +90,5 @@ MACHINE_START(ESPRESSO, "IP Fabrics Double Espresso")
90 .timer = &ixp23xx_timer, 90 .timer = &ixp23xx_timer,
91 .atag_offset = 0x100, 91 .atag_offset = 0x100,
92 .init_machine = espresso_init, 92 .init_machine = espresso_init,
93 .restart = ixp23xx_restart,
93MACHINE_END 94MACHINE_END
diff --git a/arch/arm/mach-ixp23xx/include/mach/io.h b/arch/arm/mach-ixp23xx/include/mach/io.h
index a1749d0fd896..4ce4353b9f72 100644
--- a/arch/arm/mach-ixp23xx/include/mach/io.h
+++ b/arch/arm/mach-ixp23xx/include/mach/io.h
@@ -20,33 +20,4 @@
20#define __io(p) ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT)) 20#define __io(p) ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
21#define __mem_pci(a) (a) 21#define __mem_pci(a) (a)
22 22
23static inline void __iomem *
24ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)
25{
26 if (addr >= IXP23XX_PCI_MEM_START &&
27 addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) {
28 if (addr + size > IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE)
29 return NULL;
30
31 return (void __iomem *)
32 ((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT);
33 }
34
35 return __arm_ioremap(addr, size, mtype);
36}
37
38static inline void
39ixp23xx_iounmap(void __iomem *addr)
40{
41 if ((((u32)addr) >= IXP23XX_PCI_MEM_VIRT) &&
42 (((u32)addr) < IXP23XX_PCI_MEM_VIRT + IXP23XX_PCI_MEM_SIZE))
43 return;
44
45 __iounmap(addr);
46}
47
48#define __arch_ioremap ixp23xx_ioremap
49#define __arch_iounmap ixp23xx_iounmap
50
51
52#endif 23#endif
diff --git a/arch/arm/mach-ixp23xx/include/mach/platform.h b/arch/arm/mach-ixp23xx/include/mach/platform.h
index db9d9416e5e4..50de558e722e 100644
--- a/arch/arm/mach-ixp23xx/include/mach/platform.h
+++ b/arch/arm/mach-ixp23xx/include/mach/platform.h
@@ -34,6 +34,7 @@ struct pci_sys_data;
34void ixp23xx_map_io(void); 34void ixp23xx_map_io(void);
35void ixp23xx_init_irq(void); 35void ixp23xx_init_irq(void);
36void ixp23xx_sys_init(void); 36void ixp23xx_sys_init(void);
37void ixp23xx_restart(char, const char *);
37int ixp23xx_pci_setup(int, struct pci_sys_data *); 38int ixp23xx_pci_setup(int, struct pci_sys_data *);
38void ixp23xx_pci_preinit(void); 39void ixp23xx_pci_preinit(void);
39struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); 40struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*);
diff --git a/arch/arm/mach-ixp23xx/include/mach/system.h b/arch/arm/mach-ixp23xx/include/mach/system.h
index 8920ff2dff1f..277dda7334b9 100644
--- a/arch/arm/mach-ixp23xx/include/mach/system.h
+++ b/arch/arm/mach-ixp23xx/include/mach/system.h
@@ -7,10 +7,6 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10
11#include <mach/hardware.h>
12#include <asm/mach-types.h>
13
14static inline void arch_idle(void) 10static inline void arch_idle(void)
15{ 11{
16#if 0 12#if 0
@@ -18,16 +14,3 @@ static inline void arch_idle(void)
18 cpu_do_idle(); 14 cpu_do_idle();
19#endif 15#endif
20} 16}
21
22static inline void arch_reset(char mode, const char *cmd)
23{
24 /* First try machine specific support */
25 if (machine_is_ixdp2351()) {
26 *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
27 (void) *IXDP2351_CPLD_RESET1_REG;
28 *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;
29 }
30
31 /* Use on-chip reset capability */
32 *IXP23XX_RESET0 |= IXP23XX_RST_ALL;
33}
diff --git a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
deleted file mode 100644
index 896c56a1c00e..000000000000
--- a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * arch/arm/mach-ixp23xx/include/mach/vmalloc.h
3 *
4 * Copyright (c) 2005 MontaVista Software, Inc.
5 *
6 * NPU mappings end at 0xf0000000 and we allocate 64MB for board
7 * specific static I/O.
8 */
9
10#define VMALLOC_END (0xec000000UL)
diff --git a/arch/arm/mach-ixp23xx/ixdp2351.c b/arch/arm/mach-ixp23xx/ixdp2351.c
index b3a57e0f3419..5d5dd3e8d069 100644
--- a/arch/arm/mach-ixp23xx/ixdp2351.c
+++ b/arch/arm/mach-ixp23xx/ixdp2351.c
@@ -326,6 +326,17 @@ static void __init ixdp2351_init(void)
326 ixp23xx_sys_init(); 326 ixp23xx_sys_init();
327} 327}
328 328
329static void ixdp2351_restart(char mode, const char *cmd)
330{
331 /* First try machine specific support */
332
333 *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
334 (void) *IXDP2351_CPLD_RESET1_REG;
335 *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;
336
337 ixp23xx_restart(mode, cmd);
338}
339
329MACHINE_START(IXDP2351, "Intel IXDP2351 Development Platform") 340MACHINE_START(IXDP2351, "Intel IXDP2351 Development Platform")
330 /* Maintainer: MontaVista Software, Inc. */ 341 /* Maintainer: MontaVista Software, Inc. */
331 .map_io = ixdp2351_map_io, 342 .map_io = ixdp2351_map_io,
@@ -333,4 +344,5 @@ MACHINE_START(IXDP2351, "Intel IXDP2351 Development Platform")
333 .timer = &ixp23xx_timer, 344 .timer = &ixp23xx_timer,
334 .atag_offset = 0x100, 345 .atag_offset = 0x100,
335 .init_machine = ixdp2351_init, 346 .init_machine = ixdp2351_init,
347 .restart = ixdp2351_restart,
336MACHINE_END 348MACHINE_END
diff --git a/arch/arm/mach-ixp23xx/roadrunner.c b/arch/arm/mach-ixp23xx/roadrunner.c
index 8f4dcbba9025..377283fc658c 100644
--- a/arch/arm/mach-ixp23xx/roadrunner.c
+++ b/arch/arm/mach-ixp23xx/roadrunner.c
@@ -177,4 +177,5 @@ MACHINE_START(ROADRUNNER, "ADI Engineering RoadRunner Development Platform")
177 .timer = &ixp23xx_timer, 177 .timer = &ixp23xx_timer,
178 .atag_offset = 0x100, 178 .atag_offset = 0x100,
179 .init_machine = roadrunner_init, 179 .init_machine = roadrunner_init,
180 .restart = ixp23xx_restart,
180MACHINE_END 181MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c
index 37609a22c450..a7277ad470a5 100644
--- a/arch/arm/mach-ixp4xx/avila-setup.c
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
@@ -172,6 +172,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform")
172#if defined(CONFIG_PCI) 172#if defined(CONFIG_PCI)
173 .dma_zone_size = SZ_64M, 173 .dma_zone_size = SZ_64M,
174#endif 174#endif
175 .restart = ixp4xx_restart,
175MACHINE_END 176MACHINE_END
176 177
177 /* 178 /*
@@ -190,6 +191,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
190#if defined(CONFIG_PCI) 191#if defined(CONFIG_PCI)
191 .dma_zone_size = SZ_64M, 192 .dma_zone_size = SZ_64M,
192#endif 193#endif
194 .restart = ixp4xx_restart,
193MACHINE_END 195MACHINE_END
194#endif 196#endif
195 197
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index b86a0055ab96..3841ab4146ba 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -17,7 +17,6 @@
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/serial.h> 19#include <linux/serial.h>
20#include <linux/sched.h>
21#include <linux/tty.h> 20#include <linux/tty.h>
22#include <linux/platform_device.h> 21#include <linux/platform_device.h>
23#include <linux/serial_core.h> 22#include <linux/serial_core.h>
@@ -403,18 +402,9 @@ void __init ixp4xx_sys_init(void)
403/* 402/*
404 * sched_clock() 403 * sched_clock()
405 */ 404 */
406static DEFINE_CLOCK_DATA(cd); 405static u32 notrace ixp4xx_read_sched_clock(void)
407
408unsigned long long notrace sched_clock(void)
409{
410 u32 cyc = *IXP4XX_OSTS;
411 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
412}
413
414static void notrace ixp4xx_update_sched_clock(void)
415{ 406{
416 u32 cyc = *IXP4XX_OSTS; 407 return *IXP4XX_OSTS;
417 update_sched_clock(&cd, cyc, (u32)~0);
418} 408}
419 409
420/* 410/*
@@ -430,7 +420,7 @@ unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ;
430EXPORT_SYMBOL(ixp4xx_timer_freq); 420EXPORT_SYMBOL(ixp4xx_timer_freq);
431static void __init ixp4xx_clocksource_init(void) 421static void __init ixp4xx_clocksource_init(void)
432{ 422{
433 init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq); 423 setup_sched_clock(ixp4xx_read_sched_clock, 32, ixp4xx_timer_freq);
434 424
435 clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32, 425 clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32,
436 ixp4xx_clocksource_read); 426 ixp4xx_clocksource_read);
@@ -501,3 +491,23 @@ static void __init ixp4xx_clockevent_init(void)
501 491
502 clockevents_register_device(&clockevent_ixp4xx); 492 clockevents_register_device(&clockevent_ixp4xx);
503} 493}
494
495void ixp4xx_restart(char mode, const char *cmd)
496{
497 if ( 1 && mode == 's') {
498 /* Jump into ROM at address 0 */
499 soft_restart(0);
500 } else {
501 /* Use on-chip reset capability */
502
503 /* set the "key" register to enable access to
504 * "timer" and "enable" registers
505 */
506 *IXP4XX_OSWK = IXP4XX_WDT_KEY;
507
508 /* write 0 to the timer register for an immediate reset */
509 *IXP4XX_OSWT = 0;
510
511 *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
512 }
513}
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 81dfec31842b..a74f86ce8bcc 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -117,6 +117,7 @@ MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
117#if defined(CONFIG_PCI) 117#if defined(CONFIG_PCI)
118 .dma_zone_size = SZ_64M, 118 .dma_zone_size = SZ_64M,
119#endif 119#endif
120 .restart = ixp4xx_restart,
120MACHINE_END 121MACHINE_END
121#endif 122#endif
122 123
@@ -132,6 +133,7 @@ MACHINE_START(IXDPG425, "Intel IXDPG425")
132 .timer = &ixp4xx_timer, 133 .timer = &ixp4xx_timer,
133 .atag_offset = 0x100, 134 .atag_offset = 0x100,
134 .init_machine = coyote_init, 135 .init_machine = coyote_init,
136 .restart = ixp4xx_restart,
135MACHINE_END 137MACHINE_END
136#endif 138#endif
137 139
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 8837fbca27ce..67be177b336a 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -286,4 +286,5 @@ MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
286#if defined(CONFIG_PCI) 286#if defined(CONFIG_PCI)
287 .dma_zone_size = SZ_64M, 287 .dma_zone_size = SZ_64M,
288#endif 288#endif
289 .restart = ixp4xx_restart,
289MACHINE_END 290MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index 2887c3578c17..6d5818285af8 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -277,5 +277,6 @@ MACHINE_START(FSG, "Freecom FSG-3")
277#if defined(CONFIG_PCI) 277#if defined(CONFIG_PCI)
278 .dma_zone_size = SZ_64M, 278 .dma_zone_size = SZ_64M,
279#endif 279#endif
280 .restart = ixp4xx_restart,
280MACHINE_END 281MACHINE_END
281 282
diff --git a/arch/arm/mach-ixp4xx/gateway7001-setup.c b/arch/arm/mach-ixp4xx/gateway7001-setup.c
index d69d1b053bb7..7ecf9b28f1c0 100644
--- a/arch/arm/mach-ixp4xx/gateway7001-setup.c
+++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c
@@ -104,5 +104,6 @@ MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
104#if defined(CONFIG_PCI) 104#if defined(CONFIG_PCI)
105 .dma_zone_size = SZ_64M, 105 .dma_zone_size = SZ_64M,
106#endif 106#endif
107 .restart = ixp4xx_restart,
107MACHINE_END 108MACHINE_END
108#endif 109#endif
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c
index bf6678d1a929..c0e3d69a8aec 100644
--- a/arch/arm/mach-ixp4xx/goramo_mlr.c
+++ b/arch/arm/mach-ixp4xx/goramo_mlr.c
@@ -504,4 +504,5 @@ MACHINE_START(GORAMO_MLR, "MultiLink")
504#if defined(CONFIG_PCI) 504#if defined(CONFIG_PCI)
505 .dma_zone_size = SZ_64M, 505 .dma_zone_size = SZ_64M,
506#endif 506#endif
507 .restart = ixp4xx_restart,
507MACHINE_END 508MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index aa029fc19140..a23f89391458 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -172,6 +172,7 @@ MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
172#if defined(CONFIG_PCI) 172#if defined(CONFIG_PCI)
173 .dma_zone_size = SZ_64M, 173 .dma_zone_size = SZ_64M,
174#endif 174#endif
175 .restart = ixp4xx_restart,
175MACHINE_END 176MACHINE_END
176 177
177 178
diff --git a/arch/arm/mach-ixp4xx/include/mach/platform.h b/arch/arm/mach-ixp4xx/include/mach/platform.h
index e824c02c825a..df9250bbf13d 100644
--- a/arch/arm/mach-ixp4xx/include/mach/platform.h
+++ b/arch/arm/mach-ixp4xx/include/mach/platform.h
@@ -125,6 +125,7 @@ extern void ixp4xx_init_irq(void);
125extern void ixp4xx_sys_init(void); 125extern void ixp4xx_sys_init(void);
126extern void ixp4xx_timer_init(void); 126extern void ixp4xx_timer_init(void);
127extern struct sys_timer ixp4xx_timer; 127extern struct sys_timer ixp4xx_timer;
128extern void ixp4xx_restart(char, const char *);
128extern void ixp4xx_pci_preinit(void); 129extern void ixp4xx_pci_preinit(void);
129struct pci_sys_data; 130struct pci_sys_data;
130extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); 131extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
diff --git a/arch/arm/mach-ixp4xx/include/mach/system.h b/arch/arm/mach-ixp4xx/include/mach/system.h
index 54c0af7fa2d4..140a9bef4466 100644
--- a/arch/arm/mach-ixp4xx/include/mach/system.h
+++ b/arch/arm/mach-ixp4xx/include/mach/system.h
@@ -8,9 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 */ 10 */
11
12#include <mach/hardware.h>
13
14static inline void arch_idle(void) 11static inline void arch_idle(void)
15{ 12{
16 /* ixp4xx does not implement the XScale PWRMODE register, 13 /* ixp4xx does not implement the XScale PWRMODE register,
@@ -20,25 +17,3 @@ static inline void arch_idle(void)
20 cpu_do_idle(); 17 cpu_do_idle();
21#endif 18#endif
22} 19}
23
24
25static inline void arch_reset(char mode, const char *cmd)
26{
27 if ( 1 && mode == 's') {
28 /* Jump into ROM at address 0 */
29 cpu_reset(0);
30 } else {
31 /* Use on-chip reset capability */
32
33 /* set the "key" register to enable access to
34 * "timer" and "enable" registers
35 */
36 *IXP4XX_OSWK = IXP4XX_WDT_KEY;
37
38 /* write 0 to the timer register for an immediate reset */
39 *IXP4XX_OSWT = 0;
40
41 *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
42 }
43}
44
diff --git a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
deleted file mode 100644
index 9bcd64d59854..000000000000
--- a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-ixp4xx/include/mach/vmalloc.h
3 */
4#define VMALLOC_END (0xff000000UL)
5
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index f235f829dfa6..8a38b39999f8 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -261,6 +261,7 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
261#if defined(CONFIG_PCI) 261#if defined(CONFIG_PCI)
262 .dma_zone_size = SZ_64M, 262 .dma_zone_size = SZ_64M,
263#endif 263#endif
264 .restart = ixp4xx_restart,
264MACHINE_END 265MACHINE_END
265#endif 266#endif
266 267
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index de716fa1aab6..1010eb7b0083 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -321,4 +321,5 @@ MACHINE_START(NAS100D, "Iomega NAS 100d")
321#if defined(CONFIG_PCI) 321#if defined(CONFIG_PCI)
322 .dma_zone_size = SZ_64M, 322 .dma_zone_size = SZ_64M,
323#endif 323#endif
324 .restart = ixp4xx_restart,
324MACHINE_END 325MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index ac81ccb26bfe..aa355c360d57 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -307,4 +307,5 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
307#if defined(CONFIG_PCI) 307#if defined(CONFIG_PCI)
308 .dma_zone_size = SZ_64M, 308 .dma_zone_size = SZ_64M,
309#endif 309#endif
310 .restart = ixp4xx_restart,
310MACHINE_END 311MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/omixp-setup.c b/arch/arm/mach-ixp4xx/omixp-setup.c
index 3b6a81a696fc..0940869fcfdd 100644
--- a/arch/arm/mach-ixp4xx/omixp-setup.c
+++ b/arch/arm/mach-ixp4xx/omixp-setup.c
@@ -246,6 +246,7 @@ MACHINE_START(DEVIXP, "Omicron DEVIXP")
246 .init_irq = ixp4xx_init_irq, 246 .init_irq = ixp4xx_init_irq,
247 .timer = &ixp4xx_timer, 247 .timer = &ixp4xx_timer,
248 .init_machine = omixp_init, 248 .init_machine = omixp_init,
249 .restart = ixp4xx_restart,
249MACHINE_END 250MACHINE_END
250#endif 251#endif
251 252
@@ -259,6 +260,7 @@ MACHINE_START(MICCPT, "Omicron MICCPT")
259#if defined(CONFIG_PCI) 260#if defined(CONFIG_PCI)
260 .dma_zone_size = SZ_64M, 261 .dma_zone_size = SZ_64M,
261#endif 262#endif
263 .restart = ixp4xx_restart,
262MACHINE_END 264MACHINE_END
263#endif 265#endif
264 266
@@ -269,5 +271,6 @@ MACHINE_START(MIC256, "Omicron MIC256")
269 .init_irq = ixp4xx_init_irq, 271 .init_irq = ixp4xx_init_irq,
270 .timer = &ixp4xx_timer, 272 .timer = &ixp4xx_timer,
271 .init_machine = omixp_init, 273 .init_machine = omixp_init,
274 .restart = ixp4xx_restart,
272MACHINE_END 275MACHINE_END
273#endif 276#endif
diff --git a/arch/arm/mach-ixp4xx/vulcan-setup.c b/arch/arm/mach-ixp4xx/vulcan-setup.c
index 27e469ef4523..9dec20683291 100644
--- a/arch/arm/mach-ixp4xx/vulcan-setup.c
+++ b/arch/arm/mach-ixp4xx/vulcan-setup.c
@@ -244,4 +244,5 @@ MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan")
244#if defined(CONFIG_PCI) 244#if defined(CONFIG_PCI)
245 .dma_zone_size = SZ_64M, 245 .dma_zone_size = SZ_64M,
246#endif 246#endif
247 .restart = ixp4xx_restart,
247MACHINE_END 248MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/wg302v2-setup.c b/arch/arm/mach-ixp4xx/wg302v2-setup.c
index b14144b967a7..5ac0f0a0fd8c 100644
--- a/arch/arm/mach-ixp4xx/wg302v2-setup.c
+++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c
@@ -105,5 +105,6 @@ MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
105#if defined(CONFIG_PCI) 105#if defined(CONFIG_PCI)
106 .dma_zone_size = SZ_64M, 106 .dma_zone_size = SZ_64M,
107#endif 107#endif
108 .restart = ixp4xx_restart,
108MACHINE_END 109MACHINE_END
109#endif 110#endif
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index f3248cfbe51d..0bff4a916231 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -534,3 +534,19 @@ static int __init kirkwood_clock_gate(void)
534 return 0; 534 return 0;
535} 535}
536late_initcall(kirkwood_clock_gate); 536late_initcall(kirkwood_clock_gate);
537
538void kirkwood_restart(char mode, const char *cmd)
539{
540 /*
541 * Enable soft reset to assert RSTOUTn.
542 */
543 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
544
545 /*
546 * Assert soft reset.
547 */
548 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
549
550 while (1)
551 ;
552}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index b9b0f0968a36..1529280246d6 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -50,6 +50,7 @@ void kirkwood_uart1_init(void);
50void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay); 50void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
51void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *)); 51void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *));
52void kirkwood_audio_init(void); 52void kirkwood_audio_init(void);
53void kirkwood_restart(char, const char *);
53 54
54extern int kirkwood_tclk; 55extern int kirkwood_tclk;
55extern struct sys_timer kirkwood_timer; 56extern struct sys_timer kirkwood_timer;
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c
index f457e07a65f0..6e1bac929ab5 100644
--- a/arch/arm/mach-kirkwood/d2net_v2-setup.c
+++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c
@@ -227,4 +227,5 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
227 .init_early = kirkwood_init_early, 227 .init_early = kirkwood_init_early,
228 .init_irq = kirkwood_init_irq, 228 .init_irq = kirkwood_init_irq,
229 .timer = &kirkwood_timer, 229 .timer = &kirkwood_timer,
230 .restart = kirkwood_restart,
230MACHINE_END 231MACHINE_END
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index ff4c21c1f923..d93359379598 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -103,4 +103,5 @@ MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
103 .init_early = kirkwood_init_early, 103 .init_early = kirkwood_init_early,
104 .init_irq = kirkwood_init_irq, 104 .init_irq = kirkwood_init_irq,
105 .timer = &kirkwood_timer, 105 .timer = &kirkwood_timer,
106 .restart = kirkwood_restart,
106MACHINE_END 107MACHINE_END
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c
index e4d199b2b1e8..61d9a552a054 100644
--- a/arch/arm/mach-kirkwood/dockstar-setup.c
+++ b/arch/arm/mach-kirkwood/dockstar-setup.c
@@ -108,4 +108,5 @@ MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
108 .init_early = kirkwood_init_early, 108 .init_early = kirkwood_init_early,
109 .init_irq = kirkwood_init_irq, 109 .init_irq = kirkwood_init_irq,
110 .timer = &kirkwood_timer, 110 .timer = &kirkwood_timer,
111 .restart = kirkwood_restart,
111MACHINE_END 112MACHINE_END
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
index 6c40f784b516..bdaed3867d13 100644
--- a/arch/arm/mach-kirkwood/guruplug-setup.c
+++ b/arch/arm/mach-kirkwood/guruplug-setup.c
@@ -127,4 +127,5 @@ MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
127 .init_early = kirkwood_init_early, 127 .init_early = kirkwood_init_early,
128 .init_irq = kirkwood_init_irq, 128 .init_irq = kirkwood_init_irq,
129 .timer = &kirkwood_timer, 129 .timer = &kirkwood_timer,
130 .restart = kirkwood_restart,
130MACHINE_END 131MACHINE_END
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
index 1aaddc364f2e..49dd0cb5e166 100644
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ b/arch/arm/mach-kirkwood/include/mach/io.h
@@ -19,31 +19,6 @@ static inline void __iomem *__io(unsigned long addr)
19 + KIRKWOOD_PCIE_IO_VIRT_BASE); 19 + KIRKWOOD_PCIE_IO_VIRT_BASE);
20} 20}
21 21
22static inline void __iomem *
23__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
24{
25 void __iomem *retval;
26 unsigned long offs = paddr - KIRKWOOD_REGS_PHYS_BASE;
27 if (mtype == MT_DEVICE && size && offs < KIRKWOOD_REGS_SIZE &&
28 size <= KIRKWOOD_REGS_SIZE && offs + size <= KIRKWOOD_REGS_SIZE) {
29 retval = (void __iomem *)KIRKWOOD_REGS_VIRT_BASE + offs;
30 } else {
31 retval = __arm_ioremap(paddr, size, mtype);
32 }
33
34 return retval;
35}
36
37static inline void
38__arch_iounmap(void __iomem *addr)
39{
40 if (addr < (void __iomem *)KIRKWOOD_REGS_VIRT_BASE ||
41 addr >= (void __iomem *)(KIRKWOOD_REGS_VIRT_BASE + KIRKWOOD_REGS_SIZE))
42 __iounmap(addr);
43}
44
45#define __arch_ioremap __arch_ioremap
46#define __arch_iounmap __arch_iounmap
47#define __io(a) __io(a) 22#define __io(a) __io(a)
48#define __mem_pci(a) (a) 23#define __mem_pci(a) (a)
49 24
diff --git a/arch/arm/mach-kirkwood/include/mach/system.h b/arch/arm/mach-kirkwood/include/mach/system.h
index 7568e95d279b..5fddde002b5e 100644
--- a/arch/arm/mach-kirkwood/include/mach/system.h
+++ b/arch/arm/mach-kirkwood/include/mach/system.h
@@ -9,28 +9,9 @@
9#ifndef __ASM_ARCH_SYSTEM_H 9#ifndef __ASM_ARCH_SYSTEM_H
10#define __ASM_ARCH_SYSTEM_H 10#define __ASM_ARCH_SYSTEM_H
11 11
12#include <mach/bridge-regs.h>
13
14static inline void arch_idle(void) 12static inline void arch_idle(void)
15{ 13{
16 cpu_do_idle(); 14 cpu_do_idle();
17} 15}
18 16
19static inline void arch_reset(char mode, const char *cmd)
20{
21 /*
22 * Enable soft reset to assert RSTOUTn.
23 */
24 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
25
26 /*
27 * Assert soft reset.
28 */
29 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
30
31 while (1)
32 ;
33}
34
35
36#endif 17#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
index bf162ca3d2c1..000000000000
--- a/arch/arm/mach-kirkwood/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe800000UL
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
index 9a1e917352f7..85f6169c2484 100644
--- a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
+++ b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
@@ -169,4 +169,5 @@ MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
169 .init_early = kirkwood_init_early, 169 .init_early = kirkwood_init_early,
170 .init_irq = kirkwood_init_irq, 170 .init_irq = kirkwood_init_irq,
171 .timer = &kirkwood_timer, 171 .timer = &kirkwood_timer,
172 .restart = kirkwood_restart,
172MACHINE_END 173MACHINE_END
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index 8849bcc7328e..e6bba01bae38 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -264,6 +264,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
264 .init_early = kirkwood_init_early, 264 .init_early = kirkwood_init_early,
265 .init_irq = kirkwood_init_irq, 265 .init_irq = kirkwood_init_irq,
266 .timer = &kirkwood_timer, 266 .timer = &kirkwood_timer,
267 .restart = kirkwood_restart,
267MACHINE_END 268MACHINE_END
268#endif 269#endif
269 270
@@ -275,6 +276,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
275 .init_early = kirkwood_init_early, 276 .init_early = kirkwood_init_early,
276 .init_irq = kirkwood_init_irq, 277 .init_irq = kirkwood_init_irq,
277 .timer = &kirkwood_timer, 278 .timer = &kirkwood_timer,
279 .restart = kirkwood_restart,
278MACHINE_END 280MACHINE_END
279#endif 281#endif
280 282
@@ -286,5 +288,6 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
286 .init_early = kirkwood_init_early, 288 .init_early = kirkwood_init_early,
287 .init_irq = kirkwood_init_irq, 289 .init_irq = kirkwood_init_irq,
288 .timer = &kirkwood_timer, 290 .timer = &kirkwood_timer,
291 .restart = kirkwood_restart,
289MACHINE_END 292MACHINE_END
290#endif 293#endif
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
index 1ba12c4dff8f..31ae8de34e93 100644
--- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
@@ -405,6 +405,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
405 .init_early = kirkwood_init_early, 405 .init_early = kirkwood_init_early,
406 .init_irq = kirkwood_init_irq, 406 .init_irq = kirkwood_init_irq,
407 .timer = &kirkwood_timer, 407 .timer = &kirkwood_timer,
408 .restart = kirkwood_restart,
408MACHINE_END 409MACHINE_END
409#endif 410#endif
410 411
@@ -416,5 +417,6 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
416 .init_early = kirkwood_init_early, 417 .init_early = kirkwood_init_early,
417 .init_irq = kirkwood_init_irq, 418 .init_irq = kirkwood_init_irq,
418 .timer = &kirkwood_timer, 419 .timer = &kirkwood_timer,
420 .restart = kirkwood_restart,
419MACHINE_END 421MACHINE_END
420#endif 422#endif
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index 5660ca6c3d88..01f8c8992880 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -220,6 +220,7 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
220 .init_early = kirkwood_init_early, 220 .init_early = kirkwood_init_early,
221 .init_irq = kirkwood_init_irq, 221 .init_irq = kirkwood_init_irq,
222 .timer = &kirkwood_timer, 222 .timer = &kirkwood_timer,
223 .restart = kirkwood_restart,
223MACHINE_END 224MACHINE_END
224#endif 225#endif
225 226
@@ -232,6 +233,7 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
232 .init_early = kirkwood_init_early, 233 .init_early = kirkwood_init_early,
233 .init_irq = kirkwood_init_irq, 234 .init_irq = kirkwood_init_irq,
234 .timer = &kirkwood_timer, 235 .timer = &kirkwood_timer,
236 .restart = kirkwood_restart,
235MACHINE_END 237MACHINE_END
236#endif 238#endif
237 239
@@ -244,5 +246,6 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
244 .init_early = kirkwood_init_early, 246 .init_early = kirkwood_init_early,
245 .init_irq = kirkwood_init_irq, 247 .init_irq = kirkwood_init_irq,
246 .timer = &kirkwood_timer, 248 .timer = &kirkwood_timer,
249 .restart = kirkwood_restart,
247MACHINE_END 250MACHINE_END
248#endif 251#endif
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index 6663869773ab..fd2c9c8b6831 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -85,4 +85,5 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
85 .init_early = kirkwood_init_early, 85 .init_early = kirkwood_init_early,
86 .init_irq = kirkwood_init_irq, 86 .init_irq = kirkwood_init_irq,
87 .timer = &kirkwood_timer, 87 .timer = &kirkwood_timer,
88 .restart = kirkwood_restart,
88MACHINE_END 89MACHINE_END
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 66b3c05e37a6..ef922079348b 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -121,4 +121,5 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
121 .init_early = kirkwood_init_early, 121 .init_early = kirkwood_init_early,
122 .init_irq = kirkwood_init_irq, 122 .init_irq = kirkwood_init_irq,
123 .timer = &kirkwood_timer, 123 .timer = &kirkwood_timer,
124 .restart = kirkwood_restart,
124MACHINE_END 125MACHINE_END
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
index 8b102d62e82c..4ea70e5f7137 100644
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -107,7 +107,7 @@ static void __init sheevaplug_init(void)
107 kirkwood_init(); 107 kirkwood_init();
108 108
109 /* setup gpio pin select */ 109 /* setup gpio pin select */
110 if (machine_is_sheeva_esata()) 110 if (machine_is_esata_sheevaplug())
111 kirkwood_mpp_conf(sheeva_esata_mpp_config); 111 kirkwood_mpp_conf(sheeva_esata_mpp_config);
112 else 112 else
113 kirkwood_mpp_conf(sheevaplug_mpp_config); 113 kirkwood_mpp_conf(sheevaplug_mpp_config);
@@ -123,11 +123,11 @@ static void __init sheevaplug_init(void)
123 kirkwood_ge00_init(&sheevaplug_ge00_data); 123 kirkwood_ge00_init(&sheevaplug_ge00_data);
124 124
125 /* honor lower power consumption for plugs with out eSATA */ 125 /* honor lower power consumption for plugs with out eSATA */
126 if (machine_is_sheeva_esata()) 126 if (machine_is_esata_sheevaplug())
127 kirkwood_sata_init(&sheeva_esata_sata_data); 127 kirkwood_sata_init(&sheeva_esata_sata_data);
128 128
129 /* enable sd wp and sd cd on plugs with esata */ 129 /* enable sd wp and sd cd on plugs with esata */
130 if (machine_is_sheeva_esata()) 130 if (machine_is_esata_sheevaplug())
131 kirkwood_sdio_init(&sheeva_esata_mvsdio_data); 131 kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
132 else 132 else
133 kirkwood_sdio_init(&sheevaplug_mvsdio_data); 133 kirkwood_sdio_init(&sheevaplug_mvsdio_data);
@@ -144,6 +144,7 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
144 .init_early = kirkwood_init_early, 144 .init_early = kirkwood_init_early,
145 .init_irq = kirkwood_init_irq, 145 .init_irq = kirkwood_init_irq,
146 .timer = &kirkwood_timer, 146 .timer = &kirkwood_timer,
147 .restart = kirkwood_restart,
147MACHINE_END 148MACHINE_END
148#endif 149#endif
149 150
@@ -155,5 +156,6 @@ MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
155 .init_early = kirkwood_init_early, 156 .init_early = kirkwood_init_early,
156 .init_irq = kirkwood_init_irq, 157 .init_irq = kirkwood_init_irq,
157 .timer = &kirkwood_timer, 158 .timer = &kirkwood_timer,
159 .restart = kirkwood_restart,
158MACHINE_END 160MACHINE_END
159#endif 161#endif
diff --git a/arch/arm/mach-kirkwood/t5325-setup.c b/arch/arm/mach-kirkwood/t5325-setup.c
index ea104fb5ec3d..966b2b3bb813 100644
--- a/arch/arm/mach-kirkwood/t5325-setup.c
+++ b/arch/arm/mach-kirkwood/t5325-setup.c
@@ -207,4 +207,5 @@ MACHINE_START(T5325, "HP t5325 Thin Client")
207 .init_early = kirkwood_init_early, 207 .init_early = kirkwood_init_early,
208 .init_irq = kirkwood_init_irq, 208 .init_irq = kirkwood_init_irq,
209 .timer = &kirkwood_timer, 209 .timer = &kirkwood_timer,
210 .restart = kirkwood_restart,
210MACHINE_END 211MACHINE_END
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
index 262c034836d4..73e2b6ca9564 100644
--- a/arch/arm/mach-kirkwood/ts219-setup.c
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -138,4 +138,5 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219")
138 .init_early = kirkwood_init_early, 138 .init_early = kirkwood_init_early,
139 .init_irq = kirkwood_init_irq, 139 .init_irq = kirkwood_init_irq,
140 .timer = &kirkwood_timer, 140 .timer = &kirkwood_timer,
141 .restart = kirkwood_restart,
141MACHINE_END 142MACHINE_END
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
index b68f5b4a9ec8..5bbca2680442 100644
--- a/arch/arm/mach-kirkwood/ts41x-setup.c
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -182,4 +182,5 @@ MACHINE_START(TS41X, "QNAP TS-41x")
182 .init_early = kirkwood_init_early, 182 .init_early = kirkwood_init_early,
183 .init_irq = kirkwood_init_irq, 183 .init_irq = kirkwood_init_irq,
184 .timer = &kirkwood_timer, 184 .timer = &kirkwood_timer,
185 .restart = kirkwood_restart,
185MACHINE_END 186MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c
index a91f99d265aa..255502ddd879 100644
--- a/arch/arm/mach-ks8695/board-acs5k.c
+++ b/arch/arm/mach-ks8695/board-acs5k.c
@@ -228,4 +228,5 @@ MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
228 .init_irq = ks8695_init_irq, 228 .init_irq = ks8695_init_irq,
229 .init_machine = acs5k_init, 229 .init_machine = acs5k_init,
230 .timer = &ks8695_timer, 230 .timer = &ks8695_timer,
231 .restart = ks8695_restart,
231MACHINE_END 232MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-dsm320.c b/arch/arm/mach-ks8695/board-dsm320.c
index d24bcef2e2dd..e0d36cef2c56 100644
--- a/arch/arm/mach-ks8695/board-dsm320.c
+++ b/arch/arm/mach-ks8695/board-dsm320.c
@@ -126,4 +126,5 @@ MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
126 .init_irq = ks8695_init_irq, 126 .init_irq = ks8695_init_irq,
127 .init_machine = dsm320_init, 127 .init_machine = dsm320_init,
128 .timer = &ks8695_timer, 128 .timer = &ks8695_timer,
129 .restart = ks8695_restart,
129MACHINE_END 130MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-micrel.c b/arch/arm/mach-ks8695/board-micrel.c
index 16c95657f8fd..a8270725b76d 100644
--- a/arch/arm/mach-ks8695/board-micrel.c
+++ b/arch/arm/mach-ks8695/board-micrel.c
@@ -58,4 +58,5 @@ MACHINE_START(KS8695, "KS8695 Centaur Development Board")
58 .init_irq = ks8695_init_irq, 58 .init_irq = ks8695_init_irq,
59 .init_machine = micrel_init, 59 .init_machine = micrel_init,
60 .timer = &ks8695_timer, 60 .timer = &ks8695_timer,
61 .restart = ks8695_restart,
61MACHINE_END 62MACHINE_END
diff --git a/arch/arm/mach-ks8695/generic.h b/arch/arm/mach-ks8695/generic.h
index 2fbfab8d5fae..f8bdb11a9c33 100644
--- a/arch/arm/mach-ks8695/generic.h
+++ b/arch/arm/mach-ks8695/generic.h
@@ -12,4 +12,5 @@
12 12
13extern __init void ks8695_map_io(void); 13extern __init void ks8695_map_io(void);
14extern __init void ks8695_init_irq(void); 14extern __init void ks8695_init_irq(void);
15extern void ks8695_restart(char, const char *);
15extern struct sys_timer ks8695_timer; 16extern struct sys_timer ks8695_timer;
diff --git a/arch/arm/mach-ks8695/include/mach/system.h b/arch/arm/mach-ks8695/include/mach/system.h
index fb1dda9be2d0..59fe992395bf 100644
--- a/arch/arm/mach-ks8695/include/mach/system.h
+++ b/arch/arm/mach-ks8695/include/mach/system.h
@@ -14,9 +14,6 @@
14#ifndef __ASM_ARCH_SYSTEM_H 14#ifndef __ASM_ARCH_SYSTEM_H
15#define __ASM_ARCH_SYSTEM_H 15#define __ASM_ARCH_SYSTEM_H
16 16
17#include <linux/io.h>
18#include <mach/regs-timer.h>
19
20static void arch_idle(void) 17static void arch_idle(void)
21{ 18{
22 /* 19 /*
@@ -27,22 +24,4 @@ static void arch_idle(void)
27 24
28} 25}
29 26
30static void arch_reset(char mode, const char *cmd)
31{
32 unsigned int reg;
33
34 if (mode == 's')
35 cpu_reset(0);
36
37 /* disable timer0 */
38 reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
39 __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
40
41 /* enable watchdog mode */
42 __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
43
44 /* re-enable timer0 */
45 __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
46}
47
48#endif 27#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
index 744ac66be3a2..000000000000
--- a/arch/arm/mach-ks8695/include/mach/vmalloc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2006 Ben Dooks
5 * Copyright (C) 2006 Simtec Electronics <linux@simtec.co.uk>
6 *
7 * KS8695 vmalloc definition
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __ASM_ARCH_VMALLOC_H
15#define __ASM_ARCH_VMALLOC_H
16
17#define VMALLOC_END (KS8695_IO_VA & PGDIR_MASK)
18
19#endif
diff --git a/arch/arm/mach-ks8695/irq.c b/arch/arm/mach-ks8695/irq.c
index a78092dcd6fb..76802aac0f45 100644
--- a/arch/arm/mach-ks8695/irq.c
+++ b/arch/arm/mach-ks8695/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c
index 69c072c2c0f9..37dfcd5bd2ad 100644
--- a/arch/arm/mach-ks8695/time.c
+++ b/arch/arm/mach-ks8695/time.c
@@ -109,3 +109,21 @@ struct sys_timer ks8695_timer = {
109 .offset = ks8695_gettimeoffset, 109 .offset = ks8695_gettimeoffset,
110 .resume = ks8695_timer_setup, 110 .resume = ks8695_timer_setup,
111}; 111};
112
113void ks8695_restart(char mode, const char *cmd)
114{
115 unsigned int reg;
116
117 if (mode == 's')
118 soft_restart(0);
119
120 /* disable timer0 */
121 reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
122 __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
123
124 /* enable watchdog mode */
125 __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
126
127 /* re-enable timer0 */
128 __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
129}
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index 205b2dbb565b..369b152896cd 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -164,7 +164,7 @@ int clk_is_sysclk_mainosc(void)
164/* 164/*
165 * System reset via the watchdog timer 165 * System reset via the watchdog timer
166 */ 166 */
167void lpc32xx_watchdog_reset(void) 167static void lpc32xx_watchdog_reset(void)
168{ 168{
169 /* Make sure WDT clocks are enabled */ 169 /* Make sure WDT clocks are enabled */
170 __raw_writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN, 170 __raw_writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN,
@@ -311,3 +311,21 @@ void __init lpc32xx_map_io(void)
311{ 311{
312 iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc)); 312 iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc));
313} 313}
314
315void lpc23xx_restart(char mode, const char *cmd)
316{
317 switch (mode) {
318 case 's':
319 case 'h':
320 lpc32xx_watchdog_reset();
321 break;
322
323 default:
324 /* Do nothing */
325 break;
326 }
327
328 /* Wait for watchdog to reset system */
329 while (1)
330 ;
331}
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index 5583f52662bd..4b4e700343c1 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -39,6 +39,8 @@ extern void __init lpc32xx_init_irq(void);
39extern void __init lpc32xx_map_io(void); 39extern void __init lpc32xx_map_io(void);
40extern void __init lpc32xx_serial_init(void); 40extern void __init lpc32xx_serial_init(void);
41extern void __init lpc32xx_gpio_init(void); 41extern void __init lpc32xx_gpio_init(void);
42extern void lpc23xx_restart(char, const char *);
43
42 44
43/* 45/*
44 * Structure used for setting up and querying the PLLS 46 * Structure used for setting up and querying the PLLS
diff --git a/arch/arm/mach-lpc32xx/include/mach/system.h b/arch/arm/mach-lpc32xx/include/mach/system.h
index df3b0dea4d7b..bf176c991520 100644
--- a/arch/arm/mach-lpc32xx/include/mach/system.h
+++ b/arch/arm/mach-lpc32xx/include/mach/system.h
@@ -24,29 +24,4 @@ static void arch_idle(void)
24 cpu_do_idle(); 24 cpu_do_idle();
25} 25}
26 26
27static inline void arch_reset(char mode, const char *cmd)
28{
29 extern void lpc32xx_watchdog_reset(void);
30
31 switch (mode) {
32 case 's':
33 case 'h':
34 printk(KERN_CRIT "RESET: Rebooting system\n");
35
36 /* Disable interrupts */
37 local_irq_disable();
38
39 lpc32xx_watchdog_reset();
40 break;
41
42 default:
43 /* Do nothing */
44 break;
45 }
46
47 /* Wait for watchdog to reset system */
48 while (1)
49 ;
50}
51
52#endif 27#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
index 720fa43a60bf..000000000000
--- a/arch/arm/mach-lpc32xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-lpc32xx/include/mach/vmalloc.h
3 *
4 * Author: Kevin Wells <kevin.wells@nxp.com>
5 *
6 * Copyright (C) 2010 NXP Semiconductors
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#ifndef __ASM_ARCH_VMALLOC_H
20#define __ASM_ARCH_VMALLOC_H
21
22#define VMALLOC_END 0xF0000000UL
23
24#endif
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index 6d2f0d1b9373..bfee5b455105 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -18,7 +18,7 @@
18 18
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
@@ -388,4 +388,5 @@ MACHINE_START(PHY3250, "Phytec 3250 board with the LPC3250 Microcontroller")
388 .init_irq = lpc32xx_init_irq, 388 .init_irq = lpc32xx_init_irq,
389 .timer = &lpc32xx_timer, 389 .timer = &lpc32xx_timer,
390 .init_machine = phy3250_board_init, 390 .init_machine = phy3250_board_init,
391 .restart = lpc23xx_restart,
391MACHINE_END 392MACHINE_END
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index 7a60bbbce7a4..3e6dfab59ef6 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -243,6 +243,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
243 .init_irq = pxa168_init_irq, 243 .init_irq = pxa168_init_irq,
244 .timer = &pxa168_timer, 244 .timer = &pxa168_timer,
245 .init_machine = common_init, 245 .init_machine = common_init,
246 .restart = pxa168_restart,
246MACHINE_END 247MACHINE_END
247 248
248MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform") 249MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
@@ -251,4 +252,5 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
251 .init_irq = pxa168_init_irq, 252 .init_irq = pxa168_init_irq,
252 .timer = &pxa168_timer, 253 .timer = &pxa168_timer,
253 .init_machine = common_init, 254 .init_machine = common_init,
255 .restart = pxa168_restart,
254MACHINE_END 256MACHINE_END
diff --git a/arch/arm/mach-mmp/avengers_lite.c b/arch/arm/mach-mmp/avengers_lite.c
index 39f0878d64a0..8de3dc6131a4 100644
--- a/arch/arm/mach-mmp/avengers_lite.c
+++ b/arch/arm/mach-mmp/avengers_lite.c
@@ -45,4 +45,5 @@ MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
45 .init_irq = pxa168_init_irq, 45 .init_irq = pxa168_init_irq,
46 .timer = &pxa168_timer, 46 .timer = &pxa168_timer,
47 .init_machine = avengers_lite_init, 47 .init_machine = avengers_lite_init,
48 .restart = pxa168_restart,
48MACHINE_END 49MACHINE_END
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index 983cfb15fbde..e16f04b39b15 100644
--- a/arch/arm/mach-mmp/brownstone.c
+++ b/arch/arm/mach-mmp/brownstone.c
@@ -219,4 +219,5 @@ MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
219 .init_irq = mmp2_init_irq, 219 .init_irq = mmp2_init_irq,
220 .timer = &mmp2_timer, 220 .timer = &mmp2_timer,
221 .init_machine = brownstone_init, 221 .init_machine = brownstone_init,
222 .restart = mmp_restart,
222MACHINE_END 223MACHINE_END
diff --git a/arch/arm/mach-mmp/common.c b/arch/arm/mach-mmp/common.c
index 5720674739f0..062b5b93c50e 100644
--- a/arch/arm/mach-mmp/common.c
+++ b/arch/arm/mach-mmp/common.c
@@ -45,3 +45,8 @@ void __init mmp_map_io(void)
45 /* this is early, initialize mmp_chip_id here */ 45 /* this is early, initialize mmp_chip_id here */
46 mmp_chip_id = __raw_readl(MMP_CHIPID); 46 mmp_chip_id = __raw_readl(MMP_CHIPID);
47} 47}
48
49void mmp_restart(char mode, const char *cmd)
50{
51 soft_restart(0);
52}
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
index ec8d65ded25c..1c9d6c1ea97a 100644
--- a/arch/arm/mach-mmp/common.h
+++ b/arch/arm/mach-mmp/common.h
@@ -6,3 +6,4 @@ extern void timer_init(int irq);
6 6
7extern void __init icu_init_irq(void); 7extern void __init icu_init_irq(void);
8extern void __init mmp_map_io(void); 8extern void __init mmp_map_io(void);
9extern void mmp_restart(char, const char *);
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c
index c4fd806b15b4..5a6a27a6cfd0 100644
--- a/arch/arm/mach-mmp/flint.c
+++ b/arch/arm/mach-mmp/flint.c
@@ -121,4 +121,5 @@ MACHINE_START(FLINT, "Flint Development Platform")
121 .init_irq = mmp2_init_irq, 121 .init_irq = mmp2_init_irq,
122 .timer = &mmp2_timer, 122 .timer = &mmp2_timer,
123 .init_machine = flint_init, 123 .init_machine = flint_init,
124 .restart = mmp_restart,
124MACHINE_END 125MACHINE_END
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
index 69156568bc41..1e3abbe37cac 100644
--- a/arch/arm/mach-mmp/gplugd.c
+++ b/arch/arm/mach-mmp/gplugd.c
@@ -182,7 +182,7 @@ static void __init gplugd_init(void)
182 182
183 /* on-chip devices */ 183 /* on-chip devices */
184 pxa168_add_uart(3); 184 pxa168_add_uart(3);
185 pxa168_add_ssp(0); 185 pxa168_add_ssp(1);
186 pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info)); 186 pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
187 187
188 pxa168_add_eth(&gplugd_eth_platform_data); 188 pxa168_add_eth(&gplugd_eth_platform_data);
@@ -194,4 +194,5 @@ MACHINE_START(GPLUGD, "PXA168-based GuruPlug Display (gplugD) Platform")
194 .init_irq = pxa168_init_irq, 194 .init_irq = pxa168_init_irq,
195 .timer = &pxa168_timer, 195 .timer = &pxa168_timer,
196 .init_machine = gplugd_init, 196 .init_machine = gplugd_init,
197 .restart = pxa168_restart,
197MACHINE_END 198MACHINE_END
diff --git a/arch/arm/mach-mmp/include/mach/gpio-pxa.h b/arch/arm/mach-mmp/include/mach/gpio-pxa.h
index d14eeaf16322..99b4ce1b6562 100644
--- a/arch/arm/mach-mmp/include/mach/gpio-pxa.h
+++ b/arch/arm/mach-mmp/include/mach/gpio-pxa.h
@@ -7,7 +7,7 @@
7#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000) 7#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)
8 8
9#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) 9#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
10#define GPIO_REG(x) (GPIO_REGS_VIRT + (x)) 10#define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x)))
11 11
12#define NR_BUILTIN_GPIO IRQ_GPIO_NUM 12#define NR_BUILTIN_GPIO IRQ_GPIO_NUM
13 13
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index 7fb568d2845b..a677aa732c26 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -5,6 +5,7 @@ struct sys_timer;
5 5
6extern struct sys_timer pxa168_timer; 6extern struct sys_timer pxa168_timer;
7extern void __init pxa168_init_irq(void); 7extern void __init pxa168_init_irq(void);
8extern void pxa168_restart(char, const char *);
8extern void pxa168_clear_keypad_wakeup(void); 9extern void pxa168_clear_keypad_wakeup(void);
9 10
10#include <linux/i2c.h> 11#include <linux/i2c.h>
diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h
index 1a8a25edb1b4..1d001eab81e1 100644
--- a/arch/arm/mach-mmp/include/mach/system.h
+++ b/arch/arm/mach-mmp/include/mach/system.h
@@ -9,18 +9,8 @@
9#ifndef __ASM_MACH_SYSTEM_H 9#ifndef __ASM_MACH_SYSTEM_H
10#define __ASM_MACH_SYSTEM_H 10#define __ASM_MACH_SYSTEM_H
11 11
12#include <mach/cputype.h>
13
14static inline void arch_idle(void) 12static inline void arch_idle(void)
15{ 13{
16 cpu_do_idle(); 14 cpu_do_idle();
17} 15}
18
19static inline void arch_reset(char mode, const char *cmd)
20{
21 if (cpu_is_pxa168())
22 cpu_reset(0xffff0000);
23 else
24 cpu_reset(0);
25}
26#endif /* __ASM_MACH_SYSTEM_H */ 16#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
index 1d0bac003ad0..000000000000
--- a/arch/arm/mach-mmp/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c
index 8bfac6612623..96cf5c8fe47d 100644
--- a/arch/arm/mach-mmp/jasper.c
+++ b/arch/arm/mach-mmp/jasper.c
@@ -175,4 +175,5 @@ MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
175 .init_irq = mmp2_init_irq, 175 .init_irq = mmp2_init_irq,
176 .timer = &mmp2_timer, 176 .timer = &mmp2_timer,
177 .init_machine = jasper_init, 177 .init_machine = jasper_init,
178 .restart = mmp_restart,
178MACHINE_END 179MACHINE_END
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index 76ca15c00e45..13f23867a86a 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -214,3 +214,8 @@ int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata)
214 pxa168_device_usb_host.dev.platform_data = pdata; 214 pxa168_device_usb_host.dev.platform_data = pdata;
215 return platform_device_register(&pxa168_device_usb_host); 215 return platform_device_register(&pxa168_device_usb_host);
216} 216}
217
218void pxa168_restart(char mode, const char *cmd)
219{
220 soft_restart(0xffff0000);
221}
diff --git a/arch/arm/mach-mmp/tavorevb.c b/arch/arm/mach-mmp/tavorevb.c
index eb5be879fd8c..257a21283ec1 100644
--- a/arch/arm/mach-mmp/tavorevb.c
+++ b/arch/arm/mach-mmp/tavorevb.c
@@ -103,4 +103,5 @@ MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)")
103 .init_irq = pxa910_init_irq, 103 .init_irq = pxa910_init_irq,
104 .timer = &pxa910_timer, 104 .timer = &pxa910_timer,
105 .init_machine = tavorevb_init, 105 .init_machine = tavorevb_init,
106 .restart = mmp_restart,
106MACHINE_END 107MACHINE_END
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c
index bbe4727b96cc..8ac22a62bf1a 100644
--- a/arch/arm/mach-mmp/teton_bga.c
+++ b/arch/arm/mach-mmp/teton_bga.c
@@ -86,4 +86,5 @@ MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
86 .init_irq = pxa168_init_irq, 86 .init_irq = pxa168_init_irq,
87 .timer = &pxa168_timer, 87 .timer = &pxa168_timer,
88 .init_machine = teton_bga_init, 88 .init_machine = teton_bga_init,
89 .restart = pxa168_restart,
89MACHINE_END 90MACHINE_END
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 4e91ee6e27c8..71fc4ee4602c 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -25,7 +25,6 @@
25 25
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <linux/sched.h>
29 28
30#include <asm/sched_clock.h> 29#include <asm/sched_clock.h>
31#include <mach/addr-map.h> 30#include <mach/addr-map.h>
@@ -42,8 +41,6 @@
42#define MAX_DELTA (0xfffffffe) 41#define MAX_DELTA (0xfffffffe)
43#define MIN_DELTA (16) 42#define MIN_DELTA (16)
44 43
45static DEFINE_CLOCK_DATA(cd);
46
47/* 44/*
48 * FIXME: the timer needs some delay to stablize the counter capture 45 * FIXME: the timer needs some delay to stablize the counter capture
49 */ 46 */
@@ -59,16 +56,9 @@ static inline uint32_t timer_read(void)
59 return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(1)); 56 return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(1));
60} 57}
61 58
62unsigned long long notrace sched_clock(void) 59static u32 notrace mmp_read_sched_clock(void)
63{ 60{
64 u32 cyc = timer_read(); 61 return timer_read();
65 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
66}
67
68static void notrace mmp_update_sched_clock(void)
69{
70 u32 cyc = timer_read();
71 update_sched_clock(&cd, cyc, (u32)~0);
72} 62}
73 63
74static irqreturn_t timer_interrupt(int irq, void *dev_id) 64static irqreturn_t timer_interrupt(int irq, void *dev_id)
@@ -201,7 +191,7 @@ void __init timer_init(int irq)
201{ 191{
202 timer_config(); 192 timer_config();
203 193
204 init_sched_clock(&cd, mmp_update_sched_clock, 32, CLOCK_TICK_RATE); 194 setup_sched_clock(mmp_read_sched_clock, 32, CLOCK_TICK_RATE);
205 195
206 ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift); 196 ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift);
207 ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt); 197 ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt);
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 176515a76989..f02658825576 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -159,4 +159,5 @@ MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
159 .init_irq = pxa910_init_irq, 159 .init_irq = pxa910_init_irq,
160 .timer = &pxa910_timer, 160 .timer = &pxa910_timer,
161 .init_machine = ttc_dkb_init, 161 .init_machine = ttc_dkb_init,
162 .restart = mmp_restart,
162MACHINE_END 163MACHINE_END
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index ebde97f5d5f0..e6beaff7621e 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -67,6 +67,7 @@ config MSM_SOC_REV_A
67 bool 67 bool
68config ARCH_MSM_SCORPIONMP 68config ARCH_MSM_SCORPIONMP
69 bool 69 bool
70 select HAVE_SMP
70 71
71config ARCH_MSM_ARM11 72config ARCH_MSM_ARM11
72 bool 73 bool
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index 6dc1cbd2a595..ed3598128530 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -99,6 +99,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
99 .map_io = msm8960_map_io, 99 .map_io = msm8960_map_io,
100 .init_irq = msm8960_init_irq, 100 .init_irq = msm8960_init_irq,
101 .timer = &msm_timer, 101 .timer = &msm_timer,
102 .handle_irq = gic_handle_irq,
102 .init_machine = msm8960_sim_init, 103 .init_machine = msm8960_sim_init,
103MACHINE_END 104MACHINE_END
104 105
@@ -108,6 +109,7 @@ MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
108 .map_io = msm8960_map_io, 109 .map_io = msm8960_map_io,
109 .init_irq = msm8960_init_irq, 110 .init_irq = msm8960_init_irq,
110 .timer = &msm_timer, 111 .timer = &msm_timer,
112 .handle_irq = gic_handle_irq,
111 .init_machine = msm8960_rumi3_init, 113 .init_machine = msm8960_rumi3_init,
112MACHINE_END 114MACHINE_END
113 115
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index 44bf71688373..0a113424632c 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -108,6 +108,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
108 .reserve = msm8x60_reserve, 108 .reserve = msm8x60_reserve,
109 .map_io = msm8x60_map_io, 109 .map_io = msm8x60_map_io,
110 .init_irq = msm8x60_init_irq, 110 .init_irq = msm8x60_init_irq,
111 .handle_irq = gic_handle_irq,
111 .init_machine = msm8x60_init, 112 .init_machine = msm8x60_init,
112 .timer = &msm_timer, 113 .timer = &msm_timer,
113MACHINE_END 114MACHINE_END
@@ -117,6 +118,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
117 .reserve = msm8x60_reserve, 118 .reserve = msm8x60_reserve,
118 .map_io = msm8x60_map_io, 119 .map_io = msm8x60_map_io,
119 .init_irq = msm8x60_init_irq, 120 .init_irq = msm8x60_init_irq,
121 .handle_irq = gic_handle_irq,
120 .init_machine = msm8x60_init, 122 .init_machine = msm8x60_init,
121 .timer = &msm_timer, 123 .timer = &msm_timer,
122MACHINE_END 124MACHINE_END
@@ -126,6 +128,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
126 .reserve = msm8x60_reserve, 128 .reserve = msm8x60_reserve,
127 .map_io = msm8x60_map_io, 129 .map_io = msm8x60_map_io,
128 .init_irq = msm8x60_init_irq, 130 .init_irq = msm8x60_init_irq,
131 .handle_irq = gic_handle_irq,
129 .init_machine = msm8x60_init, 132 .init_machine = msm8x60_init,
130 .timer = &msm_timer, 133 .timer = &msm_timer,
131MACHINE_END 134MACHINE_END
@@ -135,6 +138,7 @@ MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
135 .reserve = msm8x60_reserve, 138 .reserve = msm8x60_reserve,
136 .map_io = msm8x60_map_io, 139 .map_io = msm8x60_map_io,
137 .init_irq = msm8x60_init_irq, 140 .init_irq = msm8x60_init_irq,
141 .handle_irq = gic_handle_irq,
138 .init_machine = msm8x60_init, 142 .init_machine = msm8x60_init,
139 .timer = &msm_timer, 143 .timer = &msm_timer,
140MACHINE_END 144MACHINE_END
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index 32b465763dbd..97b8191d9d38 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -18,7 +18,7 @@
18#include <linux/input.h> 18#include <linux/input.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22 22
23#include <linux/delay.h> 23#include <linux/delay.h>
24 24
diff --git a/arch/arm/mach-msm/devices-iommu.c b/arch/arm/mach-msm/devices-iommu.c
index 24030d0da6e3..0fb7a17df398 100644
--- a/arch/arm/mach-msm/devices-iommu.c
+++ b/arch/arm/mach-msm/devices-iommu.c
@@ -18,6 +18,7 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/bootmem.h> 20#include <linux/bootmem.h>
21#include <linux/module.h>
21#include <mach/irqs.h> 22#include <mach/irqs.h>
22#include <mach/iommu.h> 23#include <mach/iommu.h>
23 24
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
index 717076f3ca73..000000000000
--- a/arch/arm/mach-msm/include/mach/entry-macro-qgic.S
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * Low-level IRQ helper macros
3 *
4 * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <asm/hardware/entry-macro-gic.S>
12
13 .macro disable_fiq
14 .endm
15
16 .macro arch_ret_to_user, tmp1, tmp2
17 .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
index 70563ed11b36..000000000000
--- a/arch/arm/mach-msm/include/mach/entry-macro-vic.S
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Copyright (C) 2007 Google, Inc.
3 * Author: Brian Swetland <swetland@google.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <mach/msm_iomap.h>
17
18 .macro disable_fiq
19 .endm
20
21 .macro get_irqnr_preamble, base, tmp
22 @ enable imprecise aborts
23 cpsie a
24 mov \base, #MSM_VIC_BASE
25 .endm
26
27 .macro arch_ret_to_user, tmp1, tmp2
28 .endm
29
30 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
31 @ 0xD0 has irq# or old irq# if the irq has been handled
32 @ 0xD4 has irq# or -1 if none pending *but* if you just
33 @ read 0xD4 you never get the first irq for some reason
34 ldr \irqnr, [\base, #0xD0]
35 ldr \irqnr, [\base, #0xD4]
36 cmp \irqnr, #0xffffffff
37 .endm
diff --git a/arch/arm/mach-msm/include/mach/entry-macro.S b/arch/arm/mach-msm/include/mach/entry-macro.S
index b16f082eeb6f..41f7003ef34f 100644
--- a/arch/arm/mach-msm/include/mach/entry-macro.S
+++ b/arch/arm/mach-msm/include/mach/entry-macro.S
@@ -16,8 +16,27 @@
16 * 16 *
17 */ 17 */
18 18
19#if defined(CONFIG_ARM_GIC) 19 .macro disable_fiq
20#include <mach/entry-macro-qgic.S> 20 .endm
21#else 21
22#include <mach/entry-macro-vic.S> 22 .macro arch_ret_to_user, tmp1, tmp2
23 .endm
24
25#if !defined(CONFIG_ARM_GIC)
26#include <mach/msm_iomap.h>
27
28 .macro get_irqnr_preamble, base, tmp
29 @ enable imprecise aborts
30 cpsie a
31 mov \base, #MSM_VIC_BASE
32 .endm
33
34 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
35 @ 0xD0 has irq# or old irq# if the irq has been handled
36 @ 0xD4 has irq# or -1 if none pending *but* if you just
37 @ read 0xD4 you never get the first irq for some reason
38 ldr \irqnr, [\base, #0xD0]
39 ldr \irqnr, [\base, #0xD4]
40 cmp \irqnr, #0xffffffff
41 .endm
23#endif 42#endif
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h
index d2e83f42ba16..311db2b35da0 100644
--- a/arch/arm/mach-msm/include/mach/system.h
+++ b/arch/arm/mach-msm/include/mach/system.h
@@ -12,16 +12,8 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 */ 14 */
15
16#include <mach/hardware.h>
17
18void arch_idle(void); 15void arch_idle(void);
19 16
20static inline void arch_reset(char mode, const char *cmd)
21{
22 for (;;) ; /* depends on IPC w/ other core */
23}
24
25/* low level hardware reset hook -- for example, hitting the 17/* low level hardware reset hook -- for example, hitting the
26 * PSHOLD line on the PMIC to hard reset the system 18 * PSHOLD line on the PMIC to hard reset the system
27 */ 19 */
diff --git a/arch/arm/mach-msm/include/mach/vmalloc.h b/arch/arm/mach-msm/include/mach/vmalloc.h
deleted file mode 100644
index d138448eff16..000000000000
--- a/arch/arm/mach-msm/include/mach/vmalloc.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* arch/arm/mach-msm/include/mach/vmalloc.h
2 *
3 * Copyright (C) 2007 Google, Inc.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __ASM_ARCH_MSM_VMALLOC_H
17#define __ASM_ARCH_MSM_VMALLOC_H
18
19#define VMALLOC_END 0xd0000000UL
20
21#endif
22
diff --git a/arch/arm/mach-msm/smd_debug.c b/arch/arm/mach-msm/smd_debug.c
index 8736afff82f3..0c56a5aaf588 100644
--- a/arch/arm/mach-msm/smd_debug.c
+++ b/arch/arm/mach-msm/smd_debug.c
@@ -215,7 +215,7 @@ static const struct file_operations debug_ops = {
215 .llseek = default_llseek, 215 .llseek = default_llseek,
216}; 216};
217 217
218static void debug_create(const char *name, mode_t mode, 218static void debug_create(const char *name, umode_t mode,
219 struct dentry *dent, 219 struct dentry *dent,
220 int (*fill)(char *buf, int max)) 220 int (*fill)(char *buf, int max))
221{ 221{
diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
index 0e94268d6e6f..ee74ec97c141 100644
--- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
+++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
@@ -151,4 +151,5 @@ MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
151 .init_early = mv78xx0_init_early, 151 .init_early = mv78xx0_init_early,
152 .init_irq = mv78xx0_init_irq, 152 .init_irq = mv78xx0_init_irq,
153 .timer = &mv78xx0_timer, 153 .timer = &mv78xx0_timer,
154 .restart = mv78xx0_restart,
154MACHINE_END 155MACHINE_END
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 23d3980ef59d..5b9632b01169 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -401,3 +401,19 @@ void __init mv78xx0_init(void)
401 feroceon_l2_init(is_l2_writethrough()); 401 feroceon_l2_init(is_l2_writethrough());
402#endif 402#endif
403} 403}
404
405void mv78xx0_restart(char mode, const char *cmd)
406{
407 /*
408 * Enable soft reset to assert RSTOUTn.
409 */
410 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
411
412 /*
413 * Assert soft reset.
414 */
415 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
416
417 while (1)
418 ;
419}
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
index 632e63d65e7a..07d5f8f6be7d 100644
--- a/arch/arm/mach-mv78xx0/common.h
+++ b/arch/arm/mach-mv78xx0/common.h
@@ -46,6 +46,7 @@ void mv78xx0_uart1_init(void);
46void mv78xx0_uart2_init(void); 46void mv78xx0_uart2_init(void);
47void mv78xx0_uart3_init(void); 47void mv78xx0_uart3_init(void);
48void mv78xx0_i2c_init(void); 48void mv78xx0_i2c_init(void);
49void mv78xx0_restart(char, const char *);
49 50
50extern struct sys_timer mv78xx0_timer; 51extern struct sys_timer mv78xx0_timer;
51 52
diff --git a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
index 50b85ae2da52..4d6d48bf51ef 100644
--- a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
+++ b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
@@ -99,4 +99,5 @@ MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
99 .init_early = mv78xx0_init_early, 99 .init_early = mv78xx0_init_early,
100 .init_irq = mv78xx0_init_irq, 100 .init_irq = mv78xx0_init_irq,
101 .timer = &mv78xx0_timer, 101 .timer = &mv78xx0_timer,
102 .restart = mv78xx0_restart,
102MACHINE_END 103MACHINE_END
diff --git a/arch/arm/mach-mv78xx0/include/mach/system.h b/arch/arm/mach-mv78xx0/include/mach/system.h
index 66e7ce4e90bd..8c3a5387cec7 100644
--- a/arch/arm/mach-mv78xx0/include/mach/system.h
+++ b/arch/arm/mach-mv78xx0/include/mach/system.h
@@ -9,28 +9,9 @@
9#ifndef __ASM_ARCH_SYSTEM_H 9#ifndef __ASM_ARCH_SYSTEM_H
10#define __ASM_ARCH_SYSTEM_H 10#define __ASM_ARCH_SYSTEM_H
11 11
12#include <mach/bridge-regs.h>
13
14static inline void arch_idle(void) 12static inline void arch_idle(void)
15{ 13{
16 cpu_do_idle(); 14 cpu_do_idle();
17} 15}
18 16
19static inline void arch_reset(char mode, const char *cmd)
20{
21 /*
22 * Enable soft reset to assert RSTOUTn.
23 */
24 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
25
26 /*
27 * Assert soft reset.
28 */
29 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
30
31 while (1)
32 ;
33}
34
35
36#endif 17#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
index ba26fe98e640..000000000000
--- a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-mv78xx0/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
index e85222e53578..9a882706e138 100644
--- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
+++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
@@ -84,4 +84,5 @@ MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
84 .init_early = mv78xx0_init_early, 84 .init_early = mv78xx0_init_early,
85 .init_irq = mv78xx0_init_irq, 85 .init_irq = mv78xx0_init_irq,
86 .timer = &mv78xx0_timer, 86 .timer = &mv78xx0_timer,
87 .restart = mv78xx0_restart,
87MACHINE_END 88MACHINE_END
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
index 1fc110348040..944025da8333 100644
--- a/arch/arm/mach-mx5/board-cpuimx51.c
+++ b/arch/arm/mach-mx5/board-cpuimx51.c
@@ -297,4 +297,5 @@ MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
297 .handle_irq = imx51_handle_irq, 297 .handle_irq = imx51_handle_irq,
298 .timer = &mxc_timer, 298 .timer = &mxc_timer,
299 .init_machine = eukrea_cpuimx51_init, 299 .init_machine = eukrea_cpuimx51_init,
300 .restart = mxc_restart,
300MACHINE_END 301MACHINE_END
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
index 52a11c1898e6..9fbe923c8b08 100644
--- a/arch/arm/mach-mx5/board-cpuimx51sd.c
+++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
@@ -335,4 +335,5 @@ MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
335 .handle_irq = imx51_handle_irq, 335 .handle_irq = imx51_handle_irq,
336 .timer = &mxc_timer, 336 .timer = &mxc_timer,
337 .init_machine = eukrea_cpuimx51sd_init, 337 .init_machine = eukrea_cpuimx51sd_init,
338 .restart = mxc_restart,
338MACHINE_END 339MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c
index fc3621d90bde..42b66e8d9615 100644
--- a/arch/arm/mach-mx5/board-mx50_rdp.c
+++ b/arch/arm/mach-mx5/board-mx50_rdp.c
@@ -222,4 +222,5 @@ MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform")
222 .handle_irq = imx50_handle_irq, 222 .handle_irq = imx50_handle_irq,
223 .timer = &mx50_rdp_timer, 223 .timer = &mx50_rdp_timer,
224 .init_machine = mx50_rdp_board_init, 224 .init_machine = mx50_rdp_board_init,
225 .restart = mxc_restart,
225MACHINE_END 226MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c
index 05783906db2b..83eab4176ca4 100644
--- a/arch/arm/mach-mx5/board-mx51_3ds.c
+++ b/arch/arm/mach-mx5/board-mx51_3ds.c
@@ -175,4 +175,5 @@ MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
175 .handle_irq = imx51_handle_irq, 175 .handle_irq = imx51_handle_irq,
176 .timer = &mx51_3ds_timer, 176 .timer = &mx51_3ds_timer,
177 .init_machine = mx51_3ds_init, 177 .init_machine = mx51_3ds_init,
178 .restart = mxc_restart,
178MACHINE_END 179MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index 5c837603ff0f..e4b822e9f719 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -362,7 +362,7 @@ static void __init mx51_babbage_init(void)
362{ 362{
363 iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; 363 iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
364 iomux_v3_cfg_t power_key = NEW_PAD_CTRL(MX51_PAD_EIM_A27__GPIO2_21, 364 iomux_v3_cfg_t power_key = NEW_PAD_CTRL(MX51_PAD_EIM_A27__GPIO2_21,
365 PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP); 365 PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH);
366 366
367 imx51_soc_init(); 367 imx51_soc_init();
368 368
@@ -426,4 +426,5 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
426 .handle_irq = imx51_handle_irq, 426 .handle_irq = imx51_handle_irq,
427 .timer = &mx51_babbage_timer, 427 .timer = &mx51_babbage_timer,
428 .init_machine = mx51_babbage_init, 428 .init_machine = mx51_babbage_init,
429 .restart = mxc_restart,
429MACHINE_END 430MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c
index a9e48662cf75..3a5ed2dd885a 100644
--- a/arch/arm/mach-mx5/board-mx51_efikamx.c
+++ b/arch/arm/mach-mx5/board-mx51_efikamx.c
@@ -182,7 +182,7 @@ static const struct gpio_keys_platform_data mx51_efikamx_powerkey_data __initcon
182 .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey), 182 .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey),
183}; 183};
184 184
185void mx51_efikamx_reset(void) 185static void mx51_efikamx_restart(char mode, const char *cmd)
186{ 186{
187 if (system_rev == 0x11) 187 if (system_rev == 0x11)
188 gpio_direction_output(EFIKAMX_RESET1_1, 0); 188 gpio_direction_output(EFIKAMX_RESET1_1, 0);
@@ -292,4 +292,5 @@ MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop")
292 .handle_irq = imx51_handle_irq, 292 .handle_irq = imx51_handle_irq,
293 .timer = &mx51_efikamx_timer, 293 .timer = &mx51_efikamx_timer,
294 .init_machine = mx51_efikamx_init, 294 .init_machine = mx51_efikamx_init,
295 .restart = mx51_efikamx_restart,
295MACHINE_END 296MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_efikasb.c b/arch/arm/mach-mx5/board-mx51_efikasb.c
index 38c4a3e28d3c..ea5f65b0381a 100644
--- a/arch/arm/mach-mx5/board-mx51_efikasb.c
+++ b/arch/arm/mach-mx5/board-mx51_efikasb.c
@@ -287,4 +287,5 @@ MACHINE_START(MX51_EFIKASB, "Genesi Efika Smartbook")
287 .handle_irq = imx51_handle_irq, 287 .handle_irq = imx51_handle_irq,
288 .init_machine = efikasb_board_init, 288 .init_machine = efikasb_board_init,
289 .timer = &mx51_efikasb_timer, 289 .timer = &mx51_efikasb_timer,
290 .restart = mxc_restart,
290MACHINE_END 291MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c
index 0d7f0fffb23a..5f224f1c3eb6 100644
--- a/arch/arm/mach-mx5/board-mx53_ard.c
+++ b/arch/arm/mach-mx5/board-mx53_ard.c
@@ -257,4 +257,5 @@ MACHINE_START(MX53_ARD, "Freescale MX53 ARD Board")
257 .handle_irq = imx53_handle_irq, 257 .handle_irq = imx53_handle_irq,
258 .timer = &mx53_ard_timer, 258 .timer = &mx53_ard_timer,
259 .init_machine = mx53_ard_board_init, 259 .init_machine = mx53_ard_board_init,
260 .restart = mxc_restart,
260MACHINE_END 261MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c
index 6bea31ab8f85..d6ce137896d6 100644
--- a/arch/arm/mach-mx5/board-mx53_evk.c
+++ b/arch/arm/mach-mx5/board-mx53_evk.c
@@ -106,7 +106,7 @@ static inline void mx53_evk_fec_reset(void)
106 gpio_set_value(MX53_EVK_FEC_PHY_RST, 1); 106 gpio_set_value(MX53_EVK_FEC_PHY_RST, 1);
107} 107}
108 108
109static struct fec_platform_data mx53_evk_fec_pdata = { 109static const struct fec_platform_data mx53_evk_fec_pdata __initconst = {
110 .phy = PHY_INTERFACE_MODE_RMII, 110 .phy = PHY_INTERFACE_MODE_RMII,
111}; 111};
112 112
@@ -175,4 +175,5 @@ MACHINE_START(MX53_EVK, "Freescale MX53 EVK Board")
175 .handle_irq = imx53_handle_irq, 175 .handle_irq = imx53_handle_irq,
176 .timer = &mx53_evk_timer, 176 .timer = &mx53_evk_timer,
177 .init_machine = mx53_evk_board_init, 177 .init_machine = mx53_evk_board_init,
178 .restart = mxc_restart,
178MACHINE_END 179MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index 7678f7734db6..fd8b524e1c58 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -242,7 +242,7 @@ static inline void mx53_loco_fec_reset(void)
242 gpio_set_value(LOCO_FEC_PHY_RST, 1); 242 gpio_set_value(LOCO_FEC_PHY_RST, 1);
243} 243}
244 244
245static struct fec_platform_data mx53_loco_fec_data = { 245static const struct fec_platform_data mx53_loco_fec_data __initconst = {
246 .phy = PHY_INTERFACE_MODE_RMII, 246 .phy = PHY_INTERFACE_MODE_RMII,
247}; 247};
248 248
@@ -317,4 +317,5 @@ MACHINE_START(MX53_LOCO, "Freescale MX53 LOCO Board")
317 .handle_irq = imx53_handle_irq, 317 .handle_irq = imx53_handle_irq,
318 .timer = &mx53_loco_timer, 318 .timer = &mx53_loco_timer,
319 .init_machine = mx53_loco_board_init, 319 .init_machine = mx53_loco_board_init,
320 .restart = mxc_restart,
320MACHINE_END 321MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
index 59c0845eb4a6..22c53c9b18aa 100644
--- a/arch/arm/mach-mx5/board-mx53_smd.c
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
@@ -104,7 +104,7 @@ static inline void mx53_smd_fec_reset(void)
104 gpio_set_value(SMD_FEC_PHY_RST, 1); 104 gpio_set_value(SMD_FEC_PHY_RST, 1);
105} 105}
106 106
107static struct fec_platform_data mx53_smd_fec_data = { 107static const struct fec_platform_data mx53_smd_fec_data __initconst = {
108 .phy = PHY_INTERFACE_MODE_RMII, 108 .phy = PHY_INTERFACE_MODE_RMII,
109}; 109};
110 110
@@ -164,4 +164,5 @@ MACHINE_START(MX53_SMD, "Freescale MX53 SMD Board")
164 .handle_irq = imx53_handle_irq, 164 .handle_irq = imx53_handle_irq,
165 .timer = &mx53_smd_timer, 165 .timer = &mx53_smd_timer,
166 .init_machine = mx53_smd_board_init, 166 .init_machine = mx53_smd_board_init,
167 .restart = mxc_restart,
167MACHINE_END 168MACHINE_END
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
index 5c5328257dca..5e2e7a843860 100644
--- a/arch/arm/mach-mx5/cpu.c
+++ b/arch/arm/mach-mx5/cpu.c
@@ -16,7 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19#include <asm/io.h> 19#include <linux/io.h>
20 20
21static int mx5_cpu_rev = -1; 21static int mx5_cpu_rev = -1;
22 22
@@ -67,7 +67,8 @@ static int __init mx51_neon_fixup(void)
67 if (!cpu_is_mx51()) 67 if (!cpu_is_mx51())
68 return 0; 68 return 0;
69 69
70 if (mx51_revision() < IMX_CHIP_REVISION_3_0 && (elf_hwcap & HWCAP_NEON)) { 70 if (mx51_revision() < IMX_CHIP_REVISION_3_0 &&
71 (elf_hwcap & HWCAP_NEON)) {
71 elf_hwcap &= ~HWCAP_NEON; 72 elf_hwcap &= ~HWCAP_NEON;
72 pr_info("Turning off NEON support, detected broken NEON implementation\n"); 73 pr_info("Turning off NEON support, detected broken NEON implementation\n");
73 } 74 }
diff --git a/arch/arm/mach-mx5/imx51-dt.c b/arch/arm/mach-mx5/imx51-dt.c
index ccc61585659b..e6bad17b908c 100644
--- a/arch/arm/mach-mx5/imx51-dt.c
+++ b/arch/arm/mach-mx5/imx51-dt.c
@@ -44,20 +44,22 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
44 { /* sentinel */ } 44 { /* sentinel */ }
45}; 45};
46 46
47static void __init imx51_tzic_add_irq_domain(struct device_node *np, 47static int __init imx51_tzic_add_irq_domain(struct device_node *np,
48 struct device_node *interrupt_parent) 48 struct device_node *interrupt_parent)
49{ 49{
50 irq_domain_add_simple(np, 0); 50 irq_domain_add_simple(np, 0);
51 return 0;
51} 52}
52 53
53static void __init imx51_gpio_add_irq_domain(struct device_node *np, 54static int __init imx51_gpio_add_irq_domain(struct device_node *np,
54 struct device_node *interrupt_parent) 55 struct device_node *interrupt_parent)
55{ 56{
56 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - 57 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
57 32 * 4; /* imx51 gets 4 gpio ports */
58 58
59 gpio_irq_base -= 32;
59 irq_domain_add_simple(np, gpio_irq_base); 60 irq_domain_add_simple(np, gpio_irq_base);
60 gpio_irq_base += 32; 61
62 return 0;
61} 63}
62 64
63static const struct of_device_id imx51_irq_match[] __initconst = { 65static const struct of_device_id imx51_irq_match[] __initconst = {
@@ -113,4 +115,5 @@ DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
113 .timer = &imx51_timer, 115 .timer = &imx51_timer,
114 .init_machine = imx51_dt_init, 116 .init_machine = imx51_dt_init,
115 .dt_compat = imx51_dt_board_compat, 117 .dt_compat = imx51_dt_board_compat,
118 .restart = mxc_restart,
116MACHINE_END 119MACHINE_END
diff --git a/arch/arm/mach-mx5/imx53-dt.c b/arch/arm/mach-mx5/imx53-dt.c
index ccaa0b81b768..05ebb3e68679 100644
--- a/arch/arm/mach-mx5/imx53-dt.c
+++ b/arch/arm/mach-mx5/imx53-dt.c
@@ -48,20 +48,22 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = {
48 { /* sentinel */ } 48 { /* sentinel */ }
49}; 49};
50 50
51static void __init imx53_tzic_add_irq_domain(struct device_node *np, 51static int __init imx53_tzic_add_irq_domain(struct device_node *np,
52 struct device_node *interrupt_parent) 52 struct device_node *interrupt_parent)
53{ 53{
54 irq_domain_add_simple(np, 0); 54 irq_domain_add_simple(np, 0);
55 return 0;
55} 56}
56 57
57static void __init imx53_gpio_add_irq_domain(struct device_node *np, 58static int __init imx53_gpio_add_irq_domain(struct device_node *np,
58 struct device_node *interrupt_parent) 59 struct device_node *interrupt_parent)
59{ 60{
60 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - 61 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
61 32 * 7; /* imx53 gets 7 gpio ports */
62 62
63 gpio_irq_base -= 32;
63 irq_domain_add_simple(np, gpio_irq_base); 64 irq_domain_add_simple(np, gpio_irq_base);
64 gpio_irq_base += 32; 65
66 return 0;
65} 67}
66 68
67static const struct of_device_id imx53_irq_match[] __initconst = { 69static const struct of_device_id imx53_irq_match[] __initconst = {
@@ -123,4 +125,5 @@ DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)")
123 .timer = &imx53_timer, 125 .timer = &imx53_timer,
124 .init_machine = imx53_dt_init, 126 .init_machine = imx53_dt_init,
125 .dt_compat = imx53_dt_board_compat, 127 .dt_compat = imx53_dt_board_compat,
128 .restart = mxc_restart,
126MACHINE_END 129MACHINE_END
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 26eacc9d0d90..df4a508f240a 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -23,7 +23,9 @@
23 23
24static void imx5_idle(void) 24static void imx5_idle(void)
25{ 25{
26 mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF); 26 if (!need_resched())
27 mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
28 local_irq_enable();
27} 29}
28 30
29/* 31/*
@@ -89,7 +91,7 @@ void __init imx51_init_early(void)
89 mxc_set_cpu_type(MXC_CPU_MX51); 91 mxc_set_cpu_type(MXC_CPU_MX51);
90 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR)); 92 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
91 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR)); 93 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR));
92 imx_idle = imx5_idle; 94 pm_idle = imx5_idle;
93} 95}
94 96
95void __init imx53_init_early(void) 97void __init imx53_init_early(void)
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 229ae3494216..da6e4aad177c 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -404,7 +404,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \
404 reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ 404 reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \
405 reg &= ~BM_CLKCTRL_##dr##_DIV; \ 405 reg &= ~BM_CLKCTRL_##dr##_DIV; \
406 reg |= div << BP_CLKCTRL_##dr##_DIV; \ 406 reg |= div << BP_CLKCTRL_##dr##_DIV; \
407 if (reg | (1 << clk->enable_shift)) { \ 407 if (reg & (1 << clk->enable_shift)) { \
408 pr_err("%s: clock is gated\n", __func__); \ 408 pr_err("%s: clock is gated\n", __func__); \
409 return -EINVAL; \ 409 return -EINVAL; \
410 } \ 410 } \
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index 635bb5d9a20a..1388485414c9 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -16,6 +16,7 @@ struct clk;
16extern const u32 *mxs_get_ocotp(void); 16extern const u32 *mxs_get_ocotp(void);
17extern int mxs_reset_block(void __iomem *); 17extern int mxs_reset_block(void __iomem *);
18extern void mxs_timer_init(struct clk *, int); 18extern void mxs_timer_init(struct clk *, int);
19extern void mxs_restart(char, const char *);
19 20
20extern int mx23_register_gpios(void); 21extern int mx23_register_gpios(void);
21extern int mx23_clocks_init(void); 22extern int mx23_clocks_init(void);
diff --git a/arch/arm/mach-mxs/include/mach/mx28.h b/arch/arm/mach-mxs/include/mach/mx28.h
index 75d86118b76a..30c7990f3c01 100644
--- a/arch/arm/mach-mxs/include/mach/mx28.h
+++ b/arch/arm/mach-mxs/include/mach/mx28.h
@@ -104,8 +104,8 @@
104#define MX28_INT_CAN1 9 104#define MX28_INT_CAN1 9
105#define MX28_INT_LRADC_TOUCH 10 105#define MX28_INT_LRADC_TOUCH 10
106#define MX28_INT_HSADC 13 106#define MX28_INT_HSADC 13
107#define MX28_INT_IRADC_THRESH0 14 107#define MX28_INT_LRADC_THRESH0 14
108#define MX28_INT_IRADC_THRESH1 15 108#define MX28_INT_LRADC_THRESH1 15
109#define MX28_INT_LRADC_CH0 16 109#define MX28_INT_LRADC_CH0 16
110#define MX28_INT_LRADC_CH1 17 110#define MX28_INT_LRADC_CH1 17
111#define MX28_INT_LRADC_CH2 18 111#define MX28_INT_LRADC_CH2 18
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h
index 0d2d2b470998..bde5f6634747 100644
--- a/arch/arm/mach-mxs/include/mach/mxs.h
+++ b/arch/arm/mach-mxs/include/mach/mxs.h
@@ -30,6 +30,7 @@
30 */ 30 */
31#define cpu_is_mx23() ( \ 31#define cpu_is_mx23() ( \
32 machine_is_mx23evk() || \ 32 machine_is_mx23evk() || \
33 machine_is_stmp378x() || \
33 0) 34 0)
34#define cpu_is_mx28() ( \ 35#define cpu_is_mx28() ( \
35 machine_is_mx28evk() || \ 36 machine_is_mx28evk() || \
diff --git a/arch/arm/mach-mxs/include/mach/system.h b/arch/arm/mach-mxs/include/mach/system.h
index 0e428239b433..e7ad1bb29423 100644
--- a/arch/arm/mach-mxs/include/mach/system.h
+++ b/arch/arm/mach-mxs/include/mach/system.h
@@ -22,6 +22,4 @@ static inline void arch_idle(void)
22 cpu_do_idle(); 22 cpu_do_idle();
23} 23}
24 24
25void arch_reset(char mode, const char *cmd);
26
27#endif /* __MACH_MXS_SYSTEM_H__ */ 25#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
index 103b0165ed0b..000000000000
--- a/arch/arm/mach-mxs/include/mach/vmalloc.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright (C) 2000 Russell King.
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __MACH_MXS_VMALLOC_H__
17#define __MACH_MXS_VMALLOC_H__
18
19/* vmalloc ending address */
20#define VMALLOC_END 0xf4000000UL
21
22#endif /* __MACH_MXS_VMALLOC_H__ */
diff --git a/arch/arm/mach-mxs/mach-m28evk.c b/arch/arm/mach-mxs/mach-m28evk.c
index 3b1681e4f49a..2f2758230edf 100644
--- a/arch/arm/mach-mxs/mach-m28evk.c
+++ b/arch/arm/mach-mxs/mach-m28evk.c
@@ -361,6 +361,7 @@ static struct sys_timer m28evk_timer = {
361MACHINE_START(M28EVK, "DENX M28 EVK") 361MACHINE_START(M28EVK, "DENX M28 EVK")
362 .map_io = mx28_map_io, 362 .map_io = mx28_map_io,
363 .init_irq = mx28_init_irq, 363 .init_irq = mx28_init_irq,
364 .init_machine = m28evk_init,
365 .timer = &m28evk_timer, 364 .timer = &m28evk_timer,
365 .init_machine = m28evk_init,
366 .restart = mxs_restart,
366MACHINE_END 367MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c
index c325fbe4e4c6..5ea1c57d2606 100644
--- a/arch/arm/mach-mxs/mach-mx23evk.c
+++ b/arch/arm/mach-mxs/mach-mx23evk.c
@@ -184,4 +184,5 @@ MACHINE_START(MX23EVK, "Freescale MX23 EVK")
184 .init_irq = mx23_init_irq, 184 .init_irq = mx23_init_irq,
185 .timer = &mx23evk_timer, 185 .timer = &mx23evk_timer,
186 .init_machine = mx23evk_init, 186 .init_machine = mx23evk_init,
187 .restart = mxs_restart,
187MACHINE_END 188MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index 064ec5abaa55..d0cc37fd23a4 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -501,4 +501,5 @@ MACHINE_START(MX28EVK, "Freescale MX28 EVK")
501 .init_irq = mx28_init_irq, 501 .init_irq = mx28_init_irq,
502 .timer = &mx28evk_timer, 502 .timer = &mx28evk_timer,
503 .init_machine = mx28evk_init, 503 .init_machine = mx28evk_init,
504 .restart = mxs_restart,
504MACHINE_END 505MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c
index 177e53123a02..a626c07b8713 100644
--- a/arch/arm/mach-mxs/mach-stmp378x_devb.c
+++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c
@@ -115,6 +115,7 @@ static struct sys_timer stmp378x_dvb_timer = {
115MACHINE_START(STMP378X, "STMP378X") 115MACHINE_START(STMP378X, "STMP378X")
116 .map_io = mx23_map_io, 116 .map_io = mx23_map_io,
117 .init_irq = mx23_init_irq, 117 .init_irq = mx23_init_irq,
118 .init_machine = stmp378x_dvb_init,
119 .timer = &stmp378x_dvb_timer, 118 .timer = &stmp378x_dvb_timer,
119 .init_machine = stmp378x_dvb_init,
120 .restart = mxs_restart,
120MACHINE_END 121MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c
index 9a1f0e7a338e..2c0862e655ee 100644
--- a/arch/arm/mach-mxs/mach-tx28.c
+++ b/arch/arm/mach-mxs/mach-tx28.c
@@ -178,4 +178,5 @@ MACHINE_START(TX28, "Ka-Ro electronics TX28 module")
178 .init_irq = mx28_init_irq, 178 .init_irq = mx28_init_irq,
179 .timer = &tx28_timer, 179 .timer = &tx28_timer,
180 .init_machine = tx28_stk5v3_init, 180 .init_machine = tx28_stk5v3_init,
181 .restart = mxs_restart,
181MACHINE_END 182MACHINE_END
diff --git a/arch/arm/mach-mxs/module-tx28.c b/arch/arm/mach-mxs/module-tx28.c
index 0fcff47009cf..9a7b08b2a925 100644
--- a/arch/arm/mach-mxs/module-tx28.c
+++ b/arch/arm/mach-mxs/module-tx28.c
@@ -66,11 +66,11 @@ static const iomux_cfg_t tx28_fec1_pads[] __initconst = {
66 MX28_PAD_ENET0_CRS__ENET1_RX_EN, 66 MX28_PAD_ENET0_CRS__ENET1_RX_EN,
67}; 67};
68 68
69static struct fec_platform_data tx28_fec0_data = { 69static const struct fec_platform_data tx28_fec0_data __initconst = {
70 .phy = PHY_INTERFACE_MODE_RMII, 70 .phy = PHY_INTERFACE_MODE_RMII,
71}; 71};
72 72
73static struct fec_platform_data tx28_fec1_data = { 73static const struct fec_platform_data tx28_fec1_data __initconst = {
74 .phy = PHY_INTERFACE_MODE_RMII, 74 .phy = PHY_INTERFACE_MODE_RMII,
75}; 75};
76 76
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c
index 20ec3bddf7cd..b936633b7682 100644
--- a/arch/arm/mach-mxs/system.c
+++ b/arch/arm/mach-mxs/system.c
@@ -42,7 +42,7 @@ static void __iomem *mxs_clkctrl_reset_addr;
42/* 42/*
43 * Reset the system. It is called by machine_restart(). 43 * Reset the system. It is called by machine_restart().
44 */ 44 */
45void arch_reset(char mode, const char *cmd) 45void mxs_restart(char mode, const char *cmd)
46{ 46{
47 /* reset the chip */ 47 /* reset the chip */
48 __mxs_setl(MXS_CLKCTRL_RESET_CHIP, mxs_clkctrl_reset_addr); 48 __mxs_setl(MXS_CLKCTRL_RESET_CHIP, mxs_clkctrl_reset_addr);
@@ -53,7 +53,7 @@ void arch_reset(char mode, const char *cmd)
53 mdelay(50); 53 mdelay(50);
54 54
55 /* We'll take a jump through zero as a poor second */ 55 /* We'll take a jump through zero as a poor second */
56 cpu_reset(0); 56 soft_restart(0);
57} 57}
58 58
59static int __init mxs_arch_reset_init(void) 59static int __init mxs_arch_reset_init(void)
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index 00023b5cf12b..59e67979f197 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -187,3 +187,8 @@ static int __init netx_init(void)
187 187
188subsys_initcall(netx_init); 188subsys_initcall(netx_init);
189 189
190void netx_restart(char mode, const char *cmd)
191{
192 writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
193 NETX_SYSTEM_RES_CR);
194}
diff --git a/arch/arm/mach-netx/generic.h b/arch/arm/mach-netx/generic.h
index ede2d35341c3..9b915119b8d6 100644
--- a/arch/arm/mach-netx/generic.h
+++ b/arch/arm/mach-netx/generic.h
@@ -19,6 +19,7 @@
19 19
20extern void __init netx_map_io(void); 20extern void __init netx_map_io(void);
21extern void __init netx_init_irq(void); 21extern void __init netx_init_irq(void);
22extern void netx_restart(char, const char *);
22 23
23struct sys_timer; 24struct sys_timer;
24extern struct sys_timer netx_timer; 25extern struct sys_timer netx_timer;
diff --git a/arch/arm/mach-netx/include/mach/entry-macro.S b/arch/arm/mach-netx/include/mach/entry-macro.S
index 844f1f9acbdf..6e9f1cbe1634 100644
--- a/arch/arm/mach-netx/include/mach/entry-macro.S
+++ b/arch/arm/mach-netx/include/mach/entry-macro.S
@@ -18,22 +18,9 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21#include <mach/hardware.h>
22 21
23 .macro disable_fiq 22 .macro disable_fiq
24 .endm 23 .endm
25 24
26 .macro get_irqnr_preamble, base, tmp
27 ldr \base, =io_p2v(0x001ff000)
28 .endm
29
30 .macro arch_ret_to_user, tmp1, tmp2 25 .macro arch_ret_to_user, tmp1, tmp2
31 .endm 26 .endm
32
33 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
34 ldr \irqstat, [\base, #0]
35 clz \irqnr, \irqstat
36 rsb \irqnr, \irqnr, #31
37 cmp \irqstat, #0
38 .endm
39
diff --git a/arch/arm/mach-netx/include/mach/system.h b/arch/arm/mach-netx/include/mach/system.h
index dc7b4bc003c5..b38fa36d58c4 100644
--- a/arch/arm/mach-netx/include/mach/system.h
+++ b/arch/arm/mach-netx/include/mach/system.h
@@ -19,20 +19,10 @@
19#ifndef __ASM_ARCH_SYSTEM_H 19#ifndef __ASM_ARCH_SYSTEM_H
20#define __ASM_ARCH_SYSTEM_H 20#define __ASM_ARCH_SYSTEM_H
21 21
22#include <linux/io.h>
23#include <mach/hardware.h>
24#include "netx-regs.h"
25
26static inline void arch_idle(void) 22static inline void arch_idle(void)
27{ 23{
28 cpu_do_idle(); 24 cpu_do_idle();
29} 25}
30 26
31static inline void arch_reset(char mode, const char *cmd)
32{
33 writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
34 NETX_SYSTEM_RES_CR);
35}
36
37#endif 27#endif
38 28
diff --git a/arch/arm/mach-netx/include/mach/vmalloc.h b/arch/arm/mach-netx/include/mach/vmalloc.h
deleted file mode 100644
index 871f1ef7bff5..000000000000
--- a/arch/arm/mach-netx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-netx/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#define VMALLOC_END 0xd0000000UL
diff --git a/arch/arm/mach-netx/nxdb500.c b/arch/arm/mach-netx/nxdb500.c
index 90903dd44cbc..180ea899a48a 100644
--- a/arch/arm/mach-netx/nxdb500.c
+++ b/arch/arm/mach-netx/nxdb500.c
@@ -28,6 +28,7 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h>
31#include <mach/netx-regs.h> 32#include <mach/netx-regs.h>
32#include <mach/eth.h> 33#include <mach/eth.h>
33 34
@@ -203,6 +204,8 @@ MACHINE_START(NXDB500, "Hilscher nxdb500")
203 .atag_offset = 0x100, 204 .atag_offset = 0x100,
204 .map_io = netx_map_io, 205 .map_io = netx_map_io,
205 .init_irq = netx_init_irq, 206 .init_irq = netx_init_irq,
207 .handle_irq = vic_handle_irq,
206 .timer = &netx_timer, 208 .timer = &netx_timer,
207 .init_machine = nxdb500_init, 209 .init_machine = nxdb500_init,
210 .restart = netx_restart,
208MACHINE_END 211MACHINE_END
diff --git a/arch/arm/mach-netx/nxdkn.c b/arch/arm/mach-netx/nxdkn.c
index c63384aba500..58009e29b20e 100644
--- a/arch/arm/mach-netx/nxdkn.c
+++ b/arch/arm/mach-netx/nxdkn.c
@@ -28,6 +28,7 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h>
31#include <mach/netx-regs.h> 32#include <mach/netx-regs.h>
32#include <mach/eth.h> 33#include <mach/eth.h>
33 34
@@ -96,6 +97,8 @@ MACHINE_START(NXDKN, "Hilscher nxdkn")
96 .atag_offset = 0x100, 97 .atag_offset = 0x100,
97 .map_io = netx_map_io, 98 .map_io = netx_map_io,
98 .init_irq = netx_init_irq, 99 .init_irq = netx_init_irq,
100 .handle_irq = vic_handle_irq,
99 .timer = &netx_timer, 101 .timer = &netx_timer,
100 .init_machine = nxdkn_init, 102 .init_machine = nxdkn_init,
103 .restart = netx_restart,
101MACHINE_END 104MACHINE_END
diff --git a/arch/arm/mach-netx/nxeb500hmi.c b/arch/arm/mach-netx/nxeb500hmi.c
index 8f548ec83ad2..122e99826ef6 100644
--- a/arch/arm/mach-netx/nxeb500hmi.c
+++ b/arch/arm/mach-netx/nxeb500hmi.c
@@ -28,6 +28,7 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h>
31#include <mach/netx-regs.h> 32#include <mach/netx-regs.h>
32#include <mach/eth.h> 33#include <mach/eth.h>
33 34
@@ -180,6 +181,8 @@ MACHINE_START(NXEB500HMI, "Hilscher nxeb500hmi")
180 .atag_offset = 0x100, 181 .atag_offset = 0x100,
181 .map_io = netx_map_io, 182 .map_io = netx_map_io,
182 .init_irq = netx_init_irq, 183 .init_irq = netx_init_irq,
184 .handle_irq = vic_handle_irq,
183 .timer = &netx_timer, 185 .timer = &netx_timer,
184 .init_machine = nxeb500hmi_init, 186 .init_machine = nxeb500hmi_init,
187 .restart = netx_restart,
185MACHINE_END 188MACHINE_END
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index 0cbb74c96ef7..7c878bf00340 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -21,6 +21,7 @@
21#include <linux/mtd/onenand.h> 21#include <linux/mtd/onenand.h>
22#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <asm/hardware/vic.h>
24#include <asm/sizes.h> 25#include <asm/sizes.h>
25#include <asm/mach-types.h> 26#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -34,6 +35,8 @@
34#include <mach/nand.h> 35#include <mach/nand.h>
35#include <mach/fsmc.h> 36#include <mach/fsmc.h>
36 37
38#include "cpu-8815.h"
39
37/* Initial value for SRC control register: all timers use MXTAL/8 source */ 40/* Initial value for SRC control register: all timers use MXTAL/8 source */
38#define SRC_CR_INIT_MASK 0x00007fff 41#define SRC_CR_INIT_MASK 0x00007fff
39#define SRC_CR_INIT_VAL 0x2aaa8000 42#define SRC_CR_INIT_VAL 0x2aaa8000
@@ -280,6 +283,8 @@ MACHINE_START(NOMADIK, "NHK8815")
280 .atag_offset = 0x100, 283 .atag_offset = 0x100,
281 .map_io = cpu8815_map_io, 284 .map_io = cpu8815_map_io,
282 .init_irq = cpu8815_init_irq, 285 .init_irq = cpu8815_init_irq,
286 .handle_irq = vic_handle_irq,
283 .timer = &nomadik_timer, 287 .timer = &nomadik_timer,
284 .init_machine = nhk8815_platform_init, 288 .init_machine = nhk8815_platform_init,
289 .restart = cpu8815_restart,
285MACHINE_END 290MACHINE_END
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index dc67717db6f0..65df7b4fdd3e 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -21,6 +21,7 @@
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/amba/bus.h> 22#include <linux/amba/bus.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h>
24 25
25#include <plat/gpio-nomadik.h> 26#include <plat/gpio-nomadik.h>
26#include <mach/hardware.h> 27#include <mach/hardware.h>
@@ -32,6 +33,7 @@
32#include <asm/hardware/cache-l2x0.h> 33#include <asm/hardware/cache-l2x0.h>
33 34
34#include "clock.h" 35#include "clock.h"
36#include "cpu-8815.h"
35 37
36#define __MEM_4K_RESOURCE(x) \ 38#define __MEM_4K_RESOURCE(x) \
37 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} 39 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
@@ -164,3 +166,13 @@ void __init cpu8815_init_irq(void)
164#endif 166#endif
165 return; 167 return;
166} 168}
169
170void cpu8815_restart(char mode, const char *cmd)
171{
172 void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
173
174 /* FIXME: use egpio when implemented */
175
176 /* Write anything to Reset status register */
177 writel(1, src_rstsr);
178}
diff --git a/arch/arm/mach-nomadik/cpu-8815.h b/arch/arm/mach-nomadik/cpu-8815.h
new file mode 100644
index 000000000000..71c21e8a11dc
--- /dev/null
+++ b/arch/arm/mach-nomadik/cpu-8815.h
@@ -0,0 +1,4 @@
1extern void cpu8815_map_io(void);
2extern void cpu8815_platform_init(void);
3extern void cpu8815_init_irq(void);
4extern void cpu8815_restart(char, const char *);
diff --git a/arch/arm/mach-nomadik/include/mach/entry-macro.S b/arch/arm/mach-nomadik/include/mach/entry-macro.S
index 49f1aa3bb420..98ea1c1fbbab 100644
--- a/arch/arm/mach-nomadik/include/mach/entry-macro.S
+++ b/arch/arm/mach-nomadik/include/mach/entry-macro.S
@@ -6,38 +6,8 @@
6 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
7 */ 7 */
8 8
9#include <mach/hardware.h>
10#include <mach/irqs.h>
11
12 .macro disable_fiq 9 .macro disable_fiq
13 .endm 10 .endm
14 11
15 .macro get_irqnr_preamble, base, tmp
16 ldr \base, =IO_ADDRESS(NOMADIK_IC_BASE)
17 .endm
18
19 .macro arch_ret_to_user, tmp1, tmp2 12 .macro arch_ret_to_user, tmp1, tmp2
20 .endm 13 .endm
21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23
24 /* This stanza gets the irq mask from one of two status registers */
25 mov \irqnr, #0
26 ldr \irqstat, [\base, #VIC_REG_IRQSR0] @ get masked status
27 cmp \irqstat, #0
28 bne 1001f
29 add \irqnr, \irqnr, #32
30 ldr \irqstat, [\base, #VIC_REG_IRQSR1] @ get masked status
31
321001: tst \irqstat, #15
33 bne 1002f
34 add \irqnr, \irqnr, #4
35 movs \irqstat, \irqstat, lsr #4
36 bne 1001b
371002: tst \irqstat, #1
38 bne 1003f
39 add \irqnr, \irqnr, #1
40 movs \irqstat, \irqstat, lsr #1
41 bne 1002b
421003: /* EQ will be set if no irqs pending */
43 .endm
diff --git a/arch/arm/mach-nomadik/include/mach/setup.h b/arch/arm/mach-nomadik/include/mach/setup.h
index b7897edf1f35..bcaeaf41c053 100644
--- a/arch/arm/mach-nomadik/include/mach/setup.h
+++ b/arch/arm/mach-nomadik/include/mach/setup.h
@@ -12,9 +12,6 @@
12 12
13#ifdef CONFIG_NOMADIK_8815 13#ifdef CONFIG_NOMADIK_8815
14 14
15extern void cpu8815_map_io(void);
16extern void cpu8815_platform_init(void);
17extern void cpu8815_init_irq(void);
18extern void nmdk_timer_init(void); 15extern void nmdk_timer_init(void);
19 16
20#endif /* NOMADIK_8815 */ 17#endif /* NOMADIK_8815 */
diff --git a/arch/arm/mach-nomadik/include/mach/system.h b/arch/arm/mach-nomadik/include/mach/system.h
index 7119f688116e..25e198b8976c 100644
--- a/arch/arm/mach-nomadik/include/mach/system.h
+++ b/arch/arm/mach-nomadik/include/mach/system.h
@@ -20,9 +20,6 @@
20#ifndef __ASM_ARCH_SYSTEM_H 20#ifndef __ASM_ARCH_SYSTEM_H
21#define __ASM_ARCH_SYSTEM_H 21#define __ASM_ARCH_SYSTEM_H
22 22
23#include <linux/io.h>
24#include <mach/hardware.h>
25
26static inline void arch_idle(void) 23static inline void arch_idle(void)
27{ 24{
28 /* 25 /*
@@ -32,14 +29,4 @@ static inline void arch_idle(void)
32 cpu_do_idle(); 29 cpu_do_idle();
33} 30}
34 31
35static inline void arch_reset(char mode, const char *cmd)
36{
37 void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
38
39 /* FIXME: use egpio when implemented */
40
41 /* Write anything to Reset status register */
42 writel(1, src_rstsr);
43}
44
45#endif 32#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
index f83d574d9445..000000000000
--- a/arch/arm/mach-nomadik/include/mach/vmalloc.h
+++ /dev/null
@@ -1,2 +0,0 @@
1
2#define VMALLOC_END 0xe8000000UL
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index e0a028161dde..73f287d6429b 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -171,14 +171,6 @@ config MACH_OMAP_GENERIC
171comment "OMAP CPU Speed" 171comment "OMAP CPU Speed"
172 depends on ARCH_OMAP1 172 depends on ARCH_OMAP1
173 173
174config OMAP_CLOCKS_SET_BY_BOOTLOADER
175 bool "OMAP clocks set by bootloader"
176 depends on ARCH_OMAP1
177 help
178 Enable this option to prevent the kernel from overriding the clock
179 frequencies programmed by bootloader for MPU, DSP, MMUs, TC,
180 internal LCD controller and MPU peripherals.
181
182config OMAP_ARM_216MHZ 174config OMAP_ARM_216MHZ
183 bool "OMAP ARM 216 MHz CPU (1710 only)" 175 bool "OMAP ARM 216 MHz CPU (1710 only)"
184 depends on ARCH_OMAP1 && ARCH_OMAP16XX 176 depends on ARCH_OMAP1 && ARCH_OMAP16XX
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 51bae31cf361..88909cc0b254 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -35,7 +35,7 @@
35#include <plat/mux.h> 35#include <plat/mux.h>
36#include <plat/usb.h> 36#include <plat/usb.h>
37#include <plat/board.h> 37#include <plat/board.h>
38#include <plat/common.h> 38#include "common.h"
39#include <mach/camera.h> 39#include <mach/camera.h>
40 40
41#include <mach/ams-delta-fiq.h> 41#include <mach/ams-delta-fiq.h>
@@ -302,8 +302,6 @@ static void __init ams_delta_init(void)
302 omap_cfg_reg(J19_1610_CAM_D6); 302 omap_cfg_reg(J19_1610_CAM_D6);
303 omap_cfg_reg(J18_1610_CAM_D7); 303 omap_cfg_reg(J18_1610_CAM_D7);
304 304
305 iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
306
307 omap_board_config = ams_delta_config; 305 omap_board_config = ams_delta_config;
308 omap_board_config_size = ARRAY_SIZE(ams_delta_config); 306 omap_board_config_size = ARRAY_SIZE(ams_delta_config);
309 omap_serial_init(); 307 omap_serial_init();
@@ -373,15 +371,22 @@ static int __init ams_delta_modem_init(void)
373} 371}
374arch_initcall(ams_delta_modem_init); 372arch_initcall(ams_delta_modem_init);
375 373
374static void __init ams_delta_map_io(void)
375{
376 omap15xx_map_io();
377 iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
378}
379
376MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") 380MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
377 /* Maintainer: Jonathan McDowell <noodles@earth.li> */ 381 /* Maintainer: Jonathan McDowell <noodles@earth.li> */
378 .atag_offset = 0x100, 382 .atag_offset = 0x100,
379 .map_io = omap15xx_map_io, 383 .map_io = ams_delta_map_io,
380 .init_early = omap1_init_early, 384 .init_early = omap1_init_early,
381 .reserve = omap_reserve, 385 .reserve = omap_reserve,
382 .init_irq = omap1_init_irq, 386 .init_irq = omap1_init_irq,
383 .init_machine = ams_delta_init, 387 .init_machine = ams_delta_init,
384 .timer = &omap1_timer, 388 .timer = &omap1_timer,
389 .restart = omap1_restart,
385MACHINE_END 390MACHINE_END
386 391
387EXPORT_SYMBOL(ams_delta_latch1_write); 392EXPORT_SYMBOL(ams_delta_latch1_write);
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 23178275f96b..0b9464b41212 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -32,7 +32,7 @@
32#include <plat/flash.h> 32#include <plat/flash.h>
33#include <plat/fpga.h> 33#include <plat/fpga.h>
34#include <plat/keypad.h> 34#include <plat/keypad.h>
35#include <plat/common.h> 35#include "common.h"
36#include <plat/board.h> 36#include <plat/board.h>
37 37
38/* fsample is pretty close to p2-sample */ 38/* fsample is pretty close to p2-sample */
@@ -390,4 +390,5 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
390 .init_irq = omap1_init_irq, 390 .init_irq = omap1_init_irq,
391 .init_machine = omap_fsample_init, 391 .init_machine = omap_fsample_init,
392 .timer = &omap1_timer, 392 .timer = &omap1_timer,
393 .restart = omap1_restart,
393MACHINE_END 394MACHINE_END
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index dc5b75de531c..9a5fe581bc1c 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -25,7 +25,7 @@
25#include <plat/mux.h> 25#include <plat/mux.h>
26#include <plat/usb.h> 26#include <plat/usb.h>
27#include <plat/board.h> 27#include <plat/board.h>
28#include <plat/common.h> 28#include "common.h"
29 29
30/* assume no Mini-AB port */ 30/* assume no Mini-AB port */
31 31
@@ -89,4 +89,5 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
89 .init_irq = omap1_init_irq, 89 .init_irq = omap1_init_irq,
90 .init_machine = omap_generic_init, 90 .init_machine = omap_generic_init,
91 .timer = &omap1_timer, 91 .timer = &omap1_timer,
92 .restart = omap1_restart,
92MACHINE_END 93MACHINE_END
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index b334b1481678..00ad6b22d60a 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -43,7 +43,7 @@
43#include <plat/irda.h> 43#include <plat/irda.h>
44#include <plat/usb.h> 44#include <plat/usb.h>
45#include <plat/keypad.h> 45#include <plat/keypad.h>
46#include <plat/common.h> 46#include "common.h"
47#include <plat/flash.h> 47#include <plat/flash.h>
48 48
49#include "board-h2.h" 49#include "board-h2.h"
@@ -456,4 +456,5 @@ MACHINE_START(OMAP_H2, "TI-H2")
456 .init_irq = omap1_init_irq, 456 .init_irq = omap1_init_irq,
457 .init_machine = h2_init, 457 .init_machine = h2_init,
458 .timer = &omap1_timer, 458 .timer = &omap1_timer,
459 .restart = omap1_restart,
459MACHINE_END 460MACHINE_END
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 74ebe72c9848..4a7f25149703 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -45,7 +45,7 @@
45#include <plat/usb.h> 45#include <plat/usb.h>
46#include <plat/keypad.h> 46#include <plat/keypad.h>
47#include <plat/dma.h> 47#include <plat/dma.h>
48#include <plat/common.h> 48#include "common.h"
49#include <plat/flash.h> 49#include <plat/flash.h>
50 50
51#include "board-h3.h" 51#include "board-h3.h"
@@ -444,4 +444,5 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
444 .init_irq = omap1_init_irq, 444 .init_irq = omap1_init_irq,
445 .init_machine = h3_init, 445 .init_machine = h3_init,
446 .timer = &omap1_timer, 446 .timer = &omap1_timer,
447 .restart = omap1_restart,
447MACHINE_END 448MACHINE_END
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 3e91baab1a89..731cc3db7ab3 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -41,7 +41,7 @@
41#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
42 42
43#include <plat/omap7xx.h> 43#include <plat/omap7xx.h>
44#include <plat/common.h> 44#include "common.h"
45#include <plat/board.h> 45#include <plat/board.h>
46#include <plat/keypad.h> 46#include <plat/keypad.h>
47#include <plat/usb.h> 47#include <plat/usb.h>
@@ -610,4 +610,5 @@ MACHINE_START(HERALD, "HTC Herald")
610 .init_irq = omap1_init_irq, 610 .init_irq = omap1_init_irq,
611 .init_machine = htcherald_init, 611 .init_machine = htcherald_init,
612 .timer = &omap1_timer, 612 .timer = &omap1_timer,
613 .restart = omap1_restart,
613MACHINE_END 614MACHINE_END
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 273153dba15b..309369ea6978 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -37,7 +37,7 @@
37#include <plat/tc.h> 37#include <plat/tc.h>
38#include <plat/usb.h> 38#include <plat/usb.h>
39#include <plat/keypad.h> 39#include <plat/keypad.h>
40#include <plat/common.h> 40#include "common.h"
41#include <plat/mmc.h> 41#include <plat/mmc.h>
42 42
43/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 43/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
@@ -460,4 +460,5 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
460 .init_irq = omap1_init_irq, 460 .init_irq = omap1_init_irq,
461 .init_machine = innovator_init, 461 .init_machine = innovator_init,
462 .timer = &omap1_timer, 462 .timer = &omap1_timer,
463 .restart = omap1_restart,
463MACHINE_END 464MACHINE_END
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 6798b8488315..f9efc036ba96 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -30,7 +30,7 @@
30#include <plat/usb.h> 30#include <plat/usb.h>
31#include <plat/board.h> 31#include <plat/board.h>
32#include <plat/keypad.h> 32#include <plat/keypad.h>
33#include <plat/common.h> 33#include "common.h"
34#include <plat/hwa742.h> 34#include <plat/hwa742.h>
35#include <plat/lcd_mipid.h> 35#include <plat/lcd_mipid.h>
36#include <plat/mmc.h> 36#include <plat/mmc.h>
@@ -259,4 +259,5 @@ MACHINE_START(NOKIA770, "Nokia 770")
259 .init_irq = omap1_init_irq, 259 .init_irq = omap1_init_irq,
260 .init_machine = omap_nokia770_init, 260 .init_machine = omap_nokia770_init,
261 .timer = &omap1_timer, 261 .timer = &omap1_timer,
262 .restart = omap1_restart,
262MACHINE_END 263MACHINE_END
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index c3859278d257..675de06557aa 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -51,7 +51,7 @@
51#include <plat/usb.h> 51#include <plat/usb.h>
52#include <plat/mux.h> 52#include <plat/mux.h>
53#include <plat/tc.h> 53#include <plat/tc.h>
54#include <plat/common.h> 54#include "common.h"
55 55
56/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */ 56/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
57#define OMAP_OSK_ETHR_START 0x04800300 57#define OMAP_OSK_ETHR_START 0x04800300
@@ -578,4 +578,5 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
578 .init_irq = omap1_init_irq, 578 .init_irq = omap1_init_irq,
579 .init_machine = osk_init, 579 .init_machine = osk_init,
580 .timer = &omap1_timer, 580 .timer = &omap1_timer,
581 .restart = omap1_restart,
581MACHINE_END 582MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index f9c44cb15b47..81fa27f88369 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -41,7 +41,7 @@
41#include <plat/board.h> 41#include <plat/board.h>
42#include <plat/irda.h> 42#include <plat/irda.h>
43#include <plat/keypad.h> 43#include <plat/keypad.h>
44#include <plat/common.h> 44#include "common.h"
45 45
46#define PALMTE_USBDETECT_GPIO 0 46#define PALMTE_USBDETECT_GPIO 0
47#define PALMTE_USB_OR_DC_GPIO 1 47#define PALMTE_USB_OR_DC_GPIO 1
@@ -270,4 +270,5 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
270 .init_irq = omap1_init_irq, 270 .init_irq = omap1_init_irq,
271 .init_machine = omap_palmte_init, 271 .init_machine = omap_palmte_init,
272 .timer = &omap1_timer, 272 .timer = &omap1_timer,
273 .restart = omap1_restart,
273MACHINE_END 274MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 11a98539f7bb..81cb82178388 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -39,7 +39,7 @@
39#include <plat/board.h> 39#include <plat/board.h>
40#include <plat/irda.h> 40#include <plat/irda.h>
41#include <plat/keypad.h> 41#include <plat/keypad.h>
42#include <plat/common.h> 42#include "common.h"
43 43
44#include <linux/spi/spi.h> 44#include <linux/spi/spi.h>
45#include <linux/spi/ads7846.h> 45#include <linux/spi/ads7846.h>
@@ -317,4 +317,5 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
317 .init_irq = omap1_init_irq, 317 .init_irq = omap1_init_irq,
318 .init_machine = omap_palmtt_init, 318 .init_machine = omap_palmtt_init,
319 .timer = &omap1_timer, 319 .timer = &omap1_timer,
320 .restart = omap1_restart,
320MACHINE_END 321MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 42061573e380..e881945ce8ec 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -41,7 +41,7 @@
41#include <plat/board.h> 41#include <plat/board.h>
42#include <plat/irda.h> 42#include <plat/irda.h>
43#include <plat/keypad.h> 43#include <plat/keypad.h>
44#include <plat/common.h> 44#include "common.h"
45 45
46#include <linux/spi/spi.h> 46#include <linux/spi/spi.h>
47#include <linux/spi/ads7846.h> 47#include <linux/spi/ads7846.h>
@@ -334,4 +334,5 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
334 .init_irq = omap1_init_irq, 334 .init_irq = omap1_init_irq,
335 .init_machine = omap_palmz71_init, 335 .init_machine = omap_palmz71_init,
336 .timer = &omap1_timer, 336 .timer = &omap1_timer,
337 .restart = omap1_restart,
337MACHINE_END 338MACHINE_END
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 203ae07550db..c000bed76276 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -32,7 +32,7 @@
32#include <plat/fpga.h> 32#include <plat/fpga.h>
33#include <plat/flash.h> 33#include <plat/flash.h>
34#include <plat/keypad.h> 34#include <plat/keypad.h>
35#include <plat/common.h> 35#include "common.h"
36#include <plat/board.h> 36#include <plat/board.h>
37 37
38static const unsigned int p2_keymap[] = { 38static const unsigned int p2_keymap[] = {
@@ -352,4 +352,5 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
352 .init_irq = omap1_init_irq, 352 .init_irq = omap1_init_irq,
353 .init_machine = omap_perseus2_init, 353 .init_machine = omap_perseus2_init,
354 .timer = &omap1_timer, 354 .timer = &omap1_timer,
355 .restart = omap1_restart,
355MACHINE_END 356MACHINE_END
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 092a4c046407..7bcd82ab0fd0 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -40,7 +40,7 @@
40#include <plat/usb.h> 40#include <plat/usb.h>
41#include <plat/tc.h> 41#include <plat/tc.h>
42#include <plat/board.h> 42#include <plat/board.h>
43#include <plat/common.h> 43#include "common.h"
44#include <plat/keypad.h> 44#include <plat/keypad.h>
45#include <plat/board-sx1.h> 45#include <plat/board-sx1.h>
46 46
@@ -416,4 +416,5 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
416 .init_irq = omap1_init_irq, 416 .init_irq = omap1_init_irq,
417 .init_machine = omap_sx1_init, 417 .init_machine = omap_sx1_init,
418 .timer = &omap1_timer, 418 .timer = &omap1_timer,
419 .restart = omap1_restart,
419MACHINE_END 420MACHINE_END
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 61ed6cdab2bd..f83a502dc93c 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -28,13 +28,12 @@
28#include <linux/export.h> 28#include <linux/export.h>
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/system.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35 34
36#include <plat/board-voiceblue.h> 35#include <plat/board-voiceblue.h>
37#include <plat/common.h> 36#include "common.h"
38#include <plat/flash.h> 37#include <plat/flash.h>
39#include <plat/mux.h> 38#include <plat/mux.h>
40#include <plat/tc.h> 39#include <plat/tc.h>
@@ -221,7 +220,7 @@ void voiceblue_wdt_ping(void)
221 gpio_set_value(0, wdt_gpio_state); 220 gpio_set_value(0, wdt_gpio_state);
222} 221}
223 222
224static void voiceblue_reset(char mode, const char *cmd) 223static void voiceblue_restart(char mode, const char *cmd)
225{ 224{
226 /* 225 /*
227 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 226 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
@@ -285,8 +284,6 @@ static void __init voiceblue_init(void)
285 * (it is connected through invertor) */ 284 * (it is connected through invertor) */
286 omap_writeb(0x00, OMAP_LPG1_LCR); 285 omap_writeb(0x00, OMAP_LPG1_LCR);
287 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */ 286 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
288
289 arch_reset = voiceblue_reset;
290} 287}
291 288
292MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") 289MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
@@ -298,4 +295,5 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
298 .init_irq = omap1_init_irq, 295 .init_irq = omap1_init_irq,
299 .init_machine = voiceblue_init, 296 .init_machine = voiceblue_init,
300 .timer = &omap1_timer, 297 .timer = &omap1_timer,
298 .restart = voiceblue_restart,
301MACHINE_END 299MACHINE_END
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index eaf09efb91ca..16b1423b454a 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -17,7 +17,8 @@
17 17
18#include <plat/clock.h> 18#include <plat/clock.h>
19 19
20extern int __init omap1_clk_init(void); 20int omap1_clk_init(void);
21void omap1_clk_late_init(void);
21extern int omap1_clk_enable(struct clk *clk); 22extern int omap1_clk_enable(struct clk *clk);
22extern void omap1_clk_disable(struct clk *clk); 23extern void omap1_clk_disable(struct clk *clk);
23extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate); 24extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate);
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index 92400b9eb69f..9ff90a744a21 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -16,6 +16,8 @@
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/cpufreq.h>
20#include <linux/delay.h>
19#include <linux/io.h> 21#include <linux/io.h>
20 22
21#include <asm/mach-types.h> /* for machine_is_* */ 23#include <asm/mach-types.h> /* for machine_is_* */
@@ -767,6 +769,15 @@ static struct clk_functions omap1_clk_functions = {
767 .clk_disable_unused = omap1_clk_disable_unused, 769 .clk_disable_unused = omap1_clk_disable_unused,
768}; 770};
769 771
772static void __init omap1_show_rates(void)
773{
774 pr_notice("Clocking rate (xtal/DPLL1/MPU): "
775 "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
776 ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10,
777 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
778 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
779}
780
770int __init omap1_clk_init(void) 781int __init omap1_clk_init(void)
771{ 782{
772 struct omap_clk *c; 783 struct omap_clk *c;
@@ -835,9 +846,12 @@ int __init omap1_clk_init(void)
835 /* We want to be in syncronous scalable mode */ 846 /* We want to be in syncronous scalable mode */
836 omap_writew(0x1000, ARM_SYSST); 847 omap_writew(0x1000, ARM_SYSST);
837 848
838#ifdef CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER 849
839 /* Use values set by bootloader. Determine PLL rate and recalculate 850 /*
840 * dependent clocks as if kernel had changed PLL or divisors. 851 * Initially use the values set by bootloader. Determine PLL rate and
852 * recalculate dependent clocks as if kernel had changed PLL or
853 * divisors. See also omap1_clk_late_init() that can reprogram dpll1
854 * after the SRAM is initialized.
841 */ 855 */
842 { 856 {
843 unsigned pll_ctl_val = omap_readw(DPLL_CTL); 857 unsigned pll_ctl_val = omap_readw(DPLL_CTL);
@@ -862,25 +876,10 @@ int __init omap1_clk_init(void)
862 } 876 }
863 } 877 }
864 } 878 }
865#else
866 /* Find the highest supported frequency and enable it */
867 if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
868 printk(KERN_ERR "System frequencies not set. Check your config.\n");
869 /* Guess sane values (60MHz) */
870 omap_writew(0x2290, DPLL_CTL);
871 omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL);
872 ck_dpll1.rate = 60000000;
873 }
874#endif
875 propagate_rate(&ck_dpll1); 879 propagate_rate(&ck_dpll1);
876 /* Cache rates for clocks connected to ck_ref (not dpll1) */ 880 /* Cache rates for clocks connected to ck_ref (not dpll1) */
877 propagate_rate(&ck_ref); 881 propagate_rate(&ck_ref);
878 printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): " 882 omap1_show_rates();
879 "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
880 ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10,
881 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
882 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
883
884 if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { 883 if (machine_is_omap_perseus2() || machine_is_omap_fsample()) {
885 /* Select slicer output as OMAP input clock */ 884 /* Select slicer output as OMAP input clock */
886 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, 885 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1,
@@ -925,3 +924,27 @@ int __init omap1_clk_init(void)
925 924
926 return 0; 925 return 0;
927} 926}
927
928#define OMAP1_DPLL1_SANE_VALUE 60000000
929
930void __init omap1_clk_late_init(void)
931{
932 unsigned long rate = ck_dpll1.rate;
933
934 if (rate >= OMAP1_DPLL1_SANE_VALUE)
935 return;
936
937 /* System booting at unusable rate, force reprogramming of DPLL1 */
938 ck_dpll1_p->rate = 0;
939
940 /* Find the highest supported frequency and enable it */
941 if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
942 pr_err("System frequencies not set, using default. Check your config.\n");
943 omap_writew(0x2290, DPLL_CTL);
944 omap_writew(cpu_is_omap7xx() ? 0x2005 : 0x0005, ARM_CKCTL);
945 ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE;
946 }
947 propagate_rate(&ck_dpll1);
948 omap1_show_rates();
949 loops_per_jiffy = cpufreq_scale(loops_per_jiffy, rate, ck_dpll1.rate);
950}
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
new file mode 100644
index 000000000000..a9a5146dd2d4
--- /dev/null
+++ b/arch/arm/mach-omap1/common.h
@@ -0,0 +1,62 @@
1/*
2 *
3 * Header for code common to all OMAP1 machines.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
13 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
15 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
16 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
17 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#ifndef __ARCH_ARM_MACH_OMAP1_COMMON_H
27#define __ARCH_ARM_MACH_OMAP1_COMMON_H
28
29#include <plat/common.h>
30
31#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
32void omap7xx_map_io(void);
33#else
34static inline void omap7xx_map_io(void)
35{
36}
37#endif
38
39#ifdef CONFIG_ARCH_OMAP15XX
40void omap15xx_map_io(void);
41#else
42static inline void omap15xx_map_io(void)
43{
44}
45#endif
46
47#ifdef CONFIG_ARCH_OMAP16XX
48void omap16xx_map_io(void);
49#else
50static inline void omap16xx_map_io(void)
51{
52}
53#endif
54
55void omap1_init_early(void);
56void omap1_init_irq(void);
57void omap1_restart(char, const char *);
58
59extern struct sys_timer omap1_timer;
60extern bool omap_32k_timer_init(void);
61
62#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 48ef9888e820..1d76a63c0983 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -22,7 +22,7 @@
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24 24
25#include <plat/common.h> 25#include "common.h"
26#include <plat/tc.h> 26#include <plat/tc.h>
27#include <plat/board.h> 27#include <plat/board.h>
28#include <plat/mux.h> 28#include <plat/mux.h>
@@ -30,6 +30,8 @@
30#include <plat/omap7xx.h> 30#include <plat/omap7xx.h>
31#include <plat/mcbsp.h> 31#include <plat/mcbsp.h>
32 32
33#include "clock.h"
34
33/*-------------------------------------------------------------------------*/ 35/*-------------------------------------------------------------------------*/
34 36
35#if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE) 37#if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE)
@@ -293,6 +295,7 @@ static int __init omap1_init_devices(void)
293 return -ENODEV; 295 return -ENODEV;
294 296
295 omap_sram_init(); 297 omap_sram_init();
298 omap1_clk_late_init();
296 299
297 /* please keep these calls, and their implementations above, 300 /* please keep these calls, and their implementations above,
298 * in alphabetical order so they're easier to sort through. 301 * in alphabetical order so they're easier to sort through.
diff --git a/arch/arm/mach-omap1/include/mach/vmalloc.h b/arch/arm/mach-omap1/include/mach/vmalloc.h
deleted file mode 100644
index 22ec4a479577..000000000000
--- a/arch/arm/mach-omap1/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-omap1/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END 0xd8000000UL
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 7969cfda4454..8e55b6fb3478 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -121,7 +121,6 @@ void __init omap16xx_map_io(void)
121void omap1_init_early(void) 121void omap1_init_early(void)
122{ 122{
123 omap_check_revision(); 123 omap_check_revision();
124 omap_ioremap_init();
125 124
126 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort 125 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
127 * on a Posted Write in the TIPB Bridge". 126 * on a Posted Write in the TIPB Bridge".
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
index ad951ee69205..91d199b64979 100644
--- a/arch/arm/mach-omap1/reset.c
+++ b/arch/arm/mach-omap1/reset.c
@@ -5,10 +5,9 @@
5#include <linux/io.h> 5#include <linux/io.h>
6 6
7#include <mach/hardware.h> 7#include <mach/hardware.h>
8#include <mach/system.h>
9#include <plat/prcm.h> 8#include <plat/prcm.h>
10 9
11void omap1_arch_reset(char mode, const char *cmd) 10void omap1_restart(char mode, const char *cmd)
12{ 11{
13 /* 12 /*
14 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 13 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
@@ -21,5 +20,3 @@ void omap1_arch_reset(char mode, const char *cmd)
21 20
22 omap_writew(1, ARM_RSTCT1); 21 omap_writew(1, ARM_RSTCT1);
23} 22}
24
25void (*arch_reset)(char, const char *) = omap1_arch_reset;
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index a1837771e031..b8faffa44f9e 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -37,7 +37,6 @@
37#include <linux/init.h> 37#include <linux/init.h>
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/sched.h>
41#include <linux/spinlock.h> 40#include <linux/spinlock.h>
42#include <linux/clk.h> 41#include <linux/clk.h>
43#include <linux/err.h> 42#include <linux/err.h>
@@ -54,7 +53,7 @@
54#include <asm/mach/irq.h> 53#include <asm/mach/irq.h>
55#include <asm/mach/time.h> 54#include <asm/mach/time.h>
56 55
57#include <plat/common.h> 56#include "common.h"
58 57
59#ifdef CONFIG_OMAP_MPU_TIMER 58#ifdef CONFIG_OMAP_MPU_TIMER
60 59
@@ -190,30 +189,9 @@ static __init void omap_init_mpu_timer(unsigned long rate)
190 * --------------------------------------------------------------------------- 189 * ---------------------------------------------------------------------------
191 */ 190 */
192 191
193static DEFINE_CLOCK_DATA(cd); 192static u32 notrace omap_mpu_read_sched_clock(void)
194
195static inline unsigned long long notrace _omap_mpu_sched_clock(void)
196{
197 u32 cyc = ~omap_mpu_timer_read(1);
198 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
199}
200
201#ifndef CONFIG_OMAP_32K_TIMER
202unsigned long long notrace sched_clock(void)
203{
204 return _omap_mpu_sched_clock();
205}
206#else
207static unsigned long long notrace omap_mpu_sched_clock(void)
208{
209 return _omap_mpu_sched_clock();
210}
211#endif
212
213static void notrace mpu_update_sched_clock(void)
214{ 193{
215 u32 cyc = ~omap_mpu_timer_read(1); 194 return ~omap_mpu_timer_read(1);
216 update_sched_clock(&cd, cyc, (u32)~0);
217} 195}
218 196
219static void __init omap_init_clocksource(unsigned long rate) 197static void __init omap_init_clocksource(unsigned long rate)
@@ -223,7 +201,7 @@ static void __init omap_init_clocksource(unsigned long rate)
223 "%s: can't register clocksource!\n"; 201 "%s: can't register clocksource!\n";
224 202
225 omap_mpu_timer_start(1, ~0, 1); 203 omap_mpu_timer_start(1, ~0, 1);
226 init_sched_clock(&cd, mpu_update_sched_clock, 32, rate); 204 setup_sched_clock(omap_mpu_read_sched_clock, 32, rate);
227 205
228 if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate, 206 if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate,
229 300, 32, clocksource_mmio_readl_down)) 207 300, 32, clocksource_mmio_readl_down))
@@ -254,30 +232,6 @@ static inline void omap_mpu_timer_init(void)
254} 232}
255#endif /* CONFIG_OMAP_MPU_TIMER */ 233#endif /* CONFIG_OMAP_MPU_TIMER */
256 234
257#if defined(CONFIG_OMAP_MPU_TIMER) && defined(CONFIG_OMAP_32K_TIMER)
258static unsigned long long (*preferred_sched_clock)(void);
259
260unsigned long long notrace sched_clock(void)
261{
262 if (!preferred_sched_clock)
263 return 0;
264
265 return preferred_sched_clock();
266}
267
268static inline void preferred_sched_clock_init(bool use_32k_sched_clock)
269{
270 if (use_32k_sched_clock)
271 preferred_sched_clock = omap_32k_sched_clock;
272 else
273 preferred_sched_clock = omap_mpu_sched_clock;
274}
275#else
276static inline void preferred_sched_clock_init(bool use_32k_sched_clcok)
277{
278}
279#endif
280
281static inline int omap_32k_timer_usable(void) 235static inline int omap_32k_timer_usable(void)
282{ 236{
283 int res = false; 237 int res = false;
@@ -299,12 +253,8 @@ static inline int omap_32k_timer_usable(void)
299 */ 253 */
300static void __init omap1_timer_init(void) 254static void __init omap1_timer_init(void)
301{ 255{
302 if (omap_32k_timer_usable()) { 256 if (!omap_32k_timer_usable())
303 preferred_sched_clock_init(1);
304 } else {
305 omap_mpu_timer_init(); 257 omap_mpu_timer_init();
306 preferred_sched_clock_init(0);
307 }
308} 258}
309 259
310struct sys_timer omap1_timer = { 260struct sys_timer omap1_timer = {
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 96604a50c4fe..9a54ef4dcf5e 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -52,7 +52,7 @@
52#include <asm/irq.h> 52#include <asm/irq.h>
53#include <asm/mach/irq.h> 53#include <asm/mach/irq.h>
54#include <asm/mach/time.h> 54#include <asm/mach/time.h>
55#include <plat/common.h> 55#include "common.h"
56#include <plat/dmtimer.h> 56#include <plat/dmtimer.h>
57 57
58/* 58/*
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 503414718905..4f01533083cc 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -25,6 +25,7 @@ config ARCH_OMAP2
25 depends on ARCH_OMAP2PLUS 25 depends on ARCH_OMAP2PLUS
26 default y 26 default y
27 select CPU_V6 27 select CPU_V6
28 select MULTI_IRQ_HANDLER
28 29
29config ARCH_OMAP3 30config ARCH_OMAP3
30 bool "TI OMAP3" 31 bool "TI OMAP3"
@@ -36,13 +37,16 @@ config ARCH_OMAP3
36 select ARCH_HAS_OPP 37 select ARCH_HAS_OPP
37 select PM_OPP if PM 38 select PM_OPP if PM
38 select ARM_CPU_SUSPEND if PM 39 select ARM_CPU_SUSPEND if PM
40 select MULTI_IRQ_HANDLER
39 41
40config ARCH_OMAP4 42config ARCH_OMAP4
41 bool "TI OMAP4" 43 bool "TI OMAP4"
42 default y 44 default y
43 depends on ARCH_OMAP2PLUS 45 depends on ARCH_OMAP2PLUS
46 select CACHE_L2X0
44 select CPU_V7 47 select CPU_V7
45 select ARM_GIC 48 select ARM_GIC
49 select HAVE_SMP
46 select LOCAL_TIMERS if SMP 50 select LOCAL_TIMERS if SMP
47 select PL310_ERRATA_588369 51 select PL310_ERRATA_588369
48 select PL310_ERRATA_727915 52 select PL310_ERRATA_727915
@@ -334,6 +338,7 @@ config MACH_OMAP4_PANDA
334config OMAP3_EMU 338config OMAP3_EMU
335 bool "OMAP3 debugging peripherals" 339 bool "OMAP3 debugging peripherals"
336 depends on ARCH_OMAP3 340 depends on ARCH_OMAP3
341 select ARM_AMBA
337 select OC_ETM 342 select OC_ETM
338 help 343 help
339 Say Y here to enable debugging hardware of omap3 344 Say Y here to enable debugging hardware of omap3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 69ab1c069134..b009f17dee56 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,7 +4,7 @@
4 4
5# Common support 5# Common support
6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \ 6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \
7 common.o gpio.o dma.o wd_timer.o 7 common.o gpio.o dma.o wd_timer.o display.o
8 8
9omap-2-3-common = irq.o sdrc.o 9omap-2-3-common = irq.o sdrc.o
10hwmod-common = omap_hwmod.o \ 10hwmod-common = omap_hwmod.o \
@@ -264,7 +264,4 @@ smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o
264obj-y += $(smsc911x-m) $(smsc911x-y) 264obj-y += $(smsc911x-m) $(smsc911x-y)
265obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o 265obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o
266 266
267disp-$(CONFIG_OMAP2_DSS) := display.o
268obj-y += $(disp-m) $(disp-y)
269
270obj-y += common-board-devices.o twl-common.o 267obj-y += common-board-devices.o twl-common.o
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index d704f0ac328d..7370983f809f 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -34,7 +34,7 @@
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <plat/board.h> 36#include <plat/board.h>
37#include <plat/common.h> 37#include "common.h"
38#include <plat/gpmc.h> 38#include <plat/gpmc.h>
39#include <plat/usb.h> 39#include <plat/usb.h>
40#include <plat/gpmc-smc91x.h> 40#include <plat/gpmc-smc91x.h>
@@ -301,6 +301,8 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
301 .map_io = omap243x_map_io, 301 .map_io = omap243x_map_io,
302 .init_early = omap2430_init_early, 302 .init_early = omap2430_init_early,
303 .init_irq = omap2_init_irq, 303 .init_irq = omap2_init_irq,
304 .handle_irq = omap2_intc_handle_irq,
304 .init_machine = omap_2430sdp_init, 305 .init_machine = omap_2430sdp_init,
305 .timer = &omap2_timer, 306 .timer = &omap2_timer,
307 .restart = omap_prcm_restart,
306MACHINE_END 308MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 77142c13fa13..9996334cb687 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -33,7 +33,7 @@
33#include <plat/mcspi.h> 33#include <plat/mcspi.h>
34#include <plat/board.h> 34#include <plat/board.h>
35#include <plat/usb.h> 35#include <plat/usb.h>
36#include <plat/common.h> 36#include "common.h"
37#include <plat/dma.h> 37#include <plat/dma.h>
38#include <plat/gpmc.h> 38#include <plat/gpmc.h>
39#include <video/omapdss.h> 39#include <video/omapdss.h>
@@ -728,6 +728,8 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
728 .map_io = omap3_map_io, 728 .map_io = omap3_map_io,
729 .init_early = omap3430_init_early, 729 .init_early = omap3430_init_early,
730 .init_irq = omap3_init_irq, 730 .init_irq = omap3_init_irq,
731 .handle_irq = omap3_intc_handle_irq,
731 .init_machine = omap_3430sdp_init, 732 .init_machine = omap_3430sdp_init,
732 .timer = &omap3_timer, 733 .timer = &omap3_timer,
734 .restart = omap_prcm_restart,
733MACHINE_END 735MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index f552305162fc..6ef350d1ae4f 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -16,7 +16,7 @@
16#include <asm/mach-types.h> 16#include <asm/mach-types.h>
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18 18
19#include <plat/common.h> 19#include "common.h"
20#include <plat/board.h> 20#include <plat/board.h>
21#include <plat/gpmc-smc91x.h> 21#include <plat/gpmc-smc91x.h>
22#include <plat/usb.h> 22#include <plat/usb.h>
@@ -215,6 +215,8 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
215 .map_io = omap3_map_io, 215 .map_io = omap3_map_io,
216 .init_early = omap3630_init_early, 216 .init_early = omap3630_init_early,
217 .init_irq = omap3_init_irq, 217 .init_irq = omap3_init_irq,
218 .handle_irq = omap3_intc_handle_irq,
218 .init_machine = omap_sdp_init, 219 .init_machine = omap_sdp_init,
219 .timer = &omap3_timer, 220 .timer = &omap3_timer,
221 .restart = omap_prcm_restart,
220MACHINE_END 222MACHINE_END
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 515646886b59..bad5d5a5ef79 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -27,13 +27,13 @@
27#include <linux/leds_pwm.h> 27#include <linux/leds_pwm.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/omap4-common.h> 30#include <asm/hardware/gic.h>
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34 34
35#include <plat/board.h> 35#include <plat/board.h>
36#include <plat/common.h> 36#include "common.h"
37#include <plat/usb.h> 37#include <plat/usb.h>
38#include <plat/mmc.h> 38#include <plat/mmc.h>
39#include <plat/omap4-keypad.h> 39#include <plat/omap4-keypad.h>
@@ -984,6 +984,8 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
984 .map_io = omap4_map_io, 984 .map_io = omap4_map_io,
985 .init_early = omap4430_init_early, 985 .init_early = omap4430_init_early,
986 .init_irq = gic_init_irq, 986 .init_irq = gic_init_irq,
987 .handle_irq = gic_handle_irq,
987 .init_machine = omap_4430sdp_init, 988 .init_machine = omap_4430sdp_init,
988 .timer = &omap4_timer, 989 .timer = &omap4_timer,
990 .restart = omap_prcm_restart,
989MACHINE_END 991MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 7834536ab416..c3851e8de28b 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -27,7 +27,7 @@
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <plat/board.h> 29#include <plat/board.h>
30#include <plat/common.h> 30#include "common.h"
31#include <plat/usb.h> 31#include <plat/usb.h>
32 32
33#include "mux.h" 33#include "mux.h"
@@ -98,6 +98,8 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
98 .map_io = omap3_map_io, 98 .map_io = omap3_map_io,
99 .init_early = am35xx_init_early, 99 .init_early = am35xx_init_early,
100 .init_irq = omap3_init_irq, 100 .init_irq = omap3_init_irq,
101 .handle_irq = omap3_intc_handle_irq,
101 .init_machine = am3517_crane_init, 102 .init_machine = am3517_crane_init,
102 .timer = &omap3_timer, 103 .timer = &omap3_timer,
104 .restart = omap_prcm_restart,
103MACHINE_END 105MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index d314f033c9df..f5a3a3f11739 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -32,7 +32,7 @@
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33 33
34#include <plat/board.h> 34#include <plat/board.h>
35#include <plat/common.h> 35#include "common.h"
36#include <plat/usb.h> 36#include <plat/usb.h>
37#include <video/omapdss.h> 37#include <video/omapdss.h>
38#include <video/omap-panel-generic-dpi.h> 38#include <video/omap-panel-generic-dpi.h>
@@ -491,6 +491,8 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
491 .map_io = omap3_map_io, 491 .map_io = omap3_map_io,
492 .init_early = am35xx_init_early, 492 .init_early = am35xx_init_early,
493 .init_irq = omap3_init_irq, 493 .init_irq = omap3_init_irq,
494 .handle_irq = omap3_intc_handle_irq,
494 .init_machine = am3517_evm_init, 495 .init_machine = am3517_evm_init,
495 .timer = &omap3_timer, 496 .timer = &omap3_timer,
497 .restart = omap_prcm_restart,
496MACHINE_END 498MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index de8134b7f580..ac773829941f 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -37,7 +37,7 @@
37#include <plat/led.h> 37#include <plat/led.h>
38#include <plat/usb.h> 38#include <plat/usb.h>
39#include <plat/board.h> 39#include <plat/board.h>
40#include <plat/common.h> 40#include "common.h"
41#include <plat/gpmc.h> 41#include <plat/gpmc.h>
42 42
43#include <video/omapdss.h> 43#include <video/omapdss.h>
@@ -354,6 +354,8 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
354 .map_io = omap242x_map_io, 354 .map_io = omap242x_map_io,
355 .init_early = omap2420_init_early, 355 .init_early = omap2420_init_early,
356 .init_irq = omap2_init_irq, 356 .init_irq = omap2_init_irq,
357 .handle_irq = omap2_intc_handle_irq,
357 .init_machine = omap_apollon_init, 358 .init_machine = omap_apollon_init,
358 .timer = &omap2_timer, 359 .timer = &omap2_timer,
360 .restart = omap_prcm_restart,
359MACHINE_END 361MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index bd1bcacb40f9..1545102d1f9b 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -37,7 +37,7 @@
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38 38
39#include <plat/board.h> 39#include <plat/board.h>
40#include <plat/common.h> 40#include "common.h"
41#include <plat/nand.h> 41#include <plat/nand.h>
42#include <plat/gpmc.h> 42#include <plat/gpmc.h>
43#include <plat/usb.h> 43#include <plat/usb.h>
@@ -634,8 +634,10 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
634 .map_io = omap3_map_io, 634 .map_io = omap3_map_io,
635 .init_early = omap35xx_init_early, 635 .init_early = omap35xx_init_early,
636 .init_irq = omap3_init_irq, 636 .init_irq = omap3_init_irq,
637 .handle_irq = omap3_intc_handle_irq,
637 .init_machine = cm_t35_init, 638 .init_machine = cm_t35_init,
638 .timer = &omap3_timer, 639 .timer = &omap3_timer,
640 .restart = omap_prcm_restart,
639MACHINE_END 641MACHINE_END
640 642
641MACHINE_START(CM_T3730, "Compulab CM-T3730") 643MACHINE_START(CM_T3730, "Compulab CM-T3730")
@@ -644,6 +646,8 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730")
644 .map_io = omap3_map_io, 646 .map_io = omap3_map_io,
645 .init_early = omap3630_init_early, 647 .init_early = omap3630_init_early,
646 .init_irq = omap3_init_irq, 648 .init_irq = omap3_init_irq,
649 .handle_irq = omap3_intc_handle_irq,
647 .init_machine = cm_t3730_init, 650 .init_machine = cm_t3730_init,
648 .timer = &omap3_timer, 651 .timer = &omap3_timer,
652 .restart = omap_prcm_restart,
649MACHINE_END 653MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 3f4dc6626845..f36d694d2159 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -39,7 +39,7 @@
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40 40
41#include <plat/board.h> 41#include <plat/board.h>
42#include <plat/common.h> 42#include "common.h"
43#include <plat/usb.h> 43#include <plat/usb.h>
44#include <plat/nand.h> 44#include <plat/nand.h>
45#include <plat/gpmc.h> 45#include <plat/gpmc.h>
@@ -299,6 +299,8 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
299 .map_io = omap3_map_io, 299 .map_io = omap3_map_io,
300 .init_early = am35xx_init_early, 300 .init_early = am35xx_init_early,
301 .init_irq = omap3_init_irq, 301 .init_irq = omap3_init_irq,
302 .handle_irq = omap3_intc_handle_irq,
302 .init_machine = cm_t3517_init, 303 .init_machine = cm_t3517_init,
303 .timer = &omap3_timer, 304 .timer = &omap3_timer,
305 .restart = omap_prcm_restart,
304MACHINE_END 306MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 90154e411da0..e873063f4fda 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -41,7 +41,7 @@
41#include <asm/mach/flash.h> 41#include <asm/mach/flash.h>
42 42
43#include <plat/board.h> 43#include <plat/board.h>
44#include <plat/common.h> 44#include "common.h"
45#include <plat/gpmc.h> 45#include <plat/gpmc.h>
46#include <plat/nand.h> 46#include <plat/nand.h>
47#include <plat/usb.h> 47#include <plat/usb.h>
@@ -660,6 +660,8 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
660 .map_io = omap3_map_io, 660 .map_io = omap3_map_io,
661 .init_early = omap35xx_init_early, 661 .init_early = omap35xx_init_early,
662 .init_irq = omap3_init_irq, 662 .init_irq = omap3_init_irq,
663 .handle_irq = omap3_intc_handle_irq,
663 .init_machine = devkit8000_init, 664 .init_machine = devkit8000_init,
664 .timer = &omap3_secure_timer, 665 .timer = &omap3_secure_timer,
666 .restart = omap_prcm_restart,
665MACHINE_END 667MACHINE_END
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index fb55fa3dad5a..f8c5b2cc7c9c 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -20,8 +20,7 @@
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21 21
22#include <plat/board.h> 22#include <plat/board.h>
23#include <plat/common.h> 23#include "common.h"
24#include <mach/omap4-common.h>
25#include "common-board-devices.h" 24#include "common-board-devices.h"
26 25
27/* 26/*
@@ -107,6 +106,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
107 .init_machine = omap_generic_init, 106 .init_machine = omap_generic_init,
108 .timer = &omap2_timer, 107 .timer = &omap2_timer,
109 .dt_compat = omap242x_boards_compat, 108 .dt_compat = omap242x_boards_compat,
109 .restart = omap_prcm_restart,
110MACHINE_END 110MACHINE_END
111#endif 111#endif
112 112
@@ -122,9 +122,11 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
122 .map_io = omap243x_map_io, 122 .map_io = omap243x_map_io,
123 .init_early = omap2430_init_early, 123 .init_early = omap2430_init_early,
124 .init_irq = omap2_init_irq, 124 .init_irq = omap2_init_irq,
125 .handle_irq = omap2_intc_handle_irq,
125 .init_machine = omap_generic_init, 126 .init_machine = omap_generic_init,
126 .timer = &omap2_timer, 127 .timer = &omap2_timer,
127 .dt_compat = omap243x_boards_compat, 128 .dt_compat = omap243x_boards_compat,
129 .restart = omap_prcm_restart,
128MACHINE_END 130MACHINE_END
129#endif 131#endif
130 132
@@ -143,6 +145,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
143 .init_machine = omap3_init, 145 .init_machine = omap3_init,
144 .timer = &omap3_timer, 146 .timer = &omap3_timer,
145 .dt_compat = omap3_boards_compat, 147 .dt_compat = omap3_boards_compat,
148 .restart = omap_prcm_restart,
146MACHINE_END 149MACHINE_END
147#endif 150#endif
148 151
@@ -161,5 +164,6 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
161 .init_machine = omap4_init, 164 .init_machine = omap4_init,
162 .timer = &omap4_timer, 165 .timer = &omap4_timer,
163 .dt_compat = omap4_boards_compat, 166 .dt_compat = omap4_boards_compat,
167 .restart = omap_prcm_restart,
164MACHINE_END 168MACHINE_END
165#endif 169#endif
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 8b351d92a1cc..54af800d143c 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -34,7 +34,7 @@
34 34
35#include <plat/usb.h> 35#include <plat/usb.h>
36#include <plat/board.h> 36#include <plat/board.h>
37#include <plat/common.h> 37#include "common.h"
38#include <plat/menelaus.h> 38#include <plat/menelaus.h>
39#include <plat/dma.h> 39#include <plat/dma.h>
40#include <plat/gpmc.h> 40#include <plat/gpmc.h>
@@ -396,6 +396,8 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
396 .map_io = omap242x_map_io, 396 .map_io = omap242x_map_io,
397 .init_early = omap2420_init_early, 397 .init_early = omap2420_init_early,
398 .init_irq = omap2_init_irq, 398 .init_irq = omap2_init_irq,
399 .handle_irq = omap2_intc_handle_irq,
399 .init_machine = omap_h4_init, 400 .init_machine = omap_h4_init,
400 .timer = &omap2_timer, 401 .timer = &omap2_timer,
402 .restart = omap_prcm_restart,
401MACHINE_END 403MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index d0a3f78a9b69..a59ace0ed560 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -28,7 +28,7 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29 29
30#include <plat/board.h> 30#include <plat/board.h>
31#include <plat/common.h> 31#include "common.h"
32#include <plat/gpmc.h> 32#include <plat/gpmc.h>
33#include <plat/usb.h> 33#include <plat/usb.h>
34#include <video/omapdss.h> 34#include <video/omapdss.h>
@@ -672,8 +672,10 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
672 .map_io = omap3_map_io, 672 .map_io = omap3_map_io,
673 .init_early = omap35xx_init_early, 673 .init_early = omap35xx_init_early,
674 .init_irq = omap3_init_irq, 674 .init_irq = omap3_init_irq,
675 .handle_irq = omap3_intc_handle_irq,
675 .init_machine = igep_init, 676 .init_machine = igep_init,
676 .timer = &omap3_timer, 677 .timer = &omap3_timer,
678 .restart = omap_prcm_restart,
677MACHINE_END 679MACHINE_END
678 680
679MACHINE_START(IGEP0030, "IGEP OMAP3 module") 681MACHINE_START(IGEP0030, "IGEP OMAP3 module")
@@ -682,6 +684,8 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
682 .map_io = omap3_map_io, 684 .map_io = omap3_map_io,
683 .init_early = omap35xx_init_early, 685 .init_early = omap35xx_init_early,
684 .init_irq = omap3_init_irq, 686 .init_irq = omap3_init_irq,
687 .handle_irq = omap3_intc_handle_irq,
685 .init_machine = igep_init, 688 .init_machine = igep_init,
686 .timer = &omap3_timer, 689 .timer = &omap3_timer,
690 .restart = omap_prcm_restart,
687MACHINE_END 691MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e179da0c4da5..2d2a61f7dcbf 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -36,7 +36,7 @@
36 36
37#include <plat/mcspi.h> 37#include <plat/mcspi.h>
38#include <plat/board.h> 38#include <plat/board.h>
39#include <plat/common.h> 39#include "common.h"
40#include <plat/gpmc.h> 40#include <plat/gpmc.h>
41#include <mach/board-zoom.h> 41#include <mach/board-zoom.h>
42 42
@@ -434,6 +434,8 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
434 .map_io = omap3_map_io, 434 .map_io = omap3_map_io,
435 .init_early = omap3430_init_early, 435 .init_early = omap3430_init_early,
436 .init_irq = omap3_init_irq, 436 .init_irq = omap3_init_irq,
437 .handle_irq = omap3_intc_handle_irq,
437 .init_machine = omap_ldp_init, 438 .init_machine = omap_ldp_init,
438 .timer = &omap3_timer, 439 .timer = &omap3_timer,
440 .restart = omap_prcm_restart,
439MACHINE_END 441MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index e9d5f4a3d064..cef2cf1c0b8d 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -26,7 +26,7 @@
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27 27
28#include <plat/board.h> 28#include <plat/board.h>
29#include <plat/common.h> 29#include "common.h"
30#include <plat/menelaus.h> 30#include <plat/menelaus.h>
31#include <mach/irqs.h> 31#include <mach/irqs.h>
32#include <plat/mcspi.h> 32#include <plat/mcspi.h>
@@ -689,8 +689,10 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
689 .map_io = omap242x_map_io, 689 .map_io = omap242x_map_io,
690 .init_early = omap2420_init_early, 690 .init_early = omap2420_init_early,
691 .init_irq = omap2_init_irq, 691 .init_irq = omap2_init_irq,
692 .handle_irq = omap2_intc_handle_irq,
692 .init_machine = n8x0_init_machine, 693 .init_machine = n8x0_init_machine,
693 .timer = &omap2_timer, 694 .timer = &omap2_timer,
695 .restart = omap_prcm_restart,
694MACHINE_END 696MACHINE_END
695 697
696MACHINE_START(NOKIA_N810, "Nokia N810") 698MACHINE_START(NOKIA_N810, "Nokia N810")
@@ -699,8 +701,10 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
699 .map_io = omap242x_map_io, 701 .map_io = omap242x_map_io,
700 .init_early = omap2420_init_early, 702 .init_early = omap2420_init_early,
701 .init_irq = omap2_init_irq, 703 .init_irq = omap2_init_irq,
704 .handle_irq = omap2_intc_handle_irq,
702 .init_machine = n8x0_init_machine, 705 .init_machine = n8x0_init_machine,
703 .timer = &omap2_timer, 706 .timer = &omap2_timer,
707 .restart = omap_prcm_restart,
704MACHINE_END 708MACHINE_END
705 709
706MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") 710MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
@@ -709,6 +713,8 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
709 .map_io = omap242x_map_io, 713 .map_io = omap242x_map_io,
710 .init_early = omap2420_init_early, 714 .init_early = omap2420_init_early,
711 .init_irq = omap2_init_irq, 715 .init_irq = omap2_init_irq,
716 .handle_irq = omap2_intc_handle_irq,
712 .init_machine = n8x0_init_machine, 717 .init_machine = n8x0_init_machine,
713 .timer = &omap2_timer, 718 .timer = &omap2_timer,
719 .restart = omap_prcm_restart,
714MACHINE_END 720MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 4a71cb7e42d4..7ffcd2839e7b 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -40,7 +40,7 @@
40#include <asm/mach/flash.h> 40#include <asm/mach/flash.h>
41 41
42#include <plat/board.h> 42#include <plat/board.h>
43#include <plat/common.h> 43#include "common.h"
44#include <video/omapdss.h> 44#include <video/omapdss.h>
45#include <video/omap-panel-dvi.h> 45#include <video/omap-panel-dvi.h>
46#include <plat/gpmc.h> 46#include <plat/gpmc.h>
@@ -559,6 +559,8 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
559 .map_io = omap3_map_io, 559 .map_io = omap3_map_io,
560 .init_early = omap3_init_early, 560 .init_early = omap3_init_early,
561 .init_irq = omap3_init_irq, 561 .init_irq = omap3_init_irq,
562 .handle_irq = omap3_intc_handle_irq,
562 .init_machine = omap3_beagle_init, 563 .init_machine = omap3_beagle_init,
563 .timer = &omap3_secure_timer, 564 .timer = &omap3_secure_timer,
565 .restart = omap_prcm_restart,
564MACHINE_END 566MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index ec00b2ec7022..003fe34c9343 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -43,7 +43,7 @@
43 43
44#include <plat/board.h> 44#include <plat/board.h>
45#include <plat/usb.h> 45#include <plat/usb.h>
46#include <plat/common.h> 46#include "common.h"
47#include <plat/mcspi.h> 47#include <plat/mcspi.h>
48#include <video/omapdss.h> 48#include <video/omapdss.h>
49#include <video/omap-panel-dvi.h> 49#include <video/omap-panel-dvi.h>
@@ -681,6 +681,8 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
681 .map_io = omap3_map_io, 681 .map_io = omap3_map_io,
682 .init_early = omap35xx_init_early, 682 .init_early = omap35xx_init_early,
683 .init_irq = omap3_init_irq, 683 .init_irq = omap3_init_irq,
684 .handle_irq = omap3_intc_handle_irq,
684 .init_machine = omap3_evm_init, 685 .init_machine = omap3_evm_init,
685 .timer = &omap3_timer, 686 .timer = &omap3_timer,
687 .restart = omap_prcm_restart,
686MACHINE_END 688MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 7c0f193f246d..4198dd017d8f 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -40,7 +40,7 @@
40 40
41#include <plat/mux.h> 41#include <plat/mux.h>
42#include <plat/board.h> 42#include <plat/board.h>
43#include <plat/common.h> 43#include "common.h"
44#include <plat/gpmc-smsc911x.h> 44#include <plat/gpmc-smsc911x.h>
45#include <plat/gpmc.h> 45#include <plat/gpmc.h>
46#include <plat/sdrc.h> 46#include <plat/sdrc.h>
@@ -208,8 +208,10 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
208 .map_io = omap3_map_io, 208 .map_io = omap3_map_io,
209 .init_early = omap35xx_init_early, 209 .init_early = omap35xx_init_early,
210 .init_irq = omap3_init_irq, 210 .init_irq = omap3_init_irq,
211 .handle_irq = omap3_intc_handle_irq,
211 .init_machine = omap3logic_init, 212 .init_machine = omap3logic_init,
212 .timer = &omap3_timer, 213 .timer = &omap3_timer,
214 .restart = omap_prcm_restart,
213MACHINE_END 215MACHINE_END
214 216
215MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") 217MACHINE_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")
217 .map_io = omap3_map_io, 219 .map_io = omap3_map_io,
218 .init_early = omap35xx_init_early, 220 .init_early = omap35xx_init_early,
219 .init_irq = omap3_init_irq, 221 .init_irq = omap3_init_irq,
222 .handle_irq = omap3_intc_handle_irq,
220 .init_machine = omap3logic_init, 223 .init_machine = omap3logic_init,
221 .timer = &omap3_timer, 224 .timer = &omap3_timer,
225 .restart = omap_prcm_restart,
222MACHINE_END 226MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index f7811f4cfc3d..1644b73017fc 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -41,7 +41,7 @@
41#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42 42
43#include <plat/board.h> 43#include <plat/board.h>
44#include <plat/common.h> 44#include "common.h"
45#include <mach/hardware.h> 45#include <mach/hardware.h>
46#include <plat/mcspi.h> 46#include <plat/mcspi.h>
47#include <plat/usb.h> 47#include <plat/usb.h>
@@ -606,6 +606,8 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
606 .map_io = omap3_map_io, 606 .map_io = omap3_map_io,
607 .init_early = omap35xx_init_early, 607 .init_early = omap35xx_init_early,
608 .init_irq = omap3_init_irq, 608 .init_irq = omap3_init_irq,
609 .handle_irq = omap3_intc_handle_irq,
609 .init_machine = omap3pandora_init, 610 .init_machine = omap3pandora_init,
610 .timer = &omap3_timer, 611 .timer = &omap3_timer,
612 .restart = omap_prcm_restart,
611MACHINE_END 613MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index ddb7d6663c6d..cb089a46f62f 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -35,7 +35,7 @@
35#include <asm/mach/flash.h> 35#include <asm/mach/flash.h>
36 36
37#include <plat/board.h> 37#include <plat/board.h>
38#include <plat/common.h> 38#include "common.h"
39#include <plat/gpmc.h> 39#include <plat/gpmc.h>
40#include <plat/nand.h> 40#include <plat/nand.h>
41#include <plat/usb.h> 41#include <plat/usb.h>
@@ -454,6 +454,8 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
454 .map_io = omap3_map_io, 454 .map_io = omap3_map_io,
455 .init_early = omap35xx_init_early, 455 .init_early = omap35xx_init_early,
456 .init_irq = omap3_init_irq, 456 .init_irq = omap3_init_irq,
457 .handle_irq = omap3_intc_handle_irq,
457 .init_machine = omap3_stalker_init, 458 .init_machine = omap3_stalker_init,
458 .timer = &omap3_secure_timer, 459 .timer = &omap3_secure_timer,
460 .restart = omap_prcm_restart,
459MACHINE_END 461MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index a2d0d1971e27..a0b851aafcca 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -44,7 +44,7 @@
44#include <asm/mach/flash.h> 44#include <asm/mach/flash.h>
45 45
46#include <plat/board.h> 46#include <plat/board.h>
47#include <plat/common.h> 47#include "common.h"
48#include <plat/gpmc.h> 48#include <plat/gpmc.h>
49#include <plat/nand.h> 49#include <plat/nand.h>
50#include <plat/usb.h> 50#include <plat/usb.h>
@@ -381,6 +381,8 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
381 .map_io = omap3_map_io, 381 .map_io = omap3_map_io,
382 .init_early = omap3430_init_early, 382 .init_early = omap3430_init_early,
383 .init_irq = omap3_init_irq, 383 .init_irq = omap3_init_irq,
384 .handle_irq = omap3_intc_handle_irq,
384 .init_machine = omap3_touchbook_init, 385 .init_machine = omap3_touchbook_init,
385 .timer = &omap3_secure_timer, 386 .timer = &omap3_secure_timer,
387 .restart = omap_prcm_restart,
386MACHINE_END 388MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index a8c2c4263e38..8b06c6a60d02 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -30,14 +30,14 @@
30#include <linux/wl12xx.h> 30#include <linux/wl12xx.h>
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/omap4-common.h> 33#include <asm/hardware/gic.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include <video/omapdss.h> 37#include <video/omapdss.h>
38 38
39#include <plat/board.h> 39#include <plat/board.h>
40#include <plat/common.h> 40#include "common.h"
41#include <plat/usb.h> 41#include <plat/usb.h>
42#include <plat/mmc.h> 42#include <plat/mmc.h>
43#include <video/omap-panel-dvi.h> 43#include <video/omap-panel-dvi.h>
@@ -577,6 +577,8 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
577 .map_io = omap4_map_io, 577 .map_io = omap4_map_io,
578 .init_early = omap4430_init_early, 578 .init_early = omap4430_init_early,
579 .init_irq = gic_init_irq, 579 .init_irq = gic_init_irq,
580 .handle_irq = gic_handle_irq,
580 .init_machine = omap4_panda_init, 581 .init_machine = omap4_panda_init,
581 .timer = &omap4_timer, 582 .timer = &omap4_timer,
583 .restart = omap_prcm_restart,
582MACHINE_END 584MACHINE_END
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 4cf7aeabab86..52c0cef77165 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -43,7 +43,7 @@
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44 44
45#include <plat/board.h> 45#include <plat/board.h>
46#include <plat/common.h> 46#include "common.h"
47#include <video/omapdss.h> 47#include <video/omapdss.h>
48#include <video/omap-panel-generic-dpi.h> 48#include <video/omap-panel-generic-dpi.h>
49#include <video/omap-panel-dvi.h> 49#include <video/omap-panel-dvi.h>
@@ -562,6 +562,8 @@ MACHINE_START(OVERO, "Gumstix Overo")
562 .map_io = omap3_map_io, 562 .map_io = omap3_map_io,
563 .init_early = omap35xx_init_early, 563 .init_early = omap35xx_init_early,
564 .init_irq = omap3_init_irq, 564 .init_irq = omap3_init_irq,
565 .handle_irq = omap3_intc_handle_irq,
565 .init_machine = overo_init, 566 .init_machine = overo_init,
566 .timer = &omap3_timer, 567 .timer = &omap3_timer,
568 .restart = omap_prcm_restart,
567MACHINE_END 569MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 616fb39763b0..8678b386c6a2 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -25,7 +25,7 @@
25#include <plat/mmc.h> 25#include <plat/mmc.h>
26#include <plat/usb.h> 26#include <plat/usb.h>
27#include <plat/gpmc.h> 27#include <plat/gpmc.h>
28#include <plat/common.h> 28#include "common.h"
29#include <plat/onenand.h> 29#include <plat/onenand.h>
30 30
31#include "mux.h" 31#include "mux.h"
@@ -149,6 +149,8 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
149 .map_io = omap3_map_io, 149 .map_io = omap3_map_io,
150 .init_early = omap3630_init_early, 150 .init_early = omap3630_init_early,
151 .init_irq = omap3_init_irq, 151 .init_irq = omap3_init_irq,
152 .handle_irq = omap3_intc_handle_irq,
152 .init_machine = rm680_init, 153 .init_machine = rm680_init,
153 .timer = &omap3_timer, 154 .timer = &omap3_timer,
155 .restart = omap_prcm_restart,
154MACHINE_END 156MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index ba1aa07bdb29..108fee6146fc 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -27,7 +27,7 @@
27 27
28#include <plat/mcspi.h> 28#include <plat/mcspi.h>
29#include <plat/board.h> 29#include <plat/board.h>
30#include <plat/common.h> 30#include "common.h"
31#include <plat/dma.h> 31#include <plat/dma.h>
32#include <plat/gpmc.h> 32#include <plat/gpmc.h>
33#include <plat/onenand.h> 33#include <plat/onenand.h>
@@ -193,7 +193,7 @@ static struct platform_device rx51_charger_device = {
193static void __init rx51_charger_init(void) 193static void __init rx51_charger_init(void)
194{ 194{
195 WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO, 195 WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO,
196 GPIOF_OUT_INIT_LOW, "isp1704_reset")); 196 GPIOF_OUT_INIT_HIGH, "isp1704_reset"));
197 197
198 platform_device_register(&rx51_charger_device); 198 platform_device_register(&rx51_charger_device);
199} 199}
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 4af7c4b2881a..27f01f051dff 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -25,7 +25,7 @@
25 25
26#include <plat/mcspi.h> 26#include <plat/mcspi.h>
27#include <plat/board.h> 27#include <plat/board.h>
28#include <plat/common.h> 28#include "common.h"
29#include <plat/dma.h> 29#include <plat/dma.h>
30#include <plat/gpmc.h> 30#include <plat/gpmc.h>
31#include <plat/usb.h> 31#include <plat/usb.h>
@@ -127,6 +127,8 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
127 .map_io = omap3_map_io, 127 .map_io = omap3_map_io,
128 .init_early = omap3430_init_early, 128 .init_early = omap3430_init_early,
129 .init_irq = omap3_init_irq, 129 .init_irq = omap3_init_irq,
130 .handle_irq = omap3_intc_handle_irq,
130 .init_machine = rx51_init, 131 .init_machine = rx51_init,
131 .timer = &omap3_timer, 132 .timer = &omap3_timer,
133 .restart = omap_prcm_restart,
132MACHINE_END 134MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index e6ee8842285c..74713e3993e5 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -22,7 +22,7 @@
22 22
23#include <plat/irqs.h> 23#include <plat/irqs.h>
24#include <plat/board.h> 24#include <plat/board.h>
25#include <plat/common.h> 25#include "common.h"
26 26
27static struct omap_board_config_kernel ti8168_evm_config[] __initdata = { 27static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
28}; 28};
@@ -48,4 +48,5 @@ MACHINE_START(TI8168EVM, "ti8168evm")
48 .init_irq = ti816x_init_irq, 48 .init_irq = ti816x_init_irq,
49 .timer = &omap3_timer, 49 .timer = &omap3_timer,
50 .init_machine = ti8168_evm_init, 50 .init_machine = ti8168_evm_init,
51 .restart = omap_prcm_restart,
51MACHINE_END 52MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 6d0aa4fcb7c3..8d7ce11cfeaf 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -24,7 +24,7 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26 26
27#include <plat/common.h> 27#include "common.h"
28#include <plat/usb.h> 28#include <plat/usb.h>
29 29
30#include <mach/board-zoom.h> 30#include <mach/board-zoom.h>
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index be6684dc4f55..5c20bcc57f2b 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -21,7 +21,7 @@
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23 23
24#include <plat/common.h> 24#include "common.h"
25#include <plat/board.h> 25#include <plat/board.h>
26#include <plat/usb.h> 26#include <plat/usb.h>
27 27
@@ -135,8 +135,10 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
135 .map_io = omap3_map_io, 135 .map_io = omap3_map_io,
136 .init_early = omap3430_init_early, 136 .init_early = omap3430_init_early,
137 .init_irq = omap3_init_irq, 137 .init_irq = omap3_init_irq,
138 .handle_irq = omap3_intc_handle_irq,
138 .init_machine = omap_zoom_init, 139 .init_machine = omap_zoom_init,
139 .timer = &omap3_timer, 140 .timer = &omap3_timer,
141 .restart = omap_prcm_restart,
140MACHINE_END 142MACHINE_END
141 143
142MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") 144MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
@@ -145,6 +147,8 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
145 .map_io = omap3_map_io, 147 .map_io = omap3_map_io,
146 .init_early = omap3630_init_early, 148 .init_early = omap3630_init_early,
147 .init_irq = omap3_init_irq, 149 .init_irq = omap3_init_irq,
150 .handle_irq = omap3_intc_handle_irq,
148 .init_machine = omap_zoom_init, 151 .init_machine = omap_zoom_init,
149 .timer = &omap3_timer, 152 .timer = &omap3_timer,
153 .restart = omap_prcm_restart,
150MACHINE_END 154MACHINE_END
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
index 38830d8d4783..04d39cdd2112 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -18,7 +18,7 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
21#include <plat/common.h> 21#include "common.h"
22 22
23#include "cm.h" 23#include "cm.h"
24#include "cm2xxx_3xxx.h" 24#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/cm44xx.c b/arch/arm/mach-omap2/cm44xx.c
index e96f53ea01a1..6a836303252c 100644
--- a/arch/arm/mach-omap2/cm44xx.c
+++ b/arch/arm/mach-omap2/cm44xx.c
@@ -18,7 +18,7 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
21#include <plat/common.h> 21#include "common.h"
22 22
23#include "cm.h" 23#include "cm.h"
24#include "cm1_44xx.h" 24#include "cm1_44xx.h"
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index eb2a472bbf46..6204deaf85b1 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -20,7 +20,7 @@
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <plat/common.h> 23#include "common.h"
24 24
25#include "cm.h" 25#include "cm.h"
26#include "cm1_44xx.h" 26#include "cm1_44xx.h"
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 110e5b9db145..684b8a7cd401 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -17,7 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <plat/common.h> 20#include "common.h"
21#include <plat/board.h> 21#include <plat/board.h>
22#include <plat/mux.h> 22#include <plat/mux.h>
23 23
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
new file mode 100644
index 000000000000..cda888a2e635
--- /dev/null
+++ b/arch/arm/mach-omap2/common.h
@@ -0,0 +1,186 @@
1/*
2 * Header for code common to all OMAP2+ machines.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
12 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
13 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
15 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
16 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
18 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#ifndef __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H
26#define __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H
27
28#include <linux/delay.h>
29#include <plat/common.h>
30
31#ifdef CONFIG_SOC_OMAP2420
32extern void omap242x_map_common_io(void);
33#else
34static inline void omap242x_map_common_io(void)
35{
36}
37#endif
38
39#ifdef CONFIG_SOC_OMAP2430
40extern void omap243x_map_common_io(void);
41#else
42static inline void omap243x_map_common_io(void)
43{
44}
45#endif
46
47#ifdef CONFIG_ARCH_OMAP3
48extern void omap34xx_map_common_io(void);
49#else
50static inline void omap34xx_map_common_io(void)
51{
52}
53#endif
54
55#ifdef CONFIG_SOC_OMAPTI816X
56extern void omapti816x_map_common_io(void);
57#else
58static inline void omapti816x_map_common_io(void)
59{
60}
61#endif
62
63#ifdef CONFIG_ARCH_OMAP4
64extern void omap44xx_map_common_io(void);
65#else
66static inline void omap44xx_map_common_io(void)
67{
68}
69#endif
70
71extern void omap2_init_common_infrastructure(void);
72
73extern struct sys_timer omap2_timer;
74extern struct sys_timer omap3_timer;
75extern struct sys_timer omap3_secure_timer;
76extern struct sys_timer omap4_timer;
77
78void omap2420_init_early(void);
79void omap2430_init_early(void);
80void omap3430_init_early(void);
81void omap35xx_init_early(void);
82void omap3630_init_early(void);
83void omap3_init_early(void); /* Do not use this one */
84void am35xx_init_early(void);
85void ti816x_init_early(void);
86void omap4430_init_early(void);
87void omap_prcm_restart(char, const char *);
88
89/*
90 * IO bases for various OMAP processors
91 * Except the tap base, rest all the io bases
92 * listed are physical addresses.
93 */
94struct omap_globals {
95 u32 class; /* OMAP class to detect */
96 void __iomem *tap; /* Control module ID code */
97 void __iomem *sdrc; /* SDRAM Controller */
98 void __iomem *sms; /* SDRAM Memory Scheduler */
99 void __iomem *ctrl; /* System Control Module */
100 void __iomem *ctrl_pad; /* PAD Control Module */
101 void __iomem *prm; /* Power and Reset Management */
102 void __iomem *cm; /* Clock Management */
103 void __iomem *cm2;
104};
105
106void omap2_set_globals_242x(void);
107void omap2_set_globals_243x(void);
108void omap2_set_globals_3xxx(void);
109void omap2_set_globals_443x(void);
110void omap2_set_globals_ti816x(void);
111
112/* These get called from omap2_set_globals_xxxx(), do not call these */
113void omap2_set_globals_tap(struct omap_globals *);
114void omap2_set_globals_sdrc(struct omap_globals *);
115void omap2_set_globals_control(struct omap_globals *);
116void omap2_set_globals_prcm(struct omap_globals *);
117
118void omap242x_map_io(void);
119void omap243x_map_io(void);
120void omap3_map_io(void);
121void omap4_map_io(void);
122
123/**
124 * omap_test_timeout - busy-loop, testing a condition
125 * @cond: condition to test until it evaluates to true
126 * @timeout: maximum number of microseconds in the timeout
127 * @index: loop index (integer)
128 *
129 * Loop waiting for @cond to become true or until at least @timeout
130 * microseconds have passed. To use, define some integer @index in the
131 * calling code. After running, if @index == @timeout, then the loop has
132 * timed out.
133 */
134#define omap_test_timeout(cond, timeout, index) \
135({ \
136 for (index = 0; index < timeout; index++) { \
137 if (cond) \
138 break; \
139 udelay(1); \
140 } \
141})
142
143extern struct device *omap2_get_mpuss_device(void);
144extern struct device *omap2_get_iva_device(void);
145extern struct device *omap2_get_l3_device(void);
146extern struct device *omap4_get_dsp_device(void);
147
148void omap2_init_irq(void);
149void omap3_init_irq(void);
150void ti816x_init_irq(void);
151extern int omap_irq_pending(void);
152void omap_intc_save_context(void);
153void omap_intc_restore_context(void);
154void omap3_intc_suspend(void);
155void omap3_intc_prepare_idle(void);
156void omap3_intc_resume_idle(void);
157void omap2_intc_handle_irq(struct pt_regs *regs);
158void omap3_intc_handle_irq(struct pt_regs *regs);
159
160/*
161 * wfi used in low power code. Directly opcode is used instead
162 * of instruction to avoid mulit-omap build break
163 */
164#ifdef CONFIG_THUMB2_KERNEL
165#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory")
166#else
167#define do_wfi() \
168 __asm__ __volatile__ (".word 0xe320f003" : : : "memory")
169#endif
170
171#ifdef CONFIG_CACHE_L2X0
172extern void __iomem *l2cache_base;
173#endif
174
175extern void __init gic_init_irq(void);
176extern void omap_smc1(u32 fn, u32 arg);
177
178#ifdef CONFIG_SMP
179/* Needed for secondary core boot */
180extern void omap_secondary_startup(void);
181extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
182extern void omap_auxcoreboot_addr(u32 cpu_addr);
183extern u32 omap_read_auxcoreboot0(void);
184#endif
185
186#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index e34d27f8c49c..114c037e433c 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -15,7 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <plat/common.h> 18#include "common.h"
19#include <plat/sdrc.h> 19#include <plat/sdrc.h>
20 20
21#include "cm-regbits-34xx.h" 21#include "cm-regbits-34xx.h"
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 1fe35c24fba2..e20332f4abdc 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -24,6 +24,7 @@
24 24
25#include <linux/sched.h> 25#include <linux/sched.h>
26#include <linux/cpuidle.h> 26#include <linux/cpuidle.h>
27#include <linux/export.h>
27 28
28#include <plat/prcm.h> 29#include <plat/prcm.h>
29#include <plat/irqs.h> 30#include <plat/irqs.h>
@@ -33,6 +34,7 @@
33 34
34#include "pm.h" 35#include "pm.h"
35#include "control.h" 36#include "control.h"
37#include "common.h"
36 38
37#ifdef CONFIG_CPU_IDLE 39#ifdef CONFIG_CPU_IDLE
38 40
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index adb2756e242f..bc6cf863a563 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -22,13 +22,41 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/delay.h>
25 26
26#include <video/omapdss.h> 27#include <video/omapdss.h>
27#include <plat/omap_hwmod.h> 28#include <plat/omap_hwmod.h>
28#include <plat/omap_device.h> 29#include <plat/omap_device.h>
29#include <plat/omap-pm.h> 30#include <plat/omap-pm.h>
31#include "common.h"
30 32
31#include "control.h" 33#include "control.h"
34#include "display.h"
35
36#define DISPC_CONTROL 0x0040
37#define DISPC_CONTROL2 0x0238
38#define DISPC_IRQSTATUS 0x0018
39
40#define DSS_SYSCONFIG 0x10
41#define DSS_SYSSTATUS 0x14
42#define DSS_CONTROL 0x40
43#define DSS_SDI_CONTROL 0x44
44#define DSS_PLL_CONTROL 0x48
45
46#define LCD_EN_MASK (0x1 << 0)
47#define DIGIT_EN_MASK (0x1 << 1)
48
49#define FRAMEDONE_IRQ_SHIFT 0
50#define EVSYNC_EVEN_IRQ_SHIFT 2
51#define EVSYNC_ODD_IRQ_SHIFT 3
52#define FRAMEDONE2_IRQ_SHIFT 22
53#define FRAMEDONETV_IRQ_SHIFT 24
54
55/*
56 * FRAMEDONE_IRQ_TIMEOUT: how long (in milliseconds) to wait during DISPC
57 * reset before deciding that something has gone wrong
58 */
59#define FRAMEDONE_IRQ_TIMEOUT 100
32 60
33static struct platform_device omap_display_device = { 61static struct platform_device omap_display_device = {
34 .name = "omapdss", 62 .name = "omapdss",
@@ -172,3 +200,135 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
172 200
173 return r; 201 return r;
174} 202}
203
204static void dispc_disable_outputs(void)
205{
206 u32 v, irq_mask = 0;
207 bool lcd_en, digit_en, lcd2_en = false;
208 int i;
209 struct omap_dss_dispc_dev_attr *da;
210 struct omap_hwmod *oh;
211
212 oh = omap_hwmod_lookup("dss_dispc");
213 if (!oh) {
214 WARN(1, "display: could not disable outputs during reset - could not find dss_dispc hwmod\n");
215 return;
216 }
217
218 if (!oh->dev_attr) {
219 pr_err("display: could not disable outputs during reset due to missing dev_attr\n");
220 return;
221 }
222
223 da = (struct omap_dss_dispc_dev_attr *)oh->dev_attr;
224
225 /* store value of LCDENABLE and DIGITENABLE bits */
226 v = omap_hwmod_read(oh, DISPC_CONTROL);
227 lcd_en = v & LCD_EN_MASK;
228 digit_en = v & DIGIT_EN_MASK;
229
230 /* store value of LCDENABLE for LCD2 */
231 if (da->manager_count > 2) {
232 v = omap_hwmod_read(oh, DISPC_CONTROL2);
233 lcd2_en = v & LCD_EN_MASK;
234 }
235
236 if (!(lcd_en | digit_en | lcd2_en))
237 return; /* no managers currently enabled */
238
239 /*
240 * If any manager was enabled, we need to disable it before
241 * DSS clocks are disabled or DISPC module is reset
242 */
243 if (lcd_en)
244 irq_mask |= 1 << FRAMEDONE_IRQ_SHIFT;
245
246 if (digit_en) {
247 if (da->has_framedonetv_irq) {
248 irq_mask |= 1 << FRAMEDONETV_IRQ_SHIFT;
249 } else {
250 irq_mask |= 1 << EVSYNC_EVEN_IRQ_SHIFT |
251 1 << EVSYNC_ODD_IRQ_SHIFT;
252 }
253 }
254
255 if (lcd2_en)
256 irq_mask |= 1 << FRAMEDONE2_IRQ_SHIFT;
257
258 /*
259 * clear any previous FRAMEDONE, FRAMEDONETV,
260 * EVSYNC_EVEN/ODD or FRAMEDONE2 interrupts
261 */
262 omap_hwmod_write(irq_mask, oh, DISPC_IRQSTATUS);
263
264 /* disable LCD and TV managers */
265 v = omap_hwmod_read(oh, DISPC_CONTROL);
266 v &= ~(LCD_EN_MASK | DIGIT_EN_MASK);
267 omap_hwmod_write(v, oh, DISPC_CONTROL);
268
269 /* disable LCD2 manager */
270 if (da->manager_count > 2) {
271 v = omap_hwmod_read(oh, DISPC_CONTROL2);
272 v &= ~LCD_EN_MASK;
273 omap_hwmod_write(v, oh, DISPC_CONTROL2);
274 }
275
276 i = 0;
277 while ((omap_hwmod_read(oh, DISPC_IRQSTATUS) & irq_mask) !=
278 irq_mask) {
279 i++;
280 if (i > FRAMEDONE_IRQ_TIMEOUT) {
281 pr_err("didn't get FRAMEDONE1/2 or TV interrupt\n");
282 break;
283 }
284 mdelay(1);
285 }
286}
287
288#define MAX_MODULE_SOFTRESET_WAIT 10000
289int omap_dss_reset(struct omap_hwmod *oh)
290{
291 struct omap_hwmod_opt_clk *oc;
292 int c = 0;
293 int i, r;
294
295 if (!(oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS)) {
296 pr_err("dss_core: hwmod data doesn't contain reset data\n");
297 return -EINVAL;
298 }
299
300 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
301 if (oc->_clk)
302 clk_enable(oc->_clk);
303
304 dispc_disable_outputs();
305
306 /* clear SDI registers */
307 if (cpu_is_omap3430()) {
308 omap_hwmod_write(0x0, oh, DSS_SDI_CONTROL);
309 omap_hwmod_write(0x0, oh, DSS_PLL_CONTROL);
310 }
311
312 /*
313 * clear DSS_CONTROL register to switch DSS clock sources to
314 * PRCM clock, if any
315 */
316 omap_hwmod_write(0x0, oh, DSS_CONTROL);
317
318 omap_test_timeout((omap_hwmod_read(oh, oh->class->sysc->syss_offs)
319 & SYSS_RESETDONE_MASK),
320 MAX_MODULE_SOFTRESET_WAIT, c);
321
322 if (c == MAX_MODULE_SOFTRESET_WAIT)
323 pr_warning("dss_core: waiting for reset to finish failed\n");
324 else
325 pr_debug("dss_core: softreset done\n");
326
327 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
328 if (oc->_clk)
329 clk_disable(oc->_clk);
330
331 r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;
332
333 return r;
334}
diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h
new file mode 100644
index 000000000000..b871b017b352
--- /dev/null
+++ b/arch/arm/mach-omap2/display.h
@@ -0,0 +1,29 @@
1/*
2 * display.h - OMAP2+ integration-specific DSS header
3 *
4 * Copyright (C) 2011 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __ARCH_ARM_MACH_OMAP2_DISPLAY_H
20#define __ARCH_ARM_MACH_OMAP2_DISPLAY_H
21
22#include <linux/kernel.h>
23
24struct omap_dss_dispc_dev_attr {
25 u8 manager_count;
26 bool has_framedonetv_irq;
27};
28
29#endif
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index ace99944e96f..a12e224eb97d 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -21,7 +21,7 @@
21 21
22#include <plat/cpu.h> 22#include <plat/cpu.h>
23#include <plat/i2c.h> 23#include <plat/i2c.h>
24#include <plat/common.h> 24#include "common.h"
25#include <plat/omap_hwmod.h> 25#include <plat/omap_hwmod.h>
26 26
27#include "mux.h" 27#include "mux.h"
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 7f47092a193f..27ad722df637 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -21,7 +21,7 @@
21 21
22#include <asm/cputype.h> 22#include <asm/cputype.h>
23 23
24#include <plat/common.h> 24#include "common.h"
25#include <plat/cpu.h> 25#include <plat/cpu.h>
26 26
27#include <mach/id.h> 27#include <mach/id.h>
diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index feb90a10945a..56964a0c4c7e 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -10,146 +10,9 @@
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13#include <mach/hardware.h>
14#include <mach/io.h>
15#include <mach/irqs.h>
16#include <asm/hardware/gic.h>
17
18#include <plat/omap24xx.h>
19#include <plat/omap34xx.h>
20#include <plat/omap44xx.h>
21
22#include <plat/multi.h>
23
24#define OMAP2_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
25#define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
26#define OMAP4_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
27#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */
28#define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */
29 13
30 .macro disable_fiq 14 .macro disable_fiq
31 .endm 15 .endm
32 16
33 .macro arch_ret_to_user, tmp1, tmp2 17 .macro arch_ret_to_user, tmp1, tmp2
34 .endm 18 .endm
35
36/*
37 * Unoptimized irq functions for multi-omap2, 3 and 4
38 */
39
40#ifdef MULTI_OMAP2
41 /*
42 * Configure the interrupt base on the first interrupt.
43 * See also omap_irq_base_init for setting omap_irq_base.
44 */
45 .macro get_irqnr_preamble, base, tmp
46 ldr \base, =omap_irq_base @ irq base address
47 ldr \base, [\base, #0] @ irq base value
48 .endm
49
50 /* Check the pending interrupts. Note that base already set */
51 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
52 tst \base, #0x100 @ gic address?
53 bne 4401f @ found gic
54
55 /* Handle omap2 and omap3 */
56 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
57 cmp \irqnr, #0x0
58 bne 9998f
59 ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
60 cmp \irqnr, #0x0
61 bne 9998f
62 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
63 cmp \irqnr, #0x0
64 bne 9998f
65
66 /*
67 * ti816x has additional IRQ pending register. Checking this
68 * register on omap2 & omap3 has no effect (read as 0).
69 */
70 ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
71 cmp \irqnr, #0x0
729998:
73 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
74 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
75 b 9999f
76
77 /* Handle omap4 */
784401: ldr \irqstat, [\base, #GIC_CPU_INTACK]
79 ldr \tmp, =1021
80 bic \irqnr, \irqstat, #0x1c00
81 cmp \irqnr, #15
82 cmpcc \irqnr, \irqnr
83 cmpne \irqnr, \tmp
84 cmpcs \irqnr, \irqnr
859999:
86 .endm
87
88#ifdef CONFIG_SMP
89 /* We assume that irqstat (the raw value of the IRQ acknowledge
90 * register) is preserved from the macro above.
91 * If there is an IPI, we immediately signal end of interrupt
92 * on the controller, since this requires the original irqstat
93 * value which we won't easily be able to recreate later.
94 */
95
96 .macro test_for_ipi, irqnr, irqstat, base, tmp
97 bic \irqnr, \irqstat, #0x1c00
98 cmp \irqnr, #16
99 it cc
100 strcc \irqstat, [\base, #GIC_CPU_EOI]
101 it cs
102 cmpcs \irqnr, \irqnr
103 .endm
104#endif /* CONFIG_SMP */
105
106#else /* MULTI_OMAP2 */
107
108
109/*
110 * Optimized irq functions for omap2, 3 and 4
111 */
112
113#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
114 .macro get_irqnr_preamble, base, tmp
115#ifdef CONFIG_ARCH_OMAP2
116 ldr \base, =OMAP2_IRQ_BASE
117#else
118 ldr \base, =OMAP3_IRQ_BASE
119#endif
120 .endm
121
122 /* Check the pending interrupts. Note that base already set */
123 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
124 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
125 cmp \irqnr, #0x0
126 bne 9999f
127 ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
128 cmp \irqnr, #0x0
129 bne 9999f
130 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
131 cmp \irqnr, #0x0
132#ifdef CONFIG_SOC_OMAPTI816X
133 bne 9999f
134 ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
135 cmp \irqnr, #0x0
136#endif
1379999:
138 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
139 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
140
141 .endm
142#endif
143
144
145#ifdef CONFIG_ARCH_OMAP4
146#define HAVE_GET_IRQNR_PREAMBLE
147#include <asm/hardware/entry-macro-gic.S>
148
149 .macro get_irqnr_preamble, base, tmp
150 ldr \base, =OMAP4_IRQ_BASE
151 .endm
152
153#endif
154
155#endif /* MULTI_OMAP2 */
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
index e4bd87619734..000000000000
--- a/arch/arm/mach-omap2/include/mach/omap4-common.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * omap4-common.h: OMAP4 specific common header file
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 *
6 * Author:
7 * Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#ifndef OMAP_ARCH_OMAP4_COMMON_H
14#define OMAP_ARCH_OMAP4_COMMON_H
15
16/*
17 * wfi used in low power code. Directly opcode is used instead
18 * of instruction to avoid mulit-omap build break
19 */
20#ifdef CONFIG_THUMB2_KERNEL
21#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory")
22#else
23#define do_wfi() \
24 __asm__ __volatile__ (".word 0xe320f003" : : : "memory")
25#endif
26
27#ifdef CONFIG_CACHE_L2X0
28extern void __iomem *l2cache_base;
29#endif
30
31extern void __iomem *gic_dist_base_addr;
32
33extern void __init gic_init_irq(void);
34extern void omap_smc1(u32 fn, u32 arg);
35
36#ifdef CONFIG_SMP
37/* Needed for secondary core boot */
38extern void omap_secondary_startup(void);
39extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
40extern void omap_auxcoreboot_addr(u32 cpu_addr);
41extern u32 omap_read_auxcoreboot0(void);
42#endif
43#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
index 866319947760..000000000000
--- a/arch/arm/mach-omap2/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END 0xf8000000UL
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 25d20ced03e1..3f565dd2ea8d 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -35,7 +35,7 @@
35#include "clock3xxx.h" 35#include "clock3xxx.h"
36#include "clock44xx.h" 36#include "clock44xx.h"
37 37
38#include <plat/common.h> 38#include "common.h"
39#include <plat/omap-pm.h> 39#include <plat/omap-pm.h>
40#include "voltage.h" 40#include "voltage.h"
41#include "powerdomain.h" 41#include "powerdomain.h"
@@ -43,7 +43,7 @@
43#include "clockdomain.h" 43#include "clockdomain.h"
44#include <plat/omap_hwmod.h> 44#include <plat/omap_hwmod.h>
45#include <plat/multi.h> 45#include <plat/multi.h>
46#include <plat/common.h> 46#include "common.h"
47 47
48/* 48/*
49 * The machine specific code may provide the extra mapping besides the 49 * The machine specific code may provide the extra mapping besides the
@@ -316,13 +316,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
316 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); 316 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
317} 317}
318 318
319/* See irq.c, omap4-common.c and entry-macro.S */
320void __iomem *omap_irq_base;
321
322static void __init omap_common_init_early(void) 319static void __init omap_common_init_early(void)
323{ 320{
324 omap2_check_revision(); 321 omap2_check_revision();
325 omap_ioremap_init();
326 omap_init_consistent_dma_size(); 322 omap_init_consistent_dma_size();
327} 323}
328 324
diff --git a/arch/arm/mach-omap2/io.h b/arch/arm/mach-omap2/io.h
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/arch/arm/mach-omap2/io.h
+++ /dev/null
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 65f1be6a182c..42b1d6591912 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -15,6 +15,7 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <asm/exception.h>
18#include <asm/mach/irq.h> 19#include <asm/mach/irq.h>
19 20
20 21
@@ -35,6 +36,11 @@
35/* Number of IRQ state bits in each MIR register */ 36/* Number of IRQ state bits in each MIR register */
36#define IRQ_BITS_PER_REG 32 37#define IRQ_BITS_PER_REG 32
37 38
39#define OMAP2_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
40#define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
41#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */
42#define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */
43
38/* 44/*
39 * OMAP2 has a number of different interrupt controllers, each interrupt 45 * OMAP2 has a number of different interrupt controllers, each interrupt
40 * controller is identified as its own "bank". Register definitions are 46 * 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)
143 149
144static void __init omap_init_irq(u32 base, int nr_irqs) 150static void __init omap_init_irq(u32 base, int nr_irqs)
145{ 151{
152 void __iomem *omap_irq_base;
146 unsigned long nr_of_irqs = 0; 153 unsigned long nr_of_irqs = 0;
147 unsigned int nr_banks = 0; 154 unsigned int nr_banks = 0;
148 int i, j; 155 int i, j;
@@ -191,6 +198,44 @@ void __init ti816x_init_irq(void)
191 omap_init_irq(OMAP34XX_IC_BASE, 128); 198 omap_init_irq(OMAP34XX_IC_BASE, 128);
192} 199}
193 200
201static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs)
202{
203 u32 irqnr;
204
205 do {
206 irqnr = readl_relaxed(base_addr + 0x98);
207 if (irqnr)
208 goto out;
209
210 irqnr = readl_relaxed(base_addr + 0xb8);
211 if (irqnr)
212 goto out;
213
214 irqnr = readl_relaxed(base_addr + 0xd8);
215#ifdef CONFIG_SOC_OMAPTI816X
216 if (irqnr)
217 goto out;
218 irqnr = readl_relaxed(base_addr + 0xf8);
219#endif
220
221out:
222 if (!irqnr)
223 break;
224
225 irqnr = readl_relaxed(base_addr + INTCPS_SIR_IRQ_OFFSET);
226 irqnr &= ACTIVEIRQ_MASK;
227
228 if (irqnr)
229 handle_IRQ(irqnr, regs);
230 } while (irqnr);
231}
232
233asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs)
234{
235 void __iomem *base_addr = OMAP2_IRQ_BASE;
236 omap_intc_handle_irq(base_addr, regs);
237}
238
194#ifdef CONFIG_ARCH_OMAP3 239#ifdef CONFIG_ARCH_OMAP3
195static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)]; 240static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
196 241
@@ -263,4 +308,10 @@ void omap3_intc_resume_idle(void)
263 /* Re-enable autoidle */ 308 /* Re-enable autoidle */
264 intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG); 309 intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG);
265} 310}
311
312asmlinkage void __exception_irq_entry omap3_intc_handle_irq(struct pt_regs *regs)
313{
314 void __iomem *base_addr = OMAP3_IRQ_BASE;
315 omap_intc_handle_irq(base_addr, regs);
316}
266#endif /* CONFIG_ARCH_OMAP3 */ 317#endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 292eee3be15f..28fcb27005d2 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
145 pdata->reg_size = 4; 145 pdata->reg_size = 4;
146 pdata->has_ccr = true; 146 pdata->has_ccr = true;
147 } 147 }
148 pdata->set_clk_src = omap2_mcbsp_set_clk_src;
149 if (id == 1)
150 pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
148 151
149 if (oh->class->rev == MCBSP_CONFIG_TYPE3) { 152 if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
150 if (id == 2) 153 if (id == 2)
@@ -174,9 +177,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
174 name, oh->name); 177 name, oh->name);
175 return PTR_ERR(pdev); 178 return PTR_ERR(pdev);
176 } 179 }
177 pdata->set_clk_src = omap2_mcbsp_set_clk_src;
178 if (id == 1)
179 pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
180 omap_mcbsp_count++; 180 omap_mcbsp_count++;
181 return 0; 181 return 0;
182} 182}
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c
index 4976b9393e49..e5a1c3f40a86 100644
--- a/arch/arm/mach-omap2/omap-hotplug.c
+++ b/arch/arm/mach-omap2/omap-hotplug.c
@@ -19,7 +19,8 @@
19#include <linux/smp.h> 19#include <linux/smp.h>
20 20
21#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
22#include <mach/omap4-common.h> 22
23#include "common.h"
23 24
24int platform_cpu_kill(unsigned int cpu) 25int platform_cpu_kill(unsigned int cpu)
25{ 26{
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 4412ddb7b3f6..e99bc6cd4714 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -24,7 +24,8 @@
24#include <asm/hardware/gic.h> 24#include <asm/hardware/gic.h>
25#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/omap4-common.h> 27
28#include "common.h"
28 29
29/* SCU base address */ 30/* SCU base address */
30static void __iomem *scu_base; 31static void __iomem *scu_base;
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 35ac3e5f6e94..beecfdd56ea3 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -22,17 +22,18 @@
22#include <plat/irqs.h> 22#include <plat/irqs.h>
23 23
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/omap4-common.h> 25
26#include "common.h"
26 27
27#ifdef CONFIG_CACHE_L2X0 28#ifdef CONFIG_CACHE_L2X0
28void __iomem *l2cache_base; 29void __iomem *l2cache_base;
29#endif 30#endif
30 31
31void __iomem *gic_dist_base_addr;
32
33
34void __init gic_init_irq(void) 32void __init gic_init_irq(void)
35{ 33{
34 void __iomem *omap_irq_base;
35 void __iomem *gic_dist_base_addr;
36
36 /* Static mapping, never released */ 37 /* Static mapping, never released */
37 gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); 38 gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
38 BUG_ON(!gic_dist_base_addr); 39 BUG_ON(!gic_dist_base_addr);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 6b3088db83b7..529142aff766 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -137,7 +137,7 @@
137#include <linux/mutex.h> 137#include <linux/mutex.h>
138#include <linux/spinlock.h> 138#include <linux/spinlock.h>
139 139
140#include <plat/common.h> 140#include "common.h"
141#include <plat/cpu.h> 141#include <plat/cpu.h>
142#include "clockdomain.h" 142#include "clockdomain.h"
143#include "powerdomain.h" 143#include "powerdomain.h"
@@ -749,7 +749,7 @@ static int _count_mpu_irqs(struct omap_hwmod *oh)
749 ohii = &oh->mpu_irqs[i++]; 749 ohii = &oh->mpu_irqs[i++];
750 } while (ohii->irq != -1); 750 } while (ohii->irq != -1);
751 751
752 return i; 752 return i-1;
753} 753}
754 754
755/** 755/**
@@ -772,7 +772,7 @@ static int _count_sdma_reqs(struct omap_hwmod *oh)
772 ohdi = &oh->sdma_reqs[i++]; 772 ohdi = &oh->sdma_reqs[i++];
773 } while (ohdi->dma_req != -1); 773 } while (ohdi->dma_req != -1);
774 774
775 return i; 775 return i-1;
776} 776}
777 777
778/** 778/**
@@ -795,7 +795,7 @@ static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os)
795 mem = &os->addr[i++]; 795 mem = &os->addr[i++];
796 } while (mem->pa_start != mem->pa_end); 796 } while (mem->pa_start != mem->pa_end);
797 797
798 return i; 798 return i-1;
799} 799}
800 800
801/** 801/**
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 6d7206213525..a5409ce3f323 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -875,6 +875,10 @@ static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
875}; 875};
876 876
877static struct omap_hwmod_opt_clk dss_opt_clks[] = { 877static struct omap_hwmod_opt_clk dss_opt_clks[] = {
878 /*
879 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
880 * driver does not use these clocks.
881 */
878 { .role = "tv_clk", .clk = "dss_54m_fck" }, 882 { .role = "tv_clk", .clk = "dss_54m_fck" },
879 { .role = "sys_clk", .clk = "dss2_fck" }, 883 { .role = "sys_clk", .clk = "dss2_fck" },
880}; 884};
@@ -899,7 +903,7 @@ static struct omap_hwmod omap2420_dss_core_hwmod = {
899 .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves), 903 .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves),
900 .masters = omap2420_dss_masters, 904 .masters = omap2420_dss_masters,
901 .masters_cnt = ARRAY_SIZE(omap2420_dss_masters), 905 .masters_cnt = ARRAY_SIZE(omap2420_dss_masters),
902 .flags = HWMOD_NO_IDLEST, 906 .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
903}; 907};
904 908
905/* l4_core -> dss_dispc */ 909/* l4_core -> dss_dispc */
@@ -939,6 +943,7 @@ static struct omap_hwmod omap2420_dss_dispc_hwmod = {
939 .slaves = omap2420_dss_dispc_slaves, 943 .slaves = omap2420_dss_dispc_slaves,
940 .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves), 944 .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves),
941 .flags = HWMOD_NO_IDLEST, 945 .flags = HWMOD_NO_IDLEST,
946 .dev_attr = &omap2_3_dss_dispc_dev_attr
942}; 947};
943 948
944/* l4_core -> dss_rfbi */ 949/* l4_core -> dss_rfbi */
@@ -961,6 +966,10 @@ static struct omap_hwmod_ocp_if *omap2420_dss_rfbi_slaves[] = {
961 &omap2420_l4_core__dss_rfbi, 966 &omap2420_l4_core__dss_rfbi,
962}; 967};
963 968
969static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
970 { .role = "ick", .clk = "dss_ick" },
971};
972
964static struct omap_hwmod omap2420_dss_rfbi_hwmod = { 973static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
965 .name = "dss_rfbi", 974 .name = "dss_rfbi",
966 .class = &omap2_rfbi_hwmod_class, 975 .class = &omap2_rfbi_hwmod_class,
@@ -972,6 +981,8 @@ static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
972 .module_offs = CORE_MOD, 981 .module_offs = CORE_MOD,
973 }, 982 },
974 }, 983 },
984 .opt_clks = dss_rfbi_opt_clks,
985 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
975 .slaves = omap2420_dss_rfbi_slaves, 986 .slaves = omap2420_dss_rfbi_slaves,
976 .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves), 987 .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves),
977 .flags = HWMOD_NO_IDLEST, 988 .flags = HWMOD_NO_IDLEST,
@@ -981,7 +992,7 @@ static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
981static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = { 992static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = {
982 .master = &omap2420_l4_core_hwmod, 993 .master = &omap2420_l4_core_hwmod,
983 .slave = &omap2420_dss_venc_hwmod, 994 .slave = &omap2420_dss_venc_hwmod,
984 .clk = "dss_54m_fck", 995 .clk = "dss_ick",
985 .addr = omap2_dss_venc_addrs, 996 .addr = omap2_dss_venc_addrs,
986 .fw = { 997 .fw = {
987 .omap2 = { 998 .omap2 = {
@@ -1001,7 +1012,7 @@ static struct omap_hwmod_ocp_if *omap2420_dss_venc_slaves[] = {
1001static struct omap_hwmod omap2420_dss_venc_hwmod = { 1012static struct omap_hwmod omap2420_dss_venc_hwmod = {
1002 .name = "dss_venc", 1013 .name = "dss_venc",
1003 .class = &omap2_venc_hwmod_class, 1014 .class = &omap2_venc_hwmod_class,
1004 .main_clk = "dss1_fck", 1015 .main_clk = "dss_54m_fck",
1005 .prcm = { 1016 .prcm = {
1006 .omap2 = { 1017 .omap2 = {
1007 .prcm_reg_id = 1, 1018 .prcm_reg_id = 1,
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index a2580d01c3ff..c4f56cb60d7d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -942,6 +942,10 @@ static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = {
942}; 942};
943 943
944static struct omap_hwmod_opt_clk dss_opt_clks[] = { 944static struct omap_hwmod_opt_clk dss_opt_clks[] = {
945 /*
946 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
947 * driver does not use these clocks.
948 */
945 { .role = "tv_clk", .clk = "dss_54m_fck" }, 949 { .role = "tv_clk", .clk = "dss_54m_fck" },
946 { .role = "sys_clk", .clk = "dss2_fck" }, 950 { .role = "sys_clk", .clk = "dss2_fck" },
947}; 951};
@@ -966,7 +970,7 @@ static struct omap_hwmod omap2430_dss_core_hwmod = {
966 .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves), 970 .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves),
967 .masters = omap2430_dss_masters, 971 .masters = omap2430_dss_masters,
968 .masters_cnt = ARRAY_SIZE(omap2430_dss_masters), 972 .masters_cnt = ARRAY_SIZE(omap2430_dss_masters),
969 .flags = HWMOD_NO_IDLEST, 973 .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
970}; 974};
971 975
972/* l4_core -> dss_dispc */ 976/* l4_core -> dss_dispc */
@@ -1000,6 +1004,7 @@ static struct omap_hwmod omap2430_dss_dispc_hwmod = {
1000 .slaves = omap2430_dss_dispc_slaves, 1004 .slaves = omap2430_dss_dispc_slaves,
1001 .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves), 1005 .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves),
1002 .flags = HWMOD_NO_IDLEST, 1006 .flags = HWMOD_NO_IDLEST,
1007 .dev_attr = &omap2_3_dss_dispc_dev_attr
1003}; 1008};
1004 1009
1005/* l4_core -> dss_rfbi */ 1010/* l4_core -> dss_rfbi */
@@ -1016,6 +1021,10 @@ static struct omap_hwmod_ocp_if *omap2430_dss_rfbi_slaves[] = {
1016 &omap2430_l4_core__dss_rfbi, 1021 &omap2430_l4_core__dss_rfbi,
1017}; 1022};
1018 1023
1024static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
1025 { .role = "ick", .clk = "dss_ick" },
1026};
1027
1019static struct omap_hwmod omap2430_dss_rfbi_hwmod = { 1028static struct omap_hwmod omap2430_dss_rfbi_hwmod = {
1020 .name = "dss_rfbi", 1029 .name = "dss_rfbi",
1021 .class = &omap2_rfbi_hwmod_class, 1030 .class = &omap2_rfbi_hwmod_class,
@@ -1027,6 +1036,8 @@ static struct omap_hwmod omap2430_dss_rfbi_hwmod = {
1027 .module_offs = CORE_MOD, 1036 .module_offs = CORE_MOD,
1028 }, 1037 },
1029 }, 1038 },
1039 .opt_clks = dss_rfbi_opt_clks,
1040 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
1030 .slaves = omap2430_dss_rfbi_slaves, 1041 .slaves = omap2430_dss_rfbi_slaves,
1031 .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves), 1042 .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves),
1032 .flags = HWMOD_NO_IDLEST, 1043 .flags = HWMOD_NO_IDLEST,
@@ -1036,7 +1047,7 @@ static struct omap_hwmod omap2430_dss_rfbi_hwmod = {
1036static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = { 1047static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = {
1037 .master = &omap2430_l4_core_hwmod, 1048 .master = &omap2430_l4_core_hwmod,
1038 .slave = &omap2430_dss_venc_hwmod, 1049 .slave = &omap2430_dss_venc_hwmod,
1039 .clk = "dss_54m_fck", 1050 .clk = "dss_ick",
1040 .addr = omap2_dss_venc_addrs, 1051 .addr = omap2_dss_venc_addrs,
1041 .flags = OCPIF_SWSUP_IDLE, 1052 .flags = OCPIF_SWSUP_IDLE,
1042 .user = OCP_USER_MPU | OCP_USER_SDMA, 1053 .user = OCP_USER_MPU | OCP_USER_SDMA,
@@ -1050,7 +1061,7 @@ static struct omap_hwmod_ocp_if *omap2430_dss_venc_slaves[] = {
1050static struct omap_hwmod omap2430_dss_venc_hwmod = { 1061static struct omap_hwmod omap2430_dss_venc_hwmod = {
1051 .name = "dss_venc", 1062 .name = "dss_venc",
1052 .class = &omap2_venc_hwmod_class, 1063 .class = &omap2_venc_hwmod_class,
1053 .main_clk = "dss1_fck", 1064 .main_clk = "dss_54m_fck",
1054 .prcm = { 1065 .prcm = {
1055 .omap2 = { 1066 .omap2 = {
1056 .prcm_reg_id = 1, 1067 .prcm_reg_id = 1,
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
index c451729d289a..c11273da5dcc 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
@@ -11,6 +11,7 @@
11#include <plat/omap_hwmod.h> 11#include <plat/omap_hwmod.h>
12#include <plat/serial.h> 12#include <plat/serial.h>
13#include <plat/dma.h> 13#include <plat/dma.h>
14#include <plat/common.h>
14 15
15#include <mach/irqs.h> 16#include <mach/irqs.h>
16 17
@@ -43,13 +44,15 @@ static struct omap_hwmod_class_sysconfig omap2_dss_sysc = {
43 .rev_offs = 0x0000, 44 .rev_offs = 0x0000,
44 .sysc_offs = 0x0010, 45 .sysc_offs = 0x0010,
45 .syss_offs = 0x0014, 46 .syss_offs = 0x0014,
46 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 47 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
48 SYSS_HAS_RESET_STATUS),
47 .sysc_fields = &omap_hwmod_sysc_type1, 49 .sysc_fields = &omap_hwmod_sysc_type1,
48}; 50};
49 51
50struct omap_hwmod_class omap2_dss_hwmod_class = { 52struct omap_hwmod_class omap2_dss_hwmod_class = {
51 .name = "dss", 53 .name = "dss",
52 .sysc = &omap2_dss_sysc, 54 .sysc = &omap2_dss_sysc,
55 .reset = omap_dss_reset,
53}; 56};
54 57
55/* 58/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index bc9035ec87fc..eef43e2e163e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1369,9 +1369,14 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_slaves[] = {
1369}; 1369};
1370 1370
1371static struct omap_hwmod_opt_clk dss_opt_clks[] = { 1371static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1372 { .role = "tv_clk", .clk = "dss_tv_fck" }, 1372 /*
1373 { .role = "video_clk", .clk = "dss_96m_fck" }, 1373 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
1374 * driver does not use these clocks.
1375 */
1374 { .role = "sys_clk", .clk = "dss2_alwon_fck" }, 1376 { .role = "sys_clk", .clk = "dss2_alwon_fck" },
1377 { .role = "tv_clk", .clk = "dss_tv_fck" },
1378 /* required only on OMAP3430 */
1379 { .role = "tv_dac_clk", .clk = "dss_96m_fck" },
1375}; 1380};
1376 1381
1377static struct omap_hwmod omap3430es1_dss_core_hwmod = { 1382static struct omap_hwmod omap3430es1_dss_core_hwmod = {
@@ -1394,11 +1399,12 @@ static struct omap_hwmod omap3430es1_dss_core_hwmod = {
1394 .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves), 1399 .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves),
1395 .masters = omap3xxx_dss_masters, 1400 .masters = omap3xxx_dss_masters,
1396 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), 1401 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
1397 .flags = HWMOD_NO_IDLEST, 1402 .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1398}; 1403};
1399 1404
1400static struct omap_hwmod omap3xxx_dss_core_hwmod = { 1405static struct omap_hwmod omap3xxx_dss_core_hwmod = {
1401 .name = "dss_core", 1406 .name = "dss_core",
1407 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1402 .class = &omap2_dss_hwmod_class, 1408 .class = &omap2_dss_hwmod_class,
1403 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */ 1409 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
1404 .sdma_reqs = omap3xxx_dss_sdma_chs, 1410 .sdma_reqs = omap3xxx_dss_sdma_chs,
@@ -1456,6 +1462,7 @@ static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
1456 .slaves = omap3xxx_dss_dispc_slaves, 1462 .slaves = omap3xxx_dss_dispc_slaves,
1457 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves), 1463 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves),
1458 .flags = HWMOD_NO_IDLEST, 1464 .flags = HWMOD_NO_IDLEST,
1465 .dev_attr = &omap2_3_dss_dispc_dev_attr
1459}; 1466};
1460 1467
1461/* 1468/*
@@ -1486,6 +1493,7 @@ static struct omap_hwmod_addr_space omap3xxx_dss_dsi1_addrs[] = {
1486static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dsi1 = { 1493static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dsi1 = {
1487 .master = &omap3xxx_l4_core_hwmod, 1494 .master = &omap3xxx_l4_core_hwmod,
1488 .slave = &omap3xxx_dss_dsi1_hwmod, 1495 .slave = &omap3xxx_dss_dsi1_hwmod,
1496 .clk = "dss_ick",
1489 .addr = omap3xxx_dss_dsi1_addrs, 1497 .addr = omap3xxx_dss_dsi1_addrs,
1490 .fw = { 1498 .fw = {
1491 .omap2 = { 1499 .omap2 = {
@@ -1502,6 +1510,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_dsi1_slaves[] = {
1502 &omap3xxx_l4_core__dss_dsi1, 1510 &omap3xxx_l4_core__dss_dsi1,
1503}; 1511};
1504 1512
1513static struct omap_hwmod_opt_clk dss_dsi1_opt_clks[] = {
1514 { .role = "sys_clk", .clk = "dss2_alwon_fck" },
1515};
1516
1505static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = { 1517static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = {
1506 .name = "dss_dsi1", 1518 .name = "dss_dsi1",
1507 .class = &omap3xxx_dsi_hwmod_class, 1519 .class = &omap3xxx_dsi_hwmod_class,
@@ -1514,6 +1526,8 @@ static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = {
1514 .module_offs = OMAP3430_DSS_MOD, 1526 .module_offs = OMAP3430_DSS_MOD,
1515 }, 1527 },
1516 }, 1528 },
1529 .opt_clks = dss_dsi1_opt_clks,
1530 .opt_clks_cnt = ARRAY_SIZE(dss_dsi1_opt_clks),
1517 .slaves = omap3xxx_dss_dsi1_slaves, 1531 .slaves = omap3xxx_dss_dsi1_slaves,
1518 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves), 1532 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves),
1519 .flags = HWMOD_NO_IDLEST, 1533 .flags = HWMOD_NO_IDLEST,
@@ -1540,6 +1554,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_rfbi_slaves[] = {
1540 &omap3xxx_l4_core__dss_rfbi, 1554 &omap3xxx_l4_core__dss_rfbi,
1541}; 1555};
1542 1556
1557static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
1558 { .role = "ick", .clk = "dss_ick" },
1559};
1560
1543static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = { 1561static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
1544 .name = "dss_rfbi", 1562 .name = "dss_rfbi",
1545 .class = &omap2_rfbi_hwmod_class, 1563 .class = &omap2_rfbi_hwmod_class,
@@ -1551,6 +1569,8 @@ static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
1551 .module_offs = OMAP3430_DSS_MOD, 1569 .module_offs = OMAP3430_DSS_MOD,
1552 }, 1570 },
1553 }, 1571 },
1572 .opt_clks = dss_rfbi_opt_clks,
1573 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
1554 .slaves = omap3xxx_dss_rfbi_slaves, 1574 .slaves = omap3xxx_dss_rfbi_slaves,
1555 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves), 1575 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves),
1556 .flags = HWMOD_NO_IDLEST, 1576 .flags = HWMOD_NO_IDLEST,
@@ -1560,7 +1580,7 @@ static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
1560static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = { 1580static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = {
1561 .master = &omap3xxx_l4_core_hwmod, 1581 .master = &omap3xxx_l4_core_hwmod,
1562 .slave = &omap3xxx_dss_venc_hwmod, 1582 .slave = &omap3xxx_dss_venc_hwmod,
1563 .clk = "dss_tv_fck", 1583 .clk = "dss_ick",
1564 .addr = omap2_dss_venc_addrs, 1584 .addr = omap2_dss_venc_addrs,
1565 .fw = { 1585 .fw = {
1566 .omap2 = { 1586 .omap2 = {
@@ -1578,10 +1598,15 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_venc_slaves[] = {
1578 &omap3xxx_l4_core__dss_venc, 1598 &omap3xxx_l4_core__dss_venc,
1579}; 1599};
1580 1600
1601static struct omap_hwmod_opt_clk dss_venc_opt_clks[] = {
1602 /* required only on OMAP3430 */
1603 { .role = "tv_dac_clk", .clk = "dss_96m_fck" },
1604};
1605
1581static struct omap_hwmod omap3xxx_dss_venc_hwmod = { 1606static struct omap_hwmod omap3xxx_dss_venc_hwmod = {
1582 .name = "dss_venc", 1607 .name = "dss_venc",
1583 .class = &omap2_venc_hwmod_class, 1608 .class = &omap2_venc_hwmod_class,
1584 .main_clk = "dss1_alwon_fck", 1609 .main_clk = "dss_tv_fck",
1585 .prcm = { 1610 .prcm = {
1586 .omap2 = { 1611 .omap2 = {
1587 .prcm_reg_id = 1, 1612 .prcm_reg_id = 1,
@@ -1589,6 +1614,8 @@ static struct omap_hwmod omap3xxx_dss_venc_hwmod = {
1589 .module_offs = OMAP3430_DSS_MOD, 1614 .module_offs = OMAP3430_DSS_MOD,
1590 }, 1615 },
1591 }, 1616 },
1617 .opt_clks = dss_venc_opt_clks,
1618 .opt_clks_cnt = ARRAY_SIZE(dss_venc_opt_clks),
1592 .slaves = omap3xxx_dss_venc_slaves, 1619 .slaves = omap3xxx_dss_venc_slaves,
1593 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves), 1620 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves),
1594 .flags = HWMOD_NO_IDLEST, 1621 .flags = HWMOD_NO_IDLEST,
@@ -3220,18 +3247,14 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
3220 3247
3221/* 3430ES1-only hwmods */ 3248/* 3430ES1-only hwmods */
3222static __initdata struct omap_hwmod *omap3430es1_hwmods[] = { 3249static __initdata struct omap_hwmod *omap3430es1_hwmods[] = {
3223 &omap3xxx_iva_hwmod,
3224 &omap3430es1_dss_core_hwmod, 3250 &omap3430es1_dss_core_hwmod,
3225 &omap3xxx_mailbox_hwmod,
3226 NULL 3251 NULL
3227}; 3252};
3228 3253
3229/* 3430ES2+-only hwmods */ 3254/* 3430ES2+-only hwmods */
3230static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = { 3255static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = {
3231 &omap3xxx_iva_hwmod,
3232 &omap3xxx_dss_core_hwmod, 3256 &omap3xxx_dss_core_hwmod,
3233 &omap3xxx_usbhsotg_hwmod, 3257 &omap3xxx_usbhsotg_hwmod,
3234 &omap3xxx_mailbox_hwmod,
3235 NULL 3258 NULL
3236}; 3259};
3237 3260
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 7695e5d43316..daaf165af696 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -30,6 +30,7 @@
30#include <plat/mmc.h> 30#include <plat/mmc.h>
31#include <plat/i2c.h> 31#include <plat/i2c.h>
32#include <plat/dmtimer.h> 32#include <plat/dmtimer.h>
33#include <plat/common.h>
33 34
34#include "omap_hwmod_common_data.h" 35#include "omap_hwmod_common_data.h"
35 36
@@ -1187,6 +1188,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_dss_sysc = {
1187static struct omap_hwmod_class omap44xx_dss_hwmod_class = { 1188static struct omap_hwmod_class omap44xx_dss_hwmod_class = {
1188 .name = "dss", 1189 .name = "dss",
1189 .sysc = &omap44xx_dss_sysc, 1190 .sysc = &omap44xx_dss_sysc,
1191 .reset = omap_dss_reset,
1190}; 1192};
1191 1193
1192/* dss */ 1194/* dss */
@@ -1240,12 +1242,12 @@ static struct omap_hwmod_ocp_if *omap44xx_dss_slaves[] = {
1240static struct omap_hwmod_opt_clk dss_opt_clks[] = { 1242static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1241 { .role = "sys_clk", .clk = "dss_sys_clk" }, 1243 { .role = "sys_clk", .clk = "dss_sys_clk" },
1242 { .role = "tv_clk", .clk = "dss_tv_clk" }, 1244 { .role = "tv_clk", .clk = "dss_tv_clk" },
1243 { .role = "dss_clk", .clk = "dss_dss_clk" }, 1245 { .role = "hdmi_clk", .clk = "dss_48mhz_clk" },
1244 { .role = "video_clk", .clk = "dss_48mhz_clk" },
1245}; 1246};
1246 1247
1247static struct omap_hwmod omap44xx_dss_hwmod = { 1248static struct omap_hwmod omap44xx_dss_hwmod = {
1248 .name = "dss_core", 1249 .name = "dss_core",
1250 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1249 .class = &omap44xx_dss_hwmod_class, 1251 .class = &omap44xx_dss_hwmod_class,
1250 .clkdm_name = "l3_dss_clkdm", 1252 .clkdm_name = "l3_dss_clkdm",
1251 .main_clk = "dss_dss_clk", 1253 .main_clk = "dss_dss_clk",
@@ -1325,6 +1327,11 @@ static struct omap_hwmod_addr_space omap44xx_dss_dispc_addrs[] = {
1325 { } 1327 { }
1326}; 1328};
1327 1329
1330static struct omap_dss_dispc_dev_attr omap44xx_dss_dispc_dev_attr = {
1331 .manager_count = 3,
1332 .has_framedonetv_irq = 1
1333};
1334
1328/* l4_per -> dss_dispc */ 1335/* l4_per -> dss_dispc */
1329static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = { 1336static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = {
1330 .master = &omap44xx_l4_per_hwmod, 1337 .master = &omap44xx_l4_per_hwmod,
@@ -1340,12 +1347,6 @@ static struct omap_hwmod_ocp_if *omap44xx_dss_dispc_slaves[] = {
1340 &omap44xx_l4_per__dss_dispc, 1347 &omap44xx_l4_per__dss_dispc,
1341}; 1348};
1342 1349
1343static struct omap_hwmod_opt_clk dss_dispc_opt_clks[] = {
1344 { .role = "sys_clk", .clk = "dss_sys_clk" },
1345 { .role = "tv_clk", .clk = "dss_tv_clk" },
1346 { .role = "hdmi_clk", .clk = "dss_48mhz_clk" },
1347};
1348
1349static struct omap_hwmod omap44xx_dss_dispc_hwmod = { 1350static struct omap_hwmod omap44xx_dss_dispc_hwmod = {
1350 .name = "dss_dispc", 1351 .name = "dss_dispc",
1351 .class = &omap44xx_dispc_hwmod_class, 1352 .class = &omap44xx_dispc_hwmod_class,
@@ -1359,10 +1360,9 @@ static struct omap_hwmod omap44xx_dss_dispc_hwmod = {
1359 .context_offs = OMAP4_RM_DSS_DSS_CONTEXT_OFFSET, 1360 .context_offs = OMAP4_RM_DSS_DSS_CONTEXT_OFFSET,
1360 }, 1361 },
1361 }, 1362 },
1362 .opt_clks = dss_dispc_opt_clks,
1363 .opt_clks_cnt = ARRAY_SIZE(dss_dispc_opt_clks),
1364 .slaves = omap44xx_dss_dispc_slaves, 1363 .slaves = omap44xx_dss_dispc_slaves,
1365 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves), 1364 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves),
1365 .dev_attr = &omap44xx_dss_dispc_dev_attr
1366}; 1366};
1367 1367
1368/* 1368/*
@@ -1624,7 +1624,7 @@ static struct omap_hwmod omap44xx_dss_hdmi_hwmod = {
1624 .clkdm_name = "l3_dss_clkdm", 1624 .clkdm_name = "l3_dss_clkdm",
1625 .mpu_irqs = omap44xx_dss_hdmi_irqs, 1625 .mpu_irqs = omap44xx_dss_hdmi_irqs,
1626 .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs, 1626 .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs,
1627 .main_clk = "dss_dss_clk", 1627 .main_clk = "dss_48mhz_clk",
1628 .prcm = { 1628 .prcm = {
1629 .omap4 = { 1629 .omap4 = {
1630 .clkctrl_offs = OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET, 1630 .clkctrl_offs = OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET,
@@ -1785,7 +1785,7 @@ static struct omap_hwmod omap44xx_dss_venc_hwmod = {
1785 .name = "dss_venc", 1785 .name = "dss_venc",
1786 .class = &omap44xx_venc_hwmod_class, 1786 .class = &omap44xx_venc_hwmod_class,
1787 .clkdm_name = "l3_dss_clkdm", 1787 .clkdm_name = "l3_dss_clkdm",
1788 .main_clk = "dss_dss_clk", 1788 .main_clk = "dss_tv_clk",
1789 .prcm = { 1789 .prcm = {
1790 .omap4 = { 1790 .omap4 = {
1791 .clkctrl_offs = OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET, 1791 .clkctrl_offs = OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET,
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.c b/arch/arm/mach-omap2/omap_hwmod_common_data.c
index de832ebc93a9..51e5418899fb 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.c
@@ -49,3 +49,7 @@ struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2 = {
49 .srst_shift = SYSC_TYPE2_SOFTRESET_SHIFT, 49 .srst_shift = SYSC_TYPE2_SOFTRESET_SHIFT,
50}; 50};
51 51
52struct omap_dss_dispc_dev_attr omap2_3_dss_dispc_dev_attr = {
53 .manager_count = 2,
54 .has_framedonetv_irq = 0
55};
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h
index 39a7c37f4587..ad5d8f04c0b8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h
@@ -16,6 +16,8 @@
16 16
17#include <plat/omap_hwmod.h> 17#include <plat/omap_hwmod.h>
18 18
19#include "display.h"
20
19/* Common address space across OMAP2xxx */ 21/* Common address space across OMAP2xxx */
20extern struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[]; 22extern struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[];
21extern struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[]; 23extern struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[];
@@ -111,4 +113,6 @@ extern struct omap_hwmod_class omap2xxx_dma_hwmod_class;
111extern struct omap_hwmod_class omap2xxx_mailbox_hwmod_class; 113extern struct omap_hwmod_class omap2xxx_mailbox_hwmod_class;
112extern struct omap_hwmod_class omap2xxx_mcspi_class; 114extern struct omap_hwmod_class omap2xxx_mcspi_class;
113 115
116extern struct omap_dss_dispc_dev_attr omap2_3_dss_dispc_dev_attr;
117
114#endif 118#endif
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c
index 6a66aa5e2a5b..d15225ff5c49 100644
--- a/arch/arm/mach-omap2/omap_l3_noc.c
+++ b/arch/arm/mach-omap2/omap_l3_noc.c
@@ -237,7 +237,7 @@ static int __devexit omap4_l3_remove(struct platform_device *pdev)
237static const struct of_device_id l3_noc_match[] = { 237static const struct of_device_id l3_noc_match[] = {
238 {.compatible = "ti,omap4-l3-noc", }, 238 {.compatible = "ti,omap4-l3-noc", },
239 {}, 239 {},
240} 240};
241MODULE_DEVICE_TABLE(of, l3_noc_match); 241MODULE_DEVICE_TABLE(of, l3_noc_match);
242#else 242#else
243#define l3_noc_match NULL 243#define l3_noc_match NULL
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 1e79bdf313e3..1881fe915149 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -18,12 +18,13 @@
18 18
19#include <plat/omap-pm.h> 19#include <plat/omap-pm.h>
20#include <plat/omap_device.h> 20#include <plat/omap_device.h>
21#include <plat/common.h> 21#include "common.h"
22 22
23#include "voltage.h" 23#include "voltage.h"
24#include "powerdomain.h" 24#include "powerdomain.h"
25#include "clockdomain.h" 25#include "clockdomain.h"
26#include "pm.h" 26#include "pm.h"
27#include "twl-common.h"
27 28
28static struct omap_device_pm_latency *pm_lats; 29static struct omap_device_pm_latency *pm_lats;
29 30
@@ -226,11 +227,8 @@ postcore_initcall(omap2_common_pm_init);
226 227
227static int __init omap2_common_pm_late_init(void) 228static int __init omap2_common_pm_late_init(void)
228{ 229{
229 /* Init the OMAP TWL parameters */
230 omap3_twl_init();
231 omap4_twl_init();
232
233 /* Init the voltage layer */ 230 /* Init the voltage layer */
231 omap_pmic_late_init();
234 omap_voltage_late_init(); 232 omap_voltage_late_init();
235 233
236 /* Initialize the voltages */ 234 /* Initialize the voltages */
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index cf0c216132ab..ef8595c80296 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -42,6 +42,7 @@
42#include <plat/dma.h> 42#include <plat/dma.h>
43#include <plat/board.h> 43#include <plat/board.h>
44 44
45#include "common.h"
45#include "prm2xxx_3xxx.h" 46#include "prm2xxx_3xxx.h"
46#include "prm-regbits-24xx.h" 47#include "prm-regbits-24xx.h"
47#include "cm2xxx_3xxx.h" 48#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index efa66494c1e3..fa637dfdda53 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -42,6 +42,7 @@
42#include <plat/gpmc.h> 42#include <plat/gpmc.h>
43#include <plat/dma.h> 43#include <plat/dma.h>
44 44
45#include "common.h"
45#include "cm2xxx_3xxx.h" 46#include "cm2xxx_3xxx.h"
46#include "cm-regbits-34xx.h" 47#include "cm-regbits-34xx.h"
47#include "prm-regbits-34xx.h" 48#include "prm-regbits-34xx.h"
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 59a870be8390..8edb015f5618 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -16,8 +16,8 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18 18
19#include "common.h"
19#include "powerdomain.h" 20#include "powerdomain.h"
20#include <mach/omap4-common.h>
21 21
22struct power_state { 22struct power_state {
23 struct powerdomain *pwrdm; 23 struct powerdomain *pwrdm;
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 597e2da831b3..626acfad7190 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -25,8 +25,7 @@
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/export.h> 26#include <linux/export.h>
27 27
28#include <mach/system.h> 28#include "common.h"
29#include <plat/common.h>
30#include <plat/prcm.h> 29#include <plat/prcm.h>
31#include <plat/irqs.h> 30#include <plat/irqs.h>
32 31
@@ -59,7 +58,7 @@ u32 omap_prcm_get_reset_sources(void)
59EXPORT_SYMBOL(omap_prcm_get_reset_sources); 58EXPORT_SYMBOL(omap_prcm_get_reset_sources);
60 59
61/* Resets clock rates and reboots the system. Only called from system.h */ 60/* Resets clock rates and reboots the system. Only called from system.h */
62static void omap_prcm_arch_reset(char mode, const char *cmd) 61void omap_prcm_restart(char mode, const char *cmd)
63{ 62{
64 s16 prcm_offs = 0; 63 s16 prcm_offs = 0;
65 64
@@ -110,8 +109,6 @@ static void omap_prcm_arch_reset(char mode, const char *cmd)
110 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */ 109 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */
111} 110}
112 111
113void (*arch_reset)(char, const char *) = omap_prcm_arch_reset;
114
115/** 112/**
116 * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness 113 * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness
117 * @reg: physical address of module IDLEST register 114 * @reg: physical address of module IDLEST register
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.c b/arch/arm/mach-omap2/prcm_mpu44xx.c
index 171fe171a749..ca669b50f390 100644
--- a/arch/arm/mach-omap2/prcm_mpu44xx.c
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.c
@@ -15,7 +15,7 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <plat/common.h> 18#include "common.h"
19 19
20#include "prcm_mpu44xx.h" 20#include "prcm_mpu44xx.h"
21#include "cm-regbits-44xx.h" 21#include "cm-regbits-44xx.h"
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index f02d87f68e54..9a08ba397327 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -16,7 +16,7 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <plat/common.h> 19#include "common.h"
20#include <plat/cpu.h> 20#include <plat/cpu.h>
21#include <plat/prcm.h> 21#include <plat/prcm.h>
22 22
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 495a31a7e8a7..dd885eecf22a 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -17,7 +17,7 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <plat/common.h> 20#include "common.h"
21#include <plat/cpu.h> 21#include <plat/cpu.h>
22#include <plat/prcm.h> 22#include <plat/prcm.h>
23 23
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
index 3a7bab16edd5..f6de5bc6b12a 100644
--- a/arch/arm/mach-omap2/prminst44xx.c
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -16,7 +16,7 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <plat/common.h> 19#include "common.h"
20 20
21#include "prm44xx.h" 21#include "prm44xx.h"
22#include "prminst44xx.h" 22#include "prminst44xx.h"
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 14caa228bc0d..ee3a8ad304cb 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -18,7 +18,7 @@
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <plat/io.h> 20#include <plat/io.h>
21#include <plat/common.h> 21#include "common.h"
22#include <plat/clock.h> 22#include <plat/clock.h>
23#include <plat/sdrc.h> 23#include <plat/sdrc.h>
24 24
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 8f2782874771..e3d345f46409 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -23,7 +23,7 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <plat/common.h> 26#include "common.h"
27#include <plat/clock.h> 27#include <plat/clock.h>
28#include <plat/sram.h> 28#include <plat/sram.h>
29 29
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index ccdb010f169d..791a63cdceb2 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -24,7 +24,7 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <plat/common.h> 27#include "common.h"
28#include <plat/clock.h> 28#include <plat/clock.h>
29#include <plat/sram.h> 29#include <plat/sram.h>
30 30
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 9992dbfdfdb3..42c326732a29 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -33,7 +33,7 @@
33#include <plat/omap-serial.h> 33#include <plat/omap-serial.h>
34#endif 34#endif
35 35
36#include <plat/common.h> 36#include "common.h"
37#include <plat/board.h> 37#include <plat/board.h>
38#include <plat/clock.h> 38#include <plat/clock.h>
39#include <plat/dma.h> 39#include <plat/dma.h>
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 6a4f6839a7d9..9dd93453e563 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -26,7 +26,7 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/pm_runtime.h> 27#include <linux/pm_runtime.h>
28 28
29#include <plat/common.h> 29#include "common.h"
30 30
31#include "pm.h" 31#include "pm.h"
32#include "smartreflex.h" 32#include "smartreflex.h"
@@ -139,7 +139,7 @@ static irqreturn_t sr_interrupt(int irq, void *data)
139 sr_write_reg(sr_info, ERRCONFIG_V1, status); 139 sr_write_reg(sr_info, ERRCONFIG_V1, status);
140 } else if (sr_info->ip_type == SR_TYPE_V2) { 140 } else if (sr_info->ip_type == SR_TYPE_V2) {
141 /* Read the status bits */ 141 /* Read the status bits */
142 sr_read_reg(sr_info, IRQSTATUS); 142 status = sr_read_reg(sr_info, IRQSTATUS);
143 143
144 /* Clear them by writing back */ 144 /* Clear them by writing back */
145 sr_write_reg(sr_info, IRQSTATUS, status); 145 sr_write_reg(sr_info, IRQSTATUS, status);
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 037b0d7d4e05..6eeff0e0ae01 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -41,7 +41,7 @@
41#include <plat/dmtimer.h> 41#include <plat/dmtimer.h>
42#include <asm/localtimer.h> 42#include <asm/localtimer.h>
43#include <asm/sched_clock.h> 43#include <asm/sched_clock.h>
44#include <plat/common.h> 44#include "common.h"
45#include <plat/omap_hwmod.h> 45#include <plat/omap_hwmod.h>
46#include <plat/omap_device.h> 46#include <plat/omap_device.h>
47#include <plat/omap-pm.h> 47#include <plat/omap-pm.h>
@@ -254,7 +254,6 @@ static struct omap_dm_timer clksrc;
254/* 254/*
255 * clocksource 255 * clocksource
256 */ 256 */
257static DEFINE_CLOCK_DATA(cd);
258static cycle_t clocksource_read_cycles(struct clocksource *cs) 257static cycle_t clocksource_read_cycles(struct clocksource *cs)
259{ 258{
260 return (cycle_t)__omap_dm_timer_read_counter(&clksrc, 1); 259 return (cycle_t)__omap_dm_timer_read_counter(&clksrc, 1);
@@ -268,23 +267,12 @@ static struct clocksource clocksource_gpt = {
268 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 267 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
269}; 268};
270 269
271static void notrace dmtimer_update_sched_clock(void) 270static u32 notrace dmtimer_read_sched_clock(void)
272{ 271{
273 u32 cyc;
274
275 cyc = __omap_dm_timer_read_counter(&clksrc, 1);
276
277 update_sched_clock(&cd, cyc, (u32)~0);
278}
279
280unsigned long long notrace sched_clock(void)
281{
282 u32 cyc = 0;
283
284 if (clksrc.reserved) 272 if (clksrc.reserved)
285 cyc = __omap_dm_timer_read_counter(&clksrc, 1); 273 return __omap_dm_timer_read_counter(clksrc.io_base, 1);
286 274
287 return cyc_to_sched_clock(&cd, cyc, (u32)~0); 275 return 0;
288} 276}
289 277
290/* Setup free-running counter for clocksource */ 278/* Setup free-running counter for clocksource */
@@ -301,7 +289,7 @@ static void __init omap2_gp_clocksource_init(int gptimer_id,
301 289
302 __omap_dm_timer_load_start(&clksrc, 290 __omap_dm_timer_load_start(&clksrc,
303 OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1); 291 OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1);
304 init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate); 292 setup_sched_clock(dmtimer_read_sched_clock, 32, clksrc.rate);
305 293
306 if (clocksource_register_hz(&clocksource_gpt, clksrc.rate)) 294 if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
307 pr_err("Could not register clocksource %s\n", 295 pr_err("Could not register clocksource %s\n",
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 522435772168..10b20c652e5d 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -30,6 +30,7 @@
30#include <plat/usb.h> 30#include <plat/usb.h>
31 31
32#include "twl-common.h" 32#include "twl-common.h"
33#include "pm.h"
33 34
34static struct i2c_board_info __initdata pmic_i2c_board_info = { 35static struct i2c_board_info __initdata pmic_i2c_board_info = {
35 .addr = 0x48, 36 .addr = 0x48,
@@ -48,6 +49,16 @@ void __init omap_pmic_init(int bus, u32 clkrate,
48 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); 49 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
49} 50}
50 51
52void __init omap_pmic_late_init(void)
53{
54 /* Init the OMAP TWL parameters (if PMIC has been registerd) */
55 if (!pmic_i2c_board_info.irq)
56 return;
57
58 omap3_twl_init();
59 omap4_twl_init();
60}
61
51#if defined(CONFIG_ARCH_OMAP3) 62#if defined(CONFIG_ARCH_OMAP3)
52static struct twl4030_usb_data omap3_usb_pdata = { 63static struct twl4030_usb_data omap3_usb_pdata = {
53 .usb_mode = T2_USB_MODE_ULPI, 64 .usb_mode = T2_USB_MODE_ULPI,
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index 5e83a5bd37fb..275dde8cb27a 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -1,6 +1,8 @@
1#ifndef __OMAP_PMIC_COMMON__ 1#ifndef __OMAP_PMIC_COMMON__
2#define __OMAP_PMIC_COMMON__ 2#define __OMAP_PMIC_COMMON__
3 3
4#include <plat/irqs.h>
5
4#define TWL_COMMON_PDATA_USB (1 << 0) 6#define TWL_COMMON_PDATA_USB (1 << 0)
5#define TWL_COMMON_PDATA_BCI (1 << 1) 7#define TWL_COMMON_PDATA_BCI (1 << 1)
6#define TWL_COMMON_PDATA_MADC (1 << 2) 8#define TWL_COMMON_PDATA_MADC (1 << 2)
@@ -30,6 +32,7 @@ struct twl4030_platform_data;
30 32
31void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, 33void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
32 struct twl4030_platform_data *pmic_data); 34 struct twl4030_platform_data *pmic_data);
35void omap_pmic_late_init(void);
33 36
34static inline void omap2_pmic_init(const char *pmic_type, 37static inline void omap2_pmic_init(const char *pmic_type,
35 struct twl4030_platform_data *pmic_data) 38 struct twl4030_platform_data *pmic_data)
diff --git a/arch/arm/mach-omap2/vc3xxx_data.c b/arch/arm/mach-omap2/vc3xxx_data.c
index cfe348e1af0e..a5ec7f8f2ea8 100644
--- a/arch/arm/mach-omap2/vc3xxx_data.c
+++ b/arch/arm/mach-omap2/vc3xxx_data.c
@@ -18,7 +18,7 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/init.h> 19#include <linux/init.h>
20 20
21#include <plat/common.h> 21#include "common.h"
22 22
23#include "prm-regbits-34xx.h" 23#include "prm-regbits-34xx.h"
24#include "voltage.h" 24#include "voltage.h"
diff --git a/arch/arm/mach-omap2/vc44xx_data.c b/arch/arm/mach-omap2/vc44xx_data.c
index 2740a968145e..d70b930f2739 100644
--- a/arch/arm/mach-omap2/vc44xx_data.c
+++ b/arch/arm/mach-omap2/vc44xx_data.c
@@ -18,7 +18,7 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/init.h> 19#include <linux/init.h>
20 20
21#include <plat/common.h> 21#include "common.h"
22 22
23#include "prm44xx.h" 23#include "prm44xx.h"
24#include "prm-regbits-44xx.h" 24#include "prm-regbits-44xx.h"
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index 1f8fdf736e63..8a36342e60d2 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -27,7 +27,7 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/clk.h> 28#include <linux/clk.h>
29 29
30#include <plat/common.h> 30#include "common.h"
31 31
32#include "prm-regbits-34xx.h" 32#include "prm-regbits-34xx.h"
33#include "prm-regbits-44xx.h" 33#include "prm-regbits-44xx.h"
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index 071101debbbc..474559d5b072 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -18,7 +18,7 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/init.h> 19#include <linux/init.h>
20 20
21#include <plat/common.h> 21#include "common.h"
22#include <plat/cpu.h> 22#include <plat/cpu.h>
23 23
24#include "prm-regbits-34xx.h" 24#include "prm-regbits-34xx.h"
diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c
index c4584e9ac717..4e11d022595d 100644
--- a/arch/arm/mach-omap2/voltagedomains44xx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c
@@ -21,7 +21,7 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/init.h> 22#include <linux/init.h>
23 23
24#include <plat/common.h> 24#include "common.h"
25 25
26#include "prm-regbits-44xx.h" 26#include "prm-regbits-44xx.h"
27#include "prm44xx.h" 27#include "prm44xx.h"
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index 66bd700a2b98..807391d84a9d 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -1,7 +1,7 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <linux/init.h> 2#include <linux/init.h>
3 3
4#include <plat/common.h> 4#include "common.h"
5 5
6#include "voltage.h" 6#include "voltage.h"
7#include "vp.h" 7#include "vp.h"
diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c
index 260c554b1547..bd89f80089f5 100644
--- a/arch/arm/mach-omap2/vp3xxx_data.c
+++ b/arch/arm/mach-omap2/vp3xxx_data.c
@@ -19,7 +19,7 @@
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/init.h> 20#include <linux/init.h>
21 21
22#include <plat/common.h> 22#include "common.h"
23 23
24#include "prm-regbits-34xx.h" 24#include "prm-regbits-34xx.h"
25#include "voltage.h" 25#include "voltage.h"
diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c
index b4e77044891e..8c031d16879e 100644
--- a/arch/arm/mach-omap2/vp44xx_data.c
+++ b/arch/arm/mach-omap2/vp44xx_data.c
@@ -19,7 +19,7 @@
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/init.h> 20#include <linux/init.h>
21 21
22#include <plat/common.h> 22#include "common.h"
23 23
24#include "prm44xx.h" 24#include "prm44xx.h"
25#include "prm-regbits-44xx.h" 25#include "prm-regbits-44xx.h"
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 22ace0bf2f92..41127e80cc1e 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -18,6 +18,7 @@
18#include <linux/mbus.h> 18#include <linux/mbus.h>
19#include <linux/mv643xx_i2c.h> 19#include <linux/mv643xx_i2c.h>
20#include <linux/ata_platform.h> 20#include <linux/ata_platform.h>
21#include <linux/delay.h>
21#include <net/dsa.h> 22#include <net/dsa.h>
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/setup.h> 24#include <asm/setup.h>
@@ -304,6 +305,17 @@ void __init orion5x_init(void)
304 orion5x_wdt_init(); 305 orion5x_wdt_init();
305} 306}
306 307
308void orion5x_restart(char mode, const char *cmd)
309{
310 /*
311 * Enable and issue soft reset
312 */
313 orion5x_setbits(RSTOUTn_MASK, (1 << 2));
314 orion5x_setbits(CPU_SOFT_RESET, 1);
315 mdelay(200);
316 orion5x_clrbits(CPU_SOFT_RESET, 1);
317}
318
307/* 319/*
308 * Many orion-based systems have buggy bootloader implementations. 320 * Many orion-based systems have buggy bootloader implementations.
309 * This is a common fixup for bogus memory tags. 321 * This is a common fixup for bogus memory tags.
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 909489f4d23e..37ef18de61b7 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -39,6 +39,7 @@ void orion5x_spi_init(void);
39void orion5x_uart0_init(void); 39void orion5x_uart0_init(void);
40void orion5x_uart1_init(void); 40void orion5x_uart1_init(void);
41void orion5x_xor_init(void); 41void orion5x_xor_init(void);
42void orion5x_restart(char, const char *);
42 43
43/* 44/*
44 * PCIe/PCI functions. 45 * PCIe/PCI functions.
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index 8c8300951f46..d75dcfa0f01c 100644
--- a/arch/arm/mach-orion5x/d2net-setup.c
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -343,6 +343,7 @@ MACHINE_START(D2NET, "LaCie d2 Network")
343 .init_irq = orion5x_init_irq, 343 .init_irq = orion5x_init_irq,
344 .timer = &orion5x_timer, 344 .timer = &orion5x_timer,
345 .fixup = tag_fixup_mem32, 345 .fixup = tag_fixup_mem32,
346 .restart = orion5x_restart,
346MACHINE_END 347MACHINE_END
347#endif 348#endif
348 349
@@ -355,6 +356,7 @@ MACHINE_START(BIGDISK, "LaCie Big Disk Network")
355 .init_irq = orion5x_init_irq, 356 .init_irq = orion5x_init_irq,
356 .timer = &orion5x_timer, 357 .timer = &orion5x_timer,
357 .fixup = tag_fixup_mem32, 358 .fixup = tag_fixup_mem32,
359 .restart = orion5x_restart,
358MACHINE_END 360MACHINE_END
359#endif 361#endif
360 362
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index 4b79a80d5e1f..a104d5a80e11 100644
--- a/arch/arm/mach-orion5x/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -364,4 +364,5 @@ MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
364 .init_early = orion5x_init_early, 364 .init_early = orion5x_init_early,
365 .init_irq = orion5x_init_irq, 365 .init_irq = orion5x_init_irq,
366 .timer = &orion5x_timer, 366 .timer = &orion5x_timer,
367 .restart = orion5x_restart,
367MACHINE_END 368MACHINE_END
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 343f60e9639f..91b0f4788597 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -736,4 +736,5 @@ MACHINE_START(DNS323, "D-Link DNS-323")
736 .init_irq = orion5x_init_irq, 736 .init_irq = orion5x_init_irq,
737 .timer = &orion5x_timer, 737 .timer = &orion5x_timer,
738 .fixup = tag_fixup_mem32, 738 .fixup = tag_fixup_mem32,
739 .restart = orion5x_restart,
739MACHINE_END 740MACHINE_END
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c
index 70a4e9265f06..355e962137c7 100644
--- a/arch/arm/mach-orion5x/edmini_v2-setup.c
+++ b/arch/arm/mach-orion5x/edmini_v2-setup.c
@@ -258,4 +258,5 @@ MACHINE_START(EDMINI_V2, "LaCie Ethernet Disk mini V2")
258 .init_irq = orion5x_init_irq, 258 .init_irq = orion5x_init_irq,
259 .timer = &orion5x_timer, 259 .timer = &orion5x_timer,
260 .fixup = tag_fixup_mem32, 260 .fixup = tag_fixup_mem32,
261 .restart = orion5x_restart,
261MACHINE_END 262MACHINE_END
diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h
index c5196101a237..e9d9afdc2659 100644
--- a/arch/arm/mach-orion5x/include/mach/io.h
+++ b/arch/arm/mach-orion5x/include/mach/io.h
@@ -15,31 +15,6 @@
15 15
16#define IO_SPACE_LIMIT 0xffffffff 16#define IO_SPACE_LIMIT 0xffffffff
17 17
18static inline void __iomem *
19__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
20{
21 void __iomem *retval;
22 unsigned long offs = paddr - ORION5X_REGS_PHYS_BASE;
23 if (mtype == MT_DEVICE && size && offs < ORION5X_REGS_SIZE &&
24 size <= ORION5X_REGS_SIZE && offs + size <= ORION5X_REGS_SIZE) {
25 retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + offs;
26 } else {
27 retval = __arm_ioremap(paddr, size, mtype);
28 }
29
30 return retval;
31}
32
33static inline void
34__arch_iounmap(void __iomem *addr)
35{
36 if (addr < (void __iomem *)ORION5X_REGS_VIRT_BASE ||
37 addr >= (void __iomem *)(ORION5X_REGS_VIRT_BASE + ORION5X_REGS_SIZE))
38 __iounmap(addr);
39}
40
41#define __arch_ioremap __arch_ioremap
42#define __arch_iounmap __arch_iounmap
43#define __io(a) __typesafe_io(a) 18#define __io(a) __typesafe_io(a)
44#define __mem_pci(a) (a) 19#define __mem_pci(a) (a)
45 20
diff --git a/arch/arm/mach-orion5x/include/mach/system.h b/arch/arm/mach-orion5x/include/mach/system.h
index a1d6e46ab035..825a2650cefa 100644
--- a/arch/arm/mach-orion5x/include/mach/system.h
+++ b/arch/arm/mach-orion5x/include/mach/system.h
@@ -11,23 +11,9 @@
11#ifndef __ASM_ARCH_SYSTEM_H 11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H 12#define __ASM_ARCH_SYSTEM_H
13 13
14#include <mach/bridge-regs.h>
15
16static inline void arch_idle(void) 14static inline void arch_idle(void)
17{ 15{
18 cpu_do_idle(); 16 cpu_do_idle();
19} 17}
20 18
21static inline void arch_reset(char mode, const char *cmd)
22{
23 /*
24 * Enable and issue soft reset
25 */
26 orion5x_setbits(RSTOUTn_MASK, (1 << 2));
27 orion5x_setbits(CPU_SOFT_RESET, 1);
28 mdelay(200);
29 orion5x_clrbits(CPU_SOFT_RESET, 1);
30}
31
32
33#endif 19#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
index 06b50aeff7b9..000000000000
--- a/arch/arm/mach-orion5x/include/mach/vmalloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-orion5x/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfd800000UL
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index d3cd3f63258a..47587b832842 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -386,6 +386,7 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
386 .init_irq = orion5x_init_irq, 386 .init_irq = orion5x_init_irq,
387 .timer = &orion5x_timer, 387 .timer = &orion5x_timer,
388 .fixup = tag_fixup_mem32, 388 .fixup = tag_fixup_mem32,
389 .restart = orion5x_restart,
389MACHINE_END 390MACHINE_END
390#endif 391#endif
391 392
@@ -399,5 +400,6 @@ MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
399 .init_irq = orion5x_init_irq, 400 .init_irq = orion5x_init_irq,
400 .timer = &orion5x_timer, 401 .timer = &orion5x_timer,
401 .fixup = tag_fixup_mem32, 402 .fixup = tag_fixup_mem32,
403 .restart = orion5x_restart,
402MACHINE_END 404MACHINE_END
403#endif 405#endif
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
index 9503fff404e3..527213169db0 100644
--- a/arch/arm/mach-orion5x/ls-chl-setup.c
+++ b/arch/arm/mach-orion5x/ls-chl-setup.c
@@ -140,7 +140,7 @@ static struct mv_sata_platform_data lschl_sata_data = {
140 140
141static void lschl_power_off(void) 141static void lschl_power_off(void)
142{ 142{
143 arm_machine_restart('h', NULL); 143 orion5x_restart('h', NULL);
144} 144}
145 145
146/***************************************************************************** 146/*****************************************************************************
@@ -325,4 +325,5 @@ MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
325 .init_irq = orion5x_init_irq, 325 .init_irq = orion5x_init_irq,
326 .timer = &orion5x_timer, 326 .timer = &orion5x_timer,
327 .fixup = tag_fixup_mem32, 327 .fixup = tag_fixup_mem32,
328 .restart = orion5x_restart,
328MACHINE_END 329MACHINE_END
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
index ed6d772f4a24..9a8697b97dd7 100644
--- a/arch/arm/mach-orion5x/ls_hgl-setup.c
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data ls_hgl_sata_data = {
186 186
187static void ls_hgl_power_off(void) 187static void ls_hgl_power_off(void)
188{ 188{
189 arm_machine_restart('h', NULL); 189 orion5x_restart('h', NULL);
190} 190}
191 191
192 192
@@ -272,4 +272,5 @@ MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL")
272 .init_irq = orion5x_init_irq, 272 .init_irq = orion5x_init_irq,
273 .timer = &orion5x_timer, 273 .timer = &orion5x_timer,
274 .fixup = tag_fixup_mem32, 274 .fixup = tag_fixup_mem32,
275 .restart = orion5x_restart,
275MACHINE_END 276MACHINE_END
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index 743f7f1db181..09c73659f467 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data lsmini_sata_data = {
186 186
187static void lsmini_power_off(void) 187static void lsmini_power_off(void)
188{ 188{
189 arm_machine_restart('h', NULL); 189 orion5x_restart('h', NULL);
190} 190}
191 191
192 192
@@ -274,5 +274,6 @@ MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini")
274 .init_irq = orion5x_init_irq, 274 .init_irq = orion5x_init_irq,
275 .timer = &orion5x_timer, 275 .timer = &orion5x_timer,
276 .fixup = tag_fixup_mem32, 276 .fixup = tag_fixup_mem32,
277 .restart = orion5x_restart,
277MACHINE_END 278MACHINE_END
278#endif 279#endif
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
index 6020e26b1c71..65faaa34de61 100644
--- a/arch/arm/mach-orion5x/mss2-setup.c
+++ b/arch/arm/mach-orion5x/mss2-setup.c
@@ -267,5 +267,6 @@ MACHINE_START(MSS2, "Maxtor Shared Storage II")
267 .init_early = orion5x_init_early, 267 .init_early = orion5x_init_early,
268 .init_irq = orion5x_init_irq, 268 .init_irq = orion5x_init_irq,
269 .timer = &orion5x_timer, 269 .timer = &orion5x_timer,
270 .fixup = tag_fixup_mem32 270 .fixup = tag_fixup_mem32,
271 .restart = orion5x_restart,
271MACHINE_END 272MACHINE_END
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
index 201ae3676289..c87fde4deeca 100644
--- a/arch/arm/mach-orion5x/mv2120-setup.c
+++ b/arch/arm/mach-orion5x/mv2120-setup.c
@@ -234,5 +234,6 @@ MACHINE_START(MV2120, "HP Media Vault mv2120")
234 .init_early = orion5x_init_early, 234 .init_early = orion5x_init_early,
235 .init_irq = orion5x_init_irq, 235 .init_irq = orion5x_init_irq,
236 .timer = &orion5x_timer, 236 .timer = &orion5x_timer,
237 .fixup = tag_fixup_mem32 237 .fixup = tag_fixup_mem32,
238 .restart = orion5x_restart,
238MACHINE_END 239MACHINE_END
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index 6197c79a2ecb..0180c393c711 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -426,5 +426,6 @@ MACHINE_START(NET2BIG, "LaCie 2Big Network")
426 .init_irq = orion5x_init_irq, 426 .init_irq = orion5x_init_irq,
427 .timer = &orion5x_timer, 427 .timer = &orion5x_timer,
428 .fixup = tag_fixup_mem32, 428 .fixup = tag_fixup_mem32,
429 .restart = orion5x_restart,
429MACHINE_END 430MACHINE_END
430 431
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index ebd6767d8e88..292038fc59fd 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -175,4 +175,5 @@ MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design")
175 .init_irq = orion5x_init_irq, 175 .init_irq = orion5x_init_irq,
176 .timer = &orion5x_timer, 176 .timer = &orion5x_timer,
177 .fixup = tag_fixup_mem32, 177 .fixup = tag_fixup_mem32,
178 .restart = orion5x_restart,
178MACHINE_END 179MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index 05db2d336b08..c44eabaabc16 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -187,4 +187,5 @@ MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design")
187 .init_irq = orion5x_init_irq, 187 .init_irq = orion5x_init_irq,
188 .timer = &orion5x_timer, 188 .timer = &orion5x_timer,
189 .fixup = tag_fixup_mem32, 189 .fixup = tag_fixup_mem32,
190 .restart = orion5x_restart,
190MACHINE_END 191MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index e47fa0578ae3..96438b6b2022 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -311,4 +311,5 @@ MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
311 .init_early = orion5x_init_early, 311 .init_early = orion5x_init_early,
312 .init_irq = orion5x_init_irq, 312 .init_irq = orion5x_init_irq,
313 .timer = &orion5x_timer, 313 .timer = &orion5x_timer,
314 .restart = orion5x_restart,
314MACHINE_END 315MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 64317251ec00..2c5fab00d205 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -128,4 +128,5 @@ MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
128 .init_irq = orion5x_init_irq, 128 .init_irq = orion5x_init_irq,
129 .timer = &orion5x_timer, 129 .timer = &orion5x_timer,
130 .fixup = tag_fixup_mem32, 130 .fixup = tag_fixup_mem32,
131 .restart = orion5x_restart,
131MACHINE_END 132MACHINE_END
diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c
index 29f1526f7b70..632a861ef82b 100644
--- a/arch/arm/mach-orion5x/terastation_pro2-setup.c
+++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c
@@ -364,4 +364,5 @@ MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
364 .init_irq = orion5x_init_irq, 364 .init_irq = orion5x_init_irq,
365 .timer = &orion5x_timer, 365 .timer = &orion5x_timer,
366 .fixup = tag_fixup_mem32, 366 .fixup = tag_fixup_mem32,
367 .restart = orion5x_restart,
367MACHINE_END 368MACHINE_END
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index 31e51f9b4b64..5d6408745582 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -178,7 +178,7 @@ static struct hw_pci qnap_ts209_pci __initdata = {
178 178
179static int __init qnap_ts209_pci_init(void) 179static int __init qnap_ts209_pci_init(void)
180{ 180{
181 if (machine_is_ts_x09()) 181 if (machine_is_ts209())
182 pci_common_init(&qnap_ts209_pci); 182 pci_common_init(&qnap_ts209_pci);
183 183
184 return 0; 184 return 0;
@@ -329,4 +329,5 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209")
329 .init_irq = orion5x_init_irq, 329 .init_irq = orion5x_init_irq,
330 .timer = &orion5x_timer, 330 .timer = &orion5x_timer,
331 .fixup = tag_fixup_mem32, 331 .fixup = tag_fixup_mem32,
332 .restart = orion5x_restart,
332MACHINE_END 333MACHINE_END
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
index 0fbcc14e09d7..4e6ff759cd32 100644
--- a/arch/arm/mach-orion5x/ts409-setup.c
+++ b/arch/arm/mach-orion5x/ts409-setup.c
@@ -318,4 +318,5 @@ MACHINE_START(TS409, "QNAP TS-409")
318 .init_irq = orion5x_init_irq, 318 .init_irq = orion5x_init_irq,
319 .timer = &orion5x_timer, 319 .timer = &orion5x_timer,
320 .fixup = tag_fixup_mem32, 320 .fixup = tag_fixup_mem32,
321 .restart = orion5x_restart,
321MACHINE_END 322MACHINE_END
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index b35e2005a348..c96f37472eda 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -627,4 +627,5 @@ MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
627 .init_early = orion5x_init_early, 627 .init_early = orion5x_init_early,
628 .init_irq = orion5x_init_irq, 628 .init_irq = orion5x_init_irq,
629 .timer = &orion5x_timer, 629 .timer = &orion5x_timer,
630 .restart = orion5x_restart,
630MACHINE_END 631MACHINE_END
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index b8be7d8d0cf4..078c03f7cd52 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -179,4 +179,5 @@ MACHINE_START(WNR854T, "Netgear WNR854T")
179 .init_irq = orion5x_init_irq, 179 .init_irq = orion5x_init_irq,
180 .timer = &orion5x_timer, 180 .timer = &orion5x_timer,
181 .fixup = tag_fixup_mem32, 181 .fixup = tag_fixup_mem32,
182 .restart = orion5x_restart,
182MACHINE_END 183MACHINE_END
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index faf81a039360..46a9778171ce 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -267,4 +267,5 @@ MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
267 .init_irq = orion5x_init_irq, 267 .init_irq = orion5x_init_irq,
268 .timer = &orion5x_timer, 268 .timer = &orion5x_timer,
269 .fixup = tag_fixup_mem32, 269 .fixup = tag_fixup_mem32,
270 .restart = orion5x_restart,
270MACHINE_END 271MACHINE_END
diff --git a/arch/arm/mach-picoxcell/common.c b/arch/arm/mach-picoxcell/common.c
index 34d08347be5f..ad871bd7b1ab 100644
--- a/arch/arm/mach-picoxcell/common.c
+++ b/arch/arm/mach-picoxcell/common.c
@@ -11,6 +11,7 @@
11#include <linux/irqdomain.h> 11#include <linux/irqdomain.h>
12#include <linux/of.h> 12#include <linux/of.h>
13#include <linux/of_address.h> 13#include <linux/of_address.h>
14#include <linux/of_irq.h>
14#include <linux/of_platform.h> 15#include <linux/of_platform.h>
15 16
16#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
@@ -33,22 +34,20 @@ static const char *picoxcell_dt_match[] = {
33}; 34};
34 35
35static const struct of_device_id vic_of_match[] __initconst = { 36static const struct of_device_id vic_of_match[] __initconst = {
36 { .compatible = "arm,pl192-vic" }, 37 { .compatible = "arm,pl192-vic", .data = vic_of_init, },
37 { /* Sentinel */ } 38 { /* Sentinel */ }
38}; 39};
39 40
40static void __init picoxcell_init_irq(void) 41static void __init picoxcell_init_irq(void)
41{ 42{
42 vic_init(IO_ADDRESS(PICOXCELL_VIC0_BASE), 0, ~0, 0); 43 of_irq_init(vic_of_match);
43 vic_init(IO_ADDRESS(PICOXCELL_VIC1_BASE), 32, ~0, 0);
44 irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC0_BASE, 0);
45 irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC1_BASE, 32);
46} 44}
47 45
48DT_MACHINE_START(PICOXCELL, "Picochip picoXcell") 46DT_MACHINE_START(PICOXCELL, "Picochip picoXcell")
49 .map_io = picoxcell_map_io, 47 .map_io = picoxcell_map_io,
50 .nr_irqs = ARCH_NR_IRQS, 48 .nr_irqs = ARCH_NR_IRQS,
51 .init_irq = picoxcell_init_irq, 49 .init_irq = picoxcell_init_irq,
50 .handle_irq = vic_handle_irq,
52 .timer = &picoxcell_timer, 51 .timer = &picoxcell_timer,
53 .init_machine = picoxcell_init_machine, 52 .init_machine = picoxcell_init_machine,
54 .dt_compat = picoxcell_dt_match, 53 .dt_compat = picoxcell_dt_match,
diff --git a/arch/arm/mach-picoxcell/include/mach/entry-macro.S b/arch/arm/mach-picoxcell/include/mach/entry-macro.S
index a6b09f75d9df..9b505ac00be9 100644
--- a/arch/arm/mach-picoxcell/include/mach/entry-macro.S
+++ b/arch/arm/mach-picoxcell/include/mach/entry-macro.S
@@ -9,11 +9,8 @@
9 * License version 2. This program is licensed "as is" without any 9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12#include <mach/hardware.h> 12 .macro disable_fiq
13#include <mach/irqs.h> 13 .endm
14#include <mach/map.h>
15 14
16#define VA_VIC0 IO_ADDRESS(PICOXCELL_VIC0_BASE) 15 .macro arch_ret_to_user, tmp1, tmp2
17#define VA_VIC1 IO_ADDRESS(PICOXCELL_VIC1_BASE) 16 .endm
18
19#include <asm/entry-macro-vic2.S>
diff --git a/arch/arm/mach-picoxcell/include/mach/system.h b/arch/arm/mach-picoxcell/include/mach/system.h
index 67c589b0c1bc..1a5d8cb57df4 100644
--- a/arch/arm/mach-picoxcell/include/mach/system.h
+++ b/arch/arm/mach-picoxcell/include/mach/system.h
@@ -23,9 +23,4 @@ static inline void arch_idle(void)
23 cpu_do_idle(); 23 cpu_do_idle();
24} 24}
25 25
26static inline void arch_reset(int mode, const char *cmd)
27{
28 /* Watchdog reset to go here. */
29}
30
31#endif /* __ASM_ARCH_SYSTEM_H */ 26#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
index 0216cc4b1f0b..000000000000
--- a/arch/arm/mach-picoxcell/include/mach/vmalloc.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#define VMALLOC_END 0xfe000000UL
diff --git a/arch/arm/mach-picoxcell/time.c b/arch/arm/mach-picoxcell/time.c
index 90a554ff4499..6c89cf8ab22e 100644
--- a/arch/arm/mach-picoxcell/time.c
+++ b/arch/arm/mach-picoxcell/time.c
@@ -11,7 +11,6 @@
11#include <linux/of.h> 11#include <linux/of.h>
12#include <linux/of_address.h> 12#include <linux/of_address.h>
13#include <linux/of_irq.h> 13#include <linux/of_irq.h>
14#include <linux/sched.h>
15 14
16#include <asm/mach/time.h> 15#include <asm/mach/time.h>
17#include <asm/sched_clock.h> 16#include <asm/sched_clock.h>
@@ -66,21 +65,11 @@ static void picoxcell_add_clocksource(struct device_node *source_timer)
66 dw_apb_clocksource_register(cs); 65 dw_apb_clocksource_register(cs);
67} 66}
68 67
69static DEFINE_CLOCK_DATA(cd);
70static void __iomem *sched_io_base; 68static void __iomem *sched_io_base;
71 69
72unsigned long long notrace sched_clock(void) 70unsigned u32 notrace picoxcell_read_sched_clock(void)
73{ 71{
74 cycle_t cyc = sched_io_base ? __raw_readl(sched_io_base) : 0; 72 return __raw_readl(sched_io_base);
75
76 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
77}
78
79static void notrace picoxcell_update_sched_clock(void)
80{
81 cycle_t cyc = sched_io_base ? __raw_readl(sched_io_base) : 0;
82
83 update_sched_clock(&cd, cyc, (u32)~0);
84} 73}
85 74
86static const struct of_device_id picoxcell_rtc_ids[] __initconst = { 75static const struct of_device_id picoxcell_rtc_ids[] __initconst = {
@@ -100,7 +89,7 @@ static void picoxcell_init_sched_clock(void)
100 timer_get_base_and_rate(sched_timer, &sched_io_base, &rate); 89 timer_get_base_and_rate(sched_timer, &sched_io_base, &rate);
101 of_node_put(sched_timer); 90 of_node_put(sched_timer);
102 91
103 init_sched_clock(&cd, picoxcell_update_sched_clock, 32, rate); 92 setup_sched_clock(picoxcell_read_sched_clock, 32, rate);
104} 93}
105 94
106static const struct of_device_id picoxcell_timer_ids[] __initconst = { 95static const struct of_device_id picoxcell_timer_ids[] __initconst = {
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c
index cdb95e726f5c..4cfb40b2ec19 100644
--- a/arch/arm/mach-pnx4008/core.c
+++ b/arch/arm/mach-pnx4008/core.c
@@ -260,6 +260,11 @@ void __init pnx4008_map_io(void)
260 iotable_init(pnx4008_io_desc, ARRAY_SIZE(pnx4008_io_desc)); 260 iotable_init(pnx4008_io_desc, ARRAY_SIZE(pnx4008_io_desc));
261} 261}
262 262
263static void pnx4008_restart(char mode, const char *cmd)
264{
265 soft_restart(0);
266}
267
263extern struct sys_timer pnx4008_timer; 268extern struct sys_timer pnx4008_timer;
264 269
265MACHINE_START(PNX4008, "Philips PNX4008") 270MACHINE_START(PNX4008, "Philips PNX4008")
@@ -269,4 +274,5 @@ MACHINE_START(PNX4008, "Philips PNX4008")
269 .init_irq = pnx4008_init_irq, 274 .init_irq = pnx4008_init_irq,
270 .init_machine = pnx4008_init, 275 .init_machine = pnx4008_init,
271 .timer = &pnx4008_timer, 276 .timer = &pnx4008_timer,
277 .restart = pnx4008_restart,
272MACHINE_END 278MACHINE_END
diff --git a/arch/arm/mach-pnx4008/include/mach/system.h b/arch/arm/mach-pnx4008/include/mach/system.h
index 5dda2bb55f8d..60cfe7188091 100644
--- a/arch/arm/mach-pnx4008/include/mach/system.h
+++ b/arch/arm/mach-pnx4008/include/mach/system.h
@@ -21,18 +21,9 @@
21#ifndef __ASM_ARCH_SYSTEM_H 21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H 22#define __ASM_ARCH_SYSTEM_H
23 23
24#include <linux/io.h>
25#include <mach/hardware.h>
26#include <mach/platform.h>
27
28static void arch_idle(void) 24static void arch_idle(void)
29{ 25{
30 cpu_do_idle(); 26 cpu_do_idle();
31} 27}
32 28
33static inline void arch_reset(char mode, const char *cmd)
34{
35 cpu_reset(0);
36}
37
38#endif 29#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
index 184913c71141..000000000000
--- a/arch/arm/mach-pnx4008/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/vmalloc.h
3 *
4 * Author: Vitaly Wool <source@mvista.com>
5 *
6 * 2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12/*
13 * Just any arbitrary offset to the start of the vmalloc VM area: the
14 * current 8MB value just means that there will be a 8MB "hole" after the
15 * physical memory until the kernel virtual memory starts. That means that
16 * any out-of-bounds memory accesses will hopefully be caught.
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;)
19 */
20#define VMALLOC_END 0xd0000000UL
diff --git a/arch/arm/mach-prima2/common.h b/arch/arm/mach-prima2/common.h
index 83e5d2128118..b28a930d4f8a 100644
--- a/arch/arm/mach-prima2/common.h
+++ b/arch/arm/mach-prima2/common.h
@@ -16,6 +16,7 @@ extern struct sys_timer sirfsoc_timer;
16 16
17extern void __init sirfsoc_of_irq_init(void); 17extern void __init sirfsoc_of_irq_init(void);
18extern void __init sirfsoc_of_clk_init(void); 18extern void __init sirfsoc_of_clk_init(void);
19extern void sirfsoc_restart(char, const char *);
19 20
20#ifndef CONFIG_DEBUG_LL 21#ifndef CONFIG_DEBUG_LL
21static inline void sirfsoc_map_lluart(void) {} 22static inline void sirfsoc_map_lluart(void) {}
diff --git a/arch/arm/mach-prima2/include/mach/map.h b/arch/arm/mach-prima2/include/mach/map.h
index 66b1ae2e553f..6f243532570c 100644
--- a/arch/arm/mach-prima2/include/mach/map.h
+++ b/arch/arm/mach-prima2/include/mach/map.h
@@ -9,8 +9,10 @@
9#ifndef __MACH_PRIMA2_MAP_H__ 9#ifndef __MACH_PRIMA2_MAP_H__
10#define __MACH_PRIMA2_MAP_H__ 10#define __MACH_PRIMA2_MAP_H__
11 11
12#include <mach/vmalloc.h> 12#include <linux/const.h>
13 13
14#define SIRFSOC_VA(x) (VMALLOC_END + ((x) & 0x00FFF000)) 14#define SIRFSOC_VA_BASE _AC(0xFEC00000, UL)
15
16#define SIRFSOC_VA(x) (SIRFSOC_VA_BASE + ((x) & 0x00FFF000))
15 17
16#endif 18#endif
diff --git a/arch/arm/mach-prima2/include/mach/system.h b/arch/arm/mach-prima2/include/mach/system.h
index 0dbd257ad16d..2c7d2a9d0c92 100644
--- a/arch/arm/mach-prima2/include/mach/system.h
+++ b/arch/arm/mach-prima2/include/mach/system.h
@@ -9,21 +9,9 @@
9#ifndef __MACH_SYSTEM_H__ 9#ifndef __MACH_SYSTEM_H__
10#define __MACH_SYSTEM_H__ 10#define __MACH_SYSTEM_H__
11 11
12#include <linux/bitops.h>
13#include <mach/hardware.h>
14
15#define SIRFSOC_SYS_RST_BIT BIT(31)
16
17extern void __iomem *sirfsoc_rstc_base;
18
19static inline void arch_idle(void) 12static inline void arch_idle(void)
20{ 13{
21 cpu_do_idle(); 14 cpu_do_idle();
22} 15}
23 16
24static inline void arch_reset(char mode, const char *cmd)
25{
26 writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base);
27}
28
29#endif 17#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
index c9f90fec78e3..000000000000
--- a/arch/arm/mach-prima2/include/mach/vmalloc.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * arch/arm/ach-prima2/include/mach/vmalloc.h
3 *
4 * Copyright (c) 2010 – 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#ifndef __MACH_VMALLOC_H
10#define __MACH_VMALLOC_H
11
12#include <linux/const.h>
13
14#define VMALLOC_END _AC(0xFEC00000, UL)
15
16#endif
diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c
index cb53160f6c5d..26ebb57719df 100644
--- a/arch/arm/mach-prima2/pm.c
+++ b/arch/arm/mach-prima2/pm.c
@@ -9,6 +9,7 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/suspend.h> 10#include <linux/suspend.h>
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/module.h>
12#include <linux/of.h> 13#include <linux/of.h>
13#include <linux/of_address.h> 14#include <linux/of_address.h>
14#include <linux/of_device.h> 15#include <linux/of_device.h>
diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/prima2.c
index ef555c041962..02b9c05ff990 100644
--- a/arch/arm/mach-prima2/prima2.c
+++ b/arch/arm/mach-prima2/prima2.c
@@ -8,6 +8,7 @@
8 8
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <asm/sizes.h>
11#include <asm/mach-types.h> 12#include <asm/mach-types.h>
12#include <asm/mach/arch.h> 13#include <asm/mach/arch.h>
13#include <linux/of.h> 14#include <linux/of.h>
@@ -39,4 +40,5 @@ MACHINE_START(PRIMA2_EVB, "prima2cb")
39 .dma_zone_size = SZ_256M, 40 .dma_zone_size = SZ_256M,
40 .init_machine = sirfsoc_mach_init, 41 .init_machine = sirfsoc_mach_init,
41 .dt_compat = prima2cb_dt_match, 42 .dt_compat = prima2cb_dt_match,
43 .restart = sirfsoc_restart,
42MACHINE_END 44MACHINE_END
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index 492cfa8d2610..762adb73ab7c 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -68,3 +68,10 @@ int sirfsoc_reset_device(struct device *dev)
68 68
69 return 0; 69 return 0;
70} 70}
71
72#define SIRFSOC_SYS_RST_BIT BIT(31)
73
74void sirfsoc_restart(char mode, const char *cmd)
75{
76 writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base);
77}
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index fc0b8544e174..82514f5c38f1 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -307,7 +307,7 @@ static inline void balloon3_mmc_init(void) {}
307/****************************************************************************** 307/******************************************************************************
308 * USB Gadget 308 * USB Gadget
309 ******************************************************************************/ 309 ******************************************************************************/
310#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) 310#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
311static void balloon3_udc_command(int cmd) 311static void balloon3_udc_command(int cmd)
312{ 312{
313 if (cmd == PXA2XX_UDC_CMD_CONNECT) 313 if (cmd == PXA2XX_UDC_CMD_CONNECT)
@@ -829,4 +829,5 @@ MACHINE_START(BALLOON3, "Balloon3")
829 .timer = &pxa_timer, 829 .timer = &pxa_timer,
830 .init_machine = balloon3_init, 830 .init_machine = balloon3_init,
831 .atag_offset = 0x100, 831 .atag_offset = 0x100,
832 .restart = pxa_restart,
832MACHINE_END 833MACHINE_END
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c
index 4efc16d39c79..c2f0be040d27 100644
--- a/arch/arm/mach-pxa/capc7117.c
+++ b/arch/arm/mach-pxa/capc7117.c
@@ -153,5 +153,6 @@ MACHINE_START(CAPC7117,
153 .init_irq = pxa3xx_init_irq, 153 .init_irq = pxa3xx_init_irq,
154 .handle_irq = pxa3xx_handle_irq, 154 .handle_irq = pxa3xx_handle_irq,
155 .timer = &pxa_timer, 155 .timer = &pxa_timer,
156 .init_machine = capc7117_init 156 .init_machine = capc7117_init,
157 .restart = pxa_restart,
157MACHINE_END 158MACHINE_END
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index f2e4190080cb..ec170a552c23 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -524,4 +524,5 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX")
524#ifdef CONFIG_PCI 524#ifdef CONFIG_PCI
525 .dma_zone_size = SZ_64M, 525 .dma_zone_size = SZ_64M,
526#endif 526#endif
527 .restart = pxa_restart,
527MACHINE_END 528MACHINE_END
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index e096bba8fd57..7236974da0b7 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -858,4 +858,5 @@ MACHINE_START(CM_X300, "CM-X300 module")
858 .timer = &pxa_timer, 858 .timer = &pxa_timer,
859 .init_machine = cm_x300_init, 859 .init_machine = cm_x300_init,
860 .fixup = cm_x300_fixup, 860 .fixup = cm_x300_fixup,
861 .restart = pxa_restart,
861MACHINE_END 862MACHINE_END
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 80538b8806ed..248804bb2c9d 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -183,7 +183,7 @@ static inline void income_lcd_init(void) {}
183/****************************************************************************** 183/******************************************************************************
184 * Backlight 184 * Backlight
185 ******************************************************************************/ 185 ******************************************************************************/
186#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM__MODULE) 186#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
187static struct platform_pwm_backlight_data income_backlight_data = { 187static struct platform_pwm_backlight_data income_backlight_data = {
188 .pwm_id = 0, 188 .pwm_id = 0,
189 .max_brightness = 0x3ff, 189 .max_brightness = 0x3ff,
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 05bfa1b1c001..6a685165c9f2 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -313,6 +313,7 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
313 .init_irq = pxa27x_init_irq, 313 .init_irq = pxa27x_init_irq,
314 .handle_irq = pxa27x_handle_irq, 314 .handle_irq = pxa27x_handle_irq,
315 .timer = &pxa_timer, 315 .timer = &pxa_timer,
316 .restart = pxa_restart,
316MACHINE_END 317MACHINE_END
317 318
318MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") 319MACHINE_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")
322 .init_irq = pxa27x_init_irq, 323 .init_irq = pxa27x_init_irq,
323 .handle_irq = pxa27x_handle_irq, 324 .handle_irq = pxa27x_handle_irq,
324 .timer = &pxa_timer, 325 .timer = &pxa_timer,
326 .restart = pxa_restart,
325MACHINE_END 327MACHINE_END
326 328
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index c825e8bf2db1..c01059a61f33 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -189,5 +189,6 @@ MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
189 .init_irq = pxa3xx_init_irq, 189 .init_irq = pxa3xx_init_irq,
190 .handle_irq = pxa3xx_handle_irq, 190 .handle_irq = pxa3xx_handle_irq,
191 .timer = &pxa_timer, 191 .timer = &pxa_timer,
192 .restart = pxa_restart,
192MACHINE_END 193MACHINE_END
193 194
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 692e1ffc5586..5028f2300d50 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -146,7 +146,7 @@ static void __init colibri_pxa320_init_eth(void)
146static inline void __init colibri_pxa320_init_eth(void) {} 146static inline void __init colibri_pxa320_init_eth(void) {}
147#endif /* CONFIG_AX88796 */ 147#endif /* CONFIG_AX88796 */
148 148
149#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) 149#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
150static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { 150static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
151 .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), 151 .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96),
152 .gpio_pullup = -1, 152 .gpio_pullup = -1,
@@ -259,5 +259,6 @@ MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
259 .init_irq = pxa3xx_init_irq, 259 .init_irq = pxa3xx_init_irq,
260 .handle_irq = pxa3xx_handle_irq, 260 .handle_irq = pxa3xx_handle_irq,
261 .timer = &pxa_timer, 261 .timer = &pxa_timer,
262 .restart = pxa_restart,
262MACHINE_END 263MACHINE_END
263 264
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 549468d088b9..9d4dc5970b9c 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -655,7 +655,7 @@ static void corgi_poweroff(void)
655 /* Green LED off tells the bootloader to halt */ 655 /* Green LED off tells the bootloader to halt */
656 gpio_set_value(CORGI_GPIO_LED_GREEN, 0); 656 gpio_set_value(CORGI_GPIO_LED_GREEN, 0);
657 657
658 arm_machine_restart('h', NULL); 658 pxa_restart('h', NULL);
659} 659}
660 660
661static void corgi_restart(char mode, const char *cmd) 661static void corgi_restart(char mode, const char *cmd)
@@ -664,13 +664,12 @@ static void corgi_restart(char mode, const char *cmd)
664 /* Green LED on tells the bootloader to reboot */ 664 /* Green LED on tells the bootloader to reboot */
665 gpio_set_value(CORGI_GPIO_LED_GREEN, 1); 665 gpio_set_value(CORGI_GPIO_LED_GREEN, 1);
666 666
667 arm_machine_restart('h', cmd); 667 pxa_restart('h', cmd);
668} 668}
669 669
670static void __init corgi_init(void) 670static void __init corgi_init(void)
671{ 671{
672 pm_power_off = corgi_poweroff; 672 pm_power_off = corgi_poweroff;
673 arm_pm_restart = corgi_restart;
674 673
675 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ 674 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
676 PCFR |= PCFR_OPDE; 675 PCFR |= PCFR_OPDE;
@@ -726,6 +725,7 @@ MACHINE_START(CORGI, "SHARP Corgi")
726 .handle_irq = pxa25x_handle_irq, 725 .handle_irq = pxa25x_handle_irq,
727 .init_machine = corgi_init, 726 .init_machine = corgi_init,
728 .timer = &pxa_timer, 727 .timer = &pxa_timer,
728 .restart = corgi_restart,
729MACHINE_END 729MACHINE_END
730#endif 730#endif
731 731
@@ -737,6 +737,7 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd")
737 .handle_irq = pxa25x_handle_irq, 737 .handle_irq = pxa25x_handle_irq,
738 .init_machine = corgi_init, 738 .init_machine = corgi_init,
739 .timer = &pxa_timer, 739 .timer = &pxa_timer,
740 .restart = corgi_restart,
740MACHINE_END 741MACHINE_END
741#endif 742#endif
742 743
@@ -748,6 +749,7 @@ MACHINE_START(HUSKY, "SHARP Husky")
748 .handle_irq = pxa25x_handle_irq, 749 .handle_irq = pxa25x_handle_irq,
749 .init_machine = corgi_init, 750 .init_machine = corgi_init,
750 .timer = &pxa_timer, 751 .timer = &pxa_timer,
752 .restart = corgi_restart,
751MACHINE_END 753MACHINE_END
752#endif 754#endif
753 755
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 5e2cf39e9e4c..fb5a51d834e5 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -278,4 +278,5 @@ MACHINE_START(CSB726, "Cogent CSB726")
278 .handle_irq = pxa27x_handle_irq, 278 .handle_irq = pxa27x_handle_irq,
279 .init_machine = csb726_init, 279 .init_machine = csb726_init,
280 .timer = &pxa_timer, 280 .timer = &pxa_timer,
281 .restart = pxa_restart,
281MACHINE_END 282MACHINE_END
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 94acc0b01dd6..bd396ba67af7 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -1305,6 +1305,7 @@ MACHINE_START(EM_X270, "Compulab EM-X270")
1305 .handle_irq = pxa27x_handle_irq, 1305 .handle_irq = pxa27x_handle_irq,
1306 .timer = &pxa_timer, 1306 .timer = &pxa_timer,
1307 .init_machine = em_x270_init, 1307 .init_machine = em_x270_init,
1308 .restart = pxa_restart,
1308MACHINE_END 1309MACHINE_END
1309 1310
1310MACHINE_START(EXEDA, "Compulab eXeda") 1311MACHINE_START(EXEDA, "Compulab eXeda")
@@ -1314,4 +1315,5 @@ MACHINE_START(EXEDA, "Compulab eXeda")
1314 .handle_irq = pxa27x_handle_irq, 1315 .handle_irq = pxa27x_handle_irq,
1315 .timer = &pxa_timer, 1316 .timer = &pxa_timer,
1316 .init_machine = em_x270_init, 1317 .init_machine = em_x270_init,
1318 .restart = pxa_restart,
1317MACHINE_END 1319MACHINE_END
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index d82b7aa3c096..69473db97758 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -196,6 +196,7 @@ MACHINE_START(E330, "Toshiba e330")
196 .fixup = eseries_fixup, 196 .fixup = eseries_fixup,
197 .init_machine = e330_init, 197 .init_machine = e330_init,
198 .timer = &pxa_timer, 198 .timer = &pxa_timer,
199 .restart = pxa_restart,
199MACHINE_END 200MACHINE_END
200#endif 201#endif
201 202
@@ -246,6 +247,7 @@ MACHINE_START(E350, "Toshiba e350")
246 .fixup = eseries_fixup, 247 .fixup = eseries_fixup,
247 .init_machine = e350_init, 248 .init_machine = e350_init,
248 .timer = &pxa_timer, 249 .timer = &pxa_timer,
250 .restart = pxa_restart,
249MACHINE_END 251MACHINE_END
250#endif 252#endif
251 253
@@ -369,6 +371,7 @@ MACHINE_START(E400, "Toshiba e400")
369 .fixup = eseries_fixup, 371 .fixup = eseries_fixup,
370 .init_machine = e400_init, 372 .init_machine = e400_init,
371 .timer = &pxa_timer, 373 .timer = &pxa_timer,
374 .restart = pxa_restart,
372MACHINE_END 375MACHINE_END
373#endif 376#endif
374 377
@@ -558,6 +561,7 @@ MACHINE_START(E740, "Toshiba e740")
558 .fixup = eseries_fixup, 561 .fixup = eseries_fixup,
559 .init_machine = e740_init, 562 .init_machine = e740_init,
560 .timer = &pxa_timer, 563 .timer = &pxa_timer,
564 .restart = pxa_restart,
561MACHINE_END 565MACHINE_END
562#endif 566#endif
563 567
@@ -750,6 +754,7 @@ MACHINE_START(E750, "Toshiba e750")
750 .fixup = eseries_fixup, 754 .fixup = eseries_fixup,
751 .init_machine = e750_init, 755 .init_machine = e750_init,
752 .timer = &pxa_timer, 756 .timer = &pxa_timer,
757 .restart = pxa_restart,
753MACHINE_END 758MACHINE_END
754#endif 759#endif
755 760
@@ -955,5 +960,6 @@ MACHINE_START(E800, "Toshiba e800")
955 .fixup = eseries_fixup, 960 .fixup = eseries_fixup,
956 .init_machine = e800_init, 961 .init_machine = e800_init,
957 .timer = &pxa_timer, 962 .timer = &pxa_timer,
963 .restart = pxa_restart,
958MACHINE_END 964MACHINE_END
959#endif 965#endif
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 8308eee5a924..15ab2533667d 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -804,6 +804,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780")
804 .handle_irq = pxa27x_handle_irq, 804 .handle_irq = pxa27x_handle_irq,
805 .timer = &pxa_timer, 805 .timer = &pxa_timer,
806 .init_machine = a780_init, 806 .init_machine = a780_init,
807 .restart = pxa_restart,
807MACHINE_END 808MACHINE_END
808#endif 809#endif
809 810
@@ -870,6 +871,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680")
870 .handle_irq = pxa27x_handle_irq, 871 .handle_irq = pxa27x_handle_irq,
871 .timer = &pxa_timer, 872 .timer = &pxa_timer,
872 .init_machine = e680_init, 873 .init_machine = e680_init,
874 .restart = pxa_restart,
873MACHINE_END 875MACHINE_END
874#endif 876#endif
875 877
@@ -936,6 +938,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200")
936 .handle_irq = pxa27x_handle_irq, 938 .handle_irq = pxa27x_handle_irq,
937 .timer = &pxa_timer, 939 .timer = &pxa_timer,
938 .init_machine = a1200_init, 940 .init_machine = a1200_init,
941 .restart = pxa_restart,
939MACHINE_END 942MACHINE_END
940#endif 943#endif
941 944
@@ -1127,6 +1130,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910")
1127 .handle_irq = pxa27x_handle_irq, 1130 .handle_irq = pxa27x_handle_irq,
1128 .timer = &pxa_timer, 1131 .timer = &pxa_timer,
1129 .init_machine = a910_init, 1132 .init_machine = a910_init,
1133 .restart = pxa_restart,
1130MACHINE_END 1134MACHINE_END
1131#endif 1135#endif
1132 1136
@@ -1193,6 +1197,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6")
1193 .handle_irq = pxa27x_handle_irq, 1197 .handle_irq = pxa27x_handle_irq,
1194 .timer = &pxa_timer, 1198 .timer = &pxa_timer,
1195 .init_machine = e6_init, 1199 .init_machine = e6_init,
1200 .restart = pxa_restart,
1196MACHINE_END 1201MACHINE_END
1197#endif 1202#endif
1198 1203
@@ -1233,5 +1238,6 @@ MACHINE_START(EZX_E2, "Motorola EZX E2")
1233 .handle_irq = pxa27x_handle_irq, 1238 .handle_irq = pxa27x_handle_irq,
1234 .timer = &pxa_timer, 1239 .timer = &pxa_timer,
1235 .init_machine = e2_init, 1240 .init_machine = e2_init,
1241 .restart = pxa_restart,
1236MACHINE_END 1242MACHINE_END
1237#endif 1243#endif
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 92a2e85ab02c..0d729e6619df 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -57,3 +57,5 @@ void __init pxa_set_ffuart_info(void *info);
57void __init pxa_set_btuart_info(void *info); 57void __init pxa_set_btuart_info(void *info);
58void __init pxa_set_stuart_info(void *info); 58void __init pxa_set_stuart_info(void *info);
59void __init pxa_set_hwuart_info(void *info); 59void __init pxa_set_hwuart_info(void *info);
60
61void pxa_restart(char, const char *);
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index 9c8208ca0415..ac3b1cef4751 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -106,7 +106,7 @@ static void __init gumstix_mmc_init(void)
106} 106}
107#endif 107#endif
108 108
109#ifdef CONFIG_USB_GADGET_PXA25X 109#ifdef CONFIG_USB_PXA25X
110static struct gpio_vbus_mach_info gumstix_udc_info = { 110static struct gpio_vbus_mach_info gumstix_udc_info = {
111 .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn, 111 .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn,
112 .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx, 112 .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx,
@@ -239,4 +239,5 @@ MACHINE_START(GUMSTIX, "Gumstix")
239 .handle_irq = pxa25x_handle_irq, 239 .handle_irq = pxa25x_handle_irq,
240 .timer = &pxa_timer, 240 .timer = &pxa_timer,
241 .init_machine = gumstix_init, 241 .init_machine = gumstix_init,
242 .restart = pxa_restart,
242MACHINE_END 243MACHINE_END
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
index 4b5e110640b1..fde6b4c873c4 100644
--- a/arch/arm/mach-pxa/h5000.c
+++ b/arch/arm/mach-pxa/h5000.c
@@ -209,4 +209,5 @@ MACHINE_START(H5400, "HP iPAQ H5000")
209 .handle_irq = pxa25x_handle_irq, 209 .handle_irq = pxa25x_handle_irq,
210 .timer = &pxa_timer, 210 .timer = &pxa_timer,
211 .init_machine = h5000_init, 211 .init_machine = h5000_init,
212 .restart = pxa_restart,
212MACHINE_END 213MACHINE_END
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c
index f2c324570844..26d069a9f900 100644
--- a/arch/arm/mach-pxa/himalaya.c
+++ b/arch/arm/mach-pxa/himalaya.c
@@ -164,4 +164,5 @@ MACHINE_START(HIMALAYA, "HTC Himalaya")
164 .handle_irq = pxa25x_handle_irq, 164 .handle_irq = pxa25x_handle_irq,
165 .init_machine = himalaya_init, 165 .init_machine = himalaya_init,
166 .timer = &pxa_timer, 166 .timer = &pxa_timer,
167 .restart = pxa_restart,
167MACHINE_END 168MACHINE_END
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 6f6368ece9bd..ce16bdae96de 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -845,4 +845,5 @@ MACHINE_START(H4700, "HP iPAQ HX4700")
845 .handle_irq = pxa27x_handle_irq, 845 .handle_irq = pxa27x_handle_irq,
846 .init_machine = hx4700_init, 846 .init_machine = hx4700_init,
847 .timer = &pxa_timer, 847 .timer = &pxa_timer,
848 .restart = pxa_restart,
848MACHINE_END 849MACHINE_END
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
index f78d5db758da..e239b82c99d7 100644
--- a/arch/arm/mach-pxa/icontrol.c
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -196,5 +196,6 @@ MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
196 .init_irq = pxa3xx_init_irq, 196 .init_irq = pxa3xx_init_irq,
197 .handle_irq = pxa3xx_handle_irq, 197 .handle_irq = pxa3xx_handle_irq,
198 .timer = &pxa_timer, 198 .timer = &pxa_timer,
199 .init_machine = icontrol_init 199 .init_machine = icontrol_init,
200 .restart = pxa_restart,
200MACHINE_END 201MACHINE_END
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index ddf20e5c376e..fbabd84e110c 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -199,4 +199,5 @@ MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
199 .handle_irq = pxa25x_handle_irq, 199 .handle_irq = pxa25x_handle_irq,
200 .timer = &pxa_timer, 200 .timer = &pxa_timer,
201 .init_machine = idp_init, 201 .init_machine = idp_init,
202 .restart = pxa_restart,
202MACHINE_END 203MACHINE_END
diff --git a/arch/arm/mach-pxa/include/mach/entry-macro.S b/arch/arm/mach-pxa/include/mach/entry-macro.S
index a73bc86a3c26..260c0c17692a 100644
--- a/arch/arm/mach-pxa/include/mach/entry-macro.S
+++ b/arch/arm/mach-pxa/include/mach/entry-macro.S
@@ -7,45 +7,9 @@
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <mach/hardware.h>
11#include <mach/irqs.h>
12 10
13 .macro disable_fiq 11 .macro disable_fiq
14 .endm 12 .endm
15 13
16 .macro get_irqnr_preamble, base, tmp
17 .endm
18
19 .macro arch_ret_to_user, tmp1, tmp2 14 .macro arch_ret_to_user, tmp1, tmp2
20 .endm 15 .endm
21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23 mrc p15, 0, \tmp, c0, c0, 0 @ CPUID
24 mov \tmp, \tmp, lsr #13
25 and \tmp, \tmp, #0x7 @ Core G
26 cmp \tmp, #1
27 bhi 1002f
28
29 @ Core Generation 1 (PXA25x)
30 mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000
31 add \base, \base, #0x00d00000
32 ldr \irqstat, [\base, #0] @ ICIP
33 ldr \irqnr, [\base, #4] @ ICMR
34
35 ands \irqnr, \irqstat, \irqnr
36 beq 1001f
37 rsb \irqstat, \irqnr, #0
38 and \irqstat, \irqstat, \irqnr
39 clz \irqnr, \irqstat
40 rsb \irqnr, \irqnr, #(31 + PXA_IRQ(0))
41 b 1001f
421002:
43 @ Core Generation 2 (PXA27x) or Core Generation 3 (PXA3xx)
44 mrc p6, 0, \irqstat, c5, c0, 0 @ ICHP
45 tst \irqstat, #0x80000000
46 beq 1001f
47 bic \irqstat, \irqstat, #0x80000000
48 mov \irqnr, \irqstat, lsr #16
49 add \irqnr, \irqnr, #(PXA_IRQ(0))
501001:
51 .endm
diff --git a/arch/arm/mach-pxa/include/mach/palm27x.h b/arch/arm/mach-pxa/include/mach/palm27x.h
index f80bbe246afe..d4eac3d6ffb5 100644
--- a/arch/arm/mach-pxa/include/mach/palm27x.h
+++ b/arch/arm/mach-pxa/include/mach/palm27x.h
@@ -37,8 +37,8 @@ extern void __init palm27x_lcd_init(int power,
37#define palm27x_lcd_init(power, mode) do {} while (0) 37#define palm27x_lcd_init(power, mode) do {} while (0)
38#endif 38#endif
39 39
40#if defined(CONFIG_USB_GADGET_PXA27X) || \ 40#if defined(CONFIG_USB_PXA27X) || \
41 defined(CONFIG_USB_GADGET_PXA27X_MODULE) 41 defined(CONFIG_USB_PXA27X_MODULE)
42extern void __init palm27x_udc_init(int vbus, int pullup, 42extern void __init palm27x_udc_init(int vbus, int pullup,
43 int vbus_inverted); 43 int vbus_inverted);
44#else 44#else
diff --git a/arch/arm/mach-pxa/include/mach/system.h b/arch/arm/mach-pxa/include/mach/system.h
index d1fce8b6d105..c5afacd3cc0b 100644
--- a/arch/arm/mach-pxa/include/mach/system.h
+++ b/arch/arm/mach-pxa/include/mach/system.h
@@ -9,15 +9,7 @@
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12
13#include <asm/proc-fns.h>
14#include "hardware.h"
15#include "pxa2xx-regs.h"
16
17static inline void arch_idle(void) 12static inline void arch_idle(void)
18{ 13{
19 cpu_do_idle(); 14 cpu_do_idle();
20} 15}
21
22
23void arch_reset(char mode, const char *cmd);
diff --git a/arch/arm/mach-pxa/include/mach/vmalloc.h b/arch/arm/mach-pxa/include/mach/vmalloc.h
deleted file mode 100644
index bfecfbf5f460..000000000000
--- a/arch/arm/mach-pxa/include/mach/vmalloc.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * arch/arm/mach-pxa/include/mach/vmalloc.h
3 *
4 * Author: Nicolas Pitre
5 * Copyright: (C) 2001 MontaVista Software Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#define VMALLOC_END (0xe8000000UL)
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 7b324ec6449f..c337c7eed514 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -445,4 +445,5 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto
445 .handle_irq = pxa3xx_handle_irq, 445 .handle_irq = pxa3xx_handle_irq,
446 .timer = &pxa_timer, 446 .timer = &pxa_timer,
447 .init_machine = littleton_init, 447 .init_machine = littleton_init,
448 .restart = pxa_restart,
448MACHINE_END 449MACHINE_END
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 1dd530279e0b..6119c015f393 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -505,4 +505,5 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
505 .handle_irq = pxa27x_handle_irq, 505 .handle_irq = pxa27x_handle_irq,
506 .timer = &pxa_timer, 506 .timer = &pxa_timer,
507 .init_machine = lpd270_init, 507 .init_machine = lpd270_init,
508 .restart = pxa_restart,
508MACHINE_END 509MACHINE_END
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index c48ce6da9184..4b7a52871652 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -556,4 +556,5 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
556 .handle_irq = pxa25x_handle_irq, 556 .handle_irq = pxa25x_handle_irq,
557 .timer = &pxa_timer, 557 .timer = &pxa_timer,
558 .init_machine = lubbock_init, 558 .init_machine = lubbock_init,
559 .restart = pxa_restart,
559MACHINE_END 560MACHINE_END
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 4b796c37af3e..4e6774fff422 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -760,4 +760,5 @@ MACHINE_START(MAGICIAN, "HTC Magician")
760 .handle_irq = pxa27x_handle_irq, 760 .handle_irq = pxa27x_handle_irq,
761 .init_machine = magician_init, 761 .init_machine = magician_init,
762 .timer = &pxa_timer, 762 .timer = &pxa_timer,
763 .restart = pxa_restart,
763MACHINE_END 764MACHINE_END
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 0567d3965fda..ca14555d5e15 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -622,4 +622,5 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
622 .handle_irq = pxa27x_handle_irq, 622 .handle_irq = pxa27x_handle_irq,
623 .timer = &pxa_timer, 623 .timer = &pxa_timer,
624 .init_machine = mainstone_init, 624 .init_machine = mainstone_init,
625 .restart = pxa_restart,
625MACHINE_END 626MACHINE_END
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index b938fc2c316a..924a3b5f8da6 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -696,13 +696,13 @@ static void mioa701_machine_exit(void);
696static void mioa701_poweroff(void) 696static void mioa701_poweroff(void)
697{ 697{
698 mioa701_machine_exit(); 698 mioa701_machine_exit();
699 arm_machine_restart('s', NULL); 699 pxa_restart('s', NULL);
700} 700}
701 701
702static void mioa701_restart(char c, const char *cmd) 702static void mioa701_restart(char c, const char *cmd)
703{ 703{
704 mioa701_machine_exit(); 704 mioa701_machine_exit();
705 arm_machine_restart('s', cmd); 705 pxa_restart('s', cmd);
706} 706}
707 707
708static struct gpio global_gpios[] = { 708static struct gpio global_gpios[] = {
@@ -734,7 +734,6 @@ static void __init mioa701_machine_init(void)
734 pxa_set_udc_info(&mioa701_udc_info); 734 pxa_set_udc_info(&mioa701_udc_info);
735 pxa_set_ac97_info(&mioa701_ac97_info); 735 pxa_set_ac97_info(&mioa701_ac97_info);
736 pm_power_off = mioa701_poweroff; 736 pm_power_off = mioa701_poweroff;
737 arm_pm_restart = mioa701_restart;
738 platform_add_devices(devices, ARRAY_SIZE(devices)); 737 platform_add_devices(devices, ARRAY_SIZE(devices));
739 gsm_init(); 738 gsm_init();
740 739
@@ -752,9 +751,11 @@ static void mioa701_machine_exit(void)
752 751
753MACHINE_START(MIOA701, "MIO A701") 752MACHINE_START(MIOA701, "MIO A701")
754 .atag_offset = 0x100, 753 .atag_offset = 0x100,
754 .restart_mode = 's',
755 .map_io = &pxa27x_map_io, 755 .map_io = &pxa27x_map_io,
756 .init_irq = &pxa27x_init_irq, 756 .init_irq = &pxa27x_init_irq,
757 .handle_irq = &pxa27x_handle_irq, 757 .handle_irq = &pxa27x_handle_irq,
758 .init_machine = mioa701_machine_init, 758 .init_machine = mioa701_machine_init,
759 .timer = &pxa_timer, 759 .timer = &pxa_timer,
760 .restart = mioa701_restart,
760MACHINE_END 761MACHINE_END
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c
index 4af5d513c380..169bf8f97af0 100644
--- a/arch/arm/mach-pxa/mp900.c
+++ b/arch/arm/mach-pxa/mp900.c
@@ -98,5 +98,6 @@ MACHINE_START(NEC_MP900, "MobilePro900/C")
98 .init_irq = pxa25x_init_irq, 98 .init_irq = pxa25x_init_irq,
99 .handle_irq = pxa25x_handle_irq, 99 .handle_irq = pxa25x_handle_irq,
100 .init_machine = mp900c_init, 100 .init_machine = mp900c_init,
101 .restart = pxa_restart,
101MACHINE_END 102MACHINE_END
102 103
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
index 325c245c0a0d..fbc10d7b95d1 100644
--- a/arch/arm/mach-pxa/palm27x.c
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -164,8 +164,8 @@ void __init palm27x_lcd_init(int power, struct pxafb_mode_info *mode)
164/****************************************************************************** 164/******************************************************************************
165 * USB Gadget 165 * USB Gadget
166 ******************************************************************************/ 166 ******************************************************************************/
167#if defined(CONFIG_USB_GADGET_PXA27X) || \ 167#if defined(CONFIG_USB_PXA27X) || \
168 defined(CONFIG_USB_GADGET_PXA27X_MODULE) 168 defined(CONFIG_USB_PXA27X_MODULE)
169static struct gpio_vbus_mach_info palm27x_udc_info = { 169static struct gpio_vbus_mach_info palm27x_udc_info = {
170 .gpio_vbus_inverted = 1, 170 .gpio_vbus_inverted = 1,
171}; 171};
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 3d4a2819cae1..1fa80f4f80c8 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -347,5 +347,6 @@ MACHINE_START(PALMLD, "Palm LifeDrive")
347 .init_irq = pxa27x_init_irq, 347 .init_irq = pxa27x_init_irq,
348 .handle_irq = pxa27x_handle_irq, 348 .handle_irq = pxa27x_handle_irq,
349 .timer = &pxa_timer, 349 .timer = &pxa_timer,
350 .init_machine = palmld_init 350 .init_machine = palmld_init,
351 .restart = pxa_restart,
351MACHINE_END 352MACHINE_END
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 99d6bcf1f974..5ba14316bd9c 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -208,5 +208,6 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5")
208 .init_irq = pxa27x_init_irq, 208 .init_irq = pxa27x_init_irq,
209 .handle_irq = pxa27x_handle_irq, 209 .handle_irq = pxa27x_handle_irq,
210 .timer = &pxa_timer, 210 .timer = &pxa_timer,
211 .init_machine = palmt5_init 211 .init_machine = palmt5_init,
212 .restart = pxa_restart,
212MACHINE_END 213MACHINE_END
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 6ec7caefb37c..29b51b40f09d 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -338,7 +338,7 @@ static inline void palmtc_mkp_init(void) {}
338/****************************************************************************** 338/******************************************************************************
339 * UDC 339 * UDC
340 ******************************************************************************/ 340 ******************************************************************************/
341#if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE) 341#if defined(CONFIG_USB_PXA25X)||defined(CONFIG_USB_PXA25X_MODULE)
342static struct gpio_vbus_mach_info palmtc_udc_info = { 342static struct gpio_vbus_mach_info palmtc_udc_info = {
343 .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N, 343 .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N,
344 .gpio_vbus_inverted = 1, 344 .gpio_vbus_inverted = 1,
@@ -542,5 +542,6 @@ MACHINE_START(PALMTC, "Palm Tungsten|C")
542 .init_irq = pxa25x_init_irq, 542 .init_irq = pxa25x_init_irq,
543 .handle_irq = pxa25x_handle_irq, 543 .handle_irq = pxa25x_handle_irq,
544 .timer = &pxa_timer, 544 .timer = &pxa_timer,
545 .init_machine = palmtc_init 545 .init_machine = palmtc_init,
546 .restart = pxa_restart,
546MACHINE_END 547MACHINE_END
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 9376da06404c..5ebf49acb827 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -361,5 +361,6 @@ MACHINE_START(PALMTE2, "Palm Tungsten|E2")
361 .init_irq = pxa25x_init_irq, 361 .init_irq = pxa25x_init_irq,
362 .handle_irq = pxa25x_handle_irq, 362 .handle_irq = pxa25x_handle_irq,
363 .timer = &pxa_timer, 363 .timer = &pxa_timer,
364 .init_machine = palmte2_init 364 .init_machine = palmte2_init,
365 .restart = pxa_restart,
365MACHINE_END 366MACHINE_END
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index 94e9708b349d..ec8249156c08 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -452,6 +452,7 @@ MACHINE_START(TREO680, "Palm Treo 680")
452 .handle_irq = pxa27x_handle_irq, 452 .handle_irq = pxa27x_handle_irq,
453 .timer = &pxa_timer, 453 .timer = &pxa_timer,
454 .init_machine = treo680_init, 454 .init_machine = treo680_init,
455 .restart = pxa_restart,
455MACHINE_END 456MACHINE_END
456#endif 457#endif
457 458
@@ -464,5 +465,6 @@ MACHINE_START(CENTRO, "Palm Centro 685")
464 .handle_irq = pxa27x_handle_irq, 465 .handle_irq = pxa27x_handle_irq,
465 .timer = &pxa_timer, 466 .timer = &pxa_timer,
466 .init_machine = centro_init, 467 .init_machine = centro_init,
468 .restart = pxa_restart,
467MACHINE_END 469MACHINE_END
468#endif 470#endif
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index 4e3e45927e95..6170d76dfba8 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -369,5 +369,6 @@ MACHINE_START(PALMTX, "Palm T|X")
369 .init_irq = pxa27x_init_irq, 369 .init_irq = pxa27x_init_irq,
370 .handle_irq = pxa27x_handle_irq, 370 .handle_irq = pxa27x_handle_irq,
371 .timer = &pxa_timer, 371 .timer = &pxa_timer,
372 .init_machine = palmtx_init 372 .init_machine = palmtx_init,
373 .restart = pxa_restart,
373MACHINE_END 374MACHINE_END
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 68e18baf8e07..b2dff9d415eb 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -404,5 +404,6 @@ MACHINE_START(PALMZ72, "Palm Zire72")
404 .init_irq = pxa27x_init_irq, 404 .init_irq = pxa27x_init_irq,
405 .handle_irq = pxa27x_handle_irq, 405 .handle_irq = pxa27x_handle_irq,
406 .timer = &pxa_timer, 406 .timer = &pxa_timer,
407 .init_machine = palmz72_init 407 .init_machine = palmz72_init,
408 .restart = pxa_restart,
408MACHINE_END 409MACHINE_END
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index 0b825a353537..fe9054435b6f 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -265,4 +265,5 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
265 .handle_irq = pxa27x_handle_irq, 265 .handle_irq = pxa27x_handle_irq,
266 .timer = &pxa_timer, 266 .timer = &pxa_timer,
267 .init_machine = pcm027_init, 267 .init_machine = pcm027_init,
268 .restart = pxa_restart,
268MACHINE_END 269MACHINE_END
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 50c833177866..b260ce872d2d 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -417,12 +417,7 @@ static struct i2c_board_info __initdata poodle_i2c_devices[] = {
417 417
418static void poodle_poweroff(void) 418static void poodle_poweroff(void)
419{ 419{
420 arm_machine_restart('h', NULL); 420 pxa_restart('h', NULL);
421}
422
423static void poodle_restart(char mode, const char *cmd)
424{
425 arm_machine_restart('h', cmd);
426} 421}
427 422
428static void __init poodle_init(void) 423static void __init poodle_init(void)
@@ -430,7 +425,6 @@ static void __init poodle_init(void)
430 int ret = 0; 425 int ret = 0;
431 426
432 pm_power_off = poodle_poweroff; 427 pm_power_off = poodle_poweroff;
433 arm_pm_restart = poodle_restart;
434 428
435 PCFR |= PCFR_OPDE; 429 PCFR |= PCFR_OPDE;
436 430
@@ -472,4 +466,5 @@ MACHINE_START(POODLE, "SHARP Poodle")
472 .handle_irq = pxa25x_handle_irq, 466 .handle_irq = pxa25x_handle_irq,
473 .timer = &pxa_timer, 467 .timer = &pxa_timer,
474 .init_machine = poodle_init, 468 .init_machine = poodle_init,
469 .restart = pxa_restart,
475MACHINE_END 470MACHINE_END
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index f0c05f4d12ed..4962b1676629 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -1093,6 +1093,7 @@ MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
1093 .init_irq = pxa3xx_init_irq, 1093 .init_irq = pxa3xx_init_irq,
1094 .handle_irq = pxa3xx_handle_irq, 1094 .handle_irq = pxa3xx_handle_irq,
1095 .timer = &pxa_timer, 1095 .timer = &pxa_timer,
1096 .restart = pxa_restart,
1096MACHINE_END 1097MACHINE_END
1097#endif 1098#endif
1098 1099
@@ -1104,6 +1105,7 @@ MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
1104 .init_irq = pxa3xx_init_irq, 1105 .init_irq = pxa3xx_init_irq,
1105 .handle_irq = pxa3xx_handle_irq, 1106 .handle_irq = pxa3xx_handle_irq,
1106 .timer = &pxa_timer, 1107 .timer = &pxa_timer,
1108 .restart = pxa_restart,
1107MACHINE_END 1109MACHINE_END
1108#endif 1110#endif
1109 1111
@@ -1115,5 +1117,6 @@ MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
1115 .init_irq = pxa3xx_init_irq, 1117 .init_irq = pxa3xx_init_irq,
1116 .handle_irq = pxa3xx_handle_irq, 1118 .handle_irq = pxa3xx_handle_irq,
1117 .timer = &pxa_timer, 1119 .timer = &pxa_timer,
1120 .restart = pxa_restart,
1118MACHINE_END 1121MACHINE_END
1119#endif 1122#endif
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index 01e9d643394a..c8497b00cdfe 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -81,14 +81,17 @@ static void do_hw_reset(void)
81 OSMR3 = OSCR + 368640; /* ... in 100 ms */ 81 OSMR3 = OSCR + 368640; /* ... in 100 ms */
82} 82}
83 83
84void arch_reset(char mode, const char *cmd) 84void pxa_restart(char mode, const char *cmd)
85{ 85{
86 local_irq_disable();
87 local_fiq_disable();
88
86 clear_reset_status(RESET_STATUS_ALL); 89 clear_reset_status(RESET_STATUS_ALL);
87 90
88 switch (mode) { 91 switch (mode) {
89 case 's': 92 case 's':
90 /* Jump into ROM at address 0 */ 93 /* Jump into ROM at address 0 */
91 cpu_reset(0); 94 soft_restart(0);
92 break; 95 break;
93 case 'g': 96 case 'g':
94 do_gpio_reset(); 97 do_gpio_reset();
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index fc2c1e05af9c..878707056e65 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -602,4 +602,5 @@ MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
602 .handle_irq = pxa3xx_handle_irq, 602 .handle_irq = pxa3xx_handle_irq,
603 .timer = &pxa_timer, 603 .timer = &pxa_timer,
604 .init_machine = saar_init, 604 .init_machine = saar_init,
605 .restart = pxa_restart,
605MACHINE_END 606MACHINE_END
diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c
index 3e999e308a2d..b6dbaca460c7 100644
--- a/arch/arm/mach-pxa/saarb.c
+++ b/arch/arm/mach-pxa/saarb.c
@@ -111,5 +111,6 @@ MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)")
111 .handle_irq = pxa3xx_handle_irq, 111 .handle_irq = pxa3xx_handle_irq,
112 .timer = &pxa_timer, 112 .timer = &pxa_timer,
113 .init_machine = saarb_init, 113 .init_machine = saarb_init,
114 .restart = pxa_restart,
114MACHINE_END 115MACHINE_END
115 116
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 953a9195f9e5..a7f81a3fd132 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -926,7 +926,7 @@ static inline void spitz_i2c_init(void) {}
926 ******************************************************************************/ 926 ******************************************************************************/
927static void spitz_poweroff(void) 927static void spitz_poweroff(void)
928{ 928{
929 arm_machine_restart('g', NULL); 929 pxa_restart('g', NULL);
930} 930}
931 931
932static void spitz_restart(char mode, const char *cmd) 932static void spitz_restart(char mode, const char *cmd)
@@ -943,7 +943,6 @@ static void __init spitz_init(void)
943{ 943{
944 init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0); 944 init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0);
945 pm_power_off = spitz_poweroff; 945 pm_power_off = spitz_poweroff;
946 arm_pm_restart = spitz_restart;
947 946
948 PMCR = 0x00; 947 PMCR = 0x00;
949 948
@@ -982,33 +981,39 @@ static void __init spitz_fixup(struct tag *tags, char **cmdline,
982 981
983#ifdef CONFIG_MACH_SPITZ 982#ifdef CONFIG_MACH_SPITZ
984MACHINE_START(SPITZ, "SHARP Spitz") 983MACHINE_START(SPITZ, "SHARP Spitz")
984 .restart_mode = 'g',
985 .fixup = spitz_fixup, 985 .fixup = spitz_fixup,
986 .map_io = pxa27x_map_io, 986 .map_io = pxa27x_map_io,
987 .init_irq = pxa27x_init_irq, 987 .init_irq = pxa27x_init_irq,
988 .handle_irq = pxa27x_handle_irq, 988 .handle_irq = pxa27x_handle_irq,
989 .init_machine = spitz_init, 989 .init_machine = spitz_init,
990 .timer = &pxa_timer, 990 .timer = &pxa_timer,
991 .restart = spitz_restart,
991MACHINE_END 992MACHINE_END
992#endif 993#endif
993 994
994#ifdef CONFIG_MACH_BORZOI 995#ifdef CONFIG_MACH_BORZOI
995MACHINE_START(BORZOI, "SHARP Borzoi") 996MACHINE_START(BORZOI, "SHARP Borzoi")
997 .restart_mode = 'g',
996 .fixup = spitz_fixup, 998 .fixup = spitz_fixup,
997 .map_io = pxa27x_map_io, 999 .map_io = pxa27x_map_io,
998 .init_irq = pxa27x_init_irq, 1000 .init_irq = pxa27x_init_irq,
999 .handle_irq = pxa27x_handle_irq, 1001 .handle_irq = pxa27x_handle_irq,
1000 .init_machine = spitz_init, 1002 .init_machine = spitz_init,
1001 .timer = &pxa_timer, 1003 .timer = &pxa_timer,
1004 .restart = spitz_restart,
1002MACHINE_END 1005MACHINE_END
1003#endif 1006#endif
1004 1007
1005#ifdef CONFIG_MACH_AKITA 1008#ifdef CONFIG_MACH_AKITA
1006MACHINE_START(AKITA, "SHARP Akita") 1009MACHINE_START(AKITA, "SHARP Akita")
1010 .restart_mode = 'g',
1007 .fixup = spitz_fixup, 1011 .fixup = spitz_fixup,
1008 .map_io = pxa27x_map_io, 1012 .map_io = pxa27x_map_io,
1009 .init_irq = pxa27x_init_irq, 1013 .init_irq = pxa27x_init_irq,
1010 .handle_irq = pxa27x_handle_irq, 1014 .handle_irq = pxa27x_handle_irq,
1011 .init_machine = spitz_init, 1015 .init_machine = spitz_init,
1012 .timer = &pxa_timer, 1016 .timer = &pxa_timer,
1017 .restart = spitz_restart,
1013MACHINE_END 1018MACHINE_END
1014#endif 1019#endif
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 4c9a48bef569..80d7f23ad0fd 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -1005,6 +1005,7 @@ MACHINE_START(INTELMOTE2, "IMOTE 2")
1005 .timer = &pxa_timer, 1005 .timer = &pxa_timer,
1006 .init_machine = imote2_init, 1006 .init_machine = imote2_init,
1007 .atag_offset = 0x100, 1007 .atag_offset = 0x100,
1008 .restart = pxa_restart,
1008MACHINE_END 1009MACHINE_END
1009#endif 1010#endif
1010 1011
@@ -1017,5 +1018,6 @@ MACHINE_START(STARGATE2, "Stargate 2")
1017 .timer = &pxa_timer, 1018 .timer = &pxa_timer,
1018 .init_machine = stargate2_init, 1019 .init_machine = stargate2_init,
1019 .atag_offset = 0x100, 1020 .atag_offset = 0x100,
1021 .restart = pxa_restart,
1020MACHINE_END 1022MACHINE_END
1021#endif 1023#endif
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index ad47bb98f30d..4fa36a3e383c 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -495,4 +495,5 @@ MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
495 .handle_irq = pxa3xx_handle_irq, 495 .handle_irq = pxa3xx_handle_irq,
496 .timer = &pxa_timer, 496 .timer = &pxa_timer,
497 .init_machine = tavorevb_init, 497 .init_machine = tavorevb_init,
498 .restart = pxa_restart,
498MACHINE_END 499MACHINE_END
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c
index fd569167302a..8a22879f0bb0 100644
--- a/arch/arm/mach-pxa/tavorevb3.c
+++ b/arch/arm/mach-pxa/tavorevb3.c
@@ -132,4 +132,5 @@ MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)")
132 .handle_irq = pxa3xx_handle_irq, 132 .handle_irq = pxa3xx_handle_irq,
133 .timer = &pxa_timer, 133 .timer = &pxa_timer,
134 .init_machine = evb3_init, 134 .init_machine = evb3_init,
135 .restart = pxa_restart,
135MACHINE_END 136MACHINE_END
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index de684701449c..b503049d6d26 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/clockchips.h> 18#include <linux/clockchips.h>
19#include <linux/sched.h>
20 19
21#include <asm/div64.h> 20#include <asm/div64.h>
22#include <asm/mach/irq.h> 21#include <asm/mach/irq.h>
@@ -32,18 +31,10 @@
32 * long as there is always less than 582 seconds between successive 31 * long as there is always less than 582 seconds between successive
33 * calls to sched_clock() which should always be the case in practice. 32 * calls to sched_clock() which should always be the case in practice.
34 */ 33 */
35static DEFINE_CLOCK_DATA(cd);
36 34
37unsigned long long notrace sched_clock(void) 35static u32 notrace pxa_read_sched_clock(void)
38{ 36{
39 u32 cyc = OSCR; 37 return OSCR;
40 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
41}
42
43static void notrace pxa_update_sched_clock(void)
44{
45 u32 cyc = OSCR;
46 update_sched_clock(&cd, cyc, (u32)~0);
47} 38}
48 39
49 40
@@ -119,7 +110,7 @@ static void __init pxa_timer_init(void)
119 OIER = 0; 110 OIER = 0;
120 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3; 111 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
121 112
122 init_sched_clock(&cd, pxa_update_sched_clock, 32, clock_tick_rate); 113 setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate);
123 114
124 clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4); 115 clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4);
125 ckevt_pxa_osmr0.max_delta_ns = 116 ckevt_pxa_osmr0.max_delta_ns =
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 402b0c96613b..dfe40f8705aa 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -905,7 +905,7 @@ static struct platform_device *devices[] __initdata = {
905 905
906static void tosa_poweroff(void) 906static void tosa_poweroff(void)
907{ 907{
908 arm_machine_restart('g', NULL); 908 pxa_restart('g', NULL);
909} 909}
910 910
911static void tosa_restart(char mode, const char *cmd) 911static void tosa_restart(char mode, const char *cmd)
@@ -935,7 +935,6 @@ static void __init tosa_init(void)
935 init_gpio_reset(TOSA_GPIO_ON_RESET, 0, 0); 935 init_gpio_reset(TOSA_GPIO_ON_RESET, 0, 0);
936 936
937 pm_power_off = tosa_poweroff; 937 pm_power_off = tosa_poweroff;
938 arm_pm_restart = tosa_restart;
939 938
940 PCFR |= PCFR_OPDE; 939 PCFR |= PCFR_OPDE;
941 940
@@ -970,6 +969,7 @@ static void __init fixup_tosa(struct tag *tags, char **cmdline,
970} 969}
971 970
972MACHINE_START(TOSA, "SHARP Tosa") 971MACHINE_START(TOSA, "SHARP Tosa")
972 .restart_mode = 'g',
973 .fixup = fixup_tosa, 973 .fixup = fixup_tosa,
974 .map_io = pxa25x_map_io, 974 .map_io = pxa25x_map_io,
975 .nr_irqs = TOSA_NR_IRQS, 975 .nr_irqs = TOSA_NR_IRQS,
@@ -977,4 +977,5 @@ MACHINE_START(TOSA, "SHARP Tosa")
977 .handle_irq = pxa25x_handle_irq, 977 .handle_irq = pxa25x_handle_irq,
978 .init_machine = tosa_init, 978 .init_machine = tosa_init,
979 .timer = &pxa_timer, 979 .timer = &pxa_timer,
980 .restart = tosa_restart,
980MACHINE_END 981MACHINE_END
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 1aaed2b17e10..0f30af617d8f 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -561,6 +561,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
561 .init_irq = pxa27x_init_irq, 561 .init_irq = pxa27x_init_irq,
562 .handle_irq = pxa27x_handle_irq, 562 .handle_irq = pxa27x_handle_irq,
563 .timer = &pxa_timer, 563 .timer = &pxa_timer,
564 .restart = pxa_restart,
564MACHINE_END 565MACHINE_END
565 566
566MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module") 567MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
@@ -571,4 +572,5 @@ MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
571 .init_irq = pxa27x_init_irq, 572 .init_irq = pxa27x_init_irq,
572 .handle_irq = pxa27x_handle_irq, 573 .handle_irq = pxa27x_handle_irq,
573 .timer = &pxa_timer, 574 .timer = &pxa_timer,
575 .restart = pxa_restart,
574MACHINE_END 576MACHINE_END
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 242ddae332d3..afe2b7495523 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -998,4 +998,5 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC")
998 .handle_irq = pxa25x_handle_irq, 998 .handle_irq = pxa25x_handle_irq,
999 .timer = &pxa_timer, 999 .timer = &pxa_timer,
1000 .init_machine = viper_init, 1000 .init_machine = viper_init,
1001 .restart = pxa_restart,
1001MACHINE_END 1002MACHINE_END
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index a7539a6ed1ff..fed5fb088714 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -343,7 +343,7 @@ static inline void vpac270_uhc_init(void) {}
343/****************************************************************************** 343/******************************************************************************
344 * USB Gadget 344 * USB Gadget
345 ******************************************************************************/ 345 ******************************************************************************/
346#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) 346#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
347static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = { 347static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
348 .gpio_vbus = GPIO41_VPAC270_UDC_DETECT, 348 .gpio_vbus = GPIO41_VPAC270_UDC_DETECT,
349 .gpio_pullup = -1, 349 .gpio_pullup = -1,
@@ -721,5 +721,6 @@ MACHINE_START(VPAC270, "Voipac PXA270")
721 .init_irq = pxa27x_init_irq, 721 .init_irq = pxa27x_init_irq,
722 .handle_irq = pxa27x_handle_irq, 722 .handle_irq = pxa27x_handle_irq,
723 .timer = &pxa_timer, 723 .timer = &pxa_timer,
724 .init_machine = vpac270_init 724 .init_machine = vpac270_init,
725 .restart = pxa_restart,
725MACHINE_END 726MACHINE_END
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
index 70e1730ef282..4bbe9a36fe74 100644
--- a/arch/arm/mach-pxa/xcep.c
+++ b/arch/arm/mach-pxa/xcep.c
@@ -185,5 +185,6 @@ MACHINE_START(XCEP, "Iskratel XCEP")
185 .init_irq = pxa25x_init_irq, 185 .init_irq = pxa25x_init_irq,
186 .handle_irq = pxa25x_handle_irq, 186 .handle_irq = pxa25x_handle_irq,
187 .timer = &pxa_timer, 187 .timer = &pxa_timer,
188 .restart = pxa_restart,
188MACHINE_END 189MACHINE_END
189 190
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index ead32c90fec1..d75f66ab8c34 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -725,4 +725,5 @@ MACHINE_START(ZIPIT2, "Zipit Z2")
725 .handle_irq = pxa27x_handle_irq, 725 .handle_irq = pxa27x_handle_irq,
726 .timer = &pxa_timer, 726 .timer = &pxa_timer,
727 .init_machine = z2_init, 727 .init_machine = z2_init,
728 .restart = pxa_restart,
728MACHINE_END 729MACHINE_END
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 498b83b089f3..9db35a7fcfc0 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -911,5 +911,6 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
911 .handle_irq = pxa27x_handle_irq, 911 .handle_irq = pxa27x_handle_irq,
912 .timer = &pxa_timer, 912 .timer = &pxa_timer,
913 .init_machine = zeus_init, 913 .init_machine = zeus_init,
914 .restart = pxa_restart,
914MACHINE_END 915MACHINE_END
915 916
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 6c39c3328418..7678b1bf7903 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -430,4 +430,5 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
430 .handle_irq = pxa3xx_handle_irq, 430 .handle_irq = pxa3xx_handle_irq,
431 .timer = &pxa_timer, 431 .timer = &pxa_timer,
432 .init_machine = zylonite_init, 432 .init_machine = zylonite_init,
433 .restart = pxa_restart,
433MACHINE_END 434MACHINE_END
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index dba6d0c1fc17..c593be428b8f 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -12,6 +12,8 @@ config REALVIEW_EB_A9MP
12 bool "Support Multicore Cortex-A9 Tile" 12 bool "Support Multicore Cortex-A9 Tile"
13 depends on MACH_REALVIEW_EB 13 depends on MACH_REALVIEW_EB
14 select CPU_V7 14 select CPU_V7
15 select HAVE_SMP
16 select MIGHT_HAVE_CACHE_L2X0
15 help 17 help
16 Enable support for the Cortex-A9MPCore tile fitted to the 18 Enable support for the Cortex-A9MPCore tile fitted to the
17 Realview(R) Emulation Baseboard platform. 19 Realview(R) Emulation Baseboard platform.
@@ -21,6 +23,8 @@ config REALVIEW_EB_ARM11MP
21 depends on MACH_REALVIEW_EB 23 depends on MACH_REALVIEW_EB
22 select CPU_V6K 24 select CPU_V6K
23 select ARCH_HAS_BARRIERS if SMP 25 select ARCH_HAS_BARRIERS if SMP
26 select HAVE_SMP
27 select MIGHT_HAVE_CACHE_L2X0
24 help 28 help
25 Enable support for the ARM11MPCore tile fitted to the Realview(R) 29 Enable support for the ARM11MPCore tile fitted to the Realview(R)
26 Emulation Baseboard platform. 30 Emulation Baseboard platform.
@@ -39,6 +43,8 @@ config MACH_REALVIEW_PB11MP
39 select CPU_V6K 43 select CPU_V6K
40 select ARM_GIC 44 select ARM_GIC
41 select HAVE_PATA_PLATFORM 45 select HAVE_PATA_PLATFORM
46 select HAVE_SMP
47 select MIGHT_HAVE_CACHE_L2X0
42 select ARCH_HAS_BARRIERS if SMP 48 select ARCH_HAS_BARRIERS if SMP
43 help 49 help
44 Include support for the ARM(R) RealView(R) Platform Baseboard for 50 Include support for the ARM(R) RealView(R) Platform Baseboard for
@@ -51,6 +57,7 @@ config MACH_REALVIEW_PB1176
51 select CPU_V6 57 select CPU_V6
52 select ARM_GIC 58 select ARM_GIC
53 select HAVE_TCM 59 select HAVE_TCM
60 select MIGHT_HAVE_CACHE_L2X0
54 help 61 help
55 Include support for the ARM(R) RealView(R) Platform Baseboard for 62 Include support for the ARM(R) RealView(R) Platform Baseboard for
56 ARM1176JZF-S. 63 ARM1176JZF-S.
@@ -78,6 +85,8 @@ config MACH_REALVIEW_PBX
78 bool "Support RealView(R) Platform Baseboard Explore" 85 bool "Support RealView(R) Platform Baseboard Explore"
79 select ARM_GIC 86 select ARM_GIC
80 select HAVE_PATA_PLATFORM 87 select HAVE_PATA_PLATFORM
88 select HAVE_SMP
89 select MIGHT_HAVE_CACHE_L2X0
81 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET 90 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
82 select ZONE_DMA if SPARSEMEM 91 select ZONE_DMA if SPARSEMEM
83 help 92 help
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index d5ed5d4f77d6..acd329afc3ac 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -21,7 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/amba/bus.h> 26#include <linux/amba/bus.h>
27#include <linux/amba/clcd.h> 27#include <linux/amba/clcd.h>
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 47259c89a75e..735b57aaf2d6 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -65,6 +65,5 @@ extern int realview_usb_register(struct resource *res);
65extern void realview_init_early(void); 65extern void realview_init_early(void);
66extern void realview_fixup(struct tag *tags, char **from, 66extern void realview_fixup(struct tag *tags, char **from,
67 struct meminfo *meminfo); 67 struct meminfo *meminfo);
68extern void (*realview_reset)(char);
69 68
70#endif 69#endif
diff --git a/arch/arm/mach-realview/include/mach/entry-macro.S b/arch/arm/mach-realview/include/mach/entry-macro.S
index 4071164aebaa..e8a5179c2653 100644
--- a/arch/arm/mach-realview/include/mach/entry-macro.S
+++ b/arch/arm/mach-realview/include/mach/entry-macro.S
@@ -7,8 +7,6 @@
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <mach/hardware.h>
11#include <asm/hardware/entry-macro-gic.S>
12 10
13 .macro disable_fiq 11 .macro disable_fiq
14 .endm 12 .endm
diff --git a/arch/arm/mach-realview/include/mach/system.h b/arch/arm/mach-realview/include/mach/system.h
index 6657ff231161..471b671159ce 100644
--- a/arch/arm/mach-realview/include/mach/system.h
+++ b/arch/arm/mach-realview/include/mach/system.h
@@ -21,12 +21,6 @@
21#ifndef __ASM_ARCH_SYSTEM_H 21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H 22#define __ASM_ARCH_SYSTEM_H
23 23
24#include <linux/io.h>
25#include <mach/hardware.h>
26#include <mach/platform.h>
27
28void (*realview_reset)(char mode);
29
30static inline void arch_idle(void) 24static inline void arch_idle(void)
31{ 25{
32 /* 26 /*
@@ -36,15 +30,4 @@ static inline void arch_idle(void)
36 cpu_do_idle(); 30 cpu_do_idle();
37} 31}
38 32
39static inline void arch_reset(char mode, const char *cmd)
40{
41 /*
42 * To reset, we hit the on-board reset register
43 * in the system FPGA
44 */
45 if (realview_reset)
46 realview_reset(mode);
47 dsb();
48}
49
50#endif 33#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
index a2a4c6861407..000000000000
--- a/arch/arm/mach-realview/include/mach/vmalloc.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-realview/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 * Copyright (C) 2000 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define VMALLOC_END 0xf8000000UL
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 026c66ad7ec2..0069561464f9 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
@@ -91,8 +91,8 @@ static struct map_desc realview_eb_io_desc[] __initdata = {
91 91
92static struct map_desc realview_eb11mp_io_desc[] __initdata = { 92static struct map_desc realview_eb11mp_io_desc[] __initdata = {
93 { 93 {
94 .virtual = IO_ADDRESS(REALVIEW_EB11MP_GIC_CPU_BASE), 94 .virtual = IO_ADDRESS(REALVIEW_EB11MP_SCU_BASE),
95 .pfn = __phys_to_pfn(REALVIEW_EB11MP_GIC_CPU_BASE), 95 .pfn = __phys_to_pfn(REALVIEW_EB11MP_SCU_BASE),
96 .length = SZ_4K, 96 .length = SZ_4K,
97 .type = MT_DEVICE, 97 .type = MT_DEVICE,
98 }, { 98 }, {
@@ -415,7 +415,7 @@ static struct sys_timer realview_eb_timer = {
415 .init = realview_eb_timer_init, 415 .init = realview_eb_timer_init,
416}; 416};
417 417
418static void realview_eb_reset(char mode) 418static void realview_eb_restart(char mode, const char *cmd)
419{ 419{
420 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 420 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
421 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); 421 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -427,6 +427,7 @@ static void realview_eb_reset(char mode)
427 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); 427 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
428 if (core_tile_eb11mp()) 428 if (core_tile_eb11mp())
429 __raw_writel(0x0008, reset_ctrl); 429 __raw_writel(0x0008, reset_ctrl);
430 dsb();
430} 431}
431 432
432static void __init realview_eb_init(void) 433static void __init realview_eb_init(void)
@@ -458,7 +459,6 @@ static void __init realview_eb_init(void)
458#ifdef CONFIG_LEDS 459#ifdef CONFIG_LEDS
459 leds_event = realview_leds_event; 460 leds_event = realview_leds_event;
460#endif 461#endif
461 realview_reset = realview_eb_reset;
462} 462}
463 463
464MACHINE_START(REALVIEW_EB, "ARM-RealView EB") 464MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
@@ -469,8 +469,10 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
469 .init_early = realview_init_early, 469 .init_early = realview_init_early,
470 .init_irq = gic_init_irq, 470 .init_irq = gic_init_irq,
471 .timer = &realview_eb_timer, 471 .timer = &realview_eb_timer,
472 .handle_irq = gic_handle_irq,
472 .init_machine = realview_eb_init, 473 .init_machine = realview_eb_init,
473#ifdef CONFIG_ZONE_DMA 474#ifdef CONFIG_ZONE_DMA
474 .dma_zone_size = SZ_256M, 475 .dma_zone_size = SZ_256M,
475#endif 476#endif
477 .restart = realview_eb_restart,
476MACHINE_END 478MACHINE_END
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index c057540ec776..8fe395568a47 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
@@ -336,12 +336,13 @@ static struct sys_timer realview_pb1176_timer = {
336 .init = realview_pb1176_timer_init, 336 .init = realview_pb1176_timer_init,
337}; 337};
338 338
339static void realview_pb1176_reset(char mode) 339static void realview_pb1176_restart(char mode, const char *cmd)
340{ 340{
341 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 341 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
342 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); 342 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
343 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); 343 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
344 __raw_writel(REALVIEW_PB1176_SYS_SOFT_RESET, reset_ctrl); 344 __raw_writel(REALVIEW_PB1176_SYS_SOFT_RESET, reset_ctrl);
345 dsb();
345} 346}
346 347
347static void realview_pb1176_fixup(struct tag *tags, char **from, 348static void realview_pb1176_fixup(struct tag *tags, char **from,
@@ -381,7 +382,6 @@ static void __init realview_pb1176_init(void)
381#ifdef CONFIG_LEDS 382#ifdef CONFIG_LEDS
382 leds_event = realview_leds_event; 383 leds_event = realview_leds_event;
383#endif 384#endif
384 realview_reset = realview_pb1176_reset;
385} 385}
386 386
387MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176") 387MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
@@ -392,8 +392,10 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
392 .init_early = realview_init_early, 392 .init_early = realview_init_early,
393 .init_irq = gic_init_irq, 393 .init_irq = gic_init_irq,
394 .timer = &realview_pb1176_timer, 394 .timer = &realview_pb1176_timer,
395 .handle_irq = gic_handle_irq,
395 .init_machine = realview_pb1176_init, 396 .init_machine = realview_pb1176_init,
396#ifdef CONFIG_ZONE_DMA 397#ifdef CONFIG_ZONE_DMA
397 .dma_zone_size = SZ_256M, 398 .dma_zone_size = SZ_256M,
398#endif 399#endif
400 .restart = realview_pb1176_restart,
399MACHINE_END 401MACHINE_END
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 671ad6d6ff00..34a26011bb89 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
@@ -315,7 +315,7 @@ static struct sys_timer realview_pb11mp_timer = {
315 .init = realview_pb11mp_timer_init, 315 .init = realview_pb11mp_timer_init,
316}; 316};
317 317
318static void realview_pb11mp_reset(char mode) 318static void realview_pb11mp_restart(char mode, const char *cmd)
319{ 319{
320 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 320 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
321 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); 321 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -327,6 +327,7 @@ static void realview_pb11mp_reset(char mode)
327 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); 327 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
328 __raw_writel(0x0000, reset_ctrl); 328 __raw_writel(0x0000, reset_ctrl);
329 __raw_writel(0x0004, reset_ctrl); 329 __raw_writel(0x0004, reset_ctrl);
330 dsb();
330} 331}
331 332
332static void __init realview_pb11mp_init(void) 333static void __init realview_pb11mp_init(void)
@@ -355,7 +356,6 @@ static void __init realview_pb11mp_init(void)
355#ifdef CONFIG_LEDS 356#ifdef CONFIG_LEDS
356 leds_event = realview_leds_event; 357 leds_event = realview_leds_event;
357#endif 358#endif
358 realview_reset = realview_pb11mp_reset;
359} 359}
360 360
361MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") 361MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
@@ -366,8 +366,10 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
366 .init_early = realview_init_early, 366 .init_early = realview_init_early,
367 .init_irq = gic_init_irq, 367 .init_irq = gic_init_irq,
368 .timer = &realview_pb11mp_timer, 368 .timer = &realview_pb11mp_timer,
369 .handle_irq = gic_handle_irq,
369 .init_machine = realview_pb11mp_init, 370 .init_machine = realview_pb11mp_init,
370#ifdef CONFIG_ZONE_DMA 371#ifdef CONFIG_ZONE_DMA
371 .dma_zone_size = SZ_256M, 372 .dma_zone_size = SZ_256M,
372#endif 373#endif
374 .restart = realview_pb11mp_restart,
373MACHINE_END 375MACHINE_END
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index cbf22df4ad5b..d26a6def1d65 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
@@ -271,7 +271,7 @@ static struct sys_timer realview_pba8_timer = {
271 .init = realview_pba8_timer_init, 271 .init = realview_pba8_timer_init,
272}; 272};
273 273
274static void realview_pba8_reset(char mode) 274static void realview_pba8_restart(char mode, const char *cmd)
275{ 275{
276 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 276 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
277 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); 277 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -283,6 +283,7 @@ static void realview_pba8_reset(char mode)
283 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); 283 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
284 __raw_writel(0x0000, reset_ctrl); 284 __raw_writel(0x0000, reset_ctrl);
285 __raw_writel(0x0004, reset_ctrl); 285 __raw_writel(0x0004, reset_ctrl);
286 dsb();
286} 287}
287 288
288static void __init realview_pba8_init(void) 289static void __init realview_pba8_init(void)
@@ -305,7 +306,6 @@ static void __init realview_pba8_init(void)
305#ifdef CONFIG_LEDS 306#ifdef CONFIG_LEDS
306 leds_event = realview_leds_event; 307 leds_event = realview_leds_event;
307#endif 308#endif
308 realview_reset = realview_pba8_reset;
309} 309}
310 310
311MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") 311MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
@@ -316,8 +316,10 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
316 .init_early = realview_init_early, 316 .init_early = realview_init_early,
317 .init_irq = gic_init_irq, 317 .init_irq = gic_init_irq,
318 .timer = &realview_pba8_timer, 318 .timer = &realview_pba8_timer,
319 .handle_irq = gic_handle_irq,
319 .init_machine = realview_pba8_init, 320 .init_machine = realview_pba8_init,
320#ifdef CONFIG_ZONE_DMA 321#ifdef CONFIG_ZONE_DMA
321 .dma_zone_size = SZ_256M, 322 .dma_zone_size = SZ_256M,
322#endif 323#endif
324 .restart = realview_pba8_restart,
323MACHINE_END 325MACHINE_END
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 63c4114afae9..a250fb4124bf 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -20,7 +20,7 @@
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/sysdev.h> 23#include <linux/device.h>
24#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
25#include <linux/amba/pl061.h> 25#include <linux/amba/pl061.h>
26#include <linux/amba/mmci.h> 26#include <linux/amba/mmci.h>
@@ -98,8 +98,8 @@ static struct map_desc realview_pbx_io_desc[] __initdata = {
98 98
99static struct map_desc realview_local_io_desc[] __initdata = { 99static struct map_desc realview_local_io_desc[] __initdata = {
100 { 100 {
101 .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_GIC_CPU_BASE), 101 .virtual = IO_ADDRESS(REALVIEW_PBX_TILE_SCU_BASE),
102 .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_GIC_CPU_BASE), 102 .pfn = __phys_to_pfn(REALVIEW_PBX_TILE_SCU_BASE),
103 .length = SZ_4K, 103 .length = SZ_4K,
104 .type = MT_DEVICE, 104 .type = MT_DEVICE,
105 }, { 105 }, {
@@ -339,7 +339,7 @@ static void realview_pbx_fixup(struct tag *tags, char **from,
339#endif 339#endif
340} 340}
341 341
342static void realview_pbx_reset(char mode) 342static void realview_pbx_restart(char mode, const char *cmd)
343{ 343{
344 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); 344 void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
345 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); 345 void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
@@ -351,6 +351,7 @@ static void realview_pbx_reset(char mode)
351 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); 351 __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
352 __raw_writel(0x00F0, reset_ctrl); 352 __raw_writel(0x00F0, reset_ctrl);
353 __raw_writel(0x00F4, reset_ctrl); 353 __raw_writel(0x00F4, reset_ctrl);
354 dsb();
354} 355}
355 356
356static void __init realview_pbx_init(void) 357static void __init realview_pbx_init(void)
@@ -388,7 +389,6 @@ static void __init realview_pbx_init(void)
388#ifdef CONFIG_LEDS 389#ifdef CONFIG_LEDS
389 leds_event = realview_leds_event; 390 leds_event = realview_leds_event;
390#endif 391#endif
391 realview_reset = realview_pbx_reset;
392} 392}
393 393
394MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") 394MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
@@ -399,8 +399,10 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
399 .init_early = realview_init_early, 399 .init_early = realview_init_early,
400 .init_irq = gic_init_irq, 400 .init_irq = gic_init_irq,
401 .timer = &realview_pbx_timer, 401 .timer = &realview_pbx_timer,
402 .handle_irq = gic_handle_irq,
402 .init_machine = realview_pbx_init, 403 .init_machine = realview_pbx_init,
403#ifdef CONFIG_ZONE_DMA 404#ifdef CONFIG_ZONE_DMA
404 .dma_zone_size = SZ_256M, 405 .dma_zone_size = SZ_256M,
405#endif 406#endif
407 .restart = realview_pbx_restart,
406MACHINE_END 408MACHINE_END
diff --git a/arch/arm/mach-rpc/include/mach/system.h b/arch/arm/mach-rpc/include/mach/system.h
index 45c7b935dc45..359bab94b6af 100644
--- a/arch/arm/mach-rpc/include/mach/system.h
+++ b/arch/arm/mach-rpc/include/mach/system.h
@@ -7,21 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/io.h>
11#include <mach/hardware.h>
12#include <asm/hardware/iomd.h>
13
14static inline void arch_idle(void) 10static inline void arch_idle(void)
15{ 11{
16 cpu_do_idle(); 12 cpu_do_idle();
17} 13}
18
19static inline void arch_reset(char mode, const char *cmd)
20{
21 iomd_writeb(0, IOMD_ROMCR0);
22
23 /*
24 * Jump into the ROM
25 */
26 cpu_reset(0);
27}
diff --git a/arch/arm/mach-rpc/include/mach/vmalloc.h b/arch/arm/mach-rpc/include/mach/vmalloc.h
deleted file mode 100644
index fb700228637a..000000000000
--- a/arch/arm/mach-rpc/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * arch/arm/mach-rpc/include/mach/vmalloc.h
3 *
4 * Copyright (C) 1997 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#define VMALLOC_END 0xdc000000UL
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 8559598ab767..3d44a59fc0df 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -24,6 +24,7 @@
24#include <asm/elf.h> 24#include <asm/elf.h>
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <asm/hardware/iomd.h>
27#include <asm/page.h> 28#include <asm/page.h>
28#include <asm/domain.h> 29#include <asm/domain.h>
29#include <asm/setup.h> 30#include <asm/setup.h>
@@ -214,6 +215,16 @@ static int __init rpc_init(void)
214 215
215arch_initcall(rpc_init); 216arch_initcall(rpc_init);
216 217
218static void rpc_restart(char mode, const char *cmd)
219{
220 iomd_writeb(0, IOMD_ROMCR0);
221
222 /*
223 * Jump into the ROM
224 */
225 soft_restart(0);
226}
227
217extern struct sys_timer ioc_timer; 228extern struct sys_timer ioc_timer;
218 229
219MACHINE_START(RISCPC, "Acorn-RiscPC") 230MACHINE_START(RISCPC, "Acorn-RiscPC")
@@ -224,4 +235,5 @@ MACHINE_START(RISCPC, "Acorn-RiscPC")
224 .map_io = rpc_map_io, 235 .map_io = rpc_map_io,
225 .init_irq = rpc_init_irq, 236 .init_irq = rpc_init_irq,
226 .timer = &ioc_timer, 237 .timer = &ioc_timer,
238 .restart = rpc_restart,
227MACHINE_END 239MACHINE_END
diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c2410/bast-irq.c
index bc53d2d16d1a..ac7b2ad5c405 100644
--- a/arch/arm/mach-s3c2410/bast-irq.c
+++ b/arch/arm/mach-s3c2410/bast-irq.c
@@ -24,7 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/io.h> 28#include <linux/io.h>
29 29
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
diff --git a/arch/arm/mach-s3c2410/common.h b/arch/arm/mach-s3c2410/common.h
new file mode 100644
index 000000000000..f65dc8062961
--- /dev/null
+++ b/arch/arm/mach-s3c2410/common.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Header for S3C2410 machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ARCH_ARM_MACH_S3C2410_COMMON_H
13#define __ARCH_ARM_MACH_S3C2410_COMMON_H
14
15void s3c2410_restart(char mode, const char *cmd);
16
17#endif /* __ARCH_ARM_MACH_S3C2410_COMMON_H */
diff --git a/arch/arm/mach-s3c2410/cpu-freq.c b/arch/arm/mach-s3c2410/cpu-freq.c
index 75189df995ae..7dc6c46b5e2b 100644
--- a/arch/arm/mach-s3c2410/cpu-freq.c
+++ b/arch/arm/mach-s3c2410/cpu-freq.c
@@ -16,7 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/io.h> 22#include <linux/io.h>
@@ -115,24 +115,25 @@ static struct s3c_cpufreq_info s3c2410_cpufreq_info = {
115 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs), 115 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
116}; 116};
117 117
118static int s3c2410_cpufreq_add(struct sys_device *sysdev) 118static int s3c2410_cpufreq_add(struct device *dev)
119{ 119{
120 return s3c_cpufreq_register(&s3c2410_cpufreq_info); 120 return s3c_cpufreq_register(&s3c2410_cpufreq_info);
121} 121}
122 122
123static struct sysdev_driver s3c2410_cpufreq_driver = { 123static struct subsys_interface s3c2410_cpufreq_interface = {
124 .add = s3c2410_cpufreq_add, 124 .name = "s3c2410_cpufreq",
125 .subsys = &s3c2410_subsys,
126 .add_dev = s3c2410_cpufreq_add,
125}; 127};
126 128
127static int __init s3c2410_cpufreq_init(void) 129static int __init s3c2410_cpufreq_init(void)
128{ 130{
129 return sysdev_driver_register(&s3c2410_sysclass, 131 return subsys_interface_register(&s3c2410_cpufreq_interface);
130 &s3c2410_cpufreq_driver);
131} 132}
132 133
133arch_initcall(s3c2410_cpufreq_init); 134arch_initcall(s3c2410_cpufreq_init);
134 135
135static int s3c2410a_cpufreq_add(struct sys_device *sysdev) 136static int s3c2410a_cpufreq_add(struct device *dev)
136{ 137{
137 /* alter the maximum freq settings for S3C2410A. If a board knows 138 /* alter the maximum freq settings for S3C2410A. If a board knows
138 * it only has a maximum of 200, then it should register its own 139 * it only has a maximum of 200, then it should register its own
@@ -143,17 +144,18 @@ static int s3c2410a_cpufreq_add(struct sys_device *sysdev)
143 s3c2410_cpufreq_info.max.pclk = 66500000; 144 s3c2410_cpufreq_info.max.pclk = 66500000;
144 s3c2410_cpufreq_info.name = "s3c2410a"; 145 s3c2410_cpufreq_info.name = "s3c2410a";
145 146
146 return s3c2410_cpufreq_add(sysdev); 147 return s3c2410_cpufreq_add(dev);
147} 148}
148 149
149static struct sysdev_driver s3c2410a_cpufreq_driver = { 150static struct subsys_interface s3c2410a_cpufreq_interface = {
150 .add = s3c2410a_cpufreq_add, 151 .name = "s3c2410a_cpufreq",
152 .subsys = &s3c2410a_subsys,
153 .add_dev = s3c2410a_cpufreq_add,
151}; 154};
152 155
153static int __init s3c2410a_cpufreq_init(void) 156static int __init s3c2410a_cpufreq_init(void)
154{ 157{
155 return sysdev_driver_register(&s3c2410a_sysclass, 158 return subsys_interface_register(&s3c2410a_cpufreq_interface);
156 &s3c2410a_cpufreq_driver);
157} 159}
158 160
159arch_initcall(s3c2410a_cpufreq_init); 161arch_initcall(s3c2410a_cpufreq_init);
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index dbe43df8cfec..2afd00014a77 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19 19
20#include <mach/map.h> 20#include <mach/map.h>
@@ -132,7 +132,7 @@ static struct s3c24xx_dma_order __initdata s3c2410_dma_order = {
132 }, 132 },
133}; 133};
134 134
135static int __init s3c2410_dma_add(struct sys_device *sysdev) 135static int __init s3c2410_dma_add(struct device *dev)
136{ 136{
137 s3c2410_dma_init(); 137 s3c2410_dma_init();
138 s3c24xx_dma_order_set(&s3c2410_dma_order); 138 s3c24xx_dma_order_set(&s3c2410_dma_order);
@@ -140,24 +140,28 @@ static int __init s3c2410_dma_add(struct sys_device *sysdev)
140} 140}
141 141
142#if defined(CONFIG_CPU_S3C2410) 142#if defined(CONFIG_CPU_S3C2410)
143static struct sysdev_driver s3c2410_dma_driver = { 143static struct subsys_interface s3c2410_dma_interface = {
144 .add = s3c2410_dma_add, 144 .name = "s3c2410_dma",
145 .subsys = &s3c2410_subsys,
146 .add_dev = s3c2410_dma_add,
145}; 147};
146 148
147static int __init s3c2410_dma_drvinit(void) 149static int __init s3c2410_dma_drvinit(void)
148{ 150{
149 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_dma_driver); 151 return subsys_interface_register(&s3c2410_interface);
150} 152}
151 153
152arch_initcall(s3c2410_dma_drvinit); 154arch_initcall(s3c2410_dma_drvinit);
153 155
154static struct sysdev_driver s3c2410a_dma_driver = { 156static struct subsys_interface s3c2410a_dma_interface = {
155 .add = s3c2410_dma_add, 157 .name = "s3c2410a_dma",
158 .subsys = &s3c2410a_subsys,
159 .add_dev = s3c2410_dma_add,
156}; 160};
157 161
158static int __init s3c2410a_dma_drvinit(void) 162static int __init s3c2410a_dma_drvinit(void)
159{ 163{
160 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_dma_driver); 164 return subsys_interface_register(&s3c2410a_dma_interface);
161} 165}
162 166
163arch_initcall(s3c2410a_dma_drvinit); 167arch_initcall(s3c2410a_dma_drvinit);
@@ -165,13 +169,15 @@ arch_initcall(s3c2410a_dma_drvinit);
165 169
166#if defined(CONFIG_CPU_S3C2442) 170#if defined(CONFIG_CPU_S3C2442)
167/* S3C2442 DMA contains the same selection table as the S3C2410 */ 171/* S3C2442 DMA contains the same selection table as the S3C2410 */
168static struct sysdev_driver s3c2442_dma_driver = { 172static struct subsys_interface s3c2442_dma_interface = {
169 .add = s3c2410_dma_add, 173 .name = "s3c2442_dma",
174 .subsys = &s3c2442_subsys,
175 .add_dev = s3c2410_dma_add,
170}; 176};
171 177
172static int __init s3c2442_dma_drvinit(void) 178static int __init s3c2442_dma_drvinit(void)
173{ 179{
174 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_dma_driver); 180 return subsys_interface_register(&s3c2442_dma_interface);
175} 181}
176 182
177arch_initcall(s3c2442_dma_drvinit); 183arch_initcall(s3c2442_dma_drvinit);
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h
index ae8e482b6427..acbdfecd4186 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c2410/include/mach/dma.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_DMA_H 13#ifndef __ASM_ARCH_DMA_H
14#define __ASM_ARCH_DMA_H __FILE__ 14#define __ASM_ARCH_DMA_H __FILE__
15 15
16#include <linux/sysdev.h> 16#include <linux/device.h>
17 17
18#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ 18#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */
19 19
@@ -202,7 +202,7 @@ struct s3c2410_dma_chan {
202 struct s3c2410_dma_buf *end; /* end of queue */ 202 struct s3c2410_dma_buf *end; /* end of queue */
203 203
204 /* system device */ 204 /* system device */
205 struct sys_device dev; 205 struct device dev;
206}; 206};
207 207
208typedef unsigned long dma_device_t; 208typedef unsigned long dma_device_t;
diff --git a/arch/arm/mach-s3c2410/include/mach/reset.h b/arch/arm/mach-s3c2410/include/mach/reset.h
deleted file mode 100644
index f8c9387b049d..000000000000
--- a/arch/arm/mach-s3c2410/include/mach/reset.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/reset.h
2 *
3 * Copyright (c) 2007 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * S3C2410 CPU reset controls
12*/
13
14#ifndef __ASM_ARCH_RESET_H
15#define __ASM_ARCH_RESET_H __FILE__
16
17/* This allows the over-ride of the default reset code
18*/
19
20extern void (*s3c24xx_reset_hook)(void);
21
22#endif /* __ASM_ARCH_RESET_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h b/arch/arm/mach-s3c2410/include/mach/system-reset.h
deleted file mode 100644
index 6faadcee7729..000000000000
--- a/arch/arm/mach-s3c2410/include/mach/system-reset.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/system-reset.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - System define for arch_reset() function
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <mach/hardware.h>
14#include <plat/watchdog-reset.h>
15
16extern void (*s3c24xx_reset_hook)(void);
17
18static void
19arch_reset(char mode, const char *cmd)
20{
21 if (mode == 's') {
22 cpu_reset(0);
23 }
24
25 if (s3c24xx_reset_hook)
26 s3c24xx_reset_hook();
27
28 arch_wdt_reset();
29
30 /* we'll take a jump through zero as a poor second */
31 cpu_reset(0);
32}
diff --git a/arch/arm/mach-s3c2410/include/mach/system.h b/arch/arm/mach-s3c2410/include/mach/system.h
index a8cbca6701e5..5e215c1a5c8f 100644
--- a/arch/arm/mach-s3c2410/include/mach/system.h
+++ b/arch/arm/mach-s3c2410/include/mach/system.h
@@ -15,12 +15,10 @@
15 15
16#include <mach/map.h> 16#include <mach/map.h>
17#include <mach/idle.h> 17#include <mach/idle.h>
18#include <mach/reset.h>
19 18
20#include <mach/regs-clock.h> 19#include <mach/regs-clock.h>
21 20
22void (*s3c24xx_idle)(void); 21void (*s3c24xx_idle)(void);
23void (*s3c24xx_reset_hook)(void);
24 22
25void s3c24xx_default_idle(void) 23void s3c24xx_default_idle(void)
26{ 24{
@@ -54,5 +52,3 @@ static void arch_idle(void)
54 else 52 else
55 s3c24xx_default_idle(); 53 s3c24xx_default_idle();
56} 54}
57
58#include <mach/system-reset.h>
diff --git a/arch/arm/mach-s3c2410/include/mach/vmalloc.h b/arch/arm/mach-s3c2410/include/mach/vmalloc.h
deleted file mode 100644
index 7a311e8dddba..000000000000
--- a/arch/arm/mach-s3c2410/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/vmalloc.h
2 *
3 * from arch/arm/mach-iop3xx/include/mach/vmalloc.h
4 *
5 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
6 * http://www.simtec.co.uk/products/SWLINUX/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * S3C2410 vmalloc definition
13*/
14
15#ifndef __ASM_ARCH_VMALLOC_H
16#define __ASM_ARCH_VMALLOC_H
17
18#define VMALLOC_END 0xF6000000UL
19
20#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index 79838942b0ac..4220cc60de3c 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -63,6 +63,8 @@
63#include <linux/mtd/map.h> 63#include <linux/mtd/map.h>
64#include <linux/mtd/physmap.h> 64#include <linux/mtd/physmap.h>
65 65
66#include "common.h"
67
66static struct resource amlm5900_nor_resource = { 68static struct resource amlm5900_nor_resource = {
67 .start = 0x00000000, 69 .start = 0x00000000,
68 .end = 0x01000000 - 1, 70 .end = 0x01000000 - 1,
@@ -241,4 +243,5 @@ MACHINE_START(AML_M5900, "AML_M5900")
241 .init_irq = s3c24xx_init_irq, 243 .init_irq = s3c24xx_init_irq,
242 .init_machine = amlm5900_init, 244 .init_machine = amlm5900_init,
243 .timer = &s3c24xx_timer, 245 .timer = &s3c24xx_timer,
246 .restart = s3c2410_restart,
244MACHINE_END 247MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index a20ae1ad4062..c6133c6ec18f 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -66,6 +66,7 @@
66 66
67#include "usb-simtec.h" 67#include "usb-simtec.h"
68#include "nor-simtec.h" 68#include "nor-simtec.h"
69#include "common.h"
69 70
70#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics" 71#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
71 72
@@ -662,4 +663,5 @@ MACHINE_START(BAST, "Simtec-BAST")
662 .init_irq = s3c24xx_init_irq, 663 .init_irq = s3c24xx_init_irq,
663 .init_machine = bast_init, 664 .init_machine = bast_init,
664 .timer = &s3c24xx_timer, 665 .timer = &s3c24xx_timer,
666 .restart = s3c2410_restart,
665MACHINE_END 667MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 05a7d16e59f5..41245a603981 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -18,7 +18,7 @@
18#include <linux/memblock.h> 18#include <linux/memblock.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
@@ -70,6 +70,8 @@
70 70
71#include <sound/uda1380.h> 71#include <sound/uda1380.h>
72 72
73#include "common.h"
74
73#define H1940_LATCH ((void __force __iomem *)0xF8000000) 75#define H1940_LATCH ((void __force __iomem *)0xF8000000)
74 76
75#define H1940_PA_LATCH S3C2410_CS2 77#define H1940_PA_LATCH S3C2410_CS2
@@ -751,4 +753,5 @@ MACHINE_START(H1940, "IPAQ-H1940")
751 .init_irq = h1940_init_irq, 753 .init_irq = h1940_init_irq,
752 .init_machine = h1940_init, 754 .init_machine = h1940_init,
753 .timer = &s3c24xx_timer, 755 .timer = &s3c24xx_timer,
756 .restart = s3c2410_restart,
754MACHINE_END 757MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 1dc3e3234417..383d00ca8f60 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -51,6 +51,8 @@
51#include <plat/s3c2410.h> 51#include <plat/s3c2410.h>
52#include <plat/udc.h> 52#include <plat/udc.h>
53 53
54#include "common.h"
55
54static struct map_desc n30_iodesc[] __initdata = { 56static struct map_desc n30_iodesc[] __initdata = {
55 /* nothing here yet */ 57 /* nothing here yet */
56}; 58};
@@ -591,6 +593,7 @@ MACHINE_START(N30, "Acer-N30")
591 .init_machine = n30_init, 593 .init_machine = n30_init,
592 .init_irq = s3c24xx_init_irq, 594 .init_irq = s3c24xx_init_irq,
593 .map_io = n30_map_io, 595 .map_io = n30_map_io,
596 .restart = s3c2410_restart,
594MACHINE_END 597MACHINE_END
595 598
596MACHINE_START(N35, "Acer-N35") 599MACHINE_START(N35, "Acer-N35")
@@ -601,4 +604,5 @@ MACHINE_START(N35, "Acer-N35")
601 .init_machine = n30_init, 604 .init_machine = n30_init,
602 .init_irq = s3c24xx_init_irq, 605 .init_irq = s3c24xx_init_irq,
603 .map_io = n30_map_io, 606 .map_io = n30_map_io,
607 .restart = s3c2410_restart,
604MACHINE_END 608MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index f03f3fd9cec9..5f1e0eeb38a9 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -38,6 +38,8 @@
38#include <plat/iic.h> 38#include <plat/iic.h>
39#include <plat/cpu.h> 39#include <plat/cpu.h>
40 40
41#include "common.h"
42
41static struct map_desc otom11_iodesc[] __initdata = { 43static struct map_desc otom11_iodesc[] __initdata = {
42 /* Device area */ 44 /* Device area */
43 { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE }, 45 { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
@@ -121,4 +123,5 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
121 .init_machine = otom11_init, 123 .init_machine = otom11_init,
122 .init_irq = s3c24xx_init_irq, 124 .init_irq = s3c24xx_init_irq,
123 .timer = &s3c24xx_timer, 125 .timer = &s3c24xx_timer,
126 .restart = s3c2410_restart,
124MACHINE_END 127MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 451852156254..91c16d9d2459 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -28,7 +28,7 @@
28#include <linux/timer.h> 28#include <linux/timer.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/sysdev.h> 31#include <linux/device.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
@@ -62,6 +62,8 @@
62#include <plat/cpu.h> 62#include <plat/cpu.h>
63#include <plat/pm.h> 63#include <plat/pm.h>
64 64
65#include "common.h"
66
65static struct map_desc qt2410_iodesc[] __initdata = { 67static struct map_desc qt2410_iodesc[] __initdata = {
66 { 0xe0000000, __phys_to_pfn(S3C2410_CS3+0x01000000), SZ_1M, MT_DEVICE } 68 { 0xe0000000, __phys_to_pfn(S3C2410_CS3+0x01000000), SZ_1M, MT_DEVICE }
67}; 69};
@@ -350,6 +352,5 @@ MACHINE_START(QT2410, "QT2410")
350 .init_irq = s3c24xx_init_irq, 352 .init_irq = s3c24xx_init_irq,
351 .init_machine = qt2410_machine_init, 353 .init_machine = qt2410_machine_init,
352 .timer = &s3c24xx_timer, 354 .timer = &s3c24xx_timer,
355 .restart = s3c2410_restart,
353MACHINE_END 356MACHINE_END
354
355
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index 99c9dfdb71c7..bdc27e772876 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -54,6 +54,8 @@
54 54
55#include <plat/common-smdk.h> 55#include <plat/common-smdk.h>
56 56
57#include "common.h"
58
57static struct map_desc smdk2410_iodesc[] __initdata = { 59static struct map_desc smdk2410_iodesc[] __initdata = {
58 /* nothing here yet */ 60 /* nothing here yet */
59}; 61};
@@ -116,6 +118,5 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc
116 .init_irq = s3c24xx_init_irq, 118 .init_irq = s3c24xx_init_irq,
117 .init_machine = smdk2410_init, 119 .init_machine = smdk2410_init,
118 .timer = &s3c24xx_timer, 120 .timer = &s3c24xx_timer,
121 .restart = s3c2410_restart,
119MACHINE_END 122MACHINE_END
120
121
diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c b/arch/arm/mach-s3c2410/mach-tct_hammer.c
index e0d0b6fb2800..1114666f0efb 100644
--- a/arch/arm/mach-s3c2410/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c2410/mach-tct_hammer.c
@@ -54,6 +54,8 @@
54#include <linux/mtd/map.h> 54#include <linux/mtd/map.h>
55#include <linux/mtd/physmap.h> 55#include <linux/mtd/physmap.h>
56 56
57#include "common.h"
58
57static struct resource tct_hammer_nor_resource = { 59static struct resource tct_hammer_nor_resource = {
58 .start = 0x00000000, 60 .start = 0x00000000,
59 .end = 0x01000000 - 1, 61 .end = 0x01000000 - 1,
@@ -151,4 +153,5 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
151 .init_irq = s3c24xx_init_irq, 153 .init_irq = s3c24xx_init_irq,
152 .init_machine = tct_hammer_init, 154 .init_machine = tct_hammer_init,
153 .timer = &s3c24xx_timer, 155 .timer = &s3c24xx_timer,
156 .restart = s3c2410_restart,
154MACHINE_END 157MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index df47e8e90065..cc7032b5c65b 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -53,6 +53,7 @@
53 53
54#include "usb-simtec.h" 54#include "usb-simtec.h"
55#include "nor-simtec.h" 55#include "nor-simtec.h"
56#include "common.h"
56 57
57/* macros for virtual address mods for the io space entries */ 58/* macros for virtual address mods for the io space entries */
58#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5) 59#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
@@ -405,4 +406,5 @@ MACHINE_START(VR1000, "Thorcom-VR1000")
405 .init_machine = vr1000_init, 406 .init_machine = vr1000_init,
406 .init_irq = s3c24xx_init_irq, 407 .init_irq = s3c24xx_init_irq,
407 .timer = &s3c24xx_timer, 408 .timer = &s3c24xx_timer,
409 .restart = s3c2410_restart,
408MACHINE_END 410MACHINE_END
diff --git a/arch/arm/mach-s3c2410/pll.c b/arch/arm/mach-s3c2410/pll.c
index 8338865e11c0..c07438bfc99f 100644
--- a/arch/arm/mach-s3c2410/pll.c
+++ b/arch/arm/mach-s3c2410/pll.c
@@ -25,7 +25,7 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/sysdev.h> 28#include <linux/device.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/err.h> 31#include <linux/err.h>
@@ -66,30 +66,34 @@ static struct cpufreq_frequency_table pll_vals_12MHz[] = {
66 { .frequency = 270000000, .index = PLLVAL(127, 1, 1), }, 66 { .frequency = 270000000, .index = PLLVAL(127, 1, 1), },
67}; 67};
68 68
69static int s3c2410_plls_add(struct sys_device *dev) 69static int s3c2410_plls_add(struct device *dev)
70{ 70{
71 return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz)); 71 return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz));
72} 72}
73 73
74static struct sysdev_driver s3c2410_plls_drv = { 74static struct subsys_interface s3c2410_plls_interface = {
75 .add = s3c2410_plls_add, 75 .name = "s3c2410_plls",
76 .subsys = &s3c2410_subsys,
77 .add_dev = s3c2410_plls_add,
76}; 78};
77 79
78static int __init s3c2410_pll_init(void) 80static int __init s3c2410_pll_init(void)
79{ 81{
80 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_plls_drv); 82 return subsys_interface_register(&s3c2410_plls_interface);
81 83
82} 84}
83 85
84arch_initcall(s3c2410_pll_init); 86arch_initcall(s3c2410_pll_init);
85 87
86static struct sysdev_driver s3c2410a_plls_drv = { 88static struct subsys_interface s3c2410a_plls_interface = {
87 .add = s3c2410_plls_add, 89 .name = "s3c2410a_plls",
90 .subsys = &s3c2410a_subsys,
91 .add_dev = s3c2410_plls_add,
88}; 92};
89 93
90static int __init s3c2410a_pll_init(void) 94static int __init s3c2410a_pll_init(void)
91{ 95{
92 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_plls_drv); 96 return subsys_interface_register(&s3c2410a_plls_interface);
93} 97}
94 98
95arch_initcall(s3c2410a_pll_init); 99arch_initcall(s3c2410a_pll_init);
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
index 4728f9aa7df1..fda5385deff6 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -24,7 +24,7 @@
24#include <linux/suspend.h> 24#include <linux/suspend.h>
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/syscore_ops.h> 28#include <linux/syscore_ops.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/io.h> 30#include <linux/io.h>
@@ -111,7 +111,7 @@ struct syscore_ops s3c2410_pm_syscore_ops = {
111 .resume = s3c2410_pm_resume, 111 .resume = s3c2410_pm_resume,
112}; 112};
113 113
114static int s3c2410_pm_add(struct sys_device *dev) 114static int s3c2410_pm_add(struct device *dev)
115{ 115{
116 pm_cpu_prep = s3c2410_pm_prepare; 116 pm_cpu_prep = s3c2410_pm_prepare;
117 pm_cpu_sleep = s3c2410_cpu_suspend; 117 pm_cpu_sleep = s3c2410_cpu_suspend;
@@ -120,52 +120,60 @@ static int s3c2410_pm_add(struct sys_device *dev)
120} 120}
121 121
122#if defined(CONFIG_CPU_S3C2410) 122#if defined(CONFIG_CPU_S3C2410)
123static struct sysdev_driver s3c2410_pm_driver = { 123static struct subsys_interface s3c2410_pm_interface = {
124 .add = s3c2410_pm_add, 124 .name = "s3c2410_pm",
125 .subsys = &s3c2410_subsys,
126 .add_dev = s3c2410_pm_add,
125}; 127};
126 128
127/* register ourselves */ 129/* register ourselves */
128 130
129static int __init s3c2410_pm_drvinit(void) 131static int __init s3c2410_pm_drvinit(void)
130{ 132{
131 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_pm_driver); 133 return subsys_interface_register(&s3c2410_pm_interface);
132} 134}
133 135
134arch_initcall(s3c2410_pm_drvinit); 136arch_initcall(s3c2410_pm_drvinit);
135 137
136static struct sysdev_driver s3c2410a_pm_driver = { 138static struct subsys_interface s3c2410a_pm_interface = {
137 .add = s3c2410_pm_add, 139 .name = "s3c2410a_pm",
140 .subsys = &s3c2410a_subsys,
141 .add_dev = s3c2410_pm_add,
138}; 142};
139 143
140static int __init s3c2410a_pm_drvinit(void) 144static int __init s3c2410a_pm_drvinit(void)
141{ 145{
142 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_pm_driver); 146 return subsys_interface_register(&s3c2410a_pm_interface);
143} 147}
144 148
145arch_initcall(s3c2410a_pm_drvinit); 149arch_initcall(s3c2410a_pm_drvinit);
146#endif 150#endif
147 151
148#if defined(CONFIG_CPU_S3C2440) 152#if defined(CONFIG_CPU_S3C2440)
149static struct sysdev_driver s3c2440_pm_driver = { 153static struct subsys_interface s3c2440_pm_interface = {
150 .add = s3c2410_pm_add, 154 .name = "s3c2440_pm",
155 .subsys = &s3c2440_subsys,
156 .add_dev = s3c2410_pm_add,
151}; 157};
152 158
153static int __init s3c2440_pm_drvinit(void) 159static int __init s3c2440_pm_drvinit(void)
154{ 160{
155 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_pm_driver); 161 return subsys_interface_register(&s3c2440_pm_interface);
156} 162}
157 163
158arch_initcall(s3c2440_pm_drvinit); 164arch_initcall(s3c2440_pm_drvinit);
159#endif 165#endif
160 166
161#if defined(CONFIG_CPU_S3C2442) 167#if defined(CONFIG_CPU_S3C2442)
162static struct sysdev_driver s3c2442_pm_driver = { 168static struct subsys_interface s3c2442_pm_interface = {
163 .add = s3c2410_pm_add, 169 .name = "s3c2442_pm",
170 .subsys = &s3c2442_subsys,
171 .add_dev = s3c2410_pm_add,
164}; 172};
165 173
166static int __init s3c2442_pm_drvinit(void) 174static int __init s3c2442_pm_drvinit(void)
167{ 175{
168 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_pm_driver); 176 return subsys_interface_register(&s3c2442_pm_interface);
169} 177}
170 178
171arch_initcall(s3c2442_pm_drvinit); 179arch_initcall(s3c2442_pm_drvinit);
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index 3d7ebc557a72..eea559ec7a58 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
@@ -42,6 +42,7 @@
42#include <plat/clock.h> 42#include <plat/clock.h>
43#include <plat/pll.h> 43#include <plat/pll.h>
44#include <plat/pm.h> 44#include <plat/pm.h>
45#include <plat/watchdog-reset.h>
45 46
46#include <plat/gpio-core.h> 47#include <plat/gpio-core.h>
47#include <plat/gpio-cfg.h> 48#include <plat/gpio-cfg.h>
@@ -131,22 +132,24 @@ void __init s3c2410_init_clocks(int xtal)
131 s3c24xx_register_clock(&s3c2410_armclk); 132 s3c24xx_register_clock(&s3c2410_armclk);
132} 133}
133 134
134struct sysdev_class s3c2410_sysclass = { 135struct bus_type s3c2410_subsys = {
135 .name = "s3c2410-core", 136 .name = "s3c2410-core",
137 .dev_name = "s3c2410-core",
136}; 138};
137 139
138/* Note, we would have liked to name this s3c2410-core, but we cannot 140/* Note, we would have liked to name this s3c2410-core, but we cannot
139 * register two sysdev_class with the same name. 141 * register two subsystems with the same name.
140 */ 142 */
141struct sysdev_class s3c2410a_sysclass = { 143struct bus_type s3c2410a_subsys = {
142 .name = "s3c2410a-core", 144 .name = "s3c2410a-core",
145 .dev_name = "s3c2410a-core",
143}; 146};
144 147
145static struct sys_device s3c2410_sysdev = { 148static struct device s3c2410_dev = {
146 .cls = &s3c2410_sysclass, 149 .bus = &s3c2410_subsys,
147}; 150};
148 151
149/* need to register class before we actually register the device, and 152/* need to register the subsystem before we actually register the device, and
150 * we also need to ensure that it has been initialised before any of the 153 * we also need to ensure that it has been initialised before any of the
151 * drivers even try to use it (even if not on an s3c2410 based system) 154 * drivers even try to use it (even if not on an s3c2410 based system)
152 * as a driver which may support both 2410 and 2440 may try and use it. 155 * as a driver which may support both 2410 and 2440 may try and use it.
@@ -154,14 +157,14 @@ static struct sys_device s3c2410_sysdev = {
154 157
155static int __init s3c2410_core_init(void) 158static int __init s3c2410_core_init(void)
156{ 159{
157 return sysdev_class_register(&s3c2410_sysclass); 160 return subsys_system_register(&s3c2410_subsys, NULL);
158} 161}
159 162
160core_initcall(s3c2410_core_init); 163core_initcall(s3c2410_core_init);
161 164
162static int __init s3c2410a_core_init(void) 165static int __init s3c2410a_core_init(void)
163{ 166{
164 return sysdev_class_register(&s3c2410a_sysclass); 167 return subsys_system_register(&s3c2410a_subsys, NULL);
165} 168}
166 169
167core_initcall(s3c2410a_core_init); 170core_initcall(s3c2410a_core_init);
@@ -175,11 +178,23 @@ int __init s3c2410_init(void)
175#endif 178#endif
176 register_syscore_ops(&s3c24xx_irq_syscore_ops); 179 register_syscore_ops(&s3c24xx_irq_syscore_ops);
177 180
178 return sysdev_register(&s3c2410_sysdev); 181 return device_register(&s3c2410_dev);
179} 182}
180 183
181int __init s3c2410a_init(void) 184int __init s3c2410a_init(void)
182{ 185{
183 s3c2410_sysdev.cls = &s3c2410a_sysclass; 186 s3c2410_dev.bus = &s3c2410a_subsys;
184 return s3c2410_init(); 187 return s3c2410_init();
185} 188}
189
190void s3c2410_restart(char mode, const char *cmd)
191{
192 if (mode == 's') {
193 soft_restart(0);
194 }
195
196 arch_wdt_reset();
197
198 /* we'll take a jump through zero as a poor second */
199 soft_restart(0);
200}
diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c2412/clock.c
index 140711db6c89..516881640808 100644
--- a/arch/arm/mach-s3c2412/clock.c
+++ b/arch/arm/mach-s3c2412/clock.c
@@ -26,7 +26,7 @@
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/sysdev.h> 29#include <linux/device.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
diff --git a/arch/arm/mach-s3c2412/cpu-freq.c b/arch/arm/mach-s3c2412/cpu-freq.c
index eb3ea1721335..d8664b7652ce 100644
--- a/arch/arm/mach-s3c2412/cpu-freq.c
+++ b/arch/arm/mach-s3c2412/cpu-freq.c
@@ -16,7 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/err.h> 22#include <linux/err.h>
@@ -194,7 +194,7 @@ static struct s3c_cpufreq_info s3c2412_cpufreq_info = {
194 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs), 194 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs),
195}; 195};
196 196
197static int s3c2412_cpufreq_add(struct sys_device *sysdev) 197static int s3c2412_cpufreq_add(struct device *dev)
198{ 198{
199 unsigned long fclk_rate; 199 unsigned long fclk_rate;
200 200
@@ -244,14 +244,15 @@ err_fclk:
244 return -ENOENT; 244 return -ENOENT;
245} 245}
246 246
247static struct sysdev_driver s3c2412_cpufreq_driver = { 247static struct subsys_interface s3c2412_cpufreq_interface = {
248 .add = s3c2412_cpufreq_add, 248 .name = "s3c2412_cpufreq",
249 .subsys = &s3c2412_subsys,
250 .add_dev = s3c2412_cpufreq_add,
249}; 251};
250 252
251static int s3c2412_cpufreq_init(void) 253static int s3c2412_cpufreq_init(void)
252{ 254{
253 return sysdev_driver_register(&s3c2412_sysclass, 255 return subsys_interface_register(&s3c2412_cpufreq_interface);
254 &s3c2412_cpufreq_driver);
255} 256}
256 257
257arch_initcall(s3c2412_cpufreq_init); 258arch_initcall(s3c2412_cpufreq_init);
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
index d2a7d5ef3e67..142acd3b5e15 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c2412/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
@@ -159,19 +159,21 @@ static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
159 .map_size = ARRAY_SIZE(s3c2412_dma_mappings), 159 .map_size = ARRAY_SIZE(s3c2412_dma_mappings),
160}; 160};
161 161
162static int __init s3c2412_dma_add(struct sys_device *sysdev) 162static int __init s3c2412_dma_add(struct device *dev)
163{ 163{
164 s3c2410_dma_init(); 164 s3c2410_dma_init();
165 return s3c24xx_dma_init_map(&s3c2412_dma_sel); 165 return s3c24xx_dma_init_map(&s3c2412_dma_sel);
166} 166}
167 167
168static struct sysdev_driver s3c2412_dma_driver = { 168static struct subsys_interface s3c2412_dma_interface = {
169 .add = s3c2412_dma_add, 169 .name = "s3c2412_dma",
170 .subsys = &s3c2412_subsys,
171 .add_dev = s3c2412_dma_add,
170}; 172};
171 173
172static int __init s3c2412_dma_init(void) 174static int __init s3c2412_dma_init(void)
173{ 175{
174 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_dma_driver); 176 return subsys_interface_register(&s3c2412_dma_interface);
175} 177}
176 178
177arch_initcall(s3c2412_dma_init); 179arch_initcall(s3c2412_dma_init);
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c2412/irq.c
index 1a1aa220972b..a8a46c1644f4 100644
--- a/arch/arm/mach-s3c2412/irq.c
+++ b/arch/arm/mach-s3c2412/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -170,7 +170,7 @@ static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state)
170 170
171static struct irq_chip s3c2412_irq_rtc_chip; 171static struct irq_chip s3c2412_irq_rtc_chip;
172 172
173static int s3c2412_irq_add(struct sys_device *sysdev) 173static int s3c2412_irq_add(struct device *dev)
174{ 174{
175 unsigned int irqno; 175 unsigned int irqno;
176 176
@@ -200,13 +200,15 @@ static int s3c2412_irq_add(struct sys_device *sysdev)
200 return 0; 200 return 0;
201} 201}
202 202
203static struct sysdev_driver s3c2412_irq_driver = { 203static struct subsys_interface s3c2412_irq_interface = {
204 .add = s3c2412_irq_add, 204 .name = "s3c2412_irq",
205 .subsys = &s3c2412_subsys,
206 .add_dev = s3c2412_irq_add,
205}; 207};
206 208
207static int s3c2412_irq_init(void) 209static int s3c2412_irq_init(void)
208{ 210{
209 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_irq_driver); 211 return subsys_interface_register(&s3c2412_irq_interface);
210} 212}
211 213
212arch_initcall(s3c2412_irq_init); 214arch_initcall(s3c2412_irq_init);
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 286ef1738c61..ae73ba34ecc6 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -48,6 +48,7 @@
48#include <linux/mtd/nand_ecc.h> 48#include <linux/mtd/nand_ecc.h>
49#include <linux/mtd/partitions.h> 49#include <linux/mtd/partitions.h>
50 50
51#include <plat/s3c2412.h>
51#include <plat/gpio-cfg.h> 52#include <plat/gpio-cfg.h>
52#include <plat/clock.h> 53#include <plat/clock.h>
53#include <plat/devs.h> 54#include <plat/devs.h>
@@ -661,4 +662,5 @@ MACHINE_START(JIVE, "JIVE")
661 .map_io = jive_map_io, 662 .map_io = jive_map_io,
662 .init_machine = jive_machine_init, 663 .init_machine = jive_machine_init,
663 .timer = &s3c24xx_timer, 664 .timer = &s3c24xx_timer,
665 .restart = s3c2412_restart,
664MACHINE_END 666MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index f1eec1b54932..b11451b853d8 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -134,6 +134,7 @@ MACHINE_START(S3C2413, "S3C2413")
134 .map_io = smdk2413_map_io, 134 .map_io = smdk2413_map_io,
135 .init_machine = smdk2413_machine_init, 135 .init_machine = smdk2413_machine_init,
136 .timer = &s3c24xx_timer, 136 .timer = &s3c24xx_timer,
137 .restart = s3c2412_restart,
137MACHINE_END 138MACHINE_END
138 139
139MACHINE_START(SMDK2412, "SMDK2412") 140MACHINE_START(SMDK2412, "SMDK2412")
@@ -145,6 +146,7 @@ MACHINE_START(SMDK2412, "SMDK2412")
145 .map_io = smdk2413_map_io, 146 .map_io = smdk2413_map_io,
146 .init_machine = smdk2413_machine_init, 147 .init_machine = smdk2413_machine_init,
147 .timer = &s3c24xx_timer, 148 .timer = &s3c24xx_timer,
149 .restart = s3c2412_restart,
148MACHINE_END 150MACHINE_END
149 151
150MACHINE_START(SMDK2413, "SMDK2413") 152MACHINE_START(SMDK2413, "SMDK2413")
@@ -156,4 +158,5 @@ MACHINE_START(SMDK2413, "SMDK2413")
156 .map_io = smdk2413_map_io, 158 .map_io = smdk2413_map_io,
157 .init_machine = smdk2413_machine_init, 159 .init_machine = smdk2413_machine_init,
158 .timer = &s3c24xx_timer, 160 .timer = &s3c24xx_timer,
161 .restart = s3c2412_restart,
159MACHINE_END 162MACHINE_END
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 1bbb1ef5f4ff..94bfaa1fb148 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -162,4 +162,5 @@ MACHINE_START(VSTMS, "VSTMS")
162 .init_machine = vstms_init, 162 .init_machine = vstms_init,
163 .map_io = vstms_map_io, 163 .map_io = vstms_map_io,
164 .timer = &s3c24xx_timer, 164 .timer = &s3c24xx_timer,
165 .restart = s3c2412_restart,
165MACHINE_END 166MACHINE_END
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
index f4077efa51fa..d1adfa65f66d 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c2412/pm.c
@@ -16,7 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/syscore_ops.h> 20#include <linux/syscore_ops.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/io.h> 22#include <linux/io.h>
@@ -56,7 +56,7 @@ static void s3c2412_pm_prepare(void)
56{ 56{
57} 57}
58 58
59static int s3c2412_pm_add(struct sys_device *sysdev) 59static int s3c2412_pm_add(struct device *dev)
60{ 60{
61 pm_cpu_prep = s3c2412_pm_prepare; 61 pm_cpu_prep = s3c2412_pm_prepare;
62 pm_cpu_sleep = s3c2412_cpu_suspend; 62 pm_cpu_sleep = s3c2412_cpu_suspend;
@@ -87,13 +87,15 @@ static struct sleep_save s3c2412_sleep[] = {
87 SAVE_ITEM(S3C2413_GPJSLPCON), 87 SAVE_ITEM(S3C2413_GPJSLPCON),
88}; 88};
89 89
90static struct sysdev_driver s3c2412_pm_driver = { 90static struct subsys_interface s3c2412_pm_interface = {
91 .add = s3c2412_pm_add, 91 .name = "s3c2412_pm",
92 .subsys = &s3c2412_subsys,
93 .add_dev = s3c2412_pm_add,
92}; 94};
93 95
94static __init int s3c2412_pm_init(void) 96static __init int s3c2412_pm_init(void)
95{ 97{
96 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver); 98 return subsys_interface_register(&s3c2412_pm_interface);
97} 99}
98 100
99arch_initcall(s3c2412_pm_init); 101arch_initcall(s3c2412_pm_init);
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index 57a1e01e4e50..aff6e85a97c6 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
@@ -32,7 +32,6 @@
32#include <asm/proc-fns.h> 32#include <asm/proc-fns.h>
33#include <asm/irq.h> 33#include <asm/irq.h>
34 34
35#include <mach/reset.h>
36#include <mach/idle.h> 35#include <mach/idle.h>
37 36
38#include <plat/cpu-freq.h> 37#include <plat/cpu-freq.h>
@@ -131,8 +130,11 @@ static void s3c2412_idle(void)
131 cpu_do_idle(); 130 cpu_do_idle();
132} 131}
133 132
134static void s3c2412_hard_reset(void) 133void s3c2412_restart(char mode, const char *cmd)
135{ 134{
135 if (mode == 's')
136 soft_restart(0);
137
136 /* errata "Watch-dog/Software Reset Problem" specifies that 138 /* errata "Watch-dog/Software Reset Problem" specifies that
137 * this reset must be done with the SYSCLK sourced from 139 * this reset must be done with the SYSCLK sourced from
138 * EXTCLK instead of FOUT to avoid a glitch in the reset 140 * EXTCLK instead of FOUT to avoid a glitch in the reset
@@ -164,10 +166,6 @@ void __init s3c2412_map_io(void)
164 166
165 s3c24xx_idle = s3c2412_idle; 167 s3c24xx_idle = s3c2412_idle;
166 168
167 /* set custom reset hook */
168
169 s3c24xx_reset_hook = s3c2412_hard_reset;
170
171 /* register our io-tables */ 169 /* register our io-tables */
172 170
173 iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc)); 171 iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
@@ -220,25 +218,26 @@ void __init s3c2412_init_clocks(int xtal)
220 s3c2412_baseclk_add(); 218 s3c2412_baseclk_add();
221} 219}
222 220
223/* need to register class before we actually register the device, and 221/* need to register the subsystem before we actually register the device, and
224 * we also need to ensure that it has been initialised before any of the 222 * we also need to ensure that it has been initialised before any of the
225 * drivers even try to use it (even if not on an s3c2412 based system) 223 * drivers even try to use it (even if not on an s3c2412 based system)
226 * as a driver which may support both 2410 and 2440 may try and use it. 224 * as a driver which may support both 2410 and 2440 may try and use it.
227*/ 225*/
228 226
229struct sysdev_class s3c2412_sysclass = { 227struct bus_type s3c2412_subsys = {
230 .name = "s3c2412-core", 228 .name = "s3c2412-core",
229 .dev_name = "s3c2412-core",
231}; 230};
232 231
233static int __init s3c2412_core_init(void) 232static int __init s3c2412_core_init(void)
234{ 233{
235 return sysdev_class_register(&s3c2412_sysclass); 234 return subsys_system_register(&s3c2412_subsys, NULL);
236} 235}
237 236
238core_initcall(s3c2412_core_init); 237core_initcall(s3c2412_core_init);
239 238
240static struct sys_device s3c2412_sysdev = { 239static struct device s3c2412_dev = {
241 .cls = &s3c2412_sysclass, 240 .bus = &s3c2412_subsys,
242}; 241};
243 242
244int __init s3c2412_init(void) 243int __init s3c2412_init(void)
@@ -250,5 +249,5 @@ int __init s3c2412_init(void)
250#endif 249#endif
251 register_syscore_ops(&s3c24xx_irq_syscore_ops); 250 register_syscore_ops(&s3c24xx_irq_syscore_ops);
252 251
253 return sysdev_register(&s3c2412_sysdev); 252 return device_register(&s3c2412_dev);
254} 253}
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
index 28ad20d42445..36df761061de 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c2416/irq.c
@@ -25,7 +25,7 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/ioport.h> 27#include <linux/ioport.h>
28#include <linux/sysdev.h> 28#include <linux/device.h>
29#include <linux/io.h> 29#include <linux/io.h>
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -213,7 +213,7 @@ static int __init s3c2416_add_sub(unsigned int base,
213 return 0; 213 return 0;
214} 214}
215 215
216static int __init s3c2416_irq_add(struct sys_device *sysdev) 216static int __init s3c2416_irq_add(struct device *dev)
217{ 217{
218 printk(KERN_INFO "S3C2416: IRQ Support\n"); 218 printk(KERN_INFO "S3C2416: IRQ Support\n");
219 219
@@ -234,13 +234,15 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev)
234 return 0; 234 return 0;
235} 235}
236 236
237static struct sysdev_driver s3c2416_irq_driver = { 237static struct subsys_interface s3c2416_irq_interface = {
238 .add = s3c2416_irq_add, 238 .name = "s3c2416_irq",
239 .subsys = &s3c2416_subsys,
240 .add_dev = s3c2416_irq_add,
239}; 241};
240 242
241static int __init s3c2416_irq_init(void) 243static int __init s3c2416_irq_init(void)
242{ 244{
243 return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_irq_driver); 245 return subsys_interface_register(&s3c2416_irq_interface);
244} 246}
245 247
246arch_initcall(s3c2416_irq_init); 248arch_initcall(s3c2416_irq_init);
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index a9eee531ca76..66b71736609c 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -251,4 +251,5 @@ MACHINE_START(SMDK2416, "SMDK2416")
251 .map_io = smdk2416_map_io, 251 .map_io = smdk2416_map_io,
252 .init_machine = smdk2416_machine_init, 252 .init_machine = smdk2416_machine_init,
253 .timer = &s3c24xx_timer, 253 .timer = &s3c24xx_timer,
254 .restart = s3c2416_restart,
254MACHINE_END 255MACHINE_END
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c2416/pm.c
index 9ec54f1d8e75..3bdb15a0d419 100644
--- a/arch/arm/mach-s3c2416/pm.c
+++ b/arch/arm/mach-s3c2416/pm.c
@@ -10,7 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <linux/sysdev.h> 13#include <linux/device.h>
14#include <linux/syscore_ops.h> 14#include <linux/syscore_ops.h>
15#include <linux/io.h> 15#include <linux/io.h>
16 16
@@ -48,7 +48,7 @@ static void s3c2416_pm_prepare(void)
48 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1); 48 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
49} 49}
50 50
51static int s3c2416_pm_add(struct sys_device *sysdev) 51static int s3c2416_pm_add(struct device *dev)
52{ 52{
53 pm_cpu_prep = s3c2416_pm_prepare; 53 pm_cpu_prep = s3c2416_pm_prepare;
54 pm_cpu_sleep = s3c2416_cpu_suspend; 54 pm_cpu_sleep = s3c2416_cpu_suspend;
@@ -56,13 +56,15 @@ static int s3c2416_pm_add(struct sys_device *sysdev)
56 return 0; 56 return 0;
57} 57}
58 58
59static struct sysdev_driver s3c2416_pm_driver = { 59static struct subsys_interface s3c2416_pm_interface = {
60 .add = s3c2416_pm_add, 60 .name = "s3c2416_pm",
61 .subsys = &s3c2416_subsys,
62 .add_dev = s3c2416_pm_add,
61}; 63};
62 64
63static __init int s3c2416_pm_init(void) 65static __init int s3c2416_pm_init(void)
64{ 66{
65 return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver); 67 return subsys_interface_register(&s3c2416_pm_interface);
66} 68}
67 69
68arch_initcall(s3c2416_pm_init); 70arch_initcall(s3c2416_pm_init);
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index ee214bc83c83..5287d2808d3e 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -31,7 +31,7 @@
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34#include <linux/sysdev.h> 34#include <linux/device.h>
35#include <linux/syscore_ops.h> 35#include <linux/syscore_ops.h>
36#include <linux/clk.h> 36#include <linux/clk.h>
37#include <linux/io.h> 37#include <linux/io.h>
@@ -44,7 +44,6 @@
44#include <asm/proc-fns.h> 44#include <asm/proc-fns.h>
45#include <asm/irq.h> 45#include <asm/irq.h>
46 46
47#include <mach/reset.h>
48#include <mach/idle.h> 47#include <mach/idle.h>
49#include <mach/regs-s3c2443-clock.h> 48#include <mach/regs-s3c2443-clock.h>
50 49
@@ -68,16 +67,20 @@ static struct map_desc s3c2416_iodesc[] __initdata = {
68 IODESC_ENT(TIMER), 67 IODESC_ENT(TIMER),
69}; 68};
70 69
71struct sysdev_class s3c2416_sysclass = { 70struct bus_type s3c2416_subsys = {
72 .name = "s3c2416-core", 71 .name = "s3c2416-core",
72 .dev_name = "s3c2416-core",
73}; 73};
74 74
75static struct sys_device s3c2416_sysdev = { 75static struct device s3c2416_dev = {
76 .cls = &s3c2416_sysclass, 76 .bus = &s3c2416_subsys,
77}; 77};
78 78
79static void s3c2416_hard_reset(void) 79void s3c2416_restart(char mode, const char *cmd)
80{ 80{
81 if (mode == 's')
82 soft_restart(0);
83
81 __raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST); 84 __raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
82} 85}
83 86
@@ -85,7 +88,6 @@ int __init s3c2416_init(void)
85{ 88{
86 printk(KERN_INFO "S3C2416: Initializing architecture\n"); 89 printk(KERN_INFO "S3C2416: Initializing architecture\n");
87 90
88 s3c24xx_reset_hook = s3c2416_hard_reset;
89 /* s3c24xx_idle = s3c2416_idle; */ 91 /* s3c24xx_idle = s3c2416_idle; */
90 92
91 /* change WDT IRQ number */ 93 /* change WDT IRQ number */
@@ -105,7 +107,7 @@ int __init s3c2416_init(void)
105#endif 107#endif
106 register_syscore_ops(&s3c24xx_irq_syscore_ops); 108 register_syscore_ops(&s3c24xx_irq_syscore_ops);
107 109
108 return sysdev_register(&s3c2416_sysdev); 110 return device_register(&s3c2416_dev);
109} 111}
110 112
111void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no) 113void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
@@ -133,7 +135,7 @@ void __init s3c2416_map_io(void)
133 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); 135 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
134} 136}
135 137
136/* need to register class before we actually register the device, and 138/* need to register the subsystem before we actually register the device, and
137 * we also need to ensure that it has been initialised before any of the 139 * we also need to ensure that it has been initialised before any of the
138 * drivers even try to use it (even if not on an s3c2416 based system) 140 * drivers even try to use it (even if not on an s3c2416 based system)
139 * as a driver which may support both 2443 and 2440 may try and use it. 141 * as a driver which may support both 2443 and 2440 may try and use it.
@@ -141,7 +143,7 @@ void __init s3c2416_map_io(void)
141 143
142static int __init s3c2416_core_init(void) 144static int __init s3c2416_core_init(void)
143{ 145{
144 return sysdev_class_register(&s3c2416_sysclass); 146 return subsys_system_register(&s3c2416_subsys, NULL);
145} 147}
146 148
147core_initcall(s3c2416_core_init); 149core_initcall(s3c2416_core_init);
diff --git a/arch/arm/mach-s3c2440/clock.c b/arch/arm/mach-s3c2440/clock.c
index f9e6bdaf41d2..d8957592fdc4 100644
--- a/arch/arm/mach-s3c2440/clock.c
+++ b/arch/arm/mach-s3c2440/clock.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/sysdev.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
33#include <linux/ioport.h> 32#include <linux/ioport.h>
34#include <linux/mutex.h> 33#include <linux/mutex.h>
@@ -108,7 +107,7 @@ static struct clk s3c2440_clk_ac97 = {
108 .ctrlbit = S3C2440_CLKCON_CAMERA, 107 .ctrlbit = S3C2440_CLKCON_CAMERA,
109}; 108};
110 109
111static int s3c2440_clk_add(struct sys_device *sysdev) 110static int s3c2440_clk_add(struct device *dev)
112{ 111{
113 struct clk *clock_upll; 112 struct clk *clock_upll;
114 struct clk *clock_h; 113 struct clk *clock_h;
@@ -137,13 +136,15 @@ static int s3c2440_clk_add(struct sys_device *sysdev)
137 return 0; 136 return 0;
138} 137}
139 138
140static struct sysdev_driver s3c2440_clk_driver = { 139static struct subsys_interface s3c2440_clk_interface = {
141 .add = s3c2440_clk_add, 140 .name = "s3c2440_clk",
141 .subsys = &s3c2440_subsys,
142 .add_dev = s3c2440_clk_add,
142}; 143};
143 144
144static __init int s3c24xx_clk_driver(void) 145static __init int s3c24xx_clk_init(void)
145{ 146{
146 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver); 147 return subsys_interface_register(&s3c2440_clk_interface);
147} 148}
148 149
149arch_initcall(s3c24xx_clk_driver); 150arch_initcall(s3c24xx_clk_init);
diff --git a/arch/arm/mach-s3c2440/common.h b/arch/arm/mach-s3c2440/common.h
new file mode 100644
index 000000000000..db8a98ac68c5
--- /dev/null
+++ b/arch/arm/mach-s3c2440/common.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Header for S3C2440 machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ARCH_ARM_MACH_S3C2440_COMMON_H
13#define __ARCH_ARM_MACH_S3C2440_COMMON_H
14
15void s3c2440_restart(char mode, const char *cmd);
16
17#endif /* __ARCH_ARM_MACH_S3C2440_COMMON_H */
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c2440/dma.c
index 0e73f8f9d132..15b1ddf8f626 100644
--- a/arch/arm/mach-s3c2440/dma.c
+++ b/arch/arm/mach-s3c2440/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19 19
20#include <mach/map.h> 20#include <mach/map.h>
@@ -174,20 +174,22 @@ static struct s3c24xx_dma_order __initdata s3c2440_dma_order = {
174 }, 174 },
175}; 175};
176 176
177static int __init s3c2440_dma_add(struct sys_device *sysdev) 177static int __init s3c2440_dma_add(struct device *dev)
178{ 178{
179 s3c2410_dma_init(); 179 s3c2410_dma_init();
180 s3c24xx_dma_order_set(&s3c2440_dma_order); 180 s3c24xx_dma_order_set(&s3c2440_dma_order);
181 return s3c24xx_dma_init_map(&s3c2440_dma_sel); 181 return s3c24xx_dma_init_map(&s3c2440_dma_sel);
182} 182}
183 183
184static struct sysdev_driver s3c2440_dma_driver = { 184static struct subsys_interface s3c2440_dma_interface = {
185 .add = s3c2440_dma_add, 185 .name = "s3c2440_dma",
186 .subsys = &s3c2440_subsys,
187 .add_dev = s3c2440_dma_add,
186}; 188};
187 189
188static int __init s3c2440_dma_init(void) 190static int __init s3c2440_dma_init(void)
189{ 191{
190 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_dma_driver); 192 return subsys_interface_register(&s3c2440_dma_interface);
191} 193}
192 194
193arch_initcall(s3c2440_dma_init); 195arch_initcall(s3c2440_dma_init);
diff --git a/arch/arm/mach-s3c2440/irq.c b/arch/arm/mach-s3c2440/irq.c
index eb1cc0f0705e..4fee9bc6bcb5 100644
--- a/arch/arm/mach-s3c2440/irq.c
+++ b/arch/arm/mach-s3c2440/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -92,7 +92,7 @@ static struct irq_chip s3c_irq_wdtac97 = {
92 .irq_ack = s3c_irq_wdtac97_ack, 92 .irq_ack = s3c_irq_wdtac97_ack,
93}; 93};
94 94
95static int s3c2440_irq_add(struct sys_device *sysdev) 95static int s3c2440_irq_add(struct device *dev)
96{ 96{
97 unsigned int irqno; 97 unsigned int irqno;
98 98
@@ -113,13 +113,15 @@ static int s3c2440_irq_add(struct sys_device *sysdev)
113 return 0; 113 return 0;
114} 114}
115 115
116static struct sysdev_driver s3c2440_irq_driver = { 116static struct subsys_interface s3c2440_irq_interface = {
117 .add = s3c2440_irq_add, 117 .name = "s3c2440_irq",
118 .subsys = &s3c2440_subsys,
119 .add_dev = s3c2440_irq_add,
118}; 120};
119 121
120static int s3c2440_irq_init(void) 122static int s3c2440_irq_init(void)
121{ 123{
122 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver); 124 return subsys_interface_register(&s3c2440_irq_interface);
123} 125}
124 126
125arch_initcall(s3c2440_irq_init); 127arch_initcall(s3c2440_irq_init);
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 74f92fc3fd04..121ff8d2c887 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -55,6 +55,8 @@
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/audio-simtec.h> 56#include <plat/audio-simtec.h>
57 57
58#include "common.h"
59
58#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics" 60#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics"
59 61
60static struct map_desc anubis_iodesc[] __initdata = { 62static struct map_desc anubis_iodesc[] __initdata = {
@@ -503,4 +505,5 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
503 .init_machine = anubis_init, 505 .init_machine = anubis_init,
504 .init_irq = s3c24xx_init_irq, 506 .init_irq = s3c24xx_init_irq,
505 .timer = &s3c24xx_timer, 507 .timer = &s3c24xx_timer,
508 .restart = s3c2440_restart,
506MACHINE_END 509MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index 38887ee0c784..b7e334f07da4 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -49,6 +49,8 @@
49#include <plat/cpu.h> 49#include <plat/cpu.h>
50#include <plat/mci.h> 50#include <plat/mci.h>
51 51
52#include "common.h"
53
52static struct map_desc at2440evb_iodesc[] __initdata = { 54static struct map_desc at2440evb_iodesc[] __initdata = {
53 /* Nothing here */ 55 /* Nothing here */
54}; 56};
@@ -238,4 +240,5 @@ MACHINE_START(AT2440EVB, "AT2440EVB")
238 .init_machine = at2440evb_init, 240 .init_machine = at2440evb_init,
239 .init_irq = s3c24xx_init_irq, 241 .init_irq = s3c24xx_init_irq,
240 .timer = &s3c24xx_timer, 242 .timer = &s3c24xx_timer,
243 .restart = s3c2440_restart,
241MACHINE_END 244MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index de1e0ff46cec..5859e609d28c 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -90,6 +90,7 @@
90#include <plat/iic.h> 90#include <plat/iic.h>
91#include <plat/ts.h> 91#include <plat/ts.h>
92 92
93#include "common.h"
93 94
94static struct pcf50633 *gta02_pcf; 95static struct pcf50633 *gta02_pcf;
95 96
@@ -600,4 +601,5 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
600 .init_irq = s3c24xx_init_irq, 601 .init_irq = s3c24xx_init_irq,
601 .init_machine = gta02_machine_init, 602 .init_machine = gta02_machine_init,
602 .timer = &s3c24xx_timer, 603 .timer = &s3c24xx_timer,
604 .restart = s3c2440_restart,
603MACHINE_END 605MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 91fe0b4c95f1..437322ffd88d 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -60,6 +60,8 @@
60 60
61#include <sound/s3c24xx_uda134x.h> 61#include <sound/s3c24xx_uda134x.h>
62 62
63#include "common.h"
64
63#define MACH_MINI2440_DM9K_BASE (S3C2410_CS4 + 0x300) 65#define MACH_MINI2440_DM9K_BASE (S3C2410_CS4 + 0x300)
64 66
65static struct map_desc mini2440_iodesc[] __initdata = { 67static struct map_desc mini2440_iodesc[] __initdata = {
@@ -681,4 +683,5 @@ MACHINE_START(MINI2440, "MINI2440")
681 .init_machine = mini2440_init, 683 .init_machine = mini2440_init,
682 .init_irq = s3c24xx_init_irq, 684 .init_irq = s3c24xx_init_irq,
683 .timer = &s3c24xx_timer, 685 .timer = &s3c24xx_timer,
686 .restart = s3c2440_restart,
684MACHINE_END 687MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
index 61c0bf148165..40eaf844bc1f 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
@@ -47,6 +47,8 @@
47#include <plat/devs.h> 47#include <plat/devs.h>
48#include <plat/cpu.h> 48#include <plat/cpu.h>
49 49
50#include "common.h"
51
50static struct map_desc nexcoder_iodesc[] __initdata = { 52static struct map_desc nexcoder_iodesc[] __initdata = {
51 /* nothing here yet */ 53 /* nothing here yet */
52}; 54};
@@ -156,4 +158,5 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
156 .init_machine = nexcoder_init, 158 .init_machine = nexcoder_init,
157 .init_irq = s3c24xx_init_irq, 159 .init_irq = s3c24xx_init_irq,
158 .timer = &s3c24xx_timer, 160 .timer = &s3c24xx_timer,
161 .restart = s3c2440_restart,
159MACHINE_END 162MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index dc142ebf8cba..e795715fba30 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -54,6 +54,8 @@
54#include <plat/devs.h> 54#include <plat/devs.h>
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56 56
57#include "common.h"
58
57/* onboard perihperal map */ 59/* onboard perihperal map */
58 60
59static struct map_desc osiris_iodesc[] __initdata = { 61static struct map_desc osiris_iodesc[] __initdata = {
@@ -452,4 +454,5 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
452 .init_irq = s3c24xx_init_irq, 454 .init_irq = s3c24xx_init_irq,
453 .init_machine = osiris_init, 455 .init_machine = osiris_init,
454 .timer = &s3c24xx_timer, 456 .timer = &s3c24xx_timer,
457 .restart = s3c2440_restart,
455MACHINE_END 458MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c
index 0d3453bf567c..332d7533bd96 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c2440/mach-rx1950.c
@@ -24,7 +24,7 @@
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/gpio_keys.h> 26#include <linux/gpio_keys.h>
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/pda_power.h> 28#include <linux/pda_power.h>
29#include <linux/pwm_backlight.h> 29#include <linux/pwm_backlight.h>
30#include <linux/pwm.h> 30#include <linux/pwm.h>
@@ -62,6 +62,8 @@
62 62
63#include <sound/uda1380.h> 63#include <sound/uda1380.h>
64 64
65#include "common.h"
66
65#define LCD_PWM_PERIOD 192960 67#define LCD_PWM_PERIOD 192960
66#define LCD_PWM_DUTY 127353 68#define LCD_PWM_DUTY 127353
67 69
@@ -832,4 +834,5 @@ MACHINE_START(RX1950, "HP iPAQ RX1950")
832 .init_irq = s3c24xx_init_irq, 834 .init_irq = s3c24xx_init_irq,
833 .init_machine = rx1950_init_machine, 835 .init_machine = rx1950_init_machine,
834 .timer = &s3c24xx_timer, 836 .timer = &s3c24xx_timer,
837 .restart = s3c2440_restart,
835MACHINE_END 838MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index e19499c2f909..80a0972873c2 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -20,7 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/tty.h> 21#include <linux/tty.h>
22#include <linux/console.h> 22#include <linux/console.h>
23#include <linux/sysdev.h> 23#include <linux/device.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/serial.h> 26#include <linux/serial.h>
@@ -51,6 +51,8 @@
51#include <plat/cpu.h> 51#include <plat/cpu.h>
52#include <plat/pm.h> 52#include <plat/pm.h>
53 53
54#include "common.h"
55
54static struct map_desc rx3715_iodesc[] __initdata = { 56static struct map_desc rx3715_iodesc[] __initdata = {
55 /* dump ISA space somewhere unused */ 57 /* dump ISA space somewhere unused */
56 58
@@ -224,4 +226,5 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
224 .init_irq = rx3715_init_irq, 226 .init_irq = rx3715_init_irq,
225 .init_machine = rx3715_init_machine, 227 .init_machine = rx3715_init_machine,
226 .timer = &s3c24xx_timer, 228 .timer = &s3c24xx_timer,
229 .restart = s3c2440_restart,
227MACHINE_END 230MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index 36eeb4197a84..1deb60d12a60 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -47,6 +47,8 @@
47 47
48#include <plat/common-smdk.h> 48#include <plat/common-smdk.h>
49 49
50#include "common.h"
51
50static struct map_desc smdk2440_iodesc[] __initdata = { 52static struct map_desc smdk2440_iodesc[] __initdata = {
51 /* ISA IO Space map (memory space selected by A24) */ 53 /* ISA IO Space map (memory space selected by A24) */
52 54
@@ -181,4 +183,5 @@ MACHINE_START(S3C2440, "SMDK2440")
181 .map_io = smdk2440_map_io, 183 .map_io = smdk2440_map_io,
182 .init_machine = smdk2440_machine_init, 184 .init_machine = smdk2440_machine_init,
183 .timer = &s3c24xx_timer, 185 .timer = &s3c24xx_timer,
186 .restart = s3c2440_restart,
184MACHINE_END 187MACHINE_END
diff --git a/arch/arm/mach-s3c2440/s3c2440-cpufreq.c b/arch/arm/mach-s3c2440/s3c2440-cpufreq.c
index 976002fb1b8f..cf7596694efe 100644
--- a/arch/arm/mach-s3c2440/s3c2440-cpufreq.c
+++ b/arch/arm/mach-s3c2440/s3c2440-cpufreq.c
@@ -17,7 +17,7 @@
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <linux/cpufreq.h> 19#include <linux/cpufreq.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/err.h> 23#include <linux/err.h>
@@ -270,7 +270,7 @@ struct s3c_cpufreq_info s3c2440_cpufreq_info = {
270 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs), 270 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
271}; 271};
272 272
273static int s3c2440_cpufreq_add(struct sys_device *sysdev) 273static int s3c2440_cpufreq_add(struct device *dev)
274{ 274{
275 xtal = s3c_cpufreq_clk_get(NULL, "xtal"); 275 xtal = s3c_cpufreq_clk_get(NULL, "xtal");
276 hclk = s3c_cpufreq_clk_get(NULL, "hclk"); 276 hclk = s3c_cpufreq_clk_get(NULL, "hclk");
@@ -285,27 +285,29 @@ static int s3c2440_cpufreq_add(struct sys_device *sysdev)
285 return s3c_cpufreq_register(&s3c2440_cpufreq_info); 285 return s3c_cpufreq_register(&s3c2440_cpufreq_info);
286} 286}
287 287
288static struct sysdev_driver s3c2440_cpufreq_driver = { 288static struct subsys_interface s3c2440_cpufreq_interface = {
289 .add = s3c2440_cpufreq_add, 289 .name = "s3c2440_cpufreq",
290 .subsys = &s3c2440_subsys,
291 .add_dev = s3c2440_cpufreq_add,
290}; 292};
291 293
292static int s3c2440_cpufreq_init(void) 294static int s3c2440_cpufreq_init(void)
293{ 295{
294 return sysdev_driver_register(&s3c2440_sysclass, 296 return subsys_interface_register(&s3c2440_cpufreq_interface);
295 &s3c2440_cpufreq_driver);
296} 297}
297 298
298/* arch_initcall adds the clocks we need, so use subsys_initcall. */ 299/* arch_initcall adds the clocks we need, so use subsys_initcall. */
299subsys_initcall(s3c2440_cpufreq_init); 300subsys_initcall(s3c2440_cpufreq_init);
300 301
301static struct sysdev_driver s3c2442_cpufreq_driver = { 302static struct subsys_interface s3c2442_cpufreq_interface = {
302 .add = s3c2440_cpufreq_add, 303 .name = "s3c2442_cpufreq",
304 .subsys = &s3c2442_subsys,
305 .add_dev = s3c2440_cpufreq_add,
303}; 306};
304 307
305static int s3c2442_cpufreq_init(void) 308static int s3c2442_cpufreq_init(void)
306{ 309{
307 return sysdev_driver_register(&s3c2442_sysclass, 310 return subsys_interface_register(&s3c2442_cpufreq_interface);
308 &s3c2442_cpufreq_driver);
309} 311}
310 312
311subsys_initcall(s3c2442_cpufreq_init); 313subsys_initcall(s3c2442_cpufreq_init);
diff --git a/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c b/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
index f105d5e8c477..b5368ae8d7fe 100644
--- a/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
+++ b/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20 20
@@ -51,7 +51,7 @@ static struct cpufreq_frequency_table s3c2440_plls_12[] __initdata = {
51 { .frequency = 400000000, .index = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */ 51 { .frequency = 400000000, .index = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */
52}; 52};
53 53
54static int s3c2440_plls12_add(struct sys_device *dev) 54static int s3c2440_plls12_add(struct device *dev)
55{ 55{
56 struct clk *xtal_clk; 56 struct clk *xtal_clk;
57 unsigned long xtal; 57 unsigned long xtal;
@@ -72,25 +72,29 @@ static int s3c2440_plls12_add(struct sys_device *dev)
72 return 0; 72 return 0;
73} 73}
74 74
75static struct sysdev_driver s3c2440_plls12_drv = { 75static struct subsys_interface s3c2440_plls12_interface = {
76 .add = s3c2440_plls12_add, 76 .name = "s3c2440_plls12",
77 .subsys = &s3c2440_subsys,
78 .add_dev = s3c2440_plls12_add,
77}; 79};
78 80
79static int __init s3c2440_pll_12mhz(void) 81static int __init s3c2440_pll_12mhz(void)
80{ 82{
81 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_plls12_drv); 83 return subsys_interface_register(&s3c2440_plls12_interface);
82 84
83} 85}
84 86
85arch_initcall(s3c2440_pll_12mhz); 87arch_initcall(s3c2440_pll_12mhz);
86 88
87static struct sysdev_driver s3c2442_plls12_drv = { 89static struct subsys_interface s3c2442_plls12_interface = {
88 .add = s3c2440_plls12_add, 90 .name = "s3c2442_plls12",
91 .subsys = &s3c2442_subsys,
92 .add_dev = s3c2440_plls12_add,
89}; 93};
90 94
91static int __init s3c2442_pll_12mhz(void) 95static int __init s3c2442_pll_12mhz(void)
92{ 96{
93 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_plls12_drv); 97 return subsys_interface_register(&s3c2442_plls12_interface);
94 98
95} 99}
96 100
diff --git a/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c b/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
index c8a8f90ef382..42f2b5cd2399 100644
--- a/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
+++ b/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20 20
@@ -79,7 +79,7 @@ static struct cpufreq_frequency_table s3c2440_plls_169344[] __initdata = {
79 { .frequency = 402192000, .index = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */ 79 { .frequency = 402192000, .index = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */
80}; 80};
81 81
82static int s3c2440_plls169344_add(struct sys_device *dev) 82static int s3c2440_plls169344_add(struct device *dev)
83{ 83{
84 struct clk *xtal_clk; 84 struct clk *xtal_clk;
85 unsigned long xtal; 85 unsigned long xtal;
@@ -100,28 +100,28 @@ static int s3c2440_plls169344_add(struct sys_device *dev)
100 return 0; 100 return 0;
101} 101}
102 102
103static struct sysdev_driver s3c2440_plls169344_drv = { 103static struct subsys_interface s3c2440_plls169344_interface = {
104 .add = s3c2440_plls169344_add, 104 .name = "s3c2440_plls169344",
105 .subsys = &s3c2440_subsys,
106 .add_dev = s3c2440_plls169344_add,
105}; 107};
106 108
107static int __init s3c2440_pll_16934400(void) 109static int __init s3c2440_pll_16934400(void)
108{ 110{
109 return sysdev_driver_register(&s3c2440_sysclass, 111 return subsys_interface_register(&s3c2440_plls169344_interface);
110 &s3c2440_plls169344_drv);
111
112} 112}
113 113
114arch_initcall(s3c2440_pll_16934400); 114arch_initcall(s3c2440_pll_16934400);
115 115
116static struct sysdev_driver s3c2442_plls169344_drv = { 116static struct subsys_interface s3c2442_plls169344_interface = {
117 .add = s3c2440_plls169344_add, 117 .name = "s3c2442_plls169344",
118 .subsys = &s3c2442_subsys,
119 .add_dev = s3c2440_plls169344_add,
118}; 120};
119 121
120static int __init s3c2442_pll_16934400(void) 122static int __init s3c2442_pll_16934400(void)
121{ 123{
122 return sysdev_driver_register(&s3c2442_sysclass, 124 return subsys_interface_register(&s3c2442_plls169344_interface);
123 &s3c2442_plls169344_drv);
124
125} 125}
126 126
127arch_initcall(s3c2442_pll_16934400); 127arch_initcall(s3c2442_pll_16934400);
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c
index 37f8cc6aabd4..517623a09fc5 100644
--- a/arch/arm/mach-s3c2440/s3c2440.c
+++ b/arch/arm/mach-s3c2440/s3c2440.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/clk.h> 24#include <linux/clk.h>
@@ -35,13 +35,14 @@
35#include <plat/cpu.h> 35#include <plat/cpu.h>
36#include <plat/s3c244x.h> 36#include <plat/s3c244x.h>
37#include <plat/pm.h> 37#include <plat/pm.h>
38#include <plat/watchdog-reset.h>
38 39
39#include <plat/gpio-core.h> 40#include <plat/gpio-core.h>
40#include <plat/gpio-cfg.h> 41#include <plat/gpio-cfg.h>
41#include <plat/gpio-cfg-helpers.h> 42#include <plat/gpio-cfg-helpers.h>
42 43
43static struct sys_device s3c2440_sysdev = { 44static struct device s3c2440_dev = {
44 .cls = &s3c2440_sysclass, 45 .bus = &s3c2440_subsys,
45}; 46};
46 47
47int __init s3c2440_init(void) 48int __init s3c2440_init(void)
@@ -63,7 +64,7 @@ int __init s3c2440_init(void)
63 64
64 /* register our system device for everything else */ 65 /* register our system device for everything else */
65 66
66 return sysdev_register(&s3c2440_sysdev); 67 return device_register(&s3c2440_dev);
67} 68}
68 69
69void __init s3c2440_map_io(void) 70void __init s3c2440_map_io(void)
@@ -73,3 +74,15 @@ void __init s3c2440_map_io(void)
73 s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up; 74 s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
74 s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up; 75 s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
75} 76}
77
78void s3c2440_restart(char mode, const char *cmd)
79{
80 if (mode == 's') {
81 soft_restart(0);
82 }
83
84 arch_wdt_reset();
85
86 /* we'll take a jump through zero as a poor second */
87 soft_restart(0);
88}
diff --git a/arch/arm/mach-s3c2440/s3c2442.c b/arch/arm/mach-s3c2440/s3c2442.c
index 2c822e09392f..8004e0497bf4 100644
--- a/arch/arm/mach-s3c2440/s3c2442.c
+++ b/arch/arm/mach-s3c2440/s3c2442.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/sysdev.h>
32#include <linux/syscore_ops.h> 31#include <linux/syscore_ops.h>
33#include <linux/interrupt.h> 32#include <linux/interrupt.h>
34#include <linux/ioport.h> 33#include <linux/ioport.h>
@@ -123,7 +122,7 @@ static struct clk s3c2442_clk_cam_upll = {
123 }, 122 },
124}; 123};
125 124
126static int s3c2442_clk_add(struct sys_device *sysdev) 125static int s3c2442_clk_add(struct device *dev)
127{ 126{
128 struct clk *clock_upll; 127 struct clk *clock_upll;
129 struct clk *clock_h; 128 struct clk *clock_h;
@@ -149,20 +148,22 @@ static int s3c2442_clk_add(struct sys_device *sysdev)
149 return 0; 148 return 0;
150} 149}
151 150
152static struct sysdev_driver s3c2442_clk_driver = { 151static struct subsys_interface s3c2442_clk_interface = {
153 .add = s3c2442_clk_add, 152 .name = "s3c2442_clk",
153 .subsys = &s3c2442_subsys,
154 .add_dev = s3c2442_clk_add,
154}; 155};
155 156
156static __init int s3c2442_clk_init(void) 157static __init int s3c2442_clk_init(void)
157{ 158{
158 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver); 159 return subsys_interface_register(&s3c2442_clk_interface);
159} 160}
160 161
161arch_initcall(s3c2442_clk_init); 162arch_initcall(s3c2442_clk_init);
162 163
163 164
164static struct sys_device s3c2442_sysdev = { 165static struct device s3c2442_dev = {
165 .cls = &s3c2442_sysclass, 166 .bus = &s3c2442_subsys,
166}; 167};
167 168
168int __init s3c2442_init(void) 169int __init s3c2442_init(void)
@@ -175,7 +176,7 @@ int __init s3c2442_init(void)
175 register_syscore_ops(&s3c244x_pm_syscore_ops); 176 register_syscore_ops(&s3c244x_pm_syscore_ops);
176 register_syscore_ops(&s3c24xx_irq_syscore_ops); 177 register_syscore_ops(&s3c24xx_irq_syscore_ops);
177 178
178 return sysdev_register(&s3c2442_sysdev); 179 return device_register(&s3c2442_dev);
179} 180}
180 181
181void __init s3c2442_map_io(void) 182void __init s3c2442_map_io(void)
diff --git a/arch/arm/mach-s3c2440/s3c244x-clock.c b/arch/arm/mach-s3c2440/s3c244x-clock.c
index 7f5ea0a169a5..b3fdbdda3d5f 100644
--- a/arch/arm/mach-s3c2440/s3c244x-clock.c
+++ b/arch/arm/mach-s3c2440/s3c244x-clock.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/sysdev.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
33#include <linux/ioport.h> 32#include <linux/ioport.h>
34#include <linux/clk.h> 33#include <linux/clk.h>
@@ -73,7 +72,7 @@ static struct clk clk_arm = {
73 }, 72 },
74}; 73};
75 74
76static int s3c244x_clk_add(struct sys_device *sysdev) 75static int s3c244x_clk_add(struct device *dev)
77{ 76{
78 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN); 77 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
79 unsigned long clkdivn; 78 unsigned long clkdivn;
@@ -115,24 +114,28 @@ static int s3c244x_clk_add(struct sys_device *sysdev)
115 return 0; 114 return 0;
116} 115}
117 116
118static struct sysdev_driver s3c2440_clk_driver = { 117static struct subsys_interface s3c2440_clk_interface = {
119 .add = s3c244x_clk_add, 118 .name = "s3c2440_clk",
119 .subsys = &s3c2440_subsys,
120 .add_dev = s3c244x_clk_add,
120}; 121};
121 122
122static int s3c2440_clk_init(void) 123static int s3c2440_clk_init(void)
123{ 124{
124 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver); 125 return subsys_interface_register(&s3c2440_clk_interface);
125} 126}
126 127
127arch_initcall(s3c2440_clk_init); 128arch_initcall(s3c2440_clk_init);
128 129
129static struct sysdev_driver s3c2442_clk_driver = { 130static struct subsys_interface s3c2442_clk_interface = {
130 .add = s3c244x_clk_add, 131 .name = "s3c2442_clk",
132 .subsys = &s3c2442_subsys,
133 .add_dev = s3c244x_clk_add,
131}; 134};
132 135
133static int s3c2442_clk_init(void) 136static int s3c2442_clk_init(void)
134{ 137{
135 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver); 138 return subsys_interface_register(&s3c2442_clk_interface);
136} 139}
137 140
138arch_initcall(s3c2442_clk_init); 141arch_initcall(s3c2442_clk_init);
diff --git a/arch/arm/mach-s3c2440/s3c244x-irq.c b/arch/arm/mach-s3c2440/s3c244x-irq.c
index c63e8f26d901..74d3dcf46a48 100644
--- a/arch/arm/mach-s3c2440/s3c244x-irq.c
+++ b/arch/arm/mach-s3c2440/s3c244x-irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -91,7 +91,7 @@ static struct irq_chip s3c_irq_cam = {
91 .irq_ack = s3c_irq_cam_ack, 91 .irq_ack = s3c_irq_cam_ack,
92}; 92};
93 93
94static int s3c244x_irq_add(struct sys_device *sysdev) 94static int s3c244x_irq_add(struct device *dev)
95{ 95{
96 unsigned int irqno; 96 unsigned int irqno;
97 97
@@ -114,25 +114,29 @@ static int s3c244x_irq_add(struct sys_device *sysdev)
114 return 0; 114 return 0;
115} 115}
116 116
117static struct sysdev_driver s3c2440_irq_driver = { 117static struct subsys_interface s3c2440_irq_interface = {
118 .add = s3c244x_irq_add, 118 .name = "s3c2440_irq",
119 .subsys = &s3c2440_subsys,
120 .add_dev = s3c244x_irq_add,
119}; 121};
120 122
121static int s3c2440_irq_init(void) 123static int s3c2440_irq_init(void)
122{ 124{
123 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver); 125 return subsys_interface_register(&s3c2440_irq_interface);
124} 126}
125 127
126arch_initcall(s3c2440_irq_init); 128arch_initcall(s3c2440_irq_init);
127 129
128static struct sysdev_driver s3c2442_irq_driver = { 130static struct subsys_interface s3c2442_irq_interface = {
129 .add = s3c244x_irq_add, 131 .name = "s3c2442_irq",
132 .subsys = &s3c2442_subsys,
133 .add_dev = s3c244x_irq_add,
130}; 134};
131 135
132 136
133static int s3c2442_irq_init(void) 137static int s3c2442_irq_init(void)
134{ 138{
135 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_irq_driver); 139 return subsys_interface_register(&s3c2442_irq_interface);
136} 140}
137 141
138arch_initcall(s3c2442_irq_init); 142arch_initcall(s3c2442_irq_init);
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c
index 7e8a23d2098a..36bc60f61d0a 100644
--- a/arch/arm/mach-s3c2440/s3c244x.c
+++ b/arch/arm/mach-s3c2440/s3c244x.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
@@ -135,17 +135,19 @@ void __init s3c244x_init_clocks(int xtal)
135 s3c2410_baseclk_add(); 135 s3c2410_baseclk_add();
136} 136}
137 137
138/* Since the S3C2442 and S3C2440 share items, put both sysclasses here */ 138/* Since the S3C2442 and S3C2440 share items, put both subsystems here */
139 139
140struct sysdev_class s3c2440_sysclass = { 140struct bus_type s3c2440_subsys = {
141 .name = "s3c2440-core", 141 .name = "s3c2440-core",
142 .dev_name = "s3c2440-core",
142}; 143};
143 144
144struct sysdev_class s3c2442_sysclass = { 145struct bus_type s3c2442_subsys = {
145 .name = "s3c2442-core", 146 .name = "s3c2442-core",
147 .dev_name = "s3c2442-core",
146}; 148};
147 149
148/* need to register class before we actually register the device, and 150/* need to register the subsystem before we actually register the device, and
149 * we also need to ensure that it has been initialised before any of the 151 * we also need to ensure that it has been initialised before any of the
150 * drivers even try to use it (even if not on an s3c2440 based system) 152 * drivers even try to use it (even if not on an s3c2440 based system)
151 * as a driver which may support both 2410 and 2440 may try and use it. 153 * as a driver which may support both 2410 and 2440 may try and use it.
@@ -153,14 +155,14 @@ struct sysdev_class s3c2442_sysclass = {
153 155
154static int __init s3c2440_core_init(void) 156static int __init s3c2440_core_init(void)
155{ 157{
156 return sysdev_class_register(&s3c2440_sysclass); 158 return subsys_system_register(&s3c2440_subsys, NULL);
157} 159}
158 160
159core_initcall(s3c2440_core_init); 161core_initcall(s3c2440_core_init);
160 162
161static int __init s3c2442_core_init(void) 163static int __init s3c2442_core_init(void)
162{ 164{
163 return sysdev_class_register(&s3c2442_sysclass); 165 return subsys_system_register(&s3c2442_subsys, NULL);
164} 166}
165 167
166core_initcall(s3c2442_core_init); 168core_initcall(s3c2442_core_init);
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 1c2c088aa2e8..6dde2696f8f0 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -27,7 +27,7 @@
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/sysdev.h> 30#include <linux/device.h>
31#include <linux/clk.h> 31#include <linux/clk.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c2443/dma.c
index fe52151d2e84..de6b4a23c9ed 100644
--- a/arch/arm/mach-s3c2443/dma.c
+++ b/arch/arm/mach-s3c2443/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
@@ -135,19 +135,21 @@ static struct s3c24xx_dma_selection __initdata s3c2443_dma_sel = {
135 .map_size = ARRAY_SIZE(s3c2443_dma_mappings), 135 .map_size = ARRAY_SIZE(s3c2443_dma_mappings),
136}; 136};
137 137
138static int __init s3c2443_dma_add(struct sys_device *sysdev) 138static int __init s3c2443_dma_add(struct device *dev)
139{ 139{
140 s3c24xx_dma_init(6, IRQ_S3C2443_DMA0, 0x100); 140 s3c24xx_dma_init(6, IRQ_S3C2443_DMA0, 0x100);
141 return s3c24xx_dma_init_map(&s3c2443_dma_sel); 141 return s3c24xx_dma_init_map(&s3c2443_dma_sel);
142} 142}
143 143
144static struct sysdev_driver s3c2443_dma_driver = { 144static struct subsys_interface s3c2443_dma_interface = {
145 .add = s3c2443_dma_add, 145 .name = "s3c2443_dma",
146 .subsys = &s3c2443_subsys,
147 .add_dev = s3c2443_dma_add,
146}; 148};
147 149
148static int __init s3c2443_dma_init(void) 150static int __init s3c2443_dma_init(void)
149{ 151{
150 return sysdev_driver_register(&s3c2443_sysclass, &s3c2443_dma_driver); 152 return subsys_interface_register(&s3c2443_dma_interface);
151} 153}
152 154
153arch_initcall(s3c2443_dma_init); 155arch_initcall(s3c2443_dma_init);
diff --git a/arch/arm/mach-s3c2443/irq.c b/arch/arm/mach-s3c2443/irq.c
index 83ecb1173fb1..35e4ff24fb43 100644
--- a/arch/arm/mach-s3c2443/irq.c
+++ b/arch/arm/mach-s3c2443/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -241,7 +241,7 @@ static int __init s3c2443_add_sub(unsigned int base,
241 return 0; 241 return 0;
242} 242}
243 243
244static int __init s3c2443_irq_add(struct sys_device *sysdev) 244static int __init s3c2443_irq_add(struct device *dev)
245{ 245{
246 printk("S3C2443: IRQ Support\n"); 246 printk("S3C2443: IRQ Support\n");
247 247
@@ -265,13 +265,15 @@ static int __init s3c2443_irq_add(struct sys_device *sysdev)
265 return 0; 265 return 0;
266} 266}
267 267
268static struct sysdev_driver s3c2443_irq_driver = { 268static struct subsys_interface s3c2443_irq_interface = {
269 .add = s3c2443_irq_add, 269 .name = "s3c2443_irq",
270 .subsys = &s3c2443_subsys,
271 .add_dev = s3c2443_irq_add,
270}; 272};
271 273
272static int __init s3c2443_irq_init(void) 274static int __init s3c2443_irq_init(void)
273{ 275{
274 return sysdev_driver_register(&s3c2443_sysclass, &s3c2443_irq_driver); 276 return subsys_interface_register(&s3c2443_irq_interface);
275} 277}
276 278
277arch_initcall(s3c2443_irq_init); 279arch_initcall(s3c2443_irq_init);
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index bec107e00441..209236956222 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -145,4 +145,5 @@ MACHINE_START(SMDK2443, "SMDK2443")
145 .map_io = smdk2443_map_io, 145 .map_io = smdk2443_map_io,
146 .init_machine = smdk2443_machine_init, 146 .init_machine = smdk2443_machine_init,
147 .timer = &s3c24xx_timer, 147 .timer = &s3c24xx_timer,
148 .restart = s3c2443_restart,
148MACHINE_END 149MACHINE_END
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index a22b771b0f36..b9deaeb0dfff 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -19,7 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
@@ -31,7 +31,6 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32 32
33#include <mach/regs-s3c2443-clock.h> 33#include <mach/regs-s3c2443-clock.h>
34#include <mach/reset.h>
35 34
36#include <plat/gpio-core.h> 35#include <plat/gpio-core.h>
37#include <plat/gpio-cfg.h> 36#include <plat/gpio-cfg.h>
@@ -49,16 +48,20 @@ static struct map_desc s3c2443_iodesc[] __initdata = {
49 IODESC_ENT(TIMER), 48 IODESC_ENT(TIMER),
50}; 49};
51 50
52struct sysdev_class s3c2443_sysclass = { 51struct bus_type s3c2443_subsys = {
53 .name = "s3c2443-core", 52 .name = "s3c2443-core",
53 .dev_name = "s3c2443-core",
54}; 54};
55 55
56static struct sys_device s3c2443_sysdev = { 56static struct device s3c2443_dev = {
57 .cls = &s3c2443_sysclass, 57 .bus = &s3c2443_subsys,
58}; 58};
59 59
60static void s3c2443_hard_reset(void) 60void s3c2443_restart(char mode, const char *cmd)
61{ 61{
62 if (mode == 's')
63 soft_restart(0);
64
62 __raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST); 65 __raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
63} 66}
64 67
@@ -66,8 +69,6 @@ int __init s3c2443_init(void)
66{ 69{
67 printk("S3C2443: Initialising architecture\n"); 70 printk("S3C2443: Initialising architecture\n");
68 71
69 s3c24xx_reset_hook = s3c2443_hard_reset;
70
71 s3c_nand_setname("s3c2412-nand"); 72 s3c_nand_setname("s3c2412-nand");
72 s3c_fb_setname("s3c2443-fb"); 73 s3c_fb_setname("s3c2443-fb");
73 74
@@ -77,7 +78,7 @@ int __init s3c2443_init(void)
77 s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT; 78 s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
78 s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT; 79 s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT;
79 80
80 return sysdev_register(&s3c2443_sysdev); 81 return device_register(&s3c2443_dev);
81} 82}
82 83
83void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no) 84void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
@@ -99,7 +100,7 @@ void __init s3c2443_map_io(void)
99 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); 100 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
100} 101}
101 102
102/* need to register class before we actually register the device, and 103/* need to register the subsystem before we actually register the device, and
103 * we also need to ensure that it has been initialised before any of the 104 * we also need to ensure that it has been initialised before any of the
104 * drivers even try to use it (even if not on an s3c2443 based system) 105 * drivers even try to use it (even if not on an s3c2443 based system)
105 * as a driver which may support both 2443 and 2440 may try and use it. 106 * as a driver which may support both 2443 and 2440 may try and use it.
@@ -107,7 +108,7 @@ void __init s3c2443_map_io(void)
107 108
108static int __init s3c2443_core_init(void) 109static int __init s3c2443_core_init(void)
109{ 110{
110 return sysdev_class_register(&s3c2443_sysclass); 111 return subsys_system_register(&s3c2443_subsys, NULL);
111} 112}
112 113
113core_initcall(s3c2443_core_init); 114core_initcall(s3c2443_core_init);
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 5552e048c2be..381586c7b1b2 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -8,6 +8,7 @@ config PLAT_S3C64XX
8 bool 8 bool
9 depends on ARCH_S3C64XX 9 depends on ARCH_S3C64XX
10 select SAMSUNG_WAKEMASK 10 select SAMSUNG_WAKEMASK
11 select PM_GENERIC_DOMAINS
11 default y 12 default y
12 help 13 help
13 Base platform code for any Samsung S3C64XX device 14 Base platform code for any Samsung S3C64XX device
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index cfc0b9941808..f37016cebbe3 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -10,54 +10,49 @@ obj-m :=
10obj-n := 10obj-n :=
11obj- := 11obj- :=
12 12
13# Core files 13# Core
14obj-y += cpu.o
15obj-y += clock.o
16 14
17# Core support for S3C6400 system 15obj-y += common.o clock.o
16
17# Core support
18 18
19obj-$(CONFIG_CPU_S3C6400) += s3c6400.o 19obj-$(CONFIG_CPU_S3C6400) += s3c6400.o
20obj-$(CONFIG_CPU_S3C6410) += s3c6410.o 20obj-$(CONFIG_CPU_S3C6410) += s3c6410.o
21 21
22obj-y += irq.o 22# PM
23obj-y += irq-eint.o 23
24obj-$(CONFIG_PM) += pm.o irq-pm.o sleep.o
24 25
25# DMA support 26# DMA support
26 27
27obj-$(CONFIG_S3C64XX_DMA) += dma.o 28obj-$(CONFIG_S3C64XX_DMA) += dma.o
28 29
29# Device setup 30# Device support
30 31
31obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o 32obj-y += dev-uart.o
32obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o 33obj-y += dev-audio.o
33obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o 34obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
34obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o
35obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
36obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
37obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
38 35
39# PM 36# Device setup
40 37
41obj-$(CONFIG_PM) += pm.o 38obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
42obj-$(CONFIG_PM) += sleep.o 39obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
43obj-$(CONFIG_PM) += irq-pm.o 40obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
41obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o
42obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o
43obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
44obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
44 45
45# Machine support 46# Machine support
46 47
47obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o 48obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
48obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o 49obj-$(CONFIG_MACH_HMT) += mach-hmt.o
49obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o 50obj-$(CONFIG_MACH_MINI6410) += mach-mini6410.o
50obj-$(CONFIG_MACH_REAL6410) += mach-real6410.o 51obj-$(CONFIG_MACH_NCP) += mach-ncp.o
51obj-$(CONFIG_MACH_MINI6410) += mach-mini6410.o 52obj-$(CONFIG_MACH_REAL6410) += mach-real6410.o
52obj-$(CONFIG_MACH_NCP) += mach-ncp.o 53obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o
53obj-$(CONFIG_MACH_HMT) += mach-hmt.o 54obj-$(CONFIG_MACH_SMARTQ5) += mach-smartq5.o
54obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o 55obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o
55obj-$(CONFIG_MACH_SMARTQ5) += mach-smartq5.o 56obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
56obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o 57obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
57obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o 58obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o
58
59# device support
60
61obj-y += dev-uart.o
62obj-y += dev-audio.o
63obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c
index 39c238d7a3dc..625219b9cefc 100644
--- a/arch/arm/mach-s3c64xx/clock.c
+++ b/arch/arm/mach-s3c64xx/clock.c
@@ -705,7 +705,7 @@ static struct clksrc_clk *init_parents[] = {
705 705
706#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 706#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
707 707
708void __init_or_cpufreq s3c6400_setup_clocks(void) 708void __init_or_cpufreq s3c64xx_setup_clocks(void)
709{ 709{
710 struct clk *xtal_clk; 710 struct clk *xtal_clk;
711 unsigned long xtal; 711 unsigned long xtal;
@@ -804,7 +804,7 @@ static struct clk *clks[] __initdata = {
804 * as ARMCLK as well as the necessary parent clocks. 804 * as ARMCLK as well as the necessary parent clocks.
805 * 805 *
806 * This call does not setup the clocks, which is left to the 806 * This call does not setup the clocks, which is left to the
807 * s3c6400_setup_clocks() call which may be needed by the cpufreq 807 * s3c64xx_setup_clocks() call which may be needed by the cpufreq
808 * or resume code to re-set the clocks if the bootloader has changed 808 * or resume code to re-set the clocks if the bootloader has changed
809 * them. 809 * them.
810 */ 810 */
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
new file mode 100644
index 000000000000..4a7394d4bd9e
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -0,0 +1,385 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Copyright 2008 Openmoko, Inc.
6 * Copyright 2008 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 * http://armlinux.simtec.co.uk/
9 *
10 * Common Codes for S3C64XX machines
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/module.h>
20#include <linux/interrupt.h>
21#include <linux/ioport.h>
22#include <linux/serial_core.h>
23#include <linux/platform_device.h>
24#include <linux/io.h>
25#include <linux/dma-mapping.h>
26#include <linux/irq.h>
27#include <linux/gpio.h>
28
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31#include <asm/hardware/vic.h>
32
33#include <mach/map.h>
34#include <mach/hardware.h>
35#include <mach/regs-gpio.h>
36
37#include <plat/cpu.h>
38#include <plat/clock.h>
39#include <plat/devs.h>
40#include <plat/pm.h>
41#include <plat/gpio-cfg.h>
42#include <plat/irq-uart.h>
43#include <plat/irq-vic-timer.h>
44#include <plat/regs-irqtype.h>
45#include <plat/regs-serial.h>
46#include <plat/watchdog-reset.h>
47
48#include "common.h"
49
50/* uart registration process */
51
52void __init s3c64xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
53{
54 s3c24xx_init_uartdevs("s3c6400-uart", s3c64xx_uart_resources, cfg, no);
55}
56
57/* table of supported CPUs */
58
59static const char name_s3c6400[] = "S3C6400";
60static const char name_s3c6410[] = "S3C6410";
61
62static struct cpu_table cpu_ids[] __initdata = {
63 {
64 .idcode = S3C6400_CPU_ID,
65 .idmask = S3C64XX_CPU_MASK,
66 .map_io = s3c6400_map_io,
67 .init_clocks = s3c6400_init_clocks,
68 .init_uarts = s3c64xx_init_uarts,
69 .init = s3c6400_init,
70 .name = name_s3c6400,
71 }, {
72 .idcode = S3C6410_CPU_ID,
73 .idmask = S3C64XX_CPU_MASK,
74 .map_io = s3c6410_map_io,
75 .init_clocks = s3c6410_init_clocks,
76 .init_uarts = s3c64xx_init_uarts,
77 .init = s3c6410_init,
78 .name = name_s3c6410,
79 },
80};
81
82/* minimal IO mapping */
83
84/* see notes on uart map in arch/arm/mach-s3c64xx/include/mach/debug-macro.S */
85#define UART_OFFS (S3C_PA_UART & 0xfffff)
86
87static struct map_desc s3c_iodesc[] __initdata = {
88 {
89 .virtual = (unsigned long)S3C_VA_SYS,
90 .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),
91 .length = SZ_4K,
92 .type = MT_DEVICE,
93 }, {
94 .virtual = (unsigned long)S3C_VA_MEM,
95 .pfn = __phys_to_pfn(S3C64XX_PA_SROM),
96 .length = SZ_4K,
97 .type = MT_DEVICE,
98 }, {
99 .virtual = (unsigned long)(S3C_VA_UART + UART_OFFS),
100 .pfn = __phys_to_pfn(S3C_PA_UART),
101 .length = SZ_4K,
102 .type = MT_DEVICE,
103 }, {
104 .virtual = (unsigned long)VA_VIC0,
105 .pfn = __phys_to_pfn(S3C64XX_PA_VIC0),
106 .length = SZ_16K,
107 .type = MT_DEVICE,
108 }, {
109 .virtual = (unsigned long)VA_VIC1,
110 .pfn = __phys_to_pfn(S3C64XX_PA_VIC1),
111 .length = SZ_16K,
112 .type = MT_DEVICE,
113 }, {
114 .virtual = (unsigned long)S3C_VA_TIMER,
115 .pfn = __phys_to_pfn(S3C_PA_TIMER),
116 .length = SZ_16K,
117 .type = MT_DEVICE,
118 }, {
119 .virtual = (unsigned long)S3C64XX_VA_GPIO,
120 .pfn = __phys_to_pfn(S3C64XX_PA_GPIO),
121 .length = SZ_4K,
122 .type = MT_DEVICE,
123 }, {
124 .virtual = (unsigned long)S3C64XX_VA_MODEM,
125 .pfn = __phys_to_pfn(S3C64XX_PA_MODEM),
126 .length = SZ_4K,
127 .type = MT_DEVICE,
128 }, {
129 .virtual = (unsigned long)S3C_VA_WATCHDOG,
130 .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG),
131 .length = SZ_4K,
132 .type = MT_DEVICE,
133 }, {
134 .virtual = (unsigned long)S3C_VA_USB_HSPHY,
135 .pfn = __phys_to_pfn(S3C64XX_PA_USB_HSPHY),
136 .length = SZ_1K,
137 .type = MT_DEVICE,
138 },
139};
140
141static struct bus_type s3c64xx_subsys = {
142 .name = "s3c64xx-core",
143 .dev_name = "s3c64xx-core",
144};
145
146static struct device s3c64xx_dev = {
147 .bus = &s3c64xx_subsys,
148};
149
150/* read cpu identification code */
151
152void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
153{
154 /* initialise the io descriptors we need for initialisation */
155 iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
156 iotable_init(mach_desc, size);
157 init_consistent_dma_size(SZ_8M);
158
159 /* detect cpu id */
160 s3c64xx_init_cpu();
161
162 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
163}
164
165static __init int s3c64xx_dev_init(void)
166{
167 subsys_system_register(&s3c64xx_subsys, NULL);
168 return device_register(&s3c64xx_dev);
169}
170core_initcall(s3c64xx_dev_init);
171
172/*
173 * setup the sources the vic should advertise resume
174 * for, even though it is not doing the wake
175 * (set_irq_wake needs to be valid)
176 */
177#define IRQ_VIC0_RESUME (1 << (IRQ_RTC_TIC - IRQ_VIC0_BASE))
178#define IRQ_VIC1_RESUME (1 << (IRQ_RTC_ALARM - IRQ_VIC1_BASE) | \
179 1 << (IRQ_PENDN - IRQ_VIC1_BASE) | \
180 1 << (IRQ_HSMMC0 - IRQ_VIC1_BASE) | \
181 1 << (IRQ_HSMMC1 - IRQ_VIC1_BASE) | \
182 1 << (IRQ_HSMMC2 - IRQ_VIC1_BASE))
183
184void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
185{
186 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
187
188 /* initialise the pair of VICs */
189 vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
190 vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
191
192 /* add the timer sub-irqs */
193 s3c_init_vic_timer_irq(5, IRQ_TIMER0);
194}
195
196#define eint_offset(irq) ((irq) - IRQ_EINT(0))
197#define eint_irq_to_bit(irq) ((u32)(1 << eint_offset(irq)))
198
199static inline void s3c_irq_eint_mask(struct irq_data *data)
200{
201 u32 mask;
202
203 mask = __raw_readl(S3C64XX_EINT0MASK);
204 mask |= (u32)data->chip_data;
205 __raw_writel(mask, S3C64XX_EINT0MASK);
206}
207
208static void s3c_irq_eint_unmask(struct irq_data *data)
209{
210 u32 mask;
211
212 mask = __raw_readl(S3C64XX_EINT0MASK);
213 mask &= ~((u32)data->chip_data);
214 __raw_writel(mask, S3C64XX_EINT0MASK);
215}
216
217static inline void s3c_irq_eint_ack(struct irq_data *data)
218{
219 __raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND);
220}
221
222static void s3c_irq_eint_maskack(struct irq_data *data)
223{
224 /* compiler should in-line these */
225 s3c_irq_eint_mask(data);
226 s3c_irq_eint_ack(data);
227}
228
229static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type)
230{
231 int offs = eint_offset(data->irq);
232 int pin, pin_val;
233 int shift;
234 u32 ctrl, mask;
235 u32 newvalue = 0;
236 void __iomem *reg;
237
238 if (offs > 27)
239 return -EINVAL;
240
241 if (offs <= 15)
242 reg = S3C64XX_EINT0CON0;
243 else
244 reg = S3C64XX_EINT0CON1;
245
246 switch (type) {
247 case IRQ_TYPE_NONE:
248 printk(KERN_WARNING "No edge setting!\n");
249 break;
250
251 case IRQ_TYPE_EDGE_RISING:
252 newvalue = S3C2410_EXTINT_RISEEDGE;
253 break;
254
255 case IRQ_TYPE_EDGE_FALLING:
256 newvalue = S3C2410_EXTINT_FALLEDGE;
257 break;
258
259 case IRQ_TYPE_EDGE_BOTH:
260 newvalue = S3C2410_EXTINT_BOTHEDGE;
261 break;
262
263 case IRQ_TYPE_LEVEL_LOW:
264 newvalue = S3C2410_EXTINT_LOWLEV;
265 break;
266
267 case IRQ_TYPE_LEVEL_HIGH:
268 newvalue = S3C2410_EXTINT_HILEV;
269 break;
270
271 default:
272 printk(KERN_ERR "No such irq type %d", type);
273 return -1;
274 }
275
276 if (offs <= 15)
277 shift = (offs / 2) * 4;
278 else
279 shift = ((offs - 16) / 2) * 4;
280 mask = 0x7 << shift;
281
282 ctrl = __raw_readl(reg);
283 ctrl &= ~mask;
284 ctrl |= newvalue << shift;
285 __raw_writel(ctrl, reg);
286
287 /* set the GPIO pin appropriately */
288
289 if (offs < 16) {
290 pin = S3C64XX_GPN(offs);
291 pin_val = S3C_GPIO_SFN(2);
292 } else if (offs < 23) {
293 pin = S3C64XX_GPL(offs + 8 - 16);
294 pin_val = S3C_GPIO_SFN(3);
295 } else {
296 pin = S3C64XX_GPM(offs - 23);
297 pin_val = S3C_GPIO_SFN(3);
298 }
299
300 s3c_gpio_cfgpin(pin, pin_val);
301
302 return 0;
303}
304
305static struct irq_chip s3c_irq_eint = {
306 .name = "s3c-eint",
307 .irq_mask = s3c_irq_eint_mask,
308 .irq_unmask = s3c_irq_eint_unmask,
309 .irq_mask_ack = s3c_irq_eint_maskack,
310 .irq_ack = s3c_irq_eint_ack,
311 .irq_set_type = s3c_irq_eint_set_type,
312 .irq_set_wake = s3c_irqext_wake,
313};
314
315/* s3c_irq_demux_eint
316 *
317 * This function demuxes the IRQ from the group0 external interrupts,
318 * from IRQ_EINT(0) to IRQ_EINT(27). It is designed to be inlined into
319 * the specific handlers s3c_irq_demux_eintX_Y.
320 */
321static inline void s3c_irq_demux_eint(unsigned int start, unsigned int end)
322{
323 u32 status = __raw_readl(S3C64XX_EINT0PEND);
324 u32 mask = __raw_readl(S3C64XX_EINT0MASK);
325 unsigned int irq;
326
327 status &= ~mask;
328 status >>= start;
329 status &= (1 << (end - start + 1)) - 1;
330
331 for (irq = IRQ_EINT(start); irq <= IRQ_EINT(end); irq++) {
332 if (status & 1)
333 generic_handle_irq(irq);
334
335 status >>= 1;
336 }
337}
338
339static void s3c_irq_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
340{
341 s3c_irq_demux_eint(0, 3);
342}
343
344static void s3c_irq_demux_eint4_11(unsigned int irq, struct irq_desc *desc)
345{
346 s3c_irq_demux_eint(4, 11);
347}
348
349static void s3c_irq_demux_eint12_19(unsigned int irq, struct irq_desc *desc)
350{
351 s3c_irq_demux_eint(12, 19);
352}
353
354static void s3c_irq_demux_eint20_27(unsigned int irq, struct irq_desc *desc)
355{
356 s3c_irq_demux_eint(20, 27);
357}
358
359static int __init s3c64xx_init_irq_eint(void)
360{
361 int irq;
362
363 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
364 irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq);
365 irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq));
366 set_irq_flags(irq, IRQF_VALID);
367 }
368
369 irq_set_chained_handler(IRQ_EINT0_3, s3c_irq_demux_eint0_3);
370 irq_set_chained_handler(IRQ_EINT4_11, s3c_irq_demux_eint4_11);
371 irq_set_chained_handler(IRQ_EINT12_19, s3c_irq_demux_eint12_19);
372 irq_set_chained_handler(IRQ_EINT20_27, s3c_irq_demux_eint20_27);
373
374 return 0;
375}
376arch_initcall(s3c64xx_init_irq_eint);
377
378void s3c64xx_restart(char mode, const char *cmd)
379{
380 if (mode != 's')
381 arch_wdt_reset();
382
383 /* if all else fails, or mode was for soft, jump to 0 */
384 soft_restart(0);
385}
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
new file mode 100644
index 000000000000..5eb9c9a7d73b
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/common.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Copyright 2008 Openmoko, Inc.
6 * Copyright 2008 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 * http://armlinux.simtec.co.uk/
9 *
10 * Common Header for S3C64XX machines
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#ifndef __ARCH_ARM_MACH_S3C64XX_COMMON_H
18#define __ARCH_ARM_MACH_S3C64XX_COMMON_H
19
20void s3c64xx_init_irq(u32 vic0, u32 vic1);
21void s3c64xx_init_io(struct map_desc *mach_desc, int size);
22
23void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
24void s3c64xx_setup_clocks(void);
25
26void s3c64xx_restart(char mode, const char *cmd);
27
28extern struct syscore_ops s3c64xx_irq_syscore_ops;
29
30#ifdef CONFIG_CPU_S3C6400
31
32extern int s3c6400_init(void);
33extern void s3c6400_init_irq(void);
34extern void s3c6400_map_io(void);
35extern void s3c6400_init_clocks(int xtal);
36
37#else
38#define s3c6400_init_clocks NULL
39#define s3c6400_map_io NULL
40#define s3c6400_init NULL
41#endif
42
43#ifdef CONFIG_CPU_S3C6410
44
45extern int s3c6410_init(void);
46extern void s3c6410_init_irq(void);
47extern void s3c6410_map_io(void);
48extern void s3c6410_init_clocks(int xtal);
49
50#else
51#define s3c6410_init_clocks NULL
52#define s3c6410_map_io NULL
53#define s3c6410_init NULL
54#endif
55
56#endif /* __ARCH_ARM_MACH_S3C64XX_COMMON_H */
diff --git a/arch/arm/mach-s3c64xx/cpu.c b/arch/arm/mach-s3c64xx/cpu.c
deleted file mode 100644
index de085b798aa4..000000000000
--- a/arch/arm/mach-s3c64xx/cpu.c
+++ /dev/null
@@ -1,161 +0,0 @@
1/* linux/arch/arm/plat-s3c64xx/cpu.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX CPU Support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/sysdev.h>
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22#include <linux/io.h>
23#include <linux/dma-mapping.h>
24
25#include <mach/hardware.h>
26#include <mach/map.h>
27
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30
31#include <plat/regs-serial.h>
32
33#include <plat/cpu.h>
34#include <plat/devs.h>
35#include <plat/clock.h>
36
37#include <plat/s3c6400.h>
38#include <plat/s3c6410.h>
39
40/* table of supported CPUs */
41
42static const char name_s3c6400[] = "S3C6400";
43static const char name_s3c6410[] = "S3C6410";
44
45static struct cpu_table cpu_ids[] __initdata = {
46 {
47 .idcode = S3C6400_CPU_ID,
48 .idmask = S3C64XX_CPU_MASK,
49 .map_io = s3c6400_map_io,
50 .init_clocks = s3c6400_init_clocks,
51 .init_uarts = s3c6400_init_uarts,
52 .init = s3c6400_init,
53 .name = name_s3c6400,
54 }, {
55 .idcode = S3C6410_CPU_ID,
56 .idmask = S3C64XX_CPU_MASK,
57 .map_io = s3c6410_map_io,
58 .init_clocks = s3c6410_init_clocks,
59 .init_uarts = s3c6410_init_uarts,
60 .init = s3c6410_init,
61 .name = name_s3c6410,
62 },
63};
64
65/* minimal IO mapping */
66
67/* see notes on uart map in arch/arm/mach-s3c6400/include/mach/debug-macro.S */
68#define UART_OFFS (S3C_PA_UART & 0xfffff)
69
70static struct map_desc s3c_iodesc[] __initdata = {
71 {
72 .virtual = (unsigned long)S3C_VA_SYS,
73 .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),
74 .length = SZ_4K,
75 .type = MT_DEVICE,
76 }, {
77 .virtual = (unsigned long)S3C_VA_MEM,
78 .pfn = __phys_to_pfn(S3C64XX_PA_SROM),
79 .length = SZ_4K,
80 .type = MT_DEVICE,
81 }, {
82 .virtual = (unsigned long)(S3C_VA_UART + UART_OFFS),
83 .pfn = __phys_to_pfn(S3C_PA_UART),
84 .length = SZ_4K,
85 .type = MT_DEVICE,
86 }, {
87 .virtual = (unsigned long)VA_VIC0,
88 .pfn = __phys_to_pfn(S3C64XX_PA_VIC0),
89 .length = SZ_16K,
90 .type = MT_DEVICE,
91 }, {
92 .virtual = (unsigned long)VA_VIC1,
93 .pfn = __phys_to_pfn(S3C64XX_PA_VIC1),
94 .length = SZ_16K,
95 .type = MT_DEVICE,
96 }, {
97 .virtual = (unsigned long)S3C_VA_TIMER,
98 .pfn = __phys_to_pfn(S3C_PA_TIMER),
99 .length = SZ_16K,
100 .type = MT_DEVICE,
101 }, {
102 .virtual = (unsigned long)S3C64XX_VA_GPIO,
103 .pfn = __phys_to_pfn(S3C64XX_PA_GPIO),
104 .length = SZ_4K,
105 .type = MT_DEVICE,
106 }, {
107 .virtual = (unsigned long)S3C64XX_VA_MODEM,
108 .pfn = __phys_to_pfn(S3C64XX_PA_MODEM),
109 .length = SZ_4K,
110 .type = MT_DEVICE,
111 }, {
112 .virtual = (unsigned long)S3C_VA_WATCHDOG,
113 .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG),
114 .length = SZ_4K,
115 .type = MT_DEVICE,
116 }, {
117 .virtual = (unsigned long)S3C_VA_USB_HSPHY,
118 .pfn = __phys_to_pfn(S3C64XX_PA_USB_HSPHY),
119 .length = SZ_1K,
120 .type = MT_DEVICE,
121 },
122};
123
124
125struct sysdev_class s3c64xx_sysclass = {
126 .name = "s3c64xx-core",
127};
128
129static struct sys_device s3c64xx_sysdev = {
130 .cls = &s3c64xx_sysclass,
131};
132
133/* uart registration process */
134
135void __init s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
136{
137 s3c24xx_init_uartdevs("s3c6400-uart", s3c64xx_uart_resources, cfg, no);
138}
139
140/* read cpu identification code */
141
142void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
143{
144 /* initialise the io descriptors we need for initialisation */
145 iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
146 iotable_init(mach_desc, size);
147 init_consistent_dma_size(SZ_8M);
148
149 /* detect cpu id */
150 s3c64xx_init_cpu();
151
152 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
153}
154
155static __init int s3c64xx_sysdev_init(void)
156{
157 sysdev_class_register(&s3c64xx_sysclass);
158 return sysdev_register(&s3c64xx_sysdev);
159}
160
161core_initcall(s3c64xx_sysdev_init);
diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c
index 5e6b42089eb4..3341fd118723 100644
--- a/arch/arm/mach-s3c64xx/dev-spi.c
+++ b/arch/arm/mach-s3c64xx/dev-spi.c
@@ -10,6 +10,7 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/export.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
14#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
15#include <linux/gpio.h> 16#include <linux/gpio.h>
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index 17d62f4f8204..f2a7a1725596 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -16,7 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/dmapool.h> 18#include <linux/dmapool.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
@@ -35,7 +35,7 @@
35/* dma channel state information */ 35/* dma channel state information */
36 36
37struct s3c64xx_dmac { 37struct s3c64xx_dmac {
38 struct sys_device sysdev; 38 struct device dev;
39 struct clk *clk; 39 struct clk *clk;
40 void __iomem *regs; 40 void __iomem *regs;
41 struct s3c2410_dma_chan *channels; 41 struct s3c2410_dma_chan *channels;
@@ -631,8 +631,9 @@ static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
631 return IRQ_HANDLED; 631 return IRQ_HANDLED;
632} 632}
633 633
634static struct sysdev_class dma_sysclass = { 634static struct bus_type dma_subsys = {
635 .name = "s3c64xx-dma", 635 .name = "s3c64xx-dma",
636 .dev_name = "s3c64xx-dma",
636}; 637};
637 638
638static int s3c64xx_dma_init1(int chno, enum dma_ch chbase, 639static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
@@ -651,12 +652,12 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
651 return -ENOMEM; 652 return -ENOMEM;
652 } 653 }
653 654
654 dmac->sysdev.id = chno / 8; 655 dmac->dev.id = chno / 8;
655 dmac->sysdev.cls = &dma_sysclass; 656 dmac->dev.bus = &dma_subsys;
656 657
657 err = sysdev_register(&dmac->sysdev); 658 err = device_register(&dmac->dev);
658 if (err) { 659 if (err) {
659 printk(KERN_ERR "%s: failed to register sysdevice\n", __func__); 660 printk(KERN_ERR "%s: failed to register device\n", __func__);
660 goto err_alloc; 661 goto err_alloc;
661 } 662 }
662 663
@@ -667,7 +668,7 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
667 goto err_dev; 668 goto err_dev;
668 } 669 }
669 670
670 snprintf(clkname, sizeof(clkname), "dma%d", dmac->sysdev.id); 671 snprintf(clkname, sizeof(clkname), "dma%d", dmac->dev.id);
671 672
672 dmac->clk = clk_get(NULL, clkname); 673 dmac->clk = clk_get(NULL, clkname);
673 if (IS_ERR(dmac->clk)) { 674 if (IS_ERR(dmac->clk)) {
@@ -715,7 +716,7 @@ err_clk:
715err_map: 716err_map:
716 iounmap(regs); 717 iounmap(regs);
717err_dev: 718err_dev:
718 sysdev_unregister(&dmac->sysdev); 719 device_unregister(&dmac->dev);
719err_alloc: 720err_alloc:
720 kfree(dmac); 721 kfree(dmac);
721 return err; 722 return err;
@@ -733,9 +734,9 @@ static int __init s3c64xx_dma_init(void)
733 return -ENOMEM; 734 return -ENOMEM;
734 } 735 }
735 736
736 ret = sysdev_class_register(&dma_sysclass); 737 ret = subsys_system_register(&dma_subsys, NULL);
737 if (ret) { 738 if (ret) {
738 printk(KERN_ERR "%s: failed to create sysclass\n", __func__); 739 printk(KERN_ERR "%s: failed to create subsys\n", __func__);
739 return -ENOMEM; 740 return -ENOMEM;
740 } 741 }
741 742
diff --git a/arch/arm/mach-s3c64xx/include/mach/entry-macro.S b/arch/arm/mach-s3c64xx/include/mach/entry-macro.S
index dd362604dcce..dc2bc15142ce 100644
--- a/arch/arm/mach-s3c64xx/include/mach/entry-macro.S
+++ b/arch/arm/mach-s3c64xx/include/mach/entry-macro.S
@@ -12,7 +12,8 @@
12 * warranty of any kind, whether express or implied. 12 * warranty of any kind, whether express or implied.
13*/ 13*/
14 14
15#include <mach/map.h> 15 .macro disable_fiq
16#include <mach/irqs.h> 16 .endm
17 17
18#include <asm/entry-macro-vic2.S> 18 .macro arch_ret_to_user, tmp1, tmp2
19 .endm
diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
index 2e58cb7a7147..353ed4389ae7 100644
--- a/arch/arm/mach-s3c64xx/include/mach/system.h
+++ b/arch/arm/mach-s3c64xx/include/mach/system.h
@@ -11,20 +11,9 @@
11#ifndef __ASM_ARCH_SYSTEM_H 11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H __FILE__ 12#define __ASM_ARCH_SYSTEM_H __FILE__
13 13
14#include <plat/watchdog-reset.h>
15
16static void arch_idle(void) 14static void arch_idle(void)
17{ 15{
18 /* nothing here yet */ 16 /* nothing here yet */
19} 17}
20 18
21static void arch_reset(char mode, const char *cmd)
22{
23 if (mode != 's')
24 arch_wdt_reset();
25
26 /* if all else fails, or mode was for soft, jump to 0 */
27 cpu_reset(0);
28}
29
30#endif /* __ASM_ARCH_IRQ_H */ 19#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
index 23f75e556a30..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/* arch/arm/mach-s3c64xx/include/mach/vmalloc.h
2 *
3 * from arch/arm/mach-iop3xx/include/mach/vmalloc.h
4 *
5 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
6 * http://www.simtec.co.uk/products/SWLINUX/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * S3C6400 vmalloc definition
13*/
14
15#ifndef __ASM_ARCH_VMALLOC_H
16#define __ASM_ARCH_VMALLOC_H
17
18#define VMALLOC_END 0xF6000000UL
19
20#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s3c64xx/irq-eint.c b/arch/arm/mach-s3c64xx/irq-eint.c
deleted file mode 100644
index 4d203be1f4c3..000000000000
--- a/arch/arm/mach-s3c64xx/irq-eint.c
+++ /dev/null
@@ -1,213 +0,0 @@
1/* arch/arm/plat-s3c64xx/irq-eint.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - Interrupt handling for IRQ_EINT(x)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/interrupt.h>
17#include <linux/sysdev.h>
18#include <linux/gpio.h>
19#include <linux/irq.h>
20#include <linux/io.h>
21
22#include <asm/hardware/vic.h>
23
24#include <plat/regs-irqtype.h>
25#include <mach/regs-gpio.h>
26#include <plat/gpio-cfg.h>
27
28#include <mach/map.h>
29#include <plat/cpu.h>
30#include <plat/pm.h>
31
32#define eint_offset(irq) ((irq) - IRQ_EINT(0))
33#define eint_irq_to_bit(irq) ((u32)(1 << eint_offset(irq)))
34
35static inline void s3c_irq_eint_mask(struct irq_data *data)
36{
37 u32 mask;
38
39 mask = __raw_readl(S3C64XX_EINT0MASK);
40 mask |= (u32)data->chip_data;
41 __raw_writel(mask, S3C64XX_EINT0MASK);
42}
43
44static void s3c_irq_eint_unmask(struct irq_data *data)
45{
46 u32 mask;
47
48 mask = __raw_readl(S3C64XX_EINT0MASK);
49 mask &= ~((u32)data->chip_data);
50 __raw_writel(mask, S3C64XX_EINT0MASK);
51}
52
53static inline void s3c_irq_eint_ack(struct irq_data *data)
54{
55 __raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND);
56}
57
58static void s3c_irq_eint_maskack(struct irq_data *data)
59{
60 /* compiler should in-line these */
61 s3c_irq_eint_mask(data);
62 s3c_irq_eint_ack(data);
63}
64
65static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type)
66{
67 int offs = eint_offset(data->irq);
68 int pin, pin_val;
69 int shift;
70 u32 ctrl, mask;
71 u32 newvalue = 0;
72 void __iomem *reg;
73
74 if (offs > 27)
75 return -EINVAL;
76
77 if (offs <= 15)
78 reg = S3C64XX_EINT0CON0;
79 else
80 reg = S3C64XX_EINT0CON1;
81
82 switch (type) {
83 case IRQ_TYPE_NONE:
84 printk(KERN_WARNING "No edge setting!\n");
85 break;
86
87 case IRQ_TYPE_EDGE_RISING:
88 newvalue = S3C2410_EXTINT_RISEEDGE;
89 break;
90
91 case IRQ_TYPE_EDGE_FALLING:
92 newvalue = S3C2410_EXTINT_FALLEDGE;
93 break;
94
95 case IRQ_TYPE_EDGE_BOTH:
96 newvalue = S3C2410_EXTINT_BOTHEDGE;
97 break;
98
99 case IRQ_TYPE_LEVEL_LOW:
100 newvalue = S3C2410_EXTINT_LOWLEV;
101 break;
102
103 case IRQ_TYPE_LEVEL_HIGH:
104 newvalue = S3C2410_EXTINT_HILEV;
105 break;
106
107 default:
108 printk(KERN_ERR "No such irq type %d", type);
109 return -1;
110 }
111
112 if (offs <= 15)
113 shift = (offs / 2) * 4;
114 else
115 shift = ((offs - 16) / 2) * 4;
116 mask = 0x7 << shift;
117
118 ctrl = __raw_readl(reg);
119 ctrl &= ~mask;
120 ctrl |= newvalue << shift;
121 __raw_writel(ctrl, reg);
122
123 /* set the GPIO pin appropriately */
124
125 if (offs < 16) {
126 pin = S3C64XX_GPN(offs);
127 pin_val = S3C_GPIO_SFN(2);
128 } else if (offs < 23) {
129 pin = S3C64XX_GPL(offs + 8 - 16);
130 pin_val = S3C_GPIO_SFN(3);
131 } else {
132 pin = S3C64XX_GPM(offs - 23);
133 pin_val = S3C_GPIO_SFN(3);
134 }
135
136 s3c_gpio_cfgpin(pin, pin_val);
137
138 return 0;
139}
140
141static struct irq_chip s3c_irq_eint = {
142 .name = "s3c-eint",
143 .irq_mask = s3c_irq_eint_mask,
144 .irq_unmask = s3c_irq_eint_unmask,
145 .irq_mask_ack = s3c_irq_eint_maskack,
146 .irq_ack = s3c_irq_eint_ack,
147 .irq_set_type = s3c_irq_eint_set_type,
148 .irq_set_wake = s3c_irqext_wake,
149};
150
151/* s3c_irq_demux_eint
152 *
153 * This function demuxes the IRQ from the group0 external interrupts,
154 * from IRQ_EINT(0) to IRQ_EINT(27). It is designed to be inlined into
155 * the specific handlers s3c_irq_demux_eintX_Y.
156 */
157static inline void s3c_irq_demux_eint(unsigned int start, unsigned int end)
158{
159 u32 status = __raw_readl(S3C64XX_EINT0PEND);
160 u32 mask = __raw_readl(S3C64XX_EINT0MASK);
161 unsigned int irq;
162
163 status &= ~mask;
164 status >>= start;
165 status &= (1 << (end - start + 1)) - 1;
166
167 for (irq = IRQ_EINT(start); irq <= IRQ_EINT(end); irq++) {
168 if (status & 1)
169 generic_handle_irq(irq);
170
171 status >>= 1;
172 }
173}
174
175static void s3c_irq_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
176{
177 s3c_irq_demux_eint(0, 3);
178}
179
180static void s3c_irq_demux_eint4_11(unsigned int irq, struct irq_desc *desc)
181{
182 s3c_irq_demux_eint(4, 11);
183}
184
185static void s3c_irq_demux_eint12_19(unsigned int irq, struct irq_desc *desc)
186{
187 s3c_irq_demux_eint(12, 19);
188}
189
190static void s3c_irq_demux_eint20_27(unsigned int irq, struct irq_desc *desc)
191{
192 s3c_irq_demux_eint(20, 27);
193}
194
195static int __init s3c64xx_init_irq_eint(void)
196{
197 int irq;
198
199 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
200 irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq);
201 irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq));
202 set_irq_flags(irq, IRQF_VALID);
203 }
204
205 irq_set_chained_handler(IRQ_EINT0_3, s3c_irq_demux_eint0_3);
206 irq_set_chained_handler(IRQ_EINT4_11, s3c_irq_demux_eint4_11);
207 irq_set_chained_handler(IRQ_EINT12_19, s3c_irq_demux_eint12_19);
208 irq_set_chained_handler(IRQ_EINT20_27, s3c_irq_demux_eint20_27);
209
210 return 0;
211}
212
213arch_initcall(s3c64xx_init_irq_eint);
diff --git a/arch/arm/mach-s3c64xx/irq.c b/arch/arm/mach-s3c64xx/irq.c
deleted file mode 100644
index b07357e94958..000000000000
--- a/arch/arm/mach-s3c64xx/irq.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/* arch/arm/plat-s3c64xx/irq.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - Interrupt handling
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/interrupt.h>
17#include <linux/serial_core.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20
21#include <asm/hardware/vic.h>
22
23#include <mach/map.h>
24#include <plat/irq-vic-timer.h>
25#include <plat/irq-uart.h>
26#include <plat/cpu.h>
27
28/* setup the sources the vic should advertise resume for, even though it
29 * is not doing the wake (set_irq_wake needs to be valid) */
30#define IRQ_VIC0_RESUME (1 << (IRQ_RTC_TIC - IRQ_VIC0_BASE))
31#define IRQ_VIC1_RESUME (1 << (IRQ_RTC_ALARM - IRQ_VIC1_BASE) | \
32 1 << (IRQ_PENDN - IRQ_VIC1_BASE) | \
33 1 << (IRQ_HSMMC0 - IRQ_VIC1_BASE) | \
34 1 << (IRQ_HSMMC1 - IRQ_VIC1_BASE) | \
35 1 << (IRQ_HSMMC2 - IRQ_VIC1_BASE))
36
37void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
38{
39 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
40
41 /* initialise the pair of VICs */
42 vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
43 vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
44
45 /* add the timer sub-irqs */
46 s3c_init_vic_timer_irq(5, IRQ_TIMER0);
47}
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 8eba88e7209e..b86f2779e4e6 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -30,6 +30,7 @@
30 30
31#include <video/platform_lcd.h> 31#include <video/platform_lcd.h>
32 32
33#include <asm/hardware/vic.h>
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 35#include <asm/mach/map.h>
35#include <asm/mach/irq.h> 36#include <asm/mach/irq.h>
@@ -45,13 +46,14 @@
45#include <plat/fb.h> 46#include <plat/fb.h>
46#include <plat/regs-fb-v4.h> 47#include <plat/regs-fb-v4.h>
47 48
48#include <plat/s3c6410.h>
49#include <plat/clock.h> 49#include <plat/clock.h>
50#include <plat/devs.h> 50#include <plat/devs.h>
51#include <plat/cpu.h> 51#include <plat/cpu.h>
52#include <mach/regs-gpio.h> 52#include <mach/regs-gpio.h>
53#include <mach/regs-modem.h> 53#include <mach/regs-modem.h>
54 54
55#include "common.h"
56
55/* DM9000 */ 57/* DM9000 */
56#define ANW6410_PA_DM9000 (0x18000000) 58#define ANW6410_PA_DM9000 (0x18000000)
57 59
@@ -236,7 +238,9 @@ MACHINE_START(ANW6410, "A&W6410")
236 .atag_offset = 0x100, 238 .atag_offset = 0x100,
237 239
238 .init_irq = s3c6410_init_irq, 240 .init_irq = s3c6410_init_irq,
241 .handle_irq = vic_handle_irq,
239 .map_io = anw6410_map_io, 242 .map_io = anw6410_map_io,
240 .init_machine = anw6410_machine_init, 243 .init_machine = anw6410_machine_init,
241 .timer = &s3c24xx_timer, 244 .timer = &s3c24xx_timer,
245 .restart = s3c64xx_restart,
242MACHINE_END 246MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 66668565ee75..f208154b1382 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -8,7 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/module.h> 11#include <linux/export.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14 14
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index d04b65448510..fb786b6a2eae 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -37,6 +37,7 @@
37#include <linux/mfd/wm831x/irq.h> 37#include <linux/mfd/wm831x/irq.h>
38#include <linux/mfd/wm831x/gpio.h> 38#include <linux/mfd/wm831x/gpio.h>
39 39
40#include <asm/hardware/vic.h>
40#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
41#include <asm/mach-types.h> 42#include <asm/mach-types.h>
42 43
@@ -50,7 +51,6 @@
50 51
51#include <mach/regs-gpio-memport.h> 52#include <mach/regs-gpio-memport.h>
52 53
53#include <plat/s3c6410.h>
54#include <plat/regs-serial.h> 54#include <plat/regs-serial.h>
55#include <plat/regs-fb-v4.h> 55#include <plat/regs-fb-v4.h>
56#include <plat/fb.h> 56#include <plat/fb.h>
@@ -66,6 +66,8 @@
66#include <plat/iic.h> 66#include <plat/iic.h>
67#include <plat/pm.h> 67#include <plat/pm.h>
68 68
69#include "common.h"
70
69/* serial port setup */ 71/* serial port setup */
70 72
71#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) 73#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
@@ -704,14 +706,16 @@ static void __init crag6410_machine_init(void)
704 706
705 regulator_has_full_constraints(); 707 regulator_has_full_constraints();
706 708
707 s3c_pm_init(); 709 s3c64xx_pm_init();
708} 710}
709 711
710MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410") 712MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
711 /* Maintainer: Mark Brown <broonie@opensource.wolfsonmicro.com> */ 713 /* Maintainer: Mark Brown <broonie@opensource.wolfsonmicro.com> */
712 .atag_offset = 0x100, 714 .atag_offset = 0x100,
713 .init_irq = s3c6410_init_irq, 715 .init_irq = s3c6410_init_irq,
716 .handle_irq = vic_handle_irq,
714 .map_io = crag6410_map_io, 717 .map_io = crag6410_map_io,
715 .init_machine = crag6410_machine_init, 718 .init_machine = crag6410_machine_init,
716 .timer = &s3c24xx_timer, 719 .timer = &s3c24xx_timer,
720 .restart = s3c64xx_restart,
717MACHINE_END 721MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 952f75ff5deb..521e07b8501b 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -29,6 +29,7 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/map.h> 30#include <mach/map.h>
31 31
32#include <asm/hardware/vic.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34 35
@@ -37,12 +38,13 @@
37#include <plat/fb.h> 38#include <plat/fb.h>
38#include <plat/nand.h> 39#include <plat/nand.h>
39 40
40#include <plat/s3c6410.h>
41#include <plat/clock.h> 41#include <plat/clock.h>
42#include <plat/devs.h> 42#include <plat/devs.h>
43#include <plat/cpu.h> 43#include <plat/cpu.h>
44#include <plat/regs-fb-v4.h> 44#include <plat/regs-fb-v4.h>
45 45
46#include "common.h"
47
46#define UCON S3C2410_UCON_DEFAULT 48#define UCON S3C2410_UCON_DEFAULT
47#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) 49#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)
48#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) 50#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
@@ -267,7 +269,9 @@ MACHINE_START(HMT, "Airgoo-HMT")
267 /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */ 269 /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */
268 .atag_offset = 0x100, 270 .atag_offset = 0x100,
269 .init_irq = s3c6410_init_irq, 271 .init_irq = s3c6410_init_irq,
272 .handle_irq = vic_handle_irq,
270 .map_io = hmt_map_io, 273 .map_io = hmt_map_io,
271 .init_machine = hmt_machine_init, 274 .init_machine = hmt_machine_init,
272 .timer = &s3c24xx_timer, 275 .timer = &s3c24xx_timer,
276 .restart = s3c64xx_restart,
273MACHINE_END 277MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 1bc85c359498..c34c2ab22ead 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -24,6 +24,7 @@
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/types.h> 25#include <linux/types.h>
26 26
27#include <asm/hardware/vic.h>
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
@@ -33,7 +34,6 @@
33#include <mach/regs-modem.h> 34#include <mach/regs-modem.h>
34#include <mach/regs-srom.h> 35#include <mach/regs-srom.h>
35 36
36#include <plat/s3c6410.h>
37#include <plat/adc.h> 37#include <plat/adc.h>
38#include <plat/cpu.h> 38#include <plat/cpu.h>
39#include <plat/devs.h> 39#include <plat/devs.h>
@@ -45,6 +45,8 @@
45 45
46#include <video/platform_lcd.h> 46#include <video/platform_lcd.h>
47 47
48#include "common.h"
49
48#define UCON S3C2410_UCON_DEFAULT 50#define UCON S3C2410_UCON_DEFAULT
49#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) 51#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
50#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) 52#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
@@ -345,7 +347,9 @@ MACHINE_START(MINI6410, "MINI6410")
345 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */ 347 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */
346 .atag_offset = 0x100, 348 .atag_offset = 0x100,
347 .init_irq = s3c6410_init_irq, 349 .init_irq = s3c6410_init_irq,
350 .handle_irq = vic_handle_irq,
348 .map_io = mini6410_map_io, 351 .map_io = mini6410_map_io,
349 .init_machine = mini6410_machine_init, 352 .init_machine = mini6410_machine_init,
350 .timer = &s3c24xx_timer, 353 .timer = &s3c24xx_timer,
354 .restart = s3c64xx_restart,
351MACHINE_END 355MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index cb13cba98b3d..0efa2ba783b2 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -25,6 +25,7 @@
25 25
26#include <video/platform_lcd.h> 26#include <video/platform_lcd.h>
27 27
28#include <asm/hardware/vic.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
@@ -39,12 +40,13 @@
39#include <plat/iic.h> 40#include <plat/iic.h>
40#include <plat/fb.h> 41#include <plat/fb.h>
41 42
42#include <plat/s3c6410.h>
43#include <plat/clock.h> 43#include <plat/clock.h>
44#include <plat/devs.h> 44#include <plat/devs.h>
45#include <plat/cpu.h> 45#include <plat/cpu.h>
46#include <plat/regs-fb-v4.h> 46#include <plat/regs-fb-v4.h>
47 47
48#include "common.h"
49
48#define UCON S3C2410_UCON_DEFAULT 50#define UCON S3C2410_UCON_DEFAULT
49#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE 51#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
50#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 52#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
@@ -99,7 +101,9 @@ MACHINE_START(NCP, "NCP")
99 /* Maintainer: Samsung Electronics */ 101 /* Maintainer: Samsung Electronics */
100 .atag_offset = 0x100, 102 .atag_offset = 0x100,
101 .init_irq = s3c6410_init_irq, 103 .init_irq = s3c6410_init_irq,
104 .handle_irq = vic_handle_irq,
102 .map_io = ncp_map_io, 105 .map_io = ncp_map_io,
103 .init_machine = ncp_machine_init, 106 .init_machine = ncp_machine_init,
104 .timer = &s3c24xx_timer, 107 .timer = &s3c24xx_timer,
108 .restart = s3c64xx_restart,
105MACHINE_END 109MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 87281e4b8471..be2a9a22ab74 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -25,6 +25,7 @@
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/types.h> 26#include <linux/types.h>
27 27
28#include <asm/hardware/vic.h>
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -34,7 +35,6 @@
34#include <mach/regs-modem.h> 35#include <mach/regs-modem.h>
35#include <mach/regs-srom.h> 36#include <mach/regs-srom.h>
36 37
37#include <plat/s3c6410.h>
38#include <plat/adc.h> 38#include <plat/adc.h>
39#include <plat/cpu.h> 39#include <plat/cpu.h>
40#include <plat/devs.h> 40#include <plat/devs.h>
@@ -46,6 +46,8 @@
46 46
47#include <video/platform_lcd.h> 47#include <video/platform_lcd.h>
48 48
49#include "common.h"
50
49#define UCON S3C2410_UCON_DEFAULT 51#define UCON S3C2410_UCON_DEFAULT
50#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) 52#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
51#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) 53#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
@@ -326,7 +328,9 @@ MACHINE_START(REAL6410, "REAL6410")
326 .atag_offset = 0x100, 328 .atag_offset = 0x100,
327 329
328 .init_irq = s3c6410_init_irq, 330 .init_irq = s3c6410_init_irq,
331 .handle_irq = vic_handle_irq,
329 .map_io = real6410_map_io, 332 .map_io = real6410_map_io,
330 .init_machine = real6410_machine_init, 333 .init_machine = real6410_machine_init,
331 .timer = &s3c24xx_timer, 334 .timer = &s3c24xx_timer,
335 .restart = s3c64xx_restart,
332MACHINE_END 336MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index cb1ebeb08763..ce31db136231 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -40,6 +40,8 @@
40 40
41#include <video/platform_lcd.h> 41#include <video/platform_lcd.h>
42 42
43#include "common.h"
44
43#define UCON S3C2410_UCON_DEFAULT 45#define UCON S3C2410_UCON_DEFAULT
44#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) 46#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)
45#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) 47#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 94c831d88365..3f42431d4dda 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -17,19 +17,20 @@
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <asm/hardware/vic.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22 23
23#include <mach/map.h> 24#include <mach/map.h>
24#include <mach/regs-gpio.h> 25#include <mach/regs-gpio.h>
25 26
26#include <plat/s3c6410.h>
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29#include <plat/fb.h> 29#include <plat/fb.h>
30#include <plat/gpio-cfg.h> 30#include <plat/gpio-cfg.h>
31#include <plat/regs-fb-v4.h> 31#include <plat/regs-fb-v4.h>
32 32
33#include "common.h"
33#include "mach-smartq.h" 34#include "mach-smartq.h"
34 35
35static struct gpio_led smartq5_leds[] = { 36static struct gpio_led smartq5_leds[] = {
@@ -148,7 +149,9 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
148 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */ 149 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
149 .atag_offset = 0x100, 150 .atag_offset = 0x100,
150 .init_irq = s3c6410_init_irq, 151 .init_irq = s3c6410_init_irq,
152 .handle_irq = vic_handle_irq,
151 .map_io = smartq_map_io, 153 .map_io = smartq_map_io,
152 .init_machine = smartq5_machine_init, 154 .init_machine = smartq5_machine_init,
153 .timer = &s3c24xx_timer, 155 .timer = &s3c24xx_timer,
156 .restart = s3c64xx_restart,
154MACHINE_END 157MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index f112547ce80a..e5c09b6db967 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -17,19 +17,20 @@
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <asm/hardware/vic.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22 23
23#include <mach/map.h> 24#include <mach/map.h>
24#include <mach/regs-gpio.h> 25#include <mach/regs-gpio.h>
25 26
26#include <plat/s3c6410.h>
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29#include <plat/fb.h> 29#include <plat/fb.h>
30#include <plat/gpio-cfg.h> 30#include <plat/gpio-cfg.h>
31#include <plat/regs-fb-v4.h> 31#include <plat/regs-fb-v4.h>
32 32
33#include "common.h"
33#include "mach-smartq.h" 34#include "mach-smartq.h"
34 35
35static struct gpio_led smartq7_leds[] = { 36static struct gpio_led smartq7_leds[] = {
@@ -164,7 +165,9 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
164 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */ 165 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
165 .atag_offset = 0x100, 166 .atag_offset = 0x100,
166 .init_irq = s3c6410_init_irq, 167 .init_irq = s3c6410_init_irq,
168 .handle_irq = vic_handle_irq,
167 .map_io = smartq_map_io, 169 .map_io = smartq_map_io,
168 .init_machine = smartq7_machine_init, 170 .init_machine = smartq7_machine_init,
169 .timer = &s3c24xx_timer, 171 .timer = &s3c24xx_timer,
172 .restart = s3c64xx_restart,
170MACHINE_END 173MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index 73450c2b530a..5f096534f4c4 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -22,6 +22,7 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <asm/hardware/vic.h>
25#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
27#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
@@ -31,12 +32,13 @@
31 32
32#include <plat/regs-serial.h> 33#include <plat/regs-serial.h>
33 34
34#include <plat/s3c6400.h>
35#include <plat/clock.h> 35#include <plat/clock.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/cpu.h> 37#include <plat/cpu.h>
38#include <plat/iic.h> 38#include <plat/iic.h>
39 39
40#include "common.h"
41
40#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 42#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
41#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 43#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
42#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 44#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
@@ -88,7 +90,9 @@ MACHINE_START(SMDK6400, "SMDK6400")
88 .atag_offset = 0x100, 90 .atag_offset = 0x100,
89 91
90 .init_irq = s3c6400_init_irq, 92 .init_irq = s3c6400_init_irq,
93 .handle_irq = vic_handle_irq,
91 .map_io = smdk6400_map_io, 94 .map_io = smdk6400_map_io,
92 .init_machine = smdk6400_machine_init, 95 .init_machine = smdk6400_machine_init,
93 .timer = &s3c24xx_timer, 96 .timer = &s3c24xx_timer,
97 .restart = s3c64xx_restart,
94MACHINE_END 98MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 8bc8edd85e5a..ca6fc204f0ea 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -43,6 +43,7 @@
43 43
44#include <video/platform_lcd.h> 44#include <video/platform_lcd.h>
45 45
46#include <asm/hardware/vic.h>
46#include <asm/mach/arch.h> 47#include <asm/mach/arch.h>
47#include <asm/mach/map.h> 48#include <asm/mach/map.h>
48#include <asm/mach/irq.h> 49#include <asm/mach/irq.h>
@@ -63,7 +64,6 @@
63#include <plat/fb.h> 64#include <plat/fb.h>
64#include <plat/gpio-cfg.h> 65#include <plat/gpio-cfg.h>
65 66
66#include <plat/s3c6410.h>
67#include <plat/clock.h> 67#include <plat/clock.h>
68#include <plat/devs.h> 68#include <plat/devs.h>
69#include <plat/cpu.h> 69#include <plat/cpu.h>
@@ -73,6 +73,8 @@
73#include <plat/backlight.h> 73#include <plat/backlight.h>
74#include <plat/regs-fb-v4.h> 74#include <plat/regs-fb-v4.h>
75 75
76#include "common.h"
77
76#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 78#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
77#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 79#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
78#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 80#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
@@ -700,7 +702,9 @@ MACHINE_START(SMDK6410, "SMDK6410")
700 .atag_offset = 0x100, 702 .atag_offset = 0x100,
701 703
702 .init_irq = s3c6410_init_irq, 704 .init_irq = s3c6410_init_irq,
705 .handle_irq = vic_handle_irq,
703 .map_io = smdk6410_map_io, 706 .map_io = smdk6410_map_io,
704 .init_machine = smdk6410_machine_init, 707 .init_machine = smdk6410_machine_init,
705 .timer = &s3c24xx_timer, 708 .timer = &s3c24xx_timer,
709 .restart = s3c64xx_restart,
706MACHINE_END 710MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index b375cd5c47cb..7d3e81b9dd06 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -17,10 +17,12 @@
17#include <linux/serial_core.h> 17#include <linux/serial_core.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/pm_domain.h>
20 21
21#include <mach/map.h> 22#include <mach/map.h>
22#include <mach/irqs.h> 23#include <mach/irqs.h>
23 24
25#include <plat/devs.h>
24#include <plat/pm.h> 26#include <plat/pm.h>
25#include <plat/wakeup-mask.h> 27#include <plat/wakeup-mask.h>
26 28
@@ -31,6 +33,148 @@
31#include <mach/regs-gpio-memport.h> 33#include <mach/regs-gpio-memport.h>
32#include <mach/regs-modem.h> 34#include <mach/regs-modem.h>
33 35
36struct s3c64xx_pm_domain {
37 char *const name;
38 u32 ena;
39 u32 pwr_stat;
40 struct generic_pm_domain pd;
41};
42
43static int s3c64xx_pd_off(struct generic_pm_domain *domain)
44{
45 struct s3c64xx_pm_domain *pd;
46 u32 val;
47
48 pd = container_of(domain, struct s3c64xx_pm_domain, pd);
49
50 val = __raw_readl(S3C64XX_NORMAL_CFG);
51 val &= ~(pd->ena);
52 __raw_writel(val, S3C64XX_NORMAL_CFG);
53
54 return 0;
55}
56
57static int s3c64xx_pd_on(struct generic_pm_domain *domain)
58{
59 struct s3c64xx_pm_domain *pd;
60 u32 val;
61 long retry = 1000000L;
62
63 pd = container_of(domain, struct s3c64xx_pm_domain, pd);
64
65 val = __raw_readl(S3C64XX_NORMAL_CFG);
66 val |= pd->ena;
67 __raw_writel(val, S3C64XX_NORMAL_CFG);
68
69 /* Not all domains provide power status readback */
70 if (pd->pwr_stat) {
71 do {
72 cpu_relax();
73 if (__raw_readl(S3C64XX_BLK_PWR_STAT) & pd->pwr_stat)
74 break;
75 } while (retry--);
76
77 if (!retry) {
78 pr_err("Failed to start domain %s\n", pd->name);
79 return -EBUSY;
80 }
81 }
82
83 return 0;
84}
85
86static struct s3c64xx_pm_domain s3c64xx_pm_irom = {
87 .name = "IROM",
88 .ena = S3C64XX_NORMALCFG_IROM_ON,
89 .pd = {
90 .power_off = s3c64xx_pd_off,
91 .power_on = s3c64xx_pd_on,
92 },
93};
94
95static struct s3c64xx_pm_domain s3c64xx_pm_etm = {
96 .name = "ETM",
97 .ena = S3C64XX_NORMALCFG_DOMAIN_ETM_ON,
98 .pwr_stat = S3C64XX_BLKPWRSTAT_ETM,
99 .pd = {
100 .power_off = s3c64xx_pd_off,
101 .power_on = s3c64xx_pd_on,
102 },
103};
104
105static struct s3c64xx_pm_domain s3c64xx_pm_s = {
106 .name = "S",
107 .ena = S3C64XX_NORMALCFG_DOMAIN_S_ON,
108 .pwr_stat = S3C64XX_BLKPWRSTAT_S,
109 .pd = {
110 .power_off = s3c64xx_pd_off,
111 .power_on = s3c64xx_pd_on,
112 },
113};
114
115static struct s3c64xx_pm_domain s3c64xx_pm_f = {
116 .name = "F",
117 .ena = S3C64XX_NORMALCFG_DOMAIN_F_ON,
118 .pwr_stat = S3C64XX_BLKPWRSTAT_F,
119 .pd = {
120 .power_off = s3c64xx_pd_off,
121 .power_on = s3c64xx_pd_on,
122 },
123};
124
125static struct s3c64xx_pm_domain s3c64xx_pm_p = {
126 .name = "P",
127 .ena = S3C64XX_NORMALCFG_DOMAIN_P_ON,
128 .pwr_stat = S3C64XX_BLKPWRSTAT_P,
129 .pd = {
130 .power_off = s3c64xx_pd_off,
131 .power_on = s3c64xx_pd_on,
132 },
133};
134
135static struct s3c64xx_pm_domain s3c64xx_pm_i = {
136 .name = "I",
137 .ena = S3C64XX_NORMALCFG_DOMAIN_I_ON,
138 .pwr_stat = S3C64XX_BLKPWRSTAT_I,
139 .pd = {
140 .power_off = s3c64xx_pd_off,
141 .power_on = s3c64xx_pd_on,
142 },
143};
144
145static struct s3c64xx_pm_domain s3c64xx_pm_g = {
146 .name = "G",
147 .ena = S3C64XX_NORMALCFG_DOMAIN_G_ON,
148 .pd = {
149 .power_off = s3c64xx_pd_off,
150 .power_on = s3c64xx_pd_on,
151 },
152};
153
154static struct s3c64xx_pm_domain s3c64xx_pm_v = {
155 .name = "V",
156 .ena = S3C64XX_NORMALCFG_DOMAIN_V_ON,
157 .pwr_stat = S3C64XX_BLKPWRSTAT_V,
158 .pd = {
159 .power_off = s3c64xx_pd_off,
160 .power_on = s3c64xx_pd_on,
161 },
162};
163
164static struct s3c64xx_pm_domain *s3c64xx_always_on_pm_domains[] = {
165 &s3c64xx_pm_irom,
166};
167
168static struct s3c64xx_pm_domain *s3c64xx_pm_domains[] = {
169 &s3c64xx_pm_etm,
170 &s3c64xx_pm_g,
171 &s3c64xx_pm_v,
172 &s3c64xx_pm_i,
173 &s3c64xx_pm_p,
174 &s3c64xx_pm_s,
175 &s3c64xx_pm_f,
176};
177
34#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 178#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
35void s3c_pm_debug_smdkled(u32 set, u32 clear) 179void s3c_pm_debug_smdkled(u32 set, u32 clear)
36{ 180{
@@ -89,6 +233,8 @@ static struct sleep_save misc_save[] = {
89 233
90 SAVE_ITEM(S3C64XX_SDMA_SEL), 234 SAVE_ITEM(S3C64XX_SDMA_SEL),
91 SAVE_ITEM(S3C64XX_MODEM_MIFPCON), 235 SAVE_ITEM(S3C64XX_MODEM_MIFPCON),
236
237 SAVE_ITEM(S3C64XX_NORMAL_CFG),
92}; 238};
93 239
94void s3c_pm_configure_extint(void) 240void s3c_pm_configure_extint(void)
@@ -179,7 +325,26 @@ static void s3c64xx_pm_prepare(void)
179 __raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), S3C64XX_WAKEUP_STAT); 325 __raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), S3C64XX_WAKEUP_STAT);
180} 326}
181 327
182static int s3c64xx_pm_init(void) 328int __init s3c64xx_pm_init(void)
329{
330 int i;
331
332 s3c_pm_init();
333
334 for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
335 pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd,
336 &pm_domain_always_on_gov, false);
337
338 for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
339 pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
340
341 if (dev_get_platdata(&s3c_device_fb.dev))
342 pm_genpd_add_device(&s3c64xx_pm_f.pd, &s3c_device_fb.dev);
343
344 return 0;
345}
346
347static __init int s3c64xx_pm_initcall(void)
183{ 348{
184 pm_cpu_prep = s3c64xx_pm_prepare; 349 pm_cpu_prep = s3c64xx_pm_prepare;
185 pm_cpu_sleep = s3c64xx_cpu_suspend; 350 pm_cpu_sleep = s3c64xx_cpu_suspend;
@@ -198,5 +363,12 @@ static int s3c64xx_pm_init(void)
198 363
199 return 0; 364 return 0;
200} 365}
366arch_initcall(s3c64xx_pm_initcall);
367
368static __init int s3c64xx_pm_late_initcall(void)
369{
370 pm_genpd_poweroff_unused();
201 371
202arch_initcall(s3c64xx_pm_init); 372 return 0;
373}
374late_initcall(s3c64xx_pm_late_initcall);
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 7a3bc32df425..4869714c6f1b 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -17,7 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23 23
@@ -38,7 +38,8 @@
38#include <plat/sdhci.h> 38#include <plat/sdhci.h>
39#include <plat/iic-core.h> 39#include <plat/iic-core.h>
40#include <plat/onenand-core.h> 40#include <plat/onenand-core.h>
41#include <plat/s3c6400.h> 41
42#include "common.h"
42 43
43void __init s3c6400_map_io(void) 44void __init s3c6400_map_io(void)
44{ 45{
@@ -60,7 +61,7 @@ void __init s3c6400_map_io(void)
60void __init s3c6400_init_clocks(int xtal) 61void __init s3c6400_init_clocks(int xtal)
61{ 62{
62 s3c64xx_register_clocks(xtal, S3C6400_CLKDIV0_ARM_MASK); 63 s3c64xx_register_clocks(xtal, S3C6400_CLKDIV0_ARM_MASK);
63 s3c6400_setup_clocks(); 64 s3c64xx_setup_clocks();
64} 65}
65 66
66void __init s3c6400_init_irq(void) 67void __init s3c6400_init_irq(void)
@@ -70,17 +71,18 @@ void __init s3c6400_init_irq(void)
70 s3c64xx_init_irq(~0 & ~(0xf << 5), ~0); 71 s3c64xx_init_irq(~0 & ~(0xf << 5), ~0);
71} 72}
72 73
73struct sysdev_class s3c6400_sysclass = { 74static struct bus_type s3c6400_subsys = {
74 .name = "s3c6400-core", 75 .name = "s3c6400-core",
76 .dev_name = "s3c6400-core",
75}; 77};
76 78
77static struct sys_device s3c6400_sysdev = { 79static struct device s3c6400_dev = {
78 .cls = &s3c6400_sysclass, 80 .bus = &s3c6400_subsys,
79}; 81};
80 82
81static int __init s3c6400_core_init(void) 83static int __init s3c6400_core_init(void)
82{ 84{
83 return sysdev_class_register(&s3c6400_sysclass); 85 return subsys_system_register(&s3c6400_subsys, NULL);
84} 86}
85 87
86core_initcall(s3c6400_core_init); 88core_initcall(s3c6400_core_init);
@@ -89,5 +91,5 @@ int __init s3c6400_init(void)
89{ 91{
90 printk("S3C6400: Initialising architecture\n"); 92 printk("S3C6400: Initialising architecture\n");
91 93
92 return sysdev_register(&s3c6400_sysdev); 94 return device_register(&s3c6400_dev);
93} 95}
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 4117003464ad..31c29fdf1800 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
@@ -41,8 +41,8 @@
41#include <plat/adc-core.h> 41#include <plat/adc-core.h>
42#include <plat/iic-core.h> 42#include <plat/iic-core.h>
43#include <plat/onenand-core.h> 43#include <plat/onenand-core.h>
44#include <plat/s3c6400.h> 44
45#include <plat/s3c6410.h> 45#include "common.h"
46 46
47void __init s3c6410_map_io(void) 47void __init s3c6410_map_io(void)
48{ 48{
@@ -66,7 +66,7 @@ void __init s3c6410_init_clocks(int xtal)
66{ 66{
67 printk(KERN_DEBUG "%s: initialising clocks\n", __func__); 67 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
68 s3c64xx_register_clocks(xtal, S3C6410_CLKDIV0_ARM_MASK); 68 s3c64xx_register_clocks(xtal, S3C6410_CLKDIV0_ARM_MASK);
69 s3c6400_setup_clocks(); 69 s3c64xx_setup_clocks();
70} 70}
71 71
72void __init s3c6410_init_irq(void) 72void __init s3c6410_init_irq(void)
@@ -75,17 +75,18 @@ void __init s3c6410_init_irq(void)
75 s3c64xx_init_irq(~0 & ~(1 << 7), ~0); 75 s3c64xx_init_irq(~0 & ~(1 << 7), ~0);
76} 76}
77 77
78struct sysdev_class s3c6410_sysclass = { 78struct bus_type s3c6410_subsys = {
79 .name = "s3c6410-core", 79 .name = "s3c6410-core",
80 .dev_name = "s3c6410-core",
80}; 81};
81 82
82static struct sys_device s3c6410_sysdev = { 83static struct device s3c6410_dev = {
83 .cls = &s3c6410_sysclass, 84 .bus = &s3c6410_subsys,
84}; 85};
85 86
86static int __init s3c6410_core_init(void) 87static int __init s3c6410_core_init(void)
87{ 88{
88 return sysdev_class_register(&s3c6410_sysclass); 89 return subsys_system_register(&s3c6410_subsys, NULL);
89} 90}
90 91
91core_initcall(s3c6410_core_init); 92core_initcall(s3c6410_core_init);
@@ -94,5 +95,5 @@ int __init s3c6410_init(void)
94{ 95{
95 printk("S3C6410: Initialising architecture\n"); 96 printk("S3C6410: Initialising architecture\n");
96 97
97 return sysdev_register(&s3c6410_sysdev); 98 return device_register(&s3c6410_dev);
98} 99}
diff --git a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
index 83d2afb79e9f..2cf80026c58d 100644
--- a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
+++ b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
@@ -20,7 +20,7 @@
20#include <plat/fb.h> 20#include <plat/fb.h>
21#include <plat/gpio-cfg.h> 21#include <plat/gpio-cfg.h>
22 22
23extern void s3c64xx_fb_gpio_setup_24bpp(void) 23void s3c64xx_fb_gpio_setup_24bpp(void)
24{ 24{
25 s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2)); 25 s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2));
26 s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2)); 26 s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2));
diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile
index a1324d8dc4e0..d3f7409999f2 100644
--- a/arch/arm/mach-s5p64x0/Makefile
+++ b/arch/arm/mach-s5p64x0/Makefile
@@ -10,14 +10,16 @@ obj-m :=
10obj-n := 10obj-n :=
11obj- := 11obj- :=
12 12
13# Core support for S5P64X0 system 13# Core
14 14
15obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o 15obj-y += common.o clock.o
16obj-$(CONFIG_ARCH_S5P64X0) += setup-i2c0.o irq-eint.o
17obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o 16obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o
18obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o 17obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o
18
19obj-$(CONFIG_PM) += pm.o irq-pm.o 19obj-$(CONFIG_PM) += pm.o irq-pm.o
20 20
21obj-y += dma.o
22
21# machine support 23# machine support
22 24
23obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o 25obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o
@@ -28,5 +30,6 @@ obj-$(CONFIG_MACH_SMDK6450) += mach-smdk6450.o
28obj-y += dev-audio.o 30obj-y += dev-audio.o
29obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o 31obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
30 32
33obj-y += setup-i2c0.o
31obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o 34obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o
32obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o 35obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c
index c54c65d511f0..eb4ffe331e1a 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6440.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
@@ -31,7 +31,8 @@
31#include <plat/pll.h> 31#include <plat/pll.h>
32#include <plat/s5p-clock.h> 32#include <plat/s5p-clock.h>
33#include <plat/clock-clksrc.h> 33#include <plat/clock-clksrc.h>
34#include <plat/s5p6440.h> 34
35#include "common.h"
35 36
36static u32 epll_div[][5] = { 37static u32 epll_div[][5] = {
37 { 36000000, 0, 48, 1, 4 }, 38 { 36000000, 0, 48, 1, 4 },
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c
index 2d04abfba12e..bb7ee912090b 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6450.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
@@ -31,7 +31,8 @@
31#include <plat/pll.h> 31#include <plat/pll.h>
32#include <plat/s5p-clock.h> 32#include <plat/s5p-clock.h>
33#include <plat/clock-clksrc.h> 33#include <plat/clock-clksrc.h>
34#include <plat/s5p6450.h> 34
35#include "common.h"
35 36
36static struct clksrc_clk clk_mout_dpll = { 37static struct clksrc_clk clk_mout_dpll = {
37 .clk = { 38 .clk = {
diff --git a/arch/arm/mach-s5p64x0/clock.c b/arch/arm/mach-s5p64x0/clock.c
index b52c6e2f37a6..241d0e645c85 100644
--- a/arch/arm/mach-s5p64x0/clock.c
+++ b/arch/arm/mach-s5p64x0/clock.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
@@ -30,8 +30,8 @@
30#include <plat/pll.h> 30#include <plat/pll.h>
31#include <plat/s5p-clock.h> 31#include <plat/s5p-clock.h>
32#include <plat/clock-clksrc.h> 32#include <plat/clock-clksrc.h>
33#include <plat/s5p6440.h> 33
34#include <plat/s5p6450.h> 34#include "common.h"
35 35
36struct clksrc_clk clk_mout_apll = { 36struct clksrc_clk clk_mout_apll = {
37 .clk = { 37 .clk = {
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c
new file mode 100644
index 000000000000..28d0b918cd4b
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -0,0 +1,469 @@
1/*
2 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Codes for S5P64X0 machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20#include <linux/device.h>
21#include <linux/serial_core.h>
22#include <linux/platform_device.h>
23#include <linux/sched.h>
24#include <linux/dma-mapping.h>
25#include <linux/gpio.h>
26#include <linux/irq.h>
27
28#include <asm/irq.h>
29#include <asm/proc-fns.h>
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32#include <asm/mach/irq.h>
33
34#include <mach/map.h>
35#include <mach/hardware.h>
36#include <mach/regs-clock.h>
37#include <mach/regs-gpio.h>
38
39#include <plat/cpu.h>
40#include <plat/clock.h>
41#include <plat/devs.h>
42#include <plat/pm.h>
43#include <plat/adc-core.h>
44#include <plat/fb-core.h>
45#include <plat/gpio-cfg.h>
46#include <plat/regs-irqtype.h>
47#include <plat/regs-serial.h>
48#include <plat/watchdog-reset.h>
49
50#include "common.h"
51
52static const char name_s5p6440[] = "S5P6440";
53static const char name_s5p6450[] = "S5P6450";
54
55static struct cpu_table cpu_ids[] __initdata = {
56 {
57 .idcode = S5P6440_CPU_ID,
58 .idmask = S5P64XX_CPU_MASK,
59 .map_io = s5p6440_map_io,
60 .init_clocks = s5p6440_init_clocks,
61 .init_uarts = s5p6440_init_uarts,
62 .init = s5p64x0_init,
63 .name = name_s5p6440,
64 }, {
65 .idcode = S5P6450_CPU_ID,
66 .idmask = S5P64XX_CPU_MASK,
67 .map_io = s5p6450_map_io,
68 .init_clocks = s5p6450_init_clocks,
69 .init_uarts = s5p6450_init_uarts,
70 .init = s5p64x0_init,
71 .name = name_s5p6450,
72 },
73};
74
75/* Initial IO mappings */
76
77static struct map_desc s5p64x0_iodesc[] __initdata = {
78 {
79 .virtual = (unsigned long)S5P_VA_CHIPID,
80 .pfn = __phys_to_pfn(S5P64X0_PA_CHIPID),
81 .length = SZ_4K,
82 .type = MT_DEVICE,
83 }, {
84 .virtual = (unsigned long)S3C_VA_SYS,
85 .pfn = __phys_to_pfn(S5P64X0_PA_SYSCON),
86 .length = SZ_64K,
87 .type = MT_DEVICE,
88 }, {
89 .virtual = (unsigned long)S3C_VA_TIMER,
90 .pfn = __phys_to_pfn(S5P64X0_PA_TIMER),
91 .length = SZ_16K,
92 .type = MT_DEVICE,
93 }, {
94 .virtual = (unsigned long)S3C_VA_WATCHDOG,
95 .pfn = __phys_to_pfn(S5P64X0_PA_WDT),
96 .length = SZ_4K,
97 .type = MT_DEVICE,
98 }, {
99 .virtual = (unsigned long)S5P_VA_SROMC,
100 .pfn = __phys_to_pfn(S5P64X0_PA_SROMC),
101 .length = SZ_4K,
102 .type = MT_DEVICE,
103 }, {
104 .virtual = (unsigned long)S5P_VA_GPIO,
105 .pfn = __phys_to_pfn(S5P64X0_PA_GPIO),
106 .length = SZ_4K,
107 .type = MT_DEVICE,
108 }, {
109 .virtual = (unsigned long)VA_VIC0,
110 .pfn = __phys_to_pfn(S5P64X0_PA_VIC0),
111 .length = SZ_16K,
112 .type = MT_DEVICE,
113 }, {
114 .virtual = (unsigned long)VA_VIC1,
115 .pfn = __phys_to_pfn(S5P64X0_PA_VIC1),
116 .length = SZ_16K,
117 .type = MT_DEVICE,
118 },
119};
120
121static struct map_desc s5p6440_iodesc[] __initdata = {
122 {
123 .virtual = (unsigned long)S3C_VA_UART,
124 .pfn = __phys_to_pfn(S5P6440_PA_UART(0)),
125 .length = SZ_4K,
126 .type = MT_DEVICE,
127 },
128};
129
130static struct map_desc s5p6450_iodesc[] __initdata = {
131 {
132 .virtual = (unsigned long)S3C_VA_UART,
133 .pfn = __phys_to_pfn(S5P6450_PA_UART(0)),
134 .length = SZ_512K,
135 .type = MT_DEVICE,
136 }, {
137 .virtual = (unsigned long)S3C_VA_UART + SZ_512K,
138 .pfn = __phys_to_pfn(S5P6450_PA_UART(5)),
139 .length = SZ_4K,
140 .type = MT_DEVICE,
141 },
142};
143
144static void s5p64x0_idle(void)
145{
146 unsigned long val;
147
148 if (!need_resched()) {
149 val = __raw_readl(S5P64X0_PWR_CFG);
150 val &= ~(0x3 << 5);
151 val |= (0x1 << 5);
152 __raw_writel(val, S5P64X0_PWR_CFG);
153
154 cpu_do_idle();
155 }
156 local_irq_enable();
157}
158
159/*
160 * s5p64x0_map_io
161 *
162 * register the standard CPU IO areas
163 */
164
165void __init s5p64x0_init_io(struct map_desc *mach_desc, int size)
166{
167 /* initialize the io descriptors we need for initialization */
168 iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
169 if (mach_desc)
170 iotable_init(mach_desc, size);
171
172 /* detect cpu id and rev. */
173 s5p_init_cpu(S5P64X0_SYS_ID);
174
175 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
176}
177
178void __init s5p6440_map_io(void)
179{
180 /* initialize any device information early */
181 s3c_adc_setname("s3c64xx-adc");
182 s3c_fb_setname("s5p64x0-fb");
183
184 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
185 init_consistent_dma_size(SZ_8M);
186}
187
188void __init s5p6450_map_io(void)
189{
190 /* initialize any device information early */
191 s3c_adc_setname("s3c64xx-adc");
192 s3c_fb_setname("s5p64x0-fb");
193
194 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
195 init_consistent_dma_size(SZ_8M);
196}
197
198/*
199 * s5p64x0_init_clocks
200 *
201 * register and setup the CPU clocks
202 */
203
204void __init s5p6440_init_clocks(int xtal)
205{
206 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
207
208 s3c24xx_register_baseclocks(xtal);
209 s5p_register_clocks(xtal);
210 s5p6440_register_clocks();
211 s5p6440_setup_clocks();
212}
213
214void __init s5p6450_init_clocks(int xtal)
215{
216 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
217
218 s3c24xx_register_baseclocks(xtal);
219 s5p_register_clocks(xtal);
220 s5p6450_register_clocks();
221 s5p6450_setup_clocks();
222}
223
224/*
225 * s5p64x0_init_irq
226 *
227 * register the CPU interrupts
228 */
229
230void __init s5p6440_init_irq(void)
231{
232 /* S5P6440 supports 2 VIC */
233 u32 vic[2];
234
235 /*
236 * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)]
237 * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22]
238 */
239 vic[0] = 0xff800ae7;
240 vic[1] = 0xffbf23e5;
241
242 s5p_init_irq(vic, ARRAY_SIZE(vic));
243}
244
245void __init s5p6450_init_irq(void)
246{
247 /* S5P6450 supports only 2 VIC */
248 u32 vic[2];
249
250 /*
251 * VIC0 is missing IRQ_VIC0[(13-15), (21-22)]
252 * VIC1 is missing IRQ VIC1[12, 14, 23]
253 */
254 vic[0] = 0xff9f1fff;
255 vic[1] = 0xff7fafff;
256
257 s5p_init_irq(vic, ARRAY_SIZE(vic));
258}
259
260struct bus_type s5p64x0_subsys = {
261 .name = "s5p64x0-core",
262 .dev_name = "s5p64x0-core",
263};
264
265static struct device s5p64x0_dev = {
266 .bus = &s5p64x0_subsys,
267};
268
269static int __init s5p64x0_core_init(void)
270{
271 return subsys_system_register(&s5p64x0_subsys, NULL);
272}
273core_initcall(s5p64x0_core_init);
274
275int __init s5p64x0_init(void)
276{
277 printk(KERN_INFO "S5P64X0(S5P6440/S5P6450): Initializing architecture\n");
278
279 /* set idle function */
280 pm_idle = s5p64x0_idle;
281
282 return device_register(&s5p64x0_dev);
283}
284
285static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = {
286 [0] = {
287 .name = "pclk_low",
288 .divisor = 1,
289 .min_baud = 0,
290 .max_baud = 0,
291 },
292 [1] = {
293 .name = "uclk1",
294 .divisor = 1,
295 .min_baud = 0,
296 .max_baud = 0,
297 },
298};
299
300/* uart registration process */
301
302void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
303{
304 struct s3c2410_uartcfg *tcfg = cfg;
305 u32 ucnt;
306
307 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
308 if (!tcfg->clocks) {
309 tcfg->clocks = s5p64x0_serial_clocks;
310 tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks);
311 }
312 }
313}
314
315void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
316{
317 int uart;
318
319 for (uart = 0; uart < no; uart++) {
320 s5p_uart_resources[uart].resources->start = S5P6440_PA_UART(uart);
321 s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART;
322 }
323
324 s5p64x0_common_init_uarts(cfg, no);
325 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
326}
327
328void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no)
329{
330 s5p64x0_common_init_uarts(cfg, no);
331 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
332}
333
334#define eint_offset(irq) ((irq) - IRQ_EINT(0))
335
336static int s5p64x0_irq_eint_set_type(struct irq_data *data, unsigned int type)
337{
338 int offs = eint_offset(data->irq);
339 int shift;
340 u32 ctrl, mask;
341 u32 newvalue = 0;
342
343 if (offs > 15)
344 return -EINVAL;
345
346 switch (type) {
347 case IRQ_TYPE_NONE:
348 printk(KERN_WARNING "No edge setting!\n");
349 break;
350 case IRQ_TYPE_EDGE_RISING:
351 newvalue = S3C2410_EXTINT_RISEEDGE;
352 break;
353 case IRQ_TYPE_EDGE_FALLING:
354 newvalue = S3C2410_EXTINT_FALLEDGE;
355 break;
356 case IRQ_TYPE_EDGE_BOTH:
357 newvalue = S3C2410_EXTINT_BOTHEDGE;
358 break;
359 case IRQ_TYPE_LEVEL_LOW:
360 newvalue = S3C2410_EXTINT_LOWLEV;
361 break;
362 case IRQ_TYPE_LEVEL_HIGH:
363 newvalue = S3C2410_EXTINT_HILEV;
364 break;
365 default:
366 printk(KERN_ERR "No such irq type %d", type);
367 return -EINVAL;
368 }
369
370 shift = (offs / 2) * 4;
371 mask = 0x7 << shift;
372
373 ctrl = __raw_readl(S5P64X0_EINT0CON0) & ~mask;
374 ctrl |= newvalue << shift;
375 __raw_writel(ctrl, S5P64X0_EINT0CON0);
376
377 /* Configure the GPIO pin for 6450 or 6440 based on CPU ID */
378 if (soc_is_s5p6450())
379 s3c_gpio_cfgpin(S5P6450_GPN(offs), S3C_GPIO_SFN(2));
380 else
381 s3c_gpio_cfgpin(S5P6440_GPN(offs), S3C_GPIO_SFN(2));
382
383 return 0;
384}
385
386/*
387 * s5p64x0_irq_demux_eint
388 *
389 * This function demuxes the IRQ from the group0 external interrupts,
390 * from IRQ_EINT(0) to IRQ_EINT(15). It is designed to be inlined into
391 * the specific handlers s5p64x0_irq_demux_eintX_Y.
392 */
393static inline void s5p64x0_irq_demux_eint(unsigned int start, unsigned int end)
394{
395 u32 status = __raw_readl(S5P64X0_EINT0PEND);
396 u32 mask = __raw_readl(S5P64X0_EINT0MASK);
397 unsigned int irq;
398
399 status &= ~mask;
400 status >>= start;
401 status &= (1 << (end - start + 1)) - 1;
402
403 for (irq = IRQ_EINT(start); irq <= IRQ_EINT(end); irq++) {
404 if (status & 1)
405 generic_handle_irq(irq);
406 status >>= 1;
407 }
408}
409
410static void s5p64x0_irq_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
411{
412 s5p64x0_irq_demux_eint(0, 3);
413}
414
415static void s5p64x0_irq_demux_eint4_11(unsigned int irq, struct irq_desc *desc)
416{
417 s5p64x0_irq_demux_eint(4, 11);
418}
419
420static void s5p64x0_irq_demux_eint12_15(unsigned int irq,
421 struct irq_desc *desc)
422{
423 s5p64x0_irq_demux_eint(12, 15);
424}
425
426static int s5p64x0_alloc_gc(void)
427{
428 struct irq_chip_generic *gc;
429 struct irq_chip_type *ct;
430
431 gc = irq_alloc_generic_chip("s5p64x0-eint", 1, S5P_IRQ_EINT_BASE,
432 S5P_VA_GPIO, handle_level_irq);
433 if (!gc) {
434 printk(KERN_ERR "%s: irq_alloc_generic_chip for group 0"
435 "external interrupts failed\n", __func__);
436 return -EINVAL;
437 }
438
439 ct = gc->chip_types;
440 ct->chip.irq_ack = irq_gc_ack_set_bit;
441 ct->chip.irq_mask = irq_gc_mask_set_bit;
442 ct->chip.irq_unmask = irq_gc_mask_clr_bit;
443 ct->chip.irq_set_type = s5p64x0_irq_eint_set_type;
444 ct->chip.irq_set_wake = s3c_irqext_wake;
445 ct->regs.ack = EINT0PEND_OFFSET;
446 ct->regs.mask = EINT0MASK_OFFSET;
447 irq_setup_generic_chip(gc, IRQ_MSK(16), IRQ_GC_INIT_MASK_CACHE,
448 IRQ_NOREQUEST | IRQ_NOPROBE, 0);
449 return 0;
450}
451
452static int __init s5p64x0_init_irq_eint(void)
453{
454 int ret = s5p64x0_alloc_gc();
455 irq_set_chained_handler(IRQ_EINT0_3, s5p64x0_irq_demux_eint0_3);
456 irq_set_chained_handler(IRQ_EINT4_11, s5p64x0_irq_demux_eint4_11);
457 irq_set_chained_handler(IRQ_EINT12_15, s5p64x0_irq_demux_eint12_15);
458
459 return ret;
460}
461arch_initcall(s5p64x0_init_irq_eint);
462
463void s5p64x0_restart(char mode, const char *cmd)
464{
465 if (mode != 's')
466 arch_wdt_reset();
467
468 soft_restart(0);
469}
diff --git a/arch/arm/mach-s5p64x0/common.h b/arch/arm/mach-s5p64x0/common.h
new file mode 100644
index 000000000000..f8a60fdc5884
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/common.h
@@ -0,0 +1,57 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Header for S5P64X0 machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ARCH_ARM_MACH_S5P64X0_COMMON_H
13#define __ARCH_ARM_MACH_S5P64X0_COMMON_H
14
15void s5p6440_init_irq(void);
16void s5p6450_init_irq(void);
17void s5p64x0_init_io(struct map_desc *mach_desc, int size);
18
19void s5p6440_register_clocks(void);
20void s5p6440_setup_clocks(void);
21
22void s5p6450_register_clocks(void);
23void s5p6450_setup_clocks(void);
24
25void s5p64x0_restart(char mode, const char *cmd);
26
27#ifdef CONFIG_CPU_S5P6440
28
29extern int s5p64x0_init(void);
30extern void s5p6440_map_io(void);
31extern void s5p6440_init_clocks(int xtal);
32
33extern void s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no);
34
35#else
36#define s5p6440_init_clocks NULL
37#define s5p6440_init_uarts NULL
38#define s5p6440_map_io NULL
39#define s5p64x0_init NULL
40#endif
41
42#ifdef CONFIG_CPU_S5P6450
43
44extern int s5p64x0_init(void);
45extern void s5p6450_map_io(void);
46extern void s5p6450_init_clocks(int xtal);
47
48extern void s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no);
49
50#else
51#define s5p6450_init_clocks NULL
52#define s5p6450_init_uarts NULL
53#define s5p6450_map_io NULL
54#define s5p64x0_init NULL
55#endif
56
57#endif /* __ARCH_ARM_MACH_S5P64X0_COMMON_H */
diff --git a/arch/arm/mach-s5p64x0/cpu.c b/arch/arm/mach-s5p64x0/cpu.c
deleted file mode 100644
index ecab40cf19ab..000000000000
--- a/arch/arm/mach-s5p64x0/cpu.c
+++ /dev/null
@@ -1,215 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/cpu.c
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/init.h>
17#include <linux/clk.h>
18#include <linux/io.h>
19#include <linux/sysdev.h>
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22#include <linux/sched.h>
23#include <linux/dma-mapping.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <asm/mach/irq.h>
28#include <asm/proc-fns.h>
29#include <asm/irq.h>
30
31#include <mach/hardware.h>
32#include <mach/map.h>
33#include <mach/regs-clock.h>
34
35#include <plat/regs-serial.h>
36#include <plat/cpu.h>
37#include <plat/devs.h>
38#include <plat/clock.h>
39#include <plat/s5p6440.h>
40#include <plat/s5p6450.h>
41#include <plat/adc-core.h>
42#include <plat/fb-core.h>
43
44/* Initial IO mappings */
45
46static struct map_desc s5p64x0_iodesc[] __initdata = {
47 {
48 .virtual = (unsigned long)S5P_VA_GPIO,
49 .pfn = __phys_to_pfn(S5P64X0_PA_GPIO),
50 .length = SZ_4K,
51 .type = MT_DEVICE,
52 }, {
53 .virtual = (unsigned long)VA_VIC0,
54 .pfn = __phys_to_pfn(S5P64X0_PA_VIC0),
55 .length = SZ_16K,
56 .type = MT_DEVICE,
57 }, {
58 .virtual = (unsigned long)VA_VIC1,
59 .pfn = __phys_to_pfn(S5P64X0_PA_VIC1),
60 .length = SZ_16K,
61 .type = MT_DEVICE,
62 },
63};
64
65static struct map_desc s5p6440_iodesc[] __initdata = {
66 {
67 .virtual = (unsigned long)S3C_VA_UART,
68 .pfn = __phys_to_pfn(S5P6440_PA_UART(0)),
69 .length = SZ_4K,
70 .type = MT_DEVICE,
71 },
72};
73
74static struct map_desc s5p6450_iodesc[] __initdata = {
75 {
76 .virtual = (unsigned long)S3C_VA_UART,
77 .pfn = __phys_to_pfn(S5P6450_PA_UART(0)),
78 .length = SZ_512K,
79 .type = MT_DEVICE,
80 }, {
81 .virtual = (unsigned long)S3C_VA_UART + SZ_512K,
82 .pfn = __phys_to_pfn(S5P6450_PA_UART(5)),
83 .length = SZ_4K,
84 .type = MT_DEVICE,
85 },
86};
87
88static void s5p64x0_idle(void)
89{
90 unsigned long val;
91
92 if (!need_resched()) {
93 val = __raw_readl(S5P64X0_PWR_CFG);
94 val &= ~(0x3 << 5);
95 val |= (0x1 << 5);
96 __raw_writel(val, S5P64X0_PWR_CFG);
97
98 cpu_do_idle();
99 }
100 local_irq_enable();
101}
102
103/*
104 * s5p64x0_map_io
105 *
106 * register the standard CPU IO areas
107 */
108
109void __init s5p6440_map_io(void)
110{
111 /* initialize any device information early */
112 s3c_adc_setname("s3c64xx-adc");
113 s3c_fb_setname("s5p64x0-fb");
114
115 iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
116 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
117 init_consistent_dma_size(SZ_8M);
118}
119
120void __init s5p6450_map_io(void)
121{
122 /* initialize any device information early */
123 s3c_adc_setname("s3c64xx-adc");
124 s3c_fb_setname("s5p64x0-fb");
125
126 iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
127 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
128 init_consistent_dma_size(SZ_8M);
129}
130
131/*
132 * s5p64x0_init_clocks
133 *
134 * register and setup the CPU clocks
135 */
136
137void __init s5p6440_init_clocks(int xtal)
138{
139 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
140
141 s3c24xx_register_baseclocks(xtal);
142 s5p_register_clocks(xtal);
143 s5p6440_register_clocks();
144 s5p6440_setup_clocks();
145}
146
147void __init s5p6450_init_clocks(int xtal)
148{
149 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
150
151 s3c24xx_register_baseclocks(xtal);
152 s5p_register_clocks(xtal);
153 s5p6450_register_clocks();
154 s5p6450_setup_clocks();
155}
156
157/*
158 * s5p64x0_init_irq
159 *
160 * register the CPU interrupts
161 */
162
163void __init s5p6440_init_irq(void)
164{
165 /* S5P6440 supports 2 VIC */
166 u32 vic[2];
167
168 /*
169 * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)]
170 * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22]
171 */
172 vic[0] = 0xff800ae7;
173 vic[1] = 0xffbf23e5;
174
175 s5p_init_irq(vic, ARRAY_SIZE(vic));
176}
177
178void __init s5p6450_init_irq(void)
179{
180 /* S5P6450 supports only 2 VIC */
181 u32 vic[2];
182
183 /*
184 * VIC0 is missing IRQ_VIC0[(13-15), (21-22)]
185 * VIC1 is missing IRQ VIC1[12, 14, 23]
186 */
187 vic[0] = 0xff9f1fff;
188 vic[1] = 0xff7fafff;
189
190 s5p_init_irq(vic, ARRAY_SIZE(vic));
191}
192
193struct sysdev_class s5p64x0_sysclass = {
194 .name = "s5p64x0-core",
195};
196
197static struct sys_device s5p64x0_sysdev = {
198 .cls = &s5p64x0_sysclass,
199};
200
201static int __init s5p64x0_core_init(void)
202{
203 return sysdev_class_register(&s5p64x0_sysclass);
204}
205core_initcall(s5p64x0_core_init);
206
207int __init s5p64x0_init(void)
208{
209 printk(KERN_INFO "S5P64X0(S5P6440/S5P6450): Initializing architecture\n");
210
211 /* set idle function */
212 pm_idle = s5p64x0_idle;
213
214 return sysdev_register(&s5p64x0_sysdev);
215}
diff --git a/arch/arm/mach-s5p64x0/include/mach/entry-macro.S b/arch/arm/mach-s5p64x0/include/mach/entry-macro.S
index 10b62b4f8211..fbb246d0a3df 100644
--- a/arch/arm/mach-s5p64x0/include/mach/entry-macro.S
+++ b/arch/arm/mach-s5p64x0/include/mach/entry-macro.S
@@ -10,7 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <mach/map.h> 13 .macro disable_fiq
14#include <plat/irqs.h> 14 .endm
15 15
16#include <asm/entry-macro-vic2.S> 16 .macro arch_ret_to_user, tmp1, tmp2
17 .endm
diff --git a/arch/arm/mach-s5p64x0/include/mach/system.h b/arch/arm/mach-s5p64x0/include/mach/system.h
index 60f57532c970..cf26e0954a2f 100644
--- a/arch/arm/mach-s5p64x0/include/mach/system.h
+++ b/arch/arm/mach-s5p64x0/include/mach/system.h
@@ -13,8 +13,6 @@
13#ifndef __ASM_ARCH_SYSTEM_H 13#ifndef __ASM_ARCH_SYSTEM_H
14#define __ASM_ARCH_SYSTEM_H __FILE__ 14#define __ASM_ARCH_SYSTEM_H __FILE__
15 15
16#include <plat/system-reset.h>
17
18static void arch_idle(void) 16static void arch_idle(void)
19{ 17{
20 /* nothing here yet */ 18 /* nothing here yet */
diff --git a/arch/arm/mach-s5p64x0/include/mach/vmalloc.h b/arch/arm/mach-s5p64x0/include/mach/vmalloc.h
deleted file mode 100644
index 38dcc71a03cc..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/vmalloc.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * S3C6400 vmalloc definition
13*/
14
15#ifndef __ASM_ARCH_VMALLOC_H
16#define __ASM_ARCH_VMALLOC_H
17
18#define VMALLOC_END 0xF6000000UL
19
20#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s5p64x0/init.c b/arch/arm/mach-s5p64x0/init.c
deleted file mode 100644
index 79833caf8165..000000000000
--- a/arch/arm/mach-s5p64x0/init.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/init.c
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P64X0 - Init support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/init.h>
16#include <linux/serial_core.h>
17
18#include <mach/map.h>
19
20#include <plat/cpu.h>
21#include <plat/devs.h>
22#include <plat/s5p6440.h>
23#include <plat/s5p6450.h>
24#include <plat/regs-serial.h>
25
26static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = {
27 [0] = {
28 .name = "pclk_low",
29 .divisor = 1,
30 .min_baud = 0,
31 .max_baud = 0,
32 },
33 [1] = {
34 .name = "uclk1",
35 .divisor = 1,
36 .min_baud = 0,
37 .max_baud = 0,
38 },
39};
40
41/* uart registration process */
42
43void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
44{
45 struct s3c2410_uartcfg *tcfg = cfg;
46 u32 ucnt;
47
48 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
49 if (!tcfg->clocks) {
50 tcfg->clocks = s5p64x0_serial_clocks;
51 tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks);
52 }
53 }
54}
55
56void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
57{
58 int uart;
59
60 for (uart = 0; uart < no; uart++) {
61 s5p_uart_resources[uart].resources->start = S5P6440_PA_UART(uart);
62 s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART;
63 }
64
65 s5p64x0_common_init_uarts(cfg, no);
66 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
67}
68
69void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no)
70{
71 s5p64x0_common_init_uarts(cfg, no);
72 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
73}
diff --git a/arch/arm/mach-s5p64x0/irq-eint.c b/arch/arm/mach-s5p64x0/irq-eint.c
deleted file mode 100644
index 275dc74f4a7b..000000000000
--- a/arch/arm/mach-s5p64x0/irq-eint.c
+++ /dev/null
@@ -1,155 +0,0 @@
1/* arch/arm/mach-s5p64x0/irq-eint.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd
4 * http://www.samsung.com/
5 *
6 * Based on linux/arch/arm/mach-s3c64xx/irq-eint.c
7 *
8 * S5P64X0 - Interrupt handling for External Interrupts.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/gpio.h>
17#include <linux/irq.h>
18#include <linux/io.h>
19
20#include <plat/cpu.h>
21#include <plat/regs-irqtype.h>
22#include <plat/gpio-cfg.h>
23#include <plat/pm.h>
24
25#include <mach/regs-gpio.h>
26#include <mach/regs-clock.h>
27
28#define eint_offset(irq) ((irq) - IRQ_EINT(0))
29
30static int s5p64x0_irq_eint_set_type(struct irq_data *data, unsigned int type)
31{
32 int offs = eint_offset(data->irq);
33 int shift;
34 u32 ctrl, mask;
35 u32 newvalue = 0;
36
37 if (offs > 15)
38 return -EINVAL;
39
40 switch (type) {
41 case IRQ_TYPE_NONE:
42 printk(KERN_WARNING "No edge setting!\n");
43 break;
44 case IRQ_TYPE_EDGE_RISING:
45 newvalue = S3C2410_EXTINT_RISEEDGE;
46 break;
47 case IRQ_TYPE_EDGE_FALLING:
48 newvalue = S3C2410_EXTINT_FALLEDGE;
49 break;
50 case IRQ_TYPE_EDGE_BOTH:
51 newvalue = S3C2410_EXTINT_BOTHEDGE;
52 break;
53 case IRQ_TYPE_LEVEL_LOW:
54 newvalue = S3C2410_EXTINT_LOWLEV;
55 break;
56 case IRQ_TYPE_LEVEL_HIGH:
57 newvalue = S3C2410_EXTINT_HILEV;
58 break;
59 default:
60 printk(KERN_ERR "No such irq type %d", type);
61 return -EINVAL;
62 }
63
64 shift = (offs / 2) * 4;
65 mask = 0x7 << shift;
66
67 ctrl = __raw_readl(S5P64X0_EINT0CON0) & ~mask;
68 ctrl |= newvalue << shift;
69 __raw_writel(ctrl, S5P64X0_EINT0CON0);
70
71 /* Configure the GPIO pin for 6450 or 6440 based on CPU ID */
72 if (soc_is_s5p6450())
73 s3c_gpio_cfgpin(S5P6450_GPN(offs), S3C_GPIO_SFN(2));
74 else
75 s3c_gpio_cfgpin(S5P6440_GPN(offs), S3C_GPIO_SFN(2));
76
77 return 0;
78}
79
80/*
81 * s5p64x0_irq_demux_eint
82 *
83 * This function demuxes the IRQ from the group0 external interrupts,
84 * from IRQ_EINT(0) to IRQ_EINT(15). It is designed to be inlined into
85 * the specific handlers s5p64x0_irq_demux_eintX_Y.
86 */
87static inline void s5p64x0_irq_demux_eint(unsigned int start, unsigned int end)
88{
89 u32 status = __raw_readl(S5P64X0_EINT0PEND);
90 u32 mask = __raw_readl(S5P64X0_EINT0MASK);
91 unsigned int irq;
92
93 status &= ~mask;
94 status >>= start;
95 status &= (1 << (end - start + 1)) - 1;
96
97 for (irq = IRQ_EINT(start); irq <= IRQ_EINT(end); irq++) {
98 if (status & 1)
99 generic_handle_irq(irq);
100 status >>= 1;
101 }
102}
103
104static void s5p64x0_irq_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
105{
106 s5p64x0_irq_demux_eint(0, 3);
107}
108
109static void s5p64x0_irq_demux_eint4_11(unsigned int irq, struct irq_desc *desc)
110{
111 s5p64x0_irq_demux_eint(4, 11);
112}
113
114static void s5p64x0_irq_demux_eint12_15(unsigned int irq,
115 struct irq_desc *desc)
116{
117 s5p64x0_irq_demux_eint(12, 15);
118}
119
120static int s5p64x0_alloc_gc(void)
121{
122 struct irq_chip_generic *gc;
123 struct irq_chip_type *ct;
124
125 gc = irq_alloc_generic_chip("s5p64x0-eint", 1, S5P_IRQ_EINT_BASE,
126 S5P_VA_GPIO, handle_level_irq);
127 if (!gc) {
128 printk(KERN_ERR "%s: irq_alloc_generic_chip for group 0"
129 "external interrupts failed\n", __func__);
130 return -EINVAL;
131 }
132
133 ct = gc->chip_types;
134 ct->chip.irq_ack = irq_gc_ack_set_bit;
135 ct->chip.irq_mask = irq_gc_mask_set_bit;
136 ct->chip.irq_unmask = irq_gc_mask_clr_bit;
137 ct->chip.irq_set_type = s5p64x0_irq_eint_set_type;
138 ct->chip.irq_set_wake = s3c_irqext_wake;
139 ct->regs.ack = EINT0PEND_OFFSET;
140 ct->regs.mask = EINT0MASK_OFFSET;
141 irq_setup_generic_chip(gc, IRQ_MSK(16), IRQ_GC_INIT_MASK_CACHE,
142 IRQ_NOREQUEST | IRQ_NOPROBE, 0);
143 return 0;
144}
145
146static int __init s5p64x0_init_irq_eint(void)
147{
148 int ret = s5p64x0_alloc_gc();
149 irq_set_chained_handler(IRQ_EINT0_3, s5p64x0_irq_demux_eint0_3);
150 irq_set_chained_handler(IRQ_EINT4_11, s5p64x0_irq_demux_eint4_11);
151 irq_set_chained_handler(IRQ_EINT12_15, s5p64x0_irq_demux_eint12_15);
152
153 return ret;
154}
155arch_initcall(s5p64x0_init_irq_eint);
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 4a1250cd1356..34d98a1dae57 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -27,6 +27,7 @@
27 27
28#include <video/platform_lcd.h> 28#include <video/platform_lcd.h>
29 29
30#include <asm/hardware/vic.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
@@ -40,7 +41,6 @@
40 41
41#include <plat/regs-serial.h> 42#include <plat/regs-serial.h>
42#include <plat/gpio-cfg.h> 43#include <plat/gpio-cfg.h>
43#include <plat/s5p6440.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
46#include <plat/cpu.h> 46#include <plat/cpu.h>
@@ -53,6 +53,8 @@
53#include <plat/fb.h> 53#include <plat/fb.h>
54#include <plat/regs-fb.h> 54#include <plat/regs-fb.h>
55 55
56#include "common.h"
57
56#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 58#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
57 S3C2410_UCON_RXILEVEL | \ 59 S3C2410_UCON_RXILEVEL | \
58 S3C2410_UCON_TXIRQMODE | \ 60 S3C2410_UCON_TXIRQMODE | \
@@ -201,7 +203,7 @@ static struct platform_pwm_backlight_data smdk6440_bl_data = {
201 203
202static void __init smdk6440_map_io(void) 204static void __init smdk6440_map_io(void)
203{ 205{
204 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 206 s5p64x0_init_io(NULL, 0);
205 s3c24xx_init_clocks(12000000); 207 s3c24xx_init_clocks(12000000);
206 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs)); 208 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs));
207 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 209 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -242,7 +244,9 @@ MACHINE_START(SMDK6440, "SMDK6440")
242 .atag_offset = 0x100, 244 .atag_offset = 0x100,
243 245
244 .init_irq = s5p6440_init_irq, 246 .init_irq = s5p6440_init_irq,
247 .handle_irq = vic_handle_irq,
245 .map_io = smdk6440_map_io, 248 .map_io = smdk6440_map_io,
246 .init_machine = smdk6440_machine_init, 249 .init_machine = smdk6440_machine_init,
247 .timer = &s5p_timer, 250 .timer = &s5p_timer,
251 .restart = s5p64x0_restart,
248MACHINE_END 252MACHINE_END
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 0ab129ecf009..135cf5d84737 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -27,6 +27,7 @@
27 27
28#include <video/platform_lcd.h> 28#include <video/platform_lcd.h>
29 29
30#include <asm/hardware/vic.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
@@ -40,7 +41,6 @@
40 41
41#include <plat/regs-serial.h> 42#include <plat/regs-serial.h>
42#include <plat/gpio-cfg.h> 43#include <plat/gpio-cfg.h>
43#include <plat/s5p6450.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
46#include <plat/cpu.h> 46#include <plat/cpu.h>
@@ -53,6 +53,8 @@
53#include <plat/fb.h> 53#include <plat/fb.h>
54#include <plat/regs-fb.h> 54#include <plat/regs-fb.h>
55 55
56#include "common.h"
57
56#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 58#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
57 S3C2410_UCON_RXILEVEL | \ 59 S3C2410_UCON_RXILEVEL | \
58 S3C2410_UCON_TXIRQMODE | \ 60 S3C2410_UCON_TXIRQMODE | \
@@ -221,7 +223,7 @@ static struct platform_pwm_backlight_data smdk6450_bl_data = {
221 223
222static void __init smdk6450_map_io(void) 224static void __init smdk6450_map_io(void)
223{ 225{
224 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 226 s5p64x0_init_io(NULL, 0);
225 s3c24xx_init_clocks(19200000); 227 s3c24xx_init_clocks(19200000);
226 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs)); 228 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs));
227 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 229 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -262,7 +264,9 @@ MACHINE_START(SMDK6450, "SMDK6450")
262 .atag_offset = 0x100, 264 .atag_offset = 0x100,
263 265
264 .init_irq = s5p6450_init_irq, 266 .init_irq = s5p6450_init_irq,
267 .handle_irq = vic_handle_irq,
265 .map_io = smdk6450_map_io, 268 .map_io = smdk6450_map_io,
266 .init_machine = smdk6450_machine_init, 269 .init_machine = smdk6450_machine_init,
267 .timer = &s5p_timer, 270 .timer = &s5p_timer,
271 .restart = s5p64x0_restart,
268MACHINE_END 272MACHINE_END
diff --git a/arch/arm/mach-s5p64x0/pm.c b/arch/arm/mach-s5p64x0/pm.c
index 69927243d25f..23f9b22439c9 100644
--- a/arch/arm/mach-s5p64x0/pm.c
+++ b/arch/arm/mach-s5p64x0/pm.c
@@ -160,7 +160,7 @@ static void s5p64x0_pm_prepare(void)
160 160
161} 161}
162 162
163static int s5p64x0_pm_add(struct sys_device *sysdev) 163static int s5p64x0_pm_add(struct device *dev)
164{ 164{
165 pm_cpu_prep = s5p64x0_pm_prepare; 165 pm_cpu_prep = s5p64x0_pm_prepare;
166 pm_cpu_sleep = s5p64x0_cpu_suspend; 166 pm_cpu_sleep = s5p64x0_cpu_suspend;
@@ -169,15 +169,17 @@ static int s5p64x0_pm_add(struct sys_device *sysdev)
169 return 0; 169 return 0;
170} 170}
171 171
172static struct sysdev_driver s5p64x0_pm_driver = { 172static struct subsys_interface s5p64x0_pm_interface = {
173 .add = s5p64x0_pm_add, 173 .name = "s5p64x0_pm",
174 .subsys = &s5p64x0_subsys,
175 .add_dev = s5p64x0_pm_add,
174}; 176};
175 177
176static __init int s5p64x0_pm_drvinit(void) 178static __init int s5p64x0_pm_drvinit(void)
177{ 179{
178 s3c_pm_init(); 180 s3c_pm_init();
179 181
180 return sysdev_driver_register(&s5p64x0_sysclass, &s5p64x0_pm_driver); 182 return subsys_interface_register(&s5p64x0_pm_interface);
181} 183}
182arch_initcall(s5p64x0_pm_drvinit); 184arch_initcall(s5p64x0_pm_drvinit);
183 185
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index a5e6e608b498..c3166c4d2ace 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -9,28 +9,25 @@ obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11 11
12# Core support for S5PC100 system 12# Core
13 13
14obj-$(CONFIG_CPU_S5PC100) += cpu.o init.o clock.o 14obj-y += common.o clock.o
15obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o
16obj-$(CONFIG_CPU_S5PC100) += dma.o
17 15
18# Helper and device support 16obj-y += dma.o
19
20obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
21obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
22obj-$(CONFIG_S5PC100_SETUP_IDE) += setup-ide.o
23obj-$(CONFIG_S5PC100_SETUP_KEYPAD) += setup-keypad.o
24obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o
25obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
26
27# device support
28obj-y += dev-audio.o
29obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
30 17
31# machine support 18# machine support
32 19
33obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o 20obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
34 21
35# device support 22# device support
23
36obj-y += dev-audio.o 24obj-y += dev-audio.o
25obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
26
27obj-y += setup-i2c0.o
28obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
29obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
30obj-$(CONFIG_S5PC100_SETUP_IDE) += setup-ide.o
31obj-$(CONFIG_S5PC100_SETUP_KEYPAD) += setup-keypad.o
32obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o
33obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
index 8d47709da713..c4c74893f53c 100644
--- a/arch/arm/mach-s5pc100/clock.c
+++ b/arch/arm/mach-s5pc100/clock.c
@@ -27,7 +27,8 @@
27#include <plat/pll.h> 27#include <plat/pll.h>
28#include <plat/s5p-clock.h> 28#include <plat/s5p-clock.h>
29#include <plat/clock-clksrc.h> 29#include <plat/clock-clksrc.h>
30#include <plat/s5pc100.h> 30
31#include "common.h"
31 32
32static struct clk s5p_clk_otgphy = { 33static struct clk s5p_clk_otgphy = {
33 .name = "otg_phy", 34 .name = "otg_phy",
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/common.c
index fd2708e7d8a9..c9095730a7f5 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/common.c
@@ -1,17 +1,16 @@
1/* linux/arch/arm/mach-s5pc100/cpu.c 1/*
2 * 2 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 3 * http://www.samsung.com
5 * 4 *
6 * Copyright 2009 Samsung Electronics Co. 5 * Copyright 2009 Samsung Electronics Co.
7 * Byungho Min <bhmin@samsung.com> 6 * Byungho Min <bhmin@samsung.com>
8 * 7 *
9 * Based on mach-s3c6410/cpu.c 8 * Common Codes for S5PC100
10 * 9 *
11 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
14*/ 13 */
15 14
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/types.h> 16#include <linux/types.h>
@@ -21,40 +20,78 @@
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/clk.h> 21#include <linux/clk.h>
23#include <linux/io.h> 22#include <linux/io.h>
24#include <linux/sysdev.h> 23#include <linux/device.h>
25#include <linux/serial_core.h> 24#include <linux/serial_core.h>
26#include <linux/platform_device.h> 25#include <linux/platform_device.h>
27#include <linux/sched.h> 26#include <linux/sched.h>
28 27
28#include <asm/irq.h>
29#include <asm/proc-fns.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
31#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
32 33
33#include <asm/proc-fns.h>
34
35#include <mach/hardware.h>
36#include <mach/map.h> 34#include <mach/map.h>
37#include <asm/irq.h> 35#include <mach/hardware.h>
38
39#include <plat/regs-serial.h>
40#include <mach/regs-clock.h> 36#include <mach/regs-clock.h>
41 37
42#include <plat/cpu.h> 38#include <plat/cpu.h>
43#include <plat/devs.h> 39#include <plat/devs.h>
44#include <plat/clock.h> 40#include <plat/clock.h>
45#include <plat/ata-core.h>
46#include <plat/iic-core.h>
47#include <plat/sdhci.h> 41#include <plat/sdhci.h>
48#include <plat/adc-core.h> 42#include <plat/adc-core.h>
49#include <plat/onenand-core.h> 43#include <plat/ata-core.h>
50#include <plat/fb-core.h> 44#include <plat/fb-core.h>
45#include <plat/iic-core.h>
46#include <plat/onenand-core.h>
47#include <plat/regs-serial.h>
48#include <plat/watchdog-reset.h>
49
50#include "common.h"
51
52static const char name_s5pc100[] = "S5PC100";
51 53
52#include <plat/s5pc100.h> 54static struct cpu_table cpu_ids[] __initdata = {
55 {
56 .idcode = S5PC100_CPU_ID,
57 .idmask = S5PC100_CPU_MASK,
58 .map_io = s5pc100_map_io,
59 .init_clocks = s5pc100_init_clocks,
60 .init_uarts = s5pc100_init_uarts,
61 .init = s5pc100_init,
62 .name = name_s5pc100,
63 },
64};
53 65
54/* Initial IO mappings */ 66/* Initial IO mappings */
55 67
56static struct map_desc s5pc100_iodesc[] __initdata = { 68static struct map_desc s5pc100_iodesc[] __initdata = {
57 { 69 {
70 .virtual = (unsigned long)S5P_VA_CHIPID,
71 .pfn = __phys_to_pfn(S5PC100_PA_CHIPID),
72 .length = SZ_4K,
73 .type = MT_DEVICE,
74 }, {
75 .virtual = (unsigned long)S3C_VA_SYS,
76 .pfn = __phys_to_pfn(S5PC100_PA_SYSCON),
77 .length = SZ_64K,
78 .type = MT_DEVICE,
79 }, {
80 .virtual = (unsigned long)S3C_VA_TIMER,
81 .pfn = __phys_to_pfn(S5PC100_PA_TIMER),
82 .length = SZ_16K,
83 .type = MT_DEVICE,
84 }, {
85 .virtual = (unsigned long)S3C_VA_WATCHDOG,
86 .pfn = __phys_to_pfn(S5PC100_PA_WATCHDOG),
87 .length = SZ_4K,
88 .type = MT_DEVICE,
89 }, {
90 .virtual = (unsigned long)S5P_VA_SROMC,
91 .pfn = __phys_to_pfn(S5PC100_PA_SROMC),
92 .length = SZ_4K,
93 .type = MT_DEVICE,
94 }, {
58 .virtual = (unsigned long)S5P_VA_SYSTIMER, 95 .virtual = (unsigned long)S5P_VA_SYSTIMER,
59 .pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER), 96 .pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER),
60 .length = SZ_16K, 97 .length = SZ_16K,
@@ -100,15 +137,27 @@ static void s5pc100_idle(void)
100 local_irq_enable(); 137 local_irq_enable();
101} 138}
102 139
103/* s5pc100_map_io 140/*
141 * s5pc100_map_io
104 * 142 *
105 * register the standard cpu IO areas 143 * register the standard CPU IO areas
106*/ 144 */
107 145
108void __init s5pc100_map_io(void) 146void __init s5pc100_init_io(struct map_desc *mach_desc, int size)
109{ 147{
148 /* initialize the io descriptors we need for initialization */
110 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc)); 149 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
150 if (mach_desc)
151 iotable_init(mach_desc, size);
152
153 /* detect cpu id and rev. */
154 s5p_init_cpu(S5P_VA_CHIPID);
111 155
156 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
157}
158
159void __init s5pc100_map_io(void)
160{
112 /* initialise device information early */ 161 /* initialise device information early */
113 s5pc100_default_sdhci0(); 162 s5pc100_default_sdhci0();
114 s5pc100_default_sdhci1(); 163 s5pc100_default_sdhci1();
@@ -143,19 +192,19 @@ void __init s5pc100_init_irq(void)
143 s5p_init_irq(vic, ARRAY_SIZE(vic)); 192 s5p_init_irq(vic, ARRAY_SIZE(vic));
144} 193}
145 194
146static struct sysdev_class s5pc100_sysclass = { 195static struct bus_type s5pc100_subsys = {
147 .name = "s5pc100-core", 196 .name = "s5pc100-core",
197 .dev_name = "s5pc100-core",
148}; 198};
149 199
150static struct sys_device s5pc100_sysdev = { 200static struct device s5pc100_dev = {
151 .cls = &s5pc100_sysclass, 201 .bus = &s5pc100_subsys,
152}; 202};
153 203
154static int __init s5pc100_core_init(void) 204static int __init s5pc100_core_init(void)
155{ 205{
156 return sysdev_class_register(&s5pc100_sysclass); 206 return subsys_system_register(&s5pc100_subsys, NULL);
157} 207}
158
159core_initcall(s5pc100_core_init); 208core_initcall(s5pc100_core_init);
160 209
161int __init s5pc100_init(void) 210int __init s5pc100_init(void)
@@ -165,5 +214,20 @@ int __init s5pc100_init(void)
165 /* set idle function */ 214 /* set idle function */
166 pm_idle = s5pc100_idle; 215 pm_idle = s5pc100_idle;
167 216
168 return sysdev_register(&s5pc100_sysdev); 217 return device_register(&s5pc100_dev);
218}
219
220/* uart registration process */
221
222void __init s5pc100_init_uarts(struct s3c2410_uartcfg *cfg, int no)
223{
224 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
225}
226
227void s5pc100_restart(char mode, const char *cmd)
228{
229 if (mode != 's')
230 arch_wdt_reset();
231
232 soft_restart(0);
169} 233}
diff --git a/arch/arm/mach-s5pc100/common.h b/arch/arm/mach-s5pc100/common.h
new file mode 100644
index 000000000000..9fbd3ae2b401
--- /dev/null
+++ b/arch/arm/mach-s5pc100/common.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Header for S5PC100 machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ARCH_ARM_MACH_S5PC100_COMMON_H
13#define __ARCH_ARM_MACH_S5PC100_COMMON_H
14
15void s5pc100_init_io(struct map_desc *mach_desc, int size);
16void s5pc100_init_irq(void);
17
18void s5pc100_register_clocks(void);
19void s5pc100_setup_clocks(void);
20
21void s5pc100_restart(char mode, const char *cmd);
22
23#ifdef CONFIG_CPU_S5PC100
24
25extern int s5pc100_init(void);
26extern void s5pc100_map_io(void);
27extern void s5pc100_init_clocks(int xtal);
28extern void s5pc100_init_uarts(struct s3c2410_uartcfg *cfg, int no);
29
30#else
31#define s5pc100_init_clocks NULL
32#define s5pc100_init_uarts NULL
33#define s5pc100_map_io NULL
34#define s5pc100_init NULL
35#endif
36
37#endif /* __ARCH_ARM_MACH_S5PC100_COMMON_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/entry-macro.S b/arch/arm/mach-s5pc100/include/mach/entry-macro.S
index ba76af052c81..b8c242edfa22 100644
--- a/arch/arm/mach-s5pc100/include/mach/entry-macro.S
+++ b/arch/arm/mach-s5pc100/include/mach/entry-macro.S
@@ -12,39 +12,14 @@
12 * warranty of any kind, whether express or implied. 12 * warranty of any kind, whether express or implied.
13*/ 13*/
14 14
15#include <asm/hardware/vic.h>
16#include <mach/map.h>
17#include <plat/irqs.h>
18
19 .macro disable_fiq 15 .macro disable_fiq
20 .endm 16 .endm
21 17
22 .macro get_irqnr_preamble, base, tmp 18 .macro get_irqnr_preamble, base, tmp
23 ldr \base, =VA_VIC0
24 .endm 19 .endm
25 20
26 .macro arch_ret_to_user, tmp1, tmp2 21 .macro arch_ret_to_user, tmp1, tmp2
27 .endm 22 .endm
28 23
29 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
30
31 @ check the vic0
32 mov \irqnr, # S5P_IRQ_OFFSET + 31
33 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
34 teq \irqstat, #0
35
36 @ otherwise try vic1
37 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
38 addeq \irqnr, \irqnr, #32
39 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
40 teqeq \irqstat, #0
41
42 @ otherwise try vic2
43 addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
44 addeq \irqnr, \irqnr, #32
45 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
46 teqeq \irqstat, #0
47
48 clzne \irqstat, \irqstat
49 subne \irqnr, \irqnr, \irqstat
50 .endm 25 .endm
diff --git a/arch/arm/mach-s5pc100/include/mach/system.h b/arch/arm/mach-s5pc100/include/mach/system.h
index a9ea57c06600..afc96c298518 100644
--- a/arch/arm/mach-s5pc100/include/mach/system.h
+++ b/arch/arm/mach-s5pc100/include/mach/system.h
@@ -11,8 +11,6 @@
11#ifndef __ASM_ARCH_SYSTEM_H 11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H __FILE__ 12#define __ASM_ARCH_SYSTEM_H __FILE__
13 13
14#include <plat/system-reset.h>
15
16static void arch_idle(void) 14static void arch_idle(void)
17{ 15{
18 /* nothing here yet */ 16 /* nothing here yet */
diff --git a/arch/arm/mach-s5pc100/include/mach/vmalloc.h b/arch/arm/mach-s5pc100/include/mach/vmalloc.h
deleted file mode 100644
index 44c8e5726d9d..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/vmalloc.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* arch/arm/mach-s5pc100/include/mach/vmalloc.h
2 *
3 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C6400 vmalloc definition
10*/
11
12#ifndef __ASM_ARCH_VMALLOC_H
13#define __ASM_ARCH_VMALLOC_H
14
15#define VMALLOC_END 0xF6000000UL
16
17#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s5pc100/init.c b/arch/arm/mach-s5pc100/init.c
deleted file mode 100644
index 19d7b523c137..000000000000
--- a/arch/arm/mach-s5pc100/init.c
+++ /dev/null
@@ -1,24 +0,0 @@
1/* linux/arch/arm/plat-s5pc100/s5pc100-init.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/init.h>
15
16#include <plat/cpu.h>
17#include <plat/devs.h>
18#include <plat/s5pc100.h>
19
20/* uart registration process */
21void __init s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
22{
23 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
24}
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 26f5c91c9427..674d22992f3c 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -25,6 +25,7 @@
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/pwm_backlight.h> 26#include <linux/pwm_backlight.h>
27 27
28#include <asm/hardware/vic.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30 31
@@ -42,7 +43,6 @@
42#include <plat/clock.h> 43#include <plat/clock.h>
43#include <plat/devs.h> 44#include <plat/devs.h>
44#include <plat/cpu.h> 45#include <plat/cpu.h>
45#include <plat/s5pc100.h>
46#include <plat/fb.h> 46#include <plat/fb.h>
47#include <plat/iic.h> 47#include <plat/iic.h>
48#include <plat/ata.h> 48#include <plat/ata.h>
@@ -53,6 +53,8 @@
53#include <plat/backlight.h> 53#include <plat/backlight.h>
54#include <plat/regs-fb-v4.h> 54#include <plat/regs-fb-v4.h>
55 55
56#include "common.h"
57
56/* Following are default values for UCON, ULCON and UFCON UART registers */ 58/* Following are default values for UCON, ULCON and UFCON UART registers */
57#define SMDKC100_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 59#define SMDKC100_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
58 S3C2410_UCON_RXILEVEL | \ 60 S3C2410_UCON_RXILEVEL | \
@@ -215,7 +217,7 @@ static struct platform_pwm_backlight_data smdkc100_bl_data = {
215 217
216static void __init smdkc100_map_io(void) 218static void __init smdkc100_map_io(void)
217{ 219{
218 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 220 s5pc100_init_io(NULL, 0);
219 s3c24xx_init_clocks(12000000); 221 s3c24xx_init_clocks(12000000);
220 s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs)); 222 s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
221} 223}
@@ -250,7 +252,9 @@ MACHINE_START(SMDKC100, "SMDKC100")
250 /* Maintainer: Byungho Min <bhmin@samsung.com> */ 252 /* Maintainer: Byungho Min <bhmin@samsung.com> */
251 .atag_offset = 0x100, 253 .atag_offset = 0x100,
252 .init_irq = s5pc100_init_irq, 254 .init_irq = s5pc100_init_irq,
255 .handle_irq = vic_handle_irq,
253 .map_io = smdkc100_map_io, 256 .map_io = smdkc100_map_io,
254 .init_machine = smdkc100_machine_init, 257 .init_machine = smdkc100_machine_init,
255 .timer = &s3c24xx_timer, 258 .timer = &s3c24xx_timer,
259 .restart = s5pc100_restart,
256MACHINE_END 260MACHINE_END
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 009fbe53df96..4c59186de957 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -10,18 +10,20 @@ obj-m :=
10obj-n := 10obj-n :=
11obj- := 11obj- :=
12 12
13# Core support for S5PV210 system 13# Core
14
15obj-y += common.o clock.o
14 16
15obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o dma.o
16obj-$(CONFIG_CPU_S5PV210) += setup-i2c0.o
17obj-$(CONFIG_PM) += pm.o 17obj-$(CONFIG_PM) += pm.o
18 18
19obj-y += dma.o
20
19# machine support 21# machine support
20 22
21obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o 23obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o
22obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
23obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
24obj-$(CONFIG_MACH_GONI) += mach-goni.o 24obj-$(CONFIG_MACH_GONI) += mach-goni.o
25obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
26obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
25obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o 27obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o
26 28
27# device support 29# device support
@@ -29,11 +31,12 @@ obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o
29obj-y += dev-audio.o 31obj-y += dev-audio.o
30obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o 32obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
31 33
34obj-y += setup-i2c0.o
32obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o 35obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o
33obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o 36obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o
34obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o 37obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o
35obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o 38obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o
36obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o 39obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o
37obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o 40obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o
38obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o 41obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o
39obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o 42obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index 4c5ac7a69e9e..04c9b578e626 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/map.h> 23#include <mach/map.h>
@@ -29,7 +29,8 @@
29#include <plat/pll.h> 29#include <plat/pll.h>
30#include <plat/s5p-clock.h> 30#include <plat/s5p-clock.h>
31#include <plat/clock-clksrc.h> 31#include <plat/clock-clksrc.h>
32#include <plat/s5pv210.h> 32
33#include "common.h"
33 34
34static unsigned long xtal; 35static unsigned long xtal;
35 36
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/common.c
index 84ec74633232..0ec393305d7c 100644
--- a/arch/arm/mach-s5pv210/cpu.c
+++ b/arch/arm/mach-s5pv210/common.c
@@ -1,12 +1,13 @@
1/* linux/arch/arm/mach-s5pv210/cpu.c 1/*
2 * 2 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 3 * http://www.samsung.com
5 * 4 *
5 * Common Codes for S5PV210
6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
9*/ 10 */
10 11
11#include <linux/kernel.h> 12#include <linux/kernel.h>
12#include <linux/types.h> 13#include <linux/types.h>
@@ -17,37 +18,78 @@
17#include <linux/module.h> 18#include <linux/module.h>
18#include <linux/clk.h> 19#include <linux/clk.h>
19#include <linux/io.h> 20#include <linux/io.h>
20#include <linux/sysdev.h> 21#include <linux/device.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22#include <linux/sched.h> 23#include <linux/sched.h>
23#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
25#include <linux/serial_core.h>
24 26
27#include <asm/proc-fns.h>
25#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 29#include <asm/mach/map.h>
27#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
28 31
29#include <asm/proc-fns.h>
30#include <mach/map.h> 32#include <mach/map.h>
31#include <mach/regs-clock.h> 33#include <mach/regs-clock.h>
32 34
33#include <plat/cpu.h> 35#include <plat/cpu.h>
34#include <plat/devs.h>
35#include <plat/clock.h> 36#include <plat/clock.h>
36#include <plat/fb-core.h> 37#include <plat/devs.h>
37#include <plat/s5pv210.h> 38#include <plat/sdhci.h>
38#include <plat/adc-core.h> 39#include <plat/adc-core.h>
39#include <plat/ata-core.h> 40#include <plat/ata-core.h>
41#include <plat/fb-core.h>
40#include <plat/fimc-core.h> 42#include <plat/fimc-core.h>
41#include <plat/iic-core.h> 43#include <plat/iic-core.h>
42#include <plat/keypad-core.h> 44#include <plat/keypad-core.h>
43#include <plat/sdhci.h>
44#include <plat/reset.h>
45#include <plat/tv-core.h> 45#include <plat/tv-core.h>
46#include <plat/regs-serial.h>
47
48#include "common.h"
49
50static const char name_s5pv210[] = "S5PV210/S5PC110";
51
52static struct cpu_table cpu_ids[] __initdata = {
53 {
54 .idcode = S5PV210_CPU_ID,
55 .idmask = S5PV210_CPU_MASK,
56 .map_io = s5pv210_map_io,
57 .init_clocks = s5pv210_init_clocks,
58 .init_uarts = s5pv210_init_uarts,
59 .init = s5pv210_init,
60 .name = name_s5pv210,
61 },
62};
46 63
47/* Initial IO mappings */ 64/* Initial IO mappings */
48 65
49static struct map_desc s5pv210_iodesc[] __initdata = { 66static struct map_desc s5pv210_iodesc[] __initdata = {
50 { 67 {
68 .virtual = (unsigned long)S5P_VA_CHIPID,
69 .pfn = __phys_to_pfn(S5PV210_PA_CHIPID),
70 .length = SZ_4K,
71 .type = MT_DEVICE,
72 }, {
73 .virtual = (unsigned long)S3C_VA_SYS,
74 .pfn = __phys_to_pfn(S5PV210_PA_SYSCON),
75 .length = SZ_64K,
76 .type = MT_DEVICE,
77 }, {
78 .virtual = (unsigned long)S3C_VA_TIMER,
79 .pfn = __phys_to_pfn(S5PV210_PA_TIMER),
80 .length = SZ_16K,
81 .type = MT_DEVICE,
82 }, {
83 .virtual = (unsigned long)S3C_VA_WATCHDOG,
84 .pfn = __phys_to_pfn(S5PV210_PA_WATCHDOG),
85 .length = SZ_4K,
86 .type = MT_DEVICE,
87 }, {
88 .virtual = (unsigned long)S5P_VA_SROMC,
89 .pfn = __phys_to_pfn(S5PV210_PA_SROMC),
90 .length = SZ_4K,
91 .type = MT_DEVICE,
92 }, {
51 .virtual = (unsigned long)S5P_VA_SYSTIMER, 93 .virtual = (unsigned long)S5P_VA_SYSTIMER,
52 .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER), 94 .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER),
53 .length = SZ_4K, 95 .length = SZ_4K,
@@ -108,19 +150,32 @@ static void s5pv210_idle(void)
108 local_irq_enable(); 150 local_irq_enable();
109} 151}
110 152
111static void s5pv210_sw_reset(void) 153void s5pv210_restart(char mode, const char *cmd)
112{ 154{
113 __raw_writel(0x1, S5P_SWRESET); 155 __raw_writel(0x1, S5P_SWRESET);
114} 156}
115 157
116/* s5pv210_map_io 158/*
159 * s5pv210_map_io
117 * 160 *
118 * register the standard cpu IO areas 161 * register the standard cpu IO areas
119*/ 162 */
120 163
121void __init s5pv210_map_io(void) 164void __init s5pv210_init_io(struct map_desc *mach_desc, int size)
122{ 165{
166 /* initialize the io descriptors we need for initialization */
123 iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc)); 167 iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
168 if (mach_desc)
169 iotable_init(mach_desc, size);
170
171 /* detect cpu id and rev. */
172 s5p_init_cpu(S5P_VA_CHIPID);
173
174 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
175}
176
177void __init s5pv210_map_io(void)
178{
124 init_consistent_dma_size(14 << 20); 179 init_consistent_dma_size(14 << 20);
125 180
126 /* initialise device information early */ 181 /* initialise device information early */
@@ -174,19 +229,19 @@ void __init s5pv210_init_irq(void)
174 s5p_init_irq(vic, ARRAY_SIZE(vic)); 229 s5p_init_irq(vic, ARRAY_SIZE(vic));
175} 230}
176 231
177struct sysdev_class s5pv210_sysclass = { 232struct bus_type s5pv210_subsys = {
178 .name = "s5pv210-core", 233 .name = "s5pv210-core",
234 .dev_name = "s5pv210-core",
179}; 235};
180 236
181static struct sys_device s5pv210_sysdev = { 237static struct device s5pv210_dev = {
182 .cls = &s5pv210_sysclass, 238 .bus = &s5pv210_subsys,
183}; 239};
184 240
185static int __init s5pv210_core_init(void) 241static int __init s5pv210_core_init(void)
186{ 242{
187 return sysdev_class_register(&s5pv210_sysclass); 243 return subsys_system_register(&s5pv210_subsys, NULL);
188} 244}
189
190core_initcall(s5pv210_core_init); 245core_initcall(s5pv210_core_init);
191 246
192int __init s5pv210_init(void) 247int __init s5pv210_init(void)
@@ -196,8 +251,31 @@ int __init s5pv210_init(void)
196 /* set idle function */ 251 /* set idle function */
197 pm_idle = s5pv210_idle; 252 pm_idle = s5pv210_idle;
198 253
199 /* set sw_reset function */ 254 return device_register(&s5pv210_dev);
200 s5p_reset_hook = s5pv210_sw_reset; 255}
256
257static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
258 [0] = {
259 .name = "pclk",
260 .divisor = 1,
261 .min_baud = 0,
262 .max_baud = 0,
263 },
264};
265
266/* uart registration process */
267
268void __init s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no)
269{
270 struct s3c2410_uartcfg *tcfg = cfg;
271 u32 ucnt;
272
273 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
274 if (!tcfg->clocks) {
275 tcfg->clocks = s5pv210_serial_clocks;
276 tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks);
277 }
278 }
201 279
202 return sysdev_register(&s5pv210_sysdev); 280 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
203} 281}
diff --git a/arch/arm/mach-s5pv210/common.h b/arch/arm/mach-s5pv210/common.h
new file mode 100644
index 000000000000..6ed2af5c7518
--- /dev/null
+++ b/arch/arm/mach-s5pv210/common.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Header for S5PV210 machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ARCH_ARM_MACH_S5PV210_COMMON_H
13#define __ARCH_ARM_MACH_S5PV210_COMMON_H
14
15void s5pv210_init_io(struct map_desc *mach_desc, int size);
16void s5pv210_init_irq(void);
17
18void s5pv210_register_clocks(void);
19void s5pv210_setup_clocks(void);
20
21void s5pv210_restart(char mode, const char *cmd);
22
23#ifdef CONFIG_CPU_S5PV210
24
25extern int s5pv210_init(void);
26extern void s5pv210_map_io(void);
27extern void s5pv210_init_clocks(int xtal);
28extern void s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no);
29
30#else
31#define s5pv210_init_clocks NULL
32#define s5pv210_init_uarts NULL
33#define s5pv210_map_io NULL
34#define s5pv210_init NULL
35#endif
36
37#endif /* __ARCH_ARM_MACH_S5PV210_COMMON_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/entry-macro.S b/arch/arm/mach-s5pv210/include/mach/entry-macro.S
index 3aa41ac59f07..bebca1b5d0b1 100644
--- a/arch/arm/mach-s5pv210/include/mach/entry-macro.S
+++ b/arch/arm/mach-s5pv210/include/mach/entry-macro.S
@@ -10,45 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <asm/hardware/vic.h>
14#include <mach/map.h>
15#include <plat/irqs.h>
16
17 .macro disable_fiq 13 .macro disable_fiq
18 .endm 14 .endm
19 15
20 .macro get_irqnr_preamble, base, tmp
21 ldr \base, =VA_VIC0
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2 16 .macro arch_ret_to_user, tmp1, tmp2
25 .endm 17 .endm
26
27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
28
29 @ check the vic0
30 mov \irqnr, # S5P_IRQ_OFFSET + 31
31 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
32 teq \irqstat, #0
33
34 @ otherwise try vic1
35 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
36 addeq \irqnr, \irqnr, #32
37 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
38 teqeq \irqstat, #0
39
40 @ otherwise try vic2
41 addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
42 addeq \irqnr, \irqnr, #32
43 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
44 teqeq \irqstat, #0
45
46 @ otherwise try vic3
47 addeq \tmp, \base, #(VA_VIC3 - VA_VIC0)
48 addeq \irqnr, \irqnr, #32
49 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
50 teqeq \irqstat, #0
51
52 clzne \irqstat, \irqstat
53 subne \irqnr, \irqnr, \irqstat
54 .endm
diff --git a/arch/arm/mach-s5pv210/include/mach/system.h b/arch/arm/mach-s5pv210/include/mach/system.h
index af8a200b2135..bf288ced860a 100644
--- a/arch/arm/mach-s5pv210/include/mach/system.h
+++ b/arch/arm/mach-s5pv210/include/mach/system.h
@@ -13,8 +13,6 @@
13#ifndef __ASM_ARCH_SYSTEM_H 13#ifndef __ASM_ARCH_SYSTEM_H
14#define __ASM_ARCH_SYSTEM_H __FILE__ 14#define __ASM_ARCH_SYSTEM_H __FILE__
15 15
16#include <plat/system-reset.h>
17
18static void arch_idle(void) 16static void arch_idle(void)
19{ 17{
20 /* nothing here yet */ 18 /* nothing here yet */
diff --git a/arch/arm/mach-s5pv210/include/mach/vmalloc.h b/arch/arm/mach-s5pv210/include/mach/vmalloc.h
deleted file mode 100644
index a6c659d68a5d..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/vmalloc.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/vmalloc.h
2 *
3 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 *
8 * Based on arch/arm/mach-s5p6442/include/mach/vmalloc.h
9 *
10 * S5PV210 vmalloc definition
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15*/
16
17#ifndef __ASM_ARCH_VMALLOC_H
18#define __ASM_ARCH_VMALLOC_H __FILE__
19
20#define VMALLOC_END 0xF6000000UL
21
22#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s5pv210/init.c b/arch/arm/mach-s5pv210/init.c
deleted file mode 100644
index 4865ae2c475a..000000000000
--- a/arch/arm/mach-s5pv210/init.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/init.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15
16#include <plat/cpu.h>
17#include <plat/devs.h>
18#include <plat/s5pv210.h>
19#include <plat/regs-serial.h>
20
21static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
22 [0] = {
23 .name = "pclk",
24 .divisor = 1,
25 .min_baud = 0,
26 .max_baud = 0,
27 },
28};
29
30/* uart registration process */
31void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
32{
33 struct s3c2410_uartcfg *tcfg = cfg;
34 u32 ucnt;
35
36 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
37 if (!tcfg->clocks) {
38 tcfg->clocks = s5pv210_serial_clocks;
39 tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks);
40 }
41 }
42
43 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
44}
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 5811a96125f0..6f7dfe993c12 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -22,6 +22,7 @@
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24 24
25#include <asm/hardware/vic.h>
25#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
27#include <asm/setup.h> 28#include <asm/setup.h>
@@ -32,7 +33,6 @@
32 33
33#include <plat/gpio-cfg.h> 34#include <plat/gpio-cfg.h>
34#include <plat/regs-serial.h> 35#include <plat/regs-serial.h>
35#include <plat/s5pv210.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/cpu.h> 37#include <plat/cpu.h>
38#include <plat/fb.h> 38#include <plat/fb.h>
@@ -41,6 +41,8 @@
41#include <plat/s5p-time.h> 41#include <plat/s5p-time.h>
42#include <plat/regs-fb-v4.h> 42#include <plat/regs-fb-v4.h>
43 43
44#include "common.h"
45
44/* Following are default values for UCON, ULCON and UFCON UART registers */ 46/* Following are default values for UCON, ULCON and UFCON UART registers */
45#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 47#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
46 S3C2410_UCON_RXILEVEL | \ 48 S3C2410_UCON_RXILEVEL | \
@@ -644,7 +646,7 @@ static void __init aquila_sound_init(void)
644 646
645static void __init aquila_map_io(void) 647static void __init aquila_map_io(void)
646{ 648{
647 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 649 s5pv210_init_io(NULL, 0);
648 s3c24xx_init_clocks(24000000); 650 s3c24xx_init_clocks(24000000);
649 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs)); 651 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
650 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 652 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -680,7 +682,9 @@ MACHINE_START(AQUILA, "Aquila")
680 Kyungmin Park <kyungmin.park@samsung.com> */ 682 Kyungmin Park <kyungmin.park@samsung.com> */
681 .atag_offset = 0x100, 683 .atag_offset = 0x100,
682 .init_irq = s5pv210_init_irq, 684 .init_irq = s5pv210_init_irq,
685 .handle_irq = vic_handle_irq,
683 .map_io = aquila_map_io, 686 .map_io = aquila_map_io,
684 .init_machine = aquila_machine_init, 687 .init_machine = aquila_machine_init,
685 .timer = &s5p_timer, 688 .timer = &s5p_timer,
689 .restart = s5pv210_restart,
686MACHINE_END 690MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 15edcae448b9..12c693717398 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -27,6 +27,7 @@
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29 29
30#include <asm/hardware/vic.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32#include <asm/setup.h> 33#include <asm/setup.h>
@@ -37,7 +38,6 @@
37 38
38#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
39#include <plat/regs-serial.h> 40#include <plat/regs-serial.h>
40#include <plat/s5pv210.h>
41#include <plat/devs.h> 41#include <plat/devs.h>
42#include <plat/cpu.h> 42#include <plat/cpu.h>
43#include <plat/fb.h> 43#include <plat/fb.h>
@@ -54,6 +54,8 @@
54#include <media/s5p_fimc.h> 54#include <media/s5p_fimc.h>
55#include <media/noon010pc30.h> 55#include <media/noon010pc30.h>
56 56
57#include "common.h"
58
57/* Following are default values for UCON, ULCON and UFCON UART registers */ 59/* Following are default values for UCON, ULCON and UFCON UART registers */
58#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 60#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
59 S3C2410_UCON_RXILEVEL | \ 61 S3C2410_UCON_RXILEVEL | \
@@ -890,7 +892,7 @@ static void __init goni_sound_init(void)
890 892
891static void __init goni_map_io(void) 893static void __init goni_map_io(void)
892{ 894{
893 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 895 s5pv210_init_io(NULL, 0);
894 s3c24xx_init_clocks(24000000); 896 s3c24xx_init_clocks(24000000);
895 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); 897 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
896 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 898 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -956,8 +958,10 @@ MACHINE_START(GONI, "GONI")
956 /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */ 958 /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */
957 .atag_offset = 0x100, 959 .atag_offset = 0x100,
958 .init_irq = s5pv210_init_irq, 960 .init_irq = s5pv210_init_irq,
961 .handle_irq = vic_handle_irq,
959 .map_io = goni_map_io, 962 .map_io = goni_map_io,
960 .init_machine = goni_machine_init, 963 .init_machine = goni_machine_init,
961 .timer = &s5p_timer, 964 .timer = &s5p_timer,
962 .reserve = &goni_reserve, 965 .reserve = &goni_reserve,
966 .restart = s5pv210_restart,
963MACHINE_END 967MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index f7266bb0cac8..b323983b2c54 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -13,8 +13,9 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17 17
18#include <asm/hardware/vic.h>
18#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20#include <asm/setup.h> 21#include <asm/setup.h>
@@ -24,7 +25,6 @@
24#include <mach/regs-clock.h> 25#include <mach/regs-clock.h>
25 26
26#include <plat/regs-serial.h> 27#include <plat/regs-serial.h>
27#include <plat/s5pv210.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29#include <plat/cpu.h> 29#include <plat/cpu.h>
30#include <plat/ata.h> 30#include <plat/ata.h>
@@ -32,6 +32,8 @@
32#include <plat/pm.h> 32#include <plat/pm.h>
33#include <plat/s5p-time.h> 33#include <plat/s5p-time.h>
34 34
35#include "common.h"
36
35/* Following are default values for UCON, ULCON and UFCON UART registers */ 37/* Following are default values for UCON, ULCON and UFCON UART registers */
36#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 38#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
37 S3C2410_UCON_RXILEVEL | \ 39 S3C2410_UCON_RXILEVEL | \
@@ -109,7 +111,7 @@ static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
109 111
110static void __init smdkc110_map_io(void) 112static void __init smdkc110_map_io(void)
111{ 113{
112 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 114 s5pv210_init_io(NULL, 0);
113 s3c24xx_init_clocks(24000000); 115 s3c24xx_init_clocks(24000000);
114 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); 116 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
115 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 117 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -138,7 +140,9 @@ MACHINE_START(SMDKC110, "SMDKC110")
138 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 140 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
139 .atag_offset = 0x100, 141 .atag_offset = 0x100,
140 .init_irq = s5pv210_init_irq, 142 .init_irq = s5pv210_init_irq,
143 .handle_irq = vic_handle_irq,
141 .map_io = smdkc110_map_io, 144 .map_io = smdkc110_map_io,
142 .init_machine = smdkc110_machine_init, 145 .init_machine = smdkc110_machine_init,
143 .timer = &s5p_timer, 146 .timer = &s5p_timer,
147 .restart = s5pv210_restart,
144MACHINE_END 148MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index a9106c392398..b4021dd802a8 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -13,13 +13,14 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17#include <linux/dm9000.h> 17#include <linux/dm9000.h>
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/pwm_backlight.h> 21#include <linux/pwm_backlight.h>
22 22
23#include <asm/hardware/vic.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <asm/mach/map.h> 25#include <asm/mach/map.h>
25#include <asm/setup.h> 26#include <asm/setup.h>
@@ -33,7 +34,6 @@
33#include <plat/regs-serial.h> 34#include <plat/regs-serial.h>
34#include <plat/regs-srom.h> 35#include <plat/regs-srom.h>
35#include <plat/gpio-cfg.h> 36#include <plat/gpio-cfg.h>
36#include <plat/s5pv210.h>
37#include <plat/devs.h> 37#include <plat/devs.h>
38#include <plat/cpu.h> 38#include <plat/cpu.h>
39#include <plat/adc.h> 39#include <plat/adc.h>
@@ -47,6 +47,8 @@
47#include <plat/backlight.h> 47#include <plat/backlight.h>
48#include <plat/regs-fb-v4.h> 48#include <plat/regs-fb-v4.h>
49 49
50#include "common.h"
51
50/* Following are default values for UCON, ULCON and UFCON UART registers */ 52/* Following are default values for UCON, ULCON and UFCON UART registers */
51#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 53#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
52 S3C2410_UCON_RXILEVEL | \ 54 S3C2410_UCON_RXILEVEL | \
@@ -273,11 +275,12 @@ static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = {
273 275
274static struct platform_pwm_backlight_data smdkv210_bl_data = { 276static struct platform_pwm_backlight_data smdkv210_bl_data = {
275 .pwm_id = 3, 277 .pwm_id = 3,
278 .pwm_period_ns = 1000,
276}; 279};
277 280
278static void __init smdkv210_map_io(void) 281static void __init smdkv210_map_io(void)
279{ 282{
280 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 283 s5pv210_init_io(NULL, 0);
281 s3c24xx_init_clocks(24000000); 284 s3c24xx_init_clocks(24000000);
282 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); 285 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
283 s5p_set_timer_source(S5P_PWM2, S5P_PWM4); 286 s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
@@ -315,7 +318,9 @@ MACHINE_START(SMDKV210, "SMDKV210")
315 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 318 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
316 .atag_offset = 0x100, 319 .atag_offset = 0x100,
317 .init_irq = s5pv210_init_irq, 320 .init_irq = s5pv210_init_irq,
321 .handle_irq = vic_handle_irq,
318 .map_io = smdkv210_map_io, 322 .map_io = smdkv210_map_io,
319 .init_machine = smdkv210_machine_init, 323 .init_machine = smdkv210_machine_init,
320 .timer = &s5p_timer, 324 .timer = &s5p_timer,
325 .restart = s5pv210_restart,
321MACHINE_END 326MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 97cc066c5369..74e99bc0dc9b 100644
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ b/arch/arm/mach-s5pv210/mach-torbreck.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16 16
17#include <asm/hardware/vic.h>
17#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 19#include <asm/mach/map.h>
19#include <asm/setup.h> 20#include <asm/setup.h>
@@ -23,12 +24,13 @@
23#include <mach/regs-clock.h> 24#include <mach/regs-clock.h>
24 25
25#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
26#include <plat/s5pv210.h>
27#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <plat/iic.h> 29#include <plat/iic.h>
30#include <plat/s5p-time.h> 30#include <plat/s5p-time.h>
31 31
32#include "common.h"
33
32/* Following are default values for UCON, ULCON and UFCON UART registers */ 34/* Following are default values for UCON, ULCON and UFCON UART registers */
33#define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 35#define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
34 S3C2410_UCON_RXILEVEL | \ 36 S3C2410_UCON_RXILEVEL | \
@@ -102,7 +104,7 @@ static struct i2c_board_info torbreck_i2c_devs2[] __initdata = {
102 104
103static void __init torbreck_map_io(void) 105static void __init torbreck_map_io(void)
104{ 106{
105 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 107 s5pv210_init_io(NULL, 0);
106 s3c24xx_init_clocks(24000000); 108 s3c24xx_init_clocks(24000000);
107 s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs)); 109 s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs));
108 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 110 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
@@ -127,7 +129,9 @@ MACHINE_START(TORBRECK, "TORBRECK")
127 /* Maintainer: Hyunchul Ko <ghcstop@gmail.com> */ 129 /* Maintainer: Hyunchul Ko <ghcstop@gmail.com> */
128 .atag_offset = 0x100, 130 .atag_offset = 0x100,
129 .init_irq = s5pv210_init_irq, 131 .init_irq = s5pv210_init_irq,
132 .handle_irq = vic_handle_irq,
130 .map_io = torbreck_map_io, 133 .map_io = torbreck_map_io,
131 .init_machine = torbreck_machine_init, 134 .init_machine = torbreck_machine_init,
132 .timer = &s5p_timer, 135 .timer = &s5p_timer,
136 .restart = s5pv210_restart,
133MACHINE_END 137MACHINE_END
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index f149d278377b..677c71c41e50 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -133,7 +133,7 @@ static void s5pv210_pm_prepare(void)
133 s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); 133 s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
134} 134}
135 135
136static int s5pv210_pm_add(struct sys_device *sysdev) 136static int s5pv210_pm_add(struct device *dev)
137{ 137{
138 pm_cpu_prep = s5pv210_pm_prepare; 138 pm_cpu_prep = s5pv210_pm_prepare;
139 pm_cpu_sleep = s5pv210_cpu_suspend; 139 pm_cpu_sleep = s5pv210_cpu_suspend;
@@ -141,13 +141,15 @@ static int s5pv210_pm_add(struct sys_device *sysdev)
141 return 0; 141 return 0;
142} 142}
143 143
144static struct sysdev_driver s5pv210_pm_driver = { 144static struct subsys_interface s5pv210_pm_interface = {
145 .add = s5pv210_pm_add, 145 .name = "s5pv210_pm",
146 .subsys = &s5pv210_subsys,
147 .add_dev = s5pv210_pm_add,
146}; 148};
147 149
148static __init int s5pv210_pm_drvinit(void) 150static __init int s5pv210_pm_drvinit(void)
149{ 151{
150 return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver); 152 return subsys_interface_register(&s5pv210_pm_interface);
151} 153}
152arch_initcall(s5pv210_pm_drvinit); 154arch_initcall(s5pv210_pm_drvinit);
153 155
diff --git a/arch/arm/mach-sa1100/Makefile.boot b/arch/arm/mach-sa1100/Makefile.boot
index 5a616f6e5612..f7951aa04562 100644
--- a/arch/arm/mach-sa1100/Makefile.boot
+++ b/arch/arm/mach-sa1100/Makefile.boot
@@ -1,5 +1,5 @@
1ifeq ($(CONFIG_ARCH_SA1100),y) 1ifeq ($(CONFIG_SA1111),y)
2 zreladdr-$(CONFIG_SA1111) += 0xc0208000 2 zreladdr-y += 0xc0208000
3else 3else
4 zreladdr-y += 0xc0008000 4 zreladdr-y += 0xc0008000
5endif 5endif
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 3dd133f18415..6b93e200bcac 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -455,4 +455,5 @@ MACHINE_START(ASSABET, "Intel-Assabet")
455#ifdef CONFIG_SA1111 455#ifdef CONFIG_SA1111
456 .dma_zone_size = SZ_1M, 456 .dma_zone_size = SZ_1M,
457#endif 457#endif
458 .restart = sa11x0_restart,
458MACHINE_END 459MACHINE_END
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index bda83e1ab078..b07a2c024cb7 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -309,4 +309,5 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
309#ifdef CONFIG_SA1111 309#ifdef CONFIG_SA1111
310 .dma_zone_size = SZ_1M, 310 .dma_zone_size = SZ_1M,
311#endif 311#endif
312 .restart = sa11x0_restart,
312MACHINE_END 313MACHINE_END
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 7f3da4b11ec9..11bb6d0b9be3 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -139,4 +139,5 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
139 .init_irq = cerf_init_irq, 139 .init_irq = cerf_init_irq,
140 .timer = &sa1100_timer, 140 .timer = &sa1100_timer,
141 .init_machine = cerf_init, 141 .init_machine = cerf_init,
142 .restart = sa11x0_restart,
142MACHINE_END 143MACHINE_END
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 2965cc9d424e..b9060e236def 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -387,4 +387,5 @@ MACHINE_START(COLLIE, "Sharp-Collie")
387 .init_irq = sa1100_init_irq, 387 .init_irq = sa1100_init_irq,
388 .timer = &sa1100_timer, 388 .timer = &sa1100_timer,
389 .init_machine = collie_init, 389 .init_machine = collie_init,
390 .restart = sa11x0_restart,
390MACHINE_END 391MACHINE_END
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 5fa5ae1f39e1..bb10ee2cb89f 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -126,6 +126,17 @@ static void sa1100_power_off(void)
126 PMCR = PMCR_SF; 126 PMCR = PMCR_SF;
127} 127}
128 128
129void sa11x0_restart(char mode, const char *cmd)
130{
131 if (mode == 's') {
132 /* Jump into ROM at address 0 */
133 soft_restart(0);
134 } else {
135 /* Use on-chip reset capability */
136 RSRR = RSRR_SWR;
137 }
138}
139
129static void sa11x0_register_device(struct platform_device *dev, void *data) 140static void sa11x0_register_device(struct platform_device *dev, void *data)
130{ 141{
131 int err; 142 int err;
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index b7a9a601c2d1..33268cf6be36 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -10,6 +10,7 @@ extern struct sys_timer sa1100_timer;
10extern void __init sa1100_map_io(void); 10extern void __init sa1100_map_io(void);
11extern void __init sa1100_init_irq(void); 11extern void __init sa1100_init_irq(void);
12extern void __init sa1100_init_gpio(void); 12extern void __init sa1100_init_gpio(void);
13extern void sa11x0_restart(char, const char *);
13 14
14#define SET_BANK(__nr,__start,__size) \ 15#define SET_BANK(__nr,__start,__size) \
15 mi->bank[__nr].start = (__start), \ 16 mi->bank[__nr].start = (__start), \
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
index b30733a2b82e..1e6b3c105ba6 100644
--- a/arch/arm/mach-sa1100/h3100.c
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -89,5 +89,6 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
89 .init_irq = sa1100_init_irq, 89 .init_irq = sa1100_init_irq,
90 .timer = &sa1100_timer, 90 .timer = &sa1100_timer,
91 .init_machine = h3100_mach_init, 91 .init_machine = h3100_mach_init,
92 .restart = sa11x0_restart,
92MACHINE_END 93MACHINE_END
93 94
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 6fd324d92389..6b58e7460ecf 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -130,5 +130,6 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
130 .init_irq = sa1100_init_irq, 130 .init_irq = sa1100_init_irq,
131 .timer = &sa1100_timer, 131 .timer = &sa1100_timer,
132 .init_machine = h3600_mach_init, 132 .init_machine = h3600_mach_init,
133 .restart = sa11x0_restart,
133MACHINE_END 134MACHINE_END
134 135
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 30f4a551b8e5..c01bb36db940 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -200,4 +200,5 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board")
200 .init_irq = sa1100_init_irq, 200 .init_irq = sa1100_init_irq,
201 .timer = &sa1100_timer, 201 .timer = &sa1100_timer,
202 .init_machine = hackkit_init, 202 .init_machine = hackkit_init,
203 .restart = sa11x0_restart,
203MACHINE_END 204MACHINE_END
diff --git a/arch/arm/mach-sa1100/include/mach/system.h b/arch/arm/mach-sa1100/include/mach/system.h
index ba9da9f7f183..e17b208f76d4 100644
--- a/arch/arm/mach-sa1100/include/mach/system.h
+++ b/arch/arm/mach-sa1100/include/mach/system.h
@@ -3,20 +3,7 @@
3 * 3 *
4 * Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net> 4 * Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
5 */ 5 */
6#include <mach/hardware.h>
7
8static inline void arch_idle(void) 6static inline void arch_idle(void)
9{ 7{
10 cpu_do_idle(); 8 cpu_do_idle();
11} 9}
12
13static inline void arch_reset(char mode, const char *cmd)
14{
15 if (mode == 's') {
16 /* Jump into ROM at address 0 */
17 cpu_reset(0);
18 } else {
19 /* Use on-chip reset capability */
20 RSRR = RSRR_SWR;
21 }
22}
diff --git a/arch/arm/mach-sa1100/include/mach/vmalloc.h b/arch/arm/mach-sa1100/include/mach/vmalloc.h
deleted file mode 100644
index b3d002398480..000000000000
--- a/arch/arm/mach-sa1100/include/mach/vmalloc.h
+++ /dev/null
@@ -1,4 +0,0 @@
1/*
2 * arch/arm/mach-sa1100/include/mach/vmalloc.h
3 */
4#define VMALLOC_END (0xe8000000UL)
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 77198fe02bc5..ee121d6f0480 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -373,4 +373,5 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
373#ifdef CONFIG_SA1111 373#ifdef CONFIG_SA1111
374 .dma_zone_size = SZ_1M, 374 .dma_zone_size = SZ_1M,
375#endif 375#endif
376 .restart = sa11x0_restart,
376MACHINE_END 377MACHINE_END
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 5bc59d0947ba..af4e2761f3db 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -66,4 +66,5 @@ MACHINE_START(LART, "LART")
66 .init_irq = sa1100_init_irq, 66 .init_irq = sa1100_init_irq,
67 .init_machine = lart_init, 67 .init_machine = lart_init,
68 .timer = &sa1100_timer, 68 .timer = &sa1100_timer,
69 .restart = sa11x0_restart,
69MACHINE_END 70MACHINE_END
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c
index 032f3881d145..85f6ee672225 100644
--- a/arch/arm/mach-sa1100/nanoengine.c
+++ b/arch/arm/mach-sa1100/nanoengine.c
@@ -19,6 +19,7 @@
19 19
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/setup.h> 21#include <asm/setup.h>
22#include <asm/page.h>
22 23
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <asm/mach/flash.h> 25#include <asm/mach/flash.h>
@@ -116,4 +117,5 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine")
116 .init_irq = sa1100_init_irq, 117 .init_irq = sa1100_init_irq,
117 .timer = &sa1100_timer, 118 .timer = &sa1100_timer,
118 .init_machine = nanoengine_init, 119 .init_machine = nanoengine_init,
120 .restart = sa11x0_restart,
119MACHINE_END 121MACHINE_END
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index 65161f2bea29..9307df053533 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -150,4 +150,5 @@ MACHINE_START(PLEB, "PLEB")
150 .init_irq = sa1100_init_irq, 150 .init_irq = sa1100_init_irq,
151 .timer = &sa1100_timer, 151 .timer = &sa1100_timer,
152 .init_machine = pleb_init, 152 .init_machine = pleb_init,
153 .restart = sa11x0_restart,
153MACHINE_END 154MACHINE_END
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 1cccbf5b9e9a..318b2b766a0b 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -87,4 +87,5 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
87 .init_irq = sa1100_init_irq, 87 .init_irq = sa1100_init_irq,
88 .timer = &sa1100_timer, 88 .timer = &sa1100_timer,
89 .init_machine = shannon_init, 89 .init_machine = shannon_init,
90 .restart = sa11x0_restart,
90MACHINE_END 91MACHINE_END
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 4790f3f3d008..e17c04d6e324 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -396,4 +396,5 @@ MACHINE_START(SIMPAD, "Simpad")
396 .map_io = simpad_map_io, 396 .map_io = simpad_map_io,
397 .init_irq = sa1100_init_irq, 397 .init_irq = sa1100_init_irq,
398 .timer = &sa1100_timer, 398 .timer = &sa1100_timer,
399 .restart = sa11x0_restart,
399MACHINE_END 400MACHINE_END
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index fa6602491d54..69e33535dee6 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -12,7 +12,6 @@
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/sched.h> /* just for sched_clock() - funny that */
16#include <linux/timex.h> 15#include <linux/timex.h>
17#include <linux/clockchips.h> 16#include <linux/clockchips.h>
18 17
@@ -20,29 +19,9 @@
20#include <asm/sched_clock.h> 19#include <asm/sched_clock.h>
21#include <mach/hardware.h> 20#include <mach/hardware.h>
22 21
23/* 22static u32 notrace sa1100_read_sched_clock(void)
24 * This is the SA11x0 sched_clock implementation.
25 */
26static DEFINE_CLOCK_DATA(cd);
27
28/*
29 * Constants generated by clocks_calc_mult_shift(m, s, 3.6864MHz,
30 * NSEC_PER_SEC, 60).
31 * This gives a resolution of about 271ns and a wrap period of about 19min.
32 */
33#define SC_MULT 2275555556u
34#define SC_SHIFT 23
35
36unsigned long long notrace sched_clock(void)
37{
38 u32 cyc = OSCR;
39 return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
40}
41
42static void notrace sa1100_update_sched_clock(void)
43{ 23{
44 u32 cyc = OSCR; 24 return OSCR;
45 update_sched_clock(&cd, cyc, (u32)~0);
46} 25}
47 26
48#define MIN_OSCR_DELTA 2 27#define MIN_OSCR_DELTA 2
@@ -109,8 +88,7 @@ static void __init sa1100_timer_init(void)
109 OIER = 0; 88 OIER = 0;
110 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3; 89 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
111 90
112 init_fixed_sched_clock(&cd, sa1100_update_sched_clock, 32, 91 setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
113 3686400, SC_MULT, SC_SHIFT);
114 92
115 clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4); 93 clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);
116 ckevt_sa1100_osmr0.max_delta_ns = 94 ckevt_sa1100_osmr0.max_delta_ns =
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index feda3ca7fc95..a851c254ad6c 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -26,10 +26,9 @@
26#define ROMCARD_SIZE 0x08000000 26#define ROMCARD_SIZE 0x08000000
27#define ROMCARD_START 0x10000000 27#define ROMCARD_START 0x10000000
28 28
29void arch_reset(char mode, const char *cmd) 29static void shark_restart(char mode, const char *cmd)
30{ 30{
31 short temp; 31 short temp;
32 local_irq_disable();
33 /* Reset the Machine via pc[3] of the sequoia chipset */ 32 /* Reset the Machine via pc[3] of the sequoia chipset */
34 outw(0x09,0x24); 33 outw(0x09,0x24);
35 temp=inw(0x26); 34 temp=inw(0x26);
@@ -157,4 +156,5 @@ MACHINE_START(SHARK, "Shark")
157 .init_irq = shark_init_irq, 156 .init_irq = shark_init_irq,
158 .timer = &shark_timer, 157 .timer = &shark_timer,
159 .dma_zone_size = SZ_4M, 158 .dma_zone_size = SZ_4M,
159 .restart = shark_restart,
160MACHINE_END 160MACHINE_END
diff --git a/arch/arm/mach-shark/include/mach/system.h b/arch/arm/mach-shark/include/mach/system.h
index 21c373b30bbc..1b2f2c5050a8 100644
--- a/arch/arm/mach-shark/include/mach/system.h
+++ b/arch/arm/mach-shark/include/mach/system.h
@@ -6,9 +6,6 @@
6#ifndef __ASM_ARCH_SYSTEM_H 6#ifndef __ASM_ARCH_SYSTEM_H
7#define __ASM_ARCH_SYSTEM_H 7#define __ASM_ARCH_SYSTEM_H
8 8
9/* Found in arch/mach-shark/core.c */
10extern void arch_reset(char mode, const char *cmd);
11
12static inline void arch_idle(void) 9static inline void arch_idle(void)
13{ 10{
14} 11}
diff --git a/arch/arm/mach-shark/include/mach/vmalloc.h b/arch/arm/mach-shark/include/mach/vmalloc.h
deleted file mode 100644
index b10df988526d..000000000000
--- a/arch/arm/mach-shark/include/mach/vmalloc.h
+++ /dev/null
@@ -1,4 +0,0 @@
1/*
2 * arch/arm/mach-shark/include/mach/vmalloc.h
3 */
4#define VMALLOC_END 0xd0000000UL
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 5ee604dcaf57..83e35f254bff 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -30,7 +30,6 @@ pfc-$(CONFIG_ARCH_R8A7740) += pfc-r8a7740.o
30obj-$(CONFIG_ARCH_SH7367) += entry-intc.o 30obj-$(CONFIG_ARCH_SH7367) += entry-intc.o
31obj-$(CONFIG_ARCH_SH7377) += entry-intc.o 31obj-$(CONFIG_ARCH_SH7377) += entry-intc.o
32obj-$(CONFIG_ARCH_SH7372) += entry-intc.o 32obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
33obj-$(CONFIG_ARCH_SH73A0) += entry-gic.o
34obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o 33obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o
35 34
36# PM objects 35# PM objects
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 7119b87cbfa0..a4e6ca04e319 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -466,8 +466,6 @@ static struct map_desc ag5evm_io_desc[] __initdata = {
466static void __init ag5evm_map_io(void) 466static void __init ag5evm_map_io(void)
467{ 467{
468 iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc)); 468 iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
469 /* DMA memory at 0xf6000000 - 0xffdfffff */
470 init_consistent_dma_size(158 << 20);
471 469
472 /* setup early devices and console here as well */ 470 /* setup early devices and console here as well */
473 sh73a0_add_early_devices(); 471 sh73a0_add_early_devices();
@@ -609,7 +607,7 @@ MACHINE_START(AG5EVM, "ag5evm")
609 .map_io = ag5evm_map_io, 607 .map_io = ag5evm_map_io,
610 .nr_irqs = NR_IRQS_LEGACY, 608 .nr_irqs = NR_IRQS_LEGACY,
611 .init_irq = sh73a0_init_irq, 609 .init_irq = sh73a0_init_irq,
612 .handle_irq = shmobile_handle_irq_gic, 610 .handle_irq = gic_handle_irq,
613 .init_machine = ag5evm_init, 611 .init_machine = ag5evm_init,
614 .timer = &ag5evm_timer, 612 .timer = &ag5evm_timer,
615MACHINE_END 613MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 4c865ece9ac4..6a6f9f7568c2 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1172,8 +1172,6 @@ static struct map_desc ap4evb_io_desc[] __initdata = {
1172static void __init ap4evb_map_io(void) 1172static void __init ap4evb_map_io(void)
1173{ 1173{
1174 iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc)); 1174 iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
1175 /* DMA memory at 0xf6000000 - 0xffdfffff */
1176 init_consistent_dma_size(158 << 20);
1177 1175
1178 /* setup early devices and console here as well */ 1176 /* setup early devices and console here as well */
1179 sh7372_add_early_devices(); 1177 sh7372_add_early_devices();
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index 8b620bf06221..72d557281b1f 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -261,8 +261,6 @@ static struct map_desc g3evm_io_desc[] __initdata = {
261static void __init g3evm_map_io(void) 261static void __init g3evm_map_io(void)
262{ 262{
263 iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc)); 263 iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
264 /* DMA memory at 0xf6000000 - 0xffdfffff */
265 init_consistent_dma_size(158 << 20);
266 264
267 /* setup early devices and console here as well */ 265 /* setup early devices and console here as well */
268 sh7367_add_early_devices(); 266 sh7367_add_early_devices();
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
index 7719ddc5f591..2220b885cff5 100644
--- a/arch/arm/mach-shmobile/board-g4evm.c
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -275,8 +275,6 @@ static struct map_desc g4evm_io_desc[] __initdata = {
275static void __init g4evm_map_io(void) 275static void __init g4evm_map_io(void)
276{ 276{
277 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc)); 277 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
278 /* DMA memory at 0xf6000000 - 0xffdfffff */
279 init_consistent_dma_size(158 << 20);
280 278
281 /* setup early devices and console here as well */ 279 /* setup early devices and console here as well */
282 sh7377_add_early_devices(); 280 sh7377_add_early_devices();
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index f44150b5ae46..857ceeec1bb0 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -551,7 +551,7 @@ MACHINE_START(KOTA2, "kota2")
551 .map_io = kota2_map_io, 551 .map_io = kota2_map_io,
552 .nr_irqs = NR_IRQS_LEGACY, 552 .nr_irqs = NR_IRQS_LEGACY,
553 .init_irq = sh73a0_init_irq, 553 .init_irq = sh73a0_init_irq,
554 .handle_irq = shmobile_handle_irq_gic, 554 .handle_irq = gic_handle_irq,
555 .init_machine = kota2_init, 555 .init_machine = kota2_init,
556 .timer = &kota2_timer, 556 .timer = &kota2_timer,
557MACHINE_END 557MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 9c5e598e0e3d..ed5256687397 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1390,8 +1390,6 @@ static struct map_desc mackerel_io_desc[] __initdata = {
1390static void __init mackerel_map_io(void) 1390static void __init mackerel_map_io(void)
1391{ 1391{
1392 iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc)); 1392 iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));
1393 /* DMA memory at 0xf6000000 - 0xffdfffff */
1394 init_consistent_dma_size(158 << 20);
1395 1393
1396 /* setup early devices and console here as well */ 1394 /* setup early devices and console here as well */
1397 sh7372_add_early_devices(); 1395 sh7372_add_early_devices();
diff --git a/arch/arm/mach-shmobile/entry-gic.S b/arch/arm/mach-shmobile/entry-gic.S
deleted file mode 100644
index e20239b08c83..000000000000
--- a/arch/arm/mach-shmobile/entry-gic.S
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * ARM Interrupt demux handler using GIC
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2011 Paul Mundt
6 * Copyright (C) 2010 - 2011 Renesas Solutions Corp.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <asm/assembler.h>
14#include <asm/entry-macro-multi.S>
15#include <asm/hardware/gic.h>
16#include <asm/hardware/entry-macro-gic.S>
17
18 arch_irq_handler shmobile_handle_irq_gic
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 5055a00a83d4..3a9250bb6d05 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -7,7 +7,6 @@ extern void shmobile_secondary_vector(void);
7struct clk; 7struct clk;
8extern int clk_init(void); 8extern int clk_init(void);
9extern void shmobile_handle_irq_intc(struct pt_regs *); 9extern void shmobile_handle_irq_intc(struct pt_regs *);
10extern void shmobile_handle_irq_gic(struct pt_regs *);
11extern struct platform_suspend_ops shmobile_suspend_ops; 10extern struct platform_suspend_ops shmobile_suspend_ops;
12struct cpuidle_driver; 11struct cpuidle_driver;
13extern void (*shmobile_cpuidle_modes[])(void); 12extern void (*shmobile_cpuidle_modes[])(void);
@@ -35,8 +34,8 @@ extern void sh7372_add_standard_devices(void);
35extern void sh7372_clock_init(void); 34extern void sh7372_clock_init(void);
36extern void sh7372_pinmux_init(void); 35extern void sh7372_pinmux_init(void);
37extern void sh7372_pm_init(void); 36extern void sh7372_pm_init(void);
38extern void sh7372_resume_core_standby_a3sm(void); 37extern void sh7372_resume_core_standby_sysc(void);
39extern int sh7372_do_idle_a3sm(unsigned long unused); 38extern int sh7372_do_idle_sysc(unsigned long sleep_mode);
40extern struct clk sh7372_extal1_clk; 39extern struct clk sh7372_extal1_clk;
41extern struct clk sh7372_extal2_clk; 40extern struct clk sh7372_extal2_clk;
42 41
diff --git a/arch/arm/mach-shmobile/include/mach/entry-macro.S b/arch/arm/mach-shmobile/include/mach/entry-macro.S
index 8d4a416d4285..2a57b2964ee9 100644
--- a/arch/arm/mach-shmobile/include/mach/entry-macro.S
+++ b/arch/arm/mach-shmobile/include/mach/entry-macro.S
@@ -18,14 +18,5 @@
18 .macro disable_fiq 18 .macro disable_fiq
19 .endm 19 .endm
20 20
21 .macro get_irqnr_preamble, base, tmp
22 .endm
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 .endm
26
27 .macro test_for_ipi, irqnr, irqstat, base, tmp
28 .endm
29
30 .macro arch_ret_to_user, tmp1, tmp2 21 .macro arch_ret_to_user, tmp1, tmp2
31 .endm 22 .endm
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
index 7bf0890e16ba..de795b42232a 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -12,8 +12,6 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15
16#define ARCH_NR_GPIOS 1024
17#include <linux/sh_pfc.h> 15#include <linux/sh_pfc.h>
18 16
19#ifdef CONFIG_GPIOLIB 17#ifdef CONFIG_GPIOLIB
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index 84532f9629b2..8254ab86f6cd 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -480,11 +480,10 @@ struct platform_device;
480struct sh7372_pm_domain { 480struct sh7372_pm_domain {
481 struct generic_pm_domain genpd; 481 struct generic_pm_domain genpd;
482 struct dev_power_governor *gov; 482 struct dev_power_governor *gov;
483 void (*suspend)(void); 483 int (*suspend)(void);
484 void (*resume)(void); 484 void (*resume)(void);
485 unsigned int bit_shift; 485 unsigned int bit_shift;
486 bool no_debug; 486 bool no_debug;
487 bool stay_on;
488}; 487};
489 488
490static inline struct sh7372_pm_domain *to_sh7372_pd(struct generic_pm_domain *d) 489static inline struct sh7372_pm_domain *to_sh7372_pd(struct generic_pm_domain *d)
@@ -499,6 +498,7 @@ extern struct sh7372_pm_domain sh7372_d4;
499extern struct sh7372_pm_domain sh7372_a4r; 498extern struct sh7372_pm_domain sh7372_a4r;
500extern struct sh7372_pm_domain sh7372_a3rv; 499extern struct sh7372_pm_domain sh7372_a3rv;
501extern struct sh7372_pm_domain sh7372_a3ri; 500extern struct sh7372_pm_domain sh7372_a3ri;
501extern struct sh7372_pm_domain sh7372_a4s;
502extern struct sh7372_pm_domain sh7372_a3sp; 502extern struct sh7372_pm_domain sh7372_a3sp;
503extern struct sh7372_pm_domain sh7372_a3sg; 503extern struct sh7372_pm_domain sh7372_a3sg;
504 504
@@ -515,5 +515,7 @@ extern void sh7372_pm_add_subdomain(struct sh7372_pm_domain *sh7372_pd,
515 515
516extern void sh7372_intcs_suspend(void); 516extern void sh7372_intcs_suspend(void);
517extern void sh7372_intcs_resume(void); 517extern void sh7372_intcs_resume(void);
518extern void sh7372_intca_suspend(void);
519extern void sh7372_intca_resume(void);
518 520
519#endif /* __ASM_SH7372_H__ */ 521#endif /* __ASM_SH7372_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/system.h b/arch/arm/mach-shmobile/include/mach/system.h
index 76a687eeaa22..956ac18ddbf9 100644
--- a/arch/arm/mach-shmobile/include/mach/system.h
+++ b/arch/arm/mach-shmobile/include/mach/system.h
@@ -8,7 +8,7 @@ static inline void arch_idle(void)
8 8
9static inline void arch_reset(char mode, const char *cmd) 9static inline void arch_reset(char mode, const char *cmd)
10{ 10{
11 cpu_reset(0); 11 soft_restart(0);
12} 12}
13 13
14#endif 14#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
index 2b8fd8b942fe..000000000000
--- a/arch/arm/mach-shmobile/include/mach/vmalloc.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __ASM_MACH_VMALLOC_H
2#define __ASM_MACH_VMALLOC_H
3
4/* Vmalloc at ... - 0xe5ffffff */
5#define VMALLOC_END 0xe6000000UL
6
7#endif /* __ASM_MACH_VMALLOC_H */
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index 2d8856df80e2..89afcaba99a1 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -535,6 +535,7 @@ static struct resource intcs_resources[] __initdata = {
535static struct intc_desc intcs_desc __initdata = { 535static struct intc_desc intcs_desc __initdata = {
536 .name = "sh7372-intcs", 536 .name = "sh7372-intcs",
537 .force_enable = ENABLED_INTCS, 537 .force_enable = ENABLED_INTCS,
538 .skip_syscore_suspend = true,
538 .resource = intcs_resources, 539 .resource = intcs_resources,
539 .num_resources = ARRAY_SIZE(intcs_resources), 540 .num_resources = ARRAY_SIZE(intcs_resources),
540 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers, 541 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
@@ -611,3 +612,52 @@ void sh7372_intcs_resume(void)
611 for (k = 0x80; k <= 0x9c; k += 4) 612 for (k = 0x80; k <= 0x9c; k += 4)
612 __raw_writeb(ffd5[k], intcs_ffd5 + k); 613 __raw_writeb(ffd5[k], intcs_ffd5 + k);
613} 614}
615
616static unsigned short e694[0x200];
617static unsigned short e695[0x200];
618
619void sh7372_intca_suspend(void)
620{
621 int k;
622
623 for (k = 0x00; k <= 0x38; k += 4)
624 e694[k] = __raw_readw(0xe6940000 + k);
625
626 for (k = 0x80; k <= 0xb4; k += 4)
627 e694[k] = __raw_readb(0xe6940000 + k);
628
629 for (k = 0x180; k <= 0x1b4; k += 4)
630 e694[k] = __raw_readb(0xe6940000 + k);
631
632 for (k = 0x00; k <= 0x50; k += 4)
633 e695[k] = __raw_readw(0xe6950000 + k);
634
635 for (k = 0x80; k <= 0xa8; k += 4)
636 e695[k] = __raw_readb(0xe6950000 + k);
637
638 for (k = 0x180; k <= 0x1a8; k += 4)
639 e695[k] = __raw_readb(0xe6950000 + k);
640}
641
642void sh7372_intca_resume(void)
643{
644 int k;
645
646 for (k = 0x00; k <= 0x38; k += 4)
647 __raw_writew(e694[k], 0xe6940000 + k);
648
649 for (k = 0x80; k <= 0xb4; k += 4)
650 __raw_writeb(e694[k], 0xe6940000 + k);
651
652 for (k = 0x180; k <= 0x1b4; k += 4)
653 __raw_writeb(e694[k], 0xe6940000 + k);
654
655 for (k = 0x00; k <= 0x50; k += 4)
656 __raw_writew(e695[k], 0xe6950000 + k);
657
658 for (k = 0x80; k <= 0xa8; k += 4)
659 __raw_writeb(e695[k], 0xe6950000 + k);
660
661 for (k = 0x180; k <= 0x1a8; k += 4)
662 __raw_writeb(e695[k], 0xe6950000 + k);
663}
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 0a5b22942fd3..77b8fc12fc2f 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -20,6 +20,7 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/bitrev.h> 22#include <linux/bitrev.h>
23#include <linux/console.h>
23#include <asm/system.h> 24#include <asm/system.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
@@ -81,11 +82,12 @@ static int pd_power_down(struct generic_pm_domain *genpd)
81 struct sh7372_pm_domain *sh7372_pd = to_sh7372_pd(genpd); 82 struct sh7372_pm_domain *sh7372_pd = to_sh7372_pd(genpd);
82 unsigned int mask = 1 << sh7372_pd->bit_shift; 83 unsigned int mask = 1 << sh7372_pd->bit_shift;
83 84
84 if (sh7372_pd->suspend) 85 if (sh7372_pd->suspend) {
85 sh7372_pd->suspend(); 86 int ret = sh7372_pd->suspend();
86 87
87 if (sh7372_pd->stay_on) 88 if (ret)
88 return 0; 89 return ret;
90 }
89 91
90 if (__raw_readl(PSTR) & mask) { 92 if (__raw_readl(PSTR) & mask) {
91 unsigned int retry_count; 93 unsigned int retry_count;
@@ -100,22 +102,18 @@ static int pd_power_down(struct generic_pm_domain *genpd)
100 } 102 }
101 103
102 if (!sh7372_pd->no_debug) 104 if (!sh7372_pd->no_debug)
103 pr_debug("sh7372 power domain down 0x%08x -> PSTR = 0x%08x\n", 105 pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n",
104 mask, __raw_readl(PSTR)); 106 genpd->name, mask, __raw_readl(PSTR));
105 107
106 return 0; 108 return 0;
107} 109}
108 110
109static int pd_power_up(struct generic_pm_domain *genpd) 111static int __pd_power_up(struct sh7372_pm_domain *sh7372_pd, bool do_resume)
110{ 112{
111 struct sh7372_pm_domain *sh7372_pd = to_sh7372_pd(genpd);
112 unsigned int mask = 1 << sh7372_pd->bit_shift; 113 unsigned int mask = 1 << sh7372_pd->bit_shift;
113 unsigned int retry_count; 114 unsigned int retry_count;
114 int ret = 0; 115 int ret = 0;
115 116
116 if (sh7372_pd->stay_on)
117 goto out;
118
119 if (__raw_readl(PSTR) & mask) 117 if (__raw_readl(PSTR) & mask)
120 goto out; 118 goto out;
121 119
@@ -123,58 +121,88 @@ static int pd_power_up(struct generic_pm_domain *genpd)
123 121
124 for (retry_count = 2 * PSTR_RETRIES; retry_count; retry_count--) { 122 for (retry_count = 2 * PSTR_RETRIES; retry_count; retry_count--) {
125 if (!(__raw_readl(SWUCR) & mask)) 123 if (!(__raw_readl(SWUCR) & mask))
126 goto out; 124 break;
127 if (retry_count > PSTR_RETRIES) 125 if (retry_count > PSTR_RETRIES)
128 udelay(PSTR_DELAY_US); 126 udelay(PSTR_DELAY_US);
129 else 127 else
130 cpu_relax(); 128 cpu_relax();
131 } 129 }
132 if (__raw_readl(SWUCR) & mask) 130 if (!retry_count)
133 ret = -EIO; 131 ret = -EIO;
134 132
135 if (!sh7372_pd->no_debug) 133 if (!sh7372_pd->no_debug)
136 pr_debug("sh7372 power domain up 0x%08x -> PSTR = 0x%08x\n", 134 pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n",
137 mask, __raw_readl(PSTR)); 135 sh7372_pd->genpd.name, mask, __raw_readl(PSTR));
138 136
139 out: 137 out:
140 if (ret == 0 && sh7372_pd->resume) 138 if (ret == 0 && sh7372_pd->resume && do_resume)
141 sh7372_pd->resume(); 139 sh7372_pd->resume();
142 140
143 return ret; 141 return ret;
144} 142}
145 143
146static void sh7372_a4r_suspend(void) 144static int pd_power_up(struct generic_pm_domain *genpd)
145{
146 return __pd_power_up(to_sh7372_pd(genpd), true);
147}
148
149static int sh7372_a4r_suspend(void)
147{ 150{
148 sh7372_intcs_suspend(); 151 sh7372_intcs_suspend();
149 __raw_writel(0x300fffff, WUPRMSK); /* avoid wakeup */ 152 __raw_writel(0x300fffff, WUPRMSK); /* avoid wakeup */
153 return 0;
150} 154}
151 155
152static bool pd_active_wakeup(struct device *dev) 156static bool pd_active_wakeup(struct device *dev)
153{ 157{
154 return true; 158 bool (*active_wakeup)(struct device *dev);
159
160 active_wakeup = dev_gpd_data(dev)->ops.active_wakeup;
161 return active_wakeup ? active_wakeup(dev) : true;
155} 162}
156 163
157static bool sh7372_power_down_forbidden(struct dev_pm_domain *domain) 164static int sh7372_stop_dev(struct device *dev)
158{ 165{
159 return false; 166 int (*stop)(struct device *dev);
167
168 stop = dev_gpd_data(dev)->ops.stop;
169 if (stop) {
170 int ret = stop(dev);
171 if (ret)
172 return ret;
173 }
174 return pm_clk_suspend(dev);
160} 175}
161 176
162struct dev_power_governor sh7372_always_on_gov = { 177static int sh7372_start_dev(struct device *dev)
163 .power_down_ok = sh7372_power_down_forbidden, 178{
164}; 179 int (*start)(struct device *dev);
180 int ret;
181
182 ret = pm_clk_resume(dev);
183 if (ret)
184 return ret;
185
186 start = dev_gpd_data(dev)->ops.start;
187 if (start)
188 ret = start(dev);
189
190 return ret;
191}
165 192
166void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd) 193void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
167{ 194{
168 struct generic_pm_domain *genpd = &sh7372_pd->genpd; 195 struct generic_pm_domain *genpd = &sh7372_pd->genpd;
196 struct dev_power_governor *gov = sh7372_pd->gov;
169 197
170 pm_genpd_init(genpd, sh7372_pd->gov, false); 198 pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
171 genpd->stop_device = pm_clk_suspend; 199 genpd->dev_ops.stop = sh7372_stop_dev;
172 genpd->start_device = pm_clk_resume; 200 genpd->dev_ops.start = sh7372_start_dev;
201 genpd->dev_ops.active_wakeup = pd_active_wakeup;
173 genpd->dev_irq_safe = true; 202 genpd->dev_irq_safe = true;
174 genpd->active_wakeup = pd_active_wakeup;
175 genpd->power_off = pd_power_down; 203 genpd->power_off = pd_power_down;
176 genpd->power_on = pd_power_up; 204 genpd->power_on = pd_power_up;
177 genpd->power_on(&sh7372_pd->genpd); 205 __pd_power_up(sh7372_pd, false);
178} 206}
179 207
180void sh7372_add_device_to_domain(struct sh7372_pm_domain *sh7372_pd, 208void sh7372_add_device_to_domain(struct sh7372_pm_domain *sh7372_pd,
@@ -194,44 +222,81 @@ void sh7372_pm_add_subdomain(struct sh7372_pm_domain *sh7372_pd,
194} 222}
195 223
196struct sh7372_pm_domain sh7372_a4lc = { 224struct sh7372_pm_domain sh7372_a4lc = {
225 .genpd.name = "A4LC",
197 .bit_shift = 1, 226 .bit_shift = 1,
198}; 227};
199 228
200struct sh7372_pm_domain sh7372_a4mp = { 229struct sh7372_pm_domain sh7372_a4mp = {
230 .genpd.name = "A4MP",
201 .bit_shift = 2, 231 .bit_shift = 2,
202}; 232};
203 233
204struct sh7372_pm_domain sh7372_d4 = { 234struct sh7372_pm_domain sh7372_d4 = {
235 .genpd.name = "D4",
205 .bit_shift = 3, 236 .bit_shift = 3,
206}; 237};
207 238
208struct sh7372_pm_domain sh7372_a4r = { 239struct sh7372_pm_domain sh7372_a4r = {
240 .genpd.name = "A4R",
209 .bit_shift = 5, 241 .bit_shift = 5,
210 .gov = &sh7372_always_on_gov,
211 .suspend = sh7372_a4r_suspend, 242 .suspend = sh7372_a4r_suspend,
212 .resume = sh7372_intcs_resume, 243 .resume = sh7372_intcs_resume,
213 .stay_on = true,
214}; 244};
215 245
216struct sh7372_pm_domain sh7372_a3rv = { 246struct sh7372_pm_domain sh7372_a3rv = {
247 .genpd.name = "A3RV",
217 .bit_shift = 6, 248 .bit_shift = 6,
218}; 249};
219 250
220struct sh7372_pm_domain sh7372_a3ri = { 251struct sh7372_pm_domain sh7372_a3ri = {
252 .genpd.name = "A3RI",
221 .bit_shift = 8, 253 .bit_shift = 8,
222}; 254};
223 255
256static int sh7372_a4s_suspend(void)
257{
258 /*
259 * The A4S domain contains the CPU core and therefore it should
260 * only be turned off if the CPU is in use.
261 */
262 return -EBUSY;
263}
264
265struct sh7372_pm_domain sh7372_a4s = {
266 .genpd.name = "A4S",
267 .bit_shift = 10,
268 .gov = &pm_domain_always_on_gov,
269 .no_debug = true,
270 .suspend = sh7372_a4s_suspend,
271};
272
273static int sh7372_a3sp_suspend(void)
274{
275 /*
276 * Serial consoles make use of SCIF hardware located in A3SP,
277 * keep such power domain on if "no_console_suspend" is set.
278 */
279 return console_suspend_enabled ? -EBUSY : 0;
280}
281
224struct sh7372_pm_domain sh7372_a3sp = { 282struct sh7372_pm_domain sh7372_a3sp = {
283 .genpd.name = "A3SP",
225 .bit_shift = 11, 284 .bit_shift = 11,
226 .gov = &sh7372_always_on_gov, 285 .gov = &pm_domain_always_on_gov,
227 .no_debug = true, 286 .no_debug = true,
287 .suspend = sh7372_a3sp_suspend,
228}; 288};
229 289
230struct sh7372_pm_domain sh7372_a3sg = { 290struct sh7372_pm_domain sh7372_a3sg = {
291 .genpd.name = "A3SG",
231 .bit_shift = 13, 292 .bit_shift = 13,
232}; 293};
233 294
234#endif /* CONFIG_PM */ 295#else /* !CONFIG_PM */
296
297static inline void sh7372_a3sp_init(void) {}
298
299#endif /* !CONFIG_PM */
235 300
236#if defined(CONFIG_SUSPEND) || defined(CONFIG_CPU_IDLE) 301#if defined(CONFIG_SUSPEND) || defined(CONFIG_CPU_IDLE)
237static int sh7372_do_idle_core_standby(unsigned long unused) 302static int sh7372_do_idle_core_standby(unsigned long unused)
@@ -240,11 +305,16 @@ static int sh7372_do_idle_core_standby(unsigned long unused)
240 return 0; 305 return 0;
241} 306}
242 307
243static void sh7372_enter_core_standby(void) 308static void sh7372_set_reset_vector(unsigned long address)
244{ 309{
245 /* set reset vector, translate 4k */ 310 /* set reset vector, translate 4k */
246 __raw_writel(__pa(sh7372_resume_core_standby_a3sm), SBAR); 311 __raw_writel(address, SBAR);
247 __raw_writel(0, APARMBAREA); 312 __raw_writel(0, APARMBAREA);
313}
314
315static void sh7372_enter_core_standby(void)
316{
317 sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc));
248 318
249 /* enter sleep mode with SYSTBCR to 0x10 */ 319 /* enter sleep mode with SYSTBCR to 0x10 */
250 __raw_writel(0x10, SYSTBCR); 320 __raw_writel(0x10, SYSTBCR);
@@ -257,27 +327,22 @@ static void sh7372_enter_core_standby(void)
257#endif 327#endif
258 328
259#ifdef CONFIG_SUSPEND 329#ifdef CONFIG_SUSPEND
260static void sh7372_enter_a3sm_common(int pllc0_on) 330static void sh7372_enter_sysc(int pllc0_on, unsigned long sleep_mode)
261{ 331{
262 /* set reset vector, translate 4k */
263 __raw_writel(__pa(sh7372_resume_core_standby_a3sm), SBAR);
264 __raw_writel(0, APARMBAREA);
265
266 if (pllc0_on) 332 if (pllc0_on)
267 __raw_writel(0, PLLC01STPCR); 333 __raw_writel(0, PLLC01STPCR);
268 else 334 else
269 __raw_writel(1 << 28, PLLC01STPCR); 335 __raw_writel(1 << 28, PLLC01STPCR);
270 336
271 __raw_writel(0, PDNSEL); /* power-down A3SM only, not A4S */
272 __raw_readl(WUPSFAC); /* read wakeup int. factor before sleep */ 337 __raw_readl(WUPSFAC); /* read wakeup int. factor before sleep */
273 cpu_suspend(0, sh7372_do_idle_a3sm); 338 cpu_suspend(sleep_mode, sh7372_do_idle_sysc);
274 __raw_readl(WUPSFAC); /* read wakeup int. factor after wakeup */ 339 __raw_readl(WUPSFAC); /* read wakeup int. factor after wakeup */
275 340
276 /* disable reset vector translation */ 341 /* disable reset vector translation */
277 __raw_writel(0, SBAR); 342 __raw_writel(0, SBAR);
278} 343}
279 344
280static int sh7372_a3sm_valid(unsigned long *mskp, unsigned long *msk2p) 345static int sh7372_sysc_valid(unsigned long *mskp, unsigned long *msk2p)
281{ 346{
282 unsigned long mstpsr0, mstpsr1, mstpsr2, mstpsr3, mstpsr4; 347 unsigned long mstpsr0, mstpsr1, mstpsr2, mstpsr3, mstpsr4;
283 unsigned long msk, msk2; 348 unsigned long msk, msk2;
@@ -365,7 +430,7 @@ static void sh7372_icr_to_irqcr(unsigned long icr, u16 *irqcr1p, u16 *irqcr2p)
365 *irqcr2p = irqcr2; 430 *irqcr2p = irqcr2;
366} 431}
367 432
368static void sh7372_setup_a3sm(unsigned long msk, unsigned long msk2) 433static void sh7372_setup_sysc(unsigned long msk, unsigned long msk2)
369{ 434{
370 u16 irqcrx_low, irqcrx_high, irqcry_low, irqcry_high; 435 u16 irqcrx_low, irqcrx_high, irqcry_low, irqcry_high;
371 unsigned long tmp; 436 unsigned long tmp;
@@ -398,6 +463,22 @@ static void sh7372_setup_a3sm(unsigned long msk, unsigned long msk2)
398 __raw_writel((irqcrx_high << 16) | irqcrx_low, IRQCR3); 463 __raw_writel((irqcrx_high << 16) | irqcrx_low, IRQCR3);
399 __raw_writel((irqcry_high << 16) | irqcry_low, IRQCR4); 464 __raw_writel((irqcry_high << 16) | irqcry_low, IRQCR4);
400} 465}
466
467static void sh7372_enter_a3sm_common(int pllc0_on)
468{
469 sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc));
470 sh7372_enter_sysc(pllc0_on, 1 << 12);
471}
472
473static void sh7372_enter_a4s_common(int pllc0_on)
474{
475 sh7372_intca_suspend();
476 memcpy((void *)SMFRAM, sh7372_resume_core_standby_sysc, 0x100);
477 sh7372_set_reset_vector(SMFRAM);
478 sh7372_enter_sysc(pllc0_on, 1 << 10);
479 sh7372_intca_resume();
480}
481
401#endif 482#endif
402 483
403#ifdef CONFIG_CPU_IDLE 484#ifdef CONFIG_CPU_IDLE
@@ -431,14 +512,20 @@ static int sh7372_enter_suspend(suspend_state_t suspend_state)
431 unsigned long msk, msk2; 512 unsigned long msk, msk2;
432 513
433 /* check active clocks to determine potential wakeup sources */ 514 /* check active clocks to determine potential wakeup sources */
434 if (sh7372_a3sm_valid(&msk, &msk2)) { 515 if (sh7372_sysc_valid(&msk, &msk2)) {
435
436 /* convert INTC mask and sense to SYSC mask and sense */ 516 /* convert INTC mask and sense to SYSC mask and sense */
437 sh7372_setup_a3sm(msk, msk2); 517 sh7372_setup_sysc(msk, msk2);
438 518
439 /* enter A3SM sleep with PLLC0 off */ 519 if (!console_suspend_enabled &&
440 pr_debug("entering A3SM\n"); 520 sh7372_a4s.genpd.status == GPD_STATE_POWER_OFF) {
441 sh7372_enter_a3sm_common(0); 521 /* enter A4S sleep with PLLC0 off */
522 pr_debug("entering A4S\n");
523 sh7372_enter_a4s_common(0);
524 } else {
525 /* enter A3SM sleep with PLLC0 off */
526 pr_debug("entering A3SM\n");
527 sh7372_enter_a3sm_common(0);
528 }
442 } else { 529 } else {
443 /* default to Core Standby that supports all wakeup sources */ 530 /* default to Core Standby that supports all wakeup sources */
444 pr_debug("entering Core Standby\n"); 531 pr_debug("entering Core Standby\n");
@@ -447,9 +534,37 @@ static int sh7372_enter_suspend(suspend_state_t suspend_state)
447 return 0; 534 return 0;
448} 535}
449 536
537/**
538 * sh7372_pm_notifier_fn - SH7372 PM notifier routine.
539 * @notifier: Unused.
540 * @pm_event: Event being handled.
541 * @unused: Unused.
542 */
543static int sh7372_pm_notifier_fn(struct notifier_block *notifier,
544 unsigned long pm_event, void *unused)
545{
546 switch (pm_event) {
547 case PM_SUSPEND_PREPARE:
548 /*
549 * This is necessary, because the A4R domain has to be "on"
550 * when suspend_device_irqs() and resume_device_irqs() are
551 * executed during system suspend and resume, respectively, so
552 * that those functions don't crash while accessing the INTCS.
553 */
554 pm_genpd_poweron(&sh7372_a4r.genpd);
555 break;
556 case PM_POST_SUSPEND:
557 pm_genpd_poweroff_unused();
558 break;
559 }
560
561 return NOTIFY_DONE;
562}
563
450static void sh7372_suspend_init(void) 564static void sh7372_suspend_init(void)
451{ 565{
452 shmobile_suspend_ops.enter = sh7372_enter_suspend; 566 shmobile_suspend_ops.enter = sh7372_enter_suspend;
567 pm_notifier(sh7372_pm_notifier_fn, 0);
453} 568}
454#else 569#else
455static void sh7372_suspend_init(void) {} 570static void sh7372_suspend_init(void) {}
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 2380389e6ac5..c197f9d29d04 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -994,12 +994,16 @@ void __init sh7372_add_standard_devices(void)
994 sh7372_init_pm_domain(&sh7372_a4r); 994 sh7372_init_pm_domain(&sh7372_a4r);
995 sh7372_init_pm_domain(&sh7372_a3rv); 995 sh7372_init_pm_domain(&sh7372_a3rv);
996 sh7372_init_pm_domain(&sh7372_a3ri); 996 sh7372_init_pm_domain(&sh7372_a3ri);
997 sh7372_init_pm_domain(&sh7372_a3sg); 997 sh7372_init_pm_domain(&sh7372_a4s);
998 sh7372_init_pm_domain(&sh7372_a3sp); 998 sh7372_init_pm_domain(&sh7372_a3sp);
999 sh7372_init_pm_domain(&sh7372_a3sg);
999 1000
1000 sh7372_pm_add_subdomain(&sh7372_a4lc, &sh7372_a3rv); 1001 sh7372_pm_add_subdomain(&sh7372_a4lc, &sh7372_a3rv);
1001 sh7372_pm_add_subdomain(&sh7372_a4r, &sh7372_a4lc); 1002 sh7372_pm_add_subdomain(&sh7372_a4r, &sh7372_a4lc);
1002 1003
1004 sh7372_pm_add_subdomain(&sh7372_a4s, &sh7372_a3sg);
1005 sh7372_pm_add_subdomain(&sh7372_a4s, &sh7372_a3sp);
1006
1003 platform_add_devices(sh7372_early_devices, 1007 platform_add_devices(sh7372_early_devices,
1004 ARRAY_SIZE(sh7372_early_devices)); 1008 ARRAY_SIZE(sh7372_early_devices));
1005 1009
diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S
index f3ab3c5810ea..1d564674451d 100644
--- a/arch/arm/mach-shmobile/sleep-sh7372.S
+++ b/arch/arm/mach-shmobile/sleep-sh7372.S
@@ -37,13 +37,18 @@
37#if defined(CONFIG_SUSPEND) || defined(CONFIG_CPU_IDLE) 37#if defined(CONFIG_SUSPEND) || defined(CONFIG_CPU_IDLE)
38 .align 12 38 .align 12
39 .text 39 .text
40 .global sh7372_resume_core_standby_a3sm 40 .global sh7372_resume_core_standby_sysc
41sh7372_resume_core_standby_a3sm: 41sh7372_resume_core_standby_sysc:
42 ldr pc, 1f 42 ldr pc, 1f
431: .long cpu_resume - PAGE_OFFSET + PLAT_PHYS_OFFSET 431: .long cpu_resume - PAGE_OFFSET + PLAT_PHYS_OFFSET
44 44
45 .global sh7372_do_idle_a3sm 45#define SPDCR 0xe6180008
46sh7372_do_idle_a3sm: 46
47 /* A3SM & A4S power down */
48 .global sh7372_do_idle_sysc
49sh7372_do_idle_sysc:
50 mov r8, r0 /* sleep mode passed in r0 */
51
47 /* 52 /*
48 * Clear the SCTLR.C bit to prevent further data cache 53 * Clear the SCTLR.C bit to prevent further data cache
49 * allocation. Clearing SCTLR.C would make all the data accesses 54 * allocation. Clearing SCTLR.C would make all the data accesses
@@ -80,13 +85,9 @@ sh7372_do_idle_a3sm:
80 dsb 85 dsb
81 dmb 86 dmb
82 87
83#define SPDCR 0xe6180008 88 /* SYSC power down */
84#define A3SM (1 << 12)
85
86 /* A3SM power down */
87 ldr r0, =SPDCR 89 ldr r0, =SPDCR
88 ldr r1, =A3SM 90 str r8, [r0]
89 str r1, [r0]
901: 911:
91 b 1b 92 b 1b
92 93
diff --git a/arch/arm/mach-spear3xx/include/mach/entry-macro.S b/arch/arm/mach-spear3xx/include/mach/entry-macro.S
index 53da4224ba3d..de3bb41c8e9e 100644
--- a/arch/arm/mach-spear3xx/include/mach/entry-macro.S
+++ b/arch/arm/mach-spear3xx/include/mach/entry-macro.S
@@ -11,35 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <asm/hardware/vic.h>
15#include <mach/hardware.h>
16
17 .macro disable_fiq 14 .macro disable_fiq
18 .endm 15 .endm
19 16
20 .macro get_irqnr_preamble, base, tmp
21 .endm
22
23 .macro arch_ret_to_user, tmp1, tmp2 17 .macro arch_ret_to_user, tmp1, tmp2
24 .endm 18 .endm
25
26 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
27 ldr \base, =VA_SPEAR3XX_ML1_VIC_BASE
28 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status
29 teq \irqstat, #0
30 beq 1001f @ this will set/reset
31 @ zero register
32 /*
33 * Following code will find bit position of least significang
34 * bit set in irqstat, using following equation
35 * least significant bit set in n = (n & ~(n-1))
36 */
37 sub \tmp, \irqstat, #1 @ tmp = irqstat - 1
38 mvn \tmp, \tmp @ tmp = ~tmp
39 and \irqstat, \irqstat, \tmp @ irqstat &= tmp
40 /* Now, irqstat is = bit no. of 1st bit set in vic irq status */
41 clz \tmp, \irqstat @ tmp = leading zeros
42 rsb \irqnr, \tmp, #0x1F @ irqnr = 32 - tmp - 1
43
441001: /* EQ will be set if no irqs pending */
45 .endm
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
index b8f31c3935f7..14276e5a98d2 100644
--- a/arch/arm/mach-spear3xx/include/mach/generic.h
+++ b/arch/arm/mach-spear3xx/include/mach/generic.h
@@ -42,6 +42,8 @@ void __init spear3xx_map_io(void);
42void __init spear3xx_init_irq(void); 42void __init spear3xx_init_irq(void);
43void __init spear3xx_init(void); 43void __init spear3xx_init(void);
44 44
45void spear_restart(char, const char *);
46
45/* pad mux declarations */ 47/* pad mux declarations */
46#define PMX_FIRDA_MASK (1 << 14) 48#define PMX_FIRDA_MASK (1 << 14)
47#define PMX_I2C_MASK (1 << 13) 49#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
index df977b3c9a63..000000000000
--- a/arch/arm/mach-spear3xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/vmalloc.h
3 *
4 * Defining Vmalloc area for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_VMALLOC_H
15#define __MACH_VMALLOC_H
16
17#include <plat/vmalloc.h>
18
19#endif /* __MACH_VMALLOC_H */
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c
index a5ff98eed1db..3462ab9d6122 100644
--- a/arch/arm/mach-spear3xx/spear300_evb.c
+++ b/arch/arm/mach-spear3xx/spear300_evb.c
@@ -11,6 +11,7 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <asm/hardware/vic.h>
14#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16#include <mach/generic.h> 17#include <mach/generic.h>
@@ -67,6 +68,8 @@ MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
67 .atag_offset = 0x100, 68 .atag_offset = 0x100,
68 .map_io = spear3xx_map_io, 69 .map_io = spear3xx_map_io,
69 .init_irq = spear3xx_init_irq, 70 .init_irq = spear3xx_init_irq,
71 .handle_irq = vic_handle_irq,
70 .timer = &spear3xx_timer, 72 .timer = &spear3xx_timer,
71 .init_machine = spear300_evb_init, 73 .init_machine = spear300_evb_init,
74 .restart = spear_restart,
72MACHINE_END 75MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c
index 45d180d59362..f92c4993f65a 100644
--- a/arch/arm/mach-spear3xx/spear310_evb.c
+++ b/arch/arm/mach-spear3xx/spear310_evb.c
@@ -11,6 +11,7 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <asm/hardware/vic.h>
14#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16#include <mach/generic.h> 17#include <mach/generic.h>
@@ -73,6 +74,8 @@ MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
73 .atag_offset = 0x100, 74 .atag_offset = 0x100,
74 .map_io = spear3xx_map_io, 75 .map_io = spear3xx_map_io,
75 .init_irq = spear3xx_init_irq, 76 .init_irq = spear3xx_init_irq,
77 .handle_irq = vic_handle_irq,
76 .timer = &spear3xx_timer, 78 .timer = &spear3xx_timer,
77 .init_machine = spear310_evb_init, 79 .init_machine = spear310_evb_init,
80 .restart = spear_restart,
78MACHINE_END 81MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
index 22879848d73a..105334ab7021 100644
--- a/arch/arm/mach-spear3xx/spear320_evb.c
+++ b/arch/arm/mach-spear3xx/spear320_evb.c
@@ -11,6 +11,7 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <asm/hardware/vic.h>
14#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16#include <mach/generic.h> 17#include <mach/generic.h>
@@ -71,6 +72,8 @@ MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
71 .atag_offset = 0x100, 72 .atag_offset = 0x100,
72 .map_io = spear3xx_map_io, 73 .map_io = spear3xx_map_io,
73 .init_irq = spear3xx_init_irq, 74 .init_irq = spear3xx_init_irq,
75 .handle_irq = vic_handle_irq,
74 .timer = &spear3xx_timer, 76 .timer = &spear3xx_timer,
75 .init_machine = spear320_evb_init, 77 .init_machine = spear320_evb_init,
78 .restart = spear_restart,
76MACHINE_END 79MACHINE_END
diff --git a/arch/arm/mach-spear6xx/include/mach/entry-macro.S b/arch/arm/mach-spear6xx/include/mach/entry-macro.S
index 8a0b0ed7b203..d490a910d925 100644
--- a/arch/arm/mach-spear6xx/include/mach/entry-macro.S
+++ b/arch/arm/mach-spear6xx/include/mach/entry-macro.S
@@ -11,44 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <asm/hardware/vic.h>
15#include <mach/hardware.h>
16
17 .macro disable_fiq 14 .macro disable_fiq
18 .endm 15 .endm
19 16
20 .macro get_irqnr_preamble, base, tmp
21 .endm
22
23 .macro arch_ret_to_user, tmp1, tmp2 17 .macro arch_ret_to_user, tmp1, tmp2
24 .endm 18 .endm
25
26 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
27 ldr \base, =VA_SPEAR6XX_CPU_VIC_PRI_BASE
28 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status
29 mov \irqnr, #0
30 teq \irqstat, #0
31 bne 1001f
32 ldr \base, =VA_SPEAR6XX_CPU_VIC_SEC_BASE
33 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status
34 teq \irqstat, #0
35 beq 1002f @ this will set/reset
36 @ zero register
37 mov \irqnr, #32
381001:
39 /*
40 * Following code will find bit position of least significang
41 * bit set in irqstat, using following equation
42 * least significant bit set in n = (n & ~(n-1))
43 */
44 sub \tmp, \irqstat, #1 @ tmp = irqstat - 1
45 mvn \tmp, \tmp @ tmp = ~tmp
46 and \irqstat, \irqstat, \tmp @ irqstat &= tmp
47 /* Now, irqstat is = bit no. of 1st bit set in vic irq status */
48 clz \tmp, \irqstat @ tmp = leading zeros
49
50 rsb \tmp, \tmp, #0x1F @ tmp = 32 - tmp - 1
51 add \irqnr, \irqnr, \tmp
52
531002: /* EQ will be set if no irqs pending */
54 .endm
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h
index 183f0238c5e2..116b99301cf5 100644
--- a/arch/arm/mach-spear6xx/include/mach/generic.h
+++ b/arch/arm/mach-spear6xx/include/mach/generic.h
@@ -41,6 +41,8 @@ void __init spear6xx_init(void);
41void __init spear600_init(void); 41void __init spear600_init(void);
42void __init spear6xx_clk_init(void); 42void __init spear6xx_clk_init(void);
43 43
44void spear_restart(char, const char *);
45
44/* Add spear600 machine device structure declarations here */ 46/* Add spear600 machine device structure declarations here */
45 47
46#endif /* __MACH_GENERIC_H */ 48#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
index 4a0b56cb2a91..000000000000
--- a/arch/arm/mach-spear6xx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/vmalloc.h
3 *
4 * Defining Vmalloc area for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_VMALLOC_H
15#define __MACH_VMALLOC_H
16
17#include <plat/vmalloc.h>
18
19#endif /* __MACH_VMALLOC_H */
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c
index 8238fe38e713..c6e4254741cc 100644
--- a/arch/arm/mach-spear6xx/spear600_evb.c
+++ b/arch/arm/mach-spear6xx/spear600_evb.c
@@ -11,6 +11,7 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <asm/hardware/vic.h>
14#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16#include <mach/generic.h> 17#include <mach/generic.h>
@@ -46,6 +47,8 @@ MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
46 .atag_offset = 0x100, 47 .atag_offset = 0x100,
47 .map_io = spear6xx_map_io, 48 .map_io = spear6xx_map_io,
48 .init_irq = spear6xx_init_irq, 49 .init_irq = spear6xx_init_irq,
50 .handle_irq = vic_handle_irq,
49 .timer = &spear6xx_timer, 51 .timer = &spear6xx_timer,
50 .init_machine = spear600_evb_init, 52 .init_machine = spear600_evb_init,
53 .restart = spear_restart,
51MACHINE_END 54MACHINE_END
diff --git a/arch/arm/mach-tcc8k/Kconfig b/arch/arm/mach-tcc8k/Kconfig
deleted file mode 100644
index ad86415d1577..000000000000
--- a/arch/arm/mach-tcc8k/Kconfig
+++ /dev/null
@@ -1,11 +0,0 @@
1if ARCH_TCC8K
2
3comment "TCC8000 systems:"
4
5config MACH_TCC8000_SDK
6 bool "Telechips TCC8000-SDK development kit"
7 default y
8 help
9 Support for the Telechips TCC8000-SDK board.
10
11endif
diff --git a/arch/arm/mach-tcc8k/Makefile b/arch/arm/mach-tcc8k/Makefile
deleted file mode 100644
index 9bacf31e49ba..000000000000
--- a/arch/arm/mach-tcc8k/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1#
2# Makefile for TCC8K boards and common files.
3#
4
5# Common support
6obj-y += clock.o irq.o time.o io.o devices.o
7
8# Board specific support
9obj-$(CONFIG_MACH_TCC8000_SDK) += board-tcc8000-sdk.o
diff --git a/arch/arm/mach-tcc8k/Makefile.boot b/arch/arm/mach-tcc8k/Makefile.boot
deleted file mode 100644
index 5e02d4156b04..000000000000
--- a/arch/arm/mach-tcc8k/Makefile.boot
+++ /dev/null
@@ -1,3 +0,0 @@
1 zreladdr-y += 0x20008000
2params_phys-y := 0x20000100
3initrd_phys-y := 0x20800000
diff --git a/arch/arm/mach-tcc8k/board-tcc8000-sdk.c b/arch/arm/mach-tcc8k/board-tcc8000-sdk.c
deleted file mode 100644
index 777a5bb9eed2..000000000000
--- a/arch/arm/mach-tcc8k/board-tcc8000-sdk.c
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/delay.h>
10#include <linux/init.h>
11#include <linux/kernel.h>
12#include <linux/platform_device.h>
13
14#include <asm/mach-types.h>
15
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <asm/mach/time.h>
19
20#include <mach/clock.h>
21#include <mach/tcc-nand.h>
22#include <mach/tcc8k-regs.h>
23
24#include "common.h"
25
26#define XI_FREQUENCY 12000000
27#define XTI_FREQUENCY 32768
28
29#ifdef CONFIG_MTD_NAND_TCC
30/* NAND */
31static struct tcc_nand_platform_data tcc8k_sdk_nand_data = {
32 .width = 1,
33 .hw_ecc = 0,
34};
35#endif
36
37static void __init tcc8k_init(void)
38{
39#ifdef CONFIG_MTD_NAND_TCC
40 tcc_nand_device.dev.platform_data = &tcc8k_sdk_nand_data;
41 platform_device_register(&tcc_nand_device);
42#endif
43}
44
45static void __init tcc8k_init_timer(void)
46{
47 tcc_clocks_init(XI_FREQUENCY, XTI_FREQUENCY);
48}
49
50static struct sys_timer tcc8k_timer = {
51 .init = tcc8k_init_timer,
52};
53
54static void __init tcc8k_map_io(void)
55{
56 tcc8k_map_common_io();
57
58 /* set PLL0 clock to 96MHz, adapt UART0 divisor */
59 __raw_writel(0x00026003, CKC_BASE + PLL0CFG_OFFS);
60 __raw_writel(0x10000001, CKC_BASE + ACLKUART0_OFFS);
61
62 /* set PLL1 clock to 192MHz */
63 __raw_writel(0x00016003, CKC_BASE + PLL1CFG_OFFS);
64
65 /* set PLL2 clock to 48MHz */
66 __raw_writel(0x00036003, CKC_BASE + PLL2CFG_OFFS);
67
68 /* with CPU freq higher than 150 MHz, need extra DTCM wait */
69 __raw_writel(0x00000001, SCFG_BASE + DTCMWAIT_OFFS);
70
71 /* PLL locking time as specified */
72 udelay(300);
73}
74
75MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board")
76 .atag_offset = 0x100,
77 .map_io = tcc8k_map_io,
78 .init_irq = tcc8k_init_irq,
79 .init_machine = tcc8k_init,
80 .timer = &tcc8k_timer,
81MACHINE_END
diff --git a/arch/arm/mach-tcc8k/clock.c b/arch/arm/mach-tcc8k/clock.c
deleted file mode 100644
index e7cdae5c77a4..000000000000
--- a/arch/arm/mach-tcc8k/clock.c
+++ /dev/null
@@ -1,580 +0,0 @@
1/*
2 * Lowlevel clock handling for Telechips TCC8xxx SoCs
3 *
4 * Copyright (C) 2010 by Hans J. Koch <hjk@linutronix.de>
5 *
6 * Licensed under the terms of the GPL v2
7 */
8
9#include <linux/clk.h>
10#include <linux/delay.h>
11#include <linux/err.h>
12#include <linux/io.h>
13#include <linux/module.h>
14#include <linux/spinlock.h>
15#include <linux/clkdev.h>
16
17#include <mach/clock.h>
18#include <mach/irqs.h>
19#include <mach/tcc8k-regs.h>
20
21#include "common.h"
22
23#define BCLKCTR0 (CKC_BASE + BCLKCTR0_OFFS)
24#define BCLKCTR1 (CKC_BASE + BCLKCTR1_OFFS)
25
26#define ACLKREF (CKC_BASE + ACLKREF_OFFS)
27#define ACLKUART0 (CKC_BASE + ACLKUART0_OFFS)
28#define ACLKUART1 (CKC_BASE + ACLKUART1_OFFS)
29#define ACLKUART2 (CKC_BASE + ACLKUART2_OFFS)
30#define ACLKUART3 (CKC_BASE + ACLKUART3_OFFS)
31#define ACLKUART4 (CKC_BASE + ACLKUART4_OFFS)
32#define ACLKI2C (CKC_BASE + ACLKI2C_OFFS)
33#define ACLKADC (CKC_BASE + ACLKADC_OFFS)
34#define ACLKUSBH (CKC_BASE + ACLKUSBH_OFFS)
35#define ACLKLCD (CKC_BASE + ACLKLCD_OFFS)
36#define ACLKSDH0 (CKC_BASE + ACLKSDH0_OFFS)
37#define ACLKSDH1 (CKC_BASE + ACLKSDH1_OFFS)
38#define ACLKSPI0 (CKC_BASE + ACLKSPI0_OFFS)
39#define ACLKSPI1 (CKC_BASE + ACLKSPI1_OFFS)
40#define ACLKSPDIF (CKC_BASE + ACLKSPDIF_OFFS)
41#define ACLKC3DEC (CKC_BASE + ACLKC3DEC_OFFS)
42#define ACLKCAN0 (CKC_BASE + ACLKCAN0_OFFS)
43#define ACLKCAN1 (CKC_BASE + ACLKCAN1_OFFS)
44#define ACLKGSB0 (CKC_BASE + ACLKGSB0_OFFS)
45#define ACLKGSB1 (CKC_BASE + ACLKGSB1_OFFS)
46#define ACLKGSB2 (CKC_BASE + ACLKGSB2_OFFS)
47#define ACLKGSB3 (CKC_BASE + ACLKGSB3_OFFS)
48#define ACLKTCT (CKC_BASE + ACLKTCT_OFFS)
49#define ACLKTCX (CKC_BASE + ACLKTCX_OFFS)
50#define ACLKTCZ (CKC_BASE + ACLKTCZ_OFFS)
51
52#define ACLK_MAX_DIV (0xfff + 1)
53
54/* Crystal frequencies */
55static unsigned long xi_rate, xti_rate;
56
57static void __iomem *pll_cfg_addr(int pll)
58{
59 switch (pll) {
60 case 0: return (CKC_BASE + PLL0CFG_OFFS);
61 case 1: return (CKC_BASE + PLL1CFG_OFFS);
62 case 2: return (CKC_BASE + PLL2CFG_OFFS);
63 default:
64 BUG();
65 }
66}
67
68static int pll_enable(int pll, int enable)
69{
70 u32 reg;
71 void __iomem *addr = pll_cfg_addr(pll);
72
73 reg = __raw_readl(addr);
74 if (enable)
75 reg &= ~PLLxCFG_PD;
76 else
77 reg |= PLLxCFG_PD;
78
79 __raw_writel(reg, addr);
80 return 0;
81}
82
83static int xi_enable(int enable)
84{
85 u32 reg;
86
87 reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS);
88 if (enable)
89 reg |= CLKCTRL_XE;
90 else
91 reg &= ~CLKCTRL_XE;
92
93 __raw_writel(reg, CKC_BASE + CLKCTRL_OFFS);
94 return 0;
95}
96
97static int root_clk_enable(enum root_clks src)
98{
99 switch (src) {
100 case CLK_SRC_PLL0: return pll_enable(0, 1);
101 case CLK_SRC_PLL1: return pll_enable(1, 1);
102 case CLK_SRC_PLL2: return pll_enable(2, 1);
103 case CLK_SRC_XI: return xi_enable(1);
104 default:
105 BUG();
106 }
107 return 0;
108}
109
110static int root_clk_disable(enum root_clks src)
111{
112 switch (src) {
113 case CLK_SRC_PLL0: return pll_enable(0, 0);
114 case CLK_SRC_PLL1: return pll_enable(1, 0);
115 case CLK_SRC_PLL2: return pll_enable(2, 0);
116 case CLK_SRC_XI: return xi_enable(0);
117 default:
118 BUG();
119 }
120 return 0;
121}
122
123static int enable_clk(struct clk *clk)
124{
125 u32 reg;
126
127 if (clk->root_id != CLK_SRC_NOROOT)
128 return root_clk_enable(clk->root_id);
129
130 if (clk->aclkreg) {
131 reg = __raw_readl(clk->aclkreg);
132 reg |= ACLK_EN;
133 __raw_writel(reg, clk->aclkreg);
134 }
135 if (clk->bclkctr) {
136 reg = __raw_readl(clk->bclkctr);
137 reg |= 1 << clk->bclk_shift;
138 __raw_writel(reg, clk->bclkctr);
139 }
140 return 0;
141}
142
143static void disable_clk(struct clk *clk)
144{
145 u32 reg;
146
147 if (clk->root_id != CLK_SRC_NOROOT) {
148 root_clk_disable(clk->root_id);
149 return;
150 }
151
152 if (clk->bclkctr) {
153 reg = __raw_readl(clk->bclkctr);
154 reg &= ~(1 << clk->bclk_shift);
155 __raw_writel(reg, clk->bclkctr);
156 }
157 if (clk->aclkreg) {
158 reg = __raw_readl(clk->aclkreg);
159 reg &= ~ACLK_EN;
160 __raw_writel(reg, clk->aclkreg);
161 }
162}
163
164static unsigned long get_rate_pll(int pll)
165{
166 u32 reg;
167 unsigned long s, m, p;
168 void __iomem *addr = pll_cfg_addr(pll);
169
170 reg = __raw_readl(addr);
171 s = (reg >> 16) & 0x07;
172 m = (reg >> 8) & 0xff;
173 p = reg & 0x3f;
174
175 return (m * xi_rate) / (p * (1 << s));
176}
177
178static unsigned long get_rate_pll_div(int pll)
179{
180 u32 reg;
181 unsigned long div = 0;
182 void __iomem *addr;
183
184 switch (pll) {
185 case 0:
186 addr = CKC_BASE + CLKDIVC0_OFFS;
187 reg = __raw_readl(addr);
188 if (reg & CLKDIVC0_P0E)
189 div = (reg >> 24) & 0x3f;
190 break;
191 case 1:
192 addr = CKC_BASE + CLKDIVC0_OFFS;
193 reg = __raw_readl(addr);
194 if (reg & CLKDIVC0_P1E)
195 div = (reg >> 16) & 0x3f;
196 break;
197 case 2:
198 addr = CKC_BASE + CLKDIVC1_OFFS;
199 reg = __raw_readl(addr);
200 if (reg & CLKDIVC1_P2E)
201 div = reg & 0x3f;
202 break;
203 }
204 return get_rate_pll(pll) / (div + 1);
205}
206
207static unsigned long get_rate_xi_div(void)
208{
209 unsigned long div = 0;
210 u32 reg = __raw_readl(CKC_BASE + CLKDIVC0_OFFS);
211
212 if (reg & CLKDIVC0_XE)
213 div = (reg >> 8) & 0x3f;
214
215 return xi_rate / (div + 1);
216}
217
218static unsigned long get_rate_xti_div(void)
219{
220 unsigned long div = 0;
221 u32 reg = __raw_readl(CKC_BASE + CLKDIVC0_OFFS);
222
223 if (reg & CLKDIVC0_XTE)
224 div = reg & 0x3f;
225
226 return xti_rate / (div + 1);
227}
228
229static unsigned long root_clk_get_rate(enum root_clks src)
230{
231 switch (src) {
232 case CLK_SRC_PLL0: return get_rate_pll(0);
233 case CLK_SRC_PLL1: return get_rate_pll(1);
234 case CLK_SRC_PLL2: return get_rate_pll(2);
235 case CLK_SRC_PLL0DIV: return get_rate_pll_div(0);
236 case CLK_SRC_PLL1DIV: return get_rate_pll_div(1);
237 case CLK_SRC_PLL2DIV: return get_rate_pll_div(2);
238 case CLK_SRC_XI: return xi_rate;
239 case CLK_SRC_XTI: return xti_rate;
240 case CLK_SRC_XIDIV: return get_rate_xi_div();
241 case CLK_SRC_XTIDIV: return get_rate_xti_div();
242 default: return 0;
243 }
244}
245
246static unsigned long aclk_get_rate(struct clk *clk)
247{
248 u32 reg;
249 unsigned long div;
250 unsigned int src;
251
252 reg = __raw_readl(clk->aclkreg);
253 div = reg & 0x0fff;
254 src = (reg >> ACLK_SEL_SHIFT) & CLK_SRC_MASK;
255 return root_clk_get_rate(src) / (div + 1);
256}
257
258static unsigned long aclk_best_div(struct clk *clk, unsigned long rate)
259{
260 unsigned long div, src, freq, r1, r2;
261
262 if (!rate)
263 return ACLK_MAX_DIV;
264
265 src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT;
266 src &= CLK_SRC_MASK;
267 freq = root_clk_get_rate(src);
268 div = freq / rate;
269 if (!div)
270 return 1;
271 if (div >= ACLK_MAX_DIV)
272 return ACLK_MAX_DIV;
273 r1 = freq / div;
274 r2 = freq / (div + 1);
275 if ((rate - r2) < (r1 - rate))
276 return div + 1;
277
278 return div;
279}
280
281static unsigned long aclk_round_rate(struct clk *clk, unsigned long rate)
282{
283 unsigned int src;
284
285 src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT;
286 src &= CLK_SRC_MASK;
287
288 return root_clk_get_rate(src) / aclk_best_div(clk, rate);
289}
290
291static int aclk_set_rate(struct clk *clk, unsigned long rate)
292{
293 u32 reg;
294
295 reg = __raw_readl(clk->aclkreg) & ~ACLK_DIV_MASK;
296 reg |= aclk_best_div(clk, rate) - 1;
297 __raw_writel(reg, clk->aclkreg);
298 return 0;
299}
300
301static unsigned long get_rate_sys(struct clk *clk)
302{
303 unsigned int src;
304
305 src = __raw_readl(CKC_BASE + CLKCTRL_OFFS) & CLK_SRC_MASK;
306 return root_clk_get_rate(src);
307}
308
309static unsigned long get_rate_bus(struct clk *clk)
310{
311 unsigned int reg, sdiv, bdiv, rate;
312
313 reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS);
314 rate = get_rate_sys(clk);
315 sdiv = (reg >> 20) & 3;
316 if (sdiv)
317 rate /= sdiv + 1;
318 bdiv = (reg >> 4) & 0xff;
319 if (bdiv)
320 rate /= bdiv + 1;
321 return rate;
322}
323
324static unsigned long get_rate_cpu(struct clk *clk)
325{
326 unsigned int reg, div, fsys, fbus;
327
328 fbus = get_rate_bus(clk);
329 reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS);
330 if (reg & (1 << 29))
331 return fbus;
332 fsys = get_rate_sys(clk);
333 div = (reg >> 16) & 0x0f;
334 return fbus + ((fsys - fbus) * (div + 1)) / 16;
335}
336
337static unsigned long get_rate_root(struct clk *clk)
338{
339 return root_clk_get_rate(clk->root_id);
340}
341
342static int aclk_set_parent(struct clk *clock, struct clk *parent)
343{
344 u32 reg;
345
346 if (clock->parent == parent)
347 return 0;
348
349 clock->parent = parent;
350
351 if (!parent)
352 return 0;
353
354 if (parent->root_id == CLK_SRC_NOROOT)
355 return 0;
356 reg = __raw_readl(clock->aclkreg);
357 reg &= ~ACLK_SEL_MASK;
358 reg |= (parent->root_id << ACLK_SEL_SHIFT) & ACLK_SEL_MASK;
359 __raw_writel(reg, clock->aclkreg);
360
361 return 0;
362}
363
364#define DEFINE_ROOT_CLOCK(name, ri, p) \
365 static struct clk name = { \
366 .root_id = ri, \
367 .get_rate = get_rate_root, \
368 .enable = enable_clk, \
369 .disable = disable_clk, \
370 .parent = p, \
371 };
372
373#define DEFINE_SPECIAL_CLOCK(name, gr, p) \
374 static struct clk name = { \
375 .root_id = CLK_SRC_NOROOT, \
376 .get_rate = gr, \
377 .parent = p, \
378 };
379
380#define DEFINE_ACLOCK(name, bc, bs, ar) \
381 static struct clk name = { \
382 .root_id = CLK_SRC_NOROOT, \
383 .bclkctr = bc, \
384 .bclk_shift = bs, \
385 .aclkreg = ar, \
386 .get_rate = aclk_get_rate, \
387 .set_rate = aclk_set_rate, \
388 .round_rate = aclk_round_rate, \
389 .enable = enable_clk, \
390 .disable = disable_clk, \
391 .set_parent = aclk_set_parent, \
392 };
393
394#define DEFINE_BCLOCK(name, bc, bs, gr, p) \
395 static struct clk name = { \
396 .root_id = CLK_SRC_NOROOT, \
397 .bclkctr = bc, \
398 .bclk_shift = bs, \
399 .get_rate = gr, \
400 .enable = enable_clk, \
401 .disable = disable_clk, \
402 .parent = p, \
403 };
404
405DEFINE_ROOT_CLOCK(xi, CLK_SRC_XI, NULL)
406DEFINE_ROOT_CLOCK(xti, CLK_SRC_XTI, NULL)
407DEFINE_ROOT_CLOCK(xidiv, CLK_SRC_XIDIV, &xi)
408DEFINE_ROOT_CLOCK(xtidiv, CLK_SRC_XTIDIV, &xti)
409DEFINE_ROOT_CLOCK(pll0, CLK_SRC_PLL0, &xi)
410DEFINE_ROOT_CLOCK(pll1, CLK_SRC_PLL1, &xi)
411DEFINE_ROOT_CLOCK(pll2, CLK_SRC_PLL2, &xi)
412DEFINE_ROOT_CLOCK(pll0div, CLK_SRC_PLL0DIV, &pll0)
413DEFINE_ROOT_CLOCK(pll1div, CLK_SRC_PLL1DIV, &pll1)
414DEFINE_ROOT_CLOCK(pll2div, CLK_SRC_PLL2DIV, &pll2)
415
416/* The following 3 clocks are special and are initialized explicitly later */
417DEFINE_SPECIAL_CLOCK(sys, get_rate_sys, NULL)
418DEFINE_SPECIAL_CLOCK(bus, get_rate_bus, &sys)
419DEFINE_SPECIAL_CLOCK(cpu, get_rate_cpu, &sys)
420
421DEFINE_ACLOCK(tct, NULL, 0, ACLKTCT)
422DEFINE_ACLOCK(tcx, NULL, 0, ACLKTCX)
423DEFINE_ACLOCK(tcz, NULL, 0, ACLKTCZ)
424DEFINE_ACLOCK(ref, NULL, 0, ACLKREF)
425DEFINE_ACLOCK(uart0, BCLKCTR0, 5, ACLKUART0)
426DEFINE_ACLOCK(uart1, BCLKCTR0, 23, ACLKUART1)
427DEFINE_ACLOCK(uart2, BCLKCTR0, 6, ACLKUART2)
428DEFINE_ACLOCK(uart3, BCLKCTR0, 8, ACLKUART3)
429DEFINE_ACLOCK(uart4, BCLKCTR1, 6, ACLKUART4)
430DEFINE_ACLOCK(i2c, BCLKCTR0, 7, ACLKI2C)
431DEFINE_ACLOCK(adc, BCLKCTR0, 10, ACLKADC)
432DEFINE_ACLOCK(usbh0, BCLKCTR0, 11, ACLKUSBH)
433DEFINE_ACLOCK(lcd, BCLKCTR0, 13, ACLKLCD)
434DEFINE_ACLOCK(sd0, BCLKCTR0, 17, ACLKSDH0)
435DEFINE_ACLOCK(sd1, BCLKCTR1, 5, ACLKSDH1)
436DEFINE_ACLOCK(spi0, BCLKCTR0, 24, ACLKSPI0)
437DEFINE_ACLOCK(spi1, BCLKCTR0, 30, ACLKSPI1)
438DEFINE_ACLOCK(spdif, BCLKCTR1, 2, ACLKSPDIF)
439DEFINE_ACLOCK(c3dec, BCLKCTR1, 9, ACLKC3DEC)
440DEFINE_ACLOCK(can0, BCLKCTR1, 10, ACLKCAN0)
441DEFINE_ACLOCK(can1, BCLKCTR1, 11, ACLKCAN1)
442DEFINE_ACLOCK(gsb0, BCLKCTR1, 13, ACLKGSB0)
443DEFINE_ACLOCK(gsb1, BCLKCTR1, 14, ACLKGSB1)
444DEFINE_ACLOCK(gsb2, BCLKCTR1, 15, ACLKGSB2)
445DEFINE_ACLOCK(gsb3, BCLKCTR1, 16, ACLKGSB3)
446DEFINE_ACLOCK(usbh1, BCLKCTR1, 20, ACLKUSBH)
447
448DEFINE_BCLOCK(dai0, BCLKCTR0, 0, NULL, NULL)
449DEFINE_BCLOCK(pic, BCLKCTR0, 1, NULL, NULL)
450DEFINE_BCLOCK(tc, BCLKCTR0, 2, NULL, NULL)
451DEFINE_BCLOCK(gpio, BCLKCTR0, 3, NULL, NULL)
452DEFINE_BCLOCK(usbd, BCLKCTR0, 4, NULL, NULL)
453DEFINE_BCLOCK(ecc, BCLKCTR0, 9, NULL, NULL)
454DEFINE_BCLOCK(gdma0, BCLKCTR0, 12, NULL, NULL)
455DEFINE_BCLOCK(rtc, BCLKCTR0, 15, NULL, NULL)
456DEFINE_BCLOCK(nfc, BCLKCTR0, 16, NULL, NULL)
457DEFINE_BCLOCK(g2d, BCLKCTR0, 18, NULL, NULL)
458DEFINE_BCLOCK(gdma1, BCLKCTR0, 22, NULL, NULL)
459DEFINE_BCLOCK(mscl, BCLKCTR0, 25, NULL, NULL)
460DEFINE_BCLOCK(bdma, BCLKCTR1, 0, NULL, NULL)
461DEFINE_BCLOCK(adma0, BCLKCTR1, 1, NULL, NULL)
462DEFINE_BCLOCK(scfg, BCLKCTR1, 3, NULL, NULL)
463DEFINE_BCLOCK(cid, BCLKCTR1, 4, NULL, NULL)
464DEFINE_BCLOCK(dai1, BCLKCTR1, 7, NULL, NULL)
465DEFINE_BCLOCK(adma1, BCLKCTR1, 8, NULL, NULL)
466DEFINE_BCLOCK(gps, BCLKCTR1, 12, NULL, NULL)
467DEFINE_BCLOCK(gdma2, BCLKCTR1, 17, NULL, NULL)
468DEFINE_BCLOCK(gdma3, BCLKCTR1, 18, NULL, NULL)
469DEFINE_BCLOCK(ddrc, BCLKCTR1, 19, NULL, NULL)
470
471#define _REGISTER_CLOCK(d, n, c) \
472 { \
473 .dev_id = d, \
474 .con_id = n, \
475 .clk = &c, \
476 },
477
478static struct clk_lookup lookups[] = {
479 _REGISTER_CLOCK(NULL, "bus", bus)
480 _REGISTER_CLOCK(NULL, "cpu", cpu)
481 _REGISTER_CLOCK(NULL, "tct", tct)
482 _REGISTER_CLOCK(NULL, "tcx", tcx)
483 _REGISTER_CLOCK(NULL, "tcz", tcz)
484 _REGISTER_CLOCK(NULL, "ref", ref)
485 _REGISTER_CLOCK(NULL, "dai0", dai0)
486 _REGISTER_CLOCK(NULL, "pic", pic)
487 _REGISTER_CLOCK(NULL, "tc", tc)
488 _REGISTER_CLOCK(NULL, "gpio", gpio)
489 _REGISTER_CLOCK(NULL, "usbd", usbd)
490 _REGISTER_CLOCK("tcc-uart.0", NULL, uart0)
491 _REGISTER_CLOCK("tcc-uart.2", NULL, uart2)
492 _REGISTER_CLOCK("tcc-i2c", NULL, i2c)
493 _REGISTER_CLOCK("tcc-uart.3", NULL, uart3)
494 _REGISTER_CLOCK(NULL, "ecc", ecc)
495 _REGISTER_CLOCK(NULL, "adc", adc)
496 _REGISTER_CLOCK("tcc-usbh.0", "usb", usbh0)
497 _REGISTER_CLOCK(NULL, "gdma0", gdma0)
498 _REGISTER_CLOCK(NULL, "lcd", lcd)
499 _REGISTER_CLOCK(NULL, "rtc", rtc)
500 _REGISTER_CLOCK(NULL, "nfc", nfc)
501 _REGISTER_CLOCK("tcc-mmc.0", NULL, sd0)
502 _REGISTER_CLOCK(NULL, "g2d", g2d)
503 _REGISTER_CLOCK(NULL, "gdma1", gdma1)
504 _REGISTER_CLOCK("tcc-uart.1", NULL, uart1)
505 _REGISTER_CLOCK("tcc-spi.0", NULL, spi0)
506 _REGISTER_CLOCK(NULL, "mscl", mscl)
507 _REGISTER_CLOCK("tcc-spi.1", NULL, spi1)
508 _REGISTER_CLOCK(NULL, "bdma", bdma)
509 _REGISTER_CLOCK(NULL, "adma0", adma0)
510 _REGISTER_CLOCK(NULL, "spdif", spdif)
511 _REGISTER_CLOCK(NULL, "scfg", scfg)
512 _REGISTER_CLOCK(NULL, "cid", cid)
513 _REGISTER_CLOCK("tcc-mmc.1", NULL, sd1)
514 _REGISTER_CLOCK("tcc-uart.4", NULL, uart4)
515 _REGISTER_CLOCK(NULL, "dai1", dai1)
516 _REGISTER_CLOCK(NULL, "adma1", adma1)
517 _REGISTER_CLOCK(NULL, "c3dec", c3dec)
518 _REGISTER_CLOCK("tcc-can.0", NULL, can0)
519 _REGISTER_CLOCK("tcc-can.1", NULL, can1)
520 _REGISTER_CLOCK(NULL, "gps", gps)
521 _REGISTER_CLOCK("tcc-gsb.0", NULL, gsb0)
522 _REGISTER_CLOCK("tcc-gsb.1", NULL, gsb1)
523 _REGISTER_CLOCK("tcc-gsb.2", NULL, gsb2)
524 _REGISTER_CLOCK("tcc-gsb.3", NULL, gsb3)
525 _REGISTER_CLOCK(NULL, "gdma2", gdma2)
526 _REGISTER_CLOCK(NULL, "gdma3", gdma3)
527 _REGISTER_CLOCK(NULL, "ddrc", ddrc)
528 _REGISTER_CLOCK("tcc-usbh.1", "usb", usbh1)
529};
530
531static struct clk *root_clk_by_index(enum root_clks src)
532{
533 switch (src) {
534 case CLK_SRC_PLL0: return &pll0;
535 case CLK_SRC_PLL1: return &pll1;
536 case CLK_SRC_PLL2: return &pll2;
537 case CLK_SRC_PLL0DIV: return &pll0div;
538 case CLK_SRC_PLL1DIV: return &pll1div;
539 case CLK_SRC_PLL2DIV: return &pll2div;
540 case CLK_SRC_XI: return &xi;
541 case CLK_SRC_XTI: return &xti;
542 case CLK_SRC_XIDIV: return &xidiv;
543 case CLK_SRC_XTIDIV: return &xtidiv;
544 default: return NULL;
545 }
546}
547
548static void find_aclk_parent(struct clk *clk)
549{
550 unsigned int src;
551 struct clk *clock;
552
553 if (!clk->aclkreg)
554 return;
555
556 src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT;
557 src &= CLK_SRC_MASK;
558
559 clock = root_clk_by_index(src);
560 if (!clock)
561 return;
562
563 clk->parent = clock;
564 clk->set_parent = aclk_set_parent;
565}
566
567void __init tcc_clocks_init(unsigned long xi_freq, unsigned long xti_freq)
568{
569 int i;
570
571 xi_rate = xi_freq;
572 xti_rate = xti_freq;
573
574 /* fixup parents and add the clock */
575 for (i = 0; i < ARRAY_SIZE(lookups); i++) {
576 find_aclk_parent(lookups[i].clk);
577 clkdev_add(&lookups[i]);
578 }
579 tcc8k_timer_init(&tcz, (void __iomem *)TIMER_BASE, INT_TC32);
580}
diff --git a/arch/arm/mach-tcc8k/common.h b/arch/arm/mach-tcc8k/common.h
deleted file mode 100644
index 705690add395..000000000000
--- a/arch/arm/mach-tcc8k/common.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef MACH_TCC8K_COMMON_H
2#define MACH_TCC8K_COMMON_H
3
4#include <linux/platform_device.h>
5
6extern struct platform_device tcc_nand_device;
7
8struct clk;
9
10extern void tcc_clocks_init(unsigned long xi_freq, unsigned long xti_freq);
11extern void tcc8k_timer_init(struct clk *clock, void __iomem *base, int irq);
12extern void tcc8k_init_irq(void);
13extern void tcc8k_map_common_io(void);
14
15#endif
diff --git a/arch/arm/mach-tcc8k/devices.c b/arch/arm/mach-tcc8k/devices.c
deleted file mode 100644
index 6722ad7c2836..000000000000
--- a/arch/arm/mach-tcc8k/devices.c
+++ /dev/null
@@ -1,239 +0,0 @@
1/*
2 * linux/arch/arm/mach-tcc8k/devices.c
3 *
4 * Copyright (C) Telechips, Inc.
5 * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
6 *
7 * Licensed under the terms of GPL v2.
8 *
9 */
10
11#include <linux/dma-mapping.h>
12#include <linux/init.h>
13#include <linux/io.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
16
17#include <asm/mach/map.h>
18
19#include <mach/tcc8k-regs.h>
20#include <mach/irqs.h>
21
22#include "common.h"
23
24static u64 tcc8k_dmamask = DMA_BIT_MASK(32);
25
26#ifdef CONFIG_MTD_NAND_TCC
27/* NAND controller */
28static struct resource tcc_nand_resources[] = {
29 {
30 .start = (resource_size_t)NFC_BASE,
31 .end = (resource_size_t)NFC_BASE + 0x7f,
32 .flags = IORESOURCE_MEM,
33 }, {
34 .start = INT_NFC,
35 .end = INT_NFC,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40struct platform_device tcc_nand_device = {
41 .name = "tcc_nand",
42 .id = 0,
43 .num_resources = ARRAY_SIZE(tcc_nand_resources),
44 .resource = tcc_nand_resources,
45};
46#endif
47
48#ifdef CONFIG_MMC_TCC8K
49/* MMC controller */
50static struct resource tcc8k_mmc0_resource[] = {
51 {
52 .start = INT_SD0,
53 .end = INT_SD0,
54 .flags = IORESOURCE_IRQ,
55 },
56};
57
58static struct resource tcc8k_mmc1_resource[] = {
59 {
60 .start = INT_SD1,
61 .end = INT_SD1,
62 .flags = IORESOURCE_IRQ,
63 },
64};
65
66struct platform_device tcc8k_mmc0_device = {
67 .name = "tcc-mmc",
68 .id = 0,
69 .num_resources = ARRAY_SIZE(tcc8k_mmc0_resource),
70 .resource = tcc8k_mmc0_resource,
71 .dev = {
72 .dma_mask = &tcc8k_dmamask,
73 .coherent_dma_mask = DMA_BIT_MASK(32),
74 }
75};
76
77struct platform_device tcc8k_mmc1_device = {
78 .name = "tcc-mmc",
79 .id = 1,
80 .num_resources = ARRAY_SIZE(tcc8k_mmc1_resource),
81 .resource = tcc8k_mmc1_resource,
82 .dev = {
83 .dma_mask = &tcc8k_dmamask,
84 .coherent_dma_mask = DMA_BIT_MASK(32),
85 }
86};
87
88static inline void tcc8k_init_mmc(void)
89{
90 u32 reg = __raw_readl(GPIOPS_BASE + GPIOPS_FS1_OFFS);
91
92 reg |= GPIOPS_FS1_SDH0_BITS | GPIOPS_FS1_SDH1_BITS;
93 __raw_writel(reg, GPIOPS_BASE + GPIOPS_FS1_OFFS);
94
95 platform_device_register(&tcc8k_mmc0_device);
96 platform_device_register(&tcc8k_mmc1_device);
97}
98#else
99static inline void tcc8k_init_mmc(void) { }
100#endif
101
102#ifdef CONFIG_USB_OHCI_HCD
103static int tcc8k_ohci_init(struct device *dev)
104{
105 u32 reg;
106
107 /* Use GPIO PK19 as VBUS control output */
108 reg = __raw_readl(GPIOPK_BASE + GPIOPK_FS0_OFFS);
109 reg &= ~(1 << 19);
110 __raw_writel(reg, GPIOPK_BASE + GPIOPK_FS0_OFFS);
111 reg = __raw_readl(GPIOPK_BASE + GPIOPK_FS1_OFFS);
112 reg &= ~(1 << 19);
113 __raw_writel(reg, GPIOPK_BASE + GPIOPK_FS1_OFFS);
114
115 reg = __raw_readl(GPIOPK_BASE + GPIOPK_DOE_OFFS);
116 reg |= (1 << 19);
117 __raw_writel(reg, GPIOPK_BASE + GPIOPK_DOE_OFFS);
118 /* Turn on VBUS */
119 reg = __raw_readl(GPIOPK_BASE + GPIOPK_DAT_OFFS);
120 reg |= (1 << 19);
121 __raw_writel(reg, GPIOPK_BASE + GPIOPK_DAT_OFFS);
122
123 return 0;
124}
125
126static struct resource tcc8k_ohci0_resources[] = {
127 [0] = {
128 .start = (resource_size_t)USBH0_BASE,
129 .end = (resource_size_t)USBH0_BASE + 0x5c,
130 .flags = IORESOURCE_MEM,
131 },
132 [1] = {
133 .start = INT_USBH0,
134 .end = INT_USBH0,
135 .flags = IORESOURCE_IRQ,
136 }
137};
138
139static struct resource tcc8k_ohci1_resources[] = {
140 [0] = {
141 .start = (resource_size_t)USBH1_BASE,
142 .end = (resource_size_t)USBH1_BASE + 0x5c,
143 .flags = IORESOURCE_MEM,
144 },
145 [1] = {
146 .start = INT_USBH1,
147 .end = INT_USBH1,
148 .flags = IORESOURCE_IRQ,
149 }
150};
151
152static struct tccohci_platform_data tcc8k_ohci0_platform_data = {
153 .controller = 0,
154 .port_mode = PMM_PERPORT_MODE,
155 .init = tcc8k_ohci_init,
156};
157
158static struct tccohci_platform_data tcc8k_ohci1_platform_data = {
159 .controller = 1,
160 .port_mode = PMM_PERPORT_MODE,
161 .init = tcc8k_ohci_init,
162};
163
164static struct platform_device ohci0_device = {
165 .name = "tcc-ohci",
166 .id = 0,
167 .dev = {
168 .dma_mask = &tcc8k_dmamask,
169 .coherent_dma_mask = DMA_BIT_MASK(32),
170 .platform_data = &tcc8k_ohci0_platform_data,
171 },
172 .num_resources = ARRAY_SIZE(tcc8k_ohci0_resources),
173 .resource = tcc8k_ohci0_resources,
174};
175
176static struct platform_device ohci1_device = {
177 .name = "tcc-ohci",
178 .id = 1,
179 .dev = {
180 .dma_mask = &tcc8k_dmamask,
181 .coherent_dma_mask = DMA_BIT_MASK(32),
182 .platform_data = &tcc8k_ohci1_platform_data,
183 },
184 .num_resources = ARRAY_SIZE(tcc8k_ohci1_resources),
185 .resource = tcc8k_ohci1_resources,
186};
187
188static void __init tcc8k_init_usbhost(void)
189{
190 platform_device_register(&ohci0_device);
191 platform_device_register(&ohci1_device);
192}
193#else
194static void __init tcc8k_init_usbhost(void) { }
195#endif
196
197/* USB device controller*/
198#ifdef CONFIG_USB_GADGET_TCC8K
199static struct resource udc_resources[] = {
200 [0] = {
201 .start = INT_USBD,
202 .end = INT_USBD,
203 .flags = IORESOURCE_IRQ,
204 },
205 [1] = {
206 .start = INT_UDMA,
207 .end = INT_UDMA,
208 .flags = IORESOURCE_IRQ,
209 },
210};
211
212static struct platform_device tcc8k_udc_device = {
213 .name = "tcc-udc",
214 .id = 0,
215 .resource = udc_resources,
216 .num_resources = ARRAY_SIZE(udc_resources),
217 .dev = {
218 .dma_mask = &tcc8k_dmamask,
219 .coherent_dma_mask = DMA_BIT_MASK(32),
220 },
221};
222
223static void __init tcc8k_init_usb_gadget(void)
224{
225 platform_device_register(&tcc8k_udc_device);
226}
227#else
228static void __init tcc8k_init_usb_gadget(void) { }
229#endif /* CONFIG_USB_GADGET_TCC83X */
230
231static int __init tcc8k_init_devices(void)
232{
233 tcc8k_init_mmc();
234 tcc8k_init_usbhost();
235 tcc8k_init_usb_gadget();
236 return 0;
237}
238
239arch_initcall(tcc8k_init_devices);
diff --git a/arch/arm/mach-tcc8k/io.c b/arch/arm/mach-tcc8k/io.c
deleted file mode 100644
index 9b39d7fa658f..000000000000
--- a/arch/arm/mach-tcc8k/io.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * linux/arch/arm/mach-tcc8k/io.c
3 *
4 * (C) 2009 Hans J. Koch <hjk@linutronix.de>
5 *
6 * derived from TCC83xx io.c
7 * Copyright (C) Telechips, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/init.h>
15#include <linux/io.h>
16#include <linux/kernel.h>
17
18#include <asm/mach/map.h>
19
20#include <mach/tcc8k-regs.h>
21
22/*
23 * The machine specific code may provide the extra mapping besides the
24 * default mapping provided here.
25 */
26static struct map_desc tcc8k_io_desc[] __initdata = {
27 {
28 .virtual = (unsigned long)CS1_BASE_VIRT,
29 .pfn = __phys_to_pfn(CS1_BASE),
30 .length = CS1_SIZE,
31 .type = MT_DEVICE,
32 }, {
33 .virtual = (unsigned long)AHB_PERI_BASE_VIRT,
34 .pfn = __phys_to_pfn(AHB_PERI_BASE),
35 .length = AHB_PERI_SIZE,
36 .type = MT_DEVICE,
37 }, {
38 .virtual = (unsigned long)APB0_PERI_BASE_VIRT,
39 .pfn = __phys_to_pfn(APB0_PERI_BASE),
40 .length = APB0_PERI_SIZE,
41 .type = MT_DEVICE,
42 }, {
43 .virtual = (unsigned long)APB1_PERI_BASE_VIRT,
44 .pfn = __phys_to_pfn(APB1_PERI_BASE),
45 .length = APB1_PERI_SIZE,
46 .type = MT_DEVICE,
47 }, {
48 .virtual = (unsigned long)EXT_MEM_CTRL_BASE_VIRT,
49 .pfn = __phys_to_pfn(EXT_MEM_CTRL_BASE),
50 .length = EXT_MEM_CTRL_SIZE,
51 .type = MT_DEVICE,
52 },
53};
54
55/*
56 * Maps common IO regions for tcc8k.
57 *
58 */
59void __init tcc8k_map_common_io(void)
60{
61 iotable_init(tcc8k_io_desc, ARRAY_SIZE(tcc8k_io_desc));
62}
diff --git a/arch/arm/mach-tcc8k/irq.c b/arch/arm/mach-tcc8k/irq.c
deleted file mode 100644
index 209fa5c65d4c..000000000000
--- a/arch/arm/mach-tcc8k/irq.c
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * Copyright (C) Telechips, Inc.
3 * Copyright (C) 2009-2010 Hans J. Koch <hjk@linutronix.de>
4 *
5 * Licensed under the terms of the GNU GPL version 2.
6 */
7
8#include <linux/init.h>
9#include <linux/interrupt.h>
10#include <linux/io.h>
11
12#include <asm/irq.h>
13#include <asm/mach/irq.h>
14
15#include <mach/tcc8k-regs.h>
16#include <mach/irqs.h>
17
18#include "common.h"
19
20/* Disable IRQ */
21static void tcc8000_mask_ack_irq0(struct irq_data *d)
22{
23 PIC0_IEN &= ~(1 << d->irq);
24 PIC0_CREQ |= (1 << d->irq);
25}
26
27static void tcc8000_mask_ack_irq1(struct irq_data *d)
28{
29 PIC1_IEN &= ~(1 << (d->irq - 32));
30 PIC1_CREQ |= (1 << (d->irq - 32));
31}
32
33static void tcc8000_mask_irq0(struct irq_data *d)
34{
35 PIC0_IEN &= ~(1 << d->irq);
36}
37
38static void tcc8000_mask_irq1(struct irq_data *d)
39{
40 PIC1_IEN &= ~(1 << (d->irq - 32));
41}
42
43static void tcc8000_ack_irq0(struct irq_data *d)
44{
45 PIC0_CREQ |= (1 << d->irq);
46}
47
48static void tcc8000_ack_irq1(struct irq_data *d)
49{
50 PIC1_CREQ |= (1 << (d->irq - 32));
51}
52
53/* Enable IRQ */
54static void tcc8000_unmask_irq0(struct irq_data *d)
55{
56 PIC0_IEN |= (1 << d->irq);
57 PIC0_INTOEN |= (1 << d->irq);
58}
59
60static void tcc8000_unmask_irq1(struct irq_data *d)
61{
62 PIC1_IEN |= (1 << (d->irq - 32));
63 PIC1_INTOEN |= (1 << (d->irq - 32));
64}
65
66static struct irq_chip tcc8000_irq_chip0 = {
67 .name = "tcc_irq0",
68 .irq_mask = tcc8000_mask_irq0,
69 .irq_ack = tcc8000_ack_irq0,
70 .irq_mask_ack = tcc8000_mask_ack_irq0,
71 .irq_unmask = tcc8000_unmask_irq0,
72};
73
74static struct irq_chip tcc8000_irq_chip1 = {
75 .name = "tcc_irq1",
76 .irq_mask = tcc8000_mask_irq1,
77 .irq_ack = tcc8000_ack_irq1,
78 .irq_mask_ack = tcc8000_mask_ack_irq1,
79 .irq_unmask = tcc8000_unmask_irq1,
80};
81
82void __init tcc8k_init_irq(void)
83{
84 int irqno;
85
86 /* Mask and clear all interrupts */
87 PIC0_IEN = 0x00000000;
88 PIC0_CREQ = 0xffffffff;
89 PIC1_IEN = 0x00000000;
90 PIC1_CREQ = 0xffffffff;
91
92 PIC0_MEN0 = 0x00000003;
93 PIC1_MEN1 = 0x00000003;
94 PIC1_MEN = 0x00000003;
95
96 /* let all IRQs be level triggered */
97 PIC0_TMODE = 0xffffffff;
98 PIC1_TMODE = 0xffffffff;
99 /* all IRQs are IRQs (not FIQs) */
100 PIC0_IRQSEL = 0xffffffff;
101 PIC1_IRQSEL = 0xffffffff;
102
103 for (irqno = 0; irqno < NR_IRQS; irqno++) {
104 if (irqno < 32)
105 irq_set_chip(irqno, &tcc8000_irq_chip0);
106 else
107 irq_set_chip(irqno, &tcc8000_irq_chip1);
108 irq_set_handler(irqno, handle_level_irq);
109 set_irq_flags(irqno, IRQF_VALID);
110 }
111}
diff --git a/arch/arm/mach-tcc8k/time.c b/arch/arm/mach-tcc8k/time.c
deleted file mode 100644
index a96babe83771..000000000000
--- a/arch/arm/mach-tcc8k/time.c
+++ /dev/null
@@ -1,134 +0,0 @@
1/*
2 * TCC8000 system timer setup
3 *
4 * (C) 2009 Hans J. Koch <hjk@linutronix.de>
5 *
6 * Licensed under the terms of the GPL version 2.
7 *
8 */
9
10#include <linux/clk.h>
11#include <linux/clockchips.h>
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/io.h>
15#include <linux/irq.h>
16#include <linux/kernel.h>
17#include <linux/spinlock.h>
18
19#include <asm/mach/time.h>
20
21#include <mach/tcc8k-regs.h>
22#include <mach/irqs.h>
23
24#include "common.h"
25
26static void __iomem *timer_base;
27
28static int tcc_set_next_event(unsigned long evt,
29 struct clock_event_device *unused)
30{
31 unsigned long reg = __raw_readl(timer_base + TC32MCNT_OFFS);
32
33 __raw_writel(reg + evt, timer_base + TC32CMP0_OFFS);
34 return 0;
35}
36
37static void tcc_set_mode(enum clock_event_mode mode,
38 struct clock_event_device *evt)
39{
40 unsigned long tc32irq;
41
42 switch (mode) {
43 case CLOCK_EVT_MODE_ONESHOT:
44 tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS);
45 tc32irq |= TC32IRQ_IRQEN0;
46 __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS);
47 break;
48 case CLOCK_EVT_MODE_SHUTDOWN:
49 case CLOCK_EVT_MODE_UNUSED:
50 tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS);
51 tc32irq &= ~TC32IRQ_IRQEN0;
52 __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS);
53 break;
54 case CLOCK_EVT_MODE_PERIODIC:
55 case CLOCK_EVT_MODE_RESUME:
56 break;
57 }
58}
59
60static irqreturn_t tcc8k_timer_interrupt(int irq, void *dev_id)
61{
62 struct clock_event_device *evt = dev_id;
63
64 /* Acknowledge TC32 interrupt by reading TC32IRQ */
65 __raw_readl(timer_base + TC32IRQ_OFFS);
66
67 evt->event_handler(evt);
68
69 return IRQ_HANDLED;
70}
71
72static struct clock_event_device clockevent_tcc = {
73 .name = "tcc_timer1",
74 .features = CLOCK_EVT_FEAT_ONESHOT,
75 .shift = 32,
76 .set_mode = tcc_set_mode,
77 .set_next_event = tcc_set_next_event,
78 .rating = 200,
79};
80
81static struct irqaction tcc8k_timer_irq = {
82 .name = "TC32_timer",
83 .flags = IRQF_DISABLED | IRQF_TIMER,
84 .handler = tcc8k_timer_interrupt,
85 .dev_id = &clockevent_tcc,
86};
87
88static int __init tcc_clockevent_init(struct clk *clock)
89{
90 unsigned int c = clk_get_rate(clock);
91
92 clocksource_mmio_init(timer_base + TC32MCNT_OFFS, "tcc_tc32", c,
93 200, 32, clocksource_mmio_readl_up);
94
95 clockevent_tcc.mult = div_sc(c, NSEC_PER_SEC,
96 clockevent_tcc.shift);
97 clockevent_tcc.max_delta_ns =
98 clockevent_delta2ns(0xfffffffe, &clockevent_tcc);
99 clockevent_tcc.min_delta_ns =
100 clockevent_delta2ns(0xff, &clockevent_tcc);
101
102 clockevent_tcc.cpumask = cpumask_of(0);
103
104 clockevents_register_device(&clockevent_tcc);
105
106 return 0;
107}
108
109void __init tcc8k_timer_init(struct clk *clock, void __iomem *base, int irq)
110{
111 u32 reg;
112
113 timer_base = base;
114 tcc8k_timer_irq.irq = irq;
115
116 /* Enable clocks */
117 clk_enable(clock);
118
119 /* Initialize 32-bit timer */
120 reg = __raw_readl(timer_base + TC32EN_OFFS);
121 reg &= ~TC32EN_ENABLE; /* Disable timer */
122 __raw_writel(reg, timer_base + TC32EN_OFFS);
123 /* Free running timer, counting from 0 to 0xffffffff */
124 __raw_writel(0, timer_base + TC32EN_OFFS);
125 __raw_writel(0, timer_base + TC32LDV_OFFS);
126 reg = __raw_readl(timer_base + TC32IRQ_OFFS);
127 reg |= TC32IRQ_IRQEN0; /* irq at match with CMP0 */
128 __raw_writel(reg, timer_base + TC32IRQ_OFFS);
129
130 __raw_writel(TC32EN_ENABLE, timer_base + TC32EN_OFFS);
131
132 tcc_clockevent_init(clock);
133 setup_irq(irq, &tcc8k_timer_irq);
134}
diff --git a/arch/arm/mach-tegra/board-dt.c b/arch/arm/mach-tegra/board-dt.c
index 74743ad3d2d3..e417a8383dbb 100644
--- a/arch/arm/mach-tegra/board-dt.c
+++ b/arch/arm/mach-tegra/board-dt.c
@@ -32,6 +32,7 @@
32#include <linux/i2c.h> 32#include <linux/i2c.h>
33#include <linux/i2c-tegra.h> 33#include <linux/i2c-tegra.h>
34 34
35#include <asm/hardware/gic.h>
35#include <asm/mach-types.h> 36#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
37#include <asm/mach/time.h> 38#include <asm/mach/time.h>
@@ -130,7 +131,9 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra (Flattened Device Tree)")
130 .map_io = tegra_map_common_io, 131 .map_io = tegra_map_common_io,
131 .init_early = tegra_init_early, 132 .init_early = tegra_init_early,
132 .init_irq = tegra_init_irq, 133 .init_irq = tegra_init_irq,
134 .handle_irq = gic_handle_irq,
133 .timer = &tegra_timer, 135 .timer = &tegra_timer,
134 .init_machine = tegra_dt_init, 136 .init_machine = tegra_dt_init,
137 .restart = tegra_assert_system_reset,
135 .dt_compat = tegra_dt_board_compat, 138 .dt_compat = tegra_dt_board_compat,
136MACHINE_END 139MACHINE_END
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index f0bdc5e3fe52..70ee674131f9 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -31,6 +31,7 @@
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33#include <asm/mach/time.h> 33#include <asm/mach/time.h>
34#include <asm/hardware/gic.h>
34#include <asm/setup.h> 35#include <asm/setup.h>
35 36
36#include <mach/tegra_wm8903_pdata.h> 37#include <mach/tegra_wm8903_pdata.h>
@@ -187,6 +188,8 @@ MACHINE_START(HARMONY, "harmony")
187 .map_io = tegra_map_common_io, 188 .map_io = tegra_map_common_io,
188 .init_early = tegra_init_early, 189 .init_early = tegra_init_early,
189 .init_irq = tegra_init_irq, 190 .init_irq = tegra_init_irq,
191 .handle_irq = gic_handle_irq,
190 .timer = &tegra_timer, 192 .timer = &tegra_timer,
191 .init_machine = tegra_harmony_init, 193 .init_machine = tegra_harmony_init,
194 .restart = tegra_assert_system_reset,
192MACHINE_END 195MACHINE_END
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
index 55c55ba89f1e..33d6205ad307 100644
--- a/arch/arm/mach-tegra/board-paz00.c
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -29,6 +29,7 @@
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/rfkill-gpio.h> 30#include <linux/rfkill-gpio.h>
31 31
32#include <asm/hardware/gic.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <asm/mach/time.h> 35#include <asm/mach/time.h>
@@ -190,6 +191,8 @@ MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
190 .map_io = tegra_map_common_io, 191 .map_io = tegra_map_common_io,
191 .init_early = tegra_init_early, 192 .init_early = tegra_init_early,
192 .init_irq = tegra_init_irq, 193 .init_irq = tegra_init_irq,
194 .handle_irq = gic_handle_irq,
193 .timer = &tegra_timer, 195 .timer = &tegra_timer,
194 .init_machine = tegra_paz00_init, 196 .init_machine = tegra_paz00_init,
197 .restart = tegra_assert_system_reset,
195MACHINE_END 198MACHINE_END
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index bf13ea355efc..c1599eb8e0cb 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -34,6 +34,7 @@
34 34
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
37#include <asm/hardware/gic.h>
37 38
38#include "board.h" 39#include "board.h"
39#include "board-seaboard.h" 40#include "board-seaboard.h"
@@ -284,8 +285,10 @@ MACHINE_START(SEABOARD, "seaboard")
284 .map_io = tegra_map_common_io, 285 .map_io = tegra_map_common_io,
285 .init_early = tegra_init_early, 286 .init_early = tegra_init_early,
286 .init_irq = tegra_init_irq, 287 .init_irq = tegra_init_irq,
288 .handle_irq = gic_handle_irq,
287 .timer = &tegra_timer, 289 .timer = &tegra_timer,
288 .init_machine = tegra_seaboard_init, 290 .init_machine = tegra_seaboard_init,
291 .restart = tegra_assert_system_reset,
289MACHINE_END 292MACHINE_END
290 293
291MACHINE_START(KAEN, "kaen") 294MACHINE_START(KAEN, "kaen")
@@ -293,8 +296,10 @@ MACHINE_START(KAEN, "kaen")
293 .map_io = tegra_map_common_io, 296 .map_io = tegra_map_common_io,
294 .init_early = tegra_init_early, 297 .init_early = tegra_init_early,
295 .init_irq = tegra_init_irq, 298 .init_irq = tegra_init_irq,
299 .handle_irq = gic_handle_irq,
296 .timer = &tegra_timer, 300 .timer = &tegra_timer,
297 .init_machine = tegra_kaen_init, 301 .init_machine = tegra_kaen_init,
302 .restart = tegra_assert_system_reset,
298MACHINE_END 303MACHINE_END
299 304
300MACHINE_START(WARIO, "wario") 305MACHINE_START(WARIO, "wario")
@@ -302,6 +307,8 @@ MACHINE_START(WARIO, "wario")
302 .map_io = tegra_map_common_io, 307 .map_io = tegra_map_common_io,
303 .init_early = tegra_init_early, 308 .init_early = tegra_init_early,
304 .init_irq = tegra_init_irq, 309 .init_irq = tegra_init_irq,
310 .handle_irq = gic_handle_irq,
305 .timer = &tegra_timer, 311 .timer = &tegra_timer,
306 .init_machine = tegra_wario_init, 312 .init_machine = tegra_wario_init,
313 .restart = tegra_assert_system_reset,
307MACHINE_END 314MACHINE_END
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index 1a6617b7806f..c242314a1db5 100644
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -26,6 +26,7 @@
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28 28
29#include <asm/hardware/gic.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/setup.h> 32#include <asm/setup.h>
@@ -176,6 +177,8 @@ MACHINE_START(TRIMSLICE, "trimslice")
176 .map_io = tegra_map_common_io, 177 .map_io = tegra_map_common_io,
177 .init_early = tegra_init_early, 178 .init_early = tegra_init_early,
178 .init_irq = tegra_init_irq, 179 .init_irq = tegra_init_irq,
180 .handle_irq = gic_handle_irq,
179 .timer = &tegra_timer, 181 .timer = &tegra_timer,
180 .init_machine = tegra_trimslice_init, 182 .init_machine = tegra_trimslice_init,
183 .restart = tegra_assert_system_reset,
181MACHINE_END 184MACHINE_END
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 690b888be506..20f396d740fa 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -31,8 +31,6 @@
31#include "clock.h" 31#include "clock.h"
32#include "fuse.h" 32#include "fuse.h"
33 33
34void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;
35
36void tegra_assert_system_reset(char mode, const char *cmd) 34void tegra_assert_system_reset(char mode, const char *cmd)
37{ 35{
38 void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04); 36 void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
diff --git a/arch/arm/mach-tegra/include/mach/entry-macro.S b/arch/arm/mach-tegra/include/mach/entry-macro.S
index dd165c53889d..ac11262149c7 100644
--- a/arch/arm/mach-tegra/include/mach/entry-macro.S
+++ b/arch/arm/mach-tegra/include/mach/entry-macro.S
@@ -12,30 +12,15 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 */ 14 */
15#include <mach/iomap.h>
16#include <mach/io.h>
17
18#if defined(CONFIG_ARM_GIC)
19#define HAVE_GET_IRQNR_PREAMBLE
20#include <asm/hardware/entry-macro-gic.S>
21
22 /* Uses the GIC interrupt controller built into the cpu */
23#define ICTRL_BASE (IO_CPU_VIRT + 0x100)
24 15
25 .macro disable_fiq 16 .macro disable_fiq
26 .endm 17 .endm
27 18
28 .macro get_irqnr_preamble, base, tmp 19 .macro arch_ret_to_user, tmp1, tmp2
29 movw \base, #(ICTRL_BASE & 0x0000ffff)
30 movt \base, #((ICTRL_BASE & 0xffff0000) >> 16)
31 .endm 20 .endm
32 21
33 .macro arch_ret_to_user, tmp1, tmp2 22#if !defined(CONFIG_ARM_GIC)
34 .endm
35#else
36 /* legacy interrupt controller for AP16 */ 23 /* legacy interrupt controller for AP16 */
37 .macro disable_fiq
38 .endm
39 24
40 .macro get_irqnr_preamble, base, tmp 25 .macro get_irqnr_preamble, base, tmp
41 @ enable imprecise aborts 26 @ enable imprecise aborts
@@ -46,9 +31,6 @@
46 orr \base, #0x0000f000 31 orr \base, #0x0000f000
47 .endm 32 .endm
48 33
49 .macro arch_ret_to_user, tmp1, tmp2
50 .endm
51
52 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 34 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
53 ldr \irqnr, [\base, #0x20] @ EVT_IRQ_STS 35 ldr \irqnr, [\base, #0x20] @ EVT_IRQ_STS
54 cmp \irqnr, #0x80 36 cmp \irqnr, #0x80
diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h
index 35a011fbc42d..f15defffb5d2 100644
--- a/arch/arm/mach-tegra/include/mach/io.h
+++ b/arch/arm/mach-tegra/include/mach/io.h
@@ -71,12 +71,6 @@
71 71
72#ifndef __ASSEMBLER__ 72#ifndef __ASSEMBLER__
73 73
74#define __arch_ioremap tegra_ioremap
75#define __arch_iounmap tegra_iounmap
76
77void __iomem *tegra_ioremap(unsigned long phys, size_t size, unsigned int type);
78void tegra_iounmap(volatile void __iomem *addr);
79
80#define IO_ADDRESS(n) (IO_TO_VIRT(n)) 74#define IO_ADDRESS(n) (IO_TO_VIRT(n))
81 75
82#ifdef CONFIG_TEGRA_PCI 76#ifdef CONFIG_TEGRA_PCI
diff --git a/arch/arm/mach-tegra/include/mach/system.h b/arch/arm/mach-tegra/include/mach/system.h
index 027c4215d313..a312988bf6f8 100644
--- a/arch/arm/mach-tegra/include/mach/system.h
+++ b/arch/arm/mach-tegra/include/mach/system.h
@@ -21,10 +21,6 @@
21#ifndef __MACH_TEGRA_SYSTEM_H 21#ifndef __MACH_TEGRA_SYSTEM_H
22#define __MACH_TEGRA_SYSTEM_H 22#define __MACH_TEGRA_SYSTEM_H
23 23
24#include <mach/iomap.h>
25
26extern void (*arch_reset)(char mode, const char *cmd);
27
28static inline void arch_idle(void) 24static inline void arch_idle(void)
29{ 25{
30} 26}
diff --git a/arch/arm/mach-tegra/include/mach/vmalloc.h b/arch/arm/mach-tegra/include/mach/vmalloc.h
deleted file mode 100644
index fd6aa65b2dc6..000000000000
--- a/arch/arm/mach-tegra/include/mach/vmalloc.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 * Erik Gilling <konkers@google.com>
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 */
20
21#ifndef __MACH_TEGRA_VMALLOC_H
22#define __MACH_TEGRA_VMALLOC_H
23
24#include <asm/sizes.h>
25
26#define VMALLOC_END 0xFE000000UL
27
28#endif
diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c
index 5489f8b5d6ad..d23ee2db2827 100644
--- a/arch/arm/mach-tegra/io.c
+++ b/arch/arm/mach-tegra/io.c
@@ -60,24 +60,3 @@ void __init tegra_map_common_io(void)
60{ 60{
61 iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc)); 61 iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc));
62} 62}
63
64/*
65 * Intercept ioremap() requests for addresses in our fixed mapping regions.
66 */
67void __iomem *tegra_ioremap(unsigned long p, size_t size, unsigned int type)
68{
69 void __iomem *v = IO_ADDRESS(p);
70 if (v == NULL)
71 v = __arm_ioremap(p, size, type);
72 return v;
73}
74EXPORT_SYMBOL(tegra_ioremap);
75
76void tegra_iounmap(volatile void __iomem *addr)
77{
78 unsigned long virt = (unsigned long)addr;
79
80 if (virt >= VMALLOC_START && virt < VMALLOC_END)
81 __iounmap(addr);
82}
83EXPORT_SYMBOL(tegra_iounmap);
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index e2272d263a83..732c724008b1 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -19,7 +19,6 @@
19 19
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/sched.h>
23#include <linux/time.h> 22#include <linux/time.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/irq.h> 24#include <linux/irq.h>
@@ -106,25 +105,9 @@ static struct clock_event_device tegra_clockevent = {
106 .set_mode = tegra_timer_set_mode, 105 .set_mode = tegra_timer_set_mode,
107}; 106};
108 107
109static DEFINE_CLOCK_DATA(cd); 108static u32 notrace tegra_read_sched_clock(void)
110
111/*
112 * Constants generated by clocks_calc_mult_shift(m, s, 1MHz, NSEC_PER_SEC, 60).
113 * This gives a resolution of about 1us and a wrap period of about 1h11min.
114 */
115#define SC_MULT 4194304000u
116#define SC_SHIFT 22
117
118unsigned long long notrace sched_clock(void)
119{
120 u32 cyc = timer_readl(TIMERUS_CNTR_1US);
121 return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
122}
123
124static void notrace tegra_update_sched_clock(void)
125{ 109{
126 u32 cyc = timer_readl(TIMERUS_CNTR_1US); 110 return timer_readl(TIMERUS_CNTR_1US);
127 update_sched_clock(&cd, cyc, (u32)~0);
128} 111}
129 112
130/* 113/*
@@ -218,8 +201,7 @@ static void __init tegra_init_timer(void)
218 WARN(1, "Unknown clock rate"); 201 WARN(1, "Unknown clock rate");
219 } 202 }
220 203
221 init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32, 204 setup_sched_clock(tegra_read_sched_clock, 32, 1000000);
222 1000000, SC_MULT, SC_SHIFT);
223 205
224 if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US, 206 if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US,
225 "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) { 207 "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) {
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index ac0791e924bc..697930761b3e 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -1888,3 +1888,23 @@ static int core_module_init(void)
1888 return mmc_init(&mmcsd_device); 1888 return mmc_init(&mmcsd_device);
1889} 1889}
1890module_init(core_module_init); 1890module_init(core_module_init);
1891
1892/* Forward declare this function from the watchdog */
1893void coh901327_watchdog_reset(void);
1894
1895void u300_restart(char mode, const char *cmd)
1896{
1897 switch (mode) {
1898 case 's':
1899 case 'h':
1900#ifdef CONFIG_COH901327_WATCHDOG
1901 coh901327_watchdog_reset();
1902#endif
1903 break;
1904 default:
1905 /* Do nothing */
1906 break;
1907 }
1908 /* Wait for system do die/reset. */
1909 while (1);
1910}
diff --git a/arch/arm/mach-u300/include/mach/entry-macro.S b/arch/arm/mach-u300/include/mach/entry-macro.S
index 20731ae39d38..7181d6ac6651 100644
--- a/arch/arm/mach-u300/include/mach/entry-macro.S
+++ b/arch/arm/mach-u300/include/mach/entry-macro.S
@@ -8,33 +8,9 @@
8 * Low-level IRQ helper macros for ST-Ericsson U300 8 * Low-level IRQ helper macros for ST-Ericsson U300
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */ 10 */
11#include <mach/hardware.h>
12#include <asm/hardware/vic.h>
13 11
14 .macro disable_fiq 12 .macro disable_fiq
15 .endm 13 .endm
16 14
17 .macro get_irqnr_preamble, base, tmp
18 .endm
19
20 .macro arch_ret_to_user, tmp1, tmp2 15 .macro arch_ret_to_user, tmp1, tmp2
21 .endm 16 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 ldr \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON0_BASE
25 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
26 mov \irqnr, #0
27 teq \irqstat, #0
28 bne 1002f
291001: ldr \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON1_BASE
30 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
31 mov \irqnr, #32
32 teq \irqstat, #0
33 beq 1003f
341002: tst \irqstat, #1
35 bne 1003f
36 add \irqnr, \irqnr, #1
37 movs \irqstat, \irqstat, lsr #1
38 bne 1002b
391003: /* EQ will be set if no irqs pending */
40 .endm
diff --git a/arch/arm/mach-u300/include/mach/platform.h b/arch/arm/mach-u300/include/mach/platform.h
index 77d9210a82e2..096333f32fc3 100644
--- a/arch/arm/mach-u300/include/mach/platform.h
+++ b/arch/arm/mach-u300/include/mach/platform.h
@@ -14,6 +14,7 @@
14void u300_map_io(void); 14void u300_map_io(void);
15void u300_init_irq(void); 15void u300_init_irq(void);
16void u300_init_devices(void); 16void u300_init_devices(void);
17void u300_restart(char, const char *);
17extern struct sys_timer u300_timer; 18extern struct sys_timer u300_timer;
18 19
19#endif 20#endif
diff --git a/arch/arm/mach-u300/include/mach/system.h b/arch/arm/mach-u300/include/mach/system.h
index 8daf13634ce0..574d46e38290 100644
--- a/arch/arm/mach-u300/include/mach/system.h
+++ b/arch/arm/mach-u300/include/mach/system.h
@@ -8,35 +8,7 @@
8 * System shutdown and reset functions. 8 * System shutdown and reset functions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */ 10 */
11#include <mach/hardware.h>
12#include <asm/io.h>
13#include <asm/hardware/vic.h>
14#include <asm/irq.h>
15
16/* Forward declare this function from the watchdog */
17void coh901327_watchdog_reset(void);
18
19static inline void arch_idle(void) 11static inline void arch_idle(void)
20{ 12{
21 cpu_do_idle(); 13 cpu_do_idle();
22} 14}
23
24static void arch_reset(char mode, const char *cmd)
25{
26 switch (mode) {
27 case 's':
28 case 'h':
29 printk(KERN_CRIT "RESET: shutting down/rebooting system\n");
30 /* Disable interrupts */
31 local_irq_disable();
32#ifdef CONFIG_COH901327_WATCHDOG
33 coh901327_watchdog_reset();
34#endif
35 break;
36 default:
37 /* Do nothing */
38 break;
39 }
40 /* Wait for system do die/reset. */
41 while (1);
42}
diff --git a/arch/arm/mach-u300/include/mach/vmalloc.h b/arch/arm/mach-u300/include/mach/vmalloc.h
deleted file mode 100644
index ec423b92b81d..000000000000
--- a/arch/arm/mach-u300/include/mach/vmalloc.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/vmalloc.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Virtual memory allocations
9 * End must be above the I/O registers and on an even 2MiB boundary.
10 * Author: Linus Walleij <linus.walleij@stericsson.com>
11 */
12#define VMALLOC_END 0xfe800000UL
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 5f51bdeef0ef..bc1c7897e82d 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -9,7 +9,6 @@
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */ 10 */
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/sched.h>
13#include <linux/time.h> 12#include <linux/time.h>
14#include <linux/timex.h> 13#include <linux/timex.h>
15#include <linux/clockchips.h> 14#include <linux/clockchips.h>
@@ -337,18 +336,10 @@ static struct irqaction u300_timer_irq = {
337 * this wraps around for now, since it is just a relative time 336 * this wraps around for now, since it is just a relative time
338 * stamp. (Inspired by OMAP implementation.) 337 * stamp. (Inspired by OMAP implementation.)
339 */ 338 */
340static DEFINE_CLOCK_DATA(cd);
341 339
342unsigned long long notrace sched_clock(void) 340static u32 notrace u300_read_sched_clock(void)
343{ 341{
344 u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); 342 return readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
345 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
346}
347
348static void notrace u300_update_sched_clock(void)
349{
350 u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
351 update_sched_clock(&cd, cyc, (u32)~0);
352} 343}
353 344
354 345
@@ -366,7 +357,7 @@ static void __init u300_timer_init(void)
366 clk_enable(clk); 357 clk_enable(clk);
367 rate = clk_get_rate(clk); 358 rate = clk_get_rate(clk);
368 359
369 init_sched_clock(&cd, u300_update_sched_clock, 32, rate); 360 setup_sched_clock(u300_read_sched_clock, 32, rate);
370 361
371 /* 362 /*
372 * Disable the "OS" and "DD" timers - these are designed for Symbian! 363 * Disable the "OS" and "DD" timers - these are designed for Symbian!
diff --git a/arch/arm/mach-u300/u300.c b/arch/arm/mach-u300/u300.c
index 89422ee7f3a8..def45bda2932 100644
--- a/arch/arm/mach-u300/u300.c
+++ b/arch/arm/mach-u300/u300.c
@@ -19,6 +19,7 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <mach/platform.h> 21#include <mach/platform.h>
22#include <asm/hardware/vic.h>
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <asm/memory.h> 25#include <asm/memory.h>
@@ -49,6 +50,8 @@ MACHINE_START(U300, MACH_U300_STRING)
49 .atag_offset = BOOT_PARAMS_OFFSET, 50 .atag_offset = BOOT_PARAMS_OFFSET,
50 .map_io = u300_map_io, 51 .map_io = u300_map_io,
51 .init_irq = u300_init_irq, 52 .init_irq = u300_init_irq,
53 .handle_irq = vic_handle_irq,
52 .timer = &u300_timer, 54 .timer = &u300_timer,
53 .init_machine = u300_init_machine, 55 .init_machine = u300_init_machine,
56 .restart = u300_restart,
54MACHINE_END 57MACHINE_END
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index bdd7b80dd7ad..de1f5f8f7330 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -33,6 +33,7 @@
33#include <linux/leds.h> 33#include <linux/leds.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/hardware/gic.h>
36 37
37#include <plat/i2c.h> 38#include <plat/i2c.h>
38#include <plat/ste_dma40.h> 39#include <plat/ste_dma40.h>
@@ -695,6 +696,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
695 .init_irq = ux500_init_irq, 696 .init_irq = ux500_init_irq,
696 /* we re-use nomadik timer here */ 697 /* we re-use nomadik timer here */
697 .timer = &ux500_timer, 698 .timer = &ux500_timer,
699 .handle_irq = gic_handle_irq,
698 .init_machine = mop500_init_machine, 700 .init_machine = mop500_init_machine,
699MACHINE_END 701MACHINE_END
700 702
@@ -703,6 +705,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
703 .map_io = u8500_map_io, 705 .map_io = u8500_map_io,
704 .init_irq = ux500_init_irq, 706 .init_irq = ux500_init_irq,
705 .timer = &ux500_timer, 707 .timer = &ux500_timer,
708 .handle_irq = gic_handle_irq,
706 .init_machine = hrefv60_init_machine, 709 .init_machine = hrefv60_init_machine,
707MACHINE_END 710MACHINE_END
708 711
@@ -712,5 +715,6 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
712 .init_irq = ux500_init_irq, 715 .init_irq = ux500_init_irq,
713 /* we re-use nomadik timer here */ 716 /* we re-use nomadik timer here */
714 .timer = &ux500_timer, 717 .timer = &ux500_timer,
718 .handle_irq = gic_handle_irq,
715 .init_machine = snowball_init_machine, 719 .init_machine = snowball_init_machine,
716MACHINE_END 720MACHINE_END
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
index 82025ba70c03..fe1569b67c91 100644
--- a/arch/arm/mach-ux500/board-u5500.c
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -12,6 +12,7 @@
12#include <linux/i2c.h> 12#include <linux/i2c.h>
13#include <linux/mfd/ab5500/ab5500.h> 13#include <linux/mfd/ab5500/ab5500.h>
14 14
15#include <asm/hardware/gic.h>
15#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
16#include <asm/mach-types.h> 17#include <asm/mach-types.h>
17 18
@@ -149,5 +150,6 @@ MACHINE_START(U5500, "ST-Ericsson U5500 Platform")
149 .map_io = u5500_map_io, 150 .map_io = u5500_map_io,
150 .init_irq = ux500_init_irq, 151 .init_irq = ux500_init_irq,
151 .timer = &ux500_timer, 152 .timer = &ux500_timer,
153 .handle_irq = gic_handle_irq,
152 .init_machine = u5500_init_machine, 154 .init_machine = u5500_init_machine,
153MACHINE_END 155MACHINE_END
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c
index 9de1af008094..5323286b265e 100644
--- a/arch/arm/mach-ux500/cpu-db5500.c
+++ b/arch/arm/mach-ux500/cpu-db5500.c
@@ -30,12 +30,11 @@ static struct map_desc u5500_uart_io_desc[] __initdata = {
30}; 30};
31 31
32static struct map_desc u5500_io_desc[] __initdata = { 32static struct map_desc u5500_io_desc[] __initdata = {
33 __IO_DEV_DESC(U5500_GIC_CPU_BASE, SZ_4K), 33 /* SCU base also covers GIC CPU BASE and TWD with its 4K page */
34 __IO_DEV_DESC(U5500_SCU_BASE, SZ_4K),
34 __IO_DEV_DESC(U5500_GIC_DIST_BASE, SZ_4K), 35 __IO_DEV_DESC(U5500_GIC_DIST_BASE, SZ_4K),
35 __IO_DEV_DESC(U5500_L2CC_BASE, SZ_4K), 36 __IO_DEV_DESC(U5500_L2CC_BASE, SZ_4K),
36 __IO_DEV_DESC(U5500_TWD_BASE, SZ_4K),
37 __IO_DEV_DESC(U5500_MTU0_BASE, SZ_4K), 37 __IO_DEV_DESC(U5500_MTU0_BASE, SZ_4K),
38 __IO_DEV_DESC(U5500_SCU_BASE, SZ_4K),
39 __IO_DEV_DESC(U5500_BACKUPRAM0_BASE, SZ_8K), 38 __IO_DEV_DESC(U5500_BACKUPRAM0_BASE, SZ_8K),
40 39
41 __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K), 40 __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K),
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 13e8890a8b8a..7f2729c05db3 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -35,12 +35,11 @@ static struct map_desc u8500_uart_io_desc[] __initdata = {
35}; 35};
36 36
37static struct map_desc u8500_io_desc[] __initdata = { 37static struct map_desc u8500_io_desc[] __initdata = {
38 __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K), 38 /* SCU base also covers GIC CPU BASE and TWD with its 4K page */
39 __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
39 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), 40 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),
40 __IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K), 41 __IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K),
41 __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),
42 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), 42 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),
43 __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
44 __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K), 43 __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),
45 44
46 __IO_DEV_DESC(U8500_CLKRST1_BASE, SZ_4K), 45 __IO_DEV_DESC(U8500_CLKRST1_BASE, SZ_4K),
diff --git a/arch/arm/mach-ux500/include/mach/entry-macro.S b/arch/arm/mach-ux500/include/mach/entry-macro.S
index 071bba94f727..e16299e1020a 100644
--- a/arch/arm/mach-ux500/include/mach/entry-macro.S
+++ b/arch/arm/mach-ux500/include/mach/entry-macro.S
@@ -10,8 +10,6 @@
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13#include <mach/hardware.h>
14#include <asm/hardware/entry-macro-gic.S>
15 13
16 .macro disable_fiq 14 .macro disable_fiq
17 .endm 15 .endm
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h
index 7389df911b1a..c01ef66537f3 100644
--- a/arch/arm/mach-ux500/include/mach/gpio.h
+++ b/arch/arm/mach-ux500/include/mach/gpio.h
@@ -1,10 +1,5 @@
1#ifndef __ASM_ARCH_GPIO_H 1#ifndef __ASM_ARCH_GPIO_H
2#define __ASM_ARCH_GPIO_H 2#define __ASM_ARCH_GPIO_H
3 3
4/*
5 * 288 (#267 is the highest one actually hooked up) onchip GPIOs, plus enough
6 * room for a couple of GPIO expanders.
7 */
8#define ARCH_NR_GPIOS 350
9 4
10#endif /* __ASM_ARCH_GPIO_H */ 5#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-ux500/include/mach/system.h b/arch/arm/mach-ux500/include/mach/system.h
index c0cd8006f1a2..258e5c919c24 100644
--- a/arch/arm/mach-ux500/include/mach/system.h
+++ b/arch/arm/mach-ux500/include/mach/system.h
@@ -17,9 +17,4 @@ static inline void arch_idle(void)
17 cpu_do_idle(); 17 cpu_do_idle();
18} 18}
19 19
20static inline void arch_reset(char mode, const char *cmd)
21{
22 /* yet to be implemented - TODO */
23}
24
25#endif 20#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
index a4945cb41172..000000000000
--- a/arch/arm/mach-ux500/include/mach/vmalloc.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index e340a54251df..02b7b9303f3b 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -22,7 +22,6 @@
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/sysdev.h>
26#include <linux/interrupt.h> 25#include <linux/interrupt.h>
27#include <linux/irqdomain.h> 26#include <linux/irqdomain.h>
28#include <linux/of_address.h> 27#include <linux/of_address.h>
@@ -141,11 +140,6 @@ static struct map_desc versatile_io_desc[] __initdata = {
141 }, 140 },
142#ifdef CONFIG_MACH_VERSATILE_AB 141#ifdef CONFIG_MACH_VERSATILE_AB
143 { 142 {
144 .virtual = IO_ADDRESS(VERSATILE_GPIO0_BASE),
145 .pfn = __phys_to_pfn(VERSATILE_GPIO0_BASE),
146 .length = SZ_4K,
147 .type = MT_DEVICE
148 }, {
149 .virtual = IO_ADDRESS(VERSATILE_IB2_BASE), 143 .virtual = IO_ADDRESS(VERSATILE_IB2_BASE),
150 .pfn = __phys_to_pfn(VERSATILE_IB2_BASE), 144 .pfn = __phys_to_pfn(VERSATILE_IB2_BASE),
151 .length = SZ_64M, 145 .length = SZ_64M,
@@ -745,6 +739,19 @@ static void versatile_leds_event(led_event_t ledevt)
745} 739}
746#endif /* CONFIG_LEDS */ 740#endif /* CONFIG_LEDS */
747 741
742void versatile_restart(char mode, const char *cmd)
743{
744 void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
745 u32 val;
746
747 val = __raw_readl(sys + VERSATILE_SYS_RESETCTL_OFFSET);
748 val |= 0x105;
749
750 __raw_writel(0xa05f, sys + VERSATILE_SYS_LOCK_OFFSET);
751 __raw_writel(val, sys + VERSATILE_SYS_RESETCTL_OFFSET);
752 __raw_writel(0, sys + VERSATILE_SYS_LOCK_OFFSET);
753}
754
748/* Early initializations */ 755/* Early initializations */
749void __init versatile_init_early(void) 756void __init versatile_init_early(void)
750{ 757{
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h
index e01422700ebb..2ef2f555f315 100644
--- a/arch/arm/mach-versatile/core.h
+++ b/arch/arm/mach-versatile/core.h
@@ -30,6 +30,7 @@ extern void __init versatile_init_early(void);
30extern void __init versatile_init_irq(void); 30extern void __init versatile_init_irq(void);
31extern void __init versatile_map_io(void); 31extern void __init versatile_map_io(void);
32extern struct sys_timer versatile_timer; 32extern struct sys_timer versatile_timer;
33extern void versatile_restart(char, const char *);
33extern unsigned int mmc_status(struct device *dev); 34extern unsigned int mmc_status(struct device *dev);
34#ifdef CONFIG_OF 35#ifdef CONFIG_OF
35extern struct of_dev_auxdata versatile_auxdata_lookup[]; 36extern struct of_dev_auxdata versatile_auxdata_lookup[];
diff --git a/arch/arm/mach-versatile/include/mach/entry-macro.S b/arch/arm/mach-versatile/include/mach/entry-macro.S
index e6f7c1663160..b6f0dbf122ee 100644
--- a/arch/arm/mach-versatile/include/mach/entry-macro.S
+++ b/arch/arm/mach-versatile/include/mach/entry-macro.S
@@ -7,39 +7,9 @@
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <mach/hardware.h>
11#include <mach/platform.h>
12#include <asm/hardware/vic.h>
13 10
14 .macro disable_fiq 11 .macro disable_fiq
15 .endm 12 .endm
16 13
17 .macro get_irqnr_preamble, base, tmp
18 ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE)
19 .endm
20
21 .macro arch_ret_to_user, tmp1, tmp2 14 .macro arch_ret_to_user, tmp1, tmp2
22 .endm 15 .endm
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
26 mov \irqnr, #0
27 teq \irqstat, #0
28 beq 1003f
29
301001: tst \irqstat, #15
31 bne 1002f
32 add \irqnr, \irqnr, #4
33 movs \irqstat, \irqstat, lsr #4
34 bne 1001b
351002: tst \irqstat, #1
36 bne 1003f
37 add \irqnr, \irqnr, #1
38 movs \irqstat, \irqstat, lsr #1
39 bne 1002b
401003: /* EQ will be set if no irqs pending */
41
42@ clz \irqnr, \irqstat
43@1003: /* EQ will be set if we reach MAXIRQNUM */
44 .endm
45
diff --git a/arch/arm/mach-versatile/include/mach/system.h b/arch/arm/mach-versatile/include/mach/system.h
index 8ffc12a7cb25..f3fa347895f0 100644
--- a/arch/arm/mach-versatile/include/mach/system.h
+++ b/arch/arm/mach-versatile/include/mach/system.h
@@ -21,10 +21,6 @@
21#ifndef __ASM_ARCH_SYSTEM_H 21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H 22#define __ASM_ARCH_SYSTEM_H
23 23
24#include <linux/io.h>
25#include <mach/hardware.h>
26#include <mach/platform.h>
27
28static inline void arch_idle(void) 24static inline void arch_idle(void)
29{ 25{
30 /* 26 /*
@@ -34,16 +30,4 @@ static inline void arch_idle(void)
34 cpu_do_idle(); 30 cpu_do_idle();
35} 31}
36 32
37static inline void arch_reset(char mode, const char *cmd)
38{
39 u32 val;
40
41 val = __raw_readl(IO_ADDRESS(VERSATILE_SYS_RESETCTL)) & ~0x7;
42 val |= 0x105;
43
44 __raw_writel(0xa05f, IO_ADDRESS(VERSATILE_SYS_LOCK));
45 __raw_writel(val, IO_ADDRESS(VERSATILE_SYS_RESETCTL));
46 __raw_writel(0, IO_ADDRESS(VERSATILE_SYS_LOCK));
47}
48
49#endif 33#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
index 7d8e069ad51b..000000000000
--- a/arch/arm/mach-versatile/include/mach/vmalloc.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-versatile/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 * Copyright (C) 2000 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define VMALLOC_END 0xd8000000UL
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index fda4866703cd..98f65493177a 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -21,12 +21,12 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/sysdev.h>
25#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
26#include <linux/io.h> 25#include <linux/io.h>
27 26
28#include <mach/hardware.h> 27#include <mach/hardware.h>
29#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/hardware/vic.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31 31
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
@@ -39,6 +39,8 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
39 .map_io = versatile_map_io, 39 .map_io = versatile_map_io,
40 .init_early = versatile_init_early, 40 .init_early = versatile_init_early,
41 .init_irq = versatile_init_irq, 41 .init_irq = versatile_init_irq,
42 .handle_irq = vic_handle_irq,
42 .timer = &versatile_timer, 43 .timer = &versatile_timer,
43 .init_machine = versatile_init, 44 .init_machine = versatile_init,
45 .restart = versatile_restart,
44MACHINE_END 46MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c
index 54e037c090f5..ae5ad3c8f3dd 100644
--- a/arch/arm/mach-versatile/versatile_dt.c
+++ b/arch/arm/mach-versatile/versatile_dt.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/of_irq.h> 25#include <linux/of_irq.h>
26#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27#include <asm/hardware/vic.h>
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29 30
@@ -45,7 +46,9 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
45 .map_io = versatile_map_io, 46 .map_io = versatile_map_io,
46 .init_early = versatile_init_early, 47 .init_early = versatile_init_early,
47 .init_irq = versatile_init_irq, 48 .init_irq = versatile_init_irq,
49 .handle_irq = vic_handle_irq,
48 .timer = &versatile_timer, 50 .timer = &versatile_timer,
49 .init_machine = versatile_dt_init, 51 .init_machine = versatile_dt_init,
50 .dt_compat = versatile_dt_match, 52 .dt_compat = versatile_dt_match,
53 .restart = versatile_restart,
51MACHINE_END 54MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index feaf9cbe60f6..9581c197500c 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -21,13 +21,13 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/sysdev.h>
25#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 25#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 26#include <linux/amba/mmci.h>
28#include <linux/io.h> 27#include <linux/io.h>
29 28
30#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <asm/hardware/vic.h>
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33 33
@@ -107,6 +107,8 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
107 .map_io = versatile_map_io, 107 .map_io = versatile_map_io,
108 .init_early = versatile_init_early, 108 .init_early = versatile_init_early,
109 .init_irq = versatile_init_irq, 109 .init_irq = versatile_init_irq,
110 .handle_irq = vic_handle_irq,
110 .timer = &versatile_timer, 111 .timer = &versatile_timer,
111 .init_machine = versatile_pb_init, 112 .init_machine = versatile_pb_init,
113 .restart = versatile_restart,
112MACHINE_END 114MACHINE_END
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 931148487f0b..9b3d0fbaee72 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -8,5 +8,7 @@ config ARCH_VEXPRESS_CA9X4
8 select ARM_ERRATA_720789 8 select ARM_ERRATA_720789
9 select ARM_ERRATA_751472 9 select ARM_ERRATA_751472
10 select ARM_ERRATA_753970 10 select ARM_ERRATA_753970
11 select HAVE_SMP
12 select MIGHT_HAVE_CACHE_L2X0
11 13
12endmenu 14endmenu
diff --git a/arch/arm/mach-vexpress/include/mach/entry-macro.S b/arch/arm/mach-vexpress/include/mach/entry-macro.S
index 73c11297509e..a14f9e62ca92 100644
--- a/arch/arm/mach-vexpress/include/mach/entry-macro.S
+++ b/arch/arm/mach-vexpress/include/mach/entry-macro.S
@@ -1,5 +1,3 @@
1#include <asm/hardware/entry-macro-gic.S>
2
3 .macro disable_fiq 1 .macro disable_fiq
4 .endm 2 .endm
5 3
diff --git a/arch/arm/mach-vexpress/include/mach/system.h b/arch/arm/mach-vexpress/include/mach/system.h
index 899a4e628a4c..f653a8e265bd 100644
--- a/arch/arm/mach-vexpress/include/mach/system.h
+++ b/arch/arm/mach-vexpress/include/mach/system.h
@@ -30,8 +30,4 @@ static inline void arch_idle(void)
30 cpu_do_idle(); 30 cpu_do_idle();
31} 31}
32 32
33static inline void arch_reset(char mode, const char *cmd)
34{
35}
36
37#endif 33#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
index f43a36ef678b..000000000000
--- a/arch/arm/mach-vexpress/include/mach/vmalloc.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 * Copyright (C) 2000 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define VMALLOC_END 0xf8000000UL
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 1fafc3244607..b4a28ca0e50a 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -10,7 +10,7 @@
10#include <linux/ata_platform.h> 10#include <linux/ata_platform.h>
11#include <linux/smsc911x.h> 11#include <linux/smsc911x.h>
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <linux/sysdev.h> 13#include <linux/device.h>
14#include <linux/usb/isp1760.h> 14#include <linux/usb/isp1760.h>
15#include <linux/clkdev.h> 15#include <linux/clkdev.h>
16#include <linux/mtd/physmap.h> 16#include <linux/mtd/physmap.h>
@@ -23,6 +23,7 @@
23#include <asm/hardware/arm_timer.h> 23#include <asm/hardware/arm_timer.h>
24#include <asm/hardware/timer-sp.h> 24#include <asm/hardware/timer-sp.h>
25#include <asm/hardware/sp810.h> 25#include <asm/hardware/sp810.h>
26#include <asm/hardware/gic.h>
26 27
27#include <mach/ct-ca9x4.h> 28#include <mach/ct-ca9x4.h>
28#include <mach/motherboard.h> 29#include <mach/motherboard.h>
@@ -437,7 +438,6 @@ static void __init v2m_init(void)
437 amba_device_register(v2m_amba_devs[i], &iomem_resource); 438 amba_device_register(v2m_amba_devs[i], &iomem_resource);
438 439
439 pm_power_off = v2m_power_off; 440 pm_power_off = v2m_power_off;
440 arm_pm_restart = v2m_restart;
441 441
442 ct_desc->init_tile(); 442 ct_desc->init_tile();
443} 443}
@@ -448,5 +448,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
448 .init_early = v2m_init_early, 448 .init_early = v2m_init_early,
449 .init_irq = v2m_init_irq, 449 .init_irq = v2m_init_irq,
450 .timer = &v2m_timer, 450 .timer = &v2m_timer,
451 .handle_irq = gic_handle_irq,
451 .init_machine = v2m_init, 452 .init_machine = v2m_init,
453 .restart = v2m_restart,
452MACHINE_END 454MACHINE_END
diff --git a/arch/arm/mach-vt8500/include/mach/vmalloc.h b/arch/arm/mach-vt8500/include/mach/vmalloc.h
deleted file mode 100644
index 4642290ce416..000000000000
--- a/arch/arm/mach-vt8500/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END 0xd0000000UL
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c
index 0a235e502330..604e1db266e8 100644
--- a/arch/arm/mach-w90x900/cpu.c
+++ b/arch/arm/mach-w90x900/cpu.c
@@ -33,9 +33,11 @@
33#include <mach/regs-serial.h> 33#include <mach/regs-serial.h>
34#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
35#include <mach/regs-ebi.h> 35#include <mach/regs-ebi.h>
36#include <mach/regs-timer.h>
36 37
37#include "cpu.h" 38#include "cpu.h"
38#include "clock.h" 39#include "clock.h"
40#include "nuc9xx.h"
39 41
40/* Initial IO mappings */ 42/* Initial IO mappings */
41 43
@@ -222,3 +224,17 @@ void __init nuc900_init_clocks(void)
222 clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs)); 224 clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
223} 225}
224 226
227#define WTCR (TMR_BA + 0x1C)
228#define WTCLK (1 << 10)
229#define WTE (1 << 7)
230#define WTRE (1 << 1)
231
232void nuc9xx_restart(char mode, const char *cmd)
233{
234 if (mode == 's') {
235 /* Jump into ROM at address 0 */
236 soft_restart(0);
237 } else {
238 __raw_writel(WTE | WTRE | WTCLK, WTCR);
239 }
240}
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
index 7a1fa6adb7c3..5b0c38abacc1 100644
--- a/arch/arm/mach-w90x900/dev.c
+++ b/arch/arm/mach-w90x900/dev.c
@@ -422,7 +422,7 @@ struct platform_device nuc900_device_kpi = {
422 422
423/* LCD controller*/ 423/* LCD controller*/
424 424
425static struct nuc900fb_display __initdata nuc900_lcd_info[] = { 425static struct nuc900fb_display nuc900_lcd_info[] = {
426 /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */ 426 /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
427 [0] = { 427 [0] = {
428 .type = LCM_DCCS_VA_SRC_RGB565, 428 .type = LCM_DCCS_VA_SRC_RGB565,
@@ -445,7 +445,7 @@ static struct nuc900fb_display __initdata nuc900_lcd_info[] = {
445 }, 445 },
446}; 446};
447 447
448static struct nuc900fb_mach_info nuc900_fb_info __initdata = { 448static struct nuc900fb_mach_info nuc900_fb_info = {
449#if defined(CONFIG_GPM1040A0_320X240) 449#if defined(CONFIG_GPM1040A0_320X240)
450 .displays = &nuc900_lcd_info[0], 450 .displays = &nuc900_lcd_info[0],
451#else 451#else
diff --git a/arch/arm/mach-w90x900/include/mach/mfp.h b/arch/arm/mach-w90x900/include/mach/mfp.h
index 94c0e71617c6..23ef1f573abd 100644
--- a/arch/arm/mach-w90x900/include/mach/mfp.h
+++ b/arch/arm/mach-w90x900/include/mach/mfp.h
@@ -19,6 +19,7 @@
19extern void mfp_set_groupf(struct device *dev); 19extern void mfp_set_groupf(struct device *dev);
20extern void mfp_set_groupc(struct device *dev); 20extern void mfp_set_groupc(struct device *dev);
21extern void mfp_set_groupi(struct device *dev); 21extern void mfp_set_groupi(struct device *dev);
22extern void mfp_set_groupg(struct device *dev); 22extern void mfp_set_groupg(struct device *dev, const char *subname);
23extern void mfp_set_groupd(struct device *dev, const char *subname);
23 24
24#endif /* __ASM_ARCH_MFP_H */ 25#endif /* __ASM_ARCH_MFP_H */
diff --git a/arch/arm/mach-w90x900/include/mach/nuc900_spi.h b/arch/arm/mach-w90x900/include/mach/nuc900_spi.h
index bd94819e314f..2c4e0c128501 100644
--- a/arch/arm/mach-w90x900/include/mach/nuc900_spi.h
+++ b/arch/arm/mach-w90x900/include/mach/nuc900_spi.h
@@ -14,7 +14,7 @@
14#ifndef __ASM_ARCH_SPI_H 14#ifndef __ASM_ARCH_SPI_H
15#define __ASM_ARCH_SPI_H 15#define __ASM_ARCH_SPI_H
16 16
17extern void mfp_set_groupg(struct device *dev); 17extern void mfp_set_groupg(struct device *dev, const char *subname);
18 18
19struct nuc900_spi_info { 19struct nuc900_spi_info {
20 unsigned int num_cs; 20 unsigned int num_cs;
diff --git a/arch/arm/mach-w90x900/include/mach/system.h b/arch/arm/mach-w90x900/include/mach/system.h
index ce228bdc66dd..2aaeb9311619 100644
--- a/arch/arm/mach-w90x900/include/mach/system.h
+++ b/arch/arm/mach-w90x900/include/mach/system.h
@@ -14,28 +14,6 @@
14 * (at your option) any later version. 14 * (at your option) any later version.
15 * 15 *
16 */ 16 */
17
18#include <linux/io.h>
19#include <asm/proc-fns.h>
20#include <mach/map.h>
21#include <mach/regs-timer.h>
22
23#define WTCR (TMR_BA + 0x1C)
24#define WTCLK (1 << 10)
25#define WTE (1 << 7)
26#define WTRE (1 << 1)
27
28static void arch_idle(void) 17static void arch_idle(void)
29{ 18{
30} 19}
31
32static void arch_reset(char mode, const char *cmd)
33{
34 if (mode == 's') {
35 /* Jump into ROM at address 0 */
36 cpu_reset(0);
37 } else {
38 __raw_writel(WTE | WTRE | WTCLK, WTCR);
39 }
40}
41
diff --git a/arch/arm/mach-w90x900/include/mach/vmalloc.h b/arch/arm/mach-w90x900/include/mach/vmalloc.h
deleted file mode 100644
index b067e44500a4..000000000000
--- a/arch/arm/mach-w90x900/include/mach/vmalloc.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/vmalloc.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/vmalloc.h
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#ifndef __ASM_ARCH_VMALLOC_H
19#define __ASM_ARCH_VMALLOC_H
20
21#define VMALLOC_END (0xe0000000UL)
22
23#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c
index 7bf143c443f1..d66d43ae8df5 100644
--- a/arch/arm/mach-w90x900/irq.c
+++ b/arch/arm/mach-w90x900/irq.c
@@ -19,7 +19,7 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <asm/irq.h> 25#include <asm/irq.h>
@@ -28,6 +28,8 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/regs-irq.h> 29#include <mach/regs-irq.h>
30 30
31#include "nuc9xx.h"
32
31struct group_irq { 33struct group_irq {
32 unsigned long gpen; 34 unsigned long gpen;
33 unsigned int enabled; 35 unsigned int enabled;
diff --git a/arch/arm/mach-w90x900/mach-nuc910evb.c b/arch/arm/mach-w90x900/mach-nuc910evb.c
index 31c109018228..b4243e4f1565 100644
--- a/arch/arm/mach-w90x900/mach-nuc910evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc910evb.c
@@ -38,4 +38,5 @@ MACHINE_START(W90P910EVB, "W90P910EVB")
38 .init_irq = nuc900_init_irq, 38 .init_irq = nuc900_init_irq,
39 .init_machine = nuc910evb_init, 39 .init_machine = nuc910evb_init,
40 .timer = &nuc900_timer, 40 .timer = &nuc900_timer,
41 .restart = nuc9xx_restart,
41MACHINE_END 42MACHINE_END
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
index 4062e55a57d8..067d8f9166dc 100644
--- a/arch/arm/mach-w90x900/mach-nuc950evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc950evb.c
@@ -41,4 +41,5 @@ MACHINE_START(W90P950EVB, "W90P950EVB")
41 .init_irq = nuc900_init_irq, 41 .init_irq = nuc900_init_irq,
42 .init_machine = nuc950evb_init, 42 .init_machine = nuc950evb_init,
43 .timer = &nuc900_timer, 43 .timer = &nuc900_timer,
44 .restart = nuc9xx_restart,
44MACHINE_END 45MACHINE_END
diff --git a/arch/arm/mach-w90x900/mach-nuc960evb.c b/arch/arm/mach-w90x900/mach-nuc960evb.c
index 0ab9995d5b58..cbb3adc3db10 100644
--- a/arch/arm/mach-w90x900/mach-nuc960evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc960evb.c
@@ -38,4 +38,5 @@ MACHINE_START(W90N960EVB, "W90N960EVB")
38 .init_irq = nuc900_init_irq, 38 .init_irq = nuc900_init_irq,
39 .init_machine = nuc960evb_init, 39 .init_machine = nuc960evb_init,
40 .timer = &nuc900_timer, 40 .timer = &nuc900_timer,
41 .restart = nuc9xx_restart,
41MACHINE_END 42MACHINE_END
diff --git a/arch/arm/mach-w90x900/mfp.c b/arch/arm/mach-w90x900/mfp.c
index fb7fb627b1a5..9dd74612bb87 100644
--- a/arch/arm/mach-w90x900/mfp.c
+++ b/arch/arm/mach-w90x900/mfp.c
@@ -26,10 +26,8 @@
26#define REG_MFSEL (W90X900_VA_GCR + 0xC) 26#define REG_MFSEL (W90X900_VA_GCR + 0xC)
27 27
28#define GPSELF (0x01 << 1) 28#define GPSELF (0x01 << 1)
29
30#define GPSELC (0x03 << 2) 29#define GPSELC (0x03 << 2)
31#define ENKPI (0x02 << 2) 30#define GPSELD (0x0f << 4)
32#define ENNAND (0x01 << 2)
33 31
34#define GPSELEI0 (0x01 << 26) 32#define GPSELEI0 (0x01 << 26)
35#define GPSELEI1 (0x01 << 27) 33#define GPSELEI1 (0x01 << 27)
@@ -37,11 +35,16 @@
37#define GPIOG0TO1 (0x03 << 14) 35#define GPIOG0TO1 (0x03 << 14)
38#define GPIOG2TO3 (0x03 << 16) 36#define GPIOG2TO3 (0x03 << 16)
39#define GPIOG22TO23 (0x03 << 22) 37#define GPIOG22TO23 (0x03 << 22)
38#define GPIOG18TO20 (0x07 << 18)
40 39
41#define ENSPI (0x0a << 14) 40#define ENSPI (0x0a << 14)
42#define ENI2C0 (0x01 << 14) 41#define ENI2C0 (0x01 << 14)
43#define ENI2C1 (0x01 << 16) 42#define ENI2C1 (0x01 << 16)
44#define ENAC97 (0x02 << 22) 43#define ENAC97 (0x02 << 22)
44#define ENSD1 (0x02 << 18)
45#define ENSD0 (0x0a << 4)
46#define ENKPI (0x02 << 2)
47#define ENNAND (0x01 << 2)
45 48
46static DEFINE_MUTEX(mfp_mutex); 49static DEFINE_MUTEX(mfp_mutex);
47 50
@@ -127,16 +130,19 @@ void mfp_set_groupi(struct device *dev)
127} 130}
128EXPORT_SYMBOL(mfp_set_groupi); 131EXPORT_SYMBOL(mfp_set_groupi);
129 132
130void mfp_set_groupg(struct device *dev) 133void mfp_set_groupg(struct device *dev, const char *subname)
131{ 134{
132 unsigned long mfpen; 135 unsigned long mfpen;
133 const char *dev_id; 136 const char *dev_id;
134 137
135 BUG_ON(!dev); 138 BUG_ON((!dev) && (!subname));
136 139
137 mutex_lock(&mfp_mutex); 140 mutex_lock(&mfp_mutex);
138 141
139 dev_id = dev_name(dev); 142 if (subname != NULL)
143 dev_id = subname;
144 else
145 dev_id = dev_name(dev);
140 146
141 mfpen = __raw_readl(REG_MFSEL); 147 mfpen = __raw_readl(REG_MFSEL);
142 148
@@ -152,6 +158,9 @@ void mfp_set_groupg(struct device *dev)
152 } else if (strcmp(dev_id, "nuc900-audio") == 0) { 158 } else if (strcmp(dev_id, "nuc900-audio") == 0) {
153 mfpen &= ~(GPIOG22TO23); 159 mfpen &= ~(GPIOG22TO23);
154 mfpen |= ENAC97;/*enable AC97*/ 160 mfpen |= ENAC97;/*enable AC97*/
161 } else if (strcmp(dev_id, "nuc900-mmc-port1") == 0) {
162 mfpen &= ~(GPIOG18TO20);
163 mfpen |= (ENSD1 | 0x01);/*enable sd1*/
155 } else { 164 } else {
156 mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/ 165 mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/
157 } 166 }
@@ -162,3 +171,30 @@ void mfp_set_groupg(struct device *dev)
162} 171}
163EXPORT_SYMBOL(mfp_set_groupg); 172EXPORT_SYMBOL(mfp_set_groupg);
164 173
174void mfp_set_groupd(struct device *dev, const char *subname)
175{
176 unsigned long mfpen;
177 const char *dev_id;
178
179 BUG_ON((!dev) && (!subname));
180
181 mutex_lock(&mfp_mutex);
182
183 if (subname != NULL)
184 dev_id = subname;
185 else
186 dev_id = dev_name(dev);
187
188 mfpen = __raw_readl(REG_MFSEL);
189
190 if (strcmp(dev_id, "nuc900-mmc-port0") == 0) {
191 mfpen &= ~GPSELD;/*enable sd0*/
192 mfpen |= ENSD0;
193 } else
194 mfpen &= (~GPSELD);
195
196 __raw_writel(mfpen, REG_MFSEL);
197
198 mutex_unlock(&mfp_mutex);
199}
200EXPORT_SYMBOL(mfp_set_groupd);
diff --git a/arch/arm/mach-w90x900/nuc910.h b/arch/arm/mach-w90x900/nuc910.h
index 83e9ba5fc26c..b14c71a9e683 100644
--- a/arch/arm/mach-w90x900/nuc910.h
+++ b/arch/arm/mach-w90x900/nuc910.h
@@ -12,14 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 */ 14 */
15 15#include "nuc9xx.h"
16struct map_desc;
17struct sys_timer;
18
19/* core initialisation functions */
20
21extern void nuc900_init_irq(void);
22extern struct sys_timer nuc900_timer;
23 16
24/* extern file from nuc910.c */ 17/* extern file from nuc910.c */
25 18
diff --git a/arch/arm/mach-w90x900/nuc950.h b/arch/arm/mach-w90x900/nuc950.h
index 98a1148bc5ae..6e9de3051cd4 100644
--- a/arch/arm/mach-w90x900/nuc950.h
+++ b/arch/arm/mach-w90x900/nuc950.h
@@ -12,14 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 */ 14 */
15 15#include "nuc9xx.h"
16struct map_desc;
17struct sys_timer;
18
19/* core initialisation functions */
20
21extern void nuc900_init_irq(void);
22extern struct sys_timer nuc900_timer;
23 16
24/* extern file from nuc950.c */ 17/* extern file from nuc950.c */
25 18
diff --git a/arch/arm/mach-w90x900/nuc960.h b/arch/arm/mach-w90x900/nuc960.h
index f0c07cbe3a82..9f6df9a00286 100644
--- a/arch/arm/mach-w90x900/nuc960.h
+++ b/arch/arm/mach-w90x900/nuc960.h
@@ -12,14 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 */ 14 */
15 15#include "nuc9xx.h"
16struct map_desc;
17struct sys_timer;
18
19/* core initialisation functions */
20
21extern void nuc900_init_irq(void);
22extern struct sys_timer nuc900_timer;
23 16
24/* extern file from nuc960.c */ 17/* extern file from nuc960.c */
25 18
diff --git a/arch/arm/mach-w90x900/nuc9xx.h b/arch/arm/mach-w90x900/nuc9xx.h
new file mode 100644
index 000000000000..91acb4047793
--- /dev/null
+++ b/arch/arm/mach-w90x900/nuc9xx.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/mach-w90x900/nuc9xx.h
3 *
4 * Copied from nuc910.h, which had:
5 *
6 * Copyright (c) 2008 Nuvoton corporation
7 *
8 * Header file for NUC900 CPU support
9 *
10 * Wan ZongShun <mcuos.com@gmail.com>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 */
17struct map_desc;
18struct sys_timer;
19
20/* core initialisation functions */
21
22extern void nuc900_init_irq(void);
23extern struct sys_timer nuc900_timer;
24extern void nuc9xx_restart(char, const char *);
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
index a2c4e2d0a0d4..fa27c498ac09 100644
--- a/arch/arm/mach-w90x900/time.c
+++ b/arch/arm/mach-w90x900/time.c
@@ -33,6 +33,8 @@
33#include <mach/map.h> 33#include <mach/map.h>
34#include <mach/regs-timer.h> 34#include <mach/regs-timer.h>
35 35
36#include "nuc9xx.h"
37
36#define RESETINT 0x1f 38#define RESETINT 0x1f
37#define PERIOD (0x01 << 27) 39#define PERIOD (0x01 << 27)
38#define ONESHOT (0x00 << 27) 40#define ONESHOT (0x00 << 27)
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 73e93687b81a..ab5cfddc0d7b 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -112,6 +112,7 @@ static const char *xilinx_dt_match[] = {
112MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") 112MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
113 .map_io = xilinx_map_io, 113 .map_io = xilinx_map_io,
114 .init_irq = xilinx_irq_init, 114 .init_irq = xilinx_irq_init,
115 .handle_irq = gic_handle_irq,
115 .init_machine = xilinx_init_machine, 116 .init_machine = xilinx_init_machine,
116 .timer = &xttcpss_sys_timer, 117 .timer = &xttcpss_sys_timer,
117 .dt_compat = xilinx_dt_match, 118 .dt_compat = xilinx_dt_match,
diff --git a/arch/arm/mach-zynq/include/mach/entry-macro.S b/arch/arm/mach-zynq/include/mach/entry-macro.S
index 3cfc01b37461..d621fb732569 100644
--- a/arch/arm/mach-zynq/include/mach/entry-macro.S
+++ b/arch/arm/mach-zynq/include/mach/entry-macro.S
@@ -20,9 +20,6 @@
20 * GNU General Public License for more details. 20 * GNU General Public License for more details.
21 */ 21 */
22 22
23#include <mach/hardware.h>
24#include <asm/hardware/entry-macro-gic.S>
25
26 .macro disable_fiq 23 .macro disable_fiq
27 .endm 24 .endm
28 25
diff --git a/arch/arm/mach-zynq/include/mach/system.h b/arch/arm/mach-zynq/include/mach/system.h
index 1b84d705c675..8e88e0b8d2ba 100644
--- a/arch/arm/mach-zynq/include/mach/system.h
+++ b/arch/arm/mach-zynq/include/mach/system.h
@@ -20,9 +20,4 @@ static inline void arch_idle(void)
20 cpu_do_idle(); 20 cpu_do_idle();
21} 21}
22 22
23static inline void arch_reset(char mode, const char *cmd)
24{
25 /* Add architecture specific reset processing here */
26}
27
28#endif 23#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
index 2398eff1e8b8..000000000000
--- a/arch/arm/mach-zynq/include/mach/vmalloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/* arch/arm/mach-zynq/include/mach/vmalloc.h
2 *
3 * Copyright (C) 2011 Xilinx
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef __MACH_VMALLOC_H__
16#define __MACH_VMALLOC_H__
17
18#define VMALLOC_END 0xE0000000UL
19
20#endif
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 67f75a0b66d6..4cefb57d9ed2 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -629,6 +629,23 @@ config IO_36
629 629
630comment "Processor Features" 630comment "Processor Features"
631 631
632config ARM_LPAE
633 bool "Support for the Large Physical Address Extension"
634 depends on MMU && CPU_V7
635 help
636 Say Y if you have an ARMv7 processor supporting the LPAE page
637 table format and you would like to access memory beyond the
638 4GB limit. The resulting kernel image will not run on
639 processors without the LPA extension.
640
641 If unsure, say N.
642
643config ARCH_PHYS_ADDR_T_64BIT
644 def_bool ARM_LPAE
645
646config ARCH_DMA_ADDR_T_64BIT
647 bool
648
632config ARM_THUMB 649config ARM_THUMB
633 bool "Support Thumb user binaries" 650 bool "Support Thumb user binaries"
634 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 651 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
@@ -816,14 +833,23 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
816 Say Y here to use the Feroceon L2 cache in writethrough mode. 833 Say Y here to use the Feroceon L2 cache in writethrough mode.
817 Unless you specifically require this, say N for writeback mode. 834 Unless you specifically require this, say N for writeback mode.
818 835
836config MIGHT_HAVE_CACHE_L2X0
837 bool
838 help
839 This option should be selected by machines which have a L2x0
840 or PL310 cache controller, but where its use is optional.
841
842 The only effect of this option is to make CACHE_L2X0 and
843 related options available to the user for configuration.
844
845 Boards or SoCs which always require the cache controller
846 support to be present should select CACHE_L2X0 directly
847 instead of this option, thus preventing the user from
848 inadvertently configuring a broken kernel.
849
819config CACHE_L2X0 850config CACHE_L2X0
820 bool "Enable the L2x0 outer cache controller" 851 bool "Enable the L2x0 outer cache controller" if MIGHT_HAVE_CACHE_L2X0
821 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 852 default MIGHT_HAVE_CACHE_L2X0
822 REALVIEW_EB_A9MP || ARCH_IMX_V6_V7 || MACH_REALVIEW_PBX || \
823 ARCH_NOMADIK || ARCH_OMAP4 || ARCH_EXYNOS4 || ARCH_TEGRA || \
824 ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE || \
825 ARCH_PRIMA2 || ARCH_ZYNQ || ARCH_CNS3XXX || ARCH_HIGHBANK
826 default y
827 select OUTER_CACHE 853 select OUTER_CACHE
828 select OUTER_CACHE_SYNC 854 select OUTER_CACHE_SYNC
829 help 855 help
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index c335c76e0d88..caf14dc059e5 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -968,7 +968,7 @@ static int __init alignment_init(void)
968 ai_usermode = safe_usermode(ai_usermode, false); 968 ai_usermode = safe_usermode(ai_usermode, false);
969 } 969 }
970 970
971 hook_fault_code(1, do_alignment, SIGBUS, BUS_ADRALN, 971 hook_fault_code(FAULT_CODE_ALIGNMENT, do_alignment, SIGBUS, BUS_ADRALN,
972 "alignment exception"); 972 "alignment exception");
973 973
974 /* 974 /*
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 8ac9e9f84790..b1e192ba8c24 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -61,7 +61,7 @@ static inline void cache_sync(void)
61{ 61{
62 void __iomem *base = l2x0_base; 62 void __iomem *base = l2x0_base;
63 63
64#ifdef CONFIG_ARM_ERRATA_753970 64#ifdef CONFIG_PL310_ERRATA_753970
65 /* write to an unmmapped register */ 65 /* write to an unmmapped register */
66 writel_relaxed(0, base + L2X0_DUMMY_REG); 66 writel_relaxed(0, base + L2X0_DUMMY_REG);
67#else 67#else
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 93aac068da94..ee9bb363d606 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -22,6 +22,21 @@ unsigned int cpu_last_asid = ASID_FIRST_VERSION;
22DEFINE_PER_CPU(struct mm_struct *, current_mm); 22DEFINE_PER_CPU(struct mm_struct *, current_mm);
23#endif 23#endif
24 24
25#ifdef CONFIG_ARM_LPAE
26#define cpu_set_asid(asid) { \
27 unsigned long ttbl, ttbh; \
28 asm volatile( \
29 " mrrc p15, 0, %0, %1, c2 @ read TTBR0\n" \
30 " mov %1, %2, lsl #(48 - 32) @ set ASID\n" \
31 " mcrr p15, 0, %0, %1, c2 @ set TTBR0\n" \
32 : "=&r" (ttbl), "=&r" (ttbh) \
33 : "r" (asid & ~ASID_MASK)); \
34}
35#else
36#define cpu_set_asid(asid) \
37 asm(" mcr p15, 0, %0, c13, c0, 1\n" : : "r" (asid))
38#endif
39
25/* 40/*
26 * We fork()ed a process, and we need a new context for the child 41 * We fork()ed a process, and we need a new context for the child
27 * to run in. We reserve version 0 for initial tasks so we will 42 * 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)
37static void flush_context(void) 52static void flush_context(void)
38{ 53{
39 /* set the reserved ASID before flushing the TLB */ 54 /* set the reserved ASID before flushing the TLB */
40 asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (0)); 55 cpu_set_asid(0);
41 isb(); 56 isb();
42 local_flush_tlb_all(); 57 local_flush_tlb_all();
43 if (icache_is_vivt_asid_tagged()) { 58 if (icache_is_vivt_asid_tagged()) {
@@ -99,7 +114,7 @@ static void reset_context(void *info)
99 set_mm_context(mm, asid); 114 set_mm_context(mm, asid);
100 115
101 /* set the new ASID */ 116 /* set the new ASID */
102 asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (mm->context.id)); 117 cpu_set_asid(mm->context.id);
103 isb(); 118 isb();
104} 119}
105 120
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index e4e7f6cba1ab..1aa664a1999f 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -168,7 +168,7 @@ static int __init consistent_init(void)
168 pte_t *pte; 168 pte_t *pte;
169 int i = 0; 169 int i = 0;
170 unsigned long base = consistent_base; 170 unsigned long base = consistent_base;
171 unsigned long num_ptes = (CONSISTENT_END - base) >> PGDIR_SHIFT; 171 unsigned long num_ptes = (CONSISTENT_END - base) >> PMD_SHIFT;
172 172
173 consistent_pte = kmalloc(num_ptes * sizeof(pte_t), GFP_KERNEL); 173 consistent_pte = kmalloc(num_ptes * sizeof(pte_t), GFP_KERNEL);
174 if (!consistent_pte) { 174 if (!consistent_pte) {
@@ -332,6 +332,15 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
332 struct page *page; 332 struct page *page;
333 void *addr; 333 void *addr;
334 334
335 /*
336 * Following is a work-around (a.k.a. hack) to prevent pages
337 * with __GFP_COMP being passed to split_page() which cannot
338 * handle them. The real problem is that this flag probably
339 * should be 0 on ARM as it is not supported on this
340 * platform; see CONFIG_HUGETLBFS.
341 */
342 gfp &= ~(__GFP_COMP);
343
335 *handle = ~0; 344 *handle = ~0;
336 size = PAGE_ALIGN(size); 345 size = PAGE_ALIGN(size);
337 346
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index aa33949fef60..bb7eac381a8e 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -27,19 +27,6 @@
27 27
28#include "fault.h" 28#include "fault.h"
29 29
30/*
31 * Fault status register encodings. We steal bit 31 for our own purposes.
32 */
33#define FSR_LNX_PF (1 << 31)
34#define FSR_WRITE (1 << 11)
35#define FSR_FS4 (1 << 10)
36#define FSR_FS3_0 (15)
37
38static inline int fsr_fs(unsigned int fsr)
39{
40 return (fsr & FSR_FS3_0) | (fsr & FSR_FS4) >> 6;
41}
42
43#ifdef CONFIG_MMU 30#ifdef CONFIG_MMU
44 31
45#ifdef CONFIG_KPROBES 32#ifdef CONFIG_KPROBES
@@ -123,8 +110,10 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
123 110
124 pte = pte_offset_map(pmd, addr); 111 pte = pte_offset_map(pmd, addr);
125 printk(", *pte=%08llx", (long long)pte_val(*pte)); 112 printk(", *pte=%08llx", (long long)pte_val(*pte));
113#ifndef CONFIG_ARM_LPAE
126 printk(", *ppte=%08llx", 114 printk(", *ppte=%08llx",
127 (long long)pte_val(pte[PTE_HWTABLE_PTRS])); 115 (long long)pte_val(pte[PTE_HWTABLE_PTRS]));
116#endif
128 pte_unmap(pte); 117 pte_unmap(pte);
129 } while(0); 118 } while(0);
130 119
@@ -231,7 +220,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
231 220
232static int __kprobes 221static int __kprobes
233__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, 222__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
234 struct task_struct *tsk) 223 unsigned int flags, struct task_struct *tsk)
235{ 224{
236 struct vm_area_struct *vma; 225 struct vm_area_struct *vma;
237 int fault; 226 int fault;
@@ -253,18 +242,7 @@ good_area:
253 goto out; 242 goto out;
254 } 243 }
255 244
256 /* 245 return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags);
257 * If for any reason at all we couldn't handle the fault, make
258 * sure we exit gracefully rather than endlessly redo the fault.
259 */
260 fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, (fsr & FSR_WRITE) ? FAULT_FLAG_WRITE : 0);
261 if (unlikely(fault & VM_FAULT_ERROR))
262 return fault;
263 if (fault & VM_FAULT_MAJOR)
264 tsk->maj_flt++;
265 else
266 tsk->min_flt++;
267 return fault;
268 246
269check_stack: 247check_stack:
270 if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) 248 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)
279 struct task_struct *tsk; 257 struct task_struct *tsk;
280 struct mm_struct *mm; 258 struct mm_struct *mm;
281 int fault, sig, code; 259 int fault, sig, code;
260 int write = fsr & FSR_WRITE;
261 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
262 (write ? FAULT_FLAG_WRITE : 0);
282 263
283 if (notify_page_fault(regs, fsr)) 264 if (notify_page_fault(regs, fsr))
284 return 0; 265 return 0;
@@ -305,6 +286,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
305 if (!down_read_trylock(&mm->mmap_sem)) { 286 if (!down_read_trylock(&mm->mmap_sem)) {
306 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc)) 287 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
307 goto no_context; 288 goto no_context;
289retry:
308 down_read(&mm->mmap_sem); 290 down_read(&mm->mmap_sem);
309 } else { 291 } else {
310 /* 292 /*
@@ -320,14 +302,41 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
320#endif 302#endif
321 } 303 }
322 304
323 fault = __do_page_fault(mm, addr, fsr, tsk); 305 fault = __do_page_fault(mm, addr, fsr, flags, tsk);
324 up_read(&mm->mmap_sem); 306
307 /* If we need to retry but a fatal signal is pending, handle the
308 * signal first. We do not need to release the mmap_sem because
309 * it would already be released in __lock_page_or_retry in
310 * mm/filemap.c. */
311 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
312 return 0;
313
314 /*
315 * Major/minor page fault accounting is only done on the
316 * initial attempt. If we go through a retry, it is extremely
317 * likely that the page will be found in page cache at that point.
318 */
325 319
326 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr); 320 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
327 if (fault & VM_FAULT_MAJOR) 321 if (flags & FAULT_FLAG_ALLOW_RETRY) {
328 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, addr); 322 if (fault & VM_FAULT_MAJOR) {
329 else if (fault & VM_FAULT_MINOR) 323 tsk->maj_flt++;
330 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, addr); 324 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
325 regs, addr);
326 } else {
327 tsk->min_flt++;
328 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
329 regs, addr);
330 }
331 if (fault & VM_FAULT_RETRY) {
332 /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
333 * of starvation. */
334 flags &= ~FAULT_FLAG_ALLOW_RETRY;
335 goto retry;
336 }
337 }
338
339 up_read(&mm->mmap_sem);
331 340
332 /* 341 /*
333 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR 342 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
@@ -441,6 +450,12 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
441 pmd = pmd_offset(pud, addr); 450 pmd = pmd_offset(pud, addr);
442 pmd_k = pmd_offset(pud_k, addr); 451 pmd_k = pmd_offset(pud_k, addr);
443 452
453#ifdef CONFIG_ARM_LPAE
454 /*
455 * Only one hardware entry per PMD with LPAE.
456 */
457 index = 0;
458#else
444 /* 459 /*
445 * On ARM one Linux PGD entry contains two hardware entries (see page 460 * On ARM one Linux PGD entry contains two hardware entries (see page
446 * tables layout in pgtable.h). We normally guarantee that we always 461 * tables layout in pgtable.h). We normally guarantee that we always
@@ -450,6 +465,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
450 * for the first of pair. 465 * for the first of pair.
451 */ 466 */
452 index = (addr >> SECTION_SHIFT) & 1; 467 index = (addr >> SECTION_SHIFT) & 1;
468#endif
453 if (pmd_none(pmd_k[index])) 469 if (pmd_none(pmd_k[index]))
454 goto bad_area; 470 goto bad_area;
455 471
@@ -489,55 +505,20 @@ do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
489 return 1; 505 return 1;
490} 506}
491 507
492static struct fsr_info { 508struct fsr_info {
493 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs); 509 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
494 int sig; 510 int sig;
495 int code; 511 int code;
496 const char *name; 512 const char *name;
497} fsr_info[] = {
498 /*
499 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5
500 * defines these to be "precise" aborts.
501 */
502 { do_bad, SIGSEGV, 0, "vector exception" },
503 { do_bad, SIGBUS, BUS_ADRALN, "alignment exception" },
504 { do_bad, SIGKILL, 0, "terminal exception" },
505 { do_bad, SIGBUS, BUS_ADRALN, "alignment exception" },
506 { do_bad, SIGBUS, 0, "external abort on linefetch" },
507 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
508 { do_bad, SIGBUS, 0, "external abort on linefetch" },
509 { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
510 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
511 { do_bad, SIGSEGV, SEGV_ACCERR, "section domain fault" },
512 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
513 { do_bad, SIGSEGV, SEGV_ACCERR, "page domain fault" },
514 { do_bad, SIGBUS, 0, "external abort on translation" },
515 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "section permission fault" },
516 { do_bad, SIGBUS, 0, "external abort on translation" },
517 { do_page_fault, SIGSEGV, SEGV_ACCERR, "page permission fault" },
518 /*
519 * The following are "imprecise" aborts, which are signalled by bit
520 * 10 of the FSR, and may not be recoverable. These are only
521 * supported if the CPU abort handler supports bit 10.
522 */
523 { do_bad, SIGBUS, 0, "unknown 16" },
524 { do_bad, SIGBUS, 0, "unknown 17" },
525 { do_bad, SIGBUS, 0, "unknown 18" },
526 { do_bad, SIGBUS, 0, "unknown 19" },
527 { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
528 { do_bad, SIGBUS, 0, "unknown 21" },
529 { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
530 { do_bad, SIGBUS, 0, "unknown 23" },
531 { do_bad, SIGBUS, 0, "dcache parity error" }, /* xscale */
532 { do_bad, SIGBUS, 0, "unknown 25" },
533 { do_bad, SIGBUS, 0, "unknown 26" },
534 { do_bad, SIGBUS, 0, "unknown 27" },
535 { do_bad, SIGBUS, 0, "unknown 28" },
536 { do_bad, SIGBUS, 0, "unknown 29" },
537 { do_bad, SIGBUS, 0, "unknown 30" },
538 { do_bad, SIGBUS, 0, "unknown 31" }
539}; 513};
540 514
515/* FSR definition */
516#ifdef CONFIG_ARM_LPAE
517#include "fsr-3level.c"
518#else
519#include "fsr-2level.c"
520#endif
521
541void __init 522void __init
542hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *), 523hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
543 int sig, int code, const char *name) 524 int sig, int code, const char *name)
@@ -573,42 +554,6 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
573 arm_notify_die("", regs, &info, fsr, 0); 554 arm_notify_die("", regs, &info, fsr, 0);
574} 555}
575 556
576
577static struct fsr_info ifsr_info[] = {
578 { do_bad, SIGBUS, 0, "unknown 0" },
579 { do_bad, SIGBUS, 0, "unknown 1" },
580 { do_bad, SIGBUS, 0, "debug event" },
581 { do_bad, SIGSEGV, SEGV_ACCERR, "section access flag fault" },
582 { do_bad, SIGBUS, 0, "unknown 4" },
583 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
584 { do_bad, SIGSEGV, SEGV_ACCERR, "page access flag fault" },
585 { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
586 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
587 { do_bad, SIGSEGV, SEGV_ACCERR, "section domain fault" },
588 { do_bad, SIGBUS, 0, "unknown 10" },
589 { do_bad, SIGSEGV, SEGV_ACCERR, "page domain fault" },
590 { do_bad, SIGBUS, 0, "external abort on translation" },
591 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "section permission fault" },
592 { do_bad, SIGBUS, 0, "external abort on translation" },
593 { do_page_fault, SIGSEGV, SEGV_ACCERR, "page permission fault" },
594 { do_bad, SIGBUS, 0, "unknown 16" },
595 { do_bad, SIGBUS, 0, "unknown 17" },
596 { do_bad, SIGBUS, 0, "unknown 18" },
597 { do_bad, SIGBUS, 0, "unknown 19" },
598 { do_bad, SIGBUS, 0, "unknown 20" },
599 { do_bad, SIGBUS, 0, "unknown 21" },
600 { do_bad, SIGBUS, 0, "unknown 22" },
601 { do_bad, SIGBUS, 0, "unknown 23" },
602 { do_bad, SIGBUS, 0, "unknown 24" },
603 { do_bad, SIGBUS, 0, "unknown 25" },
604 { do_bad, SIGBUS, 0, "unknown 26" },
605 { do_bad, SIGBUS, 0, "unknown 27" },
606 { do_bad, SIGBUS, 0, "unknown 28" },
607 { do_bad, SIGBUS, 0, "unknown 29" },
608 { do_bad, SIGBUS, 0, "unknown 30" },
609 { do_bad, SIGBUS, 0, "unknown 31" },
610};
611
612void __init 557void __init
613hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *), 558hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
614 int sig, int code, const char *name) 559 int sig, int code, const char *name)
@@ -641,6 +586,7 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs)
641 arm_notify_die("", regs, &info, ifsr, 0); 586 arm_notify_die("", regs, &info, ifsr, 0);
642} 587}
643 588
589#ifndef CONFIG_ARM_LPAE
644static int __init exceptions_init(void) 590static int __init exceptions_init(void)
645{ 591{
646 if (cpu_architecture() >= CPU_ARCH_ARMv6) { 592 if (cpu_architecture() >= CPU_ARCH_ARMv6) {
@@ -663,3 +609,4 @@ static int __init exceptions_init(void)
663} 609}
664 610
665arch_initcall(exceptions_init); 611arch_initcall(exceptions_init);
612#endif
diff --git a/arch/arm/mm/fault.h b/arch/arm/mm/fault.h
index 49e9e3804de4..cf08bdfbe0d6 100644
--- a/arch/arm/mm/fault.h
+++ b/arch/arm/mm/fault.h
@@ -1,3 +1,28 @@
1void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs); 1#ifndef __ARCH_ARM_FAULT_H
2#define __ARCH_ARM_FAULT_H
3
4/*
5 * Fault status register encodings. We steal bit 31 for our own purposes.
6 */
7#define FSR_LNX_PF (1 << 31)
8#define FSR_WRITE (1 << 11)
9#define FSR_FS4 (1 << 10)
10#define FSR_FS3_0 (15)
11#define FSR_FS5_0 (0x3f)
12
13#ifdef CONFIG_ARM_LPAE
14static inline int fsr_fs(unsigned int fsr)
15{
16 return fsr & FSR_FS5_0;
17}
18#else
19static inline int fsr_fs(unsigned int fsr)
20{
21 return (fsr & FSR_FS3_0) | (fsr & FSR_FS4) >> 6;
22}
23#endif
2 24
25void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
3unsigned long search_exception_table(unsigned long addr); 26unsigned long search_exception_table(unsigned long addr);
27
28#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
index 000000000000..18ca74c0f341
--- /dev/null
+++ b/arch/arm/mm/fsr-2level.c
@@ -0,0 +1,78 @@
1static struct fsr_info fsr_info[] = {
2 /*
3 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5
4 * defines these to be "precise" aborts.
5 */
6 { do_bad, SIGSEGV, 0, "vector exception" },
7 { do_bad, SIGBUS, BUS_ADRALN, "alignment exception" },
8 { do_bad, SIGKILL, 0, "terminal exception" },
9 { do_bad, SIGBUS, BUS_ADRALN, "alignment exception" },
10 { do_bad, SIGBUS, 0, "external abort on linefetch" },
11 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
12 { do_bad, SIGBUS, 0, "external abort on linefetch" },
13 { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
14 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
15 { do_bad, SIGSEGV, SEGV_ACCERR, "section domain fault" },
16 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
17 { do_bad, SIGSEGV, SEGV_ACCERR, "page domain fault" },
18 { do_bad, SIGBUS, 0, "external abort on translation" },
19 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "section permission fault" },
20 { do_bad, SIGBUS, 0, "external abort on translation" },
21 { do_page_fault, SIGSEGV, SEGV_ACCERR, "page permission fault" },
22 /*
23 * The following are "imprecise" aborts, which are signalled by bit
24 * 10 of the FSR, and may not be recoverable. These are only
25 * supported if the CPU abort handler supports bit 10.
26 */
27 { do_bad, SIGBUS, 0, "unknown 16" },
28 { do_bad, SIGBUS, 0, "unknown 17" },
29 { do_bad, SIGBUS, 0, "unknown 18" },
30 { do_bad, SIGBUS, 0, "unknown 19" },
31 { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
32 { do_bad, SIGBUS, 0, "unknown 21" },
33 { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
34 { do_bad, SIGBUS, 0, "unknown 23" },
35 { do_bad, SIGBUS, 0, "dcache parity error" }, /* xscale */
36 { do_bad, SIGBUS, 0, "unknown 25" },
37 { do_bad, SIGBUS, 0, "unknown 26" },
38 { do_bad, SIGBUS, 0, "unknown 27" },
39 { do_bad, SIGBUS, 0, "unknown 28" },
40 { do_bad, SIGBUS, 0, "unknown 29" },
41 { do_bad, SIGBUS, 0, "unknown 30" },
42 { do_bad, SIGBUS, 0, "unknown 31" },
43};
44
45static struct fsr_info ifsr_info[] = {
46 { do_bad, SIGBUS, 0, "unknown 0" },
47 { do_bad, SIGBUS, 0, "unknown 1" },
48 { do_bad, SIGBUS, 0, "debug event" },
49 { do_bad, SIGSEGV, SEGV_ACCERR, "section access flag fault" },
50 { do_bad, SIGBUS, 0, "unknown 4" },
51 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
52 { do_bad, SIGSEGV, SEGV_ACCERR, "page access flag fault" },
53 { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
54 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
55 { do_bad, SIGSEGV, SEGV_ACCERR, "section domain fault" },
56 { do_bad, SIGBUS, 0, "unknown 10" },
57 { do_bad, SIGSEGV, SEGV_ACCERR, "page domain fault" },
58 { do_bad, SIGBUS, 0, "external abort on translation" },
59 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "section permission fault" },
60 { do_bad, SIGBUS, 0, "external abort on translation" },
61 { do_page_fault, SIGSEGV, SEGV_ACCERR, "page permission fault" },
62 { do_bad, SIGBUS, 0, "unknown 16" },
63 { do_bad, SIGBUS, 0, "unknown 17" },
64 { do_bad, SIGBUS, 0, "unknown 18" },
65 { do_bad, SIGBUS, 0, "unknown 19" },
66 { do_bad, SIGBUS, 0, "unknown 20" },
67 { do_bad, SIGBUS, 0, "unknown 21" },
68 { do_bad, SIGBUS, 0, "unknown 22" },
69 { do_bad, SIGBUS, 0, "unknown 23" },
70 { do_bad, SIGBUS, 0, "unknown 24" },
71 { do_bad, SIGBUS, 0, "unknown 25" },
72 { do_bad, SIGBUS, 0, "unknown 26" },
73 { do_bad, SIGBUS, 0, "unknown 27" },
74 { do_bad, SIGBUS, 0, "unknown 28" },
75 { do_bad, SIGBUS, 0, "unknown 29" },
76 { do_bad, SIGBUS, 0, "unknown 30" },
77 { do_bad, SIGBUS, 0, "unknown 31" },
78};
diff --git a/arch/arm/mm/fsr-3level.c b/arch/arm/mm/fsr-3level.c
new file mode 100644
index 000000000000..05a4e9431836
--- /dev/null
+++ b/arch/arm/mm/fsr-3level.c
@@ -0,0 +1,68 @@
1static struct fsr_info fsr_info[] = {
2 { do_bad, SIGBUS, 0, "unknown 0" },
3 { do_bad, SIGBUS, 0, "unknown 1" },
4 { do_bad, SIGBUS, 0, "unknown 2" },
5 { do_bad, SIGBUS, 0, "unknown 3" },
6 { do_bad, SIGBUS, 0, "reserved translation fault" },
7 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 1 translation fault" },
8 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 2 translation fault" },
9 { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation fault" },
10 { do_bad, SIGBUS, 0, "reserved access flag fault" },
11 { do_bad, SIGSEGV, SEGV_ACCERR, "level 1 access flag fault" },
12 { do_bad, SIGSEGV, SEGV_ACCERR, "level 2 access flag fault" },
13 { do_page_fault, SIGSEGV, SEGV_ACCERR, "level 3 access flag fault" },
14 { do_bad, SIGBUS, 0, "reserved permission fault" },
15 { do_bad, SIGSEGV, SEGV_ACCERR, "level 1 permission fault" },
16 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "level 2 permission fault" },
17 { do_page_fault, SIGSEGV, SEGV_ACCERR, "level 3 permission fault" },
18 { do_bad, SIGBUS, 0, "synchronous external abort" },
19 { do_bad, SIGBUS, 0, "asynchronous external abort" },
20 { do_bad, SIGBUS, 0, "unknown 18" },
21 { do_bad, SIGBUS, 0, "unknown 19" },
22 { do_bad, SIGBUS, 0, "synchronous abort (translation table walk)" },
23 { do_bad, SIGBUS, 0, "synchronous abort (translation table walk)" },
24 { do_bad, SIGBUS, 0, "synchronous abort (translation table walk)" },
25 { do_bad, SIGBUS, 0, "synchronous abort (translation table walk)" },
26 { do_bad, SIGBUS, 0, "synchronous parity error" },
27 { do_bad, SIGBUS, 0, "asynchronous parity error" },
28 { do_bad, SIGBUS, 0, "unknown 26" },
29 { do_bad, SIGBUS, 0, "unknown 27" },
30 { do_bad, SIGBUS, 0, "synchronous parity error (translation table walk" },
31 { do_bad, SIGBUS, 0, "synchronous parity error (translation table walk" },
32 { do_bad, SIGBUS, 0, "synchronous parity error (translation table walk" },
33 { do_bad, SIGBUS, 0, "synchronous parity error (translation table walk" },
34 { do_bad, SIGBUS, 0, "unknown 32" },
35 { do_bad, SIGBUS, BUS_ADRALN, "alignment fault" },
36 { do_bad, SIGBUS, 0, "debug event" },
37 { do_bad, SIGBUS, 0, "unknown 35" },
38 { do_bad, SIGBUS, 0, "unknown 36" },
39 { do_bad, SIGBUS, 0, "unknown 37" },
40 { do_bad, SIGBUS, 0, "unknown 38" },
41 { do_bad, SIGBUS, 0, "unknown 39" },
42 { do_bad, SIGBUS, 0, "unknown 40" },
43 { do_bad, SIGBUS, 0, "unknown 41" },
44 { do_bad, SIGBUS, 0, "unknown 42" },
45 { do_bad, SIGBUS, 0, "unknown 43" },
46 { do_bad, SIGBUS, 0, "unknown 44" },
47 { do_bad, SIGBUS, 0, "unknown 45" },
48 { do_bad, SIGBUS, 0, "unknown 46" },
49 { do_bad, SIGBUS, 0, "unknown 47" },
50 { do_bad, SIGBUS, 0, "unknown 48" },
51 { do_bad, SIGBUS, 0, "unknown 49" },
52 { do_bad, SIGBUS, 0, "unknown 50" },
53 { do_bad, SIGBUS, 0, "unknown 51" },
54 { do_bad, SIGBUS, 0, "implementation fault (lockdown abort)" },
55 { do_bad, SIGBUS, 0, "unknown 53" },
56 { do_bad, SIGBUS, 0, "unknown 54" },
57 { do_bad, SIGBUS, 0, "unknown 55" },
58 { do_bad, SIGBUS, 0, "unknown 56" },
59 { do_bad, SIGBUS, 0, "unknown 57" },
60 { do_bad, SIGBUS, 0, "implementation fault (coprocessor abort)" },
61 { do_bad, SIGBUS, 0, "unknown 59" },
62 { do_bad, SIGBUS, 0, "unknown 60" },
63 { do_bad, SIGBUS, 0, "unknown 61" },
64 { do_bad, SIGBUS, 0, "unknown 62" },
65 { do_bad, SIGBUS, 0, "unknown 63" },
66};
67
68#define ifsr_info fsr_info
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index 2be9139a4ef3..feacf4c76712 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -1,9 +1,38 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2 2
3#include <asm/cputype.h> 3#include <asm/cputype.h>
4#include <asm/idmap.h>
4#include <asm/pgalloc.h> 5#include <asm/pgalloc.h>
5#include <asm/pgtable.h> 6#include <asm/pgtable.h>
7#include <asm/sections.h>
6 8
9pgd_t *idmap_pgd;
10
11#ifdef CONFIG_ARM_LPAE
12static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
13 unsigned long prot)
14{
15 pmd_t *pmd;
16 unsigned long next;
17
18 if (pud_none_or_clear_bad(pud) || (pud_val(*pud) & L_PGD_SWAPPER)) {
19 pmd = pmd_alloc_one(&init_mm, addr);
20 if (!pmd) {
21 pr_warning("Failed to allocate identity pmd.\n");
22 return;
23 }
24 pud_populate(&init_mm, pud, pmd);
25 pmd += pmd_index(addr);
26 } else
27 pmd = pmd_offset(pud, addr);
28
29 do {
30 next = pmd_addr_end(addr, end);
31 *pmd = __pmd((addr & PMD_MASK) | prot);
32 flush_pmd_entry(pmd);
33 } while (pmd++, addr = next, addr != end);
34}
35#else /* !CONFIG_ARM_LPAE */
7static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end, 36static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
8 unsigned long prot) 37 unsigned long prot)
9{ 38{
@@ -15,6 +44,7 @@ static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
15 pmd[1] = __pmd(addr); 44 pmd[1] = __pmd(addr);
16 flush_pmd_entry(pmd); 45 flush_pmd_entry(pmd);
17} 46}
47#endif /* CONFIG_ARM_LPAE */
18 48
19static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end, 49static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
20 unsigned long prot) 50 unsigned long prot)
@@ -28,11 +58,11 @@ static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
28 } while (pud++, addr = next, addr != end); 58 } while (pud++, addr = next, addr != end);
29} 59}
30 60
31void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end) 61static void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
32{ 62{
33 unsigned long prot, next; 63 unsigned long prot, next;
34 64
35 prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE; 65 prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF;
36 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) 66 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
37 prot |= PMD_BIT4; 67 prot |= PMD_BIT4;
38 68
@@ -43,48 +73,41 @@ void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
43 } while (pgd++, addr = next, addr != end); 73 } while (pgd++, addr = next, addr != end);
44} 74}
45 75
46#ifdef CONFIG_SMP 76extern char __idmap_text_start[], __idmap_text_end[];
47static void idmap_del_pmd(pud_t *pud, unsigned long addr, unsigned long end)
48{
49 pmd_t *pmd = pmd_offset(pud, addr);
50 pmd_clear(pmd);
51}
52 77
53static void idmap_del_pud(pgd_t *pgd, unsigned long addr, unsigned long end) 78static int __init init_static_idmap(void)
54{ 79{
55 pud_t *pud = pud_offset(pgd, addr); 80 phys_addr_t idmap_start, idmap_end;
56 unsigned long next;
57 81
58 do { 82 idmap_pgd = pgd_alloc(&init_mm);
59 next = pud_addr_end(addr, end); 83 if (!idmap_pgd)
60 idmap_del_pmd(pud, addr, next); 84 return -ENOMEM;
61 } while (pud++, addr = next, addr != end);
62}
63 85
64void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end) 86 /* Add an identity mapping for the physical address of the section. */
65{ 87 idmap_start = virt_to_phys((void *)__idmap_text_start);
66 unsigned long next; 88 idmap_end = virt_to_phys((void *)__idmap_text_end);
67 89
68 pgd += pgd_index(addr); 90 pr_info("Setting up static identity map for 0x%llx - 0x%llx\n",
69 do { 91 (long long)idmap_start, (long long)idmap_end);
70 next = pgd_addr_end(addr, end); 92 identity_mapping_add(idmap_pgd, idmap_start, idmap_end);
71 idmap_del_pud(pgd, addr, next); 93
72 } while (pgd++, addr = next, addr != end); 94 return 0;
73} 95}
74#endif 96early_initcall(init_static_idmap);
75 97
76/* 98/*
77 * In order to soft-boot, we need to insert a 1:1 mapping in place of 99 * In order to soft-boot, we need to switch to a 1:1 mapping for the
78 * the user-mode pages. This will then ensure that we have predictable 100 * cpu_reset functions. This will then ensure that we have predictable
79 * results when turning the mmu off 101 * results when turning off the mmu.
80 */ 102 */
81void setup_mm_for_reboot(char mode) 103void setup_mm_for_reboot(void)
82{ 104{
83 /* 105 /* Clean and invalidate L1. */
84 * We need to access to user-mode page tables here. For kernel threads 106 flush_cache_all();
85 * we don't have any user-mode mappings so we use the context that we 107
86 * "borrowed". 108 /* Switch to the identity mapping. */
87 */ 109 cpu_switch_mm(idmap_pgd, &init_mm);
88 identity_mapping_add(current->active_mm->pgd, 0, TASK_SIZE); 110
111 /* Flush the TLB. */
89 local_flush_tlb_all(); 112 local_flush_tlb_all();
90} 113}
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index fbdd12ea3a58..e34ea8adc1f9 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -20,7 +20,6 @@
20#include <linux/highmem.h> 20#include <linux/highmem.h>
21#include <linux/gfp.h> 21#include <linux/gfp.h>
22#include <linux/memblock.h> 22#include <linux/memblock.h>
23#include <linux/sort.h>
24 23
25#include <asm/mach-types.h> 24#include <asm/mach-types.h>
26#include <asm/prom.h> 25#include <asm/prom.h>
@@ -32,6 +31,7 @@
32 31
33#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34#include <asm/memblock.h>
35 35
36#include "mm.h" 36#include "mm.h"
37 37
@@ -134,30 +134,18 @@ void show_mem(unsigned int filter)
134} 134}
135 135
136static void __init find_limits(unsigned long *min, unsigned long *max_low, 136static void __init find_limits(unsigned long *min, unsigned long *max_low,
137 unsigned long *max_high) 137 unsigned long *max_high)
138{ 138{
139 struct meminfo *mi = &meminfo; 139 struct meminfo *mi = &meminfo;
140 int i; 140 int i;
141 141
142 *min = -1UL; 142 /* This assumes the meminfo array is properly sorted */
143 *max_low = *max_high = 0; 143 *min = bank_pfn_start(&mi->bank[0]);
144 144 for_each_bank (i, mi)
145 for_each_bank (i, mi) { 145 if (mi->bank[i].highmem)
146 struct membank *bank = &mi->bank[i]; 146 break;
147 unsigned long start, end; 147 *max_low = bank_pfn_end(&mi->bank[i - 1]);
148 148 *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
149 start = bank_pfn_start(bank);
150 end = bank_pfn_end(bank);
151
152 if (*min > start)
153 *min = start;
154 if (*max_high < end)
155 *max_high = end;
156 if (bank->highmem)
157 continue;
158 if (*max_low < end)
159 *max_low = end;
160 }
161} 149}
162 150
163static void __init arm_bootmem_init(unsigned long start_pfn, 151static void __init arm_bootmem_init(unsigned long start_pfn,
@@ -319,20 +307,10 @@ static void arm_memory_present(void)
319} 307}
320#endif 308#endif
321 309
322static int __init meminfo_cmp(const void *_a, const void *_b)
323{
324 const struct membank *a = _a, *b = _b;
325 long cmp = bank_pfn_start(a) - bank_pfn_start(b);
326 return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
327}
328
329void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) 310void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
330{ 311{
331 int i; 312 int i;
332 313
333 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
334
335 memblock_init();
336 for (i = 0; i < mi->nr_banks; i++) 314 for (i = 0; i < mi->nr_banks; i++)
337 memblock_add(mi->bank[i].start, mi->bank[i].size); 315 memblock_add(mi->bank[i].start, mi->bank[i].size);
338 316
@@ -371,7 +349,7 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
371 if (mdesc->reserve) 349 if (mdesc->reserve)
372 mdesc->reserve(); 350 mdesc->reserve();
373 351
374 memblock_analyze(); 352 memblock_allow_resize();
375 memblock_dump_all(); 353 memblock_dump_all();
376} 354}
377 355
@@ -403,8 +381,6 @@ void __init bootmem_init(void)
403 */ 381 */
404 arm_bootmem_free(min, max_low, max_high); 382 arm_bootmem_free(min, max_low, max_high);
405 383
406 high_memory = __va(((phys_addr_t)max_low << PAGE_SHIFT) - 1) + 1;
407
408 /* 384 /*
409 * This doesn't seem to be used by the Linux memory manager any 385 * This doesn't seem to be used by the Linux memory manager any
410 * more, but is used by ll_rw_block. If we can get rid of it, we 386 * more, but is used by ll_rw_block. If we can get rid of it, we
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index bdb248c4f55c..80632e8d7538 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -36,12 +36,6 @@
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include "mm.h" 37#include "mm.h"
38 38
39/*
40 * Used by ioremap() and iounmap() code to mark (super)section-mapped
41 * I/O regions in vm_struct->flags field.
42 */
43#define VM_ARM_SECTION_MAPPING 0x80000000
44
45int ioremap_page(unsigned long virt, unsigned long phys, 39int ioremap_page(unsigned long virt, unsigned long phys,
46 const struct mem_type *mtype) 40 const struct mem_type *mtype)
47{ 41{
@@ -64,7 +58,7 @@ void __check_kvm_seq(struct mm_struct *mm)
64 } while (seq != init_mm.context.kvm_seq); 58 } while (seq != init_mm.context.kvm_seq);
65} 59}
66 60
67#ifndef CONFIG_SMP 61#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
68/* 62/*
69 * Section support is unsafe on SMP - If you iounmap and ioremap a region, 63 * Section support is unsafe on SMP - If you iounmap and ioremap a region,
70 * the other CPUs will not see this change until their next context switch. 64 * 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)
79{ 73{
80 unsigned long addr = virt, end = virt + (size & ~(SZ_1M - 1)); 74 unsigned long addr = virt, end = virt + (size & ~(SZ_1M - 1));
81 pgd_t *pgd; 75 pgd_t *pgd;
76 pud_t *pud;
77 pmd_t *pmdp;
82 78
83 flush_cache_vunmap(addr, end); 79 flush_cache_vunmap(addr, end);
84 pgd = pgd_offset_k(addr); 80 pgd = pgd_offset_k(addr);
81 pud = pud_offset(pgd, addr);
82 pmdp = pmd_offset(pud, addr);
85 do { 83 do {
86 pmd_t pmd, *pmdp = pmd_offset(pgd, addr); 84 pmd_t pmd = *pmdp;
87 85
88 pmd = *pmdp;
89 if (!pmd_none(pmd)) { 86 if (!pmd_none(pmd)) {
90 /* 87 /*
91 * Clear the PMD from the page table, and 88 * Clear the PMD from the page table, and
@@ -104,8 +101,8 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
104 pte_free_kernel(&init_mm, pmd_page_vaddr(pmd)); 101 pte_free_kernel(&init_mm, pmd_page_vaddr(pmd));
105 } 102 }
106 103
107 addr += PGDIR_SIZE; 104 addr += PMD_SIZE;
108 pgd++; 105 pmdp += 2;
109 } while (addr < end); 106 } while (addr < end);
110 107
111 /* 108 /*
@@ -124,6 +121,8 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
124{ 121{
125 unsigned long addr = virt, end = virt + size; 122 unsigned long addr = virt, end = virt + size;
126 pgd_t *pgd; 123 pgd_t *pgd;
124 pud_t *pud;
125 pmd_t *pmd;
127 126
128 /* 127 /*
129 * Remove and free any PTE-based mapping, and 128 * Remove and free any PTE-based mapping, and
@@ -132,17 +131,17 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
132 unmap_area_sections(virt, size); 131 unmap_area_sections(virt, size);
133 132
134 pgd = pgd_offset_k(addr); 133 pgd = pgd_offset_k(addr);
134 pud = pud_offset(pgd, addr);
135 pmd = pmd_offset(pud, addr);
135 do { 136 do {
136 pmd_t *pmd = pmd_offset(pgd, addr);
137
138 pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect); 137 pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
139 pfn += SZ_1M >> PAGE_SHIFT; 138 pfn += SZ_1M >> PAGE_SHIFT;
140 pmd[1] = __pmd(__pfn_to_phys(pfn) | type->prot_sect); 139 pmd[1] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
141 pfn += SZ_1M >> PAGE_SHIFT; 140 pfn += SZ_1M >> PAGE_SHIFT;
142 flush_pmd_entry(pmd); 141 flush_pmd_entry(pmd);
143 142
144 addr += PGDIR_SIZE; 143 addr += PMD_SIZE;
145 pgd++; 144 pmd += 2;
146 } while (addr < end); 145 } while (addr < end);
147 146
148 return 0; 147 return 0;
@@ -154,6 +153,8 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
154{ 153{
155 unsigned long addr = virt, end = virt + size; 154 unsigned long addr = virt, end = virt + size;
156 pgd_t *pgd; 155 pgd_t *pgd;
156 pud_t *pud;
157 pmd_t *pmd;
157 158
158 /* 159 /*
159 * Remove and free any PTE-based mapping, and 160 * Remove and free any PTE-based mapping, and
@@ -162,6 +163,8 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
162 unmap_area_sections(virt, size); 163 unmap_area_sections(virt, size);
163 164
164 pgd = pgd_offset_k(virt); 165 pgd = pgd_offset_k(virt);
166 pud = pud_offset(pgd, addr);
167 pmd = pmd_offset(pud, addr);
165 do { 168 do {
166 unsigned long super_pmd_val, i; 169 unsigned long super_pmd_val, i;
167 170
@@ -170,14 +173,12 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
170 super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20; 173 super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20;
171 174
172 for (i = 0; i < 8; i++) { 175 for (i = 0; i < 8; i++) {
173 pmd_t *pmd = pmd_offset(pgd, addr);
174
175 pmd[0] = __pmd(super_pmd_val); 176 pmd[0] = __pmd(super_pmd_val);
176 pmd[1] = __pmd(super_pmd_val); 177 pmd[1] = __pmd(super_pmd_val);
177 flush_pmd_entry(pmd); 178 flush_pmd_entry(pmd);
178 179
179 addr += PGDIR_SIZE; 180 addr += PMD_SIZE;
180 pgd++; 181 pmd += 2;
181 } 182 }
182 183
183 pfn += SUPERSECTION_SIZE >> PAGE_SHIFT; 184 pfn += SUPERSECTION_SIZE >> PAGE_SHIFT;
@@ -195,17 +196,13 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
195 unsigned long addr; 196 unsigned long addr;
196 struct vm_struct * area; 197 struct vm_struct * area;
197 198
199#ifndef CONFIG_ARM_LPAE
198 /* 200 /*
199 * High mappings must be supersection aligned 201 * High mappings must be supersection aligned
200 */ 202 */
201 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) 203 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
202 return NULL; 204 return NULL;
203 205#endif
204 /*
205 * Don't allow RAM to be mapped - this causes problems with ARMv6+
206 */
207 if (WARN_ON(pfn_valid(pfn)))
208 return NULL;
209 206
210 type = get_mem_type(mtype); 207 type = get_mem_type(mtype);
211 if (!type) 208 if (!type)
@@ -216,12 +213,40 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
216 */ 213 */
217 size = PAGE_ALIGN(offset + size); 214 size = PAGE_ALIGN(offset + size);
218 215
216 /*
217 * Try to reuse one of the static mapping whenever possible.
218 */
219 read_lock(&vmlist_lock);
220 for (area = vmlist; area; area = area->next) {
221 if (!size || (sizeof(phys_addr_t) == 4 && pfn >= 0x100000))
222 break;
223 if (!(area->flags & VM_ARM_STATIC_MAPPING))
224 continue;
225 if ((area->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))
226 continue;
227 if (__phys_to_pfn(area->phys_addr) > pfn ||
228 __pfn_to_phys(pfn) + size-1 > area->phys_addr + area->size-1)
229 continue;
230 /* we can drop the lock here as we know *area is static */
231 read_unlock(&vmlist_lock);
232 addr = (unsigned long)area->addr;
233 addr += __pfn_to_phys(pfn) - area->phys_addr;
234 return (void __iomem *) (offset + addr);
235 }
236 read_unlock(&vmlist_lock);
237
238 /*
239 * Don't allow RAM to be mapped - this causes problems with ARMv6+
240 */
241 if (WARN_ON(pfn_valid(pfn)))
242 return NULL;
243
219 area = get_vm_area_caller(size, VM_IOREMAP, caller); 244 area = get_vm_area_caller(size, VM_IOREMAP, caller);
220 if (!area) 245 if (!area)
221 return NULL; 246 return NULL;
222 addr = (unsigned long)area->addr; 247 addr = (unsigned long)area->addr;
223 248
224#ifndef CONFIG_SMP 249#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
225 if (DOMAIN_IO == 0 && 250 if (DOMAIN_IO == 0 &&
226 (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) || 251 (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
227 cpu_is_xsc3()) && pfn >= 0x100000 && 252 cpu_is_xsc3()) && pfn >= 0x100000 &&
@@ -313,28 +338,34 @@ __arm_ioremap_exec(unsigned long phys_addr, size_t size, bool cached)
313void __iounmap(volatile void __iomem *io_addr) 338void __iounmap(volatile void __iomem *io_addr)
314{ 339{
315 void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr); 340 void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
316#ifndef CONFIG_SMP 341 struct vm_struct *vm;
317 struct vm_struct **p, *tmp;
318 342
319 /* 343 read_lock(&vmlist_lock);
320 * If this is a section based mapping we need to handle it 344 for (vm = vmlist; vm; vm = vm->next) {
321 * specially as the VM subsystem does not know how to handle 345 if (vm->addr > addr)
322 * such a beast. We need the lock here b/c we need to clear 346 break;
323 * all the mappings before the area can be reclaimed 347 if (!(vm->flags & VM_IOREMAP))
324 * by someone else. 348 continue;
325 */ 349 /* If this is a static mapping we must leave it alone */
326 write_lock(&vmlist_lock); 350 if ((vm->flags & VM_ARM_STATIC_MAPPING) &&
327 for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) { 351 (vm->addr <= addr) && (vm->addr + vm->size > addr)) {
328 if ((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) { 352 read_unlock(&vmlist_lock);
329 if (tmp->flags & VM_ARM_SECTION_MAPPING) { 353 return;
330 unmap_area_sections((unsigned long)tmp->addr, 354 }
331 tmp->size); 355#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
332 } 356 /*
357 * If this is a section based mapping we need to handle it
358 * specially as the VM subsystem does not know how to handle
359 * such a beast.
360 */
361 if ((vm->addr == addr) &&
362 (vm->flags & VM_ARM_SECTION_MAPPING)) {
363 unmap_area_sections((unsigned long)vm->addr, vm->size);
333 break; 364 break;
334 } 365 }
335 }
336 write_unlock(&vmlist_lock);
337#endif 366#endif
367 }
368 read_unlock(&vmlist_lock);
338 369
339 vunmap(addr); 370 vunmap(addr);
340} 371}
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index ad7cce3bc431..70f6d3ea4834 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -21,6 +21,20 @@ const struct mem_type *get_mem_type(unsigned int type);
21 21
22extern void __flush_dcache_page(struct address_space *mapping, struct page *page); 22extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
23 23
24/*
25 * ARM specific vm_struct->flags bits.
26 */
27
28/* (super)section-mapped I/O regions used by ioremap()/iounmap() */
29#define VM_ARM_SECTION_MAPPING 0x80000000
30
31/* permanent static mappings from iotable_init() */
32#define VM_ARM_STATIC_MAPPING 0x40000000
33
34/* mapping type (attributes) for permanent static mappings */
35#define VM_ARM_MTYPE(mt) ((mt) << 20)
36#define VM_ARM_MTYPE_MASK (0x1f << 20)
37
24#endif 38#endif
25 39
26#ifdef CONFIG_ZONE_DMA 40#ifdef CONFIG_ZONE_DMA
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index 74be05f3e03a..ce8cb1970d7a 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -9,13 +9,51 @@
9#include <linux/io.h> 9#include <linux/io.h>
10#include <linux/personality.h> 10#include <linux/personality.h>
11#include <linux/random.h> 11#include <linux/random.h>
12#include <asm/cputype.h> 12#include <asm/cachetype.h>
13#include <asm/system.h> 13
14static inline unsigned long COLOUR_ALIGN_DOWN(unsigned long addr,
15 unsigned long pgoff)
16{
17 unsigned long base = addr & ~(SHMLBA-1);
18 unsigned long off = (pgoff << PAGE_SHIFT) & (SHMLBA-1);
19
20 if (base + off <= addr)
21 return base + off;
22
23 return base - off;
24}
14 25
15#define COLOUR_ALIGN(addr,pgoff) \ 26#define COLOUR_ALIGN(addr,pgoff) \
16 ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \ 27 ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \
17 (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1))) 28 (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1)))
18 29
30/* gap between mmap and stack */
31#define MIN_GAP (128*1024*1024UL)
32#define MAX_GAP ((TASK_SIZE)/6*5)
33
34static int mmap_is_legacy(void)
35{
36 if (current->personality & ADDR_COMPAT_LAYOUT)
37 return 1;
38
39 if (rlimit(RLIMIT_STACK) == RLIM_INFINITY)
40 return 1;
41
42 return sysctl_legacy_va_layout;
43}
44
45static unsigned long mmap_base(unsigned long rnd)
46{
47 unsigned long gap = rlimit(RLIMIT_STACK);
48
49 if (gap < MIN_GAP)
50 gap = MIN_GAP;
51 else if (gap > MAX_GAP)
52 gap = MAX_GAP;
53
54 return PAGE_ALIGN(TASK_SIZE - gap - rnd);
55}
56
19/* 57/*
20 * We need to ensure that shared mappings are correctly aligned to 58 * We need to ensure that shared mappings are correctly aligned to
21 * avoid aliasing issues with VIPT caches. We need to ensure that 59 * avoid aliasing issues with VIPT caches. We need to ensure that
@@ -32,25 +70,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
32 struct mm_struct *mm = current->mm; 70 struct mm_struct *mm = current->mm;
33 struct vm_area_struct *vma; 71 struct vm_area_struct *vma;
34 unsigned long start_addr; 72 unsigned long start_addr;
35#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 73 int do_align = 0;
36 unsigned int cache_type; 74 int aliasing = cache_is_vipt_aliasing();
37 int do_align = 0, aliasing = 0;
38 75
39 /* 76 /*
40 * We only need to do colour alignment if either the I or D 77 * We only need to do colour alignment if either the I or D
41 * caches alias. This is indicated by bits 9 and 21 of the 78 * caches alias.
42 * cache type register.
43 */ 79 */
44 cache_type = read_cpuid_cachetype(); 80 if (aliasing)
45 if (cache_type != read_cpuid_id()) { 81 do_align = filp || (flags & MAP_SHARED);
46 aliasing = (cache_type | cache_type >> 12) & (1 << 11);
47 if (aliasing)
48 do_align = filp || flags & MAP_SHARED;
49 }
50#else
51#define do_align 0
52#define aliasing 0
53#endif
54 82
55 /* 83 /*
56 * We enforce the MAP_FIXED case. 84 * We enforce the MAP_FIXED case.
@@ -79,13 +107,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
79 if (len > mm->cached_hole_size) { 107 if (len > mm->cached_hole_size) {
80 start_addr = addr = mm->free_area_cache; 108 start_addr = addr = mm->free_area_cache;
81 } else { 109 } else {
82 start_addr = addr = TASK_UNMAPPED_BASE; 110 start_addr = addr = mm->mmap_base;
83 mm->cached_hole_size = 0; 111 mm->cached_hole_size = 0;
84 } 112 }
85 /* 8 bits of randomness in 20 address space bits */
86 if ((current->flags & PF_RANDOMIZE) &&
87 !(current->personality & ADDR_NO_RANDOMIZE))
88 addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT;
89 113
90full_search: 114full_search:
91 if (do_align) 115 if (do_align)
@@ -122,6 +146,134 @@ full_search:
122 } 146 }
123} 147}
124 148
149unsigned long
150arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
151 const unsigned long len, const unsigned long pgoff,
152 const unsigned long flags)
153{
154 struct vm_area_struct *vma;
155 struct mm_struct *mm = current->mm;
156 unsigned long addr = addr0;
157 int do_align = 0;
158 int aliasing = cache_is_vipt_aliasing();
159
160 /*
161 * We only need to do colour alignment if either the I or D
162 * caches alias.
163 */
164 if (aliasing)
165 do_align = filp || (flags & MAP_SHARED);
166
167 /* requested length too big for entire address space */
168 if (len > TASK_SIZE)
169 return -ENOMEM;
170
171 if (flags & MAP_FIXED) {
172 if (aliasing && flags & MAP_SHARED &&
173 (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))
174 return -EINVAL;
175 return addr;
176 }
177
178 /* requesting a specific address */
179 if (addr) {
180 if (do_align)
181 addr = COLOUR_ALIGN(addr, pgoff);
182 else
183 addr = PAGE_ALIGN(addr);
184 vma = find_vma(mm, addr);
185 if (TASK_SIZE - len >= addr &&
186 (!vma || addr + len <= vma->vm_start))
187 return addr;
188 }
189
190 /* check if free_area_cache is useful for us */
191 if (len <= mm->cached_hole_size) {
192 mm->cached_hole_size = 0;
193 mm->free_area_cache = mm->mmap_base;
194 }
195
196 /* either no address requested or can't fit in requested address hole */
197 addr = mm->free_area_cache;
198 if (do_align) {
199 unsigned long base = COLOUR_ALIGN_DOWN(addr - len, pgoff);
200 addr = base + len;
201 }
202
203 /* make sure it can fit in the remaining address space */
204 if (addr > len) {
205 vma = find_vma(mm, addr-len);
206 if (!vma || addr <= vma->vm_start)
207 /* remember the address as a hint for next time */
208 return (mm->free_area_cache = addr-len);
209 }
210
211 if (mm->mmap_base < len)
212 goto bottomup;
213
214 addr = mm->mmap_base - len;
215 if (do_align)
216 addr = COLOUR_ALIGN_DOWN(addr, pgoff);
217
218 do {
219 /*
220 * Lookup failure means no vma is above this address,
221 * else if new region fits below vma->vm_start,
222 * return with success:
223 */
224 vma = find_vma(mm, addr);
225 if (!vma || addr+len <= vma->vm_start)
226 /* remember the address as a hint for next time */
227 return (mm->free_area_cache = addr);
228
229 /* remember the largest hole we saw so far */
230 if (addr + mm->cached_hole_size < vma->vm_start)
231 mm->cached_hole_size = vma->vm_start - addr;
232
233 /* try just below the current vma->vm_start */
234 addr = vma->vm_start - len;
235 if (do_align)
236 addr = COLOUR_ALIGN_DOWN(addr, pgoff);
237 } while (len < vma->vm_start);
238
239bottomup:
240 /*
241 * A failed mmap() very likely causes application failure,
242 * so fall back to the bottom-up function here. This scenario
243 * can happen with large stack limits and large mmap()
244 * allocations.
245 */
246 mm->cached_hole_size = ~0UL;
247 mm->free_area_cache = TASK_UNMAPPED_BASE;
248 addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
249 /*
250 * Restore the topdown base:
251 */
252 mm->free_area_cache = mm->mmap_base;
253 mm->cached_hole_size = ~0UL;
254
255 return addr;
256}
257
258void arch_pick_mmap_layout(struct mm_struct *mm)
259{
260 unsigned long random_factor = 0UL;
261
262 /* 8 bits of randomness in 20 address space bits */
263 if ((current->flags & PF_RANDOMIZE) &&
264 !(current->personality & ADDR_NO_RANDOMIZE))
265 random_factor = (get_random_int() % (1 << 8)) << PAGE_SHIFT;
266
267 if (mmap_is_legacy()) {
268 mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
269 mm->get_unmapped_area = arch_get_unmapped_area;
270 mm->unmap_area = arch_unmap_area;
271 } else {
272 mm->mmap_base = mmap_base(random_factor);
273 mm->get_unmapped_area = arch_get_unmapped_area_topdown;
274 mm->unmap_area = arch_unmap_area_topdown;
275 }
276}
125 277
126/* 278/*
127 * You really shouldn't be using read() or write() on /dev/mem. This 279 * You really shouldn't be using read() or write() on /dev/mem. This
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index dc8c550e6cbd..94c5a0c94f5e 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -15,6 +15,7 @@
15#include <linux/nodemask.h> 15#include <linux/nodemask.h>
16#include <linux/memblock.h> 16#include <linux/memblock.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/vmalloc.h>
18 19
19#include <asm/cputype.h> 20#include <asm/cputype.h>
20#include <asm/sections.h> 21#include <asm/sections.h>
@@ -150,6 +151,7 @@ static int __init early_nowrite(char *__unused)
150} 151}
151early_param("nowb", early_nowrite); 152early_param("nowb", early_nowrite);
152 153
154#ifndef CONFIG_ARM_LPAE
153static int __init early_ecc(char *p) 155static int __init early_ecc(char *p)
154{ 156{
155 if (memcmp(p, "on", 2) == 0) 157 if (memcmp(p, "on", 2) == 0)
@@ -159,6 +161,7 @@ static int __init early_ecc(char *p)
159 return 0; 161 return 0;
160} 162}
161early_param("ecc", early_ecc); 163early_param("ecc", early_ecc);
164#endif
162 165
163static int __init noalign_setup(char *__unused) 166static int __init noalign_setup(char *__unused)
164{ 167{
@@ -228,10 +231,12 @@ static struct mem_type mem_types[] = {
228 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, 231 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
229 .domain = DOMAIN_KERNEL, 232 .domain = DOMAIN_KERNEL,
230 }, 233 },
234#ifndef CONFIG_ARM_LPAE
231 [MT_MINICLEAN] = { 235 [MT_MINICLEAN] = {
232 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE, 236 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE,
233 .domain = DOMAIN_KERNEL, 237 .domain = DOMAIN_KERNEL,
234 }, 238 },
239#endif
235 [MT_LOW_VECTORS] = { 240 [MT_LOW_VECTORS] = {
236 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 241 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
237 L_PTE_RDONLY, 242 L_PTE_RDONLY,
@@ -429,6 +434,7 @@ static void __init build_mem_type_table(void)
429 * ARMv6 and above have extended page tables. 434 * ARMv6 and above have extended page tables.
430 */ 435 */
431 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) { 436 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
437#ifndef CONFIG_ARM_LPAE
432 /* 438 /*
433 * Mark cache clean areas and XIP ROM read only 439 * Mark cache clean areas and XIP ROM read only
434 * from SVC mode and no access from userspace. 440 * from SVC mode and no access from userspace.
@@ -436,6 +442,7 @@ static void __init build_mem_type_table(void)
436 mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 442 mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
437 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 443 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
438 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 444 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
445#endif
439 446
440 if (is_smp()) { 447 if (is_smp()) {
441 /* 448 /*
@@ -474,6 +481,18 @@ static void __init build_mem_type_table(void)
474 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE; 481 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE;
475 } 482 }
476 483
484#ifdef CONFIG_ARM_LPAE
485 /*
486 * Do not generate access flag faults for the kernel mappings.
487 */
488 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
489 mem_types[i].prot_pte |= PTE_EXT_AF;
490 mem_types[i].prot_sect |= PMD_SECT_AF;
491 }
492 kern_pgprot |= PTE_EXT_AF;
493 vecs_pgprot |= PTE_EXT_AF;
494#endif
495
477 for (i = 0; i < 16; i++) { 496 for (i = 0; i < 16; i++) {
478 unsigned long v = pgprot_val(protection_map[i]); 497 unsigned long v = pgprot_val(protection_map[i]);
479 protection_map[i] = __pgprot(v | user_pgprot); 498 protection_map[i] = __pgprot(v | user_pgprot);
@@ -529,13 +548,18 @@ EXPORT_SYMBOL(phys_mem_access_prot);
529 548
530#define vectors_base() (vectors_high() ? 0xffff0000 : 0) 549#define vectors_base() (vectors_high() ? 0xffff0000 : 0)
531 550
532static void __init *early_alloc(unsigned long sz) 551static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
533{ 552{
534 void *ptr = __va(memblock_alloc(sz, sz)); 553 void *ptr = __va(memblock_alloc(sz, align));
535 memset(ptr, 0, sz); 554 memset(ptr, 0, sz);
536 return ptr; 555 return ptr;
537} 556}
538 557
558static void __init *early_alloc(unsigned long sz)
559{
560 return early_alloc_aligned(sz, sz);
561}
562
539static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot) 563static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)
540{ 564{
541 if (pmd_none(*pmd)) { 565 if (pmd_none(*pmd)) {
@@ -572,8 +596,10 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
572 if (((addr | end | phys) & ~SECTION_MASK) == 0) { 596 if (((addr | end | phys) & ~SECTION_MASK) == 0) {
573 pmd_t *p = pmd; 597 pmd_t *p = pmd;
574 598
599#ifndef CONFIG_ARM_LPAE
575 if (addr & SECTION_SIZE) 600 if (addr & SECTION_SIZE)
576 pmd++; 601 pmd++;
602#endif
577 603
578 do { 604 do {
579 *pmd = __pmd(phys | type->prot_sect); 605 *pmd = __pmd(phys | type->prot_sect);
@@ -603,6 +629,7 @@ static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
603 } while (pud++, addr = next, addr != end); 629 } while (pud++, addr = next, addr != end);
604} 630}
605 631
632#ifndef CONFIG_ARM_LPAE
606static void __init create_36bit_mapping(struct map_desc *md, 633static void __init create_36bit_mapping(struct map_desc *md,
607 const struct mem_type *type) 634 const struct mem_type *type)
608{ 635{
@@ -662,6 +689,7 @@ static void __init create_36bit_mapping(struct map_desc *md,
662 pgd += SUPERSECTION_SIZE >> PGDIR_SHIFT; 689 pgd += SUPERSECTION_SIZE >> PGDIR_SHIFT;
663 } while (addr != end); 690 } while (addr != end);
664} 691}
692#endif /* !CONFIG_ARM_LPAE */
665 693
666/* 694/*
667 * Create the page directory entries and any necessary 695 * Create the page directory entries and any necessary
@@ -685,14 +713,16 @@ static void __init create_mapping(struct map_desc *md)
685 } 713 }
686 714
687 if ((md->type == MT_DEVICE || md->type == MT_ROM) && 715 if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
688 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) { 716 md->virtual >= PAGE_OFFSET &&
717 (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) {
689 printk(KERN_WARNING "BUG: mapping for 0x%08llx" 718 printk(KERN_WARNING "BUG: mapping for 0x%08llx"
690 " at 0x%08lx overlaps vmalloc space\n", 719 " at 0x%08lx out of vmalloc space\n",
691 (long long)__pfn_to_phys((u64)md->pfn), md->virtual); 720 (long long)__pfn_to_phys((u64)md->pfn), md->virtual);
692 } 721 }
693 722
694 type = &mem_types[md->type]; 723 type = &mem_types[md->type];
695 724
725#ifndef CONFIG_ARM_LPAE
696 /* 726 /*
697 * Catch 36-bit addresses 727 * Catch 36-bit addresses
698 */ 728 */
@@ -700,6 +730,7 @@ static void __init create_mapping(struct map_desc *md)
700 create_36bit_mapping(md, type); 730 create_36bit_mapping(md, type);
701 return; 731 return;
702 } 732 }
733#endif
703 734
704 addr = md->virtual & PAGE_MASK; 735 addr = md->virtual & PAGE_MASK;
705 phys = __pfn_to_phys(md->pfn); 736 phys = __pfn_to_phys(md->pfn);
@@ -729,18 +760,33 @@ static void __init create_mapping(struct map_desc *md)
729 */ 760 */
730void __init iotable_init(struct map_desc *io_desc, int nr) 761void __init iotable_init(struct map_desc *io_desc, int nr)
731{ 762{
732 int i; 763 struct map_desc *md;
764 struct vm_struct *vm;
765
766 if (!nr)
767 return;
733 768
734 for (i = 0; i < nr; i++) 769 vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm));
735 create_mapping(io_desc + i); 770
771 for (md = io_desc; nr; md++, nr--) {
772 create_mapping(md);
773 vm->addr = (void *)(md->virtual & PAGE_MASK);
774 vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
775 vm->phys_addr = __pfn_to_phys(md->pfn);
776 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
777 vm->flags |= VM_ARM_MTYPE(md->type);
778 vm->caller = iotable_init;
779 vm_area_add_early(vm++);
780 }
736} 781}
737 782
738static void * __initdata vmalloc_min = (void *)(VMALLOC_END - SZ_128M); 783static void * __initdata vmalloc_min =
784 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
739 785
740/* 786/*
741 * vmalloc=size forces the vmalloc area to be exactly 'size' 787 * vmalloc=size forces the vmalloc area to be exactly 'size'
742 * bytes. This can be used to increase (or decrease) the vmalloc 788 * bytes. This can be used to increase (or decrease) the vmalloc
743 * area - the default is 128m. 789 * area - the default is 240m.
744 */ 790 */
745static int __init early_vmalloc(char *arg) 791static int __init early_vmalloc(char *arg)
746{ 792{
@@ -775,6 +821,9 @@ void __init sanity_check_meminfo(void)
775 struct membank *bank = &meminfo.bank[j]; 821 struct membank *bank = &meminfo.bank[j];
776 *bank = meminfo.bank[i]; 822 *bank = meminfo.bank[i];
777 823
824 if (bank->start > ULONG_MAX)
825 highmem = 1;
826
778#ifdef CONFIG_HIGHMEM 827#ifdef CONFIG_HIGHMEM
779 if (__va(bank->start) >= vmalloc_min || 828 if (__va(bank->start) >= vmalloc_min ||
780 __va(bank->start) < (void *)PAGE_OFFSET) 829 __va(bank->start) < (void *)PAGE_OFFSET)
@@ -786,7 +835,7 @@ void __init sanity_check_meminfo(void)
786 * Split those memory banks which are partially overlapping 835 * Split those memory banks which are partially overlapping
787 * the vmalloc area greatly simplifying things later. 836 * the vmalloc area greatly simplifying things later.
788 */ 837 */
789 if (__va(bank->start) < vmalloc_min && 838 if (!highmem && __va(bank->start) < vmalloc_min &&
790 bank->size > vmalloc_min - __va(bank->start)) { 839 bank->size > vmalloc_min - __va(bank->start)) {
791 if (meminfo.nr_banks >= NR_BANKS) { 840 if (meminfo.nr_banks >= NR_BANKS) {
792 printk(KERN_CRIT "NR_BANKS too low, " 841 printk(KERN_CRIT "NR_BANKS too low, "
@@ -807,6 +856,17 @@ void __init sanity_check_meminfo(void)
807 bank->highmem = highmem; 856 bank->highmem = highmem;
808 857
809 /* 858 /*
859 * Highmem banks not allowed with !CONFIG_HIGHMEM.
860 */
861 if (highmem) {
862 printk(KERN_NOTICE "Ignoring RAM at %.8llx-%.8llx "
863 "(!CONFIG_HIGHMEM).\n",
864 (unsigned long long)bank->start,
865 (unsigned long long)bank->start + bank->size - 1);
866 continue;
867 }
868
869 /*
810 * Check whether this memory bank would entirely overlap 870 * Check whether this memory bank would entirely overlap
811 * the vmalloc area. 871 * the vmalloc area.
812 */ 872 */
@@ -860,6 +920,7 @@ void __init sanity_check_meminfo(void)
860 } 920 }
861#endif 921#endif
862 meminfo.nr_banks = j; 922 meminfo.nr_banks = j;
923 high_memory = __va(lowmem_limit - 1) + 1;
863 memblock_set_current_limit(lowmem_limit); 924 memblock_set_current_limit(lowmem_limit);
864} 925}
865 926
@@ -890,14 +951,20 @@ static inline void prepare_page_table(void)
890 951
891 /* 952 /*
892 * Clear out all the kernel space mappings, except for the first 953 * Clear out all the kernel space mappings, except for the first
893 * memory bank, up to the end of the vmalloc region. 954 * memory bank, up to the vmalloc region.
894 */ 955 */
895 for (addr = __phys_to_virt(end); 956 for (addr = __phys_to_virt(end);
896 addr < VMALLOC_END; addr += PMD_SIZE) 957 addr < VMALLOC_START; addr += PMD_SIZE)
897 pmd_clear(pmd_off_k(addr)); 958 pmd_clear(pmd_off_k(addr));
898} 959}
899 960
961#ifdef CONFIG_ARM_LPAE
962/* the first page is reserved for pgd */
963#define SWAPPER_PG_DIR_SIZE (PAGE_SIZE + \
964 PTRS_PER_PGD * PTRS_PER_PMD * sizeof(pmd_t))
965#else
900#define SWAPPER_PG_DIR_SIZE (PTRS_PER_PGD * sizeof(pgd_t)) 966#define SWAPPER_PG_DIR_SIZE (PTRS_PER_PGD * sizeof(pgd_t))
967#endif
901 968
902/* 969/*
903 * Reserve the special regions of memory 970 * Reserve the special regions of memory
@@ -920,8 +987,8 @@ void __init arm_mm_memblock_reserve(void)
920} 987}
921 988
922/* 989/*
923 * Set up device the mappings. Since we clear out the page tables for all 990 * Set up the device mappings. Since we clear out the page tables for all
924 * mappings above VMALLOC_END, we will remove any debug device mappings. 991 * mappings above VMALLOC_START, we will remove any debug device mappings.
925 * This means you have to be careful how you debug this function, or any 992 * This means you have to be careful how you debug this function, or any
926 * called function. This means you can't use any function or debugging 993 * called function. This means you can't use any function or debugging
927 * method which may touch any device, otherwise the kernel _will_ crash. 994 * method which may touch any device, otherwise the kernel _will_ crash.
@@ -936,7 +1003,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
936 */ 1003 */
937 vectors_page = early_alloc(PAGE_SIZE); 1004 vectors_page = early_alloc(PAGE_SIZE);
938 1005
939 for (addr = VMALLOC_END; addr; addr += PMD_SIZE) 1006 for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
940 pmd_clear(pmd_off_k(addr)); 1007 pmd_clear(pmd_off_k(addr));
941 1008
942 /* 1009 /*
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 941a98c9e8aa..4fc6794cca4b 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -29,6 +29,8 @@ void __init arm_mm_memblock_reserve(void)
29 29
30void __init sanity_check_meminfo(void) 30void __init sanity_check_meminfo(void)
31{ 31{
32 phys_addr_t end = bank_phys_end(&meminfo.bank[meminfo.nr_banks - 1]);
33 high_memory = __va(end - 1) + 1;
32} 34}
33 35
34/* 36/*
@@ -43,7 +45,7 @@ void __init paging_init(struct machine_desc *mdesc)
43/* 45/*
44 * We don't need to do anything here for nommu machines. 46 * We don't need to do anything here for nommu machines.
45 */ 47 */
46void setup_mm_for_reboot(char mode) 48void setup_mm_for_reboot(void)
47{ 49{
48} 50}
49 51
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index b2027c154b2a..a3e78ccabd65 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -10,6 +10,7 @@
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/gfp.h> 11#include <linux/gfp.h>
12#include <linux/highmem.h> 12#include <linux/highmem.h>
13#include <linux/slab.h>
13 14
14#include <asm/pgalloc.h> 15#include <asm/pgalloc.h>
15#include <asm/page.h> 16#include <asm/page.h>
@@ -17,6 +18,14 @@
17 18
18#include "mm.h" 19#include "mm.h"
19 20
21#ifdef CONFIG_ARM_LPAE
22#define __pgd_alloc() kmalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL)
23#define __pgd_free(pgd) kfree(pgd)
24#else
25#define __pgd_alloc() (pgd_t *)__get_free_pages(GFP_KERNEL, 2)
26#define __pgd_free(pgd) free_pages((unsigned long)pgd, 2)
27#endif
28
20/* 29/*
21 * need to get a 16k page for level 1 30 * need to get a 16k page for level 1
22 */ 31 */
@@ -27,7 +36,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
27 pmd_t *new_pmd, *init_pmd; 36 pmd_t *new_pmd, *init_pmd;
28 pte_t *new_pte, *init_pte; 37 pte_t *new_pte, *init_pte;
29 38
30 new_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL, 2); 39 new_pgd = __pgd_alloc();
31 if (!new_pgd) 40 if (!new_pgd)
32 goto no_pgd; 41 goto no_pgd;
33 42
@@ -42,10 +51,25 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
42 51
43 clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t)); 52 clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
44 53
54#ifdef CONFIG_ARM_LPAE
55 /*
56 * Allocate PMD table for modules and pkmap mappings.
57 */
58 new_pud = pud_alloc(mm, new_pgd + pgd_index(MODULES_VADDR),
59 MODULES_VADDR);
60 if (!new_pud)
61 goto no_pud;
62
63 new_pmd = pmd_alloc(mm, new_pud, 0);
64 if (!new_pmd)
65 goto no_pmd;
66#endif
67
45 if (!vectors_high()) { 68 if (!vectors_high()) {
46 /* 69 /*
47 * On ARM, first page must always be allocated since it 70 * On ARM, first page must always be allocated since it
48 * contains the machine vectors. 71 * contains the machine vectors. The vectors are always high
72 * with LPAE.
49 */ 73 */
50 new_pud = pud_alloc(mm, new_pgd, 0); 74 new_pud = pud_alloc(mm, new_pgd, 0);
51 if (!new_pud) 75 if (!new_pud)
@@ -74,7 +98,7 @@ no_pte:
74no_pmd: 98no_pmd:
75 pud_free(mm, new_pud); 99 pud_free(mm, new_pud);
76no_pud: 100no_pud:
77 free_pages((unsigned long)new_pgd, 2); 101 __pgd_free(new_pgd);
78no_pgd: 102no_pgd:
79 return NULL; 103 return NULL;
80} 104}
@@ -111,5 +135,24 @@ no_pud:
111 pgd_clear(pgd); 135 pgd_clear(pgd);
112 pud_free(mm, pud); 136 pud_free(mm, pud);
113no_pgd: 137no_pgd:
114 free_pages((unsigned long) pgd_base, 2); 138#ifdef CONFIG_ARM_LPAE
139 /*
140 * Free modules/pkmap or identity pmd tables.
141 */
142 for (pgd = pgd_base; pgd < pgd_base + PTRS_PER_PGD; pgd++) {
143 if (pgd_none_or_clear_bad(pgd))
144 continue;
145 if (pgd_val(*pgd) & L_PGD_SWAPPER)
146 continue;
147 pud = pud_offset(pgd, 0);
148 if (pud_none_or_clear_bad(pud))
149 continue;
150 pmd = pmd_offset(pud, 0);
151 pud_clear(pud);
152 pmd_free(mm, pmd);
153 pgd_clear(pgd);
154 pud_free(mm, pud);
155 }
156#endif
157 __pgd_free(pgd_base);
115} 158}
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 67469665d47a..234951345eb3 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -95,6 +95,7 @@ ENTRY(cpu_arm1020_proc_fin)
95 * loc: location to jump to for soft reset 95 * loc: location to jump to for soft reset
96 */ 96 */
97 .align 5 97 .align 5
98 .pushsection .idmap.text, "ax"
98ENTRY(cpu_arm1020_reset) 99ENTRY(cpu_arm1020_reset)
99 mov ip, #0 100 mov ip, #0
100 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 101 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -107,6 +108,8 @@ ENTRY(cpu_arm1020_reset)
107 bic ip, ip, #0x1100 @ ...i...s........ 108 bic ip, ip, #0x1100 @ ...i...s........
108 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 109 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
109 mov pc, r0 110 mov pc, r0
111ENDPROC(cpu_arm1020_reset)
112 .popsection
110 113
111/* 114/*
112 * cpu_arm1020_do_idle() 115 * cpu_arm1020_do_idle()
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 4251421c0ed5..c244b06caac9 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -95,6 +95,7 @@ ENTRY(cpu_arm1020e_proc_fin)
95 * loc: location to jump to for soft reset 95 * loc: location to jump to for soft reset
96 */ 96 */
97 .align 5 97 .align 5
98 .pushsection .idmap.text, "ax"
98ENTRY(cpu_arm1020e_reset) 99ENTRY(cpu_arm1020e_reset)
99 mov ip, #0 100 mov ip, #0
100 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 101 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -107,6 +108,8 @@ ENTRY(cpu_arm1020e_reset)
107 bic ip, ip, #0x1100 @ ...i...s........ 108 bic ip, ip, #0x1100 @ ...i...s........
108 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 109 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
109 mov pc, r0 110 mov pc, r0
111ENDPROC(cpu_arm1020e_reset)
112 .popsection
110 113
111/* 114/*
112 * cpu_arm1020e_do_idle() 115 * cpu_arm1020e_do_idle()
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index d283cf3d06e3..38fe22efd18f 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -84,6 +84,7 @@ ENTRY(cpu_arm1022_proc_fin)
84 * loc: location to jump to for soft reset 84 * loc: location to jump to for soft reset
85 */ 85 */
86 .align 5 86 .align 5
87 .pushsection .idmap.text, "ax"
87ENTRY(cpu_arm1022_reset) 88ENTRY(cpu_arm1022_reset)
88 mov ip, #0 89 mov ip, #0
89 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 90 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -96,6 +97,8 @@ ENTRY(cpu_arm1022_reset)
96 bic ip, ip, #0x1100 @ ...i...s........ 97 bic ip, ip, #0x1100 @ ...i...s........
97 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 98 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
98 mov pc, r0 99 mov pc, r0
100ENDPROC(cpu_arm1022_reset)
101 .popsection
99 102
100/* 103/*
101 * cpu_arm1022_do_idle() 104 * cpu_arm1022_do_idle()
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 678a1ceafed2..3eb9c3c26c75 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -84,6 +84,7 @@ ENTRY(cpu_arm1026_proc_fin)
84 * loc: location to jump to for soft reset 84 * loc: location to jump to for soft reset
85 */ 85 */
86 .align 5 86 .align 5
87 .pushsection .idmap.text, "ax"
87ENTRY(cpu_arm1026_reset) 88ENTRY(cpu_arm1026_reset)
88 mov ip, #0 89 mov ip, #0
89 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 90 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -96,6 +97,8 @@ ENTRY(cpu_arm1026_reset)
96 bic ip, ip, #0x1100 @ ...i...s........ 97 bic ip, ip, #0x1100 @ ...i...s........
97 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 98 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
98 mov pc, r0 99 mov pc, r0
100ENDPROC(cpu_arm1026_reset)
101 .popsection
99 102
100/* 103/*
101 * cpu_arm1026_do_idle() 104 * cpu_arm1026_do_idle()
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index e5b974cddac3..4fbeb5b8e6c2 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -225,6 +225,7 @@ ENTRY(cpu_arm7_set_pte_ext)
225 * Params : r0 = address to jump to 225 * Params : r0 = address to jump to
226 * Notes : This sets up everything for a reset 226 * Notes : This sets up everything for a reset
227 */ 227 */
228 .pushsection .idmap.text, "ax"
228ENTRY(cpu_arm6_reset) 229ENTRY(cpu_arm6_reset)
229ENTRY(cpu_arm7_reset) 230ENTRY(cpu_arm7_reset)
230 mov r1, #0 231 mov r1, #0
@@ -235,6 +236,9 @@ ENTRY(cpu_arm7_reset)
235 mov r1, #0x30 236 mov r1, #0x30
236 mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc 237 mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc
237 mov pc, r0 238 mov pc, r0
239ENDPROC(cpu_arm6_reset)
240ENDPROC(cpu_arm7_reset)
241 .popsection
238 242
239 __CPUINIT 243 __CPUINIT
240 244
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index 55f4e290665a..0ac908c7ade1 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -101,6 +101,7 @@ ENTRY(cpu_arm720_set_pte_ext)
101 * Params : r0 = address to jump to 101 * Params : r0 = address to jump to
102 * Notes : This sets up everything for a reset 102 * Notes : This sets up everything for a reset
103 */ 103 */
104 .pushsection .idmap.text, "ax"
104ENTRY(cpu_arm720_reset) 105ENTRY(cpu_arm720_reset)
105 mov ip, #0 106 mov ip, #0
106 mcr p15, 0, ip, c7, c7, 0 @ invalidate cache 107 mcr p15, 0, ip, c7, c7, 0 @ invalidate cache
@@ -112,6 +113,8 @@ ENTRY(cpu_arm720_reset)
112 bic ip, ip, #0x2100 @ ..v....s........ 113 bic ip, ip, #0x2100 @ ..v....s........
113 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 114 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
114 mov pc, r0 115 mov pc, r0
116ENDPROC(cpu_arm720_reset)
117 .popsection
115 118
116 __CPUINIT 119 __CPUINIT
117 120
diff --git a/arch/arm/mm/proc-arm740.S b/arch/arm/mm/proc-arm740.S
index 4506be3adda6..dc5de5d53f20 100644
--- a/arch/arm/mm/proc-arm740.S
+++ b/arch/arm/mm/proc-arm740.S
@@ -49,6 +49,7 @@ ENTRY(cpu_arm740_proc_fin)
49 * Params : r0 = address to jump to 49 * Params : r0 = address to jump to
50 * Notes : This sets up everything for a reset 50 * Notes : This sets up everything for a reset
51 */ 51 */
52 .pushsection .idmap.text, "ax"
52ENTRY(cpu_arm740_reset) 53ENTRY(cpu_arm740_reset)
53 mov ip, #0 54 mov ip, #0
54 mcr p15, 0, ip, c7, c0, 0 @ invalidate cache 55 mcr p15, 0, ip, c7, c0, 0 @ invalidate cache
@@ -56,6 +57,8 @@ ENTRY(cpu_arm740_reset)
56 bic ip, ip, #0x0000000c @ ............wc.. 57 bic ip, ip, #0x0000000c @ ............wc..
57 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 58 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
58 mov pc, r0 59 mov pc, r0
60ENDPROC(cpu_arm740_reset)
61 .popsection
59 62
60 __CPUINIT 63 __CPUINIT
61 64
diff --git a/arch/arm/mm/proc-arm7tdmi.S b/arch/arm/mm/proc-arm7tdmi.S
index 7e0e1fe4ed4d..6ddea3e464bd 100644
--- a/arch/arm/mm/proc-arm7tdmi.S
+++ b/arch/arm/mm/proc-arm7tdmi.S
@@ -45,8 +45,11 @@ ENTRY(cpu_arm7tdmi_proc_fin)
45 * Params : loc(r0) address to jump to 45 * Params : loc(r0) address to jump to
46 * Purpose : Sets up everything for a reset and jump to the location for soft reset. 46 * Purpose : Sets up everything for a reset and jump to the location for soft reset.
47 */ 47 */
48 .pushsection .idmap.text, "ax"
48ENTRY(cpu_arm7tdmi_reset) 49ENTRY(cpu_arm7tdmi_reset)
49 mov pc, r0 50 mov pc, r0
51ENDPROC(cpu_arm7tdmi_reset)
52 .popsection
50 53
51 __CPUINIT 54 __CPUINIT
52 55
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 88fb3d9e0640..cb941ae95f66 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -85,6 +85,7 @@ ENTRY(cpu_arm920_proc_fin)
85 * loc: location to jump to for soft reset 85 * loc: location to jump to for soft reset
86 */ 86 */
87 .align 5 87 .align 5
88 .pushsection .idmap.text, "ax"
88ENTRY(cpu_arm920_reset) 89ENTRY(cpu_arm920_reset)
89 mov ip, #0 90 mov ip, #0
90 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 91 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -97,6 +98,8 @@ ENTRY(cpu_arm920_reset)
97 bic ip, ip, #0x1100 @ ...i...s........ 98 bic ip, ip, #0x1100 @ ...i...s........
98 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 99 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
99 mov pc, r0 100 mov pc, r0
101ENDPROC(cpu_arm920_reset)
102 .popsection
100 103
101/* 104/*
102 * cpu_arm920_do_idle() 105 * cpu_arm920_do_idle()
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index 490e18833857..4ec0e074dd55 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -87,6 +87,7 @@ ENTRY(cpu_arm922_proc_fin)
87 * loc: location to jump to for soft reset 87 * loc: location to jump to for soft reset
88 */ 88 */
89 .align 5 89 .align 5
90 .pushsection .idmap.text, "ax"
90ENTRY(cpu_arm922_reset) 91ENTRY(cpu_arm922_reset)
91 mov ip, #0 92 mov ip, #0
92 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 93 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -99,6 +100,8 @@ ENTRY(cpu_arm922_reset)
99 bic ip, ip, #0x1100 @ ...i...s........ 100 bic ip, ip, #0x1100 @ ...i...s........
100 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 101 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
101 mov pc, r0 102 mov pc, r0
103ENDPROC(cpu_arm922_reset)
104 .popsection
102 105
103/* 106/*
104 * cpu_arm922_do_idle() 107 * cpu_arm922_do_idle()
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index 51d494be057e..9dccd9a365b3 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -108,6 +108,7 @@ ENTRY(cpu_arm925_proc_fin)
108 * loc: location to jump to for soft reset 108 * loc: location to jump to for soft reset
109 */ 109 */
110 .align 5 110 .align 5
111 .pushsection .idmap.text, "ax"
111ENTRY(cpu_arm925_reset) 112ENTRY(cpu_arm925_reset)
112 /* Send software reset to MPU and DSP */ 113 /* Send software reset to MPU and DSP */
113 mov ip, #0xff000000 114 mov ip, #0xff000000
@@ -115,6 +116,8 @@ ENTRY(cpu_arm925_reset)
115 orr ip, ip, #0x0000ce00 116 orr ip, ip, #0x0000ce00
116 mov r4, #1 117 mov r4, #1
117 strh r4, [ip, #0x10] 118 strh r4, [ip, #0x10]
119ENDPROC(cpu_arm925_reset)
120 .popsection
118 121
119 mov ip, #0 122 mov ip, #0
120 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 123 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 9f8fd91f918a..820259b81a1f 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -77,6 +77,7 @@ ENTRY(cpu_arm926_proc_fin)
77 * loc: location to jump to for soft reset 77 * loc: location to jump to for soft reset
78 */ 78 */
79 .align 5 79 .align 5
80 .pushsection .idmap.text, "ax"
80ENTRY(cpu_arm926_reset) 81ENTRY(cpu_arm926_reset)
81 mov ip, #0 82 mov ip, #0
82 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 83 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -89,6 +90,8 @@ ENTRY(cpu_arm926_reset)
89 bic ip, ip, #0x1100 @ ...i...s........ 90 bic ip, ip, #0x1100 @ ...i...s........
90 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 91 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
91 mov pc, r0 92 mov pc, r0
93ENDPROC(cpu_arm926_reset)
94 .popsection
92 95
93/* 96/*
94 * cpu_arm926_do_idle() 97 * cpu_arm926_do_idle()
diff --git a/arch/arm/mm/proc-arm940.S b/arch/arm/mm/proc-arm940.S
index ac750d506153..9fdc0a170974 100644
--- a/arch/arm/mm/proc-arm940.S
+++ b/arch/arm/mm/proc-arm940.S
@@ -48,6 +48,7 @@ ENTRY(cpu_arm940_proc_fin)
48 * Params : r0 = address to jump to 48 * Params : r0 = address to jump to
49 * Notes : This sets up everything for a reset 49 * Notes : This sets up everything for a reset
50 */ 50 */
51 .pushsection .idmap.text, "ax"
51ENTRY(cpu_arm940_reset) 52ENTRY(cpu_arm940_reset)
52 mov ip, #0 53 mov ip, #0
53 mcr p15, 0, ip, c7, c5, 0 @ flush I cache 54 mcr p15, 0, ip, c7, c5, 0 @ flush I cache
@@ -58,6 +59,8 @@ ENTRY(cpu_arm940_reset)
58 bic ip, ip, #0x00001000 @ i-cache 59 bic ip, ip, #0x00001000 @ i-cache
59 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 60 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
60 mov pc, r0 61 mov pc, r0
62ENDPROC(cpu_arm940_reset)
63 .popsection
61 64
62/* 65/*
63 * cpu_arm940_do_idle() 66 * cpu_arm940_do_idle()
diff --git a/arch/arm/mm/proc-arm946.S b/arch/arm/mm/proc-arm946.S
index 683af3a182b7..f684cfedcca9 100644
--- a/arch/arm/mm/proc-arm946.S
+++ b/arch/arm/mm/proc-arm946.S
@@ -55,6 +55,7 @@ ENTRY(cpu_arm946_proc_fin)
55 * Params : r0 = address to jump to 55 * Params : r0 = address to jump to
56 * Notes : This sets up everything for a reset 56 * Notes : This sets up everything for a reset
57 */ 57 */
58 .pushsection .idmap.text, "ax"
58ENTRY(cpu_arm946_reset) 59ENTRY(cpu_arm946_reset)
59 mov ip, #0 60 mov ip, #0
60 mcr p15, 0, ip, c7, c5, 0 @ flush I cache 61 mcr p15, 0, ip, c7, c5, 0 @ flush I cache
@@ -65,6 +66,8 @@ ENTRY(cpu_arm946_reset)
65 bic ip, ip, #0x00001000 @ i-cache 66 bic ip, ip, #0x00001000 @ i-cache
66 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 67 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
67 mov pc, r0 68 mov pc, r0
69ENDPROC(cpu_arm946_reset)
70 .popsection
68 71
69/* 72/*
70 * cpu_arm946_do_idle() 73 * cpu_arm946_do_idle()
diff --git a/arch/arm/mm/proc-arm9tdmi.S b/arch/arm/mm/proc-arm9tdmi.S
index 2120f9e2af7f..8881391dfb9e 100644
--- a/arch/arm/mm/proc-arm9tdmi.S
+++ b/arch/arm/mm/proc-arm9tdmi.S
@@ -45,8 +45,11 @@ ENTRY(cpu_arm9tdmi_proc_fin)
45 * Params : loc(r0) address to jump to 45 * Params : loc(r0) address to jump to
46 * Purpose : Sets up everything for a reset and jump to the location for soft reset. 46 * Purpose : Sets up everything for a reset and jump to the location for soft reset.
47 */ 47 */
48 .pushsection .idmap.text, "ax"
48ENTRY(cpu_arm9tdmi_reset) 49ENTRY(cpu_arm9tdmi_reset)
49 mov pc, r0 50 mov pc, r0
51ENDPROC(cpu_arm9tdmi_reset)
52 .popsection
50 53
51 __CPUINIT 54 __CPUINIT
52 55
diff --git a/arch/arm/mm/proc-fa526.S b/arch/arm/mm/proc-fa526.S
index 4c7a5710472b..272558a133a3 100644
--- a/arch/arm/mm/proc-fa526.S
+++ b/arch/arm/mm/proc-fa526.S
@@ -57,6 +57,7 @@ ENTRY(cpu_fa526_proc_fin)
57 * loc: location to jump to for soft reset 57 * loc: location to jump to for soft reset
58 */ 58 */
59 .align 4 59 .align 4
60 .pushsection .idmap.text, "ax"
60ENTRY(cpu_fa526_reset) 61ENTRY(cpu_fa526_reset)
61/* TODO: Use CP8 if possible... */ 62/* TODO: Use CP8 if possible... */
62 mov ip, #0 63 mov ip, #0
@@ -73,6 +74,8 @@ ENTRY(cpu_fa526_reset)
73 nop 74 nop
74 nop 75 nop
75 mov pc, r0 76 mov pc, r0
77ENDPROC(cpu_fa526_reset)
78 .popsection
76 79
77/* 80/*
78 * cpu_fa526_do_idle() 81 * cpu_fa526_do_idle()
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index 8a6c2f78c1c3..ba3c500584ac 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -98,6 +98,7 @@ ENTRY(cpu_feroceon_proc_fin)
98 * loc: location to jump to for soft reset 98 * loc: location to jump to for soft reset
99 */ 99 */
100 .align 5 100 .align 5
101 .pushsection .idmap.text, "ax"
101ENTRY(cpu_feroceon_reset) 102ENTRY(cpu_feroceon_reset)
102 mov ip, #0 103 mov ip, #0
103 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 104 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -110,6 +111,8 @@ ENTRY(cpu_feroceon_reset)
110 bic ip, ip, #0x1100 @ ...i...s........ 111 bic ip, ip, #0x1100 @ ...i...s........
111 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 112 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
112 mov pc, r0 113 mov pc, r0
114ENDPROC(cpu_feroceon_reset)
115 .popsection
113 116
114/* 117/*
115 * cpu_feroceon_do_idle() 118 * cpu_feroceon_do_idle()
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index 307a4def8d3a..2d8ff3ad86d3 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -91,8 +91,9 @@
91#if L_PTE_SHARED != PTE_EXT_SHARED 91#if L_PTE_SHARED != PTE_EXT_SHARED
92#error PTE shared bit mismatch 92#error PTE shared bit mismatch
93#endif 93#endif
94#if (L_PTE_XN+L_PTE_USER+L_PTE_RDONLY+L_PTE_DIRTY+L_PTE_YOUNG+\ 94#if !defined (CONFIG_ARM_LPAE) && \
95 L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED 95 (L_PTE_XN+L_PTE_USER+L_PTE_RDONLY+L_PTE_DIRTY+L_PTE_YOUNG+\
96 L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED
96#error Invalid Linux PTE bit settings 97#error Invalid Linux PTE bit settings
97#endif 98#endif
98#endif /* CONFIG_MMU */ 99#endif /* CONFIG_MMU */
diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S
index db52b0fb14a0..cdfedc5b8ad8 100644
--- a/arch/arm/mm/proc-mohawk.S
+++ b/arch/arm/mm/proc-mohawk.S
@@ -69,6 +69,7 @@ ENTRY(cpu_mohawk_proc_fin)
69 * (same as arm926) 69 * (same as arm926)
70 */ 70 */
71 .align 5 71 .align 5
72 .pushsection .idmap.text, "ax"
72ENTRY(cpu_mohawk_reset) 73ENTRY(cpu_mohawk_reset)
73 mov ip, #0 74 mov ip, #0
74 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 75 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -79,6 +80,8 @@ ENTRY(cpu_mohawk_reset)
79 bic ip, ip, #0x1100 @ ...i...s........ 80 bic ip, ip, #0x1100 @ ...i...s........
80 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 81 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
81 mov pc, r0 82 mov pc, r0
83ENDPROC(cpu_mohawk_reset)
84 .popsection
82 85
83/* 86/*
84 * cpu_mohawk_do_idle() 87 * cpu_mohawk_do_idle()
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index d50ada26edd6..775d70fba937 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -62,6 +62,7 @@ ENTRY(cpu_sa110_proc_fin)
62 * loc: location to jump to for soft reset 62 * loc: location to jump to for soft reset
63 */ 63 */
64 .align 5 64 .align 5
65 .pushsection .idmap.text, "ax"
65ENTRY(cpu_sa110_reset) 66ENTRY(cpu_sa110_reset)
66 mov ip, #0 67 mov ip, #0
67 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 68 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -74,6 +75,8 @@ ENTRY(cpu_sa110_reset)
74 bic ip, ip, #0x1100 @ ...i...s........ 75 bic ip, ip, #0x1100 @ ...i...s........
75 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 76 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
76 mov pc, r0 77 mov pc, r0
78ENDPROC(cpu_sa110_reset)
79 .popsection
77 80
78/* 81/*
79 * cpu_sa110_do_idle(type) 82 * cpu_sa110_do_idle(type)
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index 7d91545d089b..3aa0da11fd84 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -70,6 +70,7 @@ ENTRY(cpu_sa1100_proc_fin)
70 * loc: location to jump to for soft reset 70 * loc: location to jump to for soft reset
71 */ 71 */
72 .align 5 72 .align 5
73 .pushsection .idmap.text, "ax"
73ENTRY(cpu_sa1100_reset) 74ENTRY(cpu_sa1100_reset)
74 mov ip, #0 75 mov ip, #0
75 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 76 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
@@ -82,6 +83,8 @@ ENTRY(cpu_sa1100_reset)
82 bic ip, ip, #0x1100 @ ...i...s........ 83 bic ip, ip, #0x1100 @ ...i...s........
83 mcr p15, 0, ip, c1, c0, 0 @ ctrl register 84 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
84 mov pc, r0 85 mov pc, r0
86ENDPROC(cpu_sa1100_reset)
87 .popsection
85 88
86/* 89/*
87 * cpu_sa1100_do_idle(type) 90 * cpu_sa1100_do_idle(type)
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index d061d2fa5506..5900cd520e84 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -55,6 +55,7 @@ ENTRY(cpu_v6_proc_fin)
55 * - loc - location to jump to for soft reset 55 * - loc - location to jump to for soft reset
56 */ 56 */
57 .align 5 57 .align 5
58 .pushsection .idmap.text, "ax"
58ENTRY(cpu_v6_reset) 59ENTRY(cpu_v6_reset)
59 mrc p15, 0, r1, c1, c0, 0 @ ctrl register 60 mrc p15, 0, r1, c1, c0, 0 @ ctrl register
60 bic r1, r1, #0x1 @ ...............m 61 bic r1, r1, #0x1 @ ...............m
@@ -62,6 +63,8 @@ ENTRY(cpu_v6_reset)
62 mov r1, #0 63 mov r1, #0
63 mcr p15, 0, r1, c7, c5, 4 @ ISB 64 mcr p15, 0, r1, c7, c5, 4 @ ISB
64 mov pc, r0 65 mov pc, r0
66ENDPROC(cpu_v6_reset)
67 .popsection
65 68
66/* 69/*
67 * cpu_v6_do_idle() 70 * 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
index 000000000000..3a4b3e7b888c
--- /dev/null
+++ b/arch/arm/mm/proc-v7-2level.S
@@ -0,0 +1,171 @@
1/*
2 * arch/arm/mm/proc-v7-2level.S
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#define TTB_S (1 << 1)
12#define TTB_RGN_NC (0 << 3)
13#define TTB_RGN_OC_WBWA (1 << 3)
14#define TTB_RGN_OC_WT (2 << 3)
15#define TTB_RGN_OC_WB (3 << 3)
16#define TTB_NOS (1 << 5)
17#define TTB_IRGN_NC ((0 << 0) | (0 << 6))
18#define TTB_IRGN_WBWA ((0 << 0) | (1 << 6))
19#define TTB_IRGN_WT ((1 << 0) | (0 << 6))
20#define TTB_IRGN_WB ((1 << 0) | (1 << 6))
21
22/* PTWs cacheable, inner WB not shareable, outer WB not shareable */
23#define TTB_FLAGS_UP TTB_IRGN_WB|TTB_RGN_OC_WB
24#define PMD_FLAGS_UP PMD_SECT_WB
25
26/* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */
27#define TTB_FLAGS_SMP TTB_IRGN_WBWA|TTB_S|TTB_NOS|TTB_RGN_OC_WBWA
28#define PMD_FLAGS_SMP PMD_SECT_WBWA|PMD_SECT_S
29
30/*
31 * cpu_v7_switch_mm(pgd_phys, tsk)
32 *
33 * Set the translation table base pointer to be pgd_phys
34 *
35 * - pgd_phys - physical address of new TTB
36 *
37 * It is assumed that:
38 * - we are not using split page tables
39 */
40ENTRY(cpu_v7_switch_mm)
41#ifdef CONFIG_MMU
42 mov r2, #0
43 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
44 ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP)
45 ALT_UP(orr r0, r0, #TTB_FLAGS_UP)
46#ifdef CONFIG_ARM_ERRATA_430973
47 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
48#endif
49#ifdef CONFIG_ARM_ERRATA_754322
50 dsb
51#endif
52 mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID
53 isb
541: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
55 isb
56#ifdef CONFIG_ARM_ERRATA_754322
57 dsb
58#endif
59 mcr p15, 0, r1, c13, c0, 1 @ set context ID
60 isb
61#endif
62 mov pc, lr
63ENDPROC(cpu_v7_switch_mm)
64
65/*
66 * cpu_v7_set_pte_ext(ptep, pte)
67 *
68 * Set a level 2 translation table entry.
69 *
70 * - ptep - pointer to level 2 translation table entry
71 * (hardware version is stored at +2048 bytes)
72 * - pte - PTE value to store
73 * - ext - value for extended PTE bits
74 */
75ENTRY(cpu_v7_set_pte_ext)
76#ifdef CONFIG_MMU
77 str r1, [r0] @ linux version
78
79 bic r3, r1, #0x000003f0
80 bic r3, r3, #PTE_TYPE_MASK
81 orr r3, r3, r2
82 orr r3, r3, #PTE_EXT_AP0 | 2
83
84 tst r1, #1 << 4
85 orrne r3, r3, #PTE_EXT_TEX(1)
86
87 eor r1, r1, #L_PTE_DIRTY
88 tst r1, #L_PTE_RDONLY | L_PTE_DIRTY
89 orrne r3, r3, #PTE_EXT_APX
90
91 tst r1, #L_PTE_USER
92 orrne r3, r3, #PTE_EXT_AP1
93#ifdef CONFIG_CPU_USE_DOMAINS
94 @ allow kernel read/write access to read-only user pages
95 tstne r3, #PTE_EXT_APX
96 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
97#endif
98
99 tst r1, #L_PTE_XN
100 orrne r3, r3, #PTE_EXT_XN
101
102 tst r1, #L_PTE_YOUNG
103 tstne r1, #L_PTE_PRESENT
104 moveq r3, #0
105
106 ARM( str r3, [r0, #2048]! )
107 THUMB( add r0, r0, #2048 )
108 THUMB( str r3, [r0] )
109 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
110#endif
111 mov pc, lr
112ENDPROC(cpu_v7_set_pte_ext)
113
114 /*
115 * Memory region attributes with SCTLR.TRE=1
116 *
117 * n = TEX[0],C,B
118 * TR = PRRR[2n+1:2n] - memory type
119 * IR = NMRR[2n+1:2n] - inner cacheable property
120 * OR = NMRR[2n+17:2n+16] - outer cacheable property
121 *
122 * n TR IR OR
123 * UNCACHED 000 00
124 * BUFFERABLE 001 10 00 00
125 * WRITETHROUGH 010 10 10 10
126 * WRITEBACK 011 10 11 11
127 * reserved 110
128 * WRITEALLOC 111 10 01 01
129 * DEV_SHARED 100 01
130 * DEV_NONSHARED 100 01
131 * DEV_WC 001 10
132 * DEV_CACHED 011 10
133 *
134 * Other attributes:
135 *
136 * DS0 = PRRR[16] = 0 - device shareable property
137 * DS1 = PRRR[17] = 1 - device shareable property
138 * NS0 = PRRR[18] = 0 - normal shareable property
139 * NS1 = PRRR[19] = 1 - normal shareable property
140 * NOS = PRRR[24+n] = 1 - not outer shareable
141 */
142.equ PRRR, 0xff0a81a8
143.equ NMRR, 0x40e040e0
144
145 /*
146 * Macro for setting up the TTBRx and TTBCR registers.
147 * - \ttb0 and \ttb1 updated with the corresponding flags.
148 */
149 .macro v7_ttb_setup, zero, ttbr0, ttbr1, tmp
150 mcr p15, 0, \zero, c2, c0, 2 @ TTB control register
151 ALT_SMP(orr \ttbr0, \ttbr0, #TTB_FLAGS_SMP)
152 ALT_UP(orr \ttbr0, \ttbr0, #TTB_FLAGS_UP)
153 ALT_SMP(orr \ttbr1, \ttbr1, #TTB_FLAGS_SMP)
154 ALT_UP(orr \ttbr1, \ttbr1, #TTB_FLAGS_UP)
155 mcr p15, 0, \ttbr1, c2, c0, 1 @ load TTB1
156 .endm
157
158 __CPUINIT
159
160 /* AT
161 * TFR EV X F I D LR S
162 * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM
163 * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced
164 * 1 0 110 0011 1100 .111 1101 < we want
165 */
166 .align 2
167 .type v7_crval, #object
168v7_crval:
169 crval clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c
170
171 .previous
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S
new file mode 100644
index 000000000000..8de0f1dd1549
--- /dev/null
+++ b/arch/arm/mm/proc-v7-3level.S
@@ -0,0 +1,150 @@
1/*
2 * arch/arm/mm/proc-v7-3level.S
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 * Copyright (C) 2011 ARM Ltd.
6 * Author: Catalin Marinas <catalin.marinas@arm.com>
7 * based on arch/arm/mm/proc-v7-2level.S
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#define TTB_IRGN_NC (0 << 8)
24#define TTB_IRGN_WBWA (1 << 8)
25#define TTB_IRGN_WT (2 << 8)
26#define TTB_IRGN_WB (3 << 8)
27#define TTB_RGN_NC (0 << 10)
28#define TTB_RGN_OC_WBWA (1 << 10)
29#define TTB_RGN_OC_WT (2 << 10)
30#define TTB_RGN_OC_WB (3 << 10)
31#define TTB_S (3 << 12)
32#define TTB_EAE (1 << 31)
33
34/* PTWs cacheable, inner WB not shareable, outer WB not shareable */
35#define TTB_FLAGS_UP (TTB_IRGN_WB|TTB_RGN_OC_WB)
36#define PMD_FLAGS_UP (PMD_SECT_WB)
37
38/* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */
39#define TTB_FLAGS_SMP (TTB_IRGN_WBWA|TTB_S|TTB_RGN_OC_WBWA)
40#define PMD_FLAGS_SMP (PMD_SECT_WBWA|PMD_SECT_S)
41
42/*
43 * cpu_v7_switch_mm(pgd_phys, tsk)
44 *
45 * Set the translation table base pointer to be pgd_phys (physical address of
46 * the new TTB).
47 */
48ENTRY(cpu_v7_switch_mm)
49#ifdef CONFIG_MMU
50 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
51 and r3, r1, #0xff
52 mov r3, r3, lsl #(48 - 32) @ ASID
53 mcrr p15, 0, r0, r3, c2 @ set TTB 0
54 isb
55#endif
56 mov pc, lr
57ENDPROC(cpu_v7_switch_mm)
58
59/*
60 * cpu_v7_set_pte_ext(ptep, pte)
61 *
62 * Set a level 2 translation table entry.
63 * - ptep - pointer to level 3 translation table entry
64 * - pte - PTE value to store (64-bit in r2 and r3)
65 */
66ENTRY(cpu_v7_set_pte_ext)
67#ifdef CONFIG_MMU
68 tst r2, #L_PTE_PRESENT
69 beq 1f
70 tst r3, #1 << (55 - 32) @ L_PTE_DIRTY
71 orreq r2, #L_PTE_RDONLY
721: strd r2, r3, [r0]
73 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
74#endif
75 mov pc, lr
76ENDPROC(cpu_v7_set_pte_ext)
77
78 /*
79 * Memory region attributes for LPAE (defined in pgtable-3level.h):
80 *
81 * n = AttrIndx[2:0]
82 *
83 * n MAIR
84 * UNCACHED 000 00000000
85 * BUFFERABLE 001 01000100
86 * DEV_WC 001 01000100
87 * WRITETHROUGH 010 10101010
88 * WRITEBACK 011 11101110
89 * DEV_CACHED 011 11101110
90 * DEV_SHARED 100 00000100
91 * DEV_NONSHARED 100 00000100
92 * unused 101
93 * unused 110
94 * WRITEALLOC 111 11111111
95 */
96.equ PRRR, 0xeeaa4400 @ MAIR0
97.equ NMRR, 0xff000004 @ MAIR1
98
99 /*
100 * Macro for setting up the TTBRx and TTBCR registers.
101 * - \ttbr1 updated.
102 */
103 .macro v7_ttb_setup, zero, ttbr0, ttbr1, tmp
104 ldr \tmp, =swapper_pg_dir @ swapper_pg_dir virtual address
105 cmp \ttbr1, \tmp @ PHYS_OFFSET > PAGE_OFFSET? (branch below)
106 mrc p15, 0, \tmp, c2, c0, 2 @ TTB control register
107 orr \tmp, \tmp, #TTB_EAE
108 ALT_SMP(orr \tmp, \tmp, #TTB_FLAGS_SMP)
109 ALT_UP(orr \tmp, \tmp, #TTB_FLAGS_UP)
110 ALT_SMP(orr \tmp, \tmp, #TTB_FLAGS_SMP << 16)
111 ALT_UP(orr \tmp, \tmp, #TTB_FLAGS_UP << 16)
112 /*
113 * TTBR0/TTBR1 split (PAGE_OFFSET):
114 * 0x40000000: T0SZ = 2, T1SZ = 0 (not used)
115 * 0x80000000: T0SZ = 0, T1SZ = 1
116 * 0xc0000000: T0SZ = 0, T1SZ = 2
117 *
118 * Only use this feature if PHYS_OFFSET <= PAGE_OFFSET, otherwise
119 * booting secondary CPUs would end up using TTBR1 for the identity
120 * mapping set up in TTBR0.
121 */
122 bhi 9001f @ PHYS_OFFSET > PAGE_OFFSET?
123 orr \tmp, \tmp, #(((PAGE_OFFSET >> 30) - 1) << 16) @ TTBCR.T1SZ
124#if defined CONFIG_VMSPLIT_2G
125 /* PAGE_OFFSET == 0x80000000, T1SZ == 1 */
126 add \ttbr1, \ttbr1, #1 << 4 @ skip two L1 entries
127#elif defined CONFIG_VMSPLIT_3G
128 /* PAGE_OFFSET == 0xc0000000, T1SZ == 2 */
129 add \ttbr1, \ttbr1, #4096 * (1 + 3) @ only L2 used, skip pgd+3*pmd
130#endif
131 /* CONFIG_VMSPLIT_1G does not need TTBR1 adjustment */
1329001: mcr p15, 0, \tmp, c2, c0, 2 @ TTB control register
133 mcrr p15, 1, \ttbr1, \zero, c2 @ load TTBR1
134 .endm
135
136 __CPUINIT
137
138 /*
139 * AT
140 * TFR EV X F IHD LR S
141 * .EEE ..EE PUI. .TAT 4RVI ZWRS BLDP WCAM
142 * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced
143 * 11 0 110 1 0011 1100 .111 1101 < we want
144 */
145 .align 2
146 .type v7_crval, #object
147v7_crval:
148 crval clear=0x0120c302, mmuset=0x30c23c7d, ucset=0x00c01c7c
149
150 .previous
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 2c559ac38142..7e9b5bf910c1 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -19,24 +19,11 @@
19 19
20#include "proc-macros.S" 20#include "proc-macros.S"
21 21
22#define TTB_S (1 << 1) 22#ifdef CONFIG_ARM_LPAE
23#define TTB_RGN_NC (0 << 3) 23#include "proc-v7-3level.S"
24#define TTB_RGN_OC_WBWA (1 << 3) 24#else
25#define TTB_RGN_OC_WT (2 << 3) 25#include "proc-v7-2level.S"
26#define TTB_RGN_OC_WB (3 << 3) 26#endif
27#define TTB_NOS (1 << 5)
28#define TTB_IRGN_NC ((0 << 0) | (0 << 6))
29#define TTB_IRGN_WBWA ((0 << 0) | (1 << 6))
30#define TTB_IRGN_WT ((1 << 0) | (0 << 6))
31#define TTB_IRGN_WB ((1 << 0) | (1 << 6))
32
33/* PTWs cacheable, inner WB not shareable, outer WB not shareable */
34#define TTB_FLAGS_UP TTB_IRGN_WB|TTB_RGN_OC_WB
35#define PMD_FLAGS_UP PMD_SECT_WB
36
37/* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */
38#define TTB_FLAGS_SMP TTB_IRGN_WBWA|TTB_S|TTB_NOS|TTB_RGN_OC_WBWA
39#define PMD_FLAGS_SMP PMD_SECT_WBWA|PMD_SECT_S
40 27
41ENTRY(cpu_v7_proc_init) 28ENTRY(cpu_v7_proc_init)
42 mov pc, lr 29 mov pc, lr
@@ -63,6 +50,7 @@ ENDPROC(cpu_v7_proc_fin)
63 * caches disabled. 50 * caches disabled.
64 */ 51 */
65 .align 5 52 .align 5
53 .pushsection .idmap.text, "ax"
66ENTRY(cpu_v7_reset) 54ENTRY(cpu_v7_reset)
67 mrc p15, 0, r1, c1, c0, 0 @ ctrl register 55 mrc p15, 0, r1, c1, c0, 0 @ ctrl register
68 bic r1, r1, #0x1 @ ...............m 56 bic r1, r1, #0x1 @ ...............m
@@ -71,6 +59,7 @@ ENTRY(cpu_v7_reset)
71 isb 59 isb
72 mov pc, r0 60 mov pc, r0
73ENDPROC(cpu_v7_reset) 61ENDPROC(cpu_v7_reset)
62 .popsection
74 63
75/* 64/*
76 * cpu_v7_do_idle() 65 * cpu_v7_do_idle()
@@ -97,127 +86,12 @@ ENTRY(cpu_v7_dcache_clean_area)
97 mov pc, lr 86 mov pc, lr
98ENDPROC(cpu_v7_dcache_clean_area) 87ENDPROC(cpu_v7_dcache_clean_area)
99 88
100/*
101 * cpu_v7_switch_mm(pgd_phys, tsk)
102 *
103 * Set the translation table base pointer to be pgd_phys
104 *
105 * - pgd_phys - physical address of new TTB
106 *
107 * It is assumed that:
108 * - we are not using split page tables
109 */
110ENTRY(cpu_v7_switch_mm)
111#ifdef CONFIG_MMU
112 mov r2, #0
113 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
114 ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP)
115 ALT_UP(orr r0, r0, #TTB_FLAGS_UP)
116#ifdef CONFIG_ARM_ERRATA_430973
117 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
118#endif
119#ifdef CONFIG_ARM_ERRATA_754322
120 dsb
121#endif
122 mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID
123 isb
1241: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
125 isb
126#ifdef CONFIG_ARM_ERRATA_754322
127 dsb
128#endif
129 mcr p15, 0, r1, c13, c0, 1 @ set context ID
130 isb
131#endif
132 mov pc, lr
133ENDPROC(cpu_v7_switch_mm)
134
135/*
136 * cpu_v7_set_pte_ext(ptep, pte)
137 *
138 * Set a level 2 translation table entry.
139 *
140 * - ptep - pointer to level 2 translation table entry
141 * (hardware version is stored at +2048 bytes)
142 * - pte - PTE value to store
143 * - ext - value for extended PTE bits
144 */
145ENTRY(cpu_v7_set_pte_ext)
146#ifdef CONFIG_MMU
147 str r1, [r0] @ linux version
148
149 bic r3, r1, #0x000003f0
150 bic r3, r3, #PTE_TYPE_MASK
151 orr r3, r3, r2
152 orr r3, r3, #PTE_EXT_AP0 | 2
153
154 tst r1, #1 << 4
155 orrne r3, r3, #PTE_EXT_TEX(1)
156
157 eor r1, r1, #L_PTE_DIRTY
158 tst r1, #L_PTE_RDONLY | L_PTE_DIRTY
159 orrne r3, r3, #PTE_EXT_APX
160
161 tst r1, #L_PTE_USER
162 orrne r3, r3, #PTE_EXT_AP1
163#ifdef CONFIG_CPU_USE_DOMAINS
164 @ allow kernel read/write access to read-only user pages
165 tstne r3, #PTE_EXT_APX
166 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
167#endif
168
169 tst r1, #L_PTE_XN
170 orrne r3, r3, #PTE_EXT_XN
171
172 tst r1, #L_PTE_YOUNG
173 tstne r1, #L_PTE_PRESENT
174 moveq r3, #0
175
176 ARM( str r3, [r0, #2048]! )
177 THUMB( add r0, r0, #2048 )
178 THUMB( str r3, [r0] )
179 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
180#endif
181 mov pc, lr
182ENDPROC(cpu_v7_set_pte_ext)
183
184 string cpu_v7_name, "ARMv7 Processor" 89 string cpu_v7_name, "ARMv7 Processor"
185 .align 90 .align
186 91
187 /*
188 * Memory region attributes with SCTLR.TRE=1
189 *
190 * n = TEX[0],C,B
191 * TR = PRRR[2n+1:2n] - memory type
192 * IR = NMRR[2n+1:2n] - inner cacheable property
193 * OR = NMRR[2n+17:2n+16] - outer cacheable property
194 *
195 * n TR IR OR
196 * UNCACHED 000 00
197 * BUFFERABLE 001 10 00 00
198 * WRITETHROUGH 010 10 10 10
199 * WRITEBACK 011 10 11 11
200 * reserved 110
201 * WRITEALLOC 111 10 01 01
202 * DEV_SHARED 100 01
203 * DEV_NONSHARED 100 01
204 * DEV_WC 001 10
205 * DEV_CACHED 011 10
206 *
207 * Other attributes:
208 *
209 * DS0 = PRRR[16] = 0 - device shareable property
210 * DS1 = PRRR[17] = 1 - device shareable property
211 * NS0 = PRRR[18] = 0 - normal shareable property
212 * NS1 = PRRR[19] = 1 - normal shareable property
213 * NOS = PRRR[24+n] = 1 - not outer shareable
214 */
215.equ PRRR, 0xff0a81a8
216.equ NMRR, 0x40e040e0
217
218/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ 92/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
219.globl cpu_v7_suspend_size 93.globl cpu_v7_suspend_size
220.equ cpu_v7_suspend_size, 4 * 7 94.equ cpu_v7_suspend_size, 4 * 8
221#ifdef CONFIG_ARM_CPU_SUSPEND 95#ifdef CONFIG_ARM_CPU_SUSPEND
222ENTRY(cpu_v7_do_suspend) 96ENTRY(cpu_v7_do_suspend)
223 stmfd sp!, {r4 - r10, lr} 97 stmfd sp!, {r4 - r10, lr}
@@ -226,10 +100,11 @@ ENTRY(cpu_v7_do_suspend)
226 stmia r0!, {r4 - r5} 100 stmia r0!, {r4 - r5}
227 mrc p15, 0, r6, c3, c0, 0 @ Domain ID 101 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
228 mrc p15, 0, r7, c2, c0, 1 @ TTB 1 102 mrc p15, 0, r7, c2, c0, 1 @ TTB 1
103 mrc p15, 0, r11, c2, c0, 2 @ TTB control register
229 mrc p15, 0, r8, c1, c0, 0 @ Control register 104 mrc p15, 0, r8, c1, c0, 0 @ Control register
230 mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register 105 mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register
231 mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control 106 mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control
232 stmia r0, {r6 - r10} 107 stmia r0, {r6 - r11}
233 ldmfd sp!, {r4 - r10, pc} 108 ldmfd sp!, {r4 - r10, pc}
234ENDPROC(cpu_v7_do_suspend) 109ENDPROC(cpu_v7_do_suspend)
235 110
@@ -241,13 +116,15 @@ ENTRY(cpu_v7_do_resume)
241 ldmia r0!, {r4 - r5} 116 ldmia r0!, {r4 - r5}
242 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID 117 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
243 mcr p15, 0, r5, c13, c0, 3 @ User r/o thread ID 118 mcr p15, 0, r5, c13, c0, 3 @ User r/o thread ID
244 ldmia r0, {r6 - r10} 119 ldmia r0, {r6 - r11}
245 mcr p15, 0, r6, c3, c0, 0 @ Domain ID 120 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
121#ifndef CONFIG_ARM_LPAE
246 ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP) 122 ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP)
247 ALT_UP(orr r1, r1, #TTB_FLAGS_UP) 123 ALT_UP(orr r1, r1, #TTB_FLAGS_UP)
124#endif
248 mcr p15, 0, r1, c2, c0, 0 @ TTB 0 125 mcr p15, 0, r1, c2, c0, 0 @ TTB 0
249 mcr p15, 0, r7, c2, c0, 1 @ TTB 1 126 mcr p15, 0, r7, c2, c0, 1 @ TTB 1
250 mcr p15, 0, ip, c2, c0, 2 @ TTB control register 127 mcr p15, 0, r11, c2, c0, 2 @ TTB control register
251 mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register 128 mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register
252 teq r4, r9 @ Is it already set? 129 teq r4, r9 @ Is it already set?
253 mcrne p15, 0, r9, c1, c0, 1 @ No, so write it 130 mcrne p15, 0, r9, c1, c0, 1 @ No, so write it
@@ -284,6 +161,7 @@ __v7_ca5mp_setup:
284__v7_ca9mp_setup: 161__v7_ca9mp_setup:
285 mov r10, #(1 << 0) @ TLB ops broadcasting 162 mov r10, #(1 << 0) @ TLB ops broadcasting
286 b 1f 163 b 1f
164__v7_ca7mp_setup:
287__v7_ca15mp_setup: 165__v7_ca15mp_setup:
288 mov r10, #0 166 mov r10, #0
2891: 1671:
@@ -363,11 +241,13 @@ __v7_setup:
363 orreq r10, r10, #1 << 6 @ set bit #6 241 orreq r10, r10, #1 << 6 @ set bit #6
364 mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register 242 mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register
365#endif 243#endif
366#ifdef CONFIG_ARM_ERRATA_751472 244#if defined(CONFIG_ARM_ERRATA_751472) && defined(CONFIG_SMP)
367 cmp r6, #0x30 @ present prior to r3p0 245 ALT_SMP(cmp r6, #0x30) @ present prior to r3p0
246 ALT_UP_B(1f)
368 mrclt p15, 0, r10, c15, c0, 1 @ read diagnostic register 247 mrclt p15, 0, r10, c15, c0, 1 @ read diagnostic register
369 orrlt r10, r10, #1 << 11 @ set bit #11 248 orrlt r10, r10, #1 << 11 @ set bit #11
370 mcrlt p15, 0, r10, c15, c0, 1 @ write diagnostic register 249 mcrlt p15, 0, r10, c15, c0, 1 @ write diagnostic register
2501:
371#endif 251#endif
372 252
3733: mov r10, #0 2533: mov r10, #0
@@ -377,12 +257,7 @@ __v7_setup:
377 dsb 257 dsb
378#ifdef CONFIG_MMU 258#ifdef CONFIG_MMU
379 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs 259 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
380 mcr p15, 0, r10, c2, c0, 2 @ TTB control register 260 v7_ttb_setup r10, r4, r8, r5 @ TTBCR, TTBRx setup
381 ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP)
382 ALT_UP(orr r4, r4, #TTB_FLAGS_UP)
383 ALT_SMP(orr r8, r8, #TTB_FLAGS_SMP)
384 ALT_UP(orr r8, r8, #TTB_FLAGS_UP)
385 mcr p15, 0, r8, c2, c0, 1 @ load TTB1
386 ldr r5, =PRRR @ PRRR 261 ldr r5, =PRRR @ PRRR
387 ldr r6, =NMRR @ NMRR 262 ldr r6, =NMRR @ NMRR
388 mcr p15, 0, r5, c10, c2, 0 @ write PRRR 263 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
@@ -404,16 +279,7 @@ __v7_setup:
404 mov pc, lr @ return to head.S:__ret 279 mov pc, lr @ return to head.S:__ret
405ENDPROC(__v7_setup) 280ENDPROC(__v7_setup)
406 281
407 /* AT 282 .align 2
408 * TFR EV X F I D LR S
409 * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM
410 * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced
411 * 1 0 110 0011 1100 .111 1101 < we want
412 */
413 .type v7_crval, #object
414v7_crval:
415 crval clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c
416
417__v7_setup_stack: 283__v7_setup_stack:
418 .space 4 * 11 @ 11 registers 284 .space 4 * 11 @ 11 registers
419 285
@@ -435,11 +301,11 @@ __v7_setup_stack:
435 */ 301 */
436.macro __v7_proc initfunc, mm_mmuflags = 0, io_mmuflags = 0, hwcaps = 0 302.macro __v7_proc initfunc, mm_mmuflags = 0, io_mmuflags = 0, hwcaps = 0
437 ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \ 303 ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \
438 PMD_FLAGS_SMP | \mm_mmuflags) 304 PMD_SECT_AF | PMD_FLAGS_SMP | \mm_mmuflags)
439 ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \ 305 ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \
440 PMD_FLAGS_UP | \mm_mmuflags) 306 PMD_SECT_AF | PMD_FLAGS_UP | \mm_mmuflags)
441 .long PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_AP_WRITE | \ 307 .long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | \
442 PMD_SECT_AP_READ | \io_mmuflags 308 PMD_SECT_AP_READ | PMD_SECT_AF | \io_mmuflags
443 W(b) \initfunc 309 W(b) \initfunc
444 .long cpu_arch_name 310 .long cpu_arch_name
445 .long cpu_elf_name 311 .long cpu_elf_name
@@ -452,6 +318,7 @@ __v7_setup_stack:
452 .long v7_cache_fns 318 .long v7_cache_fns
453.endm 319.endm
454 320
321#ifndef CONFIG_ARM_LPAE
455 /* 322 /*
456 * ARM Ltd. Cortex A5 processor. 323 * ARM Ltd. Cortex A5 processor.
457 */ 324 */
@@ -463,6 +330,16 @@ __v7_ca5mp_proc_info:
463 .size __v7_ca5mp_proc_info, . - __v7_ca5mp_proc_info 330 .size __v7_ca5mp_proc_info, . - __v7_ca5mp_proc_info
464 331
465 /* 332 /*
333 * ARM Ltd. Cortex A7 processor.
334 */
335 .type __v7_ca7mp_proc_info, #object
336__v7_ca7mp_proc_info:
337 .long 0x410fc070
338 .long 0xff0ffff0
339 __v7_proc __v7_ca7mp_setup, hwcaps = HWCAP_IDIV
340 .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info
341
342 /*
466 * ARM Ltd. Cortex A9 processor. 343 * ARM Ltd. Cortex A9 processor.
467 */ 344 */
468 .type __v7_ca9mp_proc_info, #object 345 .type __v7_ca9mp_proc_info, #object
@@ -471,6 +348,7 @@ __v7_ca9mp_proc_info:
471 .long 0xff0ffff0 348 .long 0xff0ffff0
472 __v7_proc __v7_ca9mp_setup 349 __v7_proc __v7_ca9mp_setup
473 .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info 350 .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info
351#endif /* CONFIG_ARM_LPAE */
474 352
475 /* 353 /*
476 * ARM Ltd. Cortex A15 processor. 354 * ARM Ltd. Cortex A15 processor.
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index abf0507a08ae..b0d57869da2d 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -105,6 +105,7 @@ ENTRY(cpu_xsc3_proc_fin)
105 * loc: location to jump to for soft reset 105 * loc: location to jump to for soft reset
106 */ 106 */
107 .align 5 107 .align 5
108 .pushsection .idmap.text, "ax"
108ENTRY(cpu_xsc3_reset) 109ENTRY(cpu_xsc3_reset)
109 mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE 110 mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
110 msr cpsr_c, r1 @ reset CPSR 111 msr cpsr_c, r1 @ reset CPSR
@@ -119,6 +120,8 @@ ENTRY(cpu_xsc3_reset)
119 @ already containing those two last instructions to survive. 120 @ already containing those two last instructions to survive.
120 mcr p15, 0, ip, c8, c7, 0 @ invalidate I and D TLBs 121 mcr p15, 0, ip, c8, c7, 0 @ invalidate I and D TLBs
121 mov pc, r0 122 mov pc, r0
123ENDPROC(cpu_xsc3_reset)
124 .popsection
122 125
123/* 126/*
124 * cpu_xsc3_do_idle() 127 * cpu_xsc3_do_idle()
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 3277904bebaf..4ffebaa595ee 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -142,6 +142,7 @@ ENTRY(cpu_xscale_proc_fin)
142 * Beware PXA270 erratum E7. 142 * Beware PXA270 erratum E7.
143 */ 143 */
144 .align 5 144 .align 5
145 .pushsection .idmap.text, "ax"
145ENTRY(cpu_xscale_reset) 146ENTRY(cpu_xscale_reset)
146 mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE 147 mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
147 msr cpsr_c, r1 @ reset CPSR 148 msr cpsr_c, r1 @ reset CPSR
@@ -160,6 +161,8 @@ ENTRY(cpu_xscale_reset)
160 @ already containing those two last instructions to survive. 161 @ already containing those two last instructions to survive.
161 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 162 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
162 mov pc, r0 163 mov pc, r0
164ENDPROC(cpu_xscale_reset)
165 .popsection
163 166
164/* 167/*
165 * cpu_xscale_do_idle() 168 * cpu_xscale_do_idle()
diff --git a/arch/arm/nwfpe/entry.S b/arch/arm/nwfpe/entry.S
index cafa18354339..d18dde95b8aa 100644
--- a/arch/arm/nwfpe/entry.S
+++ b/arch/arm/nwfpe/entry.S
@@ -20,6 +20,8 @@
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/ 21*/
22 22
23#include <asm/opcodes.h>
24
23/* This is the kernel's entry point into the floating point emulator. 25/* This is the kernel's entry point into the floating point emulator.
24It is called from the kernel with code similar to this: 26It is called from the kernel with code similar to this:
25 27
@@ -81,11 +83,11 @@ nwfpe_enter:
81 mov r6, r0 @ save the opcode 83 mov r6, r0 @ save the opcode
82emulate: 84emulate:
83 ldr r1, [sp, #S_PSR] @ fetch the PSR 85 ldr r1, [sp, #S_PSR] @ fetch the PSR
84 bl checkCondition @ check the condition 86 bl arm_check_condition @ check the condition
85 cmp r0, #0 @ r0 = 0 ==> condition failed 87 cmp r0, #ARM_OPCODE_CONDTEST_PASS @ condition passed?
86 88
87 @ if condition code failed to match, next insn 89 @ if condition code failed to match, next insn
88 beq next @ get the next instruction; 90 bne next @ get the next instruction;
89 91
90 mov r0, r6 @ prepare for EmulateAll() 92 mov r0, r6 @ prepare for EmulateAll()
91 bl EmulateAll @ emulate the instruction 93 bl EmulateAll @ emulate the instruction
diff --git a/arch/arm/nwfpe/fpopcode.c b/arch/arm/nwfpe/fpopcode.c
index 922b81107585..ff9834673085 100644
--- a/arch/arm/nwfpe/fpopcode.c
+++ b/arch/arm/nwfpe/fpopcode.c
@@ -61,29 +61,3 @@ const float32 float32Constant[] = {
61 0x41200000 /* single 10.0 */ 61 0x41200000 /* single 10.0 */
62}; 62};
63 63
64/* condition code lookup table
65 index into the table is test code: EQ, NE, ... LT, GT, AL, NV
66 bit position in short is condition code: NZCV */
67static const unsigned short aCC[16] = {
68 0xF0F0, // EQ == Z set
69 0x0F0F, // NE
70 0xCCCC, // CS == C set
71 0x3333, // CC
72 0xFF00, // MI == N set
73 0x00FF, // PL
74 0xAAAA, // VS == V set
75 0x5555, // VC
76 0x0C0C, // HI == C set && Z clear
77 0xF3F3, // LS == C clear || Z set
78 0xAA55, // GE == (N==V)
79 0x55AA, // LT == (N!=V)
80 0x0A05, // GT == (!Z && (N==V))
81 0xF5FA, // LE == (Z || (N!=V))
82 0xFFFF, // AL always
83 0 // NV
84};
85
86unsigned int checkCondition(const unsigned int opcode, const unsigned int ccodes)
87{
88 return (aCC[opcode >> 28] >> (ccodes >> 28)) & 1;
89}
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index 786e4c96156d..78f02dbfaa8f 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -475,9 +475,6 @@ static inline unsigned int getDestinationSize(const unsigned int opcode)
475 return (nRc); 475 return (nRc);
476} 476}
477 477
478extern unsigned int checkCondition(const unsigned int opcode,
479 const unsigned int ccodes);
480
481extern const float64 float64Constant[]; 478extern const float64 float64Constant[];
482extern const float32 float32Constant[]; 479extern const float32 float32Constant[];
483 480
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index c074e66ad224..4e0a371630b3 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -116,7 +116,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
116 return oprofile_perf_init(ops); 116 return oprofile_perf_init(ops);
117} 117}
118 118
119void __exit oprofile_arch_exit(void) 119void oprofile_arch_exit(void)
120{ 120{
121 oprofile_perf_exit(); 121 oprofile_perf_exit();
122} 122}
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile
index 69b09c1cec8b..a99dc15a70f7 100644
--- a/arch/arm/plat-iop/Makefile
+++ b/arch/arm/plat-iop/Makefile
@@ -10,10 +10,10 @@ obj-$(CONFIG_ARCH_IOP32X) += i2c.o
10obj-$(CONFIG_ARCH_IOP32X) += pci.o 10obj-$(CONFIG_ARCH_IOP32X) += pci.o
11obj-$(CONFIG_ARCH_IOP32X) += setup.o 11obj-$(CONFIG_ARCH_IOP32X) += setup.o
12obj-$(CONFIG_ARCH_IOP32X) += time.o 12obj-$(CONFIG_ARCH_IOP32X) += time.o
13obj-$(CONFIG_ARCH_IOP32X) += io.o
14obj-$(CONFIG_ARCH_IOP32X) += cp6.o 13obj-$(CONFIG_ARCH_IOP32X) += cp6.o
15obj-$(CONFIG_ARCH_IOP32X) += adma.o 14obj-$(CONFIG_ARCH_IOP32X) += adma.o
16obj-$(CONFIG_ARCH_IOP32X) += pmu.o 15obj-$(CONFIG_ARCH_IOP32X) += pmu.o
16obj-$(CONFIG_ARCH_IOP32X) += restart.o
17 17
18# IOP33X 18# IOP33X
19obj-$(CONFIG_ARCH_IOP33X) += gpio.o 19obj-$(CONFIG_ARCH_IOP33X) += gpio.o
@@ -21,10 +21,10 @@ obj-$(CONFIG_ARCH_IOP33X) += i2c.o
21obj-$(CONFIG_ARCH_IOP33X) += pci.o 21obj-$(CONFIG_ARCH_IOP33X) += pci.o
22obj-$(CONFIG_ARCH_IOP33X) += setup.o 22obj-$(CONFIG_ARCH_IOP33X) += setup.o
23obj-$(CONFIG_ARCH_IOP33X) += time.o 23obj-$(CONFIG_ARCH_IOP33X) += time.o
24obj-$(CONFIG_ARCH_IOP33X) += io.o
25obj-$(CONFIG_ARCH_IOP33X) += cp6.o 24obj-$(CONFIG_ARCH_IOP33X) += cp6.o
26obj-$(CONFIG_ARCH_IOP33X) += adma.o 25obj-$(CONFIG_ARCH_IOP33X) += adma.o
27obj-$(CONFIG_ARCH_IOP33X) += pmu.o 26obj-$(CONFIG_ARCH_IOP33X) += pmu.o
27obj-$(CONFIG_ARCH_IOP33X) += restart.o
28 28
29# IOP13XX 29# IOP13XX
30obj-$(CONFIG_ARCH_IOP13XX) += cp6.o 30obj-$(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
index e15bc17db90b..000000000000
--- a/arch/arm/plat-iop/io.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * iop3xx custom ioremap implementation
3 * Copyright (c) 2006, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 */
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/io.h>
22#include <mach/hardware.h>
23
24void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
25 unsigned int mtype)
26{
27 void __iomem * retval;
28
29 switch (cookie) {
30 case IOP3XX_PCI_LOWER_IO_PA ... IOP3XX_PCI_UPPER_IO_PA:
31 retval = (void *) IOP3XX_PCI_IO_PHYS_TO_VIRT(cookie);
32 break;
33 case IOP3XX_PERIPHERAL_PHYS_BASE ... IOP3XX_PERIPHERAL_UPPER_PA:
34 retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie);
35 break;
36 default:
37 retval = __arm_ioremap_caller(cookie, size, mtype,
38 __builtin_return_address(0));
39 }
40
41 return retval;
42}
43EXPORT_SYMBOL(__iop3xx_ioremap);
44
45void __iop3xx_iounmap(void __iomem *addr)
46{
47 extern void __iounmap(volatile void __iomem *addr);
48
49 switch ((u32) addr) {
50 case IOP3XX_PCI_LOWER_IO_VA ... IOP3XX_PCI_UPPER_IO_VA:
51 case IOP3XX_PERIPHERAL_VIRT_BASE ... IOP3XX_PERIPHERAL_UPPER_VA:
52 goto skip;
53 }
54 __iounmap(addr);
55
56skip:
57 return;
58}
59EXPORT_SYMBOL(__iop3xx_iounmap);
diff --git a/arch/arm/plat-iop/restart.c b/arch/arm/plat-iop/restart.c
new file mode 100644
index 000000000000..6a85a0c502e6
--- /dev/null
+++ b/arch/arm/plat-iop/restart.c
@@ -0,0 +1,19 @@
1/*
2 * restart.c
3 *
4 * Copyright (C) 2001 MontaVista Software, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <asm/hardware/iop3xx.h>
11#include <mach/hardware.h>
12
13void iop3xx_restart(char mode, const char *cmd)
14{
15 *IOP3XX_PCSR = 0x30;
16
17 /* Jump into ROM at address 0 */
18 soft_restart(0);
19}
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 568dd0223d17..cbfbbe461788 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -18,7 +18,6 @@
18#include <linux/time.h> 18#include <linux/time.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/timex.h> 20#include <linux/timex.h>
21#include <linux/sched.h>
22#include <linux/io.h> 21#include <linux/io.h>
23#include <linux/clocksource.h> 22#include <linux/clocksource.h>
24#include <linux/clockchips.h> 23#include <linux/clockchips.h>
@@ -52,21 +51,12 @@ static struct clocksource iop_clocksource = {
52 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 51 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
53}; 52};
54 53
55static DEFINE_CLOCK_DATA(cd);
56
57/* 54/*
58 * IOP sched_clock() implementation via its clocksource. 55 * IOP sched_clock() implementation via its clocksource.
59 */ 56 */
60unsigned long long notrace sched_clock(void) 57static u32 notrace iop_read_sched_clock(void)
61{ 58{
62 u32 cyc = 0xffffffffu - read_tcr1(); 59 return 0xffffffffu - read_tcr1();
63 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
64}
65
66static void notrace iop_update_sched_clock(void)
67{
68 u32 cyc = 0xffffffffu - read_tcr1();
69 update_sched_clock(&cd, cyc, (u32)~0);
70} 60}
71 61
72/* 62/*
@@ -152,7 +142,7 @@ void __init iop_init_time(unsigned long tick_rate)
152{ 142{
153 u32 timer_ctl; 143 u32 timer_ctl;
154 144
155 init_sched_clock(&cd, iop_update_sched_clock, 32, tick_rate); 145 setup_sched_clock(iop_read_sched_clock, 32, tick_rate);
156 146
157 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ); 147 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ);
158 iop_tick_rate = tick_rate; 148 iop_tick_rate = tick_rate;
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index b3a1f2b3ada3..b30708e28c1d 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -20,6 +20,7 @@ config ARCH_IMX_V6_V7
20 bool "i.MX3, i.MX6" 20 bool "i.MX3, i.MX6"
21 select AUTO_ZRELADDR if !ZBOOT_ROM 21 select AUTO_ZRELADDR if !ZBOOT_ROM
22 select ARM_PATCH_PHYS_VIRT 22 select ARM_PATCH_PHYS_VIRT
23 select MIGHT_HAVE_CACHE_L2X0
23 help 24 help
24 This enables support for systems based on the Freescale i.MX3 and i.MX6 25 This enables support for systems based on the Freescale i.MX3 and i.MX6
25 family. 26 family.
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index b9f0f5f499a4..076db84f3e31 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -5,7 +5,6 @@
5# Common support 5# Common support
6obj-y := clock.o time.o devices.o cpu.o system.o irq-common.o 6obj-y := clock.o time.o devices.o cpu.o system.o irq-common.o
7 7
8obj-$(CONFIG_ARM_GIC) += gic.o
9obj-$(CONFIG_MXC_TZIC) += tzic.o 8obj-$(CONFIG_MXC_TZIC) += tzic.o
10obj-$(CONFIG_MXC_AVIC) += avic.o 9obj-$(CONFIG_MXC_AVIC) += avic.o
11 10
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c
index 74aac96cda20..73db34bf588a 100644
--- a/arch/arm/plat-mxc/cpufreq.c
+++ b/arch/arm/plat-mxc/cpufreq.c
@@ -17,6 +17,7 @@
17 * the CPU clock speed on the fly. 17 * the CPU clock speed on the fly.
18 */ 18 */
19 19
20#include <linux/module.h>
20#include <linux/cpufreq.h> 21#include <linux/cpufreq.h>
21#include <linux/clk.h> 22#include <linux/clk.h>
22#include <linux/err.h> 23#include <linux/err.h>
@@ -97,7 +98,7 @@ static int mxc_set_target(struct cpufreq_policy *policy,
97 return ret; 98 return ret;
98} 99}
99 100
100static int __init mxc_cpufreq_init(struct cpufreq_policy *policy) 101static int mxc_cpufreq_init(struct cpufreq_policy *policy)
101{ 102{
102 int ret; 103 int ret;
103 int i; 104 int i;
diff --git a/arch/arm/plat-mxc/gic.c b/arch/arm/plat-mxc/gic.c
deleted file mode 100644
index 12f8f8109010..000000000000
--- a/arch/arm/plat-mxc/gic.c
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/io.h>
14#include <asm/exception.h>
15#include <asm/localtimer.h>
16#include <asm/hardware/gic.h>
17#ifdef CONFIG_SMP
18#include <asm/smp.h>
19#endif
20
21asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
22{
23 u32 irqstat, irqnr;
24
25 do {
26 irqstat = readl_relaxed(gic_cpu_base_addr + GIC_CPU_INTACK);
27 irqnr = irqstat & 0x3ff;
28 if (irqnr == 1023)
29 break;
30
31 if (irqnr > 15 && irqnr < 1021)
32 handle_IRQ(irqnr, regs);
33#ifdef CONFIG_SMP
34 else {
35 writel_relaxed(irqstat, gic_cpu_base_addr +
36 GIC_CPU_EOI);
37 handle_IPI(irqnr, regs);
38 }
39#endif
40 } while (1);
41}
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index 83b745a5e1b7..83cca9bcfc97 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -71,8 +71,8 @@ extern int mx6q_clocks_init(void);
71extern struct platform_device *mxc_register_gpio(char *name, int id, 71extern struct platform_device *mxc_register_gpio(char *name, int id,
72 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high); 72 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
73extern void mxc_set_cpu_type(unsigned int type); 73extern void mxc_set_cpu_type(unsigned int type);
74extern void mxc_restart(char, const char *);
74extern void mxc_arch_reset_init(void __iomem *); 75extern void mxc_arch_reset_init(void __iomem *);
75extern void mx51_efikamx_reset(void);
76extern int mx53_revision(void); 76extern int mx53_revision(void);
77extern int mx53_display_revision(void); 77extern int mx53_display_revision(void);
78 78
@@ -85,12 +85,10 @@ enum mxc_cpu_pwr_mode {
85}; 85};
86 86
87extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode); 87extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode);
88extern void (*imx_idle)(void);
89extern void imx_print_silicon_rev(const char *cpu, int srev); 88extern void imx_print_silicon_rev(const char *cpu, int srev);
90 89
91void avic_handle_irq(struct pt_regs *); 90void avic_handle_irq(struct pt_regs *);
92void tzic_handle_irq(struct pt_regs *); 91void tzic_handle_irq(struct pt_regs *);
93void gic_handle_irq(struct pt_regs *);
94 92
95#define imx1_handle_irq avic_handle_irq 93#define imx1_handle_irq avic_handle_irq
96#define imx21_handle_irq avic_handle_irq 94#define imx21_handle_irq avic_handle_irq
@@ -123,6 +121,7 @@ static inline void imx_smp_prepare(void) {}
123extern void imx_enable_cpu(int cpu, bool enable); 121extern void imx_enable_cpu(int cpu, bool enable);
124extern void imx_set_cpu_jump(int cpu, void *jump_addr); 122extern void imx_set_cpu_jump(int cpu, void *jump_addr);
125extern void imx_src_init(void); 123extern void imx_src_init(void);
124extern void imx_src_prepare_restart(void);
126extern void imx_gpc_init(void); 125extern void imx_gpc_init(void);
127extern void imx_gpc_pre_suspend(void); 126extern void imx_gpc_pre_suspend(void);
128extern void imx_gpc_post_resume(void); 127extern void imx_gpc_post_resume(void);
@@ -133,4 +132,5 @@ extern void imx53_qsb_common_init(void);
133extern void imx53_smd_common_init(void); 132extern void imx53_smd_common_init(void);
134extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); 133extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
135extern void imx6q_pm_init(void); 134extern void imx6q_pm_init(void);
135extern void imx6q_clock_map_io(void);
136#endif 136#endif
diff --git a/arch/arm/plat-mxc/include/mach/entry-macro.S b/arch/arm/plat-mxc/include/mach/entry-macro.S
index ca5cf26a04b1..def5d30cb67e 100644
--- a/arch/arm/plat-mxc/include/mach/entry-macro.S
+++ b/arch/arm/plat-mxc/include/mach/entry-macro.S
@@ -9,19 +9,8 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12/* Unused, we use CONFIG_MULTI_IRQ_HANDLER */
13
14 .macro disable_fiq 12 .macro disable_fiq
15 .endm 13 .endm
16 14
17 .macro get_irqnr_preamble, base, tmp
18 .endm
19
20 .macro arch_ret_to_user, tmp1, tmp2 15 .macro arch_ret_to_user, tmp1, tmp2
21 .endm 16 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 .endm
25
26 .macro test_for_ipi, irqnr, irqstat, base, tmp
27 .endm
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index 97b19e7800bc..2b7c08d13e89 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -12,8 +12,6 @@
12#ifndef __MACH_MX1_H__ 12#ifndef __MACH_MX1_H__
13#define __MACH_MX1_H__ 13#define __MACH_MX1_H__
14 14
15#include <mach/vmalloc.h>
16
17/* 15/*
18 * Memory map 16 * Memory map
19 */ 17 */
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
index 00a78193c681..a4d36d601d55 100644
--- a/arch/arm/plat-mxc/include/mach/mxc.h
+++ b/arch/arm/plat-mxc/include/mach/mxc.h
@@ -50,20 +50,6 @@
50#define IMX_CHIP_REVISION_3_3 0x33 50#define IMX_CHIP_REVISION_3_3 0x33
51#define IMX_CHIP_REVISION_UNKNOWN 0xff 51#define IMX_CHIP_REVISION_UNKNOWN 0xff
52 52
53#define IMX_CHIP_REVISION_1_0_STRING "1.0"
54#define IMX_CHIP_REVISION_1_1_STRING "1.1"
55#define IMX_CHIP_REVISION_1_2_STRING "1.2"
56#define IMX_CHIP_REVISION_1_3_STRING "1.3"
57#define IMX_CHIP_REVISION_2_0_STRING "2.0"
58#define IMX_CHIP_REVISION_2_1_STRING "2.1"
59#define IMX_CHIP_REVISION_2_2_STRING "2.2"
60#define IMX_CHIP_REVISION_2_3_STRING "2.3"
61#define IMX_CHIP_REVISION_3_0_STRING "3.0"
62#define IMX_CHIP_REVISION_3_1_STRING "3.1"
63#define IMX_CHIP_REVISION_3_2_STRING "3.2"
64#define IMX_CHIP_REVISION_3_3_STRING "3.3"
65#define IMX_CHIP_REVISION_UNKNOWN_STRING "unknown"
66
67#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
68extern unsigned int __mxc_cpu_type; 54extern unsigned int __mxc_cpu_type;
69#endif 55#endif
diff --git a/arch/arm/plat-mxc/include/mach/system.h b/arch/arm/plat-mxc/include/mach/system.h
index cf88b3593fba..13ad0df2e860 100644
--- a/arch/arm/plat-mxc/include/mach/system.h
+++ b/arch/arm/plat-mxc/include/mach/system.h
@@ -17,16 +17,9 @@
17#ifndef __ASM_ARCH_MXC_SYSTEM_H__ 17#ifndef __ASM_ARCH_MXC_SYSTEM_H__
18#define __ASM_ARCH_MXC_SYSTEM_H__ 18#define __ASM_ARCH_MXC_SYSTEM_H__
19 19
20extern void (*imx_idle)(void);
21
22static inline void arch_idle(void) 20static inline void arch_idle(void)
23{ 21{
24 if (imx_idle != NULL) 22 cpu_do_idle();
25 (imx_idle)();
26 else
27 cpu_do_idle();
28} 23}
29 24
30void arch_reset(char mode, const char *cmd);
31
32#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */ 25#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 88fd40452567..477971b00930 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -98,6 +98,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
98 case MACH_TYPE_PCM043: 98 case MACH_TYPE_PCM043:
99 case MACH_TYPE_LILLY1131: 99 case MACH_TYPE_LILLY1131:
100 case MACH_TYPE_VPR200: 100 case MACH_TYPE_VPR200:
101 case MACH_TYPE_EUKREA_CPUIMX35SD:
101 uart_base = MX3X_UART1_BASE_ADDR; 102 uart_base = MX3X_UART1_BASE_ADDR;
102 break; 103 break;
103 case MACH_TYPE_MAGX_ZN5: 104 case MACH_TYPE_MAGX_ZN5:
diff --git a/arch/arm/plat-mxc/include/mach/vmalloc.h b/arch/arm/plat-mxc/include/mach/vmalloc.h
deleted file mode 100644
index ef6379c474be..000000000000
--- a/arch/arm/plat-mxc/include/mach/vmalloc.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright (C) 2000 Russell King.
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __ASM_ARCH_MXC_VMALLOC_H__
17#define __ASM_ARCH_MXC_VMALLOC_H__
18
19/* vmalloc ending address */
20#define VMALLOC_END 0xf4000000UL
21
22#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
index 42d74ea59084..e032717f7d02 100644
--- a/arch/arm/plat-mxc/pwm.c
+++ b/arch/arm/plat-mxc/pwm.c
@@ -32,6 +32,9 @@
32#define MX3_PWMSAR 0x0C /* PWM Sample Register */ 32#define MX3_PWMSAR 0x0C /* PWM Sample Register */
33#define MX3_PWMPR 0x10 /* PWM Period Register */ 33#define MX3_PWMPR 0x10 /* PWM Period Register */
34#define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4) 34#define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)
35#define MX3_PWMCR_DOZEEN (1 << 24)
36#define MX3_PWMCR_WAITEN (1 << 23)
37#define MX3_PWMCR_DBGEN (1 << 22)
35#define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16) 38#define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16)
36#define MX3_PWMCR_CLKSRC_IPG (1 << 16) 39#define MX3_PWMCR_CLKSRC_IPG (1 << 16)
37#define MX3_PWMCR_EN (1 << 0) 40#define MX3_PWMCR_EN (1 << 0)
@@ -74,10 +77,21 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
74 do_div(c, period_ns); 77 do_div(c, period_ns);
75 duty_cycles = c; 78 duty_cycles = c;
76 79
80 /*
81 * according to imx pwm RM, the real period value should be
82 * PERIOD value in PWMPR plus 2.
83 */
84 if (period_cycles > 2)
85 period_cycles -= 2;
86 else
87 period_cycles = 0;
88
77 writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR); 89 writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR);
78 writel(period_cycles, pwm->mmio_base + MX3_PWMPR); 90 writel(period_cycles, pwm->mmio_base + MX3_PWMPR);
79 91
80 cr = MX3_PWMCR_PRESCALER(prescale) | MX3_PWMCR_EN; 92 cr = MX3_PWMCR_PRESCALER(prescale) |
93 MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
94 MX3_PWMCR_DBGEN | MX3_PWMCR_EN;
81 95
82 if (cpu_is_mx25()) 96 if (cpu_is_mx25())
83 cr |= MX3_PWMCR_CLKSRC_IPG; 97 cr |= MX3_PWMCR_CLKSRC_IPG;
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c
index 9dad8dcc2ea9..3599bf2cfd4f 100644
--- a/arch/arm/plat-mxc/system.c
+++ b/arch/arm/plat-mxc/system.c
@@ -21,6 +21,7 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/module.h>
24 25
25#include <mach/hardware.h> 26#include <mach/hardware.h>
26#include <mach/common.h> 27#include <mach/common.h>
@@ -28,25 +29,18 @@
28#include <asm/system.h> 29#include <asm/system.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30 31
31void (*imx_idle)(void) = NULL;
32void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL; 32void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL;
33EXPORT_SYMBOL_GPL(imx_ioremap);
33 34
34static void __iomem *wdog_base; 35static void __iomem *wdog_base;
35 36
36/* 37/*
37 * Reset the system. It is called by machine_restart(). 38 * Reset the system. It is called by machine_restart().
38 */ 39 */
39void arch_reset(char mode, const char *cmd) 40void mxc_restart(char mode, const char *cmd)
40{ 41{
41 unsigned int wcr_enable; 42 unsigned int wcr_enable;
42 43
43#ifdef CONFIG_MACH_MX51_EFIKAMX
44 if (machine_is_mx51_efikamx()) {
45 mx51_efikamx_reset();
46 return;
47 }
48#endif
49
50 if (cpu_is_mx1()) { 44 if (cpu_is_mx1()) {
51 wcr_enable = (1 << 0); 45 wcr_enable = (1 << 0);
52 } else { 46 } else {
@@ -70,7 +64,7 @@ void arch_reset(char mode, const char *cmd)
70 mdelay(50); 64 mdelay(50);
71 65
72 /* we'll take a jump through zero as a poor second */ 66 /* we'll take a jump through zero as a poor second */
73 cpu_reset(0); 67 soft_restart(0);
74} 68}
75 69
76void mxc_arch_reset_init(void __iomem *base) 70void mxc_arch_reset_init(void __iomem *base)
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 4b0fe285e83c..1c96cdb4c35e 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -108,18 +108,9 @@ static void gpt_irq_acknowledge(void)
108 108
109static void __iomem *sched_clock_reg; 109static void __iomem *sched_clock_reg;
110 110
111static DEFINE_CLOCK_DATA(cd); 111static u32 notrace mxc_read_sched_clock(void)
112unsigned long long notrace sched_clock(void)
113{ 112{
114 cycle_t cyc = sched_clock_reg ? __raw_readl(sched_clock_reg) : 0; 113 return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0;
115
116 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
117}
118
119static void notrace mxc_update_sched_clock(void)
120{
121 cycle_t cyc = sched_clock_reg ? __raw_readl(sched_clock_reg) : 0;
122 update_sched_clock(&cd, cyc, (u32)~0);
123} 114}
124 115
125static int __init mxc_clocksource_init(struct clk *timer_clk) 116static int __init mxc_clocksource_init(struct clk *timer_clk)
@@ -129,7 +120,7 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
129 120
130 sched_clock_reg = reg; 121 sched_clock_reg = reg;
131 122
132 init_sched_clock(&cd, mxc_update_sched_clock, 32, c); 123 setup_sched_clock(mxc_read_sched_clock, 32, c);
133 return clocksource_mmio_init(reg, "mxc_timer1", c, 200, 32, 124 return clocksource_mmio_init(reg, "mxc_timer1", c, 200, 32,
134 clocksource_mmio_readl_up); 125 clocksource_mmio_readl_up);
135} 126}
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index 30b6433d910d..ad1b45b605a4 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -17,7 +17,6 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/jiffies.h> 18#include <linux/jiffies.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/sched.h>
21#include <asm/mach/time.h> 20#include <asm/mach/time.h>
22#include <asm/sched_clock.h> 21#include <asm/sched_clock.h>
23 22
@@ -79,23 +78,12 @@ void __iomem *mtu_base; /* Assigned by machine code */
79 * local implementation which uses the clocksource to get some 78 * local implementation which uses the clocksource to get some
80 * better resolution when scheduling the kernel. 79 * better resolution when scheduling the kernel.
81 */ 80 */
82static DEFINE_CLOCK_DATA(cd); 81static u32 notrace nomadik_read_sched_clock(void)
83
84unsigned long long notrace sched_clock(void)
85{ 82{
86 u32 cyc;
87
88 if (unlikely(!mtu_base)) 83 if (unlikely(!mtu_base))
89 return 0; 84 return 0;
90 85
91 cyc = -readl(mtu_base + MTU_VAL(0)); 86 return -readl(mtu_base + MTU_VAL(0));
92 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
93}
94
95static void notrace nomadik_update_sched_clock(void)
96{
97 u32 cyc = -readl(mtu_base + MTU_VAL(0));
98 update_sched_clock(&cd, cyc, (u32)~0);
99} 87}
100#endif 88#endif
101 89
@@ -231,9 +219,11 @@ void __init nmdk_timer_init(void)
231 rate, 200, 32, clocksource_mmio_readl_down)) 219 rate, 200, 32, clocksource_mmio_readl_down))
232 pr_err("timer: failed to initialize clock source %s\n", 220 pr_err("timer: failed to initialize clock source %s\n",
233 "mtu_0"); 221 "mtu_0");
222
234#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK 223#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
235 init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); 224 setup_sched_clock(nomadik_read_sched_clock, 32, rate);
236#endif 225#endif
226
237 /* Timer 1 is used for events */ 227 /* Timer 1 is used for events */
238 228
239 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); 229 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index 985262242f25..3df04d944e4d 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -4,7 +4,7 @@
4 4
5# Common support 5# Common support
6obj-y := common.o sram.o clock.o devices.o dma.o mux.o \ 6obj-y := common.o sram.o clock.o devices.o dma.o mux.o \
7 usb.o fb.o io.o counter_32k.o 7 usb.o fb.o counter_32k.o
8obj-m := 8obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index d9f10a31e604..2ee6341fffdb 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/dma-mapping.h>
17#include <linux/omapfb.h> 18#include <linux/omapfb.h>
18 19
19#include <plat/common.h> 20#include <plat/common.h>
@@ -66,3 +67,10 @@ void __init omap_reserve(void)
66 omap_vram_reserve_sdram_memblock(); 67 omap_vram_reserve_sdram_memblock();
67 omap_dsp_reserve_sdram_memblock(); 68 omap_dsp_reserve_sdram_memblock();
68} 69}
70
71void __init omap_init_consistent_dma_size(void)
72{
73#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
74 init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
75#endif
76}
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index a6cbb712da51..5f0f2292b7fb 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -17,7 +17,6 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sched.h>
21#include <linux/clocksource.h> 20#include <linux/clocksource.h>
22 21
23#include <asm/sched_clock.h> 22#include <asm/sched_clock.h>
@@ -37,41 +36,9 @@ static void __iomem *timer_32k_base;
37 36
38#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 37#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410
39 38
40/* 39static u32 notrace omap_32k_read_sched_clock(void)
41 * Returns current time from boot in nsecs. It's OK for this to wrap
42 * around for now, as it's just a relative time stamp.
43 */
44static DEFINE_CLOCK_DATA(cd);
45
46/*
47 * Constants generated by clocks_calc_mult_shift(m, s, 32768, NSEC_PER_SEC, 60).
48 * This gives a resolution of about 30us and a wrap period of about 36hrs.
49 */
50#define SC_MULT 4000000000u
51#define SC_SHIFT 17
52
53static inline unsigned long long notrace _omap_32k_sched_clock(void)
54{
55 u32 cyc = timer_32k_base ? __raw_readl(timer_32k_base) : 0;
56 return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
57}
58
59#if defined(CONFIG_OMAP_32K_TIMER) && !defined(CONFIG_OMAP_MPU_TIMER)
60unsigned long long notrace sched_clock(void)
61{
62 return _omap_32k_sched_clock();
63}
64#else
65unsigned long long notrace omap_32k_sched_clock(void)
66{
67 return _omap_32k_sched_clock();
68}
69#endif
70
71static void notrace omap_update_sched_clock(void)
72{ 40{
73 u32 cyc = timer_32k_base ? __raw_readl(timer_32k_base) : 0; 41 return timer_32k_base ? __raw_readl(timer_32k_base) : 0;
74 update_sched_clock(&cd, cyc, (u32)~0);
75} 42}
76 43
77/** 44/**
@@ -147,8 +114,7 @@ int __init omap_init_clocksource_32k(void)
147 clocksource_mmio_readl_up)) 114 clocksource_mmio_readl_up))
148 printk(err, "32k_counter"); 115 printk(err, "32k_counter");
149 116
150 init_fixed_sched_clock(&cd, omap_update_sched_clock, 32, 117 setup_sched_clock(omap_32k_read_sched_clock, 32, 32768);
151 32768, SC_MULT, SC_SHIFT);
152 } 118 }
153 return 0; 119 return 0;
154} 120}
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 197ca03c3f7d..eb73ab40e955 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -165,8 +165,8 @@ struct dpll_data {
165 u8 auto_recal_bit; 165 u8 auto_recal_bit;
166 u8 recal_en_bit; 166 u8 recal_en_bit;
167 u8 recal_st_bit; 167 u8 recal_st_bit;
168 u8 flags;
169# endif 168# endif
169 u8 flags;
170}; 170};
171 171
172#endif 172#endif
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index c50df4814f6f..b4d7ec3fbfbe 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -27,94 +27,14 @@
27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H 27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
28#define __ARCH_ARM_MACH_OMAP_COMMON_H 28#define __ARCH_ARM_MACH_OMAP_COMMON_H
29 29
30#include <linux/delay.h>
31
32#include <plat/i2c.h> 30#include <plat/i2c.h>
31#include <plat/omap_hwmod.h>
33 32
34struct sys_timer;
35
36extern void omap_map_common_io(void);
37extern struct sys_timer omap1_timer;
38extern struct sys_timer omap2_timer;
39extern struct sys_timer omap3_timer;
40extern struct sys_timer omap3_secure_timer;
41extern struct sys_timer omap4_timer;
42extern bool omap_32k_timer_init(void);
43extern int __init omap_init_clocksource_32k(void); 33extern int __init omap_init_clocksource_32k(void);
44extern unsigned long long notrace omap_32k_sched_clock(void);
45 34
46extern void omap_reserve(void); 35extern void omap_reserve(void);
47 36extern int omap_dss_reset(struct omap_hwmod *);
48void omap2420_init_early(void);
49void omap2430_init_early(void);
50void omap3430_init_early(void);
51void omap35xx_init_early(void);
52void omap3630_init_early(void);
53void omap3_init_early(void); /* Do not use this one */
54void am35xx_init_early(void);
55void ti816x_init_early(void);
56void omap4430_init_early(void);
57 37
58void omap_sram_init(void); 38void omap_sram_init(void);
59 39
60/*
61 * IO bases for various OMAP processors
62 * Except the tap base, rest all the io bases
63 * listed are physical addresses.
64 */
65struct omap_globals {
66 u32 class; /* OMAP class to detect */
67 void __iomem *tap; /* Control module ID code */
68 void __iomem *sdrc; /* SDRAM Controller */
69 void __iomem *sms; /* SDRAM Memory Scheduler */
70 void __iomem *ctrl; /* System Control Module */
71 void __iomem *ctrl_pad; /* PAD Control Module */
72 void __iomem *prm; /* Power and Reset Management */
73 void __iomem *cm; /* Clock Management */
74 void __iomem *cm2;
75};
76
77void omap2_set_globals_242x(void);
78void omap2_set_globals_243x(void);
79void omap2_set_globals_3xxx(void);
80void omap2_set_globals_443x(void);
81void omap2_set_globals_ti816x(void);
82
83/* These get called from omap2_set_globals_xxxx(), do not call these */
84void omap2_set_globals_tap(struct omap_globals *);
85void omap2_set_globals_sdrc(struct omap_globals *);
86void omap2_set_globals_control(struct omap_globals *);
87void omap2_set_globals_prcm(struct omap_globals *);
88
89void omap242x_map_io(void);
90void omap243x_map_io(void);
91void omap3_map_io(void);
92void omap4_map_io(void);
93
94
95/**
96 * omap_test_timeout - busy-loop, testing a condition
97 * @cond: condition to test until it evaluates to true
98 * @timeout: maximum number of microseconds in the timeout
99 * @index: loop index (integer)
100 *
101 * Loop waiting for @cond to become true or until at least @timeout
102 * microseconds have passed. To use, define some integer @index in the
103 * calling code. After running, if @index == @timeout, then the loop has
104 * timed out.
105 */
106#define omap_test_timeout(cond, timeout, index) \
107({ \
108 for (index = 0; index < timeout; index++) { \
109 if (cond) \
110 break; \
111 udelay(1); \
112 } \
113})
114
115extern struct device *omap2_get_mpuss_device(void);
116extern struct device *omap2_get_iva_device(void);
117extern struct device *omap2_get_l3_device(void);
118extern struct device *omap4_get_dsp_device(void);
119
120#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ 40#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 7f2969eadb85..1234944a4da0 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -247,8 +247,6 @@
247 * NOTE: Please use ioremap + __raw_read/write where possible instead of these 247 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
248 */ 248 */
249 249
250void omap_ioremap_init(void);
251
252extern u8 omap_readb(u32 pa); 250extern u8 omap_readb(u32 pa);
253extern u16 omap_readw(u32 pa); 251extern u16 omap_readw(u32 pa);
254extern u32 omap_readl(u32 pa); 252extern u32 omap_readl(u32 pa);
@@ -257,83 +255,9 @@ extern void omap_writew(u16 v, u32 pa);
257extern void omap_writel(u32 v, u32 pa); 255extern void omap_writel(u32 v, u32 pa);
258 256
259struct omap_sdrc_params; 257struct omap_sdrc_params;
260
261#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
262void omap7xx_map_io(void);
263#else
264static inline void omap_map_io(void)
265{
266}
267#endif
268
269#ifdef CONFIG_ARCH_OMAP15XX
270void omap15xx_map_io(void);
271#else
272static inline void omap15xx_map_io(void)
273{
274}
275#endif
276
277#ifdef CONFIG_ARCH_OMAP16XX
278void omap16xx_map_io(void);
279#else
280static inline void omap16xx_map_io(void)
281{
282}
283#endif
284
285void omap1_init_early(void);
286
287#ifdef CONFIG_SOC_OMAP2420
288extern void omap242x_map_common_io(void);
289#else
290static inline void omap242x_map_common_io(void)
291{
292}
293#endif
294
295#ifdef CONFIG_SOC_OMAP2430
296extern void omap243x_map_common_io(void);
297#else
298static inline void omap243x_map_common_io(void)
299{
300}
301#endif
302
303#ifdef CONFIG_ARCH_OMAP3
304extern void omap34xx_map_common_io(void);
305#else
306static inline void omap34xx_map_common_io(void)
307{
308}
309#endif
310
311#ifdef CONFIG_SOC_OMAPTI816X
312extern void omapti816x_map_common_io(void);
313#else
314static inline void omapti816x_map_common_io(void)
315{
316}
317#endif
318
319#ifdef CONFIG_ARCH_OMAP4
320extern void omap44xx_map_common_io(void);
321#else
322static inline void omap44xx_map_common_io(void)
323{
324}
325#endif
326
327extern void omap2_init_common_infrastructure(void);
328extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 258extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
329 struct omap_sdrc_params *sdrc_cs1); 259 struct omap_sdrc_params *sdrc_cs1);
330 260
331#define __arch_ioremap omap_ioremap
332#define __arch_iounmap omap_iounmap
333
334void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
335void omap_iounmap(volatile void __iomem *addr);
336
337extern void __init omap_init_consistent_dma_size(void); 261extern void __init omap_init_consistent_dma_size(void);
338 262
339#endif 263#endif
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 30e10719b774..ebda7382c65b 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -436,20 +436,6 @@
436#define INTCPS_NR_MIR_REGS 3 436#define INTCPS_NR_MIR_REGS 3
437#define INTCPS_NR_IRQS 96 437#define INTCPS_NR_IRQS 96
438 438
439#ifndef __ASSEMBLY__
440extern void __iomem *omap_irq_base;
441void omap1_init_irq(void);
442void omap2_init_irq(void);
443void omap3_init_irq(void);
444void ti816x_init_irq(void);
445extern int omap_irq_pending(void);
446void omap_intc_save_context(void);
447void omap_intc_restore_context(void);
448void omap3_intc_suspend(void);
449void omap3_intc_prepare_idle(void);
450void omap3_intc_resume_idle(void);
451#endif
452
453#include <mach/hardware.h> 439#include <mach/hardware.h>
454 440
455#ifdef CONFIG_FIQ 441#ifdef CONFIG_FIQ
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index 1ab9fd6abe6d..ac44bde5d36d 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -2,7 +2,7 @@
2 * arch/arm/plat-omap/include/mach/serial.h 2 * arch/arm/plat-omap/include/mach/serial.h
3 * 3 *
4 * Copyright (C) 2009 Texas Instruments 4 * Copyright (C) 2009 Texas Instruments
5 * Addded OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com> 5 * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * 6 *
7 * This program is distributed in the hope that it will be useful, 7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/arch/arm/plat-omap/include/plat/system.h b/arch/arm/plat-omap/include/plat/system.h
index c5fa9e929009..8e5ebd74b129 100644
--- a/arch/arm/plat-omap/include/plat/system.h
+++ b/arch/arm/plat-omap/include/plat/system.h
@@ -12,6 +12,4 @@ static inline void arch_idle(void)
12 cpu_do_idle(); 12 cpu_do_idle();
13} 13}
14 14
15extern void (*arch_reset)(char, const char *);
16
17#endif 15#endif
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
deleted file mode 100644
index 333871f59995..000000000000
--- a/arch/arm/plat-omap/io.c
+++ /dev/null
@@ -1,159 +0,0 @@
1/*
2 * Common io.c file
3 * This file is created by Russell King <rmk+kernel@arm.linux.org.uk>
4 *
5 * Copyright (C) 2009 Texas Instruments
6 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/module.h>
13#include <linux/io.h>
14#include <linux/mm.h>
15#include <linux/dma-mapping.h>
16
17#include <plat/omap7xx.h>
18#include <plat/omap1510.h>
19#include <plat/omap16xx.h>
20#include <plat/omap24xx.h>
21#include <plat/omap34xx.h>
22#include <plat/omap44xx.h>
23
24#define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz)))
25#define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst)))
26
27static int initialized;
28
29/*
30 * Intercept ioremap() requests for addresses in our fixed mapping regions.
31 */
32void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
33{
34
35 WARN(!initialized, "Do not use ioremap before init_early\n");
36
37#ifdef CONFIG_ARCH_OMAP1
38 if (cpu_class_is_omap1()) {
39 if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE))
40 return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT);
41 }
42 if (cpu_is_omap7xx()) {
43 if (BETWEEN(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_SIZE))
44 return XLATE(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_START);
45
46 if (BETWEEN(p, OMAP7XX_DSPREG_BASE, OMAP7XX_DSPREG_SIZE))
47 return XLATE(p, OMAP7XX_DSPREG_BASE,
48 OMAP7XX_DSPREG_START);
49 }
50 if (cpu_is_omap15xx()) {
51 if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE))
52 return XLATE(p, OMAP1510_DSP_BASE, OMAP1510_DSP_START);
53
54 if (BETWEEN(p, OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_SIZE))
55 return XLATE(p, OMAP1510_DSPREG_BASE,
56 OMAP1510_DSPREG_START);
57 }
58 if (cpu_is_omap16xx()) {
59 if (BETWEEN(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_SIZE))
60 return XLATE(p, OMAP16XX_DSP_BASE, OMAP16XX_DSP_START);
61
62 if (BETWEEN(p, OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_SIZE))
63 return XLATE(p, OMAP16XX_DSPREG_BASE,
64 OMAP16XX_DSPREG_START);
65 }
66#endif
67#ifdef CONFIG_ARCH_OMAP2
68 if (cpu_is_omap24xx()) {
69 if (BETWEEN(p, L3_24XX_PHYS, L3_24XX_SIZE))
70 return XLATE(p, L3_24XX_PHYS, L3_24XX_VIRT);
71 if (BETWEEN(p, L4_24XX_PHYS, L4_24XX_SIZE))
72 return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT);
73 }
74 if (cpu_is_omap2420()) {
75 if (BETWEEN(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_SIZE))
76 return XLATE(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_VIRT);
77 if (BETWEEN(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE))
78 return XLATE(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE);
79 if (BETWEEN(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_SIZE))
80 return XLATE(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_VIRT);
81 }
82 if (cpu_is_omap2430()) {
83 if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE))
84 return XLATE(p, L4_WK_243X_PHYS, L4_WK_243X_VIRT);
85 if (BETWEEN(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_SIZE))
86 return XLATE(p, OMAP243X_GPMC_PHYS, OMAP243X_GPMC_VIRT);
87 if (BETWEEN(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_SIZE))
88 return XLATE(p, OMAP243X_SDRC_PHYS, OMAP243X_SDRC_VIRT);
89 if (BETWEEN(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_SIZE))
90 return XLATE(p, OMAP243X_SMS_PHYS, OMAP243X_SMS_VIRT);
91 }
92#endif
93#ifdef CONFIG_ARCH_OMAP3
94 if (cpu_is_ti816x()) {
95 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
96 return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
97 } else if (cpu_is_omap34xx()) {
98 if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))
99 return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);
100 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
101 return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
102 if (BETWEEN(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_SIZE))
103 return XLATE(p, OMAP34XX_GPMC_PHYS, OMAP34XX_GPMC_VIRT);
104 if (BETWEEN(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_SIZE))
105 return XLATE(p, OMAP343X_SMS_PHYS, OMAP343X_SMS_VIRT);
106 if (BETWEEN(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_SIZE))
107 return XLATE(p, OMAP343X_SDRC_PHYS, OMAP343X_SDRC_VIRT);
108 if (BETWEEN(p, L4_PER_34XX_PHYS, L4_PER_34XX_SIZE))
109 return XLATE(p, L4_PER_34XX_PHYS, L4_PER_34XX_VIRT);
110 if (BETWEEN(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_SIZE))
111 return XLATE(p, L4_EMU_34XX_PHYS, L4_EMU_34XX_VIRT);
112 }
113#endif
114#ifdef CONFIG_ARCH_OMAP4
115 if (cpu_is_omap44xx()) {
116 if (BETWEEN(p, L3_44XX_PHYS, L3_44XX_SIZE))
117 return XLATE(p, L3_44XX_PHYS, L3_44XX_VIRT);
118 if (BETWEEN(p, L4_44XX_PHYS, L4_44XX_SIZE))
119 return XLATE(p, L4_44XX_PHYS, L4_44XX_VIRT);
120 if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE))
121 return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT);
122 if (BETWEEN(p, OMAP44XX_EMIF1_PHYS, OMAP44XX_EMIF1_SIZE))
123 return XLATE(p, OMAP44XX_EMIF1_PHYS, \
124 OMAP44XX_EMIF1_VIRT);
125 if (BETWEEN(p, OMAP44XX_EMIF2_PHYS, OMAP44XX_EMIF2_SIZE))
126 return XLATE(p, OMAP44XX_EMIF2_PHYS, \
127 OMAP44XX_EMIF2_VIRT);
128 if (BETWEEN(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_SIZE))
129 return XLATE(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_VIRT);
130 if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE))
131 return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT);
132 if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE))
133 return XLATE(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_VIRT);
134 }
135#endif
136 return __arm_ioremap_caller(p, size, type, __builtin_return_address(0));
137}
138EXPORT_SYMBOL(omap_ioremap);
139
140void omap_iounmap(volatile void __iomem *addr)
141{
142 unsigned long virt = (unsigned long)addr;
143
144 if (virt >= VMALLOC_START && virt < VMALLOC_END)
145 __iounmap(addr);
146}
147EXPORT_SYMBOL(omap_iounmap);
148
149void __init omap_init_consistent_dma_size(void)
150{
151#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
152 init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
153#endif
154}
155
156void __init omap_ioremap_init(void)
157{
158 initialized++;
159}
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 41ab97ebe4cf..10d160888133 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -384,12 +384,16 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
384 struct orion_gpio_chip *ochip; 384 struct orion_gpio_chip *ochip;
385 struct irq_chip_generic *gc; 385 struct irq_chip_generic *gc;
386 struct irq_chip_type *ct; 386 struct irq_chip_type *ct;
387 char gc_label[16];
387 388
388 if (orion_gpio_chip_count == ARRAY_SIZE(orion_gpio_chips)) 389 if (orion_gpio_chip_count == ARRAY_SIZE(orion_gpio_chips))
389 return; 390 return;
390 391
392 snprintf(gc_label, sizeof(gc_label), "orion_gpio%d",
393 orion_gpio_chip_count);
394
391 ochip = orion_gpio_chips + orion_gpio_chip_count; 395 ochip = orion_gpio_chips + orion_gpio_chip_count;
392 ochip->chip.label = "orion_gpio"; 396 ochip->chip.label = kstrdup(gc_label, GFP_KERNEL);
393 ochip->chip.request = orion_gpio_request; 397 ochip->chip.request = orion_gpio_request;
394 ochip->chip.direction_input = orion_gpio_direction_input; 398 ochip->chip.direction_input = orion_gpio_direction_input;
395 ochip->chip.get = orion_gpio_get; 399 ochip->chip.get = orion_gpio_get;
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 69a61367e4b8..1ed8d1397fcf 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/clockchips.h> 16#include <linux/clockchips.h>
18#include <linux/interrupt.h> 17#include <linux/interrupt.h>
@@ -60,24 +59,10 @@ static u32 ticks_per_jiffy;
60 * Orion's sched_clock implementation. It has a resolution of 59 * Orion's sched_clock implementation. It has a resolution of
61 * at least 7.5ns (133MHz TCLK). 60 * at least 7.5ns (133MHz TCLK).
62 */ 61 */
63static DEFINE_CLOCK_DATA(cd);
64 62
65unsigned long long notrace sched_clock(void) 63static u32 notrace orion_read_sched_clock(void)
66{ 64{
67 u32 cyc = ~readl(timer_base + TIMER0_VAL_OFF); 65 return ~readl(timer_base + TIMER0_VAL_OFF);
68 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
69}
70
71
72static void notrace orion_update_sched_clock(void)
73{
74 u32 cyc = ~readl(timer_base + TIMER0_VAL_OFF);
75 update_sched_clock(&cd, cyc, (u32)~0);
76}
77
78static void __init setup_sched_clock(unsigned long tclk)
79{
80 init_sched_clock(&cd, orion_update_sched_clock, 32, tclk);
81} 66}
82 67
83/* 68/*
@@ -217,7 +202,7 @@ orion_time_init(u32 _bridge_base, u32 _bridge_timer1_clr_mask,
217 /* 202 /*
218 * Set scale and timer for sched_clock. 203 * Set scale and timer for sched_clock.
219 */ 204 */
220 setup_sched_clock(tclk); 205 setup_sched_clock(orion_read_sched_clock, 32, tclk);
221 206
222 /* 207 /*
223 * Setup free-running clocksource timer (interrupts 208 * Setup free-running clocksource timer (interrupts
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index bcc43f346272..084604be6ad1 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -19,7 +19,7 @@
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
diff --git a/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c b/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c
index a9276667c2fb..c7adad0e8de0 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c
@@ -12,7 +12,7 @@
12*/ 12*/
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/module.h> 15#include <linux/export.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
index b3d3d0278997..468079938884 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -20,7 +20,7 @@
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/sysdev.h> 23#include <linux/device.h>
24#include <linux/sysfs.h> 24#include <linux/sysfs.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26 26
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 3c6335307fb1..1121df13e15f 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -192,27 +192,6 @@ static unsigned long s3c24xx_read_idcode_v4(void)
192 return __raw_readl(S3C2410_GSTATUS1); 192 return __raw_readl(S3C2410_GSTATUS1);
193} 193}
194 194
195/* Hook for arm_pm_restart to ensure we execute the reset code
196 * with the caches enabled. It seems at least the S3C2440 has a problem
197 * resetting if there is bus activity interrupted by the reset.
198 */
199static void s3c24xx_pm_restart(char mode, const char *cmd)
200{
201 if (mode != 's') {
202 unsigned long flags;
203
204 local_irq_save(flags);
205 __cpuc_flush_kern_all();
206 __cpuc_flush_user_all();
207
208 arch_reset(mode, cmd);
209 local_irq_restore(flags);
210 }
211
212 /* fallback, or unhandled */
213 arm_machine_restart(mode, cmd);
214}
215
216void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) 195void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
217{ 196{
218 /* initialise the io descriptors we need for initialisation */ 197 /* initialise the io descriptors we need for initialisation */
@@ -226,7 +205,5 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
226 } 205 }
227 s3c24xx_init_cpu(); 206 s3c24xx_init_cpu();
228 207
229 arm_pm_restart = s3c24xx_pm_restart;
230
231 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); 208 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
232} 209}
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index fc8c5f89954d..bc42c04091fd 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -22,7 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/ioport.h> 24#include <linux/ioport.h>
25#include <linux/sysdev.h> 25#include <linux/device.h>
26#include <linux/syscore_ops.h> 26#include <linux/syscore_ops.h>
27 27
28#include <asm/irq.h> 28#include <asm/irq.h>
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/plat-s3c24xx/pm-simtec.c
index 663b280d65da..68296b1fe7e5 100644
--- a/arch/arm/plat-s3c24xx/pm-simtec.c
+++ b/arch/arm/plat-s3c24xx/pm-simtec.c
@@ -18,7 +18,6 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sysdev.h>
22#include <linux/device.h> 21#include <linux/device.h>
23#include <linux/io.h> 22#include <linux/io.h>
24 23
diff --git a/arch/arm/plat-s3c24xx/s3c2410-clock.c b/arch/arm/plat-s3c24xx/s3c2410-clock.c
index def76aa3825a..25dc4d4397b1 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2410-clock.c
@@ -26,7 +26,7 @@
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/sysdev.h> 29#include <linux/device.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
diff --git a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
index 0b46d3895d62..48eee39ab369 100644
--- a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
+++ b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
@@ -17,7 +17,7 @@
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/err.h> 23#include <linux/err.h>
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index 9b9968fa8695..8167ce66188c 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -11,6 +11,7 @@ config PLAT_S5P
11 default y 11 default y
12 select ARM_VIC if !ARCH_EXYNOS4 12 select ARM_VIC if !ARCH_EXYNOS4
13 select ARM_GIC if ARCH_EXYNOS4 13 select ARM_GIC if ARCH_EXYNOS4
14 select GIC_NON_BANKED if ARCH_EXYNOS4
14 select NO_IOPORT 15 select NO_IOPORT
15 select ARCH_REQUIRE_GPIOLIB 16 select ARCH_REQUIRE_GPIOLIB
16 select S3C_GPIO_TRACK 17 select S3C_GPIO_TRACK
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index 876344038b8d..30d8c3016e6b 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -13,7 +13,6 @@ obj- :=
13# Core files 13# Core files
14 14
15obj-y += dev-uart.o 15obj-y += dev-uart.o
16obj-y += cpu.o
17obj-y += clock.o 16obj-y += clock.o
18obj-y += irq.o 17obj-y += irq.o
19obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o 18obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c
index 5f84a3f13ef9..963edea7f7e7 100644
--- a/arch/arm/plat-s5p/clock.c
+++ b/arch/arm/plat-s5p/clock.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <asm/div64.h> 22#include <asm/div64.h>
23 23
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
deleted file mode 100644
index a56959e83516..000000000000
--- a/arch/arm/plat-s5p/cpu.c
+++ /dev/null
@@ -1,144 +0,0 @@
1/* linux/arch/arm/plat-s5p/cpu.c
2 *
3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P CPU Support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/init.h>
14#include <linux/module.h>
15
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18
19#include <mach/map.h>
20#include <mach/regs-clock.h>
21
22#include <plat/cpu.h>
23#include <plat/s5p6440.h>
24#include <plat/s5p6450.h>
25#include <plat/s5pc100.h>
26#include <plat/s5pv210.h>
27#include <plat/exynos4.h>
28
29/* table of supported CPUs */
30
31static const char name_s5p6440[] = "S5P6440";
32static const char name_s5p6450[] = "S5P6450";
33static const char name_s5pc100[] = "S5PC100";
34static const char name_s5pv210[] = "S5PV210/S5PC110";
35static const char name_exynos4210[] = "EXYNOS4210";
36static const char name_exynos4212[] = "EXYNOS4212";
37static const char name_exynos4412[] = "EXYNOS4412";
38
39static struct cpu_table cpu_ids[] __initdata = {
40 {
41 .idcode = S5P6440_CPU_ID,
42 .idmask = S5P64XX_CPU_MASK,
43 .map_io = s5p6440_map_io,
44 .init_clocks = s5p6440_init_clocks,
45 .init_uarts = s5p6440_init_uarts,
46 .init = s5p64x0_init,
47 .name = name_s5p6440,
48 }, {
49 .idcode = S5P6450_CPU_ID,
50 .idmask = S5P64XX_CPU_MASK,
51 .map_io = s5p6450_map_io,
52 .init_clocks = s5p6450_init_clocks,
53 .init_uarts = s5p6450_init_uarts,
54 .init = s5p64x0_init,
55 .name = name_s5p6450,
56 }, {
57 .idcode = S5PC100_CPU_ID,
58 .idmask = S5PC100_CPU_MASK,
59 .map_io = s5pc100_map_io,
60 .init_clocks = s5pc100_init_clocks,
61 .init_uarts = s5pc100_init_uarts,
62 .init = s5pc100_init,
63 .name = name_s5pc100,
64 }, {
65 .idcode = S5PV210_CPU_ID,
66 .idmask = S5PV210_CPU_MASK,
67 .map_io = s5pv210_map_io,
68 .init_clocks = s5pv210_init_clocks,
69 .init_uarts = s5pv210_init_uarts,
70 .init = s5pv210_init,
71 .name = name_s5pv210,
72 }, {
73 .idcode = EXYNOS4210_CPU_ID,
74 .idmask = EXYNOS4_CPU_MASK,
75 .map_io = exynos4_map_io,
76 .init_clocks = exynos4_init_clocks,
77 .init_uarts = exynos4_init_uarts,
78 .init = exynos_init,
79 .name = name_exynos4210,
80 }, {
81 .idcode = EXYNOS4212_CPU_ID,
82 .idmask = EXYNOS4_CPU_MASK,
83 .map_io = exynos4_map_io,
84 .init_clocks = exynos4_init_clocks,
85 .init_uarts = exynos4_init_uarts,
86 .init = exynos_init,
87 .name = name_exynos4212,
88 }, {
89 .idcode = EXYNOS4412_CPU_ID,
90 .idmask = EXYNOS4_CPU_MASK,
91 .map_io = exynos4_map_io,
92 .init_clocks = exynos4_init_clocks,
93 .init_uarts = exynos4_init_uarts,
94 .init = exynos_init,
95 .name = name_exynos4412,
96 },
97};
98
99/* minimal IO mapping */
100
101static struct map_desc s5p_iodesc[] __initdata = {
102 {
103 .virtual = (unsigned long)S5P_VA_CHIPID,
104 .pfn = __phys_to_pfn(S5P_PA_CHIPID),
105 .length = SZ_4K,
106 .type = MT_DEVICE,
107 }, {
108 .virtual = (unsigned long)S3C_VA_SYS,
109 .pfn = __phys_to_pfn(S5P_PA_SYSCON),
110 .length = SZ_64K,
111 .type = MT_DEVICE,
112 }, {
113 .virtual = (unsigned long)S3C_VA_TIMER,
114 .pfn = __phys_to_pfn(S5P_PA_TIMER),
115 .length = SZ_16K,
116 .type = MT_DEVICE,
117 }, {
118 .virtual = (unsigned long)S3C_VA_WATCHDOG,
119 .pfn = __phys_to_pfn(S3C_PA_WDT),
120 .length = SZ_4K,
121 .type = MT_DEVICE,
122 }, {
123 .virtual = (unsigned long)S5P_VA_SROMC,
124 .pfn = __phys_to_pfn(S5P_PA_SROMC),
125 .length = SZ_4K,
126 .type = MT_DEVICE,
127 },
128};
129
130/* read cpu identification code */
131
132void __init s5p_init_io(struct map_desc *mach_desc,
133 int size, void __iomem *cpuid_addr)
134{
135 /* initialize the io descriptors we need for initialization */
136 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
137 if (mach_desc)
138 iotable_init(mach_desc, size);
139
140 /* detect cpu id and rev. */
141 s5p_init_cpu(cpuid_addr);
142
143 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
144}
diff --git a/arch/arm/plat-s5p/irq-eint.c b/arch/arm/plat-s5p/irq-eint.c
index b5bb774985b0..c496b359c371 100644
--- a/arch/arm/plat-s5p/irq-eint.c
+++ b/arch/arm/plat-s5p/irq-eint.c
@@ -14,7 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19 19
20#include <asm/hardware/vic.h> 20#include <asm/hardware/vic.h>
diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c
index c833e7b57599..17c0a2c58dfd 100644
--- a/arch/arm/plat-s5p/s5p-time.c
+++ b/arch/arm/plat-s5p/s5p-time.c
@@ -10,7 +10,6 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <linux/sched.h>
14#include <linux/interrupt.h> 13#include <linux/interrupt.h>
15#include <linux/irq.h> 14#include <linux/irq.h>
16#include <linux/err.h> 15#include <linux/err.h>
@@ -321,26 +320,14 @@ static void __iomem *s5p_timer_reg(void)
321 * this wraps around for now, since it is just a relative time 320 * this wraps around for now, since it is just a relative time
322 * stamp. (Inspired by U300 implementation.) 321 * stamp. (Inspired by U300 implementation.)
323 */ 322 */
324static DEFINE_CLOCK_DATA(cd); 323static u32 notrace s5p_read_sched_clock(void)
325
326unsigned long long notrace sched_clock(void)
327{ 324{
328 void __iomem *reg = s5p_timer_reg(); 325 void __iomem *reg = s5p_timer_reg();
329 326
330 if (!reg) 327 if (!reg)
331 return 0; 328 return 0;
332 329
333 return cyc_to_sched_clock(&cd, ~__raw_readl(reg), (u32)~0); 330 return ~__raw_readl(reg);
334}
335
336static void notrace s5p_update_sched_clock(void)
337{
338 void __iomem *reg = s5p_timer_reg();
339
340 if (!reg)
341 return;
342
343 update_sched_clock(&cd, ~__raw_readl(reg), (u32)~0);
344} 331}
345 332
346static void __init s5p_clocksource_init(void) 333static void __init s5p_clocksource_init(void)
@@ -358,7 +345,7 @@ static void __init s5p_clocksource_init(void)
358 s5p_time_setup(timer_source.source_id, TCNT_MAX); 345 s5p_time_setup(timer_source.source_id, TCNT_MAX);
359 s5p_time_start(timer_source.source_id, PERIODIC); 346 s5p_time_start(timer_source.source_id, PERIODIC);
360 347
361 init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate); 348 setup_sched_clock(s5p_read_sched_clock, 32, clock_rate);
362 349
363 if (clocksource_mmio_init(s5p_timer_reg(), "s5p_clocksource_timer", 350 if (clocksource_mmio_init(s5p_timer_reg(), "s5p_clocksource_timer",
364 clock_rate, 250, 32, clocksource_mmio_readl_down)) 351 clock_rate, 250, 32, clocksource_mmio_readl_down))
diff --git a/arch/arm/plat-s5p/sysmmu.c b/arch/arm/plat-s5p/sysmmu.c
index e1cbc728c775..c8bec9c7655d 100644
--- a/arch/arm/plat-s5p/sysmmu.c
+++ b/arch/arm/plat-s5p/sysmmu.c
@@ -11,6 +11,7 @@
11#include <linux/io.h> 11#include <linux/io.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/export.h>
14 15
15#include <asm/pgtable.h> 16#include <asm/pgtable.h>
16 17
diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c
index ae8b8507663f..786a4107a157 100644
--- a/arch/arm/plat-samsung/clock-clksrc.c
+++ b/arch/arm/plat-samsung/clock-clksrc.c
@@ -16,7 +16,7 @@
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <plat/clock.h> 22#include <plat/clock.h>
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 3b4451979d1b..10f71179071f 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -33,7 +33,7 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/err.h> 34#include <linux/err.h>
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36#include <linux/sysdev.h> 36#include <linux/device.h>
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <linux/ioport.h> 38#include <linux/ioport.h>
39#include <linux/clk.h> 39#include <linux/clk.h>
diff --git a/arch/arm/plat-samsung/dev-backlight.c b/arch/arm/plat-samsung/dev-backlight.c
index e657305644cc..a976c023b286 100644
--- a/arch/arm/plat-samsung/dev-backlight.c
+++ b/arch/arm/plat-samsung/dev-backlight.c
@@ -15,7 +15,6 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/pwm_backlight.h> 17#include <linux/pwm_backlight.h>
18#include <linux/slab.h>
19 18
20#include <plat/devs.h> 19#include <plat/devs.h>
21#include <plat/gpio-cfg.h> 20#include <plat/gpio-cfg.h>
diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h b/arch/arm/plat-samsung/include/plat/cpu-freq-core.h
index dac4760c0f0a..95509d8eb140 100644
--- a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h
+++ b/arch/arm/plat-samsung/include/plat/cpu-freq-core.h
@@ -202,14 +202,6 @@ extern int s3c_plltab_register(struct cpufreq_frequency_table *plls,
202extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void); 202extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void);
203extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void); 203extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void);
204 204
205extern void s3c2410_iotiming_debugfs(struct seq_file *seq,
206 struct s3c_cpufreq_config *cfg,
207 union s3c_iobank *iob);
208
209extern void s3c2412_iotiming_debugfs(struct seq_file *seq,
210 struct s3c_cpufreq_config *cfg,
211 union s3c_iobank *iob);
212
213#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS 205#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS
214#define s3c_cpufreq_debugfs_call(x) x 206#define s3c_cpufreq_debugfs_call(x) x
215#else 207#else
@@ -226,6 +218,10 @@ extern void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg);
226extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg); 218extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg);
227 219
228#ifdef CONFIG_S3C2410_IOTIMING 220#ifdef CONFIG_S3C2410_IOTIMING
221extern void s3c2410_iotiming_debugfs(struct seq_file *seq,
222 struct s3c_cpufreq_config *cfg,
223 union s3c_iobank *iob);
224
229extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, 225extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg,
230 struct s3c_iotimings *iot); 226 struct s3c_iotimings *iot);
231 227
@@ -235,6 +231,7 @@ extern int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg,
235extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg, 231extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg,
236 struct s3c_iotimings *iot); 232 struct s3c_iotimings *iot);
237#else 233#else
234#define s3c2410_iotiming_debugfs NULL
238#define s3c2410_iotiming_calc NULL 235#define s3c2410_iotiming_calc NULL
239#define s3c2410_iotiming_get NULL 236#define s3c2410_iotiming_get NULL
240#define s3c2410_iotiming_set NULL 237#define s3c2410_iotiming_set NULL
@@ -242,8 +239,10 @@ extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg,
242 239
243/* S3C2412 compatible routines */ 240/* S3C2412 compatible routines */
244 241
245extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, 242#ifdef CONFIG_S3C2412_IOTIMING
246 struct s3c_iotimings *timings); 243extern void s3c2412_iotiming_debugfs(struct seq_file *seq,
244 struct s3c_cpufreq_config *cfg,
245 union s3c_iobank *iob);
247 246
248extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, 247extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg,
249 struct s3c_iotimings *timings); 248 struct s3c_iotimings *timings);
@@ -253,6 +252,12 @@ extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg,
253 252
254extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg, 253extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg,
255 struct s3c_iotimings *iot); 254 struct s3c_iotimings *iot);
255#else
256#define s3c2412_iotiming_debugfs NULL
257#define s3c2412_iotiming_calc NULL
258#define s3c2412_iotiming_get NULL
259#define s3c2412_iotiming_set NULL
260#endif /* CONFIG_S3C2412_IOTIMING */
256 261
257#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG 262#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG
258#define s3c_freq_dbg(x...) printk(KERN_INFO x) 263#define s3c_freq_dbg(x...) printk(KERN_INFO x)
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index 40fd7b6b5e66..73cb3cfd0685 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -152,13 +152,9 @@ extern void s3c_init_cpu(unsigned long idcode,
152/* core initialisation functions */ 152/* core initialisation functions */
153 153
154extern void s3c24xx_init_irq(void); 154extern void s3c24xx_init_irq(void);
155extern void s3c64xx_init_irq(u32 vic0, u32 vic1);
156extern void s5p_init_irq(u32 *vic, u32 num_vic); 155extern void s5p_init_irq(u32 *vic, u32 num_vic);
157 156
158extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); 157extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
159extern void s3c64xx_init_io(struct map_desc *mach_desc, int size);
160extern void s5p_init_io(struct map_desc *mach_desc,
161 int size, void __iomem *cpuid_addr);
162 158
163extern void s3c24xx_init_cpu(void); 159extern void s3c24xx_init_cpu(void);
164extern void s3c64xx_init_cpu(void); 160extern void s3c64xx_init_cpu(void);
@@ -183,22 +179,20 @@ extern struct syscore_ops s3c2410_pm_syscore_ops;
183extern struct syscore_ops s3c2412_pm_syscore_ops; 179extern struct syscore_ops s3c2412_pm_syscore_ops;
184extern struct syscore_ops s3c2416_pm_syscore_ops; 180extern struct syscore_ops s3c2416_pm_syscore_ops;
185extern struct syscore_ops s3c244x_pm_syscore_ops; 181extern struct syscore_ops s3c244x_pm_syscore_ops;
186extern struct syscore_ops s3c64xx_irq_syscore_ops; 182
187 183/* system device subsystems */
188/* system device classes */ 184
189 185extern struct bus_type s3c2410_subsys;
190extern struct sysdev_class s3c2410_sysclass; 186extern struct bus_type s3c2410a_subsys;
191extern struct sysdev_class s3c2410a_sysclass; 187extern struct bus_type s3c2412_subsys;
192extern struct sysdev_class s3c2412_sysclass; 188extern struct bus_type s3c2416_subsys;
193extern struct sysdev_class s3c2416_sysclass; 189extern struct bus_type s3c2440_subsys;
194extern struct sysdev_class s3c2440_sysclass; 190extern struct bus_type s3c2442_subsys;
195extern struct sysdev_class s3c2442_sysclass; 191extern struct bus_type s3c2443_subsys;
196extern struct sysdev_class s3c2443_sysclass; 192extern struct bus_type s3c6410_subsys;
197extern struct sysdev_class s3c6410_sysclass; 193extern struct bus_type s5p64x0_subsys;
198extern struct sysdev_class s3c64xx_sysclass; 194extern struct bus_type s5pv210_subsys;
199extern struct sysdev_class s5p64x0_sysclass; 195extern struct bus_type exynos4_subsys;
200extern struct sysdev_class s5pv210_sysclass;
201extern struct sysdev_class exynos4_sysclass;
202 196
203extern void (*s5pc1xx_idle)(void); 197extern void (*s5pc1xx_idle)(void);
204 198
diff --git a/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
index 1c1ed5481253..d01576318b2c 100644
--- a/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
+++ b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
@@ -12,7 +12,7 @@
12 12
13#include <plat/dma-core.h> 13#include <plat/dma-core.h>
14 14
15extern struct sysdev_class dma_sysclass; 15extern struct bus_type dma_subsys;
16extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS]; 16extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS];
17 17
18#define DMA_CH_VALID (1<<31) 18#define DMA_CH_VALID (1<<31)
diff --git a/arch/arm/plat-samsung/include/plat/exynos4.h b/arch/arm/plat-samsung/include/plat/exynos4.h
deleted file mode 100644
index f546e88ebc94..000000000000
--- a/arch/arm/plat-samsung/include/plat/exynos4.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/exynos4.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Header file for exynos4 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for EXYNOS4 related SoCs */
14
15extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void exynos4_register_clocks(void);
17extern void exynos4210_register_clocks(void);
18extern void exynos4212_register_clocks(void);
19extern void exynos4_setup_clocks(void);
20
21#ifdef CONFIG_ARCH_EXYNOS
22extern int exynos_init(void);
23extern void exynos4_init_irq(void);
24extern void exynos4_map_io(void);
25extern void exynos4_init_clocks(int xtal);
26extern struct sys_timer exynos4_timer;
27
28#define exynos4_init_uarts exynos4_common_init_uarts
29
30#else
31#define exynos4_init_clocks NULL
32#define exynos4_init_uarts NULL
33#define exynos4_map_io NULL
34#define exynos_init NULL
35#endif
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index d48245bb02b3..df8155b9d4d1 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -24,6 +24,8 @@
24#ifndef __PLAT_GPIO_CFG_H 24#ifndef __PLAT_GPIO_CFG_H
25#define __PLAT_GPIO_CFG_H __FILE__ 25#define __PLAT_GPIO_CFG_H __FILE__
26 26
27#include<linux/types.h>
28
27typedef unsigned int __bitwise__ samsung_gpio_pull_t; 29typedef unsigned int __bitwise__ samsung_gpio_pull_t;
28typedef unsigned int __bitwise__ s5p_gpio_drvstr_t; 30typedef unsigned int __bitwise__ s5p_gpio_drvstr_t;
29 31
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index dcf68709f9cf..61fc53740fbd 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -17,11 +17,12 @@
17 17
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20struct sys_device; 20struct device;
21 21
22#ifdef CONFIG_PM 22#ifdef CONFIG_PM
23 23
24extern __init int s3c_pm_init(void); 24extern __init int s3c_pm_init(void);
25extern __init int s3c64xx_pm_init(void);
25 26
26#else 27#else
27 28
@@ -29,6 +30,11 @@ static inline int s3c_pm_init(void)
29{ 30{
30 return 0; 31 return 0;
31} 32}
33
34static inline int s3c64xx_pm_init(void)
35{
36 return 0;
37}
32#endif 38#endif
33 39
34/* configuration for the IRQ mask over sleep */ 40/* configuration for the IRQ mask over sleep */
diff --git a/arch/arm/plat-samsung/include/plat/reset.h b/arch/arm/plat-samsung/include/plat/reset.h
deleted file mode 100644
index 32ca5179c6e1..000000000000
--- a/arch/arm/plat-samsung/include/plat/reset.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/reset.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#ifndef __PLAT_SAMSUNG_RESET_H
12#define __PLAT_SAMSUNG_RESET_H __FILE__
13
14extern void (*s5p_reset_hook)(void);
15
16#endif /* __PLAT_SAMSUNG_RESET_H */
diff --git a/arch/arm/plat-samsung/include/plat/s3c2412.h b/arch/arm/plat-samsung/include/plat/s3c2412.h
index 5bcfd143ba16..cbae50ddacc8 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2412.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2412.h
@@ -21,9 +21,12 @@ extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
21extern void s3c2412_init_clocks(int xtal); 21extern void s3c2412_init_clocks(int xtal);
22 22
23extern int s3c2412_baseclk_add(void); 23extern int s3c2412_baseclk_add(void);
24
25extern void s3c2412_restart(char mode, const char *cmd);
24#else 26#else
25#define s3c2412_init_clocks NULL 27#define s3c2412_init_clocks NULL
26#define s3c2412_init_uarts NULL 28#define s3c2412_init_uarts NULL
27#define s3c2412_map_io NULL 29#define s3c2412_map_io NULL
28#define s3c2412_init NULL 30#define s3c2412_init NULL
31#define s3c2412_restart NULL
29#endif 32#endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c2416.h b/arch/arm/plat-samsung/include/plat/s3c2416.h
index a764f8503f52..de2b5bdc5ebd 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2416.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2416.h
@@ -23,9 +23,11 @@ extern void s3c2416_init_clocks(int xtal);
23 23
24extern int s3c2416_baseclk_add(void); 24extern int s3c2416_baseclk_add(void);
25 25
26extern void s3c2416_restart(char mode, const char *cmd);
26#else 27#else
27#define s3c2416_init_clocks NULL 28#define s3c2416_init_clocks NULL
28#define s3c2416_init_uarts NULL 29#define s3c2416_init_uarts NULL
29#define s3c2416_map_io NULL 30#define s3c2416_map_io NULL
30#define s3c2416_init NULL 31#define s3c2416_init NULL
32#define s3c2416_restart NULL
31#endif 33#endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c2443.h b/arch/arm/plat-samsung/include/plat/s3c2443.h
index 7fae1a050694..dce05b43d51c 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2443.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2443.h
@@ -24,11 +24,13 @@ extern void s3c2443_init_clocks(int xtal);
24 24
25extern int s3c2443_baseclk_add(void); 25extern int s3c2443_baseclk_add(void);
26 26
27extern void s3c2443_restart(char mode, const char *cmd);
27#else 28#else
28#define s3c2443_init_clocks NULL 29#define s3c2443_init_clocks NULL
29#define s3c2443_init_uarts NULL 30#define s3c2443_init_uarts NULL
30#define s3c2443_map_io NULL 31#define s3c2443_map_io NULL
31#define s3c2443_init NULL 32#define s3c2443_init NULL
33#define s3c2443_restart NULL
32#endif 34#endif
33 35
34/* common code used by s3c2443 and others. 36/* common code used by s3c2443 and others.
diff --git a/arch/arm/plat-samsung/include/plat/s3c6400.h b/arch/arm/plat-samsung/include/plat/s3c6400.h
deleted file mode 100644
index 37d428aaaebb..000000000000
--- a/arch/arm/plat-samsung/include/plat/s3c6400.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/s3c6400.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * Header file for s3c6400 cpu support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15/* Common init code for S3C6400 related SoCs */
16
17extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
18extern void s3c6400_setup_clocks(void);
19
20extern void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
21
22#ifdef CONFIG_CPU_S3C6400
23
24extern int s3c6400_init(void);
25extern void s3c6400_init_irq(void);
26extern void s3c6400_map_io(void);
27extern void s3c6400_init_clocks(int xtal);
28
29#define s3c6400_init_uarts s3c6400_common_init_uarts
30
31#else
32#define s3c6400_init_clocks NULL
33#define s3c6400_init_uarts NULL
34#define s3c6400_map_io NULL
35#define s3c6400_init NULL
36#endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c6410.h b/arch/arm/plat-samsung/include/plat/s3c6410.h
deleted file mode 100644
index 20a6675b9d17..000000000000
--- a/arch/arm/plat-samsung/include/plat/s3c6410.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/s3c6410.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * Header file for s3c6410 cpu support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifdef CONFIG_CPU_S3C6410
16
17extern int s3c6410_init(void);
18extern void s3c6410_init_irq(void);
19extern void s3c6410_map_io(void);
20extern void s3c6410_init_clocks(int xtal);
21
22#define s3c6410_init_uarts s3c6400_common_init_uarts
23
24#else
25#define s3c6410_init_clocks NULL
26#define s3c6410_init_uarts NULL
27#define s3c6410_map_io NULL
28#define s3c6410_init NULL
29#endif
diff --git a/arch/arm/plat-samsung/include/plat/s5p6440.h b/arch/arm/plat-samsung/include/plat/s5p6440.h
deleted file mode 100644
index bf85ebbb4fbc..000000000000
--- a/arch/arm/plat-samsung/include/plat/s5p6440.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/s5p6440.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5p6440 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13 /* Common init code for S5P6440 related SoCs */
14
15extern void s5p6440_register_clocks(void);
16extern void s5p6440_setup_clocks(void);
17
18#ifdef CONFIG_CPU_S5P6440
19
20extern int s5p64x0_init(void);
21extern void s5p6440_init_irq(void);
22extern void s5p6440_map_io(void);
23extern void s5p6440_init_clocks(int xtal);
24
25extern void s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no);
26
27#else
28#define s5p6440_init_clocks NULL
29#define s5p6440_init_uarts NULL
30#define s5p6440_map_io NULL
31#define s5p64x0_init NULL
32#endif
33
34/* S5P6440 timer */
35
36extern struct sys_timer s5p6440_timer;
diff --git a/arch/arm/plat-samsung/include/plat/s5p6450.h b/arch/arm/plat-samsung/include/plat/s5p6450.h
deleted file mode 100644
index da25f9a1c54a..000000000000
--- a/arch/arm/plat-samsung/include/plat/s5p6450.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/s5p6450.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Header file for s5p6450 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for S5P6450 related SoCs */
14
15extern void s5p6450_register_clocks(void);
16extern void s5p6450_setup_clocks(void);
17
18#ifdef CONFIG_CPU_S5P6450
19
20extern int s5p64x0_init(void);
21extern void s5p6450_init_irq(void);
22extern void s5p6450_map_io(void);
23extern void s5p6450_init_clocks(int xtal);
24
25extern void s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no);
26
27#else
28#define s5p6450_init_clocks NULL
29#define s5p6450_init_uarts NULL
30#define s5p6450_map_io NULL
31#define s5p64x0_init NULL
32#endif
33
34/* S5P6450 timer */
35
36extern struct sys_timer s5p6450_timer;
diff --git a/arch/arm/plat-samsung/include/plat/s5pc100.h b/arch/arm/plat-samsung/include/plat/s5pc100.h
deleted file mode 100644
index 9a21aeaaf452..000000000000
--- a/arch/arm/plat-samsung/include/plat/s5pc100.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/s5pc100.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5pc100 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for S5PC100 related SoCs */
14
15extern void s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void s5pc100_register_clocks(void);
17extern void s5pc100_setup_clocks(void);
18
19#ifdef CONFIG_CPU_S5PC100
20
21extern int s5pc100_init(void);
22extern void s5pc100_init_irq(void);
23extern void s5pc100_map_io(void);
24extern void s5pc100_init_clocks(int xtal);
25
26#define s5pc100_init_uarts s5pc100_common_init_uarts
27
28#else
29#define s5pc100_init_clocks NULL
30#define s5pc100_init_uarts NULL
31#define s5pc100_map_io NULL
32#define s5pc100_init NULL
33#endif
diff --git a/arch/arm/plat-samsung/include/plat/s5pv210.h b/arch/arm/plat-samsung/include/plat/s5pv210.h
deleted file mode 100644
index b4bc6be77072..000000000000
--- a/arch/arm/plat-samsung/include/plat/s5pv210.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/s5pv210.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5pv210 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for S5PV210 related SoCs */
14
15extern void s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void s5pv210_register_clocks(void);
17extern void s5pv210_setup_clocks(void);
18
19#ifdef CONFIG_CPU_S5PV210
20
21extern int s5pv210_init(void);
22extern void s5pv210_init_irq(void);
23extern void s5pv210_map_io(void);
24extern void s5pv210_init_clocks(int xtal);
25
26#define s5pv210_init_uarts s5pv210_common_init_uarts
27
28#else
29#define s5pv210_init_clocks NULL
30#define s5pv210_init_uarts NULL
31#define s5pv210_map_io NULL
32#define s5pv210_init NULL
33#endif
diff --git a/arch/arm/plat-samsung/include/plat/system-reset.h b/arch/arm/plat-samsung/include/plat/system-reset.h
deleted file mode 100644
index a448e990964d..000000000000
--- a/arch/arm/plat-samsung/include/plat/system-reset.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/system-reset.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Based on arch/arm/mach-s3c2410/include/mach/system-reset.h
7 *
8 * S5P - System define for arch_reset()
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <plat/watchdog-reset.h>
16
17void (*s5p_reset_hook)(void);
18
19static void arch_reset(char mode, const char *cmd)
20{
21 /* SWRESET support in s5p_reset_hook() */
22
23 if (s5p_reset_hook)
24 s5p_reset_hook();
25
26 /* Perform reset using Watchdog reset
27 * if there is no s5p_reset_hook()
28 */
29
30 arch_wdt_reset();
31}
diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
index 40dbb2b0ae22..f19aff19205c 100644
--- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
+++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
@@ -17,6 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/delay.h>
20 21
21static inline void arch_wdt_reset(void) 22static inline void arch_wdt_reset(void)
22{ 23{
diff --git a/arch/arm/plat-samsung/pd.c b/arch/arm/plat-samsung/pd.c
index efe1d564473e..312b510d86b7 100644
--- a/arch/arm/plat-samsung/pd.c
+++ b/arch/arm/plat-samsung/pd.c
@@ -11,7 +11,7 @@
11*/ 11*/
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/module.h> 14#include <linux/export.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/pm_runtime.h> 17#include <linux/pm_runtime.h>
diff --git a/arch/arm/plat-samsung/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c
index 4be016eaa6db..c2ff92c30bdf 100644
--- a/arch/arm/plat-samsung/pm-gpio.c
+++ b/arch/arm/plat-samsung/pm-gpio.c
@@ -14,7 +14,7 @@
14*/ 14*/
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c
index dc1185dcf80d..c559d8438c70 100644
--- a/arch/arm/plat-samsung/pwm.c
+++ b/arch/arm/plat-samsung/pwm.c
@@ -11,7 +11,7 @@
11 * the Free Software Foundation; either version 2 of the License. 11 * the Free Software Foundation; either version 2 of the License.
12*/ 12*/
13 13
14#include <linux/module.h> 14#include <linux/export.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
diff --git a/arch/arm/plat-samsung/wakeup-mask.c b/arch/arm/plat-samsung/wakeup-mask.c
index dc814037297b..20c3d9117cc2 100644
--- a/arch/arm/plat-samsung/wakeup-mask.c
+++ b/arch/arm/plat-samsung/wakeup-mask.c
@@ -11,7 +11,7 @@
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/sysdev.h> 14#include <linux/device.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/io.h> 17#include <linux/io.h>
diff --git a/arch/arm/plat-spear/Makefile b/arch/arm/plat-spear/Makefile
index b4f340b8f1f1..e0f2e5b9530c 100644
--- a/arch/arm/plat-spear/Makefile
+++ b/arch/arm/plat-spear/Makefile
@@ -3,6 +3,6 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := clock.o time.o 6obj-y := clock.o restart.o time.o
7 7
8obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o 8obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o
diff --git a/arch/arm/plat-spear/include/plat/system.h b/arch/arm/plat-spear/include/plat/system.h
index a235fa0ca777..86c6f83b44cc 100644
--- a/arch/arm/plat-spear/include/plat/system.h
+++ b/arch/arm/plat-spear/include/plat/system.h
@@ -14,10 +14,6 @@
14#ifndef __PLAT_SYSTEM_H 14#ifndef __PLAT_SYSTEM_H
15#define __PLAT_SYSTEM_H 15#define __PLAT_SYSTEM_H
16 16
17#include <linux/io.h>
18#include <asm/hardware/sp810.h>
19#include <mach/hardware.h>
20
21static inline void arch_idle(void) 17static inline void arch_idle(void)
22{ 18{
23 /* 19 /*
@@ -27,15 +23,4 @@ static inline void arch_idle(void)
27 cpu_do_idle(); 23 cpu_do_idle();
28} 24}
29 25
30static inline void arch_reset(char mode, const char *cmd)
31{
32 if (mode == 's') {
33 /* software reset, Jump into ROM at address 0 */
34 cpu_reset(0);
35 } else {
36 /* hardware reset, Use on-chip reset capability */
37 sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
38 }
39}
40
41#endif /* __PLAT_SYSTEM_H */ 26#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
index 8c8b24d07046..000000000000
--- a/arch/arm/plat-spear/include/plat/vmalloc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/plat-spear/include/plat/vmalloc.h
3 *
4 * Defining Vmalloc area for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_VMALLOC_H
15#define __PLAT_VMALLOC_H
16
17#define VMALLOC_END 0xF0000000UL
18
19#endif /* __PLAT_VMALLOC_H */
diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c
new file mode 100644
index 000000000000..2b4e3d82957c
--- /dev/null
+++ b/arch/arm/plat-spear/restart.c
@@ -0,0 +1,27 @@
1/*
2 * arch/arm/plat-spear/restart.c
3 *
4 * SPEAr platform specific restart functions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13#include <linux/io.h>
14#include <asm/hardware/sp810.h>
15#include <mach/hardware.h>
16#include <mach/generic.h>
17
18void spear_restart(char mode, const char *cmd)
19{
20 if (mode == 's') {
21 /* software reset, Jump into ROM at address 0 */
22 soft_restart(0);
23 } else {
24 /* hardware reset, Use on-chip reset capability */
25 sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
26 }
27}
diff --git a/arch/arm/plat-tcc/Kconfig b/arch/arm/plat-tcc/Kconfig
deleted file mode 100644
index 1bf499570f42..000000000000
--- a/arch/arm/plat-tcc/Kconfig
+++ /dev/null
@@ -1,20 +0,0 @@
1if ARCH_TCC_926
2
3menu "Telechips ARM926-based CPUs"
4
5choice
6 prompt "Telechips CPU type:"
7 default ARCH_TCC8K
8
9config ARCH_TCC8K
10 bool TCC8000
11 select USB_ARCH_HAS_OHCI
12 help
13 Support for Telechips TCC8000 systems
14
15endchoice
16
17source "arch/arm/mach-tcc8k/Kconfig"
18
19endmenu
20endif
diff --git a/arch/arm/plat-tcc/Makefile b/arch/arm/plat-tcc/Makefile
deleted file mode 100644
index eceabc869b8f..000000000000
--- a/arch/arm/plat-tcc/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
1# "Telechips Platform Common Modules"
2
3obj-y := clock.o system.o
diff --git a/arch/arm/plat-tcc/clock.c b/arch/arm/plat-tcc/clock.c
deleted file mode 100644
index f3ced10d5271..000000000000
--- a/arch/arm/plat-tcc/clock.c
+++ /dev/null
@@ -1,179 +0,0 @@
1/*
2 * Clock framework for Telechips SoCs
3 * Based on arch/arm/plat-mxc/clock.c
4 *
5 * Copyright (C) 2004 - 2005 Nokia corporation
6 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
7 * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
8 * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
9 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
10 * Copyright 2010 Hans J. Koch, hjk@linutronix.de
11 *
12 * Licensed under the terms of the GPL v2.
13 */
14
15#include <linux/clk.h>
16#include <linux/err.h>
17#include <linux/errno.h>
18#include <linux/module.h>
19#include <linux/mutex.h>
20#include <linux/string.h>
21
22#include <mach/clock.h>
23#include <mach/hardware.h>
24
25static DEFINE_MUTEX(clocks_mutex);
26
27/*-------------------------------------------------------------------------
28 * Standard clock functions defined in include/linux/clk.h
29 *-------------------------------------------------------------------------*/
30
31static void __clk_disable(struct clk *clk)
32{
33 BUG_ON(clk->refcount == 0);
34
35 if (!(--clk->refcount) && clk->disable) {
36 /* Unconditionally disable the clock in hardware */
37 clk->disable(clk);
38 /* recursively disable parents */
39 if (clk->parent)
40 __clk_disable(clk->parent);
41 }
42}
43
44static int __clk_enable(struct clk *clk)
45{
46 int ret = 0;
47
48 if (clk->refcount++ == 0 && clk->enable) {
49 if (clk->parent)
50 ret = __clk_enable(clk->parent);
51 if (ret)
52 return ret;
53 else
54 return clk->enable(clk);
55 }
56
57 return 0;
58}
59
60/* This function increments the reference count on the clock and enables the
61 * clock if not already enabled. The parent clock tree is recursively enabled
62 */
63int clk_enable(struct clk *clk)
64{
65 int ret = 0;
66
67 if (!clk)
68 return -EINVAL;
69
70 mutex_lock(&clocks_mutex);
71 ret = __clk_enable(clk);
72 mutex_unlock(&clocks_mutex);
73
74 return ret;
75}
76EXPORT_SYMBOL_GPL(clk_enable);
77
78/* This function decrements the reference count on the clock and disables
79 * the clock when reference count is 0. The parent clock tree is
80 * recursively disabled
81 */
82void clk_disable(struct clk *clk)
83{
84 if (!clk)
85 return;
86
87 mutex_lock(&clocks_mutex);
88 __clk_disable(clk);
89 mutex_unlock(&clocks_mutex);
90}
91EXPORT_SYMBOL_GPL(clk_disable);
92
93/* Retrieve the *current* clock rate. If the clock itself
94 * does not provide a special calculation routine, ask
95 * its parent and so on, until one is able to return
96 * a valid clock rate
97 */
98unsigned long clk_get_rate(struct clk *clk)
99{
100 if (!clk)
101 return 0UL;
102
103 if (clk->get_rate)
104 return clk->get_rate(clk);
105
106 return clk_get_rate(clk->parent);
107}
108EXPORT_SYMBOL_GPL(clk_get_rate);
109
110/* Round the requested clock rate to the nearest supported
111 * rate that is less than or equal to the requested rate.
112 * This is dependent on the clock's current parent.
113 */
114long clk_round_rate(struct clk *clk, unsigned long rate)
115{
116 if (!clk)
117 return 0;
118 if (!clk->round_rate)
119 return 0;
120
121 return clk->round_rate(clk, rate);
122}
123EXPORT_SYMBOL_GPL(clk_round_rate);
124
125/* Set the clock to the requested clock rate. The rate must
126 * match a supported rate exactly based on what clk_round_rate returns
127 */
128int clk_set_rate(struct clk *clk, unsigned long rate)
129{
130 int ret = -EINVAL;
131
132 if (!clk)
133 return ret;
134 if (!clk->set_rate || !rate)
135 return ret;
136
137 mutex_lock(&clocks_mutex);
138 ret = clk->set_rate(clk, rate);
139 mutex_unlock(&clocks_mutex);
140
141 return ret;
142}
143EXPORT_SYMBOL_GPL(clk_set_rate);
144
145/* Set the clock's parent to another clock source */
146int clk_set_parent(struct clk *clk, struct clk *parent)
147{
148 struct clk *old;
149 int ret = -EINVAL;
150
151 if (!clk)
152 return ret;
153 if (!clk->set_parent || !parent)
154 return ret;
155
156 mutex_lock(&clocks_mutex);
157 old = clk->parent;
158 if (clk->refcount)
159 __clk_enable(parent);
160 ret = clk->set_parent(clk, parent);
161 if (ret)
162 old = parent;
163 if (clk->refcount)
164 __clk_disable(old);
165 mutex_unlock(&clocks_mutex);
166
167 return ret;
168}
169EXPORT_SYMBOL_GPL(clk_set_parent);
170
171/* Retrieve the clock's parent clock source */
172struct clk *clk_get_parent(struct clk *clk)
173{
174 if (!clk)
175 return NULL;
176
177 return clk->parent;
178}
179EXPORT_SYMBOL_GPL(clk_get_parent);
diff --git a/arch/arm/plat-tcc/include/mach/clock.h b/arch/arm/plat-tcc/include/mach/clock.h
deleted file mode 100644
index a12f58ad71a8..000000000000
--- a/arch/arm/plat-tcc/include/mach/clock.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Low level clock header file for Telechips TCC architecture
3 * (C) 2010 Hans J. Koch <hjk@linutronix.de>
4 *
5 * Licensed under the GPL v2.
6 */
7
8#ifndef __ASM_ARCH_TCC_CLOCK_H__
9#define __ASM_ARCH_TCC_CLOCK_H__
10
11#ifndef __ASSEMBLY__
12
13struct clk {
14 struct clk *parent;
15 /* id number of a root clock, 0 for normal clocks */
16 int root_id;
17 /* Reference count of clock enable/disable */
18 int refcount;
19 /* Address of associated BCLKCTRx register. Must be set. */
20 void __iomem *bclkctr;
21 /* Bit position for BCLKCTRx. Must be set. */
22 int bclk_shift;
23 /* Address of ACLKxxx register, if any. */
24 void __iomem *aclkreg;
25 /* get the current clock rate (always a fresh value) */
26 unsigned long (*get_rate) (struct clk *);
27 /* Function ptr to set the clock to a new rate. The rate must match a
28 supported rate returned from round_rate. Leave blank if clock is not
29 programmable */
30 int (*set_rate) (struct clk *, unsigned long);
31 /* Function ptr to round the requested clock rate to the nearest
32 supported rate that is less than or equal to the requested rate. */
33 unsigned long (*round_rate) (struct clk *, unsigned long);
34 /* Function ptr to enable the clock. Leave blank if clock can not
35 be gated. */
36 int (*enable) (struct clk *);
37 /* Function ptr to disable the clock. Leave blank if clock can not
38 be gated. */
39 void (*disable) (struct clk *);
40 /* Function ptr to set the parent clock of the clock. */
41 int (*set_parent) (struct clk *, struct clk *);
42};
43
44int clk_register(struct clk *clk);
45void clk_unregister(struct clk *clk);
46
47#endif /* __ASSEMBLY__ */
48#endif /* __ASM_ARCH_MXC_CLOCK_H__ */
diff --git a/arch/arm/plat-tcc/include/mach/debug-macro.S b/arch/arm/plat-tcc/include/mach/debug-macro.S
deleted file mode 100644
index cf17d04ec30d..000000000000
--- a/arch/arm/plat-tcc/include/mach/debug-macro.S
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright (C) 1994-1999 Russell King
3 * Copyright (C) 2008-2009 Telechips
4 * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12 .macro addruart, rp, rv, tmp
13 moveq \rp, #0x90000000 @ physical base address
14 movne \rv, #0xF1000000 @ virtual base
15 orr \rp, \rp, #0x00007000 @ UART0
16 orr \rv, \rv, #0x00007000 @ UART0
17 .endm
18
19 .macro senduart,rd,rx
20 strb \rd, [\rx, #0x44]
21 .endm
22
23 .macro waituart,rd,rx
24 .endm
25
26 .macro busyuart,rd,rx
271001:
28 ldr \rd, [\rx, #0x14]
29 tst \rd, #0x20
30
31 beq 1001b
32 .endm
diff --git a/arch/arm/plat-tcc/include/mach/entry-macro.S b/arch/arm/plat-tcc/include/mach/entry-macro.S
deleted file mode 100644
index 748f401e4b6d..000000000000
--- a/arch/arm/plat-tcc/include/mach/entry-macro.S
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * include/asm-arm/arch-tcc83x/entry-macro.S
3 *
4 * Author : <linux@telechips.com>
5 * Created: June 10, 2008
6 * Description: Low-level IRQ helper macros for Telechips-based platforms
7 *
8 * Copyright (C) 2008-2009 Telechips
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#include <mach/hardware.h>
16#include <mach/irqs.h>
17
18 .macro disable_fiq
19 .endm
20
21 .macro get_irqnr_preamble, base, tmp
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2
25 .endm
26
27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
28
29 ldr \base, =0xF2003000 @ base address of PIC registers
30
31 @@ read MREQ register of PIC0
32
33 mov \irqnr, #0
34 ldr \irqstat, [\base, #0x00000014 ] @ lower 32 interrupts
35 cmp \irqstat, #0
36 bne 1001f
37
38 @@ read MREQ register of PIC1
39
40 ldr \irqstat, [\base, #0x00000094] @ upper 32 interrupts
41 cmp \irqstat, #0
42 beq 1002f
43 mov \irqnr, #0x20
44
451001:
46 movs \tmp, \irqstat, lsl #16
47 movne \irqstat, \tmp
48 addeq \irqnr, \irqnr, #16
49
50 movs \tmp, \irqstat, lsl #8
51 movne \irqstat, \tmp
52 addeq \irqnr, \irqnr, #8
53
54 movs \tmp, \irqstat, lsl #4
55 movne \irqstat, \tmp
56 addeq \irqnr, \irqnr, #4
57
58 movs \tmp, \irqstat, lsl #2
59 movne \irqstat, \tmp
60 addeq \irqnr, \irqnr, #2
61
62 movs \tmp, \irqstat, lsl #1
63 addeq \irqnr, \irqnr, #1
64 orrs \base, \base, #1
651002:
66 @@ exit here, Z flag unset if IRQ
67
68 .endm
diff --git a/arch/arm/plat-tcc/include/mach/hardware.h b/arch/arm/plat-tcc/include/mach/hardware.h
deleted file mode 100644
index e70d126ccaf3..000000000000
--- a/arch/arm/plat-tcc/include/mach/hardware.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
3 * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
4 * and Dirk Behme <dirk.behme@de.bosch.com>
5 * Rewritten by: <linux@telechips.com>
6 * Description: Hardware definitions for TCC8300 processors and boards
7 *
8 * Copyright (C) 2001 RidgeRun, Inc.
9 * Copyright (C) 2008-2009 Telechips
10 *
11 * Modifications for mainline (C) 2009 Hans J. Koch <hjk@linutronix.de>
12 *
13 * Licensed under the terms of the GNU Pulic License version 2.
14 */
15
16#ifndef __ASM_ARCH_TCC_HARDWARE_H
17#define __ASM_ARCH_TCC_HARDWARE_H
18
19#include <asm/sizes.h>
20#ifndef __ASSEMBLER__
21#include <asm/types.h>
22#endif
23#include <mach/io.h>
24
25/*
26 * ----------------------------------------------------------------------------
27 * Clocks
28 * ----------------------------------------------------------------------------
29 */
30#define CLKGEN_REG_BASE 0xfffece00
31#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
32#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
33#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
34#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
35#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
36#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
37#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
38#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
39
40/* DPLL control registers */
41#define DPLL_CTL 0xfffecf00
42
43#endif /* __ASM_ARCH_TCC_HARDWARE_H */
diff --git a/arch/arm/plat-tcc/include/mach/io.h b/arch/arm/plat-tcc/include/mach/io.h
deleted file mode 100644
index 3e911d3ea0f1..000000000000
--- a/arch/arm/plat-tcc/include/mach/io.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * IO definitions for TCC8000 processors and boards
3 *
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2008-2009 Telechips
6 * Copyright (C) 2010 Hans J. Koch <hjk@linutronix.de>
7 *
8 * Licensed under the terms of the GNU Public License version 2.
9 */
10
11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16/*
17 * We don't actually have real ISA nor PCI buses, but there is so many
18 * drivers out there that might just work if we fake them...
19 */
20#define __io(a) __typesafe_io(a)
21#define __mem_pci(a) (a)
22
23#endif
diff --git a/arch/arm/plat-tcc/include/mach/irqs.h b/arch/arm/plat-tcc/include/mach/irqs.h
deleted file mode 100644
index da863894d498..000000000000
--- a/arch/arm/plat-tcc/include/mach/irqs.h
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * IRQ definitions for TCC8xxx
3 *
4 * Copyright (C) 2008-2009 Telechips
5 * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
6 *
7 * Licensed under the terms of the GPL v2.
8 *
9 */
10
11#ifndef __ASM_ARCH_TCC_IRQS_H
12#define __ASM_ARCH_TCC_IRQS_H
13
14#define NR_IRQS 64
15
16/* PIC0 interrupts */
17#define INT_ADMA1 0
18#define INT_BDMA 1
19#define INT_ADMA0 2
20#define INT_GDMA1 3
21#define INT_I2S0RX 4
22#define INT_I2S0TX 5
23#define INT_TC 6
24#define INT_UART0 7
25#define INT_USBD 8
26#define INT_SPI0TX 9
27#define INT_UDMA 10
28#define INT_LIRQ 11
29#define INT_GDMA2 12
30#define INT_GDMA0 13
31#define INT_TC32 14
32#define INT_LCD 15
33#define INT_ADC 16
34#define INT_I2C 17
35#define INT_RTCP 18
36#define INT_RTCA 19
37#define INT_NFC 20
38#define INT_SD0 21
39#define INT_GSB0 22
40#define INT_PK 23
41#define INT_USBH0 24
42#define INT_USBH1 25
43#define INT_G2D 26
44#define INT_ECC 27
45#define INT_SPI0RX 28
46#define INT_UART1 29
47#define INT_MSCL 30
48#define INT_GSB1 31
49/* PIC1 interrupts */
50#define INT_E0 32
51#define INT_E1 33
52#define INT_E2 34
53#define INT_E3 35
54#define INT_E4 36
55#define INT_E5 37
56#define INT_E6 38
57#define INT_E7 39
58#define INT_UART2 40
59#define INT_UART3 41
60#define INT_SPI1TX 42
61#define INT_SPI1RX 43
62#define INT_GSB2 44
63#define INT_SPDIF 45
64#define INT_CDIF 46
65#define INT_VBON 47
66#define INT_VBOFF 48
67#define INT_SD1 49
68#define INT_UART4 50
69#define INT_GDMA3 51
70#define INT_I2S1RX 52
71#define INT_I2S1TX 53
72#define INT_CAN0 54
73#define INT_CAN1 55
74#define INT_GSB3 56
75#define INT_KRST 57
76#define INT_UNUSED 58
77#define INT_SD0D3 59
78#define INT_SD1D3 60
79#define INT_GPS0 61
80#define INT_GPS1 62
81#define INT_GPS2 63
82
83#endif /* ASM_ARCH_TCC_IRQS_H */
diff --git a/arch/arm/plat-tcc/include/mach/system.h b/arch/arm/plat-tcc/include/mach/system.h
deleted file mode 100644
index 909e6035d843..000000000000
--- a/arch/arm/plat-tcc/include/mach/system.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Author: <linux@telechips.com>
3 * Created: June 10, 2008
4 * Description: LINUX SYSTEM FUNCTIONS for TCC83x
5 *
6 * Copyright (C) 2008-2009 Telechips
7 *
8 * Licensed under the terms of the GPL v2.
9 *
10 */
11
12#ifndef __ASM_ARCH_SYSTEM_H
13#define __ASM_ARCH_SYSTEM_H
14#include <linux/clk.h>
15
16#include <asm/mach-types.h>
17#include <mach/hardware.h>
18
19extern void plat_tcc_reboot(void);
20
21static inline void arch_idle(void)
22{
23 cpu_do_idle();
24}
25
26static inline void arch_reset(char mode, const char *cmd)
27{
28 plat_tcc_reboot();
29}
30
31#endif
diff --git a/arch/arm/plat-tcc/include/mach/tcc8k-regs.h b/arch/arm/plat-tcc/include/mach/tcc8k-regs.h
deleted file mode 100644
index 1d9428295332..000000000000
--- a/arch/arm/plat-tcc/include/mach/tcc8k-regs.h
+++ /dev/null
@@ -1,807 +0,0 @@
1/*
2 * Telechips TCC8000 register definitions
3 *
4 * (C) 2009 Hans J. Koch <hjk@linutronix.de>
5 *
6 * Licensed under the terms of the GPLv2.
7 */
8
9#ifndef TCC8K_REGS_H
10#define TCC8K_REGS_H
11
12#include <linux/types.h>
13
14#define EXT_SDRAM_BASE 0x20000000
15#define INT_SRAM_BASE 0x30000000
16#define INT_SRAM_SIZE SZ_32K
17#define CS0_BASE 0x40000000
18#define CS1_BASE 0x50000000
19#define CS1_SIZE SZ_64K
20#define CS2_BASE 0x60000000
21#define CS3_BASE 0x70000000
22#define AHB_PERI_BASE 0x80000000
23#define AHB_PERI_SIZE SZ_64K
24#define APB0_PERI_BASE 0x90000000
25#define APB0_PERI_SIZE SZ_128K
26#define APB1_PERI_BASE 0x98000000
27#define APB1_PERI_SIZE SZ_128K
28#define DATA_TCM_BASE 0xa0000000
29#define DATA_TCM_SIZE SZ_8K
30#define EXT_MEM_CTRL_BASE 0xf0000000
31#define EXT_MEM_CTRL_SIZE SZ_4K
32
33#define CS1_BASE_VIRT (void __iomem *)0xf7000000
34#define AHB_PERI_BASE_VIRT (void __iomem *)0xf4000000
35#define APB0_PERI_BASE_VIRT (void __iomem *)0xf1000000
36#define APB1_PERI_BASE_VIRT (void __iomem *)0xf2000000
37#define EXT_MEM_CTRL_BASE_VIRT (void __iomem *)0xf3000000
38#define INT_SRAM_BASE_VIRT (void __iomem *)0xf5000000
39#define DATA_TCM_BASE_VIRT (void __iomem *)0xf6000000
40
41#define __REG(x) (*((volatile u32 *)(x)))
42
43/* USB Device Controller Registers */
44#define UDC_BASE (AHB_PERI_BASE_VIRT + 0x8000)
45#define UDC_BASE_PHYS (AHB_PERI_BASE + 0x8000)
46
47#define UDC_IR_OFFS 0x00
48#define UDC_EIR_OFFS 0x04
49#define UDC_EIER_OFFS 0x08
50#define UDC_FAR_OFFS 0x0c
51#define UDC_FNR_OFFS 0x10
52#define UDC_EDR_OFFS 0x14
53#define UDC_RT_OFFS 0x18
54#define UDC_SSR_OFFS 0x1c
55#define UDC_SCR_OFFS 0x20
56#define UDC_EP0SR_OFFS 0x24
57#define UDC_EP0CR_OFFS 0x28
58
59#define UDC_ESR_OFFS 0x2c
60#define UDC_ECR_OFFS 0x30
61#define UDC_BRCR_OFFS 0x34
62#define UDC_BWCR_OFFS 0x38
63#define UDC_MPR_OFFS 0x3c
64#define UDC_DCR_OFFS 0x40
65#define UDC_DTCR_OFFS 0x44
66#define UDC_DFCR_OFFS 0x48
67#define UDC_DTTCR1_OFFS 0x4c
68#define UDC_DTTCR2_OFFS 0x50
69#define UDC_ESR2_OFFS 0x54
70
71#define UDC_SCR2_OFFS 0x58
72#define UDC_EP0BUF_OFFS 0x60
73#define UDC_EP1BUF_OFFS 0x64
74#define UDC_EP2BUF_OFFS 0x68
75#define UDC_EP3BUF_OFFS 0x6c
76#define UDC_PLICR_OFFS 0xa0
77#define UDC_PCR_OFFS 0xa4
78
79#define UDC_UPCR0_OFFS 0xc8
80#define UDC_UPCR1_OFFS 0xcc
81#define UDC_UPCR2_OFFS 0xd0
82#define UDC_UPCR3_OFFS 0xd4
83
84/* Bits in UDC_EIR */
85#define UDC_EIR_EP0I (1 << 0)
86#define UDC_EIR_EP1I (1 << 1)
87#define UDC_EIR_EP2I (1 << 2)
88#define UDC_EIR_EP3I (1 << 3)
89#define UDC_EIR_EPI_MASK 0x0f
90
91/* Bits in UDC_EIER */
92#define UDC_EIER_EP0IE (1 << 0)
93#define UDC_EIER_EP1IE (1 << 1)
94#define UDC_EIER_EP2IE (1 << 2)
95#define UDC_EIER_EP3IE (1 << 3)
96
97/* Bits in UDC_FNR */
98#define UDC_FNR_FN_MASK 0x7ff
99#define UDC_FNR_SM (1 << 13)
100#define UDC_FNR_FTL (1 << 14)
101
102/* Bits in UDC_SSR */
103#define UDC_SSR_HFRES (1 << 0)
104#define UDC_SSR_HFSUSP (1 << 1)
105#define UDC_SSR_HFRM (1 << 2)
106#define UDC_SSR_SDE (1 << 3)
107#define UDC_SSR_HSP (1 << 4)
108#define UDC_SSR_DM (1 << 5)
109#define UDC_SSR_DP (1 << 6)
110#define UDC_SSR_TBM (1 << 7)
111#define UDC_SSR_VBON (1 << 8)
112#define UDC_SSR_VBOFF (1 << 9)
113#define UDC_SSR_EOERR (1 << 10)
114#define UDC_SSR_DCERR (1 << 11)
115#define UDC_SSR_TCERR (1 << 12)
116#define UDC_SSR_BSERR (1 << 13)
117#define UDC_SSR_TMERR (1 << 14)
118#define UDC_SSR_BAERR (1 << 15)
119
120/* Bits in UDC_SCR */
121#define UDC_SCR_HRESE (1 << 0)
122#define UDC_SCR_HSSPE (1 << 1)
123#define UDC_SCR_RRDE (1 << 5)
124#define UDC_SCR_SPDEN (1 << 6)
125#define UDC_SCR_DIEN (1 << 12)
126
127/* Bits in UDC_EP0SR */
128#define UDC_EP0SR_RSR (1 << 0)
129#define UDC_EP0SR_TST (1 << 1)
130#define UDC_EP0SR_SHT (1 << 4)
131#define UDC_EP0SR_LWO (1 << 6)
132
133/* Bits in UDC_EP0CR */
134#define UDC_EP0CR_ESS (1 << 1)
135
136/* Bits in UDC_ESR */
137#define UDC_ESR_RPS (1 << 0)
138#define UDC_ESR_TPS (1 << 1)
139#define UDC_ESR_LWO (1 << 4)
140#define UDC_ESR_FFS (1 << 6)
141
142/* Bits in UDC_ECR */
143#define UDC_ECR_ESS (1 << 1)
144#define UDC_ECR_CDP (1 << 2)
145
146#define UDC_ECR_FLUSH (1 << 6)
147#define UDC_ECR_DUEN (1 << 7)
148
149/* Bits in UDC_UPCR0 */
150#define UDC_UPCR0_VBD (1 << 1)
151#define UDC_UPCR0_VBDS (1 << 6)
152#define UDC_UPCR0_RCD_12 (0x0 << 9)
153#define UDC_UPCR0_RCD_24 (0x1 << 9)
154#define UDC_UPCR0_RCD_48 (0x2 << 9)
155#define UDC_UPCR0_RCS_EXT (0x1 << 11)
156#define UDC_UPCR0_RCS_XTAL (0x0 << 11)
157
158/* Bits in UDC_UPCR1 */
159#define UDC_UPCR1_CDT(x) ((x) << 0)
160#define UDC_UPCR1_OTGT(x) ((x) << 3)
161#define UDC_UPCR1_SQRXT(x) ((x) << 8)
162#define UDC_UPCR1_TXFSLST(x) ((x) << 12)
163
164/* Bits in UDC_UPCR2 */
165#define UDC_UPCR2_TP (1 << 0)
166#define UDC_UPCR2_TXRT(x) ((x) << 2)
167#define UDC_UPCR2_TXVRT(x) ((x) << 5)
168#define UDC_UPCR2_OPMODE(x) ((x) << 9)
169#define UDC_UPCR2_XCVRSEL(x) ((x) << 12)
170#define UDC_UPCR2_TM (1 << 14)
171
172/* USB Host Controller registers */
173#define USBH0_BASE (AHB_PERI_BASE_VIRT + 0xb000)
174#define USBH1_BASE (AHB_PERI_BASE_VIRT + 0xb800)
175
176#define OHCI_INT_ENABLE_OFFS 0x10
177
178#define RH_DESCRIPTOR_A_OFFS 0x48
179#define RH_DESCRIPTOR_B_OFFS 0x4c
180
181#define USBHTCFG0_OFFS 0x100
182#define USBHHCFG0_OFFS 0x104
183#define USBHHCFG1_OFFS 0x104
184
185/* DMA controller registers */
186#define DMAC0_BASE (AHB_PERI_BASE + 0x4000)
187#define DMAC1_BASE (AHB_PERI_BASE + 0xa000)
188#define DMAC2_BASE (AHB_PERI_BASE + 0x4800)
189#define DMAC3_BASE (AHB_PERI_BASE + 0xa800)
190
191#define DMAC_CH_OFFSET(ch) (ch * 0x30)
192
193#define ST_SADR_OFFS 0x00
194#define SPARAM_OFFS 0x04
195#define C_SADR_OFFS 0x0c
196#define ST_DADR_OFFS 0x10
197#define DPARAM_OFFS 0x14
198#define C_DADR_OFFS 0x1c
199#define HCOUNT_OFFS 0x20
200#define CHCTRL_OFFS 0x24
201#define RPTCTRL_OFFS 0x28
202#define EXTREQ_A_OFFS 0x2c
203
204/* Bits in CHCTRL register */
205#define CHCTRL_EN (1 << 0)
206
207#define CHCTRL_IEN (1 << 2)
208#define CHCTRL_FLAG (1 << 3)
209#define CHCTRL_WSIZE8 (0 << 4)
210#define CHCTRL_WSIZE16 (1 << 4)
211#define CHCTRL_WSIZE32 (2 << 4)
212
213#define CHCTRL_BSIZE1 (0 << 6)
214#define CHCTRL_BSIZE2 (1 << 6)
215#define CHCTRL_BSIZE4 (2 << 6)
216#define CHCTRL_BSIZE8 (3 << 6)
217
218#define CHCTRL_TYPE_SINGLE_E (0 << 8)
219#define CHCTRL_TYPE_HW (1 << 8)
220#define CHCTRL_TYPE_SW (2 << 8)
221#define CHCTRL_TYPE_SINGLE_L (3 << 8)
222
223#define CHCTRL_BST (1 << 10)
224
225/* Use DMA controller 0, channel 2 for USB */
226#define USB_DMA_BASE (DMAC0_BASE + DMAC_CH_OFFSET(2))
227
228/* NAND flash controller registers */
229#define NFC_BASE (AHB_PERI_BASE_VIRT + 0xd000)
230#define NFC_BASE_PHYS (AHB_PERI_BASE + 0xd000)
231
232#define NFC_CMD_OFFS 0x00
233#define NFC_LADDR_OFFS 0x04
234#define NFC_BADDR_OFFS 0x08
235#define NFC_SADDR_OFFS 0x0c
236#define NFC_WDATA_OFFS 0x10
237#define NFC_LDATA_OFFS 0x20
238#define NFC_SDATA_OFFS 0x40
239#define NFC_CTRL_OFFS 0x50
240#define NFC_PSTART_OFFS 0x54
241#define NFC_RSTART_OFFS 0x58
242#define NFC_DSIZE_OFFS 0x5c
243#define NFC_IREQ_OFFS 0x60
244#define NFC_RST_OFFS 0x64
245#define NFC_CTRL1_OFFS 0x68
246#define NFC_MDATA_OFFS 0x70
247
248#define NFC_WDATA_PHYS_ADDR (NFC_BASE_PHYS + NFC_WDATA_OFFS)
249
250/* Bits in NFC_CTRL */
251#define NFC_CTRL_BHLD_MASK (0xf << 0)
252#define NFC_CTRL_BPW_MASK (0xf << 4)
253#define NFC_CTRL_BSTP_MASK (0xf << 8)
254#define NFC_CTRL_CADDR_MASK (0x7 << 12)
255#define NFC_CTRL_CADDR_1 (0x0 << 12)
256#define NFC_CTRL_CADDR_2 (0x1 << 12)
257#define NFC_CTRL_CADDR_3 (0x2 << 12)
258#define NFC_CTRL_CADDR_4 (0x3 << 12)
259#define NFC_CTRL_CADDR_5 (0x4 << 12)
260#define NFC_CTRL_MSK (1 << 15)
261#define NFC_CTRL_PSIZE256 (0 << 16)
262#define NFC_CTRL_PSIZE512 (1 << 16)
263#define NFC_CTRL_PSIZE1024 (2 << 16)
264#define NFC_CTRL_PSIZE2048 (3 << 16)
265#define NFC_CTRL_PSIZE4096 (4 << 16)
266#define NFC_CTRL_PSIZE_MASK (7 << 16)
267#define NFC_CTRL_BSIZE1 (0 << 19)
268#define NFC_CTRL_BSIZE2 (1 << 19)
269#define NFC_CTRL_BSIZE4 (2 << 19)
270#define NFC_CTRL_BSIZE8 (3 << 19)
271#define NFC_CTRL_BSIZE_MASK (3 << 19)
272#define NFC_CTRL_RDY (1 << 21)
273#define NFC_CTRL_CS0SEL (1 << 22)
274#define NFC_CTRL_CS1SEL (1 << 23)
275#define NFC_CTRL_CS2SEL (1 << 24)
276#define NFC_CTRL_CS3SEL (1 << 25)
277#define NFC_CTRL_CSMASK (0xf << 22)
278#define NFC_CTRL_BW (1 << 26)
279#define NFC_CTRL_FS (1 << 27)
280#define NFC_CTRL_DEN (1 << 28)
281#define NFC_CTRL_READ_IEN (1 << 29)
282#define NFC_CTRL_PROG_IEN (1 << 30)
283#define NFC_CTRL_RDY_IEN (1 << 31)
284
285/* Bits in NFC_IREQ */
286#define NFC_IREQ_IRQ0 (1 << 0)
287#define NFC_IREQ_IRQ1 (1 << 1)
288#define NFC_IREQ_IRQ2 (1 << 2)
289
290#define NFC_IREQ_FLAG0 (1 << 4)
291#define NFC_IREQ_FLAG1 (1 << 5)
292#define NFC_IREQ_FLAG2 (1 << 6)
293
294/* MMC controller registers */
295#define MMC0_BASE (AHB_PERI_BASE_VIRT + 0xe000)
296#define MMC1_BASE (AHB_PERI_BASE_VIRT + 0xe800)
297
298/* UART base addresses */
299
300#define UART0_BASE (APB0_PERI_BASE_VIRT + 0x07000)
301#define UART0_BASE_PHYS (APB0_PERI_BASE + 0x07000)
302#define UART1_BASE (APB0_PERI_BASE_VIRT + 0x08000)
303#define UART1_BASE_PHYS (APB0_PERI_BASE + 0x08000)
304#define UART2_BASE (APB0_PERI_BASE_VIRT + 0x09000)
305#define UART2_BASE_PHYS (APB0_PERI_BASE + 0x09000)
306#define UART3_BASE (APB0_PERI_BASE_VIRT + 0x0a000)
307#define UART3_BASE_PHYS (APB0_PERI_BASE + 0x0a000)
308#define UART4_BASE (APB0_PERI_BASE_VIRT + 0x15000)
309#define UART4_BASE_PHYS (APB0_PERI_BASE + 0x15000)
310
311#define UART_BASE UART0_BASE
312#define UART_BASE_PHYS UART0_BASE_PHYS
313
314/* ECC controller */
315#define ECC_CTR_BASE (APB0_PERI_BASE_VIRT + 0xd000)
316
317#define ECC_CTRL_OFFS 0x00
318#define ECC_BASE_OFFS 0x04
319#define ECC_MASK_OFFS 0x08
320#define ECC_CLEAR_OFFS 0x0c
321#define ECC4_0_OFFS 0x10
322#define ECC4_1_OFFS 0x14
323
324#define ECC_EADDR0_OFFS 0x50
325
326#define ECC_ERRNUM_OFFS 0x90
327#define ECC_IREQ_OFFS 0x94
328
329/* Bits in ECC_CTRL */
330#define ECC_CTRL_ECC4_DIEN (1 << 28)
331#define ECC_CTRL_ECC8_DIEN (1 << 29)
332#define ECC_CTRL_ECC12_DIEN (1 << 30)
333#define ECC_CTRL_ECC_DISABLE 0x0
334#define ECC_CTRL_ECC_SLC_ENC 0x8
335#define ECC_CTRL_ECC_SLC_DEC 0x9
336#define ECC_CTRL_ECC4_ENC 0xa
337#define ECC_CTRL_ECC4_DEC 0xb
338#define ECC_CTRL_ECC8_ENC 0xc
339#define ECC_CTRL_ECC8_DEC 0xd
340#define ECC_CTRL_ECC12_ENC 0xe
341#define ECC_CTRL_ECC12_DEC 0xf
342
343/* Bits in ECC_IREQ */
344#define ECC_IREQ_E4DI (1 << 4)
345
346#define ECC_IREQ_E4DF (1 << 20)
347#define ECC_IREQ_E4EF (1 << 21)
348
349/* Interrupt controller */
350
351#define PIC0_BASE (APB1_PERI_BASE_VIRT + 0x3000)
352#define PIC0_BASE_PHYS (APB1_PERI_BASE + 0x3000)
353
354#define PIC0_IEN_OFFS 0x00
355#define PIC0_CREQ_OFFS 0x04
356#define PIC0_IREQ_OFFS 0x08
357#define PIC0_IRQSEL_OFFS 0x0c
358#define PIC0_SRC_OFFS 0x10
359#define PIC0_MREQ_OFFS 0x14
360#define PIC0_TSTREQ_OFFS 0x18
361#define PIC0_POL_OFFS 0x1c
362#define PIC0_IRQ_OFFS 0x20
363#define PIC0_FIQ_OFFS 0x24
364#define PIC0_MIRQ_OFFS 0x28
365#define PIC0_MFIQ_OFFS 0x2c
366#define PIC0_TMODE_OFFS 0x30
367#define PIC0_SYNC_OFFS 0x34
368#define PIC0_WKUP_OFFS 0x38
369#define PIC0_TMODEA_OFFS 0x3c
370#define PIC0_INTOEN_OFFS 0x40
371#define PIC0_MEN0_OFFS 0x44
372#define PIC0_MEN_OFFS 0x48
373
374#define PIC0_IEN __REG(PIC0_BASE + PIC0_IEN_OFFS)
375#define PIC0_IEN_PHYS __REG(PIC0_BASE_PHYS + PIC0_IEN_OFFS)
376#define PIC0_CREQ __REG(PIC0_BASE + PIC0_CREQ_OFFS)
377#define PIC0_CREQ_PHYS __REG(PIC0_BASE_PHYS + PIC0_CREQ_OFFS)
378#define PIC0_IREQ __REG(PIC0_BASE + PIC0_IREQ_OFFS)
379#define PIC0_IRQSEL __REG(PIC0_BASE + PIC0_IRQSEL_OFFS)
380#define PIC0_IRQSEL_PHYS __REG(PIC0_BASE_PHYS + PIC0_IRQSEL_OFFS)
381#define PIC0_SRC __REG(PIC0_BASE + PIC0_SRC_OFFS)
382#define PIC0_MREQ __REG(PIC0_BASE + PIC0_MREQ_OFFS)
383#define PIC0_TSTREQ __REG(PIC0_BASE + PIC0_TSTREQ_OFFS)
384#define PIC0_POL __REG(PIC0_BASE + PIC0_POL_OFFS)
385#define PIC0_IRQ __REG(PIC0_BASE + PIC0_IRQ_OFFS)
386#define PIC0_FIQ __REG(PIC0_BASE + PIC0_FIQ_OFFS)
387#define PIC0_MIRQ __REG(PIC0_BASE + PIC0_MIRQ_OFFS)
388#define PIC0_MFIQ __REG(PIC0_BASE + PIC0_MFIQ_OFFS)
389#define PIC0_TMODE __REG(PIC0_BASE + PIC0_TMODE_OFFS)
390#define PIC0_TMODE_PHYS __REG(PIC0_BASE_PHYS + PIC0_TMODE_OFFS)
391#define PIC0_SYNC __REG(PIC0_BASE + PIC0_SYNC_OFFS)
392#define PIC0_WKUP __REG(PIC0_BASE + PIC0_WKUP_OFFS)
393#define PIC0_TMODEA __REG(PIC0_BASE + PIC0_TMODEA_OFFS)
394#define PIC0_INTOEN __REG(PIC0_BASE + PIC0_INTOEN_OFFS)
395#define PIC0_MEN0 __REG(PIC0_BASE + PIC0_MEN0_OFFS)
396#define PIC0_MEN __REG(PIC0_BASE + PIC0_MEN_OFFS)
397
398#define PIC1_BASE (APB1_PERI_BASE_VIRT + 0x3080)
399
400#define PIC1_IEN_OFFS 0x00
401#define PIC1_CREQ_OFFS 0x04
402#define PIC1_IREQ_OFFS 0x08
403#define PIC1_IRQSEL_OFFS 0x0c
404#define PIC1_SRC_OFFS 0x10
405#define PIC1_MREQ_OFFS 0x14
406#define PIC1_TSTREQ_OFFS 0x18
407#define PIC1_POL_OFFS 0x1c
408#define PIC1_IRQ_OFFS 0x20
409#define PIC1_FIQ_OFFS 0x24
410#define PIC1_MIRQ_OFFS 0x28
411#define PIC1_MFIQ_OFFS 0x2c
412#define PIC1_TMODE_OFFS 0x30
413#define PIC1_SYNC_OFFS 0x34
414#define PIC1_WKUP_OFFS 0x38
415#define PIC1_TMODEA_OFFS 0x3c
416#define PIC1_INTOEN_OFFS 0x40
417#define PIC1_MEN1_OFFS 0x44
418#define PIC1_MEN_OFFS 0x48
419
420#define PIC1_IEN __REG(PIC1_BASE + PIC1_IEN_OFFS)
421#define PIC1_CREQ __REG(PIC1_BASE + PIC1_CREQ_OFFS)
422#define PIC1_IREQ __REG(PIC1_BASE + PIC1_IREQ_OFFS)
423#define PIC1_IRQSEL __REG(PIC1_BASE + PIC1_IRQSEL_OFFS)
424#define PIC1_SRC __REG(PIC1_BASE + PIC1_SRC_OFFS)
425#define PIC1_MREQ __REG(PIC1_BASE + PIC1_MREQ_OFFS)
426#define PIC1_TSTREQ __REG(PIC1_BASE + PIC1_TSTREQ_OFFS)
427#define PIC1_POL __REG(PIC1_BASE + PIC1_POL_OFFS)
428#define PIC1_IRQ __REG(PIC1_BASE + PIC1_IRQ_OFFS)
429#define PIC1_FIQ __REG(PIC1_BASE + PIC1_FIQ_OFFS)
430#define PIC1_MIRQ __REG(PIC1_BASE + PIC1_MIRQ_OFFS)
431#define PIC1_MFIQ __REG(PIC1_BASE + PIC1_MFIQ_OFFS)
432#define PIC1_TMODE __REG(PIC1_BASE + PIC1_TMODE_OFFS)
433#define PIC1_SYNC __REG(PIC1_BASE + PIC1_SYNC_OFFS)
434#define PIC1_WKUP __REG(PIC1_BASE + PIC1_WKUP_OFFS)
435#define PIC1_TMODEA __REG(PIC1_BASE + PIC1_TMODEA_OFFS)
436#define PIC1_INTOEN __REG(PIC1_BASE + PIC1_INTOEN_OFFS)
437#define PIC1_MEN1 __REG(PIC1_BASE + PIC1_MEN1_OFFS)
438#define PIC1_MEN __REG(PIC1_BASE + PIC1_MEN_OFFS)
439
440/* Timer registers */
441#define TIMER_BASE (APB1_PERI_BASE_VIRT + 0x4000)
442#define TIMER_BASE_PHYS (APB1_PERI_BASE + 0x4000)
443
444#define TWDCFG_OFFS 0x70
445
446#define TC32EN_OFFS 0x80
447#define TC32LDV_OFFS 0x84
448#define TC32CMP0_OFFS 0x88
449#define TC32CMP1_OFFS 0x8c
450#define TC32PCNT_OFFS 0x90
451#define TC32MCNT_OFFS 0x94
452#define TC32IRQ_OFFS 0x98
453
454/* Bits in TC32EN */
455#define TC32EN_PRESCALE_MASK 0x00ffffff
456#define TC32EN_ENABLE (1 << 24)
457#define TC32EN_LOADZERO (1 << 25)
458#define TC32EN_STOPMODE (1 << 26)
459#define TC32EN_LDM0 (1 << 28)
460#define TC32EN_LDM1 (1 << 29)
461
462/* Bits in TC32IRQ */
463#define TC32IRQ_MSTAT_MASK 0x0000001f
464#define TC32IRQ_RSTAT_MASK (0x1f << 8)
465#define TC32IRQ_IRQEN0 (1 << 16)
466#define TC32IRQ_IRQEN1 (1 << 17)
467#define TC32IRQ_IRQEN2 (1 << 18)
468#define TC32IRQ_IRQEN3 (1 << 19)
469#define TC32IRQ_IRQEN4 (1 << 20)
470#define TC32IRQ_RSYNC (1 << 30)
471#define TC32IRQ_IRQCLR (1 << 31)
472
473/* GPIO registers */
474#define GPIOPD_BASE (APB1_PERI_BASE_VIRT + 0x5000)
475
476#define GPIOPD_DAT_OFFS 0x00
477#define GPIOPD_DOE_OFFS 0x04
478#define GPIOPD_FS0_OFFS 0x08
479#define GPIOPD_FS1_OFFS 0x0c
480#define GPIOPD_FS2_OFFS 0x10
481#define GPIOPD_RPU_OFFS 0x30
482#define GPIOPD_RPD_OFFS 0x34
483#define GPIOPD_DV0_OFFS 0x38
484#define GPIOPD_DV1_OFFS 0x3c
485
486#define GPIOPS_BASE (APB1_PERI_BASE_VIRT + 0x5000)
487
488#define GPIOPS_DAT_OFFS 0x40
489#define GPIOPS_DOE_OFFS 0x44
490#define GPIOPS_FS0_OFFS 0x48
491#define GPIOPS_FS1_OFFS 0x4c
492#define GPIOPS_FS2_OFFS 0x50
493#define GPIOPS_FS3_OFFS 0x54
494#define GPIOPS_RPU_OFFS 0x70
495#define GPIOPS_RPD_OFFS 0x74
496#define GPIOPS_DV0_OFFS 0x78
497#define GPIOPS_DV1_OFFS 0x7c
498
499#define GPIOPS_FS1_SDH0_BITS 0x000000ff
500#define GPIOPS_FS1_SDH1_BITS 0x0000ff00
501
502#define GPIOPU_BASE (APB1_PERI_BASE_VIRT + 0x5000)
503
504#define GPIOPU_DAT_OFFS 0x80
505#define GPIOPU_DOE_OFFS 0x84
506#define GPIOPU_FS0_OFFS 0x88
507#define GPIOPU_FS1_OFFS 0x8c
508#define GPIOPU_FS2_OFFS 0x90
509#define GPIOPU_RPU_OFFS 0xb0
510#define GPIOPU_RPD_OFFS 0xb4
511#define GPIOPU_DV0_OFFS 0xb8
512#define GPIOPU_DV1_OFFS 0xbc
513
514#define GPIOPU_FS0_TXD0 (1 << 0)
515#define GPIOPU_FS0_RXD0 (1 << 1)
516#define GPIOPU_FS0_CTS0 (1 << 2)
517#define GPIOPU_FS0_RTS0 (1 << 3)
518#define GPIOPU_FS0_TXD1 (1 << 4)
519#define GPIOPU_FS0_RXD1 (1 << 5)
520#define GPIOPU_FS0_CTS1 (1 << 6)
521#define GPIOPU_FS0_RTS1 (1 << 7)
522#define GPIOPU_FS0_TXD2 (1 << 8)
523#define GPIOPU_FS0_RXD2 (1 << 9)
524#define GPIOPU_FS0_CTS2 (1 << 10)
525#define GPIOPU_FS0_RTS2 (1 << 11)
526#define GPIOPU_FS0_TXD3 (1 << 12)
527#define GPIOPU_FS0_RXD3 (1 << 13)
528#define GPIOPU_FS0_CTS3 (1 << 14)
529#define GPIOPU_FS0_RTS3 (1 << 15)
530#define GPIOPU_FS0_TXD4 (1 << 16)
531#define GPIOPU_FS0_RXD4 (1 << 17)
532#define GPIOPU_FS0_CTS4 (1 << 18)
533#define GPIOPU_FS0_RTS4 (1 << 19)
534
535#define GPIOFC_BASE (APB1_PERI_BASE_VIRT + 0x5000)
536
537#define GPIOFC_DAT_OFFS 0xc0
538#define GPIOFC_DOE_OFFS 0xc4
539#define GPIOFC_FS0_OFFS 0xc8
540#define GPIOFC_FS1_OFFS 0xcc
541#define GPIOFC_FS2_OFFS 0xd0
542#define GPIOFC_FS3_OFFS 0xd4
543#define GPIOFC_RPU_OFFS 0xf0
544#define GPIOFC_RPD_OFFS 0xf4
545#define GPIOFC_DV0_OFFS 0xf8
546#define GPIOFC_DV1_OFFS 0xfc
547
548#define GPIOFD_BASE (APB1_PERI_BASE_VIRT + 0x5000)
549
550#define GPIOFD_DAT_OFFS 0x100
551#define GPIOFD_DOE_OFFS 0x104
552#define GPIOFD_FS0_OFFS 0x108
553#define GPIOFD_FS1_OFFS 0x10c
554#define GPIOFD_FS2_OFFS 0x110
555#define GPIOFD_RPU_OFFS 0x130
556#define GPIOFD_RPD_OFFS 0x134
557#define GPIOFD_DV0_OFFS 0x138
558#define GPIOFD_DV1_OFFS 0x13c
559
560#define GPIOLC_BASE (APB1_PERI_BASE_VIRT + 0x5000)
561
562#define GPIOLC_DAT_OFFS 0x140
563#define GPIOLC_DOE_OFFS 0x144
564#define GPIOLC_FS0_OFFS 0x148
565#define GPIOLC_FS1_OFFS 0x14c
566#define GPIOLC_RPU_OFFS 0x170
567#define GPIOLC_RPD_OFFS 0x174
568#define GPIOLC_DV0_OFFS 0x178
569#define GPIOLC_DV1_OFFS 0x17c
570
571#define GPIOLD_BASE (APB1_PERI_BASE_VIRT + 0x5000)
572
573#define GPIOLD_DAT_OFFS 0x180
574#define GPIOLD_DOE_OFFS 0x184
575#define GPIOLD_FS0_OFFS 0x188
576#define GPIOLD_FS1_OFFS 0x18c
577#define GPIOLD_FS2_OFFS 0x190
578#define GPIOLD_RPU_OFFS 0x1b0
579#define GPIOLD_RPD_OFFS 0x1b4
580#define GPIOLD_DV0_OFFS 0x1b8
581#define GPIOLD_DV1_OFFS 0x1bc
582
583#define GPIOAD_BASE (APB1_PERI_BASE_VIRT + 0x5000)
584
585#define GPIOAD_DAT_OFFS 0x1c0
586#define GPIOAD_DOE_OFFS 0x1c4
587#define GPIOAD_FS0_OFFS 0x1c8
588#define GPIOAD_RPU_OFFS 0x1f0
589#define GPIOAD_RPD_OFFS 0x1f4
590#define GPIOAD_DV0_OFFS 0x1f8
591#define GPIOAD_DV1_OFFS 0x1fc
592
593#define GPIOXC_BASE (APB1_PERI_BASE_VIRT + 0x5000)
594
595#define GPIOXC_DAT_OFFS 0x200
596#define GPIOXC_DOE_OFFS 0x204
597#define GPIOXC_FS0_OFFS 0x208
598#define GPIOXC_RPU_OFFS 0x230
599#define GPIOXC_RPD_OFFS 0x234
600#define GPIOXC_DV0_OFFS 0x238
601#define GPIOXC_DV1_OFFS 0x23c
602
603#define GPIOXC_FS0 __REG(GPIOXC_BASE + GPIOXC_FS0_OFFS)
604
605#define GPIOXC_FS0_CS0 (1 << 26)
606#define GPIOXC_FS0_CS1 (1 << 27)
607
608#define GPIOXD_BASE (APB1_PERI_BASE_VIRT + 0x5000)
609
610#define GPIOXD_DAT_OFFS 0x240
611#define GPIOXD_FS0_OFFS 0x248
612#define GPIOXD_RPU_OFFS 0x270
613#define GPIOXD_RPD_OFFS 0x274
614#define GPIOXD_DV0_OFFS 0x278
615#define GPIOXD_DV1_OFFS 0x27c
616
617#define GPIOPK_BASE (APB1_PERI_BASE_VIRT + 0x1c000)
618
619#define GPIOPK_RST_OFFS 0x008
620#define GPIOPK_DAT_OFFS 0x100
621#define GPIOPK_DOE_OFFS 0x104
622#define GPIOPK_FS0_OFFS 0x108
623#define GPIOPK_FS1_OFFS 0x10c
624#define GPIOPK_FS2_OFFS 0x110
625#define GPIOPK_IRQST_OFFS 0x210
626#define GPIOPK_IRQEN_OFFS 0x214
627#define GPIOPK_IRQPOL_OFFS 0x218
628#define GPIOPK_IRQTM0_OFFS 0x21c
629#define GPIOPK_IRQTM1_OFFS 0x220
630#define GPIOPK_CTL_OFFS 0x22c
631
632#define PMGPIO_BASE (APB1_PERI_BASE_VIRT + 0x10000)
633#define BACKUP_RAM_BASE PMGPIO_BASE
634
635#define PMGPIO_DAT_OFFS 0x800
636#define PMGPIO_DOE_OFFS 0x804
637#define PMGPIO_FS0_OFFS 0x808
638#define PMGPIO_RPU_OFFS 0x810
639#define PMGPIO_RPD_OFFS 0x814
640#define PMGPIO_DV0_OFFS 0x818
641#define PMGPIO_DV1_OFFS 0x81c
642#define PMGPIO_EE0_OFFS 0x820
643#define PMGPIO_EE1_OFFS 0x824
644#define PMGPIO_CTL_OFFS 0x828
645#define PMGPIO_DI_OFFS 0x82c
646#define PMGPIO_STR_OFFS 0x830
647#define PMGPIO_STF_OFFS 0x834
648#define PMGPIO_POL_OFFS 0x838
649#define PMGPIO_APB_OFFS 0x800
650
651/* Clock controller registers */
652#define CKC_BASE ((void __iomem *)(APB1_PERI_BASE_VIRT + 0x6000))
653
654#define CLKCTRL_OFFS 0x00
655#define PLL0CFG_OFFS 0x04
656#define PLL1CFG_OFFS 0x08
657#define CLKDIVC0_OFFS 0x0c
658
659#define BCLKCTR0_OFFS 0x14
660#define SWRESET0_OFFS 0x18
661
662#define BCLKCTR1_OFFS 0x60
663#define SWRESET1_OFFS 0x64
664#define PWDCTL_OFFS 0x68
665#define PLL2CFG_OFFS 0x6c
666#define CLKDIVC1_OFFS 0x70
667
668#define ACLKREF_OFFS 0x80
669#define ACLKI2C_OFFS 0x84
670#define ACLKSPI0_OFFS 0x88
671#define ACLKSPI1_OFFS 0x8c
672#define ACLKUART0_OFFS 0x90
673#define ACLKUART1_OFFS 0x94
674#define ACLKUART2_OFFS 0x98
675#define ACLKUART3_OFFS 0x9c
676#define ACLKUART4_OFFS 0xa0
677#define ACLKTCT_OFFS 0xa4
678#define ACLKTCX_OFFS 0xa8
679#define ACLKTCZ_OFFS 0xac
680#define ACLKADC_OFFS 0xb0
681#define ACLKDAI0_OFFS 0xb4
682#define ACLKDAI1_OFFS 0xb8
683#define ACLKLCD_OFFS 0xbc
684#define ACLKSPDIF_OFFS 0xc0
685#define ACLKUSBH_OFFS 0xc4
686#define ACLKSDH0_OFFS 0xc8
687#define ACLKSDH1_OFFS 0xcc
688#define ACLKC3DEC_OFFS 0xd0
689#define ACLKEXT_OFFS 0xd4
690#define ACLKCAN0_OFFS 0xd8
691#define ACLKCAN1_OFFS 0xdc
692#define ACLKGSB0_OFFS 0xe0
693#define ACLKGSB1_OFFS 0xe4
694#define ACLKGSB2_OFFS 0xe8
695#define ACLKGSB3_OFFS 0xec
696
697#define PLLxCFG_PD (1 << 31)
698
699/* CLKCTRL bits */
700#define CLKCTRL_XE (1 << 31)
701
702/* CLKDIVCx bits */
703#define CLKDIVC0_XTE (1 << 7)
704#define CLKDIVC0_XE (1 << 15)
705#define CLKDIVC0_P1E (1 << 23)
706#define CLKDIVC0_P0E (1 << 31)
707
708#define CLKDIVC1_P2E (1 << 7)
709
710/* BCLKCTR0 clock bits */
711#define BCLKCTR0_USBD (1 << 4)
712#define BCLKCTR0_ECC (1 << 9)
713#define BCLKCTR0_USBH0 (1 << 11)
714#define BCLKCTR0_NFC (1 << 16)
715
716/* BCLKCTR1 clock bits */
717#define BCLKCTR1_USBH1 (1 << 20)
718
719/* SWRESET0 bits */
720#define SWRESET0_USBD (1 << 4)
721#define SWRESET0_USBH0 (1 << 11)
722
723/* SWRESET1 bits */
724#define SWRESET1_USBH1 (1 << 20)
725
726/* System clock sources.
727 * Note: These are the clock sources that serve as parents for
728 * all other clocks. They have no parents themselves.
729 *
730 * These values are used for struct clk->root_id. All clocks
731 * that are not system clock sources have this value set to
732 * CLK_SRC_NOROOT.
733 * The values for system clocks start with CLK_SRC_PLL0 == 0
734 * because this gives us exactly the values needed for the lower
735 * 4 bits of ACLK_* registers. Therefore, CLK_SRC_NOROOT is
736 * defined as -1 to not disturb the order.
737 */
738enum root_clks {
739 CLK_SRC_NOROOT = -1,
740 CLK_SRC_PLL0 = 0,
741 CLK_SRC_PLL1,
742 CLK_SRC_PLL0DIV,
743 CLK_SRC_PLL1DIV,
744 CLK_SRC_XI,
745 CLK_SRC_XIDIV,
746 CLK_SRC_XTI,
747 CLK_SRC_XTIDIV,
748 CLK_SRC_PLL2,
749 CLK_SRC_PLL2DIV,
750 CLK_SRC_PK0,
751 CLK_SRC_PK1,
752 CLK_SRC_PK2,
753 CLK_SRC_PK3,
754 CLK_SRC_PK4,
755 CLK_SRC_48MHZ
756};
757
758#define CLK_SRC_MASK 0xf
759
760/* Bits in ACLK* registers */
761#define ACLK_EN (1 << 28)
762#define ACLK_SEL_SHIFT 24
763#define ACLK_SEL_MASK 0x0f000000
764#define ACLK_DIV_MASK 0x00000fff
765
766/* System configuration registers */
767
768#define SCFG_BASE (APB1_PERI_BASE_VIRT + 0x13000)
769
770#define BMI_OFFS 0x00
771#define AHBCON0_OFFS 0x04
772#define APBPWE_OFFS 0x08
773#define DTCMWAIT_OFFS 0x0c
774#define ECCSEL_OFFS 0x10
775#define AHBCON1_OFFS 0x14
776#define SDHCFG_OFFS 0x18
777#define REMAP_OFFS 0x20
778#define LCDSIAE_OFFS 0x24
779#define XMCCFG_OFFS 0xe0
780#define IMCCFG_OFFS 0xe4
781
782/* Values for ECCSEL */
783#define ECCSEL_EXTMEM 0x0
784#define ECCSEL_DTCM 0x1
785#define ECCSEL_INT_SRAM 0x2
786#define ECCSEL_AHB 0x3
787
788/* Bits in XMCCFG */
789#define XMCCFG_NFCE (1 << 1)
790#define XMCCFG_FDXD (1 << 2)
791
792/* External memory controller registers */
793
794#define EMC_BASE EXT_MEM_CTRL_BASE
795
796#define SDCFG_OFFS 0x00
797#define SDFSM_OFFS 0x04
798#define MCFG_OFFS 0x08
799
800#define CSCFG0_OFFS 0x10
801#define CSCFG1_OFFS 0x14
802#define CSCFG2_OFFS 0x18
803#define CSCFG3_OFFS 0x1c
804
805#define MCFG_SDEN (1 << 4)
806
807#endif /* TCC8K_REGS_H */
diff --git a/arch/arm/plat-tcc/include/mach/timex.h b/arch/arm/plat-tcc/include/mach/timex.h
deleted file mode 100644
index 057acbe651d9..000000000000
--- a/arch/arm/plat-tcc/include/mach/timex.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * A definition needed by arch core code.
3 *
4 */
5#define CLOCK_TICK_RATE (HZ * 100000UL)
diff --git a/arch/arm/plat-tcc/include/mach/uncompress.h b/arch/arm/plat-tcc/include/mach/uncompress.h
deleted file mode 100644
index 7a3e33a27a30..000000000000
--- a/arch/arm/plat-tcc/include/mach/uncompress.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
3 *
4 * This file is licensed under the terms of the GPL version 2.
5 */
6
7#include <linux/serial_reg.h>
8#include <linux/types.h>
9
10#include <mach/tcc8k-regs.h>
11
12unsigned int system_rev;
13
14#define ID_MASK 0x7fff
15
16static void putc(int c)
17{
18 u32 *uart_lsr = (u32 *)(UART_BASE_PHYS + (UART_LSR << 2));
19 u32 *uart_tx = (u32 *)(UART_BASE_PHYS + (UART_TX << 2));
20
21 while (!(*uart_lsr & UART_LSR_THRE))
22 barrier();
23 *uart_tx = c;
24}
25
26static inline void flush(void)
27{
28}
29
30/*
31 * nothing to do
32 */
33#define arch_decomp_setup()
34#define arch_decomp_wdog()
diff --git a/arch/arm/plat-tcc/include/mach/vmalloc.h b/arch/arm/plat-tcc/include/mach/vmalloc.h
deleted file mode 100644
index 99414d9c2b94..000000000000
--- a/arch/arm/plat-tcc/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * Author: <linux@telechips.com>
3 * Created: June 10, 2008
4 *
5 * Copyright (C) 2000 Russell King.
6 * Copyright (C) 2008-2009 Telechips
7 *
8 * Licensed under the terms of the GPL v2.
9 */
10#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/plat-tcc/system.c b/arch/arm/plat-tcc/system.c
deleted file mode 100644
index cc208fae3e7a..000000000000
--- a/arch/arm/plat-tcc/system.c
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * System functions for Telechips TCCxxxx SoCs
3 *
4 * Copyright (C) Hans J. Koch <hjk@linutronix.de>
5 *
6 * Licensed under the terms of the GPL v2.
7 *
8 */
9
10#include <linux/io.h>
11
12#include <mach/tcc8k-regs.h>
13
14/* System reboot */
15void plat_tcc_reboot(void)
16{
17 /* Make sure clocks are on */
18 __raw_writel(0xffffffff, CKC_BASE + BCLKCTR0_OFFS);
19
20 /* Enable watchdog reset */
21 __raw_writel(0x49, TIMER_BASE + TWDCFG_OFFS);
22 /* Wait for reset */
23 while(1)
24 ;
25}
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c
index 3d6a4c292cab..b33b74c87232 100644
--- a/arch/arm/plat-versatile/sched-clock.c
+++ b/arch/arm/plat-versatile/sched-clock.c
@@ -18,41 +18,24 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21#include <linux/kernel.h>
21#include <linux/io.h> 22#include <linux/io.h>
22#include <linux/sched.h>
23 23
24#include <asm/sched_clock.h> 24#include <asm/sched_clock.h>
25#include <plat/sched_clock.h> 25#include <plat/sched_clock.h>
26 26
27static DEFINE_CLOCK_DATA(cd);
28static void __iomem *ctr; 27static void __iomem *ctr;
29 28
30/* 29static u32 notrace versatile_read_sched_clock(void)
31 * Constants generated by clocks_calc_mult_shift(m, s, 24MHz, NSEC_PER_SEC, 60).
32 * This gives a resolution of about 41ns and a wrap period of about 178s.
33 */
34#define SC_MULT 2796202667u
35#define SC_SHIFT 26
36
37unsigned long long notrace sched_clock(void)
38{ 30{
39 if (ctr) { 31 if (ctr)
40 u32 cyc = readl(ctr); 32 return readl(ctr);
41 return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0,
42 SC_MULT, SC_SHIFT);
43 } else
44 return 0;
45}
46 33
47static void notrace versatile_update_sched_clock(void) 34 return 0;
48{
49 u32 cyc = readl(ctr);
50 update_sched_clock(&cd, cyc, (u32)~0);
51} 35}
52 36
53void __init versatile_sched_clock_init(void __iomem *reg, unsigned long rate) 37void __init versatile_sched_clock_init(void __iomem *reg, unsigned long rate)
54{ 38{
55 ctr = reg; 39 ctr = reg;
56 init_fixed_sched_clock(&cd, versatile_update_sched_clock, 40 setup_sched_clock(versatile_read_sched_clock, 32, rate);
57 32, rate, SC_MULT, SC_SHIFT);
58} 41}
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 5bdeef969847..f9c9f33f8cbe 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -16,7 +16,7 @@
16# are merged into mainline or have been edited in the machine database 16# are merged into mainline or have been edited in the machine database
17# within the last 12 months. References to machine_is_NAME() do not count! 17# within the last 12 months. References to machine_is_NAME() do not count!
18# 18#
19# Last update: Sat May 7 08:48:24 2011 19# Last update: Tue Dec 6 11:07:38 2011
20# 20#
21# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 21# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
22# 22#
@@ -269,7 +269,7 @@ dns323 MACH_DNS323 DNS323 1542
269omap3_beagle MACH_OMAP3_BEAGLE OMAP3_BEAGLE 1546 269omap3_beagle MACH_OMAP3_BEAGLE OMAP3_BEAGLE 1546
270nokia_n810 MACH_NOKIA_N810 NOKIA_N810 1548 270nokia_n810 MACH_NOKIA_N810 NOKIA_N810 1548
271pcm038 MACH_PCM038 PCM038 1551 271pcm038 MACH_PCM038 PCM038 1551
272ts_x09 MACH_TS209 TS209 1565 272ts209 MACH_TS209 TS209 1565
273at91cap9adk MACH_AT91CAP9ADK AT91CAP9ADK 1566 273at91cap9adk MACH_AT91CAP9ADK AT91CAP9ADK 1566
274mx31moboard MACH_MX31MOBOARD MX31MOBOARD 1574 274mx31moboard MACH_MX31MOBOARD MX31MOBOARD 1574
275vision_ep9307 MACH_VISION_EP9307 VISION_EP9307 1578 275vision_ep9307 MACH_VISION_EP9307 VISION_EP9307 1578
@@ -321,7 +321,6 @@ lb88rc8480 MACH_LB88RC8480 LB88RC8480 1769
321mx25_3ds MACH_MX25_3DS MX25_3DS 1771 321mx25_3ds MACH_MX25_3DS MX25_3DS 1771
322omap3530_lv_som MACH_OMAP3530_LV_SOM OMAP3530_LV_SOM 1773 322omap3530_lv_som MACH_OMAP3530_LV_SOM OMAP3530_LV_SOM 1773
323davinci_da830_evm MACH_DAVINCI_DA830_EVM DAVINCI_DA830_EVM 1781 323davinci_da830_evm MACH_DAVINCI_DA830_EVM DAVINCI_DA830_EVM 1781
324at572d940hfek MACH_AT572D940HFEB AT572D940HFEB 1783
325dove_db MACH_DOVE_DB DOVE_DB 1788 324dove_db MACH_DOVE_DB DOVE_DB 1788
326overo MACH_OVERO OVERO 1798 325overo MACH_OVERO OVERO 1798
327at2440evb MACH_AT2440EVB AT2440EVB 1799 326at2440evb MACH_AT2440EVB AT2440EVB 1799
@@ -459,7 +458,7 @@ guruplug MACH_GURUPLUG GURUPLUG 2659
459spear310 MACH_SPEAR310 SPEAR310 2660 458spear310 MACH_SPEAR310 SPEAR310 2660
460spear320 MACH_SPEAR320 SPEAR320 2661 459spear320 MACH_SPEAR320 SPEAR320 2661
461aquila MACH_AQUILA AQUILA 2676 460aquila MACH_AQUILA AQUILA 2676
462sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678 461esata_sheevaplug MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
463msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679 462msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679
464ea2478devkit MACH_EA2478DEVKIT EA2478DEVKIT 2683 463ea2478devkit MACH_EA2478DEVKIT EA2478DEVKIT 2683
465terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697 464terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697
@@ -491,380 +490,53 @@ eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35SD EUKREA_CPUIMX35SD 2821
491eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822 490eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822
492eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823 491eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823
493smdkc210 MACH_SMDKC210 SMDKC210 2838 492smdkc210 MACH_SMDKC210 SMDKC210 2838
494omap3_braillo MACH_OMAP3_BRAILLO OMAP3_BRAILLO 2839
495spyplug MACH_SPYPLUG SPYPLUG 2840
496ginger MACH_GINGER GINGER 2841
497tny_t3530 MACH_TNY_T3530 TNY_T3530 2842
498pca102 MACH_PCA102 PCA102 2843 493pca102 MACH_PCA102 PCA102 2843
499spade MACH_SPADE SPADE 2844
500mxc25_topaz MACH_MXC25_TOPAZ MXC25_TOPAZ 2845
501t5325 MACH_T5325 T5325 2846 494t5325 MACH_T5325 T5325 2846
502gw2361 MACH_GW2361 GW2361 2847
503elog MACH_ELOG ELOG 2848
504income MACH_INCOME INCOME 2849 495income MACH_INCOME INCOME 2849
505bcm589x MACH_BCM589X BCM589X 2850
506etna MACH_ETNA ETNA 2851
507hawks MACH_HAWKS HAWKS 2852
508meson MACH_MESON MESON 2853
509xsbase255 MACH_XSBASE255 XSBASE255 2854
510pvm2030 MACH_PVM2030 PVM2030 2855
511mioa502 MACH_MIOA502 MIOA502 2856
512vvbox_sdorig2 MACH_VVBOX_SDORIG2 VVBOX_SDORIG2 2857 496vvbox_sdorig2 MACH_VVBOX_SDORIG2 VVBOX_SDORIG2 2857
513vvbox_sdlite2 MACH_VVBOX_SDLITE2 VVBOX_SDLITE2 2858 497vvbox_sdlite2 MACH_VVBOX_SDLITE2 VVBOX_SDLITE2 2858
514vvbox_sdpro4 MACH_VVBOX_SDPRO4 VVBOX_SDPRO4 2859 498vvbox_sdpro4 MACH_VVBOX_SDPRO4 VVBOX_SDPRO4 2859
515htc_spv_m700 MACH_HTC_SPV_M700 HTC_SPV_M700 2860
516mx257sx MACH_MX257SX MX257SX 2861 499mx257sx MACH_MX257SX MX257SX 2861
517goni MACH_GONI GONI 2862 500goni MACH_GONI GONI 2862
518msm8x55_svlte_ffa MACH_MSM8X55_SVLTE_FFA MSM8X55_SVLTE_FFA 2863
519msm8x55_svlte_surf MACH_MSM8X55_SVLTE_SURF MSM8X55_SVLTE_SURF 2864
520quickstep MACH_QUICKSTEP QUICKSTEP 2865
521dmw96 MACH_DMW96 DMW96 2866
522hammerhead MACH_HAMMERHEAD HAMMERHEAD 2867
523trident MACH_TRIDENT TRIDENT 2868
524lightning MACH_LIGHTNING LIGHTNING 2869
525iconnect MACH_ICONNECT ICONNECT 2870
526autobot MACH_AUTOBOT AUTOBOT 2871
527coconut MACH_COCONUT COCONUT 2872
528durian MACH_DURIAN DURIAN 2873
529cayenne MACH_CAYENNE CAYENNE 2874
530fuji MACH_FUJI FUJI 2875
531synology_6282 MACH_SYNOLOGY_6282 SYNOLOGY_6282 2876
532em1sy MACH_EM1SY EM1SY 2877
533m502 MACH_M502 M502 2878
534matrix518 MACH_MATRIX518 MATRIX518 2879
535tiny_gurnard MACH_TINY_GURNARD TINY_GURNARD 2880
536spear1310 MACH_SPEAR1310 SPEAR1310 2881
537bv07 MACH_BV07 BV07 2882 501bv07 MACH_BV07 BV07 2882
538mxt_td61 MACH_MXT_TD61 MXT_TD61 2883
539openrd_ultimate MACH_OPENRD_ULTIMATE OPENRD_ULTIMATE 2884 502openrd_ultimate MACH_OPENRD_ULTIMATE OPENRD_ULTIMATE 2884
540devixp MACH_DEVIXP DEVIXP 2885 503devixp MACH_DEVIXP DEVIXP 2885
541miccpt MACH_MICCPT MICCPT 2886 504miccpt MACH_MICCPT MICCPT 2886
542mic256 MACH_MIC256 MIC256 2887 505mic256 MACH_MIC256 MIC256 2887
543as1167 MACH_AS1167 AS1167 2888
544omap3_ibiza MACH_OMAP3_IBIZA OMAP3_IBIZA 2889
545u5500 MACH_U5500 U5500 2890 506u5500 MACH_U5500 U5500 2890
546davinci_picto MACH_DAVINCI_PICTO DAVINCI_PICTO 2891
547mecha MACH_MECHA MECHA 2892
548bubba3 MACH_BUBBA3 BUBBA3 2893
549pupitre MACH_PUPITRE PUPITRE 2894
550tegra_vogue MACH_TEGRA_VOGUE TEGRA_VOGUE 2896
551tegra_e1165 MACH_TEGRA_E1165 TEGRA_E1165 2897
552simplenet MACH_SIMPLENET SIMPLENET 2898
553ec4350tbm MACH_EC4350TBM EC4350TBM 2899
554pec_tc MACH_PEC_TC PEC_TC 2900
555pec_hc2 MACH_PEC_HC2 PEC_HC2 2901
556esl_mobilis_a MACH_ESL_MOBILIS_A ESL_MOBILIS_A 2902
557esl_mobilis_b MACH_ESL_MOBILIS_B ESL_MOBILIS_B 2903
558esl_wave_a MACH_ESL_WAVE_A ESL_WAVE_A 2904
559esl_wave_b MACH_ESL_WAVE_B ESL_WAVE_B 2905
560unisense_mmm MACH_UNISENSE_MMM UNISENSE_MMM 2906
561blueshark MACH_BLUESHARK BLUESHARK 2907
562e10 MACH_E10 E10 2908
563app3k_robin MACH_APP3K_ROBIN APP3K_ROBIN 2909
564pov15hd MACH_POV15HD POV15HD 2910
565stella MACH_STELLA STELLA 2911
566linkstation_lschl MACH_LINKSTATION_LSCHL LINKSTATION_LSCHL 2913 507linkstation_lschl MACH_LINKSTATION_LSCHL LINKSTATION_LSCHL 2913
567netwalker MACH_NETWALKER NETWALKER 2914
568acsx106 MACH_ACSX106 ACSX106 2915
569atlas5_c1 MACH_ATLAS5_C1 ATLAS5_C1 2916
570nsb3ast MACH_NSB3AST NSB3AST 2917
571gnet_slc MACH_GNET_SLC GNET_SLC 2918
572af4000 MACH_AF4000 AF4000 2919
573ark9431 MACH_ARK9431 ARK9431 2920
574fs_s5pc100 MACH_FS_S5PC100 FS_S5PC100 2921
575omap3505nova8 MACH_OMAP3505NOVA8 OMAP3505NOVA8 2922
576omap3621_edp1 MACH_OMAP3621_EDP1 OMAP3621_EDP1 2923
577oratisaes MACH_ORATISAES ORATISAES 2924
578smdkv310 MACH_SMDKV310 SMDKV310 2925 508smdkv310 MACH_SMDKV310 SMDKV310 2925
579siemens_l0 MACH_SIEMENS_L0 SIEMENS_L0 2926
580ventana MACH_VENTANA VENTANA 2927
581wm8505_7in_netbook MACH_WM8505_7IN_NETBOOK WM8505_7IN_NETBOOK 2928 509wm8505_7in_netbook MACH_WM8505_7IN_NETBOOK WM8505_7IN_NETBOOK 2928
582ec4350sdb MACH_EC4350SDB EC4350SDB 2929
583mimas MACH_MIMAS MIMAS 2930
584titan MACH_TITAN TITAN 2931
585craneboard MACH_CRANEBOARD CRANEBOARD 2932 510craneboard MACH_CRANEBOARD CRANEBOARD 2932
586es2440 MACH_ES2440 ES2440 2933
587najay_a9263 MACH_NAJAY_A9263 NAJAY_A9263 2934
588htctornado MACH_HTCTORNADO HTCTORNADO 2935
589dimm_mx257 MACH_DIMM_MX257 DIMM_MX257 2936
590jigen301 MACH_JIGEN JIGEN 2937
591smdk6450 MACH_SMDK6450 SMDK6450 2938 511smdk6450 MACH_SMDK6450 SMDK6450 2938
592meno_qng MACH_MENO_QNG MENO_QNG 2939
593ns2416 MACH_NS2416 NS2416 2940
594rpc353 MACH_RPC353 RPC353 2941
595tq6410 MACH_TQ6410 TQ6410 2942
596sky6410 MACH_SKY6410 SKY6410 2943
597dynasty MACH_DYNASTY DYNASTY 2944
598vivo MACH_VIVO VIVO 2945
599bury_bl7582 MACH_BURY_BL7582 BURY_BL7582 2946
600bury_bps5270 MACH_BURY_BPS5270 BURY_BPS5270 2947
601basi MACH_BASI BASI 2948
602tn200 MACH_TN200 TN200 2949
603c2mmi MACH_C2MMI C2MMI 2950
604meson_6236m MACH_MESON_6236M MESON_6236M 2951
605meson_8626m MACH_MESON_8626M MESON_8626M 2952
606tube MACH_TUBE TUBE 2953
607messina MACH_MESSINA MESSINA 2954
608mx50_arm2 MACH_MX50_ARM2 MX50_ARM2 2955
609cetus9263 MACH_CETUS9263 CETUS9263 2956
610brownstone MACH_BROWNSTONE BROWNSTONE 2957 512brownstone MACH_BROWNSTONE BROWNSTONE 2957
611vmx25 MACH_VMX25 VMX25 2958
612vmx51 MACH_VMX51 VMX51 2959
613abacus MACH_ABACUS ABACUS 2960
614cm4745 MACH_CM4745 CM4745 2961
615oratislink MACH_ORATISLINK ORATISLINK 2962
616davinci_dm365_dvr MACH_DAVINCI_DM365_DVR DAVINCI_DM365_DVR 2963
617netviz MACH_NETVIZ NETVIZ 2964
618flexibity MACH_FLEXIBITY FLEXIBITY 2965 513flexibity MACH_FLEXIBITY FLEXIBITY 2965
619wlan_computer MACH_WLAN_COMPUTER WLAN_COMPUTER 2966
620lpc24xx MACH_LPC24XX LPC24XX 2967
621spica MACH_SPICA SPICA 2968
622gpsdisplay MACH_GPSDISPLAY GPSDISPLAY 2969
623bipnet MACH_BIPNET BIPNET 2970
624overo_ctu_inertial MACH_OVERO_CTU_INERTIAL OVERO_CTU_INERTIAL 2971
625davinci_dm355_mmm MACH_DAVINCI_DM355_MMM DAVINCI_DM355_MMM 2972
626pc9260_v2 MACH_PC9260_V2 PC9260_V2 2973
627ptx7545 MACH_PTX7545 PTX7545 2974
628tm_efdc MACH_TM_EFDC TM_EFDC 2975
629omap3_waldo1 MACH_OMAP3_WALDO1 OMAP3_WALDO1 2977
630flyer MACH_FLYER FLYER 2978
631tornado3240 MACH_TORNADO3240 TORNADO3240 2979
632soli_01 MACH_SOLI_01 SOLI_01 2980
633omapl138_europalc MACH_OMAPL138_EUROPALC OMAPL138_EUROPALC 2981
634helios_v1 MACH_HELIOS_V1 HELIOS_V1 2982
635netspace_lite_v2 MACH_NETSPACE_LITE_V2 NETSPACE_LITE_V2 2983
636ssc MACH_SSC SSC 2984
637premierwave_en MACH_PREMIERWAVE_EN PREMIERWAVE_EN 2985
638wasabi MACH_WASABI WASABI 2986
639mx50_rdp MACH_MX50_RDP MX50_RDP 2988 514mx50_rdp MACH_MX50_RDP MX50_RDP 2988
640universal_c210 MACH_UNIVERSAL_C210 UNIVERSAL_C210 2989 515universal_c210 MACH_UNIVERSAL_C210 UNIVERSAL_C210 2989
641real6410 MACH_REAL6410 REAL6410 2990 516real6410 MACH_REAL6410 REAL6410 2990
642spx_sakura MACH_SPX_SAKURA SPX_SAKURA 2991
643ij3k_2440 MACH_IJ3K_2440 IJ3K_2440 2992
644omap3_bc10 MACH_OMAP3_BC10 OMAP3_BC10 2993
645thebe MACH_THEBE THEBE 2994
646rv082 MACH_RV082 RV082 2995
647armlguest MACH_ARMLGUEST ARMLGUEST 2996
648tjinc1000 MACH_TJINC1000 TJINC1000 2997
649dockstar MACH_DOCKSTAR DOCKSTAR 2998 517dockstar MACH_DOCKSTAR DOCKSTAR 2998
650ax8008 MACH_AX8008 AX8008 2999
651gnet_sgce MACH_GNET_SGCE GNET_SGCE 3000
652pxwnas_500_1000 MACH_PXWNAS_500_1000 PXWNAS_500_1000 3001
653ea20 MACH_EA20 EA20 3002
654awm2 MACH_AWM2 AWM2 3003
655ti8148evm MACH_TI8148EVM TI8148EVM 3004 518ti8148evm MACH_TI8148EVM TI8148EVM 3004
656seaboard MACH_SEABOARD SEABOARD 3005 519seaboard MACH_SEABOARD SEABOARD 3005
657linkstation_chlv2 MACH_LINKSTATION_CHLV2 LINKSTATION_CHLV2 3006
658tera_pro2_rack MACH_TERA_PRO2_RACK TERA_PRO2_RACK 3007
659rubys MACH_RUBYS RUBYS 3008
660aquarius MACH_AQUARIUS AQUARIUS 3009
661mx53_ard MACH_MX53_ARD MX53_ARD 3010 520mx53_ard MACH_MX53_ARD MX53_ARD 3010
662mx53_smd MACH_MX53_SMD MX53_SMD 3011 521mx53_smd MACH_MX53_SMD MX53_SMD 3011
663lswxl MACH_LSWXL LSWXL 3012
664dove_avng_v3 MACH_DOVE_AVNG_V3 DOVE_AVNG_V3 3013
665sdi_ess_9263 MACH_SDI_ESS_9263 SDI_ESS_9263 3014
666jocpu550 MACH_JOCPU550 JOCPU550 3015
667msm8x60_rumi3 MACH_MSM8X60_RUMI3 MSM8X60_RUMI3 3016 522msm8x60_rumi3 MACH_MSM8X60_RUMI3 MSM8X60_RUMI3 3016
668msm8x60_ffa MACH_MSM8X60_FFA MSM8X60_FFA 3017 523msm8x60_ffa MACH_MSM8X60_FFA MSM8X60_FFA 3017
669yanomami MACH_YANOMAMI YANOMAMI 3018
670gta04 MACH_GTA04 GTA04 3019
671cm_a510 MACH_CM_A510 CM_A510 3020 524cm_a510 MACH_CM_A510 CM_A510 3020
672omap3_rfs200 MACH_OMAP3_RFS200 OMAP3_RFS200 3021
673kx33xx MACH_KX33XX KX33XX 3022
674ptx7510 MACH_PTX7510 PTX7510 3023
675top9000 MACH_TOP9000 TOP9000 3024
676teenote MACH_TEENOTE TEENOTE 3025
677ts3 MACH_TS3 TS3 3026
678a0 MACH_A0 A0 3027
679fsm9xxx_surf MACH_FSM9XXX_SURF FSM9XXX_SURF 3028
680fsm9xxx_ffa MACH_FSM9XXX_FFA FSM9XXX_FFA 3029
681frrhwcdma60w MACH_FRRHWCDMA60W FRRHWCDMA60W 3030
682remus MACH_REMUS REMUS 3031
683at91cap7xdk MACH_AT91CAP7XDK AT91CAP7XDK 3032
684at91cap7stk MACH_AT91CAP7STK AT91CAP7STK 3033
685kt_sbc_sam9_1 MACH_KT_SBC_SAM9_1 KT_SBC_SAM9_1 3034
686armada_xp_db MACH_ARMADA_XP_DB ARMADA_XP_DB 3036
687spdm MACH_SPDM SPDM 3037
688gtib MACH_GTIB GTIB 3038
689dgm3240 MACH_DGM3240 DGM3240 3039
690htcmega MACH_HTCMEGA HTCMEGA 3041
691tricorder MACH_TRICORDER TRICORDER 3042
692tx28 MACH_TX28 TX28 3043 525tx28 MACH_TX28 TX28 3043
693bstbrd MACH_BSTBRD BSTBRD 3044
694pwb3090 MACH_PWB3090 PWB3090 3045
695idea6410 MACH_IDEA6410 IDEA6410 3046
696qbc9263 MACH_QBC9263 QBC9263 3047
697borabora MACH_BORABORA BORABORA 3048
698valdez MACH_VALDEZ VALDEZ 3049
699ls9g20 MACH_LS9G20 LS9G20 3050
700mios_v1 MACH_MIOS_V1 MIOS_V1 3051
701s5pc110_crespo MACH_S5PC110_CRESPO S5PC110_CRESPO 3052
702controltek9g20 MACH_CONTROLTEK9G20 CONTROLTEK9G20 3053
703tin307 MACH_TIN307 TIN307 3054
704tin510 MACH_TIN510 TIN510 3055
705bluecheese MACH_BLUECHEESE BLUECHEESE 3057
706tem3x30 MACH_TEM3X30 TEM3X30 3058
707harvest_desoto MACH_HARVEST_DESOTO HARVEST_DESOTO 3059
708msm8x60_qrdc MACH_MSM8X60_QRDC MSM8X60_QRDC 3060
709spear900 MACH_SPEAR900 SPEAR900 3061
710pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062 526pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062
711rdstor MACH_RDSTOR RDSTOR 3063
712usdloader MACH_USDLOADER USDLOADER 3064
713tsoploader MACH_TSOPLOADER TSOPLOADER 3065
714kronos MACH_KRONOS KRONOS 3066
715ffcore MACH_FFCORE FFCORE 3067
716mone MACH_MONE MONE 3068
717unit2s MACH_UNIT2S UNIT2S 3069
718acer_a5 MACH_ACER_A5 ACER_A5 3070
719etherpro_isp MACH_ETHERPRO_ISP ETHERPRO_ISP 3071
720stretchs7000 MACH_STRETCHS7000 STRETCHS7000 3072
721p87_smartsim MACH_P87_SMARTSIM P87_SMARTSIM 3073
722tulip MACH_TULIP TULIP 3074
723sunflower MACH_SUNFLOWER SUNFLOWER 3075
724rib MACH_RIB RIB 3076
725clod MACH_CLOD CLOD 3077
726rump MACH_RUMP RUMP 3078
727tenderloin MACH_TENDERLOIN TENDERLOIN 3079
728shortloin MACH_SHORTLOIN SHORTLOIN 3080
729antares MACH_ANTARES ANTARES 3082
730wb40n MACH_WB40N WB40N 3083
731herring MACH_HERRING HERRING 3084
732naxy400 MACH_NAXY400 NAXY400 3085
733naxy1200 MACH_NAXY1200 NAXY1200 3086
734vpr200 MACH_VPR200 VPR200 3087 527vpr200 MACH_VPR200 VPR200 3087
735bug20 MACH_BUG20 BUG20 3088
736goflexnet MACH_GOFLEXNET GOFLEXNET 3089
737torbreck MACH_TORBRECK TORBRECK 3090 528torbreck MACH_TORBRECK TORBRECK 3090
738saarb_mg1 MACH_SAARB_MG1 SAARB_MG1 3091
739callisto MACH_CALLISTO CALLISTO 3092
740multhsu MACH_MULTHSU MULTHSU 3093
741saluda MACH_SALUDA SALUDA 3094
742pemp_omap3_apollo MACH_PEMP_OMAP3_APOLLO PEMP_OMAP3_APOLLO 3095
743vc0718 MACH_VC0718 VC0718 3096
744mvblx MACH_MVBLX MVBLX 3097
745inhand_apeiron MACH_INHAND_APEIRON INHAND_APEIRON 3098
746inhand_fury MACH_INHAND_FURY INHAND_FURY 3099
747inhand_siren MACH_INHAND_SIREN INHAND_SIREN 3100
748hdnvp MACH_HDNVP HDNVP 3101
749softwinner MACH_SOFTWINNER SOFTWINNER 3102
750prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103 529prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103
751nas6210 MACH_NAS6210 NAS6210 3104
752unisdev MACH_UNISDEV UNISDEV 3105
753sbca11 MACH_SBCA11 SBCA11 3106
754saga MACH_SAGA SAGA 3107
755ns_k330 MACH_NS_K330 NS_K330 3108
756tanna MACH_TANNA TANNA 3109
757imate8502 MACH_IMATE8502 IMATE8502 3110
758aspen MACH_ASPEN ASPEN 3111
759daintree_cwac MACH_DAINTREE_CWAC DAINTREE_CWAC 3112
760zmx25 MACH_ZMX25 ZMX25 3113
761maple1 MACH_MAPLE1 MAPLE1 3114
762qsd8x72_surf MACH_QSD8X72_SURF QSD8X72_SURF 3115
763qsd8x72_ffa MACH_QSD8X72_FFA QSD8X72_FFA 3116
764abilene MACH_ABILENE ABILENE 3117
765eigen_ttr MACH_EIGEN_TTR EIGEN_TTR 3118
766iomega_ix2_200 MACH_IOMEGA_IX2_200 IOMEGA_IX2_200 3119
767coretec_vcx7400 MACH_CORETEC_VCX7400 CORETEC_VCX7400 3120
768santiago MACH_SANTIAGO SANTIAGO 3121
769mx257sol MACH_MX257SOL MX257SOL 3122
770strasbourg MACH_STRASBOURG STRASBOURG 3123
771msm8x60_fluid MACH_MSM8X60_FLUID MSM8X60_FLUID 3124
772smartqv5 MACH_SMARTQV5 SMARTQV5 3125
773smartqv3 MACH_SMARTQV3 SMARTQV3 3126
774smartqv7 MACH_SMARTQV7 SMARTQV7 3127
775paz00 MACH_PAZ00 PAZ00 3128 530paz00 MACH_PAZ00 PAZ00 3128
776acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129 531acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129
777fwbd_0404 MACH_FWBD_0404 FWBD_0404 3131
778hdgu MACH_HDGU HDGU 3132
779pyramid MACH_PYRAMID PYRAMID 3133
780epiphan MACH_EPIPHAN EPIPHAN 3134
781omap_bender MACH_OMAP_BENDER OMAP_BENDER 3135
782gurnard MACH_GURNARD GURNARD 3136
783gtl_it5100 MACH_GTL_IT5100 GTL_IT5100 3137
784bcm2708 MACH_BCM2708 BCM2708 3138
785mx51_ggc MACH_MX51_GGC MX51_GGC 3139
786sharespace MACH_SHARESPACE SHARESPACE 3140
787haba_knx_explorer MACH_HABA_KNX_EXPLORER HABA_KNX_EXPLORER 3141
788simtec_kirkmod MACH_SIMTEC_KIRKMOD SIMTEC_KIRKMOD 3142
789crux MACH_CRUX CRUX 3143
790mx51_bravo MACH_MX51_BRAVO MX51_BRAVO 3144
791charon MACH_CHARON CHARON 3145
792picocom3 MACH_PICOCOM3 PICOCOM3 3146
793picocom4 MACH_PICOCOM4 PICOCOM4 3147
794serrano MACH_SERRANO SERRANO 3148
795doubleshot MACH_DOUBLESHOT DOUBLESHOT 3149
796evsy MACH_EVSY EVSY 3150
797huashan MACH_HUASHAN HUASHAN 3151
798lausanne MACH_LAUSANNE LAUSANNE 3152
799emerald MACH_EMERALD EMERALD 3153
800tqma35 MACH_TQMA35 TQMA35 3154
801marvel MACH_MARVEL MARVEL 3155
802manuae MACH_MANUAE MANUAE 3156
803chacha MACH_CHACHA CHACHA 3157
804lemon MACH_LEMON LEMON 3158
805csc MACH_CSC CSC 3159
806gira_knxip_router MACH_GIRA_KNXIP_ROUTER GIRA_KNXIP_ROUTER 3160
807t20 MACH_T20 T20 3161
808hdmini MACH_HDMINI HDMINI 3162
809sciphone_g2 MACH_SCIPHONE_G2 SCIPHONE_G2 3163
810express MACH_EXPRESS EXPRESS 3164
811express_kt MACH_EXPRESS_KT EXPRESS_KT 3165
812maximasp MACH_MAXIMASP MAXIMASP 3166
813nitrogen_imx51 MACH_NITROGEN_IMX51 NITROGEN_IMX51 3167
814nitrogen_imx53 MACH_NITROGEN_IMX53 NITROGEN_IMX53 3168
815sunfire MACH_SUNFIRE SUNFIRE 3169
816arowana MACH_AROWANA AROWANA 3170
817tegra_daytona MACH_TEGRA_DAYTONA TEGRA_DAYTONA 3171
818tegra_swordfish MACH_TEGRA_SWORDFISH TEGRA_SWORDFISH 3172
819edison MACH_EDISON EDISON 3173
820svp8500v1 MACH_SVP8500V1 SVP8500V1 3174
821svp8500v2 MACH_SVP8500V2 SVP8500V2 3175
822svp5500 MACH_SVP5500 SVP5500 3176
823b5500 MACH_B5500 B5500 3177
824s5500 MACH_S5500 S5500 3178
825icon MACH_ICON ICON 3179
826elephant MACH_ELEPHANT ELEPHANT 3180
827shooter MACH_SHOOTER SHOOTER 3182
828spade_lte MACH_SPADE_LTE SPADE_LTE 3183
829philhwani MACH_PHILHWANI PHILHWANI 3184
830gsncomm MACH_GSNCOMM GSNCOMM 3185
831strasbourg_a2 MACH_STRASBOURG_A2 STRASBOURG_A2 3186
832mmm MACH_MMM MMM 3187
833davinci_dm365_bv MACH_DAVINCI_DM365_BV DAVINCI_DM365_BV 3188
834ag5evm MACH_AG5EVM AG5EVM 3189 532ag5evm MACH_AG5EVM AG5EVM 3189
835sc575plc MACH_SC575PLC SC575PLC 3190
836sc575hmi MACH_SC575IPC SC575IPC 3191
837omap3_tdm3730 MACH_OMAP3_TDM3730 OMAP3_TDM3730 3192
838top9000_eval MACH_TOP9000_EVAL TOP9000_EVAL 3194
839top9000_su MACH_TOP9000_SU TOP9000_SU 3195
840utm300 MACH_UTM300 UTM300 3196
841tsunagi MACH_TSUNAGI TSUNAGI 3197 533tsunagi MACH_TSUNAGI TSUNAGI 3197
842ts75xx MACH_TS75XX TS75XX 3198
843ts47xx MACH_TS47XX TS47XX 3200
844da850_k5 MACH_DA850_K5 DA850_K5 3201
845ax502 MACH_AX502 AX502 3202
846igep0032 MACH_IGEP0032 IGEP0032 3203
847antero MACH_ANTERO ANTERO 3204
848synergy MACH_SYNERGY SYNERGY 3205
849ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206 534ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206
850wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207 535wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207
851punica MACH_PUNICA PUNICA 3208
852trimslice MACH_TRIMSLICE TRIMSLICE 3209 536trimslice MACH_TRIMSLICE TRIMSLICE 3209
853mx27_wmultra MACH_MX27_WMULTRA MX27_WMULTRA 3210
854mackerel MACH_MACKEREL MACKEREL 3211 537mackerel MACH_MACKEREL MACKEREL 3211
855fa9x27 MACH_FA9X27 FA9X27 3213
856ns2816tb MACH_NS2816TB NS2816TB 3214
857ns2816_ntpad MACH_NS2816_NTPAD NS2816_NTPAD 3215
858ns2816_ntnb MACH_NS2816_NTNB NS2816_NTNB 3216
859kaen MACH_KAEN KAEN 3217 538kaen MACH_KAEN KAEN 3217
860nv1000 MACH_NV1000 NV1000 3218
861nuc950ts MACH_NUC950TS NUC950TS 3219
862nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220 539nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220
863ast2200 MACH_AST2200 AST2200 3221
864lead MACH_LEAD LEAD 3222
865unino1 MACH_UNINO1 UNINO1 3223
866greeco MACH_GREECO GREECO 3224
867verdi MACH_VERDI VERDI 3225
868dm6446_adbox MACH_DM6446_ADBOX DM6446_ADBOX 3226 540dm6446_adbox MACH_DM6446_ADBOX DM6446_ADBOX 3226
869quad_salsa MACH_QUAD_SALSA QUAD_SALSA 3227 541quad_salsa MACH_QUAD_SALSA QUAD_SALSA 3227
870abb_gma_1_1 MACH_ABB_GMA_1_1 ABB_GMA_1_1 3228 542abb_gma_1_1 MACH_ABB_GMA_1_1 ABB_GMA_1_1 3228
@@ -949,13 +621,11 @@ koi MACH_KOI KOI 3312
949ts4800 MACH_TS4800 TS4800 3313 621ts4800 MACH_TS4800 TS4800 3313
950tqma9263 MACH_TQMA9263 TQMA9263 3314 622tqma9263 MACH_TQMA9263 TQMA9263 3314
951holiday MACH_HOLIDAY HOLIDAY 3315 623holiday MACH_HOLIDAY HOLIDAY 3315
952dma_6410 MACH_DMA6410 DMA6410 3316
953pcats_overlay MACH_PCATS_OVERLAY PCATS_OVERLAY 3317 624pcats_overlay MACH_PCATS_OVERLAY PCATS_OVERLAY 3317
954hwgw6410 MACH_HWGW6410 HWGW6410 3318 625hwgw6410 MACH_HWGW6410 HWGW6410 3318
955shenzhou MACH_SHENZHOU SHENZHOU 3319 626shenzhou MACH_SHENZHOU SHENZHOU 3319
956cwme9210 MACH_CWME9210 CWME9210 3320 627cwme9210 MACH_CWME9210 CWME9210 3320
957cwme9210js MACH_CWME9210JS CWME9210JS 3321 628cwme9210js MACH_CWME9210JS CWME9210JS 3321
958pgs_v1 MACH_PGS_SITARA PGS_SITARA 3322
959colibri_tegra2 MACH_COLIBRI_TEGRA2 COLIBRI_TEGRA2 3323 629colibri_tegra2 MACH_COLIBRI_TEGRA2 COLIBRI_TEGRA2 3323
960w21 MACH_W21 W21 3324 630w21 MACH_W21 W21 3324
961polysat1 MACH_POLYSAT1 POLYSAT1 3325 631polysat1 MACH_POLYSAT1 POLYSAT1 3325
@@ -1021,13 +691,11 @@ viprinet MACH_VIPRINET VIPRINET 3385
1021bockw MACH_BOCKW BOCKW 3386 691bockw MACH_BOCKW BOCKW 3386
1022eva2000 MACH_EVA2000 EVA2000 3387 692eva2000 MACH_EVA2000 EVA2000 3387
1023steelyard MACH_STEELYARD STEELYARD 3388 693steelyard MACH_STEELYARD STEELYARD 3388
1024sdh001 MACH_MACH_SDH001 MACH_SDH001 3390
1025nsslsboard MACH_NSSLSBOARD NSSLSBOARD 3392 694nsslsboard MACH_NSSLSBOARD NSSLSBOARD 3392
1026geneva_b5 MACH_GENEVA_B5 GENEVA_B5 3393 695geneva_b5 MACH_GENEVA_B5 GENEVA_B5 3393
1027spear1340 MACH_SPEAR1340 SPEAR1340 3394 696spear1340 MACH_SPEAR1340 SPEAR1340 3394
1028rexmas MACH_REXMAS REXMAS 3395 697rexmas MACH_REXMAS REXMAS 3395
1029msm8960_cdp MACH_MSM8960_CDP MSM8960_CDP 3396 698msm8960_cdp MACH_MSM8960_CDP MSM8960_CDP 3396
1030msm8960_mdp MACH_MSM8960_MDP MSM8960_MDP 3397
1031msm8960_fluid MACH_MSM8960_FLUID MSM8960_FLUID 3398 699msm8960_fluid MACH_MSM8960_FLUID MSM8960_FLUID 3398
1032msm8960_apq MACH_MSM8960_APQ MSM8960_APQ 3399 700msm8960_apq MACH_MSM8960_APQ MSM8960_APQ 3399
1033helios_v2 MACH_HELIOS_V2 HELIOS_V2 3400 701helios_v2 MACH_HELIOS_V2 HELIOS_V2 3400
@@ -1123,5 +791,381 @@ blissc MACH_BLISSC BLISSC 3491
1123thales_adc MACH_THALES_ADC THALES_ADC 3492 791thales_adc MACH_THALES_ADC THALES_ADC 3492
1124ubisys_p9d_evp MACH_UBISYS_P9D_EVP UBISYS_P9D_EVP 3493 792ubisys_p9d_evp MACH_UBISYS_P9D_EVP UBISYS_P9D_EVP 3493
1125atdgp318 MACH_ATDGP318 ATDGP318 3494 793atdgp318 MACH_ATDGP318 ATDGP318 3494
794dma210u MACH_DMA210U DMA210U 3495
795em_t3 MACH_EM_T3 EM_T3 3496
796htx3250 MACH_HTX3250 HTX3250 3497
797g50 MACH_G50 G50 3498
798eco5 MACH_ECO5 ECO5 3499
799wintergrasp MACH_WINTERGRASP WINTERGRASP 3500
800puro MACH_PURO PURO 3501
801shooter_k MACH_SHOOTER_K SHOOTER_K 3502
802nspire MACH_NSPIRE NSPIRE 3503
803mickxx MACH_MICKXX MICKXX 3504
804lxmb MACH_LXMB LXMB 3505
805adam MACH_ADAM ADAM 3507
806b1004 MACH_B1004 B1004 3508
807oboea MACH_OBOEA OBOEA 3509
808a1015 MACH_A1015 A1015 3510
809robin_vbdt30 MACH_ROBIN_VBDT30 ROBIN_VBDT30 3511
810tegra_enterprise MACH_TEGRA_ENTERPRISE TEGRA_ENTERPRISE 3512
811rfl108200_mk10 MACH_RFL108200_MK10 RFL108200_MK10 3513
812rfl108300_mk16 MACH_RFL108300_MK16 RFL108300_MK16 3514
813rover_v7 MACH_ROVER_V7 ROVER_V7 3515
814miphone MACH_MIPHONE MIPHONE 3516
815femtobts MACH_FEMTOBTS FEMTOBTS 3517
816monopoli MACH_MONOPOLI MONOPOLI 3518
817boss MACH_BOSS BOSS 3519
818davinci_dm368_vtam MACH_DAVINCI_DM368_VTAM DAVINCI_DM368_VTAM 3520
819clcon MACH_CLCON CLCON 3521
820nokia_rm696 MACH_NOKIA_RM696 NOKIA_RM696 3522
821tahiti MACH_TAHITI TAHITI 3523
822fighter MACH_FIGHTER FIGHTER 3524
823sgh_i710 MACH_SGH_I710 SGH_I710 3525
824integreproscb MACH_INTEGREPROSCB INTEGREPROSCB 3526
825monza MACH_MONZA MONZA 3527
826calimain MACH_CALIMAIN CALIMAIN 3528
827mx6q_sabreauto MACH_MX6Q_SABREAUTO MX6Q_SABREAUTO 3529
828gma01x MACH_GMA01X GMA01X 3530
829sbc51 MACH_SBC51 SBC51 3531
830fit MACH_FIT FIT 3532
831steelhead MACH_STEELHEAD STEELHEAD 3533
832panther MACH_PANTHER PANTHER 3534
833msm8960_liquid MACH_MSM8960_LIQUID MSM8960_LIQUID 3535
834lexikonct MACH_LEXIKONCT LEXIKONCT 3536
835ns2816_stb MACH_NS2816_STB NS2816_STB 3537
836sei_mm2_lpc3250 MACH_SEI_MM2_LPC3250 SEI_MM2_LPC3250 3538
837cmimx53 MACH_CMIMX53 CMIMX53 3539
838sandwich MACH_SANDWICH SANDWICH 3540
839chief MACH_CHIEF CHIEF 3541
840pogo_e02 MACH_POGO_E02 POGO_E02 3542
841mikrap_x168 MACH_MIKRAP_X168 MIKRAP_X168 3543
842htcmozart MACH_HTCMOZART HTCMOZART 3544
843htcgold MACH_HTCGOLD HTCGOLD 3545
844mt72xx MACH_MT72XX MT72XX 3546
845mx51_ivy MACH_MX51_IVY MX51_IVY 3547
846mx51_lvd MACH_MX51_LVD MX51_LVD 3548
847omap3_wiser2 MACH_OMAP3_WISER2 OMAP3_WISER2 3549
848dreamplug MACH_DREAMPLUG DREAMPLUG 3550
849cobas_c_111 MACH_COBAS_C_111 COBAS_C_111 3551
850cobas_u_411 MACH_COBAS_U_411 COBAS_U_411 3552
851hssd MACH_HSSD HSSD 3553
852iom35x MACH_IOM35X IOM35X 3554
853psom_omap MACH_PSOM_OMAP PSOM_OMAP 3555
854iphone_2g MACH_IPHONE_2G IPHONE_2G 3556
855iphone_3g MACH_IPHONE_3G IPHONE_3G 3557
856ipod_touch_1g MACH_IPOD_TOUCH_1G IPOD_TOUCH_1G 3558
857pharos_tpc MACH_PHAROS_TPC PHAROS_TPC 3559
858mx53_hydra MACH_MX53_HYDRA MX53_HYDRA 3560
859ns2816_dev_board MACH_NS2816_DEV_BOARD NS2816_DEV_BOARD 3561
860iphone_3gs MACH_IPHONE_3GS IPHONE_3GS 3562
861iphone_4 MACH_IPHONE_4 IPHONE_4 3563
862ipod_touch_4g MACH_IPOD_TOUCH_4G IPOD_TOUCH_4G 3564
863dragon_e1100 MACH_DRAGON_E1100 DRAGON_E1100 3565
864topside MACH_TOPSIDE TOPSIDE 3566
865irisiii MACH_IRISIII IRISIII 3567
866deto_macarm9 MACH_DETO_MACARM9 DETO_MACARM9 3568
867eti_d1 MACH_ETI_D1 ETI_D1 3569
868som3530sdk MACH_SOM3530SDK SOM3530SDK 3570
869oc_engine MACH_OC_ENGINE OC_ENGINE 3571
870apq8064_sim MACH_APQ8064_SIM APQ8064_SIM 3572
871alps MACH_ALPS ALPS 3575
872tny_t3730 MACH_TNY_T3730 TNY_T3730 3576
873geryon_nfe MACH_GERYON_NFE GERYON_NFE 3577
874ns2816_ref_board MACH_NS2816_REF_BOARD NS2816_REF_BOARD 3578
875silverstone MACH_SILVERSTONE SILVERSTONE 3579
876mtt2440 MACH_MTT2440 MTT2440 3580
877ynicdb MACH_YNICDB YNICDB 3581
878bct MACH_BCT BCT 3582
879tuscan MACH_TUSCAN TUSCAN 3583
880xbt_sam9g45 MACH_XBT_SAM9G45 XBT_SAM9G45 3584
881enbw_cmc MACH_ENBW_CMC ENBW_CMC 3585
882ch104mx257 MACH_CH104MX257 CH104MX257 3587
883openpri MACH_OPENPRI OPENPRI 3588
884am335xevm MACH_AM335XEVM AM335XEVM 3589
885picodmb MACH_PICODMB PICODMB 3590
886waluigi MACH_WALUIGI WALUIGI 3591
887punicag7 MACH_PUNICAG7 PUNICAG7 3592
888ipad_1g MACH_IPAD_1G IPAD_1G 3593
889appletv_2g MACH_APPLETV_2G APPLETV_2G 3594
890mach_ecog45 MACH_MACH_ECOG45 MACH_ECOG45 3595
891ait_cam_enc_4xx MACH_AIT_CAM_ENC_4XX AIT_CAM_ENC_4XX 3596
892runnymede MACH_RUNNYMEDE RUNNYMEDE 3597
893play MACH_PLAY PLAY 3598
894hw90260 MACH_HW90260 HW90260 3599
895tagh MACH_TAGH TAGH 3600
896filbert MACH_FILBERT FILBERT 3601
897getinge_netcomv3 MACH_GETINGE_NETCOMV3 GETINGE_NETCOMV3 3602
898cw20 MACH_CW20 CW20 3603
899cinema MACH_CINEMA CINEMA 3604
900cinema_tea MACH_CINEMA_TEA CINEMA_TEA 3605
901cinema_coffee MACH_CINEMA_COFFEE CINEMA_COFFEE 3606
902cinema_juice MACH_CINEMA_JUICE CINEMA_JUICE 3607
903mx53_mirage2 MACH_MX53_MIRAGE2 MX53_MIRAGE2 3609
904mx53_efikasb MACH_MX53_EFIKASB MX53_EFIKASB 3610
905stm_b2000 MACH_STM_B2000 STM_B2000 3612
906m28evk MACH_M28EVK M28EVK 3613
907pda MACH_PDA PDA 3614
908meraki_mr58 MACH_MERAKI_MR58 MERAKI_MR58 3615
909kota2 MACH_KOTA2 KOTA2 3616
910letcool MACH_LETCOOL LETCOOL 3617
911mx27iat MACH_MX27IAT MX27IAT 3618
912apollo_td MACH_APOLLO_TD APOLLO_TD 3619
913arena MACH_ARENA ARENA 3620
914gsngateway MACH_GSNGATEWAY GSNGATEWAY 3621
915lf2000 MACH_LF2000 LF2000 3622
916bonito MACH_BONITO BONITO 3623
917asymptote MACH_ASYMPTOTE ASYMPTOTE 3624
918bst2brd MACH_BST2BRD BST2BRD 3625
919tx335s MACH_TX335S TX335S 3626
920pelco_tesla MACH_PELCO_TESLA PELCO_TESLA 3627
921rrhtestplat MACH_RRHTESTPLAT RRHTESTPLAT 3628
922vidtonic_pro MACH_VIDTONIC_PRO VIDTONIC_PRO 3629
923pl_apollo MACH_PL_APOLLO PL_APOLLO 3630
924pl_phoenix MACH_PL_PHOENIX PL_PHOENIX 3631
925m28cu3 MACH_M28CU3 M28CU3 3632
926vvbox_hd MACH_VVBOX_HD VVBOX_HD 3633
927coreware_sam9260_ MACH_COREWARE_SAM9260_ COREWARE_SAM9260_ 3634
928marmaduke MACH_MARMADUKE MARMADUKE 3635
929amg_xlcore_camera MACH_AMG_XLCORE_CAMERA AMG_XLCORE_CAMERA 3636
930omap3_egf MACH_OMAP3_EGF OMAP3_EGF 3637
1126smdk4212 MACH_SMDK4212 SMDK4212 3638 931smdk4212 MACH_SMDK4212 SMDK4212 3638
932dnp9200 MACH_DNP9200 DNP9200 3639
933tf101 MACH_TF101 TF101 3640
934omap3silvio MACH_OMAP3SILVIO OMAP3SILVIO 3641
935picasso2 MACH_PICASSO2 PICASSO2 3642
936vangogh2 MACH_VANGOGH2 VANGOGH2 3643
937olpc_xo_1_75 MACH_OLPC_XO_1_75 OLPC_XO_1_75 3644
938gx400 MACH_GX400 GX400 3645
939gs300 MACH_GS300 GS300 3646
940acer_a9 MACH_ACER_A9 ACER_A9 3647
941vivow_evm MACH_VIVOW_EVM VIVOW_EVM 3648
942veloce_cxq MACH_VELOCE_CXQ VELOCE_CXQ 3649
943veloce_cxm MACH_VELOCE_CXM VELOCE_CXM 3650
944p1852 MACH_P1852 P1852 3651
945naxy100 MACH_NAXY100 NAXY100 3652
946taishan MACH_TAISHAN TAISHAN 3653
947touchlink MACH_TOUCHLINK TOUCHLINK 3654
948stm32f103ze MACH_STM32F103ZE STM32F103ZE 3655
949mcx MACH_MCX MCX 3656
950stm_nmhdk_fli7610 MACH_STM_NMHDK_FLI7610 STM_NMHDK_FLI7610 3657
951top28x MACH_TOP28X TOP28X 3658
952okl4vp_microvisor MACH_OKL4VP_MICROVISOR OKL4VP_MICROVISOR 3659
953pop MACH_POP POP 3660
954layer MACH_LAYER LAYER 3661
955trondheim MACH_TRONDHEIM TRONDHEIM 3662
956eva MACH_EVA EVA 3663
957trust_taurus MACH_TRUST_TAURUS TRUST_TAURUS 3664
958ns2816_huashan MACH_NS2816_HUASHAN NS2816_HUASHAN 3665
959ns2816_yangcheng MACH_NS2816_YANGCHENG NS2816_YANGCHENG 3666
960p852 MACH_P852 P852 3667
961flea3 MACH_FLEA3 FLEA3 3668
962bowfin MACH_BOWFIN BOWFIN 3669
963mv88de3100 MACH_MV88DE3100 MV88DE3100 3670
964pia_am35x MACH_PIA_AM35X PIA_AM35X 3671
965cedar MACH_CEDAR CEDAR 3672
966picasso_e MACH_PICASSO_E PICASSO_E 3673
967samsung_e60 MACH_SAMSUNG_E60 SAMSUNG_E60 3674
968sdvr_mini MACH_SDVR_MINI SDVR_MINI 3676
969omap3_ij3k MACH_OMAP3_IJ3K OMAP3_IJ3K 3677
970modasmc1 MACH_MODASMC1 MODASMC1 3678
971apq8064_rumi3 MACH_APQ8064_RUMI3 APQ8064_RUMI3 3679
972matrix506 MACH_MATRIX506 MATRIX506 3680
973msm9615_mtp MACH_MSM9615_MTP MSM9615_MTP 3681
974dm36x_spawndc MACH_DM36X_SPAWNDC DM36X_SPAWNDC 3682
975sff792 MACH_SFF792 SFF792 3683
976am335xiaevm MACH_AM335XIAEVM AM335XIAEVM 3684
977g3c2440 MACH_G3C2440 G3C2440 3685
978tion270 MACH_TION270 TION270 3686
979w22q7arm02 MACH_W22Q7ARM02 W22Q7ARM02 3687
980omap_cat MACH_OMAP_CAT OMAP_CAT 3688
981at91sam9n12ek MACH_AT91SAM9N12EK AT91SAM9N12EK 3689
982morrison MACH_MORRISON MORRISON 3690
983svdu MACH_SVDU SVDU 3691
984lpp01 MACH_LPP01 LPP01 3692
985ubc283 MACH_UBC283 UBC283 3693
986zeppelin MACH_ZEPPELIN ZEPPELIN 3694
987motus MACH_MOTUS MOTUS 3695
988neomainboard MACH_NEOMAINBOARD NEOMAINBOARD 3696
989devkit3250 MACH_DEVKIT3250 DEVKIT3250 3697
990devkit7000 MACH_DEVKIT7000 DEVKIT7000 3698
991fmc_uic MACH_FMC_UIC FMC_UIC 3699
992fmc_dcm MACH_FMC_DCM FMC_DCM 3700
993batwm MACH_BATWM BATWM 3701
994atlas6cb MACH_ATLAS6CB ATLAS6CB 3702
995blue MACH_BLUE BLUE 3705
996colorado MACH_COLORADO COLORADO 3706
997popc MACH_POPC POPC 3707
998promwad_jade MACH_PROMWAD_JADE PROMWAD_JADE 3708
999amp MACH_AMP AMP 3709
1000gnet_amp MACH_GNET_AMP GNET_AMP 3710
1001toques MACH_TOQUES TOQUES 3711
1002dct_storm MACH_DCT_STORM DCT_STORM 3713
1003owl MACH_OWL OWL 3715
1004cogent_csb1741 MACH_COGENT_CSB1741 COGENT_CSB1741 3716
1005adillustra610 MACH_ADILLUSTRA610 ADILLUSTRA610 3718
1006ecafe_na04 MACH_ECAFE_NA04 ECAFE_NA04 3719
1007popct MACH_POPCT POPCT 3720
1008omap3_helena MACH_OMAP3_HELENA OMAP3_HELENA 3721
1009ach MACH_ACH ACH 3722
1010module_dtb MACH_MODULE_DTB MODULE_DTB 3723
1011oslo_elisabeth MACH_OSLO_ELISABETH OSLO_ELISABETH 3725
1012tt01 MACH_TT01 TT01 3726
1013msm8930_cdp MACH_MSM8930_CDP MSM8930_CDP 3727
1014msm8930_mtp MACH_MSM8930_MTP MSM8930_MTP 3728
1015msm8930_fluid MACH_MSM8930_FLUID MSM8930_FLUID 3729
1016ltu11 MACH_LTU11 LTU11 3730
1017am1808_spawnco MACH_AM1808_SPAWNCO AM1808_SPAWNCO 3731
1018flx6410 MACH_FLX6410 FLX6410 3732
1019mx6q_qsb MACH_MX6Q_QSB MX6Q_QSB 3733
1020mx53_plt424 MACH_MX53_PLT424 MX53_PLT424 3734
1021jasmine MACH_JASMINE JASMINE 3735
1022l138_owlboard_plus MACH_L138_OWLBOARD_PLUS L138_OWLBOARD_PLUS 3736
1023wr21 MACH_WR21 WR21 3737
1024peaboy MACH_PEABOY PEABOY 3739
1025mx28_plato MACH_MX28_PLATO MX28_PLATO 3740
1026kacom2 MACH_KACOM2 KACOM2 3741
1027slco MACH_SLCO SLCO 3742
1028imx51pico MACH_IMX51PICO IMX51PICO 3743
1029glink1 MACH_GLINK1 GLINK1 3744
1030diamond MACH_DIAMOND DIAMOND 3745
1031d9000 MACH_D9000 D9000 3746
1032w5300e01 MACH_W5300E01 W5300E01 3747
1033im6000 MACH_IM6000 IM6000 3748
1034mx51_fred51 MACH_MX51_FRED51 MX51_FRED51 3749
1035stm32f2 MACH_STM32F2 STM32F2 3750
1036ville MACH_VILLE VILLE 3751
1037ptip_murnau MACH_PTIP_MURNAU PTIP_MURNAU 3752
1038ptip_classic MACH_PTIP_CLASSIC PTIP_CLASSIC 3753
1039mx53grb MACH_MX53GRB MX53GRB 3754
1040gagarin MACH_GAGARIN GAGARIN 3755
1041nas2big MACH_NAS2BIG NAS2BIG 3757
1042superfemto MACH_SUPERFEMTO SUPERFEMTO 3758
1043teufel MACH_TEUFEL TEUFEL 3759
1044dinara MACH_DINARA DINARA 3760
1045vanquish MACH_VANQUISH VANQUISH 3761
1046zipabox1 MACH_ZIPABOX1 ZIPABOX1 3762
1047u9540 MACH_U9540 U9540 3763
1048jet MACH_JET JET 3764
1127smdk4412 MACH_SMDK4412 SMDK4412 3765 1049smdk4412 MACH_SMDK4412 SMDK4412 3765
1050elite MACH_ELITE ELITE 3766
1051spear320_hmi MACH_SPEAR320_HMI SPEAR320_HMI 3767
1052ontario MACH_ONTARIO ONTARIO 3768
1053mx6q_sabrelite MACH_MX6Q_SABRELITE MX6Q_SABRELITE 3769
1054vc200 MACH_VC200 VC200 3770
1055msm7625a_ffa MACH_MSM7625A_FFA MSM7625A_FFA 3771
1056msm7625a_surf MACH_MSM7625A_SURF MSM7625A_SURF 3772
1057benthossbp MACH_BENTHOSSBP BENTHOSSBP 3773
1058smdk5210 MACH_SMDK5210 SMDK5210 3774
1059empq2300 MACH_EMPQ2300 EMPQ2300 3775
1060minipos MACH_MINIPOS MINIPOS 3776
1061omap5_sevm MACH_OMAP5_SEVM OMAP5_SEVM 3777
1062shelter MACH_SHELTER SHELTER 3778
1063omap3_devkit8500 MACH_OMAP3_DEVKIT8500 OMAP3_DEVKIT8500 3779
1064edgetd MACH_EDGETD EDGETD 3780
1065copperyard MACH_COPPERYARD COPPERYARD 3781
1066edge MACH_EDGE EDGE 3782
1067edge_u MACH_EDGE_U EDGE_U 3783
1068edge_td MACH_EDGE_TD EDGE_TD 3784
1069wdss MACH_WDSS WDSS 3785
1070dl_pb25 MACH_DL_PB25 DL_PB25 3786
1071dss11 MACH_DSS11 DSS11 3787
1072cpa MACH_CPA CPA 3788
1073aptp2000 MACH_APTP2000 APTP2000 3789
1074marzen MACH_MARZEN MARZEN 3790
1075st_turbine MACH_ST_TURBINE ST_TURBINE 3791
1076gtl_it3300 MACH_GTL_IT3300 GTL_IT3300 3792
1077mx6_mule MACH_MX6_MULE MX6_MULE 3793
1078v7pxa_dt MACH_V7PXA_DT V7PXA_DT 3794
1079v7mmp_dt MACH_V7MMP_DT V7MMP_DT 3795
1080dragon7 MACH_DRAGON7 DRAGON7 3796
1081krome MACH_KROME KROME 3797
1082oratisdante MACH_ORATISDANTE ORATISDANTE 3798
1083fathom MACH_FATHOM FATHOM 3799
1084dns325 MACH_DNS325 DNS325 3800
1085sarnen MACH_SARNEN SARNEN 3801
1086ubisys_g1 MACH_UBISYS_G1 UBISYS_G1 3802
1087mx53_pf1 MACH_MX53_PF1 MX53_PF1 3803
1088asanti MACH_ASANTI ASANTI 3804
1089volta MACH_VOLTA VOLTA 3805
1090knight MACH_KNIGHT KNIGHT 3807
1091beaglebone MACH_BEAGLEBONE BEAGLEBONE 3808
1092becker MACH_BECKER BECKER 3809
1093fc360 MACH_FC360 FC360 3810
1094pmi2_xls MACH_PMI2_XLS PMI2_XLS 3811
1095taranto MACH_TARANTO TARANTO 3812
1096plutux MACH_PLUTUX PLUTUX 3813
1097ipmp_medcom MACH_IPMP_MEDCOM IPMP_MEDCOM 3814
1098absolut MACH_ABSOLUT ABSOLUT 3815
1099awpb3 MACH_AWPB3 AWPB3 3816
1100nfp32xx_dt MACH_NFP32XX_DT NFP32XX_DT 3817
1101dl_pb53 MACH_DL_PB53 DL_PB53 3818
1102acu_ii MACH_ACU_II ACU_II 3819
1103avalon MACH_AVALON AVALON 3820
1104sphinx MACH_SPHINX SPHINX 3821
1105titan_t MACH_TITAN_T TITAN_T 3822
1106harvest_boris MACH_HARVEST_BORIS HARVEST_BORIS 3823
1107mach_msm7x30_m3s MACH_MACH_MSM7X30_M3S MACH_MSM7X30_M3S 3824
1108smdk5250 MACH_SMDK5250 SMDK5250 3825
1109imxt_lite MACH_IMXT_LITE IMXT_LITE 3826
1110imxt_std MACH_IMXT_STD IMXT_STD 3827
1111imxt_log MACH_IMXT_LOG IMXT_LOG 3828
1112imxt_nav MACH_IMXT_NAV IMXT_NAV 3829
1113imxt_full MACH_IMXT_FULL IMXT_FULL 3830
1114ag09015 MACH_AG09015 AG09015 3831
1115am3517_mt_ventoux MACH_AM3517_MT_VENTOUX AM3517_MT_VENTOUX 3832
1116dp1arm9 MACH_DP1ARM9 DP1ARM9 3833
1117picasso_m MACH_PICASSO_M PICASSO_M 3834
1118video_gadget MACH_VIDEO_GADGET VIDEO_GADGET 3835
1119mtt_om3x MACH_MTT_OM3X MTT_OM3X 3836
1120mx6q_arm2 MACH_MX6Q_ARM2 MX6Q_ARM2 3837
1121picosam9g45 MACH_PICOSAM9G45 PICOSAM9G45 3838
1122vpm_dm365 MACH_VPM_DM365 VPM_DM365 3839
1123bonfire MACH_BONFIRE BONFIRE 3840
1124mt2p2d MACH_MT2P2D MT2P2D 3841
1125sigpda01 MACH_SIGPDA01 SIGPDA01 3842
1126cn27 MACH_CN27 CN27 3843
1127mx25_cwtap MACH_MX25_CWTAP MX25_CWTAP 3844
1128apf28 MACH_APF28 APF28 3845
1129pelco_maxwell MACH_PELCO_MAXWELL PELCO_MAXWELL 3846
1130ge_phoenix MACH_GE_PHOENIX GE_PHOENIX 3847
1131empc_a500 MACH_EMPC_A500 EMPC_A500 3848
1132ims_arm9 MACH_IMS_ARM9 IMS_ARM9 3849
1133mini2416 MACH_MINI2416 MINI2416 3850
1134mini2450 MACH_MINI2450 MINI2450 3851
1135mini310 MACH_MINI310 MINI310 3852
1136spear_hurricane MACH_SPEAR_HURRICANE SPEAR_HURRICANE 3853
1137mt7208 MACH_MT7208 MT7208 3854
1138lpc178x MACH_LPC178X LPC178X 3855
1139farleys MACH_FARLEYS FARLEYS 3856
1140efm32gg_dk3750 MACH_EFM32GG_DK3750 EFM32GG_DK3750 3857
1141zeus_board MACH_ZEUS_BOARD ZEUS_BOARD 3858
1142cc51 MACH_CC51 CC51 3859
1143fxi_c210 MACH_FXI_C210 FXI_C210 3860
1144msm8627_cdp MACH_MSM8627_CDP MSM8627_CDP 3861
1145msm8627_mtp MACH_MSM8627_MTP MSM8627_MTP 3862
1146armadillo800eva MACH_ARMADILLO800EVA ARMADILLO800EVA 3863
1147primou MACH_PRIMOU PRIMOU 3864
1148primoc MACH_PRIMOC PRIMOC 3865
1149primoct MACH_PRIMOCT PRIMOCT 3866
1150a9500 MACH_A9500 A9500 3867
1151pluto MACH_PLUTO PLUTO 3869
1152acfx100 MACH_ACFX100 ACFX100 3870
1153msm8625_rumi3 MACH_MSM8625_RUMI3 MSM8625_RUMI3 3871
1154valente MACH_VALENTE VALENTE 3872
1155crfs_rfeye MACH_CRFS_RFEYE CRFS_RFEYE 3873
1156rfeye MACH_RFEYE RFEYE 3874
1157phidget_sbc3 MACH_PHIDGET_SBC3 PHIDGET_SBC3 3875
1158tcw_mika MACH_TCW_MIKA TCW_MIKA 3876
1159imx28_egf MACH_IMX28_EGF IMX28_EGF 3877
1160valente_wx MACH_VALENTE_WX VALENTE_WX 3878
1161huangshans MACH_HUANGSHANS HUANGSHANS 3879
1162bosphorus1 MACH_BOSPHORUS1 BOSPHORUS1 3880
1163prima MACH_PRIMA PRIMA 3881
1164evita_ulk MACH_EVITA_ULK EVITA_ULK 3884
1165merisc600 MACH_MERISC600 MERISC600 3885
1166dolak MACH_DOLAK DOLAK 3886
1167sbc53 MACH_SBC53 SBC53 3887
1168elite_ulk MACH_ELITE_ULK ELITE_ULK 3888
1169pov2 MACH_POV2 POV2 3889
1170ipod_touch_2g MACH_IPOD_TOUCH_2G IPOD_TOUCH_2G 3890
1171da850_pqab MACH_DA850_PQAB DA850_PQAB 3891
diff --git a/arch/avr32/boards/merisc/merisc_sysfs.c b/arch/avr32/boards/merisc/merisc_sysfs.c
index df431fdba9ad..5a252318f4bd 100644
--- a/arch/avr32/boards/merisc/merisc_sysfs.c
+++ b/arch/avr32/boards/merisc/merisc_sysfs.c
@@ -13,7 +13,6 @@
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/sysdev.h>
17#include <linux/timer.h> 16#include <linux/timer.h>
18#include <linux/err.h> 17#include <linux/err.h>
19#include <linux/ctype.h> 18#include <linux/ctype.h>
diff --git a/arch/avr32/include/asm/ipcbuf.h b/arch/avr32/include/asm/ipcbuf.h
index 1552c9698f5e..84c7e51cb6d0 100644
--- a/arch/avr32/include/asm/ipcbuf.h
+++ b/arch/avr32/include/asm/ipcbuf.h
@@ -1,29 +1 @@
1#ifndef __ASM_AVR32_IPCBUF_H #include <asm-generic/ipcbuf.h>
2#define __ASM_AVR32_IPCBUF_H
3
4/*
5* The user_ipc_perm structure for AVR32 architecture.
6* Note extra padding because this structure is passed back and forth
7* between kernel and user space.
8*
9* Pad space is left for:
10* - 32-bit mode_t and seq
11* - 2 miscellaneous 32-bit values
12*/
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __ASM_AVR32_IPCBUF_H */
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h
index c8d1fae49476..247b88c760be 100644
--- a/arch/avr32/include/asm/socket.h
+++ b/arch/avr32/include/asm/socket.h
@@ -62,4 +62,7 @@
62 62
63#define SO_RXQ_OVFL 40 63#define SO_RXQ_OVFL 40
64 64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67
65#endif /* __ASM_AVR32_SOCKET_H */ 68#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
index 7a9c03dcb0b6..e5deda4691db 100644
--- a/arch/avr32/include/asm/thread_info.h
+++ b/arch/avr32/include/asm/thread_info.h
@@ -85,7 +85,6 @@ static inline struct thread_info *current_thread_info(void)
85#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal */ 85#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal */
86#define TIF_CPU_GOING_TO_SLEEP 8 /* CPU is entering sleep 0 mode */ 86#define TIF_CPU_GOING_TO_SLEEP 8 /* CPU is entering sleep 0 mode */
87#define TIF_NOTIFY_RESUME 9 /* callback before returning to user */ 87#define TIF_NOTIFY_RESUME 9 /* callback before returning to user */
88#define TIF_FREEZE 29
89#define TIF_DEBUG 30 /* debugging enabled */ 88#define TIF_DEBUG 30 /* debugging enabled */
90#define TIF_USERSPACE 31 /* true if FS sets userspace */ 89#define TIF_USERSPACE 31 /* true if FS sets userspace */
91 90
@@ -98,7 +97,6 @@ static inline struct thread_info *current_thread_info(void)
98#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 97#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
99#define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP) 98#define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
100#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 99#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
101#define _TIF_FREEZE (1 << TIF_FREEZE)
102 100
103/* Note: The masks below must never span more than 16 bits! */ 101/* Note: The masks below must never span more than 16 bits! */
104 102
diff --git a/arch/avr32/include/asm/types.h b/arch/avr32/include/asm/types.h
index 72667a3b1af7..9bb2d8b2e6ca 100644
--- a/arch/avr32/include/asm/types.h
+++ b/arch/avr32/include/asm/types.h
@@ -10,12 +10,6 @@
10 10
11#include <asm-generic/int-ll64.h> 11#include <asm-generic/int-ll64.h>
12 12
13#ifndef __ASSEMBLY__
14
15typedef unsigned short umode_t;
16
17#endif /* __ASSEMBLY__ */
18
19/* 13/*
20 * These aren't exported outside the kernel to avoid name space clashes 14 * These aren't exported outside the kernel to avoid name space clashes
21 */ 15 */
diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c
index e84faffbbeca..2233be71e2e8 100644
--- a/arch/avr32/kernel/cpu.c
+++ b/arch/avr32/kernel/cpu.c
@@ -6,7 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/sysdev.h> 9#include <linux/device.h>
10#include <linux/seq_file.h> 10#include <linux/seq_file.h>
11#include <linux/cpu.h> 11#include <linux/cpu.h>
12#include <linux/module.h> 12#include <linux/module.h>
@@ -26,16 +26,16 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
26 * XXX: If/when a SMP-capable implementation of AVR32 will ever be 26 * XXX: If/when a SMP-capable implementation of AVR32 will ever be
27 * made, we must make sure that the code executes on the correct CPU. 27 * made, we must make sure that the code executes on the correct CPU.
28 */ 28 */
29static ssize_t show_pc0event(struct sys_device *dev, 29static ssize_t show_pc0event(struct device *dev,
30 struct sysdev_attribute *attr, char *buf) 30 struct device_attribute *attr, char *buf)
31{ 31{
32 unsigned long pccr; 32 unsigned long pccr;
33 33
34 pccr = sysreg_read(PCCR); 34 pccr = sysreg_read(PCCR);
35 return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f); 35 return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f);
36} 36}
37static ssize_t store_pc0event(struct sys_device *dev, 37static ssize_t store_pc0event(struct device *dev,
38 struct sysdev_attribute *attr, const char *buf, 38 struct device_attribute *attr, const char *buf,
39 size_t count) 39 size_t count)
40{ 40{
41 unsigned long val; 41 unsigned long val;
@@ -48,16 +48,16 @@ static ssize_t store_pc0event(struct sys_device *dev,
48 sysreg_write(PCCR, val); 48 sysreg_write(PCCR, val);
49 return count; 49 return count;
50} 50}
51static ssize_t show_pc0count(struct sys_device *dev, 51static ssize_t show_pc0count(struct device *dev,
52 struct sysdev_attribute *attr, char *buf) 52 struct device_attribute *attr, char *buf)
53{ 53{
54 unsigned long pcnt0; 54 unsigned long pcnt0;
55 55
56 pcnt0 = sysreg_read(PCNT0); 56 pcnt0 = sysreg_read(PCNT0);
57 return sprintf(buf, "%lu\n", pcnt0); 57 return sprintf(buf, "%lu\n", pcnt0);
58} 58}
59static ssize_t store_pc0count(struct sys_device *dev, 59static ssize_t store_pc0count(struct device *dev,
60 struct sysdev_attribute *attr, 60 struct device_attribute *attr,
61 const char *buf, size_t count) 61 const char *buf, size_t count)
62{ 62{
63 unsigned long val; 63 unsigned long val;
@@ -71,16 +71,16 @@ static ssize_t store_pc0count(struct sys_device *dev,
71 return count; 71 return count;
72} 72}
73 73
74static ssize_t show_pc1event(struct sys_device *dev, 74static ssize_t show_pc1event(struct device *dev,
75 struct sysdev_attribute *attr, char *buf) 75 struct device_attribute *attr, char *buf)
76{ 76{
77 unsigned long pccr; 77 unsigned long pccr;
78 78
79 pccr = sysreg_read(PCCR); 79 pccr = sysreg_read(PCCR);
80 return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f); 80 return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f);
81} 81}
82static ssize_t store_pc1event(struct sys_device *dev, 82static ssize_t store_pc1event(struct device *dev,
83 struct sysdev_attribute *attr, const char *buf, 83 struct device_attribute *attr, const char *buf,
84 size_t count) 84 size_t count)
85{ 85{
86 unsigned long val; 86 unsigned long val;
@@ -93,16 +93,16 @@ static ssize_t store_pc1event(struct sys_device *dev,
93 sysreg_write(PCCR, val); 93 sysreg_write(PCCR, val);
94 return count; 94 return count;
95} 95}
96static ssize_t show_pc1count(struct sys_device *dev, 96static ssize_t show_pc1count(struct device *dev,
97 struct sysdev_attribute *attr, char *buf) 97 struct device_attribute *attr, char *buf)
98{ 98{
99 unsigned long pcnt1; 99 unsigned long pcnt1;
100 100
101 pcnt1 = sysreg_read(PCNT1); 101 pcnt1 = sysreg_read(PCNT1);
102 return sprintf(buf, "%lu\n", pcnt1); 102 return sprintf(buf, "%lu\n", pcnt1);
103} 103}
104static ssize_t store_pc1count(struct sys_device *dev, 104static ssize_t store_pc1count(struct device *dev,
105 struct sysdev_attribute *attr, const char *buf, 105 struct device_attribute *attr, const char *buf,
106 size_t count) 106 size_t count)
107{ 107{
108 unsigned long val; 108 unsigned long val;
@@ -116,16 +116,16 @@ static ssize_t store_pc1count(struct sys_device *dev,
116 return count; 116 return count;
117} 117}
118 118
119static ssize_t show_pccycles(struct sys_device *dev, 119static ssize_t show_pccycles(struct device *dev,
120 struct sysdev_attribute *attr, char *buf) 120 struct device_attribute *attr, char *buf)
121{ 121{
122 unsigned long pccnt; 122 unsigned long pccnt;
123 123
124 pccnt = sysreg_read(PCCNT); 124 pccnt = sysreg_read(PCCNT);
125 return sprintf(buf, "%lu\n", pccnt); 125 return sprintf(buf, "%lu\n", pccnt);
126} 126}
127static ssize_t store_pccycles(struct sys_device *dev, 127static ssize_t store_pccycles(struct device *dev,
128 struct sysdev_attribute *attr, const char *buf, 128 struct device_attribute *attr, const char *buf,
129 size_t count) 129 size_t count)
130{ 130{
131 unsigned long val; 131 unsigned long val;
@@ -139,16 +139,16 @@ static ssize_t store_pccycles(struct sys_device *dev,
139 return count; 139 return count;
140} 140}
141 141
142static ssize_t show_pcenable(struct sys_device *dev, 142static ssize_t show_pcenable(struct device *dev,
143 struct sysdev_attribute *attr, char *buf) 143 struct device_attribute *attr, char *buf)
144{ 144{
145 unsigned long pccr; 145 unsigned long pccr;
146 146
147 pccr = sysreg_read(PCCR); 147 pccr = sysreg_read(PCCR);
148 return sprintf(buf, "%c\n", (pccr & 1)?'1':'0'); 148 return sprintf(buf, "%c\n", (pccr & 1)?'1':'0');
149} 149}
150static ssize_t store_pcenable(struct sys_device *dev, 150static ssize_t store_pcenable(struct device *dev,
151 struct sysdev_attribute *attr, const char *buf, 151 struct device_attribute *attr, const char *buf,
152 size_t count) 152 size_t count)
153{ 153{
154 unsigned long pccr, val; 154 unsigned long pccr, val;
@@ -167,12 +167,12 @@ static ssize_t store_pcenable(struct sys_device *dev,
167 return count; 167 return count;
168} 168}
169 169
170static SYSDEV_ATTR(pc0event, 0600, show_pc0event, store_pc0event); 170static DEVICE_ATTR(pc0event, 0600, show_pc0event, store_pc0event);
171static SYSDEV_ATTR(pc0count, 0600, show_pc0count, store_pc0count); 171static DEVICE_ATTR(pc0count, 0600, show_pc0count, store_pc0count);
172static SYSDEV_ATTR(pc1event, 0600, show_pc1event, store_pc1event); 172static DEVICE_ATTR(pc1event, 0600, show_pc1event, store_pc1event);
173static SYSDEV_ATTR(pc1count, 0600, show_pc1count, store_pc1count); 173static DEVICE_ATTR(pc1count, 0600, show_pc1count, store_pc1count);
174static SYSDEV_ATTR(pccycles, 0600, show_pccycles, store_pccycles); 174static DEVICE_ATTR(pccycles, 0600, show_pccycles, store_pccycles);
175static SYSDEV_ATTR(pcenable, 0600, show_pcenable, store_pcenable); 175static DEVICE_ATTR(pcenable, 0600, show_pcenable, store_pcenable);
176 176
177#endif /* CONFIG_PERFORMANCE_COUNTERS */ 177#endif /* CONFIG_PERFORMANCE_COUNTERS */
178 178
@@ -186,12 +186,12 @@ static int __init topology_init(void)
186 register_cpu(c, cpu); 186 register_cpu(c, cpu);
187 187
188#ifdef CONFIG_PERFORMANCE_COUNTERS 188#ifdef CONFIG_PERFORMANCE_COUNTERS
189 sysdev_create_file(&c->sysdev, &attr_pc0event); 189 device_create_file(&c->dev, &dev_attr_pc0event);
190 sysdev_create_file(&c->sysdev, &attr_pc0count); 190 device_create_file(&c->dev, &dev_attr_pc0count);
191 sysdev_create_file(&c->sysdev, &attr_pc1event); 191 device_create_file(&c->dev, &dev_attr_pc1event);
192 sysdev_create_file(&c->sysdev, &attr_pc1count); 192 device_create_file(&c->dev, &dev_attr_pc1count);
193 sysdev_create_file(&c->sysdev, &attr_pccycles); 193 device_create_file(&c->dev, &dev_attr_pccycles);
194 sysdev_create_file(&c->sysdev, &attr_pcenable); 194 device_create_file(&c->dev, &dev_attr_pcenable);
195#endif 195#endif
196 } 196 }
197 197
diff --git a/arch/avr32/kernel/irq.c b/arch/avr32/kernel/irq.c
index bc3aa18293df..900e49b2258b 100644
--- a/arch/avr32/kernel/irq.c
+++ b/arch/avr32/kernel/irq.c
@@ -14,7 +14,7 @@
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/proc_fs.h> 15#include <linux/proc_fs.h>
16#include <linux/seq_file.h> 16#include <linux/seq_file.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18 18
19/* May be overridden by platform code */ 19/* May be overridden by platform code */
20int __weak nmi_enable(void) 20int __weak nmi_enable(void)
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index ef5a2a08fcca..ea3395750324 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -34,10 +34,12 @@ void cpu_idle(void)
34{ 34{
35 /* endless idle loop with no priority at all */ 35 /* endless idle loop with no priority at all */
36 while (1) { 36 while (1) {
37 tick_nohz_stop_sched_tick(1); 37 tick_nohz_idle_enter();
38 rcu_idle_enter();
38 while (!need_resched()) 39 while (!need_resched())
39 cpu_idle_sleep(); 40 cpu_idle_sleep();
40 tick_nohz_restart_sched_tick(); 41 rcu_idle_exit();
42 tick_nohz_idle_exit();
41 preempt_enable_no_resched(); 43 preempt_enable_no_resched();
42 schedule(); 44 schedule();
43 preempt_disable(); 45 preempt_disable();
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 02560fd8a121..53ad10005ae3 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -100,7 +100,6 @@ static inline struct thread_info *current_thread_info(void)
100 TIF_NEED_RESCHED */ 100 TIF_NEED_RESCHED */
101#define TIF_MEMDIE 4 /* is terminating due to OOM killer */ 101#define TIF_MEMDIE 4 /* is terminating due to OOM killer */
102#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ 102#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
103#define TIF_FREEZE 6 /* is freezing for suspend */
104#define TIF_IRQ_SYNC 7 /* sync pipeline stage */ 103#define TIF_IRQ_SYNC 7 /* sync pipeline stage */
105#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ 104#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
106#define TIF_SINGLESTEP 9 105#define TIF_SINGLESTEP 9
@@ -111,7 +110,6 @@ static inline struct thread_info *current_thread_info(void)
111#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 110#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
112#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 111#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
113#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 112#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
114#define _TIF_FREEZE (1<<TIF_FREEZE)
115#define _TIF_IRQ_SYNC (1<<TIF_IRQ_SYNC) 113#define _TIF_IRQ_SYNC (1<<TIF_IRQ_SYNC)
116#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 114#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
117#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 115#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 6a80a9e9fc4a..8dd0416673cb 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -88,10 +88,12 @@ void cpu_idle(void)
88#endif 88#endif
89 if (!idle) 89 if (!idle)
90 idle = default_idle; 90 idle = default_idle;
91 tick_nohz_stop_sched_tick(1); 91 tick_nohz_idle_enter();
92 rcu_idle_enter();
92 while (!need_resched()) 93 while (!need_resched())
93 idle(); 94 idle();
94 tick_nohz_restart_sched_tick(); 95 rcu_idle_exit();
96 tick_nohz_idle_exit();
95 preempt_enable_no_resched(); 97 preempt_enable_no_resched();
96 schedule(); 98 schedule();
97 preempt_disable(); 99 preempt_disable();
diff --git a/arch/cris/Kconfig.debug b/arch/cris/Kconfig.debug
index 0b9a630dc812..14881e81e8a3 100644
--- a/arch/cris/Kconfig.debug
+++ b/arch/cris/Kconfig.debug
@@ -1,6 +1,5 @@
1menu "Kernel hacking" 1menu "Kernel hacking"
2 2
3#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
4config PROFILING 3config PROFILING
5 bool "Kernel profiling support" 4 bool "Kernel profiling support"
6 5
diff --git a/arch/cris/arch-v10/drivers/Kconfig b/arch/cris/arch-v10/drivers/Kconfig
index 32d90867a984..5f2cdb3e428c 100644
--- a/arch/cris/arch-v10/drivers/Kconfig
+++ b/arch/cris/arch-v10/drivers/Kconfig
@@ -3,7 +3,7 @@ if ETRAX_ARCH_V10
3config ETRAX_ETHERNET 3config ETRAX_ETHERNET
4 bool "Ethernet support" 4 bool "Ethernet support"
5 depends on ETRAX_ARCH_V10 5 depends on ETRAX_ARCH_V10
6 select NET_ETHERNET 6 select ETHERNET
7 select NET_CORE 7 select NET_CORE
8 select MII 8 select MII
9 help 9 help
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig
index e47e9c3401b0..de43aadcdbc4 100644
--- a/arch/cris/arch-v32/drivers/Kconfig
+++ b/arch/cris/arch-v32/drivers/Kconfig
@@ -3,7 +3,7 @@ if ETRAX_ARCH_V32
3config ETRAX_ETHERNET 3config ETRAX_ETHERNET
4 bool "Ethernet support" 4 bool "Ethernet support"
5 depends on ETRAX_ARCH_V32 5 depends on ETRAX_ARCH_V32
6 select NET_ETHERNET 6 select ETHERNET
7 select NET_CORE 7 select NET_CORE
8 select MII 8 select MII
9 help 9 help
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c
index bb978ede8985..6773fc83a670 100644
--- a/arch/cris/arch-v32/kernel/time.c
+++ b/arch/cris/arch-v32/kernel/time.c
@@ -47,14 +47,12 @@ static struct clocksource cont_rotime = {
47 .rating = 300, 47 .rating = 300,
48 .read = read_cont_rotime, 48 .read = read_cont_rotime,
49 .mask = CLOCKSOURCE_MASK(32), 49 .mask = CLOCKSOURCE_MASK(32),
50 .shift = 10,
51 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 50 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
52}; 51};
53 52
54static int __init etrax_init_cont_rotime(void) 53static int __init etrax_init_cont_rotime(void)
55{ 54{
56 cont_rotime.mult = clocksource_khz2mult(100000, cont_rotime.shift); 55 clocksource_register_khz(&cont_rotime, 100000);
57 clocksource_register(&cont_rotime);
58 return 0; 56 return 0;
59} 57}
60arch_initcall(etrax_init_cont_rotime); 58arch_initcall(etrax_init_cont_rotime);
diff --git a/arch/cris/include/asm/ipcbuf.h b/arch/cris/include/asm/ipcbuf.h
index 8b0c18b02844..84c7e51cb6d0 100644
--- a/arch/cris/include/asm/ipcbuf.h
+++ b/arch/cris/include/asm/ipcbuf.h
@@ -1,29 +1 @@
1#ifndef __CRIS_IPCBUF_H__ #include <asm-generic/ipcbuf.h>
2#define __CRIS_IPCBUF_H__
3
4/*
5 * The user_ipc_perm structure for CRIS architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __CRIS_IPCBUF_H__ */
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h
index 1a4a61909ca8..e269264df7c4 100644
--- a/arch/cris/include/asm/socket.h
+++ b/arch/cris/include/asm/socket.h
@@ -64,6 +64,9 @@
64 64
65#define SO_RXQ_OVFL 40 65#define SO_RXQ_OVFL 40
66 66
67#define SO_WIFI_STATUS 41
68#define SCM_WIFI_STATUS SO_WIFI_STATUS
69
67#endif /* _ASM_SOCKET_H */ 70#endif /* _ASM_SOCKET_H */
68 71
69 72
diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h
index 332f19c54557..29b92884d793 100644
--- a/arch/cris/include/asm/thread_info.h
+++ b/arch/cris/include/asm/thread_info.h
@@ -86,7 +86,6 @@ struct thread_info {
86#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ 86#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
87#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 87#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
88#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ 88#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
89#define TIF_FREEZE 18 /* is freezing for suspend */
90 89
91#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 90#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
92#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 91#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -94,7 +93,6 @@ struct thread_info {
94#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 93#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
95#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 94#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
96#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 95#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
97#define _TIF_FREEZE (1<<TIF_FREEZE)
98 96
99#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 97#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
100#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 98#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
diff --git a/arch/cris/include/asm/types.h b/arch/cris/include/asm/types.h
index 551a12c0aa01..adaf82780bb4 100644
--- a/arch/cris/include/asm/types.h
+++ b/arch/cris/include/asm/types.h
@@ -3,12 +3,6 @@
3 3
4#include <asm-generic/int-ll64.h> 4#include <asm-generic/int-ll64.h>
5 5
6#ifndef __ASSEMBLY__
7
8typedef unsigned short umode_t;
9
10#endif /* __ASSEMBLY__ */
11
12/* 6/*
13 * These aren't exported outside the kernel to avoid name space clashes 7 * These aren't exported outside the kernel to avoid name space clashes
14 */ 8 */
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index bad27a6ff407..c5e69abb4889 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -341,16 +341,6 @@ source "drivers/pci/Kconfig"
341 341
342source "drivers/pcmcia/Kconfig" 342source "drivers/pcmcia/Kconfig"
343 343
344#config MATH_EMULATION
345# bool "Math emulation support (EXPERIMENTAL)"
346# depends on EXPERIMENTAL
347# help
348# At some point in the future, this will cause floating-point math
349# instructions to be emulated by the kernel on machines that lack a
350# floating-point math coprocessor. Thrill-seekers and chronically
351# sleep-deprived psychotic hacker types can say Y now, everyone else
352# should probably wait a while.
353
354menu "Power management options" 344menu "Power management options"
355 345
356config ARCH_SUSPEND_POSSIBLE 346config ARCH_SUSPEND_POSSIBLE
diff --git a/arch/frv/include/asm/ipcbuf.h b/arch/frv/include/asm/ipcbuf.h
index b546f67e455f..84c7e51cb6d0 100644
--- a/arch/frv/include/asm/ipcbuf.h
+++ b/arch/frv/include/asm/ipcbuf.h
@@ -1,30 +1 @@
1#ifndef __ASM_IPCBUF_H__ #include <asm-generic/ipcbuf.h>
2#define __ASM_IPCBUF_H__
3
4/*
5 * The user_ipc_perm structure for FR-V architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __ASM_IPCBUF_H__ */
30
diff --git a/arch/frv/include/asm/socket.h b/arch/frv/include/asm/socket.h
index a6b26880c1ec..ce80fdadcce5 100644
--- a/arch/frv/include/asm/socket.h
+++ b/arch/frv/include/asm/socket.h
@@ -62,5 +62,8 @@
62 62
63#define SO_RXQ_OVFL 40 63#define SO_RXQ_OVFL 40
64 64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67
65#endif /* _ASM_SOCKET_H */ 68#endif /* _ASM_SOCKET_H */
66 69
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index cefbe73dc119..92d83ea99ae5 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -111,7 +111,6 @@ register struct thread_info *__current_thread_info asm("gr15");
111#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ 111#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
112#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 112#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
113#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ 113#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
114#define TIF_FREEZE 18 /* freezing for suspend */
115 114
116#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 115#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
117#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 116#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
@@ -120,7 +119,6 @@ register struct thread_info *__current_thread_info asm("gr15");
120#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 119#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
121#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 120#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
122#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 121#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
123#define _TIF_FREEZE (1 << TIF_FREEZE)
124 122
125#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 123#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
126#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 124#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
diff --git a/arch/frv/include/asm/types.h b/arch/frv/include/asm/types.h
index aa3e7fdc7f29..390a612f3a58 100644
--- a/arch/frv/include/asm/types.h
+++ b/arch/frv/include/asm/types.h
@@ -14,12 +14,6 @@
14 14
15#include <asm-generic/int-ll64.h> 15#include <asm-generic/int-ll64.h>
16 16
17#ifndef __ASSEMBLY__
18
19typedef unsigned short umode_t;
20
21#endif /* __ASSEMBLY__ */
22
23/* 17/*
24 * These aren't exported outside the kernel to avoid name space clashes 18 * These aren't exported outside the kernel to avoid name space clashes
25 */ 19 */
diff --git a/arch/h8300/include/asm/ipcbuf.h b/arch/h8300/include/asm/ipcbuf.h
index 2cd1ebcc109d..84c7e51cb6d0 100644
--- a/arch/h8300/include/asm/ipcbuf.h
+++ b/arch/h8300/include/asm/ipcbuf.h
@@ -1,29 +1 @@
1#ifndef __H8300_IPCBUF_H__ #include <asm-generic/ipcbuf.h>
2#define __H8300_IPCBUF_H__
3
4/*
5 * The user_ipc_perm structure for H8/300 architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __H8300_IPCBUF_H__ */
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h
index 04c0f4596eb5..cf1daab6f27e 100644
--- a/arch/h8300/include/asm/socket.h
+++ b/arch/h8300/include/asm/socket.h
@@ -62,4 +62,7 @@
62 62
63#define SO_RXQ_OVFL 40 63#define SO_RXQ_OVFL 40
64 64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67
65#endif /* _ASM_SOCKET_H */ 68#endif /* _ASM_SOCKET_H */
diff --git a/arch/h8300/include/asm/thread_info.h b/arch/h8300/include/asm/thread_info.h
index d6f1784bfdee..9c126e0c09aa 100644
--- a/arch/h8300/include/asm/thread_info.h
+++ b/arch/h8300/include/asm/thread_info.h
@@ -90,7 +90,6 @@ static inline struct thread_info *current_thread_info(void)
90#define TIF_MEMDIE 4 /* is terminating due to OOM killer */ 90#define TIF_MEMDIE 4 /* is terminating due to OOM killer */
91#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ 91#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
92#define TIF_NOTIFY_RESUME 6 /* callback before returning to user */ 92#define TIF_NOTIFY_RESUME 6 /* callback before returning to user */
93#define TIF_FREEZE 16 /* is freezing for suspend */
94 93
95/* as above, but as bit values */ 94/* as above, but as bit values */
96#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 95#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -99,7 +98,6 @@ static inline struct thread_info *current_thread_info(void)
99#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 98#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
100#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 99#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
101#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 100#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
102#define _TIF_FREEZE (1<<TIF_FREEZE)
103 101
104#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 102#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
105 103
diff --git a/arch/h8300/include/asm/types.h b/arch/h8300/include/asm/types.h
index bb2c91a3522e..07257d9487d8 100644
--- a/arch/h8300/include/asm/types.h
+++ b/arch/h8300/include/asm/types.h
@@ -3,27 +3,10 @@
3 3
4#include <asm-generic/int-ll64.h> 4#include <asm-generic/int-ll64.h>
5 5
6#if !defined(__ASSEMBLY__)
7
8/*
9 * This file is never included by application software unless
10 * explicitly requested (e.g., via linux/types.h) in which case the
11 * application is Linux specific so (user-) name space pollution is
12 * not a major issue. However, for interoperability, libraries still
13 * need to be careful to avoid a name clashes.
14 */
15
16typedef unsigned short umode_t;
17
18/*
19 * These aren't exported outside the kernel to avoid name space clashes
20 */
21#ifdef __KERNEL__ 6#ifdef __KERNEL__
22 7
23#define BITS_PER_LONG 32 8#define BITS_PER_LONG 32
24 9
25#endif /* __KERNEL__ */ 10#endif /* __KERNEL__ */
26 11
27#endif /* __ASSEMBLY__ */
28
29#endif /* _H8300_TYPES_H */ 12#endif /* _H8300_TYPES_H */
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 27489b6dd533..3b7a7c483785 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -23,6 +23,9 @@ config IA64
23 select HAVE_ARCH_TRACEHOOK 23 select HAVE_ARCH_TRACEHOOK
24 select HAVE_DMA_API_DEBUG 24 select HAVE_DMA_API_DEBUG
25 select HAVE_GENERIC_HARDIRQS 25 select HAVE_GENERIC_HARDIRQS
26 select HAVE_MEMBLOCK
27 select HAVE_MEMBLOCK_NODE_MAP
28 select ARCH_DISCARD_MEMBLOCK
26 select GENERIC_IRQ_PROBE 29 select GENERIC_IRQ_PROBE
27 select GENERIC_PENDING_IRQ if SMP 30 select GENERIC_PENDING_IRQ if SMP
28 select IRQ_PER_CPU 31 select IRQ_PER_CPU
@@ -474,9 +477,6 @@ config NODES_SHIFT
474 MAX_NUMNODES will be 2^(This value). 477 MAX_NUMNODES will be 2^(This value).
475 If in doubt, use the default. 478 If in doubt, use the default.
476 479
477config ARCH_POPULATES_NODE_MAP
478 def_bool y
479
480# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent. 480# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent.
481# VIRTUAL_MEM_MAP has been retained for historical reasons. 481# VIRTUAL_MEM_MAP has been retained for historical reasons.
482config VIRTUAL_MEM_MAP 482config VIRTUAL_MEM_MAP
diff --git a/arch/ia64/include/asm/cputime.h b/arch/ia64/include/asm/cputime.h
index 6073b187528a..3deac956d325 100644
--- a/arch/ia64/include/asm/cputime.h
+++ b/arch/ia64/include/asm/cputime.h
@@ -26,59 +26,53 @@
26#include <linux/jiffies.h> 26#include <linux/jiffies.h>
27#include <asm/processor.h> 27#include <asm/processor.h>
28 28
29typedef u64 cputime_t; 29typedef u64 __nocast cputime_t;
30typedef u64 cputime64_t; 30typedef u64 __nocast cputime64_t;
31 31
32#define cputime_zero ((cputime_t)0)
33#define cputime_one_jiffy jiffies_to_cputime(1) 32#define cputime_one_jiffy jiffies_to_cputime(1)
34#define cputime_max ((~((cputime_t)0) >> 1) - 1)
35#define cputime_add(__a, __b) ((__a) + (__b))
36#define cputime_sub(__a, __b) ((__a) - (__b))
37#define cputime_div(__a, __n) ((__a) / (__n))
38#define cputime_halve(__a) ((__a) >> 1)
39#define cputime_eq(__a, __b) ((__a) == (__b))
40#define cputime_gt(__a, __b) ((__a) > (__b))
41#define cputime_ge(__a, __b) ((__a) >= (__b))
42#define cputime_lt(__a, __b) ((__a) < (__b))
43#define cputime_le(__a, __b) ((__a) <= (__b))
44
45#define cputime64_zero ((cputime64_t)0)
46#define cputime64_add(__a, __b) ((__a) + (__b))
47#define cputime64_sub(__a, __b) ((__a) - (__b))
48#define cputime_to_cputime64(__ct) (__ct)
49 33
50/* 34/*
51 * Convert cputime <-> jiffies (HZ) 35 * Convert cputime <-> jiffies (HZ)
52 */ 36 */
53#define cputime_to_jiffies(__ct) ((__ct) / (NSEC_PER_SEC / HZ)) 37#define cputime_to_jiffies(__ct) \
54#define jiffies_to_cputime(__jif) ((__jif) * (NSEC_PER_SEC / HZ)) 38 ((__force u64)(__ct) / (NSEC_PER_SEC / HZ))
55#define cputime64_to_jiffies64(__ct) ((__ct) / (NSEC_PER_SEC / HZ)) 39#define jiffies_to_cputime(__jif) \
56#define jiffies64_to_cputime64(__jif) ((__jif) * (NSEC_PER_SEC / HZ)) 40 (__force cputime_t)((__jif) * (NSEC_PER_SEC / HZ))
41#define cputime64_to_jiffies64(__ct) \
42 ((__force u64)(__ct) / (NSEC_PER_SEC / HZ))
43#define jiffies64_to_cputime64(__jif) \
44 (__force cputime64_t)((__jif) * (NSEC_PER_SEC / HZ))
57 45
58/* 46/*
59 * Convert cputime <-> microseconds 47 * Convert cputime <-> microseconds
60 */ 48 */
61#define cputime_to_usecs(__ct) ((__ct) / NSEC_PER_USEC) 49#define cputime_to_usecs(__ct) \
62#define usecs_to_cputime(__usecs) ((__usecs) * NSEC_PER_USEC) 50 ((__force u64)(__ct) / NSEC_PER_USEC)
51#define usecs_to_cputime(__usecs) \
52 (__force cputime_t)((__usecs) * NSEC_PER_USEC)
53#define usecs_to_cputime64(__usecs) \
54 (__force cputime64_t)((__usecs) * NSEC_PER_USEC)
63 55
64/* 56/*
65 * Convert cputime <-> seconds 57 * Convert cputime <-> seconds
66 */ 58 */
67#define cputime_to_secs(__ct) ((__ct) / NSEC_PER_SEC) 59#define cputime_to_secs(__ct) \
68#define secs_to_cputime(__secs) ((__secs) * NSEC_PER_SEC) 60 ((__force u64)(__ct) / NSEC_PER_SEC)
61#define secs_to_cputime(__secs) \
62 (__force cputime_t)((__secs) * NSEC_PER_SEC)
69 63
70/* 64/*
71 * Convert cputime <-> timespec (nsec) 65 * Convert cputime <-> timespec (nsec)
72 */ 66 */
73static inline cputime_t timespec_to_cputime(const struct timespec *val) 67static inline cputime_t timespec_to_cputime(const struct timespec *val)
74{ 68{
75 cputime_t ret = val->tv_sec * NSEC_PER_SEC; 69 u64 ret = val->tv_sec * NSEC_PER_SEC + val->tv_nsec;
76 return (ret + val->tv_nsec); 70 return (__force cputime_t) ret;
77} 71}
78static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val) 72static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val)
79{ 73{
80 val->tv_sec = ct / NSEC_PER_SEC; 74 val->tv_sec = (__force u64) ct / NSEC_PER_SEC;
81 val->tv_nsec = ct % NSEC_PER_SEC; 75 val->tv_nsec = (__force u64) ct % NSEC_PER_SEC;
82} 76}
83 77
84/* 78/*
@@ -86,25 +80,28 @@ static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val)
86 */ 80 */
87static inline cputime_t timeval_to_cputime(struct timeval *val) 81static inline cputime_t timeval_to_cputime(struct timeval *val)
88{ 82{
89 cputime_t ret = val->tv_sec * NSEC_PER_SEC; 83 u64 ret = val->tv_sec * NSEC_PER_SEC + val->tv_usec * NSEC_PER_USEC;
90 return (ret + val->tv_usec * NSEC_PER_USEC); 84 return (__force cputime_t) ret;
91} 85}
92static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val) 86static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val)
93{ 87{
94 val->tv_sec = ct / NSEC_PER_SEC; 88 val->tv_sec = (__force u64) ct / NSEC_PER_SEC;
95 val->tv_usec = (ct % NSEC_PER_SEC) / NSEC_PER_USEC; 89 val->tv_usec = ((__force u64) ct % NSEC_PER_SEC) / NSEC_PER_USEC;
96} 90}
97 91
98/* 92/*
99 * Convert cputime <-> clock (USER_HZ) 93 * Convert cputime <-> clock (USER_HZ)
100 */ 94 */
101#define cputime_to_clock_t(__ct) ((__ct) / (NSEC_PER_SEC / USER_HZ)) 95#define cputime_to_clock_t(__ct) \
102#define clock_t_to_cputime(__x) ((__x) * (NSEC_PER_SEC / USER_HZ)) 96 ((__force u64)(__ct) / (NSEC_PER_SEC / USER_HZ))
97#define clock_t_to_cputime(__x) \
98 (__force cputime_t)((__x) * (NSEC_PER_SEC / USER_HZ))
103 99
104/* 100/*
105 * Convert cputime64 to clock. 101 * Convert cputime64 to clock.
106 */ 102 */
107#define cputime64_to_clock_t(__ct) cputime_to_clock_t((cputime_t)__ct) 103#define cputime64_to_clock_t(__ct) \
104 cputime_to_clock_t((__force cputime_t)__ct)
108 105
109#endif /* CONFIG_VIRT_CPU_ACCOUNTING */ 106#endif /* CONFIG_VIRT_CPU_ACCOUNTING */
110#endif /* __IA64_CPUTIME_H */ 107#endif /* __IA64_CPUTIME_H */
diff --git a/arch/ia64/include/asm/ipcbuf.h b/arch/ia64/include/asm/ipcbuf.h
index 079899ae7d32..84c7e51cb6d0 100644
--- a/arch/ia64/include/asm/ipcbuf.h
+++ b/arch/ia64/include/asm/ipcbuf.h
@@ -1,28 +1 @@
1#ifndef _ASM_IA64_IPCBUF_H #include <asm-generic/ipcbuf.h>
2#define _ASM_IA64_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for IA-64 architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit seq
11 * - 2 miscellaneous 64-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid_t uid;
18 __kernel_gid_t gid;
19 __kernel_uid_t cuid;
20 __kernel_gid_t cgid;
21 __kernel_mode_t mode;
22 unsigned short seq;
23 unsigned short __pad1;
24 unsigned long __unused1;
25 unsigned long __unused2;
26};
27
28#endif /* _ASM_IA64_IPCBUF_H */
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
index 51427eaa51ba..4b03664e3fb5 100644
--- a/arch/ia64/include/asm/socket.h
+++ b/arch/ia64/include/asm/socket.h
@@ -71,4 +71,7 @@
71 71
72#define SO_RXQ_OVFL 40 72#define SO_RXQ_OVFL 40
73 73
74#define SO_WIFI_STATUS 41
75#define SCM_WIFI_STATUS SO_WIFI_STATUS
76
74#endif /* _ASM_IA64_SOCKET_H */ 77#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index ff0cc84e7bcc..e054bcc4273c 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -113,7 +113,6 @@ struct thread_info {
113#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ 113#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
114#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ 114#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */
115#define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */ 115#define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */
116#define TIF_FREEZE 20 /* is freezing for suspend */
117#define TIF_RESTORE_RSE 21 /* user RBS is newer than kernel RBS */ 116#define TIF_RESTORE_RSE 21 /* user RBS is newer than kernel RBS */
118 117
119#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 118#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
@@ -126,7 +125,6 @@ struct thread_info {
126#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 125#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
127#define _TIF_MCA_INIT (1 << TIF_MCA_INIT) 126#define _TIF_MCA_INIT (1 << TIF_MCA_INIT)
128#define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) 127#define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED)
129#define _TIF_FREEZE (1 << TIF_FREEZE)
130#define _TIF_RESTORE_RSE (1 << TIF_RESTORE_RSE) 128#define _TIF_RESTORE_RSE (1 << TIF_RESTORE_RSE)
131 129
132/* "work to do on user-return" bits */ 130/* "work to do on user-return" bits */
diff --git a/arch/ia64/include/asm/types.h b/arch/ia64/include/asm/types.h
index 82b3939d2718..3f5b122d9975 100644
--- a/arch/ia64/include/asm/types.h
+++ b/arch/ia64/include/asm/types.h
@@ -28,8 +28,6 @@
28# define __IA64_UL(x) ((unsigned long)(x)) 28# define __IA64_UL(x) ((unsigned long)(x))
29# define __IA64_UL_CONST(x) x##UL 29# define __IA64_UL_CONST(x) x##UL
30 30
31typedef unsigned int umode_t;
32
33/* 31/*
34 * These aren't exported outside the kernel to avoid name space clashes 32 * These aren't exported outside the kernel to avoid name space clashes
35 */ 33 */
diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c
index c539c689493b..2d67317a1ec2 100644
--- a/arch/ia64/kernel/err_inject.c
+++ b/arch/ia64/kernel/err_inject.c
@@ -24,7 +24,7 @@
24 * Copyright (C) 2006, Intel Corp. All rights reserved. 24 * Copyright (C) 2006, Intel Corp. All rights reserved.
25 * 25 *
26 */ 26 */
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/cpu.h> 30#include <linux/cpu.h>
@@ -35,10 +35,10 @@
35#define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte; 35#define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte;
36 36
37#define define_one_ro(name) \ 37#define define_one_ro(name) \
38static SYSDEV_ATTR(name, 0444, show_##name, NULL) 38static DEVICE_ATTR(name, 0444, show_##name, NULL)
39 39
40#define define_one_rw(name) \ 40#define define_one_rw(name) \
41static SYSDEV_ATTR(name, 0644, show_##name, store_##name) 41static DEVICE_ATTR(name, 0644, show_##name, store_##name)
42 42
43static u64 call_start[NR_CPUS]; 43static u64 call_start[NR_CPUS];
44static u64 phys_addr[NR_CPUS]; 44static u64 phys_addr[NR_CPUS];
@@ -55,7 +55,7 @@ static u64 resources[NR_CPUS];
55 55
56#define show(name) \ 56#define show(name) \
57static ssize_t \ 57static ssize_t \
58show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \ 58show_##name(struct device *dev, struct device_attribute *attr, \
59 char *buf) \ 59 char *buf) \
60{ \ 60{ \
61 u32 cpu=dev->id; \ 61 u32 cpu=dev->id; \
@@ -64,7 +64,7 @@ show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
64 64
65#define store(name) \ 65#define store(name) \
66static ssize_t \ 66static ssize_t \
67store_##name(struct sys_device *dev, struct sysdev_attribute *attr, \ 67store_##name(struct device *dev, struct device_attribute *attr, \
68 const char *buf, size_t size) \ 68 const char *buf, size_t size) \
69{ \ 69{ \
70 unsigned int cpu=dev->id; \ 70 unsigned int cpu=dev->id; \
@@ -78,7 +78,7 @@ show(call_start)
78 * processor. The cpu number in driver is only used for storing data. 78 * processor. The cpu number in driver is only used for storing data.
79 */ 79 */
80static ssize_t 80static ssize_t
81store_call_start(struct sys_device *dev, struct sysdev_attribute *attr, 81store_call_start(struct device *dev, struct device_attribute *attr,
82 const char *buf, size_t size) 82 const char *buf, size_t size)
83{ 83{
84 unsigned int cpu=dev->id; 84 unsigned int cpu=dev->id;
@@ -127,7 +127,7 @@ show(err_type_info)
127store(err_type_info) 127store(err_type_info)
128 128
129static ssize_t 129static ssize_t
130show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr, 130show_virtual_to_phys(struct device *dev, struct device_attribute *attr,
131 char *buf) 131 char *buf)
132{ 132{
133 unsigned int cpu=dev->id; 133 unsigned int cpu=dev->id;
@@ -135,7 +135,7 @@ show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
135} 135}
136 136
137static ssize_t 137static ssize_t
138store_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr, 138store_virtual_to_phys(struct device *dev, struct device_attribute *attr,
139 const char *buf, size_t size) 139 const char *buf, size_t size)
140{ 140{
141 unsigned int cpu=dev->id; 141 unsigned int cpu=dev->id;
@@ -159,8 +159,8 @@ show(err_struct_info)
159store(err_struct_info) 159store(err_struct_info)
160 160
161static ssize_t 161static ssize_t
162show_err_data_buffer(struct sys_device *dev, 162show_err_data_buffer(struct device *dev,
163 struct sysdev_attribute *attr, char *buf) 163 struct device_attribute *attr, char *buf)
164{ 164{
165 unsigned int cpu=dev->id; 165 unsigned int cpu=dev->id;
166 166
@@ -171,8 +171,8 @@ show_err_data_buffer(struct sys_device *dev,
171} 171}
172 172
173static ssize_t 173static ssize_t
174store_err_data_buffer(struct sys_device *dev, 174store_err_data_buffer(struct device *dev,
175 struct sysdev_attribute *attr, 175 struct device_attribute *attr,
176 const char *buf, size_t size) 176 const char *buf, size_t size)
177{ 177{
178 unsigned int cpu=dev->id; 178 unsigned int cpu=dev->id;
@@ -209,14 +209,14 @@ define_one_ro(capabilities);
209define_one_ro(resources); 209define_one_ro(resources);
210 210
211static struct attribute *default_attrs[] = { 211static struct attribute *default_attrs[] = {
212 &attr_call_start.attr, 212 &dev_attr_call_start.attr,
213 &attr_virtual_to_phys.attr, 213 &dev_attr_virtual_to_phys.attr,
214 &attr_err_type_info.attr, 214 &dev_attr_err_type_info.attr,
215 &attr_err_struct_info.attr, 215 &dev_attr_err_struct_info.attr,
216 &attr_err_data_buffer.attr, 216 &dev_attr_err_data_buffer.attr,
217 &attr_status.attr, 217 &dev_attr_status.attr,
218 &attr_capabilities.attr, 218 &dev_attr_capabilities.attr,
219 &attr_resources.attr, 219 &dev_attr_resources.attr,
220 NULL 220 NULL
221}; 221};
222 222
@@ -225,12 +225,12 @@ static struct attribute_group err_inject_attr_group = {
225 .name = "err_inject" 225 .name = "err_inject"
226}; 226};
227/* Add/Remove err_inject interface for CPU device */ 227/* Add/Remove err_inject interface for CPU device */
228static int __cpuinit err_inject_add_dev(struct sys_device * sys_dev) 228static int __cpuinit err_inject_add_dev(struct device * sys_dev)
229{ 229{
230 return sysfs_create_group(&sys_dev->kobj, &err_inject_attr_group); 230 return sysfs_create_group(&sys_dev->kobj, &err_inject_attr_group);
231} 231}
232 232
233static int __cpuinit err_inject_remove_dev(struct sys_device * sys_dev) 233static int __cpuinit err_inject_remove_dev(struct device * sys_dev)
234{ 234{
235 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group); 235 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);
236 return 0; 236 return 0;
@@ -239,9 +239,9 @@ static int __cpuinit err_inject_cpu_callback(struct notifier_block *nfb,
239 unsigned long action, void *hcpu) 239 unsigned long action, void *hcpu)
240{ 240{
241 unsigned int cpu = (unsigned long)hcpu; 241 unsigned int cpu = (unsigned long)hcpu;
242 struct sys_device *sys_dev; 242 struct device *sys_dev;
243 243
244 sys_dev = get_cpu_sysdev(cpu); 244 sys_dev = get_cpu_device(cpu);
245 switch (action) { 245 switch (action) {
246 case CPU_ONLINE: 246 case CPU_ONLINE:
247 case CPU_ONLINE_FROZEN: 247 case CPU_ONLINE_FROZEN:
@@ -283,13 +283,13 @@ static void __exit
283err_inject_exit(void) 283err_inject_exit(void)
284{ 284{
285 int i; 285 int i;
286 struct sys_device *sys_dev; 286 struct device *sys_dev;
287 287
288#ifdef ERR_INJ_DEBUG 288#ifdef ERR_INJ_DEBUG
289 printk(KERN_INFO "Exit error injection driver.\n"); 289 printk(KERN_INFO "Exit error injection driver.\n");
290#endif 290#endif
291 for_each_online_cpu(i) { 291 for_each_online_cpu(i) {
292 sys_dev = get_cpu_sysdev(i); 292 sys_dev = get_cpu_device(i);
293 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group); 293 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);
294 } 294 }
295 unregister_hotcpu_notifier(&err_inject_cpu_notifier); 295 unregister_hotcpu_notifier(&err_inject_cpu_notifier);
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 89accc626b86..b2c65e034f5d 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2228,7 +2228,7 @@ pfm_alloc_file(pfm_context_t *ctx)
2228 /* 2228 /*
2229 * allocate a new dcache entry 2229 * allocate a new dcache entry
2230 */ 2230 */
2231 path.dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this); 2231 path.dentry = d_alloc(pfmfs_mnt->mnt_root, &this);
2232 if (!path.dentry) { 2232 if (!path.dentry) {
2233 iput(inode); 2233 iput(inode);
2234 return ERR_PTR(-ENOMEM); 2234 return ERR_PTR(-ENOMEM);
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5e2c72498c51..cd57d7312de0 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -220,6 +220,23 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
220 } 220 }
221} 221}
222 222
223/* merge overlaps */
224static int __init
225merge_regions (struct rsvd_region *rsvd_region, int max)
226{
227 int i;
228 for (i = 1; i < max; ++i) {
229 if (rsvd_region[i].start >= rsvd_region[i-1].end)
230 continue;
231 if (rsvd_region[i].end > rsvd_region[i-1].end)
232 rsvd_region[i-1].end = rsvd_region[i].end;
233 --max;
234 memmove(&rsvd_region[i], &rsvd_region[i+1],
235 (max - i) * sizeof(struct rsvd_region));
236 }
237 return max;
238}
239
223/* 240/*
224 * Request address space for all standard resources 241 * Request address space for all standard resources
225 */ 242 */
@@ -270,6 +287,7 @@ static void __init setup_crashkernel(unsigned long total, int *n)
270 if (ret == 0 && size > 0) { 287 if (ret == 0 && size > 0) {
271 if (!base) { 288 if (!base) {
272 sort_regions(rsvd_region, *n); 289 sort_regions(rsvd_region, *n);
290 *n = merge_regions(rsvd_region, *n);
273 base = kdump_find_rsvd_region(size, 291 base = kdump_find_rsvd_region(size,
274 rsvd_region, *n); 292 rsvd_region, *n);
275 } 293 }
@@ -373,6 +391,7 @@ reserve_memory (void)
373 BUG_ON(IA64_MAX_RSVD_REGIONS + 1 < n); 391 BUG_ON(IA64_MAX_RSVD_REGIONS + 1 < n);
374 392
375 sort_regions(rsvd_region, num_rsvd_regions); 393 sort_regions(rsvd_region, num_rsvd_regions);
394 num_rsvd_regions = merge_regions(rsvd_region, num_rsvd_regions);
376} 395}
377 396
378 397
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 9be1f11a01d9..9deb21dbf629 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -350,7 +350,7 @@ static int __cpuinit cpu_cache_sysfs_init(unsigned int cpu)
350} 350}
351 351
352/* Add cache interface for CPU device */ 352/* Add cache interface for CPU device */
353static int __cpuinit cache_add_dev(struct sys_device * sys_dev) 353static int __cpuinit cache_add_dev(struct device * sys_dev)
354{ 354{
355 unsigned int cpu = sys_dev->id; 355 unsigned int cpu = sys_dev->id;
356 unsigned long i, j; 356 unsigned long i, j;
@@ -400,7 +400,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
400} 400}
401 401
402/* Remove cache interface for CPU device */ 402/* Remove cache interface for CPU device */
403static int __cpuinit cache_remove_dev(struct sys_device * sys_dev) 403static int __cpuinit cache_remove_dev(struct device * sys_dev)
404{ 404{
405 unsigned int cpu = sys_dev->id; 405 unsigned int cpu = sys_dev->id;
406 unsigned long i; 406 unsigned long i;
@@ -428,9 +428,9 @@ static int __cpuinit cache_cpu_callback(struct notifier_block *nfb,
428 unsigned long action, void *hcpu) 428 unsigned long action, void *hcpu)
429{ 429{
430 unsigned int cpu = (unsigned long)hcpu; 430 unsigned int cpu = (unsigned long)hcpu;
431 struct sys_device *sys_dev; 431 struct device *sys_dev;
432 432
433 sys_dev = get_cpu_sysdev(cpu); 433 sys_dev = get_cpu_device(cpu);
434 switch (action) { 434 switch (action) {
435 case CPU_ONLINE: 435 case CPU_ONLINE:
436 case CPU_ONLINE_FROZEN: 436 case CPU_ONLINE_FROZEN:
@@ -454,7 +454,7 @@ static int __init cache_sysfs_init(void)
454 int i; 454 int i;
455 455
456 for_each_online_cpu(i) { 456 for_each_online_cpu(i) {
457 struct sys_device *sys_dev = get_cpu_sysdev((unsigned int)i); 457 struct device *sys_dev = get_cpu_device((unsigned int)i);
458 cache_add_dev(sys_dev); 458 cache_add_dev(sys_dev);
459 } 459 }
460 460
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index f114a3b14c6a..1516d1dc11fd 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -16,6 +16,7 @@
16 */ 16 */
17#include <linux/bootmem.h> 17#include <linux/bootmem.h>
18#include <linux/efi.h> 18#include <linux/efi.h>
19#include <linux/memblock.h>
19#include <linux/mm.h> 20#include <linux/mm.h>
20#include <linux/nmi.h> 21#include <linux/nmi.h>
21#include <linux/swap.h> 22#include <linux/swap.h>
@@ -348,7 +349,7 @@ paging_init (void)
348 printk("Virtual mem_map starts at 0x%p\n", mem_map); 349 printk("Virtual mem_map starts at 0x%p\n", mem_map);
349 } 350 }
350#else /* !CONFIG_VIRTUAL_MEM_MAP */ 351#else /* !CONFIG_VIRTUAL_MEM_MAP */
351 add_active_range(0, 0, max_low_pfn); 352 memblock_add_node(0, PFN_PHYS(max_low_pfn), 0);
352 free_area_init_nodes(max_zone_pfns); 353 free_area_init_nodes(max_zone_pfns);
353#endif /* !CONFIG_VIRTUAL_MEM_MAP */ 354#endif /* !CONFIG_VIRTUAL_MEM_MAP */
354 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); 355 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 00cb0e26c64e..13df239dbed1 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -10,6 +10,7 @@
10#include <linux/bootmem.h> 10#include <linux/bootmem.h>
11#include <linux/efi.h> 11#include <linux/efi.h>
12#include <linux/elf.h> 12#include <linux/elf.h>
13#include <linux/memblock.h>
13#include <linux/mm.h> 14#include <linux/mm.h>
14#include <linux/mmzone.h> 15#include <linux/mmzone.h>
15#include <linux/module.h> 16#include <linux/module.h>
@@ -557,8 +558,7 @@ int __init register_active_ranges(u64 start, u64 len, int nid)
557#endif 558#endif
558 559
559 if (start < end) 560 if (start < end)
560 add_active_range(nid, __pa(start) >> PAGE_SHIFT, 561 memblock_add_node(__pa(start), end - start, nid);
561 __pa(end) >> PAGE_SHIFT);
562 return 0; 562 return 0;
563} 563}
564 564
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 485c42d97e83..dfac09ab027a 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -150,12 +150,11 @@ struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info,
150 * PROM does not support SAL_INTR_REDIRECT, or it failed. 150 * PROM does not support SAL_INTR_REDIRECT, or it failed.
151 * Revert to old method. 151 * Revert to old method.
152 */ 152 */
153 new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); 153 new_irq_info = kmemdup(sn_irq_info, sizeof(struct sn_irq_info),
154 GFP_ATOMIC);
154 if (new_irq_info == NULL) 155 if (new_irq_info == NULL)
155 return NULL; 156 return NULL;
156 157
157 memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info));
158
159 /* Free the old PROM new_irq_info structure */ 158 /* Free the old PROM new_irq_info structure */
160 sn_intr_free(local_nasid, local_widget, new_irq_info); 159 sn_intr_free(local_nasid, local_widget, new_irq_info);
161 unregister_intr_pda(new_irq_info); 160 unregister_intr_pda(new_irq_info);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 5698f29d5add..8886a0bc4a11 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -127,12 +127,11 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
127 * Allocate kernel bus soft and copy from prom. 127 * Allocate kernel bus soft and copy from prom.
128 */ 128 */
129 129
130 soft = kmalloc(sizeof(struct pcibus_info), GFP_KERNEL); 130 soft = kmemdup(prom_bussoft, sizeof(struct pcibus_info), GFP_KERNEL);
131 if (!soft) { 131 if (!soft) {
132 return NULL; 132 return NULL;
133 } 133 }
134 134
135 memcpy(soft, prom_bussoft, sizeof(struct pcibus_info));
136 soft->pbi_buscommon.bs_base = (unsigned long) 135 soft->pbi_buscommon.bs_base = (unsigned long)
137 ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base), 136 ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base),
138 sizeof(struct pic)); 137 sizeof(struct pic));
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 642451e770ea..e77c477245fd 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -600,11 +600,11 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
600 * Allocate kernel bus soft and copy from prom. 600 * Allocate kernel bus soft and copy from prom.
601 */ 601 */
602 602
603 tioca_common = kzalloc(sizeof(struct tioca_common), GFP_KERNEL); 603 tioca_common = kmemdup(prom_bussoft, sizeof(struct tioca_common),
604 GFP_KERNEL);
604 if (!tioca_common) 605 if (!tioca_common)
605 return NULL; 606 return NULL;
606 607
607 memcpy(tioca_common, prom_bussoft, sizeof(struct tioca_common));
608 tioca_common->ca_common.bs_base = (unsigned long) 608 tioca_common->ca_common.bs_base = (unsigned long)
609 ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base), 609 ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base),
610 sizeof(struct tioca_common)); 610 sizeof(struct tioca_common));
diff --git a/arch/m32r/include/asm/ipcbuf.h b/arch/m32r/include/asm/ipcbuf.h
index 8d2d7c8ffdb0..84c7e51cb6d0 100644
--- a/arch/m32r/include/asm/ipcbuf.h
+++ b/arch/m32r/include/asm/ipcbuf.h
@@ -1,29 +1 @@
1#ifndef _ASM_M32R_IPCBUF_H #include <asm-generic/ipcbuf.h>
2#define _ASM_M32R_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for m32r architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* _ASM_M32R_IPCBUF_H */
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h
index 469787c30098..e8b8c5bb053c 100644
--- a/arch/m32r/include/asm/socket.h
+++ b/arch/m32r/include/asm/socket.h
@@ -62,4 +62,7 @@
62 62
63#define SO_RXQ_OVFL 40 63#define SO_RXQ_OVFL 40
64 64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67
65#endif /* _ASM_M32R_SOCKET_H */ 68#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
index 0227dba44068..bf8fa3c06f4e 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -138,7 +138,6 @@ static inline unsigned int get_thread_fault_code(void)
138#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 138#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
139#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 139#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
140#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 140#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
141#define TIF_FREEZE 19 /* is freezing for suspend */
142 141
143#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 142#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
144#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 143#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
@@ -149,7 +148,6 @@ static inline unsigned int get_thread_fault_code(void)
149#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 148#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
150#define _TIF_USEDFPU (1<<TIF_USEDFPU) 149#define _TIF_USEDFPU (1<<TIF_USEDFPU)
151#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 150#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
152#define _TIF_FREEZE (1<<TIF_FREEZE)
153 151
154#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 152#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
155#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 153#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
diff --git a/arch/m32r/include/asm/types.h b/arch/m32r/include/asm/types.h
index bd0035597b3b..bb2eeadecf99 100644
--- a/arch/m32r/include/asm/types.h
+++ b/arch/m32r/include/asm/types.h
@@ -3,12 +3,6 @@
3 3
4#include <asm-generic/int-ll64.h> 4#include <asm-generic/int-ll64.h>
5 5
6#ifndef __ASSEMBLY__
7
8typedef unsigned short umode_t;
9
10#endif /* __ASSEMBLY__ */
11
12/* 6/*
13 * These aren't exported outside the kernel to avoid name space clashes 7 * These aren't exported outside the kernel to avoid name space clashes
14 */ 8 */
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 361d54019bb0..81fdaa72c540 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -3,7 +3,6 @@ config M68K
3 default y 3 default y
4 select HAVE_IDE 4 select HAVE_IDE
5 select HAVE_AOUT if MMU 5 select HAVE_AOUT if MMU
6 select GENERIC_ATOMIC64 if MMU
7 select HAVE_GENERIC_HARDIRQS 6 select HAVE_GENERIC_HARDIRQS
8 select GENERIC_IRQ_SHOW 7 select GENERIC_IRQ_SHOW
9 select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS 8 select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
@@ -41,12 +40,15 @@ config GENERIC_CALIBRATE_DELAY
41config GENERIC_IOMAP 40config GENERIC_IOMAP
42 def_bool MMU 41 def_bool MMU
43 42
43config GENERIC_CSUM
44 bool
45
44config TIME_LOW_RES 46config TIME_LOW_RES
45 bool 47 bool
46 default y 48 default y
47 49
48config ARCH_USES_GETTIMEOFFSET 50config ARCH_USES_GETTIMEOFFSET
49 def_bool MMU 51 def_bool MMU && !COLDFIRE
50 52
51config NO_IOPORT 53config NO_IOPORT
52 def_bool y 54 def_bool y
@@ -61,6 +63,12 @@ config ZONE_DMA
61config CPU_HAS_NO_BITFIELDS 63config CPU_HAS_NO_BITFIELDS
62 bool 64 bool
63 65
66config CPU_HAS_NO_MULDIV64
67 bool
68
69config CPU_HAS_ADDRESS_SPACES
70 bool
71
64config HZ 72config HZ
65 int 73 int
66 default 1000 if CLEOPATRA 74 default 1000 if CLEOPATRA
@@ -80,9 +88,12 @@ config MMU
80config MMU_MOTOROLA 88config MMU_MOTOROLA
81 bool 89 bool
82 90
91config MMU_COLDFIRE
92 bool
93
83config MMU_SUN3 94config MMU_SUN3
84 bool 95 bool
85 depends on MMU && !MMU_MOTOROLA 96 depends on MMU && !MMU_MOTOROLA && !MMU_COLDFIRE
86 97
87menu "Platform setup" 98menu "Platform setup"
88 99
diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index e632b2d12106..8a9c767125a4 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -1,8 +1,42 @@
1comment "Processor Type" 1comment "Processor Type"
2 2
3choice
4 prompt "CPU family support"
5 default M68KCLASSIC if MMU
6 default COLDFIRE if !MMU
7 help
8 The Freescale (was Motorola) M68K family of processors implements
9 the full 68000 processor instruction set.
10 The Freescale ColdFire family of processors is a modern derivitive
11 of the 68000 processor family. They are mainly targeted at embedded
12 applications, and are all System-On-Chip (SOC) devices, as opposed
13 to stand alone CPUs. They implement a subset of the original 68000
14 processor instruction set.
15 If you anticipate running this kernel on a computer with a classic
16 MC68xxx processor, select M68KCLASSIC.
17 If you anticipate running this kernel on a computer with a ColdFire
18 processor, select COLDFIRE.
19
20config M68KCLASSIC
21 bool "Classic M68K CPU family support"
22
23config COLDFIRE
24 bool "Coldfire CPU family support"
25 select GENERIC_GPIO
26 select ARCH_REQUIRE_GPIOLIB
27 select CPU_HAS_NO_BITFIELDS
28 select CPU_HAS_NO_MULDIV64
29 select GENERIC_CSUM
30
31endchoice
32
33if M68KCLASSIC
34
3config M68000 35config M68000
4 bool 36 bool
5 select CPU_HAS_NO_BITFIELDS 37 select CPU_HAS_NO_BITFIELDS
38 select CPU_HAS_NO_MULDIV64
39 select GENERIC_CSUM
6 help 40 help
7 The Freescale (was Motorola) 68000 CPU is the first generation of 41 The Freescale (was Motorola) 68000 CPU is the first generation of
8 the well known M68K family of processors. The CPU core as well as 42 the well known M68K family of processors. The CPU core as well as
@@ -18,21 +52,11 @@ config MCPU32
18 based on the 68020 processor. For the most part it is used in 52 based on the 68020 processor. For the most part it is used in
19 System-On-Chip parts, and does not contain a paging MMU. 53 System-On-Chip parts, and does not contain a paging MMU.
20 54
21config COLDFIRE
22 bool
23 select GENERIC_GPIO
24 select ARCH_REQUIRE_GPIOLIB
25 select CPU_HAS_NO_BITFIELDS
26 help
27 The Freescale ColdFire family of processors is a modern derivitive
28 of the 68000 processor family. They are mainly targeted at embedded
29 applications, and are all System-On-Chip (SOC) devices, as opposed
30 to stand alone CPUs. They implement a subset of the original 68000
31 processor instruction set.
32
33config M68020 55config M68020
34 bool "68020 support" 56 bool "68020 support"
35 depends on MMU 57 depends on MMU
58 select GENERIC_ATOMIC64
59 select CPU_HAS_ADDRESS_SPACES
36 help 60 help
37 If you anticipate running this kernel on a computer with a MC68020 61 If you anticipate running this kernel on a computer with a MC68020
38 processor, say Y. Otherwise, say N. Note that the 68020 requires a 62 processor, say Y. Otherwise, say N. Note that the 68020 requires a
@@ -42,6 +66,8 @@ config M68020
42config M68030 66config M68030
43 bool "68030 support" 67 bool "68030 support"
44 depends on MMU && !MMU_SUN3 68 depends on MMU && !MMU_SUN3
69 select GENERIC_ATOMIC64
70 select CPU_HAS_ADDRESS_SPACES
45 help 71 help
46 If you anticipate running this kernel on a computer with a MC68030 72 If you anticipate running this kernel on a computer with a MC68030
47 processor, say Y. Otherwise, say N. Note that a MC68EC030 will not 73 processor, say Y. Otherwise, say N. Note that a MC68EC030 will not
@@ -50,6 +76,8 @@ config M68030
50config M68040 76config M68040
51 bool "68040 support" 77 bool "68040 support"
52 depends on MMU && !MMU_SUN3 78 depends on MMU && !MMU_SUN3
79 select GENERIC_ATOMIC64
80 select CPU_HAS_ADDRESS_SPACES
53 help 81 help
54 If you anticipate running this kernel on a computer with a MC68LC040 82 If you anticipate running this kernel on a computer with a MC68LC040
55 or MC68040 processor, say Y. Otherwise, say N. Note that an 83 or MC68040 processor, say Y. Otherwise, say N. Note that an
@@ -59,6 +87,8 @@ config M68040
59config M68060 87config M68060
60 bool "68060 support" 88 bool "68060 support"
61 depends on MMU && !MMU_SUN3 89 depends on MMU && !MMU_SUN3
90 select GENERIC_ATOMIC64
91 select CPU_HAS_ADDRESS_SPACES
62 help 92 help
63 If you anticipate running this kernel on a computer with a MC68060 93 If you anticipate running this kernel on a computer with a MC68060
64 processor, say Y. Otherwise, say N. 94 processor, say Y. Otherwise, say N.
@@ -91,10 +121,13 @@ config M68360
91 help 121 help
92 Motorola 68360 processor support. 122 Motorola 68360 processor support.
93 123
124endif # M68KCLASSIC
125
126if COLDFIRE
127
94config M5206 128config M5206
95 bool "MCF5206" 129 bool "MCF5206"
96 depends on !MMU 130 depends on !MMU
97 select COLDFIRE
98 select COLDFIRE_SW_A7 131 select COLDFIRE_SW_A7
99 select HAVE_MBAR 132 select HAVE_MBAR
100 help 133 help
@@ -103,7 +136,6 @@ config M5206
103config M5206e 136config M5206e
104 bool "MCF5206e" 137 bool "MCF5206e"
105 depends on !MMU 138 depends on !MMU
106 select COLDFIRE
107 select COLDFIRE_SW_A7 139 select COLDFIRE_SW_A7
108 select HAVE_MBAR 140 select HAVE_MBAR
109 help 141 help
@@ -112,7 +144,6 @@ config M5206e
112config M520x 144config M520x
113 bool "MCF520x" 145 bool "MCF520x"
114 depends on !MMU 146 depends on !MMU
115 select COLDFIRE
116 select GENERIC_CLOCKEVENTS 147 select GENERIC_CLOCKEVENTS
117 select HAVE_CACHE_SPLIT 148 select HAVE_CACHE_SPLIT
118 help 149 help
@@ -121,7 +152,6 @@ config M520x
121config M523x 152config M523x
122 bool "MCF523x" 153 bool "MCF523x"
123 depends on !MMU 154 depends on !MMU
124 select COLDFIRE
125 select GENERIC_CLOCKEVENTS 155 select GENERIC_CLOCKEVENTS
126 select HAVE_CACHE_SPLIT 156 select HAVE_CACHE_SPLIT
127 select HAVE_IPSBAR 157 select HAVE_IPSBAR
@@ -131,7 +161,6 @@ config M523x
131config M5249 161config M5249
132 bool "MCF5249" 162 bool "MCF5249"
133 depends on !MMU 163 depends on !MMU
134 select COLDFIRE
135 select COLDFIRE_SW_A7 164 select COLDFIRE_SW_A7
136 select HAVE_MBAR 165 select HAVE_MBAR
137 help 166 help
@@ -143,7 +172,6 @@ config M527x
143config M5271 172config M5271
144 bool "MCF5271" 173 bool "MCF5271"
145 depends on !MMU 174 depends on !MMU
146 select COLDFIRE
147 select M527x 175 select M527x
148 select HAVE_CACHE_SPLIT 176 select HAVE_CACHE_SPLIT
149 select HAVE_IPSBAR 177 select HAVE_IPSBAR
@@ -154,7 +182,6 @@ config M5271
154config M5272 182config M5272
155 bool "MCF5272" 183 bool "MCF5272"
156 depends on !MMU 184 depends on !MMU
157 select COLDFIRE
158 select COLDFIRE_SW_A7 185 select COLDFIRE_SW_A7
159 select HAVE_MBAR 186 select HAVE_MBAR
160 help 187 help
@@ -163,7 +190,6 @@ config M5272
163config M5275 190config M5275
164 bool "MCF5275" 191 bool "MCF5275"
165 depends on !MMU 192 depends on !MMU
166 select COLDFIRE
167 select M527x 193 select M527x
168 select HAVE_CACHE_SPLIT 194 select HAVE_CACHE_SPLIT
169 select HAVE_IPSBAR 195 select HAVE_IPSBAR
@@ -174,7 +200,6 @@ config M5275
174config M528x 200config M528x
175 bool "MCF528x" 201 bool "MCF528x"
176 depends on !MMU 202 depends on !MMU
177 select COLDFIRE
178 select GENERIC_CLOCKEVENTS 203 select GENERIC_CLOCKEVENTS
179 select HAVE_CACHE_SPLIT 204 select HAVE_CACHE_SPLIT
180 select HAVE_IPSBAR 205 select HAVE_IPSBAR
@@ -184,7 +209,6 @@ config M528x
184config M5307 209config M5307
185 bool "MCF5307" 210 bool "MCF5307"
186 depends on !MMU 211 depends on !MMU
187 select COLDFIRE
188 select COLDFIRE_SW_A7 212 select COLDFIRE_SW_A7
189 select HAVE_CACHE_CB 213 select HAVE_CACHE_CB
190 select HAVE_MBAR 214 select HAVE_MBAR
@@ -194,7 +218,6 @@ config M5307
194config M532x 218config M532x
195 bool "MCF532x" 219 bool "MCF532x"
196 depends on !MMU 220 depends on !MMU
197 select COLDFIRE
198 select HAVE_CACHE_CB 221 select HAVE_CACHE_CB
199 help 222 help
200 Freescale (Motorola) ColdFire 532x processor support. 223 Freescale (Motorola) ColdFire 532x processor support.
@@ -202,7 +225,6 @@ config M532x
202config M5407 225config M5407
203 bool "MCF5407" 226 bool "MCF5407"
204 depends on !MMU 227 depends on !MMU
205 select COLDFIRE
206 select COLDFIRE_SW_A7 228 select COLDFIRE_SW_A7
207 select HAVE_CACHE_CB 229 select HAVE_CACHE_CB
208 select HAVE_MBAR 230 select HAVE_MBAR
@@ -214,9 +236,8 @@ config M54xx
214 236
215config M547x 237config M547x
216 bool "MCF547x" 238 bool "MCF547x"
217 depends on !MMU
218 select COLDFIRE
219 select M54xx 239 select M54xx
240 select MMU_COLDFIRE if MMU
220 select HAVE_CACHE_CB 241 select HAVE_CACHE_CB
221 select HAVE_MBAR 242 select HAVE_MBAR
222 help 243 help
@@ -224,14 +245,15 @@ config M547x
224 245
225config M548x 246config M548x
226 bool "MCF548x" 247 bool "MCF548x"
227 depends on !MMU 248 select MMU_COLDFIRE if MMU
228 select COLDFIRE
229 select M54xx 249 select M54xx
230 select HAVE_CACHE_CB 250 select HAVE_CACHE_CB
231 select HAVE_MBAR 251 select HAVE_MBAR
232 help 252 help
233 Freescale ColdFire 5480/5481/5482/5483/5484/5485 processor support. 253 Freescale ColdFire 5480/5481/5482/5483/5484/5485 processor support.
234 254
255endif # COLDFIRE
256
235 257
236comment "Processor Specific Options" 258comment "Processor Specific Options"
237 259
diff --git a/arch/m68k/Kconfig.debug b/arch/m68k/Kconfig.debug
index 2bdb1b01115c..87233acef18b 100644
--- a/arch/m68k/Kconfig.debug
+++ b/arch/m68k/Kconfig.debug
@@ -2,6 +2,25 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config BOOTPARAM
6 bool 'Compiled-in Kernel Boot Parameter'
7
8config BOOTPARAM_STRING
9 string 'Kernel Boot Parameter'
10 default 'console=ttyS0,19200'
11 depends on BOOTPARAM
12
13config EARLY_PRINTK
14 bool "Early printk" if EMBEDDED
15 depends on MVME16x || MAC
16 default y
17 help
18 Write kernel log output directly to a serial port.
19
20 This is useful for kernel debugging when your machine crashes very
21 early before the console code is initialized.
22 You should normally say N here, unless you want to debug such a crash.
23
5if !MMU 24if !MMU
6 25
7config FULLDEBUG 26config FULLDEBUG
@@ -15,14 +34,6 @@ config HIGHPROFILE
15 help 34 help
16 Use a fast secondary clock to produce profiling information. 35 Use a fast secondary clock to produce profiling information.
17 36
18config BOOTPARAM
19 bool 'Compiled-in Kernel Boot Parameter'
20
21config BOOTPARAM_STRING
22 string 'Kernel Boot Parameter'
23 default 'console=ttyS0,19200'
24 depends on BOOTPARAM
25
26config NO_KERNEL_MSG 37config NO_KERNEL_MSG
27 bool "Suppress Kernel BUG Messages" 38 bool "Suppress Kernel BUG Messages"
28 help 39 help
diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices
index 6033f5d4e67e..04a3d9be90e9 100644
--- a/arch/m68k/Kconfig.devices
+++ b/arch/m68k/Kconfig.devices
@@ -8,8 +8,8 @@ config ARCH_MAY_HAVE_PC_FDC
8menu "Platform devices" 8menu "Platform devices"
9 9
10config HEARTBEAT 10config HEARTBEAT
11 bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || MAC ||Q40 11 bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || Q40
12 default y if !AMIGA && !APOLLO && !ATARI && !MAC && !Q40 && HP300 12 default y if !AMIGA && !APOLLO && !ATARI && !Q40 && HP300
13 help 13 help
14 Use the power-on LED on your machine as a load meter. The exact 14 Use the power-on LED on your machine as a load meter. The exact
15 behavior is platform-dependent, but normally the flash frequency is 15 behavior is platform-dependent, but normally the flash frequency is
@@ -59,27 +59,6 @@ endmenu
59 59
60menu "Character devices" 60menu "Character devices"
61 61
62config ATARI_MFPSER
63 tristate "Atari MFP serial support"
64 depends on ATARI
65 ---help---
66 If you like to use the MFP serial ports ("Modem1", "Serial1") under
67 Linux, say Y. The driver equally supports all kinds of MFP serial
68 ports and automatically detects whether Serial1 is available.
69
70 To compile this driver as a module, choose M here.
71
72 Note for Falcon users: You also have an MFP port, it's just not
73 wired to the outside... But you could use the port under Linux.
74
75config ATARI_MIDI
76 tristate "Atari MIDI serial support"
77 depends on ATARI
78 help
79 If you want to use your Atari's MIDI port in Linux, say Y.
80
81 To compile this driver as a module, choose M here.
82
83config ATARI_DSP56K 62config ATARI_DSP56K
84 tristate "Atari DSP56k support (EXPERIMENTAL)" 63 tristate "Atari DSP56k support (EXPERIMENTAL)"
85 depends on ATARI && EXPERIMENTAL 64 depends on ATARI && EXPERIMENTAL
@@ -99,15 +78,6 @@ config AMIGA_BUILTIN_SERIAL
99 78
100 To compile this driver as a module, choose M here. 79 To compile this driver as a module, choose M here.
101 80
102config MULTIFACE_III_TTY
103 tristate "Multiface Card III serial support"
104 depends on AMIGA
105 help
106 If you want to use a Multiface III card's serial port in Linux,
107 answer Y.
108
109 To compile this driver as a module, choose M here.
110
111config HPDCA 81config HPDCA
112 tristate "HP DCA serial support" 82 tristate "HP DCA serial support"
113 depends on DIO && SERIAL_8250 83 depends on DIO && SERIAL_8250
@@ -122,13 +92,9 @@ config HPAPCI
122 If you want to use the internal "APCI" serial ports on an HP400 92 If you want to use the internal "APCI" serial ports on an HP400
123 machine, say Y here. 93 machine, say Y here.
124 94
125config DN_SERIAL
126 bool "Support for DN serial port (dummy)"
127 depends on APOLLO
128
129config SERIAL_CONSOLE 95config SERIAL_CONSOLE
130 bool "Support for serial port console" 96 bool "Support for serial port console"
131 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) 97 depends on AMIGA_BUILTIN_SERIAL=y
132 ---help--- 98 ---help---
133 If you say Y here, it will be possible to use a serial port as the 99 If you say Y here, it will be possible to use a serial port as the
134 system console (the system console is the device which receives all 100 system console (the system console is the device which receives all
@@ -140,10 +106,10 @@ config SERIAL_CONSOLE
140 (/dev/tty0) will still be used as the system console by default, but 106 (/dev/tty0) will still be used as the system console by default, but
141 you can alter that using a kernel command line option such as 107 you can alter that using a kernel command line option such as
142 "console=ttyS1". (Try "man bootparam" or see the documentation of 108 "console=ttyS1". (Try "man bootparam" or see the documentation of
143 your boot loader (lilo or loadlin) about how to pass options to the 109 your boot loader about how to pass options to the kernel at boot
144 kernel at boot time.) 110 time.)
145 111
146 If you don't have a VGA card installed and you say Y here, the 112 If you don't have a graphical console and you say Y here, the
147 kernel will automatically use the first serial line, /dev/ttyS0, as 113 kernel will automatically use the first serial line, /dev/ttyS0, as
148 system console. 114 system console.
149 115
diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index ef4a26aff780..7cdf6b010381 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -1,5 +1,7 @@
1comment "Machine Types" 1comment "Machine Types"
2 2
3if M68KCLASSIC
4
3config AMIGA 5config AMIGA
4 bool "Amiga support" 6 bool "Amiga support"
5 depends on MMU 7 depends on MMU
@@ -130,6 +132,8 @@ config SUN3
130 132
131 If you don't want to compile a kernel exclusively for a Sun 3, say N. 133 If you don't want to compile a kernel exclusively for a Sun 3, say N.
132 134
135endif # M68KCLASSIC
136
133config PILOT 137config PILOT
134 bool 138 bool
135 139
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index 6d196dadfdbc..8048e1b7e552 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -82,8 +82,6 @@ __ALIGN_STR "\n\t"
82 82
83extern void atari_microwire_cmd(int cmd); 83extern void atari_microwire_cmd(int cmd);
84 84
85extern int atari_SCC_reset_done;
86
87static unsigned int atari_irq_startup(struct irq_data *data) 85static unsigned int atari_irq_startup(struct irq_data *data)
88{ 86{
89 unsigned int irq = data->irq; 87 unsigned int irq = data->irq;
diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c
index 5a484247e493..a547ba9683d1 100644
--- a/arch/m68k/atari/debug.c
+++ b/arch/m68k/atari/debug.c
@@ -202,7 +202,6 @@ static void __init atari_init_mfp_port(int cflag)
202 202
203static void __init atari_init_scc_port(int cflag) 203static void __init atari_init_scc_port(int cflag)
204{ 204{
205 extern int atari_SCC_reset_done;
206 static int clksrc_table[9] = 205 static int clksrc_table[9] =
207 /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ 206 /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
208 { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; 207 { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig
index dbb49fc6463b..e93fdae10b23 100644
--- a/arch/m68k/configs/amiga_defconfig
+++ b/arch/m68k/configs/amiga_defconfig
@@ -255,7 +255,6 @@ CONFIG_HID=m
255CONFIG_HIDRAW=y 255CONFIG_HIDRAW=y
256# CONFIG_USB_SUPPORT is not set 256# CONFIG_USB_SUPPORT is not set
257CONFIG_AMIGA_BUILTIN_SERIAL=y 257CONFIG_AMIGA_BUILTIN_SERIAL=y
258CONFIG_MULTIFACE_III_TTY=m
259CONFIG_SERIAL_CONSOLE=y 258CONFIG_SERIAL_CONSOLE=y
260CONFIG_EXT2_FS=y 259CONFIG_EXT2_FS=y
261CONFIG_EXT3_FS=y 260CONFIG_EXT3_FS=y
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig
index 562b221f6951..66b26c1e848c 100644
--- a/arch/m68k/configs/apollo_defconfig
+++ b/arch/m68k/configs/apollo_defconfig
@@ -223,8 +223,6 @@ CONFIG_LOGO=y
223CONFIG_HID=m 223CONFIG_HID=m
224CONFIG_HIDRAW=y 224CONFIG_HIDRAW=y
225# CONFIG_USB_SUPPORT is not set 225# CONFIG_USB_SUPPORT is not set
226CONFIG_DN_SERIAL=y
227CONFIG_SERIAL_CONSOLE=y
228CONFIG_EXT2_FS=y 226CONFIG_EXT2_FS=y
229CONFIG_EXT3_FS=y 227CONFIG_EXT3_FS=y
230# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 228# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig
index 82978df637fa..151332515980 100644
--- a/arch/m68k/configs/atari_defconfig
+++ b/arch/m68k/configs/atari_defconfig
@@ -235,10 +235,7 @@ CONFIG_DMASOUND_ATARI=m
235CONFIG_HID=m 235CONFIG_HID=m
236CONFIG_HIDRAW=y 236CONFIG_HIDRAW=y
237# CONFIG_USB_SUPPORT is not set 237# CONFIG_USB_SUPPORT is not set
238CONFIG_ATARI_MFPSER=y
239CONFIG_ATARI_MIDI=y
240CONFIG_ATARI_DSP56K=m 238CONFIG_ATARI_DSP56K=m
241CONFIG_SERIAL_CONSOLE=y
242CONFIG_EXT2_FS=y 239CONFIG_EXT2_FS=y
243CONFIG_EXT3_FS=y 240CONFIG_EXT3_FS=y
244# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 241# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig
index ad9e85760e34..55d394edf633 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -318,13 +318,8 @@ CONFIG_DMASOUND_Q40=m
318CONFIG_HID=m 318CONFIG_HID=m
319CONFIG_HIDRAW=y 319CONFIG_HIDRAW=y
320# CONFIG_USB_SUPPORT is not set 320# CONFIG_USB_SUPPORT is not set
321CONFIG_ATARI_MFPSER=y
322CONFIG_ATARI_MIDI=y
323CONFIG_ATARI_DSP56K=m 321CONFIG_ATARI_DSP56K=m
324CONFIG_AMIGA_BUILTIN_SERIAL=y 322CONFIG_AMIGA_BUILTIN_SERIAL=y
325CONFIG_MULTIFACE_III_TTY=m
326CONFIG_SERIAL167=y
327CONFIG_DN_SERIAL=y
328CONFIG_SERIAL_CONSOLE=y 323CONFIG_SERIAL_CONSOLE=y
329CONFIG_EXT2_FS=y 324CONFIG_EXT2_FS=y
330CONFIG_EXT3_FS=y 325CONFIG_EXT3_FS=y
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig
index c45aaf3b816f..cdb70d66e535 100644
--- a/arch/m68k/configs/mvme16x_defconfig
+++ b/arch/m68k/configs/mvme16x_defconfig
@@ -218,8 +218,6 @@ CONFIG_GEN_RTC_X=y
218CONFIG_HID=m 218CONFIG_HID=m
219CONFIG_HIDRAW=y 219CONFIG_HIDRAW=y
220# CONFIG_USB_SUPPORT is not set 220# CONFIG_USB_SUPPORT is not set
221CONFIG_SERIAL167=y
222CONFIG_SERIAL_CONSOLE=y
223CONFIG_EXT2_FS=y 221CONFIG_EXT2_FS=y
224CONFIG_EXT3_FS=y 222CONFIG_EXT3_FS=y
225# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 223# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c
index c5748bb4ea71..a985a7e87d45 100644
--- a/arch/m68k/emu/nfeth.c
+++ b/arch/m68k/emu/nfeth.c
@@ -39,7 +39,7 @@ enum {
39#define MAX_UNIT 8 39#define MAX_UNIT 8
40 40
41/* These identify the driver base version and may not be removed. */ 41/* These identify the driver base version and may not be removed. */
42static const char version[] __devinitdata = 42static const char version[] __devinitconst =
43 KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE 43 KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE
44 " S.Opichal, M.Jurik, P.Stehlik\n" 44 " S.Opichal, M.Jurik, P.Stehlik\n"
45 KERN_INFO " http://aranym.org/\n"; 45 KERN_INFO " http://aranym.org/\n";
diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c
index 1c05a6260546..bf16af1edacf 100644
--- a/arch/m68k/hp300/config.c
+++ b/arch/m68k/hp300/config.c
@@ -24,7 +24,8 @@
24 24
25unsigned long hp300_model; 25unsigned long hp300_model;
26unsigned long hp300_uart_scode = -1; 26unsigned long hp300_uart_scode = -1;
27unsigned char ledstate; 27unsigned char hp300_ledstate;
28EXPORT_SYMBOL(hp300_ledstate);
28 29
29static char s_hp330[] __initdata = "330"; 30static char s_hp330[] __initdata = "330";
30static char s_hp340[] __initdata = "340"; 31static char s_hp340[] __initdata = "340";
diff --git a/arch/m68k/include/asm/anchor.h b/arch/m68k/include/asm/anchor.h
deleted file mode 100644
index 871c0d5cfc3d..000000000000
--- a/arch/m68k/include/asm/anchor.h
+++ /dev/null
@@ -1,112 +0,0 @@
1/****************************************************************************/
2
3/*
4 * anchor.h -- Anchor CO-MEM Lite PCI host bridge part.
5 *
6 * (C) Copyright 2000, Moreton Bay (www.moreton.com.au)
7 */
8
9/****************************************************************************/
10#ifndef anchor_h
11#define anchor_h
12/****************************************************************************/
13
14/*
15 * Define basic addressing info.
16 */
17#if defined(CONFIG_M5407C3)
18#define COMEM_BASE 0xFFFF0000 /* Base of CO-MEM address space */
19#define COMEM_IRQ 25 /* IRQ of anchor part */
20#else
21#define COMEM_BASE 0x80000000 /* Base of CO-MEM address space */
22#define COMEM_IRQ 25 /* IRQ of anchor part */
23#endif
24
25/****************************************************************************/
26
27/*
28 * 4-byte registers of CO-MEM, so adjust register addresses for
29 * easy access. Handy macro for word access too.
30 */
31#define LREG(a) ((a) >> 2)
32#define WREG(a) ((a) >> 1)
33
34
35/*
36 * Define base addresses within CO-MEM Lite register address space.
37 */
38#define COMEM_I2O 0x0000 /* I2O registers */
39#define COMEM_OPREGS 0x0400 /* Operation registers */
40#define COMEM_PCIBUS 0x2000 /* Direct access to PCI bus */
41#define COMEM_SHMEM 0x4000 /* Shared memory region */
42
43#define COMEM_SHMEMSIZE 0x4000 /* Size of shared memory */
44
45
46/*
47 * Define CO-MEM Registers.
48 */
49#define COMEM_I2OHISR 0x0030 /* I2O host interrupt status */
50#define COMEM_I2OHIMR 0x0034 /* I2O host interrupt mask */
51#define COMEM_I2OLISR 0x0038 /* I2O local interrupt status */
52#define COMEM_I2OLIMR 0x003c /* I2O local interrupt mask */
53#define COMEM_IBFPFIFO 0x0040 /* I2O inbound free/post FIFO */
54#define COMEM_OBPFFIFO 0x0044 /* I2O outbound post/free FIFO */
55#define COMEM_IBPFFIFO 0x0048 /* I2O inbound post/free FIFO */
56#define COMEM_OBFPFIFO 0x004c /* I2O outbound free/post FIFO */
57
58#define COMEM_DAHBASE 0x0460 /* Direct access base address */
59
60#define COMEM_NVCMD 0x04a0 /* I2C serial command */
61#define COMEM_NVREAD 0x04a4 /* I2C serial read */
62#define COMEM_NVSTAT 0x04a8 /* I2C status */
63
64#define COMEM_DMALBASE 0x04b0 /* DMA local base address */
65#define COMEM_DMAHBASE 0x04b4 /* DMA host base address */
66#define COMEM_DMASIZE 0x04b8 /* DMA size */
67#define COMEM_DMACTL 0x04bc /* DMA control */
68
69#define COMEM_HCTL 0x04e0 /* Host control */
70#define COMEM_HINT 0x04e4 /* Host interrupt control/status */
71#define COMEM_HLDATA 0x04e8 /* Host to local data mailbox */
72#define COMEM_LINT 0x04f4 /* Local interrupt contole status */
73#define COMEM_LHDATA 0x04f8 /* Local to host data mailbox */
74
75#define COMEM_LBUSCFG 0x04fc /* Local bus configuration */
76
77
78/*
79 * Commands and flags for use with Direct Access Register.
80 */
81#define COMEM_DA_IACK 0x00000000 /* Interrupt acknowledge (read) */
82#define COMEM_DA_SPCL 0x00000010 /* Special cycle (write) */
83#define COMEM_DA_MEMRD 0x00000004 /* Memory read cycle */
84#define COMEM_DA_MEMWR 0x00000004 /* Memory write cycle */
85#define COMEM_DA_IORD 0x00000002 /* I/O read cycle */
86#define COMEM_DA_IOWR 0x00000002 /* I/O write cycle */
87#define COMEM_DA_CFGRD 0x00000006 /* Configuration read cycle */
88#define COMEM_DA_CFGWR 0x00000006 /* Configuration write cycle */
89
90#define COMEM_DA_ADDR(a) ((a) & 0xffffe000)
91
92#define COMEM_DA_OFFSET(a) ((a) & 0x00001fff)
93
94
95/*
96 * The PCI bus will be limited in what slots will actually be used.
97 * Define valid device numbers for different boards.
98 */
99#if defined(CONFIG_M5407C3)
100#define COMEM_MINDEV 14 /* Minimum valid DEVICE */
101#define COMEM_MAXDEV 14 /* Maximum valid DEVICE */
102#define COMEM_BRIDGEDEV 15 /* Slot bridge is in */
103#else
104#define COMEM_MINDEV 0 /* Minimum valid DEVICE */
105#define COMEM_MAXDEV 3 /* Maximum valid DEVICE */
106#endif
107
108#define COMEM_MAXPCI (COMEM_MAXDEV+1) /* Maximum PCI devices */
109
110
111/****************************************************************************/
112#endif /* anchor_h */
diff --git a/arch/m68k/include/asm/atarihw.h b/arch/m68k/include/asm/atarihw.h
index 0392b28656ab..c0cb36350775 100644
--- a/arch/m68k/include/asm/atarihw.h
+++ b/arch/m68k/include/asm/atarihw.h
@@ -30,6 +30,8 @@ extern u_long atari_switches;
30extern int atari_rtc_year_offset; 30extern int atari_rtc_year_offset;
31extern int atari_dont_touch_floppy_select; 31extern int atari_dont_touch_floppy_select;
32 32
33extern int atari_SCC_reset_done;
34
33/* convenience macros for testing machine type */ 35/* convenience macros for testing machine type */
34#define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST) 36#define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST)
35#define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \ 37#define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h
index 65c6be6c8180..4eba796c00d4 100644
--- a/arch/m68k/include/asm/atomic.h
+++ b/arch/m68k/include/asm/atomic.h
@@ -55,6 +55,16 @@ static inline int atomic_dec_and_test(atomic_t *v)
55 return c != 0; 55 return c != 0;
56} 56}
57 57
58static inline int atomic_dec_and_test_lt(atomic_t *v)
59{
60 char c;
61 __asm__ __volatile__(
62 "subql #1,%1; slt %0"
63 : "=d" (c), "=m" (*v)
64 : "m" (*v));
65 return c != 0;
66}
67
58static inline int atomic_inc_and_test(atomic_t *v) 68static inline int atomic_inc_and_test(atomic_t *v)
59{ 69{
60 char c; 70 char c;
diff --git a/arch/m68k/include/asm/blinken.h b/arch/m68k/include/asm/blinken.h
index 1a749cf7b06d..0626582a7db4 100644
--- a/arch/m68k/include/asm/blinken.h
+++ b/arch/m68k/include/asm/blinken.h
@@ -17,15 +17,15 @@
17 17
18#define HP300_LEDS 0xf001ffff 18#define HP300_LEDS 0xf001ffff
19 19
20extern unsigned char ledstate; 20extern unsigned char hp300_ledstate;
21 21
22static __inline__ void blinken_leds(int on, int off) 22static __inline__ void blinken_leds(int on, int off)
23{ 23{
24 if (MACH_IS_HP300) 24 if (MACH_IS_HP300)
25 { 25 {
26 ledstate |= on; 26 hp300_ledstate |= on;
27 ledstate &= ~off; 27 hp300_ledstate &= ~off;
28 out_8(HP300_LEDS, ~ledstate); 28 out_8(HP300_LEDS, ~hp300_ledstate);
29 } 29 }
30} 30}
31 31
diff --git a/arch/m68k/include/asm/cacheflush_mm.h b/arch/m68k/include/asm/cacheflush_mm.h
index 73de7c89d8e0..8104bd874649 100644
--- a/arch/m68k/include/asm/cacheflush_mm.h
+++ b/arch/m68k/include/asm/cacheflush_mm.h
@@ -2,23 +2,89 @@
2#define _M68K_CACHEFLUSH_H 2#define _M68K_CACHEFLUSH_H
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#ifdef CONFIG_COLDFIRE
6#include <asm/mcfsim.h>
7#endif
5 8
6/* cache code */ 9/* cache code */
7#define FLUSH_I_AND_D (0x00000808) 10#define FLUSH_I_AND_D (0x00000808)
8#define FLUSH_I (0x00000008) 11#define FLUSH_I (0x00000008)
9 12
13#ifndef ICACHE_MAX_ADDR
14#define ICACHE_MAX_ADDR 0
15#define ICACHE_SET_MASK 0
16#define DCACHE_MAX_ADDR 0
17#define DCACHE_SETMASK 0
18#endif
19
20static inline void flush_cf_icache(unsigned long start, unsigned long end)
21{
22 unsigned long set;
23
24 for (set = start; set <= end; set += (0x10 - 3)) {
25 __asm__ __volatile__ (
26 "cpushl %%ic,(%0)\n\t"
27 "addq%.l #1,%0\n\t"
28 "cpushl %%ic,(%0)\n\t"
29 "addq%.l #1,%0\n\t"
30 "cpushl %%ic,(%0)\n\t"
31 "addq%.l #1,%0\n\t"
32 "cpushl %%ic,(%0)"
33 : "=a" (set)
34 : "a" (set));
35 }
36}
37
38static inline void flush_cf_dcache(unsigned long start, unsigned long end)
39{
40 unsigned long set;
41
42 for (set = start; set <= end; set += (0x10 - 3)) {
43 __asm__ __volatile__ (
44 "cpushl %%dc,(%0)\n\t"
45 "addq%.l #1,%0\n\t"
46 "cpushl %%dc,(%0)\n\t"
47 "addq%.l #1,%0\n\t"
48 "cpushl %%dc,(%0)\n\t"
49 "addq%.l #1,%0\n\t"
50 "cpushl %%dc,(%0)"
51 : "=a" (set)
52 : "a" (set));
53 }
54}
55
56static inline void flush_cf_bcache(unsigned long start, unsigned long end)
57{
58 unsigned long set;
59
60 for (set = start; set <= end; set += (0x10 - 3)) {
61 __asm__ __volatile__ (
62 "cpushl %%bc,(%0)\n\t"
63 "addq%.l #1,%0\n\t"
64 "cpushl %%bc,(%0)\n\t"
65 "addq%.l #1,%0\n\t"
66 "cpushl %%bc,(%0)\n\t"
67 "addq%.l #1,%0\n\t"
68 "cpushl %%bc,(%0)"
69 : "=a" (set)
70 : "a" (set));
71 }
72}
73
10/* 74/*
11 * Cache handling functions 75 * Cache handling functions
12 */ 76 */
13 77
14static inline void flush_icache(void) 78static inline void flush_icache(void)
15{ 79{
16 if (CPU_IS_040_OR_060) 80 if (CPU_IS_COLDFIRE) {
81 flush_cf_icache(0, ICACHE_MAX_ADDR);
82 } else if (CPU_IS_040_OR_060) {
17 asm volatile ( "nop\n" 83 asm volatile ( "nop\n"
18 " .chip 68040\n" 84 " .chip 68040\n"
19 " cpusha %bc\n" 85 " cpusha %bc\n"
20 " .chip 68k"); 86 " .chip 68k");
21 else { 87 } else {
22 unsigned long tmp; 88 unsigned long tmp;
23 asm volatile ( "movec %%cacr,%0\n" 89 asm volatile ( "movec %%cacr,%0\n"
24 " or.w %1,%0\n" 90 " or.w %1,%0\n"
@@ -51,12 +117,14 @@ extern void cache_push_v(unsigned long vaddr, int len);
51 process changes. */ 117 process changes. */
52#define __flush_cache_all() \ 118#define __flush_cache_all() \
53({ \ 119({ \
54 if (CPU_IS_040_OR_060) \ 120 if (CPU_IS_COLDFIRE) { \
121 flush_cf_dcache(0, DCACHE_MAX_ADDR); \
122 } else if (CPU_IS_040_OR_060) { \
55 __asm__ __volatile__("nop\n\t" \ 123 __asm__ __volatile__("nop\n\t" \
56 ".chip 68040\n\t" \ 124 ".chip 68040\n\t" \
57 "cpusha %dc\n\t" \ 125 "cpusha %dc\n\t" \
58 ".chip 68k"); \ 126 ".chip 68k"); \
59 else { \ 127 } else { \
60 unsigned long _tmp; \ 128 unsigned long _tmp; \
61 __asm__ __volatile__("movec %%cacr,%0\n\t" \ 129 __asm__ __volatile__("movec %%cacr,%0\n\t" \
62 "orw %1,%0\n\t" \ 130 "orw %1,%0\n\t" \
@@ -112,7 +180,17 @@ static inline void flush_cache_page(struct vm_area_struct *vma, unsigned long vm
112/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */ 180/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
113static inline void __flush_page_to_ram(void *vaddr) 181static inline void __flush_page_to_ram(void *vaddr)
114{ 182{
115 if (CPU_IS_040_OR_060) { 183 if (CPU_IS_COLDFIRE) {
184 unsigned long addr, start, end;
185 addr = ((unsigned long) vaddr) & ~(PAGE_SIZE - 1);
186 start = addr & ICACHE_SET_MASK;
187 end = (addr + PAGE_SIZE - 1) & ICACHE_SET_MASK;
188 if (start > end) {
189 flush_cf_bcache(0, end);
190 end = ICACHE_MAX_ADDR;
191 }
192 flush_cf_bcache(start, end);
193 } else if (CPU_IS_040_OR_060) {
116 __asm__ __volatile__("nop\n\t" 194 __asm__ __volatile__("nop\n\t"
117 ".chip 68040\n\t" 195 ".chip 68040\n\t"
118 "cpushp %%bc,(%0)\n\t" 196 "cpushp %%bc,(%0)\n\t"
diff --git a/arch/m68k/include/asm/checksum.h b/arch/m68k/include/asm/checksum.h
index ec514485c8b6..2f88d867c711 100644
--- a/arch/m68k/include/asm/checksum.h
+++ b/arch/m68k/include/asm/checksum.h
@@ -3,6 +3,10 @@
3 3
4#include <linux/in6.h> 4#include <linux/in6.h>
5 5
6#ifdef CONFIG_GENERIC_CSUM
7#include <asm-generic/checksum.h>
8#else
9
6/* 10/*
7 * computes the checksum of a memory block at buff, length len, 11 * computes the checksum of a memory block at buff, length len,
8 * and adds in "sum" (32-bit) 12 * and adds in "sum" (32-bit)
@@ -34,30 +38,6 @@ extern __wsum csum_partial_copy_nocheck(const void *src,
34 void *dst, int len, 38 void *dst, int len,
35 __wsum sum); 39 __wsum sum);
36 40
37
38#ifdef CONFIG_COLDFIRE
39
40/*
41 * The ColdFire cores don't support all the 68k instructions used
42 * in the optimized checksum code below. So it reverts back to using
43 * more standard C coded checksums. The fast checksum code is
44 * significantly larger than the optimized version, so it is not
45 * inlined here.
46 */
47__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
48
49static inline __sum16 csum_fold(__wsum sum)
50{
51 unsigned int tmp = (__force u32)sum;
52
53 tmp = (tmp & 0xffff) + (tmp >> 16);
54 tmp = (tmp & 0xffff) + (tmp >> 16);
55
56 return (__force __sum16)~tmp;
57}
58
59#else
60
61/* 41/*
62 * This is a version of ip_fast_csum() optimized for IP headers, 42 * This is a version of ip_fast_csum() optimized for IP headers,
63 * which always checksum on 4 octet boundaries. 43 * which always checksum on 4 octet boundaries.
@@ -97,8 +77,6 @@ static inline __sum16 csum_fold(__wsum sum)
97 return (__force __sum16)~sum; 77 return (__force __sum16)~sum;
98} 78}
99 79
100#endif /* CONFIG_COLDFIRE */
101
102static inline __wsum 80static inline __wsum
103csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, 81csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
104 unsigned short proto, __wsum sum) 82 unsigned short proto, __wsum sum)
@@ -167,4 +145,5 @@ csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
167 return csum_fold(sum); 145 return csum_fold(sum);
168} 146}
169 147
148#endif /* CONFIG_GENERIC_CSUM */
170#endif /* _M68K_CHECKSUM_H */ 149#endif /* _M68K_CHECKSUM_H */
diff --git a/arch/m68k/include/asm/div64.h b/arch/m68k/include/asm/div64.h
index edb66148a71d..444ea8a09e9f 100644
--- a/arch/m68k/include/asm/div64.h
+++ b/arch/m68k/include/asm/div64.h
@@ -1,7 +1,9 @@
1#ifndef _M68K_DIV64_H 1#ifndef _M68K_DIV64_H
2#define _M68K_DIV64_H 2#define _M68K_DIV64_H
3 3
4#ifdef CONFIG_MMU 4#ifdef CONFIG_CPU_HAS_NO_MULDIV64
5#include <asm-generic/div64.h>
6#else
5 7
6#include <linux/types.h> 8#include <linux/types.h>
7 9
@@ -27,8 +29,6 @@
27 __rem; \ 29 __rem; \
28}) 30})
29 31
30#else 32#endif /* CONFIG_CPU_HAS_NO_MULDIV64 */
31#include <asm-generic/div64.h>
32#endif /* CONFIG_MMU */
33 33
34#endif /* _M68K_DIV64_H */ 34#endif /* _M68K_DIV64_H */
diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h
index 01c193d91412..e9b7cda59744 100644
--- a/arch/m68k/include/asm/elf.h
+++ b/arch/m68k/include/asm/elf.h
@@ -59,10 +59,10 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
59 is actually used on ASV. */ 59 is actually used on ASV. */
60#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 60#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
61 61
62#ifndef CONFIG_SUN3 62#if defined(CONFIG_SUN3) || defined(CONFIG_COLDFIRE)
63#define ELF_EXEC_PAGESIZE 4096
64#else
65#define ELF_EXEC_PAGESIZE 8192 63#define ELF_EXEC_PAGESIZE 8192
64#else
65#define ELF_EXEC_PAGESIZE 4096
66#endif 66#endif
67 67
68/* This is the location that an ET_DYN program is loaded if exec'ed. Typical 68/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
diff --git a/arch/m68k/include/asm/entry.h b/arch/m68k/include/asm/entry.h
index c3c5a8643e15..622138dc7288 100644
--- a/arch/m68k/include/asm/entry.h
+++ b/arch/m68k/include/asm/entry.h
@@ -222,16 +222,24 @@
222 * Non-MMU systems do not reserve %a2 in this way, and this definition is 222 * Non-MMU systems do not reserve %a2 in this way, and this definition is
223 * not used for them. 223 * not used for them.
224 */ 224 */
225#ifdef CONFIG_MMU
226
225#define curptr a2 227#define curptr a2
226 228
227#define GET_CURRENT(tmp) get_current tmp 229#define GET_CURRENT(tmp) get_current tmp
228.macro get_current reg=%d0 230.macro get_current reg=%d0
229 movel %sp,\reg 231 movel %sp,\reg
230 andw #-THREAD_SIZE,\reg 232 andl #-THREAD_SIZE,\reg
231 movel \reg,%curptr 233 movel \reg,%curptr
232 movel %curptr@,%curptr 234 movel %curptr@,%curptr
233.endm 235.endm
234 236
237#else
238
239#define GET_CURRENT(tmp)
240
241#endif /* CONFIG_MMU */
242
235#else /* C source */ 243#else /* C source */
236 244
237#define STR(X) STR1(X) 245#define STR(X) STR1(X)
diff --git a/arch/m68k/include/asm/fpu.h b/arch/m68k/include/asm/fpu.h
index ffb6b8cfc6d5..526db9da9e43 100644
--- a/arch/m68k/include/asm/fpu.h
+++ b/arch/m68k/include/asm/fpu.h
@@ -12,6 +12,8 @@
12#define FPSTATESIZE (96) 12#define FPSTATESIZE (96)
13#elif defined(CONFIG_M68KFPU_EMU) 13#elif defined(CONFIG_M68KFPU_EMU)
14#define FPSTATESIZE (28) 14#define FPSTATESIZE (28)
15#elif defined(CONFIG_COLDFIRE) && defined(CONFIG_MMU)
16#define FPSTATESIZE (16)
15#elif defined(CONFIG_M68060) 17#elif defined(CONFIG_M68060)
16#define FPSTATESIZE (12) 18#define FPSTATESIZE (12)
17#else 19#else
diff --git a/arch/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h
index b2046839f4b2..00d0071de4c3 100644
--- a/arch/m68k/include/asm/gpio.h
+++ b/arch/m68k/include/asm/gpio.h
@@ -225,7 +225,8 @@ static inline void gpio_set_value(unsigned gpio, int value)
225 225
226static inline int gpio_to_irq(unsigned gpio) 226static inline int gpio_to_irq(unsigned gpio)
227{ 227{
228 return (gpio < MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE : -EINVAL; 228 return (gpio < MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE
229 : __gpio_to_irq(gpio);
229} 230}
230 231
231static inline int irq_to_gpio(unsigned irq) 232static inline int irq_to_gpio(unsigned irq)
diff --git a/arch/m68k/include/asm/ipcbuf.h b/arch/m68k/include/asm/ipcbuf.h
index a623ea3f0955..84c7e51cb6d0 100644
--- a/arch/m68k/include/asm/ipcbuf.h
+++ b/arch/m68k/include/asm/ipcbuf.h
@@ -1,29 +1 @@
1#ifndef __m68k_IPCBUF_H__ #include <asm-generic/ipcbuf.h>
2#define __m68k_IPCBUF_H__
3
4/*
5 * The user_ipc_perm structure for m68k architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __m68k_IPCBUF_H__ */
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h
index 6198df5ff245..0e89fa05de0e 100644
--- a/arch/m68k/include/asm/irq.h
+++ b/arch/m68k/include/asm/irq.h
@@ -25,7 +25,8 @@
25#define NR_IRQS 0 25#define NR_IRQS 0
26#endif 26#endif
27 27
28#ifdef CONFIG_MMU 28#if defined(CONFIG_M68020) || defined(CONFIG_M68030) || \
29 defined(CONFIG_M68040) || defined(CONFIG_M68060)
29 30
30/* 31/*
31 * Interrupt source definitions 32 * Interrupt source definitions
@@ -80,7 +81,7 @@ extern unsigned int irq_canonicalize(unsigned int irq);
80 81
81#else 82#else
82#define irq_canonicalize(irq) (irq) 83#define irq_canonicalize(irq) (irq)
83#endif /* CONFIG_MMU */ 84#endif /* !(CONFIG_M68020 || CONFIG_M68030 || CONFIG_M68040 || CONFIG_M68060) */
84 85
85asmlinkage void do_IRQ(int irq, struct pt_regs *regs); 86asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
86extern atomic_t irq_err_count; 87extern atomic_t irq_err_count;
diff --git a/arch/m68k/include/asm/m54xxacr.h b/arch/m68k/include/asm/m54xxacr.h
index 16a1835f9b2a..47906aafbf67 100644
--- a/arch/m68k/include/asm/m54xxacr.h
+++ b/arch/m68k/include/asm/m54xxacr.h
@@ -39,8 +39,12 @@
39#define ACR_CM_OFF_PRE 0x00000040 /* No cache, precise */ 39#define ACR_CM_OFF_PRE 0x00000040 /* No cache, precise */
40#define ACR_CM_OFF_IMP 0x00000060 /* No cache, imprecise */ 40#define ACR_CM_OFF_IMP 0x00000060 /* No cache, imprecise */
41#define ACR_CM 0x00000060 /* Cache mode mask */ 41#define ACR_CM 0x00000060 /* Cache mode mask */
42#define ACR_SP 0x00000008 /* Supervisor protect */
42#define ACR_WPROTECT 0x00000004 /* Write protect */ 43#define ACR_WPROTECT 0x00000004 /* Write protect */
43 44
45#define ACR_BA(x) ((x) & 0xff000000)
46#define ACR_ADMSK(x) ((((x) - 1) & 0xff000000) >> 8)
47
44#if defined(CONFIG_M5407) 48#if defined(CONFIG_M5407)
45 49
46#define ICACHE_SIZE 0x4000 /* instruction - 16k */ 50#define ICACHE_SIZE 0x4000 /* instruction - 16k */
@@ -56,6 +60,11 @@
56#define CACHE_LINE_SIZE 0x0010 /* 16 bytes */ 60#define CACHE_LINE_SIZE 0x0010 /* 16 bytes */
57#define CACHE_WAYS 4 /* 4 ways */ 61#define CACHE_WAYS 4 /* 4 ways */
58 62
63#define ICACHE_SET_MASK ((ICACHE_SIZE / 64 - 1) << CACHE_WAYS)
64#define DCACHE_SET_MASK ((DCACHE_SIZE / 64 - 1) << CACHE_WAYS)
65#define ICACHE_MAX_ADDR ICACHE_SET_MASK
66#define DCACHE_MAX_ADDR DCACHE_SET_MASK
67
59/* 68/*
60 * Version 4 cores have a true harvard style separate instruction 69 * Version 4 cores have a true harvard style separate instruction
61 * and data cache. Enable data and instruction caches, also enable write 70 * and data cache. Enable data and instruction caches, also enable write
@@ -73,6 +82,27 @@
73#else 82#else
74#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC+CACR_EUSP) 83#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC+CACR_EUSP)
75#endif 84#endif
85#define CACHE_INIT (CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)
86
87#if defined(CONFIG_MMU)
88/*
89 * If running with the MMU enabled then we need to map the internal
90 * register region as non-cacheable. And then we map all our RAM as
91 * cacheable and supervisor access only.
92 */
93#define ACR0_MODE (ACR_BA(CONFIG_MBAR)+ACR_ADMSK(0x1000000)+ \
94 ACR_ENABLE+ACR_SUPER+ACR_CM_OFF_PRE+ACR_SP)
95#define ACR1_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \
96 ACR_ENABLE+ACR_SUPER+ACR_SP)
97#define ACR2_MODE 0
98#define ACR3_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \
99 ACR_ENABLE+ACR_SUPER+ACR_SP)
100
101#else
102
103/*
104 * For the non-MMU enabled case we map all of RAM as cacheable.
105 */
76#if defined(CONFIG_CACHE_COPYBACK) 106#if defined(CONFIG_CACHE_COPYBACK)
77#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_CP) 107#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_CP)
78#else 108#else
@@ -80,7 +110,6 @@
80#endif 110#endif
81#define INSN_CACHE_MODE (ACR_ENABLE+ACR_ANY) 111#define INSN_CACHE_MODE (ACR_ENABLE+ACR_ANY)
82 112
83#define CACHE_INIT (CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)
84#define CACHE_INVALIDATE (CACHE_MODE+CACR_DCINVA+CACR_BCINVA+CACR_ICINVA) 113#define CACHE_INVALIDATE (CACHE_MODE+CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)
85#define CACHE_INVALIDATEI (CACHE_MODE+CACR_BCINVA+CACR_ICINVA) 114#define CACHE_INVALIDATEI (CACHE_MODE+CACR_BCINVA+CACR_ICINVA)
86#define CACHE_INVALIDATED (CACHE_MODE+CACR_DCINVA) 115#define CACHE_INVALIDATED (CACHE_MODE+CACR_DCINVA)
@@ -94,4 +123,5 @@
94#define CACHE_PUSH 123#define CACHE_PUSH
95#endif 124#endif
96 125
126#endif /* CONFIG_MMU */
97#endif /* m54xxacr_h */ 127#endif /* m54xxacr_h */
diff --git a/arch/m68k/include/asm/mac_baboon.h b/arch/m68k/include/asm/mac_baboon.h
index c2a042b8c349..a2d32f6589f9 100644
--- a/arch/m68k/include/asm/mac_baboon.h
+++ b/arch/m68k/include/asm/mac_baboon.h
@@ -29,4 +29,10 @@ struct baboon {
29 */ 29 */
30}; 30};
31 31
32extern int baboon_present;
33
34extern void baboon_register_interrupts(void);
35extern void baboon_irq_enable(int);
36extern void baboon_irq_disable(int);
37
32#endif /* __ASSEMBLY **/ 38#endif /* __ASSEMBLY **/
diff --git a/arch/m68k/include/asm/mac_iop.h b/arch/m68k/include/asm/mac_iop.h
index a2c7e6fcca38..fde874a01e20 100644
--- a/arch/m68k/include/asm/mac_iop.h
+++ b/arch/m68k/include/asm/mac_iop.h
@@ -159,4 +159,6 @@ extern void iop_upload_code(uint, __u8 *, uint, __u16);
159extern void iop_download_code(uint, __u8 *, uint, __u16); 159extern void iop_download_code(uint, __u8 *, uint, __u16);
160extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16); 160extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16);
161 161
162extern void iop_register_interrupts(void);
163
162#endif /* __ASSEMBLY__ */ 164#endif /* __ASSEMBLY__ */
diff --git a/arch/m68k/include/asm/mac_oss.h b/arch/m68k/include/asm/mac_oss.h
index 3cf2b6ed685a..425fbff4f4d8 100644
--- a/arch/m68k/include/asm/mac_oss.h
+++ b/arch/m68k/include/asm/mac_oss.h
@@ -58,25 +58,6 @@
58 58
59#define OSS_POWEROFF 0x80 59#define OSS_POWEROFF 0x80
60 60
61/*
62 * OSS Interrupt levels for various sub-systems
63 *
64 * This mapping is laid out with two things in mind: first, we try to keep
65 * things on their own levels to avoid having to do double-dispatches. Second,
66 * the levels match as closely as possible the alternate IRQ mapping mode (aka
67 * "A/UX mode") available on some VIA machines.
68 */
69
70#define OSS_IRQLEV_DISABLED 0
71#define OSS_IRQLEV_IOPISM 1 /* ADB? */
72#define OSS_IRQLEV_SCSI IRQ_AUTO_2
73#define OSS_IRQLEV_NUBUS IRQ_AUTO_3 /* keep this on its own level */
74#define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 /* matches VIA alternate mapping */
75#define OSS_IRQLEV_SOUND IRQ_AUTO_5 /* matches VIA alternate mapping */
76#define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */
77#define OSS_IRQLEV_VIA1 IRQ_AUTO_6 /* matches VIA alternate mapping */
78#define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */
79
80#ifndef __ASSEMBLY__ 61#ifndef __ASSEMBLY__
81 62
82struct mac_oss { 63struct mac_oss {
@@ -91,4 +72,8 @@ struct mac_oss {
91extern volatile struct mac_oss *oss; 72extern volatile struct mac_oss *oss;
92extern int oss_present; 73extern int oss_present;
93 74
75extern void oss_register_interrupts(void);
76extern void oss_irq_enable(int);
77extern void oss_irq_disable(int);
78
94#endif /* __ASSEMBLY__ */ 79#endif /* __ASSEMBLY__ */
diff --git a/arch/m68k/include/asm/mac_psc.h b/arch/m68k/include/asm/mac_psc.h
index 7808bb0b2323..e5c0d71d1543 100644
--- a/arch/m68k/include/asm/mac_psc.h
+++ b/arch/m68k/include/asm/mac_psc.h
@@ -211,6 +211,10 @@
211extern volatile __u8 *psc; 211extern volatile __u8 *psc;
212extern int psc_present; 212extern int psc_present;
213 213
214extern void psc_register_interrupts(void);
215extern void psc_irq_enable(int);
216extern void psc_irq_disable(int);
217
214/* 218/*
215 * Access functions 219 * Access functions
216 */ 220 */
diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h
index a59665e1d41b..aeeedf8b2d25 100644
--- a/arch/m68k/include/asm/mac_via.h
+++ b/arch/m68k/include/asm/mac_via.h
@@ -254,6 +254,15 @@
254extern volatile __u8 *via1,*via2; 254extern volatile __u8 *via1,*via2;
255extern int rbv_present,via_alt_mapping; 255extern int rbv_present,via_alt_mapping;
256 256
257extern void via_register_interrupts(void);
258extern void via_irq_enable(int);
259extern void via_irq_disable(int);
260extern void via_nubus_irq_startup(int irq);
261extern void via_nubus_irq_shutdown(int irq);
262extern void via1_irq(unsigned int irq, struct irq_desc *desc);
263extern void via1_set_head(int);
264extern int via2_scsi_drq_pending(void);
265
257static inline int rbv_set_video_bpp(int bpp) 266static inline int rbv_set_video_bpp(int bpp)
258{ 267{
259 char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1; 268 char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h
index 12ebe43b008b..682a1a2ff55f 100644
--- a/arch/m68k/include/asm/macintosh.h
+++ b/arch/m68k/include/asm/macintosh.h
@@ -11,17 +11,11 @@
11extern void mac_reset(void); 11extern void mac_reset(void);
12extern void mac_poweroff(void); 12extern void mac_poweroff(void);
13extern void mac_init_IRQ(void); 13extern void mac_init_IRQ(void);
14extern int mac_irq_pending(unsigned int); 14
15extern void mac_irq_enable(struct irq_data *data); 15extern void mac_irq_enable(struct irq_data *data);
16extern void mac_irq_disable(struct irq_data *data); 16extern void mac_irq_disable(struct irq_data *data);
17 17
18/* 18/*
19 * Floppy driver magic hook - probably shouldn't be here
20 */
21
22extern void via1_set_head(int);
23
24/*
25 * Macintosh Table 19 * Macintosh Table
26 */ 20 */
27 21
@@ -48,7 +42,7 @@ struct mac_model
48#define MAC_ADB_IOP 6 42#define MAC_ADB_IOP 6
49 43
50#define MAC_VIA_II 1 44#define MAC_VIA_II 1
51#define MAC_VIA_IIci 2 45#define MAC_VIA_IICI 2
52#define MAC_VIA_QUADRA 3 46#define MAC_VIA_QUADRA 3
53 47
54#define MAC_SCSI_NONE 0 48#define MAC_SCSI_NONE 0
diff --git a/arch/m68k/include/asm/macints.h b/arch/m68k/include/asm/macints.h
index ebe1b70fe90c..92aa8a4c2d03 100644
--- a/arch/m68k/include/asm/macints.h
+++ b/arch/m68k/include/asm/macints.h
@@ -104,6 +104,9 @@
104#define IRQ_PSC4_3 (35) 104#define IRQ_PSC4_3 (35)
105#define IRQ_MAC_MACE_DMA IRQ_PSC4_3 105#define IRQ_MAC_MACE_DMA IRQ_PSC4_3
106 106
107/* OSS Level 4 interrupts */
108#define IRQ_MAC_SCC (33)
109
107/* Level 5 (PSC, AV Macs only) interrupts */ 110/* Level 5 (PSC, AV Macs only) interrupts */
108#define IRQ_PSC5_0 (40) 111#define IRQ_PSC5_0 (40)
109#define IRQ_PSC5_1 (41) 112#define IRQ_PSC5_1 (41)
@@ -131,9 +134,6 @@
131#define IRQ_BABOON_2 (66) 134#define IRQ_BABOON_2 (66)
132#define IRQ_BABOON_3 (67) 135#define IRQ_BABOON_3 (67)
133 136
134/* On non-PSC machines, the serial ports share an IRQ */
135#define IRQ_MAC_SCC IRQ_AUTO_4
136
137#define SLOT2IRQ(x) (x + 47) 137#define SLOT2IRQ(x) (x + 47)
138#define IRQ2SLOT(x) (x - 47) 138#define IRQ2SLOT(x) (x - 47)
139 139
diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h
new file mode 100644
index 000000000000..313f3dd23cdc
--- /dev/null
+++ b/arch/m68k/include/asm/mcf_pgalloc.h
@@ -0,0 +1,102 @@
1#ifndef M68K_MCF_PGALLOC_H
2#define M68K_MCF_PGALLOC_H
3
4#include <asm/tlb.h>
5#include <asm/tlbflush.h>
6
7extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
8{
9 free_page((unsigned long) pte);
10}
11
12extern const char bad_pmd_string[];
13
14extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
15 unsigned long address)
16{
17 unsigned long page = __get_free_page(GFP_DMA|__GFP_REPEAT);
18
19 if (!page)
20 return NULL;
21
22 memset((void *)page, 0, PAGE_SIZE);
23 return (pte_t *) (page);
24}
25
26extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
27{
28 return (pmd_t *) pgd;
29}
30
31#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
32#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
33
34#define pte_alloc_one_fast(mm, addr) pte_alloc_one(mm, addr)
35
36#define pmd_populate(mm, pmd, page) (pmd_val(*pmd) = \
37 (unsigned long)(page_address(page)))
38
39#define pmd_populate_kernel(mm, pmd, pte) (pmd_val(*pmd) = (unsigned long)(pte))
40
41#define pmd_pgtable(pmd) pmd_page(pmd)
42
43static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page,
44 unsigned long address)
45{
46 __free_page(page);
47}
48
49#define __pmd_free_tlb(tlb, pmd, address) do { } while (0)
50
51static inline struct page *pte_alloc_one(struct mm_struct *mm,
52 unsigned long address)
53{
54 struct page *page = alloc_pages(GFP_DMA|__GFP_REPEAT, 0);
55 pte_t *pte;
56
57 if (!page)
58 return NULL;
59
60 pte = kmap(page);
61 if (pte) {
62 clear_page(pte);
63 __flush_page_to_ram(pte);
64 flush_tlb_kernel_page(pte);
65 nocache_page(pte);
66 }
67 kunmap(page);
68
69 return page;
70}
71
72extern inline void pte_free(struct mm_struct *mm, struct page *page)
73{
74 __free_page(page);
75}
76
77/*
78 * In our implementation, each pgd entry contains 1 pmd that is never allocated
79 * or freed. pgd_present is always 1, so this should never be called. -NL
80 */
81#define pmd_free(mm, pmd) BUG()
82
83static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
84{
85 free_page((unsigned long) pgd);
86}
87
88static inline pgd_t *pgd_alloc(struct mm_struct *mm)
89{
90 pgd_t *new_pgd;
91
92 new_pgd = (pgd_t *)__get_free_page(GFP_DMA | __GFP_NOWARN);
93 if (!new_pgd)
94 return NULL;
95 memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE);
96 memset(new_pgd, 0, PAGE_OFFSET >> PGDIR_SHIFT);
97 return new_pgd;
98}
99
100#define pgd_populate(mm, pmd, pte) BUG()
101
102#endif /* M68K_MCF_PGALLOC_H */
diff --git a/arch/m68k/include/asm/mcf_pgtable.h b/arch/m68k/include/asm/mcf_pgtable.h
new file mode 100644
index 000000000000..756bde4fb4f8
--- /dev/null
+++ b/arch/m68k/include/asm/mcf_pgtable.h
@@ -0,0 +1,425 @@
1#ifndef _MCF_PGTABLE_H
2#define _MCF_PGTABLE_H
3
4#include <asm/mcfmmu.h>
5#include <asm/page.h>
6
7/*
8 * MMUDR bits, in proper place. We write these directly into the MMUDR
9 * after masking from the pte.
10 */
11#define CF_PAGE_LOCKED MMUDR_LK /* 0x00000002 */
12#define CF_PAGE_EXEC MMUDR_X /* 0x00000004 */
13#define CF_PAGE_WRITABLE MMUDR_W /* 0x00000008 */
14#define CF_PAGE_READABLE MMUDR_R /* 0x00000010 */
15#define CF_PAGE_SYSTEM MMUDR_SP /* 0x00000020 */
16#define CF_PAGE_COPYBACK MMUDR_CM_CCB /* 0x00000040 */
17#define CF_PAGE_NOCACHE MMUDR_CM_NCP /* 0x00000080 */
18
19#define CF_CACHEMASK (~MMUDR_CM_CCB)
20#define CF_PAGE_MMUDR_MASK 0x000000fe
21
22#define _PAGE_NOCACHE030 CF_PAGE_NOCACHE
23
24/*
25 * MMUTR bits, need shifting down.
26 */
27#define CF_PAGE_MMUTR_MASK 0x00000c00
28#define CF_PAGE_MMUTR_SHIFT 10
29
30#define CF_PAGE_VALID (MMUTR_V << CF_PAGE_MMUTR_SHIFT)
31#define CF_PAGE_SHARED (MMUTR_SG << CF_PAGE_MMUTR_SHIFT)
32
33/*
34 * Fake bits, not implemented in CF, will get masked out before
35 * hitting hardware.
36 */
37#define CF_PAGE_DIRTY 0x00000001
38#define CF_PAGE_FILE 0x00000200
39#define CF_PAGE_ACCESSED 0x00001000
40
41#define _PAGE_CACHE040 0x020 /* 68040 cache mode, cachable, copyback */
42#define _PAGE_NOCACHE_S 0x040 /* 68040 no-cache mode, serialized */
43#define _PAGE_NOCACHE 0x060 /* 68040 cache mode, non-serialized */
44#define _PAGE_CACHE040W 0x000 /* 68040 cache mode, cachable, write-through */
45#define _DESCTYPE_MASK 0x003
46#define _CACHEMASK040 (~0x060)
47#define _PAGE_GLOBAL040 0x400 /* 68040 global bit, used for kva descs */
48
49/*
50 * Externally used page protection values.
51 */
52#define _PAGE_PRESENT (CF_PAGE_VALID)
53#define _PAGE_ACCESSED (CF_PAGE_ACCESSED)
54#define _PAGE_DIRTY (CF_PAGE_DIRTY)
55#define _PAGE_READWRITE (CF_PAGE_READABLE \
56 | CF_PAGE_WRITABLE \
57 | CF_PAGE_SYSTEM \
58 | CF_PAGE_SHARED)
59
60/*
61 * Compound page protection values.
62 */
63#define PAGE_NONE __pgprot(CF_PAGE_VALID \
64 | CF_PAGE_ACCESSED)
65
66#define PAGE_SHARED __pgprot(CF_PAGE_VALID \
67 | CF_PAGE_ACCESSED \
68 | CF_PAGE_SHARED)
69
70#define PAGE_INIT __pgprot(CF_PAGE_VALID \
71 | CF_PAGE_READABLE \
72 | CF_PAGE_WRITABLE \
73 | CF_PAGE_EXEC \
74 | CF_PAGE_SYSTEM)
75
76#define PAGE_KERNEL __pgprot(CF_PAGE_VALID \
77 | CF_PAGE_ACCESSED \
78 | CF_PAGE_READABLE \
79 | CF_PAGE_WRITABLE \
80 | CF_PAGE_EXEC \
81 | CF_PAGE_SYSTEM)
82
83#define PAGE_COPY __pgprot(CF_PAGE_VALID \
84 | CF_PAGE_ACCESSED \
85 | CF_PAGE_READABLE \
86 | CF_PAGE_DIRTY)
87
88/*
89 * Page protections for initialising protection_map. See mm/mmap.c
90 * for use. In general, the bit positions are xwr, and P-items are
91 * private, the S-items are shared.
92 */
93#define __P000 PAGE_NONE
94#define __P001 __pgprot(CF_PAGE_VALID \
95 | CF_PAGE_ACCESSED \
96 | CF_PAGE_READABLE)
97#define __P010 __pgprot(CF_PAGE_VALID \
98 | CF_PAGE_ACCESSED \
99 | CF_PAGE_WRITABLE)
100#define __P011 __pgprot(CF_PAGE_VALID \
101 | CF_PAGE_ACCESSED \
102 | CF_PAGE_READABLE \
103 | CF_PAGE_WRITABLE)
104#define __P100 __pgprot(CF_PAGE_VALID \
105 | CF_PAGE_ACCESSED \
106 | CF_PAGE_EXEC)
107#define __P101 __pgprot(CF_PAGE_VALID \
108 | CF_PAGE_ACCESSED \
109 | CF_PAGE_READABLE \
110 | CF_PAGE_EXEC)
111#define __P110 __pgprot(CF_PAGE_VALID \
112 | CF_PAGE_ACCESSED \
113 | CF_PAGE_WRITABLE \
114 | CF_PAGE_EXEC)
115#define __P111 __pgprot(CF_PAGE_VALID \
116 | CF_PAGE_ACCESSED \
117 | CF_PAGE_READABLE \
118 | CF_PAGE_WRITABLE \
119 | CF_PAGE_EXEC)
120
121#define __S000 PAGE_NONE
122#define __S001 __pgprot(CF_PAGE_VALID \
123 | CF_PAGE_ACCESSED \
124 | CF_PAGE_READABLE)
125#define __S010 PAGE_SHARED
126#define __S011 __pgprot(CF_PAGE_VALID \
127 | CF_PAGE_ACCESSED \
128 | CF_PAGE_SHARED \
129 | CF_PAGE_READABLE)
130#define __S100 __pgprot(CF_PAGE_VALID \
131 | CF_PAGE_ACCESSED \
132 | CF_PAGE_EXEC)
133#define __S101 __pgprot(CF_PAGE_VALID \
134 | CF_PAGE_ACCESSED \
135 | CF_PAGE_READABLE \
136 | CF_PAGE_EXEC)
137#define __S110 __pgprot(CF_PAGE_VALID \
138 | CF_PAGE_ACCESSED \
139 | CF_PAGE_SHARED \
140 | CF_PAGE_EXEC)
141#define __S111 __pgprot(CF_PAGE_VALID \
142 | CF_PAGE_ACCESSED \
143 | CF_PAGE_SHARED \
144 | CF_PAGE_READABLE \
145 | CF_PAGE_EXEC)
146
147#define PTE_MASK PAGE_MASK
148#define CF_PAGE_CHG_MASK (PTE_MASK | CF_PAGE_ACCESSED | CF_PAGE_DIRTY)
149
150#ifndef __ASSEMBLY__
151
152/*
153 * Conversion functions: convert a page and protection to a page entry,
154 * and a page entry and page directory to the page they refer to.
155 */
156#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
157
158static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
159{
160 pte_val(pte) = (pte_val(pte) & CF_PAGE_CHG_MASK) | pgprot_val(newprot);
161 return pte;
162}
163
164#define pmd_set(pmdp, ptep) do {} while (0)
165
166static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
167{
168 pgd_val(*pgdp) = virt_to_phys(pmdp);
169}
170
171#define __pte_page(pte) ((unsigned long) (pte_val(pte) & PAGE_MASK))
172#define __pmd_page(pmd) ((unsigned long) (pmd_val(pmd)))
173
174static inline int pte_none(pte_t pte)
175{
176 return !pte_val(pte);
177}
178
179static inline int pte_present(pte_t pte)
180{
181 return pte_val(pte) & CF_PAGE_VALID;
182}
183
184static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
185 pte_t *ptep)
186{
187 pte_val(*ptep) = 0;
188}
189
190#define pte_pagenr(pte) ((__pte_page(pte) - PAGE_OFFSET) >> PAGE_SHIFT)
191#define pte_page(pte) virt_to_page(__pte_page(pte))
192
193static inline int pmd_none2(pmd_t *pmd) { return !pmd_val(*pmd); }
194#define pmd_none(pmd) pmd_none2(&(pmd))
195static inline int pmd_bad2(pmd_t *pmd) { return 0; }
196#define pmd_bad(pmd) pmd_bad2(&(pmd))
197#define pmd_present(pmd) (!pmd_none2(&(pmd)))
198static inline void pmd_clear(pmd_t *pmdp) { pmd_val(*pmdp) = 0; }
199
200static inline int pgd_none(pgd_t pgd) { return 0; }
201static inline int pgd_bad(pgd_t pgd) { return 0; }
202static inline int pgd_present(pgd_t pgd) { return 1; }
203static inline void pgd_clear(pgd_t *pgdp) {}
204
205#define pte_ERROR(e) \
206 printk(KERN_ERR "%s:%d: bad pte %08lx.\n", \
207 __FILE__, __LINE__, pte_val(e))
208#define pmd_ERROR(e) \
209 printk(KERN_ERR "%s:%d: bad pmd %08lx.\n", \
210 __FILE__, __LINE__, pmd_val(e))
211#define pgd_ERROR(e) \
212 printk(KERN_ERR "%s:%d: bad pgd %08lx.\n", \
213 __FILE__, __LINE__, pgd_val(e))
214
215/*
216 * The following only work if pte_present() is true.
217 * Undefined behaviour if not...
218 * [we have the full set here even if they don't change from m68k]
219 */
220static inline int pte_read(pte_t pte)
221{
222 return pte_val(pte) & CF_PAGE_READABLE;
223}
224
225static inline int pte_write(pte_t pte)
226{
227 return pte_val(pte) & CF_PAGE_WRITABLE;
228}
229
230static inline int pte_exec(pte_t pte)
231{
232 return pte_val(pte) & CF_PAGE_EXEC;
233}
234
235static inline int pte_dirty(pte_t pte)
236{
237 return pte_val(pte) & CF_PAGE_DIRTY;
238}
239
240static inline int pte_young(pte_t pte)
241{
242 return pte_val(pte) & CF_PAGE_ACCESSED;
243}
244
245static inline int pte_file(pte_t pte)
246{
247 return pte_val(pte) & CF_PAGE_FILE;
248}
249
250static inline int pte_special(pte_t pte)
251{
252 return 0;
253}
254
255static inline pte_t pte_wrprotect(pte_t pte)
256{
257 pte_val(pte) &= ~CF_PAGE_WRITABLE;
258 return pte;
259}
260
261static inline pte_t pte_rdprotect(pte_t pte)
262{
263 pte_val(pte) &= ~CF_PAGE_READABLE;
264 return pte;
265}
266
267static inline pte_t pte_exprotect(pte_t pte)
268{
269 pte_val(pte) &= ~CF_PAGE_EXEC;
270 return pte;
271}
272
273static inline pte_t pte_mkclean(pte_t pte)
274{
275 pte_val(pte) &= ~CF_PAGE_DIRTY;
276 return pte;
277}
278
279static inline pte_t pte_mkold(pte_t pte)
280{
281 pte_val(pte) &= ~CF_PAGE_ACCESSED;
282 return pte;
283}
284
285static inline pte_t pte_mkwrite(pte_t pte)
286{
287 pte_val(pte) |= CF_PAGE_WRITABLE;
288 return pte;
289}
290
291static inline pte_t pte_mkread(pte_t pte)
292{
293 pte_val(pte) |= CF_PAGE_READABLE;
294 return pte;
295}
296
297static inline pte_t pte_mkexec(pte_t pte)
298{
299 pte_val(pte) |= CF_PAGE_EXEC;
300 return pte;
301}
302
303static inline pte_t pte_mkdirty(pte_t pte)
304{
305 pte_val(pte) |= CF_PAGE_DIRTY;
306 return pte;
307}
308
309static inline pte_t pte_mkyoung(pte_t pte)
310{
311 pte_val(pte) |= CF_PAGE_ACCESSED;
312 return pte;
313}
314
315static inline pte_t pte_mknocache(pte_t pte)
316{
317 pte_val(pte) |= 0x80 | (pte_val(pte) & ~0x40);
318 return pte;
319}
320
321static inline pte_t pte_mkcache(pte_t pte)
322{
323 pte_val(pte) &= ~CF_PAGE_NOCACHE;
324 return pte;
325}
326
327static inline pte_t pte_mkspecial(pte_t pte)
328{
329 return pte;
330}
331
332#define swapper_pg_dir kernel_pg_dir
333extern pgd_t kernel_pg_dir[PTRS_PER_PGD];
334
335/*
336 * Find an entry in a pagetable directory.
337 */
338#define pgd_index(address) ((address) >> PGDIR_SHIFT)
339#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
340
341/*
342 * Find an entry in a kernel pagetable directory.
343 */
344#define pgd_offset_k(address) pgd_offset(&init_mm, address)
345
346/*
347 * Find an entry in the second-level pagetable.
348 */
349static inline pmd_t *pmd_offset(pgd_t *pgd, unsigned long address)
350{
351 return (pmd_t *) pgd;
352}
353
354/*
355 * Find an entry in the third-level pagetable.
356 */
357#define __pte_offset(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
358#define pte_offset_kernel(dir, address) \
359 ((pte_t *) __pmd_page(*(dir)) + __pte_offset(address))
360
361/*
362 * Disable caching for page at given kernel virtual address.
363 */
364static inline void nocache_page(void *vaddr)
365{
366 pgd_t *dir;
367 pmd_t *pmdp;
368 pte_t *ptep;
369 unsigned long addr = (unsigned long) vaddr;
370
371 dir = pgd_offset_k(addr);
372 pmdp = pmd_offset(dir, addr);
373 ptep = pte_offset_kernel(pmdp, addr);
374 *ptep = pte_mknocache(*ptep);
375}
376
377/*
378 * Enable caching for page at given kernel virtual address.
379 */
380static inline void cache_page(void *vaddr)
381{
382 pgd_t *dir;
383 pmd_t *pmdp;
384 pte_t *ptep;
385 unsigned long addr = (unsigned long) vaddr;
386
387 dir = pgd_offset_k(addr);
388 pmdp = pmd_offset(dir, addr);
389 ptep = pte_offset_kernel(pmdp, addr);
390 *ptep = pte_mkcache(*ptep);
391}
392
393#define PTE_FILE_MAX_BITS 21
394#define PTE_FILE_SHIFT 11
395
396static inline unsigned long pte_to_pgoff(pte_t pte)
397{
398 return pte_val(pte) >> PTE_FILE_SHIFT;
399}
400
401static inline pte_t pgoff_to_pte(unsigned pgoff)
402{
403 return __pte((pgoff << PTE_FILE_SHIFT) + CF_PAGE_FILE);
404}
405
406/*
407 * Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e))
408 */
409#define __swp_type(x) ((x).val & 0xFF)
410#define __swp_offset(x) ((x).val >> PTE_FILE_SHIFT)
411#define __swp_entry(typ, off) ((swp_entry_t) { (typ) | \
412 (off << PTE_FILE_SHIFT) })
413#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
414#define __swp_entry_to_pte(x) (__pte((x).val))
415
416#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
417
418#define pte_offset_map(pmdp, addr) ((pte_t *)__pmd_page(*pmdp) + \
419 __pte_offset(addr))
420#define pte_unmap(pte) ((void) 0)
421#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
422#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
423
424#endif /* !__ASSEMBLY__ */
425#endif /* _MCF_PGTABLE_H */
diff --git a/arch/m68k/include/asm/mcfmmu.h b/arch/m68k/include/asm/mcfmmu.h
new file mode 100644
index 000000000000..26cc3d5a63f8
--- /dev/null
+++ b/arch/m68k/include/asm/mcfmmu.h
@@ -0,0 +1,112 @@
1/*
2 * mcfmmu.h -- definitions for the ColdFire v4e MMU
3 *
4 * (C) Copyright 2011, Greg Ungerer <gerg@uclinux.org>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef MCFMMU_H
12#define MCFMMU_H
13
14/*
15 * The MMU support registers are mapped into the address space using
16 * the processor MMUBASE register. We used a fixed address for mapping,
17 * there doesn't seem any need to make this configurable yet.
18 */
19#define MMUBASE 0xfe000000
20
21/*
22 * The support registers of the MMU. Names are the sames as those
23 * used in the Freescale v4e documentation.
24 */
25#define MMUCR (MMUBASE + 0x00) /* Control register */
26#define MMUOR (MMUBASE + 0x04) /* Operation register */
27#define MMUSR (MMUBASE + 0x08) /* Status register */
28#define MMUAR (MMUBASE + 0x10) /* TLB Address register */
29#define MMUTR (MMUBASE + 0x14) /* TLB Tag register */
30#define MMUDR (MMUBASE + 0x18) /* TLB Data register */
31
32/*
33 * MMU Control register bit flags
34 */
35#define MMUCR_EN 0x00000001 /* Virtual mode enable */
36#define MMUCR_ASM 0x00000002 /* Address space mode */
37
38/*
39 * MMU Operation register.
40 */
41#define MMUOR_UAA 0x00000001 /* Update allocatiom address */
42#define MMUOR_ACC 0x00000002 /* TLB access */
43#define MMUOR_RD 0x00000004 /* TLB access read */
44#define MMUOR_WR 0x00000000 /* TLB access write */
45#define MMUOR_ADR 0x00000008 /* TLB address select */
46#define MMUOR_ITLB 0x00000010 /* ITLB operation */
47#define MMUOR_CAS 0x00000020 /* Clear non-locked ASID TLBs */
48#define MMUOR_CNL 0x00000040 /* Clear non-locked TLBs */
49#define MMUOR_CA 0x00000080 /* Clear all TLBs */
50#define MMUOR_STLB 0x00000100 /* Search TLBs */
51#define MMUOR_AAN 16 /* TLB allocation address */
52#define MMUOR_AAMASK 0xffff0000 /* AA mask */
53
54/*
55 * MMU Status register.
56 */
57#define MMUSR_HIT 0x00000002 /* Search TLB hit */
58#define MMUSR_WF 0x00000008 /* Write access fault */
59#define MMUSR_RF 0x00000010 /* Read access fault */
60#define MMUSR_SPF 0x00000020 /* Supervisor protect fault */
61
62/*
63 * MMU Read/Write Tag register.
64 */
65#define MMUTR_V 0x00000001 /* Valid */
66#define MMUTR_SG 0x00000002 /* Shared global */
67#define MMUTR_IDN 2 /* Address Space ID */
68#define MMUTR_IDMASK 0x000003fc /* ASID mask */
69#define MMUTR_VAN 10 /* Virtual Address */
70#define MMUTR_VAMASK 0xfffffc00 /* VA mask */
71
72/*
73 * MMU Read/Write Data register.
74 */
75#define MMUDR_LK 0x00000002 /* Lock entry */
76#define MMUDR_X 0x00000004 /* Execute access enable */
77#define MMUDR_W 0x00000008 /* Write access enable */
78#define MMUDR_R 0x00000010 /* Read access enable */
79#define MMUDR_SP 0x00000020 /* Supervisor access enable */
80#define MMUDR_CM_CWT 0x00000000 /* Cachable write thru */
81#define MMUDR_CM_CCB 0x00000040 /* Cachable copy back */
82#define MMUDR_CM_NCP 0x00000080 /* Non-cachable precise */
83#define MMUDR_CM_NCI 0x000000c0 /* Non-cachable imprecise */
84#define MMUDR_SZ_1MB 0x00000000 /* 1MB page size */
85#define MMUDR_SZ_4KB 0x00000100 /* 4kB page size */
86#define MMUDR_SZ_8KB 0x00000200 /* 8kB page size */
87#define MMUDR_SZ_1KB 0x00000300 /* 1kB page size */
88#define MMUDR_PAN 10 /* Physical address */
89#define MMUDR_PAMASK 0xfffffc00 /* PA mask */
90
91#ifndef __ASSEMBLY__
92
93/*
94 * Simple access functions for the MMU registers. Nothing fancy
95 * currently required, just simple 32bit access.
96 */
97static inline u32 mmu_read(u32 a)
98{
99 return *((volatile u32 *) a);
100}
101
102static inline void mmu_write(u32 a, u32 v)
103{
104 *((volatile u32 *) a) = v;
105 __asm__ __volatile__ ("nop");
106}
107
108int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word);
109
110#endif
111
112#endif /* MCFMMU_H */
diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm/mmu_context.h
index 7d4341e55a99..dc3be991d634 100644
--- a/arch/m68k/include/asm/mmu_context.h
+++ b/arch/m68k/include/asm/mmu_context.h
@@ -8,7 +8,206 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
8} 8}
9 9
10#ifdef CONFIG_MMU 10#ifdef CONFIG_MMU
11#ifndef CONFIG_SUN3 11
12#if defined(CONFIG_COLDFIRE)
13
14#include <asm/atomic.h>
15#include <asm/bitops.h>
16#include <asm/mcfmmu.h>
17#include <asm/mmu.h>
18
19#define NO_CONTEXT 256
20#define LAST_CONTEXT 255
21#define FIRST_CONTEXT 1
22
23extern unsigned long context_map[];
24extern mm_context_t next_mmu_context;
25
26extern atomic_t nr_free_contexts;
27extern struct mm_struct *context_mm[LAST_CONTEXT+1];
28extern void steal_context(void);
29
30static inline void get_mmu_context(struct mm_struct *mm)
31{
32 mm_context_t ctx;
33
34 if (mm->context != NO_CONTEXT)
35 return;
36 while (atomic_dec_and_test_lt(&nr_free_contexts)) {
37 atomic_inc(&nr_free_contexts);
38 steal_context();
39 }
40 ctx = next_mmu_context;
41 while (test_and_set_bit(ctx, context_map)) {
42 ctx = find_next_zero_bit(context_map, LAST_CONTEXT+1, ctx);
43 if (ctx > LAST_CONTEXT)
44 ctx = 0;
45 }
46 next_mmu_context = (ctx + 1) & LAST_CONTEXT;
47 mm->context = ctx;
48 context_mm[ctx] = mm;
49}
50
51/*
52 * Set up the context for a new address space.
53 */
54#define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0)
55
56/*
57 * We're finished using the context for an address space.
58 */
59static inline void destroy_context(struct mm_struct *mm)
60{
61 if (mm->context != NO_CONTEXT) {
62 clear_bit(mm->context, context_map);
63 mm->context = NO_CONTEXT;
64 atomic_inc(&nr_free_contexts);
65 }
66}
67
68static inline void set_context(mm_context_t context, pgd_t *pgd)
69{
70 __asm__ __volatile__ ("movec %0,%%asid" : : "d" (context));
71}
72
73static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
74 struct task_struct *tsk)
75{
76 get_mmu_context(tsk->mm);
77 set_context(tsk->mm->context, next->pgd);
78}
79
80/*
81 * After we have set current->mm to a new value, this activates
82 * the context for the new mm so we see the new mappings.
83 */
84static inline void activate_mm(struct mm_struct *active_mm,
85 struct mm_struct *mm)
86{
87 get_mmu_context(mm);
88 set_context(mm->context, mm->pgd);
89}
90
91#define deactivate_mm(tsk, mm) do { } while (0)
92
93extern void mmu_context_init(void);
94#define prepare_arch_switch(next) load_ksp_mmu(next)
95
96static inline void load_ksp_mmu(struct task_struct *task)
97{
98 unsigned long flags;
99 struct mm_struct *mm;
100 int asid;
101 pgd_t *pgd;
102 pmd_t *pmd;
103 pte_t *pte;
104 unsigned long mmuar;
105
106 local_irq_save(flags);
107 mmuar = task->thread.ksp;
108
109 /* Search for a valid TLB entry, if one is found, don't remap */
110 mmu_write(MMUAR, mmuar);
111 mmu_write(MMUOR, MMUOR_STLB | MMUOR_ADR);
112 if (mmu_read(MMUSR) & MMUSR_HIT)
113 goto end;
114
115 if (mmuar >= PAGE_OFFSET) {
116 mm = &init_mm;
117 } else {
118 pr_info("load_ksp_mmu: non-kernel mm found: 0x%p\n", task->mm);
119 mm = task->mm;
120 }
121
122 if (!mm)
123 goto bug;
124
125 pgd = pgd_offset(mm, mmuar);
126 if (pgd_none(*pgd))
127 goto bug;
128
129 pmd = pmd_offset(pgd, mmuar);
130 if (pmd_none(*pmd))
131 goto bug;
132
133 pte = (mmuar >= PAGE_OFFSET) ? pte_offset_kernel(pmd, mmuar)
134 : pte_offset_map(pmd, mmuar);
135 if (pte_none(*pte) || !pte_present(*pte))
136 goto bug;
137
138 set_pte(pte, pte_mkyoung(*pte));
139 asid = mm->context & 0xff;
140 if (!pte_dirty(*pte) && mmuar <= PAGE_OFFSET)
141 set_pte(pte, pte_wrprotect(*pte));
142
143 mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) |
144 (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK)
145 >> CF_PAGE_MMUTR_SHIFT) | MMUTR_V);
146
147 mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) |
148 ((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
149
150 mmu_write(MMUOR, MMUOR_ACC | MMUOR_UAA);
151
152 goto end;
153
154bug:
155 pr_info("ksp load failed: mm=0x%p ksp=0x08%lx\n", mm, mmuar);
156end:
157 local_irq_restore(flags);
158}
159
160#elif defined(CONFIG_SUN3)
161#include <asm/sun3mmu.h>
162#include <linux/sched.h>
163
164extern unsigned long get_free_context(struct mm_struct *mm);
165extern void clear_context(unsigned long context);
166
167/* set the context for a new task to unmapped */
168static inline int init_new_context(struct task_struct *tsk,
169 struct mm_struct *mm)
170{
171 mm->context = SUN3_INVALID_CONTEXT;
172 return 0;
173}
174
175/* find the context given to this process, and if it hasn't already
176 got one, go get one for it. */
177static inline void get_mmu_context(struct mm_struct *mm)
178{
179 if (mm->context == SUN3_INVALID_CONTEXT)
180 mm->context = get_free_context(mm);
181}
182
183/* flush context if allocated... */
184static inline void destroy_context(struct mm_struct *mm)
185{
186 if (mm->context != SUN3_INVALID_CONTEXT)
187 clear_context(mm->context);
188}
189
190static inline void activate_context(struct mm_struct *mm)
191{
192 get_mmu_context(mm);
193 sun3_put_context(mm->context);
194}
195
196static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
197 struct task_struct *tsk)
198{
199 activate_context(tsk->mm);
200}
201
202#define deactivate_mm(tsk, mm) do { } while (0)
203
204static inline void activate_mm(struct mm_struct *prev_mm,
205 struct mm_struct *next_mm)
206{
207 activate_context(next_mm);
208}
209
210#else
12 211
13#include <asm/setup.h> 212#include <asm/setup.h>
14#include <asm/page.h> 213#include <asm/page.h>
@@ -103,55 +302,8 @@ static inline void activate_mm(struct mm_struct *prev_mm,
103 switch_mm_0460(next_mm); 302 switch_mm_0460(next_mm);
104} 303}
105 304
106#else /* CONFIG_SUN3 */
107#include <asm/sun3mmu.h>
108#include <linux/sched.h>
109
110extern unsigned long get_free_context(struct mm_struct *mm);
111extern void clear_context(unsigned long context);
112
113/* set the context for a new task to unmapped */
114static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
115{
116 mm->context = SUN3_INVALID_CONTEXT;
117 return 0;
118}
119
120/* find the context given to this process, and if it hasn't already
121 got one, go get one for it. */
122static inline void get_mmu_context(struct mm_struct *mm)
123{
124 if(mm->context == SUN3_INVALID_CONTEXT)
125 mm->context = get_free_context(mm);
126}
127
128/* flush context if allocated... */
129static inline void destroy_context(struct mm_struct *mm)
130{
131 if(mm->context != SUN3_INVALID_CONTEXT)
132 clear_context(mm->context);
133}
134
135static inline void activate_context(struct mm_struct *mm)
136{
137 get_mmu_context(mm);
138 sun3_put_context(mm->context);
139}
140
141static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
142{
143 activate_context(tsk->mm);
144}
145
146#define deactivate_mm(tsk,mm) do { } while (0)
147
148static inline void activate_mm(struct mm_struct *prev_mm,
149 struct mm_struct *next_mm)
150{
151 activate_context(next_mm);
152}
153
154#endif 305#endif
306
155#else /* !CONFIG_MMU */ 307#else /* !CONFIG_MMU */
156 308
157static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) 309static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
diff --git a/arch/m68k/include/asm/motorola_pgtable.h b/arch/m68k/include/asm/motorola_pgtable.h
index 45bd3f589bf0..e0fdd4d08075 100644
--- a/arch/m68k/include/asm/motorola_pgtable.h
+++ b/arch/m68k/include/asm/motorola_pgtable.h
@@ -8,6 +8,7 @@
8#define _PAGE_PRESENT 0x001 8#define _PAGE_PRESENT 0x001
9#define _PAGE_SHORT 0x002 9#define _PAGE_SHORT 0x002
10#define _PAGE_RONLY 0x004 10#define _PAGE_RONLY 0x004
11#define _PAGE_READWRITE 0x000
11#define _PAGE_ACCESSED 0x008 12#define _PAGE_ACCESSED 0x008
12#define _PAGE_DIRTY 0x010 13#define _PAGE_DIRTY 0x010
13#define _PAGE_SUPER 0x080 /* 68040 supervisor only */ 14#define _PAGE_SUPER 0x080 /* 68040 supervisor only */
diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h
index dfebb7c1e379..98baa82a8615 100644
--- a/arch/m68k/include/asm/page.h
+++ b/arch/m68k/include/asm/page.h
@@ -6,10 +6,10 @@
6#include <asm/page_offset.h> 6#include <asm/page_offset.h>
7 7
8/* PAGE_SHIFT determines the page size */ 8/* PAGE_SHIFT determines the page size */
9#ifndef CONFIG_SUN3 9#if defined(CONFIG_SUN3) || defined(CONFIG_COLDFIRE)
10#define PAGE_SHIFT (12) 10#define PAGE_SHIFT 13
11#else 11#else
12#define PAGE_SHIFT (13) 12#define PAGE_SHIFT 12
13#endif 13#endif
14#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) 14#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
15#define PAGE_MASK (~(PAGE_SIZE-1)) 15#define PAGE_MASK (~(PAGE_SIZE-1))
@@ -36,6 +36,10 @@ typedef struct page *pgtable_t;
36#define __pgd(x) ((pgd_t) { (x) } ) 36#define __pgd(x) ((pgd_t) { (x) } )
37#define __pgprot(x) ((pgprot_t) { (x) } ) 37#define __pgprot(x) ((pgprot_t) { (x) } )
38 38
39extern unsigned long _rambase;
40extern unsigned long _ramstart;
41extern unsigned long _ramend;
42
39#endif /* !__ASSEMBLY__ */ 43#endif /* !__ASSEMBLY__ */
40 44
41#ifdef CONFIG_MMU 45#ifdef CONFIG_MMU
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h
index a8d1c60eb9ce..90595721185f 100644
--- a/arch/m68k/include/asm/page_no.h
+++ b/arch/m68k/include/asm/page_no.h
@@ -5,9 +5,6 @@
5 5
6extern unsigned long memory_start; 6extern unsigned long memory_start;
7extern unsigned long memory_end; 7extern unsigned long memory_end;
8extern unsigned long _rambase;
9extern unsigned long _ramstart;
10extern unsigned long _ramend;
11 8
12#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 9#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
13#define free_user_page(page, addr) free_page(addr) 10#define free_user_page(page, addr) free_page(addr)
diff --git a/arch/m68k/include/asm/page_offset.h b/arch/m68k/include/asm/page_offset.h
index 1780152d81da..82626a8f1d0a 100644
--- a/arch/m68k/include/asm/page_offset.h
+++ b/arch/m68k/include/asm/page_offset.h
@@ -1,11 +1,9 @@
1/* This handles the memory map.. */ 1/* This handles the memory map.. */
2 2
3#ifdef CONFIG_MMU 3#if defined(CONFIG_RAMBASE)
4#ifndef CONFIG_SUN3 4#define PAGE_OFFSET_RAW CONFIG_RAMBASE
5#define PAGE_OFFSET_RAW 0x00000000 5#elif defined(CONFIG_SUN3)
6#else
7#define PAGE_OFFSET_RAW 0x0E000000 6#define PAGE_OFFSET_RAW 0x0E000000
8#endif
9#else 7#else
10#define PAGE_OFFSET_RAW CONFIG_RAMBASE 8#define PAGE_OFFSET_RAW 0x00000000
11#endif 9#endif
diff --git a/arch/m68k/include/asm/pgalloc.h b/arch/m68k/include/asm/pgalloc.h
index c294aad8a900..37bee7e3223d 100644
--- a/arch/m68k/include/asm/pgalloc.h
+++ b/arch/m68k/include/asm/pgalloc.h
@@ -7,7 +7,9 @@
7 7
8#ifdef CONFIG_MMU 8#ifdef CONFIG_MMU
9#include <asm/virtconvert.h> 9#include <asm/virtconvert.h>
10#ifdef CONFIG_SUN3 10#if defined(CONFIG_COLDFIRE)
11#include <asm/mcf_pgalloc.h>
12#elif defined(CONFIG_SUN3)
11#include <asm/sun3_pgalloc.h> 13#include <asm/sun3_pgalloc.h>
12#else 14#else
13#include <asm/motorola_pgalloc.h> 15#include <asm/motorola_pgalloc.h>
diff --git a/arch/m68k/include/asm/pgtable_mm.h b/arch/m68k/include/asm/pgtable_mm.h
index 87174c904d2b..dc35e0e106e4 100644
--- a/arch/m68k/include/asm/pgtable_mm.h
+++ b/arch/m68k/include/asm/pgtable_mm.h
@@ -40,6 +40,8 @@
40/* PGDIR_SHIFT determines what a third-level page table entry can map */ 40/* PGDIR_SHIFT determines what a third-level page table entry can map */
41#ifdef CONFIG_SUN3 41#ifdef CONFIG_SUN3
42#define PGDIR_SHIFT 17 42#define PGDIR_SHIFT 17
43#elif defined(CONFIG_COLDFIRE)
44#define PGDIR_SHIFT 22
43#else 45#else
44#define PGDIR_SHIFT 25 46#define PGDIR_SHIFT 25
45#endif 47#endif
@@ -54,6 +56,10 @@
54#define PTRS_PER_PTE 16 56#define PTRS_PER_PTE 16
55#define PTRS_PER_PMD 1 57#define PTRS_PER_PMD 1
56#define PTRS_PER_PGD 2048 58#define PTRS_PER_PGD 2048
59#elif defined(CONFIG_COLDFIRE)
60#define PTRS_PER_PTE 512
61#define PTRS_PER_PMD 1
62#define PTRS_PER_PGD 1024
57#else 63#else
58#define PTRS_PER_PTE 1024 64#define PTRS_PER_PTE 1024
59#define PTRS_PER_PMD 8 65#define PTRS_PER_PMD 8
@@ -66,12 +72,22 @@
66#ifdef CONFIG_SUN3 72#ifdef CONFIG_SUN3
67#define KMAP_START 0x0DC00000 73#define KMAP_START 0x0DC00000
68#define KMAP_END 0x0E000000 74#define KMAP_END 0x0E000000
75#elif defined(CONFIG_COLDFIRE)
76#define KMAP_START 0xe0000000
77#define KMAP_END 0xf0000000
69#else 78#else
70#define KMAP_START 0xd0000000 79#define KMAP_START 0xd0000000
71#define KMAP_END 0xf0000000 80#define KMAP_END 0xf0000000
72#endif 81#endif
73 82
74#ifndef CONFIG_SUN3 83#ifdef CONFIG_SUN3
84extern unsigned long m68k_vmalloc_end;
85#define VMALLOC_START 0x0f800000
86#define VMALLOC_END m68k_vmalloc_end
87#elif defined(CONFIG_COLDFIRE)
88#define VMALLOC_START 0xd0000000
89#define VMALLOC_END 0xe0000000
90#else
75/* Just any arbitrary offset to the start of the vmalloc VM area: the 91/* Just any arbitrary offset to the start of the vmalloc VM area: the
76 * current 8MB value just means that there will be a 8MB "hole" after the 92 * current 8MB value just means that there will be a 8MB "hole" after the
77 * physical memory until the kernel virtual memory starts. That means that 93 * physical memory until the kernel virtual memory starts. That means that
@@ -82,11 +98,7 @@
82#define VMALLOC_OFFSET (8*1024*1024) 98#define VMALLOC_OFFSET (8*1024*1024)
83#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) 99#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
84#define VMALLOC_END KMAP_START 100#define VMALLOC_END KMAP_START
85#else 101#endif
86extern unsigned long m68k_vmalloc_end;
87#define VMALLOC_START 0x0f800000
88#define VMALLOC_END m68k_vmalloc_end
89#endif /* CONFIG_SUN3 */
90 102
91/* zero page used for uninitialized stuff */ 103/* zero page used for uninitialized stuff */
92extern void *empty_zero_page; 104extern void *empty_zero_page;
@@ -130,6 +142,8 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
130 142
131#ifdef CONFIG_SUN3 143#ifdef CONFIG_SUN3
132#include <asm/sun3_pgtable.h> 144#include <asm/sun3_pgtable.h>
145#elif defined(CONFIG_COLDFIRE)
146#include <asm/mcf_pgtable.h>
133#else 147#else
134#include <asm/motorola_pgtable.h> 148#include <asm/motorola_pgtable.h>
135#endif 149#endif
@@ -138,6 +152,9 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
138/* 152/*
139 * Macro to mark a page protection value as "uncacheable". 153 * Macro to mark a page protection value as "uncacheable".
140 */ 154 */
155#ifdef CONFIG_COLDFIRE
156# define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | CF_PAGE_NOCACHE))
157#else
141#ifdef SUN3_PAGE_NOCACHE 158#ifdef SUN3_PAGE_NOCACHE
142# define __SUN3_PAGE_NOCACHE SUN3_PAGE_NOCACHE 159# define __SUN3_PAGE_NOCACHE SUN3_PAGE_NOCACHE
143#else 160#else
@@ -152,6 +169,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
152 ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S)) \ 169 ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S)) \
153 : (prot))) 170 : (prot)))
154 171
172#endif /* CONFIG_COLDFIRE */
155#include <asm-generic/pgtable.h> 173#include <asm-generic/pgtable.h>
156#endif /* !__ASSEMBLY__ */ 174#endif /* !__ASSEMBLY__ */
157 175
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index 568facf30276..46460fa15d5c 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -48,10 +48,12 @@ static inline void wrusp(unsigned long usp)
48 * so don't change it unless you know what you are doing. 48 * so don't change it unless you know what you are doing.
49 */ 49 */
50#ifdef CONFIG_MMU 50#ifdef CONFIG_MMU
51#ifndef CONFIG_SUN3 51#if defined(CONFIG_COLDFIRE)
52#define TASK_SIZE (0xF0000000UL) 52#define TASK_SIZE (0xC0000000UL)
53#else 53#elif defined(CONFIG_SUN3)
54#define TASK_SIZE (0x0E000000UL) 54#define TASK_SIZE (0x0E000000UL)
55#else
56#define TASK_SIZE (0xF0000000UL)
55#endif 57#endif
56#else 58#else
57#define TASK_SIZE (0xFFFFFFFFUL) 59#define TASK_SIZE (0xFFFFFFFFUL)
@@ -66,10 +68,12 @@ static inline void wrusp(unsigned long usp)
66 * space during mmap's. 68 * space during mmap's.
67 */ 69 */
68#ifdef CONFIG_MMU 70#ifdef CONFIG_MMU
69#ifndef CONFIG_SUN3 71#if defined(CONFIG_COLDFIRE)
70#define TASK_UNMAPPED_BASE 0xC0000000UL 72#define TASK_UNMAPPED_BASE 0x60000000UL
71#else 73#elif defined(CONFIG_SUN3)
72#define TASK_UNMAPPED_BASE 0x0A000000UL 74#define TASK_UNMAPPED_BASE 0x0A000000UL
75#else
76#define TASK_UNMAPPED_BASE 0xC0000000UL
73#endif 77#endif
74#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr) 78#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
75#else 79#else
@@ -88,14 +92,12 @@ struct thread_struct {
88 unsigned long fp[8*3]; 92 unsigned long fp[8*3];
89 unsigned long fpcntl[3]; /* fp control regs */ 93 unsigned long fpcntl[3]; /* fp control regs */
90 unsigned char fpstate[FPSTATESIZE]; /* floating point state */ 94 unsigned char fpstate[FPSTATESIZE]; /* floating point state */
91 struct thread_info info;
92}; 95};
93 96
94#define INIT_THREAD { \ 97#define INIT_THREAD { \
95 .ksp = sizeof(init_stack) + (unsigned long) init_stack, \ 98 .ksp = sizeof(init_stack) + (unsigned long) init_stack, \
96 .sr = PS_S, \ 99 .sr = PS_S, \
97 .fs = __KERNEL_DS, \ 100 .fs = __KERNEL_DS, \
98 .info = INIT_THREAD_INFO(init_task), \
99} 101}
100 102
101#ifdef CONFIG_MMU 103#ifdef CONFIG_MMU
diff --git a/arch/m68k/include/asm/segment.h b/arch/m68k/include/asm/segment.h
index ee959219fdfe..0fa80e97ed2d 100644
--- a/arch/m68k/include/asm/segment.h
+++ b/arch/m68k/include/asm/segment.h
@@ -22,23 +22,26 @@ typedef struct {
22} mm_segment_t; 22} mm_segment_t;
23 23
24#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) 24#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
25#define USER_DS MAKE_MM_SEG(__USER_DS)
26#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
27 25
26#ifdef CONFIG_CPU_HAS_ADDRESS_SPACES
28/* 27/*
29 * Get/set the SFC/DFC registers for MOVES instructions 28 * Get/set the SFC/DFC registers for MOVES instructions
30 */ 29 */
30#define USER_DS MAKE_MM_SEG(__USER_DS)
31#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
31 32
32static inline mm_segment_t get_fs(void) 33static inline mm_segment_t get_fs(void)
33{ 34{
34#ifdef CONFIG_MMU
35 mm_segment_t _v; 35 mm_segment_t _v;
36 __asm__ ("movec %/dfc,%0":"=r" (_v.seg):); 36 __asm__ ("movec %/dfc,%0":"=r" (_v.seg):);
37
38 return _v; 37 return _v;
39#else 38}
40 return USER_DS; 39
41#endif 40static inline void set_fs(mm_segment_t val)
41{
42 __asm__ __volatile__ ("movec %0,%/sfc\n\t"
43 "movec %0,%/dfc\n\t"
44 : /* no outputs */ : "r" (val.seg) : "memory");
42} 45}
43 46
44static inline mm_segment_t get_ds(void) 47static inline mm_segment_t get_ds(void)
@@ -47,14 +50,13 @@ static inline mm_segment_t get_ds(void)
47 return KERNEL_DS; 50 return KERNEL_DS;
48} 51}
49 52
50static inline void set_fs(mm_segment_t val) 53#else
51{ 54#define USER_DS MAKE_MM_SEG(TASK_SIZE)
52#ifdef CONFIG_MMU 55#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF)
53 __asm__ __volatile__ ("movec %0,%/sfc\n\t" 56#define get_ds() (KERNEL_DS)
54 "movec %0,%/dfc\n\t" 57#define get_fs() (current_thread_info()->addr_limit)
55 : /* no outputs */ : "r" (val.seg) : "memory"); 58#define set_fs(x) (current_thread_info()->addr_limit = (x))
56#endif 59#endif
57}
58 60
59#define segment_eq(a,b) ((a).seg == (b).seg) 61#define segment_eq(a,b) ((a).seg == (b).seg)
60 62
diff --git a/arch/m68k/include/asm/serial.h b/arch/m68k/include/asm/serial.h
index 2b90d6e69070..7267536adbcc 100644
--- a/arch/m68k/include/asm/serial.h
+++ b/arch/m68k/include/asm/serial.h
@@ -25,9 +25,11 @@
25#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 25#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
26#endif 26#endif
27 27
28#ifdef CONFIG_ISA
28#define SERIAL_PORT_DFNS \ 29#define SERIAL_PORT_DFNS \
29 /* UART CLK PORT IRQ FLAGS */ \ 30 /* UART CLK PORT IRQ FLAGS */ \
30 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 31 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
31 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 32 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
32 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 33 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
33 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 34 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
35#endif
diff --git a/arch/m68k/include/asm/setup.h b/arch/m68k/include/asm/setup.h
index 4dfb3952b375..00c2c5397d37 100644
--- a/arch/m68k/include/asm/setup.h
+++ b/arch/m68k/include/asm/setup.h
@@ -40,6 +40,7 @@
40#define MACH_HP300 9 40#define MACH_HP300 9
41#define MACH_Q40 10 41#define MACH_Q40 10
42#define MACH_SUN3X 11 42#define MACH_SUN3X 11
43#define MACH_M54XX 12
43 44
44#define COMMAND_LINE_SIZE 256 45#define COMMAND_LINE_SIZE 256
45 46
@@ -211,23 +212,27 @@ extern unsigned long m68k_machtype;
211#define CPUB_68030 1 212#define CPUB_68030 1
212#define CPUB_68040 2 213#define CPUB_68040 2
213#define CPUB_68060 3 214#define CPUB_68060 3
215#define CPUB_COLDFIRE 4
214 216
215#define CPU_68020 (1<<CPUB_68020) 217#define CPU_68020 (1<<CPUB_68020)
216#define CPU_68030 (1<<CPUB_68030) 218#define CPU_68030 (1<<CPUB_68030)
217#define CPU_68040 (1<<CPUB_68040) 219#define CPU_68040 (1<<CPUB_68040)
218#define CPU_68060 (1<<CPUB_68060) 220#define CPU_68060 (1<<CPUB_68060)
221#define CPU_COLDFIRE (1<<CPUB_COLDFIRE)
219 222
220#define FPUB_68881 0 223#define FPUB_68881 0
221#define FPUB_68882 1 224#define FPUB_68882 1
222#define FPUB_68040 2 /* Internal FPU */ 225#define FPUB_68040 2 /* Internal FPU */
223#define FPUB_68060 3 /* Internal FPU */ 226#define FPUB_68060 3 /* Internal FPU */
224#define FPUB_SUNFPA 4 /* Sun-3 FPA */ 227#define FPUB_SUNFPA 4 /* Sun-3 FPA */
228#define FPUB_COLDFIRE 5 /* ColdFire FPU */
225 229
226#define FPU_68881 (1<<FPUB_68881) 230#define FPU_68881 (1<<FPUB_68881)
227#define FPU_68882 (1<<FPUB_68882) 231#define FPU_68882 (1<<FPUB_68882)
228#define FPU_68040 (1<<FPUB_68040) 232#define FPU_68040 (1<<FPUB_68040)
229#define FPU_68060 (1<<FPUB_68060) 233#define FPU_68060 (1<<FPUB_68060)
230#define FPU_SUNFPA (1<<FPUB_SUNFPA) 234#define FPU_SUNFPA (1<<FPUB_SUNFPA)
235#define FPU_COLDFIRE (1<<FPUB_COLDFIRE)
231 236
232#define MMUB_68851 0 237#define MMUB_68851 0
233#define MMUB_68030 1 /* Internal MMU */ 238#define MMUB_68030 1 /* Internal MMU */
@@ -235,6 +240,7 @@ extern unsigned long m68k_machtype;
235#define MMUB_68060 3 /* Internal MMU */ 240#define MMUB_68060 3 /* Internal MMU */
236#define MMUB_APOLLO 4 /* Custom Apollo */ 241#define MMUB_APOLLO 4 /* Custom Apollo */
237#define MMUB_SUN3 5 /* Custom Sun-3 */ 242#define MMUB_SUN3 5 /* Custom Sun-3 */
243#define MMUB_COLDFIRE 6 /* Internal MMU */
238 244
239#define MMU_68851 (1<<MMUB_68851) 245#define MMU_68851 (1<<MMUB_68851)
240#define MMU_68030 (1<<MMUB_68030) 246#define MMU_68030 (1<<MMUB_68030)
@@ -242,6 +248,7 @@ extern unsigned long m68k_machtype;
242#define MMU_68060 (1<<MMUB_68060) 248#define MMU_68060 (1<<MMUB_68060)
243#define MMU_SUN3 (1<<MMUB_SUN3) 249#define MMU_SUN3 (1<<MMUB_SUN3)
244#define MMU_APOLLO (1<<MMUB_APOLLO) 250#define MMU_APOLLO (1<<MMUB_APOLLO)
251#define MMU_COLDFIRE (1<<MMUB_COLDFIRE)
245 252
246#ifdef __KERNEL__ 253#ifdef __KERNEL__
247 254
@@ -341,6 +348,13 @@ extern int m68k_is040or060;
341# endif 348# endif
342#endif 349#endif
343 350
351#if !defined(CONFIG_COLDFIRE)
352# define CPU_IS_COLDFIRE (0)
353#else
354# define CPU_IS_COLDFIRE (1)
355# define MMU_IS_COLDFIRE (1)
356#endif
357
344#define CPU_TYPE (m68k_cputype) 358#define CPU_TYPE (m68k_cputype)
345 359
346#ifdef CONFIG_M68KFPU_EMU 360#ifdef CONFIG_M68KFPU_EMU
diff --git a/arch/m68k/include/asm/sigcontext.h b/arch/m68k/include/asm/sigcontext.h
index a29dd74a17cb..523db2a51cf3 100644
--- a/arch/m68k/include/asm/sigcontext.h
+++ b/arch/m68k/include/asm/sigcontext.h
@@ -15,11 +15,7 @@ struct sigcontext {
15 unsigned long sc_pc; 15 unsigned long sc_pc;
16 unsigned short sc_formatvec; 16 unsigned short sc_formatvec;
17#ifndef __uClinux__ 17#ifndef __uClinux__
18# ifdef __mcoldfire__
19 unsigned long sc_fpregs[2][2]; /* room for two fp registers */
20# else
21 unsigned long sc_fpregs[2*3]; /* room for two fp registers */ 18 unsigned long sc_fpregs[2*3]; /* room for two fp registers */
22# endif
23 unsigned long sc_fpcntl[3]; 19 unsigned long sc_fpcntl[3];
24 unsigned char sc_fpstate[216]; 20 unsigned char sc_fpstate[216];
25#endif 21#endif
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h
index 9bf49c87d954..d4708ce466e0 100644
--- a/arch/m68k/include/asm/socket.h
+++ b/arch/m68k/include/asm/socket.h
@@ -62,4 +62,7 @@
62 62
63#define SO_RXQ_OVFL 40 63#define SO_RXQ_OVFL 40
64 64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67
65#endif /* _ASM_SOCKET_H */ 68#endif /* _ASM_SOCKET_H */
diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h
index 790988967ba7..e8665e6f9464 100644
--- a/arch/m68k/include/asm/thread_info.h
+++ b/arch/m68k/include/asm/thread_info.h
@@ -3,6 +3,7 @@
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5#include <asm/page.h> 5#include <asm/page.h>
6#include <asm/segment.h>
6 7
7/* 8/*
8 * On machines with 4k pages we default to an 8k thread size, though we 9 * On machines with 4k pages we default to an 8k thread size, though we
@@ -26,6 +27,7 @@ struct thread_info {
26 struct task_struct *task; /* main task structure */ 27 struct task_struct *task; /* main task structure */
27 unsigned long flags; 28 unsigned long flags;
28 struct exec_domain *exec_domain; /* execution domain */ 29 struct exec_domain *exec_domain; /* execution domain */
30 mm_segment_t addr_limit; /* thread address space */
29 int preempt_count; /* 0 => preemptable, <0 => BUG */ 31 int preempt_count; /* 0 => preemptable, <0 => BUG */
30 __u32 cpu; /* should always be 0 on m68k */ 32 __u32 cpu; /* should always be 0 on m68k */
31 unsigned long tp_value; /* thread pointer */ 33 unsigned long tp_value; /* thread pointer */
@@ -39,6 +41,7 @@ struct thread_info {
39{ \ 41{ \
40 .task = &tsk, \ 42 .task = &tsk, \
41 .exec_domain = &default_exec_domain, \ 43 .exec_domain = &default_exec_domain, \
44 .addr_limit = KERNEL_DS, \
42 .preempt_count = INIT_PREEMPT_COUNT, \ 45 .preempt_count = INIT_PREEMPT_COUNT, \
43 .restart_block = { \ 46 .restart_block = { \
44 .fn = do_no_restart_syscall, \ 47 .fn = do_no_restart_syscall, \
@@ -47,34 +50,6 @@ struct thread_info {
47 50
48#define init_stack (init_thread_union.stack) 51#define init_stack (init_thread_union.stack)
49 52
50#ifdef CONFIG_MMU
51
52#ifndef __ASSEMBLY__
53#include <asm/current.h>
54#endif
55
56#ifdef ASM_OFFSETS_C
57#define task_thread_info(tsk) ((struct thread_info *) NULL)
58#else
59#include <asm/asm-offsets.h>
60#define task_thread_info(tsk) ((struct thread_info *)((char *)tsk+TASK_TINFO))
61#endif
62
63#define init_thread_info (init_task.thread.info)
64#define task_stack_page(tsk) ((tsk)->stack)
65#define current_thread_info() task_thread_info(current)
66
67#define __HAVE_THREAD_FUNCTIONS
68
69#define setup_thread_stack(p, org) ({ \
70 *(struct task_struct **)(p)->stack = (p); \
71 task_thread_info(p)->task = (p); \
72})
73
74#define end_of_stack(p) ((unsigned long *)(p)->stack + 1)
75
76#else /* !CONFIG_MMU */
77
78#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
79/* how to get the thread information struct from C */ 54/* how to get the thread information struct from C */
80static inline struct thread_info *current_thread_info(void) 55static inline struct thread_info *current_thread_info(void)
@@ -92,8 +67,6 @@ static inline struct thread_info *current_thread_info(void)
92 67
93#define init_thread_info (init_thread_union.thread_info) 68#define init_thread_info (init_thread_union.thread_info)
94 69
95#endif /* CONFIG_MMU */
96
97/* entry.S relies on these definitions! 70/* entry.S relies on these definitions!
98 * bits 0-7 are tested at every exception exit 71 * bits 0-7 are tested at every exception exit
99 * bits 8-15 are also tested at syscall exit 72 * bits 8-15 are also tested at syscall exit
@@ -103,7 +76,6 @@ static inline struct thread_info *current_thread_info(void)
103#define TIF_DELAYED_TRACE 14 /* single step a syscall */ 76#define TIF_DELAYED_TRACE 14 /* single step a syscall */
104#define TIF_SYSCALL_TRACE 15 /* syscall trace active */ 77#define TIF_SYSCALL_TRACE 15 /* syscall trace active */
105#define TIF_MEMDIE 16 /* is terminating due to OOM killer */ 78#define TIF_MEMDIE 16 /* is terminating due to OOM killer */
106#define TIF_FREEZE 17 /* thread is freezing for suspend */
107#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal */ 79#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal */
108 80
109#endif /* _ASM_M68K_THREAD_INFO_H */ 81#endif /* _ASM_M68K_THREAD_INFO_H */
diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h
index a6b4ed4fc90f..965ea35c9a40 100644
--- a/arch/m68k/include/asm/tlbflush.h
+++ b/arch/m68k/include/asm/tlbflush.h
@@ -5,10 +5,13 @@
5#ifndef CONFIG_SUN3 5#ifndef CONFIG_SUN3
6 6
7#include <asm/current.h> 7#include <asm/current.h>
8#include <asm/mcfmmu.h>
8 9
9static inline void flush_tlb_kernel_page(void *addr) 10static inline void flush_tlb_kernel_page(void *addr)
10{ 11{
11 if (CPU_IS_040_OR_060) { 12 if (CPU_IS_COLDFIRE) {
13 mmu_write(MMUOR, MMUOR_CNL);
14 } else if (CPU_IS_040_OR_060) {
12 mm_segment_t old_fs = get_fs(); 15 mm_segment_t old_fs = get_fs();
13 set_fs(KERNEL_DS); 16 set_fs(KERNEL_DS);
14 __asm__ __volatile__(".chip 68040\n\t" 17 __asm__ __volatile__(".chip 68040\n\t"
@@ -25,12 +28,15 @@ static inline void flush_tlb_kernel_page(void *addr)
25 */ 28 */
26static inline void __flush_tlb(void) 29static inline void __flush_tlb(void)
27{ 30{
28 if (CPU_IS_040_OR_060) 31 if (CPU_IS_COLDFIRE) {
32 mmu_write(MMUOR, MMUOR_CNL);
33 } else if (CPU_IS_040_OR_060) {
29 __asm__ __volatile__(".chip 68040\n\t" 34 __asm__ __volatile__(".chip 68040\n\t"
30 "pflushan\n\t" 35 "pflushan\n\t"
31 ".chip 68k"); 36 ".chip 68k");
32 else if (CPU_IS_020_OR_030) 37 } else if (CPU_IS_020_OR_030) {
33 __asm__ __volatile__("pflush #0,#4"); 38 __asm__ __volatile__("pflush #0,#4");
39 }
34} 40}
35 41
36static inline void __flush_tlb040_one(unsigned long addr) 42static inline void __flush_tlb040_one(unsigned long addr)
@@ -43,7 +49,9 @@ static inline void __flush_tlb040_one(unsigned long addr)
43 49
44static inline void __flush_tlb_one(unsigned long addr) 50static inline void __flush_tlb_one(unsigned long addr)
45{ 51{
46 if (CPU_IS_040_OR_060) 52 if (CPU_IS_COLDFIRE)
53 mmu_write(MMUOR, MMUOR_CNL);
54 else if (CPU_IS_040_OR_060)
47 __flush_tlb040_one(addr); 55 __flush_tlb040_one(addr);
48 else if (CPU_IS_020_OR_030) 56 else if (CPU_IS_020_OR_030)
49 __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr)); 57 __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr));
@@ -56,12 +64,15 @@ static inline void __flush_tlb_one(unsigned long addr)
56 */ 64 */
57static inline void flush_tlb_all(void) 65static inline void flush_tlb_all(void)
58{ 66{
59 if (CPU_IS_040_OR_060) 67 if (CPU_IS_COLDFIRE) {
68 mmu_write(MMUOR, MMUOR_CNL);
69 } else if (CPU_IS_040_OR_060) {
60 __asm__ __volatile__(".chip 68040\n\t" 70 __asm__ __volatile__(".chip 68040\n\t"
61 "pflusha\n\t" 71 "pflusha\n\t"
62 ".chip 68k"); 72 ".chip 68k");
63 else if (CPU_IS_020_OR_030) 73 } else if (CPU_IS_020_OR_030) {
64 __asm__ __volatile__("pflusha"); 74 __asm__ __volatile__("pflusha");
75 }
65} 76}
66 77
67static inline void flush_tlb_mm(struct mm_struct *mm) 78static inline void flush_tlb_mm(struct mm_struct *mm)
diff --git a/arch/m68k/include/asm/traps.h b/arch/m68k/include/asm/traps.h
index 151068f64f44..4aff3358fbaf 100644
--- a/arch/m68k/include/asm/traps.h
+++ b/arch/m68k/include/asm/traps.h
@@ -18,6 +18,7 @@
18 18
19typedef void (*e_vector)(void); 19typedef void (*e_vector)(void);
20extern e_vector vectors[]; 20extern e_vector vectors[];
21extern e_vector *_ramvec;
21 22
22asmlinkage void auto_inthandler(void); 23asmlinkage void auto_inthandler(void);
23asmlinkage void user_inthandler(void); 24asmlinkage void user_inthandler(void);
diff --git a/arch/m68k/include/asm/types.h b/arch/m68k/include/asm/types.h
index b17fd115a4e7..89705adcbd52 100644
--- a/arch/m68k/include/asm/types.h
+++ b/arch/m68k/include/asm/types.h
@@ -10,12 +10,6 @@
10 */ 10 */
11#include <asm-generic/int-ll64.h> 11#include <asm-generic/int-ll64.h>
12 12
13#ifndef __ASSEMBLY__
14
15typedef unsigned short umode_t;
16
17#endif /* __ASSEMBLY__ */
18
19/* 13/*
20 * These aren't exported outside the kernel to avoid name space clashes 14 * These aren't exported outside the kernel to avoid name space clashes
21 */ 15 */
diff --git a/arch/m68k/include/asm/uaccess_mm.h b/arch/m68k/include/asm/uaccess_mm.h
index 7107f3fbdbb6..9c80cd515b20 100644
--- a/arch/m68k/include/asm/uaccess_mm.h
+++ b/arch/m68k/include/asm/uaccess_mm.h
@@ -21,6 +21,22 @@ static inline int access_ok(int type, const void __user *addr,
21} 21}
22 22
23/* 23/*
24 * Not all varients of the 68k family support the notion of address spaces.
25 * The traditional 680x0 parts do, and they use the sfc/dfc registers and
26 * the "moves" instruction to access user space from kernel space. Other
27 * family members like ColdFire don't support this, and only have a single
28 * address space, and use the usual "move" instruction for user space access.
29 *
30 * Outside of this difference the user space access functions are the same.
31 * So lets keep the code simple and just define in what we need to use.
32 */
33#ifdef CONFIG_CPU_HAS_ADDRESS_SPACES
34#define MOVES "moves"
35#else
36#define MOVES "move"
37#endif
38
39/*
24 * The exception table consists of pairs of addresses: the first is the 40 * The exception table consists of pairs of addresses: the first is the
25 * address of an instruction that is allowed to fault, and the second is 41 * address of an instruction that is allowed to fault, and the second is
26 * the address at which the program should continue. No registers are 42 * the address at which the program should continue. No registers are
@@ -43,7 +59,7 @@ extern int __get_user_bad(void);
43 59
44#define __put_user_asm(res, x, ptr, bwl, reg, err) \ 60#define __put_user_asm(res, x, ptr, bwl, reg, err) \
45asm volatile ("\n" \ 61asm volatile ("\n" \
46 "1: moves."#bwl" %2,%1\n" \ 62 "1: "MOVES"."#bwl" %2,%1\n" \
47 "2:\n" \ 63 "2:\n" \
48 " .section .fixup,\"ax\"\n" \ 64 " .section .fixup,\"ax\"\n" \
49 " .even\n" \ 65 " .even\n" \
@@ -83,8 +99,8 @@ asm volatile ("\n" \
83 { \ 99 { \
84 const void __user *__pu_ptr = (ptr); \ 100 const void __user *__pu_ptr = (ptr); \
85 asm volatile ("\n" \ 101 asm volatile ("\n" \
86 "1: moves.l %2,(%1)+\n" \ 102 "1: "MOVES".l %2,(%1)+\n" \
87 "2: moves.l %R2,(%1)\n" \ 103 "2: "MOVES".l %R2,(%1)\n" \
88 "3:\n" \ 104 "3:\n" \
89 " .section .fixup,\"ax\"\n" \ 105 " .section .fixup,\"ax\"\n" \
90 " .even\n" \ 106 " .even\n" \
@@ -115,12 +131,12 @@ asm volatile ("\n" \
115#define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \ 131#define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \
116 type __gu_val; \ 132 type __gu_val; \
117 asm volatile ("\n" \ 133 asm volatile ("\n" \
118 "1: moves."#bwl" %2,%1\n" \ 134 "1: "MOVES"."#bwl" %2,%1\n" \
119 "2:\n" \ 135 "2:\n" \
120 " .section .fixup,\"ax\"\n" \ 136 " .section .fixup,\"ax\"\n" \
121 " .even\n" \ 137 " .even\n" \
122 "10: move.l %3,%0\n" \ 138 "10: move.l %3,%0\n" \
123 " sub."#bwl" %1,%1\n" \ 139 " sub.l %1,%1\n" \
124 " jra 2b\n" \ 140 " jra 2b\n" \
125 " .previous\n" \ 141 " .previous\n" \
126 "\n" \ 142 "\n" \
@@ -152,8 +168,8 @@ asm volatile ("\n" \
152 const void *__gu_ptr = (ptr); \ 168 const void *__gu_ptr = (ptr); \
153 u64 __gu_val; \ 169 u64 __gu_val; \
154 asm volatile ("\n" \ 170 asm volatile ("\n" \
155 "1: moves.l (%2)+,%1\n" \ 171 "1: "MOVES".l (%2)+,%1\n" \
156 "2: moves.l (%2),%R1\n" \ 172 "2: "MOVES".l (%2),%R1\n" \
157 "3:\n" \ 173 "3:\n" \
158 " .section .fixup,\"ax\"\n" \ 174 " .section .fixup,\"ax\"\n" \
159 " .even\n" \ 175 " .even\n" \
@@ -188,12 +204,12 @@ unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned
188 204
189#define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\ 205#define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\
190 asm volatile ("\n" \ 206 asm volatile ("\n" \
191 "1: moves."#s1" (%2)+,%3\n" \ 207 "1: "MOVES"."#s1" (%2)+,%3\n" \
192 " move."#s1" %3,(%1)+\n" \ 208 " move."#s1" %3,(%1)+\n" \
193 "2: moves."#s2" (%2)+,%3\n" \ 209 "2: "MOVES"."#s2" (%2)+,%3\n" \
194 " move."#s2" %3,(%1)+\n" \ 210 " move."#s2" %3,(%1)+\n" \
195 " .ifnc \""#s3"\",\"\"\n" \ 211 " .ifnc \""#s3"\",\"\"\n" \
196 "3: moves."#s3" (%2)+,%3\n" \ 212 "3: "MOVES"."#s3" (%2)+,%3\n" \
197 " move."#s3" %3,(%1)+\n" \ 213 " move."#s3" %3,(%1)+\n" \
198 " .endif\n" \ 214 " .endif\n" \
199 "4:\n" \ 215 "4:\n" \
@@ -269,13 +285,13 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n)
269#define __constant_copy_to_user_asm(res, to, from, tmp, n, s1, s2, s3) \ 285#define __constant_copy_to_user_asm(res, to, from, tmp, n, s1, s2, s3) \
270 asm volatile ("\n" \ 286 asm volatile ("\n" \
271 " move."#s1" (%2)+,%3\n" \ 287 " move."#s1" (%2)+,%3\n" \
272 "11: moves."#s1" %3,(%1)+\n" \ 288 "11: "MOVES"."#s1" %3,(%1)+\n" \
273 "12: move."#s2" (%2)+,%3\n" \ 289 "12: move."#s2" (%2)+,%3\n" \
274 "21: moves."#s2" %3,(%1)+\n" \ 290 "21: "MOVES"."#s2" %3,(%1)+\n" \
275 "22:\n" \ 291 "22:\n" \
276 " .ifnc \""#s3"\",\"\"\n" \ 292 " .ifnc \""#s3"\",\"\"\n" \
277 " move."#s3" (%2)+,%3\n" \ 293 " move."#s3" (%2)+,%3\n" \
278 "31: moves."#s3" %3,(%1)+\n" \ 294 "31: "MOVES"."#s3" %3,(%1)+\n" \
279 "32:\n" \ 295 "32:\n" \
280 " .endif\n" \ 296 " .endif\n" \
281 "4:\n" \ 297 "4:\n" \
diff --git a/arch/m68k/include/asm/ucontext.h b/arch/m68k/include/asm/ucontext.h
index 00dcc5176c57..e4e22669edc0 100644
--- a/arch/m68k/include/asm/ucontext.h
+++ b/arch/m68k/include/asm/ucontext.h
@@ -7,11 +7,7 @@ typedef greg_t gregset_t[NGREG];
7 7
8typedef struct fpregset { 8typedef struct fpregset {
9 int f_fpcntl[3]; 9 int f_fpcntl[3];
10#ifdef __mcoldfire__
11 int f_fpregs[8][2];
12#else
13 int f_fpregs[8*3]; 10 int f_fpregs[8*3];
14#endif
15} fpregset_t; 11} fpregset_t;
16 12
17struct mcontext { 13struct mcontext {
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h
index 43f984e93970..ea0b502f845e 100644
--- a/arch/m68k/include/asm/unistd.h
+++ b/arch/m68k/include/asm/unistd.h
@@ -132,10 +132,10 @@
132#define __NR_adjtimex 124 132#define __NR_adjtimex 124
133#define __NR_mprotect 125 133#define __NR_mprotect 125
134#define __NR_sigprocmask 126 134#define __NR_sigprocmask 126
135/*#define __NR_create_module 127*/ 135#define __NR_create_module 127
136#define __NR_init_module 128 136#define __NR_init_module 128
137#define __NR_delete_module 129 137#define __NR_delete_module 129
138/*#define __NR_get_kernel_syms 130*/ 138#define __NR_get_kernel_syms 130
139#define __NR_quotactl 131 139#define __NR_quotactl 131
140#define __NR_getpgid 132 140#define __NR_getpgid 132
141#define __NR_fchdir 133 141#define __NR_fchdir 133
@@ -172,7 +172,7 @@
172#define __NR_setresuid 164 172#define __NR_setresuid 164
173#define __NR_getresuid 165 173#define __NR_getresuid 165
174#define __NR_getpagesize 166 174#define __NR_getpagesize 166
175/*#define __NR_query_module 167*/ 175#define __NR_query_module 167
176#define __NR_poll 168 176#define __NR_poll 168
177#define __NR_nfsservctl 169 177#define __NR_nfsservctl 169
178#define __NR_setresgid 170 178#define __NR_setresgid 170
@@ -193,8 +193,8 @@
193#define __NR_capset 185 193#define __NR_capset 185
194#define __NR_sigaltstack 186 194#define __NR_sigaltstack 186
195#define __NR_sendfile 187 195#define __NR_sendfile 187
196/*#define __NR_getpmsg 188*/ /* some people actually want streams */ 196#define __NR_getpmsg 188 /* some people actually want streams */
197/*#define __NR_putpmsg 189*/ /* some people actually want streams */ 197#define __NR_putpmsg 189 /* some people actually want streams */
198#define __NR_vfork 190 198#define __NR_vfork 190
199#define __NR_ugetrlimit 191 199#define __NR_ugetrlimit 191
200#define __NR_mmap2 192 200#define __NR_mmap2 192
@@ -350,10 +350,12 @@
350#define __NR_clock_adjtime 342 350#define __NR_clock_adjtime 342
351#define __NR_syncfs 343 351#define __NR_syncfs 343
352#define __NR_setns 344 352#define __NR_setns 344
353#define __NR_process_vm_readv 345
354#define __NR_process_vm_writev 346
353 355
354#ifdef __KERNEL__ 356#ifdef __KERNEL__
355 357
356#define NR_syscalls 345 358#define NR_syscalls 347
357 359
358#define __ARCH_WANT_IPC_PARSE_VERSION 360#define __ARCH_WANT_IPC_PARSE_VERSION
359#define __ARCH_WANT_OLD_READDIR 361#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
index c5696193281a..40d29a788b05 100644
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -2,19 +2,24 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5extra-$(CONFIG_MMU) := head.o 5extra-$(CONFIG_AMIGA) := head.o
6extra-$(CONFIG_ATARI) := head.o
7extra-$(CONFIG_MAC) := head.o
8extra-$(CONFIG_APOLLO) := head.o
9extra-$(CONFIG_VME) := head.o
10extra-$(CONFIG_HP300) := head.o
11extra-$(CONFIG_Q40) := head.o
12extra-$(CONFIG_SUN3X) := head.o
6extra-$(CONFIG_SUN3) := sun3-head.o 13extra-$(CONFIG_SUN3) := sun3-head.o
7extra-y += vmlinux.lds 14extra-y += vmlinux.lds
8 15
9obj-y := entry.o irq.o m68k_ksyms.o module.o process.o ptrace.o setup.o \ 16obj-y := entry.o init_task.o irq.o m68k_ksyms.o module.o process.o ptrace.o
10 signal.o sys_m68k.o syscalltable.o time.o traps.o 17obj-y += setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o
11 18
12obj-$(CONFIG_MMU) += ints.o vectors.o 19obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o
20obj-$(CONFIG_MMU_SUN3) += ints.o vectors.o
13 21
14ifndef CONFIG_MMU_SUN3 22ifndef CONFIG_MMU_SUN3
15obj-y += dma.o 23obj-y += dma.o
16endif
17ifndef CONFIG_MMU
18obj-y += init_task.o
19endif 24endif
20 25
diff --git a/arch/m68k/kernel/asm-offsets.c b/arch/m68k/kernel/asm-offsets.c
index 983fed9d469b..a972b00cd77d 100644
--- a/arch/m68k/kernel/asm-offsets.c
+++ b/arch/m68k/kernel/asm-offsets.c
@@ -24,8 +24,7 @@ int main(void)
24 /* offsets into the task struct */ 24 /* offsets into the task struct */
25 DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); 25 DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
26 DEFINE(TASK_MM, offsetof(struct task_struct, mm)); 26 DEFINE(TASK_MM, offsetof(struct task_struct, mm));
27 DEFINE(TASK_INFO, offsetof(struct task_struct, thread.info)); 27 DEFINE(TASK_STACK, offsetof(struct task_struct, stack));
28 DEFINE(TASK_TINFO, offsetof(struct task_struct, thread.info));
29 28
30 /* offsets into the thread struct */ 29 /* offsets into the thread struct */
31 DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); 30 DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 081cf96f243b..b8daf64e347d 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -1,4 +1,4 @@
1#ifdef CONFIG_MMU 1#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)
2#include "entry_mm.S" 2#include "entry_mm.S"
3#else 3#else
4#include "entry_no.S" 4#include "entry_no.S"
diff --git a/arch/m68k/kernel/entry_mm.S b/arch/m68k/kernel/entry_mm.S
index c713f514843d..675a854966a6 100644
--- a/arch/m68k/kernel/entry_mm.S
+++ b/arch/m68k/kernel/entry_mm.S
@@ -99,7 +99,8 @@ do_trace_exit:
99 jra .Lret_from_exception 99 jra .Lret_from_exception
100 100
101ENTRY(ret_from_signal) 101ENTRY(ret_from_signal)
102 tstb %curptr@(TASK_INFO+TINFO_FLAGS+2) 102 movel %curptr@(TASK_STACK),%a1
103 tstb %a1@(TINFO_FLAGS+2)
103 jge 1f 104 jge 1f
104 jbsr syscall_trace 105 jbsr syscall_trace
1051: RESTORE_SWITCH_STACK 1061: RESTORE_SWITCH_STACK
@@ -120,11 +121,13 @@ ENTRY(system_call)
120 SAVE_ALL_SYS 121 SAVE_ALL_SYS
121 122
122 GET_CURRENT(%d1) 123 GET_CURRENT(%d1)
124 movel %d1,%a1
125
123 | save top of frame 126 | save top of frame
124 movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0) 127 movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0)
125 128
126 | syscall trace? 129 | syscall trace?
127 tstb %curptr@(TASK_INFO+TINFO_FLAGS+2) 130 tstb %a1@(TINFO_FLAGS+2)
128 jmi do_trace_entry 131 jmi do_trace_entry
129 cmpl #NR_syscalls,%d0 132 cmpl #NR_syscalls,%d0
130 jcc badsys 133 jcc badsys
@@ -133,7 +136,8 @@ syscall:
133 movel %d0,%sp@(PT_OFF_D0) | save the return value 136 movel %d0,%sp@(PT_OFF_D0) | save the return value
134ret_from_syscall: 137ret_from_syscall:
135 |oriw #0x0700,%sr 138 |oriw #0x0700,%sr
136 movew %curptr@(TASK_INFO+TINFO_FLAGS+2),%d0 139 movel %curptr@(TASK_STACK),%a1
140 movew %a1@(TINFO_FLAGS+2),%d0
137 jne syscall_exit_work 141 jne syscall_exit_work
1381: RESTORE_ALL 1421: RESTORE_ALL
139 143
@@ -159,7 +163,8 @@ ENTRY(ret_from_exception)
159 andw #ALLOWINT,%sr 163 andw #ALLOWINT,%sr
160 164
161resume_userspace: 165resume_userspace:
162 moveb %curptr@(TASK_INFO+TINFO_FLAGS+3),%d0 166 movel %curptr@(TASK_STACK),%a1
167 moveb %a1@(TINFO_FLAGS+3),%d0
163 jne exit_work 168 jne exit_work
1641: RESTORE_ALL 1691: RESTORE_ALL
165 170
@@ -199,7 +204,8 @@ do_delayed_trace:
199ENTRY(auto_inthandler) 204ENTRY(auto_inthandler)
200 SAVE_ALL_INT 205 SAVE_ALL_INT
201 GET_CURRENT(%d0) 206 GET_CURRENT(%d0)
202 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 207 movel %d0,%a1
208 addqb #1,%a1@(TINFO_PREEMPT+1)
203 | put exception # in d0 209 | put exception # in d0
204 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 210 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
205 subw #VEC_SPUR,%d0 211 subw #VEC_SPUR,%d0
@@ -211,7 +217,8 @@ auto_irqhandler_fixup = . + 2
211 addql #8,%sp | pop parameters off stack 217 addql #8,%sp | pop parameters off stack
212 218
213ret_from_interrupt: 219ret_from_interrupt:
214 subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 220 movel %curptr@(TASK_STACK),%a1
221 subqb #1,%a1@(TINFO_PREEMPT+1)
215 jeq ret_from_last_interrupt 222 jeq ret_from_last_interrupt
2162: RESTORE_ALL 2232: RESTORE_ALL
217 224
@@ -232,7 +239,8 @@ ret_from_last_interrupt:
232ENTRY(user_inthandler) 239ENTRY(user_inthandler)
233 SAVE_ALL_INT 240 SAVE_ALL_INT
234 GET_CURRENT(%d0) 241 GET_CURRENT(%d0)
235 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 242 movel %d0,%a1
243 addqb #1,%a1@(TINFO_PREEMPT+1)
236 | put exception # in d0 244 | put exception # in d0
237 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 245 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
238user_irqvec_fixup = . + 2 246user_irqvec_fixup = . + 2
@@ -243,7 +251,8 @@ user_irqvec_fixup = . + 2
243 jsr do_IRQ | process the IRQ 251 jsr do_IRQ | process the IRQ
244 addql #8,%sp | pop parameters off stack 252 addql #8,%sp | pop parameters off stack
245 253
246 subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 254 movel %curptr@(TASK_STACK),%a1
255 subqb #1,%a1@(TINFO_PREEMPT+1)
247 jeq ret_from_last_interrupt 256 jeq ret_from_last_interrupt
248 RESTORE_ALL 257 RESTORE_ALL
249 258
@@ -252,13 +261,15 @@ user_irqvec_fixup = . + 2
252ENTRY(bad_inthandler) 261ENTRY(bad_inthandler)
253 SAVE_ALL_INT 262 SAVE_ALL_INT
254 GET_CURRENT(%d0) 263 GET_CURRENT(%d0)
255 addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 264 movel %d0,%a1
265 addqb #1,%a1@(TINFO_PREEMPT+1)
256 266
257 movel %sp,%sp@- 267 movel %sp,%sp@-
258 jsr handle_badint 268 jsr handle_badint
259 addql #4,%sp 269 addql #4,%sp
260 270
261 subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) 271 movel %curptr@(TASK_STACK),%a1
272 subqb #1,%a1@(TINFO_PREEMPT+1)
262 jeq ret_from_last_interrupt 273 jeq ret_from_last_interrupt
263 RESTORE_ALL 274 RESTORE_ALL
264 275
diff --git a/arch/m68k/kernel/entry_no.S b/arch/m68k/kernel/entry_no.S
index 1b4289061a64..d80cba45589f 100644
--- a/arch/m68k/kernel/entry_no.S
+++ b/arch/m68k/kernel/entry_no.S
@@ -44,8 +44,7 @@
44 44
45ENTRY(buserr) 45ENTRY(buserr)
46 SAVE_ALL_INT 46 SAVE_ALL_INT
47 moveq #-1,%d0 47 GET_CURRENT(%d0)
48 movel %d0,%sp@(PT_OFF_ORIG_D0)
49 movel %sp,%sp@- /* stack frame pointer argument */ 48 movel %sp,%sp@- /* stack frame pointer argument */
50 jsr buserr_c 49 jsr buserr_c
51 addql #4,%sp 50 addql #4,%sp
@@ -53,8 +52,7 @@ ENTRY(buserr)
53 52
54ENTRY(trap) 53ENTRY(trap)
55 SAVE_ALL_INT 54 SAVE_ALL_INT
56 moveq #-1,%d0 55 GET_CURRENT(%d0)
57 movel %d0,%sp@(PT_OFF_ORIG_D0)
58 movel %sp,%sp@- /* stack frame pointer argument */ 56 movel %sp,%sp@- /* stack frame pointer argument */
59 jsr trap_c 57 jsr trap_c
60 addql #4,%sp 58 addql #4,%sp
@@ -65,8 +63,7 @@ ENTRY(trap)
65.globl dbginterrupt 63.globl dbginterrupt
66ENTRY(dbginterrupt) 64ENTRY(dbginterrupt)
67 SAVE_ALL_INT 65 SAVE_ALL_INT
68 moveq #-1,%d0 66 GET_CURRENT(%d0)
69 movel %d0,%sp@(PT_OFF_ORIG_D0)
70 movel %sp,%sp@- /* stack frame pointer argument */ 67 movel %sp,%sp@- /* stack frame pointer argument */
71 jsr dbginterrupt_c 68 jsr dbginterrupt_c
72 addql #4,%sp 69 addql #4,%sp
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index 27622b3273c1..d197e7ff62c5 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -250,9 +250,8 @@
250 * USE_MFP: Use the ST-MFP port (Modem1) for serial debug. 250 * USE_MFP: Use the ST-MFP port (Modem1) for serial debug.
251 * 251 *
252 * Macintosh constants: 252 * Macintosh constants:
253 * MAC_SERIAL_DEBUG: Turns on serial debug output for the Macintosh. 253 * MAC_USE_SCC_A: Use SCC port A (modem) for serial debug and early console.
254 * MAC_USE_SCC_A: Use the SCC port A (modem) for serial debug. 254 * MAC_USE_SCC_B: Use SCC port B (printer) for serial debug and early console.
255 * MAC_USE_SCC_B: Use the SCC port B (printer) for serial debug (default).
256 */ 255 */
257 256
258#include <linux/linkage.h> 257#include <linux/linkage.h>
@@ -268,33 +267,25 @@
268 267
269#include <asm/machw.h> 268#include <asm/machw.h>
270 269
271/*
272 * Macintosh console support
273 */
274
275#ifdef CONFIG_FRAMEBUFFER_CONSOLE 270#ifdef CONFIG_FRAMEBUFFER_CONSOLE
276#define CONSOLE 271#define CONSOLE
277#define CONSOLE_PENGUIN 272#define CONSOLE_PENGUIN
278#endif 273#endif
279 274
280/* 275#ifdef CONFIG_EARLY_PRINTK
281 * Macintosh serial debug support; outputs boot info to the printer 276#define SERIAL_DEBUG
282 * and/or modem serial ports 277#else
283 */ 278#undef SERIAL_DEBUG
284#undef MAC_SERIAL_DEBUG 279#endif
285 280
286/* 281#else /* !CONFIG_MAC */
287 * Macintosh serial debug port selection; define one or both;
288 * requires MAC_SERIAL_DEBUG to be defined
289 */
290#define MAC_USE_SCC_A /* Macintosh modem serial port */
291#define MAC_USE_SCC_B /* Macintosh printer serial port */
292 282
293#endif /* CONFIG_MAC */ 283#define SERIAL_DEBUG
284
285#endif /* !CONFIG_MAC */
294 286
295#undef MMU_PRINT 287#undef MMU_PRINT
296#undef MMU_NOCACHE_KERNEL 288#undef MMU_NOCACHE_KERNEL
297#define SERIAL_DEBUG
298#undef DEBUG 289#undef DEBUG
299 290
300/* 291/*
@@ -655,11 +646,11 @@ ENTRY(__start)
655 lea %pc@(L(mac_rowbytes)),%a1 646 lea %pc@(L(mac_rowbytes)),%a1
656 movel %a0@,%a1@ 647 movel %a0@,%a1@
657 648
658#ifdef MAC_SERIAL_DEBUG 649#ifdef SERIAL_DEBUG
659 get_bi_record BI_MAC_SCCBASE 650 get_bi_record BI_MAC_SCCBASE
660 lea %pc@(L(mac_sccbase)),%a1 651 lea %pc@(L(mac_sccbase)),%a1
661 movel %a0@,%a1@ 652 movel %a0@,%a1@
662#endif /* MAC_SERIAL_DEBUG */ 653#endif
663 654
664#if 0 655#if 0
665 /* 656 /*
@@ -1427,7 +1418,7 @@ L(mmu_fixup_done):
1427 subl %d0,L(console_font) 1418 subl %d0,L(console_font)
1428 subl %d0,L(console_font_data) 1419 subl %d0,L(console_font_data)
1429#endif 1420#endif
1430#ifdef MAC_SERIAL_DEBUG 1421#ifdef SERIAL_DEBUG
1431 orl #0x50000000,L(mac_sccbase) 1422 orl #0x50000000,L(mac_sccbase)
1432#endif 1423#endif
14331: 14241:
@@ -1917,7 +1908,7 @@ mmu_030_print:
1917 jbne 30b 1908 jbne 30b
1918 1909
1919mmu_print_done: 1910mmu_print_done:
1920 puts "\n\n" 1911 puts "\n"
1921 1912
1922func_return mmu_print 1913func_return mmu_print
1923 1914
@@ -2768,7 +2759,7 @@ L(scc_initable_mac):
2768 .byte 9,0 /* no interrupts */ 2759 .byte 9,0 /* no interrupts */
2769 .byte 10,0 /* NRZ */ 2760 .byte 10,0 /* NRZ */
2770 .byte 11,0x50 /* use baud rate generator */ 2761 .byte 11,0x50 /* use baud rate generator */
2771 .byte 12,10,13,0 /* 9600 baud */ 2762 .byte 12,1,13,0 /* 38400 baud */
2772 .byte 14,1 /* Baud rate generator enable */ 2763 .byte 14,1 /* Baud rate generator enable */
2773 .byte 3,0xc1 /* enable receiver */ 2764 .byte 3,0xc1 /* enable receiver */
2774 .byte 5,0xea /* enable transmitter */ 2765 .byte 5,0xea /* enable transmitter */
@@ -2906,10 +2897,12 @@ func_start serial_init,%d0/%d1/%a0/%a1
2906#endif 2897#endif
2907#ifdef CONFIG_MAC 2898#ifdef CONFIG_MAC
2908 is_not_mac(L(serial_init_not_mac)) 2899 is_not_mac(L(serial_init_not_mac))
2909#ifdef MAC_SERIAL_DEBUG 2900
2910#if !defined(MAC_USE_SCC_A) && !defined(MAC_USE_SCC_B) 2901#ifdef SERIAL_DEBUG
2911#define MAC_USE_SCC_B 2902/* You may define either or both of these. */
2912#endif 2903#define MAC_USE_SCC_A /* Modem port */
2904#define MAC_USE_SCC_B /* Printer port */
2905
2913#define mac_scc_cha_b_ctrl_offset 0x0 2906#define mac_scc_cha_b_ctrl_offset 0x0
2914#define mac_scc_cha_a_ctrl_offset 0x2 2907#define mac_scc_cha_a_ctrl_offset 0x2
2915#define mac_scc_cha_b_data_offset 0x4 2908#define mac_scc_cha_b_data_offset 0x4
@@ -2940,7 +2933,7 @@ func_start serial_init,%d0/%d1/%a0/%a1
2940 jra 7b 2933 jra 7b
29418: 29348:
2942#endif /* MAC_USE_SCC_B */ 2935#endif /* MAC_USE_SCC_B */
2943#endif /* MAC_SERIAL_DEBUG */ 2936#endif /* SERIAL_DEBUG */
2944 2937
2945 jra L(serial_init_done) 2938 jra L(serial_init_done)
2946L(serial_init_not_mac): 2939L(serial_init_not_mac):
@@ -3011,7 +3004,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
3011#ifdef CONFIG_MAC 3004#ifdef CONFIG_MAC
3012 is_not_mac(5f) 3005 is_not_mac(5f)
3013 3006
3014#ifdef MAC_SERIAL_DEBUG 3007#ifdef SERIAL_DEBUG
3015 3008
3016#ifdef MAC_USE_SCC_A 3009#ifdef MAC_USE_SCC_A
3017 movel %pc@(L(mac_sccbase)),%a1 3010 movel %pc@(L(mac_sccbase)),%a1
@@ -3029,7 +3022,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
3029 moveb %d0,%a1@(mac_scc_cha_b_data_offset) 3022 moveb %d0,%a1@(mac_scc_cha_b_data_offset)
3030#endif /* MAC_USE_SCC_B */ 3023#endif /* MAC_USE_SCC_B */
3031 3024
3032#endif /* MAC_SERIAL_DEBUG */ 3025#endif /* SERIAL_DEBUG */
3033 3026
3034 jra L(serial_putc_done) 3027 jra L(serial_putc_done)
30355: 30285:
@@ -3248,33 +3241,39 @@ func_return putn
3248 3241
3249#ifdef CONFIG_MAC 3242#ifdef CONFIG_MAC
3250/* 3243/*
3251 * mac_serial_print 3244 * mac_early_print
3252 * 3245 *
3253 * This routine takes its parameters on the stack. It then 3246 * This routine takes its parameters on the stack. It then
3254 * turns around and calls the internal routine. This routine 3247 * turns around and calls the internal routines. This routine
3255 * is used until the Linux console driver initializes itself. 3248 * is used by the boot console.
3256 * 3249 *
3257 * The calling parameters are: 3250 * The calling parameters are:
3258 * void mac_serial_print(const char *str); 3251 * void mac_early_print(const char *str, unsigned length);
3259 * 3252 *
3260 * This routine does NOT understand variable arguments only 3253 * This routine does NOT understand variable arguments only
3261 * simple strings! 3254 * simple strings!
3262 */ 3255 */
3263ENTRY(mac_serial_print) 3256ENTRY(mac_early_print)
3264 moveml %d0/%a0,%sp@- 3257 moveml %d0/%d1/%a0,%sp@-
3265#if 1 3258 movew %sr,%sp@-
3266 move %sr,%sp@-
3267 ori #0x0700,%sr 3259 ori #0x0700,%sr
3268#endif 3260 movel %sp@(18),%a0 /* fetch parameter */
3269 movel %sp@(10),%a0 /* fetch parameter */ 3261 movel %sp@(22),%d1 /* fetch parameter */
3270 jra 2f 3262 jra 2f
32711: serial_putc %d0 32631:
32722: moveb %a0@+,%d0 3264#ifdef CONSOLE
3273 jne 1b 3265 console_putc %d0
3274#if 1
3275 move %sp@+,%sr
3276#endif 3266#endif
3277 moveml %sp@+,%d0/%a0 3267#ifdef SERIAL_DEBUG
3268 serial_putc %d0
3269#endif
3270 subq #1,%d1
32712: jeq 3f
3272 moveb %a0@+,%d0
3273 jne 1b
32743:
3275 movew %sp@+,%sr
3276 moveml %sp@+,%d0/%d1/%a0
3278 rts 3277 rts
3279#endif /* CONFIG_MAC */ 3278#endif /* CONFIG_MAC */
3280 3279
@@ -3409,10 +3408,10 @@ func_start console_put_stats,%a0/%d7
3409 * a0 = pointer to boot_info 3408 * a0 = pointer to boot_info
3410 * d7 = value of boot_info fields 3409 * d7 = value of boot_info fields
3411 */ 3410 */
3412 puts "\nMacLinux\n\n" 3411 puts "\nMacLinux\n"
3413 3412
3414#ifdef SERIAL_DEBUG 3413#ifdef SERIAL_DEBUG
3415 puts " vidaddr:" 3414 puts "\n vidaddr:"
3416 putn %pc@(L(mac_videobase)) /* video addr. */ 3415 putn %pc@(L(mac_videobase)) /* video addr. */
3417 3416
3418 puts "\n _stext:" 3417 puts "\n _stext:"
@@ -3423,19 +3422,21 @@ func_start console_put_stats,%a0/%d7
3423 lea %pc@(_end),%a0 3422 lea %pc@(_end),%a0
3424 putn %a0 3423 putn %a0
3425 3424
3426 puts "\ncpuid:" 3425 puts "\n cpuid:"
3427 putn %pc@(L(cputype)) 3426 putn %pc@(L(cputype))
3428 putc '\n'
3429 3427
3430#ifdef MAC_SERIAL_DEBUG 3428# ifdef CONFIG_MAC
3429 puts "\n sccbase:"
3431 putn %pc@(L(mac_sccbase)) 3430 putn %pc@(L(mac_sccbase))
3431# endif
3432# ifdef MMU_PRINT
3432 putc '\n' 3433 putc '\n'
3433#endif
3434# if defined(MMU_PRINT)
3435 jbsr mmu_print_machine_cpu_types 3434 jbsr mmu_print_machine_cpu_types
3436# endif /* MMU_PRINT */ 3435# endif
3437#endif /* SERIAL_DEBUG */ 3436#endif /* SERIAL_DEBUG */
3438 3437
3438 putc '\n'
3439
3439func_return console_put_stats 3440func_return console_put_stats
3440 3441
3441#ifdef CONSOLE_PENGUIN 3442#ifdef CONSOLE_PENGUIN
@@ -3896,11 +3897,11 @@ L(mac_dimensions):
3896 .long 0 3897 .long 0
3897L(mac_rowbytes): 3898L(mac_rowbytes):
3898 .long 0 3899 .long 0
3899#ifdef MAC_SERIAL_DEBUG 3900#ifdef SERIAL_DEBUG
3900L(mac_sccbase): 3901L(mac_sccbase):
3901 .long 0 3902 .long 0
3902#endif /* MAC_SERIAL_DEBUG */
3903#endif 3903#endif
3904#endif /* CONFIG_MAC */
3904 3905
3905#if defined (CONFIG_APOLLO) 3906#if defined (CONFIG_APOLLO)
3906LSRB0 = 0x10412 3907LSRB0 = 0x10412
diff --git a/arch/m68k/kernel/init_task.c b/arch/m68k/kernel/init_task.c
index cbf9dc3cc51d..c744cfc6bfa1 100644
--- a/arch/m68k/kernel/init_task.c
+++ b/arch/m68k/kernel/init_task.c
@@ -19,7 +19,6 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
19 * 19 *
20 * All other task structs will be allocated on slabs in fork.c 20 * All other task structs will be allocated on slabs in fork.c
21 */ 21 */
22__asm__(".align 4");
23struct task_struct init_task = INIT_TASK(init_task); 22struct task_struct init_task = INIT_TASK(init_task);
24 23
25EXPORT_SYMBOL(init_task); 24EXPORT_SYMBOL(init_task);
@@ -27,7 +26,7 @@ EXPORT_SYMBOL(init_task);
27/* 26/*
28 * Initial thread structure. 27 * Initial thread structure.
29 * 28 *
30 * We need to make sure that this is 8192-byte aligned due to the 29 * We need to make sure that this is THREAD size aligned due to the
31 * way process stacks are handled. This is done by having a special 30 * way process stacks are handled. This is done by having a special
32 * "init_task" linker map entry.. 31 * "init_task" linker map entry..
33 */ 32 */
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
index 1b7a14d1a000..774c1bd59c36 100644
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ b/arch/m68k/kernel/m68k_ksyms.c
@@ -14,7 +14,7 @@ EXPORT_SYMBOL(__ashrdi3);
14EXPORT_SYMBOL(__lshrdi3); 14EXPORT_SYMBOL(__lshrdi3);
15EXPORT_SYMBOL(__muldi3); 15EXPORT_SYMBOL(__muldi3);
16 16
17#if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE) 17#if defined(CONFIG_CPU_HAS_NO_MULDIV64)
18/* 18/*
19 * Simpler 68k and ColdFire parts also need a few other gcc functions. 19 * Simpler 68k and ColdFire parts also need a few other gcc functions.
20 */ 20 */
diff --git a/arch/m68k/kernel/process_mm.c b/arch/m68k/kernel/process_mm.c
index 1bc223aa07ec..125f34e00bf0 100644
--- a/arch/m68k/kernel/process_mm.c
+++ b/arch/m68k/kernel/process_mm.c
@@ -33,22 +33,6 @@
33#include <asm/setup.h> 33#include <asm/setup.h>
34#include <asm/pgtable.h> 34#include <asm/pgtable.h>
35 35
36/*
37 * Initial task/thread structure. Make this a per-architecture thing,
38 * because different architectures tend to have different
39 * alignment requirements and potentially different initial
40 * setup.
41 */
42static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
43static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
44union thread_union init_thread_union __init_task_data
45 __attribute__((aligned(THREAD_SIZE))) =
46 { INIT_THREAD_INFO(init_task) };
47
48/* initial task structure */
49struct task_struct init_task = INIT_TASK(init_task);
50
51EXPORT_SYMBOL(init_task);
52 36
53asmlinkage void ret_from_fork(void); 37asmlinkage void ret_from_fork(void);
54 38
@@ -188,9 +172,7 @@ void flush_thread(void)
188 172
189 current->thread.fs = __USER_DS; 173 current->thread.fs = __USER_DS;
190 if (!FPU_IS_EMU) 174 if (!FPU_IS_EMU)
191 asm volatile (".chip 68k/68881\n\t" 175 asm volatile ("frestore %0@" : : "a" (&zero) : "memory");
192 "frestore %0@\n\t"
193 ".chip 68k" : : "a" (&zero));
194} 176}
195 177
196/* 178/*
@@ -264,11 +246,28 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
264 /* Copy the current fpu state */ 246 /* Copy the current fpu state */
265 asm volatile ("fsave %0" : : "m" (p->thread.fpstate[0]) : "memory"); 247 asm volatile ("fsave %0" : : "m" (p->thread.fpstate[0]) : "memory");
266 248
267 if (!CPU_IS_060 ? p->thread.fpstate[0] : p->thread.fpstate[2]) 249 if (!CPU_IS_060 ? p->thread.fpstate[0] : p->thread.fpstate[2]) {
268 asm volatile ("fmovemx %/fp0-%/fp7,%0\n\t" 250 if (CPU_IS_COLDFIRE) {
269 "fmoveml %/fpiar/%/fpcr/%/fpsr,%1" 251 asm volatile ("fmovemd %/fp0-%/fp7,%0\n\t"
270 : : "m" (p->thread.fp[0]), "m" (p->thread.fpcntl[0]) 252 "fmovel %/fpiar,%1\n\t"
271 : "memory"); 253 "fmovel %/fpcr,%2\n\t"
254 "fmovel %/fpsr,%3"
255 :
256 : "m" (p->thread.fp[0]),
257 "m" (p->thread.fpcntl[0]),
258 "m" (p->thread.fpcntl[1]),
259 "m" (p->thread.fpcntl[2])
260 : "memory");
261 } else {
262 asm volatile ("fmovemx %/fp0-%/fp7,%0\n\t"
263 "fmoveml %/fpiar/%/fpcr/%/fpsr,%1"
264 :
265 : "m" (p->thread.fp[0]),
266 "m" (p->thread.fpcntl[0])
267 : "memory");
268 }
269 }
270
272 /* Restore the state in case the fpu was busy */ 271 /* Restore the state in case the fpu was busy */
273 asm volatile ("frestore %0" : : "m" (p->thread.fpstate[0])); 272 asm volatile ("frestore %0" : : "m" (p->thread.fpstate[0]));
274 } 273 }
@@ -301,12 +300,28 @@ int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
301 if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2]) 300 if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2])
302 return 0; 301 return 0;
303 302
304 asm volatile ("fmovem %/fpiar/%/fpcr/%/fpsr,%0" 303 if (CPU_IS_COLDFIRE) {
305 :: "m" (fpu->fpcntl[0]) 304 asm volatile ("fmovel %/fpiar,%0\n\t"
306 : "memory"); 305 "fmovel %/fpcr,%1\n\t"
307 asm volatile ("fmovemx %/fp0-%/fp7,%0" 306 "fmovel %/fpsr,%2\n\t"
308 :: "m" (fpu->fpregs[0]) 307 "fmovemd %/fp0-%/fp7,%3"
309 : "memory"); 308 :
309 : "m" (fpu->fpcntl[0]),
310 "m" (fpu->fpcntl[1]),
311 "m" (fpu->fpcntl[2]),
312 "m" (fpu->fpregs[0])
313 : "memory");
314 } else {
315 asm volatile ("fmovem %/fpiar/%/fpcr/%/fpsr,%0"
316 :
317 : "m" (fpu->fpcntl[0])
318 : "memory");
319 asm volatile ("fmovemx %/fp0-%/fp7,%0"
320 :
321 : "m" (fpu->fpregs[0])
322 : "memory");
323 }
324
310 return 1; 325 return 1;
311} 326}
312EXPORT_SYMBOL(dump_fpu); 327EXPORT_SYMBOL(dump_fpu);
diff --git a/arch/m68k/kernel/ptrace_mm.c b/arch/m68k/kernel/ptrace_mm.c
index 0b252683cefb..7bc999b73529 100644
--- a/arch/m68k/kernel/ptrace_mm.c
+++ b/arch/m68k/kernel/ptrace_mm.c
@@ -18,6 +18,7 @@
18#include <linux/ptrace.h> 18#include <linux/ptrace.h>
19#include <linux/user.h> 19#include <linux/user.h>
20#include <linux/signal.h> 20#include <linux/signal.h>
21#include <linux/tracehook.h>
21 22
22#include <asm/uaccess.h> 23#include <asm/uaccess.h>
23#include <asm/page.h> 24#include <asm/page.h>
@@ -275,3 +276,20 @@ asmlinkage void syscall_trace(void)
275 current->exit_code = 0; 276 current->exit_code = 0;
276 } 277 }
277} 278}
279
280#ifdef CONFIG_COLDFIRE
281asmlinkage int syscall_trace_enter(void)
282{
283 int ret = 0;
284
285 if (test_thread_flag(TIF_SYSCALL_TRACE))
286 ret = tracehook_report_syscall_entry(task_pt_regs(current));
287 return ret;
288}
289
290asmlinkage void syscall_trace_leave(void)
291{
292 if (test_thread_flag(TIF_SYSCALL_TRACE))
293 tracehook_report_syscall_exit(task_pt_regs(current), 0);
294}
295#endif /* CONFIG_COLDFIRE */
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index c3b45061dd08..d872ce4807c9 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -221,7 +221,8 @@ void __init setup_arch(char **cmdline_p)
221#endif 221#endif
222 222
223 /* The bootinfo is located right after the kernel bss */ 223 /* The bootinfo is located right after the kernel bss */
224 m68k_parse_bootinfo((const struct bi_record *)_end); 224 if (!CPU_IS_COLDFIRE)
225 m68k_parse_bootinfo((const struct bi_record *)_end);
225 226
226 if (CPU_IS_040) 227 if (CPU_IS_040)
227 m68k_is040or060 = 4; 228 m68k_is040or060 = 4;
@@ -235,7 +236,7 @@ void __init setup_arch(char **cmdline_p)
235 * with them, we should add a test to check_bugs() below] */ 236 * with them, we should add a test to check_bugs() below] */
236#ifndef CONFIG_M68KFPU_EMU_ONLY 237#ifndef CONFIG_M68KFPU_EMU_ONLY
237 /* clear the fpu if we have one */ 238 /* clear the fpu if we have one */
238 if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060)) { 239 if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060|FPU_COLDFIRE)) {
239 volatile int zero = 0; 240 volatile int zero = 0;
240 asm volatile ("frestore %0" : : "m" (zero)); 241 asm volatile ("frestore %0" : : "m" (zero));
241 } 242 }
@@ -258,6 +259,10 @@ void __init setup_arch(char **cmdline_p)
258 init_mm.end_data = (unsigned long)_edata; 259 init_mm.end_data = (unsigned long)_edata;
259 init_mm.brk = (unsigned long)_end; 260 init_mm.brk = (unsigned long)_end;
260 261
262#if defined(CONFIG_BOOTPARAM)
263 strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
264 m68k_command_line[CL_SIZE - 1] = 0;
265#endif /* CONFIG_BOOTPARAM */
261 *cmdline_p = m68k_command_line; 266 *cmdline_p = m68k_command_line;
262 memcpy(boot_command_line, *cmdline_p, CL_SIZE); 267 memcpy(boot_command_line, *cmdline_p, CL_SIZE);
263 268
@@ -323,6 +328,11 @@ void __init setup_arch(char **cmdline_p)
323 config_sun3x(); 328 config_sun3x();
324 break; 329 break;
325#endif 330#endif
331#ifdef CONFIG_COLDFIRE
332 case MACH_M54XX:
333 config_BSP(NULL, 0);
334 break;
335#endif
326 default: 336 default:
327 panic("No configuration setup"); 337 panic("No configuration setup");
328 } 338 }
@@ -384,6 +394,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
384#define LOOP_CYCLES_68030 (8) 394#define LOOP_CYCLES_68030 (8)
385#define LOOP_CYCLES_68040 (3) 395#define LOOP_CYCLES_68040 (3)
386#define LOOP_CYCLES_68060 (1) 396#define LOOP_CYCLES_68060 (1)
397#define LOOP_CYCLES_COLDFIRE (2)
387 398
388 if (CPU_IS_020) { 399 if (CPU_IS_020) {
389 cpu = "68020"; 400 cpu = "68020";
@@ -397,6 +408,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
397 } else if (CPU_IS_060) { 408 } else if (CPU_IS_060) {
398 cpu = "68060"; 409 cpu = "68060";
399 clockfactor = LOOP_CYCLES_68060; 410 clockfactor = LOOP_CYCLES_68060;
411 } else if (CPU_IS_COLDFIRE) {
412 cpu = "ColdFire";
413 clockfactor = LOOP_CYCLES_COLDFIRE;
400 } else { 414 } else {
401 cpu = "680x0"; 415 cpu = "680x0";
402 clockfactor = 0; 416 clockfactor = 0;
@@ -415,6 +429,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
415 fpu = "68060"; 429 fpu = "68060";
416 else if (m68k_fputype & FPU_SUNFPA) 430 else if (m68k_fputype & FPU_SUNFPA)
417 fpu = "Sun FPA"; 431 fpu = "Sun FPA";
432 else if (m68k_fputype & FPU_COLDFIRE)
433 fpu = "ColdFire";
418 else 434 else
419 fpu = "none"; 435 fpu = "none";
420#endif 436#endif
@@ -431,6 +447,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
431 mmu = "Sun-3"; 447 mmu = "Sun-3";
432 else if (m68k_mmutype & MMU_APOLLO) 448 else if (m68k_mmutype & MMU_APOLLO)
433 mmu = "Apollo"; 449 mmu = "Apollo";
450 else if (m68k_mmutype & MMU_COLDFIRE)
451 mmu = "ColdFire";
434 else 452 else
435 mmu = "unknown"; 453 mmu = "unknown";
436 454
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index 2ed8c0fb1517..ca3df0dc7e88 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -47,7 +47,6 @@ EXPORT_SYMBOL(memory_end);
47char __initdata command_line[COMMAND_LINE_SIZE]; 47char __initdata command_line[COMMAND_LINE_SIZE];
48 48
49/* machine dependent timer functions */ 49/* machine dependent timer functions */
50void (*mach_gettod)(int*, int*, int*, int*, int*, int*);
51int (*mach_set_clock_mmss)(unsigned long); 50int (*mach_set_clock_mmss)(unsigned long);
52 51
53/* machine dependent reboot functions */ 52/* machine dependent reboot functions */
diff --git a/arch/m68k/kernel/signal_mm.c b/arch/m68k/kernel/signal_mm.c
index a0afc239304e..cb856f9da655 100644
--- a/arch/m68k/kernel/signal_mm.c
+++ b/arch/m68k/kernel/signal_mm.c
@@ -56,7 +56,11 @@ static const int frame_extra_sizes[16] = {
56 [1] = -1, /* sizeof(((struct frame *)0)->un.fmt1), */ 56 [1] = -1, /* sizeof(((struct frame *)0)->un.fmt1), */
57 [2] = sizeof(((struct frame *)0)->un.fmt2), 57 [2] = sizeof(((struct frame *)0)->un.fmt2),
58 [3] = sizeof(((struct frame *)0)->un.fmt3), 58 [3] = sizeof(((struct frame *)0)->un.fmt3),
59#ifdef CONFIG_COLDFIRE
60 [4] = 0,
61#else
59 [4] = sizeof(((struct frame *)0)->un.fmt4), 62 [4] = sizeof(((struct frame *)0)->un.fmt4),
63#endif
60 [5] = -1, /* sizeof(((struct frame *)0)->un.fmt5), */ 64 [5] = -1, /* sizeof(((struct frame *)0)->un.fmt5), */
61 [6] = -1, /* sizeof(((struct frame *)0)->un.fmt6), */ 65 [6] = -1, /* sizeof(((struct frame *)0)->un.fmt6), */
62 [7] = sizeof(((struct frame *)0)->un.fmt7), 66 [7] = sizeof(((struct frame *)0)->un.fmt7),
@@ -84,7 +88,11 @@ int handle_kernel_fault(struct pt_regs *regs)
84 regs->stkadj = frame_extra_sizes[regs->format]; 88 regs->stkadj = frame_extra_sizes[regs->format];
85 tregs = (struct pt_regs *)((long)regs + regs->stkadj); 89 tregs = (struct pt_regs *)((long)regs + regs->stkadj);
86 tregs->vector = regs->vector; 90 tregs->vector = regs->vector;
91#ifdef CONFIG_COLDFIRE
92 tregs->format = 4;
93#else
87 tregs->format = 0; 94 tregs->format = 0;
95#endif
88 tregs->pc = fixup->fixup; 96 tregs->pc = fixup->fixup;
89 tregs->sr = regs->sr; 97 tregs->sr = regs->sr;
90 98
@@ -195,7 +203,8 @@ static inline int restore_fpu_state(struct sigcontext *sc)
195 203
196 if (CPU_IS_060 ? sc->sc_fpstate[2] : sc->sc_fpstate[0]) { 204 if (CPU_IS_060 ? sc->sc_fpstate[2] : sc->sc_fpstate[0]) {
197 /* Verify the frame format. */ 205 /* Verify the frame format. */
198 if (!CPU_IS_060 && (sc->sc_fpstate[0] != fpu_version)) 206 if (!(CPU_IS_060 || CPU_IS_COLDFIRE) &&
207 (sc->sc_fpstate[0] != fpu_version))
199 goto out; 208 goto out;
200 if (CPU_IS_020_OR_030) { 209 if (CPU_IS_020_OR_030) {
201 if (m68k_fputype & FPU_68881 && 210 if (m68k_fputype & FPU_68881 &&
@@ -214,19 +223,43 @@ static inline int restore_fpu_state(struct sigcontext *sc)
214 sc->sc_fpstate[3] == 0x60 || 223 sc->sc_fpstate[3] == 0x60 ||
215 sc->sc_fpstate[3] == 0xe0)) 224 sc->sc_fpstate[3] == 0xe0))
216 goto out; 225 goto out;
226 } else if (CPU_IS_COLDFIRE) {
227 if (!(sc->sc_fpstate[0] == 0x00 ||
228 sc->sc_fpstate[0] == 0x05 ||
229 sc->sc_fpstate[0] == 0xe5))
230 goto out;
217 } else 231 } else
218 goto out; 232 goto out;
219 233
220 __asm__ volatile (".chip 68k/68881\n\t" 234 if (CPU_IS_COLDFIRE) {
221 "fmovemx %0,%%fp0-%%fp1\n\t" 235 __asm__ volatile ("fmovemd %0,%%fp0-%%fp1\n\t"
222 "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t" 236 "fmovel %1,%%fpcr\n\t"
223 ".chip 68k" 237 "fmovel %2,%%fpsr\n\t"
224 : /* no outputs */ 238 "fmovel %3,%%fpiar"
225 : "m" (*sc->sc_fpregs), "m" (*sc->sc_fpcntl)); 239 : /* no outputs */
240 : "m" (sc->sc_fpregs[0]),
241 "m" (sc->sc_fpcntl[0]),
242 "m" (sc->sc_fpcntl[1]),
243 "m" (sc->sc_fpcntl[2]));
244 } else {
245 __asm__ volatile (".chip 68k/68881\n\t"
246 "fmovemx %0,%%fp0-%%fp1\n\t"
247 "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t"
248 ".chip 68k"
249 : /* no outputs */
250 : "m" (*sc->sc_fpregs),
251 "m" (*sc->sc_fpcntl));
252 }
253 }
254
255 if (CPU_IS_COLDFIRE) {
256 __asm__ volatile ("frestore %0" : : "m" (*sc->sc_fpstate));
257 } else {
258 __asm__ volatile (".chip 68k/68881\n\t"
259 "frestore %0\n\t"
260 ".chip 68k"
261 : : "m" (*sc->sc_fpstate));
226 } 262 }
227 __asm__ volatile (".chip 68k/68881\n\t"
228 "frestore %0\n\t"
229 ".chip 68k" : : "m" (*sc->sc_fpstate));
230 err = 0; 263 err = 0;
231 264
232out: 265out:
@@ -241,7 +274,7 @@ out:
241static inline int rt_restore_fpu_state(struct ucontext __user *uc) 274static inline int rt_restore_fpu_state(struct ucontext __user *uc)
242{ 275{
243 unsigned char fpstate[FPCONTEXT_SIZE]; 276 unsigned char fpstate[FPCONTEXT_SIZE];
244 int context_size = CPU_IS_060 ? 8 : 0; 277 int context_size = CPU_IS_060 ? 8 : (CPU_IS_COLDFIRE ? 12 : 0);
245 fpregset_t fpregs; 278 fpregset_t fpregs;
246 int err = 1; 279 int err = 1;
247 280
@@ -260,10 +293,11 @@ static inline int rt_restore_fpu_state(struct ucontext __user *uc)
260 if (__get_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate)) 293 if (__get_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate))
261 goto out; 294 goto out;
262 if (CPU_IS_060 ? fpstate[2] : fpstate[0]) { 295 if (CPU_IS_060 ? fpstate[2] : fpstate[0]) {
263 if (!CPU_IS_060) 296 if (!(CPU_IS_060 || CPU_IS_COLDFIRE))
264 context_size = fpstate[1]; 297 context_size = fpstate[1];
265 /* Verify the frame format. */ 298 /* Verify the frame format. */
266 if (!CPU_IS_060 && (fpstate[0] != fpu_version)) 299 if (!(CPU_IS_060 || CPU_IS_COLDFIRE) &&
300 (fpstate[0] != fpu_version))
267 goto out; 301 goto out;
268 if (CPU_IS_020_OR_030) { 302 if (CPU_IS_020_OR_030) {
269 if (m68k_fputype & FPU_68881 && 303 if (m68k_fputype & FPU_68881 &&
@@ -282,26 +316,50 @@ static inline int rt_restore_fpu_state(struct ucontext __user *uc)
282 fpstate[3] == 0x60 || 316 fpstate[3] == 0x60 ||
283 fpstate[3] == 0xe0)) 317 fpstate[3] == 0xe0))
284 goto out; 318 goto out;
319 } else if (CPU_IS_COLDFIRE) {
320 if (!(fpstate[3] == 0x00 ||
321 fpstate[3] == 0x05 ||
322 fpstate[3] == 0xe5))
323 goto out;
285 } else 324 } else
286 goto out; 325 goto out;
287 if (__copy_from_user(&fpregs, &uc->uc_mcontext.fpregs, 326 if (__copy_from_user(&fpregs, &uc->uc_mcontext.fpregs,
288 sizeof(fpregs))) 327 sizeof(fpregs)))
289 goto out; 328 goto out;
290 __asm__ volatile (".chip 68k/68881\n\t" 329
291 "fmovemx %0,%%fp0-%%fp7\n\t" 330 if (CPU_IS_COLDFIRE) {
292 "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t" 331 __asm__ volatile ("fmovemd %0,%%fp0-%%fp7\n\t"
293 ".chip 68k" 332 "fmovel %1,%%fpcr\n\t"
294 : /* no outputs */ 333 "fmovel %2,%%fpsr\n\t"
295 : "m" (*fpregs.f_fpregs), 334 "fmovel %3,%%fpiar"
296 "m" (*fpregs.f_fpcntl)); 335 : /* no outputs */
336 : "m" (fpregs.f_fpregs[0]),
337 "m" (fpregs.f_fpcntl[0]),
338 "m" (fpregs.f_fpcntl[1]),
339 "m" (fpregs.f_fpcntl[2]));
340 } else {
341 __asm__ volatile (".chip 68k/68881\n\t"
342 "fmovemx %0,%%fp0-%%fp7\n\t"
343 "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t"
344 ".chip 68k"
345 : /* no outputs */
346 : "m" (*fpregs.f_fpregs),
347 "m" (*fpregs.f_fpcntl));
348 }
297 } 349 }
298 if (context_size && 350 if (context_size &&
299 __copy_from_user(fpstate + 4, (long __user *)&uc->uc_fpstate + 1, 351 __copy_from_user(fpstate + 4, (long __user *)&uc->uc_fpstate + 1,
300 context_size)) 352 context_size))
301 goto out; 353 goto out;
302 __asm__ volatile (".chip 68k/68881\n\t" 354
303 "frestore %0\n\t" 355 if (CPU_IS_COLDFIRE) {
304 ".chip 68k" : : "m" (*fpstate)); 356 __asm__ volatile ("frestore %0" : : "m" (*fpstate));
357 } else {
358 __asm__ volatile (".chip 68k/68881\n\t"
359 "frestore %0\n\t"
360 ".chip 68k"
361 : : "m" (*fpstate));
362 }
305 err = 0; 363 err = 0;
306 364
307out: 365out:
@@ -336,8 +394,12 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,
336 regs->format = formatvec >> 12; 394 regs->format = formatvec >> 12;
337 regs->vector = formatvec & 0xfff; 395 regs->vector = formatvec & 0xfff;
338#define frame_offset (sizeof(struct pt_regs)+sizeof(struct switch_stack)) 396#define frame_offset (sizeof(struct pt_regs)+sizeof(struct switch_stack))
339 __asm__ __volatile__ 397 __asm__ __volatile__ (
340 (" movel %0,%/a0\n\t" 398#ifdef CONFIG_COLDFIRE
399 " movel %0,%/sp\n\t"
400 " bra ret_from_signal\n"
401#else
402 " movel %0,%/a0\n\t"
341 " subl %1,%/a0\n\t" /* make room on stack */ 403 " subl %1,%/a0\n\t" /* make room on stack */
342 " movel %/a0,%/sp\n\t" /* set stack pointer */ 404 " movel %/a0,%/sp\n\t" /* set stack pointer */
343 /* move switch_stack and pt_regs */ 405 /* move switch_stack and pt_regs */
@@ -350,6 +412,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,
350 "2: movel %4@+,%/a0@+\n\t" 412 "2: movel %4@+,%/a0@+\n\t"
351 " dbra %1,2b\n\t" 413 " dbra %1,2b\n\t"
352 " bral ret_from_signal\n" 414 " bral ret_from_signal\n"
415#endif
353 : /* no outputs, it doesn't ever return */ 416 : /* no outputs, it doesn't ever return */
354 : "a" (sw), "d" (fsize), "d" (frame_offset/4-1), 417 : "a" (sw), "d" (fsize), "d" (frame_offset/4-1),
355 "n" (frame_offset), "a" (buf + fsize/4) 418 "n" (frame_offset), "a" (buf + fsize/4)
@@ -516,10 +579,15 @@ static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs)
516 return; 579 return;
517 } 580 }
518 581
519 __asm__ volatile (".chip 68k/68881\n\t" 582 if (CPU_IS_COLDFIRE) {
520 "fsave %0\n\t" 583 __asm__ volatile ("fsave %0"
521 ".chip 68k" 584 : : "m" (*sc->sc_fpstate) : "memory");
522 : : "m" (*sc->sc_fpstate) : "memory"); 585 } else {
586 __asm__ volatile (".chip 68k/68881\n\t"
587 "fsave %0\n\t"
588 ".chip 68k"
589 : : "m" (*sc->sc_fpstate) : "memory");
590 }
523 591
524 if (CPU_IS_060 ? sc->sc_fpstate[2] : sc->sc_fpstate[0]) { 592 if (CPU_IS_060 ? sc->sc_fpstate[2] : sc->sc_fpstate[0]) {
525 fpu_version = sc->sc_fpstate[0]; 593 fpu_version = sc->sc_fpstate[0];
@@ -530,21 +598,35 @@ static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs)
530 if (*(unsigned short *) sc->sc_fpstate == 0x1f38) 598 if (*(unsigned short *) sc->sc_fpstate == 0x1f38)
531 sc->sc_fpstate[0x38] |= 1 << 3; 599 sc->sc_fpstate[0x38] |= 1 << 3;
532 } 600 }
533 __asm__ volatile (".chip 68k/68881\n\t" 601
534 "fmovemx %%fp0-%%fp1,%0\n\t" 602 if (CPU_IS_COLDFIRE) {
535 "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t" 603 __asm__ volatile ("fmovemd %%fp0-%%fp1,%0\n\t"
536 ".chip 68k" 604 "fmovel %%fpcr,%1\n\t"
537 : "=m" (*sc->sc_fpregs), 605 "fmovel %%fpsr,%2\n\t"
538 "=m" (*sc->sc_fpcntl) 606 "fmovel %%fpiar,%3"
539 : /* no inputs */ 607 : "=m" (sc->sc_fpregs[0]),
540 : "memory"); 608 "=m" (sc->sc_fpcntl[0]),
609 "=m" (sc->sc_fpcntl[1]),
610 "=m" (sc->sc_fpcntl[2])
611 : /* no inputs */
612 : "memory");
613 } else {
614 __asm__ volatile (".chip 68k/68881\n\t"
615 "fmovemx %%fp0-%%fp1,%0\n\t"
616 "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t"
617 ".chip 68k"
618 : "=m" (*sc->sc_fpregs),
619 "=m" (*sc->sc_fpcntl)
620 : /* no inputs */
621 : "memory");
622 }
541 } 623 }
542} 624}
543 625
544static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *regs) 626static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *regs)
545{ 627{
546 unsigned char fpstate[FPCONTEXT_SIZE]; 628 unsigned char fpstate[FPCONTEXT_SIZE];
547 int context_size = CPU_IS_060 ? 8 : 0; 629 int context_size = CPU_IS_060 ? 8 : (CPU_IS_COLDFIRE ? 12 : 0);
548 int err = 0; 630 int err = 0;
549 631
550 if (FPU_IS_EMU) { 632 if (FPU_IS_EMU) {
@@ -557,15 +639,19 @@ static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *
557 return err; 639 return err;
558 } 640 }
559 641
560 __asm__ volatile (".chip 68k/68881\n\t" 642 if (CPU_IS_COLDFIRE) {
561 "fsave %0\n\t" 643 __asm__ volatile ("fsave %0" : : "m" (*fpstate) : "memory");
562 ".chip 68k" 644 } else {
563 : : "m" (*fpstate) : "memory"); 645 __asm__ volatile (".chip 68k/68881\n\t"
646 "fsave %0\n\t"
647 ".chip 68k"
648 : : "m" (*fpstate) : "memory");
649 }
564 650
565 err |= __put_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate); 651 err |= __put_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate);
566 if (CPU_IS_060 ? fpstate[2] : fpstate[0]) { 652 if (CPU_IS_060 ? fpstate[2] : fpstate[0]) {
567 fpregset_t fpregs; 653 fpregset_t fpregs;
568 if (!CPU_IS_060) 654 if (!(CPU_IS_060 || CPU_IS_COLDFIRE))
569 context_size = fpstate[1]; 655 context_size = fpstate[1];
570 fpu_version = fpstate[0]; 656 fpu_version = fpstate[0];
571 if (CPU_IS_020_OR_030 && 657 if (CPU_IS_020_OR_030 &&
@@ -575,14 +661,27 @@ static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *
575 if (*(unsigned short *) fpstate == 0x1f38) 661 if (*(unsigned short *) fpstate == 0x1f38)
576 fpstate[0x38] |= 1 << 3; 662 fpstate[0x38] |= 1 << 3;
577 } 663 }
578 __asm__ volatile (".chip 68k/68881\n\t" 664 if (CPU_IS_COLDFIRE) {
579 "fmovemx %%fp0-%%fp7,%0\n\t" 665 __asm__ volatile ("fmovemd %%fp0-%%fp7,%0\n\t"
580 "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t" 666 "fmovel %%fpcr,%1\n\t"
581 ".chip 68k" 667 "fmovel %%fpsr,%2\n\t"
582 : "=m" (*fpregs.f_fpregs), 668 "fmovel %%fpiar,%3"
583 "=m" (*fpregs.f_fpcntl) 669 : "=m" (fpregs.f_fpregs[0]),
584 : /* no inputs */ 670 "=m" (fpregs.f_fpcntl[0]),
585 : "memory"); 671 "=m" (fpregs.f_fpcntl[1]),
672 "=m" (fpregs.f_fpcntl[2])
673 : /* no inputs */
674 : "memory");
675 } else {
676 __asm__ volatile (".chip 68k/68881\n\t"
677 "fmovemx %%fp0-%%fp7,%0\n\t"
678 "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t"
679 ".chip 68k"
680 : "=m" (*fpregs.f_fpregs),
681 "=m" (*fpregs.f_fpcntl)
682 : /* no inputs */
683 : "memory");
684 }
586 err |= copy_to_user(&uc->uc_mcontext.fpregs, &fpregs, 685 err |= copy_to_user(&uc->uc_mcontext.fpregs, &fpregs,
587 sizeof(fpregs)); 686 sizeof(fpregs));
588 } 687 }
@@ -679,8 +778,7 @@ static inline void push_cache (unsigned long vaddr)
679 "cpushl %%bc,(%0)\n\t" 778 "cpushl %%bc,(%0)\n\t"
680 ".chip 68k" 779 ".chip 68k"
681 : : "a" (temp)); 780 : : "a" (temp));
682 } 781 } else if (!CPU_IS_COLDFIRE) {
683 else {
684 /* 782 /*
685 * 68030/68020 have no writeback cache; 783 * 68030/68020 have no writeback cache;
686 * still need to clear icache. 784 * still need to clear icache.
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S
index c468f2edaa85..ce827b376110 100644
--- a/arch/m68k/kernel/syscalltable.S
+++ b/arch/m68k/kernel/syscalltable.S
@@ -365,4 +365,6 @@ ENTRY(sys_call_table)
365 .long sys_clock_adjtime 365 .long sys_clock_adjtime
366 .long sys_syncfs 366 .long sys_syncfs
367 .long sys_setns 367 .long sys_setns
368 .long sys_process_vm_readv /* 345 */
369 .long sys_process_vm_writev
368 370
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index a5cf40c26de5..75ab79b3bdeb 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -1,4 +1,4 @@
1#ifdef CONFIG_MMU 1#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)
2#include "time_mm.c" 2#include "time_mm.c"
3#else 3#else
4#include "time_no.c" 4#include "time_no.c"
diff --git a/arch/m68k/kernel/time_no.c b/arch/m68k/kernel/time_no.c
index 6623909f70e6..3ef0f7768dcd 100644
--- a/arch/m68k/kernel/time_no.c
+++ b/arch/m68k/kernel/time_no.c
@@ -26,6 +26,9 @@
26 26
27#define TICK_SIZE (tick_nsec / 1000) 27#define TICK_SIZE (tick_nsec / 1000)
28 28
29/* machine dependent timer functions */
30void (*mach_gettod)(int*, int*, int*, int*, int*, int*);
31
29static inline int set_rtc_mmss(unsigned long nowtime) 32static inline int set_rtc_mmss(unsigned long nowtime)
30{ 33{
31 if (mach_set_clock_mmss) 34 if (mach_set_clock_mmss)
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 89362f2bb56a..a76452ca964e 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -706,6 +706,88 @@ create_atc_entry:
706#endif /* CPU_M68020_OR_M68030 */ 706#endif /* CPU_M68020_OR_M68030 */
707#endif /* !CONFIG_SUN3 */ 707#endif /* !CONFIG_SUN3 */
708 708
709#if defined(CONFIG_COLDFIRE) && defined(CONFIG_MMU)
710#include <asm/mcfmmu.h>
711
712/*
713 * The following table converts the FS encoding of a ColdFire
714 * exception stack frame into the error_code value needed by
715 * do_fault.
716*/
717static const unsigned char fs_err_code[] = {
718 0, /* 0000 */
719 0, /* 0001 */
720 0, /* 0010 */
721 0, /* 0011 */
722 1, /* 0100 */
723 0, /* 0101 */
724 0, /* 0110 */
725 0, /* 0111 */
726 2, /* 1000 */
727 3, /* 1001 */
728 2, /* 1010 */
729 0, /* 1011 */
730 1, /* 1100 */
731 1, /* 1101 */
732 0, /* 1110 */
733 0 /* 1111 */
734};
735
736static inline void access_errorcf(unsigned int fs, struct frame *fp)
737{
738 unsigned long mmusr, addr;
739 unsigned int err_code;
740 int need_page_fault;
741
742 mmusr = mmu_read(MMUSR);
743 addr = mmu_read(MMUAR);
744
745 /*
746 * error_code:
747 * bit 0 == 0 means no page found, 1 means protection fault
748 * bit 1 == 0 means read, 1 means write
749 */
750 switch (fs) {
751 case 5: /* 0101 TLB opword X miss */
752 need_page_fault = cf_tlb_miss(&fp->ptregs, 0, 0, 0);
753 addr = fp->ptregs.pc;
754 break;
755 case 6: /* 0110 TLB extension word X miss */
756 need_page_fault = cf_tlb_miss(&fp->ptregs, 0, 0, 1);
757 addr = fp->ptregs.pc + sizeof(long);
758 break;
759 case 10: /* 1010 TLB W miss */
760 need_page_fault = cf_tlb_miss(&fp->ptregs, 1, 1, 0);
761 break;
762 case 14: /* 1110 TLB R miss */
763 need_page_fault = cf_tlb_miss(&fp->ptregs, 0, 1, 0);
764 break;
765 default:
766 /* 0000 Normal */
767 /* 0001 Reserved */
768 /* 0010 Interrupt during debug service routine */
769 /* 0011 Reserved */
770 /* 0100 X Protection */
771 /* 0111 IFP in emulator mode */
772 /* 1000 W Protection*/
773 /* 1001 Write error*/
774 /* 1011 Reserved*/
775 /* 1100 R Protection*/
776 /* 1101 R Protection*/
777 /* 1111 OEP in emulator mode*/
778 need_page_fault = 1;
779 break;
780 }
781
782 if (need_page_fault) {
783 err_code = fs_err_code[fs];
784 if ((fs == 13) && (mmusr & MMUSR_WF)) /* rd-mod-wr access */
785 err_code |= 2; /* bit1 - write, bit0 - protection */
786 do_page_fault(&fp->ptregs, addr, err_code);
787 }
788}
789#endif /* CONFIG_COLDFIRE CONFIG_MMU */
790
709asmlinkage void buserr_c(struct frame *fp) 791asmlinkage void buserr_c(struct frame *fp)
710{ 792{
711 /* Only set esp0 if coming from user mode */ 793 /* Only set esp0 if coming from user mode */
@@ -716,6 +798,28 @@ asmlinkage void buserr_c(struct frame *fp)
716 printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format); 798 printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format);
717#endif 799#endif
718 800
801#if defined(CONFIG_COLDFIRE) && defined(CONFIG_MMU)
802 if (CPU_IS_COLDFIRE) {
803 unsigned int fs;
804 fs = (fp->ptregs.vector & 0x3) |
805 ((fp->ptregs.vector & 0xc00) >> 8);
806 switch (fs) {
807 case 0x5:
808 case 0x6:
809 case 0x7:
810 case 0x9:
811 case 0xa:
812 case 0xd:
813 case 0xe:
814 case 0xf:
815 access_errorcf(fs, fp);
816 return;
817 default:
818 break;
819 }
820 }
821#endif /* CONFIG_COLDFIRE && CONFIG_MMU */
822
719 switch (fp->ptregs.format) { 823 switch (fp->ptregs.format) {
720#if defined (CONFIG_M68060) 824#if defined (CONFIG_M68060)
721 case 4: /* 68060 access error */ 825 case 4: /* 68060 access error */
diff --git a/arch/m68k/kernel/vmlinux.lds_no.S b/arch/m68k/kernel/vmlinux-nommu.lds
index 4e2389340837..8e66ccb0935e 100644
--- a/arch/m68k/kernel/vmlinux.lds_no.S
+++ b/arch/m68k/kernel/vmlinux-nommu.lds
@@ -69,6 +69,7 @@ SECTIONS {
69 SCHED_TEXT 69 SCHED_TEXT
70 LOCK_TEXT 70 LOCK_TEXT
71 *(.text..lock) 71 *(.text..lock)
72 *(.fixup)
72 73
73 . = ALIGN(16); /* Exception table */ 74 . = ALIGN(16); /* Exception table */
74 __start___ex_table = .; 75 __start___ex_table = .;
@@ -161,6 +162,13 @@ SECTIONS {
161 _edata = . ; 162 _edata = . ;
162 } > DATA 163 } > DATA
163 164
165 .m68k_fixup : {
166 __start_fixup = .;
167 *(.m68k_fixup)
168 __stop_fixup = .;
169 } > DATA
170 NOTES > DATA
171
164 .init.text : { 172 .init.text : {
165 . = ALIGN(PAGE_SIZE); 173 . = ALIGN(PAGE_SIZE);
166 __init_begin = .; 174 __init_begin = .;
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index d0993594f558..63407c836826 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -31,7 +31,9 @@ SECTIONS
31 31
32 RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) 32 RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
33 33
34 _sbss = .;
34 BSS_SECTION(0, 0, 0) 35 BSS_SECTION(0, 0, 0)
36 _ebss = .;
35 37
36 _edata = .; /* End of data section */ 38 _edata = .; /* End of data section */
37 39
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 8080469ee6c1..ad0f46d64c0b 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -44,7 +44,9 @@ __init_begin = .;
44 . = ALIGN(PAGE_SIZE); 44 . = ALIGN(PAGE_SIZE);
45 __init_end = .; 45 __init_end = .;
46 46
47 _sbss = .;
47 BSS_SECTION(0, 0, 0) 48 BSS_SECTION(0, 0, 0)
49 _ebss = .;
48 50
49 _end = . ; 51 _end = . ;
50 52
diff --git a/arch/m68k/kernel/vmlinux.lds.S b/arch/m68k/kernel/vmlinux.lds.S
index 030dabf0bc53..69ec79638870 100644
--- a/arch/m68k/kernel/vmlinux.lds.S
+++ b/arch/m68k/kernel/vmlinux.lds.S
@@ -1,5 +1,14 @@
1#ifdef CONFIG_MMU 1#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)
2#include "vmlinux.lds_mm.S" 2PHDRS
3{
4 text PT_LOAD FILEHDR PHDRS FLAGS (7);
5 data PT_LOAD FLAGS (7);
6}
7#ifdef CONFIG_SUN3
8#include "vmlinux-sun3.lds"
3#else 9#else
4#include "vmlinux.lds_no.S" 10#include "vmlinux-std.lds"
11#endif
12#else
13#include "vmlinux-nommu.lds"
5#endif 14#endif
diff --git a/arch/m68k/kernel/vmlinux.lds_mm.S b/arch/m68k/kernel/vmlinux.lds_mm.S
deleted file mode 100644
index 99ba315bd0a8..000000000000
--- a/arch/m68k/kernel/vmlinux.lds_mm.S
+++ /dev/null
@@ -1,10 +0,0 @@
1PHDRS
2{
3 text PT_LOAD FILEHDR PHDRS FLAGS (7);
4 data PT_LOAD FLAGS (7);
5}
6#ifdef CONFIG_SUN3
7#include "vmlinux-sun3.lds"
8#else
9#include "vmlinux-std.lds"
10#endif
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index 1a1bd9067e90..a9d782d34276 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -6,9 +6,11 @@
6lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ 6lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
7 memcpy.o memset.o memmove.o 7 memcpy.o memset.o memmove.o
8 8
9ifdef CONFIG_MMU 9lib-$(CONFIG_MMU) += string.o uaccess.o
10lib-y += string.o uaccess.o checksum_mm.o 10lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += mulsi3.o divsi3.o udivsi3.o
11else 11lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += modsi3.o umodsi3.o
12lib-y += mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o checksum_no.o 12
13ifndef CONFIG_GENERIC_CSUM
14lib-y += checksum.o
13endif 15endif
14 16
diff --git a/arch/m68k/lib/checksum_mm.c b/arch/m68k/lib/checksum.c
index 6216f12a756b..6216f12a756b 100644
--- a/arch/m68k/lib/checksum_mm.c
+++ b/arch/m68k/lib/checksum.c
diff --git a/arch/m68k/lib/checksum_no.c b/arch/m68k/lib/checksum_no.c
deleted file mode 100644
index e4c6354da765..000000000000
--- a/arch/m68k/lib/checksum_no.c
+++ /dev/null
@@ -1,156 +0,0 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * IP/TCP/UDP checksumming routines
7 *
8 * Authors: Jorge Cwik, <jorge@laser.satlink.net>
9 * Arnt Gulbrandsen, <agulbra@nvg.unit.no>
10 * Tom May, <ftom@netcom.com>
11 * Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>
12 * Lots of code moved from tcp.c and ip.c; see those files
13 * for more names.
14 *
15 * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek:
16 * Fixed some nasty bugs, causing some horrible crashes.
17 * A: At some points, the sum (%0) was used as
18 * length-counter instead of the length counter
19 * (%1). Thanks to Roman Hodek for pointing this out.
20 * B: GCC seems to mess up if one uses too many
21 * data-registers to hold input values and one tries to
22 * specify d0 and d1 as scratch registers. Letting gcc choose these
23 * registers itself solves the problem.
24 *
25 * This program is free software; you can redistribute it and/or
26 * modify it under the terms of the GNU General Public License
27 * as published by the Free Software Foundation; either version
28 * 2 of the License, or (at your option) any later version.
29 */
30
31/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access kills, so most
32 of the assembly has to go. */
33
34#include <linux/module.h>
35#include <net/checksum.h>
36
37static inline unsigned short from32to16(unsigned long x)
38{
39 /* add up 16-bit and 16-bit for 16+c bit */
40 x = (x & 0xffff) + (x >> 16);
41 /* add up carry.. */
42 x = (x & 0xffff) + (x >> 16);
43 return x;
44}
45
46static unsigned long do_csum(const unsigned char * buff, int len)
47{
48 int odd, count;
49 unsigned long result = 0;
50
51 if (len <= 0)
52 goto out;
53 odd = 1 & (unsigned long) buff;
54 if (odd) {
55 result = *buff;
56 len--;
57 buff++;
58 }
59 count = len >> 1; /* nr of 16-bit words.. */
60 if (count) {
61 if (2 & (unsigned long) buff) {
62 result += *(unsigned short *) buff;
63 count--;
64 len -= 2;
65 buff += 2;
66 }
67 count >>= 1; /* nr of 32-bit words.. */
68 if (count) {
69 unsigned long carry = 0;
70 do {
71 unsigned long w = *(unsigned long *) buff;
72 count--;
73 buff += 4;
74 result += carry;
75 result += w;
76 carry = (w > result);
77 } while (count);
78 result += carry;
79 result = (result & 0xffff) + (result >> 16);
80 }
81 if (len & 2) {
82 result += *(unsigned short *) buff;
83 buff += 2;
84 }
85 }
86 if (len & 1)
87 result += (*buff << 8);
88 result = from32to16(result);
89 if (odd)
90 result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
91out:
92 return result;
93}
94
95#ifdef CONFIG_COLDFIRE
96/*
97 * This is a version of ip_compute_csum() optimized for IP headers,
98 * which always checksum on 4 octet boundaries.
99 */
100__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
101{
102 return (__force __sum16)~do_csum(iph,ihl*4);
103}
104EXPORT_SYMBOL(ip_fast_csum);
105#endif
106
107/*
108 * computes the checksum of a memory block at buff, length len,
109 * and adds in "sum" (32-bit)
110 *
111 * returns a 32-bit number suitable for feeding into itself
112 * or csum_tcpudp_magic
113 *
114 * this function must be called with even lengths, except
115 * for the last fragment, which may be odd
116 *
117 * it's best to have buff aligned on a 32-bit boundary
118 */
119__wsum csum_partial(const void *buff, int len, __wsum sum)
120{
121 unsigned int result = do_csum(buff, len);
122
123 /* add in old sum, and carry.. */
124 result += (__force u32)sum;
125 if ((__force u32)sum > result)
126 result += 1;
127 return (__force __wsum)result;
128}
129
130EXPORT_SYMBOL(csum_partial);
131
132/*
133 * copy from fs while checksumming, otherwise like csum_partial
134 */
135
136__wsum
137csum_partial_copy_from_user(const void __user *src, void *dst,
138 int len, __wsum sum, int *csum_err)
139{
140 if (csum_err) *csum_err = 0;
141 memcpy(dst, (__force const void *)src, len);
142 return csum_partial(dst, len, sum);
143}
144EXPORT_SYMBOL(csum_partial_copy_from_user);
145
146/*
147 * copy from ds while checksumming, otherwise like csum_partial
148 */
149
150__wsum
151csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
152{
153 memcpy(dst, src, len);
154 return csum_partial(dst, len, sum);
155}
156EXPORT_SYMBOL(csum_partial_copy_nocheck);
diff --git a/arch/m68k/lib/uaccess.c b/arch/m68k/lib/uaccess.c
index 13854ed8cd9a..5664386338da 100644
--- a/arch/m68k/lib/uaccess.c
+++ b/arch/m68k/lib/uaccess.c
@@ -15,17 +15,17 @@ unsigned long __generic_copy_from_user(void *to, const void __user *from,
15 asm volatile ("\n" 15 asm volatile ("\n"
16 " tst.l %0\n" 16 " tst.l %0\n"
17 " jeq 2f\n" 17 " jeq 2f\n"
18 "1: moves.l (%1)+,%3\n" 18 "1: "MOVES".l (%1)+,%3\n"
19 " move.l %3,(%2)+\n" 19 " move.l %3,(%2)+\n"
20 " subq.l #1,%0\n" 20 " subq.l #1,%0\n"
21 " jne 1b\n" 21 " jne 1b\n"
22 "2: btst #1,%5\n" 22 "2: btst #1,%5\n"
23 " jeq 4f\n" 23 " jeq 4f\n"
24 "3: moves.w (%1)+,%3\n" 24 "3: "MOVES".w (%1)+,%3\n"
25 " move.w %3,(%2)+\n" 25 " move.w %3,(%2)+\n"
26 "4: btst #0,%5\n" 26 "4: btst #0,%5\n"
27 " jeq 6f\n" 27 " jeq 6f\n"
28 "5: moves.b (%1)+,%3\n" 28 "5: "MOVES".b (%1)+,%3\n"
29 " move.b %3,(%2)+\n" 29 " move.b %3,(%2)+\n"
30 "6:\n" 30 "6:\n"
31 " .section .fixup,\"ax\"\n" 31 " .section .fixup,\"ax\"\n"
@@ -68,17 +68,17 @@ unsigned long __generic_copy_to_user(void __user *to, const void *from,
68 " tst.l %0\n" 68 " tst.l %0\n"
69 " jeq 4f\n" 69 " jeq 4f\n"
70 "1: move.l (%1)+,%3\n" 70 "1: move.l (%1)+,%3\n"
71 "2: moves.l %3,(%2)+\n" 71 "2: "MOVES".l %3,(%2)+\n"
72 "3: subq.l #1,%0\n" 72 "3: subq.l #1,%0\n"
73 " jne 1b\n" 73 " jne 1b\n"
74 "4: btst #1,%5\n" 74 "4: btst #1,%5\n"
75 " jeq 6f\n" 75 " jeq 6f\n"
76 " move.w (%1)+,%3\n" 76 " move.w (%1)+,%3\n"
77 "5: moves.w %3,(%2)+\n" 77 "5: "MOVES".w %3,(%2)+\n"
78 "6: btst #0,%5\n" 78 "6: btst #0,%5\n"
79 " jeq 8f\n" 79 " jeq 8f\n"
80 " move.b (%1)+,%3\n" 80 " move.b (%1)+,%3\n"
81 "7: moves.b %3,(%2)+\n" 81 "7: "MOVES".b %3,(%2)+\n"
82 "8:\n" 82 "8:\n"
83 " .section .fixup,\"ax\"\n" 83 " .section .fixup,\"ax\"\n"
84 " .even\n" 84 " .even\n"
@@ -115,7 +115,7 @@ long strncpy_from_user(char *dst, const char __user *src, long count)
115 return count; 115 return count;
116 116
117 asm volatile ("\n" 117 asm volatile ("\n"
118 "1: moves.b (%2)+,%4\n" 118 "1: "MOVES".b (%2)+,%4\n"
119 " move.b %4,(%1)+\n" 119 " move.b %4,(%1)+\n"
120 " jeq 2f\n" 120 " jeq 2f\n"
121 " subq.l #1,%3\n" 121 " subq.l #1,%3\n"
@@ -152,7 +152,7 @@ long strnlen_user(const char __user *src, long n)
152 asm volatile ("\n" 152 asm volatile ("\n"
153 "1: subq.l #1,%1\n" 153 "1: subq.l #1,%1\n"
154 " jmi 3f\n" 154 " jmi 3f\n"
155 "2: moves.b (%0)+,%2\n" 155 "2: "MOVES".b (%0)+,%2\n"
156 " tst.b %2\n" 156 " tst.b %2\n"
157 " jne 1b\n" 157 " jne 1b\n"
158 " jra 4f\n" 158 " jra 4f\n"
@@ -188,15 +188,15 @@ unsigned long __clear_user(void __user *to, unsigned long n)
188 asm volatile ("\n" 188 asm volatile ("\n"
189 " tst.l %0\n" 189 " tst.l %0\n"
190 " jeq 3f\n" 190 " jeq 3f\n"
191 "1: moves.l %2,(%1)+\n" 191 "1: "MOVES".l %2,(%1)+\n"
192 "2: subq.l #1,%0\n" 192 "2: subq.l #1,%0\n"
193 " jne 1b\n" 193 " jne 1b\n"
194 "3: btst #1,%4\n" 194 "3: btst #1,%4\n"
195 " jeq 5f\n" 195 " jeq 5f\n"
196 "4: moves.w %2,(%1)+\n" 196 "4: "MOVES".w %2,(%1)+\n"
197 "5: btst #0,%4\n" 197 "5: btst #0,%4\n"
198 " jeq 7f\n" 198 " jeq 7f\n"
199 "6: moves.b %2,(%1)\n" 199 "6: "MOVES".b %2,(%1)\n"
200 "7:\n" 200 "7:\n"
201 " .section .fixup,\"ax\"\n" 201 " .section .fixup,\"ax\"\n"
202 " .even\n" 202 " .even\n"
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index b403924a1cad..3fe0e43d44f6 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -8,13 +8,8 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/mm.h>
12#include <linux/delay.h>
13#include <linux/init.h>
14#include <linux/irq.h> 11#include <linux/irq.h>
15 12
16#include <asm/traps.h>
17#include <asm/bootinfo.h>
18#include <asm/macintosh.h> 13#include <asm/macintosh.h>
19#include <asm/macints.h> 14#include <asm/macints.h>
20#include <asm/mac_baboon.h> 15#include <asm/mac_baboon.h>
@@ -23,7 +18,6 @@
23 18
24int baboon_present; 19int baboon_present;
25static volatile struct baboon *baboon; 20static volatile struct baboon *baboon;
26static unsigned char baboon_disabled;
27 21
28#if 0 22#if 0
29extern int macide_ack_intr(struct ata_channel *); 23extern int macide_ack_intr(struct ata_channel *);
@@ -89,51 +83,32 @@ static void baboon_irq(unsigned int irq, struct irq_desc *desc)
89 83
90void __init baboon_register_interrupts(void) 84void __init baboon_register_interrupts(void)
91{ 85{
92 baboon_disabled = 0;
93 irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq); 86 irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq);
94} 87}
95 88
96/* 89/*
97 * The means for masking individual baboon interrupts remains a mystery, so 90 * The means for masking individual Baboon interrupts remains a mystery.
98 * enable the umbrella interrupt only when no baboon interrupt is disabled. 91 * However, since we only use the IDE IRQ, we can just enable/disable all
92 * Baboon interrupts. If/when we handle more than one Baboon IRQ, we must
93 * either figure out how to mask them individually or else implement the
94 * same workaround that's used for NuBus slots (see nubus_disabled and
95 * via_nubus_irq_shutdown).
99 */ 96 */
100 97
101void baboon_irq_enable(int irq) 98void baboon_irq_enable(int irq)
102{ 99{
103 int irq_idx = IRQ_IDX(irq);
104
105#ifdef DEBUG_IRQUSE 100#ifdef DEBUG_IRQUSE
106 printk("baboon_irq_enable(%d)\n", irq); 101 printk("baboon_irq_enable(%d)\n", irq);
107#endif 102#endif
108 103
109 baboon_disabled &= ~(1 << irq_idx); 104 mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
110 if (!baboon_disabled)
111 mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
112} 105}
113 106
114void baboon_irq_disable(int irq) 107void baboon_irq_disable(int irq)
115{ 108{
116 int irq_idx = IRQ_IDX(irq);
117
118#ifdef DEBUG_IRQUSE 109#ifdef DEBUG_IRQUSE
119 printk("baboon_irq_disable(%d)\n", irq); 110 printk("baboon_irq_disable(%d)\n", irq);
120#endif 111#endif
121 112
122 baboon_disabled |= 1 << irq_idx; 113 mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
123 if (baboon_disabled)
124 mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
125}
126
127void baboon_irq_clear(int irq)
128{
129 int irq_idx = IRQ_IDX(irq);
130
131 baboon->mb_ifr &= ~(1 << irq_idx);
132}
133
134int baboon_irq_pending(int irq)
135{
136 int irq_idx = IRQ_IDX(irq);
137
138 return baboon->mb_ifr & (1 << irq_idx);
139} 114}
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index c247de02bc7e..f60ff5f59205 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -71,6 +71,31 @@ static void mac_get_model(char *str);
71static void mac_identify(void); 71static void mac_identify(void);
72static void mac_report_hardware(void); 72static void mac_report_hardware(void);
73 73
74#ifdef CONFIG_EARLY_PRINTK
75asmlinkage void __init mac_early_print(const char *s, unsigned n);
76
77static void __init mac_early_cons_write(struct console *con,
78 const char *s, unsigned n)
79{
80 mac_early_print(s, n);
81}
82
83static struct console __initdata mac_early_cons = {
84 .name = "early",
85 .write = mac_early_cons_write,
86 .flags = CON_PRINTBUFFER | CON_BOOT,
87 .index = -1
88};
89
90int __init mac_unregister_early_cons(void)
91{
92 /* mac_early_print can't be used after init sections are discarded */
93 return unregister_console(&mac_early_cons);
94}
95
96late_initcall(mac_unregister_early_cons);
97#endif
98
74static void __init mac_sched_init(irq_handler_t vector) 99static void __init mac_sched_init(irq_handler_t vector)
75{ 100{
76 via_init_clock(vector); 101 via_init_clock(vector);
@@ -164,6 +189,10 @@ void __init config_mac(void)
164 mach_beep = mac_mksound; 189 mach_beep = mac_mksound;
165#endif 190#endif
166 191
192#ifdef CONFIG_EARLY_PRINTK
193 register_console(&mac_early_cons);
194#endif
195
167 /* 196 /*
168 * Determine hardware present 197 * Determine hardware present
169 */ 198 */
@@ -192,7 +221,7 @@ void __init config_mac(void)
192 * inaccurate, so look here if a new Mac model won't run. Example: if 221 * inaccurate, so look here if a new Mac model won't run. Example: if
193 * a Mac crashes immediately after the VIA1 registers have been dumped 222 * a Mac crashes immediately after the VIA1 registers have been dumped
194 * to the screen, it probably died attempting to read DirB on a RBV. 223 * to the screen, it probably died attempting to read DirB on a RBV.
195 * Meaning it should have MAC_VIA_IIci here :-) 224 * Meaning it should have MAC_VIA_IICI here :-)
196 */ 225 */
197 226
198struct mac_model *macintosh_config; 227struct mac_model *macintosh_config;
@@ -267,7 +296,7 @@ static struct mac_model mac_data_table[] = {
267 .ident = MAC_MODEL_IICI, 296 .ident = MAC_MODEL_IICI,
268 .name = "IIci", 297 .name = "IIci",
269 .adb_type = MAC_ADB_II, 298 .adb_type = MAC_ADB_II,
270 .via_type = MAC_VIA_IIci, 299 .via_type = MAC_VIA_IICI,
271 .scsi_type = MAC_SCSI_OLD, 300 .scsi_type = MAC_SCSI_OLD,
272 .scc_type = MAC_SCC_II, 301 .scc_type = MAC_SCC_II,
273 .nubus_type = MAC_NUBUS, 302 .nubus_type = MAC_NUBUS,
@@ -276,7 +305,7 @@ static struct mac_model mac_data_table[] = {
276 .ident = MAC_MODEL_IIFX, 305 .ident = MAC_MODEL_IIFX,
277 .name = "IIfx", 306 .name = "IIfx",
278 .adb_type = MAC_ADB_IOP, 307 .adb_type = MAC_ADB_IOP,
279 .via_type = MAC_VIA_IIci, 308 .via_type = MAC_VIA_IICI,
280 .scsi_type = MAC_SCSI_OLD, 309 .scsi_type = MAC_SCSI_OLD,
281 .scc_type = MAC_SCC_IOP, 310 .scc_type = MAC_SCC_IOP,
282 .nubus_type = MAC_NUBUS, 311 .nubus_type = MAC_NUBUS,
@@ -285,7 +314,7 @@ static struct mac_model mac_data_table[] = {
285 .ident = MAC_MODEL_IISI, 314 .ident = MAC_MODEL_IISI,
286 .name = "IIsi", 315 .name = "IIsi",
287 .adb_type = MAC_ADB_IISI, 316 .adb_type = MAC_ADB_IISI,
288 .via_type = MAC_VIA_IIci, 317 .via_type = MAC_VIA_IICI,
289 .scsi_type = MAC_SCSI_OLD, 318 .scsi_type = MAC_SCSI_OLD,
290 .scc_type = MAC_SCC_II, 319 .scc_type = MAC_SCC_II,
291 .nubus_type = MAC_NUBUS, 320 .nubus_type = MAC_NUBUS,
@@ -294,7 +323,7 @@ static struct mac_model mac_data_table[] = {
294 .ident = MAC_MODEL_IIVI, 323 .ident = MAC_MODEL_IIVI,
295 .name = "IIvi", 324 .name = "IIvi",
296 .adb_type = MAC_ADB_IISI, 325 .adb_type = MAC_ADB_IISI,
297 .via_type = MAC_VIA_IIci, 326 .via_type = MAC_VIA_IICI,
298 .scsi_type = MAC_SCSI_OLD, 327 .scsi_type = MAC_SCSI_OLD,
299 .scc_type = MAC_SCC_II, 328 .scc_type = MAC_SCC_II,
300 .nubus_type = MAC_NUBUS, 329 .nubus_type = MAC_NUBUS,
@@ -303,7 +332,7 @@ static struct mac_model mac_data_table[] = {
303 .ident = MAC_MODEL_IIVX, 332 .ident = MAC_MODEL_IIVX,
304 .name = "IIvx", 333 .name = "IIvx",
305 .adb_type = MAC_ADB_IISI, 334 .adb_type = MAC_ADB_IISI,
306 .via_type = MAC_VIA_IIci, 335 .via_type = MAC_VIA_IICI,
307 .scsi_type = MAC_SCSI_OLD, 336 .scsi_type = MAC_SCSI_OLD,
308 .scc_type = MAC_SCC_II, 337 .scc_type = MAC_SCC_II,
309 .nubus_type = MAC_NUBUS, 338 .nubus_type = MAC_NUBUS,
@@ -318,7 +347,7 @@ static struct mac_model mac_data_table[] = {
318 .ident = MAC_MODEL_CLII, 347 .ident = MAC_MODEL_CLII,
319 .name = "Classic II", 348 .name = "Classic II",
320 .adb_type = MAC_ADB_IISI, 349 .adb_type = MAC_ADB_IISI,
321 .via_type = MAC_VIA_IIci, 350 .via_type = MAC_VIA_IICI,
322 .scsi_type = MAC_SCSI_OLD, 351 .scsi_type = MAC_SCSI_OLD,
323 .scc_type = MAC_SCC_II, 352 .scc_type = MAC_SCC_II,
324 .nubus_type = MAC_NUBUS, 353 .nubus_type = MAC_NUBUS,
@@ -327,7 +356,7 @@ static struct mac_model mac_data_table[] = {
327 .ident = MAC_MODEL_CCL, 356 .ident = MAC_MODEL_CCL,
328 .name = "Color Classic", 357 .name = "Color Classic",
329 .adb_type = MAC_ADB_CUDA, 358 .adb_type = MAC_ADB_CUDA,
330 .via_type = MAC_VIA_IIci, 359 .via_type = MAC_VIA_IICI,
331 .scsi_type = MAC_SCSI_OLD, 360 .scsi_type = MAC_SCSI_OLD,
332 .scc_type = MAC_SCC_II, 361 .scc_type = MAC_SCC_II,
333 .nubus_type = MAC_NUBUS, 362 .nubus_type = MAC_NUBUS,
@@ -336,7 +365,7 @@ static struct mac_model mac_data_table[] = {
336 .ident = MAC_MODEL_CCLII, 365 .ident = MAC_MODEL_CCLII,
337 .name = "Color Classic II", 366 .name = "Color Classic II",
338 .adb_type = MAC_ADB_CUDA, 367 .adb_type = MAC_ADB_CUDA,
339 .via_type = MAC_VIA_IIci, 368 .via_type = MAC_VIA_IICI,
340 .scsi_type = MAC_SCSI_OLD, 369 .scsi_type = MAC_SCSI_OLD,
341 .scc_type = MAC_SCC_II, 370 .scc_type = MAC_SCC_II,
342 .nubus_type = MAC_NUBUS, 371 .nubus_type = MAC_NUBUS,
@@ -351,7 +380,7 @@ static struct mac_model mac_data_table[] = {
351 .ident = MAC_MODEL_LC, 380 .ident = MAC_MODEL_LC,
352 .name = "LC", 381 .name = "LC",
353 .adb_type = MAC_ADB_IISI, 382 .adb_type = MAC_ADB_IISI,
354 .via_type = MAC_VIA_IIci, 383 .via_type = MAC_VIA_IICI,
355 .scsi_type = MAC_SCSI_OLD, 384 .scsi_type = MAC_SCSI_OLD,
356 .scc_type = MAC_SCC_II, 385 .scc_type = MAC_SCC_II,
357 .nubus_type = MAC_NUBUS, 386 .nubus_type = MAC_NUBUS,
@@ -360,7 +389,7 @@ static struct mac_model mac_data_table[] = {
360 .ident = MAC_MODEL_LCII, 389 .ident = MAC_MODEL_LCII,
361 .name = "LC II", 390 .name = "LC II",
362 .adb_type = MAC_ADB_IISI, 391 .adb_type = MAC_ADB_IISI,
363 .via_type = MAC_VIA_IIci, 392 .via_type = MAC_VIA_IICI,
364 .scsi_type = MAC_SCSI_OLD, 393 .scsi_type = MAC_SCSI_OLD,
365 .scc_type = MAC_SCC_II, 394 .scc_type = MAC_SCC_II,
366 .nubus_type = MAC_NUBUS, 395 .nubus_type = MAC_NUBUS,
@@ -369,7 +398,7 @@ static struct mac_model mac_data_table[] = {
369 .ident = MAC_MODEL_LCIII, 398 .ident = MAC_MODEL_LCIII,
370 .name = "LC III", 399 .name = "LC III",
371 .adb_type = MAC_ADB_IISI, 400 .adb_type = MAC_ADB_IISI,
372 .via_type = MAC_VIA_IIci, 401 .via_type = MAC_VIA_IICI,
373 .scsi_type = MAC_SCSI_OLD, 402 .scsi_type = MAC_SCSI_OLD,
374 .scc_type = MAC_SCC_II, 403 .scc_type = MAC_SCC_II,
375 .nubus_type = MAC_NUBUS, 404 .nubus_type = MAC_NUBUS,
@@ -497,7 +526,7 @@ static struct mac_model mac_data_table[] = {
497 .ident = MAC_MODEL_P460, 526 .ident = MAC_MODEL_P460,
498 .name = "Performa 460", 527 .name = "Performa 460",
499 .adb_type = MAC_ADB_IISI, 528 .adb_type = MAC_ADB_IISI,
500 .via_type = MAC_VIA_IIci, 529 .via_type = MAC_VIA_IICI,
501 .scsi_type = MAC_SCSI_OLD, 530 .scsi_type = MAC_SCSI_OLD,
502 .scc_type = MAC_SCC_II, 531 .scc_type = MAC_SCC_II,
503 .nubus_type = MAC_NUBUS, 532 .nubus_type = MAC_NUBUS,
@@ -524,7 +553,7 @@ static struct mac_model mac_data_table[] = {
524 .ident = MAC_MODEL_P520, 553 .ident = MAC_MODEL_P520,
525 .name = "Performa 520", 554 .name = "Performa 520",
526 .adb_type = MAC_ADB_CUDA, 555 .adb_type = MAC_ADB_CUDA,
527 .via_type = MAC_VIA_IIci, 556 .via_type = MAC_VIA_IICI,
528 .scsi_type = MAC_SCSI_OLD, 557 .scsi_type = MAC_SCSI_OLD,
529 .scc_type = MAC_SCC_II, 558 .scc_type = MAC_SCC_II,
530 .nubus_type = MAC_NUBUS, 559 .nubus_type = MAC_NUBUS,
@@ -533,7 +562,7 @@ static struct mac_model mac_data_table[] = {
533 .ident = MAC_MODEL_P550, 562 .ident = MAC_MODEL_P550,
534 .name = "Performa 550", 563 .name = "Performa 550",
535 .adb_type = MAC_ADB_CUDA, 564 .adb_type = MAC_ADB_CUDA,
536 .via_type = MAC_VIA_IIci, 565 .via_type = MAC_VIA_IICI,
537 .scsi_type = MAC_SCSI_OLD, 566 .scsi_type = MAC_SCSI_OLD,
538 .scc_type = MAC_SCC_II, 567 .scc_type = MAC_SCC_II,
539 .nubus_type = MAC_NUBUS, 568 .nubus_type = MAC_NUBUS,
@@ -565,7 +594,7 @@ static struct mac_model mac_data_table[] = {
565 .ident = MAC_MODEL_TV, 594 .ident = MAC_MODEL_TV,
566 .name = "TV", 595 .name = "TV",
567 .adb_type = MAC_ADB_CUDA, 596 .adb_type = MAC_ADB_CUDA,
568 .via_type = MAC_VIA_QUADRA, 597 .via_type = MAC_VIA_IICI,
569 .scsi_type = MAC_SCSI_OLD, 598 .scsi_type = MAC_SCSI_OLD,
570 .scc_type = MAC_SCC_II, 599 .scc_type = MAC_SCC_II,
571 .nubus_type = MAC_NUBUS, 600 .nubus_type = MAC_NUBUS,
@@ -574,7 +603,7 @@ static struct mac_model mac_data_table[] = {
574 .ident = MAC_MODEL_P600, 603 .ident = MAC_MODEL_P600,
575 .name = "Performa 600", 604 .name = "Performa 600",
576 .adb_type = MAC_ADB_IISI, 605 .adb_type = MAC_ADB_IISI,
577 .via_type = MAC_VIA_IIci, 606 .via_type = MAC_VIA_IICI,
578 .scsi_type = MAC_SCSI_OLD, 607 .scsi_type = MAC_SCSI_OLD,
579 .scc_type = MAC_SCC_II, 608 .scc_type = MAC_SCC_II,
580 .nubus_type = MAC_NUBUS, 609 .nubus_type = MAC_NUBUS,
@@ -645,8 +674,8 @@ static struct mac_model mac_data_table[] = {
645 }, { 674 }, {
646 .ident = MAC_MODEL_PB150, 675 .ident = MAC_MODEL_PB150,
647 .name = "PowerBook 150", 676 .name = "PowerBook 150",
648 .adb_type = MAC_ADB_PB1, 677 .adb_type = MAC_ADB_PB2,
649 .via_type = MAC_VIA_IIci, 678 .via_type = MAC_VIA_IICI,
650 .scsi_type = MAC_SCSI_OLD, 679 .scsi_type = MAC_SCSI_OLD,
651 .ide_type = MAC_IDE_PB, 680 .ide_type = MAC_IDE_PB,
652 .scc_type = MAC_SCC_QUADRA, 681 .scc_type = MAC_SCC_QUADRA,
@@ -732,17 +761,13 @@ static struct mac_model mac_data_table[] = {
732 * PowerBook Duos are pretty much like normal PowerBooks 761 * PowerBook Duos are pretty much like normal PowerBooks
733 * All of these probably have onboard SONIC in the Dock which 762 * All of these probably have onboard SONIC in the Dock which
734 * means we'll have to probe for it eventually. 763 * means we'll have to probe for it eventually.
735 *
736 * Are these really MAC_VIA_IIci? The developer notes for the
737 * Duos show pretty much the same custom parts as in most of
738 * the other PowerBooks which would imply MAC_VIA_QUADRA.
739 */ 764 */
740 765
741 { 766 {
742 .ident = MAC_MODEL_PB210, 767 .ident = MAC_MODEL_PB210,
743 .name = "PowerBook Duo 210", 768 .name = "PowerBook Duo 210",
744 .adb_type = MAC_ADB_PB2, 769 .adb_type = MAC_ADB_PB2,
745 .via_type = MAC_VIA_IIci, 770 .via_type = MAC_VIA_IICI,
746 .scsi_type = MAC_SCSI_OLD, 771 .scsi_type = MAC_SCSI_OLD,
747 .scc_type = MAC_SCC_QUADRA, 772 .scc_type = MAC_SCC_QUADRA,
748 .nubus_type = MAC_NUBUS, 773 .nubus_type = MAC_NUBUS,
@@ -751,7 +776,7 @@ static struct mac_model mac_data_table[] = {
751 .ident = MAC_MODEL_PB230, 776 .ident = MAC_MODEL_PB230,
752 .name = "PowerBook Duo 230", 777 .name = "PowerBook Duo 230",
753 .adb_type = MAC_ADB_PB2, 778 .adb_type = MAC_ADB_PB2,
754 .via_type = MAC_VIA_IIci, 779 .via_type = MAC_VIA_IICI,
755 .scsi_type = MAC_SCSI_OLD, 780 .scsi_type = MAC_SCSI_OLD,
756 .scc_type = MAC_SCC_QUADRA, 781 .scc_type = MAC_SCC_QUADRA,
757 .nubus_type = MAC_NUBUS, 782 .nubus_type = MAC_NUBUS,
@@ -760,7 +785,7 @@ static struct mac_model mac_data_table[] = {
760 .ident = MAC_MODEL_PB250, 785 .ident = MAC_MODEL_PB250,
761 .name = "PowerBook Duo 250", 786 .name = "PowerBook Duo 250",
762 .adb_type = MAC_ADB_PB2, 787 .adb_type = MAC_ADB_PB2,
763 .via_type = MAC_VIA_IIci, 788 .via_type = MAC_VIA_IICI,
764 .scsi_type = MAC_SCSI_OLD, 789 .scsi_type = MAC_SCSI_OLD,
765 .scc_type = MAC_SCC_QUADRA, 790 .scc_type = MAC_SCC_QUADRA,
766 .nubus_type = MAC_NUBUS, 791 .nubus_type = MAC_NUBUS,
@@ -769,7 +794,7 @@ static struct mac_model mac_data_table[] = {
769 .ident = MAC_MODEL_PB270C, 794 .ident = MAC_MODEL_PB270C,
770 .name = "PowerBook Duo 270c", 795 .name = "PowerBook Duo 270c",
771 .adb_type = MAC_ADB_PB2, 796 .adb_type = MAC_ADB_PB2,
772 .via_type = MAC_VIA_IIci, 797 .via_type = MAC_VIA_IICI,
773 .scsi_type = MAC_SCSI_OLD, 798 .scsi_type = MAC_SCSI_OLD,
774 .scc_type = MAC_SCC_QUADRA, 799 .scc_type = MAC_SCC_QUADRA,
775 .nubus_type = MAC_NUBUS, 800 .nubus_type = MAC_NUBUS,
@@ -778,7 +803,7 @@ static struct mac_model mac_data_table[] = {
778 .ident = MAC_MODEL_PB280, 803 .ident = MAC_MODEL_PB280,
779 .name = "PowerBook Duo 280", 804 .name = "PowerBook Duo 280",
780 .adb_type = MAC_ADB_PB2, 805 .adb_type = MAC_ADB_PB2,
781 .via_type = MAC_VIA_IIci, 806 .via_type = MAC_VIA_IICI,
782 .scsi_type = MAC_SCSI_OLD, 807 .scsi_type = MAC_SCSI_OLD,
783 .scc_type = MAC_SCC_QUADRA, 808 .scc_type = MAC_SCC_QUADRA,
784 .nubus_type = MAC_NUBUS, 809 .nubus_type = MAC_NUBUS,
@@ -787,7 +812,7 @@ static struct mac_model mac_data_table[] = {
787 .ident = MAC_MODEL_PB280C, 812 .ident = MAC_MODEL_PB280C,
788 .name = "PowerBook Duo 280c", 813 .name = "PowerBook Duo 280c",
789 .adb_type = MAC_ADB_PB2, 814 .adb_type = MAC_ADB_PB2,
790 .via_type = MAC_VIA_IIci, 815 .via_type = MAC_VIA_IICI,
791 .scsi_type = MAC_SCSI_OLD, 816 .scsi_type = MAC_SCSI_OLD,
792 .scc_type = MAC_SCC_QUADRA, 817 .scc_type = MAC_SCC_QUADRA,
793 .nubus_type = MAC_NUBUS, 818 .nubus_type = MAC_NUBUS,
@@ -864,8 +889,14 @@ static void __init mac_identify(void)
864 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; 889 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
865 break; 890 break;
866 default: 891 default:
867 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; 892 /* On non-PSC machines, the serial ports share an IRQ. */
868 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; 893 if (macintosh_config->ident == MAC_MODEL_IIFX) {
894 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
895 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
896 } else {
897 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4;
898 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4;
899 }
869 break; 900 break;
870 } 901 }
871 902
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c
index a5462cc0bfd6..7d8d46127ad9 100644
--- a/arch/m68k/mac/iop.c
+++ b/arch/m68k/mac/iop.c
@@ -115,7 +115,6 @@
115#include <asm/macintosh.h> 115#include <asm/macintosh.h>
116#include <asm/macints.h> 116#include <asm/macints.h>
117#include <asm/mac_iop.h> 117#include <asm/mac_iop.h>
118#include <asm/mac_oss.h>
119 118
120/*#define DEBUG_IOP*/ 119/*#define DEBUG_IOP*/
121 120
@@ -149,8 +148,6 @@ static struct listener iop_listeners[NUM_IOPS][NUM_IOP_CHAN];
149 148
150irqreturn_t iop_ism_irq(int, void *); 149irqreturn_t iop_ism_irq(int, void *);
151 150
152extern void oss_irq_enable(int);
153
154/* 151/*
155 * Private access functions 152 * Private access functions
156 */ 153 */
@@ -304,11 +301,10 @@ void __init iop_init(void)
304void __init iop_register_interrupts(void) 301void __init iop_register_interrupts(void)
305{ 302{
306 if (iop_ism_present) { 303 if (iop_ism_present) {
307 if (oss_present) { 304 if (macintosh_config->ident == MAC_MODEL_IIFX) {
308 if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, 0, 305 if (request_irq(IRQ_MAC_ADB, iop_ism_irq, 0,
309 "ISM IOP", (void *)IOP_NUM_ISM)) 306 "ISM IOP", (void *)IOP_NUM_ISM))
310 pr_err("Couldn't register ISM IOP interrupt\n"); 307 pr_err("Couldn't register ISM IOP interrupt\n");
311 oss_irq_enable(IRQ_MAC_ADB);
312 } else { 308 } else {
313 if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP", 309 if (request_irq(IRQ_VIA2_0, iop_ism_irq, 0, "ISM IOP",
314 (void *)IOP_NUM_ISM)) 310 (void *)IOP_NUM_ISM))
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index ba220b70ab8c..5c1a6b2ff0af 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -26,10 +26,6 @@
26 * - slot 6: timer 1 (not on IIci) 26 * - slot 6: timer 1 (not on IIci)
27 * - slot 7: status of IRQ; signals 'any enabled int.' 27 * - slot 7: status of IRQ; signals 'any enabled int.'
28 * 28 *
29 * 2 - OSS (IIfx only?)
30 * - slot 0: SCSI interrupt
31 * - slot 1: Sound interrupt
32 *
33 * Levels 3-6 vary by machine type. For VIA or RBV Macintoshes: 29 * Levels 3-6 vary by machine type. For VIA or RBV Macintoshes:
34 * 30 *
35 * 3 - unused (?) 31 * 3 - unused (?)
@@ -42,21 +38,30 @@
42 * 38 *
43 * 6 - off switch (?) 39 * 6 - off switch (?)
44 * 40 *
45 * For OSS Macintoshes (IIfx only at this point): 41 * Machines with Quadra-like VIA hardware, except PSC and PMU machines, support
42 * an alternate interrupt mapping, as used by A/UX. It spreads ethernet and
43 * sound out to their own autovector IRQs and gives VIA1 a higher priority:
46 * 44 *
47 * 3 - Nubus interrupt 45 * 1 - unused (?)
48 * - slot 0: Slot $9
49 * - slot 1: Slot $A
50 * - slot 2: Slot $B
51 * - slot 3: Slot $C
52 * - slot 4: Slot $D
53 * - slot 5: Slot $E
54 * 46 *
55 * 4 - SCC IOP 47 * 3 - on-board SONIC
48 *
49 * 5 - Apple Sound Chip (ASC)
50 *
51 * 6 - VIA1
52 *
53 * For OSS Macintoshes (IIfx only), we apply an interrupt mapping similar to
54 * the Quadra (A/UX) mapping:
55 *
56 * 1 - ISM IOP (ADB)
56 * 57 *
57 * 5 - ISM IOP (ADB?) 58 * 2 - SCSI
58 * 59 *
59 * 6 - unused 60 * 3 - NuBus
61 *
62 * 4 - SCC IOP
63 *
64 * 6 - VIA1
60 * 65 *
61 * For PSC Macintoshes (660AV, 840AV): 66 * For PSC Macintoshes (660AV, 840AV):
62 * 67 *
@@ -100,88 +105,29 @@
100 * case. They're hidden behind the Nubus slot $C interrupt thus adding a 105 * case. They're hidden behind the Nubus slot $C interrupt thus adding a
101 * third layer of indirection. Why oh why did the Apple engineers do that? 106 * third layer of indirection. Why oh why did the Apple engineers do that?
102 * 107 *
103 * - We support "fast" and "slow" handlers, just like the Amiga port. The
104 * fast handlers are called first and with all interrupts disabled. They
105 * are expected to execute quickly (hence the name). The slow handlers are
106 * called last with interrupts enabled and the interrupt level restored.
107 * They must therefore be reentrant.
108 *
109 * TODO:
110 *
111 */ 108 */
112 109
113#include <linux/module.h>
114#include <linux/types.h> 110#include <linux/types.h>
115#include <linux/kernel.h> 111#include <linux/kernel.h>
116#include <linux/sched.h> 112#include <linux/sched.h>
117#include <linux/kernel_stat.h> 113#include <linux/interrupt.h>
118#include <linux/interrupt.h> /* for intr_count */ 114#include <linux/irq.h>
119#include <linux/delay.h> 115#include <linux/delay.h>
120#include <linux/seq_file.h>
121 116
122#include <asm/system.h>
123#include <asm/irq.h> 117#include <asm/irq.h>
124#include <asm/traps.h>
125#include <asm/bootinfo.h>
126#include <asm/macintosh.h> 118#include <asm/macintosh.h>
119#include <asm/macints.h>
127#include <asm/mac_via.h> 120#include <asm/mac_via.h>
128#include <asm/mac_psc.h> 121#include <asm/mac_psc.h>
122#include <asm/mac_oss.h>
123#include <asm/mac_iop.h>
124#include <asm/mac_baboon.h>
129#include <asm/hwtest.h> 125#include <asm/hwtest.h>
130#include <asm/errno.h>
131#include <asm/macints.h>
132#include <asm/irq_regs.h> 126#include <asm/irq_regs.h>
133#include <asm/mac_oss.h>
134 127
135#define SHUTUP_SONIC 128#define SHUTUP_SONIC
136 129
137/* 130/*
138 * VIA/RBV hooks
139 */
140
141extern void via_register_interrupts(void);
142extern void via_irq_enable(int);
143extern void via_irq_disable(int);
144extern void via_irq_clear(int);
145extern int via_irq_pending(int);
146
147/*
148 * OSS hooks
149 */
150
151extern void oss_register_interrupts(void);
152extern void oss_irq_enable(int);
153extern void oss_irq_disable(int);
154extern void oss_irq_clear(int);
155extern int oss_irq_pending(int);
156
157/*
158 * PSC hooks
159 */
160
161extern void psc_register_interrupts(void);
162extern void psc_irq_enable(int);
163extern void psc_irq_disable(int);
164extern void psc_irq_clear(int);
165extern int psc_irq_pending(int);
166
167/*
168 * IOP hooks
169 */
170
171extern void iop_register_interrupts(void);
172
173/*
174 * Baboon hooks
175 */
176
177extern int baboon_present;
178
179extern void baboon_register_interrupts(void);
180extern void baboon_irq_enable(int);
181extern void baboon_irq_disable(int);
182extern void baboon_irq_clear(int);
183
184/*
185 * console_loglevel determines NMI handler function 131 * console_loglevel determines NMI handler function
186 */ 132 */
187 133
@@ -190,10 +136,15 @@ irqreturn_t mac_debug_handler(int, void *);
190 136
191/* #define DEBUG_MACINTS */ 137/* #define DEBUG_MACINTS */
192 138
139static unsigned int mac_irq_startup(struct irq_data *);
140static void mac_irq_shutdown(struct irq_data *);
141
193static struct irq_chip mac_irq_chip = { 142static struct irq_chip mac_irq_chip = {
194 .name = "mac", 143 .name = "mac",
195 .irq_enable = mac_irq_enable, 144 .irq_enable = mac_irq_enable,
196 .irq_disable = mac_irq_disable, 145 .irq_disable = mac_irq_disable,
146 .irq_startup = mac_irq_startup,
147 .irq_shutdown = mac_irq_shutdown,
197}; 148};
198 149
199void __init mac_init_IRQ(void) 150void __init mac_init_IRQ(void)
@@ -239,8 +190,6 @@ void __init mac_init_IRQ(void)
239/* 190/*
240 * mac_irq_enable - enable an interrupt source 191 * mac_irq_enable - enable an interrupt source
241 * mac_irq_disable - disable an interrupt source 192 * mac_irq_disable - disable an interrupt source
242 * mac_clear_irq - clears a pending interrupt
243 * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending)
244 * 193 *
245 * These routines are just dispatchers to the VIA/OSS/PSC routines. 194 * These routines are just dispatchers to the VIA/OSS/PSC routines.
246 */ 195 */
@@ -252,8 +201,6 @@ void mac_irq_enable(struct irq_data *data)
252 201
253 switch(irq_src) { 202 switch(irq_src) {
254 case 1: 203 case 1:
255 via_irq_enable(irq);
256 break;
257 case 2: 204 case 2:
258 case 7: 205 case 7:
259 if (oss_present) 206 if (oss_present)
@@ -262,6 +209,7 @@ void mac_irq_enable(struct irq_data *data)
262 via_irq_enable(irq); 209 via_irq_enable(irq);
263 break; 210 break;
264 case 3: 211 case 3:
212 case 4:
265 case 5: 213 case 5:
266 case 6: 214 case 6:
267 if (psc_present) 215 if (psc_present)
@@ -269,10 +217,6 @@ void mac_irq_enable(struct irq_data *data)
269 else if (oss_present) 217 else if (oss_present)
270 oss_irq_enable(irq); 218 oss_irq_enable(irq);
271 break; 219 break;
272 case 4:
273 if (psc_present)
274 psc_irq_enable(irq);
275 break;
276 case 8: 220 case 8:
277 if (baboon_present) 221 if (baboon_present)
278 baboon_irq_enable(irq); 222 baboon_irq_enable(irq);
@@ -287,8 +231,6 @@ void mac_irq_disable(struct irq_data *data)
287 231
288 switch(irq_src) { 232 switch(irq_src) {
289 case 1: 233 case 1:
290 via_irq_disable(irq);
291 break;
292 case 2: 234 case 2:
293 case 7: 235 case 7:
294 if (oss_present) 236 if (oss_present)
@@ -297,6 +239,7 @@ void mac_irq_disable(struct irq_data *data)
297 via_irq_disable(irq); 239 via_irq_disable(irq);
298 break; 240 break;
299 case 3: 241 case 3:
242 case 4:
300 case 5: 243 case 5:
301 case 6: 244 case 6:
302 if (psc_present) 245 if (psc_present)
@@ -304,10 +247,6 @@ void mac_irq_disable(struct irq_data *data)
304 else if (oss_present) 247 else if (oss_present)
305 oss_irq_disable(irq); 248 oss_irq_disable(irq);
306 break; 249 break;
307 case 4:
308 if (psc_present)
309 psc_irq_disable(irq);
310 break;
311 case 8: 250 case 8:
312 if (baboon_present) 251 if (baboon_present)
313 baboon_irq_disable(irq); 252 baboon_irq_disable(irq);
@@ -315,65 +254,27 @@ void mac_irq_disable(struct irq_data *data)
315 } 254 }
316} 255}
317 256
318void mac_clear_irq(unsigned int irq) 257static unsigned int mac_irq_startup(struct irq_data *data)
319{ 258{
320 switch(IRQ_SRC(irq)) { 259 int irq = data->irq;
321 case 1: 260
322 via_irq_clear(irq); 261 if (IRQ_SRC(irq) == 7 && !oss_present)
323 break; 262 via_nubus_irq_startup(irq);
324 case 2: 263 else
325 case 7: 264 mac_irq_enable(data);
326 if (oss_present) 265
327 oss_irq_clear(irq); 266 return 0;
328 else
329 via_irq_clear(irq);
330 break;
331 case 3:
332 case 5:
333 case 6:
334 if (psc_present)
335 psc_irq_clear(irq);
336 else if (oss_present)
337 oss_irq_clear(irq);
338 break;
339 case 4:
340 if (psc_present)
341 psc_irq_clear(irq);
342 break;
343 case 8:
344 if (baboon_present)
345 baboon_irq_clear(irq);
346 break;
347 }
348} 267}
349 268
350int mac_irq_pending(unsigned int irq) 269static void mac_irq_shutdown(struct irq_data *data)
351{ 270{
352 switch(IRQ_SRC(irq)) { 271 int irq = data->irq;
353 case 1: 272
354 return via_irq_pending(irq); 273 if (IRQ_SRC(irq) == 7 && !oss_present)
355 case 2: 274 via_nubus_irq_shutdown(irq);
356 case 7: 275 else
357 if (oss_present) 276 mac_irq_disable(data);
358 return oss_irq_pending(irq);
359 else
360 return via_irq_pending(irq);
361 case 3:
362 case 5:
363 case 6:
364 if (psc_present)
365 return psc_irq_pending(irq);
366 else if (oss_present)
367 return oss_irq_pending(irq);
368 break;
369 case 4:
370 if (psc_present)
371 return psc_irq_pending(irq);
372 break;
373 }
374 return 0;
375} 277}
376EXPORT_SYMBOL(mac_irq_pending);
377 278
378static int num_debug[8]; 279static int num_debug[8];
379 280
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index a4c82dab9ff1..6c4c882c126e 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * OSS handling 2 * Operating System Services (OSS) chip handling
3 * Written by Joshua M. Thompson (funaho@jurai.org) 3 * Written by Joshua M. Thompson (funaho@jurai.org)
4 * 4 *
5 * 5 *
@@ -30,8 +30,6 @@
30int oss_present; 30int oss_present;
31volatile struct mac_oss *oss; 31volatile struct mac_oss *oss;
32 32
33extern void via1_irq(unsigned int irq, struct irq_desc *desc);
34
35/* 33/*
36 * Initialize the OSS 34 * Initialize the OSS
37 * 35 *
@@ -51,10 +49,8 @@ void __init oss_init(void)
51 /* do this by setting the source's interrupt level to zero. */ 49 /* do this by setting the source's interrupt level to zero. */
52 50
53 for (i = 0; i <= OSS_NUM_SOURCES; i++) { 51 for (i = 0; i <= OSS_NUM_SOURCES; i++) {
54 oss->irq_level[i] = OSS_IRQLEV_DISABLED; 52 oss->irq_level[i] = 0;
55 } 53 }
56 /* If we disable VIA1 here, we never really handle it... */
57 oss->irq_level[OSS_VIA1] = OSS_IRQLEV_VIA1;
58} 54}
59 55
60/* 56/*
@@ -66,17 +62,13 @@ void __init oss_nubus_init(void)
66} 62}
67 63
68/* 64/*
69 * Handle miscellaneous OSS interrupts. Right now that's just sound 65 * Handle miscellaneous OSS interrupts.
70 * and SCSI; everything else is routed to its own autovector IRQ.
71 */ 66 */
72 67
73static void oss_irq(unsigned int irq, struct irq_desc *desc) 68static void oss_irq(unsigned int irq, struct irq_desc *desc)
74{ 69{
75 int events; 70 int events = oss->irq_pending &
76 71 (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM);
77 events = oss->irq_pending & (OSS_IP_SOUND|OSS_IP_SCSI);
78 if (!events)
79 return;
80 72
81#ifdef DEBUG_IRQS 73#ifdef DEBUG_IRQS
82 if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) { 74 if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) {
@@ -84,16 +76,20 @@ static void oss_irq(unsigned int irq, struct irq_desc *desc)
84 (int) oss->irq_pending); 76 (int) oss->irq_pending);
85 } 77 }
86#endif 78#endif
87 /* FIXME: how do you clear a pending IRQ? */
88 79
89 if (events & OSS_IP_SOUND) { 80 if (events & OSS_IP_IOPSCC) {
90 oss->irq_pending &= ~OSS_IP_SOUND; 81 oss->irq_pending &= ~OSS_IP_IOPSCC;
91 /* FIXME: call sound handler */ 82 generic_handle_irq(IRQ_MAC_SCC);
92 } else if (events & OSS_IP_SCSI) { 83 }
84
85 if (events & OSS_IP_SCSI) {
93 oss->irq_pending &= ~OSS_IP_SCSI; 86 oss->irq_pending &= ~OSS_IP_SCSI;
94 generic_handle_irq(IRQ_MAC_SCSI); 87 generic_handle_irq(IRQ_MAC_SCSI);
95 } else { 88 }
96 /* FIXME: error check here? */ 89
90 if (events & OSS_IP_IOPISM) {
91 oss->irq_pending &= ~OSS_IP_IOPISM;
92 generic_handle_irq(IRQ_MAC_ADB);
97 } 93 }
98} 94}
99 95
@@ -132,14 +128,29 @@ static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc)
132 128
133/* 129/*
134 * Register the OSS and NuBus interrupt dispatchers. 130 * Register the OSS and NuBus interrupt dispatchers.
131 *
132 * This IRQ mapping is laid out with two things in mind: first, we try to keep
133 * things on their own levels to avoid having to do double-dispatches. Second,
134 * the levels match as closely as possible the alternate IRQ mapping mode (aka
135 * "A/UX mode") available on some VIA machines.
135 */ 136 */
136 137
138#define OSS_IRQLEV_IOPISM IRQ_AUTO_1
139#define OSS_IRQLEV_SCSI IRQ_AUTO_2
140#define OSS_IRQLEV_NUBUS IRQ_AUTO_3
141#define OSS_IRQLEV_IOPSCC IRQ_AUTO_4
142#define OSS_IRQLEV_VIA1 IRQ_AUTO_6
143
137void __init oss_register_interrupts(void) 144void __init oss_register_interrupts(void)
138{ 145{
139 irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq); 146 irq_set_chained_handler(OSS_IRQLEV_IOPISM, oss_irq);
140 irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq); 147 irq_set_chained_handler(OSS_IRQLEV_SCSI, oss_irq);
141 irq_set_chained_handler(OSS_IRQLEV_SOUND, oss_irq); 148 irq_set_chained_handler(OSS_IRQLEV_NUBUS, oss_nubus_irq);
142 irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_irq); 149 irq_set_chained_handler(OSS_IRQLEV_IOPSCC, oss_irq);
150 irq_set_chained_handler(OSS_IRQLEV_VIA1, via1_irq);
151
152 /* OSS_VIA1 gets enabled here because it has no machspec interrupt. */
153 oss->irq_level[OSS_VIA1] = IRQ_AUTO_6;
143} 154}
144 155
145/* 156/*
@@ -158,13 +169,13 @@ void oss_irq_enable(int irq) {
158 switch(irq) { 169 switch(irq) {
159 case IRQ_MAC_SCC: 170 case IRQ_MAC_SCC:
160 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; 171 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC;
161 break; 172 return;
162 case IRQ_MAC_ADB: 173 case IRQ_MAC_ADB:
163 oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_IOPISM; 174 oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_IOPISM;
164 break; 175 return;
165 case IRQ_MAC_SCSI: 176 case IRQ_MAC_SCSI:
166 oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI; 177 oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI;
167 break; 178 return;
168 case IRQ_NUBUS_9: 179 case IRQ_NUBUS_9:
169 case IRQ_NUBUS_A: 180 case IRQ_NUBUS_A:
170 case IRQ_NUBUS_B: 181 case IRQ_NUBUS_B:
@@ -173,13 +184,11 @@ void oss_irq_enable(int irq) {
173 case IRQ_NUBUS_E: 184 case IRQ_NUBUS_E:
174 irq -= NUBUS_SOURCE_BASE; 185 irq -= NUBUS_SOURCE_BASE;
175 oss->irq_level[irq] = OSS_IRQLEV_NUBUS; 186 oss->irq_level[irq] = OSS_IRQLEV_NUBUS;
176 break; 187 return;
177#ifdef DEBUG_IRQUSE
178 default:
179 printk("%s unknown irq %d\n", __func__, irq);
180 break;
181#endif
182 } 188 }
189
190 if (IRQ_SRC(irq) == 1)
191 via_irq_enable(irq);
183} 192}
184 193
185/* 194/*
@@ -195,50 +204,14 @@ void oss_irq_disable(int irq) {
195#endif 204#endif
196 switch(irq) { 205 switch(irq) {
197 case IRQ_MAC_SCC: 206 case IRQ_MAC_SCC:
198 oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; 207 oss->irq_level[OSS_IOPSCC] = 0;
199 break; 208 return;
200 case IRQ_MAC_ADB:
201 oss->irq_level[OSS_IOPISM] = OSS_IRQLEV_DISABLED;
202 break;
203 case IRQ_MAC_SCSI:
204 oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED;
205 break;
206 case IRQ_NUBUS_9:
207 case IRQ_NUBUS_A:
208 case IRQ_NUBUS_B:
209 case IRQ_NUBUS_C:
210 case IRQ_NUBUS_D:
211 case IRQ_NUBUS_E:
212 irq -= NUBUS_SOURCE_BASE;
213 oss->irq_level[irq] = OSS_IRQLEV_DISABLED;
214 break;
215#ifdef DEBUG_IRQUSE
216 default:
217 printk("%s unknown irq %d\n", __func__, irq);
218 break;
219#endif
220 }
221}
222
223/*
224 * Clear an OSS interrupt
225 *
226 * Not sure if this works or not but it's the only method I could
227 * think of based on the contents of the mac_oss structure.
228 */
229
230void oss_irq_clear(int irq) {
231 /* FIXME: how to do this on OSS? */
232 switch(irq) {
233 case IRQ_MAC_SCC:
234 oss->irq_pending &= ~OSS_IP_IOPSCC;
235 break;
236 case IRQ_MAC_ADB: 209 case IRQ_MAC_ADB:
237 oss->irq_pending &= ~OSS_IP_IOPISM; 210 oss->irq_level[OSS_IOPISM] = 0;
238 break; 211 return;
239 case IRQ_MAC_SCSI: 212 case IRQ_MAC_SCSI:
240 oss->irq_pending &= ~OSS_IP_SCSI; 213 oss->irq_level[OSS_SCSI] = 0;
241 break; 214 return;
242 case IRQ_NUBUS_9: 215 case IRQ_NUBUS_9:
243 case IRQ_NUBUS_A: 216 case IRQ_NUBUS_A:
244 case IRQ_NUBUS_B: 217 case IRQ_NUBUS_B:
@@ -246,36 +219,10 @@ void oss_irq_clear(int irq) {
246 case IRQ_NUBUS_D: 219 case IRQ_NUBUS_D:
247 case IRQ_NUBUS_E: 220 case IRQ_NUBUS_E:
248 irq -= NUBUS_SOURCE_BASE; 221 irq -= NUBUS_SOURCE_BASE;
249 oss->irq_pending &= ~(1 << irq); 222 oss->irq_level[irq] = 0;
250 break; 223 return;
251 } 224 }
252}
253
254/*
255 * Check to see if a specific OSS interrupt is pending
256 */
257 225
258int oss_irq_pending(int irq) 226 if (IRQ_SRC(irq) == 1)
259{ 227 via_irq_disable(irq);
260 switch(irq) {
261 case IRQ_MAC_SCC:
262 return oss->irq_pending & OSS_IP_IOPSCC;
263 break;
264 case IRQ_MAC_ADB:
265 return oss->irq_pending & OSS_IP_IOPISM;
266 break;
267 case IRQ_MAC_SCSI:
268 return oss->irq_pending & OSS_IP_SCSI;
269 break;
270 case IRQ_NUBUS_9:
271 case IRQ_NUBUS_A:
272 case IRQ_NUBUS_B:
273 case IRQ_NUBUS_C:
274 case IRQ_NUBUS_D:
275 case IRQ_NUBUS_E:
276 irq -= NUBUS_SOURCE_BASE;
277 return oss->irq_pending & (1 << irq);
278 break;
279 }
280 return 0;
281} 228}
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c
index e6c2d20f328d..6f026fc302fa 100644
--- a/arch/m68k/mac/psc.c
+++ b/arch/m68k/mac/psc.c
@@ -180,20 +180,3 @@ void psc_irq_disable(int irq) {
180#endif 180#endif
181 psc_write_byte(pIER, 1 << irq_idx); 181 psc_write_byte(pIER, 1 << irq_idx);
182} 182}
183
184void psc_irq_clear(int irq) {
185 int irq_src = IRQ_SRC(irq);
186 int irq_idx = IRQ_IDX(irq);
187 int pIFR = pIERbase + (irq_src << 4);
188
189 psc_write_byte(pIFR, 1 << irq_idx);
190}
191
192int psc_irq_pending(int irq)
193{
194 int irq_src = IRQ_SRC(irq);
195 int irq_idx = IRQ_IDX(irq);
196 int pIFR = pIERbase + (irq_src << 4);
197
198 return psc_read_byte(pIFR) & (1 << irq_idx);
199}
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index f1600ad26621..2d85662715fb 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -63,24 +63,50 @@ static int gIER,gIFR,gBufA,gBufB;
63#define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) 63#define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF)
64#define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) 64#define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8)
65 65
66/* To disable a NuBus slot on Quadras we make that slot IRQ line an output set 66
67 * high. On RBV we just use the slot interrupt enable register. On Macs with 67/*
68 * genuine VIA chips we must use nubus_disabled to keep track of disabled slot 68 * On Macs with a genuine VIA chip there is no way to mask an individual slot
69 * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1 69 * interrupt. This limitation also seems to apply to VIA clone logic cores in
70 * or "SLOTS" interrupt. When no slot is disabled, we unmask the CA1 interrupt. 70 * Quadra-like ASICs. (RBV and OSS machines don't have this limitation.)
71 * So, on genuine VIAs, having more than one NuBus IRQ can mean trouble, 71 *
72 * because closing one of those drivers can mask all of the NuBus interrupts. 72 * We used to fake it by configuring the relevent VIA pin as an output
73 * Also, since we can't mask the unregistered slot IRQs on genuine VIAs, it's 73 * (to mask the interrupt) or input (to unmask). That scheme did not work on
74 * possible to get interrupts from cards that MacOS or the ROM has configured 74 * (at least) the Quadra 700. A NuBus card's /NMRQ signal is an open-collector
75 * but we have not. FWIW, "Designing Cards and Drivers for Macintosh II and 75 * circuit (see Designing Cards and Drivers for Macintosh II and Macintosh SE,
76 * Macintosh SE", page 9-8, says, a slot IRQ with no driver would crash MacOS. 76 * p. 10-11 etc) but VIA outputs are not (see datasheet).
77 *
78 * Driving these outputs high must cause the VIA to source current and the
79 * card to sink current when it asserts /NMRQ. Current will flow but the pin
80 * voltage is uncertain and so the /NMRQ condition may still cause a transition
81 * at the VIA2 CA1 input (which explains the lost interrupts). A side effect
82 * is that a disabled slot IRQ can never be tested as pending or not.
83 *
84 * Driving these outputs low doesn't work either. All the slot /NMRQ lines are
85 * (active low) OR'd together to generate the CA1 (aka "SLOTS") interrupt (see
86 * The Guide To Macintosh Family Hardware, 2nd edition p. 167). If we drive a
87 * disabled /NMRQ line low, the falling edge immediately triggers a CA1
88 * interrupt and all slot interrupts after that will generate no transition
89 * and therefore no interrupt, even after being re-enabled.
90 *
91 * So we make the VIA port A I/O lines inputs and use nubus_disabled to keep
92 * track of their states. When any slot IRQ becomes disabled we mask the CA1
93 * umbrella interrupt. Only when all slot IRQs become enabled do we unmask
94 * the CA1 interrupt. It must remain enabled even when cards have no interrupt
95 * handler registered. Drivers must therefore disable a slot interrupt at the
96 * device before they call free_irq (like shared and autovector interrupts).
97 *
98 * There is also a related problem when MacOS is used to boot Linux. A network
99 * card brought up by a MacOS driver may raise an interrupt while Linux boots.
100 * This can be fatal since it can't be handled until the right driver loads
101 * (if such a driver exists at all). Apparently related to this hardware
102 * limitation, "Designing Cards and Drivers", p. 9-8, says that a slot
103 * interrupt with no driver would crash MacOS (the book was written before
104 * the appearance of Macs with RBV or OSS).
77 */ 105 */
106
78static u8 nubus_disabled; 107static u8 nubus_disabled;
79 108
80void via_debug_dump(void); 109void via_debug_dump(void);
81void via_irq_enable(int irq);
82void via_irq_disable(int irq);
83void via_irq_clear(int irq);
84 110
85/* 111/*
86 * Initialize the VIAs 112 * Initialize the VIAs
@@ -100,7 +126,7 @@ void __init via_init(void)
100 126
101 /* IIci, IIsi, IIvx, IIvi (P6xx), LC series */ 127 /* IIci, IIsi, IIvx, IIvi (P6xx), LC series */
102 128
103 case MAC_VIA_IIci: 129 case MAC_VIA_IICI:
104 via1 = (void *) VIA1_BASE; 130 via1 = (void *) VIA1_BASE;
105 if (macintosh_config->ident == MAC_MODEL_IIFX) { 131 if (macintosh_config->ident == MAC_MODEL_IIFX) {
106 via2 = NULL; 132 via2 = NULL;
@@ -197,38 +223,17 @@ void __init via_init(void)
197 if (oss_present) 223 if (oss_present)
198 return; 224 return;
199 225
200 /* Some machines support an alternate IRQ mapping that spreads */ 226 if ((macintosh_config->via_type == MAC_VIA_QUADRA) &&
201 /* Ethernet and Sound out to their own autolevel IRQs and moves */ 227 (macintosh_config->adb_type != MAC_ADB_PB1) &&
202 /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */ 228 (macintosh_config->adb_type != MAC_ADB_PB2) &&
203 /* that the IIfx emulates this alternate mapping using the OSS. */ 229 (macintosh_config->ident != MAC_MODEL_C660) &&
204 230 (macintosh_config->ident != MAC_MODEL_Q840)) {
205 via_alt_mapping = 0; 231 via_alt_mapping = 1;
206 if (macintosh_config->via_type == MAC_VIA_QUADRA) 232 via1[vDirB] |= 0x40;
207 switch (macintosh_config->ident) { 233 via1[vBufB] &= ~0x40;
208 case MAC_MODEL_C660: 234 } else {
209 case MAC_MODEL_Q840: 235 via_alt_mapping = 0;
210 /* not applicable */ 236 }
211 break;
212 case MAC_MODEL_P588:
213 case MAC_MODEL_TV:
214 case MAC_MODEL_PB140:
215 case MAC_MODEL_PB145:
216 case MAC_MODEL_PB160:
217 case MAC_MODEL_PB165:
218 case MAC_MODEL_PB165C:
219 case MAC_MODEL_PB170:
220 case MAC_MODEL_PB180:
221 case MAC_MODEL_PB180C:
222 case MAC_MODEL_PB190:
223 case MAC_MODEL_PB520:
224 /* not yet tested */
225 break;
226 default:
227 via_alt_mapping = 1;
228 via1[vDirB] |= 0x40;
229 via1[vBufB] &= ~0x40;
230 break;
231 }
232 237
233 /* 238 /*
234 * Now initialize VIA2. For RBV we just kill all interrupts; 239 * Now initialize VIA2. For RBV we just kill all interrupts;
@@ -248,22 +253,28 @@ void __init via_init(void)
248 via2[vACR] &= ~0x03; /* disable port A & B latches */ 253 via2[vACR] &= ~0x03; /* disable port A & B latches */
249 } 254 }
250 255
256 /* Everything below this point is VIA2 only... */
257
258 if (rbv_present)
259 return;
260
251 /* 261 /*
252 * Set vPCR for control line interrupts (but not on RBV) 262 * Set vPCR for control line interrupts.
263 *
264 * CA1 (SLOTS IRQ), CB1 (ASC IRQ): negative edge trigger.
265 *
266 * Macs with ESP SCSI have a negative edge triggered SCSI interrupt.
267 * Testing reveals that PowerBooks do too. However, the SE/30
268 * schematic diagram shows an active high NCR5380 IRQ line.
253 */ 269 */
254 if (!rbv_present) { 270
255 /* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ) 271 pr_debug("VIA2 vPCR is 0x%02X\n", via2[vPCR]);
256 * are made negative edge triggered here. 272 if (macintosh_config->via_type == MAC_VIA_II) {
257 */ 273 /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, pos. edge */
258 if (macintosh_config->scsi_type == MAC_SCSI_OLD) { 274 via2[vPCR] = 0x66;
259 /* CB2 (IRQ) indep. input, positive edge */ 275 } else {
260 /* CA2 (DRQ) indep. input, positive edge */ 276 /* CA2 (SCSI DRQ), CB2 (SCSI IRQ): indep. input, neg. edge */
261 via2[vPCR] = 0x66; 277 via2[vPCR] = 0x22;
262 } else {
263 /* CB2 (IRQ) indep. input, negative edge */
264 /* CA2 (DRQ) indep. input, negative edge */
265 via2[vPCR] = 0x22;
266 }
267 } 278 }
268} 279}
269 280
@@ -378,34 +389,55 @@ void __init via_nubus_init(void)
378 via2[gBufB] |= 0x02; 389 via2[gBufB] |= 0x02;
379 } 390 }
380 391
381 /* Disable all the slot interrupts (where possible). */ 392 /*
393 * Disable the slot interrupts. On some hardware that's not possible.
394 * On some hardware it's unclear what all of these I/O lines do.
395 */
382 396
383 switch (macintosh_config->via_type) { 397 switch (macintosh_config->via_type) {
384 case MAC_VIA_II: 398 case MAC_VIA_II:
385 /* Just make the port A lines inputs. */ 399 case MAC_VIA_QUADRA:
386 switch(macintosh_config->ident) { 400 pr_debug("VIA2 vDirA is 0x%02X\n", via2[vDirA]);
387 case MAC_MODEL_II:
388 case MAC_MODEL_IIX:
389 case MAC_MODEL_IICX:
390 case MAC_MODEL_SE30:
391 /* The top two bits are RAM size outputs. */
392 via2[vDirA] &= 0xC0;
393 break;
394 default:
395 via2[vDirA] &= 0x80;
396 }
397 break; 401 break;
398 case MAC_VIA_IIci: 402 case MAC_VIA_IICI:
399 /* RBV. Disable all the slot interrupts. SIER works like IER. */ 403 /* RBV. Disable all the slot interrupts. SIER works like IER. */
400 via2[rSIER] = 0x7F; 404 via2[rSIER] = 0x7F;
401 break; 405 break;
406 }
407}
408
409void via_nubus_irq_startup(int irq)
410{
411 int irq_idx = IRQ_IDX(irq);
412
413 switch (macintosh_config->via_type) {
414 case MAC_VIA_II:
402 case MAC_VIA_QUADRA: 415 case MAC_VIA_QUADRA:
403 /* Disable the inactive slot interrupts by making those lines outputs. */ 416 /* Make the port A line an input. Probably redundant. */
404 if ((macintosh_config->adb_type != MAC_ADB_PB1) && 417 if (macintosh_config->via_type == MAC_VIA_II) {
405 (macintosh_config->adb_type != MAC_ADB_PB2)) { 418 /* The top two bits are RAM size outputs. */
406 via2[vBufA] |= 0x7F; 419 via2[vDirA] &= 0xC0 | ~(1 << irq_idx);
407 via2[vDirA] |= 0x7F; 420 } else {
421 /* Allow NuBus slots 9 through F. */
422 via2[vDirA] &= 0x80 | ~(1 << irq_idx);
408 } 423 }
424 /* fall through */
425 case MAC_VIA_IICI:
426 via_irq_enable(irq);
427 break;
428 }
429}
430
431void via_nubus_irq_shutdown(int irq)
432{
433 switch (macintosh_config->via_type) {
434 case MAC_VIA_II:
435 case MAC_VIA_QUADRA:
436 /* Ensure that the umbrella CA1 interrupt remains enabled. */
437 via_irq_enable(irq);
438 break;
439 case MAC_VIA_IICI:
440 via_irq_disable(irq);
409 break; 441 break;
410 } 442 }
411} 443}
@@ -531,25 +563,18 @@ void via_irq_enable(int irq) {
531 } else if (irq_src == 7) { 563 } else if (irq_src == 7) {
532 switch (macintosh_config->via_type) { 564 switch (macintosh_config->via_type) {
533 case MAC_VIA_II: 565 case MAC_VIA_II:
566 case MAC_VIA_QUADRA:
534 nubus_disabled &= ~(1 << irq_idx); 567 nubus_disabled &= ~(1 << irq_idx);
535 /* Enable the CA1 interrupt when no slot is disabled. */ 568 /* Enable the CA1 interrupt when no slot is disabled. */
536 if (!nubus_disabled) 569 if (!nubus_disabled)
537 via2[gIER] = IER_SET_BIT(1); 570 via2[gIER] = IER_SET_BIT(1);
538 break; 571 break;
539 case MAC_VIA_IIci: 572 case MAC_VIA_IICI:
540 /* On RBV, enable the slot interrupt. 573 /* On RBV, enable the slot interrupt.
541 * SIER works like IER. 574 * SIER works like IER.
542 */ 575 */
543 via2[rSIER] = IER_SET_BIT(irq_idx); 576 via2[rSIER] = IER_SET_BIT(irq_idx);
544 break; 577 break;
545 case MAC_VIA_QUADRA:
546 /* Make the port A line an input to enable the slot irq.
547 * But not on PowerBooks, that's ADB.
548 */
549 if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
550 (macintosh_config->adb_type != MAC_ADB_PB2))
551 via2[vDirA] &= ~(1 << irq_idx);
552 break;
553 } 578 }
554 } 579 }
555} 580}
@@ -569,60 +594,18 @@ void via_irq_disable(int irq) {
569 } else if (irq_src == 7) { 594 } else if (irq_src == 7) {
570 switch (macintosh_config->via_type) { 595 switch (macintosh_config->via_type) {
571 case MAC_VIA_II: 596 case MAC_VIA_II:
597 case MAC_VIA_QUADRA:
572 nubus_disabled |= 1 << irq_idx; 598 nubus_disabled |= 1 << irq_idx;
573 if (nubus_disabled) 599 if (nubus_disabled)
574 via2[gIER] = IER_CLR_BIT(1); 600 via2[gIER] = IER_CLR_BIT(1);
575 break; 601 break;
576 case MAC_VIA_IIci: 602 case MAC_VIA_IICI:
577 via2[rSIER] = IER_CLR_BIT(irq_idx); 603 via2[rSIER] = IER_CLR_BIT(irq_idx);
578 break; 604 break;
579 case MAC_VIA_QUADRA:
580 if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
581 (macintosh_config->adb_type != MAC_ADB_PB2))
582 via2[vDirA] |= 1 << irq_idx;
583 break;
584 } 605 }
585 } 606 }
586} 607}
587 608
588void via_irq_clear(int irq) {
589 int irq_src = IRQ_SRC(irq);
590 int irq_idx = IRQ_IDX(irq);
591 int irq_bit = 1 << irq_idx;
592
593 if (irq_src == 1) {
594 via1[vIFR] = irq_bit;
595 } else if (irq_src == 2) {
596 via2[gIFR] = irq_bit | rbv_clear;
597 } else if (irq_src == 7) {
598 /* FIXME: There is no way to clear an individual nubus slot
599 * IRQ flag, other than getting the device to do it.
600 */
601 }
602}
603
604/*
605 * Returns nonzero if an interrupt is pending on the given
606 * VIA/IRQ combination.
607 */
608
609int via_irq_pending(int irq)
610{
611 int irq_src = IRQ_SRC(irq);
612 int irq_idx = IRQ_IDX(irq);
613 int irq_bit = 1 << irq_idx;
614
615 if (irq_src == 1) {
616 return via1[vIFR] & irq_bit;
617 } else if (irq_src == 2) {
618 return via2[gIFR] & irq_bit;
619 } else if (irq_src == 7) {
620 /* Always 0 for MAC_VIA_QUADRA if the slot irq is disabled. */
621 return ~via2[gBufA] & irq_bit;
622 }
623 return 0;
624}
625
626void via1_set_head(int head) 609void via1_set_head(int head)
627{ 610{
628 if (head == 0) 611 if (head == 0)
@@ -631,3 +614,9 @@ void via1_set_head(int head)
631 via1[vBufA] |= VIA1A_vHeadSel; 614 via1[vBufA] |= VIA1A_vHeadSel;
632} 615}
633EXPORT_SYMBOL(via1_set_head); 616EXPORT_SYMBOL(via1_set_head);
617
618int via2_scsi_drq_pending(void)
619{
620 return via2[gIFR] & (1 << IRQ_IDX(IRQ_MAC_SCSIDRQ));
621}
622EXPORT_SYMBOL(via2_scsi_drq_pending);
diff --git a/arch/m68k/mm/Makefile b/arch/m68k/mm/Makefile
index 09cadf1058d5..cfbf3205724a 100644
--- a/arch/m68k/mm/Makefile
+++ b/arch/m68k/mm/Makefile
@@ -4,6 +4,8 @@
4 4
5obj-y := init.o 5obj-y := init.o
6 6
7obj-$(CONFIG_MMU) += cache.o fault.o hwtest.o 7obj-$(CONFIG_MMU) += cache.o fault.o
8obj-$(CONFIG_MMU_MOTOROLA) += kmap.o memory.o motorola.o 8obj-$(CONFIG_MMU_MOTOROLA) += kmap.o memory.o motorola.o hwtest.o
9obj-$(CONFIG_MMU_SUN3) += sun3kmap.o sun3mmu.o 9obj-$(CONFIG_MMU_SUN3) += sun3kmap.o sun3mmu.o hwtest.o
10obj-$(CONFIG_MMU_COLDFIRE) += kmap.o memory.o mcfmmu.o
11
diff --git a/arch/m68k/mm/cache.c b/arch/m68k/mm/cache.c
index 5437fff5fe07..95d0bf66e2e2 100644
--- a/arch/m68k/mm/cache.c
+++ b/arch/m68k/mm/cache.c
@@ -74,8 +74,16 @@ static unsigned long virt_to_phys_slow(unsigned long vaddr)
74/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */ 74/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
75void flush_icache_range(unsigned long address, unsigned long endaddr) 75void flush_icache_range(unsigned long address, unsigned long endaddr)
76{ 76{
77 77 if (CPU_IS_COLDFIRE) {
78 if (CPU_IS_040_OR_060) { 78 unsigned long start, end;
79 start = address & ICACHE_SET_MASK;
80 end = endaddr & ICACHE_SET_MASK;
81 if (start > end) {
82 flush_cf_icache(0, end);
83 end = ICACHE_MAX_ADDR;
84 }
85 flush_cf_icache(start, end);
86 } else if (CPU_IS_040_OR_060) {
79 address &= PAGE_MASK; 87 address &= PAGE_MASK;
80 88
81 do { 89 do {
@@ -100,7 +108,17 @@ EXPORT_SYMBOL(flush_icache_range);
100void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, 108void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
101 unsigned long addr, int len) 109 unsigned long addr, int len)
102{ 110{
103 if (CPU_IS_040_OR_060) { 111 if (CPU_IS_COLDFIRE) {
112 unsigned long start, end;
113 start = addr & ICACHE_SET_MASK;
114 end = (addr + len) & ICACHE_SET_MASK;
115 if (start > end) {
116 flush_cf_icache(0, end);
117 end = ICACHE_MAX_ADDR;
118 }
119 flush_cf_icache(start, end);
120
121 } else if (CPU_IS_040_OR_060) {
104 asm volatile ("nop\n\t" 122 asm volatile ("nop\n\t"
105 ".chip 68040\n\t" 123 ".chip 68040\n\t"
106 "cpushp %%bc,(%0)\n\t" 124 "cpushp %%bc,(%0)\n\t"
diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
index bbe525434ccb..89f3b203814b 100644
--- a/arch/m68k/mm/init_mm.c
+++ b/arch/m68k/mm/init_mm.c
@@ -24,6 +24,7 @@
24#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/pgalloc.h> 25#include <asm/pgalloc.h>
26#include <asm/system.h> 26#include <asm/system.h>
27#include <asm/traps.h>
27#include <asm/machdep.h> 28#include <asm/machdep.h>
28#include <asm/io.h> 29#include <asm/io.h>
29#ifdef CONFIG_ATARI 30#ifdef CONFIG_ATARI
@@ -75,6 +76,38 @@ extern void init_pointer_table(unsigned long ptable);
75 76
76extern pmd_t *zero_pgtable; 77extern pmd_t *zero_pgtable;
77 78
79#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)
80#define VECTORS &vectors[0]
81#else
82#define VECTORS _ramvec
83#endif
84
85void __init print_memmap(void)
86{
87#define UL(x) ((unsigned long) (x))
88#define MLK(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 10
89#define MLM(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 20
90#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), 1024)
91
92 pr_notice("Virtual kernel memory layout:\n"
93 " vector : 0x%08lx - 0x%08lx (%4ld KiB)\n"
94 " kmap : 0x%08lx - 0x%08lx (%4ld MiB)\n"
95 " vmalloc : 0x%08lx - 0x%08lx (%4ld MiB)\n"
96 " lowmem : 0x%08lx - 0x%08lx (%4ld MiB)\n"
97 " .init : 0x%p" " - 0x%p" " (%4d KiB)\n"
98 " .text : 0x%p" " - 0x%p" " (%4d KiB)\n"
99 " .data : 0x%p" " - 0x%p" " (%4d KiB)\n"
100 " .bss : 0x%p" " - 0x%p" " (%4d KiB)\n",
101 MLK(VECTORS, VECTORS + 256),
102 MLM(KMAP_START, KMAP_END),
103 MLM(VMALLOC_START, VMALLOC_END),
104 MLM(PAGE_OFFSET, (unsigned long)high_memory),
105 MLK_ROUNDUP(__init_begin, __init_end),
106 MLK_ROUNDUP(_stext, _etext),
107 MLK_ROUNDUP(_sdata, _edata),
108 MLK_ROUNDUP(_sbss, _ebss));
109}
110
78void __init mem_init(void) 111void __init mem_init(void)
79{ 112{
80 pg_data_t *pgdat; 113 pg_data_t *pgdat;
@@ -106,7 +139,7 @@ void __init mem_init(void)
106 } 139 }
107 } 140 }
108 141
109#ifndef CONFIG_SUN3 142#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
110 /* insert pointer tables allocated so far into the tablelist */ 143 /* insert pointer tables allocated so far into the tablelist */
111 init_pointer_table((unsigned long)kernel_pg_dir); 144 init_pointer_table((unsigned long)kernel_pg_dir);
112 for (i = 0; i < PTRS_PER_PGD; i++) { 145 for (i = 0; i < PTRS_PER_PGD; i++) {
@@ -125,6 +158,7 @@ void __init mem_init(void)
125 codepages << (PAGE_SHIFT-10), 158 codepages << (PAGE_SHIFT-10),
126 datapages << (PAGE_SHIFT-10), 159 datapages << (PAGE_SHIFT-10),
127 initpages << (PAGE_SHIFT-10)); 160 initpages << (PAGE_SHIFT-10));
161 print_memmap();
128} 162}
129 163
130#ifdef CONFIG_BLK_DEV_INITRD 164#ifdef CONFIG_BLK_DEV_INITRD
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index 69345849454b..1cc2bed4c3dd 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -171,7 +171,8 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
171 break; 171 break;
172 } 172 }
173 } else { 173 } else {
174 physaddr |= (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY); 174 physaddr |= (_PAGE_PRESENT | _PAGE_ACCESSED |
175 _PAGE_DIRTY | _PAGE_READWRITE);
175 switch (cacheflag) { 176 switch (cacheflag) {
176 case IOMAP_NOCACHE_SER: 177 case IOMAP_NOCACHE_SER:
177 case IOMAP_NOCACHE_NONSER: 178 case IOMAP_NOCACHE_NONSER:
diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
new file mode 100644
index 000000000000..babd5a97cdcb
--- /dev/null
+++ b/arch/m68k/mm/mcfmmu.c
@@ -0,0 +1,198 @@
1/*
2 * Based upon linux/arch/m68k/mm/sun3mmu.c
3 * Based upon linux/arch/ppc/mm/mmu_context.c
4 *
5 * Implementations of mm routines specific to the Coldfire MMU.
6 *
7 * Copyright (c) 2008 Freescale Semiconductor, Inc.
8 */
9
10#include <linux/kernel.h>
11#include <linux/types.h>
12#include <linux/mm.h>
13#include <linux/init.h>
14#include <linux/string.h>
15#include <linux/bootmem.h>
16
17#include <asm/setup.h>
18#include <asm/page.h>
19#include <asm/pgtable.h>
20#include <asm/mmu_context.h>
21#include <asm/mcf_pgalloc.h>
22#include <asm/tlbflush.h>
23
24#define KMAPAREA(x) ((x >= VMALLOC_START) && (x < KMAP_END))
25
26mm_context_t next_mmu_context;
27unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
28atomic_t nr_free_contexts;
29struct mm_struct *context_mm[LAST_CONTEXT+1];
30extern unsigned long num_pages;
31
32void free_initmem(void)
33{
34}
35
36/*
37 * ColdFire paging_init derived from sun3.
38 */
39void __init paging_init(void)
40{
41 pgd_t *pg_dir;
42 pte_t *pg_table;
43 unsigned long address, size;
44 unsigned long next_pgtable, bootmem_end;
45 unsigned long zones_size[MAX_NR_ZONES];
46 enum zone_type zone;
47 int i;
48
49 empty_zero_page = (void *) alloc_bootmem_pages(PAGE_SIZE);
50 memset((void *) empty_zero_page, 0, PAGE_SIZE);
51
52 pg_dir = swapper_pg_dir;
53 memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir));
54
55 size = num_pages * sizeof(pte_t);
56 size = (size + PAGE_SIZE) & ~(PAGE_SIZE-1);
57 next_pgtable = (unsigned long) alloc_bootmem_pages(size);
58
59 bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK;
60 pg_dir += PAGE_OFFSET >> PGDIR_SHIFT;
61
62 address = PAGE_OFFSET;
63 while (address < (unsigned long)high_memory) {
64 pg_table = (pte_t *) next_pgtable;
65 next_pgtable += PTRS_PER_PTE * sizeof(pte_t);
66 pgd_val(*pg_dir) = (unsigned long) pg_table;
67 pg_dir++;
68
69 /* now change pg_table to kernel virtual addresses */
70 for (i = 0; i < PTRS_PER_PTE; ++i, ++pg_table) {
71 pte_t pte = pfn_pte(virt_to_pfn(address), PAGE_INIT);
72 if (address >= (unsigned long) high_memory)
73 pte_val(pte) = 0;
74
75 set_pte(pg_table, pte);
76 address += PAGE_SIZE;
77 }
78 }
79
80 current->mm = NULL;
81
82 for (zone = 0; zone < MAX_NR_ZONES; zone++)
83 zones_size[zone] = 0x0;
84 zones_size[ZONE_DMA] = num_pages;
85 free_area_init(zones_size);
86}
87
88int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
89{
90 unsigned long flags, mmuar;
91 struct mm_struct *mm;
92 pgd_t *pgd;
93 pmd_t *pmd;
94 pte_t *pte;
95 int asid;
96
97 local_irq_save(flags);
98
99 mmuar = (dtlb) ? mmu_read(MMUAR) :
100 regs->pc + (extension_word * sizeof(long));
101
102 mm = (!user_mode(regs) && KMAPAREA(mmuar)) ? &init_mm : current->mm;
103 if (!mm) {
104 local_irq_restore(flags);
105 return -1;
106 }
107
108 pgd = pgd_offset(mm, mmuar);
109 if (pgd_none(*pgd)) {
110 local_irq_restore(flags);
111 return -1;
112 }
113
114 pmd = pmd_offset(pgd, mmuar);
115 if (pmd_none(*pmd)) {
116 local_irq_restore(flags);
117 return -1;
118 }
119
120 pte = (KMAPAREA(mmuar)) ? pte_offset_kernel(pmd, mmuar)
121 : pte_offset_map(pmd, mmuar);
122 if (pte_none(*pte) || !pte_present(*pte)) {
123 local_irq_restore(flags);
124 return -1;
125 }
126
127 if (write) {
128 if (!pte_write(*pte)) {
129 local_irq_restore(flags);
130 return -1;
131 }
132 set_pte(pte, pte_mkdirty(*pte));
133 }
134
135 set_pte(pte, pte_mkyoung(*pte));
136 asid = mm->context & 0xff;
137 if (!pte_dirty(*pte) && !KMAPAREA(mmuar))
138 set_pte(pte, pte_wrprotect(*pte));
139
140 mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) |
141 (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK)
142 >> CF_PAGE_MMUTR_SHIFT) | MMUTR_V);
143
144 mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) |
145 ((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
146
147 if (dtlb)
148 mmu_write(MMUOR, MMUOR_ACC | MMUOR_UAA);
149 else
150 mmu_write(MMUOR, MMUOR_ITLB | MMUOR_ACC | MMUOR_UAA);
151
152 local_irq_restore(flags);
153 return 0;
154}
155
156/*
157 * Initialize the context management stuff.
158 * The following was taken from arch/ppc/mmu_context.c
159 */
160void __init mmu_context_init(void)
161{
162 /*
163 * Some processors have too few contexts to reserve one for
164 * init_mm, and require using context 0 for a normal task.
165 * Other processors reserve the use of context zero for the kernel.
166 * This code assumes FIRST_CONTEXT < 32.
167 */
168 context_map[0] = (1 << FIRST_CONTEXT) - 1;
169 next_mmu_context = FIRST_CONTEXT;
170 atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1);
171}
172
173/*
174 * Steal a context from a task that has one at the moment.
175 * This is only used on 8xx and 4xx and we presently assume that
176 * they don't do SMP. If they do then thicfpgalloc.hs will have to check
177 * whether the MM we steal is in use.
178 * We also assume that this is only used on systems that don't
179 * use an MMU hash table - this is true for 8xx and 4xx.
180 * This isn't an LRU system, it just frees up each context in
181 * turn (sort-of pseudo-random replacement :). This would be the
182 * place to implement an LRU scheme if anyone was motivated to do it.
183 * -- paulus
184 */
185void steal_context(void)
186{
187 struct mm_struct *mm;
188 /*
189 * free up context `next_mmu_context'
190 * if we shouldn't free context 0, don't...
191 */
192 if (next_mmu_context < FIRST_CONTEXT)
193 next_mmu_context = FIRST_CONTEXT;
194 mm = context_mm[next_mmu_context];
195 flush_tlb_mm(mm);
196 destroy_context(mm);
197}
198
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 34c77ce24fba..a5dbb74fe1de 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -203,7 +203,9 @@ static inline void pushcl040(unsigned long paddr)
203 203
204void cache_clear (unsigned long paddr, int len) 204void cache_clear (unsigned long paddr, int len)
205{ 205{
206 if (CPU_IS_040_OR_060) { 206 if (CPU_IS_COLDFIRE) {
207 flush_cf_bcache(0, DCACHE_MAX_ADDR);
208 } else if (CPU_IS_040_OR_060) {
207 int tmp; 209 int tmp;
208 210
209 /* 211 /*
@@ -250,7 +252,9 @@ EXPORT_SYMBOL(cache_clear);
250 252
251void cache_push (unsigned long paddr, int len) 253void cache_push (unsigned long paddr, int len)
252{ 254{
253 if (CPU_IS_040_OR_060) { 255 if (CPU_IS_COLDFIRE) {
256 flush_cf_bcache(0, DCACHE_MAX_ADDR);
257 } else if (CPU_IS_040_OR_060) {
254 int tmp = PAGE_SIZE; 258 int tmp = PAGE_SIZE;
255 259
256 /* 260 /*
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index 31a66d99cbca..c3fb3bdd7ed9 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -124,6 +124,163 @@ static void __init mvme16x_init_IRQ (void)
124#define PccSCCMICR 0x1d 124#define PccSCCMICR 0x1d
125#define PccSCCTICR 0x1e 125#define PccSCCTICR 0x1e
126#define PccSCCRICR 0x1f 126#define PccSCCRICR 0x1f
127#define PccTPIACKR 0x25
128
129#ifdef CONFIG_EARLY_PRINTK
130
131/**** cd2401 registers ****/
132#define CD2401_ADDR (0xfff45000)
133
134#define CyGFRCR (0x81)
135#define CyCCR (0x13)
136#define CyCLR_CHAN (0x40)
137#define CyINIT_CHAN (0x20)
138#define CyCHIP_RESET (0x10)
139#define CyENB_XMTR (0x08)
140#define CyDIS_XMTR (0x04)
141#define CyENB_RCVR (0x02)
142#define CyDIS_RCVR (0x01)
143#define CyCAR (0xee)
144#define CyIER (0x11)
145#define CyMdmCh (0x80)
146#define CyRxExc (0x20)
147#define CyRxData (0x08)
148#define CyTxMpty (0x02)
149#define CyTxRdy (0x01)
150#define CyLICR (0x26)
151#define CyRISR (0x89)
152#define CyTIMEOUT (0x80)
153#define CySPECHAR (0x70)
154#define CyOVERRUN (0x08)
155#define CyPARITY (0x04)
156#define CyFRAME (0x02)
157#define CyBREAK (0x01)
158#define CyREOIR (0x84)
159#define CyTEOIR (0x85)
160#define CyMEOIR (0x86)
161#define CyNOTRANS (0x08)
162#define CyRFOC (0x30)
163#define CyRDR (0xf8)
164#define CyTDR (0xf8)
165#define CyMISR (0x8b)
166#define CyRISR (0x89)
167#define CyTISR (0x8a)
168#define CyMSVR1 (0xde)
169#define CyMSVR2 (0xdf)
170#define CyDSR (0x80)
171#define CyDCD (0x40)
172#define CyCTS (0x20)
173#define CyDTR (0x02)
174#define CyRTS (0x01)
175#define CyRTPRL (0x25)
176#define CyRTPRH (0x24)
177#define CyCOR1 (0x10)
178#define CyPARITY_NONE (0x00)
179#define CyPARITY_E (0x40)
180#define CyPARITY_O (0xC0)
181#define Cy_5_BITS (0x04)
182#define Cy_6_BITS (0x05)
183#define Cy_7_BITS (0x06)
184#define Cy_8_BITS (0x07)
185#define CyCOR2 (0x17)
186#define CyETC (0x20)
187#define CyCtsAE (0x02)
188#define CyCOR3 (0x16)
189#define Cy_1_STOP (0x02)
190#define Cy_2_STOP (0x04)
191#define CyCOR4 (0x15)
192#define CyREC_FIFO (0x0F) /* Receive FIFO threshold */
193#define CyCOR5 (0x14)
194#define CyCOR6 (0x18)
195#define CyCOR7 (0x07)
196#define CyRBPR (0xcb)
197#define CyRCOR (0xc8)
198#define CyTBPR (0xc3)
199#define CyTCOR (0xc0)
200#define CySCHR1 (0x1f)
201#define CySCHR2 (0x1e)
202#define CyTPR (0xda)
203#define CyPILR1 (0xe3)
204#define CyPILR2 (0xe0)
205#define CyPILR3 (0xe1)
206#define CyCMR (0x1b)
207#define CyASYNC (0x02)
208#define CyLICR (0x26)
209#define CyLIVR (0x09)
210#define CySCRL (0x23)
211#define CySCRH (0x22)
212#define CyTFTC (0x80)
213
214static void cons_write(struct console *co, const char *str, unsigned count)
215{
216 volatile unsigned char *base_addr = (u_char *)CD2401_ADDR;
217 volatile u_char sink;
218 u_char ier;
219 int port;
220 u_char do_lf = 0;
221 int i = 0;
222
223 /* Ensure transmitter is enabled! */
224
225 port = 0;
226 base_addr[CyCAR] = (u_char)port;
227 while (base_addr[CyCCR])
228 ;
229 base_addr[CyCCR] = CyENB_XMTR;
230
231 ier = base_addr[CyIER];
232 base_addr[CyIER] = CyTxMpty;
233
234 while (1) {
235 if (pcc2chip[PccSCCTICR] & 0x20)
236 {
237 /* We have a Tx int. Acknowledge it */
238 sink = pcc2chip[PccTPIACKR];
239 if ((base_addr[CyLICR] >> 2) == port) {
240 if (i == count) {
241 /* Last char of string is now output */
242 base_addr[CyTEOIR] = CyNOTRANS;
243 break;
244 }
245 if (do_lf) {
246 base_addr[CyTDR] = '\n';
247 str++;
248 i++;
249 do_lf = 0;
250 }
251 else if (*str == '\n') {
252 base_addr[CyTDR] = '\r';
253 do_lf = 1;
254 }
255 else {
256 base_addr[CyTDR] = *str++;
257 i++;
258 }
259 base_addr[CyTEOIR] = 0;
260 }
261 else
262 base_addr[CyTEOIR] = CyNOTRANS;
263 }
264 }
265
266 base_addr[CyIER] = ier;
267}
268
269static struct console cons_info =
270{
271 .name = "sercon",
272 .write = cons_write,
273 .flags = CON_PRINTBUFFER | CON_BOOT,
274 .index = -1,
275};
276
277static void __init mvme16x_early_console(void)
278{
279 register_console(&cons_info);
280
281 printk(KERN_INFO "MVME16x: early console registered\n");
282}
283#endif
127 284
128void __init config_mvme16x(void) 285void __init config_mvme16x(void)
129{ 286{
@@ -183,6 +340,9 @@ void __init config_mvme16x(void)
183 pcc2chip[PccSCCMICR] = 0x10; 340 pcc2chip[PccSCCMICR] = 0x10;
184 pcc2chip[PccSCCTICR] = 0x10; 341 pcc2chip[PccSCCTICR] = 0x10;
185 pcc2chip[PccSCCRICR] = 0x10; 342 pcc2chip[PccSCCRICR] = 0x10;
343#ifdef CONFIG_EARLY_PRINTK
344 mvme16x_early_console();
345#endif
186 } 346 }
187} 347}
188 348
diff --git a/arch/m68k/platform/54xx/config.c b/arch/m68k/platform/54xx/config.c
index 78130984db95..ee043540bfa2 100644
--- a/arch/m68k/platform/54xx/config.c
+++ b/arch/m68k/platform/54xx/config.c
@@ -13,11 +13,17 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/mm.h>
17#include <linux/bootmem.h>
18#include <asm/pgalloc.h>
16#include <asm/machdep.h> 19#include <asm/machdep.h>
17#include <asm/coldfire.h> 20#include <asm/coldfire.h>
18#include <asm/m54xxsim.h> 21#include <asm/m54xxsim.h>
19#include <asm/mcfuart.h> 22#include <asm/mcfuart.h>
20#include <asm/m54xxgpt.h> 23#include <asm/m54xxgpt.h>
24#ifdef CONFIG_MMU
25#include <asm/mmu_context.h>
26#endif
21 27
22/***************************************************************************/ 28/***************************************************************************/
23 29
@@ -95,8 +101,49 @@ static void mcf54xx_reset(void)
95 101
96/***************************************************************************/ 102/***************************************************************************/
97 103
104#ifdef CONFIG_MMU
105
106unsigned long num_pages;
107
108static void __init mcf54xx_bootmem_alloc(void)
109{
110 unsigned long start_pfn;
111 unsigned long memstart;
112
113 /* _rambase and _ramend will be naturally page aligned */
114 m68k_memory[0].addr = _rambase;
115 m68k_memory[0].size = _ramend - _rambase;
116
117 /* compute total pages in system */
118 num_pages = (_ramend - _rambase) >> PAGE_SHIFT;
119
120 /* page numbers */
121 memstart = PAGE_ALIGN(_ramstart);
122 min_low_pfn = _rambase >> PAGE_SHIFT;
123 start_pfn = memstart >> PAGE_SHIFT;
124 max_low_pfn = _ramend >> PAGE_SHIFT;
125 high_memory = (void *)_ramend;
126
127 m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;
128 module_fixup(NULL, __start_fixup, __stop_fixup);
129
130 /* setup bootmem data */
131 m68k_setup_node(0);
132 memstart += init_bootmem_node(NODE_DATA(0), start_pfn,
133 min_low_pfn, max_low_pfn);
134 free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart);
135}
136
137#endif /* CONFIG_MMU */
138
139/***************************************************************************/
140
98void __init config_BSP(char *commandp, int size) 141void __init config_BSP(char *commandp, int size)
99{ 142{
143#ifdef CONFIG_MMU
144 mcf54xx_bootmem_alloc();
145 mmu_context_init();
146#endif
100 mach_reset = mcf54xx_reset; 147 mach_reset = mcf54xx_reset;
101 m54xx_uarts_init(); 148 m54xx_uarts_init();
102} 149}
diff --git a/arch/m68k/platform/68328/Makefile b/arch/m68k/platform/68328/Makefile
index e4dfd8fde068..ee61bf84d4a0 100644
--- a/arch/m68k/platform/68328/Makefile
+++ b/arch/m68k/platform/68328/Makefile
@@ -14,12 +14,8 @@ obj-$(CONFIG_M68328) += config.o
14obj-$(CONFIG_ROM) += romvec.o 14obj-$(CONFIG_ROM) += romvec.o
15 15
16extra-y := head.o 16extra-y := head.o
17extra-$(CONFIG_M68328) += bootlogo.rh head.o
18
19$(obj)/bootlogo.rh: $(src)/bootlogo.h
20 perl $(src)/bootlogo.pl < $(src)/bootlogo.h > $(obj)/bootlogo.rh
21 17
22$(obj)/head.o: $(obj)/$(head-y) 18$(obj)/head.o: $(obj)/$(head-y)
23 ln -sf $(head-y) $(obj)/head.o 19 ln -sf $(head-y) $(obj)/head.o
24 20
25clean-files := $(obj)/bootlogo.rh $(obj)/head.o $(head-y) 21clean-files := $(obj)/head.o $(head-y)
diff --git a/arch/m68k/platform/68328/bootlogo.h b/arch/m68k/platform/68328/bootlogo.h
index 67bc2c17386e..b896c933fafc 100644
--- a/arch/m68k/platform/68328/bootlogo.h
+++ b/arch/m68k/platform/68328/bootlogo.h
@@ -1,6 +1,6 @@
1#define bootlogo_width 160 1#define bootlogo_width 160
2#define bootlogo_height 160 2#define bootlogo_height 160
3static unsigned char bootlogo_bits[] = { 3unsigned char __attribute__ ((aligned(16))) bootlogo_bits[] = {
4 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x00, 4 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x00,
5 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6 0x00, 0x00, 0x40, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 0x00, 0x00, 0x40, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/arch/m68k/platform/68328/bootlogo.pl b/arch/m68k/platform/68328/bootlogo.pl
deleted file mode 100644
index b04ae3f50da5..000000000000
--- a/arch/m68k/platform/68328/bootlogo.pl
+++ /dev/null
@@ -1,10 +0,0 @@
1
2$_ = join("", <>);
3
4s/(0x[0-9a-f]{2})/sprintf("0x%.2x",ord(pack("b8",unpack("B8",chr(hex($1))))))/gei;
5
6s/^ / .byte /gm;
7s/[,};]+$//gm;
8s/^static.*//gm;
9
10print $_;
diff --git a/arch/m68k/platform/68328/config.c b/arch/m68k/platform/68328/config.c
index a7bd21deb00f..d70bf2623db1 100644
--- a/arch/m68k/platform/68328/config.c
+++ b/arch/m68k/platform/68328/config.c
@@ -20,6 +20,9 @@
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/MC68328.h> 22#include <asm/MC68328.h>
23#if defined(CONFIG_PILOT) || defined(CONFIG_INIT_LCD)
24#include "bootlogo.h"
25#endif
23 26
24/***************************************************************************/ 27/***************************************************************************/
25 28
diff --git a/arch/m68k/platform/68328/head-pilot.S b/arch/m68k/platform/68328/head-pilot.S
index aecff532b343..2ebfd6420818 100644
--- a/arch/m68k/platform/68328/head-pilot.S
+++ b/arch/m68k/platform/68328/head-pilot.S
@@ -24,19 +24,7 @@
24.global _ramstart 24.global _ramstart
25.global _ramend 25.global _ramend
26 26
27.global penguin_bits 27.global bootlogo_bits
28
29#ifdef CONFIG_PILOT
30
31#define IMR 0xFFFFF304
32
33 .data
34 .align 16
35
36penguin_bits:
37#include "bootlogo.rh"
38
39#endif
40 28
41/*****************************************************************************/ 29/*****************************************************************************/
42 30
@@ -185,9 +173,6 @@ L3:
185 moveq #79, %d7 173 moveq #79, %d7
186 movel %d0, _ramend 174 movel %d0, _ramend
187 175
188 movel %a3, %d0
189 movel %d0, rom_length
190
191 pea 0 176 pea 0
192 pea env 177 pea env
193 pea %sp@(4) 178 pea %sp@(4)
@@ -196,7 +181,7 @@ L3:
196 DBG_PUTC('H') 181 DBG_PUTC('H')
197 182
198#ifdef CONFIG_PILOT 183#ifdef CONFIG_PILOT
199 movel #penguin_bits, 0xFFFFFA00 184 movel #bootlogo_bits, 0xFFFFFA00
200 moveb #10, 0xFFFFFA05 185 moveb #10, 0xFFFFFA05
201 movew #160, 0xFFFFFA08 186 movew #160, 0xFFFFFA08
202 movew #160, 0xFFFFFA0A 187 movew #160, 0xFFFFFA0A
diff --git a/arch/m68k/platform/68328/head-rom.S b/arch/m68k/platform/68328/head-rom.S
index 6ec77d3ea0b3..a5ff96d0295f 100644
--- a/arch/m68k/platform/68328/head-rom.S
+++ b/arch/m68k/platform/68328/head-rom.S
@@ -8,7 +8,7 @@
8 .global _ramend 8 .global _ramend
9 9
10#ifdef CONFIG_INIT_LCD 10#ifdef CONFIG_INIT_LCD
11 .global splash_bits 11 .global bootlogo_bits
12#endif 12#endif
13 13
14 .data 14 .data
@@ -29,16 +29,11 @@ _ramend:
29 29
30#define RAMEND (CONFIG_RAMBASE + CONFIG_RAMSIZE) 30#define RAMEND (CONFIG_RAMBASE + CONFIG_RAMSIZE)
31 31
32#ifdef CONFIG_INIT_LCD
33splash_bits:
34#include "bootlogo.rh"
35#endif
36
37 .text 32 .text
38_start: 33_start:
39_stext: movew #0x2700,%sr 34_stext: movew #0x2700,%sr
40#ifdef CONFIG_INIT_LCD 35#ifdef CONFIG_INIT_LCD
41 movel #splash_bits, 0xfffffA00 /* LSSA */ 36 movel #bootlogo_bits, 0xfffffA00 /* LSSA */
42 moveb #0x28, 0xfffffA05 /* LVPW */ 37 moveb #0x28, 0xfffffA05 /* LVPW */
43 movew #0x280, 0xFFFFFa08 /* LXMAX */ 38 movew #0x280, 0xFFFFFa08 /* LXMAX */
44 movew #0x1df, 0xFFFFFa0a /* LYMAX */ 39 movew #0x1df, 0xFFFFFa0a /* LYMAX */
diff --git a/arch/m68k/platform/68328/timers.c b/arch/m68k/platform/68328/timers.c
index 309f725995bf..f2678866067b 100644
--- a/arch/m68k/platform/68328/timers.c
+++ b/arch/m68k/platform/68328/timers.c
@@ -93,7 +93,6 @@ static struct clocksource m68328_clk = {
93 .name = "timer", 93 .name = "timer",
94 .rating = 250, 94 .rating = 250,
95 .read = m68328_read_clk, 95 .read = m68328_read_clk,
96 .shift = 20,
97 .mask = CLOCKSOURCE_MASK(32), 96 .mask = CLOCKSOURCE_MASK(32),
98 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 97 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
99}; 98};
@@ -115,8 +114,7 @@ void hw_timer_init(void)
115 114
116 /* Enable timer 1 */ 115 /* Enable timer 1 */
117 TCTL |= TCTL_TEN; 116 TCTL |= TCTL_TEN;
118 m68328_clk.mult = clocksource_hz2mult(TICKS_PER_JIFFY*HZ, m68328_clk.shift); 117 clocksource_register_hz(&m68328_clk, TICKS_PER_JIFFY*HZ);
119 clocksource_register(&m68328_clk);
120} 118}
121 119
122/***************************************************************************/ 120/***************************************************************************/
diff --git a/arch/m68k/platform/coldfire/dma_timer.c b/arch/m68k/platform/coldfire/dma_timer.c
index a5f562823d7a..235ad57c4707 100644
--- a/arch/m68k/platform/coldfire/dma_timer.c
+++ b/arch/m68k/platform/coldfire/dma_timer.c
@@ -44,7 +44,6 @@ static struct clocksource clocksource_cf_dt = {
44 .rating = 200, 44 .rating = 200,
45 .read = cf_dt_get_cycles, 45 .read = cf_dt_get_cycles,
46 .mask = CLOCKSOURCE_MASK(32), 46 .mask = CLOCKSOURCE_MASK(32),
47 .shift = 20,
48 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 47 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
49}; 48};
50 49
@@ -60,9 +59,7 @@ static int __init init_cf_dt_clocksource(void)
60 __raw_writeb(0x00, DTER0); 59 __raw_writeb(0x00, DTER0);
61 __raw_writel(0x00000000, DTRR0); 60 __raw_writel(0x00000000, DTRR0);
62 __raw_writew(DMA_DTMR_CLK_DIV_16 | DMA_DTMR_ENABLE, DTMR0); 61 __raw_writew(DMA_DTMR_CLK_DIV_16 | DMA_DTMR_ENABLE, DTMR0);
63 clocksource_cf_dt.mult = clocksource_hz2mult(DMA_FREQ, 62 return clocksource_register_hz(&clocksource_cf_dt, DMA_FREQ);
64 clocksource_cf_dt.shift);
65 return clocksource_register(&clocksource_cf_dt);
66} 63}
67 64
68arch_initcall(init_cf_dt_clocksource); 65arch_initcall(init_cf_dt_clocksource);
diff --git a/arch/m68k/platform/coldfire/entry.S b/arch/m68k/platform/coldfire/entry.S
index 3157461a8d1d..863889fc31c9 100644
--- a/arch/m68k/platform/coldfire/entry.S
+++ b/arch/m68k/platform/coldfire/entry.S
@@ -54,7 +54,6 @@ sw_usp:
54.globl ret_from_signal 54.globl ret_from_signal
55.globl sys_call_table 55.globl sys_call_table
56.globl inthandler 56.globl inthandler
57.globl fasthandler
58 57
59enosys: 58enosys:
60 mov.l #sys_ni_syscall,%d3 59 mov.l #sys_ni_syscall,%d3
@@ -63,6 +62,7 @@ enosys:
63ENTRY(system_call) 62ENTRY(system_call)
64 SAVE_ALL_SYS 63 SAVE_ALL_SYS
65 move #0x2000,%sr /* enable intrs again */ 64 move #0x2000,%sr /* enable intrs again */
65 GET_CURRENT(%d2)
66 66
67 cmpl #NR_syscalls,%d0 67 cmpl #NR_syscalls,%d0
68 jcc enosys 68 jcc enosys
@@ -166,6 +166,7 @@ Lsignal_return:
166 */ 166 */
167ENTRY(inthandler) 167ENTRY(inthandler)
168 SAVE_ALL_INT 168 SAVE_ALL_INT
169 GET_CURRENT(%d2)
169 170
170 movew %sp@(PT_OFF_FORMATVEC),%d0 /* put exception # in d0 */ 171 movew %sp@(PT_OFF_FORMATVEC),%d0 /* put exception # in d0 */
171 andl #0x03fc,%d0 /* mask out vector only */ 172 andl #0x03fc,%d0 /* mask out vector only */
@@ -191,7 +192,9 @@ ENTRY(resume)
191 movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */ 192 movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */
192 RDUSP /* movel %usp,%a3 */ 193 RDUSP /* movel %usp,%a3 */
193 movel %a3,%a0@(TASK_THREAD+THREAD_USP) /* save thread user stack */ 194 movel %a3,%a0@(TASK_THREAD+THREAD_USP) /* save thread user stack */
194 195#ifdef CONFIG_MMU
196 movel %a1,%a2 /* set new current */
197#endif
195 movel %a1@(TASK_THREAD+THREAD_USP),%a3 /* restore thread user stack */ 198 movel %a1@(TASK_THREAD+THREAD_USP),%a3 /* restore thread user stack */
196 WRUSP /* movel %a3,%usp */ 199 WRUSP /* movel %a3,%usp */
197 movel %a1@(TASK_THREAD+THREAD_KSP),%sp /* restore new kernel stack */ 200 movel %a1@(TASK_THREAD+THREAD_KSP),%sp /* restore new kernel stack */
diff --git a/arch/m68k/platform/coldfire/gpio.c b/arch/m68k/platform/coldfire/gpio.c
index ff0045793450..292a1a5a2d7c 100644
--- a/arch/m68k/platform/coldfire/gpio.c
+++ b/arch/m68k/platform/coldfire/gpio.c
@@ -15,7 +15,7 @@
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/sysdev.h> 18#include <linux/device.h>
19 19
20#include <asm/gpio.h> 20#include <asm/gpio.h>
21#include <asm/pinmux.h> 21#include <asm/pinmux.h>
@@ -115,13 +115,14 @@ void mcf_gpio_free(struct gpio_chip *chip, unsigned offset)
115 mcf_pinmux_release(mcf_chip->gpio_to_pinmux[offset], 0); 115 mcf_pinmux_release(mcf_chip->gpio_to_pinmux[offset], 0);
116} 116}
117 117
118struct sysdev_class mcf_gpio_sysclass = { 118struct bus_type mcf_gpio_subsys = {
119 .name = "gpio", 119 .name = "gpio",
120 .dev_name = "gpio",
120}; 121};
121 122
122static int __init mcf_gpio_sysinit(void) 123static int __init mcf_gpio_sysinit(void)
123{ 124{
124 return sysdev_class_register(&mcf_gpio_sysclass); 125 return subsys_system_register(&mcf_gpio_subsys, NULL);
125} 126}
126 127
127core_initcall(mcf_gpio_sysinit); 128core_initcall(mcf_gpio_sysinit);
diff --git a/arch/m68k/platform/coldfire/head.S b/arch/m68k/platform/coldfire/head.S
index c33483824a2e..38f04a3f6207 100644
--- a/arch/m68k/platform/coldfire/head.S
+++ b/arch/m68k/platform/coldfire/head.S
@@ -3,7 +3,7 @@
3/* 3/*
4 * head.S -- common startup code for ColdFire CPUs. 4 * head.S -- common startup code for ColdFire CPUs.
5 * 5 *
6 * (C) Copyright 1999-2010, Greg Ungerer <gerg@snapgear.com>. 6 * (C) Copyright 1999-2011, Greg Ungerer <gerg@snapgear.com>.
7 */ 7 */
8 8
9/*****************************************************************************/ 9/*****************************************************************************/
@@ -13,6 +13,7 @@
13#include <asm/asm-offsets.h> 13#include <asm/asm-offsets.h>
14#include <asm/coldfire.h> 14#include <asm/coldfire.h>
15#include <asm/mcfsim.h> 15#include <asm/mcfsim.h>
16#include <asm/mcfmmu.h>
16#include <asm/thread_info.h> 17#include <asm/thread_info.h>
17 18
18/*****************************************************************************/ 19/*****************************************************************************/
@@ -135,6 +136,14 @@ _init_sp:
135 136
136__HEAD 137__HEAD
137 138
139#ifdef CONFIG_MMU
140_start0:
141 jmp _start
142.global kernel_pg_dir
143.equ kernel_pg_dir,_start0
144.equ .,_start0+0x1000
145#endif
146
138/* 147/*
139 * This is the codes first entry point. This is where it all 148 * This is the codes first entry point. This is where it all
140 * begins... 149 * begins...
@@ -143,6 +152,9 @@ __HEAD
143_start: 152_start:
144 nop /* filler */ 153 nop /* filler */
145 movew #0x2700, %sr /* no interrupts */ 154 movew #0x2700, %sr /* no interrupts */
155 movel #CACHE_INIT,%d0 /* disable cache */
156 movec %d0,%CACR
157 nop
146#if defined(CONFIG_UBOOT) 158#if defined(CONFIG_UBOOT)
147 movel %sp,_init_sp /* save initial stack pointer */ 159 movel %sp,_init_sp /* save initial stack pointer */
148#endif 160#endif
@@ -176,9 +188,6 @@ _start:
176 * it is very similar. Define the exact settings in the headers 188 * it is very similar. Define the exact settings in the headers
177 * then the code here is the same for all. 189 * then the code here is the same for all.
178 */ 190 */
179 movel #CACHE_INIT,%d0 /* invalidate whole cache */
180 movec %d0,%CACR
181 nop
182 movel #ACR0_MODE,%d0 /* set RAM region for caching */ 191 movel #ACR0_MODE,%d0 /* set RAM region for caching */
183 movec %d0,%ACR0 192 movec %d0,%ACR0
184 movel #ACR1_MODE,%d0 /* anything else to cache? */ 193 movel #ACR1_MODE,%d0 /* anything else to cache? */
@@ -193,6 +202,26 @@ _start:
193 movec %d0,%CACR 202 movec %d0,%CACR
194 nop 203 nop
195 204
205#ifdef CONFIG_MMU
206 /*
207 * Identity mapping for the kernel region.
208 */
209 movel #(MMUBASE+1),%d0 /* enable MMUBAR registers */
210 movec %d0,%MMUBAR
211 movel #MMUOR_CA,%d0 /* clear TLB entries */
212 movel %d0,MMUOR
213 movel #0,%d0 /* set ASID to 0 */
214 movec %d0,%asid
215
216 movel #MMUCR_EN,%d0 /* Enable the identity map */
217 movel %d0,MMUCR
218 nop /* sync i-pipeline */
219
220 movel #_vstart,%a0 /* jump to "virtual" space */
221 jmp %a0@
222_vstart:
223#endif /* CONFIG_MMU */
224
196#ifdef CONFIG_ROMFS_FS 225#ifdef CONFIG_ROMFS_FS
197 /* 226 /*
198 * Move ROM filesystem above bss :-) 227 * Move ROM filesystem above bss :-)
@@ -238,6 +267,22 @@ _clear_bss:
238 lea init_thread_union,%a0 267 lea init_thread_union,%a0
239 lea THREAD_SIZE(%a0),%sp 268 lea THREAD_SIZE(%a0),%sp
240 269
270#ifdef CONFIG_MMU
271.global m68k_cputype
272.global m68k_mmutype
273.global m68k_fputype
274.global m68k_machtype
275 movel #CPU_COLDFIRE,%d0
276 movel %d0,m68k_cputype /* Mark us as a ColdFire */
277 movel #MMU_COLDFIRE,%d0
278 movel %d0,m68k_mmutype
279 movel #FPU_COLDFIRE,%d0
280 movel %d0,m68k_fputype
281 movel #MACH_M54XX,%d0
282 movel %d0,m68k_machtype /* Mark us as a 54xx machine */
283 lea init_task,%a2 /* Set "current" init task */
284#endif
285
241 /* 286 /*
242 * Assember start up done, start code proper. 287 * Assember start up done, start code proper.
243 */ 288 */
diff --git a/arch/m68k/platform/coldfire/pit.c b/arch/m68k/platform/coldfire/pit.c
index c2b980926bec..02663d25822d 100644
--- a/arch/m68k/platform/coldfire/pit.c
+++ b/arch/m68k/platform/coldfire/pit.c
@@ -144,7 +144,6 @@ static struct clocksource pit_clk = {
144 .name = "pit", 144 .name = "pit",
145 .rating = 100, 145 .rating = 100,
146 .read = pit_read_clk, 146 .read = pit_read_clk,
147 .shift = 20,
148 .mask = CLOCKSOURCE_MASK(32), 147 .mask = CLOCKSOURCE_MASK(32),
149}; 148};
150 149
@@ -162,8 +161,7 @@ void hw_timer_init(void)
162 161
163 setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &pit_irq); 162 setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &pit_irq);
164 163
165 pit_clk.mult = clocksource_hz2mult(FREQ, pit_clk.shift); 164 clocksource_register_hz(&pit_clk, FREQ);
166 clocksource_register(&pit_clk);
167} 165}
168 166
169/***************************************************************************/ 167/***************************************************************************/
diff --git a/arch/m68k/platform/coldfire/sltimers.c b/arch/m68k/platform/coldfire/sltimers.c
index 6a85daf9a7fd..54e1452f853a 100644
--- a/arch/m68k/platform/coldfire/sltimers.c
+++ b/arch/m68k/platform/coldfire/sltimers.c
@@ -98,23 +98,25 @@ static struct irqaction mcfslt_timer_irq = {
98static cycle_t mcfslt_read_clk(struct clocksource *cs) 98static cycle_t mcfslt_read_clk(struct clocksource *cs)
99{ 99{
100 unsigned long flags; 100 unsigned long flags;
101 u32 cycles; 101 u32 cycles, scnt;
102 u16 scnt;
103 102
104 local_irq_save(flags); 103 local_irq_save(flags);
105 scnt = __raw_readl(TA(MCFSLT_SCNT)); 104 scnt = __raw_readl(TA(MCFSLT_SCNT));
106 cycles = mcfslt_cnt; 105 cycles = mcfslt_cnt;
106 if (__raw_readl(TA(MCFSLT_SSR)) & MCFSLT_SSR_TE) {
107 cycles += mcfslt_cycles_per_jiffy;
108 scnt = __raw_readl(TA(MCFSLT_SCNT));
109 }
107 local_irq_restore(flags); 110 local_irq_restore(flags);
108 111
109 /* subtract because slice timers count down */ 112 /* subtract because slice timers count down */
110 return cycles - scnt; 113 return cycles + ((mcfslt_cycles_per_jiffy - 1) - scnt);
111} 114}
112 115
113static struct clocksource mcfslt_clk = { 116static struct clocksource mcfslt_clk = {
114 .name = "slt", 117 .name = "slt",
115 .rating = 250, 118 .rating = 250,
116 .read = mcfslt_read_clk, 119 .read = mcfslt_read_clk,
117 .shift = 20,
118 .mask = CLOCKSOURCE_MASK(32), 120 .mask = CLOCKSOURCE_MASK(32),
119 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 121 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
120}; 122};
@@ -136,8 +138,7 @@ void hw_timer_init(void)
136 138
137 setup_irq(MCF_IRQ_TIMER, &mcfslt_timer_irq); 139 setup_irq(MCF_IRQ_TIMER, &mcfslt_timer_irq);
138 140
139 mcfslt_clk.mult = clocksource_hz2mult(MCF_BUSCLK, mcfslt_clk.shift); 141 clocksource_register_hz(&mcfslt_clk, MCF_BUSCLK);
140 clocksource_register(&mcfslt_clk);
141 142
142#ifdef CONFIG_HIGHPROFILE 143#ifdef CONFIG_HIGHPROFILE
143 mcfslt_profile_init(); 144 mcfslt_profile_init();
diff --git a/arch/m68k/platform/coldfire/timers.c b/arch/m68k/platform/coldfire/timers.c
index 60242f65fea9..0d90da32fcdb 100644
--- a/arch/m68k/platform/coldfire/timers.c
+++ b/arch/m68k/platform/coldfire/timers.c
@@ -88,7 +88,6 @@ static struct clocksource mcftmr_clk = {
88 .name = "tmr", 88 .name = "tmr",
89 .rating = 250, 89 .rating = 250,
90 .read = mcftmr_read_clk, 90 .read = mcftmr_read_clk,
91 .shift = 20,
92 .mask = CLOCKSOURCE_MASK(32), 91 .mask = CLOCKSOURCE_MASK(32),
93 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 92 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
94}; 93};
@@ -109,8 +108,7 @@ void hw_timer_init(void)
109 __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 | 108 __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 |
110 MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR)); 109 MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR));
111 110
112 mcftmr_clk.mult = clocksource_hz2mult(FREQ, mcftmr_clk.shift); 111 clocksource_register_hz(&mcftmr_clk, FREQ);
113 clocksource_register(&mcftmr_clk);
114 112
115 setup_irq(MCF_IRQ_TIMER, &mcftmr_timer_irq); 113 setup_irq(MCF_IRQ_TIMER, &mcftmr_timer_irq);
116 114
diff --git a/arch/microblaze/include/asm/memblock.h b/arch/microblaze/include/asm/memblock.h
deleted file mode 100644
index 20a8e257c77f..000000000000
--- a/arch/microblaze/include/asm/memblock.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MEMBLOCK_H
10#define _ASM_MICROBLAZE_MEMBLOCK_H
11
12#endif /* _ASM_MICROBLAZE_MEMBLOCK_H */
13
14
diff --git a/arch/microblaze/include/asm/namei.h b/arch/microblaze/include/asm/namei.h
deleted file mode 100644
index 61d60b8a07d5..000000000000
--- a/arch/microblaze/include/asm/namei.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_NAMEI_H
10#define _ASM_MICROBLAZE_NAMEI_H
11
12#ifdef __KERNEL__
13
14/* This dummy routine maybe changed to something useful
15 * for /usr/gnemul/ emulation stuff.
16 * Look at asm-sparc/namei.h for details.
17 */
18#define __emul_prefix() NULL
19
20#endif /* __KERNEL__ */
21
22#endif /* _ASM_MICROBLAZE_NAMEI_H */
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index b73da2ac21b3..1a8ab6a5c03f 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -125,7 +125,6 @@ static inline struct thread_info *current_thread_info(void)
125#define TIF_MEMDIE 6 /* is terminating due to OOM killer */ 125#define TIF_MEMDIE 6 /* is terminating due to OOM killer */
126#define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */ 126#define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */
127#define TIF_SECCOMP 10 /* secure computing */ 127#define TIF_SECCOMP 10 /* secure computing */
128#define TIF_FREEZE 14 /* Freezing for suspend */
129 128
130/* true if poll_idle() is polling TIF_NEED_RESCHED */ 129/* true if poll_idle() is polling TIF_NEED_RESCHED */
131#define TIF_POLLING_NRFLAG 16 130#define TIF_POLLING_NRFLAG 16
@@ -137,7 +136,6 @@ static inline struct thread_info *current_thread_info(void)
137#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 136#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
138#define _TIF_IRET (1 << TIF_IRET) 137#define _TIF_IRET (1 << TIF_IRET)
139#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 138#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
140#define _TIF_FREEZE (1 << TIF_FREEZE)
141#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 139#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
142#define _TIF_SECCOMP (1 << TIF_SECCOMP) 140#define _TIF_SECCOMP (1 << TIF_SECCOMP)
143 141
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 95cc295976a7..7dcb5bfffb75 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -103,10 +103,12 @@ void cpu_idle(void)
103 if (!idle) 103 if (!idle)
104 idle = default_idle; 104 idle = default_idle;
105 105
106 tick_nohz_stop_sched_tick(1); 106 tick_nohz_idle_enter();
107 rcu_idle_enter();
107 while (!need_resched()) 108 while (!need_resched())
108 idle(); 109 idle();
109 tick_nohz_restart_sched_tick(); 110 rcu_idle_exit();
111 tick_nohz_idle_exit();
110 112
111 preempt_enable_no_resched(); 113 preempt_enable_no_resched();
112 schedule(); 114 schedule();
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 977484add216..80d314e81901 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -122,7 +122,6 @@ void __init early_init_devtree(void *params)
122 of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line); 122 of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line);
123 123
124 /* Scan memory nodes and rebuild MEMBLOCKs */ 124 /* Scan memory nodes and rebuild MEMBLOCKs */
125 memblock_init();
126 of_scan_flat_dt(early_init_dt_scan_root, NULL); 125 of_scan_flat_dt(early_init_dt_scan_root, NULL);
127 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 126 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
128 127
@@ -130,7 +129,7 @@ void __init early_init_devtree(void *params)
130 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); 129 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
131 parse_early_param(); 130 parse_early_param();
132 131
133 memblock_analyze(); 132 memblock_allow_resize();
134 133
135 pr_debug("Phys. mem: %lx\n", (unsigned long) memblock_phys_mem_size()); 134 pr_debug("Phys. mem: %lx\n", (unsigned long) memblock_phys_mem_size());
136 135
diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c
index bd8ccab5ceff..88a01636f785 100644
--- a/arch/microblaze/kernel/reset.c
+++ b/arch/microblaze/kernel/reset.c
@@ -19,50 +19,11 @@
19static int handle; /* reset pin handle */ 19static int handle; /* reset pin handle */
20static unsigned int reset_val; 20static unsigned int reset_val;
21 21
22static int of_reset_gpio_handle(void)
23{
24 int ret; /* variable which stored handle reset gpio pin */
25 struct device_node *root; /* root node */
26 struct device_node *gpio; /* gpio node */
27 struct gpio_chip *gc;
28 u32 flags;
29 const void *gpio_spec;
30
31 /* find out root node */
32 root = of_find_node_by_path("/");
33
34 /* give me handle for gpio node to be possible allocate pin */
35 ret = of_parse_phandles_with_args(root, "hard-reset-gpios",
36 "#gpio-cells", 0, &gpio, &gpio_spec);
37 if (ret) {
38 pr_debug("%s: can't parse gpios property\n", __func__);
39 goto err0;
40 }
41
42 gc = of_node_to_gpiochip(gpio);
43 if (!gc) {
44 pr_debug("%s: gpio controller %s isn't registered\n",
45 root->full_name, gpio->full_name);
46 ret = -ENODEV;
47 goto err1;
48 }
49
50 ret = gc->of_xlate(gc, root, gpio_spec, &flags);
51 if (ret < 0)
52 goto err1;
53
54 ret += gc->base;
55err1:
56 of_node_put(gpio);
57err0:
58 pr_debug("%s exited with status %d\n", __func__, ret);
59 return ret;
60}
61
62void of_platform_reset_gpio_probe(void) 22void of_platform_reset_gpio_probe(void)
63{ 23{
64 int ret; 24 int ret;
65 handle = of_reset_gpio_handle(); 25 handle = of_get_named_gpio(of_find_node_by_path("/"),
26 "hard-reset-gpios", 0);
66 27
67 if (!gpio_is_valid(handle)) { 28 if (!gpio_is_valid(handle)) {
68 printk(KERN_INFO "Skipping unavailable RESET gpio %d (%s)\n", 29 printk(KERN_INFO "Skipping unavailable RESET gpio %d (%s)\n",
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d46f1da18a3c..a7636d3ddc6a 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -25,6 +25,9 @@ config MIPS
25 select GENERIC_IRQ_SHOW 25 select GENERIC_IRQ_SHOW
26 select HAVE_ARCH_JUMP_LABEL 26 select HAVE_ARCH_JUMP_LABEL
27 select IRQ_FORCED_THREADING 27 select IRQ_FORCED_THREADING
28 select HAVE_MEMBLOCK
29 select HAVE_MEMBLOCK_NODE_MAP
30 select ARCH_DISCARD_MEMBLOCK
28 31
29menu "Machine selection" 32menu "Machine selection"
30 33
@@ -65,7 +68,6 @@ config AR7
65 select SYS_SUPPORTS_LITTLE_ENDIAN 68 select SYS_SUPPORTS_LITTLE_ENDIAN
66 select SYS_SUPPORTS_ZBOOT_UART16550 69 select SYS_SUPPORTS_ZBOOT_UART16550
67 select ARCH_REQUIRE_GPIOLIB 70 select ARCH_REQUIRE_GPIOLIB
68 select GCD
69 select VLYNQ 71 select VLYNQ
70 help 72 help
71 Support for the Texas Instruments AR7 System-on-a-Chip 73 Support for the Texas Instruments AR7 System-on-a-Chip
@@ -2064,9 +2066,6 @@ config ARCH_DISCONTIGMEM_ENABLE
2064 or have huge holes in the physical address space for other reasons. 2066 or have huge holes in the physical address space for other reasons.
2065 See <file:Documentation/vm/numa> for more. 2067 See <file:Documentation/vm/numa> for more.
2066 2068
2067config ARCH_POPULATES_NODE_MAP
2068 def_bool y
2069
2070config ARCH_SPARSEMEM_ENABLE 2069config ARCH_SPARSEMEM_ENABLE
2071 bool 2070 bool
2072 select SPARSEMEM_STATIC 2071 select SPARSEMEM_STATIC
@@ -2369,10 +2368,6 @@ config TC
2369 Linux driver support status is documented at: 2368 Linux driver support status is documented at:
2370 <http://www.linux-mips.org/wiki/DECstation> 2369 <http://www.linux-mips.org/wiki/DECstation>
2371 2370
2372#config ACCESSBUS
2373# bool "Access.Bus support"
2374# depends on TC
2375
2376config MMU 2371config MMU
2377 bool 2372 bool
2378 default y 2373 default y
diff --git a/arch/mips/include/asm/ip32/mace.h b/arch/mips/include/asm/ip32/mace.h
index d08d7c672139..c523123df380 100644
--- a/arch/mips/include/asm/ip32/mace.h
+++ b/arch/mips/include/asm/ip32/mace.h
@@ -95,7 +95,7 @@ struct mace_video {
95 * Ethernet interface 95 * Ethernet interface
96 */ 96 */
97struct mace_ethernet { 97struct mace_ethernet {
98 volatile unsigned long mac_ctrl; 98 volatile u64 mac_ctrl;
99 volatile unsigned long int_stat; 99 volatile unsigned long int_stat;
100 volatile unsigned long dma_ctrl; 100 volatile unsigned long dma_ctrl;
101 volatile unsigned long timer; 101 volatile unsigned long timer;
diff --git a/arch/mips/include/asm/ipcbuf.h b/arch/mips/include/asm/ipcbuf.h
index d47d08f264e7..84c7e51cb6d0 100644
--- a/arch/mips/include/asm/ipcbuf.h
+++ b/arch/mips/include/asm/ipcbuf.h
@@ -1,28 +1 @@
1#ifndef _ASM_IPCBUF_H #include <asm-generic/ipcbuf.h>
2#define _ASM_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for alpha architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit seq
11 * - 2 miscellaneous 64-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid_t uid;
18 __kernel_gid_t gid;
19 __kernel_uid_t cuid;
20 __kernel_gid_t cgid;
21 __kernel_mode_t mode;
22 unsigned short seq;
23 unsigned short __pad1;
24 unsigned long __unused1;
25 unsigned long __unused2;
26};
27
28#endif /* _ASM_IPCBUF_H */
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index 9de5190f2487..ad5c0a7a02a7 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -82,6 +82,9 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
82 82
83#define SO_RXQ_OVFL 40 83#define SO_RXQ_OVFL 40
84 84
85#define SO_WIFI_STATUS 41
86#define SCM_WIFI_STATUS SO_WIFI_STATUS
87
85#ifdef __KERNEL__ 88#ifdef __KERNEL__
86 89
87/** sock_type - Socket types 90/** sock_type - Socket types
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 97f8bf6639e7..0d85d8e440c5 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -117,7 +117,6 @@ register struct thread_info *__current_thread_info __asm__("$28");
117#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 117#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
118#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 118#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
119#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 119#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
120#define TIF_FREEZE 19
121#define TIF_FIXADE 20 /* Fix address errors in software */ 120#define TIF_FIXADE 20 /* Fix address errors in software */
122#define TIF_LOGADE 21 /* Log address errors to syslog */ 121#define TIF_LOGADE 21 /* Log address errors to syslog */
123#define TIF_32BIT_REGS 22 /* also implies 16/32 fprs */ 122#define TIF_32BIT_REGS 22 /* also implies 16/32 fprs */
@@ -141,7 +140,6 @@ register struct thread_info *__current_thread_info __asm__("$28");
141#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 140#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
142#define _TIF_USEDFPU (1<<TIF_USEDFPU) 141#define _TIF_USEDFPU (1<<TIF_USEDFPU)
143#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 142#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
144#define _TIF_FREEZE (1<<TIF_FREEZE)
145#define _TIF_FIXADE (1<<TIF_FIXADE) 143#define _TIF_FIXADE (1<<TIF_FIXADE)
146#define _TIF_LOGADE (1<<TIF_LOGADE) 144#define _TIF_LOGADE (1<<TIF_LOGADE)
147#define _TIF_32BIT_REGS (1<<TIF_32BIT_REGS) 145#define _TIF_32BIT_REGS (1<<TIF_32BIT_REGS)
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h
index 533812b61881..43bf70ebd3a2 100644
--- a/arch/mips/include/asm/types.h
+++ b/arch/mips/include/asm/types.h
@@ -21,12 +21,6 @@
21# include <asm-generic/int-ll64.h> 21# include <asm-generic/int-ll64.h>
22#endif 22#endif
23 23
24#ifndef __ASSEMBLY__
25
26typedef unsigned short umode_t;
27
28#endif /* __ASSEMBLY__ */
29
30/* 24/*
31 * These aren't exported outside the kernel to avoid name space clashes 25 * These aren't exported outside the kernel to avoid name space clashes
32 */ 26 */
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index 4f2971bcf8e5..315fc0b250f8 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -623,7 +623,7 @@ static int mipspmu_event_init(struct perf_event *event)
623 if (!atomic_inc_not_zero(&active_events)) { 623 if (!atomic_inc_not_zero(&active_events)) {
624 if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) { 624 if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) {
625 atomic_dec(&active_events); 625 atomic_dec(&active_events);
626 return -ENOSPC; 626 return -EINVAL;
627 } 627 }
628 628
629 mutex_lock(&pmu_reserve_mutex); 629 mutex_lock(&pmu_reserve_mutex);
@@ -732,15 +732,15 @@ static int validate_group(struct perf_event *event)
732 memset(&fake_cpuc, 0, sizeof(fake_cpuc)); 732 memset(&fake_cpuc, 0, sizeof(fake_cpuc));
733 733
734 if (!validate_event(&fake_cpuc, leader)) 734 if (!validate_event(&fake_cpuc, leader))
735 return -ENOSPC; 735 return -EINVAL;
736 736
737 list_for_each_entry(sibling, &leader->sibling_list, group_entry) { 737 list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
738 if (!validate_event(&fake_cpuc, sibling)) 738 if (!validate_event(&fake_cpuc, sibling))
739 return -ENOSPC; 739 return -EINVAL;
740 } 740 }
741 741
742 if (!validate_event(&fake_cpuc, event)) 742 if (!validate_event(&fake_cpuc, event))
743 return -ENOSPC; 743 return -EINVAL;
744 744
745 return 0; 745 return 0;
746} 746}
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index c47f96e453c0..7955409051c4 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -56,7 +56,8 @@ void __noreturn cpu_idle(void)
56 56
57 /* endless idle loop with no priority at all */ 57 /* endless idle loop with no priority at all */
58 while (1) { 58 while (1) {
59 tick_nohz_stop_sched_tick(1); 59 tick_nohz_idle_enter();
60 rcu_idle_enter();
60 while (!need_resched() && cpu_online(cpu)) { 61 while (!need_resched() && cpu_online(cpu)) {
61#ifdef CONFIG_MIPS_MT_SMTC 62#ifdef CONFIG_MIPS_MT_SMTC
62 extern void smtc_idle_loop_hook(void); 63 extern void smtc_idle_loop_hook(void);
@@ -77,7 +78,8 @@ void __noreturn cpu_idle(void)
77 system_state == SYSTEM_BOOTING)) 78 system_state == SYSTEM_BOOTING))
78 play_dead(); 79 play_dead();
79#endif 80#endif
80 tick_nohz_restart_sched_tick(); 81 rcu_idle_exit();
82 tick_nohz_idle_exit();
81 preempt_enable_no_resched(); 83 preempt_enable_no_resched();
82 schedule(); 84 schedule();
83 preempt_disable(); 85 preempt_disable();
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 84af26ab2212..b1cb8f87d7b4 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -14,6 +14,7 @@
14#include <linux/ioport.h> 14#include <linux/ioport.h>
15#include <linux/export.h> 15#include <linux/export.h>
16#include <linux/screen_info.h> 16#include <linux/screen_info.h>
17#include <linux/memblock.h>
17#include <linux/bootmem.h> 18#include <linux/bootmem.h>
18#include <linux/initrd.h> 19#include <linux/initrd.h>
19#include <linux/root_dev.h> 20#include <linux/root_dev.h>
@@ -352,7 +353,7 @@ static void __init bootmem_init(void)
352 continue; 353 continue;
353#endif 354#endif
354 355
355 add_active_range(0, start, end); 356 memblock_add_node(PFN_PHYS(start), PFN_PHYS(end - start), 0);
356 } 357 }
357 358
358 /* 359 /*
diff --git a/arch/mips/sgi-ip27/Kconfig b/arch/mips/sgi-ip27/Kconfig
index bc5e9769bb73..4b2ea282b9c7 100644
--- a/arch/mips/sgi-ip27/Kconfig
+++ b/arch/mips/sgi-ip27/Kconfig
@@ -1,9 +1,3 @@
1#config SGI_SN0_XXL
2# bool "IP27 XXL"
3# depends on SGI_IP27
4# This options adds support for userspace processes up to 16TB size.
5# Normally the limit is just .5TB.
6
7choice 1choice
8 prompt "Node addressing mode" 2 prompt "Node addressing mode"
9 depends on SGI_IP27 3 depends on SGI_IP27
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index bc1297109cc5..b105eca3c020 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -12,6 +12,7 @@
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/memblock.h>
15#include <linux/mm.h> 16#include <linux/mm.h>
16#include <linux/mmzone.h> 17#include <linux/mmzone.h>
17#include <linux/module.h> 18#include <linux/module.h>
@@ -381,8 +382,8 @@ static void __init szmem(void)
381 continue; 382 continue;
382 } 383 }
383 num_physpages += slot_psize; 384 num_physpages += slot_psize;
384 add_active_range(node, slot_getbasepfn(node, slot), 385 memblock_add_node(PFN_PHYS(slot_getbasepfn(node, slot)),
385 slot_getbasepfn(node, slot) + slot_psize); 386 PFN_PHYS(slot_psize), node);
386 } 387 }
387 } 388 }
388} 389}
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig
index 3e639bda43f7..3cd937e0e9a3 100644
--- a/arch/mips/sibyte/Kconfig
+++ b/arch/mips/sibyte/Kconfig
@@ -71,7 +71,6 @@ config SIBYTE_SB1xxx_SOC
71 bool 71 bool
72 select DMA_COHERENT 72 select DMA_COHERENT
73 select IRQ_CPU 73 select IRQ_CPU
74 select SIBYTE_CFE
75 select SWAP_IO_SPACE 74 select SWAP_IO_SPACE
76 select SYS_SUPPORTS_32BIT_KERNEL 75 select SYS_SUPPORTS_32BIT_KERNEL
77 select SYS_SUPPORTS_64BIT_KERNEL 76 select SYS_SUPPORTS_64BIT_KERNEL
diff --git a/arch/mips/txx9/generic/7segled.c b/arch/mips/txx9/generic/7segled.c
index 7f8416f86222..8e93b2122524 100644
--- a/arch/mips/txx9/generic/7segled.c
+++ b/arch/mips/txx9/generic/7segled.c
@@ -9,7 +9,7 @@
9 * (C) Copyright TOSHIBA CORPORATION 2005-2007 9 * (C) Copyright TOSHIBA CORPORATION 2005-2007
10 * All Rights Reserved. 10 * All Rights Reserved.
11 */ 11 */
12#include <linux/sysdev.h> 12#include <linux/device.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/map_to_7segment.h> 14#include <linux/map_to_7segment.h>
15#include <asm/txx9/generic.h> 15#include <asm/txx9/generic.h>
@@ -37,8 +37,8 @@ int txx9_7segled_putc(unsigned int pos, char c)
37 return 0; 37 return 0;
38} 38}
39 39
40static ssize_t ascii_store(struct sys_device *dev, 40static ssize_t ascii_store(struct device *dev,
41 struct sysdev_attribute *attr, 41 struct device_attribute *attr,
42 const char *buf, size_t size) 42 const char *buf, size_t size)
43{ 43{
44 unsigned int ch = dev->id; 44 unsigned int ch = dev->id;
@@ -46,8 +46,8 @@ static ssize_t ascii_store(struct sys_device *dev,
46 return size; 46 return size;
47} 47}
48 48
49static ssize_t raw_store(struct sys_device *dev, 49static ssize_t raw_store(struct device *dev,
50 struct sysdev_attribute *attr, 50 struct device_attribute *attr,
51 const char *buf, size_t size) 51 const char *buf, size_t size)
52{ 52{
53 unsigned int ch = dev->id; 53 unsigned int ch = dev->id;
@@ -55,19 +55,19 @@ static ssize_t raw_store(struct sys_device *dev,
55 return size; 55 return size;
56} 56}
57 57
58static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store); 58static DEVICE_ATTR(ascii, 0200, NULL, ascii_store);
59static SYSDEV_ATTR(raw, 0200, NULL, raw_store); 59static DEVICE_ATTR(raw, 0200, NULL, raw_store);
60 60
61static ssize_t map_seg7_show(struct sysdev_class *class, 61static ssize_t map_seg7_show(struct device *dev,
62 struct sysdev_class_attribute *attr, 62 struct device_attribute *attr,
63 char *buf) 63 char *buf)
64{ 64{
65 memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map)); 65 memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map));
66 return sizeof(txx9_seg7map); 66 return sizeof(txx9_seg7map);
67} 67}
68 68
69static ssize_t map_seg7_store(struct sysdev_class *class, 69static ssize_t map_seg7_store(struct device *dev,
70 struct sysdev_class_attribute *attr, 70 struct device_attribute *attr,
71 const char *buf, size_t size) 71 const char *buf, size_t size)
72{ 72{
73 if (size != sizeof(txx9_seg7map)) 73 if (size != sizeof(txx9_seg7map))
@@ -76,10 +76,11 @@ static ssize_t map_seg7_store(struct sysdev_class *class,
76 return size; 76 return size;
77} 77}
78 78
79static SYSDEV_CLASS_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); 79static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store);
80 80
81static struct sysdev_class tx_7segled_sysdev_class = { 81static struct bus_type tx_7segled_subsys = {
82 .name = "7segled", 82 .name = "7segled",
83 .dev_name = "7segled",
83}; 84};
84 85
85static int __init tx_7segled_init_sysfs(void) 86static int __init tx_7segled_init_sysfs(void)
@@ -87,26 +88,25 @@ static int __init tx_7segled_init_sysfs(void)
87 int error, i; 88 int error, i;
88 if (!tx_7segled_num) 89 if (!tx_7segled_num)
89 return -ENODEV; 90 return -ENODEV;
90 error = sysdev_class_register(&tx_7segled_sysdev_class); 91 error = subsys_system_register(&tx_7segled_subsys, NULL);
91 if (error) 92 if (error)
92 return error; 93 return error;
93 error = sysdev_class_create_file(&tx_7segled_sysdev_class, 94 error = device_create_file(tx_7segled_subsys.dev_root, &dev_attr_map_seg7);
94 &attr_map_seg7);
95 if (error) 95 if (error)
96 return error; 96 return error;
97 for (i = 0; i < tx_7segled_num; i++) { 97 for (i = 0; i < tx_7segled_num; i++) {
98 struct sys_device *dev; 98 struct device *dev;
99 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 99 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
100 if (!dev) { 100 if (!dev) {
101 error = -ENODEV; 101 error = -ENODEV;
102 break; 102 break;
103 } 103 }
104 dev->id = i; 104 dev->id = i;
105 dev->cls = &tx_7segled_sysdev_class; 105 dev->dev = &tx_7segled_subsys;
106 error = sysdev_register(dev); 106 error = device_register(dev);
107 if (!error) { 107 if (!error) {
108 sysdev_create_file(dev, &attr_ascii); 108 device_create_file(dev, &dev_attr_ascii);
109 sysdev_create_file(dev, &attr_raw); 109 device_create_file(dev, &dev_attr_raw);
110 } 110 }
111 } 111 }
112 return error; 112 return error;
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index ec38e00b2559..ae77a7916c03 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -22,7 +22,7 @@
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/leds.h> 24#include <linux/leds.h>
25#include <linux/sysdev.h> 25#include <linux/device.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
@@ -897,10 +897,13 @@ void __init txx9_aclc_init(unsigned long baseaddr, int irq,
897#endif 897#endif
898} 898}
899 899
900static struct sysdev_class txx9_sramc_sysdev_class; 900static struct bus_type txx9_sramc_subsys = {
901 .name = "txx9_sram",
902 .dev_name = "txx9_sram",
903};
901 904
902struct txx9_sramc_sysdev { 905struct txx9_sramc_dev {
903 struct sys_device dev; 906 struct device dev;
904 struct bin_attribute bindata_attr; 907 struct bin_attribute bindata_attr;
905 void __iomem *base; 908 void __iomem *base;
906}; 909};
@@ -909,7 +912,7 @@ static ssize_t txx9_sram_read(struct file *filp, struct kobject *kobj,
909 struct bin_attribute *bin_attr, 912 struct bin_attribute *bin_attr,
910 char *buf, loff_t pos, size_t size) 913 char *buf, loff_t pos, size_t size)
911{ 914{
912 struct txx9_sramc_sysdev *dev = bin_attr->private; 915 struct txx9_sramc_dev *dev = bin_attr->private;
913 size_t ramsize = bin_attr->size; 916 size_t ramsize = bin_attr->size;
914 917
915 if (pos >= ramsize) 918 if (pos >= ramsize)
@@ -924,7 +927,7 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj,
924 struct bin_attribute *bin_attr, 927 struct bin_attribute *bin_attr,
925 char *buf, loff_t pos, size_t size) 928 char *buf, loff_t pos, size_t size)
926{ 929{
927 struct txx9_sramc_sysdev *dev = bin_attr->private; 930 struct txx9_sramc_dev *dev = bin_attr->private;
928 size_t ramsize = bin_attr->size; 931 size_t ramsize = bin_attr->size;
929 932
930 if (pos >= ramsize) 933 if (pos >= ramsize)
@@ -937,18 +940,13 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj,
937 940
938void __init txx9_sramc_init(struct resource *r) 941void __init txx9_sramc_init(struct resource *r)
939{ 942{
940 struct txx9_sramc_sysdev *dev; 943 struct txx9_sramc_dev *dev;
941 size_t size; 944 size_t size;
942 int err; 945 int err;
943 946
944 if (!txx9_sramc_sysdev_class.name) { 947 err = subsys_system_register(&txx9_sramc_subsys, NULL);
945 txx9_sramc_sysdev_class.name = "txx9_sram"; 948 if (err)
946 err = sysdev_class_register(&txx9_sramc_sysdev_class); 949 return;
947 if (err) {
948 txx9_sramc_sysdev_class.name = NULL;
949 return;
950 }
951 }
952 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 950 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
953 if (!dev) 951 if (!dev)
954 return; 952 return;
@@ -956,7 +954,7 @@ void __init txx9_sramc_init(struct resource *r)
956 dev->base = ioremap(r->start, size); 954 dev->base = ioremap(r->start, size);
957 if (!dev->base) 955 if (!dev->base)
958 goto exit; 956 goto exit;
959 dev->dev.cls = &txx9_sramc_sysdev_class; 957 dev->dev.bus = &txx9_sramc_subsys;
960 sysfs_bin_attr_init(&dev->bindata_attr); 958 sysfs_bin_attr_init(&dev->bindata_attr);
961 dev->bindata_attr.attr.name = "bindata"; 959 dev->bindata_attr.attr.name = "bindata";
962 dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; 960 dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR;
@@ -964,12 +962,12 @@ void __init txx9_sramc_init(struct resource *r)
964 dev->bindata_attr.write = txx9_sram_write; 962 dev->bindata_attr.write = txx9_sram_write;
965 dev->bindata_attr.size = size; 963 dev->bindata_attr.size = size;
966 dev->bindata_attr.private = dev; 964 dev->bindata_attr.private = dev;
967 err = sysdev_register(&dev->dev); 965 err = device_register(&dev->dev);
968 if (err) 966 if (err)
969 goto exit; 967 goto exit;
970 err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr); 968 err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr);
971 if (err) { 969 if (err) {
972 sysdev_unregister(&dev->dev); 970 device_unregister(&dev->dev);
973 goto exit; 971 goto exit;
974 } 972 }
975 return; 973 return;
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
index ba3cec3155df..6567895d1f59 100644
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -15,7 +15,7 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/netdevice.h> 16#include <linux/netdevice.h>
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/sysdev.h> 18#include <linux/device.h>
19#include <linux/ethtool.h> 19#include <linux/ethtool.h>
20#include <linux/param.h> 20#include <linux/param.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
diff --git a/arch/mn10300/include/asm/ipcbuf.h b/arch/mn10300/include/asm/ipcbuf.h
index f6f63d448272..84c7e51cb6d0 100644
--- a/arch/mn10300/include/asm/ipcbuf.h
+++ b/arch/mn10300/include/asm/ipcbuf.h
@@ -1,29 +1 @@
1#ifndef _ASM_IPCBUF_H #include <asm-generic/ipcbuf.h>
2#define _ASM_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for MN10300 architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* _ASM_IPCBUF_H */
diff --git a/arch/mn10300/include/asm/socket.h b/arch/mn10300/include/asm/socket.h
index 4e60c4281288..876356d78522 100644
--- a/arch/mn10300/include/asm/socket.h
+++ b/arch/mn10300/include/asm/socket.h
@@ -62,4 +62,7 @@
62 62
63#define SO_RXQ_OVFL 40 63#define SO_RXQ_OVFL 40
64 64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67
65#endif /* _ASM_SOCKET_H */ 68#endif /* _ASM_SOCKET_H */
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index 87c213002d4c..28cf52100baa 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -165,7 +165,6 @@ extern void free_thread_info(struct thread_info *);
165#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ 165#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
166#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 166#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
167#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ 167#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
168#define TIF_FREEZE 18 /* freezing for suspend */
169 168
170#define _TIF_SYSCALL_TRACE +(1 << TIF_SYSCALL_TRACE) 169#define _TIF_SYSCALL_TRACE +(1 << TIF_SYSCALL_TRACE)
171#define _TIF_NOTIFY_RESUME +(1 << TIF_NOTIFY_RESUME) 170#define _TIF_NOTIFY_RESUME +(1 << TIF_NOTIFY_RESUME)
@@ -174,7 +173,6 @@ extern void free_thread_info(struct thread_info *);
174#define _TIF_SINGLESTEP +(1 << TIF_SINGLESTEP) 173#define _TIF_SINGLESTEP +(1 << TIF_SINGLESTEP)
175#define _TIF_RESTORE_SIGMASK +(1 << TIF_RESTORE_SIGMASK) 174#define _TIF_RESTORE_SIGMASK +(1 << TIF_RESTORE_SIGMASK)
176#define _TIF_POLLING_NRFLAG +(1 << TIF_POLLING_NRFLAG) 175#define _TIF_POLLING_NRFLAG +(1 << TIF_POLLING_NRFLAG)
177#define _TIF_FREEZE +(1 << TIF_FREEZE)
178 176
179#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 177#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
180#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 178#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
diff --git a/arch/mn10300/include/asm/types.h b/arch/mn10300/include/asm/types.h
index c1833eb192e3..713d4ba108a5 100644
--- a/arch/mn10300/include/asm/types.h
+++ b/arch/mn10300/include/asm/types.h
@@ -13,12 +13,6 @@
13 13
14#include <asm-generic/int-ll64.h> 14#include <asm-generic/int-ll64.h>
15 15
16#ifndef __ASSEMBLY__
17
18typedef unsigned short umode_t;
19
20#endif /* __ASSEMBLY__ */
21
22/* 16/*
23 * These aren't exported outside the kernel to avoid name space clashes 17 * These aren't exported outside the kernel to avoid name space clashes
24 */ 18 */
diff --git a/arch/openrisc/include/asm/memblock.h b/arch/openrisc/include/asm/memblock.h
deleted file mode 100644
index bbe5a1c788cb..000000000000
--- a/arch/openrisc/include/asm/memblock.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * OpenRISC Linux
3 *
4 * Linux architectural port borrowing liberally from similar works of
5 * others. All original copyrights apply as per the original source
6 * declaration.
7 *
8 * OpenRISC implementation:
9 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
10 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
11 * et al.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 */
18
19#ifndef __ASM_OPENRISC_MEMBLOCK_H
20#define __ASM_OPENRISC_MEMBLOCK_H
21
22/* empty */
23
24#endif /* __ASM_OPENRISC_MEMBLOCK_H */
diff --git a/arch/openrisc/kernel/idle.c b/arch/openrisc/kernel/idle.c
index d5bc5f813e89..e5fc78877830 100644
--- a/arch/openrisc/kernel/idle.c
+++ b/arch/openrisc/kernel/idle.c
@@ -51,7 +51,8 @@ void cpu_idle(void)
51 51
52 /* endless idle loop with no priority at all */ 52 /* endless idle loop with no priority at all */
53 while (1) { 53 while (1) {
54 tick_nohz_stop_sched_tick(1); 54 tick_nohz_idle_enter();
55 rcu_idle_enter();
55 56
56 while (!need_resched()) { 57 while (!need_resched()) {
57 check_pgt_cache(); 58 check_pgt_cache();
@@ -69,7 +70,8 @@ void cpu_idle(void)
69 set_thread_flag(TIF_POLLING_NRFLAG); 70 set_thread_flag(TIF_POLLING_NRFLAG);
70 } 71 }
71 72
72 tick_nohz_restart_sched_tick(); 73 rcu_idle_exit();
74 tick_nohz_idle_exit();
73 preempt_enable_no_resched(); 75 preempt_enable_no_resched();
74 schedule(); 76 schedule();
75 preempt_disable(); 77 preempt_disable();
diff --git a/arch/openrisc/kernel/prom.c b/arch/openrisc/kernel/prom.c
index 1bb58ba89afa..3d4478f6c942 100644
--- a/arch/openrisc/kernel/prom.c
+++ b/arch/openrisc/kernel/prom.c
@@ -76,14 +76,13 @@ void __init early_init_devtree(void *params)
76 of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line); 76 of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line);
77 77
78 /* Scan memory nodes and rebuild MEMBLOCKs */ 78 /* Scan memory nodes and rebuild MEMBLOCKs */
79 memblock_init();
80 of_scan_flat_dt(early_init_dt_scan_root, NULL); 79 of_scan_flat_dt(early_init_dt_scan_root, NULL);
81 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 80 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
82 81
83 /* Save command line for /proc/cmdline and then parse parameters */ 82 /* Save command line for /proc/cmdline and then parse parameters */
84 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); 83 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
85 84
86 memblock_analyze(); 85 memblock_allow_resize();
87 86
88 /* We must copy the flattend device tree from init memory to regular 87 /* We must copy the flattend device tree from init memory to regular
89 * memory because the device tree references the strings in it 88 * memory because the device tree references the strings in it
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c
index 6ab9580b0b00..d9dc6cd3b7d2 100644
--- a/arch/parisc/hpux/sys_hpux.c
+++ b/arch/parisc/hpux/sys_hpux.c
@@ -136,16 +136,9 @@ struct hpux_ustat {
136 */ 136 */
137static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf) 137static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf)
138{ 138{
139 struct super_block *s;
140 struct hpux_ustat tmp; /* Changed to hpux_ustat */ 139 struct hpux_ustat tmp; /* Changed to hpux_ustat */
141 struct kstatfs sbuf; 140 struct kstatfs sbuf;
142 int err = -EINVAL; 141 int err = vfs_ustat(dev, &sbuf);
143
144 s = user_get_super(dev);
145 if (s == NULL)
146 goto out;
147 err = statfs_by_dentry(s->s_root, &sbuf);
148 drop_super(s);
149 if (err) 142 if (err)
150 goto out; 143 goto out;
151 144
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
index 225b7d6a1a0a..d28c51b61067 100644
--- a/arch/parisc/include/asm/socket.h
+++ b/arch/parisc/include/asm/socket.h
@@ -61,6 +61,9 @@
61 61
62#define SO_RXQ_OVFL 0x4021 62#define SO_RXQ_OVFL 0x4021
63 63
64#define SO_WIFI_STATUS 0x4022
65#define SCM_WIFI_STATUS SO_WIFI_STATUS
66
64/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 67/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
65 * have to define SOCK_NONBLOCK to a different value here. 68 * have to define SOCK_NONBLOCK to a different value here.
66 */ 69 */
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
index aa8de727e90b..6d9c7c7973d0 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -58,7 +58,6 @@ struct thread_info {
58#define TIF_32BIT 4 /* 32 bit binary */ 58#define TIF_32BIT 4 /* 32 bit binary */
59#define TIF_MEMDIE 5 /* is terminating due to OOM killer */ 59#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
60#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */ 60#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
61#define TIF_FREEZE 7 /* is freezing for suspend */
62#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ 61#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
63#define TIF_SINGLESTEP 9 /* single stepping? */ 62#define TIF_SINGLESTEP 9 /* single stepping? */
64#define TIF_BLOCKSTEP 10 /* branch stepping? */ 63#define TIF_BLOCKSTEP 10 /* branch stepping? */
@@ -69,7 +68,6 @@ struct thread_info {
69#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 68#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
70#define _TIF_32BIT (1 << TIF_32BIT) 69#define _TIF_32BIT (1 << TIF_32BIT)
71#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 70#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
72#define _TIF_FREEZE (1 << TIF_FREEZE)
73#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 71#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
74#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 72#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
75#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) 73#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
diff --git a/arch/parisc/include/asm/types.h b/arch/parisc/include/asm/types.h
index 80e415c9936d..8866f9bbdeaf 100644
--- a/arch/parisc/include/asm/types.h
+++ b/arch/parisc/include/asm/types.h
@@ -3,10 +3,4 @@
3 3
4#include <asm-generic/int-ll64.h> 4#include <asm-generic/int-ll64.h>
5 5
6#ifndef __ASSEMBLY__
7
8typedef unsigned short umode_t;
9
10#endif /* __ASSEMBLY__ */
11
12#endif 6#endif
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 45b7389d77aa..7c0774397b89 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -198,8 +198,6 @@ static struct clocksource clocksource_cr16 = {
198 .rating = 300, 198 .rating = 300,
199 .read = read_cr16, 199 .read = read_cr16,
200 .mask = CLOCKSOURCE_MASK(BITS_PER_LONG), 200 .mask = CLOCKSOURCE_MASK(BITS_PER_LONG),
201 .mult = 0, /* to be set */
202 .shift = 22,
203 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 201 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
204}; 202};
205 203
@@ -270,7 +268,5 @@ void __init time_init(void)
270 268
271 /* register at clocksource framework */ 269 /* register at clocksource framework */
272 current_cr16_khz = PAGE0->mem_10msec/10; /* kHz */ 270 current_cr16_khz = PAGE0->mem_10msec/10; /* kHz */
273 clocksource_cr16.mult = clocksource_khz2mult(current_cr16_khz, 271 clocksource_register_khz(&clocksource_cr16, current_cr16_khz);
274 clocksource_cr16.shift);
275 clocksource_register(&clocksource_cr16);
276} 272}
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b177caa56d95..692ac7588e20 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -87,6 +87,10 @@ config ARCH_HAS_ILOG2_U64
87 bool 87 bool
88 default y if 64BIT 88 default y if 64BIT
89 89
90config ARCH_HAS_CPU_IDLE_WAIT
91 bool
92 default y
93
90config GENERIC_HWEIGHT 94config GENERIC_HWEIGHT
91 bool 95 bool
92 default y 96 default y
@@ -117,6 +121,7 @@ config PPC
117 select HAVE_KRETPROBES 121 select HAVE_KRETPROBES
118 select HAVE_ARCH_TRACEHOOK 122 select HAVE_ARCH_TRACEHOOK
119 select HAVE_MEMBLOCK 123 select HAVE_MEMBLOCK
124 select HAVE_MEMBLOCK_NODE_MAP
120 select HAVE_DMA_ATTRS 125 select HAVE_DMA_ATTRS
121 select HAVE_DMA_API_DEBUG 126 select HAVE_DMA_API_DEBUG
122 select USE_GENERIC_SMP_HELPERS if SMP 127 select USE_GENERIC_SMP_HELPERS if SMP
@@ -132,6 +137,7 @@ config PPC
132 select IRQ_PER_CPU 137 select IRQ_PER_CPU
133 select GENERIC_IRQ_SHOW 138 select GENERIC_IRQ_SHOW
134 select GENERIC_IRQ_SHOW_LEVEL 139 select GENERIC_IRQ_SHOW_LEVEL
140 select IRQ_FORCED_THREADING
135 select HAVE_RCU_TABLE_FREE if SMP 141 select HAVE_RCU_TABLE_FREE if SMP
136 select HAVE_SYSCALL_TRACEPOINTS 142 select HAVE_SYSCALL_TRACEPOINTS
137 select HAVE_BPF_JIT if (PPC64 && NET) 143 select HAVE_BPF_JIT if (PPC64 && NET)
@@ -345,7 +351,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
345 351
346config KEXEC 352config KEXEC
347 bool "kexec system call (EXPERIMENTAL)" 353 bool "kexec system call (EXPERIMENTAL)"
348 depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP && !47x)) && EXPERIMENTAL 354 depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP && !PPC_47x)) && EXPERIMENTAL
349 help 355 help
350 kexec is a system call that implements the ability to shutdown your 356 kexec is a system call that implements the ability to shutdown your
351 current kernel, and to start another kernel. It is like a reboot 357 current kernel, and to start another kernel. It is like a reboot
@@ -362,8 +368,9 @@ config KEXEC
362 368
363config CRASH_DUMP 369config CRASH_DUMP
364 bool "Build a kdump crash kernel" 370 bool "Build a kdump crash kernel"
365 depends on PPC64 || 6xx || FSL_BOOKE 371 depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP && !PPC_47x)
366 select RELOCATABLE if PPC64 || FSL_BOOKE 372 select RELOCATABLE if PPC64 || 44x
373 select DYNAMIC_MEMSTART if FSL_BOOKE
367 help 374 help
368 Build a kernel suitable for use as a kdump capture kernel. 375 Build a kernel suitable for use as a kdump capture kernel.
369 The same kernel binary can be used as production kernel and dump 376 The same kernel binary can be used as production kernel and dump
@@ -421,9 +428,6 @@ config ARCH_SPARSEMEM_DEFAULT
421 def_bool y 428 def_bool y
422 depends on (SMP && PPC_PSERIES) || PPC_PS3 429 depends on (SMP && PPC_PSERIES) || PPC_PS3
423 430
424config ARCH_POPULATES_NODE_MAP
425 def_bool y
426
427config SYS_SUPPORTS_HUGETLBFS 431config SYS_SUPPORTS_HUGETLBFS
428 bool 432 bool
429 433
@@ -687,6 +691,10 @@ config FSL_LBC
687 controller. Also contains some common code used by 691 controller. Also contains some common code used by
688 drivers for specific local bus peripherals. 692 drivers for specific local bus peripherals.
689 693
694config FSL_IFC
695 bool
696 depends on FSL_SOC
697
690config FSL_GTM 698config FSL_GTM
691 bool 699 bool
692 depends on PPC_83xx || QUICC_ENGINE || CPM2 700 depends on PPC_83xx || QUICC_ENGINE || CPM2
@@ -772,6 +780,10 @@ source "drivers/rapidio/Kconfig"
772 780
773endmenu 781endmenu
774 782
783config NONSTATIC_KERNEL
784 bool
785 default n
786
775menu "Advanced setup" 787menu "Advanced setup"
776 depends on PPC32 788 depends on PPC32
777 789
@@ -821,13 +833,32 @@ config LOWMEM_CAM_NUM
821 int "Number of CAMs to use to map low memory" if LOWMEM_CAM_NUM_BOOL 833 int "Number of CAMs to use to map low memory" if LOWMEM_CAM_NUM_BOOL
822 default 3 834 default 3
823 835
836config DYNAMIC_MEMSTART
837 bool "Enable page aligned dynamic load address for kernel (EXPERIMENTAL)"
838 depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && (FSL_BOOKE || 44x)
839 select NONSTATIC_KERNEL
840 help
841 This option enables the kernel to be loaded at any page aligned
842 physical address. The kernel creates a mapping from KERNELBASE to
843 the address where the kernel is loaded. The page size here implies
844 the TLB page size of the mapping for kernel on the particular platform.
845 Please refer to the init code for finding the TLB page size.
846
847 DYNAMIC_MEMSTART is an easy way of implementing pseudo-RELOCATABLE
848 kernel image, where the only restriction is the page aligned kernel
849 load address. When this option is enabled, the compile time physical
850 address CONFIG_PHYSICAL_START is ignored.
851
852 This option is overridden by CONFIG_RELOCATABLE
853
824config RELOCATABLE 854config RELOCATABLE
825 bool "Build a relocatable kernel (EXPERIMENTAL)" 855 bool "Build a relocatable kernel (EXPERIMENTAL)"
826 depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && (FSL_BOOKE || PPC_47x) 856 depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && 44x
857 select NONSTATIC_KERNEL
827 help 858 help
828 This builds a kernel image that is capable of running at the 859 This builds a kernel image that is capable of running at the
829 location the kernel is loaded at (some alignment restrictions may 860 location the kernel is loaded at, without any alignment restrictions.
830 exist). 861 This feature is a superset of DYNAMIC_MEMSTART and hence overrides it.
831 862
832 One use is for the kexec on panic case where the recovery kernel 863 One use is for the kexec on panic case where the recovery kernel
833 must live at a different physical address than the primary 864 must live at a different physical address than the primary
@@ -837,7 +868,11 @@ config RELOCATABLE
837 it has been loaded at and the compile time physical addresses 868 it has been loaded at and the compile time physical addresses
838 CONFIG_PHYSICAL_START is ignored. However CONFIG_PHYSICAL_START 869 CONFIG_PHYSICAL_START is ignored. However CONFIG_PHYSICAL_START
839 setting can still be useful to bootwrappers that need to know the 870 setting can still be useful to bootwrappers that need to know the
840 load location of the kernel (eg. u-boot/mkimage). 871 load address of the kernel (eg. u-boot/mkimage).
872
873config RELOCATABLE_PPC32
874 def_bool y
875 depends on PPC32 && RELOCATABLE
841 876
842config PAGE_OFFSET_BOOL 877config PAGE_OFFSET_BOOL
843 bool "Set custom page offset address" 878 bool "Set custom page offset address"
@@ -867,7 +902,7 @@ config KERNEL_START_BOOL
867config KERNEL_START 902config KERNEL_START
868 hex "Virtual address of kernel base" if KERNEL_START_BOOL 903 hex "Virtual address of kernel base" if KERNEL_START_BOOL
869 default PAGE_OFFSET if PAGE_OFFSET_BOOL 904 default PAGE_OFFSET if PAGE_OFFSET_BOOL
870 default "0xc2000000" if CRASH_DUMP && !RELOCATABLE 905 default "0xc2000000" if CRASH_DUMP && !NONSTATIC_KERNEL
871 default "0xc0000000" 906 default "0xc0000000"
872 907
873config PHYSICAL_START_BOOL 908config PHYSICAL_START_BOOL
@@ -880,7 +915,7 @@ config PHYSICAL_START_BOOL
880 915
881config PHYSICAL_START 916config PHYSICAL_START
882 hex "Physical address where the kernel is loaded" if PHYSICAL_START_BOOL 917 hex "Physical address where the kernel is loaded" if PHYSICAL_START_BOOL
883 default "0x02000000" if PPC_STD_MMU && CRASH_DUMP && !RELOCATABLE 918 default "0x02000000" if PPC_STD_MMU && CRASH_DUMP && !NONSTATIC_KERNEL
884 default "0x00000000" 919 default "0x00000000"
885 920
886config PHYSICAL_ALIGN 921config PHYSICAL_ALIGN
@@ -926,6 +961,7 @@ endmenu
926if PPC64 961if PPC64
927config RELOCATABLE 962config RELOCATABLE
928 bool "Build a relocatable kernel" 963 bool "Build a relocatable kernel"
964 select NONSTATIC_KERNEL
929 help 965 help
930 This builds a kernel image that is capable of running anywhere 966 This builds a kernel image that is capable of running anywhere
931 in the RMA (real memory area) at any 16k-aligned base address. 967 in the RMA (real memory area) at any 16k-aligned base address.
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 1b8a9c905cf7..4ccb2a009f74 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -336,4 +336,16 @@ config PPC_EARLY_DEBUG_CPM_ADDR
336 platform probing is done, all platforms selected must 336 platform probing is done, all platforms selected must
337 share the same address. 337 share the same address.
338 338
339config STRICT_DEVMEM
340 def_bool y
341 prompt "Filter access to /dev/mem"
342 help
343 This option restricts access to /dev/mem. If this option is
344 disabled, you allow userspace access to all memory, including
345 kernel and userspace memory. Accidental memory access is likely
346 to be disastrous.
347 Memory access is required for experts who want to debug the kernel.
348
349 If you are unsure, say Y.
350
339endmenu 351endmenu
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 57af16edc192..b8b105c01c64 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -63,9 +63,9 @@ override CC += -m$(CONFIG_WORD_SIZE)
63override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR) 63override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR)
64endif 64endif
65 65
66LDFLAGS_vmlinux-yy := -Bstatic 66LDFLAGS_vmlinux-y := -Bstatic
67LDFLAGS_vmlinux-$(CONFIG_PPC64)$(CONFIG_RELOCATABLE) := -pie 67LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
68LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-yy) 68LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y)
69 69
70CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc 70CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc
71CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple 71CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple
@@ -131,8 +131,7 @@ KBUILD_CFLAGS += -mno-sched-epilog
131endif 131endif
132 132
133cpu-as-$(CONFIG_4xx) += -Wa,-m405 133cpu-as-$(CONFIG_4xx) += -Wa,-m405
134cpu-as-$(CONFIG_6xx) += -Wa,-maltivec 134cpu-as-$(CONFIG_ALTIVEC) += -Wa,-maltivec
135cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
136cpu-as-$(CONFIG_E500) += -Wa,-me500 135cpu-as-$(CONFIG_E500) += -Wa,-me500
137cpu-as-$(CONFIG_E200) += -Wa,-me200 136cpu-as-$(CONFIG_E200) += -Wa,-me200
138 137
@@ -166,7 +165,7 @@ all: zImage
166 165
167# With make 3.82 we cannot mix normal and wildcard targets 166# With make 3.82 we cannot mix normal and wildcard targets
168BOOT_TARGETS1 := zImage zImage.initrd uImage 167BOOT_TARGETS1 := zImage zImage.initrd uImage
169BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% 168BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.%
170 169
171PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) 170PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
172 171
@@ -255,12 +254,6 @@ checkbin:
255 echo 'disable kernel modules' ; \ 254 echo 'disable kernel modules' ; \
256 false ; \ 255 false ; \
257 fi 256 fi
258 @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
259 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
260 echo 'correctly with old versions of binutils.' ; \
261 echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
262 false ; \
263 fi
264 257
265CLEAN_FILES += $(TOUT) 258CLEAN_FILES += $(TOUT)
266 259
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 72ee8c1fba48..15986e70799c 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -45,6 +45,7 @@ $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405
45$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405 45$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405
46$(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405 46$(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
47$(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405 47$(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405
48$(obj)/treeboot-currituck.o: BOOTCFLAGS += -mcpu=405
48$(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405 49$(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405
49 50
50 51
@@ -79,7 +80,8 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c
79 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ 80 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
80 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ 81 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
81 cuboot-acadia.c cuboot-amigaone.c cuboot-kilauea.c \ 82 cuboot-acadia.c cuboot-amigaone.c cuboot-kilauea.c \
82 gamecube-head.S gamecube.c wii-head.S wii.c treeboot-iss4xx.c 83 gamecube-head.S gamecube.c wii-head.S wii.c treeboot-iss4xx.c \
84 treeboot-currituck.c
83src-boot := $(src-wlib) $(src-plat) empty.c 85src-boot := $(src-wlib) $(src-plat) empty.c
84 86
85src-boot := $(addprefix $(obj)/, $(src-boot)) 87src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -199,6 +201,7 @@ image-$(CONFIG_EP405) += dtbImage.ep405
199image-$(CONFIG_HOTFOOT) += cuImage.hotfoot 201image-$(CONFIG_HOTFOOT) += cuImage.hotfoot
200image-$(CONFIG_WALNUT) += treeImage.walnut 202image-$(CONFIG_WALNUT) += treeImage.walnut
201image-$(CONFIG_ACADIA) += cuImage.acadia 203image-$(CONFIG_ACADIA) += cuImage.acadia
204image-$(CONFIG_OBS600) += uImage.obs600
202 205
203# Board ports in arch/powerpc/platform/44x/Kconfig 206# Board ports in arch/powerpc/platform/44x/Kconfig
204image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony 207image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
@@ -212,6 +215,7 @@ image-$(CONFIG_WARP) += cuImage.warp
212image-$(CONFIG_YOSEMITE) += cuImage.yosemite 215image-$(CONFIG_YOSEMITE) += cuImage.yosemite
213image-$(CONFIG_ISS4xx) += treeImage.iss4xx \ 216image-$(CONFIG_ISS4xx) += treeImage.iss4xx \
214 treeImage.iss4xx-mpic 217 treeImage.iss4xx-mpic
218image-$(CONFIG_CURRITUCK) += treeImage.currituck
215 219
216# Board ports in arch/powerpc/platform/8xx/Kconfig 220# Board ports in arch/powerpc/platform/8xx/Kconfig
217image-$(CONFIG_MPC86XADS) += cuImage.mpc866ads 221image-$(CONFIG_MPC86XADS) += cuImage.mpc866ads
@@ -316,6 +320,12 @@ $(obj)/zImage.iseries: vmlinux
316$(obj)/uImage: vmlinux $(wrapperbits) 320$(obj)/uImage: vmlinux $(wrapperbits)
317 $(call if_changed,wrap,uboot) 321 $(call if_changed,wrap,uboot)
318 322
323$(obj)/uImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
324 $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
325
326$(obj)/uImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
327 $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb)
328
319$(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) 329$(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
320 $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz) 330 $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
321 331
diff --git a/arch/powerpc/boot/dcr.h b/arch/powerpc/boot/dcr.h
index 645a7c964e5f..cc73f7a95e26 100644
--- a/arch/powerpc/boot/dcr.h
+++ b/arch/powerpc/boot/dcr.h
@@ -9,6 +9,12 @@
9 }) 9 })
10#define mtdcr(rn, val) \ 10#define mtdcr(rn, val) \
11 asm volatile("mtdcr %0,%1" : : "i"(rn), "r"(val)) 11 asm volatile("mtdcr %0,%1" : : "i"(rn), "r"(val))
12#define mfdcrx(rn) \
13 ({ \
14 unsigned long rval; \
15 asm volatile("mfdcrx %0,%1" : "=r"(rval) : "r"(rn)); \
16 rval; \
17 })
12 18
13/* 440GP/440GX SDRAM controller DCRs */ 19/* 440GP/440GX SDRAM controller DCRs */
14#define DCRN_SDRAM0_CFGADDR 0x010 20#define DCRN_SDRAM0_CFGADDR 0x010
diff --git a/arch/powerpc/boot/div64.S b/arch/powerpc/boot/div64.S
index d271ab542673..bbcb8a4cc121 100644
--- a/arch/powerpc/boot/div64.S
+++ b/arch/powerpc/boot/div64.S
@@ -57,3 +57,55 @@ __div64_32:
57 stw r8,4(r3) 57 stw r8,4(r3)
58 mr r3,r6 # return the remainder in r3 58 mr r3,r6 # return the remainder in r3
59 blr 59 blr
60
61/*
62 * Extended precision shifts.
63 *
64 * Updated to be valid for shift counts from 0 to 63 inclusive.
65 * -- Gabriel
66 *
67 * R3/R4 has 64 bit value
68 * R5 has shift count
69 * result in R3/R4
70 *
71 * ashrdi3: arithmetic right shift (sign propagation)
72 * lshrdi3: logical right shift
73 * ashldi3: left shift
74 */
75 .globl __ashrdi3
76__ashrdi3:
77 subfic r6,r5,32
78 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
79 addi r7,r5,32 # could be xori, or addi with -32
80 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
81 rlwinm r8,r7,0,32 # t3 = (count < 32) ? 32 : 0
82 sraw r7,r3,r7 # t2 = MSW >> (count-32)
83 or r4,r4,r6 # LSW |= t1
84 slw r7,r7,r8 # t2 = (count < 32) ? 0 : t2
85 sraw r3,r3,r5 # MSW = MSW >> count
86 or r4,r4,r7 # LSW |= t2
87 blr
88
89 .globl __ashldi3
90__ashldi3:
91 subfic r6,r5,32
92 slw r3,r3,r5 # MSW = count > 31 ? 0 : MSW << count
93 addi r7,r5,32 # could be xori, or addi with -32
94 srw r6,r4,r6 # t1 = count > 31 ? 0 : LSW >> (32-count)
95 slw r7,r4,r7 # t2 = count < 32 ? 0 : LSW << (count-32)
96 or r3,r3,r6 # MSW |= t1
97 slw r4,r4,r5 # LSW = LSW << count
98 or r3,r3,r7 # MSW |= t2
99 blr
100
101 .globl __lshrdi3
102__lshrdi3:
103 subfic r6,r5,32
104 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
105 addi r7,r5,32 # could be xori, or addi with -32
106 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
107 srw r7,r3,r7 # t2 = count < 32 ? 0 : MSW >> (count-32)
108 or r4,r4,r6 # LSW |= t1
109 srw r3,r3,r5 # MSW = MSW >> count
110 or r4,r4,r7 # LSW |= t2
111 blr
diff --git a/arch/powerpc/boot/dts/asp834x-redboot.dts b/arch/powerpc/boot/dts/asp834x-redboot.dts
index 261d10c4534b..227290db866d 100644
--- a/arch/powerpc/boot/dts/asp834x-redboot.dts
+++ b/arch/powerpc/boot/dts/asp834x-redboot.dts
@@ -256,7 +256,7 @@
256 serial0: serial@4500 { 256 serial0: serial@4500 {
257 cell-index = <0>; 257 cell-index = <0>;
258 device_type = "serial"; 258 device_type = "serial";
259 compatible = "ns16550"; 259 compatible = "fsl,ns16550", "ns16550";
260 reg = <0x4500 0x100>; 260 reg = <0x4500 0x100>;
261 clock-frequency = <400000000>; 261 clock-frequency = <400000000>;
262 interrupts = <9 0x8>; 262 interrupts = <9 0x8>;
@@ -266,7 +266,7 @@
266 serial1: serial@4600 { 266 serial1: serial@4600 {
267 cell-index = <1>; 267 cell-index = <1>;
268 device_type = "serial"; 268 device_type = "serial";
269 compatible = "ns16550"; 269 compatible = "fsl,ns16550", "ns16550";
270 reg = <0x4600 0x100>; 270 reg = <0x4600 0x100>;
271 clock-frequency = <400000000>; 271 clock-frequency = <400000000>;
272 interrupts = <10 0x8>; 272 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/currituck.dts b/arch/powerpc/boot/dts/currituck.dts
new file mode 100644
index 000000000000..b801dd06e573
--- /dev/null
+++ b/arch/powerpc/boot/dts/currituck.dts
@@ -0,0 +1,237 @@
1/*
2 * Device Tree Source for IBM Embedded PPC 476 Platform
3 *
4 * Copyright © 2011 Tony Breeds IBM Corporation
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/memreserve/ 0x01f00000 0x00100000; // spin table
14
15/ {
16 #address-cells = <2>;
17 #size-cells = <2>;
18 model = "ibm,currituck";
19 compatible = "ibm,currituck";
20 dcr-parent = <&{/cpus/cpu@0}>;
21
22 aliases {
23 serial0 = &UART0;
24 };
25
26 cpus {
27 #address-cells = <1>;
28 #size-cells = <0>;
29
30 cpu@0 {
31 device_type = "cpu";
32 model = "PowerPC,476";
33 reg = <0>;
34 clock-frequency = <1600000000>; // 1.6 GHz
35 timebase-frequency = <100000000>; // 100Mhz
36 i-cache-line-size = <32>;
37 d-cache-line-size = <32>;
38 i-cache-size = <32768>;
39 d-cache-size = <32768>;
40 dcr-controller;
41 dcr-access-method = "native";
42 status = "ok";
43 };
44 cpu@1 {
45 device_type = "cpu";
46 model = "PowerPC,476";
47 reg = <1>;
48 clock-frequency = <1600000000>; // 1.6 GHz
49 timebase-frequency = <100000000>; // 100Mhz
50 i-cache-line-size = <32>;
51 d-cache-line-size = <32>;
52 i-cache-size = <32768>;
53 d-cache-size = <32768>;
54 dcr-controller;
55 dcr-access-method = "native";
56 status = "disabled";
57 enable-method = "spin-table";
58 cpu-release-addr = <0x0 0x01f00000>;
59 };
60 };
61
62 memory {
63 device_type = "memory";
64 reg = <0x0 0x0 0x0 0x0>; // filled in by zImage
65 };
66
67 MPIC: interrupt-controller {
68 compatible = "chrp,open-pic";
69 interrupt-controller;
70 dcr-reg = <0xffc00000 0x00040000>;
71 #address-cells = <0>;
72 #size-cells = <0>;
73 #interrupt-cells = <2>;
74
75 };
76
77 plb {
78 compatible = "ibm,plb6";
79 #address-cells = <2>;
80 #size-cells = <2>;
81 ranges;
82 clock-frequency = <200000000>; // 200Mhz
83
84 POB0: opb {
85 compatible = "ibm,opb-4xx", "ibm,opb";
86 #address-cells = <1>;
87 #size-cells = <1>;
88 /* Wish there was a nicer way of specifying a full
89 * 32-bit range
90 */
91 ranges = <0x00000000 0x00000200 0x00000000 0x80000000
92 0x80000000 0x00000200 0x80000000 0x80000000>;
93 clock-frequency = <100000000>;
94
95 UART0: serial@10000000 {
96 device_type = "serial";
97 compatible = "ns16750", "ns16550";
98 reg = <0x10000000 0x00000008>;
99 virtual-reg = <0xe1000000>;
100 clock-frequency = <1851851>; // PCIe refclk/MCGC0_CTL[UART]
101 current-speed = <115200>;
102 interrupt-parent = <&MPIC>;
103 interrupts = <34 2>;
104 };
105
106 IIC0: i2c@00000000 {
107 compatible = "ibm,iic-currituck", "ibm,iic";
108 reg = <0x0 0x00000014>;
109 interrupt-parent = <&MPIC>;
110 interrupts = <79 2>;
111 #address-cells = <1>;
112 #size-cells = <0>;
113 rtc@68 {
114 compatible = "stm,m41t80", "m41st85";
115 reg = <0x68>;
116 };
117 };
118 };
119
120 PCIE0: pciex@10100000000 { // 4xGBIF1
121 device_type = "pci";
122 #interrupt-cells = <1>;
123 #size-cells = <2>;
124 #address-cells = <3>;
125 compatible = "ibm,plb-pciex-476fpe", "ibm,plb-pciex";
126 primary;
127 port = <0x0>; /* port number */
128 reg = <0x00000101 0x00000000 0x0 0x10000000 /* Config space access */
129 0x00000100 0x00000000 0x0 0x00001000>; /* UTL Registers space access */
130 dcr-reg = <0x80 0x20>;
131
132// pci_space < pci_addr > < cpu_addr > < size >
133 ranges = <0x02000000 0x00000000 0x80000000 0x00000110 0x80000000 0x0 0x80000000
134 0x01000000 0x0 0x0 0x00000140 0x0 0x0 0x00010000>;
135
136 /* Inbound starting at 0 to memsize filled in by zImage */
137 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>;
138
139 /* This drives busses 0 to 0xf */
140 bus-range = <0x0 0xf>;
141
142 /* Legacy interrupts (note the weird polarity, the bridge seems
143 * to invert PCIe legacy interrupts).
144 * We are de-swizzling here because the numbers are actually for
145 * port of the root complex virtual P2P bridge. But I want
146 * to avoid putting a node for it in the tree, so the numbers
147 * below are basically de-swizzled numbers.
148 * The real slot is on idsel 0, so the swizzling is 1:1
149 */
150 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
151 interrupt-map = <
152 0x0 0x0 0x0 0x1 &MPIC 46 0x2 /* int A */
153 0x0 0x0 0x0 0x2 &MPIC 47 0x2 /* int B */
154 0x0 0x0 0x0 0x3 &MPIC 48 0x2 /* int C */
155 0x0 0x0 0x0 0x4 &MPIC 49 0x2 /* int D */>;
156 };
157
158 PCIE1: pciex@30100000000 { // 4xGBIF0
159 device_type = "pci";
160 #interrupt-cells = <1>;
161 #size-cells = <2>;
162 #address-cells = <3>;
163 compatible = "ibm,plb-pciex-476fpe", "ibm,plb-pciex";
164 primary;
165 port = <0x1>; /* port number */
166 reg = <0x00000301 0x00000000 0x0 0x10000000 /* Config space access */
167 0x00000300 0x00000000 0x0 0x00001000>; /* UTL Registers space access */
168 dcr-reg = <0x60 0x20>;
169
170 ranges = <0x02000000 0x00000000 0x80000000 0x00000310 0x80000000 0x0 0x80000000
171 0x01000000 0x0 0x0 0x00000340 0x0 0x0 0x00010000>;
172
173 /* Inbound starting at 0 to memsize filled in by zImage */
174 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>;
175
176 /* This drives busses 0 to 0xf */
177 bus-range = <0x0 0xf>;
178
179 /* Legacy interrupts (note the weird polarity, the bridge seems
180 * to invert PCIe legacy interrupts).
181 * We are de-swizzling here because the numbers are actually for
182 * port of the root complex virtual P2P bridge. But I want
183 * to avoid putting a node for it in the tree, so the numbers
184 * below are basically de-swizzled numbers.
185 * The real slot is on idsel 0, so the swizzling is 1:1
186 */
187 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
188 interrupt-map = <
189 0x0 0x0 0x0 0x1 &MPIC 38 0x2 /* int A */
190 0x0 0x0 0x0 0x2 &MPIC 39 0x2 /* int B */
191 0x0 0x0 0x0 0x3 &MPIC 40 0x2 /* int C */
192 0x0 0x0 0x0 0x4 &MPIC 41 0x2 /* int D */>;
193 };
194
195 PCIE2: pciex@38100000000 { // 2xGBIF0
196 device_type = "pci";
197 #interrupt-cells = <1>;
198 #size-cells = <2>;
199 #address-cells = <3>;
200 compatible = "ibm,plb-pciex-476fpe", "ibm,plb-pciex";
201 primary;
202 port = <0x2>; /* port number */
203 reg = <0x00000381 0x00000000 0x0 0x10000000 /* Config space access */
204 0x00000380 0x00000000 0x0 0x00001000>; /* UTL Registers space access */
205 dcr-reg = <0xA0 0x20>;
206
207 ranges = <0x02000000 0x00000000 0x80000000 0x00000390 0x80000000 0x0 0x80000000
208 0x01000000 0x0 0x0 0x000003C0 0x0 0x0 0x00010000>;
209
210 /* Inbound starting at 0 to memsize filled in by zImage */
211 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>;
212
213 /* This drives busses 0 to 0xf */
214 bus-range = <0x0 0xf>;
215
216 /* Legacy interrupts (note the weird polarity, the bridge seems
217 * to invert PCIe legacy interrupts).
218 * We are de-swizzling here because the numbers are actually for
219 * port of the root complex virtual P2P bridge. But I want
220 * to avoid putting a node for it in the tree, so the numbers
221 * below are basically de-swizzled numbers.
222 * The real slot is on idsel 0, so the swizzling is 1:1
223 */
224 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
225 interrupt-map = <
226 0x0 0x0 0x0 0x1 &MPIC 54 0x2 /* int A */
227 0x0 0x0 0x0 0x2 &MPIC 55 0x2 /* int B */
228 0x0 0x0 0x0 0x3 &MPIC 56 0x2 /* int C */
229 0x0 0x0 0x0 0x4 &MPIC 57 0x2 /* int D */>;
230 };
231
232 };
233
234 chosen {
235 linux,stdout-path = &UART0;
236 };
237};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8536si-post.dtsi b/arch/powerpc/boot/dts/fsl/mpc8536si-post.dtsi
new file mode 100644
index 000000000000..89af62637707
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8536si-post.dtsi
@@ -0,0 +1,248 @@
1/*
2 * MPC8536 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,mpc8536-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0x8000 */
43&pci0 {
44 compatible = "fsl,mpc8540-pci";
45 device_type = "pci";
46 interrupts = <24 0x2 0 0>;
47 bus-range = <0 0xff>;
48 #interrupt-cells = <1>;
49 #size-cells = <2>;
50 #address-cells = <3>;
51};
52
53/* controller at 0x9000 */
54&pci1 {
55 compatible = "fsl,mpc8548-pcie";
56 device_type = "pci";
57 #size-cells = <2>;
58 #address-cells = <3>;
59 bus-range = <0 255>;
60 clock-frequency = <33333333>;
61 interrupts = <25 2 0 0>;
62
63 pcie@0 {
64 reg = <0 0 0 0 0>;
65 #interrupt-cells = <1>;
66 #size-cells = <2>;
67 #address-cells = <3>;
68 device_type = "pci";
69 interrupts = <25 2 0 0>;
70 interrupt-map-mask = <0xf800 0 0 7>;
71
72 interrupt-map = <
73 /* IDSEL 0x0 */
74 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
75 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
76 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
77 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
78 >;
79 };
80};
81
82/* controller at 0xa000 */
83&pci2 {
84 compatible = "fsl,mpc8548-pcie";
85 device_type = "pci";
86 #size-cells = <2>;
87 #address-cells = <3>;
88 bus-range = <0 255>;
89 clock-frequency = <33333333>;
90 interrupts = <26 2 0 0>;
91
92 pcie@0 {
93 reg = <0 0 0 0 0>;
94 #interrupt-cells = <1>;
95 #size-cells = <2>;
96 #address-cells = <3>;
97 device_type = "pci";
98 interrupts = <26 2 0 0>;
99 interrupt-map-mask = <0xf800 0 0 7>;
100 interrupt-map = <
101 /* IDSEL 0x0 */
102 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
103 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
104 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
105 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
106 >;
107 };
108};
109
110/* controller at 0xb000 */
111&pci3 {
112 compatible = "fsl,mpc8548-pcie";
113 device_type = "pci";
114 #size-cells = <2>;
115 #address-cells = <3>;
116 bus-range = <0 255>;
117 clock-frequency = <33333333>;
118 interrupts = <27 2 0 0>;
119
120 pcie@0 {
121 reg = <0 0 0 0 0>;
122 #interrupt-cells = <1>;
123 #size-cells = <2>;
124 #address-cells = <3>;
125 device_type = "pci";
126 interrupts = <27 2 0 0>;
127 interrupt-map-mask = <0xf800 0 0 7>;
128 interrupt-map = <
129 /* IDSEL 0x0 */
130 0000 0x0 0x0 0x1 &mpic 0x8 0x1 0x0 0x0
131 0000 0x0 0x0 0x2 &mpic 0x9 0x1 0x0 0x0
132 0000 0x0 0x0 0x3 &mpic 0xa 0x1 0x0 0x0
133 0000 0x0 0x0 0x4 &mpic 0xb 0x1 0x0 0x0
134 >;
135 };
136};
137&soc {
138 #address-cells = <1>;
139 #size-cells = <1>;
140 device_type = "soc";
141 compatible = "fsl,mpc8536-immr", "simple-bus";
142 bus-frequency = <0>; // Filled out by uboot.
143
144 ecm-law@0 {
145 compatible = "fsl,ecm-law";
146 reg = <0x0 0x1000>;
147 fsl,num-laws = <12>;
148 };
149
150 ecm@1000 {
151 compatible = "fsl,mpc8536-ecm", "fsl,ecm";
152 reg = <0x1000 0x1000>;
153 interrupts = <17 2 0 0>;
154 };
155
156 memory-controller@2000 {
157 compatible = "fsl,mpc8536-memory-controller";
158 reg = <0x2000 0x1000>;
159 interrupts = <18 2 0 0>;
160 };
161
162/include/ "pq3-i2c-0.dtsi"
163/include/ "pq3-i2c-1.dtsi"
164/include/ "pq3-duart-0.dtsi"
165
166/include/ "pq3-espi-0.dtsi"
167 spi@7000 {
168 fsl,espi-num-chipselects = <4>;
169 };
170
171/include/ "pq3-gpio-0.dtsi"
172
173 /* mark compat w/8572 to get some erratum treatment */
174 gpio-controller@f000 {
175 compatible = "fsl,mpc8572-gpio", "fsl,pq3-gpio";
176 };
177
178 sata@18000 {
179 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
180 reg = <0x18000 0x1000>;
181 cell-index = <1>;
182 interrupts = <74 0x2 0 0>;
183 };
184
185 sata@19000 {
186 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
187 reg = <0x19000 0x1000>;
188 cell-index = <2>;
189 interrupts = <41 0x2 0 0>;
190 };
191
192 L2: l2-cache-controller@20000 {
193 compatible = "fsl,mpc8536-l2-cache-controller";
194 reg = <0x20000 0x1000>;
195 cache-line-size = <32>; // 32 bytes
196 cache-size = <0x80000>; // L2, 512K
197 interrupts = <16 2 0 0>;
198 };
199
200/include/ "pq3-dma-0.dtsi"
201/include/ "pq3-etsec1-0.dtsi"
202/include/ "pq3-etsec1-timer-0.dtsi"
203
204 usb@22000 {
205 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
206 reg = <0x22000 0x1000>;
207 #address-cells = <1>;
208 #size-cells = <0>;
209 interrupts = <28 0x2 0 0>;
210 };
211
212 usb@23000 {
213 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
214 reg = <0x23000 0x1000>;
215 #address-cells = <1>;
216 #size-cells = <0>;
217 interrupts = <46 0x2 0 0>;
218 };
219
220 ptp_clock@24e00 {
221 interrupts = <68 2 0 0 69 2 0 0 70 2 0 0 71 2 0 0>;
222 };
223
224/include/ "pq3-etsec1-2.dtsi"
225
226 ethernet@26000 {
227 cell-index = <1>;
228 };
229
230 usb@2b000 {
231 compatible = "fsl,mpc8536-usb2-dr", "fsl-usb2-dr";
232 reg = <0x2b000 0x1000>;
233 #address-cells = <1>;
234 #size-cells = <0>;
235 interrupts = <60 0x2 0 0>;
236 };
237
238/include/ "pq3-esdhc-0.dtsi"
239/include/ "pq3-sec3.0-0.dtsi"
240/include/ "pq3-mpic.dtsi"
241/include/ "pq3-mpic-timer-B.dtsi"
242
243 global-utilities@e0000 {
244 compatible = "fsl,mpc8536-guts";
245 reg = <0xe0000 0x1000>;
246 fsl,has-rstcr;
247 };
248};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8536si-pre.dtsi b/arch/powerpc/boot/dts/fsl/mpc8536si-pre.dtsi
new file mode 100644
index 000000000000..7de45a784df6
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8536si-pre.dtsi
@@ -0,0 +1,63 @@
1/*
2 * MPC8536 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,MPC8536";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet2;
47 pci0 = &pci0;
48 pci1 = &pci1;
49 pci2 = &pci2;
50 pci3 = &pci3;
51 };
52
53 cpus {
54 #address-cells = <1>;
55 #size-cells = <0>;
56
57 PowerPC,8536@0 {
58 device_type = "cpu";
59 reg = <0x0>;
60 next-level-cache = <&L2>;
61 };
62 };
63};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8544si-post.dtsi b/arch/powerpc/boot/dts/fsl/mpc8544si-post.dtsi
new file mode 100644
index 000000000000..b68eb119faef
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8544si-post.dtsi
@@ -0,0 +1,191 @@
1/*
2 * MPC8544 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,mpc8544-lbc", "fsl,pq3-localbus", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0x8000 */
43&pci0 {
44 compatible = "fsl,mpc8540-pci";
45 device_type = "pci";
46 interrupts = <24 0x2 0 0>;
47 bus-range = <0 0xff>;
48 #interrupt-cells = <1>;
49 #size-cells = <2>;
50 #address-cells = <3>;
51};
52
53/* controller at 0x9000 */
54&pci1 {
55 compatible = "fsl,mpc8548-pcie";
56 device_type = "pci";
57 #size-cells = <2>;
58 #address-cells = <3>;
59 bus-range = <0 255>;
60 clock-frequency = <33333333>;
61 interrupts = <25 2 0 0>;
62
63 pcie@0 {
64 reg = <0 0 0 0 0>;
65 #interrupt-cells = <1>;
66 #size-cells = <2>;
67 #address-cells = <3>;
68 device_type = "pci";
69 interrupts = <25 2 0 0>;
70 interrupt-map-mask = <0xf800 0 0 7>;
71
72 interrupt-map = <
73 /* IDSEL 0x0 */
74 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
75 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
76 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
77 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
78 >;
79 };
80};
81
82/* controller at 0xa000 */
83&pci2 {
84 compatible = "fsl,mpc8548-pcie";
85 device_type = "pci";
86 #size-cells = <2>;
87 #address-cells = <3>;
88 bus-range = <0 255>;
89 clock-frequency = <33333333>;
90 interrupts = <26 2 0 0>;
91
92 pcie@0 {
93 reg = <0 0 0 0 0>;
94 #interrupt-cells = <1>;
95 #size-cells = <2>;
96 #address-cells = <3>;
97 device_type = "pci";
98 interrupts = <26 2 0 0>;
99 interrupt-map-mask = <0xf800 0 0 7>;
100 interrupt-map = <
101 /* IDSEL 0x0 */
102 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
103 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
104 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
105 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
106 >;
107 };
108};
109
110/* controller at 0xb000 */
111&pci3 {
112 compatible = "fsl,mpc8548-pcie";
113 device_type = "pci";
114 #size-cells = <2>;
115 #address-cells = <3>;
116 bus-range = <0 255>;
117 clock-frequency = <33333333>;
118 interrupts = <27 2 0 0>;
119
120 pcie@0 {
121 reg = <0 0 0 0 0>;
122 #interrupt-cells = <1>;
123 #size-cells = <2>;
124 #address-cells = <3>;
125 device_type = "pci";
126 interrupts = <27 2 0 0>;
127 interrupt-map-mask = <0xf800 0 0 7>;
128 interrupt-map = <
129 /* IDSEL 0x0 */
130 0000 0x0 0x0 0x1 &mpic 0x8 0x1 0x0 0x0
131 0000 0x0 0x0 0x2 &mpic 0x9 0x1 0x0 0x0
132 0000 0x0 0x0 0x3 &mpic 0xa 0x1 0x0 0x0
133 0000 0x0 0x0 0x4 &mpic 0xb 0x1 0x0 0x0
134 >;
135 };
136};
137
138&soc {
139 #address-cells = <1>;
140 #size-cells = <1>;
141 device_type = "soc";
142 compatible = "fsl,mpc8544-immr", "simple-bus";
143 bus-frequency = <0>; // Filled out by uboot.
144
145 ecm-law@0 {
146 compatible = "fsl,ecm-law";
147 reg = <0x0 0x1000>;
148 fsl,num-laws = <10>;
149 };
150
151 ecm@1000 {
152 compatible = "fsl,mpc8544-ecm", "fsl,ecm";
153 reg = <0x1000 0x1000>;
154 interrupts = <17 2 0 0>;
155 };
156
157 memory-controller@2000 {
158 compatible = "fsl,mpc8544-memory-controller";
159 reg = <0x2000 0x1000>;
160 interrupts = <18 2 0 0>;
161 };
162
163/include/ "pq3-i2c-0.dtsi"
164/include/ "pq3-i2c-1.dtsi"
165/include/ "pq3-duart-0.dtsi"
166
167 L2: l2-cache-controller@20000 {
168 compatible = "fsl,mpc8544-l2-cache-controller";
169 reg = <0x20000 0x1000>;
170 cache-line-size = <32>; // 32 bytes
171 cache-size = <0x40000>; // L2, 256K
172 interrupts = <16 2 0 0>;
173 };
174
175/include/ "pq3-dma-0.dtsi"
176/include/ "pq3-etsec1-0.dtsi"
177/include/ "pq3-etsec1-2.dtsi"
178
179 ethernet@26000 {
180 cell-index = <1>;
181 };
182
183/include/ "pq3-sec2.1-0.dtsi"
184/include/ "pq3-mpic.dtsi"
185
186 global-utilities@e0000 {
187 compatible = "fsl,mpc8544-guts";
188 reg = <0xe0000 0x1000>;
189 fsl,has-rstcr;
190 };
191};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8544si-pre.dtsi b/arch/powerpc/boot/dts/fsl/mpc8544si-pre.dtsi
new file mode 100644
index 000000000000..8777f9239d9e
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8544si-pre.dtsi
@@ -0,0 +1,63 @@
1/*
2 * MPC8544 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,MPC8544";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet2;
47 pci0 = &pci0;
48 pci1 = &pci1;
49 pci2 = &pci2;
50 pci3 = &pci3;
51 };
52
53 cpus {
54 #address-cells = <1>;
55 #size-cells = <0>;
56
57 PowerPC,8544@0 {
58 device_type = "cpu";
59 reg = <0x0>;
60 next-level-cache = <&L2>;
61 };
62 };
63};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8548si-post.dtsi b/arch/powerpc/boot/dts/fsl/mpc8548si-post.dtsi
new file mode 100644
index 000000000000..9d8023a69d7d
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8548si-post.dtsi
@@ -0,0 +1,143 @@
1/*
2 * MPC8548 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,mpc8548-lbc", "fsl,pq3-localbus", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0x8000 */
43&pci0 {
44 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
45 device_type = "pci";
46 interrupts = <24 0x2 0 0>;
47 bus-range = <0 0xff>;
48 #interrupt-cells = <1>;
49 #size-cells = <2>;
50 #address-cells = <3>;
51};
52
53/* controller at 0x9000 */
54&pci1 {
55 compatible = "fsl,mpc8540-pci";
56 device_type = "pci";
57 interrupts = <25 0x2 0 0>;
58 bus-range = <0 0xff>;
59 #interrupt-cells = <1>;
60 #size-cells = <2>;
61 #address-cells = <3>;
62};
63
64/* controller at 0xa000 */
65&pci2 {
66 compatible = "fsl,mpc8548-pcie";
67 device_type = "pci";
68 #size-cells = <2>;
69 #address-cells = <3>;
70 bus-range = <0 255>;
71 clock-frequency = <33333333>;
72 interrupts = <26 2 0 0>;
73
74 pcie@0 {
75 reg = <0 0 0 0 0>;
76 #interrupt-cells = <1>;
77 #size-cells = <2>;
78 #address-cells = <3>;
79 device_type = "pci";
80 interrupts = <26 2 0 0>;
81 interrupt-map-mask = <0xf800 0 0 7>;
82 interrupt-map = <
83 /* IDSEL 0x0 */
84 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
85 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
86 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
87 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
88 >;
89 };
90};
91
92&soc {
93 #address-cells = <1>;
94 #size-cells = <1>;
95 device_type = "soc";
96 compatible = "fsl,mpc8548-immr", "simple-bus";
97 bus-frequency = <0>; // Filled out by uboot.
98
99 ecm-law@0 {
100 compatible = "fsl,ecm-law";
101 reg = <0x0 0x1000>;
102 fsl,num-laws = <10>;
103 };
104
105 ecm@1000 {
106 compatible = "fsl,mpc8548-ecm", "fsl,ecm";
107 reg = <0x1000 0x1000>;
108 interrupts = <17 2 0 0>;
109 };
110
111 memory-controller@2000 {
112 compatible = "fsl,mpc8548-memory-controller";
113 reg = <0x2000 0x1000>;
114 interrupts = <18 2 0 0>;
115 };
116
117/include/ "pq3-i2c-0.dtsi"
118/include/ "pq3-i2c-1.dtsi"
119/include/ "pq3-duart-0.dtsi"
120
121 L2: l2-cache-controller@20000 {
122 compatible = "fsl,mpc8548-l2-cache-controller";
123 reg = <0x20000 0x1000>;
124 cache-line-size = <32>; // 32 bytes
125 cache-size = <0x80000>; // L2, 512K
126 interrupts = <16 2 0 0>;
127 };
128
129/include/ "pq3-dma-0.dtsi"
130/include/ "pq3-etsec1-0.dtsi"
131/include/ "pq3-etsec1-1.dtsi"
132/include/ "pq3-etsec1-2.dtsi"
133/include/ "pq3-etsec1-3.dtsi"
134
135/include/ "pq3-sec2.1-0.dtsi"
136/include/ "pq3-mpic.dtsi"
137
138 global-utilities@e0000 {
139 compatible = "fsl,mpc8548-guts";
140 reg = <0xe0000 0x1000>;
141 fsl,has-rstcr;
142 };
143};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8548si-pre.dtsi b/arch/powerpc/boot/dts/fsl/mpc8548si-pre.dtsi
new file mode 100644
index 000000000000..289f1218d755
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8548si-pre.dtsi
@@ -0,0 +1,62 @@
1/*
2 * MPC8548 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,MPC8548";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet2;
47 pci0 = &pci0;
48 pci1 = &pci1;
49 pci2 = &pci2;
50 };
51
52 cpus {
53 #address-cells = <1>;
54 #size-cells = <0>;
55
56 PowerPC,8548@0 {
57 device_type = "cpu";
58 reg = <0x0>;
59 next-level-cache = <&L2>;
60 };
61 };
62};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8568si-post.dtsi b/arch/powerpc/boot/dts/fsl/mpc8568si-post.dtsi
new file mode 100644
index 000000000000..64e7075a9cd4
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8568si-post.dtsi
@@ -0,0 +1,270 @@
1/*
2 * MPC8568 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,mpc8568-localbus", "fsl,pq3-localbus", "simple-bus";
39 interrupts = <19 2 0 0>;
40 sleep = <&pmc 0x08000000>;
41};
42
43/* controller at 0x8000 */
44&pci0 {
45 compatible = "fsl,mpc8540-pci";
46 device_type = "pci";
47 interrupts = <24 0x2 0 0>;
48 bus-range = <0 0xff>;
49 #interrupt-cells = <1>;
50 #size-cells = <2>;
51 #address-cells = <3>;
52 sleep = <&pmc 0x80000000>;
53};
54
55/* controller at 0xa000 */
56&pci1 {
57 compatible = "fsl,mpc8548-pcie";
58 device_type = "pci";
59 #size-cells = <2>;
60 #address-cells = <3>;
61 bus-range = <0 255>;
62 clock-frequency = <33333333>;
63 interrupts = <26 2 0 0>;
64 sleep = <&pmc 0x20000000>;
65
66 pcie@0 {
67 reg = <0 0 0 0 0>;
68 #interrupt-cells = <1>;
69 #size-cells = <2>;
70 #address-cells = <3>;
71 device_type = "pci";
72 interrupts = <26 2 0 0>;
73 interrupt-map-mask = <0xf800 0 0 7>;
74 interrupt-map = <
75 /* IDSEL 0x0 */
76 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
77 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
78 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
79 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
80 >;
81 };
82};
83
84&rio {
85 compatible = "fsl,srio";
86 interrupts = <48 2 0 0>;
87 #address-cells = <2>;
88 #size-cells = <2>;
89 fsl,srio-rmu-handle = <&rmu>;
90 sleep = <&pmc 0x00080000>;
91 ranges;
92
93 port1 {
94 #address-cells = <2>;
95 #size-cells = <2>;
96 cell-index = <1>;
97 };
98};
99
100&soc {
101 #address-cells = <1>;
102 #size-cells = <1>;
103 device_type = "soc";
104 compatible = "fsl,mpc8568-immr", "simple-bus";
105 bus-frequency = <0>; // Filled out by uboot.
106
107 ecm-law@0 {
108 compatible = "fsl,ecm-law";
109 reg = <0x0 0x1000>;
110 fsl,num-laws = <10>;
111 };
112
113 ecm@1000 {
114 compatible = "fsl,mpc8568-ecm", "fsl,ecm";
115 reg = <0x1000 0x1000>;
116 interrupts = <17 2 0 0>;
117 };
118
119 memory-controller@2000 {
120 compatible = "fsl,mpc8568-memory-controller";
121 reg = <0x2000 0x1000>;
122 interrupts = <18 2 0 0>;
123 };
124
125 i2c-sleep-nexus {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 compatible = "simple-bus";
129 sleep = <&pmc 0x00000004>;
130 ranges;
131
132/include/ "pq3-i2c-0.dtsi"
133/include/ "pq3-i2c-1.dtsi"
134
135 };
136
137 duart-sleep-nexus {
138 #address-cells = <1>;
139 #size-cells = <1>;
140 compatible = "simple-bus";
141 sleep = <&pmc 0x00000002>;
142 ranges;
143
144/include/ "pq3-duart-0.dtsi"
145
146 };
147
148 L2: l2-cache-controller@20000 {
149 compatible = "fsl,mpc8568-l2-cache-controller";
150 reg = <0x20000 0x1000>;
151 cache-line-size = <32>; // 32 bytes
152 cache-size = <0x80000>; // L2, 512K
153 interrupts = <16 2 0 0>;
154 };
155
156/include/ "pq3-dma-0.dtsi"
157 dma@21300 {
158 sleep = <&pmc 0x00000400>;
159 };
160
161/include/ "pq3-etsec1-0.dtsi"
162 ethernet@24000 {
163 sleep = <&pmc 0x00000080>;
164 };
165
166/include/ "pq3-etsec1-1.dtsi"
167 ethernet@25000 {
168 sleep = <&pmc 0x00000040>;
169 };
170
171 par_io@e0100 {
172 reg = <0xe0100 0x100>;
173 device_type = "par_io";
174 };
175
176/include/ "pq3-sec2.1-0.dtsi"
177 crypto@30000 {
178 sleep = <&pmc 0x01000000>;
179 };
180
181/include/ "pq3-mpic.dtsi"
182/include/ "pq3-rmu-0.dtsi"
183 rmu@d3000 {
184 sleep = <&pmc 0x00040000>;
185 };
186
187 global-utilities@e0000 {
188 #address-cells = <1>;
189 #size-cells = <1>;
190 compatible = "fsl,mpc8568-guts", "fsl,mpc8548-guts";
191 reg = <0xe0000 0x1000>;
192 ranges = <0 0xe0000 0x1000>;
193 fsl,has-rstcr;
194
195 pmc: power@70 {
196 compatible = "fsl,mpc8568-pmc",
197 "fsl,mpc8548-pmc";
198 reg = <0x70 0x20>;
199 };
200 };
201};
202
203&qe {
204 #address-cells = <1>;
205 #size-cells = <1>;
206 device_type = "qe";
207 compatible = "fsl,qe";
208 sleep = <&pmc 0x00000800>;
209 brg-frequency = <0>;
210 bus-frequency = <396000000>;
211 fsl,qe-num-riscs = <2>;
212 fsl,qe-num-snums = <28>;
213
214 qeic: interrupt-controller@80 {
215 interrupt-controller;
216 compatible = "fsl,qe-ic";
217 #address-cells = <0>;
218 #interrupt-cells = <1>;
219 reg = <0x80 0x80>;
220 interrupts = <46 2 0 0 46 2 0 0>; //high:30 low:30
221 interrupt-parent = <&mpic>;
222 };
223
224 spi@4c0 {
225 #address-cells = <1>;
226 #size-cells = <0>;
227 compatible = "fsl,spi";
228 reg = <0x4c0 0x40>;
229 cell-index = <0>;
230 interrupts = <2>;
231 interrupt-parent = <&qeic>;
232 };
233
234 spi@500 {
235 #address-cells = <1>;
236 #size-cells = <0>;
237 cell-index = <1>;
238 compatible = "fsl,spi";
239 reg = <0x500 0x40>;
240 interrupts = <1>;
241 interrupt-parent = <&qeic>;
242 };
243
244 ucc@2000 {
245 cell-index = <1>;
246 reg = <0x2000 0x200>;
247 interrupts = <32>;
248 interrupt-parent = <&qeic>;
249 };
250
251 ucc@3000 {
252 cell-index = <2>;
253 reg = <0x3000 0x200>;
254 interrupts = <33>;
255 interrupt-parent = <&qeic>;
256 };
257
258 muram@10000 {
259 #address-cells = <1>;
260 #size-cells = <1>;
261 compatible = "fsl,qe-muram", "fsl,cpm-muram";
262 ranges = <0x0 0x10000 0x10000>;
263
264 data-only@0 {
265 compatible = "fsl,qe-muram-data",
266 "fsl,cpm-muram-data";
267 reg = <0x0 0x10000>;
268 };
269 };
270};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8568si-pre.dtsi b/arch/powerpc/boot/dts/fsl/mpc8568si-pre.dtsi
new file mode 100644
index 000000000000..eacd62c5fe6c
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8568si-pre.dtsi
@@ -0,0 +1,65 @@
1/*
2 * MPC8568 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,MPC8568";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 ethernet2 = &enet2;
48 ethernet3 = &enet3;
49 pci0 = &pci0;
50 pci1 = &pci1;
51 };
52
53 cpus {
54 #address-cells = <1>;
55 #size-cells = <0>;
56
57 PowerPC,8568@0 {
58 device_type = "cpu";
59 reg = <0x0>;
60 next-level-cache = <&L2>;
61 sleep = <&pmc 0x00008000 // core
62 &pmc 0x00004000>; // timebase
63 };
64 };
65};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8569si-post.dtsi b/arch/powerpc/boot/dts/fsl/mpc8569si-post.dtsi
new file mode 100644
index 000000000000..3e6346a4a183
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8569si-post.dtsi
@@ -0,0 +1,304 @@
1/*
2 * MPC8569 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,mpc8569-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40 sleep = <&pmc 0x08000000>;
41};
42
43/* controller at 0xa000 */
44&pci1 {
45 compatible = "fsl,mpc8548-pcie";
46 device_type = "pci";
47 #size-cells = <2>;
48 #address-cells = <3>;
49 bus-range = <0 255>;
50 clock-frequency = <33333333>;
51 interrupts = <26 2 0 0>;
52 sleep = <&pmc 0x20000000>;
53
54 pcie@0 {
55 reg = <0 0 0 0 0>;
56 #interrupt-cells = <1>;
57 #size-cells = <2>;
58 #address-cells = <3>;
59 device_type = "pci";
60 interrupts = <26 2 0 0>;
61 interrupt-map-mask = <0xf800 0 0 7>;
62 interrupt-map = <
63 /* IDSEL 0x0 */
64 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
65 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
66 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
67 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
68 >;
69 };
70};
71
72&rio {
73 compatible = "fsl,srio";
74 interrupts = <48 2 0 0>;
75 #address-cells = <2>;
76 #size-cells = <2>;
77 fsl,srio-rmu-handle = <&rmu>;
78 sleep = <&pmc 0x00080000>;
79 ranges;
80
81 port1 {
82 #address-cells = <2>;
83 #size-cells = <2>;
84 cell-index = <1>;
85 };
86
87 port2 {
88 #address-cells = <2>;
89 #size-cells = <2>;
90 cell-index = <2>;
91 };
92};
93
94&soc {
95 #address-cells = <1>;
96 #size-cells = <1>;
97 device_type = "soc";
98 compatible = "fsl,mpc8569-immr", "simple-bus";
99 bus-frequency = <0>; // Filled out by uboot.
100
101 ecm-law@0 {
102 compatible = "fsl,ecm-law";
103 reg = <0x0 0x1000>;
104 fsl,num-laws = <10>;
105 };
106
107 ecm@1000 {
108 compatible = "fsl,mpc8569-ecm", "fsl,ecm";
109 reg = <0x1000 0x1000>;
110 interrupts = <17 2 0 0>;
111 };
112
113 memory-controller@2000 {
114 compatible = "fsl,mpc8569-memory-controller";
115 reg = <0x2000 0x1000>;
116 interrupts = <18 2 0 0>;
117 };
118
119 i2c-sleep-nexus {
120 #address-cells = <1>;
121 #size-cells = <1>;
122 compatible = "simple-bus";
123 sleep = <&pmc 0x00000004>;
124 ranges;
125
126/include/ "pq3-i2c-0.dtsi"
127/include/ "pq3-i2c-1.dtsi"
128
129 };
130
131 duart-sleep-nexus {
132 #address-cells = <1>;
133 #size-cells = <1>;
134 compatible = "simple-bus";
135 sleep = <&pmc 0x00000002>;
136 ranges;
137
138/include/ "pq3-duart-0.dtsi"
139
140 };
141
142 L2: l2-cache-controller@20000 {
143 compatible = "fsl,mpc8569-l2-cache-controller";
144 reg = <0x20000 0x1000>;
145 cache-line-size = <32>; // 32 bytes
146 cache-size = <0x80000>; // L2, 512K
147 interrupts = <16 2 0 0>;
148 };
149
150/include/ "pq3-dma-0.dtsi"
151/include/ "pq3-esdhc-0.dtsi"
152 sdhc@2e000 {
153 sleep = <&pmc 0x00200000>;
154 };
155
156 par_io@e0100 {
157 #address-cells = <1>;
158 #size-cells = <1>;
159 reg = <0xe0100 0x100>;
160 ranges = <0x0 0xe0100 0x100>;
161 device_type = "par_io";
162 };
163
164/include/ "pq3-sec3.1-0.dtsi"
165 crypto@30000 {
166 sleep = <&pmc 0x01000000>;
167 };
168
169/include/ "pq3-mpic.dtsi"
170/include/ "pq3-rmu-0.dtsi"
171 rmu@d3000 {
172 sleep = <&pmc 0x00040000>;
173 };
174
175 global-utilities@e0000 {
176 #address-cells = <1>;
177 #size-cells = <1>;
178 compatible = "fsl,mpc8569-guts", "fsl,mpc8548-guts";
179 reg = <0xe0000 0x1000>;
180 ranges = <0 0xe0000 0x1000>;
181 fsl,has-rstcr;
182
183 pmc: power@70 {
184 compatible = "fsl,mpc8569-pmc",
185 "fsl,mpc8548-pmc";
186 reg = <0x70 0x20>;
187 };
188 };
189};
190
191&qe {
192 #address-cells = <1>;
193 #size-cells = <1>;
194 device_type = "qe";
195 compatible = "fsl,qe";
196 sleep = <&pmc 0x00000800>;
197 brg-frequency = <0>;
198 bus-frequency = <0>;
199 fsl,qe-num-riscs = <4>;
200 fsl,qe-num-snums = <46>;
201
202 qeic: interrupt-controller@80 {
203 interrupt-controller;
204 compatible = "fsl,qe-ic";
205 #address-cells = <0>;
206 #interrupt-cells = <1>;
207 reg = <0x80 0x80>;
208 interrupts = <46 2 0 0 46 2 0 0>; //high:30 low:30
209 interrupt-parent = <&mpic>;
210 };
211
212 timer@440 {
213 compatible = "fsl,mpc8569-qe-gtm",
214 "fsl,qe-gtm", "fsl,gtm";
215 reg = <0x440 0x40>;
216 interrupts = <12 13 14 15>;
217 interrupt-parent = <&qeic>;
218 /* Filled in by U-Boot */
219 clock-frequency = <0>;
220 };
221
222 spi@4c0 {
223 #address-cells = <1>;
224 #size-cells = <0>;
225 compatible = "fsl,mpc8569-qe-spi", "fsl,spi";
226 reg = <0x4c0 0x40>;
227 cell-index = <0>;
228 interrupts = <2>;
229 interrupt-parent = <&qeic>;
230 };
231
232 spi@500 {
233 #address-cells = <1>;
234 #size-cells = <0>;
235 cell-index = <1>;
236 compatible = "fsl,spi";
237 reg = <0x500 0x40>;
238 interrupts = <1>;
239 interrupt-parent = <&qeic>;
240 };
241
242 usb@6c0 {
243 compatible = "fsl,mpc8569-qe-usb",
244 "fsl,mpc8323-qe-usb";
245 reg = <0x6c0 0x40 0x8b00 0x100>;
246 interrupts = <11>;
247 interrupt-parent = <&qeic>;
248 };
249
250 ucc@2000 {
251 cell-index = <1>;
252 reg = <0x2000 0x200>;
253 interrupts = <32>;
254 interrupt-parent = <&qeic>;
255 };
256
257 ucc@2200 {
258 cell-index = <3>;
259 reg = <0x2200 0x200>;
260 interrupts = <34>;
261 interrupt-parent = <&qeic>;
262 };
263
264 ucc@3000 {
265 cell-index = <2>;
266 reg = <0x3000 0x200>;
267 interrupts = <33>;
268 interrupt-parent = <&qeic>;
269 };
270
271 ucc@3200 {
272 cell-index = <4>;
273 reg = <0x3200 0x200>;
274 interrupts = <35>;
275 interrupt-parent = <&qeic>;
276 };
277
278 ucc@3400 {
279 cell-index = <6>;
280 reg = <0x3400 0x200>;
281 interrupts = <41>;
282 interrupt-parent = <&qeic>;
283 };
284
285 ucc@3600 {
286 cell-index = <8>;
287 reg = <0x3600 0x200>;
288 interrupts = <43>;
289 interrupt-parent = <&qeic>;
290 };
291
292 muram@10000 {
293 #address-cells = <1>;
294 #size-cells = <1>;
295 compatible = "fsl,qe-muram", "fsl,cpm-muram";
296 ranges = <0x0 0x10000 0x20000>;
297
298 data-only@0 {
299 compatible = "fsl,qe-muram-data",
300 "fsl,cpm-muram-data";
301 reg = <0x0 0x20000>;
302 };
303 };
304};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8569si-pre.dtsi b/arch/powerpc/boot/dts/fsl/mpc8569si-pre.dtsi
new file mode 100644
index 000000000000..b07064d11930
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8569si-pre.dtsi
@@ -0,0 +1,64 @@
1/*
2 * MPC8569 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,MPC8569";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 ethernet2 = &enet2;
48 ethernet3 = &enet3;
49 pci1 = &pci1;
50 };
51
52 cpus {
53 #address-cells = <1>;
54 #size-cells = <0>;
55
56 PowerPC,8569@0 {
57 device_type = "cpu";
58 reg = <0x0>;
59 next-level-cache = <&L2>;
60 sleep = <&pmc 0x00008000 // core
61 &pmc 0x00004000>; // timebase
62 };
63 };
64};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8572si-post.dtsi b/arch/powerpc/boot/dts/fsl/mpc8572si-post.dtsi
new file mode 100644
index 000000000000..d44e25a48734
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8572si-post.dtsi
@@ -0,0 +1,196 @@
1/*
2 * MPC8572 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,mpc8572-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0x8000 */
43&pci0 {
44 compatible = "fsl,mpc8548-pcie";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0 255>;
49 clock-frequency = <33333333>;
50 interrupts = <24 2 0 0>;
51
52 pcie@0 {
53 reg = <0 0 0 0 0>;
54 #interrupt-cells = <1>;
55 #size-cells = <2>;
56 #address-cells = <3>;
57 device_type = "pci";
58 interrupts = <24 2 0 0>;
59 interrupt-map-mask = <0xf800 0 0 7>;
60
61 interrupt-map = <
62 /* IDSEL 0x0 */
63 0000 0x0 0x0 0x1 &mpic 0x8 0x1 0x0 0x0
64 0000 0x0 0x0 0x2 &mpic 0x9 0x1 0x0 0x0
65 0000 0x0 0x0 0x3 &mpic 0xa 0x1 0x0 0x0
66 0000 0x0 0x0 0x4 &mpic 0xb 0x1 0x0 0x0
67 >;
68 };
69};
70
71/* controller at 0x9000 */
72&pci1 {
73 compatible = "fsl,mpc8548-pcie";
74 device_type = "pci";
75 #size-cells = <2>;
76 #address-cells = <3>;
77 bus-range = <0 255>;
78 clock-frequency = <33333333>;
79 interrupts = <25 2 0 0>;
80
81 pcie@0 {
82 reg = <0 0 0 0 0>;
83 #interrupt-cells = <1>;
84 #size-cells = <2>;
85 #address-cells = <3>;
86 device_type = "pci";
87 interrupts = <25 2 0 0>;
88 interrupt-map-mask = <0xf800 0 0 7>;
89
90 interrupt-map = <
91 /* IDSEL 0x0 */
92 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
93 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
94 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
95 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
96 >;
97 };
98};
99
100/* controller at 0xa000 */
101&pci2 {
102 compatible = "fsl,mpc8548-pcie";
103 device_type = "pci";
104 #size-cells = <2>;
105 #address-cells = <3>;
106 bus-range = <0 255>;
107 clock-frequency = <33333333>;
108 interrupts = <26 2 0 0>;
109
110 pcie@0 {
111 reg = <0 0 0 0 0>;
112 #interrupt-cells = <1>;
113 #size-cells = <2>;
114 #address-cells = <3>;
115 device_type = "pci";
116 interrupts = <26 2 0 0>;
117 interrupt-map-mask = <0xf800 0 0 7>;
118 interrupt-map = <
119 /* IDSEL 0x0 */
120 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
121 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
122 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
123 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
124 >;
125 };
126};
127
128&soc {
129 #address-cells = <1>;
130 #size-cells = <1>;
131 device_type = "soc";
132 compatible = "fsl,mpc8572-immr", "simple-bus";
133 bus-frequency = <0>; // Filled out by uboot.
134
135 ecm-law@0 {
136 compatible = "fsl,ecm-law";
137 reg = <0x0 0x1000>;
138 fsl,num-laws = <12>;
139 };
140
141 ecm@1000 {
142 compatible = "fsl,mpc8572-ecm", "fsl,ecm";
143 reg = <0x1000 0x1000>;
144 interrupts = <17 2 0 0>;
145 };
146
147 memory-controller@2000 {
148 compatible = "fsl,mpc8572-memory-controller";
149 reg = <0x2000 0x1000>;
150 interrupts = <18 2 0 0>;
151 };
152
153 memory-controller@6000 {
154 compatible = "fsl,mpc8572-memory-controller";
155 reg = <0x6000 0x1000>;
156 interrupts = <18 2 0 0>;
157 };
158
159/include/ "pq3-i2c-0.dtsi"
160/include/ "pq3-i2c-1.dtsi"
161/include/ "pq3-duart-0.dtsi"
162/include/ "pq3-dma-1.dtsi"
163/include/ "pq3-gpio-0.dtsi"
164 gpio-controller@f000 {
165 compatible = "fsl,mpc8572-gpio", "fsl,pq3-gpio";
166 };
167
168 L2: l2-cache-controller@20000 {
169 compatible = "fsl,mpc8572-l2-cache-controller";
170 reg = <0x20000 0x1000>;
171 cache-line-size = <32>; // 32 bytes
172 cache-size = <0x100000>; // L2,1M
173 interrupts = <16 2 0 0>;
174 };
175
176/include/ "pq3-dma-0.dtsi"
177/include/ "pq3-etsec1-0.dtsi"
178/include/ "pq3-etsec1-timer-0.dtsi"
179
180 ptp_clock@24e00 {
181 interrupts = <68 2 0 0 69 2 0 0 70 2 0 0 71 2 0 0>;
182 };
183
184/include/ "pq3-etsec1-1.dtsi"
185/include/ "pq3-etsec1-2.dtsi"
186/include/ "pq3-etsec1-3.dtsi"
187/include/ "pq3-sec3.0-0.dtsi"
188/include/ "pq3-mpic.dtsi"
189/include/ "pq3-mpic-timer-B.dtsi"
190
191 global-utilities@e0000 {
192 compatible = "fsl,mpc8572-guts";
193 reg = <0xe0000 0x1000>;
194 fsl,has-rstcr;
195 };
196};
diff --git a/arch/powerpc/boot/dts/fsl/mpc8572si-pre.dtsi b/arch/powerpc/boot/dts/fsl/mpc8572si-pre.dtsi
new file mode 100644
index 000000000000..ca188326c2ca
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mpc8572si-pre.dtsi
@@ -0,0 +1,70 @@
1/*
2 * MPC8572 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,MPC8572";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 ethernet2 = &enet2;
48 ethernet3 = &enet3;
49 pci0 = &pci0;
50 pci1 = &pci1;
51 pci2 = &pci2;
52 };
53
54 cpus {
55 #address-cells = <1>;
56 #size-cells = <0>;
57
58 PowerPC,8572@0 {
59 device_type = "cpu";
60 reg = <0x0>;
61 next-level-cache = <&L2>;
62 };
63
64 PowerPC,8572@1 {
65 device_type = "cpu";
66 reg = <0x1>;
67 next-level-cache = <&L2>;
68 };
69 };
70};
diff --git a/arch/powerpc/boot/dts/fsl/p1010si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1010si-post.dtsi
new file mode 100644
index 000000000000..bd9e163c764b
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1010si-post.dtsi
@@ -0,0 +1,198 @@
1/*
2 * P1010/P1014 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&ifc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,ifc", "simple-bus";
39 interrupts = <16 2 0 0 19 2 0 0>;
40};
41
42/* controller at 0x9000 */
43&pci0 {
44 compatible = "fsl,p1010-pcie", "fsl,qoriq-pcie-v2.3", "fsl,qoriq-pcie-v2.2";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0 255>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 0 0>;
51
52 pcie@0 {
53 reg = <0 0 0 0 0>;
54 #interrupt-cells = <1>;
55 #size-cells = <2>;
56 #address-cells = <3>;
57 device_type = "pci";
58 interrupts = <16 2 0 0>;
59 interrupt-map-mask = <0xf800 0 0 7>;
60 interrupt-map = <
61 /* IDSEL 0x0 */
62 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
63 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
64 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
65 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
66 >;
67 };
68};
69
70/* controller at 0xa000 */
71&pci1 {
72 compatible = "fsl,p1010-pcie", "fsl,qoriq-pcie-v2.3", "fsl,qoriq-pcie-v2.2";
73 device_type = "pci";
74 #size-cells = <2>;
75 #address-cells = <3>;
76 bus-range = <0 255>;
77 clock-frequency = <33333333>;
78 interrupts = <16 2 0 0>;
79
80 pcie@0 {
81 reg = <0 0 0 0 0>;
82 #interrupt-cells = <1>;
83 #size-cells = <2>;
84 #address-cells = <3>;
85 device_type = "pci";
86 interrupts = <16 2 0 0>;
87 interrupt-map-mask = <0xf800 0 0 7>;
88
89 interrupt-map = <
90 /* IDSEL 0x0 */
91 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
92 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
93 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
94 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
95 >;
96 };
97};
98
99&soc {
100 #address-cells = <1>;
101 #size-cells = <1>;
102 device_type = "soc";
103 compatible = "fsl,p1010-immr", "simple-bus";
104 bus-frequency = <0>; // Filled out by uboot.
105
106 ecm-law@0 {
107 compatible = "fsl,ecm-law";
108 reg = <0x0 0x1000>;
109 fsl,num-laws = <12>;
110 };
111
112 ecm@1000 {
113 compatible = "fsl,p1010-ecm", "fsl,ecm";
114 reg = <0x1000 0x1000>;
115 interrupts = <16 2 0 0>;
116 };
117
118 memory-controller@2000 {
119 compatible = "fsl,p1010-memory-controller";
120 reg = <0x2000 0x1000>;
121 interrupts = <16 2 0 0>;
122 };
123
124/include/ "pq3-i2c-0.dtsi"
125/include/ "pq3-i2c-1.dtsi"
126/include/ "pq3-duart-0.dtsi"
127/include/ "pq3-espi-0.dtsi"
128 spi0: spi@7000 {
129 fsl,espi-num-chipselects = <1>;
130 };
131
132/include/ "pq3-gpio-0.dtsi"
133/include/ "pq3-sata2-0.dtsi"
134/include/ "pq3-sata2-1.dtsi"
135
136 can0: can@1c000 {
137 compatible = "fsl,p1010-flexcan";
138 reg = <0x1c000 0x1000>;
139 interrupts = <48 0x2 0 0>;
140 };
141
142 can1: can@1d000 {
143 compatible = "fsl,p1010-flexcan";
144 reg = <0x1d000 0x1000>;
145 interrupts = <61 0x2 0 0>;
146 };
147
148 L2: l2-cache-controller@20000 {
149 compatible = "fsl,p1010-l2-cache-controller",
150 "fsl,p1014-l2-cache-controller";
151 reg = <0x20000 0x1000>;
152 cache-line-size = <32>; // 32 bytes
153 cache-size = <0x40000>; // L2,256K
154 interrupts = <16 2 0 0>;
155 };
156
157/include/ "pq3-dma-0.dtsi"
158/include/ "pq3-usb2-dr-0.dtsi"
159/include/ "pq3-esdhc-0.dtsi"
160 sdhc@2e000 {
161 fsl,sdhci-auto-cmd12;
162 };
163
164/include/ "pq3-sec4.4-0.dtsi"
165/include/ "pq3-mpic.dtsi"
166/include/ "pq3-mpic-timer-B.dtsi"
167
168/include/ "pq3-etsec2-0.dtsi"
169 enet0: ethernet@b0000 {
170 queue-group@b0000 {
171 fsl,rx-bit-map = <0xff>;
172 fsl,tx-bit-map = <0xff>;
173 };
174 };
175
176/include/ "pq3-etsec2-1.dtsi"
177 enet1: ethernet@b1000 {
178 queue-group@b1000 {
179 fsl,rx-bit-map = <0xff>;
180 fsl,tx-bit-map = <0xff>;
181 };
182 };
183
184/include/ "pq3-etsec2-2.dtsi"
185 enet2: ethernet@b2000 {
186 queue-group@b2000 {
187 fsl,rx-bit-map = <0xff>;
188 fsl,tx-bit-map = <0xff>;
189 };
190
191 };
192
193 global-utilities@e0000 {
194 compatible = "fsl,p1010-guts";
195 reg = <0xe0000 0x1000>;
196 fsl,has-rstcr;
197 };
198};
diff --git a/arch/powerpc/boot/dts/fsl/p1010si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p1010si-pre.dtsi
new file mode 100644
index 000000000000..7354a8f90ea5
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1010si-pre.dtsi
@@ -0,0 +1,64 @@
1/*
2 * P1010/P1014 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P1010";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 ethernet2 = &enet2;
48 pci0 = &pci0;
49 pci1 = &pci1;
50 can0 = &can0;
51 can1 = &can1;
52 };
53
54 cpus {
55 #address-cells = <1>;
56 #size-cells = <0>;
57
58 PowerPC,P1010@0 {
59 device_type = "cpu";
60 reg = <0x0>;
61 next-level-cache = <&L2>;
62 };
63 };
64};
diff --git a/arch/powerpc/boot/dts/fsl/p1020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1020si-post.dtsi
new file mode 100644
index 000000000000..fc924c5ffebe
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1020si-post.dtsi
@@ -0,0 +1,174 @@
1/*
2 * P1020/P1011 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,p1020-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0x9000 */
43&pci0 {
44 compatible = "fsl,mpc8548-pcie";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0 255>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 0 0>;
51
52 pcie@0 {
53 reg = <0 0 0 0 0>;
54 #interrupt-cells = <1>;
55 #size-cells = <2>;
56 #address-cells = <3>;
57 device_type = "pci";
58 interrupts = <16 2 0 0>;
59 interrupt-map-mask = <0xf800 0 0 7>;
60 interrupt-map = <
61 /* IDSEL 0x0 */
62 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
63 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
64 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
65 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
66 >;
67 };
68};
69
70/* controller at 0xa000 */
71&pci1 {
72 compatible = "fsl,mpc8548-pcie";
73 device_type = "pci";
74 #size-cells = <2>;
75 #address-cells = <3>;
76 bus-range = <0 255>;
77 clock-frequency = <33333333>;
78 interrupts = <16 2 0 0>;
79
80 pcie@0 {
81 reg = <0 0 0 0 0>;
82 #interrupt-cells = <1>;
83 #size-cells = <2>;
84 #address-cells = <3>;
85 device_type = "pci";
86 interrupts = <16 2 0 0>;
87 interrupt-map-mask = <0xf800 0 0 7>;
88
89 interrupt-map = <
90 /* IDSEL 0x0 */
91 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
92 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
93 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
94 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
95 >;
96 };
97};
98
99&soc {
100 #address-cells = <1>;
101 #size-cells = <1>;
102 device_type = "soc";
103 compatible = "fsl,p1020-immr", "simple-bus";
104 bus-frequency = <0>; // Filled out by uboot.
105
106 ecm-law@0 {
107 compatible = "fsl,ecm-law";
108 reg = <0x0 0x1000>;
109 fsl,num-laws = <12>;
110 };
111
112 ecm@1000 {
113 compatible = "fsl,p1020-ecm", "fsl,ecm";
114 reg = <0x1000 0x1000>;
115 interrupts = <16 2 0 0>;
116 };
117
118 memory-controller@2000 {
119 compatible = "fsl,p1020-memory-controller";
120 reg = <0x2000 0x1000>;
121 interrupts = <16 2 0 0>;
122 };
123
124/include/ "pq3-i2c-0.dtsi"
125/include/ "pq3-i2c-1.dtsi"
126/include/ "pq3-duart-0.dtsi"
127
128/include/ "pq3-espi-0.dtsi"
129 spi@7000 {
130 fsl,espi-num-chipselects = <4>;
131 };
132
133/include/ "pq3-gpio-0.dtsi"
134
135 L2: l2-cache-controller@20000 {
136 compatible = "fsl,p1020-l2-cache-controller";
137 reg = <0x20000 0x1000>;
138 cache-line-size = <32>; // 32 bytes
139 cache-size = <0x40000>; // L2,256K
140 interrupts = <16 2 0 0>;
141 };
142
143/include/ "pq3-dma-0.dtsi"
144/include/ "pq3-usb2-dr-0.dtsi"
145/include/ "pq3-usb2-dr-1.dtsi"
146
147/include/ "pq3-esdhc-0.dtsi"
148/include/ "pq3-sec3.3-0.dtsi"
149
150/include/ "pq3-mpic.dtsi"
151/include/ "pq3-mpic-timer-B.dtsi"
152
153/include/ "pq3-etsec2-0.dtsi"
154 enet0: enet0_grp2: ethernet@b0000 {
155 };
156
157/include/ "pq3-etsec2-1.dtsi"
158 enet1: enet1_grp2: ethernet@b1000 {
159 };
160
161/include/ "pq3-etsec2-2.dtsi"
162 enet2: enet2_grp2: ethernet@b2000 {
163 };
164
165 global-utilities@e0000 {
166 compatible = "fsl,p1020-guts";
167 reg = <0xe0000 0x1000>;
168 fsl,has-rstcr;
169 };
170};
171
172/include/ "pq3-etsec2-grp2-0.dtsi"
173/include/ "pq3-etsec2-grp2-1.dtsi"
174/include/ "pq3-etsec2-grp2-2.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/p1020si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p1020si-pre.dtsi
new file mode 100644
index 000000000000..6f0376e554eb
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1020si-pre.dtsi
@@ -0,0 +1,68 @@
1/*
2 * P1020/P1011 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P1020";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 ethernet2 = &enet2;
48 pci0 = &pci0;
49 pci1 = &pci1;
50 };
51
52 cpus {
53 #address-cells = <1>;
54 #size-cells = <0>;
55
56 PowerPC,P1020@0 {
57 device_type = "cpu";
58 reg = <0x0>;
59 next-level-cache = <&L2>;
60 };
61
62 PowerPC,P1020@1 {
63 device_type = "cpu";
64 reg = <0x1>;
65 next-level-cache = <&L2>;
66 };
67 };
68};
diff --git a/arch/powerpc/boot/dts/fsl/p1021si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1021si-post.dtsi
new file mode 100644
index 000000000000..38ba54d1e32e
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1021si-post.dtsi
@@ -0,0 +1,225 @@
1/*
2 * P1021/P1012 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,p1021-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0x9000 */
43&pci0 {
44 compatible = "fsl,mpc8548-pcie";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0 255>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 0 0>;
51
52 pcie@0 {
53 reg = <0 0 0 0 0>;
54 #interrupt-cells = <1>;
55 #size-cells = <2>;
56 #address-cells = <3>;
57 device_type = "pci";
58 interrupts = <16 2 0 0>;
59 interrupt-map-mask = <0xf800 0 0 7>;
60 interrupt-map = <
61 /* IDSEL 0x0 */
62 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
63 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
64 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
65 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
66 >;
67 };
68};
69
70/* controller at 0xa000 */
71&pci1 {
72 compatible = "fsl,mpc8548-pcie";
73 device_type = "pci";
74 #size-cells = <2>;
75 #address-cells = <3>;
76 bus-range = <0 255>;
77 clock-frequency = <33333333>;
78 interrupts = <16 2 0 0>;
79
80 pcie@0 {
81 reg = <0 0 0 0 0>;
82 #interrupt-cells = <1>;
83 #size-cells = <2>;
84 #address-cells = <3>;
85 device_type = "pci";
86 interrupts = <16 2 0 0>;
87 interrupt-map-mask = <0xf800 0 0 7>;
88
89 interrupt-map = <
90 /* IDSEL 0x0 */
91 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
92 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
93 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
94 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
95 >;
96 };
97};
98
99&soc {
100 #address-cells = <1>;
101 #size-cells = <1>;
102 device_type = "soc";
103 compatible = "fsl,p1021-immr", "simple-bus";
104 bus-frequency = <0>; // Filled out by uboot.
105
106 ecm-law@0 {
107 compatible = "fsl,ecm-law";
108 reg = <0x0 0x1000>;
109 fsl,num-laws = <12>;
110 };
111
112 ecm@1000 {
113 compatible = "fsl,p1021-ecm", "fsl,ecm";
114 reg = <0x1000 0x1000>;
115 interrupts = <16 2 0 0>;
116 };
117
118 memory-controller@2000 {
119 compatible = "fsl,p1021-memory-controller";
120 reg = <0x2000 0x1000>;
121 interrupts = <16 2 0 0>;
122 };
123
124/include/ "pq3-i2c-0.dtsi"
125/include/ "pq3-i2c-1.dtsi"
126/include/ "pq3-duart-0.dtsi"
127
128/include/ "pq3-espi-0.dtsi"
129 spi@7000 {
130 fsl,espi-num-chipselects = <4>;
131 };
132
133/include/ "pq3-gpio-0.dtsi"
134
135 L2: l2-cache-controller@20000 {
136 compatible = "fsl,p1021-l2-cache-controller";
137 reg = <0x20000 0x1000>;
138 cache-line-size = <32>; // 32 bytes
139 cache-size = <0x40000>; // L2,256K
140 interrupts = <16 2 0 0>;
141 };
142
143/include/ "pq3-dma-0.dtsi"
144/include/ "pq3-usb2-dr-0.dtsi"
145
146/include/ "pq3-esdhc-0.dtsi"
147/include/ "pq3-sec3.3-0.dtsi"
148
149/include/ "pq3-mpic.dtsi"
150/include/ "pq3-mpic-timer-B.dtsi"
151
152/include/ "pq3-etsec2-0.dtsi"
153 enet0: enet0_grp2: ethernet@b0000 {
154 };
155
156/include/ "pq3-etsec2-1.dtsi"
157 enet1: enet1_grp2: ethernet@b1000 {
158 };
159
160/include/ "pq3-etsec2-2.dtsi"
161 enet2: enet2_grp2: ethernet@b2000 {
162 };
163
164 global-utilities@e0000 {
165 compatible = "fsl,p1021-guts";
166 reg = <0xe0000 0x1000>;
167 fsl,has-rstcr;
168 };
169};
170
171&qe {
172 #address-cells = <1>;
173 #size-cells = <1>;
174 device_type = "qe";
175 compatible = "fsl,qe";
176 fsl,qe-num-riscs = <1>;
177 fsl,qe-num-snums = <28>;
178
179 qeic: interrupt-controller@80 {
180 interrupt-controller;
181 compatible = "fsl,qe-ic";
182 #address-cells = <0>;
183 #interrupt-cells = <1>;
184 reg = <0x80 0x80>;
185 interrupts = <63 2 0 0 60 2 0 0>; //high:47 low:44
186 };
187
188 ucc@2000 {
189 cell-index = <1>;
190 reg = <0x2000 0x200>;
191 interrupts = <32>;
192 interrupt-parent = <&qeic>;
193 };
194
195 mdio@2120 {
196 #address-cells = <1>;
197 #size-cells = <0>;
198 reg = <0x2120 0x18>;
199 compatible = "fsl,ucc-mdio";
200 };
201
202 ucc@2400 {
203 cell-index = <5>;
204 reg = <0x2400 0x200>;
205 interrupts = <40>;
206 interrupt-parent = <&qeic>;
207 };
208
209 muram@10000 {
210 #address-cells = <1>;
211 #size-cells = <1>;
212 compatible = "fsl,qe-muram", "fsl,cpm-muram";
213 ranges = <0x0 0x10000 0x6000>;
214
215 data-only@0 {
216 compatible = "fsl,qe-muram-data",
217 "fsl,cpm-muram-data";
218 reg = <0x0 0x6000>;
219 };
220 };
221};
222
223/include/ "pq3-etsec2-grp2-0.dtsi"
224/include/ "pq3-etsec2-grp2-1.dtsi"
225/include/ "pq3-etsec2-grp2-2.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/p1021si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p1021si-pre.dtsi
new file mode 100644
index 000000000000..4abd54bc3308
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1021si-pre.dtsi
@@ -0,0 +1,68 @@
1/*
2 * P1021/P1012 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P1021";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 ethernet2 = &enet2;
48 pci0 = &pci0;
49 pci1 = &pci1;
50 };
51
52 cpus {
53 #address-cells = <1>;
54 #size-cells = <0>;
55
56 PowerPC,P1021@0 {
57 device_type = "cpu";
58 reg = <0x0>;
59 next-level-cache = <&L2>;
60 };
61
62 PowerPC,P1021@1 {
63 device_type = "cpu";
64 reg = <0x1>;
65 next-level-cache = <&L2>;
66 };
67 };
68};
diff --git a/arch/powerpc/boot/dts/fsl/p1022si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1022si-post.dtsi
new file mode 100644
index 000000000000..16239b199d0a
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1022si-post.dtsi
@@ -0,0 +1,235 @@
1/*
2 * P1022/P1013 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,p1022-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0x9000 */
43&pci0 {
44 compatible = "fsl,p1022-pcie";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0 255>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 0 0>;
51
52 pcie@0 {
53 reg = <0 0 0 0 0>;
54 #interrupt-cells = <1>;
55 #size-cells = <2>;
56 #address-cells = <3>;
57 device_type = "pci";
58 interrupts = <16 2 0 0>;
59 interrupt-map-mask = <0xf800 0 0 7>;
60 interrupt-map = <
61 /* IDSEL 0x0 */
62 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
63 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
64 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
65 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
66 >;
67 };
68};
69
70/* controller at 0xa000 */
71&pci1 {
72 compatible = "fsl,p1022-pcie";
73 device_type = "pci";
74 #size-cells = <2>;
75 #address-cells = <3>;
76 bus-range = <0 255>;
77 clock-frequency = <33333333>;
78 interrupts = <16 2 0 0>;
79
80 pcie@0 {
81 reg = <0 0 0 0 0>;
82 #interrupt-cells = <1>;
83 #size-cells = <2>;
84 #address-cells = <3>;
85 device_type = "pci";
86 interrupts = <16 2 0 0>;
87 interrupt-map-mask = <0xf800 0 0 7>;
88
89 interrupt-map = <
90 /* IDSEL 0x0 */
91 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
92 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
93 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
94 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
95 >;
96 };
97};
98
99/* controller at 0xb000 */
100&pci2 {
101 compatible = "fsl,p1022-pcie";
102 device_type = "pci";
103 #size-cells = <2>;
104 #address-cells = <3>;
105 bus-range = <0 255>;
106 clock-frequency = <33333333>;
107 interrupts = <16 2 0 0>;
108
109 pcie@0 {
110 reg = <0 0 0 0 0>;
111 #interrupt-cells = <1>;
112 #size-cells = <2>;
113 #address-cells = <3>;
114 device_type = "pci";
115 interrupts = <16 2 0 0>;
116 interrupt-map-mask = <0xf800 0 0 7>;
117
118 interrupt-map = <
119 /* IDSEL 0x0 */
120 0000 0x0 0x0 0x1 &mpic 0x8 0x1 0x0 0x0
121 0000 0x0 0x0 0x2 &mpic 0x9 0x1 0x0 0x0
122 0000 0x0 0x0 0x3 &mpic 0xa 0x1 0x0 0x0
123 0000 0x0 0x0 0x4 &mpic 0xb 0x1 0x0 0x0
124 >;
125 };
126};
127
128&soc {
129 #address-cells = <1>;
130 #size-cells = <1>;
131 device_type = "soc";
132 compatible = "fsl,p1022-immr", "simple-bus";
133 bus-frequency = <0>; // Filled out by uboot.
134
135 ecm-law@0 {
136 compatible = "fsl,ecm-law";
137 reg = <0x0 0x1000>;
138 fsl,num-laws = <12>;
139 };
140
141 ecm@1000 {
142 compatible = "fsl,p1022-ecm", "fsl,ecm";
143 reg = <0x1000 0x1000>;
144 interrupts = <16 2 0 0>;
145 };
146
147 memory-controller@2000 {
148 compatible = "fsl,p1022-memory-controller";
149 reg = <0x2000 0x1000>;
150 interrupts = <16 2 0 0>;
151 };
152
153/include/ "pq3-i2c-0.dtsi"
154/include/ "pq3-i2c-1.dtsi"
155/include/ "pq3-duart-0.dtsi"
156/include/ "pq3-espi-0.dtsi"
157 spi@7000 {
158 fsl,espi-num-chipselects = <4>;
159 };
160
161/include/ "pq3-dma-1.dtsi"
162 dma@c300 {
163 dma00: dma-channel@0 {
164 compatible = "fsl,ssi-dma-channel";
165 };
166 dma01: dma-channel@80 {
167 compatible = "fsl,ssi-dma-channel";
168 };
169 };
170
171/include/ "pq3-gpio-0.dtsi"
172
173 display@10000 {
174 compatible = "fsl,diu", "fsl,p1022-diu";
175 reg = <0x10000 1000>;
176 interrupts = <64 2 0 0>;
177 };
178
179 ssi@15000 {
180 compatible = "fsl,mpc8610-ssi";
181 cell-index = <0>;
182 reg = <0x15000 0x100>;
183 interrupts = <75 2 0 0>;
184 fsl,playback-dma = <&dma00>;
185 fsl,capture-dma = <&dma01>;
186 fsl,fifo-depth = <15>;
187 };
188
189/include/ "pq3-sata2-0.dtsi"
190/include/ "pq3-sata2-1.dtsi"
191
192 L2: l2-cache-controller@20000 {
193 compatible = "fsl,p1022-l2-cache-controller";
194 reg = <0x20000 0x1000>;
195 cache-line-size = <32>; // 32 bytes
196 cache-size = <0x40000>; // L2,256K
197 interrupts = <16 2 0 0>;
198 };
199
200/include/ "pq3-dma-0.dtsi"
201/include/ "pq3-usb2-dr-0.dtsi"
202/include/ "pq3-usb2-dr-1.dtsi"
203
204/include/ "pq3-esdhc-0.dtsi"
205 sdhc@2e000 {
206 fsl,sdhci-auto-cmd12;
207 };
208
209/include/ "pq3-sec3.3-0.dtsi"
210/include/ "pq3-mpic.dtsi"
211/include/ "pq3-mpic-timer-B.dtsi"
212
213/include/ "pq3-etsec2-0.dtsi"
214 enet0: enet0_grp2: ethernet@b0000 {
215 };
216
217/include/ "pq3-etsec2-1.dtsi"
218 enet1: enet1_grp2: ethernet@b1000 {
219 };
220
221 global-utilities@e0000 {
222 compatible = "fsl,p1022-guts";
223 reg = <0xe0000 0x1000>;
224 fsl,has-rstcr;
225 };
226
227 power@e0070{
228 compatible = "fsl,mpc8536-pmc", "fsl,mpc8548-pmc";
229 reg = <0xe0070 0x20>;
230 };
231
232};
233
234/include/ "pq3-etsec2-grp2-0.dtsi"
235/include/ "pq3-etsec2-grp2-1.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi
new file mode 100644
index 000000000000..e930f4f7ca89
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi
@@ -0,0 +1,68 @@
1/*
2 * P1022/P1013 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P1022";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 pci0 = &pci0;
48 pci1 = &pci1;
49 pci2 = &pci2;
50 };
51
52 cpus {
53 #address-cells = <1>;
54 #size-cells = <0>;
55
56 PowerPC,P1022@0 {
57 device_type = "cpu";
58 reg = <0x0>;
59 next-level-cache = <&L2>;
60 };
61
62 PowerPC,P1022@1 {
63 device_type = "cpu";
64 reg = <0x1>;
65 next-level-cache = <&L2>;
66 };
67 };
68};
diff --git a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
new file mode 100644
index 000000000000..b06bb4cc1fe8
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
@@ -0,0 +1,224 @@
1/*
2 * P1023/P1017 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,p1023-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0xa000 */
43&pci0 {
44 compatible = "fsl,p1023-pcie", "fsl,qoriq-pcie-v2.2";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0x0 0xff>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 0 0>;
51 pcie@0 {
52 reg = <0 0 0 0 0>;
53 #interrupt-cells = <1>;
54 #size-cells = <2>;
55 #address-cells = <3>;
56 device_type = "pci";
57 interrupts = <16 2 0 0>;
58 };
59};
60
61/* controller at 0x9000 */
62&pci1 {
63 compatible = "fsl,p1023-pcie", "fsl,qoriq-pcie-v2.2";
64 device_type = "pci";
65 #size-cells = <2>;
66 #address-cells = <3>;
67 bus-range = <0 0xff>;
68 clock-frequency = <33333333>;
69 interrupts = <16 2 0 0>;
70 pcie@0 {
71 reg = <0 0 0 0 0>;
72 #interrupt-cells = <1>;
73 #size-cells = <2>;
74 #address-cells = <3>;
75 device_type = "pci";
76 interrupts = <16 2 0 0>;
77 };
78};
79
80/* controller at 0xb000 */
81&pci2 {
82 compatible = "fsl,p1023-pcie", "fsl,qoriq-pcie-v2.2";
83 device_type = "pci";
84 #size-cells = <2>;
85 #address-cells = <3>;
86 bus-range = <0x0 0xff>;
87 clock-frequency = <33333333>;
88 interrupts = <16 2 0 0>;
89 pcie@0 {
90 reg = <0 0 0 0 0>;
91 #interrupt-cells = <1>;
92 #size-cells = <2>;
93 #address-cells = <3>;
94 device_type = "pci";
95 interrupts = <16 2 0 0>;
96 };
97};
98
99&soc {
100 #address-cells = <1>;
101 #size-cells = <1>;
102 device_type = "soc";
103 compatible = "fsl,p1023-immr", "simple-bus";
104 bus-frequency = <0>; // Filled out by uboot.
105
106 ecm-law@0 {
107 compatible = "fsl,ecm-law";
108 reg = <0x0 0x1000>;
109 fsl,num-laws = <12>;
110 };
111
112 ecm@1000 {
113 compatible = "fsl,p1023-ecm", "fsl,ecm";
114 reg = <0x1000 0x1000>;
115 interrupts = <16 2 0 0>;
116 };
117
118 memory-controller@2000 {
119 compatible = "fsl,p1023-memory-controller";
120 reg = <0x2000 0x1000>;
121 interrupts = <16 2 0 0>;
122 };
123
124/include/ "pq3-i2c-0.dtsi"
125/include/ "pq3-i2c-1.dtsi"
126/include/ "pq3-duart-0.dtsi"
127
128/include/ "pq3-espi-0.dtsi"
129 spi@7000 {
130 fsl,espi-num-chipselects = <4>;
131 };
132
133/include/ "pq3-gpio-0.dtsi"
134
135 L2: l2-cache-controller@20000 {
136 compatible = "fsl,p1023-l2-cache-controller";
137 reg = <0x20000 0x1000>;
138 cache-line-size = <32>; // 32 bytes
139 cache-size = <0x40000>; // L2,256K
140 interrupts = <16 2 0 0>;
141 };
142
143/include/ "pq3-dma-0.dtsi"
144/include/ "pq3-usb2-dr-0.dtsi"
145
146 crypto: crypto@300000 {
147 compatible = "fsl,sec-v4.2", "fsl,sec-v4.0";
148 #address-cells = <1>;
149 #size-cells = <1>;
150 reg = <0x30000 0x10000>;
151 ranges = <0 0x30000 0x10000>;
152 interrupts = <58 2 0 0>;
153
154 sec_jr0: jr@1000 {
155 compatible = "fsl,sec-v4.2-job-ring",
156 "fsl,sec-v4.0-job-ring";
157 reg = <0x1000 0x1000>;
158 interrupts = <45 2 0 0>;
159 };
160
161 sec_jr1: jr@2000 {
162 compatible = "fsl,sec-v4.2-job-ring",
163 "fsl,sec-v4.0-job-ring";
164 reg = <0x2000 0x1000>;
165 interrupts = <45 2 0 0>;
166 };
167
168 sec_jr2: jr@3000 {
169 compatible = "fsl,sec-v4.2-job-ring",
170 "fsl,sec-v4.0-job-ring";
171 reg = <0x3000 0x1000>;
172 interrupts = <57 2 0 0>;
173 };
174
175 sec_jr3: jr@4000 {
176 compatible = "fsl,sec-v4.2-job-ring",
177 "fsl,sec-v4.0-job-ring";
178 reg = <0x4000 0x1000>;
179 interrupts = <57 2 0 0>;
180 };
181
182 rtic@6000 {
183 compatible = "fsl,sec-v4.2-rtic",
184 "fsl,sec-v4.0-rtic";
185 #address-cells = <1>;
186 #size-cells = <1>;
187 reg = <0x6000 0x100>;
188 ranges = <0x0 0x6100 0xe00>;
189
190 rtic_a: rtic-a@0 {
191 compatible = "fsl,sec-v4.2-rtic-memory",
192 "fsl,sec-v4.0-rtic-memory";
193 reg = <0x00 0x20 0x100 0x80>;
194 };
195
196 rtic_b: rtic-b@20 {
197 compatible = "fsl,sec-v4.2-rtic-memory",
198 "fsl,sec-v4.0-rtic-memory";
199 reg = <0x20 0x20 0x200 0x80>;
200 };
201
202 rtic_c: rtic-c@40 {
203 compatible = "fsl,sec-v4.2-rtic-memory",
204 "fsl,sec-v4.0-rtic-memory";
205 reg = <0x40 0x20 0x300 0x80>;
206 };
207
208 rtic_d: rtic-d@60 {
209 compatible = "fsl,sec-v4.2-rtic-memory",
210 "fsl,sec-v4.0-rtic-memory";
211 reg = <0x60 0x20 0x500 0x80>;
212 };
213 };
214 };
215
216/include/ "pq3-mpic.dtsi"
217/include/ "pq3-mpic-timer-B.dtsi"
218
219 global-utilities@e0000 {
220 compatible = "fsl,p1023-guts";
221 reg = <0xe0000 0x1000>;
222 fsl,has-rstcr;
223 };
224};
diff --git a/arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi
new file mode 100644
index 000000000000..ac45f6d93385
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi
@@ -0,0 +1,76 @@
1/*
2 * P1023/P1017 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P1023";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 pci0 = &pci0;
46 pci1 = &pci1;
47 pci2 = &pci2;
48
49 crypto = &crypto;
50 sec_jr0 = &sec_jr0;
51 sec_jr1 = &sec_jr1;
52 sec_jr2 = &sec_jr2;
53 sec_jr3 = &sec_jr3;
54 rtic_a = &rtic_a;
55 rtic_b = &rtic_b;
56 rtic_c = &rtic_c;
57 rtic_d = &rtic_d;
58 };
59
60 cpus {
61 #address-cells = <1>;
62 #size-cells = <0>;
63
64 PowerPC,P1023@0 {
65 device_type = "cpu";
66 reg = <0x0>;
67 next-level-cache = <&L2>;
68 };
69
70 PowerPC,P1023@1 {
71 device_type = "cpu";
72 reg = <0x1>;
73 next-level-cache = <&L2>;
74 };
75 };
76};
diff --git a/arch/powerpc/boot/dts/fsl/p2020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2020si-post.dtsi
new file mode 100644
index 000000000000..c041050561a7
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p2020si-post.dtsi
@@ -0,0 +1,194 @@
1/*
2 * P2020/P2010 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,p2020-elbc", "fsl,elbc", "simple-bus";
39 interrupts = <19 2 0 0>;
40};
41
42/* controller at 0xa000 */
43&pci0 {
44 compatible = "fsl,mpc8548-pcie";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0 255>;
49 clock-frequency = <33333333>;
50 interrupts = <26 2 0 0>;
51
52 pcie@0 {
53 reg = <0 0 0 0 0>;
54 #interrupt-cells = <1>;
55 #size-cells = <2>;
56 #address-cells = <3>;
57 device_type = "pci";
58 interrupts = <26 2 0 0>;
59 interrupt-map-mask = <0xf800 0 0 7>;
60 interrupt-map = <
61 /* IDSEL 0x0 */
62 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
63 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
64 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
65 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
66 >;
67 };
68};
69
70/* controller at 0x9000 */
71&pci1 {
72 compatible = "fsl,mpc8548-pcie";
73 device_type = "pci";
74 #size-cells = <2>;
75 #address-cells = <3>;
76 bus-range = <0 255>;
77 clock-frequency = <33333333>;
78 interrupts = <25 2 0 0>;
79
80 pcie@0 {
81 reg = <0 0 0 0 0>;
82 #interrupt-cells = <1>;
83 #size-cells = <2>;
84 #address-cells = <3>;
85 device_type = "pci";
86 interrupts = <25 2 0 0>;
87 interrupt-map-mask = <0xf800 0 0 7>;
88
89 interrupt-map = <
90 /* IDSEL 0x0 */
91 0000 0x0 0x0 0x1 &mpic 0x4 0x1 0x0 0x0
92 0000 0x0 0x0 0x2 &mpic 0x5 0x1 0x0 0x0
93 0000 0x0 0x0 0x3 &mpic 0x6 0x1 0x0 0x0
94 0000 0x0 0x0 0x4 &mpic 0x7 0x1 0x0 0x0
95 >;
96 };
97};
98
99/* controller at 0x8000 */
100&pci2 {
101 compatible = "fsl,mpc8548-pcie";
102 device_type = "pci";
103 #size-cells = <2>;
104 #address-cells = <3>;
105 bus-range = <0 255>;
106 clock-frequency = <33333333>;
107 interrupts = <24 2 0 0>;
108
109 pcie@0 {
110 reg = <0 0 0 0 0>;
111 #interrupt-cells = <1>;
112 #size-cells = <2>;
113 #address-cells = <3>;
114 device_type = "pci";
115 interrupts = <24 2 0 0>;
116 interrupt-map-mask = <0xf800 0 0 7>;
117
118 interrupt-map = <
119 /* IDSEL 0x0 */
120 0000 0x0 0x0 0x1 &mpic 0x8 0x1 0x0 0x0
121 0000 0x0 0x0 0x2 &mpic 0x9 0x1 0x0 0x0
122 0000 0x0 0x0 0x3 &mpic 0xa 0x1 0x0 0x0
123 0000 0x0 0x0 0x4 &mpic 0xb 0x1 0x0 0x0
124 >;
125 };
126};
127
128&soc {
129 #address-cells = <1>;
130 #size-cells = <1>;
131 device_type = "soc";
132 compatible = "fsl,p2020-immr", "simple-bus";
133 bus-frequency = <0>; // Filled out by uboot.
134
135 ecm-law@0 {
136 compatible = "fsl,ecm-law";
137 reg = <0x0 0x1000>;
138 fsl,num-laws = <12>;
139 };
140
141 ecm@1000 {
142 compatible = "fsl,p2020-ecm", "fsl,ecm";
143 reg = <0x1000 0x1000>;
144 interrupts = <17 2 0 0>;
145 };
146
147 memory-controller@2000 {
148 compatible = "fsl,p2020-memory-controller";
149 reg = <0x2000 0x1000>;
150 interrupts = <18 2 0 0>;
151 };
152
153/include/ "pq3-i2c-0.dtsi"
154/include/ "pq3-i2c-1.dtsi"
155/include/ "pq3-duart-0.dtsi"
156/include/ "pq3-espi-0.dtsi"
157 spi0: spi@7000 {
158 fsl,espi-num-chipselects = <4>;
159 };
160
161/include/ "pq3-dma-1.dtsi"
162/include/ "pq3-gpio-0.dtsi"
163
164 L2: l2-cache-controller@20000 {
165 compatible = "fsl,p2020-l2-cache-controller";
166 reg = <0x20000 0x1000>;
167 cache-line-size = <32>; // 32 bytes
168 cache-size = <0x80000>; // L2,512K
169 interrupts = <16 2 0 0>;
170 };
171
172/include/ "pq3-dma-0.dtsi"
173/include/ "pq3-usb2-dr-0.dtsi"
174/include/ "pq3-etsec1-0.dtsi"
175/include/ "pq3-etsec1-timer-0.dtsi"
176
177 ptp_clock@24e00 {
178 interrupts = <68 2 0 0 69 2 0 0 70 2 0 0>;
179 };
180
181
182/include/ "pq3-etsec1-1.dtsi"
183/include/ "pq3-etsec1-2.dtsi"
184/include/ "pq3-esdhc-0.dtsi"
185/include/ "pq3-sec3.1-0.dtsi"
186/include/ "pq3-mpic.dtsi"
187/include/ "pq3-mpic-timer-B.dtsi"
188
189 global-utilities@e0000 {
190 compatible = "fsl,p2020-guts";
191 reg = <0xe0000 0x1000>;
192 fsl,has-rstcr;
193 };
194};
diff --git a/arch/powerpc/boot/dts/fsl/p2020si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p2020si-pre.dtsi
new file mode 100644
index 000000000000..3213288641d1
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p2020si-pre.dtsi
@@ -0,0 +1,69 @@
1/*
2 * P2020/P2010 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P2020";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 serial0 = &serial0;
44 serial1 = &serial1;
45 ethernet0 = &enet0;
46 ethernet1 = &enet1;
47 ethernet2 = &enet2;
48 pci0 = &pci0;
49 pci1 = &pci1;
50 pci2 = &pci2;
51 };
52
53 cpus {
54 #address-cells = <1>;
55 #size-cells = <0>;
56
57 PowerPC,P2020@0 {
58 device_type = "cpu";
59 reg = <0x0>;
60 next-level-cache = <&L2>;
61 };
62
63 PowerPC,P2020@1 {
64 device_type = "cpu";
65 reg = <0x1>;
66 next-level-cache = <&L2>;
67 };
68 };
69};
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
new file mode 100644
index 000000000000..234a399ddeb2
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -0,0 +1,325 @@
1/*
2 * P2041/P2040 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 compatible = "fsl,p2041-elbc", "fsl,elbc", "simple-bus";
37 interrupts = <25 2 0 0>;
38 #address-cells = <2>;
39 #size-cells = <1>;
40};
41
42/* controller at 0x200000 */
43&pci0 {
44 compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0x0 0xff>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 1 15>;
51 pcie@0 {
52 reg = <0 0 0 0 0>;
53 #interrupt-cells = <1>;
54 #size-cells = <2>;
55 #address-cells = <3>;
56 device_type = "pci";
57 interrupts = <16 2 1 15>;
58 interrupt-map-mask = <0xf800 0 0 7>;
59 interrupt-map = <
60 /* IDSEL 0x0 */
61 0000 0 0 1 &mpic 40 1 0 0
62 0000 0 0 2 &mpic 1 1 0 0
63 0000 0 0 3 &mpic 2 1 0 0
64 0000 0 0 4 &mpic 3 1 0 0
65 >;
66 };
67};
68
69/* controller at 0x201000 */
70&pci1 {
71 compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";
72 device_type = "pci";
73 #size-cells = <2>;
74 #address-cells = <3>;
75 bus-range = <0 0xff>;
76 clock-frequency = <33333333>;
77 interrupts = <16 2 1 14>;
78 pcie@0 {
79 reg = <0 0 0 0 0>;
80 #interrupt-cells = <1>;
81 #size-cells = <2>;
82 #address-cells = <3>;
83 device_type = "pci";
84 interrupts = <16 2 1 14>;
85 interrupt-map-mask = <0xf800 0 0 7>;
86 interrupt-map = <
87 /* IDSEL 0x0 */
88 0000 0 0 1 &mpic 41 1 0 0
89 0000 0 0 2 &mpic 5 1 0 0
90 0000 0 0 3 &mpic 6 1 0 0
91 0000 0 0 4 &mpic 7 1 0 0
92 >;
93 };
94};
95
96/* controller at 0x202000 */
97&pci2 {
98 compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";
99 device_type = "pci";
100 #size-cells = <2>;
101 #address-cells = <3>;
102 bus-range = <0x0 0xff>;
103 clock-frequency = <33333333>;
104 interrupts = <16 2 1 13>;
105 pcie@0 {
106 reg = <0 0 0 0 0>;
107 #interrupt-cells = <1>;
108 #size-cells = <2>;
109 #address-cells = <3>;
110 device_type = "pci";
111 interrupts = <16 2 1 13>;
112 interrupt-map-mask = <0xf800 0 0 7>;
113 interrupt-map = <
114 /* IDSEL 0x0 */
115 0000 0 0 1 &mpic 42 1 0 0
116 0000 0 0 2 &mpic 9 1 0 0
117 0000 0 0 3 &mpic 10 1 0 0
118 0000 0 0 4 &mpic 11 1 0 0
119 >;
120 };
121};
122
123&rio {
124 compatible = "fsl,srio";
125 interrupts = <16 2 1 11>;
126 #address-cells = <2>;
127 #size-cells = <2>;
128 ranges;
129
130 port1 {
131 #address-cells = <2>;
132 #size-cells = <2>;
133 cell-index = <1>;
134 };
135
136 port2 {
137 #address-cells = <2>;
138 #size-cells = <2>;
139 cell-index = <2>;
140 };
141};
142
143&dcsr {
144 #address-cells = <1>;
145 #size-cells = <1>;
146 compatible = "fsl,dcsr", "simple-bus";
147
148 dcsr-epu@0 {
149 compatible = "fsl,dcsr-epu";
150 interrupts = <52 2 0 0
151 84 2 0 0
152 85 2 0 0>;
153 reg = <0x0 0x1000>;
154 };
155 dcsr-npc {
156 compatible = "fsl,dcsr-npc";
157 reg = <0x1000 0x1000 0x1000000 0x8000>;
158 };
159 dcsr-nxc@2000 {
160 compatible = "fsl,dcsr-nxc";
161 reg = <0x2000 0x1000>;
162 };
163 dcsr-corenet {
164 compatible = "fsl,dcsr-corenet";
165 reg = <0x8000 0x1000 0xB0000 0x1000>;
166 };
167 dcsr-dpaa@9000 {
168 compatible = "fsl,p2041-dcsr-dpaa", "fsl,dcsr-dpaa";
169 reg = <0x9000 0x1000>;
170 };
171 dcsr-ocn@11000 {
172 compatible = "fsl,p2041-dcsr-ocn", "fsl,dcsr-ocn";
173 reg = <0x11000 0x1000>;
174 };
175 dcsr-ddr@12000 {
176 compatible = "fsl,dcsr-ddr";
177 dev-handle = <&ddr1>;
178 reg = <0x12000 0x1000>;
179 };
180 dcsr-nal@18000 {
181 compatible = "fsl,p2041-dcsr-nal", "fsl,dcsr-nal";
182 reg = <0x18000 0x1000>;
183 };
184 dcsr-rcpm@22000 {
185 compatible = "fsl,p2041-dcsr-rcpm", "fsl,dcsr-rcpm";
186 reg = <0x22000 0x1000>;
187 };
188 dcsr-cpu-sb-proxy@40000 {
189 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
190 cpu-handle = <&cpu0>;
191 reg = <0x40000 0x1000>;
192 };
193 dcsr-cpu-sb-proxy@41000 {
194 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
195 cpu-handle = <&cpu1>;
196 reg = <0x41000 0x1000>;
197 };
198 dcsr-cpu-sb-proxy@42000 {
199 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
200 cpu-handle = <&cpu2>;
201 reg = <0x42000 0x1000>;
202 };
203 dcsr-cpu-sb-proxy@43000 {
204 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
205 cpu-handle = <&cpu3>;
206 reg = <0x43000 0x1000>;
207 };
208};
209
210&soc {
211 #address-cells = <1>;
212 #size-cells = <1>;
213 device_type = "soc";
214 compatible = "simple-bus";
215
216 soc-sram-error {
217 compatible = "fsl,soc-sram-error";
218 interrupts = <16 2 1 29>;
219 };
220
221 corenet-law@0 {
222 compatible = "fsl,corenet-law";
223 reg = <0x0 0x1000>;
224 fsl,num-laws = <32>;
225 };
226
227 ddr1: memory-controller@8000 {
228 compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
229 reg = <0x8000 0x1000>;
230 interrupts = <16 2 1 23>;
231 };
232
233 cpc: l3-cache-controller@10000 {
234 compatible = "fsl,p2041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache";
235 reg = <0x10000 0x1000>;
236 interrupts = <16 2 1 27>;
237 };
238
239 corenet-cf@18000 {
240 compatible = "fsl,corenet-cf";
241 reg = <0x18000 0x1000>;
242 interrupts = <16 2 1 31>;
243 fsl,ccf-num-csdids = <32>;
244 fsl,ccf-num-snoopids = <32>;
245 };
246
247 iommu@20000 {
248 compatible = "fsl,pamu-v1.0", "fsl,pamu";
249 reg = <0x20000 0x4000>;
250 interrupts = <
251 24 2 0 0
252 16 2 1 30>;
253 };
254
255/include/ "qoriq-mpic.dtsi"
256
257 guts: global-utilities@e0000 {
258 compatible = "fsl,qoriq-device-config-1.0";
259 reg = <0xe0000 0xe00>;
260 fsl,has-rstcr;
261 #sleep-cells = <1>;
262 fsl,liodn-bits = <12>;
263 };
264
265 pins: global-utilities@e0e00 {
266 compatible = "fsl,qoriq-pin-control-1.0";
267 reg = <0xe0e00 0x200>;
268 #sleep-cells = <2>;
269 };
270
271 clockgen: global-utilities@e1000 {
272 compatible = "fsl,p2041-clockgen", "fsl,qoriq-clockgen-1.0";
273 reg = <0xe1000 0x1000>;
274 clock-frequency = <0>;
275 };
276
277 rcpm: global-utilities@e2000 {
278 compatible = "fsl,qoriq-rcpm-1.0";
279 reg = <0xe2000 0x1000>;
280 #sleep-cells = <1>;
281 };
282
283 sfp: sfp@e8000 {
284 compatible = "fsl,p2041-sfp", "fsl,qoriq-sfp-1.0";
285 reg = <0xe8000 0x1000>;
286 };
287
288 serdes: serdes@ea000 {
289 compatible = "fsl,p2041-serdes";
290 reg = <0xea000 0x1000>;
291 };
292
293/include/ "qoriq-dma-0.dtsi"
294/include/ "qoriq-dma-1.dtsi"
295/include/ "qoriq-espi-0.dtsi"
296 spi@110000 {
297 fsl,espi-num-chipselects = <4>;
298 };
299
300/include/ "qoriq-esdhc-0.dtsi"
301 sdhc@114000 {
302 sdhci,auto-cmd12;
303 };
304
305/include/ "qoriq-i2c-0.dtsi"
306/include/ "qoriq-i2c-1.dtsi"
307/include/ "qoriq-duart-0.dtsi"
308/include/ "qoriq-duart-1.dtsi"
309/include/ "qoriq-gpio-0.dtsi"
310/include/ "qoriq-usb2-mph-0.dtsi"
311 usb0: usb@210000 {
312 phy_type = "utmi";
313 port0;
314 };
315
316/include/ "qoriq-usb2-dr-0.dtsi"
317 usb1: usb@211000 {
318 dr_mode = "host";
319 phy_type = "utmi";
320 };
321
322/include/ "qoriq-sata2-0.dtsi"
323/include/ "qoriq-sata2-1.dtsi"
324/include/ "qoriq-sec4.2-0.dtsi"
325};
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
new file mode 100644
index 000000000000..2d0a40d6b10f
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
@@ -0,0 +1,111 @@
1/*
2 * P2041 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P2041";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 ccsr = &soc;
44 dcsr = &dcsr;
45
46 serial0 = &serial0;
47 serial1 = &serial1;
48 serial2 = &serial2;
49 serial3 = &serial3;
50 pci0 = &pci0;
51 pci1 = &pci1;
52 pci2 = &pci2;
53 usb0 = &usb0;
54 usb1 = &usb1;
55 dma0 = &dma0;
56 dma1 = &dma1;
57 sdhc = &sdhc;
58 msi0 = &msi0;
59 msi1 = &msi1;
60 msi2 = &msi2;
61
62 crypto = &crypto;
63 sec_jr0 = &sec_jr0;
64 sec_jr1 = &sec_jr1;
65 sec_jr2 = &sec_jr2;
66 sec_jr3 = &sec_jr3;
67 rtic_a = &rtic_a;
68 rtic_b = &rtic_b;
69 rtic_c = &rtic_c;
70 rtic_d = &rtic_d;
71 sec_mon = &sec_mon;
72 };
73
74 cpus {
75 #address-cells = <1>;
76 #size-cells = <0>;
77
78 cpu0: PowerPC,e500mc@0 {
79 device_type = "cpu";
80 reg = <0>;
81 next-level-cache = <&L2_0>;
82 L2_0: l2-cache {
83 next-level-cache = <&cpc>;
84 };
85 };
86 cpu1: PowerPC,e500mc@1 {
87 device_type = "cpu";
88 reg = <1>;
89 next-level-cache = <&L2_1>;
90 L2_1: l2-cache {
91 next-level-cache = <&cpc>;
92 };
93 };
94 cpu2: PowerPC,e500mc@2 {
95 device_type = "cpu";
96 reg = <2>;
97 next-level-cache = <&L2_2>;
98 L2_2: l2-cache {
99 next-level-cache = <&cpc>;
100 };
101 };
102 cpu3: PowerPC,e500mc@3 {
103 device_type = "cpu";
104 reg = <3>;
105 next-level-cache = <&L2_3>;
106 L2_3: l2-cache {
107 next-level-cache = <&cpc>;
108 };
109 };
110 };
111};
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
new file mode 100644
index 000000000000..d41d08de7f7e
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -0,0 +1,352 @@
1/*
2 * P3041 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 compatible = "fsl,p3041-elbc", "fsl,elbc", "simple-bus";
37 interrupts = <25 2 0 0>;
38 #address-cells = <2>;
39 #size-cells = <1>;
40};
41
42/* controller at 0x200000 */
43&pci0 {
44 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0x0 0xff>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 1 15>;
51 pcie@0 {
52 reg = <0 0 0 0 0>;
53 #interrupt-cells = <1>;
54 #size-cells = <2>;
55 #address-cells = <3>;
56 device_type = "pci";
57 interrupts = <16 2 1 15>;
58 interrupt-map-mask = <0xf800 0 0 7>;
59 interrupt-map = <
60 /* IDSEL 0x0 */
61 0000 0 0 1 &mpic 40 1 0 0
62 0000 0 0 2 &mpic 1 1 0 0
63 0000 0 0 3 &mpic 2 1 0 0
64 0000 0 0 4 &mpic 3 1 0 0
65 >;
66 };
67};
68
69/* controller at 0x201000 */
70&pci1 {
71 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
72 device_type = "pci";
73 #size-cells = <2>;
74 #address-cells = <3>;
75 bus-range = <0 0xff>;
76 clock-frequency = <33333333>;
77 interrupts = <16 2 1 14>;
78 pcie@0 {
79 reg = <0 0 0 0 0>;
80 #interrupt-cells = <1>;
81 #size-cells = <2>;
82 #address-cells = <3>;
83 device_type = "pci";
84 interrupts = <16 2 1 14>;
85 interrupt-map-mask = <0xf800 0 0 7>;
86 interrupt-map = <
87 /* IDSEL 0x0 */
88 0000 0 0 1 &mpic 41 1 0 0
89 0000 0 0 2 &mpic 5 1 0 0
90 0000 0 0 3 &mpic 6 1 0 0
91 0000 0 0 4 &mpic 7 1 0 0
92 >;
93 };
94};
95
96/* controller at 0x202000 */
97&pci2 {
98 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
99 device_type = "pci";
100 #size-cells = <2>;
101 #address-cells = <3>;
102 bus-range = <0x0 0xff>;
103 clock-frequency = <33333333>;
104 interrupts = <16 2 1 13>;
105 pcie@0 {
106 reg = <0 0 0 0 0>;
107 #interrupt-cells = <1>;
108 #size-cells = <2>;
109 #address-cells = <3>;
110 device_type = "pci";
111 interrupts = <16 2 1 13>;
112 interrupt-map-mask = <0xf800 0 0 7>;
113 interrupt-map = <
114 /* IDSEL 0x0 */
115 0000 0 0 1 &mpic 42 1 0 0
116 0000 0 0 2 &mpic 9 1 0 0
117 0000 0 0 3 &mpic 10 1 0 0
118 0000 0 0 4 &mpic 11 1 0 0
119 >;
120 };
121};
122
123/* controller at 0x203000 */
124&pci3 {
125 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
126 device_type = "pci";
127 #size-cells = <2>;
128 #address-cells = <3>;
129 bus-range = <0x0 0xff>;
130 clock-frequency = <33333333>;
131 interrupts = <16 2 1 12>;
132 pcie@0 {
133 reg = <0 0 0 0 0>;
134 #interrupt-cells = <1>;
135 #size-cells = <2>;
136 #address-cells = <3>;
137 device_type = "pci";
138 interrupts = <16 2 1 12>;
139 interrupt-map-mask = <0xf800 0 0 7>;
140 interrupt-map = <
141 /* IDSEL 0x0 */
142 0000 0 0 1 &mpic 43 1 0 0
143 0000 0 0 2 &mpic 0 1 0 0
144 0000 0 0 3 &mpic 4 1 0 0
145 0000 0 0 4 &mpic 8 1 0 0
146 >;
147 };
148};
149
150&rio {
151 compatible = "fsl,srio";
152 interrupts = <16 2 1 11>;
153 #address-cells = <2>;
154 #size-cells = <2>;
155 ranges;
156
157 port1 {
158 #address-cells = <2>;
159 #size-cells = <2>;
160 cell-index = <1>;
161 };
162
163 port2 {
164 #address-cells = <2>;
165 #size-cells = <2>;
166 cell-index = <2>;
167 };
168};
169
170&dcsr {
171 #address-cells = <1>;
172 #size-cells = <1>;
173 compatible = "fsl,dcsr", "simple-bus";
174
175 dcsr-epu@0 {
176 compatible = "fsl,dcsr-epu";
177 interrupts = <52 2 0 0
178 84 2 0 0
179 85 2 0 0>;
180 reg = <0x0 0x1000>;
181 };
182 dcsr-npc {
183 compatible = "fsl,dcsr-npc";
184 reg = <0x1000 0x1000 0x1000000 0x8000>;
185 };
186 dcsr-nxc@2000 {
187 compatible = "fsl,dcsr-nxc";
188 reg = <0x2000 0x1000>;
189 };
190 dcsr-corenet {
191 compatible = "fsl,dcsr-corenet";
192 reg = <0x8000 0x1000 0xB0000 0x1000>;
193 };
194 dcsr-dpaa@9000 {
195 compatible = "fsl,p3041-dcsr-dpaa", "fsl,dcsr-dpaa";
196 reg = <0x9000 0x1000>;
197 };
198 dcsr-ocn@11000 {
199 compatible = "fsl,p3041-dcsr-ocn", "fsl,dcsr-ocn";
200 reg = <0x11000 0x1000>;
201 };
202 dcsr-ddr@12000 {
203 compatible = "fsl,dcsr-ddr";
204 dev-handle = <&ddr1>;
205 reg = <0x12000 0x1000>;
206 };
207 dcsr-nal@18000 {
208 compatible = "fsl,p3041-dcsr-nal", "fsl,dcsr-nal";
209 reg = <0x18000 0x1000>;
210 };
211 dcsr-rcpm@22000 {
212 compatible = "fsl,p3041-dcsr-rcpm", "fsl,dcsr-rcpm";
213 reg = <0x22000 0x1000>;
214 };
215 dcsr-cpu-sb-proxy@40000 {
216 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
217 cpu-handle = <&cpu0>;
218 reg = <0x40000 0x1000>;
219 };
220 dcsr-cpu-sb-proxy@41000 {
221 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
222 cpu-handle = <&cpu1>;
223 reg = <0x41000 0x1000>;
224 };
225 dcsr-cpu-sb-proxy@42000 {
226 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
227 cpu-handle = <&cpu2>;
228 reg = <0x42000 0x1000>;
229 };
230 dcsr-cpu-sb-proxy@43000 {
231 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
232 cpu-handle = <&cpu3>;
233 reg = <0x43000 0x1000>;
234 };
235};
236
237&soc {
238 #address-cells = <1>;
239 #size-cells = <1>;
240 device_type = "soc";
241 compatible = "simple-bus";
242
243 soc-sram-error {
244 compatible = "fsl,soc-sram-error";
245 interrupts = <16 2 1 29>;
246 };
247
248 corenet-law@0 {
249 compatible = "fsl,corenet-law";
250 reg = <0x0 0x1000>;
251 fsl,num-laws = <32>;
252 };
253
254 ddr1: memory-controller@8000 {
255 compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
256 reg = <0x8000 0x1000>;
257 interrupts = <16 2 1 23>;
258 };
259
260 cpc: l3-cache-controller@10000 {
261 compatible = "fsl,p3041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache";
262 reg = <0x10000 0x1000>;
263 interrupts = <16 2 1 27>;
264 };
265
266 corenet-cf@18000 {
267 compatible = "fsl,corenet-cf";
268 reg = <0x18000 0x1000>;
269 interrupts = <16 2 1 31>;
270 fsl,ccf-num-csdids = <32>;
271 fsl,ccf-num-snoopids = <32>;
272 };
273
274 iommu@20000 {
275 compatible = "fsl,pamu-v1.0", "fsl,pamu";
276 reg = <0x20000 0x4000>;
277 interrupts = <
278 24 2 0 0
279 16 2 1 30>;
280 };
281
282/include/ "qoriq-mpic.dtsi"
283
284 guts: global-utilities@e0000 {
285 compatible = "fsl,qoriq-device-config-1.0";
286 reg = <0xe0000 0xe00>;
287 fsl,has-rstcr;
288 #sleep-cells = <1>;
289 fsl,liodn-bits = <12>;
290 };
291
292 pins: global-utilities@e0e00 {
293 compatible = "fsl,qoriq-pin-control-1.0";
294 reg = <0xe0e00 0x200>;
295 #sleep-cells = <2>;
296 };
297
298 clockgen: global-utilities@e1000 {
299 compatible = "fsl,p3041-clockgen", "fsl,qoriq-clockgen-1.0";
300 reg = <0xe1000 0x1000>;
301 clock-frequency = <0>;
302 };
303
304 rcpm: global-utilities@e2000 {
305 compatible = "fsl,qoriq-rcpm-1.0";
306 reg = <0xe2000 0x1000>;
307 #sleep-cells = <1>;
308 };
309
310 sfp: sfp@e8000 {
311 compatible = "fsl,p3041-sfp", "fsl,qoriq-sfp-1.0";
312 reg = <0xe8000 0x1000>;
313 };
314
315 serdes: serdes@ea000 {
316 compatible = "fsl,p3041-serdes";
317 reg = <0xea000 0x1000>;
318 };
319
320/include/ "qoriq-dma-0.dtsi"
321/include/ "qoriq-dma-1.dtsi"
322/include/ "qoriq-espi-0.dtsi"
323 spi@110000 {
324 fsl,espi-num-chipselects = <4>;
325 };
326
327/include/ "qoriq-esdhc-0.dtsi"
328 sdhc@114000 {
329 sdhci,auto-cmd12;
330 };
331
332/include/ "qoriq-i2c-0.dtsi"
333/include/ "qoriq-i2c-1.dtsi"
334/include/ "qoriq-duart-0.dtsi"
335/include/ "qoriq-duart-1.dtsi"
336/include/ "qoriq-gpio-0.dtsi"
337/include/ "qoriq-usb2-mph-0.dtsi"
338 usb0: usb@210000 {
339 phy_type = "utmi";
340 port0;
341 };
342
343/include/ "qoriq-usb2-dr-0.dtsi"
344 usb1: usb@211000 {
345 dr_mode = "host";
346 phy_type = "utmi";
347 };
348
349/include/ "qoriq-sata2-0.dtsi"
350/include/ "qoriq-sata2-1.dtsi"
351/include/ "qoriq-sec4.2-0.dtsi"
352};
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
new file mode 100644
index 000000000000..136def3536b6
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
@@ -0,0 +1,112 @@
1/*
2 * P3041 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P3041";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 ccsr = &soc;
44 dcsr = &dcsr;
45
46 serial0 = &serial0;
47 serial1 = &serial1;
48 serial2 = &serial2;
49 serial3 = &serial3;
50 pci0 = &pci0;
51 pci1 = &pci1;
52 pci2 = &pci2;
53 pci3 = &pci3;
54 usb0 = &usb0;
55 usb1 = &usb1;
56 dma0 = &dma0;
57 dma1 = &dma1;
58 sdhc = &sdhc;
59 msi0 = &msi0;
60 msi1 = &msi1;
61 msi2 = &msi2;
62
63 crypto = &crypto;
64 sec_jr0 = &sec_jr0;
65 sec_jr1 = &sec_jr1;
66 sec_jr2 = &sec_jr2;
67 sec_jr3 = &sec_jr3;
68 rtic_a = &rtic_a;
69 rtic_b = &rtic_b;
70 rtic_c = &rtic_c;
71 rtic_d = &rtic_d;
72 sec_mon = &sec_mon;
73 };
74
75 cpus {
76 #address-cells = <1>;
77 #size-cells = <0>;
78
79 cpu0: PowerPC,e500mc@0 {
80 device_type = "cpu";
81 reg = <0>;
82 next-level-cache = <&L2_0>;
83 L2_0: l2-cache {
84 next-level-cache = <&cpc>;
85 };
86 };
87 cpu1: PowerPC,e500mc@1 {
88 device_type = "cpu";
89 reg = <1>;
90 next-level-cache = <&L2_1>;
91 L2_1: l2-cache {
92 next-level-cache = <&cpc>;
93 };
94 };
95 cpu2: PowerPC,e500mc@2 {
96 device_type = "cpu";
97 reg = <2>;
98 next-level-cache = <&L2_2>;
99 L2_2: l2-cache {
100 next-level-cache = <&cpc>;
101 };
102 };
103 cpu3: PowerPC,e500mc@3 {
104 device_type = "cpu";
105 reg = <3>;
106 next-level-cache = <&L2_3>;
107 L2_3: l2-cache {
108 next-level-cache = <&cpc>;
109 };
110 };
111 };
112};
diff --git a/arch/powerpc/boot/dts/fsl/p3060si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3060si-post.dtsi
new file mode 100644
index 000000000000..a63edd195ae5
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p3060si-post.dtsi
@@ -0,0 +1,296 @@
1/*
2 * P3060 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 compatible = "fsl,p3060-elbc", "fsl,elbc", "simple-bus";
37 interrupts = <25 2 0 0>;
38 #address-cells = <2>;
39 #size-cells = <1>;
40};
41
42/* controller at 0x200000 */
43&pci0 {
44 compatible = "fsl,p3060-pcie", "fsl,qoriq-pcie-v2.2";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0x0 0xff>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 1 15>;
51 pcie@0 {
52 reg = <0 0 0 0 0>;
53 #interrupt-cells = <1>;
54 #size-cells = <2>;
55 #address-cells = <3>;
56 device_type = "pci";
57 interrupts = <16 2 1 15>;
58 interrupt-map-mask = <0xf800 0 0 7>;
59 interrupt-map = <
60 /* IDSEL 0x0 */
61 0000 0 0 1 &mpic 40 1 0 0
62 0000 0 0 2 &mpic 1 1 0 0
63 0000 0 0 3 &mpic 2 1 0 0
64 0000 0 0 4 &mpic 3 1 0 0
65 >;
66 };
67};
68
69/* controller at 0x201000 */
70&pci1 {
71 compatible = "fsl,p3060-pcie", "fsl,qoriq-pcie-v2.2";
72 device_type = "pci";
73 #size-cells = <2>;
74 #address-cells = <3>;
75 bus-range = <0 0xff>;
76 clock-frequency = <33333333>;
77 interrupts = <16 2 1 14>;
78 pcie@0 {
79 reg = <0 0 0 0 0>;
80 #interrupt-cells = <1>;
81 #size-cells = <2>;
82 #address-cells = <3>;
83 device_type = "pci";
84 interrupts = <16 2 1 14>;
85 interrupt-map-mask = <0xf800 0 0 7>;
86 interrupt-map = <
87 /* IDSEL 0x0 */
88 0000 0 0 1 &mpic 41 1 0 0
89 0000 0 0 2 &mpic 5 1 0 0
90 0000 0 0 3 &mpic 6 1 0 0
91 0000 0 0 4 &mpic 7 1 0 0
92 >;
93 };
94};
95
96&rio {
97 compatible = "fsl,srio";
98 interrupts = <16 2 1 11>;
99 #address-cells = <2>;
100 #size-cells = <2>;
101 fsl,srio-rmu-handle = <&rmu>;
102 ranges;
103
104 port1 {
105 #address-cells = <2>;
106 #size-cells = <2>;
107 cell-index = <1>;
108 };
109
110 port2 {
111 #address-cells = <2>;
112 #size-cells = <2>;
113 cell-index = <2>;
114 };
115};
116
117&dcsr {
118 #address-cells = <1>;
119 #size-cells = <1>;
120 compatible = "fsl,dcsr", "simple-bus";
121
122 dcsr-epu@0 {
123 compatible = "fsl,dcsr-epu";
124 interrupts = <52 2 0 0
125 84 2 0 0
126 85 2 0 0>;
127 reg = <0x0 0x1000>;
128 };
129 dcsr-npc {
130 compatible = "fsl,dcsr-npc";
131 reg = <0x1000 0x1000 0x1000000 0x8000>;
132 };
133 dcsr-nxc@2000 {
134 compatible = "fsl,dcsr-nxc";
135 reg = <0x2000 0x1000>;
136 };
137 dcsr-corenet {
138 compatible = "fsl,dcsr-corenet";
139 reg = <0x8000 0x1000 0xB0000 0x1000>;
140 };
141 dcsr-dpaa@9000 {
142 compatible = "fsl,p3060-dcsr-dpaa", "fsl,dcsr-dpaa";
143 reg = <0x9000 0x1000>;
144 };
145 dcsr-ocn@11000 {
146 compatible = "fsl,p3060-dcsr-ocn", "fsl,dcsr-ocn";
147 reg = <0x11000 0x1000>;
148 };
149 dcsr-ddr@12000 {
150 compatible = "fsl,dcsr-ddr";
151 dev-handle = <&ddr1>;
152 reg = <0x12000 0x1000>;
153 };
154 dcsr-nal@18000 {
155 compatible = "fsl,p3060-dcsr-nal", "fsl,dcsr-nal";
156 reg = <0x18000 0x1000>;
157 };
158 dcsr-rcpm@22000 {
159 compatible = "fsl,p3060-dcsr-rcpm", "fsl,dcsr-rcpm";
160 reg = <0x22000 0x1000>;
161 };
162 dcsr-cpu-sb-proxy@40000 {
163 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
164 cpu-handle = <&cpu0>;
165 reg = <0x40000 0x1000>;
166 };
167 dcsr-cpu-sb-proxy@41000 {
168 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
169 cpu-handle = <&cpu1>;
170 reg = <0x41000 0x1000>;
171 };
172 dcsr-cpu-sb-proxy@44000 {
173 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
174 cpu-handle = <&cpu4>;
175 reg = <0x44000 0x1000>;
176 };
177 dcsr-cpu-sb-proxy@45000 {
178 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
179 cpu-handle = <&cpu5>;
180 reg = <0x45000 0x1000>;
181 };
182 dcsr-cpu-sb-proxy@46000 {
183 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
184 cpu-handle = <&cpu6>;
185 reg = <0x46000 0x1000>;
186 };
187 dcsr-cpu-sb-proxy@47000 {
188 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
189 cpu-handle = <&cpu7>;
190 reg = <0x47000 0x1000>;
191 };
192
193};
194
195&soc {
196 #address-cells = <1>;
197 #size-cells = <1>;
198 device_type = "soc";
199 compatible = "simple-bus";
200
201 soc-sram-error {
202 compatible = "fsl,soc-sram-error";
203 interrupts = <16 2 1 29>;
204 };
205
206 corenet-law@0 {
207 compatible = "fsl,corenet-law";
208 reg = <0x0 0x1000>;
209 fsl,num-laws = <32>;
210 };
211
212 ddr1: memory-controller@8000 {
213 compatible = "fsl,qoriq-memory-controller-v4.4", "fsl,qoriq-memory-controller";
214 reg = <0x8000 0x1000>;
215 interrupts = <16 2 1 23>;
216 };
217
218 cpc: l3-cache-controller@10000 {
219 compatible = "fsl,p3060-l3-cache-controller", "cache";
220 reg = <0x10000 0x1000
221 0x11000 0x1000>;
222 interrupts = <16 2 1 27
223 16 2 1 26>;
224 };
225
226 corenet-cf@18000 {
227 compatible = "fsl,corenet-cf";
228 reg = <0x18000 0x1000>;
229 interrupts = <16 2 1 31>;
230 fsl,ccf-num-csdids = <32>;
231 fsl,ccf-num-snoopids = <32>;
232 };
233
234 iommu@20000 {
235 compatible = "fsl,pamu-v1.0", "fsl,pamu";
236 reg = <0x20000 0x5000>;
237 interrupts = <
238 24 2 0 0
239 16 2 1 30>;
240 };
241
242/include/ "qoriq-rmu-0.dtsi"
243/include/ "qoriq-mpic.dtsi"
244
245 guts: global-utilities@e0000 {
246 compatible = "fsl,qoriq-device-config-1.0";
247 reg = <0xe0000 0xe00>;
248 fsl,has-rstcr;
249 #sleep-cells = <1>;
250 fsl,liodn-bits = <12>;
251 };
252
253 pins: global-utilities@e0e00 {
254 compatible = "fsl,qoriq-pin-control-1.0";
255 reg = <0xe0e00 0x200>;
256 #sleep-cells = <2>;
257 };
258
259 clockgen: global-utilities@e1000 {
260 compatible = "fsl,p3060-clockgen", "fsl,qoriq-clockgen-1.0";
261 reg = <0xe1000 0x1000>;
262 clock-frequency = <0>;
263 };
264
265 rcpm: global-utilities@e2000 {
266 compatible = "fsl,qoriq-rcpm-1.0";
267 reg = <0xe2000 0x1000>;
268 #sleep-cells = <1>;
269 };
270
271 sfp: sfp@e8000 {
272 compatible = "fsl,p3060-sfp", "fsl,qoriq-sfp-1.0";
273 reg = <0xe8000 0x1000>;
274 };
275
276 serdes: serdes@ea000 {
277 compatible = "fsl,p3060-serdes";
278 reg = <0xea000 0x1000>;
279 };
280
281/include/ "qoriq-dma-0.dtsi"
282/include/ "qoriq-dma-1.dtsi"
283/include/ "qoriq-espi-0.dtsi"
284 spi@110000 {
285 fsl,espi-num-chipselects = <4>;
286 };
287
288/include/ "qoriq-i2c-0.dtsi"
289/include/ "qoriq-i2c-1.dtsi"
290/include/ "qoriq-duart-0.dtsi"
291/include/ "qoriq-duart-1.dtsi"
292/include/ "qoriq-gpio-0.dtsi"
293/include/ "qoriq-usb2-mph-0.dtsi"
294/include/ "qoriq-usb2-dr-0.dtsi"
295/include/ "qoriq-sec4.1-0.dtsi"
296};
diff --git a/arch/powerpc/boot/dts/fsl/p3060si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p3060si-pre.dtsi
new file mode 100644
index 000000000000..00c8e70e7b90
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p3060si-pre.dtsi
@@ -0,0 +1,125 @@
1/*
2 * P3060 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P3060";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 ccsr = &soc;
44 dcsr = &dcsr;
45
46 serial0 = &serial0;
47 serial1 = &serial1;
48 serial2 = &serial2;
49 serial3 = &serial3;
50 pci0 = &pci0;
51 pci1 = &pci1;
52 usb0 = &usb0;
53 usb1 = &usb1;
54 dma0 = &dma0;
55 dma1 = &dma1;
56 msi0 = &msi0;
57 msi1 = &msi1;
58 msi2 = &msi2;
59
60 crypto = &crypto;
61 sec_jr0 = &sec_jr0;
62 sec_jr1 = &sec_jr1;
63 sec_jr2 = &sec_jr2;
64 sec_jr3 = &sec_jr3;
65 rtic_a = &rtic_a;
66 rtic_b = &rtic_b;
67 rtic_c = &rtic_c;
68 rtic_d = &rtic_d;
69 sec_mon = &sec_mon;
70 };
71
72 cpus {
73 #address-cells = <1>;
74 #size-cells = <0>;
75
76 cpu0: PowerPC,e500mc@0 {
77 device_type = "cpu";
78 reg = <0>;
79 next-level-cache = <&L2_0>;
80 L2_0: l2-cache {
81 next-level-cache = <&cpc>;
82 };
83 };
84 cpu1: PowerPC,e500mc@1 {
85 device_type = "cpu";
86 reg = <1>;
87 next-level-cache = <&L2_1>;
88 L2_1: l2-cache {
89 next-level-cache = <&cpc>;
90 };
91 };
92 cpu4: PowerPC,e500mc@4 {
93 device_type = "cpu";
94 reg = <4>;
95 next-level-cache = <&L2_4>;
96 L2_4: l2-cache {
97 next-level-cache = <&cpc>;
98 };
99 };
100 cpu5: PowerPC,e500mc@5 {
101 device_type = "cpu";
102 reg = <5>;
103 next-level-cache = <&L2_5>;
104 L2_5: l2-cache {
105 next-level-cache = <&cpc>;
106 };
107 };
108 cpu6: PowerPC,e500mc@6 {
109 device_type = "cpu";
110 reg = <6>;
111 next-level-cache = <&L2_6>;
112 L2_6: l2-cache {
113 next-level-cache = <&cpc>;
114 };
115 };
116 cpu7: PowerPC,e500mc@7 {
117 device_type = "cpu";
118 reg = <7>;
119 next-level-cache = <&L2_7>;
120 L2_7: l2-cache {
121 next-level-cache = <&cpc>;
122 };
123 };
124 };
125};
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
new file mode 100644
index 000000000000..8d35d2c1f694
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -0,0 +1,350 @@
1/*
2 * P4080/P4040 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 compatible = "fsl,p4080-elbc", "fsl,elbc", "simple-bus";
37 interrupts = <25 2 0 0>;
38 #address-cells = <2>;
39 #size-cells = <1>;
40};
41
42/* controller at 0x200000 */
43&pci0 {
44 compatible = "fsl,p4080-pcie";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0x0 0xff>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 1 15>;
51 pcie@0 {
52 reg = <0 0 0 0 0>;
53 #interrupt-cells = <1>;
54 #size-cells = <2>;
55 #address-cells = <3>;
56 device_type = "pci";
57 interrupts = <16 2 1 15>;
58 interrupt-map-mask = <0xf800 0 0 7>;
59 interrupt-map = <
60 /* IDSEL 0x0 */
61 0000 0 0 1 &mpic 40 1 0 0
62 0000 0 0 2 &mpic 1 1 0 0
63 0000 0 0 3 &mpic 2 1 0 0
64 0000 0 0 4 &mpic 3 1 0 0
65 >;
66 };
67};
68
69/* controller at 0x201000 */
70&pci1 {
71 compatible = "fsl,p4080-pcie";
72 device_type = "pci";
73 #size-cells = <2>;
74 #address-cells = <3>;
75 bus-range = <0 0xff>;
76 clock-frequency = <33333333>;
77 interrupts = <16 2 1 14>;
78 pcie@0 {
79 reg = <0 0 0 0 0>;
80 #interrupt-cells = <1>;
81 #size-cells = <2>;
82 #address-cells = <3>;
83 device_type = "pci";
84 interrupts = <16 2 1 14>;
85 interrupt-map-mask = <0xf800 0 0 7>;
86 interrupt-map = <
87 /* IDSEL 0x0 */
88 0000 0 0 1 &mpic 41 1 0 0
89 0000 0 0 2 &mpic 5 1 0 0
90 0000 0 0 3 &mpic 6 1 0 0
91 0000 0 0 4 &mpic 7 1 0 0
92 >;
93 };
94};
95
96/* controller at 0x202000 */
97&pci2 {
98 compatible = "fsl,p4080-pcie";
99 device_type = "pci";
100 #size-cells = <2>;
101 #address-cells = <3>;
102 bus-range = <0x0 0xff>;
103 clock-frequency = <33333333>;
104 interrupts = <16 2 1 13>;
105 pcie@0 {
106 reg = <0 0 0 0 0>;
107 #interrupt-cells = <1>;
108 #size-cells = <2>;
109 #address-cells = <3>;
110 device_type = "pci";
111 interrupts = <16 2 1 13>;
112 interrupt-map-mask = <0xf800 0 0 7>;
113 interrupt-map = <
114 /* IDSEL 0x0 */
115 0000 0 0 1 &mpic 42 1 0 0
116 0000 0 0 2 &mpic 9 1 0 0
117 0000 0 0 3 &mpic 10 1 0 0
118 0000 0 0 4 &mpic 11 1 0 0
119 >;
120 };
121};
122
123&rio {
124 compatible = "fsl,srio";
125 interrupts = <16 2 1 11>;
126 #address-cells = <2>;
127 #size-cells = <2>;
128 fsl,srio-rmu-handle = <&rmu>;
129 ranges;
130
131 port1 {
132 #address-cells = <2>;
133 #size-cells = <2>;
134 cell-index = <1>;
135 };
136
137 port2 {
138 #address-cells = <2>;
139 #size-cells = <2>;
140 cell-index = <2>;
141 };
142};
143
144&dcsr {
145 #address-cells = <1>;
146 #size-cells = <1>;
147 compatible = "fsl,dcsr", "simple-bus";
148
149 dcsr-epu@0 {
150 compatible = "fsl,dcsr-epu";
151 interrupts = <52 2 0 0
152 84 2 0 0
153 85 2 0 0>;
154 reg = <0x0 0x1000>;
155 };
156 dcsr-npc {
157 compatible = "fsl,dcsr-npc";
158 reg = <0x1000 0x1000 0x1000000 0x8000>;
159 };
160 dcsr-nxc@2000 {
161 compatible = "fsl,dcsr-nxc";
162 reg = <0x2000 0x1000>;
163 };
164 dcsr-corenet {
165 compatible = "fsl,dcsr-corenet";
166 reg = <0x8000 0x1000 0xB0000 0x1000>;
167 };
168 dcsr-dpaa@9000 {
169 compatible = "fsl,p4080-dcsr-dpaa", "fsl,dcsr-dpaa";
170 reg = <0x9000 0x1000>;
171 };
172 dcsr-ocn@11000 {
173 compatible = "fsl,p4080-dcsr-ocn", "fsl,dcsr-ocn";
174 reg = <0x11000 0x1000>;
175 };
176 dcsr-ddr@12000 {
177 compatible = "fsl,dcsr-ddr";
178 dev-handle = <&ddr1>;
179 reg = <0x12000 0x1000>;
180 };
181 dcsr-ddr@13000 {
182 compatible = "fsl,dcsr-ddr";
183 dev-handle = <&ddr2>;
184 reg = <0x13000 0x1000>;
185 };
186 dcsr-nal@18000 {
187 compatible = "fsl,p4080-dcsr-nal", "fsl,dcsr-nal";
188 reg = <0x18000 0x1000>;
189 };
190 dcsr-rcpm@22000 {
191 compatible = "fsl,p4080-dcsr-rcpm", "fsl,dcsr-rcpm";
192 reg = <0x22000 0x1000>;
193 };
194 dcsr-cpu-sb-proxy@40000 {
195 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
196 cpu-handle = <&cpu0>;
197 reg = <0x40000 0x1000>;
198 };
199 dcsr-cpu-sb-proxy@41000 {
200 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
201 cpu-handle = <&cpu1>;
202 reg = <0x41000 0x1000>;
203 };
204 dcsr-cpu-sb-proxy@42000 {
205 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
206 cpu-handle = <&cpu2>;
207 reg = <0x42000 0x1000>;
208 };
209 dcsr-cpu-sb-proxy@43000 {
210 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
211 cpu-handle = <&cpu3>;
212 reg = <0x43000 0x1000>;
213 };
214 dcsr-cpu-sb-proxy@44000 {
215 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
216 cpu-handle = <&cpu4>;
217 reg = <0x44000 0x1000>;
218 };
219 dcsr-cpu-sb-proxy@45000 {
220 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
221 cpu-handle = <&cpu5>;
222 reg = <0x45000 0x1000>;
223 };
224 dcsr-cpu-sb-proxy@46000 {
225 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
226 cpu-handle = <&cpu6>;
227 reg = <0x46000 0x1000>;
228 };
229 dcsr-cpu-sb-proxy@47000 {
230 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
231 cpu-handle = <&cpu7>;
232 reg = <0x47000 0x1000>;
233 };
234
235};
236
237&soc {
238 #address-cells = <1>;
239 #size-cells = <1>;
240 device_type = "soc";
241 compatible = "simple-bus";
242
243 soc-sram-error {
244 compatible = "fsl,soc-sram-error";
245 interrupts = <16 2 1 29>;
246 };
247
248 corenet-law@0 {
249 compatible = "fsl,corenet-law";
250 reg = <0x0 0x1000>;
251 fsl,num-laws = <32>;
252 };
253
254 ddr1: memory-controller@8000 {
255 compatible = "fsl,qoriq-memory-controller-v4.4", "fsl,qoriq-memory-controller";
256 reg = <0x8000 0x1000>;
257 interrupts = <16 2 1 23>;
258 };
259
260 ddr2: memory-controller@9000 {
261 compatible = "fsl,qoriq-memory-controller-v4.4","fsl,qoriq-memory-controller";
262 reg = <0x9000 0x1000>;
263 interrupts = <16 2 1 22>;
264 };
265
266 cpc: l3-cache-controller@10000 {
267 compatible = "fsl,p4080-l3-cache-controller", "cache";
268 reg = <0x10000 0x1000
269 0x11000 0x1000>;
270 interrupts = <16 2 1 27
271 16 2 1 26>;
272 };
273
274 corenet-cf@18000 {
275 compatible = "fsl,corenet-cf";
276 reg = <0x18000 0x1000>;
277 interrupts = <16 2 1 31>;
278 fsl,ccf-num-csdids = <32>;
279 fsl,ccf-num-snoopids = <32>;
280 };
281
282 iommu@20000 {
283 compatible = "fsl,pamu-v1.0", "fsl,pamu";
284 reg = <0x20000 0x5000>;
285 interrupts = <
286 24 2 0 0
287 16 2 1 30>;
288 };
289
290/include/ "qoriq-rmu-0.dtsi"
291/include/ "qoriq-mpic.dtsi"
292
293 guts: global-utilities@e0000 {
294 compatible = "fsl,qoriq-device-config-1.0";
295 reg = <0xe0000 0xe00>;
296 fsl,has-rstcr;
297 #sleep-cells = <1>;
298 fsl,liodn-bits = <12>;
299 };
300
301 pins: global-utilities@e0e00 {
302 compatible = "fsl,qoriq-pin-control-1.0";
303 reg = <0xe0e00 0x200>;
304 #sleep-cells = <2>;
305 };
306
307 clockgen: global-utilities@e1000 {
308 compatible = "fsl,p4080-clockgen", "fsl,qoriq-clockgen-1.0";
309 reg = <0xe1000 0x1000>;
310 clock-frequency = <0>;
311 };
312
313 rcpm: global-utilities@e2000 {
314 compatible = "fsl,qoriq-rcpm-1.0";
315 reg = <0xe2000 0x1000>;
316 #sleep-cells = <1>;
317 };
318
319 sfp: sfp@e8000 {
320 compatible = "fsl,p4080-sfp", "fsl,qoriq-sfp-1.0";
321 reg = <0xe8000 0x1000>;
322 };
323
324 serdes: serdes@ea000 {
325 compatible = "fsl,p4080-serdes";
326 reg = <0xea000 0x1000>;
327 };
328
329/include/ "qoriq-dma-0.dtsi"
330/include/ "qoriq-dma-1.dtsi"
331/include/ "qoriq-espi-0.dtsi"
332 spi@110000 {
333 fsl,espi-num-chipselects = <4>;
334 };
335
336/include/ "qoriq-esdhc-0.dtsi"
337 sdhc@114000 {
338 voltage-ranges = <3300 3300>;
339 sdhci,auto-cmd12;
340 };
341
342/include/ "qoriq-i2c-0.dtsi"
343/include/ "qoriq-i2c-1.dtsi"
344/include/ "qoriq-duart-0.dtsi"
345/include/ "qoriq-duart-1.dtsi"
346/include/ "qoriq-gpio-0.dtsi"
347/include/ "qoriq-usb2-mph-0.dtsi"
348/include/ "qoriq-usb2-dr-0.dtsi"
349/include/ "qoriq-sec4.0-0.dtsi"
350};
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
new file mode 100644
index 000000000000..b9556ee3a639
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
@@ -0,0 +1,143 @@
1/*
2 * P4080/P4040 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P4080";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 ccsr = &soc;
44 dcsr = &dcsr;
45
46 serial0 = &serial0;
47 serial1 = &serial1;
48 serial2 = &serial2;
49 serial3 = &serial3;
50 pci0 = &pci0;
51 pci1 = &pci1;
52 pci2 = &pci2;
53 usb0 = &usb0;
54 usb1 = &usb1;
55 dma0 = &dma0;
56 dma1 = &dma1;
57 sdhc = &sdhc;
58 msi0 = &msi0;
59 msi1 = &msi1;
60 msi2 = &msi2;
61
62 crypto = &crypto;
63 sec_jr0 = &sec_jr0;
64 sec_jr1 = &sec_jr1;
65 sec_jr2 = &sec_jr2;
66 sec_jr3 = &sec_jr3;
67 rtic_a = &rtic_a;
68 rtic_b = &rtic_b;
69 rtic_c = &rtic_c;
70 rtic_d = &rtic_d;
71 sec_mon = &sec_mon;
72 };
73
74 cpus {
75 #address-cells = <1>;
76 #size-cells = <0>;
77
78 cpu0: PowerPC,e500mc@0 {
79 device_type = "cpu";
80 reg = <0>;
81 next-level-cache = <&L2_0>;
82 L2_0: l2-cache {
83 next-level-cache = <&cpc>;
84 };
85 };
86 cpu1: PowerPC,e500mc@1 {
87 device_type = "cpu";
88 reg = <1>;
89 next-level-cache = <&L2_1>;
90 L2_1: l2-cache {
91 next-level-cache = <&cpc>;
92 };
93 };
94 cpu2: PowerPC,e500mc@2 {
95 device_type = "cpu";
96 reg = <2>;
97 next-level-cache = <&L2_2>;
98 L2_2: l2-cache {
99 next-level-cache = <&cpc>;
100 };
101 };
102 cpu3: PowerPC,e500mc@3 {
103 device_type = "cpu";
104 reg = <3>;
105 next-level-cache = <&L2_3>;
106 L2_3: l2-cache {
107 next-level-cache = <&cpc>;
108 };
109 };
110 cpu4: PowerPC,e500mc@4 {
111 device_type = "cpu";
112 reg = <4>;
113 next-level-cache = <&L2_4>;
114 L2_4: l2-cache {
115 next-level-cache = <&cpc>;
116 };
117 };
118 cpu5: PowerPC,e500mc@5 {
119 device_type = "cpu";
120 reg = <5>;
121 next-level-cache = <&L2_5>;
122 L2_5: l2-cache {
123 next-level-cache = <&cpc>;
124 };
125 };
126 cpu6: PowerPC,e500mc@6 {
127 device_type = "cpu";
128 reg = <6>;
129 next-level-cache = <&L2_6>;
130 L2_6: l2-cache {
131 next-level-cache = <&cpc>;
132 };
133 };
134 cpu7: PowerPC,e500mc@7 {
135 device_type = "cpu";
136 reg = <7>;
137 next-level-cache = <&L2_7>;
138 L2_7: l2-cache {
139 next-level-cache = <&cpc>;
140 };
141 };
142 };
143};
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
new file mode 100644
index 000000000000..914074b91a85
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
@@ -0,0 +1,355 @@
1/*
2 * P5020/5010 Silicon/SoC Device Tree Source (post include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&lbc {
36 compatible = "fsl,p5020-elbc", "fsl,elbc", "simple-bus";
37 interrupts = <25 2 0 0>;
38 #address-cells = <2>;
39 #size-cells = <1>;
40};
41
42/* controller at 0x200000 */
43&pci0 {
44 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
45 device_type = "pci";
46 #size-cells = <2>;
47 #address-cells = <3>;
48 bus-range = <0x0 0xff>;
49 clock-frequency = <33333333>;
50 interrupts = <16 2 1 15>;
51 pcie@0 {
52 reg = <0 0 0 0 0>;
53 #interrupt-cells = <1>;
54 #size-cells = <2>;
55 #address-cells = <3>;
56 device_type = "pci";
57 interrupts = <16 2 1 15>;
58 interrupt-map-mask = <0xf800 0 0 7>;
59 interrupt-map = <
60 /* IDSEL 0x0 */
61 0000 0 0 1 &mpic 40 1 0 0
62 0000 0 0 2 &mpic 1 1 0 0
63 0000 0 0 3 &mpic 2 1 0 0
64 0000 0 0 4 &mpic 3 1 0 0
65 >;
66 };
67};
68
69/* controller at 0x201000 */
70&pci1 {
71 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
72 device_type = "pci";
73 #size-cells = <2>;
74 #address-cells = <3>;
75 bus-range = <0 0xff>;
76 clock-frequency = <33333333>;
77 interrupts = <16 2 1 14>;
78 pcie@0 {
79 reg = <0 0 0 0 0>;
80 #interrupt-cells = <1>;
81 #size-cells = <2>;
82 #address-cells = <3>;
83 device_type = "pci";
84 interrupts = <16 2 1 14>;
85 interrupt-map-mask = <0xf800 0 0 7>;
86 interrupt-map = <
87 /* IDSEL 0x0 */
88 0000 0 0 1 &mpic 41 1 0 0
89 0000 0 0 2 &mpic 5 1 0 0
90 0000 0 0 3 &mpic 6 1 0 0
91 0000 0 0 4 &mpic 7 1 0 0
92 >;
93 };
94};
95
96/* controller at 0x202000 */
97&pci2 {
98 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
99 device_type = "pci";
100 #size-cells = <2>;
101 #address-cells = <3>;
102 bus-range = <0x0 0xff>;
103 clock-frequency = <33333333>;
104 interrupts = <16 2 1 13>;
105 pcie@0 {
106 reg = <0 0 0 0 0>;
107 #interrupt-cells = <1>;
108 #size-cells = <2>;
109 #address-cells = <3>;
110 device_type = "pci";
111 interrupts = <16 2 1 13>;
112 interrupt-map-mask = <0xf800 0 0 7>;
113 interrupt-map = <
114 /* IDSEL 0x0 */
115 0000 0 0 1 &mpic 42 1 0 0
116 0000 0 0 2 &mpic 9 1 0 0
117 0000 0 0 3 &mpic 10 1 0 0
118 0000 0 0 4 &mpic 11 1 0 0
119 >;
120 };
121};
122
123/* controller at 0x203000 */
124&pci3 {
125 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
126 device_type = "pci";
127 #size-cells = <2>;
128 #address-cells = <3>;
129 bus-range = <0x0 0xff>;
130 clock-frequency = <33333333>;
131 interrupts = <16 2 1 12>;
132 pcie@0 {
133 reg = <0 0 0 0 0>;
134 #interrupt-cells = <1>;
135 #size-cells = <2>;
136 #address-cells = <3>;
137 device_type = "pci";
138 interrupts = <16 2 1 12>;
139 interrupt-map-mask = <0xf800 0 0 7>;
140 interrupt-map = <
141 /* IDSEL 0x0 */
142 0000 0 0 1 &mpic 43 1 0 0
143 0000 0 0 2 &mpic 0 1 0 0
144 0000 0 0 3 &mpic 4 1 0 0
145 0000 0 0 4 &mpic 8 1 0 0
146 >;
147 };
148};
149
150&rio {
151 compatible = "fsl,srio";
152 interrupts = <16 2 1 11>;
153 #address-cells = <2>;
154 #size-cells = <2>;
155 ranges;
156
157 port1 {
158 #address-cells = <2>;
159 #size-cells = <2>;
160 cell-index = <1>;
161 };
162
163 port2 {
164 #address-cells = <2>;
165 #size-cells = <2>;
166 cell-index = <2>;
167 };
168};
169
170&dcsr {
171 #address-cells = <1>;
172 #size-cells = <1>;
173 compatible = "fsl,dcsr", "simple-bus";
174
175 dcsr-epu@0 {
176 compatible = "fsl,dcsr-epu";
177 interrupts = <52 2 0 0
178 84 2 0 0
179 85 2 0 0>;
180 reg = <0x0 0x1000>;
181 };
182 dcsr-npc {
183 compatible = "fsl,dcsr-npc";
184 reg = <0x1000 0x1000 0x1000000 0x8000>;
185 };
186 dcsr-nxc@2000 {
187 compatible = "fsl,dcsr-nxc";
188 reg = <0x2000 0x1000>;
189 };
190 dcsr-corenet {
191 compatible = "fsl,dcsr-corenet";
192 reg = <0x8000 0x1000 0xB0000 0x1000>;
193 };
194 dcsr-dpaa@9000 {
195 compatible = "fsl,p5020-dcsr-dpaa", "fsl,dcsr-dpaa";
196 reg = <0x9000 0x1000>;
197 };
198 dcsr-ocn@11000 {
199 compatible = "fsl,p5020-dcsr-ocn", "fsl,dcsr-ocn";
200 reg = <0x11000 0x1000>;
201 };
202 dcsr-ddr@12000 {
203 compatible = "fsl,dcsr-ddr";
204 dev-handle = <&ddr1>;
205 reg = <0x12000 0x1000>;
206 };
207 dcsr-ddr@13000 {
208 compatible = "fsl,dcsr-ddr";
209 dev-handle = <&ddr2>;
210 reg = <0x13000 0x1000>;
211 };
212 dcsr-nal@18000 {
213 compatible = "fsl,p5020-dcsr-nal", "fsl,dcsr-nal";
214 reg = <0x18000 0x1000>;
215 };
216 dcsr-rcpm@22000 {
217 compatible = "fsl,p5020-dcsr-rcpm", "fsl,dcsr-rcpm";
218 reg = <0x22000 0x1000>;
219 };
220 dcsr-cpu-sb-proxy@40000 {
221 compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
222 cpu-handle = <&cpu0>;
223 reg = <0x40000 0x1000>;
224 };
225 dcsr-cpu-sb-proxy@41000 {
226 compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
227 cpu-handle = <&cpu1>;
228 reg = <0x41000 0x1000>;
229 };
230};
231
232&soc {
233 #address-cells = <1>;
234 #size-cells = <1>;
235 device_type = "soc";
236 compatible = "simple-bus";
237
238 soc-sram-error {
239 compatible = "fsl,soc-sram-error";
240 interrupts = <16 2 1 29>;
241 };
242
243 corenet-law@0 {
244 compatible = "fsl,corenet-law";
245 reg = <0x0 0x1000>;
246 fsl,num-laws = <32>;
247 };
248
249 ddr1: memory-controller@8000 {
250 compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
251 reg = <0x8000 0x1000>;
252 interrupts = <16 2 1 23>;
253 };
254
255 ddr2: memory-controller@9000 {
256 compatible = "fsl,qoriq-memory-controller-v4.5","fsl,qoriq-memory-controller";
257 reg = <0x9000 0x1000>;
258 interrupts = <16 2 1 22>;
259 };
260
261 cpc: l3-cache-controller@10000 {
262 compatible = "fsl,p5020-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache";
263 reg = <0x10000 0x1000
264 0x11000 0x1000>;
265 interrupts = <16 2 1 27
266 16 2 1 26>;
267 };
268
269 corenet-cf@18000 {
270 compatible = "fsl,corenet-cf";
271 reg = <0x18000 0x1000>;
272 interrupts = <16 2 1 31>;
273 fsl,ccf-num-csdids = <32>;
274 fsl,ccf-num-snoopids = <32>;
275 };
276
277 iommu@20000 {
278 compatible = "fsl,pamu-v1.0", "fsl,pamu";
279 reg = <0x20000 0x4000>;
280 interrupts = <
281 24 2 0 0
282 16 2 1 30>;
283 };
284
285/include/ "qoriq-mpic.dtsi"
286
287 guts: global-utilities@e0000 {
288 compatible = "fsl,qoriq-device-config-1.0";
289 reg = <0xe0000 0xe00>;
290 fsl,has-rstcr;
291 #sleep-cells = <1>;
292 fsl,liodn-bits = <12>;
293 };
294
295 pins: global-utilities@e0e00 {
296 compatible = "fsl,qoriq-pin-control-1.0";
297 reg = <0xe0e00 0x200>;
298 #sleep-cells = <2>;
299 };
300
301 clockgen: global-utilities@e1000 {
302 compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0";
303 reg = <0xe1000 0x1000>;
304 clock-frequency = <0>;
305 };
306
307 rcpm: global-utilities@e2000 {
308 compatible = "fsl,qoriq-rcpm-1.0";
309 reg = <0xe2000 0x1000>;
310 #sleep-cells = <1>;
311 };
312
313 sfp: sfp@e8000 {
314 compatible = "fsl,p5020-sfp", "fsl,qoriq-sfp-1.0";
315 reg = <0xe8000 0x1000>;
316 };
317
318 serdes: serdes@ea000 {
319 compatible = "fsl,p5020-serdes";
320 reg = <0xea000 0x1000>;
321 };
322
323/include/ "qoriq-dma-0.dtsi"
324/include/ "qoriq-dma-1.dtsi"
325/include/ "qoriq-espi-0.dtsi"
326 spi@110000 {
327 fsl,espi-num-chipselects = <4>;
328 };
329
330/include/ "qoriq-esdhc-0.dtsi"
331 sdhc@114000 {
332 sdhci,auto-cmd12;
333 };
334
335/include/ "qoriq-i2c-0.dtsi"
336/include/ "qoriq-i2c-1.dtsi"
337/include/ "qoriq-duart-0.dtsi"
338/include/ "qoriq-duart-1.dtsi"
339/include/ "qoriq-gpio-0.dtsi"
340/include/ "qoriq-usb2-mph-0.dtsi"
341 usb0: usb@210000 {
342 phy_type = "utmi";
343 port0;
344 };
345
346/include/ "qoriq-usb2-dr-0.dtsi"
347 usb1: usb@211000 {
348 dr_mode = "host";
349 phy_type = "utmi";
350 };
351
352/include/ "qoriq-sata2-0.dtsi"
353/include/ "qoriq-sata2-1.dtsi"
354/include/ "qoriq-sec4.2-0.dtsi"
355};
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
new file mode 100644
index 000000000000..ae823a47584e
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
@@ -0,0 +1,96 @@
1/*
2 * P5020/P5010 Silicon/SoC Device Tree Source (pre include)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36/ {
37 compatible = "fsl,P5020";
38 #address-cells = <2>;
39 #size-cells = <2>;
40 interrupt-parent = <&mpic>;
41
42 aliases {
43 ccsr = &soc;
44 dcsr = &dcsr;
45
46 serial0 = &serial0;
47 serial1 = &serial1;
48 serial2 = &serial2;
49 serial3 = &serial3;
50 pci0 = &pci0;
51 pci1 = &pci1;
52 pci2 = &pci2;
53 pci3 = &pci3;
54 usb0 = &usb0;
55 usb1 = &usb1;
56 dma0 = &dma0;
57 dma1 = &dma1;
58 sdhc = &sdhc;
59 msi0 = &msi0;
60 msi1 = &msi1;
61 msi2 = &msi2;
62
63 crypto = &crypto;
64 sec_jr0 = &sec_jr0;
65 sec_jr1 = &sec_jr1;
66 sec_jr2 = &sec_jr2;
67 sec_jr3 = &sec_jr3;
68 rtic_a = &rtic_a;
69 rtic_b = &rtic_b;
70 rtic_c = &rtic_c;
71 rtic_d = &rtic_d;
72 sec_mon = &sec_mon;
73 };
74
75 cpus {
76 #address-cells = <1>;
77 #size-cells = <0>;
78
79 cpu0: PowerPC,e5500@0 {
80 device_type = "cpu";
81 reg = <0>;
82 next-level-cache = <&L2_0>;
83 L2_0: l2-cache {
84 next-level-cache = <&cpc>;
85 };
86 };
87 cpu1: PowerPC,e5500@1 {
88 device_type = "cpu";
89 reg = <1>;
90 next-level-cache = <&L2_1>;
91 L2_1: l2-cache {
92 next-level-cache = <&cpc>;
93 };
94 };
95 };
96};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-dma-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-dma-0.dtsi
new file mode 100644
index 000000000000..b5b37ad30e75
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-dma-0.dtsi
@@ -0,0 +1,66 @@
1/*
2 * PQ3 DMA device tree stub [ controller @ offset 0x21000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35dma@21300 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 compatible = "fsl,eloplus-dma";
39 reg = <0x21300 0x4>;
40 ranges = <0x0 0x21100 0x200>;
41 cell-index = <0>;
42 dma-channel@0 {
43 compatible = "fsl,eloplus-dma-channel";
44 reg = <0x0 0x80>;
45 cell-index = <0>;
46 interrupts = <20 2 0 0>;
47 };
48 dma-channel@80 {
49 compatible = "fsl,eloplus-dma-channel";
50 reg = <0x80 0x80>;
51 cell-index = <1>;
52 interrupts = <21 2 0 0>;
53 };
54 dma-channel@100 {
55 compatible = "fsl,eloplus-dma-channel";
56 reg = <0x100 0x80>;
57 cell-index = <2>;
58 interrupts = <22 2 0 0>;
59 };
60 dma-channel@180 {
61 compatible = "fsl,eloplus-dma-channel";
62 reg = <0x180 0x80>;
63 cell-index = <3>;
64 interrupts = <23 2 0 0>;
65 };
66};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-dma-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-dma-1.dtsi
new file mode 100644
index 000000000000..28cb8a55d807
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-dma-1.dtsi
@@ -0,0 +1,66 @@
1/*
2 * PQ3 DMA device tree stub [ controller @ offset 0xc300 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35dma@c300 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 compatible = "fsl,eloplus-dma";
39 reg = <0xc300 0x4>;
40 ranges = <0x0 0xc100 0x200>;
41 cell-index = <1>;
42 dma-channel@0 {
43 compatible = "fsl,eloplus-dma-channel";
44 reg = <0x0 0x80>;
45 cell-index = <0>;
46 interrupts = <76 2 0 0>;
47 };
48 dma-channel@80 {
49 compatible = "fsl,eloplus-dma-channel";
50 reg = <0x80 0x80>;
51 cell-index = <1>;
52 interrupts = <77 2 0 0>;
53 };
54 dma-channel@100 {
55 compatible = "fsl,eloplus-dma-channel";
56 reg = <0x100 0x80>;
57 cell-index = <2>;
58 interrupts = <78 2 0 0>;
59 };
60 dma-channel@180 {
61 compatible = "fsl,eloplus-dma-channel";
62 reg = <0x180 0x80>;
63 cell-index = <3>;
64 interrupts = <79 2 0 0>;
65 };
66};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-duart-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-duart-0.dtsi
new file mode 100644
index 000000000000..5e268fdb9d1f
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-duart-0.dtsi
@@ -0,0 +1,51 @@
1/*
2 * PQ3 DUART device tree stub [ controller @ offset 0x4000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35serial0: serial@4500 {
36 cell-index = <0>;
37 device_type = "serial";
38 compatible = "fsl,ns16550", "ns16550";
39 reg = <0x4500 0x100>;
40 clock-frequency = <0>;
41 interrupts = <42 2 0 0>;
42};
43
44serial1: serial@4600 {
45 cell-index = <1>;
46 device_type = "serial";
47 compatible = "fsl,ns16550", "ns16550";
48 reg = <0x4600 0x100>;
49 clock-frequency = <0>;
50 interrupts = <42 2 0 0>;
51};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-esdhc-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-esdhc-0.dtsi
new file mode 100644
index 000000000000..5743433e278e
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-esdhc-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * PQ3 eSDHC device tree stub [ controller @ offset 0x2e000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35sdhc@2e000 {
36 compatible = "fsl,esdhc";
37 reg = <0x2e000 0x1000>;
38 interrupts = <72 0x2 0 0>;
39 /* Filled in by U-Boot */
40 clock-frequency = <0>;
41};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-espi-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-espi-0.dtsi
new file mode 100644
index 000000000000..75854b2e0391
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-espi-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * PQ3 eSPI device tree stub [ controller @ offset 0x7000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35spi@7000 {
36 #address-cells = <1>;
37 #size-cells = <0>;
38 compatible = "fsl,mpc8536-espi";
39 reg = <0x7000 0x1000>;
40 interrupts = <59 0x2 0 0>;
41};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec1-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec1-0.dtsi
new file mode 100644
index 000000000000..a1979ae334a7
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec1-0.dtsi
@@ -0,0 +1,53 @@
1/*
2 * PQ3 eTSEC device tree stub [ @ offsets 0x24000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35ethernet@24000 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 cell-index = <0>;
39 device_type = "network";
40 model = "eTSEC";
41 compatible = "gianfar";
42 reg = <0x24000 0x1000>;
43 ranges = <0x0 0x24000 0x1000>;
44 local-mac-address = [ 00 00 00 00 00 00 ];
45 interrupts = <29 2 0 0 30 2 0 0 34 2 0 0>;
46};
47
48mdio@24520 {
49 #address-cells = <1>;
50 #size-cells = <0>;
51 compatible = "fsl,gianfar-mdio";
52 reg = <0x24520 0x20>;
53};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec1-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec1-1.dtsi
new file mode 100644
index 000000000000..4c4fdde1ec2a
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec1-1.dtsi
@@ -0,0 +1,53 @@
1/*
2 * PQ3 eTSEC device tree stub [ @ offsets 0x25000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35ethernet@25000 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 cell-index = <1>;
39 device_type = "network";
40 model = "eTSEC";
41 compatible = "gianfar";
42 reg = <0x25000 0x1000>;
43 ranges = <0x0 0x25000 0x1000>;
44 local-mac-address = [ 00 00 00 00 00 00 ];
45 interrupts = <35 2 0 0 36 2 0 0 40 2 0 0>;
46};
47
48mdio@25520 {
49 #address-cells = <1>;
50 #size-cells = <0>;
51 compatible = "fsl,gianfar-tbi";
52 reg = <0x25520 0x20>;
53};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec1-2.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec1-2.dtsi
new file mode 100644
index 000000000000..4b8ab438668a
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec1-2.dtsi
@@ -0,0 +1,53 @@
1/*
2 * PQ3 eTSEC device tree stub [ @ offsets 0x26000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35ethernet@26000 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 cell-index = <2>;
39 device_type = "network";
40 model = "eTSEC";
41 compatible = "gianfar";
42 reg = <0x26000 0x1000>;
43 ranges = <0x0 0x26000 0x1000>;
44 local-mac-address = [ 00 00 00 00 00 00 ];
45 interrupts = <31 2 0 0 32 2 0 0 33 2 0 0>;
46};
47
48mdio@26520 {
49 #address-cells = <1>;
50 #size-cells = <0>;
51 compatible = "fsl,gianfar-tbi";
52 reg = <0x26520 0x20>;
53};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec1-3.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec1-3.dtsi
new file mode 100644
index 000000000000..40c9137729ae
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec1-3.dtsi
@@ -0,0 +1,53 @@
1/*
2 * PQ3 eTSEC device tree stub [ @ offsets 0x27000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35ethernet@27000 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 cell-index = <3>;
39 device_type = "network";
40 model = "eTSEC";
41 compatible = "gianfar";
42 reg = <0x27000 0x1000>;
43 ranges = <0x0 0x27000 0x1000>;
44 local-mac-address = [ 00 00 00 00 00 00 ];
45 interrupts = <37 2 0 0 38 2 0 0 39 2 0 0>;
46};
47
48mdio@27520 {
49 #address-cells = <1>;
50 #size-cells = <0>;
51 compatible = "fsl,gianfar-tbi";
52 reg = <0x27520 0x20>;
53};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec1-timer-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec1-timer-0.dtsi
new file mode 100644
index 000000000000..efe2ca04bce8
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec1-timer-0.dtsi
@@ -0,0 +1,39 @@
1/*
2 * PQ3 eTSEC Timer (IEEE 1588) device tree stub [ @ offsets 0x24e00 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35ptp_clock@24e00 {
36 compatible = "fsl,etsec-ptp";
37 reg = <0x24e00 0xb0>;
38 interrupts = <68 2 0 0 69 2 0 0>;
39};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
new file mode 100644
index 000000000000..1382fec9e8c5
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
@@ -0,0 +1,60 @@
1/*
2 * PQ3 eTSEC2 device tree stub [ @ offsets 0x24000/0xb0000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35
36mdio@24000 {
37 #address-cells = <1>;
38 #size-cells = <0>;
39 compatible = "fsl,etsec2-mdio";
40 reg = <0x24000 0x1000 0xb0030 0x4>;
41};
42
43ethernet@b0000 {
44 #address-cells = <1>;
45 #size-cells = <1>;
46 device_type = "network";
47 model = "eTSEC";
48 compatible = "fsl,etsec2";
49 fsl,num_rx_queues = <0x8>;
50 fsl,num_tx_queues = <0x8>;
51 fsl,magic-packet;
52 local-mac-address = [ 00 00 00 00 00 00 ];
53
54 queue-group@b0000 {
55 #address-cells = <1>;
56 #size-cells = <1>;
57 reg = <0xb0000 0x1000>;
58 interrupts = <29 2 0 0 30 2 0 0 34 2 0 0>;
59 };
60};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
new file mode 100644
index 000000000000..221cd2ea5b31
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
@@ -0,0 +1,60 @@
1/*
2 * PQ3 eTSEC2 device tree stub [ @ offsets 0x25000/0xb1000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35
36mdio@25000 {
37 #address-cells = <1>;
38 #size-cells = <0>;
39 compatible = "fsl,etsec2-tbi";
40 reg = <0x25000 0x1000 0xb1030 0x4>;
41};
42
43ethernet@b1000 {
44 #address-cells = <1>;
45 #size-cells = <1>;
46 device_type = "network";
47 model = "eTSEC";
48 compatible = "fsl,etsec2";
49 fsl,num_rx_queues = <0x8>;
50 fsl,num_tx_queues = <0x8>;
51 fsl,magic-packet;
52 local-mac-address = [ 00 00 00 00 00 00 ];
53
54 queue-group@b1000 {
55 #address-cells = <1>;
56 #size-cells = <1>;
57 reg = <0xb1000 0x1000>;
58 interrupts = <35 2 0 0 36 2 0 0 40 2 0 0>;
59 };
60};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
new file mode 100644
index 000000000000..61456c317609
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
@@ -0,0 +1,59 @@
1/*
2 * PQ3 eTSEC2 device tree stub [ @ offsets 0x26000/0xb2000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35mdio@26000 {
36 #address-cells = <1>;
37 #size-cells = <0>;
38 compatible = "fsl,etsec2-tbi";
39 reg = <0x26000 0x1000 0xb1030 0x4>;
40};
41
42ethernet@b2000 {
43 #address-cells = <1>;
44 #size-cells = <1>;
45 device_type = "network";
46 model = "eTSEC";
47 compatible = "fsl,etsec2";
48 fsl,num_rx_queues = <0x8>;
49 fsl,num_tx_queues = <0x8>;
50 fsl,magic-packet;
51 local-mac-address = [ 00 00 00 00 00 00 ];
52
53 queue-group@b2000 {
54 #address-cells = <1>;
55 #size-cells = <1>;
56 reg = <0xb2000 0x1000>;
57 interrupts = <31 2 0 0 32 2 0 0 33 2 0 0>;
58 };
59};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-0.dtsi
new file mode 100644
index 000000000000..034ab8fac22f
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-0.dtsi
@@ -0,0 +1,42 @@
1/*
2 * PQ3 eTSEC2 Group 2 device tree stub [ @ offsets 0xb4000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&enet0_grp2 {
36 queue-group@b4000 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 reg = <0xb4000 0x1000>;
40 interrupts = <17 2 0 0 18 2 0 0 24 2 0 0>;
41 };
42};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-1.dtsi
new file mode 100644
index 000000000000..3be9ba3b374e
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-1.dtsi
@@ -0,0 +1,42 @@
1/*
2 * PQ3 eTSEC2 Group 2 device tree stub [ @ offsets 0xb5000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&enet1_grp2 {
36 queue-group@b5000 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 reg = <0xb5000 0x1000>;
40 interrupts = <51 2 0 0 52 2 0 0 67 2 0 0>;
41 };
42};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-2.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-2.dtsi
new file mode 100644
index 000000000000..02a33457048c
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-grp2-2.dtsi
@@ -0,0 +1,42 @@
1/*
2 * PQ3 eTSEC2 Group 2 device tree stub [ @ offsets 0xb6000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&enet2_grp2 {
36 queue-group@b6000 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 reg = <0xb6000 0x1000>;
40 interrupts = <25 2 0 0 26 2 0 0 27 2 0 0>;
41 };
42};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi
new file mode 100644
index 000000000000..72a3ef5945c1
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * PQ3 GPIO device tree stub [ controller @ offset 0xf000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35gpio-controller@f000 {
36 #gpio-cells = <2>;
37 compatible = "fsl,pq3-gpio";
38 reg = <0xf000 0x100>;
39 interrupts = <47 0x2 0 0>;
40 gpio-controller;
41};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-i2c-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-i2c-0.dtsi
new file mode 100644
index 000000000000..d1dd6fb82a78
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-i2c-0.dtsi
@@ -0,0 +1,43 @@
1/*
2 * PQ3 I2C device tree stub [ controller @ offset 0x3000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35i2c@3000 {
36 #address-cells = <1>;
37 #size-cells = <0>;
38 cell-index = <0>;
39 compatible = "fsl-i2c";
40 reg = <0x3000 0x100>;
41 interrupts = <43 2 0 0>;
42 dfsrr;
43};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-i2c-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-i2c-1.dtsi
new file mode 100644
index 000000000000..a9bd803e2090
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-i2c-1.dtsi
@@ -0,0 +1,43 @@
1/*
2 * PQ3 I2C device tree stub [ controller @ offset 0x3100 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35i2c@3100 {
36 #address-cells = <1>;
37 #size-cells = <0>;
38 cell-index = <1>;
39 compatible = "fsl-i2c";
40 reg = <0x3100 0x100>;
41 interrupts = <43 2 0 0>;
42 dfsrr;
43};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-mpic-timer-B.dtsi b/arch/powerpc/boot/dts/fsl/pq3-mpic-timer-B.dtsi
new file mode 100644
index 000000000000..8734cffae1a1
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-mpic-timer-B.dtsi
@@ -0,0 +1,42 @@
1/*
2 * PQ3 MPIC Timer (Group B) device tree stub [ controller @ offset 0x42100 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35timer@42100 {
36 compatible = "fsl,mpic-global-timer";
37 reg = <0x42100 0x100 0x42300 4>;
38 interrupts = <4 0 3 0
39 5 0 3 0
40 6 0 3 0
41 7 0 3 0>;
42};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi b/arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi
new file mode 100644
index 000000000000..5c8046065844
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi
@@ -0,0 +1,66 @@
1/*
2 * PQ3 MPIC device tree stub [ controller @ offset 0x40000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35mpic: pic@40000 {
36 interrupt-controller;
37 #address-cells = <0>;
38 #interrupt-cells = <4>;
39 reg = <0x40000 0x40000>;
40 compatible = "fsl,mpic";
41 device_type = "open-pic";
42};
43
44timer@41100 {
45 compatible = "fsl,mpic-global-timer";
46 reg = <0x41100 0x100 0x41300 4>;
47 interrupts = <0 0 3 0
48 1 0 3 0
49 2 0 3 0
50 3 0 3 0>;
51};
52
53msi@41600 {
54 compatible = "fsl,mpic-msi";
55 reg = <0x41600 0x80>;
56 msi-available-ranges = <0 0x100>;
57 interrupts = <
58 0xe0 0 0 0
59 0xe1 0 0 0
60 0xe2 0 0 0
61 0xe3 0 0 0
62 0xe4 0 0 0
63 0xe5 0 0 0
64 0xe6 0 0 0
65 0xe7 0 0 0>;
66};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-rmu-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-rmu-0.dtsi
new file mode 100644
index 000000000000..587ca9ffad7d
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-rmu-0.dtsi
@@ -0,0 +1,68 @@
1/*
2 * PQ3 RIO Message Unit device tree stub [ controller @ offset 0xd3000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35rmu: rmu@d3000 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 compatible = "fsl,srio-rmu";
39 reg = <0xd3000 0x500>;
40 ranges = <0x0 0xd3000 0x500>;
41
42 message-unit@0 {
43 compatible = "fsl,srio-msg-unit";
44 reg = <0x0 0x100>;
45 interrupts = <
46 53 2 0 0 /* msg1_tx_irq */
47 54 2 0 0>;/* msg1_rx_irq */
48 };
49 message-unit@100 {
50 compatible = "fsl,srio-msg-unit";
51 reg = <0x100 0x100>;
52 interrupts = <
53 55 2 0 0 /* msg2_tx_irq */
54 56 2 0 0>;/* msg2_rx_irq */
55 };
56 doorbell-unit@400 {
57 compatible = "fsl,srio-dbell-unit";
58 reg = <0x400 0x80>;
59 interrupts = <
60 49 2 0 0 /* bell_outb_irq */
61 50 2 0 0>;/* bell_inb_irq */
62 };
63 port-write-unit@4e0 {
64 compatible = "fsl,srio-port-write-unit";
65 reg = <0x4e0 0x20>;
66 interrupts = <48 2 0 0>;
67 };
68};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-sata2-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-sata2-0.dtsi
new file mode 100644
index 000000000000..3c28dd08d38b
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-sata2-0.dtsi
@@ -0,0 +1,40 @@
1/*
2 * PQ3 SATAv2 device tree stub [ controller @ offset 0x18000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35sata@18000 {
36 compatible = "fsl,pq-sata-v2";
37 reg = <0x18000 0x1000>;
38 cell-index = <1>;
39 interrupts = <74 0x2 0 0>;
40};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-sata2-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-sata2-1.dtsi
new file mode 100644
index 000000000000..eefaf2855e3b
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-sata2-1.dtsi
@@ -0,0 +1,40 @@
1/*
2 * PQ3 SATAv2 device tree stub [ controller @ offset 0x19000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35sata@19000 {
36 compatible = "fsl,pq-sata-v2";
37 reg = <0x19000 0x1000>;
38 cell-index = <2>;
39 interrupts = <41 0x2 0 0>;
40};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-sec2.1-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-sec2.1-0.dtsi
new file mode 100644
index 000000000000..02a5c7ae72d0
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-sec2.1-0.dtsi
@@ -0,0 +1,43 @@
1/*
2 * PQ3 Sec/Crypto 2.1 device tree stub [ controller @ offset 0x30000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto@30000 {
36 compatible = "fsl,sec2.1", "fsl,sec2.0";
37 reg = <0x30000 0x10000>;
38 interrupts = <45 2 0 0>;
39 fsl,num-channels = <4>;
40 fsl,channel-fifo-len = <24>;
41 fsl,exec-units-mask = <0xfe>;
42 fsl,descriptor-types-mask = <0x12b0ebf>;
43};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-sec3.0-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-sec3.0-0.dtsi
new file mode 100644
index 000000000000..bba1ba44ccf0
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-sec3.0-0.dtsi
@@ -0,0 +1,45 @@
1/*
2 * PQ3 Sec/Crypto 3.0 device tree stub [ controller @ offset 0x30000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto@30000 {
36 compatible = "fsl,sec3.0",
37 "fsl,sec2.4", "fsl,sec2.2", "fsl,sec2.1",
38 "fsl,sec2.0";
39 reg = <0x30000 0x10000>;
40 interrupts = <45 2 0 0 58 2 0 0>;
41 fsl,num-channels = <4>;
42 fsl,channel-fifo-len = <24>;
43 fsl,exec-units-mask = <0x9fe>;
44 fsl,descriptor-types-mask = <0x3ab0ebf>;
45};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-sec3.1-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-sec3.1-0.dtsi
new file mode 100644
index 000000000000..8f0a5669bee5
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-sec3.1-0.dtsi
@@ -0,0 +1,45 @@
1/*
2 * PQ3 Sec/Crypto 3.1 device tree stub [ controller @ offset 0x30000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto@30000 {
36 compatible = "fsl,sec3.1", "fsl,sec3.0",
37 "fsl,sec2.4", "fsl,sec2.2", "fsl,sec2.1",
38 "fsl,sec2.0";
39 reg = <0x30000 0x10000>;
40 interrupts = <45 2 0 0 58 2 0 0>;
41 fsl,num-channels = <4>;
42 fsl,channel-fifo-len = <24>;
43 fsl,exec-units-mask = <0xbfe>;
44 fsl,descriptor-types-mask = <0x3ab0ebf>;
45};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-sec3.3-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-sec3.3-0.dtsi
new file mode 100644
index 000000000000..c227f2748a24
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-sec3.3-0.dtsi
@@ -0,0 +1,45 @@
1/*
2 * PQ3 Sec/Crypto 3.3 device tree stub [ controller @ offset 0x30000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto@30000 {
36 compatible = "fsl,sec3.3", "fsl,sec3.1", "fsl,sec3.0",
37 "fsl,sec2.4", "fsl,sec2.2", "fsl,sec2.1",
38 "fsl,sec2.0";
39 reg = <0x30000 0x10000>;
40 interrupts = <45 2 0 0 58 2 0 0>;
41 fsl,num-channels = <4>;
42 fsl,channel-fifo-len = <24>;
43 fsl,exec-units-mask = <0x97c>;
44 fsl,descriptor-types-mask = <0x3a30abf>;
45};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-sec4.4-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-sec4.4-0.dtsi
new file mode 100644
index 000000000000..bf957a7fca2a
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-sec4.4-0.dtsi
@@ -0,0 +1,65 @@
1/*
2 * PQ3 Sec/Crypto 4.4 device tree stub [ controller @ offset 0x30000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto@30000 {
36 compatible = "fsl,sec4.4", "fsl,sec4.0";
37 #address-cells = <1>;
38 #size-cells = <1>;
39 reg = <0x30000 0x10000>;
40 interrupts = <58 2 0 0>;
41
42 sec_jr0: jr@1000 {
43 compatible = "fsl,sec4.4-job-ring", "fsl,sec4.0-job-ring";
44 reg = <0x1000 0x1000>;
45 interrupts = <45 2 0 0>;
46 };
47
48 sec_jr1: jr@2000 {
49 compatible = "fsl,sec4.4-job-ring", "fsl,sec4.0-job-ring";
50 reg = <0x2000 0x1000>;
51 interrupts = <45 2 0 0>;
52 };
53
54 sec_jr2: jr@3000 {
55 compatible = "fsl,sec4.4-job-ring", "fsl,sec4.0-job-ring";
56 reg = <0x3000 0x1000>;
57 interrupts = <45 2 0 0>;
58 };
59
60 sec_jr3: jr@4000 {
61 compatible = "fsl,sec4.4-job-ring", "fsl,sec4.0-job-ring";
62 reg = <0x4000 0x1000>;
63 interrupts = <45 2 0 0>;
64 };
65};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-usb2-dr-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-usb2-dr-0.dtsi
new file mode 100644
index 000000000000..185ab9dc3ecd
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-usb2-dr-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * PQ3 USB DR device tree stub [ controller @ offset 0x22000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35usb@22000 {
36 compatible = "fsl-usb2-dr";
37 reg = <0x22000 0x1000>;
38 #address-cells = <1>;
39 #size-cells = <0>;
40 interrupts = <28 0x2 0 0>;
41};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-usb2-dr-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-usb2-dr-1.dtsi
new file mode 100644
index 000000000000..fe24cd612fff
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-usb2-dr-1.dtsi
@@ -0,0 +1,41 @@
1/*
2 * PQ3 USB DR device tree stub [ controller @ offset 0x23000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35usb@23000 {
36 compatible = "fsl-usb2-dr";
37 reg = <0x23000 0x1000>;
38 #address-cells = <1>;
39 #size-cells = <0>;
40 interrupts = <46 0x2 0 0>;
41};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-dma-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-dma-0.dtsi
new file mode 100644
index 000000000000..1aebf3ea4ca5
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-dma-0.dtsi
@@ -0,0 +1,66 @@
1/*
2 * QorIQ DMA device tree stub [ controller @ offset 0x100000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35dma0: dma@100300 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 compatible = "fsl,eloplus-dma";
39 reg = <0x100300 0x4>;
40 ranges = <0x0 0x100100 0x200>;
41 cell-index = <0>;
42 dma-channel@0 {
43 compatible = "fsl,eloplus-dma-channel";
44 reg = <0x0 0x80>;
45 cell-index = <0>;
46 interrupts = <28 2 0 0>;
47 };
48 dma-channel@80 {
49 compatible = "fsl,eloplus-dma-channel";
50 reg = <0x80 0x80>;
51 cell-index = <1>;
52 interrupts = <29 2 0 0>;
53 };
54 dma-channel@100 {
55 compatible = "fsl,eloplus-dma-channel";
56 reg = <0x100 0x80>;
57 cell-index = <2>;
58 interrupts = <30 2 0 0>;
59 };
60 dma-channel@180 {
61 compatible = "fsl,eloplus-dma-channel";
62 reg = <0x180 0x80>;
63 cell-index = <3>;
64 interrupts = <31 2 0 0>;
65 };
66};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-dma-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-dma-1.dtsi
new file mode 100644
index 000000000000..ecf5e180fe79
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-dma-1.dtsi
@@ -0,0 +1,66 @@
1/*
2 * QorIQ DMA device tree stub [ controller @ offset 0x101000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35dma1: dma@101300 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 compatible = "fsl,eloplus-dma";
39 reg = <0x101300 0x4>;
40 ranges = <0x0 0x101100 0x200>;
41 cell-index = <1>;
42 dma-channel@0 {
43 compatible = "fsl,eloplus-dma-channel";
44 reg = <0x0 0x80>;
45 cell-index = <0>;
46 interrupts = <32 2 0 0>;
47 };
48 dma-channel@80 {
49 compatible = "fsl,eloplus-dma-channel";
50 reg = <0x80 0x80>;
51 cell-index = <1>;
52 interrupts = <33 2 0 0>;
53 };
54 dma-channel@100 {
55 compatible = "fsl,eloplus-dma-channel";
56 reg = <0x100 0x80>;
57 cell-index = <2>;
58 interrupts = <34 2 0 0>;
59 };
60 dma-channel@180 {
61 compatible = "fsl,eloplus-dma-channel";
62 reg = <0x180 0x80>;
63 cell-index = <3>;
64 interrupts = <35 2 0 0>;
65 };
66};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-duart-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-duart-0.dtsi
new file mode 100644
index 000000000000..225c07b4e8ab
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-duart-0.dtsi
@@ -0,0 +1,51 @@
1/*
2 * QorIQ DUART device tree stub [ controller @ offset 0x11c000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35serial0: serial@11c500 {
36 cell-index = <0>;
37 device_type = "serial";
38 compatible = "fsl,ns16550", "ns16550";
39 reg = <0x11c500 0x100>;
40 clock-frequency = <0>;
41 interrupts = <36 2 0 0>;
42};
43
44serial1: serial@11c600 {
45 cell-index = <1>;
46 device_type = "serial";
47 compatible = "fsl,ns16550", "ns16550";
48 reg = <0x11c600 0x100>;
49 clock-frequency = <0>;
50 interrupts = <36 2 0 0>;
51};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-duart-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-duart-1.dtsi
new file mode 100644
index 000000000000..d23233a56b91
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-duart-1.dtsi
@@ -0,0 +1,51 @@
1/*
2 * QorIQ DUART device tree stub [ controller @ offset 0x11d000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35serial2: serial@11d500 {
36 cell-index = <2>;
37 device_type = "serial";
38 compatible = "fsl,ns16550", "ns16550";
39 reg = <0x11d500 0x100>;
40 clock-frequency = <0>;
41 interrupts = <37 2 0 0>;
42};
43
44serial3: serial@11d600 {
45 cell-index = <3>;
46 device_type = "serial";
47 compatible = "fsl,ns16550", "ns16550";
48 reg = <0x11d600 0x100>;
49 clock-frequency = <0>;
50 interrupts = <37 2 0 0>;
51};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-esdhc-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-esdhc-0.dtsi
new file mode 100644
index 000000000000..20835ae216c7
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-esdhc-0.dtsi
@@ -0,0 +1,40 @@
1/*
2 * QorIQ eSDHC device tree stub [ controller @ offset 0x114000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35sdhc: sdhc@114000 {
36 compatible = "fsl,esdhc";
37 reg = <0x114000 0x1000>;
38 interrupts = <48 2 0 0>;
39 clock-frequency = <0>;
40};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-espi-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-espi-0.dtsi
new file mode 100644
index 000000000000..6db06975e095
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-espi-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * QorIQ eSPI device tree stub [ controller @ offset 0x110000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35spi@110000 {
36 #address-cells = <1>;
37 #size-cells = <0>;
38 compatible = "fsl,mpc8536-espi";
39 reg = <0x110000 0x1000>;
40 interrupts = <53 0x2 0 0>;
41};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-gpio-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-gpio-0.dtsi
new file mode 100644
index 000000000000..cf714f5f68bc
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-gpio-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * QorIQ GPIO device tree stub [ controller @ offset 0x130000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35gpio0: gpio@130000 {
36 compatible = "fsl,qoriq-gpio";
37 reg = <0x130000 0x1000>;
38 interrupts = <55 2 0 0>;
39 #gpio-cells = <2>;
40 gpio-controller;
41};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
new file mode 100644
index 000000000000..5f9bf7debe4c
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
@@ -0,0 +1,53 @@
1/*
2 * QorIQ I2C device tree stub [ controller @ offset 0x118000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35i2c@118000 {
36 #address-cells = <1>;
37 #size-cells = <0>;
38 cell-index = <0>;
39 compatible = "fsl-i2c";
40 reg = <0x118000 0x100>;
41 interrupts = <38 2 0 0>;
42 dfsrr;
43};
44
45i2c@118100 {
46 #address-cells = <1>;
47 #size-cells = <0>;
48 cell-index = <1>;
49 compatible = "fsl-i2c";
50 reg = <0x118100 0x100>;
51 interrupts = <38 2 0 0>;
52 dfsrr;
53};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-i2c-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-i2c-1.dtsi
new file mode 100644
index 000000000000..7989bf5eeb53
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-i2c-1.dtsi
@@ -0,0 +1,53 @@
1/*
2 * QorIQ I2C device tree stub [ controller @ offset 0x119000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35i2c@119000 {
36 #address-cells = <1>;
37 #size-cells = <0>;
38 cell-index = <2>;
39 compatible = "fsl-i2c";
40 reg = <0x119000 0x100>;
41 interrupts = <39 2 0 0>;
42 dfsrr;
43};
44
45i2c@119100 {
46 #address-cells = <1>;
47 #size-cells = <0>;
48 cell-index = <3>;
49 compatible = "fsl-i2c";
50 reg = <0x119100 0x100>;
51 interrupts = <39 2 0 0>;
52 dfsrr;
53};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-mpic.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-mpic.dtsi
new file mode 100644
index 000000000000..b9bada6a87dc
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-mpic.dtsi
@@ -0,0 +1,106 @@
1/*
2 * QorIQ MPIC device tree stub [ controller @ offset 0x40000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35mpic: pic@40000 {
36 interrupt-controller;
37 #address-cells = <0>;
38 #interrupt-cells = <4>;
39 reg = <0x40000 0x40000>;
40 compatible = "fsl,mpic", "chrp,open-pic";
41 device_type = "open-pic";
42 clock-frequency = <0x0>;
43};
44
45timer@41100 {
46 compatible = "fsl,mpic-global-timer";
47 reg = <0x41100 0x100 0x41300 4>;
48 interrupts = <0 0 3 0
49 1 0 3 0
50 2 0 3 0
51 3 0 3 0>;
52};
53
54msi0: msi@41600 {
55 compatible = "fsl,mpic-msi";
56 reg = <0x41600 0x200>;
57 msi-available-ranges = <0 0x100>;
58 interrupts = <
59 0xe0 0 0 0
60 0xe1 0 0 0
61 0xe2 0 0 0
62 0xe3 0 0 0
63 0xe4 0 0 0
64 0xe5 0 0 0
65 0xe6 0 0 0
66 0xe7 0 0 0>;
67};
68
69msi1: msi@41800 {
70 compatible = "fsl,mpic-msi";
71 reg = <0x41800 0x200>;
72 msi-available-ranges = <0 0x100>;
73 interrupts = <
74 0xe8 0 0 0
75 0xe9 0 0 0
76 0xea 0 0 0
77 0xeb 0 0 0
78 0xec 0 0 0
79 0xed 0 0 0
80 0xee 0 0 0
81 0xef 0 0 0>;
82};
83
84msi2: msi@41a00 {
85 compatible = "fsl,mpic-msi";
86 reg = <0x41a00 0x200>;
87 msi-available-ranges = <0 0x100>;
88 interrupts = <
89 0xf0 0 0 0
90 0xf1 0 0 0
91 0xf2 0 0 0
92 0xf3 0 0 0
93 0xf4 0 0 0
94 0xf5 0 0 0
95 0xf6 0 0 0
96 0xf7 0 0 0>;
97};
98
99timer@42100 {
100 compatible = "fsl,mpic-global-timer";
101 reg = <0x42100 0x100 0x42300 4>;
102 interrupts = <4 0 3 0
103 5 0 3 0
104 6 0 3 0
105 7 0 3 0>;
106};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-rmu-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-rmu-0.dtsi
new file mode 100644
index 000000000000..ca7fec792e53
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-rmu-0.dtsi
@@ -0,0 +1,68 @@
1/*
2 * QorIQ RIO Message Unit device tree stub [ controller @ offset 0xd3000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35rmu: rmu@d3000 {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 compatible = "fsl,srio-rmu";
39 reg = <0xd3000 0x500>;
40 ranges = <0x0 0xd3000 0x500>;
41
42 message-unit@0 {
43 compatible = "fsl,srio-msg-unit";
44 reg = <0x0 0x100>;
45 interrupts = <
46 60 2 0 0 /* msg1_tx_irq */
47 61 2 0 0>;/* msg1_rx_irq */
48 };
49 message-unit@100 {
50 compatible = "fsl,srio-msg-unit";
51 reg = <0x100 0x100>;
52 interrupts = <
53 62 2 0 0 /* msg2_tx_irq */
54 63 2 0 0>;/* msg2_rx_irq */
55 };
56 doorbell-unit@400 {
57 compatible = "fsl,srio-dbell-unit";
58 reg = <0x400 0x80>;
59 interrupts = <
60 56 2 0 0 /* bell_outb_irq */
61 57 2 0 0>;/* bell_inb_irq */
62 };
63 port-write-unit@4e0 {
64 compatible = "fsl,srio-port-write-unit";
65 reg = <0x4e0 0x20>;
66 interrupts = <16 2 1 11>;
67 };
68};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sata2-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sata2-0.dtsi
new file mode 100644
index 000000000000..b642047fdecf
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-sata2-0.dtsi
@@ -0,0 +1,39 @@
1/*
2 * QorIQ SATAv2 device tree stub [ controller @ offset 0x220000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35sata@220000 {
36 compatible = "fsl,pq-sata-v2";
37 reg = <0x220000 0x1000>;
38 interrupts = <68 0x2 0 0>;
39};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sata2-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sata2-1.dtsi
new file mode 100644
index 000000000000..c57370259750
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-sata2-1.dtsi
@@ -0,0 +1,39 @@
1/*
2 * QorIQ SATAv2 device tree stub [ controller @ offset 0x221000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35sata@221000 {
36 compatible = "fsl,pq-sata-v2";
37 reg = <0x221000 0x1000>;
38 interrupts = <69 0x2 0 0>;
39};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sec4.0-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sec4.0-0.dtsi
new file mode 100644
index 000000000000..0cbbac329539
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-sec4.0-0.dtsi
@@ -0,0 +1,100 @@
1/*
2 * QorIQ Sec/Crypto 4.0 device tree stub [ controller @ offset 0x300000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto: crypto@300000 {
36 compatible = "fsl,sec-v4.0";
37 #address-cells = <1>;
38 #size-cells = <1>;
39 reg = <0x300000 0x10000>;
40 ranges = <0 0x300000 0x10000>;
41 interrupts = <92 2 0 0>;
42
43 sec_jr0: jr@1000 {
44 compatible = "fsl,sec-v4.0-job-ring";
45 reg = <0x1000 0x1000>;
46 interrupts = <88 2 0 0>;
47 };
48
49 sec_jr1: jr@2000 {
50 compatible = "fsl,sec-v4.0-job-ring";
51 reg = <0x2000 0x1000>;
52 interrupts = <89 2 0 0>;
53 };
54
55 sec_jr2: jr@3000 {
56 compatible = "fsl,sec-v4.0-job-ring";
57 reg = <0x3000 0x1000>;
58 interrupts = <90 2 0 0>;
59 };
60
61 sec_jr3: jr@4000 {
62 compatible = "fsl,sec-v4.0-job-ring";
63 reg = <0x4000 0x1000>;
64 interrupts = <91 2 0 0>;
65 };
66
67 rtic@6000 {
68 compatible = "fsl,sec-v4.0-rtic";
69 #address-cells = <1>;
70 #size-cells = <1>;
71 reg = <0x6000 0x100>;
72 ranges = <0x0 0x6100 0xe00>;
73
74 rtic_a: rtic-a@0 {
75 compatible = "fsl,sec-v4.0-rtic-memory";
76 reg = <0x00 0x20 0x100 0x80>;
77 };
78
79 rtic_b: rtic-b@20 {
80 compatible = "fsl,sec-v4.0-rtic-memory";
81 reg = <0x20 0x20 0x200 0x80>;
82 };
83
84 rtic_c: rtic-c@40 {
85 compatible = "fsl,sec-v4.0-rtic-memory";
86 reg = <0x40 0x20 0x300 0x80>;
87 };
88
89 rtic_d: rtic-d@60 {
90 compatible = "fsl,sec-v4.0-rtic-memory";
91 reg = <0x60 0x20 0x500 0x80>;
92 };
93 };
94};
95
96sec_mon: sec_mon@314000 {
97 compatible = "fsl,sec-v4.0-mon";
98 reg = <0x314000 0x1000>;
99 interrupts = <93 2 0 0>;
100};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sec4.1-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sec4.1-0.dtsi
new file mode 100644
index 000000000000..3308986bba0d
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-sec4.1-0.dtsi
@@ -0,0 +1,109 @@
1/*
2 * QorIQ Sec/Crypto 4.1 device tree stub [ controller @ offset 0x300000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto: crypto@300000 {
36 compatible = "fsl,sec-v4.1", "fsl,sec-v4.0";
37 #address-cells = <1>;
38 #size-cells = <1>;
39 reg = <0x300000 0x10000>;
40 ranges = <0 0x300000 0x10000>;
41 interrupts = <92 2 0 0>;
42
43 sec_jr0: jr@1000 {
44 compatible = "fsl,sec-v4.1-job-ring",
45 "fsl,sec-v4.0-job-ring";
46 reg = <0x1000 0x1000>;
47 interrupts = <88 2 0 0>;
48 };
49
50 sec_jr1: jr@2000 {
51 compatible = "fsl,sec-v4.1-job-ring",
52 "fsl,sec-v4.0-job-ring";
53 reg = <0x2000 0x1000>;
54 interrupts = <89 2 0 0>;
55 };
56
57 sec_jr2: jr@3000 {
58 compatible = "fsl,sec-v4.1-job-ring",
59 "fsl,sec-v4.0-job-ring";
60 reg = <0x3000 0x1000>;
61 interrupts = <90 2 0 0>;
62 };
63
64 sec_jr3: jr@4000 {
65 compatible = "fsl,sec-v4.1-job-ring",
66 "fsl,sec-v4.0-job-ring";
67 reg = <0x4000 0x1000>;
68 interrupts = <91 2 0 0>;
69 };
70
71 rtic@6000 {
72 compatible = "fsl,sec-v4.1-rtic",
73 "fsl,sec-v4.0-rtic";
74 #address-cells = <1>;
75 #size-cells = <1>;
76 reg = <0x6000 0x100>;
77 ranges = <0x0 0x6100 0xe00>;
78
79 rtic_a: rtic-a@0 {
80 compatible = "fsl,sec-v4.1-rtic-memory",
81 "fsl,sec-v4.0-rtic-memory";
82 reg = <0x00 0x20 0x100 0x80>;
83 };
84
85 rtic_b: rtic-b@20 {
86 compatible = "fsl,sec-v4.1-rtic-memory",
87 "fsl,sec-v4.0-rtic-memory";
88 reg = <0x20 0x20 0x200 0x80>;
89 };
90
91 rtic_c: rtic-c@40 {
92 compatible = "fsl,sec-v4.1-rtic-memory",
93 "fsl,sec-v4.0-rtic-memory";
94 reg = <0x40 0x20 0x300 0x80>;
95 };
96
97 rtic_d: rtic-d@60 {
98 compatible = "fsl,sec-v4.1-rtic-memory",
99 "fsl,sec-v4.0-rtic-memory";
100 reg = <0x60 0x20 0x500 0x80>;
101 };
102 };
103};
104
105sec_mon: sec_mon@314000 {
106 compatible = "fsl,sec-v4.1-mon", "fsl,sec-v4.0-mon";
107 reg = <0x314000 0x1000>;
108 interrupts = <93 2 0 0>;
109};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi
new file mode 100644
index 000000000000..7990e0d3d6f2
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi
@@ -0,0 +1,109 @@
1/*
2 * QorIQ Sec/Crypto 4.2 device tree stub [ controller @ offset 0x300000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35crypto: crypto@300000 {
36 compatible = "fsl,sec-v4.2", "fsl,sec-v4.0";
37 #address-cells = <1>;
38 #size-cells = <1>;
39 reg = <0x300000 0x10000>;
40 ranges = <0 0x300000 0x10000>;
41 interrupts = <92 2 0 0>;
42
43 sec_jr0: jr@1000 {
44 compatible = "fsl,sec-v4.2-job-ring",
45 "fsl,sec-v4.0-job-ring";
46 reg = <0x1000 0x1000>;
47 interrupts = <88 2 0 0>;
48 };
49
50 sec_jr1: jr@2000 {
51 compatible = "fsl,sec-v4.2-job-ring",
52 "fsl,sec-v4.0-job-ring";
53 reg = <0x2000 0x1000>;
54 interrupts = <89 2 0 0>;
55 };
56
57 sec_jr2: jr@3000 {
58 compatible = "fsl,sec-v4.2-job-ring",
59 "fsl,sec-v4.0-job-ring";
60 reg = <0x3000 0x1000>;
61 interrupts = <90 2 0 0>;
62 };
63
64 sec_jr3: jr@4000 {
65 compatible = "fsl,sec-v4.2-job-ring",
66 "fsl,sec-v4.0-job-ring";
67 reg = <0x4000 0x1000>;
68 interrupts = <91 2 0 0>;
69 };
70
71 rtic@6000 {
72 compatible = "fsl,sec-v4.2-rtic",
73 "fsl,sec-v4.0-rtic";
74 #address-cells = <1>;
75 #size-cells = <1>;
76 reg = <0x6000 0x100>;
77 ranges = <0x0 0x6100 0xe00>;
78
79 rtic_a: rtic-a@0 {
80 compatible = "fsl,sec-v4.2-rtic-memory",
81 "fsl,sec-v4.0-rtic-memory";
82 reg = <0x00 0x20 0x100 0x80>;
83 };
84
85 rtic_b: rtic-b@20 {
86 compatible = "fsl,sec-v4.2-rtic-memory",
87 "fsl,sec-v4.0-rtic-memory";
88 reg = <0x20 0x20 0x200 0x80>;
89 };
90
91 rtic_c: rtic-c@40 {
92 compatible = "fsl,sec-v4.2-rtic-memory",
93 "fsl,sec-v4.0-rtic-memory";
94 reg = <0x40 0x20 0x300 0x80>;
95 };
96
97 rtic_d: rtic-d@60 {
98 compatible = "fsl,sec-v4.2-rtic-memory",
99 "fsl,sec-v4.0-rtic-memory";
100 reg = <0x60 0x20 0x500 0x80>;
101 };
102 };
103};
104
105sec_mon: sec_mon@314000 {
106 compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon";
107 reg = <0x314000 0x1000>;
108 interrupts = <93 2 0 0>;
109};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-usb2-dr-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-usb2-dr-0.dtsi
new file mode 100644
index 000000000000..4dd6f84c239c
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-usb2-dr-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * QorIQ USB DR device tree stub [ controller @ offset 0x211000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35usb@211000 {
36 compatible = "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr";
37 reg = <0x211000 0x1000>;
38 #address-cells = <1>;
39 #size-cells = <0>;
40 interrupts = <45 0x2 0 0>;
41};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-usb2-mph-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-usb2-mph-0.dtsi
new file mode 100644
index 000000000000..f053835aa1c7
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-usb2-mph-0.dtsi
@@ -0,0 +1,41 @@
1/*
2 * QorIQ USB Host device tree stub [ controller @ offset 0x210000 ]
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35usb@210000 {
36 compatible = "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph";
37 reg = <0x210000 0x1000>;
38 #address-cells = <1>;
39 #size-cells = <0>;
40 interrupts = <44 0x2 0 0>;
41};
diff --git a/arch/powerpc/boot/dts/gef_ppc9a.dts b/arch/powerpc/boot/dts/gef_ppc9a.dts
index 2266bbb303d0..38dcb96c8e26 100644
--- a/arch/powerpc/boot/dts/gef_ppc9a.dts
+++ b/arch/powerpc/boot/dts/gef_ppc9a.dts
@@ -339,7 +339,7 @@
339 serial0: serial@4500 { 339 serial0: serial@4500 {
340 cell-index = <0>; 340 cell-index = <0>;
341 device_type = "serial"; 341 device_type = "serial";
342 compatible = "ns16550"; 342 compatible = "fsl,ns16550", "ns16550";
343 reg = <0x4500 0x100>; 343 reg = <0x4500 0x100>;
344 clock-frequency = <0>; 344 clock-frequency = <0>;
345 interrupts = <0x2a 0x2>; 345 interrupts = <0x2a 0x2>;
@@ -349,7 +349,7 @@
349 serial1: serial@4600 { 349 serial1: serial@4600 {
350 cell-index = <1>; 350 cell-index = <1>;
351 device_type = "serial"; 351 device_type = "serial";
352 compatible = "ns16550"; 352 compatible = "fsl,ns16550", "ns16550";
353 reg = <0x4600 0x100>; 353 reg = <0x4600 0x100>;
354 clock-frequency = <0>; 354 clock-frequency = <0>;
355 interrupts = <0x1c 0x2>; 355 interrupts = <0x1c 0x2>;
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
index 429e87d9acef..5ab8932d09b7 100644
--- a/arch/powerpc/boot/dts/gef_sbc310.dts
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -337,7 +337,7 @@
337 serial0: serial@4500 { 337 serial0: serial@4500 {
338 cell-index = <0>; 338 cell-index = <0>;
339 device_type = "serial"; 339 device_type = "serial";
340 compatible = "ns16550"; 340 compatible = "fsl,ns16550", "ns16550";
341 reg = <0x4500 0x100>; 341 reg = <0x4500 0x100>;
342 clock-frequency = <0>; 342 clock-frequency = <0>;
343 interrupts = <0x2a 0x2>; 343 interrupts = <0x2a 0x2>;
@@ -347,7 +347,7 @@
347 serial1: serial@4600 { 347 serial1: serial@4600 {
348 cell-index = <1>; 348 cell-index = <1>;
349 device_type = "serial"; 349 device_type = "serial";
350 compatible = "ns16550"; 350 compatible = "fsl,ns16550", "ns16550";
351 reg = <0x4600 0x100>; 351 reg = <0x4600 0x100>;
352 clock-frequency = <0>; 352 clock-frequency = <0>;
353 interrupts = <0x1c 0x2>; 353 interrupts = <0x1c 0x2>;
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index d81201ac2cad..d5341f5741aa 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -337,7 +337,7 @@
337 serial0: serial@4500 { 337 serial0: serial@4500 {
338 cell-index = <0>; 338 cell-index = <0>;
339 device_type = "serial"; 339 device_type = "serial";
340 compatible = "ns16550"; 340 compatible = "fsl,ns16550", "ns16550";
341 reg = <0x4500 0x100>; 341 reg = <0x4500 0x100>;
342 clock-frequency = <0>; 342 clock-frequency = <0>;
343 interrupts = <0x2a 0x2>; 343 interrupts = <0x2a 0x2>;
@@ -347,7 +347,7 @@
347 serial1: serial@4600 { 347 serial1: serial@4600 {
348 cell-index = <1>; 348 cell-index = <1>;
349 device_type = "serial"; 349 device_type = "serial";
350 compatible = "ns16550"; 350 compatible = "fsl,ns16550", "ns16550";
351 reg = <0x4600 0x100>; 351 reg = <0x4600 0x100>;
352 clock-frequency = <0>; 352 clock-frequency = <0>;
353 interrupts = <0x1c 0x2>; 353 interrupts = <0x1c 0x2>;
diff --git a/arch/powerpc/boot/dts/klondike.dts b/arch/powerpc/boot/dts/klondike.dts
new file mode 100644
index 000000000000..8c9429033618
--- /dev/null
+++ b/arch/powerpc/boot/dts/klondike.dts
@@ -0,0 +1,227 @@
1/*
2 * Device Tree for Klondike (APM8018X) board.
3 *
4 * Copyright (c) 2010, Applied Micro Circuits Corporation
5 * Author: Tanmay Inamdar <tinamdar@apm.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 *
22 */
23
24/dts-v1/;
25
26/ {
27 #address-cells = <1>;
28 #size-cells = <1>;
29 model = "apm,klondike";
30 compatible = "apm,klondike";
31 dcr-parent = <&{/cpus/cpu@0}>;
32
33 aliases {
34 ethernet0 = &EMAC0;
35 ethernet1 = &EMAC1;
36 };
37
38 cpus {
39 #address-cells = <1>;
40 #size-cells = <0>;
41
42 cpu@0 {
43 device_type = "cpu";
44 model = "PowerPC,apm8018x";
45 reg = <0x00000000>;
46 clock-frequency = <300000000>; /* Filled in by U-Boot */
47 timebase-frequency = <300000000>; /* Filled in by U-Boot */
48 i-cache-line-size = <32>;
49 d-cache-line-size = <32>;
50 i-cache-size = <16384>; /* 16 kB */
51 d-cache-size = <16384>; /* 16 kB */
52 dcr-controller;
53 dcr-access-method = "native";
54 };
55 };
56
57 memory {
58 device_type = "memory";
59 reg = <0x00000000 0x20000000>; /* Filled in by U-Boot */
60 };
61
62 UIC0: interrupt-controller {
63 compatible = "ibm,uic";
64 interrupt-controller;
65 cell-index = <0>;
66 dcr-reg = <0x0c0 0x010>;
67 #address-cells = <0>;
68 #size-cells = <0>;
69 #interrupt-cells = <2>;
70 };
71
72 UIC1: interrupt-controller1 {
73 compatible = "ibm,uic";
74 interrupt-controller;
75 cell-index = <1>;
76 dcr-reg = <0x0d0 0x010>;
77 #address-cells = <0>;
78 #size-cells = <0>;
79 #interrupt-cells = <2>;
80 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
81 interrupt-parent = <&UIC0>;
82 };
83
84 UIC2: interrupt-controller2 {
85 compatible = "ibm,uic";
86 interrupt-controller;
87 cell-index = <2>;
88 dcr-reg = <0x0e0 0x010>;
89 #address-cells = <0>;
90 #size-cells = <0>;
91 #interrupt-cells = <2>;
92 interrupts = <0x0a 0x4 0x0b 0x4>; /* cascade */
93 interrupt-parent = <&UIC0>;
94 };
95
96 UIC3: interrupt-controller3 {
97 compatible = "ibm,uic";
98 interrupt-controller;
99 cell-index = <3>;
100 dcr-reg = <0x0f0 0x010>;
101 #address-cells = <0>;
102 #size-cells = <0>;
103 #interrupt-cells = <2>;
104 interrupts = <0x10 0x4 0x11 0x4>; /* cascade */
105 interrupt-parent = <&UIC0>;
106 };
107
108 plb {
109 compatible = "ibm,plb4";
110 #address-cells = <1>;
111 #size-cells = <1>;
112 ranges;
113 clock-frequency = <0>; /* Filled in by U-Boot */
114
115 SDRAM0: memory-controller {
116 compatible = "ibm,sdram-apm8018x";
117 dcr-reg = <0x010 0x002>;
118 };
119
120 MAL0: mcmal {
121 compatible = "ibm,mcmal2";
122 dcr-reg = <0x180 0x062>;
123 num-tx-chans = <2>;
124 num-rx-chans = <16>;
125 #address-cells = <0>;
126 #size-cells = <0>;
127 interrupt-parent = <&UIC1>;
128 interrupts = </*TXEOB*/ 0x6 0x4
129 /*RXEOB*/ 0x7 0x4
130 /*SERR*/ 0x1 0x4
131 /*TXDE*/ 0x2 0x4
132 /*RXDE*/ 0x3 0x4>;
133 };
134
135 POB0: opb {
136 compatible = "ibm,opb";
137 #address-cells = <1>;
138 #size-cells = <1>;
139 ranges = <0x20000000 0x20000000 0x30000000
140 0x50000000 0x50000000 0x10000000
141 0x60000000 0x60000000 0x10000000
142 0xFE000000 0xFE000000 0x00010000>;
143 dcr-reg = <0x100 0x020>;
144 clock-frequency = <300000000>; /* Filled in by U-Boot */
145
146 RGMII0: emac-rgmii@400a2000 {
147 compatible = "ibm,rgmii";
148 reg = <0x400a2000 0x00000010>;
149 has-mdio;
150 };
151
152 TAH0: emac-tah@400a3000 {
153 compatible = "ibm,tah";
154 reg = <0x400a3000 0x100>;
155 };
156
157 TAH1: emac-tah@400a4000 {
158 compatible = "ibm,tah";
159 reg = <0x400a4000 0x100>;
160 };
161
162 EMAC0: ethernet@400a0000 {
163 compatible = "ibm,emac4", "ibm-emac4sync";
164 interrupt-parent = <&EMAC0>;
165 interrupts = <0x0>;
166 #interrupt-cells = <1>;
167 #address-cells = <0>;
168 #size-cells = <0>;
169 interrupt-map = </*Status*/ 0x0 &UIC0 0x13 0x4>;
170 reg = <0x400a0000 0x00000100>;
171 local-mac-address = [000000000000]; /* Filled in by U-Boot */
172 mal-device = <&MAL0>;
173 mal-tx-channel = <0x0>;
174 mal-rx-channel = <0x0>;
175 cell-index = <0>;
176 max-frame-size = <9000>;
177 rx-fifo-size = <4096>;
178 tx-fifo-size = <2048>;
179 phy-mode = "rgmii";
180 phy-address = <0x2>;
181 turbo = "no";
182 phy-map = <0x00000000>;
183 rgmii-device = <&RGMII0>;
184 rgmii-channel = <0>;
185 tah-device = <&TAH0>;
186 tah-channel = <0>;
187 has-inverted-stacr-oc;
188 has-new-stacr-staopc;
189 };
190
191 EMAC1: ethernet@400a1000 {
192 compatible = "ibm,emac4", "ibm-emac4sync";
193 status = "disabled";
194 interrupt-parent = <&EMAC1>;
195 interrupts = <0x0>;
196 #interrupt-cells = <1>;
197 #address-cells = <0>;
198 #size-cells = <0>;
199 interrupt-map = </*Status*/ 0x0 &UIC0 0x14 0x4>;
200 reg = <0x400a1000 0x00000100>;
201 local-mac-address = [000000000000]; /* Filled in by U-Boot */
202 mal-device = <&MAL0>;
203 mal-tx-channel = <1>;
204 mal-rx-channel = <8>;
205 cell-index = <1>;
206 max-frame-size = <9000>;
207 rx-fifo-size = <4096>;
208 tx-fifo-size = <2048>;
209 phy-mode = "rgmii";
210 phy-address = <0x3>;
211 turbo = "no";
212 phy-map = <0x00000000>;
213 rgmii-device = <&RGMII0>;
214 rgmii-channel = <1>;
215 tah-device = <&TAH1>;
216 tah-channel = <0>;
217 has-inverted-stacr-oc;
218 has-new-stacr-staopc;
219 mdio-device = <&EMAC0>;
220 };
221 };
222 };
223
224 chosen {
225 linux,stdout-path = "/plb/opb/serial@50001000";
226 };
227};
diff --git a/arch/powerpc/boot/dts/kmeter1.dts b/arch/powerpc/boot/dts/kmeter1.dts
index d16bae1230f7..983aee185793 100644
--- a/arch/powerpc/boot/dts/kmeter1.dts
+++ b/arch/powerpc/boot/dts/kmeter1.dts
@@ -80,7 +80,7 @@
80 serial0: serial@4500 { 80 serial0: serial@4500 {
81 cell-index = <0>; 81 cell-index = <0>;
82 device_type = "serial"; 82 device_type = "serial";
83 compatible = "ns16550"; 83 compatible = "fsl,ns16550", "ns16550";
84 reg = <0x4500 0x100>; 84 reg = <0x4500 0x100>;
85 clock-frequency = <264000000>; 85 clock-frequency = <264000000>;
86 interrupts = <9 0x8>; 86 interrupts = <9 0x8>;
diff --git a/arch/powerpc/boot/dts/kuroboxHD.dts b/arch/powerpc/boot/dts/kuroboxHD.dts
index 8d725d10882f..0a4545159e80 100644
--- a/arch/powerpc/boot/dts/kuroboxHD.dts
+++ b/arch/powerpc/boot/dts/kuroboxHD.dts
@@ -84,7 +84,7 @@ XXXX add flash parts, rtc, ??
84 serial0: serial@80004500 { 84 serial0: serial@80004500 {
85 cell-index = <0>; 85 cell-index = <0>;
86 device_type = "serial"; 86 device_type = "serial";
87 compatible = "ns16550"; 87 compatible = "fsl,ns16550", "ns16550";
88 reg = <0x80004500 0x8>; 88 reg = <0x80004500 0x8>;
89 clock-frequency = <97553800>; 89 clock-frequency = <97553800>;
90 current-speed = <9600>; 90 current-speed = <9600>;
@@ -95,7 +95,7 @@ XXXX add flash parts, rtc, ??
95 serial1: serial@80004600 { 95 serial1: serial@80004600 {
96 cell-index = <1>; 96 cell-index = <1>;
97 device_type = "serial"; 97 device_type = "serial";
98 compatible = "ns16550"; 98 compatible = "fsl,ns16550", "ns16550";
99 reg = <0x80004600 0x8>; 99 reg = <0x80004600 0x8>;
100 clock-frequency = <97553800>; 100 clock-frequency = <97553800>;
101 current-speed = <57600>; 101 current-speed = <57600>;
diff --git a/arch/powerpc/boot/dts/kuroboxHG.dts b/arch/powerpc/boot/dts/kuroboxHG.dts
index b13a11eb81b0..0e758b347cdb 100644
--- a/arch/powerpc/boot/dts/kuroboxHG.dts
+++ b/arch/powerpc/boot/dts/kuroboxHG.dts
@@ -84,7 +84,7 @@ XXXX add flash parts, rtc, ??
84 serial0: serial@80004500 { 84 serial0: serial@80004500 {
85 cell-index = <0>; 85 cell-index = <0>;
86 device_type = "serial"; 86 device_type = "serial";
87 compatible = "ns16550"; 87 compatible = "fsl,ns16550", "ns16550";
88 reg = <0x80004500 0x8>; 88 reg = <0x80004500 0x8>;
89 clock-frequency = <130041000>; 89 clock-frequency = <130041000>;
90 current-speed = <9600>; 90 current-speed = <9600>;
@@ -95,7 +95,7 @@ XXXX add flash parts, rtc, ??
95 serial1: serial@80004600 { 95 serial1: serial@80004600 {
96 cell-index = <1>; 96 cell-index = <1>;
97 device_type = "serial"; 97 device_type = "serial";
98 compatible = "ns16550"; 98 compatible = "fsl,ns16550", "ns16550";
99 reg = <0x80004600 0x8>; 99 reg = <0x80004600 0x8>;
100 clock-frequency = <130041000>; 100 clock-frequency = <130041000>;
101 current-speed = <57600>; 101 current-speed = <57600>;
diff --git a/arch/powerpc/boot/dts/mpc8308_p1m.dts b/arch/powerpc/boot/dts/mpc8308_p1m.dts
index 697b3f6b78bf..22b0832b6c31 100644
--- a/arch/powerpc/boot/dts/mpc8308_p1m.dts
+++ b/arch/powerpc/boot/dts/mpc8308_p1m.dts
@@ -233,7 +233,7 @@
233 serial0: serial@4500 { 233 serial0: serial@4500 {
234 cell-index = <0>; 234 cell-index = <0>;
235 device_type = "serial"; 235 device_type = "serial";
236 compatible = "ns16550"; 236 compatible = "fsl,ns16550", "ns16550";
237 reg = <0x4500 0x100>; 237 reg = <0x4500 0x100>;
238 clock-frequency = <133333333>; 238 clock-frequency = <133333333>;
239 interrupts = <9 0x8>; 239 interrupts = <9 0x8>;
@@ -243,7 +243,7 @@
243 serial1: serial@4600 { 243 serial1: serial@4600 {
244 cell-index = <1>; 244 cell-index = <1>;
245 device_type = "serial"; 245 device_type = "serial";
246 compatible = "ns16550"; 246 compatible = "fsl,ns16550", "ns16550";
247 reg = <0x4600 0x100>; 247 reg = <0x4600 0x100>;
248 clock-frequency = <133333333>; 248 clock-frequency = <133333333>;
249 interrupts = <10 0x8>; 249 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8308rdb.dts b/arch/powerpc/boot/dts/mpc8308rdb.dts
index a0bd1881081e..f66d10d95a8d 100644
--- a/arch/powerpc/boot/dts/mpc8308rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8308rdb.dts
@@ -208,7 +208,7 @@
208 serial0: serial@4500 { 208 serial0: serial@4500 {
209 cell-index = <0>; 209 cell-index = <0>;
210 device_type = "serial"; 210 device_type = "serial";
211 compatible = "ns16550"; 211 compatible = "fsl,ns16550", "ns16550";
212 reg = <0x4500 0x100>; 212 reg = <0x4500 0x100>;
213 clock-frequency = <133333333>; 213 clock-frequency = <133333333>;
214 interrupts = <9 0x8>; 214 interrupts = <9 0x8>;
@@ -218,7 +218,7 @@
218 serial1: serial@4600 { 218 serial1: serial@4600 {
219 cell-index = <1>; 219 cell-index = <1>;
220 device_type = "serial"; 220 device_type = "serial";
221 compatible = "ns16550"; 221 compatible = "fsl,ns16550", "ns16550";
222 reg = <0x4600 0x100>; 222 reg = <0x4600 0x100>;
223 clock-frequency = <133333333>; 223 clock-frequency = <133333333>;
224 interrupts = <10 0x8>; 224 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index ac1eb320c7b4..1c836c6c5be6 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -261,7 +261,7 @@
261 serial0: serial@4500 { 261 serial0: serial@4500 {
262 cell-index = <0>; 262 cell-index = <0>;
263 device_type = "serial"; 263 device_type = "serial";
264 compatible = "ns16550"; 264 compatible = "fsl,ns16550", "ns16550";
265 reg = <0x4500 0x100>; 265 reg = <0x4500 0x100>;
266 clock-frequency = <0>; 266 clock-frequency = <0>;
267 interrupts = <9 0x8>; 267 interrupts = <9 0x8>;
@@ -271,7 +271,7 @@
271 serial1: serial@4600 { 271 serial1: serial@4600 {
272 cell-index = <1>; 272 cell-index = <1>;
273 device_type = "serial"; 273 device_type = "serial";
274 compatible = "ns16550"; 274 compatible = "fsl,ns16550", "ns16550";
275 reg = <0x4600 0x100>; 275 reg = <0x4600 0x100>;
276 clock-frequency = <0>; 276 clock-frequency = <0>;
277 interrupts = <10 0x8>; 277 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts b/arch/powerpc/boot/dts/mpc8315erdb.dts
index 4dd08c322979..811848e93aef 100644
--- a/arch/powerpc/boot/dts/mpc8315erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8315erdb.dts
@@ -265,7 +265,7 @@
265 serial0: serial@4500 { 265 serial0: serial@4500 {
266 cell-index = <0>; 266 cell-index = <0>;
267 device_type = "serial"; 267 device_type = "serial";
268 compatible = "ns16550"; 268 compatible = "fsl,ns16550", "ns16550";
269 reg = <0x4500 0x100>; 269 reg = <0x4500 0x100>;
270 clock-frequency = <133333333>; 270 clock-frequency = <133333333>;
271 interrupts = <9 0x8>; 271 interrupts = <9 0x8>;
@@ -275,7 +275,7 @@
275 serial1: serial@4600 { 275 serial1: serial@4600 {
276 cell-index = <1>; 276 cell-index = <1>;
277 device_type = "serial"; 277 device_type = "serial";
278 compatible = "ns16550"; 278 compatible = "fsl,ns16550", "ns16550";
279 reg = <0x4600 0x100>; 279 reg = <0x4600 0x100>;
280 clock-frequency = <133333333>; 280 clock-frequency = <133333333>;
281 interrupts = <10 0x8>; 281 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 05ad8c98e527..da9c72ddc343 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -105,7 +105,7 @@
105 serial0: serial@4500 { 105 serial0: serial@4500 {
106 cell-index = <0>; 106 cell-index = <0>;
107 device_type = "serial"; 107 device_type = "serial";
108 compatible = "ns16550"; 108 compatible = "fsl,ns16550", "ns16550";
109 reg = <0x4500 0x100>; 109 reg = <0x4500 0x100>;
110 clock-frequency = <0>; 110 clock-frequency = <0>;
111 interrupts = <9 0x8>; 111 interrupts = <9 0x8>;
@@ -115,7 +115,7 @@
115 serial1: serial@4600 { 115 serial1: serial@4600 {
116 cell-index = <1>; 116 cell-index = <1>;
117 device_type = "serial"; 117 device_type = "serial";
118 compatible = "ns16550"; 118 compatible = "fsl,ns16550", "ns16550";
119 reg = <0x4600 0x100>; 119 reg = <0x4600 0x100>;
120 clock-frequency = <0>; 120 clock-frequency = <0>;
121 interrupts = <10 0x8>; 121 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index f4fadb23ad6f..ff7b15b340a3 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -83,7 +83,7 @@
83 serial0: serial@4500 { 83 serial0: serial@4500 {
84 cell-index = <0>; 84 cell-index = <0>;
85 device_type = "serial"; 85 device_type = "serial";
86 compatible = "ns16550"; 86 compatible = "fsl,ns16550", "ns16550";
87 reg = <0x4500 0x100>; 87 reg = <0x4500 0x100>;
88 clock-frequency = <0>; 88 clock-frequency = <0>;
89 interrupts = <9 0x8>; 89 interrupts = <9 0x8>;
@@ -93,7 +93,7 @@
93 serial1: serial@4600 { 93 serial1: serial@4600 {
94 cell-index = <1>; 94 cell-index = <1>;
95 device_type = "serial"; 95 device_type = "serial";
96 compatible = "ns16550"; 96 compatible = "fsl,ns16550", "ns16550";
97 reg = <0x4600 0x100>; 97 reg = <0x4600 0x100>;
98 clock-frequency = <0>; 98 clock-frequency = <0>;
99 interrupts = <10 0x8>; 99 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 505dc842d808..2608679d0d4a 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -283,7 +283,7 @@
283 serial0: serial@4500 { 283 serial0: serial@4500 {
284 cell-index = <0>; 284 cell-index = <0>;
285 device_type = "serial"; 285 device_type = "serial";
286 compatible = "ns16550"; 286 compatible = "fsl,ns16550", "ns16550";
287 reg = <0x4500 0x100>; 287 reg = <0x4500 0x100>;
288 clock-frequency = <0>; // from bootloader 288 clock-frequency = <0>; // from bootloader
289 interrupts = <9 0x8>; 289 interrupts = <9 0x8>;
@@ -293,7 +293,7 @@
293 serial1: serial@4600 { 293 serial1: serial@4600 {
294 cell-index = <1>; 294 cell-index = <1>;
295 device_type = "serial"; 295 device_type = "serial";
296 compatible = "ns16550"; 296 compatible = "fsl,ns16550", "ns16550";
297 reg = <0x4600 0x100>; 297 reg = <0x4600 0x100>;
298 clock-frequency = <0>; // from bootloader 298 clock-frequency = <0>; // from bootloader
299 interrupts = <10 0x8>; 299 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
index eb732115f016..6cd044d8fb89 100644
--- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
@@ -189,7 +189,7 @@
189 serial0: serial@4500 { 189 serial0: serial@4500 {
190 cell-index = <0>; 190 cell-index = <0>;
191 device_type = "serial"; 191 device_type = "serial";
192 compatible = "ns16550"; 192 compatible = "fsl,ns16550", "ns16550";
193 reg = <0x4500 0x100>; 193 reg = <0x4500 0x100>;
194 clock-frequency = <0>; // from bootloader 194 clock-frequency = <0>; // from bootloader
195 interrupts = <9 0x8>; 195 interrupts = <9 0x8>;
@@ -199,7 +199,7 @@
199 serial1: serial@4600 { 199 serial1: serial@4600 {
200 cell-index = <1>; 200 cell-index = <1>;
201 device_type = "serial"; 201 device_type = "serial";
202 compatible = "ns16550"; 202 compatible = "fsl,ns16550", "ns16550";
203 reg = <0x4600 0x100>; 203 reg = <0x4600 0x100>;
204 clock-frequency = <0>; // from bootloader 204 clock-frequency = <0>; // from bootloader
205 interrupts = <10 0x8>; 205 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index 230febb9b72f..4552864082c2 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -242,7 +242,7 @@
242 serial0: serial@4500 { 242 serial0: serial@4500 {
243 cell-index = <0>; 243 cell-index = <0>;
244 device_type = "serial"; 244 device_type = "serial";
245 compatible = "ns16550"; 245 compatible = "fsl,ns16550", "ns16550";
246 reg = <0x4500 0x100>; 246 reg = <0x4500 0x100>;
247 clock-frequency = <0>; 247 clock-frequency = <0>;
248 interrupts = <9 0x8>; 248 interrupts = <9 0x8>;
@@ -252,7 +252,7 @@
252 serial1: serial@4600 { 252 serial1: serial@4600 {
253 cell-index = <1>; 253 cell-index = <1>;
254 device_type = "serial"; 254 device_type = "serial";
255 compatible = "ns16550"; 255 compatible = "fsl,ns16550", "ns16550";
256 reg = <0x4600 0x100>; 256 reg = <0x4600 0x100>;
257 clock-frequency = <0>; 257 clock-frequency = <0>;
258 interrupts = <10 0x8>; 258 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 45cfa1c50a2a..c0e450a551bf 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -136,7 +136,7 @@
136 serial0: serial@4500 { 136 serial0: serial@4500 {
137 cell-index = <0>; 137 cell-index = <0>;
138 device_type = "serial"; 138 device_type = "serial";
139 compatible = "ns16550"; 139 compatible = "fsl,ns16550", "ns16550";
140 reg = <0x4500 0x100>; 140 reg = <0x4500 0x100>;
141 clock-frequency = <264000000>; 141 clock-frequency = <264000000>;
142 interrupts = <9 0x8>; 142 interrupts = <9 0x8>;
@@ -146,7 +146,7 @@
146 serial1: serial@4600 { 146 serial1: serial@4600 {
147 cell-index = <1>; 147 cell-index = <1>;
148 device_type = "serial"; 148 device_type = "serial";
149 compatible = "ns16550"; 149 compatible = "fsl,ns16550", "ns16550";
150 reg = <0x4600 0x100>; 150 reg = <0x4600 0x100>;
151 clock-frequency = <264000000>; 151 clock-frequency = <264000000>;
152 interrupts = <10 0x8>; 152 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index bdf4459677b1..b6e9aec1d860 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -102,7 +102,7 @@
102 102
103 serial0: serial@4500 { 103 serial0: serial@4500 {
104 device_type = "serial"; 104 device_type = "serial";
105 compatible = "ns16550"; 105 compatible = "fsl,ns16550", "ns16550";
106 reg = <0x4500 0x100>; 106 reg = <0x4500 0x100>;
107 interrupts = <9 8>; 107 interrupts = <9 8>;
108 interrupt-parent = <&ipic>; 108 interrupt-parent = <&ipic>;
@@ -112,7 +112,7 @@
112 112
113 serial1: serial@4600 { 113 serial1: serial@4600 {
114 device_type = "serial"; 114 device_type = "serial";
115 compatible = "ns16550"; 115 compatible = "fsl,ns16550", "ns16550";
116 reg = <0x4600 0x100>; 116 reg = <0x4600 0x100>;
117 interrupts = <10 8>; 117 interrupts = <10 8>;
118 interrupt-parent = <&ipic>; 118 interrupt-parent = <&ipic>;
diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
index 855782c5e5ec..cfccef57cd1d 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -276,7 +276,7 @@
276 serial0: serial@4500 { 276 serial0: serial@4500 {
277 cell-index = <0>; 277 cell-index = <0>;
278 device_type = "serial"; 278 device_type = "serial";
279 compatible = "ns16550"; 279 compatible = "fsl,ns16550", "ns16550";
280 reg = <0x4500 0x100>; 280 reg = <0x4500 0x100>;
281 clock-frequency = <0>; 281 clock-frequency = <0>;
282 interrupts = <9 0x8>; 282 interrupts = <9 0x8>;
@@ -286,7 +286,7 @@
286 serial1: serial@4600 { 286 serial1: serial@4600 {
287 cell-index = <1>; 287 cell-index = <1>;
288 device_type = "serial"; 288 device_type = "serial";
289 compatible = "ns16550"; 289 compatible = "fsl,ns16550", "ns16550";
290 reg = <0x4600 0x100>; 290 reg = <0x4600 0x100>;
291 clock-frequency = <0>; 291 clock-frequency = <0>;
292 interrupts = <10 0x8>; 292 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts b/arch/powerpc/boot/dts/mpc8377_rdb.dts
index dbc1b988b29d..353deff1b7f6 100644
--- a/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -321,7 +321,7 @@
321 serial0: serial@4500 { 321 serial0: serial@4500 {
322 cell-index = <0>; 322 cell-index = <0>;
323 device_type = "serial"; 323 device_type = "serial";
324 compatible = "ns16550"; 324 compatible = "fsl,ns16550", "ns16550";
325 reg = <0x4500 0x100>; 325 reg = <0x4500 0x100>;
326 clock-frequency = <0>; 326 clock-frequency = <0>;
327 interrupts = <9 0x8>; 327 interrupts = <9 0x8>;
@@ -331,7 +331,7 @@
331 serial1: serial@4600 { 331 serial1: serial@4600 {
332 cell-index = <1>; 332 cell-index = <1>;
333 device_type = "serial"; 333 device_type = "serial";
334 compatible = "ns16550"; 334 compatible = "fsl,ns16550", "ns16550";
335 reg = <0x4600 0x100>; 335 reg = <0x4600 0x100>;
336 clock-frequency = <0>; 336 clock-frequency = <0>;
337 interrupts = <10 0x8>; 337 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8377_wlan.dts b/arch/powerpc/boot/dts/mpc8377_wlan.dts
index 9ea783056969..ef4a305a0d0c 100644
--- a/arch/powerpc/boot/dts/mpc8377_wlan.dts
+++ b/arch/powerpc/boot/dts/mpc8377_wlan.dts
@@ -304,7 +304,7 @@
304 serial0: serial@4500 { 304 serial0: serial@4500 {
305 cell-index = <0>; 305 cell-index = <0>;
306 device_type = "serial"; 306 device_type = "serial";
307 compatible = "ns16550"; 307 compatible = "fsl,ns16550", "ns16550";
308 reg = <0x4500 0x100>; 308 reg = <0x4500 0x100>;
309 clock-frequency = <0>; 309 clock-frequency = <0>;
310 interrupts = <9 0x8>; 310 interrupts = <9 0x8>;
@@ -314,7 +314,7 @@
314 serial1: serial@4600 { 314 serial1: serial@4600 {
315 cell-index = <1>; 315 cell-index = <1>;
316 device_type = "serial"; 316 device_type = "serial";
317 compatible = "ns16550"; 317 compatible = "fsl,ns16550", "ns16550";
318 reg = <0x4600 0x100>; 318 reg = <0x4600 0x100>;
319 clock-frequency = <0>; 319 clock-frequency = <0>;
320 interrupts = <10 0x8>; 320 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8378_mds.dts b/arch/powerpc/boot/dts/mpc8378_mds.dts
index f70cf6000839..538fcb927337 100644
--- a/arch/powerpc/boot/dts/mpc8378_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8378_mds.dts
@@ -315,7 +315,7 @@
315 serial0: serial@4500 { 315 serial0: serial@4500 {
316 cell-index = <0>; 316 cell-index = <0>;
317 device_type = "serial"; 317 device_type = "serial";
318 compatible = "ns16550"; 318 compatible = "fsl,ns16550", "ns16550";
319 reg = <0x4500 0x100>; 319 reg = <0x4500 0x100>;
320 clock-frequency = <0>; 320 clock-frequency = <0>;
321 interrupts = <9 0x8>; 321 interrupts = <9 0x8>;
@@ -325,7 +325,7 @@
325 serial1: serial@4600 { 325 serial1: serial@4600 {
326 cell-index = <1>; 326 cell-index = <1>;
327 device_type = "serial"; 327 device_type = "serial";
328 compatible = "ns16550"; 328 compatible = "fsl,ns16550", "ns16550";
329 reg = <0x4600 0x100>; 329 reg = <0x4600 0x100>;
330 clock-frequency = <0>; 330 clock-frequency = <0>;
331 interrupts = <10 0x8>; 331 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts b/arch/powerpc/boot/dts/mpc8378_rdb.dts
index 3447eb9f6e88..32333a908f3d 100644
--- a/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -321,7 +321,7 @@
321 serial0: serial@4500 { 321 serial0: serial@4500 {
322 cell-index = <0>; 322 cell-index = <0>;
323 device_type = "serial"; 323 device_type = "serial";
324 compatible = "ns16550"; 324 compatible = "fsl,ns16550", "ns16550";
325 reg = <0x4500 0x100>; 325 reg = <0x4500 0x100>;
326 clock-frequency = <0>; 326 clock-frequency = <0>;
327 interrupts = <9 0x8>; 327 interrupts = <9 0x8>;
@@ -331,7 +331,7 @@
331 serial1: serial@4600 { 331 serial1: serial@4600 {
332 cell-index = <1>; 332 cell-index = <1>;
333 device_type = "serial"; 333 device_type = "serial";
334 compatible = "ns16550"; 334 compatible = "fsl,ns16550", "ns16550";
335 reg = <0x4600 0x100>; 335 reg = <0x4600 0x100>;
336 clock-frequency = <0>; 336 clock-frequency = <0>;
337 interrupts = <10 0x8>; 337 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts b/arch/powerpc/boot/dts/mpc8379_mds.dts
index 645ec51cc6e1..5387092fdfb4 100644
--- a/arch/powerpc/boot/dts/mpc8379_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8379_mds.dts
@@ -313,7 +313,7 @@
313 serial0: serial@4500 { 313 serial0: serial@4500 {
314 cell-index = <0>; 314 cell-index = <0>;
315 device_type = "serial"; 315 device_type = "serial";
316 compatible = "ns16550"; 316 compatible = "fsl,ns16550", "ns16550";
317 reg = <0x4500 0x100>; 317 reg = <0x4500 0x100>;
318 clock-frequency = <0>; 318 clock-frequency = <0>;
319 interrupts = <9 0x8>; 319 interrupts = <9 0x8>;
@@ -323,7 +323,7 @@
323 serial1: serial@4600 { 323 serial1: serial@4600 {
324 cell-index = <1>; 324 cell-index = <1>;
325 device_type = "serial"; 325 device_type = "serial";
326 compatible = "ns16550"; 326 compatible = "fsl,ns16550", "ns16550";
327 reg = <0x4600 0x100>; 327 reg = <0x4600 0x100>;
328 clock-frequency = <0>; 328 clock-frequency = <0>;
329 interrupts = <10 0x8>; 329 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts b/arch/powerpc/boot/dts/mpc8379_rdb.dts
index 15560c619b04..46224c2430ff 100644
--- a/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -319,7 +319,7 @@
319 serial0: serial@4500 { 319 serial0: serial@4500 {
320 cell-index = <0>; 320 cell-index = <0>;
321 device_type = "serial"; 321 device_type = "serial";
322 compatible = "ns16550"; 322 compatible = "fsl,ns16550", "ns16550";
323 reg = <0x4500 0x100>; 323 reg = <0x4500 0x100>;
324 clock-frequency = <0>; 324 clock-frequency = <0>;
325 interrupts = <9 0x8>; 325 interrupts = <9 0x8>;
@@ -329,7 +329,7 @@
329 serial1: serial@4600 { 329 serial1: serial@4600 {
330 cell-index = <1>; 330 cell-index = <1>;
331 device_type = "serial"; 331 device_type = "serial";
332 compatible = "ns16550"; 332 compatible = "fsl,ns16550", "ns16550";
333 reg = <0x4600 0x100>; 333 reg = <0x4600 0x100>;
334 clock-frequency = <0>; 334 clock-frequency = <0>;
335 interrupts = <10 0x8>; 335 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts b/arch/powerpc/boot/dts/mpc8536ds.dts
index a75c10eed269..c15881574fdc 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds.dts
@@ -9,24 +9,11 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8536si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "fsl,mpc8536ds"; 15 model = "fsl,mpc8536ds";
16 compatible = "fsl,mpc8536ds"; 16 compatible = "fsl,mpc8536ds";
17 #address-cells = <2>;
18 #size-cells = <2>;
19
20 aliases {
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 serial0 = &serial0;
24 serial1 = &serial1;
25 pci0 = &pci0;
26 pci1 = &pci1;
27 pci2 = &pci2;
28 pci3 = &pci3;
29 };
30 17
31 cpus { 18 cpus {
32 #cpus = <1>; 19 #cpus = <1>;
@@ -45,403 +32,34 @@
45 reg = <0 0 0 0>; // Filled by U-Boot 32 reg = <0 0 0 0>; // Filled by U-Boot
46 }; 33 };
47 34
48 soc@ffe00000 { 35 lbc: localbus@ffe05000 {
49 #address-cells = <1>; 36 reg = <0 0xffe05000 0 0x1000>;
50 #size-cells = <1>; 37 };
51 device_type = "soc";
52 compatible = "simple-bus";
53 ranges = <0x0 0 0xffe00000 0x100000>;
54 bus-frequency = <0>; // Filled out by uboot.
55
56 ecm-law@0 {
57 compatible = "fsl,ecm-law";
58 reg = <0x0 0x1000>;
59 fsl,num-laws = <12>;
60 };
61
62 ecm@1000 {
63 compatible = "fsl,mpc8536-ecm", "fsl,ecm";
64 reg = <0x1000 0x1000>;
65 interrupts = <17 2>;
66 interrupt-parent = <&mpic>;
67 };
68
69 memory-controller@2000 {
70 compatible = "fsl,mpc8536-memory-controller";
71 reg = <0x2000 0x1000>;
72 interrupt-parent = <&mpic>;
73 interrupts = <18 0x2>;
74 };
75
76 L2: l2-cache-controller@20000 {
77 compatible = "fsl,mpc8536-l2-cache-controller";
78 reg = <0x20000 0x1000>;
79 interrupt-parent = <&mpic>;
80 interrupts = <16 0x2>;
81 };
82
83 i2c@3000 {
84 #address-cells = <1>;
85 #size-cells = <0>;
86 cell-index = <0>;
87 compatible = "fsl-i2c";
88 reg = <0x3000 0x100>;
89 interrupts = <43 0x2>;
90 interrupt-parent = <&mpic>;
91 dfsrr;
92 };
93
94 i2c@3100 {
95 #address-cells = <1>;
96 #size-cells = <0>;
97 cell-index = <1>;
98 compatible = "fsl-i2c";
99 reg = <0x3100 0x100>;
100 interrupts = <43 0x2>;
101 interrupt-parent = <&mpic>;
102 dfsrr;
103 rtc@68 {
104 compatible = "dallas,ds3232";
105 reg = <0x68>;
106 interrupts = <0 0x1>;
107 interrupt-parent = <&mpic>;
108 };
109 };
110
111 spi@7000 {
112 #address-cells = <1>;
113 #size-cells = <0>;
114 compatible = "fsl,mpc8536-espi";
115 reg = <0x7000 0x1000>;
116 interrupts = <59 0x2>;
117 interrupt-parent = <&mpic>;
118 fsl,espi-num-chipselects = <4>;
119
120 flash@0 {
121 #address-cells = <1>;
122 #size-cells = <1>;
123 compatible = "spansion,s25sl12801";
124 reg = <0>;
125 spi-max-frequency = <40000000>;
126 partition@u-boot {
127 label = "u-boot";
128 reg = <0x00000000 0x00100000>;
129 read-only;
130 };
131 partition@kernel {
132 label = "kernel";
133 reg = <0x00100000 0x00500000>;
134 read-only;
135 };
136 partition@dtb {
137 label = "dtb";
138 reg = <0x00600000 0x00100000>;
139 read-only;
140 };
141 partition@fs {
142 label = "file system";
143 reg = <0x00700000 0x00900000>;
144 };
145 };
146 flash@1 {
147 compatible = "spansion,s25sl12801";
148 reg = <1>;
149 spi-max-frequency = <40000000>;
150 };
151 flash@2 {
152 compatible = "spansion,s25sl12801";
153 reg = <2>;
154 spi-max-frequency = <40000000>;
155 };
156 flash@3 {
157 compatible = "spansion,s25sl12801";
158 reg = <3>;
159 spi-max-frequency = <40000000>;
160 };
161 };
162
163 dma@21300 {
164 #address-cells = <1>;
165 #size-cells = <1>;
166 compatible = "fsl,mpc8536-dma", "fsl,eloplus-dma";
167 reg = <0x21300 4>;
168 ranges = <0 0x21100 0x200>;
169 cell-index = <0>;
170 dma-channel@0 {
171 compatible = "fsl,mpc8536-dma-channel",
172 "fsl,eloplus-dma-channel";
173 reg = <0x0 0x80>;
174 cell-index = <0>;
175 interrupt-parent = <&mpic>;
176 interrupts = <20 2>;
177 };
178 dma-channel@80 {
179 compatible = "fsl,mpc8536-dma-channel",
180 "fsl,eloplus-dma-channel";
181 reg = <0x80 0x80>;
182 cell-index = <1>;
183 interrupt-parent = <&mpic>;
184 interrupts = <21 2>;
185 };
186 dma-channel@100 {
187 compatible = "fsl,mpc8536-dma-channel",
188 "fsl,eloplus-dma-channel";
189 reg = <0x100 0x80>;
190 cell-index = <2>;
191 interrupt-parent = <&mpic>;
192 interrupts = <22 2>;
193 };
194 dma-channel@180 {
195 compatible = "fsl,mpc8536-dma-channel",
196 "fsl,eloplus-dma-channel";
197 reg = <0x180 0x80>;
198 cell-index = <3>;
199 interrupt-parent = <&mpic>;
200 interrupts = <23 2>;
201 };
202 };
203
204 usb@22000 {
205 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
206 reg = <0x22000 0x1000>;
207 #address-cells = <1>;
208 #size-cells = <0>;
209 interrupt-parent = <&mpic>;
210 interrupts = <28 0x2>;
211 phy_type = "ulpi";
212 };
213
214 usb@23000 {
215 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
216 reg = <0x23000 0x1000>;
217 #address-cells = <1>;
218 #size-cells = <0>;
219 interrupt-parent = <&mpic>;
220 interrupts = <46 0x2>;
221 phy_type = "ulpi";
222 };
223
224 enet0: ethernet@24000 {
225 #address-cells = <1>;
226 #size-cells = <1>;
227 cell-index = <0>;
228 device_type = "network";
229 model = "eTSEC";
230 compatible = "gianfar";
231 reg = <0x24000 0x1000>;
232 ranges = <0x0 0x24000 0x1000>;
233 local-mac-address = [ 00 00 00 00 00 00 ];
234 interrupts = <29 2 30 2 34 2>;
235 interrupt-parent = <&mpic>;
236 tbi-handle = <&tbi0>;
237 phy-handle = <&phy1>;
238 phy-connection-type = "rgmii-id";
239
240 mdio@520 {
241 #address-cells = <1>;
242 #size-cells = <0>;
243 compatible = "fsl,gianfar-mdio";
244 reg = <0x520 0x20>;
245
246 phy0: ethernet-phy@0 {
247 interrupt-parent = <&mpic>;
248 interrupts = <10 0x1>;
249 reg = <0>;
250 device_type = "ethernet-phy";
251 };
252 phy1: ethernet-phy@1 {
253 interrupt-parent = <&mpic>;
254 interrupts = <10 0x1>;
255 reg = <1>;
256 device_type = "ethernet-phy";
257 };
258 tbi0: tbi-phy@11 {
259 reg = <0x11>;
260 device_type = "tbi-phy";
261 };
262 };
263 };
264
265 enet1: ethernet@26000 {
266 #address-cells = <1>;
267 #size-cells = <1>;
268 cell-index = <1>;
269 device_type = "network";
270 model = "eTSEC";
271 compatible = "gianfar";
272 reg = <0x26000 0x1000>;
273 ranges = <0x0 0x26000 0x1000>;
274 local-mac-address = [ 00 00 00 00 00 00 ];
275 interrupts = <31 2 32 2 33 2>;
276 interrupt-parent = <&mpic>;
277 tbi-handle = <&tbi1>;
278 phy-handle = <&phy0>;
279 phy-connection-type = "rgmii-id";
280
281 mdio@520 {
282 #address-cells = <1>;
283 #size-cells = <0>;
284 compatible = "fsl,gianfar-tbi";
285 reg = <0x520 0x20>;
286
287 tbi1: tbi-phy@11 {
288 reg = <0x11>;
289 device_type = "tbi-phy";
290 };
291 };
292 };
293
294 usb@2b000 {
295 compatible = "fsl,mpc8536-usb2-dr", "fsl-usb2-dr";
296 reg = <0x2b000 0x1000>;
297 #address-cells = <1>;
298 #size-cells = <0>;
299 interrupt-parent = <&mpic>;
300 interrupts = <60 0x2>;
301 dr_mode = "peripheral";
302 phy_type = "ulpi";
303 };
304
305 sdhci@2e000 {
306 compatible = "fsl,mpc8536-esdhc", "fsl,esdhc";
307 reg = <0x2e000 0x1000>;
308 interrupts = <72 0x2>;
309 interrupt-parent = <&mpic>;
310 clock-frequency = <250000000>;
311 };
312
313 serial0: serial@4500 {
314 cell-index = <0>;
315 device_type = "serial";
316 compatible = "ns16550";
317 reg = <0x4500 0x100>;
318 clock-frequency = <0>;
319 interrupts = <42 0x2>;
320 interrupt-parent = <&mpic>;
321 };
322
323 serial1: serial@4600 {
324 cell-index = <1>;
325 device_type = "serial";
326 compatible = "ns16550";
327 reg = <0x4600 0x100>;
328 clock-frequency = <0>;
329 interrupts = <42 0x2>;
330 interrupt-parent = <&mpic>;
331 };
332
333 crypto@30000 {
334 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
335 "fsl,sec2.1", "fsl,sec2.0";
336 reg = <0x30000 0x10000>;
337 interrupts = <45 2 58 2>;
338 interrupt-parent = <&mpic>;
339 fsl,num-channels = <4>;
340 fsl,channel-fifo-len = <24>;
341 fsl,exec-units-mask = <0x9fe>;
342 fsl,descriptor-types-mask = <0x3ab0ebf>;
343 };
344
345 sata@18000 {
346 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
347 reg = <0x18000 0x1000>;
348 cell-index = <1>;
349 interrupts = <74 0x2>;
350 interrupt-parent = <&mpic>;
351 };
352
353 sata@19000 {
354 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
355 reg = <0x19000 0x1000>;
356 cell-index = <2>;
357 interrupts = <41 0x2>;
358 interrupt-parent = <&mpic>;
359 };
360
361 global-utilities@e0000 { //global utilities block
362 compatible = "fsl,mpc8548-guts";
363 reg = <0xe0000 0x1000>;
364 fsl,has-rstcr;
365 };
366
367 mpic: pic@40000 {
368 clock-frequency = <0>;
369 interrupt-controller;
370 #address-cells = <0>;
371 #interrupt-cells = <2>;
372 reg = <0x40000 0x40000>;
373 compatible = "chrp,open-pic";
374 device_type = "open-pic";
375 big-endian;
376 };
377 38
378 msi@41600 { 39 board_soc: soc: soc@ffe00000 {
379 compatible = "fsl,mpc8536-msi", "fsl,mpic-msi"; 40 ranges = <0x0 0 0xffe00000 0x100000>;
380 reg = <0x41600 0x80>;
381 msi-available-ranges = <0 0x100>;
382 interrupts = <
383 0xe0 0
384 0xe1 0
385 0xe2 0
386 0xe3 0
387 0xe4 0
388 0xe5 0
389 0xe6 0
390 0xe7 0>;
391 interrupt-parent = <&mpic>;
392 };
393 }; 41 };
394 42
395 pci0: pci@ffe08000 { 43 pci0: pci@ffe08000 {
396 compatible = "fsl,mpc8540-pci"; 44 reg = <0 0xffe08000 0 0x1000>;
397 device_type = "pci"; 45 ranges = <0x02000000 0 0x80000000 0 0x80000000 0 0x10000000
46 0x01000000 0 0x00000000 0 0xffc00000 0 0x00010000>;
47 clock-frequency = <66666666>;
398 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 48 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
399 interrupt-map = < 49 interrupt-map = <
400 50
401 /* IDSEL 0x11 J17 Slot 1 */ 51 /* IDSEL 0x11 J17 Slot 1 */
402 0x8800 0 0 1 &mpic 1 1 52 0x8800 0 0 1 &mpic 1 1 0 0
403 0x8800 0 0 2 &mpic 2 1 53 0x8800 0 0 2 &mpic 2 1 0 0
404 0x8800 0 0 3 &mpic 3 1 54 0x8800 0 0 3 &mpic 3 1 0 0
405 0x8800 0 0 4 &mpic 4 1>; 55 0x8800 0 0 4 &mpic 4 1 0 0>;
406
407 interrupt-parent = <&mpic>;
408 interrupts = <24 0x2>;
409 bus-range = <0 0xff>;
410 ranges = <0x02000000 0 0x80000000 0 0x80000000 0 0x10000000
411 0x01000000 0 0x00000000 0 0xffc00000 0 0x00010000>;
412 clock-frequency = <66666666>;
413 #interrupt-cells = <1>;
414 #size-cells = <2>;
415 #address-cells = <3>;
416 reg = <0 0xffe08000 0 0x1000>;
417 }; 56 };
418 57
419 pci1: pcie@ffe09000 { 58 pci1: pcie@ffe09000 {
420 compatible = "fsl,mpc8548-pcie";
421 device_type = "pci";
422 #interrupt-cells = <1>;
423 #size-cells = <2>;
424 #address-cells = <3>;
425 reg = <0 0xffe09000 0 0x1000>; 59 reg = <0 0xffe09000 0 0x1000>;
426 bus-range = <0 0xff>;
427 ranges = <0x02000000 0 0x98000000 0 0x98000000 0 0x08000000 60 ranges = <0x02000000 0 0x98000000 0 0x98000000 0 0x08000000
428 0x01000000 0 0x00000000 0 0xffc20000 0 0x00010000>; 61 0x01000000 0 0x00000000 0 0xffc20000 0 0x00010000>;
429 clock-frequency = <33333333>;
430 interrupt-parent = <&mpic>;
431 interrupts = <25 0x2>;
432 interrupt-map-mask = <0xf800 0 0 7>;
433 interrupt-map = <
434 /* IDSEL 0x0 */
435 0000 0 0 1 &mpic 4 1
436 0000 0 0 2 &mpic 5 1
437 0000 0 0 3 &mpic 6 1
438 0000 0 0 4 &mpic 7 1
439 >;
440 pcie@0 { 62 pcie@0 {
441 reg = <0 0 0 0 0>;
442 #size-cells = <2>;
443 #address-cells = <3>;
444 device_type = "pci";
445 ranges = <0x02000000 0 0x98000000 63 ranges = <0x02000000 0 0x98000000
446 0x02000000 0 0x98000000 64 0x02000000 0 0x98000000
447 0 0x08000000 65 0 0x08000000
@@ -453,31 +71,10 @@
453 }; 71 };
454 72
455 pci2: pcie@ffe0a000 { 73 pci2: pcie@ffe0a000 {
456 compatible = "fsl,mpc8548-pcie";
457 device_type = "pci";
458 #interrupt-cells = <1>;
459 #size-cells = <2>;
460 #address-cells = <3>;
461 reg = <0 0xffe0a000 0 0x1000>; 74 reg = <0 0xffe0a000 0 0x1000>;
462 bus-range = <0 0xff>;
463 ranges = <0x02000000 0 0x90000000 0 0x90000000 0 0x08000000 75 ranges = <0x02000000 0 0x90000000 0 0x90000000 0 0x08000000
464 0x01000000 0 0x00000000 0 0xffc10000 0 0x00010000>; 76 0x01000000 0 0x00000000 0 0xffc10000 0 0x00010000>;
465 clock-frequency = <33333333>;
466 interrupt-parent = <&mpic>;
467 interrupts = <26 0x2>;
468 interrupt-map-mask = <0xf800 0 0 7>;
469 interrupt-map = <
470 /* IDSEL 0x0 */
471 0000 0 0 1 &mpic 0 1
472 0000 0 0 2 &mpic 1 1
473 0000 0 0 3 &mpic 2 1
474 0000 0 0 4 &mpic 3 1
475 >;
476 pcie@0 { 77 pcie@0 {
477 reg = <0 0 0 0 0>;
478 #size-cells = <2>;
479 #address-cells = <3>;
480 device_type = "pci";
481 ranges = <0x02000000 0 0x90000000 78 ranges = <0x02000000 0 0x90000000
482 0x02000000 0 0x90000000 79 0x02000000 0 0x90000000
483 0 0x08000000 80 0 0x08000000
@@ -489,32 +86,10 @@
489 }; 86 };
490 87
491 pci3: pcie@ffe0b000 { 88 pci3: pcie@ffe0b000 {
492 compatible = "fsl,mpc8548-pcie";
493 device_type = "pci";
494 #interrupt-cells = <1>;
495 #size-cells = <2>;
496 #address-cells = <3>;
497 reg = <0 0xffe0b000 0 0x1000>; 89 reg = <0 0xffe0b000 0 0x1000>;
498 bus-range = <0 0xff>;
499 ranges = <0x02000000 0 0xa0000000 0 0xa0000000 0 0x20000000 90 ranges = <0x02000000 0 0xa0000000 0 0xa0000000 0 0x20000000
500 0x01000000 0 0x00000000 0 0xffc30000 0 0x00010000>; 91 0x01000000 0 0x00000000 0 0xffc30000 0 0x00010000>;
501 clock-frequency = <33333333>;
502 interrupt-parent = <&mpic>;
503 interrupts = <27 0x2>;
504 interrupt-map-mask = <0xf800 0 0 7>;
505 interrupt-map = <
506 /* IDSEL 0x0 */
507 0000 0 0 1 &mpic 8 1
508 0000 0 0 2 &mpic 9 1
509 0000 0 0 3 &mpic 10 1
510 0000 0 0 4 &mpic 11 1
511 >;
512
513 pcie@0 { 92 pcie@0 {
514 reg = <0 0 0 0 0>;
515 #size-cells = <2>;
516 #address-cells = <3>;
517 device_type = "pci";
518 ranges = <0x02000000 0 0xa0000000 93 ranges = <0x02000000 0 0xa0000000
519 0x02000000 0 0xa0000000 94 0x02000000 0 0xa0000000
520 0 0x20000000 95 0 0x20000000
@@ -525,3 +100,6 @@
525 }; 100 };
526 }; 101 };
527}; 102};
103
104/include/ "fsl/mpc8536si-post.dtsi"
105/include/ "mpc8536ds.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dtsi b/arch/powerpc/boot/dts/mpc8536ds.dtsi
new file mode 100644
index 000000000000..1462e4cf49d7
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8536ds.dtsi
@@ -0,0 +1,141 @@
1/*
2 * MPC8536DS Device Tree Source stub (no addresses or top-level ranges)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&board_soc {
36 i2c@3100 {
37 rtc@68 {
38 compatible = "dallas,ds3232";
39 reg = <0x68>;
40 interrupts = <0 0x1 0 0>;
41 };
42 };
43
44 spi@7000 {
45 flash@0 {
46 #address-cells = <1>;
47 #size-cells = <1>;
48 compatible = "spansion,s25sl12801";
49 reg = <0>;
50 spi-max-frequency = <40000000>;
51 partition@u-boot {
52 label = "u-boot";
53 reg = <0x00000000 0x00100000>;
54 read-only;
55 };
56 partition@kernel {
57 label = "kernel";
58 reg = <0x00100000 0x00500000>;
59 read-only;
60 };
61 partition@dtb {
62 label = "dtb";
63 reg = <0x00600000 0x00100000>;
64 read-only;
65 };
66 partition@fs {
67 label = "file system";
68 reg = <0x00700000 0x00900000>;
69 };
70 };
71 flash@1 {
72 compatible = "spansion,s25sl12801";
73 reg = <1>;
74 spi-max-frequency = <40000000>;
75 };
76 flash@2 {
77 compatible = "spansion,s25sl12801";
78 reg = <2>;
79 spi-max-frequency = <40000000>;
80 };
81 flash@3 {
82 compatible = "spansion,s25sl12801";
83 reg = <3>;
84 spi-max-frequency = <40000000>;
85 };
86 };
87
88 usb@22000 {
89 phy_type = "ulpi";
90 };
91
92 usb@23000 {
93 phy_type = "ulpi";
94 };
95
96 enet0: ethernet@24000 {
97 tbi-handle = <&tbi0>;
98 phy-handle = <&phy1>;
99 phy-connection-type = "rgmii-id";
100 };
101
102 mdio@24520 {
103 phy0: ethernet-phy@0 {
104 interrupts = <10 0x1 0 0>;
105 reg = <0>;
106 device_type = "ethernet-phy";
107 };
108 phy1: ethernet-phy@1 {
109 interrupts = <10 0x1 0 0>;
110 reg = <1>;
111 device_type = "ethernet-phy";
112 };
113 tbi0: tbi-phy@11 {
114 reg = <0x11>;
115 device_type = "tbi-phy";
116 };
117 };
118
119 enet2: ethernet@26000 {
120 tbi-handle = <&tbi1>;
121 phy-handle = <&phy0>;
122 phy-connection-type = "rgmii-id";
123 };
124
125 mdio@26520 {
126 #address-cells = <1>;
127 #size-cells = <0>;
128 compatible = "fsl,gianfar-tbi";
129 reg = <0x26520 0x20>;
130
131 tbi1: tbi-phy@11 {
132 reg = <0x11>;
133 device_type = "tbi-phy";
134 };
135 };
136
137 usb@2b000 {
138 dr_mode = "peripheral";
139 phy_type = "ulpi";
140 };
141};
diff --git a/arch/powerpc/boot/dts/mpc8536ds_36b.dts b/arch/powerpc/boot/dts/mpc8536ds_36b.dts
index d95b26021e62..8f4b929b1d1d 100644
--- a/arch/powerpc/boot/dts/mpc8536ds_36b.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds_36b.dts
@@ -1,5 +1,5 @@
1/* 1/*
2 * MPC8536 DS Device Tree Source 2 * MPC8536DS Device Tree Source (36-bit address map)
3 * 3 *
4 * Copyright 2008-2009 Freescale Semiconductor, Inc. 4 * Copyright 2008-2009 Freescale Semiconductor, Inc.
5 * 5 *
@@ -9,24 +9,11 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8536si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "fsl,mpc8536ds"; 15 model = "fsl,mpc8536ds";
16 compatible = "fsl,mpc8536ds"; 16 compatible = "fsl,mpc8536ds";
17 #address-cells = <2>;
18 #size-cells = <2>;
19
20 aliases {
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 serial0 = &serial0;
24 serial1 = &serial1;
25 pci0 = &pci0;
26 pci1 = &pci1;
27 pci2 = &pci2;
28 pci3 = &pci3;
29 };
30 17
31 cpus { 18 cpus {
32 #cpus = <1>; 19 #cpus = <1>;
@@ -45,351 +32,34 @@
45 reg = <0 0 0 0>; // Filled by U-Boot 32 reg = <0 0 0 0>; // Filled by U-Boot
46 }; 33 };
47 34
48 soc@fffe00000 { 35 lbc: localbus@ffe05000 {
49 #address-cells = <1>; 36 reg = <0 0xffe05000 0 0x1000>;
50 #size-cells = <1>; 37 };
51 device_type = "soc";
52 compatible = "simple-bus";
53 ranges = <0x0 0xf 0xffe00000 0x100000>;
54 bus-frequency = <0>; // Filled out by uboot.
55
56 ecm-law@0 {
57 compatible = "fsl,ecm-law";
58 reg = <0x0 0x1000>;
59 fsl,num-laws = <12>;
60 };
61
62 ecm@1000 {
63 compatible = "fsl,mpc8536-ecm", "fsl,ecm";
64 reg = <0x1000 0x1000>;
65 interrupts = <17 2>;
66 interrupt-parent = <&mpic>;
67 };
68
69 memory-controller@2000 {
70 compatible = "fsl,mpc8536-memory-controller";
71 reg = <0x2000 0x1000>;
72 interrupt-parent = <&mpic>;
73 interrupts = <18 0x2>;
74 };
75
76 L2: l2-cache-controller@20000 {
77 compatible = "fsl,mpc8536-l2-cache-controller";
78 reg = <0x20000 0x1000>;
79 interrupt-parent = <&mpic>;
80 interrupts = <16 0x2>;
81 };
82
83 i2c@3000 {
84 #address-cells = <1>;
85 #size-cells = <0>;
86 cell-index = <0>;
87 compatible = "fsl-i2c";
88 reg = <0x3000 0x100>;
89 interrupts = <43 0x2>;
90 interrupt-parent = <&mpic>;
91 dfsrr;
92 };
93
94 i2c@3100 {
95 #address-cells = <1>;
96 #size-cells = <0>;
97 cell-index = <1>;
98 compatible = "fsl-i2c";
99 reg = <0x3100 0x100>;
100 interrupts = <43 0x2>;
101 interrupt-parent = <&mpic>;
102 dfsrr;
103 rtc@68 {
104 compatible = "dallas,ds3232";
105 reg = <0x68>;
106 interrupts = <0 0x1>;
107 interrupt-parent = <&mpic>;
108 };
109 };
110
111 dma@21300 {
112 #address-cells = <1>;
113 #size-cells = <1>;
114 compatible = "fsl,mpc8536-dma", "fsl,eloplus-dma";
115 reg = <0x21300 4>;
116 ranges = <0 0x21100 0x200>;
117 cell-index = <0>;
118 dma-channel@0 {
119 compatible = "fsl,mpc8536-dma-channel",
120 "fsl,eloplus-dma-channel";
121 reg = <0x0 0x80>;
122 cell-index = <0>;
123 interrupt-parent = <&mpic>;
124 interrupts = <20 2>;
125 };
126 dma-channel@80 {
127 compatible = "fsl,mpc8536-dma-channel",
128 "fsl,eloplus-dma-channel";
129 reg = <0x80 0x80>;
130 cell-index = <1>;
131 interrupt-parent = <&mpic>;
132 interrupts = <21 2>;
133 };
134 dma-channel@100 {
135 compatible = "fsl,mpc8536-dma-channel",
136 "fsl,eloplus-dma-channel";
137 reg = <0x100 0x80>;
138 cell-index = <2>;
139 interrupt-parent = <&mpic>;
140 interrupts = <22 2>;
141 };
142 dma-channel@180 {
143 compatible = "fsl,mpc8536-dma-channel",
144 "fsl,eloplus-dma-channel";
145 reg = <0x180 0x80>;
146 cell-index = <3>;
147 interrupt-parent = <&mpic>;
148 interrupts = <23 2>;
149 };
150 };
151
152 usb@22000 {
153 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
154 reg = <0x22000 0x1000>;
155 #address-cells = <1>;
156 #size-cells = <0>;
157 interrupt-parent = <&mpic>;
158 interrupts = <28 0x2>;
159 phy_type = "ulpi";
160 };
161
162 usb@23000 {
163 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
164 reg = <0x23000 0x1000>;
165 #address-cells = <1>;
166 #size-cells = <0>;
167 interrupt-parent = <&mpic>;
168 interrupts = <46 0x2>;
169 phy_type = "ulpi";
170 };
171
172 enet0: ethernet@24000 {
173 #address-cells = <1>;
174 #size-cells = <1>;
175 cell-index = <0>;
176 device_type = "network";
177 model = "eTSEC";
178 compatible = "gianfar";
179 reg = <0x24000 0x1000>;
180 ranges = <0x0 0x24000 0x1000>;
181 local-mac-address = [ 00 00 00 00 00 00 ];
182 interrupts = <29 2 30 2 34 2>;
183 interrupt-parent = <&mpic>;
184 tbi-handle = <&tbi0>;
185 phy-handle = <&phy1>;
186 phy-connection-type = "rgmii-id";
187
188 mdio@520 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 compatible = "fsl,gianfar-mdio";
192 reg = <0x520 0x20>;
193
194 phy0: ethernet-phy@0 {
195 interrupt-parent = <&mpic>;
196 interrupts = <10 0x1>;
197 reg = <0>;
198 device_type = "ethernet-phy";
199 };
200 phy1: ethernet-phy@1 {
201 interrupt-parent = <&mpic>;
202 interrupts = <10 0x1>;
203 reg = <1>;
204 device_type = "ethernet-phy";
205 };
206 tbi0: tbi-phy@11 {
207 reg = <0x11>;
208 device_type = "tbi-phy";
209 };
210 };
211 };
212
213 enet1: ethernet@26000 {
214 #address-cells = <1>;
215 #size-cells = <1>;
216 cell-index = <1>;
217 device_type = "network";
218 model = "eTSEC";
219 compatible = "gianfar";
220 reg = <0x26000 0x1000>;
221 ranges = <0x0 0x26000 0x1000>;
222 local-mac-address = [ 00 00 00 00 00 00 ];
223 interrupts = <31 2 32 2 33 2>;
224 interrupt-parent = <&mpic>;
225 tbi-handle = <&tbi1>;
226 phy-handle = <&phy0>;
227 phy-connection-type = "rgmii-id";
228
229 mdio@520 {
230 #address-cells = <1>;
231 #size-cells = <0>;
232 compatible = "fsl,gianfar-tbi";
233 reg = <0x520 0x20>;
234
235 tbi1: tbi-phy@11 {
236 reg = <0x11>;
237 device_type = "tbi-phy";
238 };
239 };
240 };
241
242 usb@2b000 {
243 compatible = "fsl,mpc8536-usb2-dr", "fsl-usb2-dr";
244 reg = <0x2b000 0x1000>;
245 #address-cells = <1>;
246 #size-cells = <0>;
247 interrupt-parent = <&mpic>;
248 interrupts = <60 0x2>;
249 dr_mode = "peripheral";
250 phy_type = "ulpi";
251 };
252
253 sdhci@2e000 {
254 compatible = "fsl,mpc8536-esdhc", "fsl,esdhc";
255 reg = <0x2e000 0x1000>;
256 interrupts = <72 0x2>;
257 interrupt-parent = <&mpic>;
258 clock-frequency = <250000000>;
259 };
260
261 serial0: serial@4500 {
262 cell-index = <0>;
263 device_type = "serial";
264 compatible = "ns16550";
265 reg = <0x4500 0x100>;
266 clock-frequency = <0>;
267 interrupts = <42 0x2>;
268 interrupt-parent = <&mpic>;
269 };
270
271 serial1: serial@4600 {
272 cell-index = <1>;
273 device_type = "serial";
274 compatible = "ns16550";
275 reg = <0x4600 0x100>;
276 clock-frequency = <0>;
277 interrupts = <42 0x2>;
278 interrupt-parent = <&mpic>;
279 };
280
281 crypto@30000 {
282 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
283 "fsl,sec2.1", "fsl,sec2.0";
284 reg = <0x30000 0x10000>;
285 interrupts = <45 2 58 2>;
286 interrupt-parent = <&mpic>;
287 fsl,num-channels = <4>;
288 fsl,channel-fifo-len = <24>;
289 fsl,exec-units-mask = <0x9fe>;
290 fsl,descriptor-types-mask = <0x3ab0ebf>;
291 };
292
293 sata@18000 {
294 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
295 reg = <0x18000 0x1000>;
296 cell-index = <1>;
297 interrupts = <74 0x2>;
298 interrupt-parent = <&mpic>;
299 };
300
301 sata@19000 {
302 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
303 reg = <0x19000 0x1000>;
304 cell-index = <2>;
305 interrupts = <41 0x2>;
306 interrupt-parent = <&mpic>;
307 };
308
309 global-utilities@e0000 { //global utilities block
310 compatible = "fsl,mpc8548-guts";
311 reg = <0xe0000 0x1000>;
312 fsl,has-rstcr;
313 };
314
315 mpic: pic@40000 {
316 clock-frequency = <0>;
317 interrupt-controller;
318 #address-cells = <0>;
319 #interrupt-cells = <2>;
320 reg = <0x40000 0x40000>;
321 compatible = "chrp,open-pic";
322 device_type = "open-pic";
323 big-endian;
324 };
325 38
326 msi@41600 { 39 board_soc: soc: soc@fffe00000 {
327 compatible = "fsl,mpc8536-msi", "fsl,mpic-msi"; 40 ranges = <0x0 0xf 0xffe00000 0x100000>;
328 reg = <0x41600 0x80>;
329 msi-available-ranges = <0 0x100>;
330 interrupts = <
331 0xe0 0
332 0xe1 0
333 0xe2 0
334 0xe3 0
335 0xe4 0
336 0xe5 0
337 0xe6 0
338 0xe7 0>;
339 interrupt-parent = <&mpic>;
340 };
341 }; 41 };
342 42
343 pci0: pci@fffe08000 { 43 pci0: pci@ffe08000 {
344 compatible = "fsl,mpc8540-pci"; 44 reg = <0xf 0xffe08000 0 0x1000>;
345 device_type = "pci"; 45 ranges = <0x02000000 0 0xf0000000 0xc 0x00000000 0 0x10000000
46 0x01000000 0 0x00000000 0xf 0xffc00000 0 0x00010000>;
47 clock-frequency = <66666666>;
346 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 48 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
347 interrupt-map = < 49 interrupt-map = <
348 50
349 /* IDSEL 0x11 J17 Slot 1 */ 51 /* IDSEL 0x11 J17 Slot 1 */
350 0x8800 0 0 1 &mpic 1 1 52 0x8800 0 0 1 &mpic 1 1 0 0
351 0x8800 0 0 2 &mpic 2 1 53 0x8800 0 0 2 &mpic 2 1 0 0
352 0x8800 0 0 3 &mpic 3 1 54 0x8800 0 0 3 &mpic 3 1 0 0
353 0x8800 0 0 4 &mpic 4 1>; 55 0x8800 0 0 4 &mpic 4 1 0 0>;
354
355 interrupt-parent = <&mpic>;
356 interrupts = <24 0x2>;
357 bus-range = <0 0xff>;
358 ranges = <0x02000000 0 0xf0000000 0xc 0x00000000 0 0x10000000
359 0x01000000 0 0x00000000 0xf 0xffc00000 0 0x00010000>;
360 clock-frequency = <66666666>;
361 #interrupt-cells = <1>;
362 #size-cells = <2>;
363 #address-cells = <3>;
364 reg = <0xf 0xffe08000 0 0x1000>;
365 }; 56 };
366 57
367 pci1: pcie@fffe09000 { 58 pci1: pcie@ffe09000 {
368 compatible = "fsl,mpc8548-pcie";
369 device_type = "pci";
370 #interrupt-cells = <1>;
371 #size-cells = <2>;
372 #address-cells = <3>;
373 reg = <0xf 0xffe09000 0 0x1000>; 59 reg = <0xf 0xffe09000 0 0x1000>;
374 bus-range = <0 0xff>;
375 ranges = <0x02000000 0 0xf8000000 0xc 0x18000000 0 0x08000000 60 ranges = <0x02000000 0 0xf8000000 0xc 0x18000000 0 0x08000000
376 0x01000000 0 0x00000000 0xf 0xffc20000 0 0x00010000>; 61 0x01000000 0 0x00000000 0xf 0xffc20000 0 0x00010000>;
377 clock-frequency = <33333333>;
378 interrupt-parent = <&mpic>;
379 interrupts = <25 0x2>;
380 interrupt-map-mask = <0xf800 0 0 7>;
381 interrupt-map = <
382 /* IDSEL 0x0 */
383 0000 0 0 1 &mpic 4 1
384 0000 0 0 2 &mpic 5 1
385 0000 0 0 3 &mpic 6 1
386 0000 0 0 4 &mpic 7 1
387 >;
388 pcie@0 { 62 pcie@0 {
389 reg = <0 0 0 0 0>;
390 #size-cells = <2>;
391 #address-cells = <3>;
392 device_type = "pci";
393 ranges = <0x02000000 0 0xf8000000 63 ranges = <0x02000000 0 0xf8000000
394 0x02000000 0 0xf8000000 64 0x02000000 0 0xf8000000
395 0 0x08000000 65 0 0x08000000
@@ -401,31 +71,10 @@
401 }; 71 };
402 72
403 pci2: pcie@fffe0a000 { 73 pci2: pcie@fffe0a000 {
404 compatible = "fsl,mpc8548-pcie";
405 device_type = "pci";
406 #interrupt-cells = <1>;
407 #size-cells = <2>;
408 #address-cells = <3>;
409 reg = <0xf 0xffe0a000 0 0x1000>; 74 reg = <0xf 0xffe0a000 0 0x1000>;
410 bus-range = <0 0xff>;
411 ranges = <0x02000000 0 0xf8000000 0xc 0x10000000 0 0x08000000 75 ranges = <0x02000000 0 0xf8000000 0xc 0x10000000 0 0x08000000
412 0x01000000 0 0x00000000 0xf 0xffc10000 0 0x00010000>; 76 0x01000000 0 0x00000000 0xf 0xffc10000 0 0x00010000>;
413 clock-frequency = <33333333>;
414 interrupt-parent = <&mpic>;
415 interrupts = <26 0x2>;
416 interrupt-map-mask = <0xf800 0 0 7>;
417 interrupt-map = <
418 /* IDSEL 0x0 */
419 0000 0 0 1 &mpic 0 1
420 0000 0 0 2 &mpic 1 1
421 0000 0 0 3 &mpic 2 1
422 0000 0 0 4 &mpic 3 1
423 >;
424 pcie@0 { 77 pcie@0 {
425 reg = <0 0 0 0 0>;
426 #size-cells = <2>;
427 #address-cells = <3>;
428 device_type = "pci";
429 ranges = <0x02000000 0 0xf8000000 78 ranges = <0x02000000 0 0xf8000000
430 0x02000000 0 0xf8000000 79 0x02000000 0 0xf8000000
431 0 0x08000000 80 0 0x08000000
@@ -437,32 +86,10 @@
437 }; 86 };
438 87
439 pci3: pcie@fffe0b000 { 88 pci3: pcie@fffe0b000 {
440 compatible = "fsl,mpc8548-pcie";
441 device_type = "pci";
442 #interrupt-cells = <1>;
443 #size-cells = <2>;
444 #address-cells = <3>;
445 reg = <0xf 0xffe0b000 0 0x1000>; 89 reg = <0xf 0xffe0b000 0 0x1000>;
446 bus-range = <0 0xff>;
447 ranges = <0x02000000 0 0xe0000000 0xc 0x20000000 0 0x20000000 90 ranges = <0x02000000 0 0xe0000000 0xc 0x20000000 0 0x20000000
448 0x01000000 0 0x00000000 0xf 0xffc30000 0 0x00010000>; 91 0x01000000 0 0x00000000 0xf 0xffc30000 0 0x00010000>;
449 clock-frequency = <33333333>;
450 interrupt-parent = <&mpic>;
451 interrupts = <27 0x2>;
452 interrupt-map-mask = <0xf800 0 0 7>;
453 interrupt-map = <
454 /* IDSEL 0x0 */
455 0000 0 0 1 &mpic 8 1
456 0000 0 0 2 &mpic 9 1
457 0000 0 0 3 &mpic 10 1
458 0000 0 0 4 &mpic 11 1
459 >;
460
461 pcie@0 { 92 pcie@0 {
462 reg = <0 0 0 0 0>;
463 #size-cells = <2>;
464 #address-cells = <3>;
465 device_type = "pci";
466 ranges = <0x02000000 0 0xe0000000 93 ranges = <0x02000000 0 0xe0000000
467 0x02000000 0 0xe0000000 94 0x02000000 0 0xe0000000
468 0 0x20000000 95 0 0x20000000
@@ -473,3 +100,6 @@
473 }; 100 };
474 }; 101 };
475}; 102};
103
104/include/ "fsl/mpc8536si-post.dtsi"
105/include/ "mpc8536ds.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index 8d1bf0fd9268..f99fb110c97f 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -243,7 +243,7 @@
243 serial0: serial@4500 { 243 serial0: serial@4500 {
244 cell-index = <0>; 244 cell-index = <0>;
245 device_type = "serial"; 245 device_type = "serial";
246 compatible = "ns16550"; 246 compatible = "fsl,ns16550", "ns16550";
247 reg = <0x4500 0x100>; // reg base, size 247 reg = <0x4500 0x100>; // reg base, size
248 clock-frequency = <0>; // should we fill in in uboot? 248 clock-frequency = <0>; // should we fill in in uboot?
249 interrupts = <42 2>; 249 interrupts = <42 2>;
@@ -253,7 +253,7 @@
253 serial1: serial@4600 { 253 serial1: serial@4600 {
254 cell-index = <1>; 254 cell-index = <1>;
255 device_type = "serial"; 255 device_type = "serial";
256 compatible = "ns16550"; 256 compatible = "fsl,ns16550", "ns16550";
257 reg = <0x4600 0x100>; // reg base, size 257 reg = <0x4600 0x100>; // reg base, size
258 clock-frequency = <0>; // should we fill in in uboot? 258 clock-frequency = <0>; // should we fill in in uboot?
259 interrupts = <42 2>; 259 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index 87ff96549fac..0f5e93912799 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -209,7 +209,7 @@
209 serial0: serial@4500 { 209 serial0: serial@4500 {
210 cell-index = <0>; 210 cell-index = <0>;
211 device_type = "serial"; 211 device_type = "serial";
212 compatible = "ns16550"; 212 compatible = "fsl,ns16550", "ns16550";
213 reg = <0x4500 0x100>; // reg base, size 213 reg = <0x4500 0x100>; // reg base, size
214 clock-frequency = <0>; // should we fill in in uboot? 214 clock-frequency = <0>; // should we fill in in uboot?
215 interrupts = <42 2>; 215 interrupts = <42 2>;
@@ -219,7 +219,7 @@
219 serial1: serial@4600 { 219 serial1: serial@4600 {
220 cell-index = <1>; 220 cell-index = <1>;
221 device_type = "serial"; 221 device_type = "serial";
222 compatible = "ns16550"; 222 compatible = "fsl,ns16550", "ns16550";
223 reg = <0x4600 0x100>; // reg base, size 223 reg = <0x4600 0x100>; // reg base, size
224 clock-frequency = <0>; // should we fill in in uboot? 224 clock-frequency = <0>; // should we fill in in uboot?
225 interrupts = <42 2>; 225 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index d793968743c9..e934987e882b 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -9,339 +9,52 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8544si-pre.dtsi"
13
13/ { 14/ {
14 model = "MPC8544DS"; 15 model = "MPC8544DS";
15 compatible = "MPC8544DS", "MPC85xxDS"; 16 compatible = "MPC8544DS", "MPC85xxDS";
16 #address-cells = <1>;
17 #size-cells = <1>;
18
19 aliases {
20 ethernet0 = &enet0;
21 ethernet1 = &enet1;
22 serial0 = &serial0;
23 serial1 = &serial1;
24 pci0 = &pci0;
25 pci1 = &pci1;
26 pci2 = &pci2;
27 pci3 = &pci3;
28 };
29
30 cpus {
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 PowerPC,8544@0 {
35 device_type = "cpu";
36 reg = <0x0>;
37 d-cache-line-size = <32>; // 32 bytes
38 i-cache-line-size = <32>; // 32 bytes
39 d-cache-size = <0x8000>; // L1, 32K
40 i-cache-size = <0x8000>; // L1, 32K
41 timebase-frequency = <0>;
42 bus-frequency = <0>;
43 clock-frequency = <0>;
44 next-level-cache = <&L2>;
45 };
46 };
47 17
48 memory { 18 memory {
49 device_type = "memory"; 19 device_type = "memory";
50 reg = <0x0 0x0>; // Filled by U-Boot 20 reg = <0 0 0 0>; // Filled by U-Boot
51 }; 21 };
52 22
53 soc8544@e0000000 { 23 lbc: localbus@e0005000 {
54 #address-cells = <1>; 24 reg = <0 0xe0005000 0 0x1000>;
55 #size-cells = <1>; 25 };
56 device_type = "soc";
57 compatible = "simple-bus";
58
59 ranges = <0x0 0xe0000000 0x100000>;
60 bus-frequency = <0>; // Filled out by uboot.
61
62 ecm-law@0 {
63 compatible = "fsl,ecm-law";
64 reg = <0x0 0x1000>;
65 fsl,num-laws = <10>;
66 };
67
68 ecm@1000 {
69 compatible = "fsl,mpc8544-ecm", "fsl,ecm";
70 reg = <0x1000 0x1000>;
71 interrupts = <17 2>;
72 interrupt-parent = <&mpic>;
73 };
74
75 memory-controller@2000 {
76 compatible = "fsl,mpc8544-memory-controller";
77 reg = <0x2000 0x1000>;
78 interrupt-parent = <&mpic>;
79 interrupts = <18 2>;
80 };
81
82 L2: l2-cache-controller@20000 {
83 compatible = "fsl,mpc8544-l2-cache-controller";
84 reg = <0x20000 0x1000>;
85 cache-line-size = <32>; // 32 bytes
86 cache-size = <0x40000>; // L2, 256K
87 interrupt-parent = <&mpic>;
88 interrupts = <16 2>;
89 };
90
91 i2c@3000 {
92 #address-cells = <1>;
93 #size-cells = <0>;
94 cell-index = <0>;
95 compatible = "fsl-i2c";
96 reg = <0x3000 0x100>;
97 interrupts = <43 2>;
98 interrupt-parent = <&mpic>;
99 dfsrr;
100 };
101
102 i2c@3100 {
103 #address-cells = <1>;
104 #size-cells = <0>;
105 cell-index = <1>;
106 compatible = "fsl-i2c";
107 reg = <0x3100 0x100>;
108 interrupts = <43 2>;
109 interrupt-parent = <&mpic>;
110 dfsrr;
111 };
112
113 dma@21300 {
114 #address-cells = <1>;
115 #size-cells = <1>;
116 compatible = "fsl,mpc8544-dma", "fsl,eloplus-dma";
117 reg = <0x21300 0x4>;
118 ranges = <0x0 0x21100 0x200>;
119 cell-index = <0>;
120 dma-channel@0 {
121 compatible = "fsl,mpc8544-dma-channel",
122 "fsl,eloplus-dma-channel";
123 reg = <0x0 0x80>;
124 cell-index = <0>;
125 interrupt-parent = <&mpic>;
126 interrupts = <20 2>;
127 };
128 dma-channel@80 {
129 compatible = "fsl,mpc8544-dma-channel",
130 "fsl,eloplus-dma-channel";
131 reg = <0x80 0x80>;
132 cell-index = <1>;
133 interrupt-parent = <&mpic>;
134 interrupts = <21 2>;
135 };
136 dma-channel@100 {
137 compatible = "fsl,mpc8544-dma-channel",
138 "fsl,eloplus-dma-channel";
139 reg = <0x100 0x80>;
140 cell-index = <2>;
141 interrupt-parent = <&mpic>;
142 interrupts = <22 2>;
143 };
144 dma-channel@180 {
145 compatible = "fsl,mpc8544-dma-channel",
146 "fsl,eloplus-dma-channel";
147 reg = <0x180 0x80>;
148 cell-index = <3>;
149 interrupt-parent = <&mpic>;
150 interrupts = <23 2>;
151 };
152 };
153
154 enet0: ethernet@24000 {
155 #address-cells = <1>;
156 #size-cells = <1>;
157 cell-index = <0>;
158 device_type = "network";
159 model = "TSEC";
160 compatible = "gianfar";
161 reg = <0x24000 0x1000>;
162 ranges = <0x0 0x24000 0x1000>;
163 local-mac-address = [ 00 00 00 00 00 00 ];
164 interrupts = <29 2 30 2 34 2>;
165 interrupt-parent = <&mpic>;
166 phy-handle = <&phy0>;
167 tbi-handle = <&tbi0>;
168 phy-connection-type = "rgmii-id";
169
170 mdio@520 {
171 #address-cells = <1>;
172 #size-cells = <0>;
173 compatible = "fsl,gianfar-mdio";
174 reg = <0x520 0x20>;
175
176 phy0: ethernet-phy@0 {
177 interrupt-parent = <&mpic>;
178 interrupts = <10 1>;
179 reg = <0x0>;
180 device_type = "ethernet-phy";
181 };
182 phy1: ethernet-phy@1 {
183 interrupt-parent = <&mpic>;
184 interrupts = <10 1>;
185 reg = <0x1>;
186 device_type = "ethernet-phy";
187 };
188
189 tbi0: tbi-phy@11 {
190 reg = <0x11>;
191 device_type = "tbi-phy";
192 };
193 };
194 };
195
196 enet1: ethernet@26000 {
197 #address-cells = <1>;
198 #size-cells = <1>;
199 cell-index = <1>;
200 device_type = "network";
201 model = "TSEC";
202 compatible = "gianfar";
203 reg = <0x26000 0x1000>;
204 ranges = <0x0 0x26000 0x1000>;
205 local-mac-address = [ 00 00 00 00 00 00 ];
206 interrupts = <31 2 32 2 33 2>;
207 interrupt-parent = <&mpic>;
208 phy-handle = <&phy1>;
209 tbi-handle = <&tbi1>;
210 phy-connection-type = "rgmii-id";
211
212 mdio@520 {
213 #address-cells = <1>;
214 #size-cells = <0>;
215 compatible = "fsl,gianfar-tbi";
216 reg = <0x520 0x20>;
217
218 tbi1: tbi-phy@11 {
219 reg = <0x11>;
220 device_type = "tbi-phy";
221 };
222 };
223 };
224
225 serial0: serial@4500 {
226 cell-index = <0>;
227 device_type = "serial";
228 compatible = "ns16550";
229 reg = <0x4500 0x100>;
230 clock-frequency = <0>;
231 interrupts = <42 2>;
232 interrupt-parent = <&mpic>;
233 };
234
235 serial1: serial@4600 {
236 cell-index = <1>;
237 device_type = "serial";
238 compatible = "ns16550";
239 reg = <0x4600 0x100>;
240 clock-frequency = <0>;
241 interrupts = <42 2>;
242 interrupt-parent = <&mpic>;
243 };
244
245 global-utilities@e0000 { //global utilities block
246 compatible = "fsl,mpc8548-guts";
247 reg = <0xe0000 0x1000>;
248 fsl,has-rstcr;
249 };
250
251 crypto@30000 {
252 compatible = "fsl,sec2.1", "fsl,sec2.0";
253 reg = <0x30000 0x10000>;
254 interrupts = <45 2>;
255 interrupt-parent = <&mpic>;
256 fsl,num-channels = <4>;
257 fsl,channel-fifo-len = <24>;
258 fsl,exec-units-mask = <0xfe>;
259 fsl,descriptor-types-mask = <0x12b0ebf>;
260 };
261
262 mpic: pic@40000 {
263 interrupt-controller;
264 #address-cells = <0>;
265 #interrupt-cells = <2>;
266 reg = <0x40000 0x40000>;
267 compatible = "chrp,open-pic";
268 device_type = "open-pic";
269 };
270 26
271 msi@41600 { 27 board_soc: soc: soc8544@e0000000 {
272 compatible = "fsl,mpc8544-msi", "fsl,mpic-msi"; 28 ranges = <0x0 0x0 0xe0000000 0x100000>;
273 reg = <0x41600 0x80>;
274 msi-available-ranges = <0 0x100>;
275 interrupts = <
276 0xe0 0
277 0xe1 0
278 0xe2 0
279 0xe3 0
280 0xe4 0
281 0xe5 0
282 0xe6 0
283 0xe7 0>;
284 interrupt-parent = <&mpic>;
285 };
286 }; 29 };
287 30
288 pci0: pci@e0008000 { 31 pci0: pci@e0008000 {
289 compatible = "fsl,mpc8540-pci"; 32 reg = <0 0xe0008000 0 0x1000>;
290 device_type = "pci"; 33 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
34 0x1000000 0x0 0x00000000 0 0xe1000000 0x0 0x10000>;
35 clock-frequency = <66666666>;
291 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 36 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
292 interrupt-map = < 37 interrupt-map = <
293 38
294 /* IDSEL 0x11 J17 Slot 1 */ 39 /* IDSEL 0x11 J17 Slot 1 */
295 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1 40 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
296 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1 41 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
297 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1 42 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
298 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1 43 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
299 44
300 /* IDSEL 0x12 J16 Slot 2 */ 45 /* IDSEL 0x12 J16 Slot 2 */
301 46
302 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1 47 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
303 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1 48 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
304 0x9000 0x0 0x0 0x3 &mpic 0x2 0x1 49 0x9000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
305 0x9000 0x0 0x0 0x4 &mpic 0x1 0x1>; 50 0x9000 0x0 0x0 0x4 &mpic 0x1 0x1 0 0>;
306
307 interrupt-parent = <&mpic>;
308 interrupts = <24 2>;
309 bus-range = <0 255>;
310 ranges = <0x2000000 0x0 0xc0000000 0xc0000000 0x0 0x20000000
311 0x1000000 0x0 0x0 0xe1000000 0x0 0x10000>;
312 clock-frequency = <66666666>;
313 #interrupt-cells = <1>;
314 #size-cells = <2>;
315 #address-cells = <3>;
316 reg = <0xe0008000 0x1000>;
317 }; 51 };
318 52
319 pci1: pcie@e0009000 { 53 pci1: pcie@e0009000 {
320 compatible = "fsl,mpc8548-pcie"; 54 reg = <0x0 0xe0009000 0x0 0x1000>;
321 device_type = "pci"; 55 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
322 #interrupt-cells = <1>; 56 0x1000000 0x0 0x00000000 0 0xe1010000 0x0 0x10000>;
323 #size-cells = <2>;
324 #address-cells = <3>;
325 reg = <0xe0009000 0x1000>;
326 bus-range = <0 255>;
327 ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
328 0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>;
329 clock-frequency = <33333333>;
330 interrupt-parent = <&mpic>;
331 interrupts = <25 2>;
332 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
333 interrupt-map = <
334 /* IDSEL 0x0 */
335 0000 0x0 0x0 0x1 &mpic 0x4 0x1
336 0000 0x0 0x0 0x2 &mpic 0x5 0x1
337 0000 0x0 0x0 0x3 &mpic 0x6 0x1
338 0000 0x0 0x0 0x4 &mpic 0x7 0x1
339 >;
340 pcie@0 { 57 pcie@0 {
341 reg = <0x0 0x0 0x0 0x0 0x0>;
342 #size-cells = <2>;
343 #address-cells = <3>;
344 device_type = "pci";
345 ranges = <0x2000000 0x0 0x80000000 58 ranges = <0x2000000 0x0 0x80000000
346 0x2000000 0x0 0x80000000 59 0x2000000 0x0 0x80000000
347 0x0 0x20000000 60 0x0 0x20000000
@@ -353,31 +66,10 @@
353 }; 66 };
354 67
355 pci2: pcie@e000a000 { 68 pci2: pcie@e000a000 {
356 compatible = "fsl,mpc8548-pcie"; 69 reg = <0x0 0xe000a000 0x0 0x1000>;
357 device_type = "pci"; 70 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x10000000
358 #interrupt-cells = <1>; 71 0x1000000 0x0 0x00000000 0 0xe1020000 0x0 0x10000>;
359 #size-cells = <2>;
360 #address-cells = <3>;
361 reg = <0xe000a000 0x1000>;
362 bus-range = <0 255>;
363 ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000
364 0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>;
365 clock-frequency = <33333333>;
366 interrupt-parent = <&mpic>;
367 interrupts = <26 2>;
368 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
369 interrupt-map = <
370 /* IDSEL 0x0 */
371 0000 0x0 0x0 0x1 &mpic 0x0 0x1
372 0000 0x0 0x0 0x2 &mpic 0x1 0x1
373 0000 0x0 0x0 0x3 &mpic 0x2 0x1
374 0000 0x0 0x0 0x4 &mpic 0x3 0x1
375 >;
376 pcie@0 { 72 pcie@0 {
377 reg = <0x0 0x0 0x0 0x0 0x0>;
378 #size-cells = <2>;
379 #address-cells = <3>;
380 device_type = "pci";
381 ranges = <0x2000000 0x0 0xa0000000 73 ranges = <0x2000000 0x0 0xa0000000
382 0x2000000 0x0 0xa0000000 74 0x2000000 0x0 0xa0000000
383 0x0 0x10000000 75 0x0 0x10000000
@@ -388,44 +80,11 @@
388 }; 80 };
389 }; 81 };
390 82
391 pci3: pcie@e000b000 { 83 board_pci3: pci3: pcie@e000b000 {
392 compatible = "fsl,mpc8548-pcie"; 84 reg = <0x0 0xe000b000 0x0 0x1000>;
393 device_type = "pci"; 85 ranges = <0x2000000 0x0 0xb0000000 0 0xb0000000 0x0 0x100000
394 #interrupt-cells = <1>; 86 0x1000000 0x0 0x00000000 0 0xb0100000 0x0 0x100000>;
395 #size-cells = <2>;
396 #address-cells = <3>;
397 reg = <0xe000b000 0x1000>;
398 bus-range = <0 255>;
399 ranges = <0x2000000 0x0 0xb0000000 0xb0000000 0x0 0x100000
400 0x1000000 0x0 0x0 0xb0100000 0x0 0x100000>;
401 clock-frequency = <33333333>;
402 interrupt-parent = <&mpic>;
403 interrupts = <27 2>;
404 interrupt-map-mask = <0xff00 0x0 0x0 0x1>;
405 interrupt-map = <
406 // IDSEL 0x1c USB
407 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
408 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
409 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
410 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
411
412 // IDSEL 0x1d Audio
413 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
414
415 // IDSEL 0x1e Legacy
416 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
417 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
418
419 // IDSEL 0x1f IDE/SATA
420 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
421 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
422 >;
423
424 pcie@0 { 87 pcie@0 {
425 reg = <0x0 0x0 0x0 0x0 0x0>;
426 #size-cells = <2>;
427 #address-cells = <3>;
428 device_type = "pci";
429 ranges = <0x2000000 0x0 0xb0000000 88 ranges = <0x2000000 0x0 0xb0000000
430 0x2000000 0x0 0xb0000000 89 0x2000000 0x0 0xb0000000
431 0x0 0x100000 90 0x0 0x100000
@@ -433,70 +92,14 @@
433 0x1000000 0x0 0x0 92 0x1000000 0x0 0x0
434 0x1000000 0x0 0x0 93 0x1000000 0x0 0x0
435 0x0 0x100000>; 94 0x0 0x100000>;
436
437 uli1575@0 {
438 reg = <0x0 0x0 0x0 0x0 0x0>;
439 #size-cells = <2>;
440 #address-cells = <3>;
441 ranges = <0x2000000 0x0 0xb0000000
442 0x2000000 0x0 0xb0000000
443 0x0 0x100000
444
445 0x1000000 0x0 0x0
446 0x1000000 0x0 0x0
447 0x0 0x100000>;
448 isa@1e {
449 device_type = "isa";
450 #interrupt-cells = <2>;
451 #size-cells = <1>;
452 #address-cells = <2>;
453 reg = <0xf000 0x0 0x0 0x0 0x0>;
454 ranges = <0x1 0x0
455 0x1000000 0x0 0x0
456 0x1000>;
457 interrupt-parent = <&i8259>;
458
459 i8259: interrupt-controller@20 {
460 reg = <0x1 0x20 0x2
461 0x1 0xa0 0x2
462 0x1 0x4d0 0x2>;
463 interrupt-controller;
464 device_type = "interrupt-controller";
465 #address-cells = <0>;
466 #interrupt-cells = <2>;
467 compatible = "chrp,iic";
468 interrupts = <9 2>;
469 interrupt-parent = <&mpic>;
470 };
471
472 i8042@60 {
473 #size-cells = <0>;
474 #address-cells = <1>;
475 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
476 interrupts = <1 3 12 3>;
477 interrupt-parent = <&i8259>;
478
479 keyboard@0 {
480 reg = <0x0>;
481 compatible = "pnpPNP,303";
482 };
483
484 mouse@1 {
485 reg = <0x1>;
486 compatible = "pnpPNP,f03";
487 };
488 };
489
490 rtc@70 {
491 compatible = "pnpPNP,b00";
492 reg = <0x1 0x70 0x2>;
493 };
494
495 gpio@400 {
496 reg = <0x1 0x400 0x80>;
497 };
498 };
499 };
500 }; 95 };
501 }; 96 };
502}; 97};
98
99/*
100 * mpc8544ds.dtsi must be last to ensure board_pci3 overrides pci3 settings
101 * for interrupt-map & interrupt-map-mask
102 */
103
104/include/ "fsl/mpc8544si-post.dtsi"
105/include/ "mpc8544ds.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dtsi b/arch/powerpc/boot/dts/mpc8544ds.dtsi
new file mode 100644
index 000000000000..270f64b90f4e
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8544ds.dtsi
@@ -0,0 +1,161 @@
1/*
2 * MPC8544DS Device Tree Source stub (no addresses or top-level ranges)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&board_soc {
36 enet0: ethernet@24000 {
37 phy-handle = <&phy0>;
38 tbi-handle = <&tbi0>;
39 phy-connection-type = "rgmii-id";
40 };
41
42 mdio@24520 {
43 phy0: ethernet-phy@0 {
44 interrupts = <10 1 0 0>;
45 reg = <0x0>;
46 device_type = "ethernet-phy";
47 };
48 phy1: ethernet-phy@1 {
49 interrupts = <10 1 0 0>;
50 reg = <0x1>;
51 device_type = "ethernet-phy";
52 };
53
54 tbi0: tbi-phy@11 {
55 reg = <0x11>;
56 device_type = "tbi-phy";
57 };
58 };
59
60 enet2: ethernet@26000 {
61 phy-handle = <&phy1>;
62 tbi-handle = <&tbi1>;
63 phy-connection-type = "rgmii-id";
64 };
65
66 mdio@26520 {
67 tbi1: tbi-phy@11 {
68 reg = <0x11>;
69 device_type = "tbi-phy";
70 };
71 };
72};
73
74&board_pci3 {
75 pcie@0 {
76 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
77 interrupt-map = <
78 // IDSEL 0x1c USB
79 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
80 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
81 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
82 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
83
84 // IDSEL 0x1d Audio
85 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
86
87 // IDSEL 0x1e Legacy
88 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
89 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
90
91 // IDSEL 0x1f IDE/SATA
92 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
93 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
94 >;
95
96
97 uli1575@0 {
98 reg = <0x0 0x0 0x0 0x0 0x0>;
99 #size-cells = <2>;
100 #address-cells = <3>;
101 ranges = <0x2000000 0x0 0xb0000000
102 0x2000000 0x0 0xb0000000
103 0x0 0x100000
104
105 0x1000000 0x0 0x0
106 0x1000000 0x0 0x0
107 0x0 0x100000>;
108 isa@1e {
109 device_type = "isa";
110 #interrupt-cells = <2>;
111 #size-cells = <1>;
112 #address-cells = <2>;
113 reg = <0xf000 0x0 0x0 0x0 0x0>;
114 ranges = <0x1 0x0 0x1000000 0x0 0x0
115 0x1000>;
116 interrupt-parent = <&i8259>;
117
118 i8259: interrupt-controller@20 {
119 reg = <0x1 0x20 0x2
120 0x1 0xa0 0x2
121 0x1 0x4d0 0x2>;
122 interrupt-controller;
123 device_type = "interrupt-controller";
124 #address-cells = <0>;
125 #interrupt-cells = <2>;
126 compatible = "chrp,iic";
127 interrupts = <9 2 0 0>;
128 interrupt-parent = <&mpic>;
129 };
130
131 i8042@60 {
132 #size-cells = <0>;
133 #address-cells = <1>;
134 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
135 interrupts = <1 3 12 3>;
136 interrupt-parent =
137 <&i8259>;
138
139 keyboard@0 {
140 reg = <0x0>;
141 compatible = "pnpPNP,303";
142 };
143
144 mouse@1 {
145 reg = <0x1>;
146 compatible = "pnpPNP,f03";
147 };
148 };
149
150 rtc@70 {
151 compatible = "pnpPNP,b00";
152 reg = <0x1 0x70 0x2>;
153 };
154
155 gpio@400 {
156 reg = <0x1 0x400 0x80>;
157 };
158 };
159 };
160 };
161};
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index a17a5572fb73..07b8dae0f46e 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -9,13 +9,11 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8548si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "MPC8548CDS"; 15 model = "MPC8548CDS";
16 compatible = "MPC8548CDS", "MPC85xxCDS"; 16 compatible = "MPC8548CDS", "MPC85xxCDS";
17 #address-cells = <1>;
18 #size-cells = <1>;
19 17
20 aliases { 18 aliases {
21 ethernet0 = &enet0; 19 ethernet0 = &enet0;
@@ -29,76 +27,19 @@
29 pci2 = &pci2; 27 pci2 = &pci2;
30 }; 28 };
31 29
32 cpus {
33 #address-cells = <1>;
34 #size-cells = <0>;
35
36 PowerPC,8548@0 {
37 device_type = "cpu";
38 reg = <0x0>;
39 d-cache-line-size = <32>; // 32 bytes
40 i-cache-line-size = <32>; // 32 bytes
41 d-cache-size = <0x8000>; // L1, 32K
42 i-cache-size = <0x8000>; // L1, 32K
43 timebase-frequency = <0>; // 33 MHz, from uboot
44 bus-frequency = <0>; // 166 MHz
45 clock-frequency = <0>; // 825 MHz, from uboot
46 next-level-cache = <&L2>;
47 };
48 };
49
50 memory { 30 memory {
51 device_type = "memory"; 31 device_type = "memory";
52 reg = <0x0 0x8000000>; // 128M at 0x0 32 reg = <0 0 0x0 0x8000000>; // 128M at 0x0
53 }; 33 };
54 34
55 soc8548@e0000000 { 35 lbc: localbus@e0005000 {
56 #address-cells = <1>; 36 reg = <0 0xe0005000 0 0x1000>;
57 #size-cells = <1>; 37 };
58 device_type = "soc";
59 compatible = "simple-bus";
60 ranges = <0x0 0xe0000000 0x100000>;
61 bus-frequency = <0>;
62
63 ecm-law@0 {
64 compatible = "fsl,ecm-law";
65 reg = <0x0 0x1000>;
66 fsl,num-laws = <10>;
67 };
68
69 ecm@1000 {
70 compatible = "fsl,mpc8548-ecm", "fsl,ecm";
71 reg = <0x1000 0x1000>;
72 interrupts = <17 2>;
73 interrupt-parent = <&mpic>;
74 };
75
76 memory-controller@2000 {
77 compatible = "fsl,mpc8548-memory-controller";
78 reg = <0x2000 0x1000>;
79 interrupt-parent = <&mpic>;
80 interrupts = <18 2>;
81 };
82 38
83 L2: l2-cache-controller@20000 { 39 soc: soc8548@e0000000 {
84 compatible = "fsl,mpc8548-l2-cache-controller"; 40 ranges = <0 0x0 0xe0000000 0x100000>;
85 reg = <0x20000 0x1000>;
86 cache-line-size = <32>; // 32 bytes
87 cache-size = <0x80000>; // L2, 512K
88 interrupt-parent = <&mpic>;
89 interrupts = <16 2>;
90 };
91 41
92 i2c@3000 { 42 i2c@3000 {
93 #address-cells = <1>;
94 #size-cells = <0>;
95 cell-index = <0>;
96 compatible = "fsl-i2c";
97 reg = <0x3000 0x100>;
98 interrupts = <43 2>;
99 interrupt-parent = <&mpic>;
100 dfsrr;
101
102 eeprom@50 { 43 eeprom@50 {
103 compatible = "atmel,24c64"; 44 compatible = "atmel,24c64";
104 reg = <0x50>; 45 reg = <0x50>;
@@ -116,351 +57,178 @@
116 }; 57 };
117 58
118 i2c@3100 { 59 i2c@3100 {
119 #address-cells = <1>;
120 #size-cells = <0>;
121 cell-index = <1>;
122 compatible = "fsl-i2c";
123 reg = <0x3100 0x100>;
124 interrupts = <43 2>;
125 interrupt-parent = <&mpic>;
126 dfsrr;
127
128 eeprom@50 { 60 eeprom@50 {
129 compatible = "atmel,24c64"; 61 compatible = "atmel,24c64";
130 reg = <0x50>; 62 reg = <0x50>;
131 }; 63 };
132 }; 64 };
133 65
134 dma@21300 {
135 #address-cells = <1>;
136 #size-cells = <1>;
137 compatible = "fsl,mpc8548-dma", "fsl,eloplus-dma";
138 reg = <0x21300 0x4>;
139 ranges = <0x0 0x21100 0x200>;
140 cell-index = <0>;
141 dma-channel@0 {
142 compatible = "fsl,mpc8548-dma-channel",
143 "fsl,eloplus-dma-channel";
144 reg = <0x0 0x80>;
145 cell-index = <0>;
146 interrupt-parent = <&mpic>;
147 interrupts = <20 2>;
148 };
149 dma-channel@80 {
150 compatible = "fsl,mpc8548-dma-channel",
151 "fsl,eloplus-dma-channel";
152 reg = <0x80 0x80>;
153 cell-index = <1>;
154 interrupt-parent = <&mpic>;
155 interrupts = <21 2>;
156 };
157 dma-channel@100 {
158 compatible = "fsl,mpc8548-dma-channel",
159 "fsl,eloplus-dma-channel";
160 reg = <0x100 0x80>;
161 cell-index = <2>;
162 interrupt-parent = <&mpic>;
163 interrupts = <22 2>;
164 };
165 dma-channel@180 {
166 compatible = "fsl,mpc8548-dma-channel",
167 "fsl,eloplus-dma-channel";
168 reg = <0x180 0x80>;
169 cell-index = <3>;
170 interrupt-parent = <&mpic>;
171 interrupts = <23 2>;
172 };
173 };
174
175 enet0: ethernet@24000 { 66 enet0: ethernet@24000 {
176 #address-cells = <1>;
177 #size-cells = <1>;
178 cell-index = <0>;
179 device_type = "network";
180 model = "eTSEC";
181 compatible = "gianfar";
182 reg = <0x24000 0x1000>;
183 ranges = <0x0 0x24000 0x1000>;
184 local-mac-address = [ 00 00 00 00 00 00 ];
185 interrupts = <29 2 30 2 34 2>;
186 interrupt-parent = <&mpic>;
187 tbi-handle = <&tbi0>; 67 tbi-handle = <&tbi0>;
188 phy-handle = <&phy0>; 68 phy-handle = <&phy0>;
69 };
189 70
190 mdio@520 { 71 mdio@24520 {
191 #address-cells = <1>; 72 phy0: ethernet-phy@0 {
192 #size-cells = <0>; 73 interrupts = <5 1 0 0>;
193 compatible = "fsl,gianfar-mdio"; 74 reg = <0x0>;
194 reg = <0x520 0x20>; 75 device_type = "ethernet-phy";
195 76 };
196 phy0: ethernet-phy@0 { 77 phy1: ethernet-phy@1 {
197 interrupt-parent = <&mpic>; 78 interrupts = <5 1 0 0>;
198 interrupts = <5 1>; 79 reg = <0x1>;
199 reg = <0x0>; 80 device_type = "ethernet-phy";
200 device_type = "ethernet-phy"; 81 };
201 }; 82 phy2: ethernet-phy@2 {
202 phy1: ethernet-phy@1 { 83 interrupts = <5 1 0 0>;
203 interrupt-parent = <&mpic>; 84 reg = <0x2>;
204 interrupts = <5 1>; 85 device_type = "ethernet-phy";
205 reg = <0x1>; 86 };
206 device_type = "ethernet-phy"; 87 phy3: ethernet-phy@3 {
207 }; 88 interrupts = <5 1 0 0>;
208 phy2: ethernet-phy@2 { 89 reg = <0x3>;
209 interrupt-parent = <&mpic>; 90 device_type = "ethernet-phy";
210 interrupts = <5 1>; 91 };
211 reg = <0x2>; 92 tbi0: tbi-phy@11 {
212 device_type = "ethernet-phy"; 93 reg = <0x11>;
213 }; 94 device_type = "tbi-phy";
214 phy3: ethernet-phy@3 {
215 interrupt-parent = <&mpic>;
216 interrupts = <5 1>;
217 reg = <0x3>;
218 device_type = "ethernet-phy";
219 };
220 tbi0: tbi-phy@11 {
221 reg = <0x11>;
222 device_type = "tbi-phy";
223 };
224 }; 95 };
225 }; 96 };
226 97
227 enet1: ethernet@25000 { 98 enet1: ethernet@25000 {
228 #address-cells = <1>;
229 #size-cells = <1>;
230 cell-index = <1>;
231 device_type = "network";
232 model = "eTSEC";
233 compatible = "gianfar";
234 reg = <0x25000 0x1000>;
235 ranges = <0x0 0x25000 0x1000>;
236 local-mac-address = [ 00 00 00 00 00 00 ];
237 interrupts = <35 2 36 2 40 2>;
238 interrupt-parent = <&mpic>;
239 tbi-handle = <&tbi1>; 99 tbi-handle = <&tbi1>;
240 phy-handle = <&phy1>; 100 phy-handle = <&phy1>;
101 };
241 102
242 mdio@520 { 103 mdio@25520 {
243 #address-cells = <1>; 104 tbi1: tbi-phy@11 {
244 #size-cells = <0>; 105 reg = <0x11>;
245 compatible = "fsl,gianfar-tbi"; 106 device_type = "tbi-phy";
246 reg = <0x520 0x20>;
247
248 tbi1: tbi-phy@11 {
249 reg = <0x11>;
250 device_type = "tbi-phy";
251 };
252 }; 107 };
253 }; 108 };
254 109
255 enet2: ethernet@26000 { 110 enet2: ethernet@26000 {
256 #address-cells = <1>;
257 #size-cells = <1>;
258 cell-index = <2>;
259 device_type = "network";
260 model = "eTSEC";
261 compatible = "gianfar";
262 reg = <0x26000 0x1000>;
263 ranges = <0x0 0x26000 0x1000>;
264 local-mac-address = [ 00 00 00 00 00 00 ];
265 interrupts = <31 2 32 2 33 2>;
266 interrupt-parent = <&mpic>;
267 tbi-handle = <&tbi2>; 111 tbi-handle = <&tbi2>;
268 phy-handle = <&phy2>; 112 phy-handle = <&phy2>;
113 };
269 114
270 mdio@520 { 115 mdio@26520 {
271 #address-cells = <1>; 116 tbi2: tbi-phy@11 {
272 #size-cells = <0>; 117 reg = <0x11>;
273 compatible = "fsl,gianfar-tbi"; 118 device_type = "tbi-phy";
274 reg = <0x520 0x20>;
275
276 tbi2: tbi-phy@11 {
277 reg = <0x11>;
278 device_type = "tbi-phy";
279 };
280 }; 119 };
281 }; 120 };
282 121
283 enet3: ethernet@27000 { 122 enet3: ethernet@27000 {
284 #address-cells = <1>;
285 #size-cells = <1>;
286 cell-index = <3>;
287 device_type = "network";
288 model = "eTSEC";
289 compatible = "gianfar";
290 reg = <0x27000 0x1000>;
291 ranges = <0x0 0x27000 0x1000>;
292 local-mac-address = [ 00 00 00 00 00 00 ];
293 interrupts = <37 2 38 2 39 2>;
294 interrupt-parent = <&mpic>;
295 tbi-handle = <&tbi3>; 123 tbi-handle = <&tbi3>;
296 phy-handle = <&phy3>; 124 phy-handle = <&phy3>;
297
298 mdio@520 {
299 #address-cells = <1>;
300 #size-cells = <0>;
301 compatible = "fsl,gianfar-tbi";
302 reg = <0x520 0x20>;
303
304 tbi3: tbi-phy@11 {
305 reg = <0x11>;
306 device_type = "tbi-phy";
307 };
308 };
309 };
310
311 serial0: serial@4500 {
312 cell-index = <0>;
313 device_type = "serial";
314 compatible = "ns16550";
315 reg = <0x4500 0x100>; // reg base, size
316 clock-frequency = <0>; // should we fill in in uboot?
317 interrupts = <42 2>;
318 interrupt-parent = <&mpic>;
319 };
320
321 serial1: serial@4600 {
322 cell-index = <1>;
323 device_type = "serial";
324 compatible = "ns16550";
325 reg = <0x4600 0x100>; // reg base, size
326 clock-frequency = <0>; // should we fill in in uboot?
327 interrupts = <42 2>;
328 interrupt-parent = <&mpic>;
329 }; 125 };
330 126
331 global-utilities@e0000 { //global utilities reg 127 mdio@27520 {
332 compatible = "fsl,mpc8548-guts"; 128 tbi3: tbi-phy@11 {
333 reg = <0xe0000 0x1000>; 129 reg = <0x11>;
334 fsl,has-rstcr; 130 device_type = "tbi-phy";
335 }; 131 };
336
337 crypto@30000 {
338 compatible = "fsl,sec2.1", "fsl,sec2.0";
339 reg = <0x30000 0x10000>;
340 interrupts = <45 2>;
341 interrupt-parent = <&mpic>;
342 fsl,num-channels = <4>;
343 fsl,channel-fifo-len = <24>;
344 fsl,exec-units-mask = <0xfe>;
345 fsl,descriptor-types-mask = <0x12b0ebf>;
346 };
347
348 mpic: pic@40000 {
349 interrupt-controller;
350 #address-cells = <0>;
351 #interrupt-cells = <2>;
352 reg = <0x40000 0x40000>;
353 compatible = "chrp,open-pic";
354 device_type = "open-pic";
355 }; 132 };
356 }; 133 };
357 134
358 pci0: pci@e0008000 { 135 pci0: pci@e0008000 {
136 reg = <0 0xe0008000 0 0x1000>;
137 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x10000000
138 0x1000000 0x0 0x00000000 0 0xe2000000 0x0 0x800000>;
139 clock-frequency = <66666666>;
359 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 140 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
360 interrupt-map = < 141 interrupt-map = <
361 /* IDSEL 0x4 (PCIX Slot 2) */ 142 /* IDSEL 0x4 (PCIX Slot 2) */
362 0x2000 0x0 0x0 0x1 &mpic 0x0 0x1 143 0x2000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
363 0x2000 0x0 0x0 0x2 &mpic 0x1 0x1 144 0x2000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
364 0x2000 0x0 0x0 0x3 &mpic 0x2 0x1 145 0x2000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
365 0x2000 0x0 0x0 0x4 &mpic 0x3 0x1 146 0x2000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0
366 147
367 /* IDSEL 0x5 (PCIX Slot 3) */ 148 /* IDSEL 0x5 (PCIX Slot 3) */
368 0x2800 0x0 0x0 0x1 &mpic 0x1 0x1 149 0x2800 0x0 0x0 0x1 &mpic 0x1 0x1 0 0
369 0x2800 0x0 0x0 0x2 &mpic 0x2 0x1 150 0x2800 0x0 0x0 0x2 &mpic 0x2 0x1 0 0
370 0x2800 0x0 0x0 0x3 &mpic 0x3 0x1 151 0x2800 0x0 0x0 0x3 &mpic 0x3 0x1 0 0
371 0x2800 0x0 0x0 0x4 &mpic 0x0 0x1 152 0x2800 0x0 0x0 0x4 &mpic 0x0 0x1 0 0
372 153
373 /* IDSEL 0x6 (PCIX Slot 4) */ 154 /* IDSEL 0x6 (PCIX Slot 4) */
374 0x3000 0x0 0x0 0x1 &mpic 0x2 0x1 155 0x3000 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
375 0x3000 0x0 0x0 0x2 &mpic 0x3 0x1 156 0x3000 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
376 0x3000 0x0 0x0 0x3 &mpic 0x0 0x1 157 0x3000 0x0 0x0 0x3 &mpic 0x0 0x1 0 0
377 0x3000 0x0 0x0 0x4 &mpic 0x1 0x1 158 0x3000 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
378 159
379 /* IDSEL 0x8 (PCIX Slot 5) */ 160 /* IDSEL 0x8 (PCIX Slot 5) */
380 0x4000 0x0 0x0 0x1 &mpic 0x0 0x1 161 0x4000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
381 0x4000 0x0 0x0 0x2 &mpic 0x1 0x1 162 0x4000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
382 0x4000 0x0 0x0 0x3 &mpic 0x2 0x1 163 0x4000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
383 0x4000 0x0 0x0 0x4 &mpic 0x3 0x1 164 0x4000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0
384 165
385 /* IDSEL 0xC (Tsi310 bridge) */ 166 /* IDSEL 0xC (Tsi310 bridge) */
386 0x6000 0x0 0x0 0x1 &mpic 0x0 0x1 167 0x6000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
387 0x6000 0x0 0x0 0x2 &mpic 0x1 0x1 168 0x6000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
388 0x6000 0x0 0x0 0x3 &mpic 0x2 0x1 169 0x6000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
389 0x6000 0x0 0x0 0x4 &mpic 0x3 0x1 170 0x6000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0
390 171
391 /* IDSEL 0x14 (Slot 2) */ 172 /* IDSEL 0x14 (Slot 2) */
392 0xa000 0x0 0x0 0x1 &mpic 0x0 0x1 173 0xa000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
393 0xa000 0x0 0x0 0x2 &mpic 0x1 0x1 174 0xa000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
394 0xa000 0x0 0x0 0x3 &mpic 0x2 0x1 175 0xa000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
395 0xa000 0x0 0x0 0x4 &mpic 0x3 0x1 176 0xa000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0
396 177
397 /* IDSEL 0x15 (Slot 3) */ 178 /* IDSEL 0x15 (Slot 3) */
398 0xa800 0x0 0x0 0x1 &mpic 0x1 0x1 179 0xa800 0x0 0x0 0x1 &mpic 0x1 0x1 0 0
399 0xa800 0x0 0x0 0x2 &mpic 0x2 0x1 180 0xa800 0x0 0x0 0x2 &mpic 0x2 0x1 0 0
400 0xa800 0x0 0x0 0x3 &mpic 0x3 0x1 181 0xa800 0x0 0x0 0x3 &mpic 0x3 0x1 0 0
401 0xa800 0x0 0x0 0x4 &mpic 0x0 0x1 182 0xa800 0x0 0x0 0x4 &mpic 0x0 0x1 0 0
402 183
403 /* IDSEL 0x16 (Slot 4) */ 184 /* IDSEL 0x16 (Slot 4) */
404 0xb000 0x0 0x0 0x1 &mpic 0x2 0x1 185 0xb000 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
405 0xb000 0x0 0x0 0x2 &mpic 0x3 0x1 186 0xb000 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
406 0xb000 0x0 0x0 0x3 &mpic 0x0 0x1 187 0xb000 0x0 0x0 0x3 &mpic 0x0 0x1 0 0
407 0xb000 0x0 0x0 0x4 &mpic 0x1 0x1 188 0xb000 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
408 189
409 /* IDSEL 0x18 (Slot 5) */ 190 /* IDSEL 0x18 (Slot 5) */
410 0xc000 0x0 0x0 0x1 &mpic 0x0 0x1 191 0xc000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
411 0xc000 0x0 0x0 0x2 &mpic 0x1 0x1 192 0xc000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
412 0xc000 0x0 0x0 0x3 &mpic 0x2 0x1 193 0xc000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
413 0xc000 0x0 0x0 0x4 &mpic 0x3 0x1 194 0xc000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0
414 195
415 /* IDSEL 0x1C (Tsi310 bridge PCI primary) */ 196 /* IDSEL 0x1C (Tsi310 bridge PCI primary) */
416 0xe000 0x0 0x0 0x1 &mpic 0x0 0x1 197 0xe000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
417 0xe000 0x0 0x0 0x2 &mpic 0x1 0x1 198 0xe000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
418 0xe000 0x0 0x0 0x3 &mpic 0x2 0x1 199 0xe000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
419 0xe000 0x0 0x0 0x4 &mpic 0x3 0x1>; 200 0xe000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0>;
420
421 interrupt-parent = <&mpic>;
422 interrupts = <24 2>;
423 bus-range = <0 0>;
424 ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x10000000
425 0x1000000 0x0 0x0 0xe2000000 0x0 0x800000>;
426 clock-frequency = <66666666>;
427 #interrupt-cells = <1>;
428 #size-cells = <2>;
429 #address-cells = <3>;
430 reg = <0xe0008000 0x1000>;
431 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
432 device_type = "pci";
433 201
434 pci_bridge@1c { 202 pci_bridge@1c {
435 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 203 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
436 interrupt-map = < 204 interrupt-map = <
437 205
438 /* IDSEL 0x00 (PrPMC Site) */ 206 /* IDSEL 0x00 (PrPMC Site) */
439 0000 0x0 0x0 0x1 &mpic 0x0 0x1 207 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
440 0000 0x0 0x0 0x2 &mpic 0x1 0x1 208 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
441 0000 0x0 0x0 0x3 &mpic 0x2 0x1 209 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
442 0000 0x0 0x0 0x4 &mpic 0x3 0x1 210 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0
443 211
444 /* IDSEL 0x04 (VIA chip) */ 212 /* IDSEL 0x04 (VIA chip) */
445 0x2000 0x0 0x0 0x1 &mpic 0x0 0x1 213 0x2000 0x0 0x0 0x1 &mpic 0x0 0x1 0 0
446 0x2000 0x0 0x0 0x2 &mpic 0x1 0x1 214 0x2000 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
447 0x2000 0x0 0x0 0x3 &mpic 0x2 0x1 215 0x2000 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
448 0x2000 0x0 0x0 0x4 &mpic 0x3 0x1 216 0x2000 0x0 0x0 0x4 &mpic 0x3 0x1 0 0
449 217
450 /* IDSEL 0x05 (8139) */ 218 /* IDSEL 0x05 (8139) */
451 0x2800 0x0 0x0 0x1 &mpic 0x1 0x1 219 0x2800 0x0 0x0 0x1 &mpic 0x1 0x1 0 0
452 220
453 /* IDSEL 0x06 (Slot 6) */ 221 /* IDSEL 0x06 (Slot 6) */
454 0x3000 0x0 0x0 0x1 &mpic 0x2 0x1 222 0x3000 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
455 0x3000 0x0 0x0 0x2 &mpic 0x3 0x1 223 0x3000 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
456 0x3000 0x0 0x0 0x3 &mpic 0x0 0x1 224 0x3000 0x0 0x0 0x3 &mpic 0x0 0x1 0 0
457 0x3000 0x0 0x0 0x4 &mpic 0x1 0x1 225 0x3000 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
458 226
459 /* IDESL 0x07 (Slot 7) */ 227 /* IDESL 0x07 (Slot 7) */
460 0x3800 0x0 0x0 0x1 &mpic 0x3 0x1 228 0x3800 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
461 0x3800 0x0 0x0 0x2 &mpic 0x0 0x1 229 0x3800 0x0 0x0 0x2 &mpic 0x0 0x1 0 0
462 0x3800 0x0 0x0 0x3 &mpic 0x1 0x1 230 0x3800 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
463 0x3800 0x0 0x0 0x4 &mpic 0x2 0x1>; 231 0x3800 0x0 0x0 0x4 &mpic 0x2 0x1 0 0>;
464 232
465 reg = <0xe000 0x0 0x0 0x0 0x0>; 233 reg = <0xe000 0x0 0x0 0x0 0x0>;
466 #interrupt-cells = <1>; 234 #interrupt-cells = <1>;
@@ -492,7 +260,7 @@
492 #address-cells = <0>; 260 #address-cells = <0>;
493 #interrupt-cells = <2>; 261 #interrupt-cells = <2>;
494 compatible = "chrp,iic"; 262 compatible = "chrp,iic";
495 interrupts = <0 1>; 263 interrupts = <0 1 0 0>;
496 interrupt-parent = <&mpic>; 264 interrupt-parent = <&mpic>;
497 }; 265 };
498 266
@@ -505,56 +273,25 @@
505 }; 273 };
506 274
507 pci1: pci@e0009000 { 275 pci1: pci@e0009000 {
276 reg = <0 0xe0009000 0 0x1000>;
277 ranges = <0x2000000 0x0 0x90000000 0 0x90000000 0x0 0x10000000
278 0x1000000 0x0 0x00000000 0 0xe2800000 0x0 0x800000>;
279 clock-frequency = <66666666>;
508 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 280 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
509 interrupt-map = < 281 interrupt-map = <
510 282
511 /* IDSEL 0x15 */ 283 /* IDSEL 0x15 */
512 0xa800 0x0 0x0 0x1 &mpic 0xb 0x1 284 0xa800 0x0 0x0 0x1 &mpic 0xb 0x1 0 0
513 0xa800 0x0 0x0 0x2 &mpic 0x1 0x1 285 0xa800 0x0 0x0 0x2 &mpic 0x1 0x1 0 0
514 0xa800 0x0 0x0 0x3 &mpic 0x2 0x1 286 0xa800 0x0 0x0 0x3 &mpic 0x2 0x1 0 0
515 0xa800 0x0 0x0 0x4 &mpic 0x3 0x1>; 287 0xa800 0x0 0x0 0x4 &mpic 0x3 0x1 0 0>;
516
517 interrupt-parent = <&mpic>;
518 interrupts = <25 2>;
519 bus-range = <0 0>;
520 ranges = <0x2000000 0x0 0x90000000 0x90000000 0x0 0x10000000
521 0x1000000 0x0 0x0 0xe2800000 0x0 0x800000>;
522 clock-frequency = <66666666>;
523 #interrupt-cells = <1>;
524 #size-cells = <2>;
525 #address-cells = <3>;
526 reg = <0xe0009000 0x1000>;
527 compatible = "fsl,mpc8540-pci";
528 device_type = "pci";
529 }; 288 };
530 289
531 pci2: pcie@e000a000 { 290 pci2: pcie@e000a000 {
532 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 291 reg = <0 0xe000a000 0 0x1000>;
533 interrupt-map = < 292 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
534 293 0x1000000 0x0 0x00000000 0 0xe3000000 0x0 0x100000>;
535 /* IDSEL 0x0 (PEX) */
536 00000 0x0 0x0 0x1 &mpic 0x0 0x1
537 00000 0x0 0x0 0x2 &mpic 0x1 0x1
538 00000 0x0 0x0 0x3 &mpic 0x2 0x1
539 00000 0x0 0x0 0x4 &mpic 0x3 0x1>;
540
541 interrupt-parent = <&mpic>;
542 interrupts = <26 2>;
543 bus-range = <0 255>;
544 ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
545 0x1000000 0x0 0x0 0xe3000000 0x0 0x100000>;
546 clock-frequency = <33333333>;
547 #interrupt-cells = <1>;
548 #size-cells = <2>;
549 #address-cells = <3>;
550 reg = <0xe000a000 0x1000>;
551 compatible = "fsl,mpc8548-pcie";
552 device_type = "pci";
553 pcie@0 { 294 pcie@0 {
554 reg = <0x0 0x0 0x0 0x0 0x0>;
555 #size-cells = <2>;
556 #address-cells = <3>;
557 device_type = "pci";
558 ranges = <0x2000000 0x0 0xa0000000 295 ranges = <0x2000000 0x0 0xa0000000
559 0x2000000 0x0 0xa0000000 296 0x2000000 0x0 0xa0000000
560 0x0 0x20000000 297 0x0 0x20000000
@@ -565,3 +302,5 @@
565 }; 302 };
566 }; 303 };
567}; 304};
305
306/include/ "fsl/mpc8548si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 5c5614f9eb17..fe10438613d6 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -209,7 +209,7 @@
209 serial0: serial@4500 { 209 serial0: serial@4500 {
210 cell-index = <0>; 210 cell-index = <0>;
211 device_type = "serial"; 211 device_type = "serial";
212 compatible = "ns16550"; 212 compatible = "fsl,ns16550", "ns16550";
213 reg = <0x4500 0x100>; // reg base, size 213 reg = <0x4500 0x100>; // reg base, size
214 clock-frequency = <0>; // should we fill in in uboot? 214 clock-frequency = <0>; // should we fill in in uboot?
215 interrupts = <42 2>; 215 interrupts = <42 2>;
@@ -219,7 +219,7 @@
219 serial1: serial@4600 { 219 serial1: serial@4600 {
220 cell-index = <1>; 220 cell-index = <1>;
221 device_type = "serial"; 221 device_type = "serial";
222 compatible = "ns16550"; 222 compatible = "fsl,ns16550", "ns16550";
223 reg = <0x4600 0x100>; // reg base, size 223 reg = <0x4600 0x100>; // reg base, size
224 clock-frequency = <0>; // should we fill in in uboot? 224 clock-frequency = <0>; // should we fill in in uboot?
225 interrupts = <42 2>; 225 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 647daf8e7291..09598bb5d443 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -9,60 +9,25 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8568si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "MPC8568EMDS"; 15 model = "MPC8568EMDS";
16 compatible = "MPC8568EMDS", "MPC85xxMDS"; 16 compatible = "MPC8568EMDS", "MPC85xxMDS";
17 #address-cells = <1>;
18 #size-cells = <1>;
19 17
20 aliases { 18 aliases {
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 ethernet2 = &enet2;
24 ethernet3 = &enet3;
25 serial0 = &serial0;
26 serial1 = &serial1;
27 pci0 = &pci0; 19 pci0 = &pci0;
28 pci1 = &pci1; 20 pci1 = &pci1;
29 rapidio0 = &rio0; 21 rapidio0 = &rio;
30 };
31
32 cpus {
33 #address-cells = <1>;
34 #size-cells = <0>;
35
36 PowerPC,8568@0 {
37 device_type = "cpu";
38 reg = <0x0>;
39 d-cache-line-size = <32>; // 32 bytes
40 i-cache-line-size = <32>; // 32 bytes
41 d-cache-size = <0x8000>; // L1, 32K
42 i-cache-size = <0x8000>; // L1, 32K
43 sleep = <&pmc 0x00008000 // core
44 &pmc 0x00004000>; // timebase
45 timebase-frequency = <0>;
46 bus-frequency = <0>;
47 clock-frequency = <0>;
48 next-level-cache = <&L2>;
49 };
50 }; 22 };
51 23
52 memory { 24 memory {
53 device_type = "memory"; 25 device_type = "memory";
54 reg = <0x0 0x10000000>; 26 reg = <0x0 0x0 0x0 0x0>;
55 }; 27 };
56 28
57 localbus@e0005000 { 29 lbc: localbus@e0005000 {
58 #address-cells = <2>; 30 reg = <0x0 0xe0005000 0x0 0x1000>;
59 #size-cells = <1>;
60 compatible = "fsl,mpc8568-localbus", "fsl,pq3-localbus",
61 "simple-bus";
62 reg = <0xe0005000 0x1000>;
63 interrupt-parent = <&mpic>;
64 interrupts = <19 2>;
65
66 ranges = <0x0 0x0 0xfe000000 0x02000000 31 ranges = <0x0 0x0 0xfe000000 0x02000000
67 0x1 0x0 0xf8000000 0x00008000 32 0x1 0x0 0xf8000000 0x00008000
68 0x2 0x0 0xf0000000 0x04000000 33 0x2 0x0 0xf0000000 0x04000000
@@ -104,288 +69,65 @@
104 }; 69 };
105 }; 70 };
106 71
107 soc8568@e0000000 { 72 soc: soc8568@e0000000 {
108 #address-cells = <1>; 73 ranges = <0x0 0x0 0xe0000000 0x100000>;
109 #size-cells = <1>;
110 device_type = "soc";
111 compatible = "simple-bus";
112 ranges = <0x0 0xe0000000 0x100000>;
113 bus-frequency = <0>;
114
115 ecm-law@0 {
116 compatible = "fsl,ecm-law";
117 reg = <0x0 0x1000>;
118 fsl,num-laws = <10>;
119 };
120
121 ecm@1000 {
122 compatible = "fsl,mpc8568-ecm", "fsl,ecm";
123 reg = <0x1000 0x1000>;
124 interrupts = <17 2>;
125 interrupt-parent = <&mpic>;
126 };
127
128 memory-controller@2000 {
129 compatible = "fsl,mpc8568-memory-controller";
130 reg = <0x2000 0x1000>;
131 interrupt-parent = <&mpic>;
132 interrupts = <18 2>;
133 };
134
135 L2: l2-cache-controller@20000 {
136 compatible = "fsl,mpc8568-l2-cache-controller";
137 reg = <0x20000 0x1000>;
138 cache-line-size = <32>; // 32 bytes
139 cache-size = <0x80000>; // L2, 512K
140 interrupt-parent = <&mpic>;
141 interrupts = <16 2>;
142 };
143 74
144 i2c-sleep-nexus { 75 i2c-sleep-nexus {
145 #address-cells = <1>;
146 #size-cells = <1>;
147 compatible = "simple-bus";
148 sleep = <&pmc 0x00000004>;
149 ranges;
150
151 i2c@3000 { 76 i2c@3000 {
152 #address-cells = <1>;
153 #size-cells = <0>;
154 cell-index = <0>;
155 compatible = "fsl-i2c";
156 reg = <0x3000 0x100>;
157 interrupts = <43 2>;
158 interrupt-parent = <&mpic>;
159 dfsrr;
160
161 rtc@68 { 77 rtc@68 {
162 compatible = "dallas,ds1374"; 78 compatible = "dallas,ds1374";
163 reg = <0x68>; 79 reg = <0x68>;
164 interrupts = <3 1>; 80 interrupts = <3 1 0 0>;
165 interrupt-parent = <&mpic>;
166 }; 81 };
167 }; 82 };
83 };
168 84
169 i2c@3100 { 85 enet0: ethernet@24000 {
170 #address-cells = <1>; 86 tbi-handle = <&tbi0>;
171 #size-cells = <0>; 87 phy-handle = <&phy2>;
172 cell-index = <1>;
173 compatible = "fsl-i2c";
174 reg = <0x3100 0x100>;
175 interrupts = <43 2>;
176 interrupt-parent = <&mpic>;
177 dfsrr;
178 };
179 }; 88 };
180 89
181 dma@21300 { 90 mdio@24520 {
182 #address-cells = <1>; 91 phy0: ethernet-phy@7 {
183 #size-cells = <1>; 92 interrupts = <1 1 0 0>;
184 compatible = "fsl,mpc8568-dma", "fsl,eloplus-dma"; 93 reg = <0x7>;
185 reg = <0x21300 0x4>; 94 device_type = "ethernet-phy";
186 ranges = <0x0 0x21100 0x200>;
187 cell-index = <0>;
188 sleep = <&pmc 0x00000400>;
189
190 dma-channel@0 {
191 compatible = "fsl,mpc8568-dma-channel",
192 "fsl,eloplus-dma-channel";
193 reg = <0x0 0x80>;
194 cell-index = <0>;
195 interrupt-parent = <&mpic>;
196 interrupts = <20 2>;
197 }; 95 };
198 dma-channel@80 { 96 phy1: ethernet-phy@1 {
199 compatible = "fsl,mpc8568-dma-channel", 97 interrupts = <2 1 0 0>;
200 "fsl,eloplus-dma-channel"; 98 reg = <0x1>;
201 reg = <0x80 0x80>; 99 device_type = "ethernet-phy";
202 cell-index = <1>;
203 interrupt-parent = <&mpic>;
204 interrupts = <21 2>;
205 }; 100 };
206 dma-channel@100 { 101 phy2: ethernet-phy@2 {
207 compatible = "fsl,mpc8568-dma-channel", 102 interrupts = <1 1 0 0>;
208 "fsl,eloplus-dma-channel"; 103 reg = <0x2>;
209 reg = <0x100 0x80>; 104 device_type = "ethernet-phy";
210 cell-index = <2>;
211 interrupt-parent = <&mpic>;
212 interrupts = <22 2>;
213 }; 105 };
214 dma-channel@180 { 106 phy3: ethernet-phy@3 {
215 compatible = "fsl,mpc8568-dma-channel", 107 interrupts = <2 1 0 0>;
216 "fsl,eloplus-dma-channel"; 108 reg = <0x3>;
217 reg = <0x180 0x80>; 109 device_type = "ethernet-phy";
218 cell-index = <3>;
219 interrupt-parent = <&mpic>;
220 interrupts = <23 2>;
221 }; 110 };
222 }; 111 tbi0: tbi-phy@11 {
223 112 reg = <0x11>;
224 enet0: ethernet@24000 { 113 device_type = "tbi-phy";
225 #address-cells = <1>;
226 #size-cells = <1>;
227 cell-index = <0>;
228 device_type = "network";
229 model = "eTSEC";
230 compatible = "gianfar";
231 reg = <0x24000 0x1000>;
232 ranges = <0x0 0x24000 0x1000>;
233 local-mac-address = [ 00 00 00 00 00 00 ];
234 interrupts = <29 2 30 2 34 2>;
235 interrupt-parent = <&mpic>;
236 tbi-handle = <&tbi0>;
237 phy-handle = <&phy2>;
238 sleep = <&pmc 0x00000080>;
239
240 mdio@520 {
241 #address-cells = <1>;
242 #size-cells = <0>;
243 compatible = "fsl,gianfar-mdio";
244 reg = <0x520 0x20>;
245
246 phy0: ethernet-phy@7 {
247 interrupt-parent = <&mpic>;
248 interrupts = <1 1>;
249 reg = <0x7>;
250 device_type = "ethernet-phy";
251 };
252 phy1: ethernet-phy@1 {
253 interrupt-parent = <&mpic>;
254 interrupts = <2 1>;
255 reg = <0x1>;
256 device_type = "ethernet-phy";
257 };
258 phy2: ethernet-phy@2 {
259 interrupt-parent = <&mpic>;
260 interrupts = <1 1>;
261 reg = <0x2>;
262 device_type = "ethernet-phy";
263 };
264 phy3: ethernet-phy@3 {
265 interrupt-parent = <&mpic>;
266 interrupts = <2 1>;
267 reg = <0x3>;
268 device_type = "ethernet-phy";
269 };
270 tbi0: tbi-phy@11 {
271 reg = <0x11>;
272 device_type = "tbi-phy";
273 };
274 }; 114 };
275 }; 115 };
276 116
277 enet1: ethernet@25000 { 117 enet1: ethernet@25000 {
278 #address-cells = <1>;
279 #size-cells = <1>;
280 cell-index = <1>;
281 device_type = "network";
282 model = "eTSEC";
283 compatible = "gianfar";
284 reg = <0x25000 0x1000>;
285 ranges = <0x0 0x25000 0x1000>;
286 local-mac-address = [ 00 00 00 00 00 00 ];
287 interrupts = <35 2 36 2 40 2>;
288 interrupt-parent = <&mpic>;
289 tbi-handle = <&tbi1>; 118 tbi-handle = <&tbi1>;
290 phy-handle = <&phy3>; 119 phy-handle = <&phy3>;
291 sleep = <&pmc 0x00000040>; 120 sleep = <&pmc 0x00000040>;
292
293 mdio@520 {
294 #address-cells = <1>;
295 #size-cells = <0>;
296 compatible = "fsl,gianfar-tbi";
297 reg = <0x520 0x20>;
298
299 tbi1: tbi-phy@11 {
300 reg = <0x11>;
301 device_type = "tbi-phy";
302 };
303 };
304 }; 121 };
305 122
306 duart-sleep-nexus { 123 mdio@25520 {
307 #address-cells = <1>; 124 tbi1: tbi-phy@11 {
308 #size-cells = <1>; 125 reg = <0x11>;
309 compatible = "simple-bus"; 126 device_type = "tbi-phy";
310 sleep = <&pmc 0x00000002>;
311 ranges;
312
313 serial0: serial@4500 {
314 cell-index = <0>;
315 device_type = "serial";
316 compatible = "ns16550";
317 reg = <0x4500 0x100>;
318 clock-frequency = <0>;
319 interrupts = <42 2>;
320 interrupt-parent = <&mpic>;
321 };
322
323 serial1: serial@4600 {
324 cell-index = <1>;
325 device_type = "serial";
326 compatible = "ns16550";
327 reg = <0x4600 0x100>;
328 clock-frequency = <0>;
329 interrupts = <42 2>;
330 interrupt-parent = <&mpic>;
331 }; 127 };
332 }; 128 };
333 129
334 global-utilities@e0000 {
335 #address-cells = <1>;
336 #size-cells = <1>;
337 compatible = "fsl,mpc8568-guts", "fsl,mpc8548-guts";
338 reg = <0xe0000 0x1000>;
339 ranges = <0 0xe0000 0x1000>;
340 fsl,has-rstcr;
341
342 pmc: power@70 {
343 compatible = "fsl,mpc8568-pmc",
344 "fsl,mpc8548-pmc";
345 reg = <0x70 0x20>;
346 };
347 };
348
349 crypto@30000 {
350 compatible = "fsl,sec2.1", "fsl,sec2.0";
351 reg = <0x30000 0x10000>;
352 interrupts = <45 2>;
353 interrupt-parent = <&mpic>;
354 fsl,num-channels = <4>;
355 fsl,channel-fifo-len = <24>;
356 fsl,exec-units-mask = <0xfe>;
357 fsl,descriptor-types-mask = <0x12b0ebf>;
358 sleep = <&pmc 0x01000000>;
359 };
360
361 mpic: pic@40000 {
362 interrupt-controller;
363 #address-cells = <0>;
364 #interrupt-cells = <2>;
365 reg = <0x40000 0x40000>;
366 compatible = "chrp,open-pic";
367 device_type = "open-pic";
368 };
369
370 msi@41600 {
371 compatible = "fsl,mpc8568-msi", "fsl,mpic-msi";
372 reg = <0x41600 0x80>;
373 msi-available-ranges = <0 0x100>;
374 interrupts = <
375 0xe0 0
376 0xe1 0
377 0xe2 0
378 0xe3 0
379 0xe4 0
380 0xe5 0
381 0xe6 0
382 0xe7 0>;
383 interrupt-parent = <&mpic>;
384 };
385
386 par_io@e0100 { 130 par_io@e0100 {
387 reg = <0xe0100 0x100>;
388 device_type = "par_io";
389 num-ports = <7>; 131 num-ports = <7>;
390 132
391 pio1: ucc_pin@01 { 133 pio1: ucc_pin@01 {
@@ -448,57 +190,21 @@
448 }; 190 };
449 }; 191 };
450 192
451 qe@e0080000 { 193 qe: qe@e0080000 {
452 #address-cells = <1>; 194 ranges = <0x0 0x0 0xe0080000 0x40000>;
453 #size-cells = <1>; 195 reg = <0x0 0xe0080000 0x0 0x480>;
454 device_type = "qe";
455 compatible = "fsl,qe";
456 ranges = <0x0 0xe0080000 0x40000>;
457 reg = <0xe0080000 0x480>;
458 sleep = <&pmc 0x00000800>;
459 brg-frequency = <0>;
460 bus-frequency = <396000000>;
461 fsl,qe-num-riscs = <2>;
462 fsl,qe-num-snums = <28>;
463
464 muram@10000 {
465 #address-cells = <1>;
466 #size-cells = <1>;
467 compatible = "fsl,qe-muram", "fsl,cpm-muram";
468 ranges = <0x0 0x10000 0x10000>;
469
470 data-only@0 {
471 compatible = "fsl,qe-muram-data",
472 "fsl,cpm-muram-data";
473 reg = <0x0 0x10000>;
474 };
475 };
476 196
477 spi@4c0 { 197 spi@4c0 {
478 cell-index = <0>;
479 compatible = "fsl,spi";
480 reg = <0x4c0 0x40>;
481 interrupts = <2>;
482 interrupt-parent = <&qeic>;
483 mode = "cpu"; 198 mode = "cpu";
484 }; 199 };
485 200
486 spi@500 { 201 spi@500 {
487 cell-index = <1>;
488 compatible = "fsl,spi";
489 reg = <0x500 0x40>;
490 interrupts = <1>;
491 interrupt-parent = <&qeic>;
492 mode = "cpu"; 202 mode = "cpu";
493 }; 203 };
494 204
495 enet2: ucc@2000 { 205 enet2: ucc@2000 {
496 device_type = "network"; 206 device_type = "network";
497 compatible = "ucc_geth"; 207 compatible = "ucc_geth";
498 cell-index = <1>;
499 reg = <0x2000 0x200>;
500 interrupts = <32>;
501 interrupt-parent = <&qeic>;
502 local-mac-address = [ 00 00 00 00 00 00 ]; 208 local-mac-address = [ 00 00 00 00 00 00 ];
503 rx-clock-name = "none"; 209 rx-clock-name = "none";
504 tx-clock-name = "clk16"; 210 tx-clock-name = "clk16";
@@ -510,10 +216,6 @@
510 enet3: ucc@3000 { 216 enet3: ucc@3000 {
511 device_type = "network"; 217 device_type = "network";
512 compatible = "ucc_geth"; 218 compatible = "ucc_geth";
513 cell-index = <2>;
514 reg = <0x3000 0x200>;
515 interrupts = <33>;
516 interrupt-parent = <&qeic>;
517 local-mac-address = [ 00 00 00 00 00 00 ]; 219 local-mac-address = [ 00 00 00 00 00 00 ];
518 rx-clock-name = "none"; 220 rx-clock-name = "none";
519 tx-clock-name = "clk16"; 221 tx-clock-name = "clk16";
@@ -532,102 +234,57 @@
532 * gianfar's MDIO bus */ 234 * gianfar's MDIO bus */
533 qe_phy0: ethernet-phy@07 { 235 qe_phy0: ethernet-phy@07 {
534 interrupt-parent = <&mpic>; 236 interrupt-parent = <&mpic>;
535 interrupts = <1 1>; 237 interrupts = <1 1 0 0>;
536 reg = <0x7>; 238 reg = <0x7>;
537 device_type = "ethernet-phy"; 239 device_type = "ethernet-phy";
538 }; 240 };
539 qe_phy1: ethernet-phy@01 { 241 qe_phy1: ethernet-phy@01 {
540 interrupt-parent = <&mpic>; 242 interrupt-parent = <&mpic>;
541 interrupts = <2 1>; 243 interrupts = <2 1 0 0>;
542 reg = <0x1>; 244 reg = <0x1>;
543 device_type = "ethernet-phy"; 245 device_type = "ethernet-phy";
544 }; 246 };
545 qe_phy2: ethernet-phy@02 { 247 qe_phy2: ethernet-phy@02 {
546 interrupt-parent = <&mpic>; 248 interrupt-parent = <&mpic>;
547 interrupts = <1 1>; 249 interrupts = <1 1 0 0>;
548 reg = <0x2>; 250 reg = <0x2>;
549 device_type = "ethernet-phy"; 251 device_type = "ethernet-phy";
550 }; 252 };
551 qe_phy3: ethernet-phy@03 { 253 qe_phy3: ethernet-phy@03 {
552 interrupt-parent = <&mpic>; 254 interrupt-parent = <&mpic>;
553 interrupts = <2 1>; 255 interrupts = <2 1 0 0>;
554 reg = <0x3>; 256 reg = <0x3>;
555 device_type = "ethernet-phy"; 257 device_type = "ethernet-phy";
556 }; 258 };
557 }; 259 };
558
559 qeic: interrupt-controller@80 {
560 interrupt-controller;
561 compatible = "fsl,qe-ic";
562 #address-cells = <0>;
563 #interrupt-cells = <1>;
564 reg = <0x80 0x80>;
565 big-endian;
566 interrupts = <46 2 46 2>; //high:30 low:30
567 interrupt-parent = <&mpic>;
568 };
569
570 }; 260 };
571 261
572 pci0: pci@e0008000 { 262 pci0: pci@e0008000 {
263 reg = <0x0 0xe0008000 0x0 0x1000>;
264 ranges = <0x2000000 0x0 0x80000000 0x0 0x80000000 0x0 0x20000000
265 0x1000000 0x0 0x00000000 0x0 0xe2000000 0x0 0x800000>;
266 clock-frequency = <66666666>;
573 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 267 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
574 interrupt-map = < 268 interrupt-map = <
575 /* IDSEL 0x12 AD18 */ 269 /* IDSEL 0x12 AD18 */
576 0x9000 0x0 0x0 0x1 &mpic 0x5 0x1 270 0x9000 0x0 0x0 0x1 &mpic 0x5 0x1 0 0
577 0x9000 0x0 0x0 0x2 &mpic 0x6 0x1 271 0x9000 0x0 0x0 0x2 &mpic 0x6 0x1 0 0
578 0x9000 0x0 0x0 0x3 &mpic 0x7 0x1 272 0x9000 0x0 0x0 0x3 &mpic 0x7 0x1 0 0
579 0x9000 0x0 0x0 0x4 &mpic 0x4 0x1 273 0x9000 0x0 0x0 0x4 &mpic 0x4 0x1 0 0
580 274
581 /* IDSEL 0x13 AD19 */ 275 /* IDSEL 0x13 AD19 */
582 0x9800 0x0 0x0 0x1 &mpic 0x6 0x1 276 0x9800 0x0 0x0 0x1 &mpic 0x6 0x1 0 0
583 0x9800 0x0 0x0 0x2 &mpic 0x7 0x1 277 0x9800 0x0 0x0 0x2 &mpic 0x7 0x1 0 0
584 0x9800 0x0 0x0 0x3 &mpic 0x4 0x1 278 0x9800 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
585 0x9800 0x0 0x0 0x4 &mpic 0x5 0x1>; 279 0x9800 0x0 0x0 0x4 &mpic 0x5 0x1 0 0>;
586
587 interrupt-parent = <&mpic>;
588 interrupts = <24 2>;
589 bus-range = <0 255>;
590 ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
591 0x1000000 0x0 0x0 0xe2000000 0x0 0x800000>;
592 sleep = <&pmc 0x80000000>;
593 clock-frequency = <66666666>;
594 #interrupt-cells = <1>;
595 #size-cells = <2>;
596 #address-cells = <3>;
597 reg = <0xe0008000 0x1000>;
598 compatible = "fsl,mpc8540-pci";
599 device_type = "pci";
600 }; 280 };
601 281
602 /* PCI Express */ 282 /* PCI Express */
603 pci1: pcie@e000a000 { 283 pci1: pcie@e000a000 {
604 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 284 ranges = <0x2000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x10000000
605 interrupt-map = < 285 0x1000000 0x0 0x00000000 0x0 0xe2800000 0x0 0x800000>;
606 286 reg = <0x0 0xe000a000 0x0 0x1000>;
607 /* IDSEL 0x0 (PEX) */
608 00000 0x0 0x0 0x1 &mpic 0x0 0x1
609 00000 0x0 0x0 0x2 &mpic 0x1 0x1
610 00000 0x0 0x0 0x3 &mpic 0x2 0x1
611 00000 0x0 0x0 0x4 &mpic 0x3 0x1>;
612
613 interrupt-parent = <&mpic>;
614 interrupts = <26 2>;
615 bus-range = <0 255>;
616 ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000
617 0x1000000 0x0 0x0 0xe2800000 0x0 0x800000>;
618 sleep = <&pmc 0x20000000>;
619 clock-frequency = <33333333>;
620 #interrupt-cells = <1>;
621 #size-cells = <2>;
622 #address-cells = <3>;
623 reg = <0xe000a000 0x1000>;
624 compatible = "fsl,mpc8548-pcie";
625 device_type = "pci";
626 pcie@0 { 287 pcie@0 {
627 reg = <0x0 0x0 0x0 0x0 0x0>;
628 #size-cells = <2>;
629 #address-cells = <3>;
630 device_type = "pci";
631 ranges = <0x2000000 0x0 0xa0000000 288 ranges = <0x2000000 0x0 0xa0000000
632 0x2000000 0x0 0xa0000000 289 0x2000000 0x0 0xa0000000
633 0x0 0x10000000 290 0x0 0x10000000
@@ -638,22 +295,11 @@
638 }; 295 };
639 }; 296 };
640 297
641 rio0: rapidio@e00c00000 { 298 rio: rapidio@e00c00000 {
642 #address-cells = <2>; 299 reg = <0x0 0xe00c0000 0x0 0x20000>;
643 #size-cells = <2>; 300 port1 {
644 compatible = "fsl,mpc8568-rapidio", "fsl,rapidio-delta"; 301 ranges = <0x0 0x0 0x0 0xc0000000 0x0 0x20000000>;
645 reg = <0xe00c0000 0x20000>; 302 };
646 ranges = <0x0 0x0 0xc0000000 0x0 0x20000000>;
647 interrupts = <48 2 /* error */
648 49 2 /* bell_outb */
649 50 2 /* bell_inb */
650 53 2 /* msg1_tx */
651 54 2 /* msg1_rx */
652 55 2 /* msg2_tx */
653 56 2 /* msg2_rx */>;
654 interrupt-parent = <&mpic>;
655 sleep = <&pmc 0x00080000 /* controller */
656 &pmc 0x00040000>; /* message unit */
657 }; 303 };
658 304
659 leds { 305 leds {
@@ -672,3 +318,5 @@
672 }; 318 };
673 }; 319 };
674}; 320};
321
322/include/ "fsl/mpc8568si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
index 8b72eaff5b03..7e283c891b7f 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -9,66 +9,36 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8569si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "MPC8569EMDS"; 15 model = "MPC8569EMDS";
16 compatible = "fsl,MPC8569EMDS"; 16 compatible = "fsl,MPC8569EMDS";
17 #address-cells = <1>; 17 #address-cells = <2>;
18 #size-cells = <1>; 18 #size-cells = <2>;
19 interrupt-parent = <&mpic>;
19 20
20 aliases { 21 aliases {
21 serial0 = &serial0;
22 serial1 = &serial1;
23 ethernet0 = &enet0;
24 ethernet1 = &enet1;
25 ethernet2 = &enet2; 22 ethernet2 = &enet2;
26 ethernet3 = &enet3; 23 ethernet3 = &enet3;
27 ethernet5 = &enet5; 24 ethernet5 = &enet5;
28 ethernet7 = &enet7; 25 ethernet7 = &enet7;
29 pci1 = &pci1; 26 rapidio0 = &rio;
30 rapidio0 = &rio0;
31 };
32
33 cpus {
34 #address-cells = <1>;
35 #size-cells = <0>;
36
37 PowerPC,8569@0 {
38 device_type = "cpu";
39 reg = <0x0>;
40 d-cache-line-size = <32>; // 32 bytes
41 i-cache-line-size = <32>; // 32 bytes
42 d-cache-size = <0x8000>; // L1, 32K
43 i-cache-size = <0x8000>; // L1, 32K
44 sleep = <&pmc 0x00008000 // core
45 &pmc 0x00004000>; // timebase
46 timebase-frequency = <0>;
47 bus-frequency = <0>;
48 clock-frequency = <0>;
49 next-level-cache = <&L2>;
50 };
51 }; 27 };
52 28
53 memory { 29 memory {
54 device_type = "memory"; 30 device_type = "memory";
55 }; 31 };
56 32
57 localbus@e0005000 { 33 lbc: localbus@e0005000 {
58 #address-cells = <2>; 34 reg = <0x0 0xe0005000 0x0 0x1000>;
59 #size-cells = <1>; 35
60 compatible = "fsl,mpc8569-elbc", "fsl,elbc", "simple-bus"; 36 ranges = <0x0 0x0 0x0 0xfe000000 0x02000000
61 reg = <0xe0005000 0x1000>; 37 0x1 0x0 0x0 0xf8000000 0x00008000
62 interrupts = <19 2>; 38 0x2 0x0 0x0 0xf0000000 0x04000000
63 interrupt-parent = <&mpic>; 39 0x3 0x0 0x0 0xfc000000 0x00008000
64 sleep = <&pmc 0x08000000>; 40 0x4 0x0 0x0 0xf8008000 0x00008000
65 41 0x5 0x0 0x0 0xf8010000 0x00008000>;
66 ranges = <0x0 0x0 0xfe000000 0x02000000
67 0x1 0x0 0xf8000000 0x00008000
68 0x2 0x0 0xf0000000 0x04000000
69 0x3 0x0 0xfc000000 0x00008000
70 0x4 0x0 0xf8008000 0x00008000
71 0x5 0x0 0xf8010000 0x00008000>;
72 42
73 nor@0,0 { 43 nor@0,0 {
74 #address-cells = <1>; 44 #address-cells = <1>;
@@ -133,220 +103,25 @@
133 }; 103 };
134 }; 104 };
135 105
136 soc@e0000000 { 106 soc: soc@e0000000 {
137 #address-cells = <1>; 107 ranges = <0x0 0x0 0xe0000000 0x100000>;
138 #size-cells = <1>;
139 device_type = "soc";
140 compatible = "fsl,mpc8569-immr", "simple-bus";
141 ranges = <0x0 0xe0000000 0x100000>;
142 bus-frequency = <0>;
143
144 ecm-law@0 {
145 compatible = "fsl,ecm-law";
146 reg = <0x0 0x1000>;
147 fsl,num-laws = <10>;
148 };
149
150 ecm@1000 {
151 compatible = "fsl,mpc8569-ecm", "fsl,ecm";
152 reg = <0x1000 0x1000>;
153 interrupts = <17 2>;
154 interrupt-parent = <&mpic>;
155 };
156
157 memory-controller@2000 {
158 compatible = "fsl,mpc8569-memory-controller";
159 reg = <0x2000 0x1000>;
160 interrupt-parent = <&mpic>;
161 interrupts = <18 2>;
162 };
163 108
164 i2c-sleep-nexus { 109 i2c-sleep-nexus {
165 #address-cells = <1>;
166 #size-cells = <1>;
167 compatible = "simple-bus";
168 sleep = <&pmc 0x00000004>;
169 ranges;
170
171 i2c@3000 { 110 i2c@3000 {
172 #address-cells = <1>;
173 #size-cells = <0>;
174 cell-index = <0>;
175 compatible = "fsl-i2c";
176 reg = <0x3000 0x100>;
177 interrupts = <43 2>;
178 interrupt-parent = <&mpic>;
179 dfsrr;
180
181 rtc@68 { 111 rtc@68 {
182 compatible = "dallas,ds1374"; 112 compatible = "dallas,ds1374";
183 reg = <0x68>; 113 reg = <0x68>;
184 interrupts = <3 1>; 114 interrupts = <3 1 0 0>;
185 interrupt-parent = <&mpic>;
186 }; 115 };
187 }; 116 };
188
189 i2c@3100 {
190 #address-cells = <1>;
191 #size-cells = <0>;
192 cell-index = <1>;
193 compatible = "fsl-i2c";
194 reg = <0x3100 0x100>;
195 interrupts = <43 2>;
196 interrupt-parent = <&mpic>;
197 dfsrr;
198 };
199 };
200
201 duart-sleep-nexus {
202 #address-cells = <1>;
203 #size-cells = <1>;
204 compatible = "simple-bus";
205 sleep = <&pmc 0x00000002>;
206 ranges;
207
208 serial0: serial@4500 {
209 cell-index = <0>;
210 device_type = "serial";
211 compatible = "ns16550";
212 reg = <0x4500 0x100>;
213 clock-frequency = <0>;
214 interrupts = <42 2>;
215 interrupt-parent = <&mpic>;
216 };
217
218 serial1: serial@4600 {
219 cell-index = <1>;
220 device_type = "serial";
221 compatible = "ns16550";
222 reg = <0x4600 0x100>;
223 clock-frequency = <0>;
224 interrupts = <42 2>;
225 interrupt-parent = <&mpic>;
226 };
227 };
228
229 L2: l2-cache-controller@20000 {
230 compatible = "fsl,mpc8569-l2-cache-controller";
231 reg = <0x20000 0x1000>;
232 cache-line-size = <32>; // 32 bytes
233 cache-size = <0x80000>; // L2, 512K
234 interrupt-parent = <&mpic>;
235 interrupts = <16 2>;
236 }; 117 };
237 118
238 dma@21300 { 119 sdhc@2e000 {
239 #address-cells = <1>;
240 #size-cells = <1>;
241 compatible = "fsl,mpc8569-dma", "fsl,eloplus-dma";
242 reg = <0x21300 0x4>;
243 ranges = <0x0 0x21100 0x200>;
244 cell-index = <0>;
245 dma-channel@0 {
246 compatible = "fsl,mpc8569-dma-channel",
247 "fsl,eloplus-dma-channel";
248 reg = <0x0 0x80>;
249 cell-index = <0>;
250 interrupt-parent = <&mpic>;
251 interrupts = <20 2>;
252 };
253 dma-channel@80 {
254 compatible = "fsl,mpc8569-dma-channel",
255 "fsl,eloplus-dma-channel";
256 reg = <0x80 0x80>;
257 cell-index = <1>;
258 interrupt-parent = <&mpic>;
259 interrupts = <21 2>;
260 };
261 dma-channel@100 {
262 compatible = "fsl,mpc8569-dma-channel",
263 "fsl,eloplus-dma-channel";
264 reg = <0x100 0x80>;
265 cell-index = <2>;
266 interrupt-parent = <&mpic>;
267 interrupts = <22 2>;
268 };
269 dma-channel@180 {
270 compatible = "fsl,mpc8569-dma-channel",
271 "fsl,eloplus-dma-channel";
272 reg = <0x180 0x80>;
273 cell-index = <3>;
274 interrupt-parent = <&mpic>;
275 interrupts = <23 2>;
276 };
277 };
278
279 sdhci@2e000 {
280 compatible = "fsl,mpc8569-esdhc", "fsl,esdhc";
281 reg = <0x2e000 0x1000>;
282 interrupts = <72 0x8>;
283 interrupt-parent = <&mpic>;
284 sleep = <&pmc 0x00200000>;
285 /* Filled in by U-Boot */
286 clock-frequency = <0>;
287 status = "disabled"; 120 status = "disabled";
288 sdhci,1-bit-only; 121 sdhci,1-bit-only;
289 }; 122 };
290 123
291 crypto@30000 {
292 compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
293 "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
294 reg = <0x30000 0x10000>;
295 interrupts = <45 2 58 2>;
296 interrupt-parent = <&mpic>;
297 fsl,num-channels = <4>;
298 fsl,channel-fifo-len = <24>;
299 fsl,exec-units-mask = <0xbfe>;
300 fsl,descriptor-types-mask = <0x3ab0ebf>;
301 sleep = <&pmc 0x01000000>;
302 };
303
304 mpic: pic@40000 {
305 interrupt-controller;
306 #address-cells = <0>;
307 #interrupt-cells = <2>;
308 reg = <0x40000 0x40000>;
309 compatible = "chrp,open-pic";
310 device_type = "open-pic";
311 };
312
313 msi@41600 {
314 compatible = "fsl,mpc8568-msi", "fsl,mpic-msi";
315 reg = <0x41600 0x80>;
316 msi-available-ranges = <0 0x100>;
317 interrupts = <
318 0xe0 0
319 0xe1 0
320 0xe2 0
321 0xe3 0
322 0xe4 0
323 0xe5 0
324 0xe6 0
325 0xe7 0>;
326 interrupt-parent = <&mpic>;
327 };
328
329 global-utilities@e0000 {
330 #address-cells = <1>;
331 #size-cells = <1>;
332 compatible = "fsl,mpc8569-guts", "fsl,mpc8548-guts";
333 reg = <0xe0000 0x1000>;
334 ranges = <0 0xe0000 0x1000>;
335 fsl,has-rstcr;
336
337 pmc: power@70 {
338 compatible = "fsl,mpc8569-pmc",
339 "fsl,mpc8548-pmc";
340 reg = <0x70 0x20>;
341 };
342 };
343
344 par_io@e0100 { 124 par_io@e0100 {
345 #address-cells = <1>;
346 #size-cells = <1>;
347 reg = <0xe0100 0x100>;
348 ranges = <0x0 0xe0100 0x100>;
349 device_type = "par_io";
350 num-ports = <7>; 125 num-ports = <7>;
351 126
352 qe_pio_e: gpio-controller@80 { 127 qe_pio_e: gpio-controller@80 {
@@ -447,47 +222,11 @@
447 }; 222 };
448 }; 223 };
449 224
450 qe@e0080000 { 225 qe: qe@e0080000 {
451 #address-cells = <1>; 226 ranges = <0x0 0x0 0xe0080000 0x40000>;
452 #size-cells = <1>; 227 reg = <0x0 0xe0080000 0x0 0x480>;
453 device_type = "qe";
454 compatible = "fsl,qe";
455 ranges = <0x0 0xe0080000 0x40000>;
456 reg = <0xe0080000 0x480>;
457 sleep = <&pmc 0x00000800>;
458 brg-frequency = <0>;
459 bus-frequency = <0>;
460 fsl,qe-num-riscs = <4>;
461 fsl,qe-num-snums = <46>;
462
463 qeic: interrupt-controller@80 {
464 interrupt-controller;
465 compatible = "fsl,qe-ic";
466 #address-cells = <0>;
467 #interrupt-cells = <1>;
468 reg = <0x80 0x80>;
469 interrupts = <46 2 46 2>; //high:30 low:30
470 interrupt-parent = <&mpic>;
471 };
472
473 timer@440 {
474 compatible = "fsl,mpc8569-qe-gtm",
475 "fsl,qe-gtm", "fsl,gtm";
476 reg = <0x440 0x40>;
477 interrupts = <12 13 14 15>;
478 interrupt-parent = <&qeic>;
479 /* Filled in by U-Boot */
480 clock-frequency = <0>;
481 };
482 228
483 spi@4c0 { 229 spi@4c0 {
484 #address-cells = <1>;
485 #size-cells = <0>;
486 compatible = "fsl,mpc8569-qe-spi", "fsl,spi";
487 reg = <0x4c0 0x40>;
488 cell-index = <0>;
489 interrupts = <2>;
490 interrupt-parent = <&qeic>;
491 gpios = <&qe_pio_e 30 0>; 230 gpios = <&qe_pio_e 30 0>;
492 mode = "cpu-qe"; 231 mode = "cpu-qe";
493 232
@@ -499,20 +238,10 @@
499 }; 238 };
500 239
501 spi@500 { 240 spi@500 {
502 cell-index = <1>;
503 compatible = "fsl,spi";
504 reg = <0x500 0x40>;
505 interrupts = <1>;
506 interrupt-parent = <&qeic>;
507 mode = "cpu"; 241 mode = "cpu";
508 }; 242 };
509 243
510 usb@6c0 { 244 usb@6c0 {
511 compatible = "fsl,mpc8569-qe-usb",
512 "fsl,mpc8323-qe-usb";
513 reg = <0x6c0 0x40 0x8b00 0x100>;
514 interrupts = <11>;
515 interrupt-parent = <&qeic>;
516 fsl,fullspeed-clock = "clk5"; 245 fsl,fullspeed-clock = "clk5";
517 fsl,lowspeed-clock = "brg10"; 246 fsl,lowspeed-clock = "brg10";
518 gpios = <&qe_pio_f 3 0 /* USBOE */ 247 gpios = <&qe_pio_f 3 0 /* USBOE */
@@ -527,10 +256,6 @@
527 enet0: ucc@2000 { 256 enet0: ucc@2000 {
528 device_type = "network"; 257 device_type = "network";
529 compatible = "ucc_geth"; 258 compatible = "ucc_geth";
530 cell-index = <1>;
531 reg = <0x2000 0x200>;
532 interrupts = <32>;
533 interrupt-parent = <&qeic>;
534 local-mac-address = [ 00 00 00 00 00 00 ]; 259 local-mac-address = [ 00 00 00 00 00 00 ];
535 rx-clock-name = "none"; 260 rx-clock-name = "none";
536 tx-clock-name = "clk12"; 261 tx-clock-name = "clk12";
@@ -548,35 +273,33 @@
548 273
549 qe_phy0: ethernet-phy@07 { 274 qe_phy0: ethernet-phy@07 {
550 interrupt-parent = <&mpic>; 275 interrupt-parent = <&mpic>;
551 interrupts = <1 1>; 276 interrupts = <1 1 0 0>;
552 reg = <0x7>; 277 reg = <0x7>;
553 device_type = "ethernet-phy"; 278 device_type = "ethernet-phy";
554 }; 279 };
555 qe_phy1: ethernet-phy@01 { 280 qe_phy1: ethernet-phy@01 {
556 interrupt-parent = <&mpic>; 281 interrupt-parent = <&mpic>;
557 interrupts = <2 1>; 282 interrupts = <2 1 0 0>;
558 reg = <0x1>; 283 reg = <0x1>;
559 device_type = "ethernet-phy"; 284 device_type = "ethernet-phy";
560 }; 285 };
561 qe_phy2: ethernet-phy@02 { 286 qe_phy2: ethernet-phy@02 {
562 interrupt-parent = <&mpic>; 287 interrupt-parent = <&mpic>;
563 interrupts = <3 1>; 288 interrupts = <3 1 0 0>;
564 reg = <0x2>; 289 reg = <0x2>;
565 device_type = "ethernet-phy"; 290 device_type = "ethernet-phy";
566 }; 291 };
567 qe_phy3: ethernet-phy@03 { 292 qe_phy3: ethernet-phy@03 {
568 interrupt-parent = <&mpic>; 293 interrupt-parent = <&mpic>;
569 interrupts = <4 1>; 294 interrupts = <4 1 0 0>;
570 reg = <0x3>; 295 reg = <0x3>;
571 device_type = "ethernet-phy"; 296 device_type = "ethernet-phy";
572 }; 297 };
573 qe_phy5: ethernet-phy@04 { 298 qe_phy5: ethernet-phy@04 {
574 interrupt-parent = <&mpic>;
575 reg = <0x04>; 299 reg = <0x04>;
576 device_type = "ethernet-phy"; 300 device_type = "ethernet-phy";
577 }; 301 };
578 qe_phy7: ethernet-phy@06 { 302 qe_phy7: ethernet-phy@06 {
579 interrupt-parent = <&mpic>;
580 reg = <0x6>; 303 reg = <0x6>;
581 device_type = "ethernet-phy"; 304 device_type = "ethernet-phy";
582 }; 305 };
@@ -610,10 +333,6 @@
610 enet2: ucc@2200 { 333 enet2: ucc@2200 {
611 device_type = "network"; 334 device_type = "network";
612 compatible = "ucc_geth"; 335 compatible = "ucc_geth";
613 cell-index = <3>;
614 reg = <0x2200 0x200>;
615 interrupts = <34>;
616 interrupt-parent = <&qeic>;
617 local-mac-address = [ 00 00 00 00 00 00 ]; 336 local-mac-address = [ 00 00 00 00 00 00 ];
618 rx-clock-name = "none"; 337 rx-clock-name = "none";
619 tx-clock-name = "clk12"; 338 tx-clock-name = "clk12";
@@ -637,10 +356,6 @@
637 enet1: ucc@3000 { 356 enet1: ucc@3000 {
638 device_type = "network"; 357 device_type = "network";
639 compatible = "ucc_geth"; 358 compatible = "ucc_geth";
640 cell-index = <2>;
641 reg = <0x3000 0x200>;
642 interrupts = <33>;
643 interrupt-parent = <&qeic>;
644 local-mac-address = [ 00 00 00 00 00 00 ]; 359 local-mac-address = [ 00 00 00 00 00 00 ];
645 rx-clock-name = "none"; 360 rx-clock-name = "none";
646 tx-clock-name = "clk17"; 361 tx-clock-name = "clk17";
@@ -664,10 +379,6 @@
664 enet3: ucc@3200 { 379 enet3: ucc@3200 {
665 device_type = "network"; 380 device_type = "network";
666 compatible = "ucc_geth"; 381 compatible = "ucc_geth";
667 cell-index = <4>;
668 reg = <0x3200 0x200>;
669 interrupts = <35>;
670 interrupt-parent = <&qeic>;
671 local-mac-address = [ 00 00 00 00 00 00 ]; 382 local-mac-address = [ 00 00 00 00 00 00 ];
672 rx-clock-name = "none"; 383 rx-clock-name = "none";
673 tx-clock-name = "clk17"; 384 tx-clock-name = "clk17";
@@ -691,10 +402,6 @@
691 enet5: ucc@3400 { 402 enet5: ucc@3400 {
692 device_type = "network"; 403 device_type = "network";
693 compatible = "ucc_geth"; 404 compatible = "ucc_geth";
694 cell-index = <6>;
695 reg = <0x3400 0x200>;
696 interrupts = <41>;
697 interrupt-parent = <&qeic>;
698 local-mac-address = [ 00 00 00 00 00 00 ]; 405 local-mac-address = [ 00 00 00 00 00 00 ];
699 rx-clock-name = "none"; 406 rx-clock-name = "none";
700 tx-clock-name = "none"; 407 tx-clock-name = "none";
@@ -706,10 +413,6 @@
706 enet7: ucc@3600 { 413 enet7: ucc@3600 {
707 device_type = "network"; 414 device_type = "network";
708 compatible = "ucc_geth"; 415 compatible = "ucc_geth";
709 cell-index = <8>;
710 reg = <0x3600 0x200>;
711 interrupts = <43>;
712 interrupt-parent = <&qeic>;
713 local-mac-address = [ 00 00 00 00 00 00 ]; 416 local-mac-address = [ 00 00 00 00 00 00 ];
714 rx-clock-name = "none"; 417 rx-clock-name = "none";
715 tx-clock-name = "none"; 418 tx-clock-name = "none";
@@ -717,50 +420,14 @@
717 phy-handle = <&qe_phy7>; 420 phy-handle = <&qe_phy7>;
718 phy-connection-type = "sgmii"; 421 phy-connection-type = "sgmii";
719 }; 422 };
720
721 muram@10000 {
722 #address-cells = <1>;
723 #size-cells = <1>;
724 compatible = "fsl,qe-muram", "fsl,cpm-muram";
725 ranges = <0x0 0x10000 0x20000>;
726
727 data-only@0 {
728 compatible = "fsl,qe-muram-data",
729 "fsl,cpm-muram-data";
730 reg = <0x0 0x20000>;
731 };
732 };
733
734 }; 423 };
735 424
736 /* PCI Express */ 425 /* PCI Express */
737 pci1: pcie@e000a000 { 426 pci1: pcie@e000a000 {
738 compatible = "fsl,mpc8548-pcie"; 427 reg = <0x0 0xe000a000 0x0 0x1000>;
739 device_type = "pci"; 428 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x10000000
740 #interrupt-cells = <1>; 429 0x1000000 0x0 0x00000000 0 0xe2800000 0x0 0x00800000>;
741 #size-cells = <2>;
742 #address-cells = <3>;
743 reg = <0xe000a000 0x1000>;
744 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
745 interrupt-map = <
746 /* IDSEL 0x0 (PEX) */
747 00000 0x0 0x0 0x1 &mpic 0x0 0x1
748 00000 0x0 0x0 0x2 &mpic 0x1 0x1
749 00000 0x0 0x0 0x3 &mpic 0x2 0x1
750 00000 0x0 0x0 0x4 &mpic 0x3 0x1>;
751
752 interrupt-parent = <&mpic>;
753 interrupts = <26 2>;
754 bus-range = <0 255>;
755 ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000
756 0x1000000 0x0 0x00000000 0xe2800000 0x0 0x00800000>;
757 sleep = <&pmc 0x20000000>;
758 clock-frequency = <33333333>;
759 pcie@0 { 430 pcie@0 {
760 reg = <0x0 0x0 0x0 0x0 0x0>;
761 #size-cells = <2>;
762 #address-cells = <3>;
763 device_type = "pci";
764 ranges = <0x2000000 0x0 0xa0000000 431 ranges = <0x2000000 0x0 0xa0000000
765 0x2000000 0x0 0xa0000000 432 0x2000000 0x0 0xa0000000
766 0x0 0x10000000 433 0x0 0x10000000
@@ -771,20 +438,15 @@
771 }; 438 };
772 }; 439 };
773 440
774 rio0: rapidio@e00c00000 { 441 rio: rapidio@e00c00000 {
775 #address-cells = <2>; 442 reg = <0x0 0xe00c0000 0x0 0x20000>;
776 #size-cells = <2>; 443 port1 {
777 compatible = "fsl,mpc8569-rapidio", "fsl,rapidio-delta"; 444 ranges = <0x0 0x0 0x0 0xc0000000 0x0 0x20000000>;
778 reg = <0xe00c0000 0x20000>; 445 };
779 ranges = <0x0 0x0 0xc0000000 0x0 0x20000000>; 446 port2 {
780 interrupts = <48 2 /* error */ 447 status = "disabled";
781 49 2 /* bell_outb */ 448 };
782 50 2 /* bell_inb */
783 53 2 /* msg1_tx */
784 54 2 /* msg1_rx */
785 55 2 /* msg2_tx */
786 56 2 /* msg2_rx */>;
787 interrupt-parent = <&mpic>;
788 sleep = <&pmc 0x00080000>;
789 }; 449 };
790}; 450};
451
452/include/ "fsl/mpc8569si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
index f6c04d25e916..0c9f2955deb4 100644
--- a/arch/powerpc/boot/dts/mpc8572ds.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -9,67 +9,18 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8572si-pre.dtsi"
13
13/ { 14/ {
14 model = "fsl,MPC8572DS"; 15 model = "fsl,MPC8572DS";
15 compatible = "fsl,MPC8572DS"; 16 compatible = "fsl,MPC8572DS";
16 #address-cells = <2>;
17 #size-cells = <2>;
18
19 aliases {
20 ethernet0 = &enet0;
21 ethernet1 = &enet1;
22 ethernet2 = &enet2;
23 ethernet3 = &enet3;
24 serial0 = &serial0;
25 serial1 = &serial1;
26 pci0 = &pci0;
27 pci1 = &pci1;
28 pci2 = &pci2;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 PowerPC,8572@0 {
36 device_type = "cpu";
37 reg = <0x0>;
38 d-cache-line-size = <32>; // 32 bytes
39 i-cache-line-size = <32>; // 32 bytes
40 d-cache-size = <0x8000>; // L1, 32K
41 i-cache-size = <0x8000>; // L1, 32K
42 timebase-frequency = <0>;
43 bus-frequency = <0>;
44 clock-frequency = <0>;
45 next-level-cache = <&L2>;
46 };
47
48 PowerPC,8572@1 {
49 device_type = "cpu";
50 reg = <0x1>;
51 d-cache-line-size = <32>; // 32 bytes
52 i-cache-line-size = <32>; // 32 bytes
53 d-cache-size = <0x8000>; // L1, 32K
54 i-cache-size = <0x8000>; // L1, 32K
55 timebase-frequency = <0>;
56 bus-frequency = <0>;
57 clock-frequency = <0>;
58 next-level-cache = <&L2>;
59 };
60 };
61 17
62 memory { 18 memory {
63 device_type = "memory"; 19 device_type = "memory";
64 }; 20 };
65 21
66 localbus@ffe05000 { 22 board_lbc: lbc: localbus@ffe05000 {
67 #address-cells = <2>;
68 #size-cells = <1>;
69 compatible = "fsl,mpc8572-elbc", "fsl,elbc", "simple-bus";
70 reg = <0 0xffe05000 0 0x1000>; 23 reg = <0 0xffe05000 0 0x1000>;
71 interrupts = <19 2>;
72 interrupt-parent = <&mpic>;
73 24
74 ranges = <0x0 0x0 0x0 0xe8000000 0x08000000 25 ranges = <0x0 0x0 0x0 0xe8000000 0x08000000
75 0x1 0x0 0x0 0xe0000000 0x08000000 26 0x1 0x0 0x0 0xe0000000 0x08000000
@@ -78,601 +29,17 @@
78 0x4 0x0 0x0 0xffa40000 0x00040000 29 0x4 0x0 0x0 0xffa40000 0x00040000
79 0x5 0x0 0x0 0xffa80000 0x00040000 30 0x5 0x0 0x0 0xffa80000 0x00040000
80 0x6 0x0 0x0 0xffac0000 0x00040000>; 31 0x6 0x0 0x0 0xffac0000 0x00040000>;
81
82 nor@0,0 {
83 #address-cells = <1>;
84 #size-cells = <1>;
85 compatible = "cfi-flash";
86 reg = <0x0 0x0 0x8000000>;
87 bank-width = <2>;
88 device-width = <1>;
89
90 ramdisk@0 {
91 reg = <0x0 0x03000000>;
92 read-only;
93 };
94
95 diagnostic@3000000 {
96 reg = <0x03000000 0x00e00000>;
97 read-only;
98 };
99
100 dink@3e00000 {
101 reg = <0x03e00000 0x00200000>;
102 read-only;
103 };
104
105 kernel@4000000 {
106 reg = <0x04000000 0x00400000>;
107 read-only;
108 };
109
110 jffs2@4400000 {
111 reg = <0x04400000 0x03b00000>;
112 };
113
114 dtb@7f00000 {
115 reg = <0x07f00000 0x00080000>;
116 read-only;
117 };
118
119 u-boot@7f80000 {
120 reg = <0x07f80000 0x00080000>;
121 read-only;
122 };
123 };
124
125 nand@2,0 {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 compatible = "fsl,mpc8572-fcm-nand",
129 "fsl,elbc-fcm-nand";
130 reg = <0x2 0x0 0x40000>;
131
132 u-boot@0 {
133 reg = <0x0 0x02000000>;
134 read-only;
135 };
136
137 jffs2@2000000 {
138 reg = <0x02000000 0x10000000>;
139 };
140
141 ramdisk@12000000 {
142 reg = <0x12000000 0x08000000>;
143 read-only;
144 };
145
146 kernel@1a000000 {
147 reg = <0x1a000000 0x04000000>;
148 };
149
150 dtb@1e000000 {
151 reg = <0x1e000000 0x01000000>;
152 read-only;
153 };
154
155 empty@1f000000 {
156 reg = <0x1f000000 0x21000000>;
157 };
158 };
159
160 nand@4,0 {
161 compatible = "fsl,mpc8572-fcm-nand",
162 "fsl,elbc-fcm-nand";
163 reg = <0x4 0x0 0x40000>;
164 };
165
166 nand@5,0 {
167 compatible = "fsl,mpc8572-fcm-nand",
168 "fsl,elbc-fcm-nand";
169 reg = <0x5 0x0 0x40000>;
170 };
171
172 nand@6,0 {
173 compatible = "fsl,mpc8572-fcm-nand",
174 "fsl,elbc-fcm-nand";
175 reg = <0x6 0x0 0x40000>;
176 };
177 }; 32 };
178 33
179 soc8572@ffe00000 { 34 board_soc: soc: soc8572@ffe00000 {
180 #address-cells = <1>;
181 #size-cells = <1>;
182 device_type = "soc";
183 compatible = "simple-bus";
184 ranges = <0x0 0 0xffe00000 0x100000>; 35 ranges = <0x0 0 0xffe00000 0x100000>;
185 bus-frequency = <0>; // Filled out by uboot.
186
187 ecm-law@0 {
188 compatible = "fsl,ecm-law";
189 reg = <0x0 0x1000>;
190 fsl,num-laws = <12>;
191 };
192
193 ecm@1000 {
194 compatible = "fsl,mpc8572-ecm", "fsl,ecm";
195 reg = <0x1000 0x1000>;
196 interrupts = <17 2>;
197 interrupt-parent = <&mpic>;
198 };
199
200 memory-controller@2000 {
201 compatible = "fsl,mpc8572-memory-controller";
202 reg = <0x2000 0x1000>;
203 interrupt-parent = <&mpic>;
204 interrupts = <18 2>;
205 };
206
207 memory-controller@6000 {
208 compatible = "fsl,mpc8572-memory-controller";
209 reg = <0x6000 0x1000>;
210 interrupt-parent = <&mpic>;
211 interrupts = <18 2>;
212 };
213
214 L2: l2-cache-controller@20000 {
215 compatible = "fsl,mpc8572-l2-cache-controller";
216 reg = <0x20000 0x1000>;
217 cache-line-size = <32>; // 32 bytes
218 cache-size = <0x100000>; // L2, 1M
219 interrupt-parent = <&mpic>;
220 interrupts = <16 2>;
221 };
222
223 i2c@3000 {
224 #address-cells = <1>;
225 #size-cells = <0>;
226 cell-index = <0>;
227 compatible = "fsl-i2c";
228 reg = <0x3000 0x100>;
229 interrupts = <43 2>;
230 interrupt-parent = <&mpic>;
231 dfsrr;
232 };
233
234 i2c@3100 {
235 #address-cells = <1>;
236 #size-cells = <0>;
237 cell-index = <1>;
238 compatible = "fsl-i2c";
239 reg = <0x3100 0x100>;
240 interrupts = <43 2>;
241 interrupt-parent = <&mpic>;
242 dfsrr;
243 };
244
245 dma@c300 {
246 #address-cells = <1>;
247 #size-cells = <1>;
248 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma";
249 reg = <0xc300 0x4>;
250 ranges = <0x0 0xc100 0x200>;
251 cell-index = <1>;
252 dma-channel@0 {
253 compatible = "fsl,mpc8572-dma-channel",
254 "fsl,eloplus-dma-channel";
255 reg = <0x0 0x80>;
256 cell-index = <0>;
257 interrupt-parent = <&mpic>;
258 interrupts = <76 2>;
259 };
260 dma-channel@80 {
261 compatible = "fsl,mpc8572-dma-channel",
262 "fsl,eloplus-dma-channel";
263 reg = <0x80 0x80>;
264 cell-index = <1>;
265 interrupt-parent = <&mpic>;
266 interrupts = <77 2>;
267 };
268 dma-channel@100 {
269 compatible = "fsl,mpc8572-dma-channel",
270 "fsl,eloplus-dma-channel";
271 reg = <0x100 0x80>;
272 cell-index = <2>;
273 interrupt-parent = <&mpic>;
274 interrupts = <78 2>;
275 };
276 dma-channel@180 {
277 compatible = "fsl,mpc8572-dma-channel",
278 "fsl,eloplus-dma-channel";
279 reg = <0x180 0x80>;
280 cell-index = <3>;
281 interrupt-parent = <&mpic>;
282 interrupts = <79 2>;
283 };
284 };
285
286 dma@21300 {
287 #address-cells = <1>;
288 #size-cells = <1>;
289 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma";
290 reg = <0x21300 0x4>;
291 ranges = <0x0 0x21100 0x200>;
292 cell-index = <0>;
293 dma-channel@0 {
294 compatible = "fsl,mpc8572-dma-channel",
295 "fsl,eloplus-dma-channel";
296 reg = <0x0 0x80>;
297 cell-index = <0>;
298 interrupt-parent = <&mpic>;
299 interrupts = <20 2>;
300 };
301 dma-channel@80 {
302 compatible = "fsl,mpc8572-dma-channel",
303 "fsl,eloplus-dma-channel";
304 reg = <0x80 0x80>;
305 cell-index = <1>;
306 interrupt-parent = <&mpic>;
307 interrupts = <21 2>;
308 };
309 dma-channel@100 {
310 compatible = "fsl,mpc8572-dma-channel",
311 "fsl,eloplus-dma-channel";
312 reg = <0x100 0x80>;
313 cell-index = <2>;
314 interrupt-parent = <&mpic>;
315 interrupts = <22 2>;
316 };
317 dma-channel@180 {
318 compatible = "fsl,mpc8572-dma-channel",
319 "fsl,eloplus-dma-channel";
320 reg = <0x180 0x80>;
321 cell-index = <3>;
322 interrupt-parent = <&mpic>;
323 interrupts = <23 2>;
324 };
325 };
326
327 ptp_clock@24E00 {
328 compatible = "fsl,etsec-ptp";
329 reg = <0x24E00 0xB0>;
330 interrupts = <68 2 69 2 70 2 71 2>;
331 interrupt-parent = < &mpic >;
332 fsl,tclk-period = <5>;
333 fsl,tmr-prsc = <200>;
334 fsl,tmr-add = <0xAAAAAAAB>;
335 fsl,tmr-fiper1 = <0x3B9AC9FB>;
336 fsl,tmr-fiper2 = <0x3B9AC9FB>;
337 fsl,max-adj = <499999999>;
338 };
339
340 enet0: ethernet@24000 {
341 #address-cells = <1>;
342 #size-cells = <1>;
343 cell-index = <0>;
344 device_type = "network";
345 model = "eTSEC";
346 compatible = "gianfar";
347 reg = <0x24000 0x1000>;
348 ranges = <0x0 0x24000 0x1000>;
349 local-mac-address = [ 00 00 00 00 00 00 ];
350 interrupts = <29 2 30 2 34 2>;
351 interrupt-parent = <&mpic>;
352 tbi-handle = <&tbi0>;
353 phy-handle = <&phy0>;
354 phy-connection-type = "rgmii-id";
355
356 mdio@520 {
357 #address-cells = <1>;
358 #size-cells = <0>;
359 compatible = "fsl,gianfar-mdio";
360 reg = <0x520 0x20>;
361
362 phy0: ethernet-phy@0 {
363 interrupt-parent = <&mpic>;
364 interrupts = <10 1>;
365 reg = <0x0>;
366 };
367 phy1: ethernet-phy@1 {
368 interrupt-parent = <&mpic>;
369 interrupts = <10 1>;
370 reg = <0x1>;
371 };
372 phy2: ethernet-phy@2 {
373 interrupt-parent = <&mpic>;
374 interrupts = <10 1>;
375 reg = <0x2>;
376 };
377 phy3: ethernet-phy@3 {
378 interrupt-parent = <&mpic>;
379 interrupts = <10 1>;
380 reg = <0x3>;
381 };
382
383 tbi0: tbi-phy@11 {
384 reg = <0x11>;
385 device_type = "tbi-phy";
386 };
387 };
388 };
389
390 enet1: ethernet@25000 {
391 #address-cells = <1>;
392 #size-cells = <1>;
393 cell-index = <1>;
394 device_type = "network";
395 model = "eTSEC";
396 compatible = "gianfar";
397 reg = <0x25000 0x1000>;
398 ranges = <0x0 0x25000 0x1000>;
399 local-mac-address = [ 00 00 00 00 00 00 ];
400 interrupts = <35 2 36 2 40 2>;
401 interrupt-parent = <&mpic>;
402 tbi-handle = <&tbi1>;
403 phy-handle = <&phy1>;
404 phy-connection-type = "rgmii-id";
405
406 mdio@520 {
407 #address-cells = <1>;
408 #size-cells = <0>;
409 compatible = "fsl,gianfar-tbi";
410 reg = <0x520 0x20>;
411
412 tbi1: tbi-phy@11 {
413 reg = <0x11>;
414 device_type = "tbi-phy";
415 };
416 };
417 };
418
419 enet2: ethernet@26000 {
420 #address-cells = <1>;
421 #size-cells = <1>;
422 cell-index = <2>;
423 device_type = "network";
424 model = "eTSEC";
425 compatible = "gianfar";
426 reg = <0x26000 0x1000>;
427 ranges = <0x0 0x26000 0x1000>;
428 local-mac-address = [ 00 00 00 00 00 00 ];
429 interrupts = <31 2 32 2 33 2>;
430 interrupt-parent = <&mpic>;
431 tbi-handle = <&tbi2>;
432 phy-handle = <&phy2>;
433 phy-connection-type = "rgmii-id";
434
435 mdio@520 {
436 #address-cells = <1>;
437 #size-cells = <0>;
438 compatible = "fsl,gianfar-tbi";
439 reg = <0x520 0x20>;
440
441 tbi2: tbi-phy@11 {
442 reg = <0x11>;
443 device_type = "tbi-phy";
444 };
445 };
446 };
447
448 enet3: ethernet@27000 {
449 #address-cells = <1>;
450 #size-cells = <1>;
451 cell-index = <3>;
452 device_type = "network";
453 model = "eTSEC";
454 compatible = "gianfar";
455 reg = <0x27000 0x1000>;
456 ranges = <0x0 0x27000 0x1000>;
457 local-mac-address = [ 00 00 00 00 00 00 ];
458 interrupts = <37 2 38 2 39 2>;
459 interrupt-parent = <&mpic>;
460 tbi-handle = <&tbi3>;
461 phy-handle = <&phy3>;
462 phy-connection-type = "rgmii-id";
463
464 mdio@520 {
465 #address-cells = <1>;
466 #size-cells = <0>;
467 compatible = "fsl,gianfar-tbi";
468 reg = <0x520 0x20>;
469
470 tbi3: tbi-phy@11 {
471 reg = <0x11>;
472 device_type = "tbi-phy";
473 };
474 };
475 };
476
477 serial0: serial@4500 {
478 cell-index = <0>;
479 device_type = "serial";
480 compatible = "ns16550";
481 reg = <0x4500 0x100>;
482 clock-frequency = <0>;
483 interrupts = <42 2>;
484 interrupt-parent = <&mpic>;
485 };
486
487 serial1: serial@4600 {
488 cell-index = <1>;
489 device_type = "serial";
490 compatible = "ns16550";
491 reg = <0x4600 0x100>;
492 clock-frequency = <0>;
493 interrupts = <42 2>;
494 interrupt-parent = <&mpic>;
495 };
496
497 global-utilities@e0000 { //global utilities block
498 compatible = "fsl,mpc8572-guts";
499 reg = <0xe0000 0x1000>;
500 fsl,has-rstcr;
501 };
502
503 msi@41600 {
504 compatible = "fsl,mpc8572-msi", "fsl,mpic-msi";
505 reg = <0x41600 0x80>;
506 msi-available-ranges = <0 0x100>;
507 interrupts = <
508 0xe0 0
509 0xe1 0
510 0xe2 0
511 0xe3 0
512 0xe4 0
513 0xe5 0
514 0xe6 0
515 0xe7 0>;
516 interrupt-parent = <&mpic>;
517 };
518
519 crypto@30000 {
520 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
521 "fsl,sec2.1", "fsl,sec2.0";
522 reg = <0x30000 0x10000>;
523 interrupts = <45 2 58 2>;
524 interrupt-parent = <&mpic>;
525 fsl,num-channels = <4>;
526 fsl,channel-fifo-len = <24>;
527 fsl,exec-units-mask = <0x9fe>;
528 fsl,descriptor-types-mask = <0x3ab0ebf>;
529 };
530
531 mpic: pic@40000 {
532 interrupt-controller;
533 #address-cells = <0>;
534 #interrupt-cells = <2>;
535 reg = <0x40000 0x40000>;
536 compatible = "chrp,open-pic";
537 device_type = "open-pic";
538 };
539 }; 36 };
540 37
541 pci0: pcie@ffe08000 { 38 board_pci0: pci0: pcie@ffe08000 {
542 compatible = "fsl,mpc8548-pcie";
543 device_type = "pci";
544 #interrupt-cells = <1>;
545 #size-cells = <2>;
546 #address-cells = <3>;
547 reg = <0 0xffe08000 0 0x1000>; 39 reg = <0 0xffe08000 0 0x1000>;
548 bus-range = <0 255>;
549 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 40 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
550 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x00010000>; 41 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x00010000>;
551 clock-frequency = <33333333>;
552 interrupt-parent = <&mpic>;
553 interrupts = <24 2>;
554 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
555 interrupt-map = <
556 /* IDSEL 0x11 func 0 - PCI slot 1 */
557 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1
558 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1
559 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1
560 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1
561
562 /* IDSEL 0x11 func 1 - PCI slot 1 */
563 0x8900 0x0 0x0 0x1 &mpic 0x2 0x1
564 0x8900 0x0 0x0 0x2 &mpic 0x3 0x1
565 0x8900 0x0 0x0 0x3 &mpic 0x4 0x1
566 0x8900 0x0 0x0 0x4 &mpic 0x1 0x1
567
568 /* IDSEL 0x11 func 2 - PCI slot 1 */
569 0x8a00 0x0 0x0 0x1 &mpic 0x2 0x1
570 0x8a00 0x0 0x0 0x2 &mpic 0x3 0x1
571 0x8a00 0x0 0x0 0x3 &mpic 0x4 0x1
572 0x8a00 0x0 0x0 0x4 &mpic 0x1 0x1
573
574 /* IDSEL 0x11 func 3 - PCI slot 1 */
575 0x8b00 0x0 0x0 0x1 &mpic 0x2 0x1
576 0x8b00 0x0 0x0 0x2 &mpic 0x3 0x1
577 0x8b00 0x0 0x0 0x3 &mpic 0x4 0x1
578 0x8b00 0x0 0x0 0x4 &mpic 0x1 0x1
579
580 /* IDSEL 0x11 func 4 - PCI slot 1 */
581 0x8c00 0x0 0x0 0x1 &mpic 0x2 0x1
582 0x8c00 0x0 0x0 0x2 &mpic 0x3 0x1
583 0x8c00 0x0 0x0 0x3 &mpic 0x4 0x1
584 0x8c00 0x0 0x0 0x4 &mpic 0x1 0x1
585
586 /* IDSEL 0x11 func 5 - PCI slot 1 */
587 0x8d00 0x0 0x0 0x1 &mpic 0x2 0x1
588 0x8d00 0x0 0x0 0x2 &mpic 0x3 0x1
589 0x8d00 0x0 0x0 0x3 &mpic 0x4 0x1
590 0x8d00 0x0 0x0 0x4 &mpic 0x1 0x1
591
592 /* IDSEL 0x11 func 6 - PCI slot 1 */
593 0x8e00 0x0 0x0 0x1 &mpic 0x2 0x1
594 0x8e00 0x0 0x0 0x2 &mpic 0x3 0x1
595 0x8e00 0x0 0x0 0x3 &mpic 0x4 0x1
596 0x8e00 0x0 0x0 0x4 &mpic 0x1 0x1
597
598 /* IDSEL 0x11 func 7 - PCI slot 1 */
599 0x8f00 0x0 0x0 0x1 &mpic 0x2 0x1
600 0x8f00 0x0 0x0 0x2 &mpic 0x3 0x1
601 0x8f00 0x0 0x0 0x3 &mpic 0x4 0x1
602 0x8f00 0x0 0x0 0x4 &mpic 0x1 0x1
603
604 /* IDSEL 0x12 func 0 - PCI slot 2 */
605 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1
606 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1
607 0x9000 0x0 0x0 0x3 &mpic 0x1 0x1
608 0x9000 0x0 0x0 0x4 &mpic 0x2 0x1
609
610 /* IDSEL 0x12 func 1 - PCI slot 2 */
611 0x9100 0x0 0x0 0x1 &mpic 0x3 0x1
612 0x9100 0x0 0x0 0x2 &mpic 0x4 0x1
613 0x9100 0x0 0x0 0x3 &mpic 0x1 0x1
614 0x9100 0x0 0x0 0x4 &mpic 0x2 0x1
615
616 /* IDSEL 0x12 func 2 - PCI slot 2 */
617 0x9200 0x0 0x0 0x1 &mpic 0x3 0x1
618 0x9200 0x0 0x0 0x2 &mpic 0x4 0x1
619 0x9200 0x0 0x0 0x3 &mpic 0x1 0x1
620 0x9200 0x0 0x0 0x4 &mpic 0x2 0x1
621
622 /* IDSEL 0x12 func 3 - PCI slot 2 */
623 0x9300 0x0 0x0 0x1 &mpic 0x3 0x1
624 0x9300 0x0 0x0 0x2 &mpic 0x4 0x1
625 0x9300 0x0 0x0 0x3 &mpic 0x1 0x1
626 0x9300 0x0 0x0 0x4 &mpic 0x2 0x1
627
628 /* IDSEL 0x12 func 4 - PCI slot 2 */
629 0x9400 0x0 0x0 0x1 &mpic 0x3 0x1
630 0x9400 0x0 0x0 0x2 &mpic 0x4 0x1
631 0x9400 0x0 0x0 0x3 &mpic 0x1 0x1
632 0x9400 0x0 0x0 0x4 &mpic 0x2 0x1
633
634 /* IDSEL 0x12 func 5 - PCI slot 2 */
635 0x9500 0x0 0x0 0x1 &mpic 0x3 0x1
636 0x9500 0x0 0x0 0x2 &mpic 0x4 0x1
637 0x9500 0x0 0x0 0x3 &mpic 0x1 0x1
638 0x9500 0x0 0x0 0x4 &mpic 0x2 0x1
639
640 /* IDSEL 0x12 func 6 - PCI slot 2 */
641 0x9600 0x0 0x0 0x1 &mpic 0x3 0x1
642 0x9600 0x0 0x0 0x2 &mpic 0x4 0x1
643 0x9600 0x0 0x0 0x3 &mpic 0x1 0x1
644 0x9600 0x0 0x0 0x4 &mpic 0x2 0x1
645
646 /* IDSEL 0x12 func 7 - PCI slot 2 */
647 0x9700 0x0 0x0 0x1 &mpic 0x3 0x1
648 0x9700 0x0 0x0 0x2 &mpic 0x4 0x1
649 0x9700 0x0 0x0 0x3 &mpic 0x1 0x1
650 0x9700 0x0 0x0 0x4 &mpic 0x2 0x1
651
652 // IDSEL 0x1c USB
653 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
654 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
655 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
656 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
657
658 // IDSEL 0x1d Audio
659 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
660
661 // IDSEL 0x1e Legacy
662 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
663 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
664
665 // IDSEL 0x1f IDE/SATA
666 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
667 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
668
669 >;
670
671 pcie@0 { 42 pcie@0 {
672 reg = <0x0 0x0 0x0 0x0 0x0>;
673 #size-cells = <2>;
674 #address-cells = <3>;
675 device_type = "pci";
676 ranges = <0x2000000 0x0 0x80000000 43 ranges = <0x2000000 0x0 0x80000000
677 0x2000000 0x0 0x80000000 44 0x2000000 0x0 0x80000000
678 0x0 0x20000000 45 0x0 0x20000000
@@ -680,99 +47,14 @@
680 0x1000000 0x0 0x0 47 0x1000000 0x0 0x0
681 0x1000000 0x0 0x0 48 0x1000000 0x0 0x0
682 0x0 0x10000>; 49 0x0 0x10000>;
683 uli1575@0 {
684 reg = <0x0 0x0 0x0 0x0 0x0>;
685 #size-cells = <2>;
686 #address-cells = <3>;
687 ranges = <0x2000000 0x0 0x80000000
688 0x2000000 0x0 0x80000000
689 0x0 0x20000000
690
691 0x1000000 0x0 0x0
692 0x1000000 0x0 0x0
693 0x0 0x10000>;
694 isa@1e {
695 device_type = "isa";
696 #interrupt-cells = <2>;
697 #size-cells = <1>;
698 #address-cells = <2>;
699 reg = <0xf000 0x0 0x0 0x0 0x0>;
700 ranges = <0x1 0x0 0x1000000 0x0 0x0
701 0x1000>;
702 interrupt-parent = <&i8259>;
703
704 i8259: interrupt-controller@20 {
705 reg = <0x1 0x20 0x2
706 0x1 0xa0 0x2
707 0x1 0x4d0 0x2>;
708 interrupt-controller;
709 device_type = "interrupt-controller";
710 #address-cells = <0>;
711 #interrupt-cells = <2>;
712 compatible = "chrp,iic";
713 interrupts = <9 2>;
714 interrupt-parent = <&mpic>;
715 };
716
717 i8042@60 {
718 #size-cells = <0>;
719 #address-cells = <1>;
720 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
721 interrupts = <1 3 12 3>;
722 interrupt-parent =
723 <&i8259>;
724
725 keyboard@0 {
726 reg = <0x0>;
727 compatible = "pnpPNP,303";
728 };
729
730 mouse@1 {
731 reg = <0x1>;
732 compatible = "pnpPNP,f03";
733 };
734 };
735
736 rtc@70 {
737 compatible = "pnpPNP,b00";
738 reg = <0x1 0x70 0x2>;
739 };
740
741 gpio@400 {
742 reg = <0x1 0x400 0x80>;
743 };
744 };
745 };
746 }; 50 };
747
748 }; 51 };
749 52
750 pci1: pcie@ffe09000 { 53 pci1: pcie@ffe09000 {
751 compatible = "fsl,mpc8548-pcie";
752 device_type = "pci";
753 #interrupt-cells = <1>;
754 #size-cells = <2>;
755 #address-cells = <3>;
756 reg = <0 0xffe09000 0 0x1000>; 54 reg = <0 0xffe09000 0 0x1000>;
757 bus-range = <0 255>;
758 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 55 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
759 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>; 56 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>;
760 clock-frequency = <33333333>;
761 interrupt-parent = <&mpic>;
762 interrupts = <25 2>;
763 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
764 interrupt-map = <
765 /* IDSEL 0x0 */
766 0000 0x0 0x0 0x1 &mpic 0x4 0x1
767 0000 0x0 0x0 0x2 &mpic 0x5 0x1
768 0000 0x0 0x0 0x3 &mpic 0x6 0x1
769 0000 0x0 0x0 0x4 &mpic 0x7 0x1
770 >;
771 pcie@0 { 57 pcie@0 {
772 reg = <0x0 0x0 0x0 0x0 0x0>;
773 #size-cells = <2>;
774 #address-cells = <3>;
775 device_type = "pci";
776 ranges = <0x2000000 0x0 0xa0000000 58 ranges = <0x2000000 0x0 0xa0000000
777 0x2000000 0x0 0xa0000000 59 0x2000000 0x0 0xa0000000
778 0x0 0x20000000 60 0x0 0x20000000
@@ -784,31 +66,10 @@
784 }; 66 };
785 67
786 pci2: pcie@ffe0a000 { 68 pci2: pcie@ffe0a000 {
787 compatible = "fsl,mpc8548-pcie";
788 device_type = "pci";
789 #interrupt-cells = <1>;
790 #size-cells = <2>;
791 #address-cells = <3>;
792 reg = <0 0xffe0a000 0 0x1000>; 69 reg = <0 0xffe0a000 0 0x1000>;
793 bus-range = <0 255>;
794 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 70 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
795 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>; 71 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>;
796 clock-frequency = <33333333>;
797 interrupt-parent = <&mpic>;
798 interrupts = <26 2>;
799 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
800 interrupt-map = <
801 /* IDSEL 0x0 */
802 0000 0x0 0x0 0x1 &mpic 0x0 0x1
803 0000 0x0 0x0 0x2 &mpic 0x1 0x1
804 0000 0x0 0x0 0x3 &mpic 0x2 0x1
805 0000 0x0 0x0 0x4 &mpic 0x3 0x1
806 >;
807 pcie@0 { 72 pcie@0 {
808 reg = <0x0 0x0 0x0 0x0 0x0>;
809 #size-cells = <2>;
810 #address-cells = <3>;
811 device_type = "pci";
812 ranges = <0x2000000 0x0 0xc0000000 73 ranges = <0x2000000 0x0 0xc0000000
813 0x2000000 0x0 0xc0000000 74 0x2000000 0x0 0xc0000000
814 0x0 0x20000000 75 0x0 0x20000000
@@ -819,3 +80,11 @@
819 }; 80 };
820 }; 81 };
821}; 82};
83
84/*
85 * mpc8572ds.dtsi must be last to ensure board_pci0 overrides pci0 settings
86 * for interrupt-map & interrupt-map-mask
87 */
88
89/include/ "fsl/mpc8572si-post.dtsi"
90/include/ "mpc8572ds.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dtsi b/arch/powerpc/boot/dts/mpc8572ds.dtsi
new file mode 100644
index 000000000000..c3d4fac0532a
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8572ds.dtsi
@@ -0,0 +1,397 @@
1/*
2 * MPC8572DS Device Tree Source stub (no addresses or top-level ranges)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&board_lbc {
36 nor@0,0 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 compatible = "cfi-flash";
40 reg = <0x0 0x0 0x8000000>;
41 bank-width = <2>;
42 device-width = <1>;
43
44 ramdisk@0 {
45 reg = <0x0 0x03000000>;
46 read-only;
47 };
48
49 diagnostic@3000000 {
50 reg = <0x03000000 0x00e00000>;
51 read-only;
52 };
53
54 dink@3e00000 {
55 reg = <0x03e00000 0x00200000>;
56 read-only;
57 };
58
59 kernel@4000000 {
60 reg = <0x04000000 0x00400000>;
61 read-only;
62 };
63
64 jffs2@4400000 {
65 reg = <0x04400000 0x03b00000>;
66 };
67
68 dtb@7f00000 {
69 reg = <0x07f00000 0x00080000>;
70 read-only;
71 };
72
73 u-boot@7f80000 {
74 reg = <0x07f80000 0x00080000>;
75 read-only;
76 };
77 };
78
79 nand@2,0 {
80 #address-cells = <1>;
81 #size-cells = <1>;
82 compatible = "fsl,mpc8572-fcm-nand",
83 "fsl,elbc-fcm-nand";
84 reg = <0x2 0x0 0x40000>;
85
86 u-boot@0 {
87 reg = <0x0 0x02000000>;
88 read-only;
89 };
90
91 jffs2@2000000 {
92 reg = <0x02000000 0x10000000>;
93 };
94
95 ramdisk@12000000 {
96 reg = <0x12000000 0x08000000>;
97 read-only;
98 };
99
100 kernel@1a000000 {
101 reg = <0x1a000000 0x04000000>;
102 };
103
104 dtb@1e000000 {
105 reg = <0x1e000000 0x01000000>;
106 read-only;
107 };
108
109 empty@1f000000 {
110 reg = <0x1f000000 0x21000000>;
111 };
112 };
113
114 nand@4,0 {
115 compatible = "fsl,mpc8572-fcm-nand",
116 "fsl,elbc-fcm-nand";
117 reg = <0x4 0x0 0x40000>;
118 };
119
120 nand@5,0 {
121 compatible = "fsl,mpc8572-fcm-nand",
122 "fsl,elbc-fcm-nand";
123 reg = <0x5 0x0 0x40000>;
124 };
125
126 nand@6,0 {
127 compatible = "fsl,mpc8572-fcm-nand",
128 "fsl,elbc-fcm-nand";
129 reg = <0x6 0x0 0x40000>;
130 };
131};
132
133&board_soc {
134 enet0: ethernet@24000 {
135 tbi-handle = <&tbi0>;
136 phy-handle = <&phy0>;
137 phy-connection-type = "rgmii-id";
138 };
139
140 mdio@24520 {
141 phy0: ethernet-phy@0 {
142 interrupts = <10 1 0 0>;
143 reg = <0x0>;
144 };
145 phy1: ethernet-phy@1 {
146 interrupts = <10 1 0 0>;
147 reg = <0x1>;
148 };
149 phy2: ethernet-phy@2 {
150 interrupts = <10 1 0 0>;
151 reg = <0x2>;
152 };
153 phy3: ethernet-phy@3 {
154 interrupts = <10 1 0 0>;
155 reg = <0x3>;
156 };
157
158 tbi0: tbi-phy@11 {
159 reg = <0x11>;
160 device_type = "tbi-phy";
161 };
162 };
163
164 ptp_clock@24e00 {
165 fsl,tclk-period = <5>;
166 fsl,tmr-prsc = <200>;
167 fsl,tmr-add = <0xAAAAAAAB>;
168 fsl,tmr-fiper1 = <0x3B9AC9FB>;
169 fsl,tmr-fiper2 = <0x3B9AC9FB>;
170 fsl,max-adj = <499999999>;
171 };
172
173 enet1: ethernet@25000 {
174 tbi-handle = <&tbi1>;
175 phy-handle = <&phy1>;
176 phy-connection-type = "rgmii-id";
177
178 };
179
180 mdio@25520 {
181 tbi1: tbi-phy@11 {
182 reg = <0x11>;
183 device_type = "tbi-phy";
184 };
185 };
186
187 enet2: ethernet@26000 {
188 tbi-handle = <&tbi2>;
189 phy-handle = <&phy2>;
190 phy-connection-type = "rgmii-id";
191
192 };
193 mdio@26520 {
194 tbi2: tbi-phy@11 {
195 reg = <0x11>;
196 device_type = "tbi-phy";
197 };
198 };
199
200 enet3: ethernet@27000 {
201 tbi-handle = <&tbi3>;
202 phy-handle = <&phy3>;
203 phy-connection-type = "rgmii-id";
204 };
205
206 mdio@27520 {
207 tbi3: tbi-phy@11 {
208 reg = <0x11>;
209 device_type = "tbi-phy";
210 };
211 };
212};
213
214&board_pci0 {
215 pcie@0 {
216 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
217 interrupt-map = <
218 /* IDSEL 0x11 func 0 - PCI slot 1 */
219 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
220 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
221 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
222 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
223
224 /* IDSEL 0x11 func 1 - PCI slot 1 */
225 0x8900 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
226 0x8900 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
227 0x8900 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
228 0x8900 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
229
230 /* IDSEL 0x11 func 2 - PCI slot 1 */
231 0x8a00 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
232 0x8a00 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
233 0x8a00 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
234 0x8a00 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
235
236 /* IDSEL 0x11 func 3 - PCI slot 1 */
237 0x8b00 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
238 0x8b00 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
239 0x8b00 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
240 0x8b00 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
241
242 /* IDSEL 0x11 func 4 - PCI slot 1 */
243 0x8c00 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
244 0x8c00 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
245 0x8c00 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
246 0x8c00 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
247
248 /* IDSEL 0x11 func 5 - PCI slot 1 */
249 0x8d00 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
250 0x8d00 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
251 0x8d00 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
252 0x8d00 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
253
254 /* IDSEL 0x11 func 6 - PCI slot 1 */
255 0x8e00 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
256 0x8e00 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
257 0x8e00 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
258 0x8e00 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
259
260 /* IDSEL 0x11 func 7 - PCI slot 1 */
261 0x8f00 0x0 0x0 0x1 &mpic 0x2 0x1 0 0
262 0x8f00 0x0 0x0 0x2 &mpic 0x3 0x1 0 0
263 0x8f00 0x0 0x0 0x3 &mpic 0x4 0x1 0 0
264 0x8f00 0x0 0x0 0x4 &mpic 0x1 0x1 0 0
265
266 /* IDSEL 0x12 func 0 - PCI slot 2 */
267 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
268 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
269 0x9000 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
270 0x9000 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
271
272 /* IDSEL 0x12 func 1 - PCI slot 2 */
273 0x9100 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
274 0x9100 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
275 0x9100 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
276 0x9100 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
277
278 /* IDSEL 0x12 func 2 - PCI slot 2 */
279 0x9200 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
280 0x9200 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
281 0x9200 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
282 0x9200 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
283
284 /* IDSEL 0x12 func 3 - PCI slot 2 */
285 0x9300 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
286 0x9300 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
287 0x9300 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
288 0x9300 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
289
290 /* IDSEL 0x12 func 4 - PCI slot 2 */
291 0x9400 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
292 0x9400 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
293 0x9400 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
294 0x9400 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
295
296 /* IDSEL 0x12 func 5 - PCI slot 2 */
297 0x9500 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
298 0x9500 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
299 0x9500 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
300 0x9500 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
301
302 /* IDSEL 0x12 func 6 - PCI slot 2 */
303 0x9600 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
304 0x9600 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
305 0x9600 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
306 0x9600 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
307
308 /* IDSEL 0x12 func 7 - PCI slot 2 */
309 0x9700 0x0 0x0 0x1 &mpic 0x3 0x1 0 0
310 0x9700 0x0 0x0 0x2 &mpic 0x4 0x1 0 0
311 0x9700 0x0 0x0 0x3 &mpic 0x1 0x1 0 0
312 0x9700 0x0 0x0 0x4 &mpic 0x2 0x1 0 0
313
314 // IDSEL 0x1c USB
315 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
316 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
317 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
318 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
319
320 // IDSEL 0x1d Audio
321 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
322
323 // IDSEL 0x1e Legacy
324 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
325 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
326
327 // IDSEL 0x1f IDE/SATA
328 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
329 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
330 >;
331
332
333 uli1575@0 {
334 reg = <0x0 0x0 0x0 0x0 0x0>;
335 #size-cells = <2>;
336 #address-cells = <3>;
337 ranges = <0x2000000 0x0 0x80000000
338 0x2000000 0x0 0x80000000
339 0x0 0x20000000
340
341 0x1000000 0x0 0x0
342 0x1000000 0x0 0x0
343 0x0 0x10000>;
344 isa@1e {
345 device_type = "isa";
346 #interrupt-cells = <2>;
347 #size-cells = <1>;
348 #address-cells = <2>;
349 reg = <0xf000 0x0 0x0 0x0 0x0>;
350 ranges = <0x1 0x0 0x1000000 0x0 0x0
351 0x1000>;
352 interrupt-parent = <&i8259>;
353
354 i8259: interrupt-controller@20 {
355 reg = <0x1 0x20 0x2
356 0x1 0xa0 0x2
357 0x1 0x4d0 0x2>;
358 interrupt-controller;
359 device_type = "interrupt-controller";
360 #address-cells = <0>;
361 #interrupt-cells = <2>;
362 compatible = "chrp,iic";
363 interrupts = <9 2 0 0>;
364 interrupt-parent = <&mpic>;
365 };
366
367 i8042@60 {
368 #size-cells = <0>;
369 #address-cells = <1>;
370 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
371 interrupts = <1 3 12 3>;
372 interrupt-parent =
373 <&i8259>;
374
375 keyboard@0 {
376 reg = <0x0>;
377 compatible = "pnpPNP,303";
378 };
379
380 mouse@1 {
381 reg = <0x1>;
382 compatible = "pnpPNP,f03";
383 };
384 };
385
386 rtc@70 {
387 compatible = "pnpPNP,b00";
388 reg = <0x1 0x70 0x2>;
389 };
390
391 gpio@400 {
392 reg = <0x1 0x400 0x80>;
393 };
394 };
395 };
396 };
397};
diff --git a/arch/powerpc/boot/dts/mpc8572ds_36b.dts b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
index f6365db3b97d..6c3d0b305e1b 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_36b.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
@@ -1,5 +1,5 @@
1/* 1/*
2 * MPC8572 DS Device Tree Source 2 * MPC8572DS Device Tree Source (36-bit address map)
3 * 3 *
4 * Copyright 2007-2009 Freescale Semiconductor Inc. 4 * Copyright 2007-2009 Freescale Semiconductor Inc.
5 * 5 *
@@ -9,67 +9,18 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/mpc8572si-pre.dtsi"
13
13/ { 14/ {
14 model = "fsl,MPC8572DS"; 15 model = "fsl,MPC8572DS";
15 compatible = "fsl,MPC8572DS"; 16 compatible = "fsl,MPC8572DS";
16 #address-cells = <2>;
17 #size-cells = <2>;
18
19 aliases {
20 ethernet0 = &enet0;
21 ethernet1 = &enet1;
22 ethernet2 = &enet2;
23 ethernet3 = &enet3;
24 serial0 = &serial0;
25 serial1 = &serial1;
26 pci0 = &pci0;
27 pci1 = &pci1;
28 pci2 = &pci2;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 PowerPC,8572@0 {
36 device_type = "cpu";
37 reg = <0x0>;
38 d-cache-line-size = <32>; // 32 bytes
39 i-cache-line-size = <32>; // 32 bytes
40 d-cache-size = <0x8000>; // L1, 32K
41 i-cache-size = <0x8000>; // L1, 32K
42 timebase-frequency = <0>;
43 bus-frequency = <0>;
44 clock-frequency = <0>;
45 next-level-cache = <&L2>;
46 };
47
48 PowerPC,8572@1 {
49 device_type = "cpu";
50 reg = <0x1>;
51 d-cache-line-size = <32>; // 32 bytes
52 i-cache-line-size = <32>; // 32 bytes
53 d-cache-size = <0x8000>; // L1, 32K
54 i-cache-size = <0x8000>; // L1, 32K
55 timebase-frequency = <0>;
56 bus-frequency = <0>;
57 clock-frequency = <0>;
58 next-level-cache = <&L2>;
59 };
60 };
61 17
62 memory { 18 memory {
63 device_type = "memory"; 19 device_type = "memory";
64 }; 20 };
65 21
66 localbus@fffe05000 { 22 board_lbc: lbc: localbus@fffe05000 {
67 #address-cells = <2>;
68 #size-cells = <1>;
69 compatible = "fsl,mpc8572-elbc", "fsl,elbc", "simple-bus";
70 reg = <0xf 0xffe05000 0 0x1000>; 23 reg = <0xf 0xffe05000 0 0x1000>;
71 interrupts = <19 2>;
72 interrupt-parent = <&mpic>;
73 24
74 ranges = <0x0 0x0 0xf 0xe8000000 0x08000000 25 ranges = <0x0 0x0 0xf 0xe8000000 0x08000000
75 0x1 0x0 0xf 0xe0000000 0x08000000 26 0x1 0x0 0xf 0xe0000000 0x08000000
@@ -78,588 +29,17 @@
78 0x4 0x0 0xf 0xffa40000 0x00040000 29 0x4 0x0 0xf 0xffa40000 0x00040000
79 0x5 0x0 0xf 0xffa80000 0x00040000 30 0x5 0x0 0xf 0xffa80000 0x00040000
80 0x6 0x0 0xf 0xffac0000 0x00040000>; 31 0x6 0x0 0xf 0xffac0000 0x00040000>;
81
82 nor@0,0 {
83 #address-cells = <1>;
84 #size-cells = <1>;
85 compatible = "cfi-flash";
86 reg = <0x0 0x0 0x8000000>;
87 bank-width = <2>;
88 device-width = <1>;
89
90 ramdisk@0 {
91 reg = <0x0 0x03000000>;
92 read-only;
93 };
94
95 diagnostic@3000000 {
96 reg = <0x03000000 0x00e00000>;
97 read-only;
98 };
99
100 dink@3e00000 {
101 reg = <0x03e00000 0x00200000>;
102 read-only;
103 };
104
105 kernel@4000000 {
106 reg = <0x04000000 0x00400000>;
107 read-only;
108 };
109
110 jffs2@4400000 {
111 reg = <0x04400000 0x03b00000>;
112 };
113
114 dtb@7f00000 {
115 reg = <0x07f00000 0x00080000>;
116 read-only;
117 };
118
119 u-boot@7f80000 {
120 reg = <0x07f80000 0x00080000>;
121 read-only;
122 };
123 };
124
125 nand@2,0 {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 compatible = "fsl,mpc8572-fcm-nand",
129 "fsl,elbc-fcm-nand";
130 reg = <0x2 0x0 0x40000>;
131
132 u-boot@0 {
133 reg = <0x0 0x02000000>;
134 read-only;
135 };
136
137 jffs2@2000000 {
138 reg = <0x02000000 0x10000000>;
139 };
140
141 ramdisk@12000000 {
142 reg = <0x12000000 0x08000000>;
143 read-only;
144 };
145
146 kernel@1a000000 {
147 reg = <0x1a000000 0x04000000>;
148 };
149
150 dtb@1e000000 {
151 reg = <0x1e000000 0x01000000>;
152 read-only;
153 };
154
155 empty@1f000000 {
156 reg = <0x1f000000 0x21000000>;
157 };
158 };
159
160 nand@4,0 {
161 compatible = "fsl,mpc8572-fcm-nand",
162 "fsl,elbc-fcm-nand";
163 reg = <0x4 0x0 0x40000>;
164 };
165
166 nand@5,0 {
167 compatible = "fsl,mpc8572-fcm-nand",
168 "fsl,elbc-fcm-nand";
169 reg = <0x5 0x0 0x40000>;
170 };
171
172 nand@6,0 {
173 compatible = "fsl,mpc8572-fcm-nand",
174 "fsl,elbc-fcm-nand";
175 reg = <0x6 0x0 0x40000>;
176 };
177 }; 32 };
178 33
179 soc8572@fffe00000 { 34 board_soc: soc: soc8572@fffe00000 {
180 #address-cells = <1>;
181 #size-cells = <1>;
182 device_type = "soc";
183 compatible = "simple-bus";
184 ranges = <0x0 0xf 0xffe00000 0x100000>; 35 ranges = <0x0 0xf 0xffe00000 0x100000>;
185 bus-frequency = <0>; // Filled out by uboot.
186
187 ecm-law@0 {
188 compatible = "fsl,ecm-law";
189 reg = <0x0 0x1000>;
190 fsl,num-laws = <12>;
191 };
192
193 ecm@1000 {
194 compatible = "fsl,mpc8572-ecm", "fsl,ecm";
195 reg = <0x1000 0x1000>;
196 interrupts = <17 2>;
197 interrupt-parent = <&mpic>;
198 };
199
200 memory-controller@2000 {
201 compatible = "fsl,mpc8572-memory-controller";
202 reg = <0x2000 0x1000>;
203 interrupt-parent = <&mpic>;
204 interrupts = <18 2>;
205 };
206
207 memory-controller@6000 {
208 compatible = "fsl,mpc8572-memory-controller";
209 reg = <0x6000 0x1000>;
210 interrupt-parent = <&mpic>;
211 interrupts = <18 2>;
212 };
213
214 L2: l2-cache-controller@20000 {
215 compatible = "fsl,mpc8572-l2-cache-controller";
216 reg = <0x20000 0x1000>;
217 cache-line-size = <32>; // 32 bytes
218 cache-size = <0x100000>; // L2, 1M
219 interrupt-parent = <&mpic>;
220 interrupts = <16 2>;
221 };
222
223 i2c@3000 {
224 #address-cells = <1>;
225 #size-cells = <0>;
226 cell-index = <0>;
227 compatible = "fsl-i2c";
228 reg = <0x3000 0x100>;
229 interrupts = <43 2>;
230 interrupt-parent = <&mpic>;
231 dfsrr;
232 };
233
234 i2c@3100 {
235 #address-cells = <1>;
236 #size-cells = <0>;
237 cell-index = <1>;
238 compatible = "fsl-i2c";
239 reg = <0x3100 0x100>;
240 interrupts = <43 2>;
241 interrupt-parent = <&mpic>;
242 dfsrr;
243 };
244
245 dma@c300 {
246 #address-cells = <1>;
247 #size-cells = <1>;
248 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma";
249 reg = <0xc300 0x4>;
250 ranges = <0x0 0xc100 0x200>;
251 cell-index = <1>;
252 dma-channel@0 {
253 compatible = "fsl,mpc8572-dma-channel",
254 "fsl,eloplus-dma-channel";
255 reg = <0x0 0x80>;
256 cell-index = <0>;
257 interrupt-parent = <&mpic>;
258 interrupts = <76 2>;
259 };
260 dma-channel@80 {
261 compatible = "fsl,mpc8572-dma-channel",
262 "fsl,eloplus-dma-channel";
263 reg = <0x80 0x80>;
264 cell-index = <1>;
265 interrupt-parent = <&mpic>;
266 interrupts = <77 2>;
267 };
268 dma-channel@100 {
269 compatible = "fsl,mpc8572-dma-channel",
270 "fsl,eloplus-dma-channel";
271 reg = <0x100 0x80>;
272 cell-index = <2>;
273 interrupt-parent = <&mpic>;
274 interrupts = <78 2>;
275 };
276 dma-channel@180 {
277 compatible = "fsl,mpc8572-dma-channel",
278 "fsl,eloplus-dma-channel";
279 reg = <0x180 0x80>;
280 cell-index = <3>;
281 interrupt-parent = <&mpic>;
282 interrupts = <79 2>;
283 };
284 };
285
286 dma@21300 {
287 #address-cells = <1>;
288 #size-cells = <1>;
289 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma";
290 reg = <0x21300 0x4>;
291 ranges = <0x0 0x21100 0x200>;
292 cell-index = <0>;
293 dma-channel@0 {
294 compatible = "fsl,mpc8572-dma-channel",
295 "fsl,eloplus-dma-channel";
296 reg = <0x0 0x80>;
297 cell-index = <0>;
298 interrupt-parent = <&mpic>;
299 interrupts = <20 2>;
300 };
301 dma-channel@80 {
302 compatible = "fsl,mpc8572-dma-channel",
303 "fsl,eloplus-dma-channel";
304 reg = <0x80 0x80>;
305 cell-index = <1>;
306 interrupt-parent = <&mpic>;
307 interrupts = <21 2>;
308 };
309 dma-channel@100 {
310 compatible = "fsl,mpc8572-dma-channel",
311 "fsl,eloplus-dma-channel";
312 reg = <0x100 0x80>;
313 cell-index = <2>;
314 interrupt-parent = <&mpic>;
315 interrupts = <22 2>;
316 };
317 dma-channel@180 {
318 compatible = "fsl,mpc8572-dma-channel",
319 "fsl,eloplus-dma-channel";
320 reg = <0x180 0x80>;
321 cell-index = <3>;
322 interrupt-parent = <&mpic>;
323 interrupts = <23 2>;
324 };
325 };
326
327 enet0: ethernet@24000 {
328 #address-cells = <1>;
329 #size-cells = <1>;
330 cell-index = <0>;
331 device_type = "network";
332 model = "eTSEC";
333 compatible = "gianfar";
334 reg = <0x24000 0x1000>;
335 ranges = <0x0 0x24000 0x1000>;
336 local-mac-address = [ 00 00 00 00 00 00 ];
337 interrupts = <29 2 30 2 34 2>;
338 interrupt-parent = <&mpic>;
339 tbi-handle = <&tbi0>;
340 phy-handle = <&phy0>;
341 phy-connection-type = "rgmii-id";
342
343 mdio@520 {
344 #address-cells = <1>;
345 #size-cells = <0>;
346 compatible = "fsl,gianfar-mdio";
347 reg = <0x520 0x20>;
348
349 phy0: ethernet-phy@0 {
350 interrupt-parent = <&mpic>;
351 interrupts = <10 1>;
352 reg = <0x0>;
353 };
354 phy1: ethernet-phy@1 {
355 interrupt-parent = <&mpic>;
356 interrupts = <10 1>;
357 reg = <0x1>;
358 };
359 phy2: ethernet-phy@2 {
360 interrupt-parent = <&mpic>;
361 interrupts = <10 1>;
362 reg = <0x2>;
363 };
364 phy3: ethernet-phy@3 {
365 interrupt-parent = <&mpic>;
366 interrupts = <10 1>;
367 reg = <0x3>;
368 };
369
370 tbi0: tbi-phy@11 {
371 reg = <0x11>;
372 device_type = "tbi-phy";
373 };
374 };
375 };
376
377 enet1: ethernet@25000 {
378 #address-cells = <1>;
379 #size-cells = <1>;
380 cell-index = <1>;
381 device_type = "network";
382 model = "eTSEC";
383 compatible = "gianfar";
384 reg = <0x25000 0x1000>;
385 ranges = <0x0 0x25000 0x1000>;
386 local-mac-address = [ 00 00 00 00 00 00 ];
387 interrupts = <35 2 36 2 40 2>;
388 interrupt-parent = <&mpic>;
389 tbi-handle = <&tbi1>;
390 phy-handle = <&phy1>;
391 phy-connection-type = "rgmii-id";
392
393 mdio@520 {
394 #address-cells = <1>;
395 #size-cells = <0>;
396 compatible = "fsl,gianfar-tbi";
397 reg = <0x520 0x20>;
398
399 tbi1: tbi-phy@11 {
400 reg = <0x11>;
401 device_type = "tbi-phy";
402 };
403 };
404 };
405
406 enet2: ethernet@26000 {
407 #address-cells = <1>;
408 #size-cells = <1>;
409 cell-index = <2>;
410 device_type = "network";
411 model = "eTSEC";
412 compatible = "gianfar";
413 reg = <0x26000 0x1000>;
414 ranges = <0x0 0x26000 0x1000>;
415 local-mac-address = [ 00 00 00 00 00 00 ];
416 interrupts = <31 2 32 2 33 2>;
417 interrupt-parent = <&mpic>;
418 tbi-handle = <&tbi2>;
419 phy-handle = <&phy2>;
420 phy-connection-type = "rgmii-id";
421
422 mdio@520 {
423 #address-cells = <1>;
424 #size-cells = <0>;
425 compatible = "fsl,gianfar-tbi";
426 reg = <0x520 0x20>;
427
428 tbi2: tbi-phy@11 {
429 reg = <0x11>;
430 device_type = "tbi-phy";
431 };
432 };
433 };
434
435 enet3: ethernet@27000 {
436 #address-cells = <1>;
437 #size-cells = <1>;
438 cell-index = <3>;
439 device_type = "network";
440 model = "eTSEC";
441 compatible = "gianfar";
442 reg = <0x27000 0x1000>;
443 ranges = <0x0 0x27000 0x1000>;
444 local-mac-address = [ 00 00 00 00 00 00 ];
445 interrupts = <37 2 38 2 39 2>;
446 interrupt-parent = <&mpic>;
447 tbi-handle = <&tbi3>;
448 phy-handle = <&phy3>;
449 phy-connection-type = "rgmii-id";
450
451 mdio@520 {
452 #address-cells = <1>;
453 #size-cells = <0>;
454 compatible = "fsl,gianfar-tbi";
455 reg = <0x520 0x20>;
456
457 tbi3: tbi-phy@11 {
458 reg = <0x11>;
459 device_type = "tbi-phy";
460 };
461 };
462 };
463
464 serial0: serial@4500 {
465 cell-index = <0>;
466 device_type = "serial";
467 compatible = "ns16550";
468 reg = <0x4500 0x100>;
469 clock-frequency = <0>;
470 interrupts = <42 2>;
471 interrupt-parent = <&mpic>;
472 };
473
474 serial1: serial@4600 {
475 cell-index = <1>;
476 device_type = "serial";
477 compatible = "ns16550";
478 reg = <0x4600 0x100>;
479 clock-frequency = <0>;
480 interrupts = <42 2>;
481 interrupt-parent = <&mpic>;
482 };
483
484 global-utilities@e0000 { //global utilities block
485 compatible = "fsl,mpc8572-guts";
486 reg = <0xe0000 0x1000>;
487 fsl,has-rstcr;
488 };
489
490 msi@41600 {
491 compatible = "fsl,mpc8572-msi", "fsl,mpic-msi";
492 reg = <0x41600 0x80>;
493 msi-available-ranges = <0 0x100>;
494 interrupts = <
495 0xe0 0
496 0xe1 0
497 0xe2 0
498 0xe3 0
499 0xe4 0
500 0xe5 0
501 0xe6 0
502 0xe7 0>;
503 interrupt-parent = <&mpic>;
504 };
505
506 crypto@30000 {
507 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
508 "fsl,sec2.1", "fsl,sec2.0";
509 reg = <0x30000 0x10000>;
510 interrupts = <45 2 58 2>;
511 interrupt-parent = <&mpic>;
512 fsl,num-channels = <4>;
513 fsl,channel-fifo-len = <24>;
514 fsl,exec-units-mask = <0x9fe>;
515 fsl,descriptor-types-mask = <0x3ab0ebf>;
516 };
517
518 mpic: pic@40000 {
519 interrupt-controller;
520 #address-cells = <0>;
521 #interrupt-cells = <2>;
522 reg = <0x40000 0x40000>;
523 compatible = "chrp,open-pic";
524 device_type = "open-pic";
525 };
526 }; 36 };
527 37
528 pci0: pcie@fffe08000 { 38 board_pci0: pci0: pcie@fffe08000 {
529 compatible = "fsl,mpc8548-pcie";
530 device_type = "pci";
531 #interrupt-cells = <1>;
532 #size-cells = <2>;
533 #address-cells = <3>;
534 reg = <0xf 0xffe08000 0 0x1000>; 39 reg = <0xf 0xffe08000 0 0x1000>;
535 bus-range = <0 255>;
536 ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000 40 ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000
537 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x00010000>; 41 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x00010000>;
538 clock-frequency = <33333333>;
539 interrupt-parent = <&mpic>;
540 interrupts = <24 2>;
541 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
542 interrupt-map = <
543 /* IDSEL 0x11 func 0 - PCI slot 1 */
544 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1
545 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1
546 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1
547 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1
548
549 /* IDSEL 0x11 func 1 - PCI slot 1 */
550 0x8900 0x0 0x0 0x1 &mpic 0x2 0x1
551 0x8900 0x0 0x0 0x2 &mpic 0x3 0x1
552 0x8900 0x0 0x0 0x3 &mpic 0x4 0x1
553 0x8900 0x0 0x0 0x4 &mpic 0x1 0x1
554
555 /* IDSEL 0x11 func 2 - PCI slot 1 */
556 0x8a00 0x0 0x0 0x1 &mpic 0x2 0x1
557 0x8a00 0x0 0x0 0x2 &mpic 0x3 0x1
558 0x8a00 0x0 0x0 0x3 &mpic 0x4 0x1
559 0x8a00 0x0 0x0 0x4 &mpic 0x1 0x1
560
561 /* IDSEL 0x11 func 3 - PCI slot 1 */
562 0x8b00 0x0 0x0 0x1 &mpic 0x2 0x1
563 0x8b00 0x0 0x0 0x2 &mpic 0x3 0x1
564 0x8b00 0x0 0x0 0x3 &mpic 0x4 0x1
565 0x8b00 0x0 0x0 0x4 &mpic 0x1 0x1
566
567 /* IDSEL 0x11 func 4 - PCI slot 1 */
568 0x8c00 0x0 0x0 0x1 &mpic 0x2 0x1
569 0x8c00 0x0 0x0 0x2 &mpic 0x3 0x1
570 0x8c00 0x0 0x0 0x3 &mpic 0x4 0x1
571 0x8c00 0x0 0x0 0x4 &mpic 0x1 0x1
572
573 /* IDSEL 0x11 func 5 - PCI slot 1 */
574 0x8d00 0x0 0x0 0x1 &mpic 0x2 0x1
575 0x8d00 0x0 0x0 0x2 &mpic 0x3 0x1
576 0x8d00 0x0 0x0 0x3 &mpic 0x4 0x1
577 0x8d00 0x0 0x0 0x4 &mpic 0x1 0x1
578
579 /* IDSEL 0x11 func 6 - PCI slot 1 */
580 0x8e00 0x0 0x0 0x1 &mpic 0x2 0x1
581 0x8e00 0x0 0x0 0x2 &mpic 0x3 0x1
582 0x8e00 0x0 0x0 0x3 &mpic 0x4 0x1
583 0x8e00 0x0 0x0 0x4 &mpic 0x1 0x1
584
585 /* IDSEL 0x11 func 7 - PCI slot 1 */
586 0x8f00 0x0 0x0 0x1 &mpic 0x2 0x1
587 0x8f00 0x0 0x0 0x2 &mpic 0x3 0x1
588 0x8f00 0x0 0x0 0x3 &mpic 0x4 0x1
589 0x8f00 0x0 0x0 0x4 &mpic 0x1 0x1
590
591 /* IDSEL 0x12 func 0 - PCI slot 2 */
592 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1
593 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1
594 0x9000 0x0 0x0 0x3 &mpic 0x1 0x1
595 0x9000 0x0 0x0 0x4 &mpic 0x2 0x1
596
597 /* IDSEL 0x12 func 1 - PCI slot 2 */
598 0x9100 0x0 0x0 0x1 &mpic 0x3 0x1
599 0x9100 0x0 0x0 0x2 &mpic 0x4 0x1
600 0x9100 0x0 0x0 0x3 &mpic 0x1 0x1
601 0x9100 0x0 0x0 0x4 &mpic 0x2 0x1
602
603 /* IDSEL 0x12 func 2 - PCI slot 2 */
604 0x9200 0x0 0x0 0x1 &mpic 0x3 0x1
605 0x9200 0x0 0x0 0x2 &mpic 0x4 0x1
606 0x9200 0x0 0x0 0x3 &mpic 0x1 0x1
607 0x9200 0x0 0x0 0x4 &mpic 0x2 0x1
608
609 /* IDSEL 0x12 func 3 - PCI slot 2 */
610 0x9300 0x0 0x0 0x1 &mpic 0x3 0x1
611 0x9300 0x0 0x0 0x2 &mpic 0x4 0x1
612 0x9300 0x0 0x0 0x3 &mpic 0x1 0x1
613 0x9300 0x0 0x0 0x4 &mpic 0x2 0x1
614
615 /* IDSEL 0x12 func 4 - PCI slot 2 */
616 0x9400 0x0 0x0 0x1 &mpic 0x3 0x1
617 0x9400 0x0 0x0 0x2 &mpic 0x4 0x1
618 0x9400 0x0 0x0 0x3 &mpic 0x1 0x1
619 0x9400 0x0 0x0 0x4 &mpic 0x2 0x1
620
621 /* IDSEL 0x12 func 5 - PCI slot 2 */
622 0x9500 0x0 0x0 0x1 &mpic 0x3 0x1
623 0x9500 0x0 0x0 0x2 &mpic 0x4 0x1
624 0x9500 0x0 0x0 0x3 &mpic 0x1 0x1
625 0x9500 0x0 0x0 0x4 &mpic 0x2 0x1
626
627 /* IDSEL 0x12 func 6 - PCI slot 2 */
628 0x9600 0x0 0x0 0x1 &mpic 0x3 0x1
629 0x9600 0x0 0x0 0x2 &mpic 0x4 0x1
630 0x9600 0x0 0x0 0x3 &mpic 0x1 0x1
631 0x9600 0x0 0x0 0x4 &mpic 0x2 0x1
632
633 /* IDSEL 0x12 func 7 - PCI slot 2 */
634 0x9700 0x0 0x0 0x1 &mpic 0x3 0x1
635 0x9700 0x0 0x0 0x2 &mpic 0x4 0x1
636 0x9700 0x0 0x0 0x3 &mpic 0x1 0x1
637 0x9700 0x0 0x0 0x4 &mpic 0x2 0x1
638
639 // IDSEL 0x1c USB
640 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
641 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
642 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
643 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
644
645 // IDSEL 0x1d Audio
646 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
647
648 // IDSEL 0x1e Legacy
649 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
650 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
651
652 // IDSEL 0x1f IDE/SATA
653 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
654 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
655
656 >;
657
658 pcie@0 { 42 pcie@0 {
659 reg = <0x0 0x0 0x0 0x0 0x0>;
660 #size-cells = <2>;
661 #address-cells = <3>;
662 device_type = "pci";
663 ranges = <0x2000000 0x0 0xe0000000 43 ranges = <0x2000000 0x0 0xe0000000
664 0x2000000 0x0 0xe0000000 44 0x2000000 0x0 0xe0000000
665 0x0 0x20000000 45 0x0 0x20000000
@@ -667,99 +47,14 @@
667 0x1000000 0x0 0x0 47 0x1000000 0x0 0x0
668 0x1000000 0x0 0x0 48 0x1000000 0x0 0x0
669 0x0 0x10000>; 49 0x0 0x10000>;
670 uli1575@0 {
671 reg = <0x0 0x0 0x0 0x0 0x0>;
672 #size-cells = <2>;
673 #address-cells = <3>;
674 ranges = <0x2000000 0x0 0xe0000000
675 0x2000000 0x0 0xe0000000
676 0x0 0x20000000
677
678 0x1000000 0x0 0x0
679 0x1000000 0x0 0x0
680 0x0 0x10000>;
681 isa@1e {
682 device_type = "isa";
683 #interrupt-cells = <2>;
684 #size-cells = <1>;
685 #address-cells = <2>;
686 reg = <0xf000 0x0 0x0 0x0 0x0>;
687 ranges = <0x1 0x0 0x1000000 0x0 0x0
688 0x1000>;
689 interrupt-parent = <&i8259>;
690
691 i8259: interrupt-controller@20 {
692 reg = <0x1 0x20 0x2
693 0x1 0xa0 0x2
694 0x1 0x4d0 0x2>;
695 interrupt-controller;
696 device_type = "interrupt-controller";
697 #address-cells = <0>;
698 #interrupt-cells = <2>;
699 compatible = "chrp,iic";
700 interrupts = <9 2>;
701 interrupt-parent = <&mpic>;
702 };
703
704 i8042@60 {
705 #size-cells = <0>;
706 #address-cells = <1>;
707 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
708 interrupts = <1 3 12 3>;
709 interrupt-parent =
710 <&i8259>;
711
712 keyboard@0 {
713 reg = <0x0>;
714 compatible = "pnpPNP,303";
715 };
716
717 mouse@1 {
718 reg = <0x1>;
719 compatible = "pnpPNP,f03";
720 };
721 };
722
723 rtc@70 {
724 compatible = "pnpPNP,b00";
725 reg = <0x1 0x70 0x2>;
726 };
727
728 gpio@400 {
729 reg = <0x1 0x400 0x80>;
730 };
731 };
732 };
733 }; 50 };
734
735 }; 51 };
736 52
737 pci1: pcie@fffe09000 { 53 pci1: pcie@fffe09000 {
738 compatible = "fsl,mpc8548-pcie";
739 device_type = "pci";
740 #interrupt-cells = <1>;
741 #size-cells = <2>;
742 #address-cells = <3>;
743 reg = <0xf 0xffe09000 0 0x1000>; 54 reg = <0xf 0xffe09000 0 0x1000>;
744 bus-range = <0 255>;
745 ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 55 ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
746 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x00010000>; 56 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x00010000>;
747 clock-frequency = <33333333>;
748 interrupt-parent = <&mpic>;
749 interrupts = <25 2>;
750 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
751 interrupt-map = <
752 /* IDSEL 0x0 */
753 0000 0x0 0x0 0x1 &mpic 0x4 0x1
754 0000 0x0 0x0 0x2 &mpic 0x5 0x1
755 0000 0x0 0x0 0x3 &mpic 0x6 0x1
756 0000 0x0 0x0 0x4 &mpic 0x7 0x1
757 >;
758 pcie@0 { 57 pcie@0 {
759 reg = <0x0 0x0 0x0 0x0 0x0>;
760 #size-cells = <2>;
761 #address-cells = <3>;
762 device_type = "pci";
763 ranges = <0x2000000 0x0 0xe0000000 58 ranges = <0x2000000 0x0 0xe0000000
764 0x2000000 0x0 0xe0000000 59 0x2000000 0x0 0xe0000000
765 0x0 0x20000000 60 0x0 0x20000000
@@ -771,31 +66,10 @@
771 }; 66 };
772 67
773 pci2: pcie@fffe0a000 { 68 pci2: pcie@fffe0a000 {
774 compatible = "fsl,mpc8548-pcie";
775 device_type = "pci";
776 #interrupt-cells = <1>;
777 #size-cells = <2>;
778 #address-cells = <3>;
779 reg = <0xf 0xffe0a000 0 0x1000>; 69 reg = <0xf 0xffe0a000 0 0x1000>;
780 bus-range = <0 255>;
781 ranges = <0x2000000 0x0 0xe0000000 0xc 0x40000000 0x0 0x20000000 70 ranges = <0x2000000 0x0 0xe0000000 0xc 0x40000000 0x0 0x20000000
782 0x1000000 0x0 0x00000000 0xf 0xffc20000 0x0 0x00010000>; 71 0x1000000 0x0 0x00000000 0xf 0xffc20000 0x0 0x00010000>;
783 clock-frequency = <33333333>;
784 interrupt-parent = <&mpic>;
785 interrupts = <26 2>;
786 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
787 interrupt-map = <
788 /* IDSEL 0x0 */
789 0000 0x0 0x0 0x1 &mpic 0x0 0x1
790 0000 0x0 0x0 0x2 &mpic 0x1 0x1
791 0000 0x0 0x0 0x3 &mpic 0x2 0x1
792 0000 0x0 0x0 0x4 &mpic 0x3 0x1
793 >;
794 pcie@0 { 72 pcie@0 {
795 reg = <0x0 0x0 0x0 0x0 0x0>;
796 #size-cells = <2>;
797 #address-cells = <3>;
798 device_type = "pci";
799 ranges = <0x2000000 0x0 0xe0000000 73 ranges = <0x2000000 0x0 0xe0000000
800 0x2000000 0x0 0xe0000000 74 0x2000000 0x0 0xe0000000
801 0x0 0x20000000 75 0x0 0x20000000
@@ -806,3 +80,11 @@
806 }; 80 };
807 }; 81 };
808}; 82};
83
84/*
85 * mpc8572ds.dtsi must be last to ensure board_pci0 overrides pci0 settings
86 * for interrupt-map & interrupt-map-mask
87 */
88
89/include/ "fsl/mpc8572si-post.dtsi"
90/include/ "mpc8572ds.dtsi"
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
index 3375c2ab0c32..d34d12712125 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
@@ -14,494 +14,69 @@
14 * option) any later version. 14 * option) any later version.
15 */ 15 */
16 16
17/dts-v1/; 17/include/ "mpc8572ds.dts"
18
18/ { 19/ {
19 model = "fsl,MPC8572DS"; 20 model = "fsl,MPC8572DS";
20 compatible = "fsl,MPC8572DS", "fsl,MPC8572DS-CAMP"; 21 compatible = "fsl,MPC8572DS", "fsl,MPC8572DS-CAMP";
21 #address-cells = <1>;
22 #size-cells = <1>;
23
24 aliases {
25 ethernet0 = &enet0;
26 ethernet1 = &enet1;
27 serial0 = &serial0;
28 pci0 = &pci0;
29 pci1 = &pci1;
30 };
31 22
32 cpus { 23 cpus {
33 #address-cells = <1>;
34 #size-cells = <0>;
35
36 PowerPC,8572@0 { 24 PowerPC,8572@0 {
37 device_type = "cpu";
38 reg = <0x0>;
39 d-cache-line-size = <32>; // 32 bytes
40 i-cache-line-size = <32>; // 32 bytes
41 d-cache-size = <0x8000>; // L1, 32K
42 i-cache-size = <0x8000>; // L1, 32K
43 timebase-frequency = <0>;
44 bus-frequency = <0>;
45 clock-frequency = <0>;
46 next-level-cache = <&L2>;
47 }; 25 };
48 26 PowerPC,8572@1 {
27 status = "disabled";
28 };
49 }; 29 };
50 30
51 memory { 31 localbus@ffe05000 {
52 device_type = "memory"; 32 status = "disabled";
53 reg = <0x0 0x0>; // Filled by U-Boot
54 }; 33 };
55 34
56 soc8572@ffe00000 { 35 soc8572@ffe00000 {
57 #address-cells = <1>; 36 serial@4600 {
58 #size-cells = <1>; 37 status = "disabled";
59 device_type = "soc";
60 compatible = "simple-bus";
61 ranges = <0x0 0xffe00000 0x100000>;
62 bus-frequency = <0>; // Filled out by uboot.
63
64 ecm-law@0 {
65 compatible = "fsl,ecm-law";
66 reg = <0x0 0x1000>;
67 fsl,num-laws = <12>;
68 }; 38 };
69 39 dma@c300 {
70 ecm@1000 { 40 status = "disabled";
71 compatible = "fsl,mpc8572-ecm", "fsl,ecm";
72 reg = <0x1000 0x1000>;
73 interrupts = <17 2>;
74 interrupt-parent = <&mpic>;
75 }; 41 };
76 42 gpio-controller@f000 {
77 memory-controller@2000 {
78 compatible = "fsl,mpc8572-memory-controller";
79 reg = <0x2000 0x1000>;
80 interrupt-parent = <&mpic>;
81 interrupts = <18 2>;
82 }; 43 };
83 44 l2-cache-controller@20000 {
84 memory-controller@6000 {
85 compatible = "fsl,mpc8572-memory-controller";
86 reg = <0x6000 0x1000>;
87 interrupt-parent = <&mpic>;
88 interrupts = <18 2>;
89 };
90
91 L2: l2-cache-controller@20000 {
92 compatible = "fsl,mpc8572-l2-cache-controller";
93 reg = <0x20000 0x1000>;
94 cache-line-size = <32>; // 32 bytes
95 cache-size = <0x80000>; // L2, 512K 45 cache-size = <0x80000>; // L2, 512K
96 interrupt-parent = <&mpic>;
97 interrupts = <16 2>;
98 }; 46 };
99 47 ethernet@26000 {
100 i2c@3000 { 48 status = "disabled";
101 #address-cells = <1>;
102 #size-cells = <0>;
103 cell-index = <0>;
104 compatible = "fsl-i2c";
105 reg = <0x3000 0x100>;
106 interrupts = <43 2>;
107 interrupt-parent = <&mpic>;
108 dfsrr;
109 }; 49 };
110 50 mdio@26520 {
111 i2c@3100 { 51 status = "disabled";
112 #address-cells = <1>;
113 #size-cells = <0>;
114 cell-index = <1>;
115 compatible = "fsl-i2c";
116 reg = <0x3100 0x100>;
117 interrupts = <43 2>;
118 interrupt-parent = <&mpic>;
119 dfsrr;
120 }; 52 };
121 53 ethernet@27000 {
122 dma@21300 { 54 status = "disabled";
123 #address-cells = <1>;
124 #size-cells = <1>;
125 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma";
126 reg = <0x21300 0x4>;
127 ranges = <0x0 0x21100 0x200>;
128 cell-index = <0>;
129 dma-channel@0 {
130 compatible = "fsl,mpc8572-dma-channel",
131 "fsl,eloplus-dma-channel";
132 reg = <0x0 0x80>;
133 cell-index = <0>;
134 interrupt-parent = <&mpic>;
135 interrupts = <20 2>;
136 };
137 dma-channel@80 {
138 compatible = "fsl,mpc8572-dma-channel",
139 "fsl,eloplus-dma-channel";
140 reg = <0x80 0x80>;
141 cell-index = <1>;
142 interrupt-parent = <&mpic>;
143 interrupts = <21 2>;
144 };
145 dma-channel@100 {
146 compatible = "fsl,mpc8572-dma-channel",
147 "fsl,eloplus-dma-channel";
148 reg = <0x100 0x80>;
149 cell-index = <2>;
150 interrupt-parent = <&mpic>;
151 interrupts = <22 2>;
152 };
153 dma-channel@180 {
154 compatible = "fsl,mpc8572-dma-channel",
155 "fsl,eloplus-dma-channel";
156 reg = <0x180 0x80>;
157 cell-index = <3>;
158 interrupt-parent = <&mpic>;
159 interrupts = <23 2>;
160 };
161 }; 55 };
162 56 mdio@27520 {
163 enet0: ethernet@24000 { 57 status = "disabled";
164 #address-cells = <1>;
165 #size-cells = <1>;
166 cell-index = <0>;
167 device_type = "network";
168 model = "eTSEC";
169 compatible = "gianfar";
170 reg = <0x24000 0x1000>;
171 ranges = <0x0 0x24000 0x1000>;
172 local-mac-address = [ 00 00 00 00 00 00 ];
173 interrupts = <29 2 30 2 34 2>;
174 interrupt-parent = <&mpic>;
175 phy-handle = <&phy0>;
176 phy-connection-type = "rgmii-id";
177
178 mdio@520 {
179 #address-cells = <1>;
180 #size-cells = <0>;
181 compatible = "fsl,gianfar-mdio";
182 reg = <0x520 0x20>;
183
184 phy0: ethernet-phy@0 {
185 interrupt-parent = <&mpic>;
186 interrupts = <10 1>;
187 reg = <0x0>;
188 };
189 phy1: ethernet-phy@1 {
190 interrupt-parent = <&mpic>;
191 interrupts = <10 1>;
192 reg = <0x1>;
193 };
194 };
195 }; 58 };
196 59 pic@40000 {
197 enet1: ethernet@25000 { 60 protected-sources = <
198 cell-index = <1>; 61 31 32 33 37 38 39 /* enet2 enet3 */
199 device_type = "network"; 62 76 77 78 79 26 42 /* dma2 pci2 serial*/
200 model = "eTSEC"; 63 0xe4 0xe5 0xe6 0xe7 /* msi */
201 compatible = "gianfar"; 64 >;
202 reg = <0x25000 0x1000>;
203 local-mac-address = [ 00 00 00 00 00 00 ];
204 interrupts = <35 2 36 2 40 2>;
205 interrupt-parent = <&mpic>;
206 phy-handle = <&phy1>;
207 phy-connection-type = "rgmii-id";
208 };
209
210 serial0: serial@4500 {
211 cell-index = <0>;
212 device_type = "serial";
213 compatible = "ns16550";
214 reg = <0x4500 0x100>;
215 clock-frequency = <0>;
216 }; 65 };
217 66
218 msi@41600 { 67 msi@41600 {
219 compatible = "fsl,mpc8572-msi", "fsl,mpic-msi";
220 reg = <0x41600 0x80>;
221 msi-available-ranges = <0 0x80>; 68 msi-available-ranges = <0 0x80>;
222 interrupts = < 69 interrupts = <
223 0xe0 0 70 0xe0 0
224 0xe1 0 71 0xe1 0
225 0xe2 0 72 0xe2 0
226 0xe3 0>; 73 0xe3 0>;
227 interrupt-parent = <&mpic>;
228 };
229
230 global-utilities@e0000 { //global utilities block
231 compatible = "fsl,mpc8572-guts";
232 reg = <0xe0000 0x1000>;
233 fsl,has-rstcr;
234 };
235
236 crypto@30000 {
237 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
238 "fsl,sec2.1", "fsl,sec2.0";
239 reg = <0x30000 0x10000>;
240 interrupts = <45 2 58 2>;
241 interrupt-parent = <&mpic>;
242 fsl,num-channels = <4>;
243 fsl,channel-fifo-len = <24>;
244 fsl,exec-units-mask = <0x9fe>;
245 fsl,descriptor-types-mask = <0x3ab0ebf>;
246 };
247
248 mpic: pic@40000 {
249 interrupt-controller;
250 #address-cells = <0>;
251 #interrupt-cells = <2>;
252 reg = <0x40000 0x40000>;
253 compatible = "chrp,open-pic";
254 device_type = "open-pic";
255 protected-sources = <
256 31 32 33 37 38 39 /* enet2 enet3 */
257 76 77 78 79 26 42 /* dma2 pci2 serial*/
258 0xe4 0xe5 0xe6 0xe7 /* msi */
259 >;
260 }; 74 };
261 }; 75 timer@42100 {
262 76 status = "disabled";
263 pci0: pcie@ffe08000 {
264 compatible = "fsl,mpc8548-pcie";
265 device_type = "pci";
266 #interrupt-cells = <1>;
267 #size-cells = <2>;
268 #address-cells = <3>;
269 reg = <0xffe08000 0x1000>;
270 bus-range = <0 255>;
271 ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
272 0x1000000 0x0 0x0 0xffc00000 0x0 0x10000>;
273 clock-frequency = <33333333>;
274 interrupt-parent = <&mpic>;
275 interrupts = <24 2>;
276 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
277 interrupt-map = <
278 /* IDSEL 0x11 func 0 - PCI slot 1 */
279 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1
280 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1
281 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1
282 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1
283
284 /* IDSEL 0x11 func 1 - PCI slot 1 */
285 0x8900 0x0 0x0 0x1 &mpic 0x2 0x1
286 0x8900 0x0 0x0 0x2 &mpic 0x3 0x1
287 0x8900 0x0 0x0 0x3 &mpic 0x4 0x1
288 0x8900 0x0 0x0 0x4 &mpic 0x1 0x1
289
290 /* IDSEL 0x11 func 2 - PCI slot 1 */
291 0x8a00 0x0 0x0 0x1 &mpic 0x2 0x1
292 0x8a00 0x0 0x0 0x2 &mpic 0x3 0x1
293 0x8a00 0x0 0x0 0x3 &mpic 0x4 0x1
294 0x8a00 0x0 0x0 0x4 &mpic 0x1 0x1
295
296 /* IDSEL 0x11 func 3 - PCI slot 1 */
297 0x8b00 0x0 0x0 0x1 &mpic 0x2 0x1
298 0x8b00 0x0 0x0 0x2 &mpic 0x3 0x1
299 0x8b00 0x0 0x0 0x3 &mpic 0x4 0x1
300 0x8b00 0x0 0x0 0x4 &mpic 0x1 0x1
301
302 /* IDSEL 0x11 func 4 - PCI slot 1 */
303 0x8c00 0x0 0x0 0x1 &mpic 0x2 0x1
304 0x8c00 0x0 0x0 0x2 &mpic 0x3 0x1
305 0x8c00 0x0 0x0 0x3 &mpic 0x4 0x1
306 0x8c00 0x0 0x0 0x4 &mpic 0x1 0x1
307
308 /* IDSEL 0x11 func 5 - PCI slot 1 */
309 0x8d00 0x0 0x0 0x1 &mpic 0x2 0x1
310 0x8d00 0x0 0x0 0x2 &mpic 0x3 0x1
311 0x8d00 0x0 0x0 0x3 &mpic 0x4 0x1
312 0x8d00 0x0 0x0 0x4 &mpic 0x1 0x1
313
314 /* IDSEL 0x11 func 6 - PCI slot 1 */
315 0x8e00 0x0 0x0 0x1 &mpic 0x2 0x1
316 0x8e00 0x0 0x0 0x2 &mpic 0x3 0x1
317 0x8e00 0x0 0x0 0x3 &mpic 0x4 0x1
318 0x8e00 0x0 0x0 0x4 &mpic 0x1 0x1
319
320 /* IDSEL 0x11 func 7 - PCI slot 1 */
321 0x8f00 0x0 0x0 0x1 &mpic 0x2 0x1
322 0x8f00 0x0 0x0 0x2 &mpic 0x3 0x1
323 0x8f00 0x0 0x0 0x3 &mpic 0x4 0x1
324 0x8f00 0x0 0x0 0x4 &mpic 0x1 0x1
325
326 /* IDSEL 0x12 func 0 - PCI slot 2 */
327 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1
328 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1
329 0x9000 0x0 0x0 0x3 &mpic 0x1 0x1
330 0x9000 0x0 0x0 0x4 &mpic 0x2 0x1
331
332 /* IDSEL 0x12 func 1 - PCI slot 2 */
333 0x9100 0x0 0x0 0x1 &mpic 0x3 0x1
334 0x9100 0x0 0x0 0x2 &mpic 0x4 0x1
335 0x9100 0x0 0x0 0x3 &mpic 0x1 0x1
336 0x9100 0x0 0x0 0x4 &mpic 0x2 0x1
337
338 /* IDSEL 0x12 func 2 - PCI slot 2 */
339 0x9200 0x0 0x0 0x1 &mpic 0x3 0x1
340 0x9200 0x0 0x0 0x2 &mpic 0x4 0x1
341 0x9200 0x0 0x0 0x3 &mpic 0x1 0x1
342 0x9200 0x0 0x0 0x4 &mpic 0x2 0x1
343
344 /* IDSEL 0x12 func 3 - PCI slot 2 */
345 0x9300 0x0 0x0 0x1 &mpic 0x3 0x1
346 0x9300 0x0 0x0 0x2 &mpic 0x4 0x1
347 0x9300 0x0 0x0 0x3 &mpic 0x1 0x1
348 0x9300 0x0 0x0 0x4 &mpic 0x2 0x1
349
350 /* IDSEL 0x12 func 4 - PCI slot 2 */
351 0x9400 0x0 0x0 0x1 &mpic 0x3 0x1
352 0x9400 0x0 0x0 0x2 &mpic 0x4 0x1
353 0x9400 0x0 0x0 0x3 &mpic 0x1 0x1
354 0x9400 0x0 0x0 0x4 &mpic 0x2 0x1
355
356 /* IDSEL 0x12 func 5 - PCI slot 2 */
357 0x9500 0x0 0x0 0x1 &mpic 0x3 0x1
358 0x9500 0x0 0x0 0x2 &mpic 0x4 0x1
359 0x9500 0x0 0x0 0x3 &mpic 0x1 0x1
360 0x9500 0x0 0x0 0x4 &mpic 0x2 0x1
361
362 /* IDSEL 0x12 func 6 - PCI slot 2 */
363 0x9600 0x0 0x0 0x1 &mpic 0x3 0x1
364 0x9600 0x0 0x0 0x2 &mpic 0x4 0x1
365 0x9600 0x0 0x0 0x3 &mpic 0x1 0x1
366 0x9600 0x0 0x0 0x4 &mpic 0x2 0x1
367
368 /* IDSEL 0x12 func 7 - PCI slot 2 */
369 0x9700 0x0 0x0 0x1 &mpic 0x3 0x1
370 0x9700 0x0 0x0 0x2 &mpic 0x4 0x1
371 0x9700 0x0 0x0 0x3 &mpic 0x1 0x1
372 0x9700 0x0 0x0 0x4 &mpic 0x2 0x1
373
374 // IDSEL 0x1c USB
375 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
376 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
377 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
378 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
379
380 // IDSEL 0x1d Audio
381 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
382
383 // IDSEL 0x1e Legacy
384 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
385 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
386
387 // IDSEL 0x1f IDE/SATA
388 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
389 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
390
391 >;
392
393 pcie@0 {
394 reg = <0x0 0x0 0x0 0x0 0x0>;
395 #size-cells = <2>;
396 #address-cells = <3>;
397 device_type = "pci";
398 ranges = <0x2000000 0x0 0x80000000
399 0x2000000 0x0 0x80000000
400 0x0 0x20000000
401
402 0x1000000 0x0 0x0
403 0x1000000 0x0 0x0
404 0x0 0x10000>;
405 uli1575@0 {
406 reg = <0x0 0x0 0x0 0x0 0x0>;
407 #size-cells = <2>;
408 #address-cells = <3>;
409 ranges = <0x2000000 0x0 0x80000000
410 0x2000000 0x0 0x80000000
411 0x0 0x20000000
412
413 0x1000000 0x0 0x0
414 0x1000000 0x0 0x0
415 0x0 0x10000>;
416 isa@1e {
417 device_type = "isa";
418 #interrupt-cells = <2>;
419 #size-cells = <1>;
420 #address-cells = <2>;
421 reg = <0xf000 0x0 0x0 0x0 0x0>;
422 ranges = <0x1 0x0 0x1000000 0x0 0x0
423 0x1000>;
424 interrupt-parent = <&i8259>;
425
426 i8259: interrupt-controller@20 {
427 reg = <0x1 0x20 0x2
428 0x1 0xa0 0x2
429 0x1 0x4d0 0x2>;
430 interrupt-controller;
431 device_type = "interrupt-controller";
432 #address-cells = <0>;
433 #interrupt-cells = <2>;
434 compatible = "chrp,iic";
435 interrupts = <9 2>;
436 interrupt-parent = <&mpic>;
437 };
438
439 i8042@60 {
440 #size-cells = <0>;
441 #address-cells = <1>;
442 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
443 interrupts = <1 3 12 3>;
444 interrupt-parent =
445 <&i8259>;
446
447 keyboard@0 {
448 reg = <0x0>;
449 compatible = "pnpPNP,303";
450 };
451
452 mouse@1 {
453 reg = <0x1>;
454 compatible = "pnpPNP,f03";
455 };
456 };
457
458 rtc@70 {
459 compatible = "pnpPNP,b00";
460 reg = <0x1 0x70 0x2>;
461 };
462
463 gpio@400 {
464 reg = <0x1 0x400 0x80>;
465 };
466 };
467 };
468 }; 77 };
469
470 }; 78 };
471 79 pcie@ffe0a000 {
472 pci1: pcie@ffe09000 { 80 status = "disabled";
473 compatible = "fsl,mpc8548-pcie";
474 device_type = "pci";
475 #interrupt-cells = <1>;
476 #size-cells = <2>;
477 #address-cells = <3>;
478 reg = <0xffe09000 0x1000>;
479 bus-range = <0 255>;
480 ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
481 0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>;
482 clock-frequency = <33333333>;
483 interrupt-parent = <&mpic>;
484 interrupts = <25 2>;
485 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
486 interrupt-map = <
487 /* IDSEL 0x0 */
488 0000 0x0 0x0 0x1 &mpic 0x4 0x1
489 0000 0x0 0x0 0x2 &mpic 0x5 0x1
490 0000 0x0 0x0 0x3 &mpic 0x6 0x1
491 0000 0x0 0x0 0x4 &mpic 0x7 0x1
492 >;
493 pcie@0 {
494 reg = <0x0 0x0 0x0 0x0 0x0>;
495 #size-cells = <2>;
496 #address-cells = <3>;
497 device_type = "pci";
498 ranges = <0x2000000 0x0 0xa0000000
499 0x2000000 0x0 0xa0000000
500 0x0 0x20000000
501
502 0x1000000 0x0 0x0
503 0x1000000 0x0 0x0
504 0x0 0x10000>;
505 };
506 }; 81 };
507}; 82};
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
index e7b477f6a3fe..d6a8fafc0d0d 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
@@ -15,169 +15,74 @@
15 * option) any later version. 15 * option) any later version.
16 */ 16 */
17 17
18/dts-v1/; 18/include/ "mpc8572ds.dts"
19
19/ { 20/ {
20 model = "fsl,MPC8572DS"; 21 model = "fsl,MPC8572DS";
21 compatible = "fsl,MPC8572DS", "fsl,MPC8572DS-CAMP"; 22 compatible = "fsl,MPC8572DS", "fsl,MPC8572DS-CAMP";
22 #address-cells = <1>;
23 #size-cells = <1>;
24
25 aliases {
26 ethernet2 = &enet2;
27 ethernet3 = &enet3;
28 serial0 = &serial0;
29 pci2 = &pci2;
30 };
31 23
32 cpus { 24 cpus {
33 #address-cells = <1>; 25 PowerPC,8572@0 {
34 #size-cells = <0>; 26 status = "disabled";
35 27 };
36 PowerPC,8572@1 { 28 PowerPC,8572@1 {
37 device_type = "cpu";
38 reg = <0x1>;
39 d-cache-line-size = <32>; // 32 bytes
40 i-cache-line-size = <32>; // 32 bytes
41 d-cache-size = <0x8000>; // L1, 32K
42 i-cache-size = <0x8000>; // L1, 32K
43 timebase-frequency = <0>;
44 bus-frequency = <0>;
45 clock-frequency = <0>;
46 next-level-cache = <&L2>;
47 }; 29 };
48 }; 30 };
49 31
50 memory { 32 localbus@ffe05000 {
51 device_type = "memory"; 33 status = "disabled";
52 reg = <0x0 0x0>; // Filled by U-Boot
53 }; 34 };
54 35
55 soc8572@ffe00000 { 36 soc8572@ffe00000 {
56 #address-cells = <1>; 37 ecm-law@0 {
57 #size-cells = <1>; 38 status = "disabled";
58 device_type = "soc";
59 compatible = "simple-bus";
60 ranges = <0x0 0xffe00000 0x100000>;
61 bus-frequency = <0>; // Filled out by uboot.
62
63 L2: l2-cache-controller@20000 {
64 compatible = "fsl,mpc8572-l2-cache-controller";
65 reg = <0x20000 0x1000>;
66 cache-line-size = <32>; // 32 bytes
67 cache-size = <0x80000>; // L2, 512K
68 interrupt-parent = <&mpic>;
69 }; 39 };
70 40 ecm@1000 {
71 dma@c300 { 41 status = "disabled";
72 #address-cells = <1>; 42 };
73 #size-cells = <1>; 43 memory-controller@2000 {
74 compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma"; 44 status = "disabled";
75 reg = <0xc300 0x4>; 45 };
76 ranges = <0x0 0xc100 0x200>; 46 memory-controller@6000 {
77 cell-index = <0>; 47 status = "disabled";
78 dma-channel@0 { 48 };
79 compatible = "fsl,mpc8572-dma-channel", 49 i2c@3000 {
80 "fsl,eloplus-dma-channel"; 50 status = "disabled";
81 reg = <0x0 0x80>; 51 };
82 cell-index = <0>; 52 i2c@3100 {
83 interrupt-parent = <&mpic>; 53 status = "disabled";
84 interrupts = <76 2>; 54 };
85 }; 55 serial@4500 {
86 dma-channel@80 { 56 status = "disabled";
87 compatible = "fsl,mpc8572-dma-channel", 57 };
88 "fsl,eloplus-dma-channel"; 58 gpio-controller@f000 {
89 reg = <0x80 0x80>; 59 status = "disabled";
90 cell-index = <1>; 60 };
91 interrupt-parent = <&mpic>; 61 l2-cache-controller@20000 {
92 interrupts = <77 2>; 62 cache-size = <0x80000>; // L2, 512K
93 }; 63 };
94 dma-channel@100 { 64 dma@21300 {
95 compatible = "fsl,mpc8572-dma-channel", 65 status = "disabled";
96 "fsl,eloplus-dma-channel"; 66 };
97 reg = <0x100 0x80>; 67 ethernet@24000 {
98 cell-index = <2>; 68 status = "disabled";
99 interrupt-parent = <&mpic>;
100 interrupts = <78 2>;
101 };
102 dma-channel@180 {
103 compatible = "fsl,mpc8572-dma-channel",
104 "fsl,eloplus-dma-channel";
105 reg = <0x180 0x80>;
106 cell-index = <3>;
107 interrupt-parent = <&mpic>;
108 interrupts = <79 2>;
109 };
110 }; 69 };
111
112 mdio@24520 { 70 mdio@24520 {
113 #address-cells = <1>; 71 status = "disabled";
114 #size-cells = <0>;
115 compatible = "fsl,gianfar-mdio";
116 reg = <0x24520 0x20>;
117
118 phy2: ethernet-phy@2 {
119 interrupt-parent = <&mpic>;
120 reg = <0x2>;
121 };
122 phy3: ethernet-phy@3 {
123 interrupt-parent = <&mpic>;
124 reg = <0x3>;
125 };
126 }; 72 };
127 73 ptp_clock@24e00 {
128 enet2: ethernet@26000 { 74 status = "disabled";
129 cell-index = <2>;
130 device_type = "network";
131 model = "eTSEC";
132 compatible = "gianfar";
133 reg = <0x26000 0x1000>;
134 local-mac-address = [ 00 00 00 00 00 00 ];
135 interrupts = <31 2 32 2 33 2>;
136 interrupt-parent = <&mpic>;
137 phy-handle = <&phy2>;
138 phy-connection-type = "rgmii-id";
139 }; 75 };
140 76 ethernet@25000 {
141 enet3: ethernet@27000 { 77 status = "disabled";
142 cell-index = <3>;
143 device_type = "network";
144 model = "eTSEC";
145 compatible = "gianfar";
146 reg = <0x27000 0x1000>;
147 local-mac-address = [ 00 00 00 00 00 00 ];
148 interrupts = <37 2 38 2 39 2>;
149 interrupt-parent = <&mpic>;
150 phy-handle = <&phy3>;
151 phy-connection-type = "rgmii-id";
152 }; 78 };
153 79 mdio@25520 {
154 msi@41600 { 80 status = "disabled";
155 compatible = "fsl,mpc8572-msi", "fsl,mpic-msi";
156 reg = <0x41600 0x80>;
157 msi-available-ranges = <0x80 0x80>;
158 interrupts = <
159 0xe4 0
160 0xe5 0
161 0xe6 0
162 0xe7 0>;
163 interrupt-parent = <&mpic>;
164 }; 81 };
165 82 crypto@30000 {
166 serial0: serial@4600 { 83 status = "disabled";
167 cell-index = <1>;
168 device_type = "serial";
169 compatible = "ns16550";
170 reg = <0x4600 0x100>;
171 clock-frequency = <0>;
172 }; 84 };
173 85 pic@40000 {
174 mpic: pic@40000 {
175 interrupt-controller;
176 #address-cells = <0>;
177 #interrupt-cells = <2>;
178 reg = <0x40000 0x40000>;
179 compatible = "chrp,open-pic";
180 device_type = "open-pic";
181 protected-sources = < 86 protected-sources = <
182 18 16 10 42 45 58 /* MEM L2 mdio serial crypto */ 87 18 16 10 42 45 58 /* MEM L2 mdio serial crypto */
183 29 30 34 35 36 40 /* enet0 enet1 */ 88 29 30 34 35 36 40 /* enet0 enet1 */
@@ -189,41 +94,25 @@
189 0xe0 0xe1 0xe2 0xe3 /* msi */ 94 0xe0 0xe1 0xe2 0xe3 /* msi */
190 >; 95 >;
191 }; 96 };
192 }; 97 timer@41100 {
193 98 status = "disabled";
194 pci2: pcie@ffe0a000 {
195 compatible = "fsl,mpc8548-pcie";
196 device_type = "pci";
197 #interrupt-cells = <1>;
198 #size-cells = <2>;
199 #address-cells = <3>;
200 reg = <0xffe0a000 0x1000>;
201 bus-range = <0 255>;
202 ranges = <0x2000000 0x0 0xc0000000 0xc0000000 0x0 0x20000000
203 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>;
204 clock-frequency = <33333333>;
205 interrupt-parent = <&mpic>;
206 interrupts = <26 2>;
207 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
208 interrupt-map = <
209 /* IDSEL 0x0 */
210 0000 0x0 0x0 0x1 &mpic 0x0 0x1
211 0000 0x0 0x0 0x2 &mpic 0x1 0x1
212 0000 0x0 0x0 0x3 &mpic 0x2 0x1
213 0000 0x0 0x0 0x4 &mpic 0x3 0x1
214 >;
215 pcie@0 {
216 reg = <0x0 0x0 0x0 0x0 0x0>;
217 #size-cells = <2>;
218 #address-cells = <3>;
219 device_type = "pci";
220 ranges = <0x2000000 0x0 0xc0000000
221 0x2000000 0x0 0xc0000000
222 0x0 0x20000000
223
224 0x1000000 0x0 0x0
225 0x1000000 0x0 0x0
226 0x0 0x10000>;
227 }; 99 };
100 msi@41600 {
101 msi-available-ranges = <0x80 0x80>;
102 interrupts = <
103 0xe4 0
104 0xe5 0
105 0xe6 0
106 0xe7 0>;
107 };
108 global-utilities@e0000 {
109 status = "disabled";
110 };
111 };
112 pcie@ffe08000 {
113 status = "disabled";
114 };
115 pcie@ffe09000 {
116 status = "disabled";
228 }; 117 };
229}; 118};
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 83c3218cb4da..6a109a0ceac9 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -175,7 +175,7 @@
175 serial0: serial@4500 { 175 serial0: serial@4500 {
176 cell-index = <0>; 176 cell-index = <0>;
177 device_type = "serial"; 177 device_type = "serial";
178 compatible = "ns16550"; 178 compatible = "fsl,ns16550", "ns16550";
179 reg = <0x4500 0x100>; 179 reg = <0x4500 0x100>;
180 clock-frequency = <0>; 180 clock-frequency = <0>;
181 interrupts = <42 2>; 181 interrupts = <42 2>;
@@ -186,7 +186,7 @@
186 serial1: serial@4600 { 186 serial1: serial@4600 {
187 cell-index = <1>; 187 cell-index = <1>;
188 device_type = "serial"; 188 device_type = "serial";
189 compatible = "ns16550"; 189 compatible = "fsl,ns16550", "ns16550";
190 reg = <0x4600 0x100>; 190 reg = <0x4600 0x100>;
191 clock-frequency = <0>; 191 clock-frequency = <0>;
192 interrupts = <42 2>; 192 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index 848320e4d3c4..1e8666ccbed8 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -26,13 +26,6 @@
26 serial1 = &serial1; 26 serial1 = &serial1;
27 pci0 = &pci0; 27 pci0 = &pci0;
28 pci1 = &pci1; 28 pci1 = &pci1;
29/*
30 * Only one of Rapid IO or PCI can be present due to HW limitations and
31 * due to the fact that the 2 now share address space in the new memory
32 * map. The most likely case is that we have PCI, so comment out the
33 * rapidio node. Leave it here for reference.
34 */
35 /* rapidio0 = &rapidio0; */
36 }; 29 };
37 30
38 cpus { 31 cpus {
@@ -335,7 +328,7 @@
335 serial0: serial@4500 { 328 serial0: serial@4500 {
336 cell-index = <0>; 329 cell-index = <0>;
337 device_type = "serial"; 330 device_type = "serial";
338 compatible = "ns16550"; 331 compatible = "fsl,ns16550", "ns16550";
339 reg = <0x4500 0x100>; 332 reg = <0x4500 0x100>;
340 clock-frequency = <0>; 333 clock-frequency = <0>;
341 interrupts = <42 2>; 334 interrupts = <42 2>;
@@ -345,7 +338,7 @@
345 serial1: serial@4600 { 338 serial1: serial@4600 {
346 cell-index = <1>; 339 cell-index = <1>;
347 device_type = "serial"; 340 device_type = "serial";
348 compatible = "ns16550"; 341 compatible = "fsl,ns16550", "ns16550";
349 reg = <0x4600 0x100>; 342 reg = <0x4600 0x100>;
350 clock-frequency = <0>; 343 clock-frequency = <0>;
351 interrupts = <28 2>; 344 interrupts = <28 2>;
@@ -361,6 +354,41 @@
361 device_type = "open-pic"; 354 device_type = "open-pic";
362 }; 355 };
363 356
357 rmu: rmu@d3000 {
358 #address-cells = <1>;
359 #size-cells = <1>;
360 compatible = "fsl,srio-rmu";
361 reg = <0xd3000 0x500>;
362 ranges = <0x0 0xd3000 0x500>;
363
364 message-unit@0 {
365 compatible = "fsl,srio-msg-unit";
366 reg = <0x0 0x100>;
367 interrupts = <
368 53 2 /* msg1_tx_irq */
369 54 2>;/* msg1_rx_irq */
370 };
371 message-unit@100 {
372 compatible = "fsl,srio-msg-unit";
373 reg = <0x100 0x100>;
374 interrupts = <
375 55 2 /* msg2_tx_irq */
376 56 2>;/* msg2_rx_irq */
377 };
378 doorbell-unit@400 {
379 compatible = "fsl,srio-dbell-unit";
380 reg = <0x400 0x80>;
381 interrupts = <
382 49 2 /* bell_outb_irq */
383 50 2>;/* bell_inb_irq */
384 };
385 port-write-unit@4e0 {
386 compatible = "fsl,srio-port-write-unit";
387 reg = <0x4e0 0x20>;
388 interrupts = <48 2>;
389 };
390 };
391
364 global-utilities@e0000 { 392 global-utilities@e0000 {
365 compatible = "fsl,mpc8641-guts"; 393 compatible = "fsl,mpc8641-guts";
366 reg = <0xe0000 0x1000>; 394 reg = <0xe0000 0x1000>;
@@ -612,16 +640,27 @@
612 }; 640 };
613 }; 641 };
614/* 642/*
615 rapidio0: rapidio@ffec0000 { 643 * Only one of Rapid IO or PCI can be present due to HW limitations and
644 * due to the fact that the 2 now share address space in the new memory
645 * map. The most likely case is that we have PCI, so comment out the
646 * rapidio node. Leave it here for reference.
647
648 rapidio@ffec0000 {
649 reg = <0xffec0000 0x11000>;
650 compatible = "fsl,srio";
651 interrupt-parent = <&mpic>;
652 interrupts = <48 2>;
616 #address-cells = <2>; 653 #address-cells = <2>;
617 #size-cells = <2>; 654 #size-cells = <2>;
618 compatible = "fsl,rapidio-delta"; 655 fsl,srio-rmu-handle = <&rmu>;
619 reg = <0xffec0000 0x20000>; 656 ranges;
620 ranges = <0 0 0x80000000 0 0x20000000>; 657
621 interrupt-parent = <&mpic>; 658 port1 {
622 // err_irq bell_outb_irq bell_inb_irq 659 #address-cells = <2>;
623 // msg1_tx_irq msg1_rx_irq msg2_tx_irq msg2_rx_irq 660 #size-cells = <2>;
624 interrupts = <48 2 49 2 50 2 53 2 54 2 55 2 56 2>; 661 cell-index = <1>;
662 ranges = <0 0 0x80000000 0 0x20000000>;
663 };
625 }; 664 };
626*/ 665*/
627 666
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts b/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
index 8be8e701e1d3..fd4cd4da60b5 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
@@ -328,7 +328,7 @@
328 serial0: serial@4500 { 328 serial0: serial@4500 {
329 cell-index = <0>; 329 cell-index = <0>;
330 device_type = "serial"; 330 device_type = "serial";
331 compatible = "ns16550"; 331 compatible = "fsl,ns16550", "ns16550";
332 reg = <0x4500 0x100>; 332 reg = <0x4500 0x100>;
333 clock-frequency = <0>; 333 clock-frequency = <0>;
334 interrupts = <42 2>; 334 interrupts = <42 2>;
@@ -338,7 +338,7 @@
338 serial1: serial@4600 { 338 serial1: serial@4600 {
339 cell-index = <1>; 339 cell-index = <1>;
340 device_type = "serial"; 340 device_type = "serial";
341 compatible = "ns16550"; 341 compatible = "fsl,ns16550", "ns16550";
342 reg = <0x4600 0x100>; 342 reg = <0x4600 0x100>;
343 clock-frequency = <0>; 343 clock-frequency = <0>;
344 interrupts = <28 2>; 344 interrupts = <28 2>;
diff --git a/arch/powerpc/boot/dts/obs600.dts b/arch/powerpc/boot/dts/obs600.dts
new file mode 100644
index 000000000000..18e7d79ee4c3
--- /dev/null
+++ b/arch/powerpc/boot/dts/obs600.dts
@@ -0,0 +1,314 @@
1/*
2 * Device Tree Source for PlatHome OpenBlockS 600 (405EX)
3 *
4 * Copyright 2011 Ben Herrenschmidt, IBM Corp.
5 *
6 * Based on Kilauea by:
7 *
8 * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de>
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without
12 * any warranty of any kind, whether express or implied.
13 */
14
15/dts-v1/;
16
17/ {
18 #address-cells = <1>;
19 #size-cells = <1>;
20 model = "PlatHome,OpenBlockS 600";
21 compatible = "plathome,obs600";
22 dcr-parent = <&{/cpus/cpu@0}>;
23
24 aliases {
25 ethernet0 = &EMAC0;
26 ethernet1 = &EMAC1;
27 serial0 = &UART0;
28 serial1 = &UART1;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 cpu@0 {
36 device_type = "cpu";
37 model = "PowerPC,405EX";
38 reg = <0x00000000>;
39 clock-frequency = <0>; /* Filled in by U-Boot */
40 timebase-frequency = <0>; /* Filled in by U-Boot */
41 i-cache-line-size = <32>;
42 d-cache-line-size = <32>;
43 i-cache-size = <16384>; /* 16 kB */
44 d-cache-size = <16384>; /* 16 kB */
45 dcr-controller;
46 dcr-access-method = "native";
47 };
48 };
49
50 memory {
51 device_type = "memory";
52 reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */
53 };
54
55 UIC0: interrupt-controller {
56 compatible = "ibm,uic-405ex", "ibm,uic";
57 interrupt-controller;
58 cell-index = <0>;
59 dcr-reg = <0x0c0 0x009>;
60 #address-cells = <0>;
61 #size-cells = <0>;
62 #interrupt-cells = <2>;
63 };
64
65 UIC1: interrupt-controller1 {
66 compatible = "ibm,uic-405ex","ibm,uic";
67 interrupt-controller;
68 cell-index = <1>;
69 dcr-reg = <0x0d0 0x009>;
70 #address-cells = <0>;
71 #size-cells = <0>;
72 #interrupt-cells = <2>;
73 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
74 interrupt-parent = <&UIC0>;
75 };
76
77 UIC2: interrupt-controller2 {
78 compatible = "ibm,uic-405ex","ibm,uic";
79 interrupt-controller;
80 cell-index = <2>;
81 dcr-reg = <0x0e0 0x009>;
82 #address-cells = <0>;
83 #size-cells = <0>;
84 #interrupt-cells = <2>;
85 interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */
86 interrupt-parent = <&UIC0>;
87 };
88
89 CPM0: cpm {
90 compatible = "ibm,cpm";
91 dcr-access-method = "native";
92 dcr-reg = <0x0b0 0x003>;
93 unused-units = <0x00000000>;
94 idle-doze = <0x02000000>;
95 standby = <0xe3e74800>;
96 };
97
98 plb {
99 compatible = "ibm,plb-405ex", "ibm,plb4";
100 #address-cells = <1>;
101 #size-cells = <1>;
102 ranges;
103 clock-frequency = <0>; /* Filled in by U-Boot */
104
105 SDRAM0: memory-controller {
106 compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2";
107 dcr-reg = <0x010 0x002>;
108 interrupt-parent = <&UIC2>;
109 interrupts = <0x5 0x4 /* ECC DED Error */
110 0x6 0x4>; /* ECC SEC Error */
111 };
112
113 CRYPTO: crypto@ef700000 {
114 compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto";
115 reg = <0xef700000 0x80400>;
116 interrupt-parent = <&UIC0>;
117 interrupts = <0x17 0x2>;
118 };
119
120 MAL0: mcmal {
121 compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
122 dcr-reg = <0x180 0x062>;
123 num-tx-chans = <2>;
124 num-rx-chans = <2>;
125 interrupt-parent = <&MAL0>;
126 interrupts = <0x0 0x1 0x2 0x3 0x4>;
127 #interrupt-cells = <1>;
128 #address-cells = <0>;
129 #size-cells = <0>;
130 interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4
131 /*RXEOB*/ 0x1 &UIC0 0xb 0x4
132 /*SERR*/ 0x2 &UIC1 0x0 0x4
133 /*TXDE*/ 0x3 &UIC1 0x1 0x4
134 /*RXDE*/ 0x4 &UIC1 0x2 0x4>;
135 interrupt-map-mask = <0xffffffff>;
136 };
137
138 POB0: opb {
139 compatible = "ibm,opb-405ex", "ibm,opb";
140 #address-cells = <1>;
141 #size-cells = <1>;
142 ranges = <0x80000000 0x80000000 0x10000000
143 0xef600000 0xef600000 0x00a00000
144 0xf0000000 0xf0000000 0x10000000>;
145 dcr-reg = <0x0a0 0x005>;
146 clock-frequency = <0>; /* Filled in by U-Boot */
147
148 EBC0: ebc {
149 compatible = "ibm,ebc-405ex", "ibm,ebc";
150 dcr-reg = <0x012 0x002>;
151 #address-cells = <2>;
152 #size-cells = <1>;
153 clock-frequency = <0>; /* Filled in by U-Boot */
154 /* ranges property is supplied by U-Boot */
155 interrupts = <0x5 0x1>;
156 interrupt-parent = <&UIC1>;
157
158 nor_flash@0,0 {
159 compatible = "amd,s29gl512n", "cfi-flash";
160 bank-width = <2>;
161 reg = <0x00000000 0x00000000 0x08000000>;
162 #address-cells = <1>;
163 #size-cells = <1>;
164 partition@0 {
165 label = "kernel + initrd";
166 reg = <0x00000000 0x03de0000>;
167 };
168 partition@3de0000 {
169 label = "user config area";
170 reg = <0x03de0000 0x00080000>;
171 };
172 partition@3e60000 {
173 label = "user program area";
174 reg = <0x03e60000 0x04000000>;
175 };
176 partition@7e60000 {
177 label = "flat device tree";
178 reg = <0x07e60000 0x00080000>;
179 };
180 partition@7ee0000 {
181 label = "test program";
182 reg = <0x07ee0000 0x00080000>;
183 };
184 partition@7f60000 {
185 label = "u-boot env";
186 reg = <0x07f60000 0x00040000>;
187 };
188 partition@7fa0000 {
189 label = "u-boot";
190 reg = <0x07fa0000 0x00060000>;
191 };
192 };
193 };
194
195 UART0: serial@ef600200 {
196 device_type = "serial";
197 compatible = "ns16550";
198 reg = <0xef600200 0x00000008>;
199 virtual-reg = <0xef600200>;
200 clock-frequency = <0>; /* Filled in by U-Boot */
201 current-speed = <0>;
202 interrupt-parent = <&UIC0>;
203 interrupts = <0x1a 0x4>;
204 };
205
206 UART1: serial@ef600300 {
207 device_type = "serial";
208 compatible = "ns16550";
209 reg = <0xef600300 0x00000008>;
210 virtual-reg = <0xef600300>;
211 clock-frequency = <0>; /* Filled in by U-Boot */
212 current-speed = <0>;
213 interrupt-parent = <&UIC0>;
214 interrupts = <0x1 0x4>;
215 };
216
217 IIC0: i2c@ef600400 {
218 compatible = "ibm,iic-405ex", "ibm,iic";
219 reg = <0xef600400 0x00000014>;
220 interrupt-parent = <&UIC0>;
221 interrupts = <0x2 0x4>;
222 #address-cells = <1>;
223 #size-cells = <0>;
224
225 rtc@68 {
226 compatible = "dallas,ds1340";
227 reg = <0x68>;
228 };
229 };
230
231 IIC1: i2c@ef600500 {
232 compatible = "ibm,iic-405ex", "ibm,iic";
233 reg = <0xef600500 0x00000014>;
234 interrupt-parent = <&UIC0>;
235 interrupts = <0x7 0x4>;
236 };
237
238 RGMII0: emac-rgmii@ef600b00 {
239 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
240 reg = <0xef600b00 0x00000104>;
241 has-mdio;
242 };
243
244 EMAC0: ethernet@ef600900 {
245 linux,network-index = <0x0>;
246 device_type = "network";
247 compatible = "ibm,emac-405ex", "ibm,emac4sync";
248 interrupt-parent = <&EMAC0>;
249 interrupts = <0x0 0x1>;
250 #interrupt-cells = <1>;
251 #address-cells = <0>;
252 #size-cells = <0>;
253 interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4
254 /*Wake*/ 0x1 &UIC1 0x1d 0x4>;
255 reg = <0xef600900 0x000000c4>;
256 local-mac-address = [000000000000]; /* Filled in by U-Boot */
257 mal-device = <&MAL0>;
258 mal-tx-channel = <0>;
259 mal-rx-channel = <0>;
260 cell-index = <0>;
261 max-frame-size = <9000>;
262 rx-fifo-size = <4096>;
263 tx-fifo-size = <2048>;
264 rx-fifo-size-gige = <16384>;
265 tx-fifo-size-gige = <16384>;
266 phy-mode = "rgmii";
267 phy-map = <0x00000000>;
268 rgmii-device = <&RGMII0>;
269 rgmii-channel = <0>;
270 has-inverted-stacr-oc;
271 has-new-stacr-staopc;
272 };
273
274 EMAC1: ethernet@ef600a00 {
275 linux,network-index = <0x1>;
276 device_type = "network";
277 compatible = "ibm,emac-405ex", "ibm,emac4sync";
278 interrupt-parent = <&EMAC1>;
279 interrupts = <0x0 0x1>;
280 #interrupt-cells = <1>;
281 #address-cells = <0>;
282 #size-cells = <0>;
283 interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4
284 /*Wake*/ 0x1 &UIC1 0x1f 0x4>;
285 reg = <0xef600a00 0x000000c4>;
286 local-mac-address = [000000000000]; /* Filled in by U-Boot */
287 mal-device = <&MAL0>;
288 mal-tx-channel = <1>;
289 mal-rx-channel = <1>;
290 cell-index = <1>;
291 max-frame-size = <9000>;
292 rx-fifo-size = <4096>;
293 tx-fifo-size = <2048>;
294 rx-fifo-size-gige = <16384>;
295 tx-fifo-size-gige = <16384>;
296 phy-mode = "rgmii";
297 phy-map = <0x00000000>;
298 rgmii-device = <&RGMII0>;
299 rgmii-channel = <1>;
300 has-inverted-stacr-oc;
301 has-new-stacr-staopc;
302 };
303
304 GPIO: gpio@ef600800 {
305 device_type = "gpio";
306 compatible = "ibm,gpio-405ex", "ibm,ppc4xx-gpio";
307 reg = <0xef600800 0x50>;
308 };
309 };
310 };
311 chosen {
312 linux,stdout-path = "/plb/opb/serial@ef600200";
313 };
314};
diff --git a/arch/powerpc/boot/dts/p1010rdb.dts b/arch/powerpc/boot/dts/p1010rdb.dts
index d6c669c888e9..b868d22984e9 100644
--- a/arch/powerpc/boot/dts/p1010rdb.dts
+++ b/arch/powerpc/boot/dts/p1010rdb.dts
@@ -9,230 +9,33 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/include/ "p1010si.dtsi" 12/include/ "fsl/p1010si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "fsl,P1010RDB"; 15 model = "fsl,P1010RDB";
16 compatible = "fsl,P1010RDB"; 16 compatible = "fsl,P1010RDB";
17 17
18 aliases {
19 serial0 = &serial0;
20 serial1 = &serial1;
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 ethernet2 = &enet2;
24 pci0 = &pci0;
25 pci1 = &pci1;
26 can0 = &can0;
27 can1 = &can1;
28 };
29
30 memory { 18 memory {
31 device_type = "memory"; 19 device_type = "memory";
32 }; 20 };
33 21
34 ifc@ffe1e000 { 22 board_ifc: ifc: ifc@ffe1e000 {
35 /* NOR, NAND Flashes and CPLD on board */ 23 /* NOR, NAND Flashes and CPLD on board */
36 ranges = <0x0 0x0 0x0 0xee000000 0x02000000 24 ranges = <0x0 0x0 0x0 0xee000000 0x02000000
37 0x1 0x0 0x0 0xff800000 0x00010000 25 0x1 0x0 0x0 0xff800000 0x00010000
38 0x3 0x0 0x0 0xffb00000 0x00000020>; 26 0x3 0x0 0x0 0xffb00000 0x00000020>;
39 27 reg = <0x0 0xffe1e000 0 0x2000>;
40 nor@0,0 {
41 #address-cells = <1>;
42 #size-cells = <1>;
43 compatible = "cfi-flash";
44 reg = <0x0 0x0 0x2000000>;
45 bank-width = <2>;
46 device-width = <1>;
47
48 partition@40000 {
49 /* 256KB for DTB Image */
50 reg = <0x00040000 0x00040000>;
51 label = "NOR DTB Image";
52 };
53
54 partition@80000 {
55 /* 7 MB for Linux Kernel Image */
56 reg = <0x00080000 0x00700000>;
57 label = "NOR Linux Kernel Image";
58 };
59
60 partition@800000 {
61 /* 20MB for JFFS2 based Root file System */
62 reg = <0x00800000 0x01400000>;
63 label = "NOR JFFS2 Root File System";
64 };
65
66 partition@1f00000 {
67 /* This location must not be altered */
68 /* 512KB for u-boot Bootloader Image */
69 /* 512KB for u-boot Environment Variables */
70 reg = <0x01f00000 0x00100000>;
71 label = "NOR U-Boot Image";
72 read-only;
73 };
74 };
75
76 nand@1,0 {
77 #address-cells = <1>;
78 #size-cells = <1>;
79 compatible = "fsl,ifc-nand";
80 reg = <0x1 0x0 0x10000>;
81
82 partition@0 {
83 /* This location must not be altered */
84 /* 1MB for u-boot Bootloader Image */
85 reg = <0x0 0x00100000>;
86 label = "NAND U-Boot Image";
87 read-only;
88 };
89
90 partition@100000 {
91 /* 1MB for DTB Image */
92 reg = <0x00100000 0x00100000>;
93 label = "NAND DTB Image";
94 };
95
96 partition@200000 {
97 /* 4MB for Linux Kernel Image */
98 reg = <0x00200000 0x00400000>;
99 label = "NAND Linux Kernel Image";
100 };
101
102 partition@600000 {
103 /* 4MB for Compressed Root file System Image */
104 reg = <0x00600000 0x00400000>;
105 label = "NAND Compressed RFS Image";
106 };
107
108 partition@a00000 {
109 /* 15MB for JFFS2 based Root file System */
110 reg = <0x00a00000 0x00f00000>;
111 label = "NAND JFFS2 Root File System";
112 };
113
114 partition@1900000 {
115 /* 7MB for User Area */
116 reg = <0x01900000 0x00700000>;
117 label = "NAND User area";
118 };
119 };
120
121 cpld@3,0 {
122 #address-cells = <1>;
123 #size-cells = <1>;
124 compatible = "fsl,p1010rdb-cpld";
125 reg = <0x3 0x0 0x0000020>;
126 bank-width = <1>;
127 device-width = <1>;
128 };
129 }; 28 };
130 29
131 soc@ffe00000 { 30 board_soc: soc: soc@ffe00000 {
132 spi@7000 { 31 ranges = <0x0 0x0 0xffe00000 0x100000>;
133 flash@0 {
134 #address-cells = <1>;
135 #size-cells = <1>;
136 compatible = "spansion,s25sl12801";
137 reg = <0>;
138 spi-max-frequency = <50000000>;
139
140 partition@0 {
141 /* 1MB for u-boot Bootloader Image */
142 /* 1MB for Environment */
143 reg = <0x0 0x00100000>;
144 label = "SPI Flash U-Boot Image";
145 read-only;
146 };
147
148 partition@100000 {
149 /* 512KB for DTB Image */
150 reg = <0x00100000 0x00080000>;
151 label = "SPI Flash DTB Image";
152 };
153
154 partition@180000 {
155 /* 4MB for Linux Kernel Image */
156 reg = <0x00180000 0x00400000>;
157 label = "SPI Flash Linux Kernel Image";
158 };
159
160 partition@580000 {
161 /* 4MB for Compressed RFS Image */
162 reg = <0x00580000 0x00400000>;
163 label = "SPI Flash Compressed RFSImage";
164 };
165
166 partition@980000 {
167 /* 6.5MB for JFFS2 based RFS */
168 reg = <0x00980000 0x00680000>;
169 label = "SPI Flash JFFS2 RFS";
170 };
171 };
172 };
173
174 usb@22000 {
175 phy_type = "utmi";
176 };
177
178 mdio@24000 {
179 phy0: ethernet-phy@0 {
180 interrupt-parent = <&mpic>;
181 interrupts = <3 1>;
182 reg = <0x1>;
183 };
184
185 phy1: ethernet-phy@1 {
186 interrupt-parent = <&mpic>;
187 interrupts = <2 1>;
188 reg = <0x0>;
189 };
190
191 phy2: ethernet-phy@2 {
192 interrupt-parent = <&mpic>;
193 interrupts = <2 1>;
194 reg = <0x2>;
195 };
196 };
197
198 enet0: ethernet@b0000 {
199 phy-handle = <&phy0>;
200 phy-connection-type = "rgmii-id";
201 };
202
203 enet1: ethernet@b1000 {
204 phy-handle = <&phy1>;
205 tbi-handle = <&tbi0>;
206 phy-connection-type = "sgmii";
207 };
208
209 enet2: ethernet@b2000 {
210 phy-handle = <&phy2>;
211 tbi-handle = <&tbi1>;
212 phy-connection-type = "sgmii";
213 };
214 }; 32 };
215 33
216 pci0: pcie@ffe09000 { 34 pci0: pcie@ffe09000 {
35 reg = <0 0xffe09000 0 0x1000>;
217 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 36 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
218 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 37 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
219 pcie@0 { 38 pcie@0 {
220 reg = <0x0 0x0 0x0 0x0 0x0>;
221 #interrupt-cells = <1>;
222 #size-cells = <2>;
223 #address-cells = <3>;
224 device_type = "pci";
225 interrupt-parent = <&mpic>;
226 interrupts = <16 2>;
227 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
228 interrupt-map = <
229 /* IDSEL 0x0 */
230 0000 0x0 0x0 0x1 &mpic 0x4 0x1
231 0000 0x0 0x0 0x2 &mpic 0x5 0x1
232 0000 0x0 0x0 0x3 &mpic 0x6 0x1
233 0000 0x0 0x0 0x4 &mpic 0x7 0x1
234 >;
235
236 ranges = <0x2000000 0x0 0xa0000000 39 ranges = <0x2000000 0x0 0xa0000000
237 0x2000000 0x0 0xa0000000 40 0x2000000 0x0 0xa0000000
238 0x0 0x20000000 41 0x0 0x20000000
@@ -244,24 +47,10 @@
244 }; 47 };
245 48
246 pci1: pcie@ffe0a000 { 49 pci1: pcie@ffe0a000 {
50 reg = <0 0xffe0a000 0 0x1000>;
247 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 51 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
248 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 52 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
249 pcie@0 { 53 pcie@0 {
250 reg = <0x0 0x0 0x0 0x0 0x0>;
251 #interrupt-cells = <1>;
252 #size-cells = <2>;
253 #address-cells = <3>;
254 device_type = "pci";
255 interrupt-parent = <&mpic>;
256 interrupts = <16 2>;
257 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
258 interrupt-map = <
259 /* IDSEL 0x0 */
260 0000 0x0 0x0 0x1 &mpic 0x4 0x1
261 0000 0x0 0x0 0x2 &mpic 0x5 0x1
262 0000 0x0 0x0 0x3 &mpic 0x6 0x1
263 0000 0x0 0x0 0x4 &mpic 0x7 0x1
264 >;
265 ranges = <0x2000000 0x0 0x80000000 54 ranges = <0x2000000 0x0 0x80000000
266 0x2000000 0x0 0x80000000 55 0x2000000 0x0 0x80000000
267 0x0 0x20000000 56 0x0 0x20000000
@@ -272,3 +61,6 @@
272 }; 61 };
273 }; 62 };
274}; 63};
64
65/include/ "p1010rdb.dtsi"
66/include/ "fsl/p1010si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p1010rdb.dtsi b/arch/powerpc/boot/dts/p1010rdb.dtsi
new file mode 100644
index 000000000000..d4c4a7730285
--- /dev/null
+++ b/arch/powerpc/boot/dts/p1010rdb.dtsi
@@ -0,0 +1,234 @@
1/*
2 * P1010 RDB Device Tree Source stub (no addresses or top-level ranges)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&board_ifc {
36 nor@0,0 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 compatible = "cfi-flash";
40 reg = <0x0 0x0 0x2000000>;
41 bank-width = <2>;
42 device-width = <1>;
43
44 partition@40000 {
45 /* 256KB for DTB Image */
46 reg = <0x00040000 0x00040000>;
47 label = "NOR DTB Image";
48 };
49
50 partition@80000 {
51 /* 7 MB for Linux Kernel Image */
52 reg = <0x00080000 0x00700000>;
53 label = "NOR Linux Kernel Image";
54 };
55
56 partition@800000 {
57 /* 20MB for JFFS2 based Root file System */
58 reg = <0x00800000 0x01400000>;
59 label = "NOR JFFS2 Root File System";
60 };
61
62 partition@1f00000 {
63 /* This location must not be altered */
64 /* 512KB for u-boot Bootloader Image */
65 /* 512KB for u-boot Environment Variables */
66 reg = <0x01f00000 0x00100000>;
67 label = "NOR U-Boot Image";
68 read-only;
69 };
70 };
71
72 nand@1,0 {
73 #address-cells = <1>;
74 #size-cells = <1>;
75 compatible = "fsl,ifc-nand";
76 reg = <0x1 0x0 0x10000>;
77
78 partition@0 {
79 /* This location must not be altered */
80 /* 1MB for u-boot Bootloader Image */
81 reg = <0x0 0x00100000>;
82 label = "NAND U-Boot Image";
83 read-only;
84 };
85
86 partition@100000 {
87 /* 1MB for DTB Image */
88 reg = <0x00100000 0x00100000>;
89 label = "NAND DTB Image";
90 };
91
92 partition@200000 {
93 /* 4MB for Linux Kernel Image */
94 reg = <0x00200000 0x00400000>;
95 label = "NAND Linux Kernel Image";
96 };
97
98 partition@600000 {
99 /* 4MB for Compressed Root file System Image */
100 reg = <0x00600000 0x00400000>;
101 label = "NAND Compressed RFS Image";
102 };
103
104 partition@a00000 {
105 /* 15MB for JFFS2 based Root file System */
106 reg = <0x00a00000 0x00f00000>;
107 label = "NAND JFFS2 Root File System";
108 };
109
110 partition@1900000 {
111 /* 7MB for User Area */
112 reg = <0x01900000 0x00700000>;
113 label = "NAND User area";
114 };
115 };
116
117 cpld@3,0 {
118 #address-cells = <1>;
119 #size-cells = <1>;
120 compatible = "fsl,p1010rdb-cpld";
121 reg = <0x3 0x0 0x0000020>;
122 bank-width = <1>;
123 device-width = <1>;
124 };
125};
126
127&board_soc {
128 i2c@3000 {
129 rtc@68 {
130 compatible = "pericom,pt7c4338";
131 reg = <0x68>;
132 };
133 };
134
135 spi@7000 {
136 flash@0 {
137 #address-cells = <1>;
138 #size-cells = <1>;
139 compatible = "spansion,s25sl12801";
140 reg = <0>;
141 spi-max-frequency = <50000000>;
142
143 partition@0 {
144 /* 1MB for u-boot Bootloader Image */
145 /* 1MB for Environment */
146 reg = <0x0 0x00100000>;
147 label = "SPI Flash U-Boot Image";
148 read-only;
149 };
150
151 partition@100000 {
152 /* 512KB for DTB Image */
153 reg = <0x00100000 0x00080000>;
154 label = "SPI Flash DTB Image";
155 };
156
157 partition@180000 {
158 /* 4MB for Linux Kernel Image */
159 reg = <0x00180000 0x00400000>;
160 label = "SPI Flash Linux Kernel Image";
161 };
162
163 partition@580000 {
164 /* 4MB for Compressed RFS Image */
165 reg = <0x00580000 0x00400000>;
166 label = "SPI Flash Compressed RFSImage";
167 };
168
169 partition@980000 {
170 /* 6.5MB for JFFS2 based RFS */
171 reg = <0x00980000 0x00680000>;
172 label = "SPI Flash JFFS2 RFS";
173 };
174 };
175 };
176
177 usb@22000 {
178 phy_type = "utmi";
179 dr_mode = "host";
180 };
181
182 mdio@24000 {
183 phy0: ethernet-phy@0 {
184 interrupts = <3 1 0 0>;
185 reg = <0x1>;
186 };
187
188 phy1: ethernet-phy@1 {
189 interrupts = <2 1 0 0>;
190 reg = <0x0>;
191 };
192
193 phy2: ethernet-phy@2 {
194 interrupts = <2 1 0 0>;
195 reg = <0x2>;
196 };
197
198 tbi-phy@3 {
199 device-type = "tbi-phy";
200 reg = <0x3>;
201 };
202 };
203
204 mdio@25000 {
205 tbi0: tbi-phy@11 {
206 reg = <0x11>;
207 device_type = "tbi-phy";
208 };
209 };
210
211 mdio@26000 {
212 tbi1: tbi-phy@11 {
213 reg = <0x11>;
214 device_type = "tbi-phy";
215 };
216 };
217
218 enet0: ethernet@b0000 {
219 phy-handle = <&phy0>;
220 phy-connection-type = "rgmii-id";
221 };
222
223 enet1: ethernet@b1000 {
224 phy-handle = <&phy1>;
225 tbi-handle = <&tbi0>;
226 phy-connection-type = "sgmii";
227 };
228
229 enet2: ethernet@b2000 {
230 phy-handle = <&phy2>;
231 tbi-handle = <&tbi1>;
232 phy-connection-type = "sgmii";
233 };
234};
diff --git a/arch/powerpc/boot/dts/p1010rdb_36b.dts b/arch/powerpc/boot/dts/p1010rdb_36b.dts
new file mode 100644
index 000000000000..64776f4a4651
--- /dev/null
+++ b/arch/powerpc/boot/dts/p1010rdb_36b.dts
@@ -0,0 +1,89 @@
1/*
2 * P1010 RDB Device Tree Source (36-bit address map)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/include/ "fsl/p1010si-pre.dtsi"
36
37/ {
38 model = "fsl,P1010RDB";
39 compatible = "fsl,P1010RDB";
40
41 memory {
42 device_type = "memory";
43 };
44
45 board_ifc: ifc: ifc@fffe1e000 {
46 /* NOR, NAND Flashes and CPLD on board */
47 ranges = <0x0 0x0 0xf 0xee000000 0x02000000
48 0x1 0x0 0xf 0xff800000 0x00010000
49 0x3 0x0 0xf 0xffb00000 0x00000020>;
50 reg = <0xf 0xffe1e000 0 0x2000>;
51 };
52
53 board_soc: soc: soc@fffe00000 {
54 ranges = <0x0 0xf 0xffe00000 0x100000>;
55 };
56
57 pci0: pcie@fffe09000 {
58 reg = <0xf 0xffe09000 0 0x1000>;
59 ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000
60 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>;
61 pcie@0 {
62 ranges = <0x2000000 0x0 0xc0000000
63 0x2000000 0x0 0xc0000000
64 0x0 0x20000000
65
66 0x1000000 0x0 0x0
67 0x1000000 0x0 0x0
68 0x0 0x100000>;
69 };
70 };
71
72 pci1: pcie@fffe0a000 {
73 reg = <0xf 0xffe0a000 0 0x1000>;
74 ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000
75 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>;
76 pcie@0 {
77 ranges = <0x2000000 0x0 0xc0000000
78 0x2000000 0x0 0xc0000000
79 0x0 0x20000000
80
81 0x1000000 0x0 0x0
82 0x1000000 0x0 0x0
83 0x0 0x100000>;
84 };
85 };
86};
87
88/include/ "p1010rdb.dtsi"
89/include/ "fsl/p1010si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p1010si.dtsi b/arch/powerpc/boot/dts/p1010si.dtsi
deleted file mode 100644
index cabe0a453ae6..000000000000
--- a/arch/powerpc/boot/dts/p1010si.dtsi
+++ /dev/null
@@ -1,374 +0,0 @@
1/*
2 * P1010si Device Tree Source
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/dts-v1/;
13/ {
14 compatible = "fsl,P1010";
15 #address-cells = <2>;
16 #size-cells = <2>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 PowerPC,P1010@0 {
23 device_type = "cpu";
24 reg = <0x0>;
25 next-level-cache = <&L2>;
26 };
27 };
28
29 ifc@ffe1e000 {
30 #address-cells = <2>;
31 #size-cells = <1>;
32 compatible = "fsl,ifc", "simple-bus";
33 reg = <0x0 0xffe1e000 0 0x2000>;
34 interrupts = <16 2 19 2>;
35 interrupt-parent = <&mpic>;
36 };
37
38 soc@ffe00000 {
39 #address-cells = <1>;
40 #size-cells = <1>;
41 device_type = "soc";
42 compatible = "fsl,p1010-immr", "simple-bus";
43 ranges = <0x0 0x0 0xffe00000 0x100000>;
44 bus-frequency = <0>; // Filled out by uboot.
45
46 ecm-law@0 {
47 compatible = "fsl,ecm-law";
48 reg = <0x0 0x1000>;
49 fsl,num-laws = <12>;
50 };
51
52 ecm@1000 {
53 compatible = "fsl,p1010-ecm", "fsl,ecm";
54 reg = <0x1000 0x1000>;
55 interrupts = <16 2>;
56 interrupt-parent = <&mpic>;
57 };
58
59 memory-controller@2000 {
60 compatible = "fsl,p1010-memory-controller";
61 reg = <0x2000 0x1000>;
62 interrupt-parent = <&mpic>;
63 interrupts = <16 2>;
64 };
65
66 i2c@3000 {
67 #address-cells = <1>;
68 #size-cells = <0>;
69 cell-index = <0>;
70 compatible = "fsl-i2c";
71 reg = <0x3000 0x100>;
72 interrupts = <43 2>;
73 interrupt-parent = <&mpic>;
74 dfsrr;
75 };
76
77 i2c@3100 {
78 #address-cells = <1>;
79 #size-cells = <0>;
80 cell-index = <1>;
81 compatible = "fsl-i2c";
82 reg = <0x3100 0x100>;
83 interrupts = <43 2>;
84 interrupt-parent = <&mpic>;
85 dfsrr;
86 };
87
88 serial0: serial@4500 {
89 cell-index = <0>;
90 device_type = "serial";
91 compatible = "ns16550";
92 reg = <0x4500 0x100>;
93 clock-frequency = <0>;
94 interrupts = <42 2>;
95 interrupt-parent = <&mpic>;
96 };
97
98 serial1: serial@4600 {
99 cell-index = <1>;
100 device_type = "serial";
101 compatible = "ns16550";
102 reg = <0x4600 0x100>;
103 clock-frequency = <0>;
104 interrupts = <42 2>;
105 interrupt-parent = <&mpic>;
106 };
107
108 spi@7000 {
109 #address-cells = <1>;
110 #size-cells = <0>;
111 compatible = "fsl,mpc8536-espi";
112 reg = <0x7000 0x1000>;
113 interrupts = <59 0x2>;
114 interrupt-parent = <&mpic>;
115 fsl,espi-num-chipselects = <1>;
116 };
117
118 gpio: gpio-controller@f000 {
119 #gpio-cells = <2>;
120 compatible = "fsl,mpc8572-gpio";
121 reg = <0xf000 0x100>;
122 interrupts = <47 0x2>;
123 interrupt-parent = <&mpic>;
124 gpio-controller;
125 };
126
127 sata@18000 {
128 compatible = "fsl,pq-sata-v2";
129 reg = <0x18000 0x1000>;
130 cell-index = <1>;
131 interrupts = <74 0x2>;
132 interrupt-parent = <&mpic>;
133 };
134
135 sata@19000 {
136 compatible = "fsl,pq-sata-v2";
137 reg = <0x19000 0x1000>;
138 cell-index = <2>;
139 interrupts = <41 0x2>;
140 interrupt-parent = <&mpic>;
141 };
142
143 can0: can@1c000 {
144 compatible = "fsl,p1010-flexcan";
145 reg = <0x1c000 0x1000>;
146 interrupts = <48 0x2>;
147 interrupt-parent = <&mpic>;
148 };
149
150 can1: can@1d000 {
151 compatible = "fsl,p1010-flexcan";
152 reg = <0x1d000 0x1000>;
153 interrupts = <61 0x2>;
154 interrupt-parent = <&mpic>;
155 };
156
157 L2: l2-cache-controller@20000 {
158 compatible = "fsl,p1010-l2-cache-controller",
159 "fsl,p1014-l2-cache-controller";
160 reg = <0x20000 0x1000>;
161 cache-line-size = <32>; // 32 bytes
162 cache-size = <0x40000>; // L2,256K
163 interrupt-parent = <&mpic>;
164 interrupts = <16 2>;
165 };
166
167 dma@21300 {
168 #address-cells = <1>;
169 #size-cells = <1>;
170 compatible = "fsl,p1010-dma", "fsl,eloplus-dma";
171 reg = <0x21300 0x4>;
172 ranges = <0x0 0x21100 0x200>;
173 cell-index = <0>;
174 dma-channel@0 {
175 compatible = "fsl,p1010-dma-channel", "fsl,eloplus-dma-channel";
176 reg = <0x0 0x80>;
177 cell-index = <0>;
178 interrupt-parent = <&mpic>;
179 interrupts = <20 2>;
180 };
181 dma-channel@80 {
182 compatible = "fsl,p1010-dma-channel", "fsl,eloplus-dma-channel";
183 reg = <0x80 0x80>;
184 cell-index = <1>;
185 interrupt-parent = <&mpic>;
186 interrupts = <21 2>;
187 };
188 dma-channel@100 {
189 compatible = "fsl,p1010-dma-channel", "fsl,eloplus-dma-channel";
190 reg = <0x100 0x80>;
191 cell-index = <2>;
192 interrupt-parent = <&mpic>;
193 interrupts = <22 2>;
194 };
195 dma-channel@180 {
196 compatible = "fsl,p1010-dma-channel", "fsl,eloplus-dma-channel";
197 reg = <0x180 0x80>;
198 cell-index = <3>;
199 interrupt-parent = <&mpic>;
200 interrupts = <23 2>;
201 };
202 };
203
204 usb@22000 {
205 compatible = "fsl-usb2-dr";
206 reg = <0x22000 0x1000>;
207 #address-cells = <1>;
208 #size-cells = <0>;
209 interrupt-parent = <&mpic>;
210 interrupts = <28 0x2>;
211 dr_mode = "host";
212 };
213
214 mdio@24000 {
215 #address-cells = <1>;
216 #size-cells = <0>;
217 compatible = "fsl,etsec2-mdio";
218 reg = <0x24000 0x1000 0xb0030 0x4>;
219 };
220
221 mdio@25000 {
222 #address-cells = <1>;
223 #size-cells = <0>;
224 compatible = "fsl,etsec2-tbi";
225 reg = <0x25000 0x1000 0xb1030 0x4>;
226 tbi0: tbi-phy@11 {
227 reg = <0x11>;
228 device_type = "tbi-phy";
229 };
230 };
231
232 mdio@26000 {
233 #address-cells = <1>;
234 #size-cells = <0>;
235 compatible = "fsl,etsec2-tbi";
236 reg = <0x26000 0x1000 0xb1030 0x4>;
237 tbi1: tbi-phy@11 {
238 reg = <0x11>;
239 device_type = "tbi-phy";
240 };
241 };
242
243 sdhci@2e000 {
244 compatible = "fsl,esdhc";
245 reg = <0x2e000 0x1000>;
246 interrupts = <72 0x8>;
247 interrupt-parent = <&mpic>;
248 /* Filled in by U-Boot */
249 clock-frequency = <0>;
250 fsl,sdhci-auto-cmd12;
251 };
252
253 enet0: ethernet@b0000 {
254 #address-cells = <1>;
255 #size-cells = <1>;
256 device_type = "network";
257 model = "eTSEC";
258 compatible = "fsl,etsec2";
259 fsl,num_rx_queues = <0x8>;
260 fsl,num_tx_queues = <0x8>;
261 local-mac-address = [ 00 00 00 00 00 00 ];
262 interrupt-parent = <&mpic>;
263
264 queue-group@0 {
265 #address-cells = <1>;
266 #size-cells = <1>;
267 reg = <0xb0000 0x1000>;
268 fsl,rx-bit-map = <0xff>;
269 fsl,tx-bit-map = <0xff>;
270 interrupts = <29 2 30 2 34 2>;
271 };
272
273 };
274
275 enet1: ethernet@b1000 {
276 #address-cells = <1>;
277 #size-cells = <1>;
278 device_type = "network";
279 model = "eTSEC";
280 compatible = "fsl,etsec2";
281 fsl,num_rx_queues = <0x8>;
282 fsl,num_tx_queues = <0x8>;
283 local-mac-address = [ 00 00 00 00 00 00 ];
284 interrupt-parent = <&mpic>;
285
286 queue-group@0 {
287 #address-cells = <1>;
288 #size-cells = <1>;
289 reg = <0xb1000 0x1000>;
290 fsl,rx-bit-map = <0xff>;
291 fsl,tx-bit-map = <0xff>;
292 interrupts = <35 2 36 2 40 2>;
293 };
294
295 };
296
297 enet2: ethernet@b2000 {
298 #address-cells = <1>;
299 #size-cells = <1>;
300 device_type = "network";
301 model = "eTSEC";
302 compatible = "fsl,etsec2";
303 fsl,num_rx_queues = <0x8>;
304 fsl,num_tx_queues = <0x8>;
305 local-mac-address = [ 00 00 00 00 00 00 ];
306 interrupt-parent = <&mpic>;
307
308 queue-group@0 {
309 #address-cells = <1>;
310 #size-cells = <1>;
311 reg = <0xb2000 0x1000>;
312 fsl,rx-bit-map = <0xff>;
313 fsl,tx-bit-map = <0xff>;
314 interrupts = <31 2 32 2 33 2>;
315 };
316
317 };
318
319 mpic: pic@40000 {
320 interrupt-controller;
321 #address-cells = <0>;
322 #interrupt-cells = <2>;
323 reg = <0x40000 0x40000>;
324 compatible = "chrp,open-pic";
325 device_type = "open-pic";
326 };
327
328 msi@41600 {
329 compatible = "fsl,p1010-msi", "fsl,mpic-msi";
330 reg = <0x41600 0x80>;
331 msi-available-ranges = <0 0x100>;
332 interrupts = <
333 0xe0 0
334 0xe1 0
335 0xe2 0
336 0xe3 0
337 0xe4 0
338 0xe5 0
339 0xe6 0
340 0xe7 0>;
341 interrupt-parent = <&mpic>;
342 };
343
344 global-utilities@e0000 { //global utilities block
345 compatible = "fsl,p1010-guts";
346 reg = <0xe0000 0x1000>;
347 fsl,has-rstcr;
348 };
349 };
350
351 pci0: pcie@ffe09000 {
352 compatible = "fsl,p1010-pcie", "fsl,qoriq-pcie-v2.3", "fsl,qoriq-pcie-v2.2";
353 device_type = "pci";
354 #size-cells = <2>;
355 #address-cells = <3>;
356 reg = <0 0xffe09000 0 0x1000>;
357 bus-range = <0 255>;
358 clock-frequency = <33333333>;
359 interrupt-parent = <&mpic>;
360 interrupts = <16 2>;
361 };
362
363 pci1: pcie@ffe0a000 {
364 compatible = "fsl,p1010-pcie", "fsl,qoriq-pcie-v2.3", "fsl,qoriq-pcie-v2.2";
365 device_type = "pci";
366 #size-cells = <2>;
367 #address-cells = <3>;
368 reg = <0 0xffe0a000 0 0x1000>;
369 bus-range = <0 255>;
370 clock-frequency = <33333333>;
371 interrupt-parent = <&mpic>;
372 interrupts = <16 2>;
373 };
374};
diff --git a/arch/powerpc/boot/dts/p1020rdb.dts b/arch/powerpc/boot/dts/p1020rdb.dts
index d6a8ae458137..518bf99b1f50 100644
--- a/arch/powerpc/boot/dts/p1020rdb.dts
+++ b/arch/powerpc/boot/dts/p1020rdb.dts
@@ -9,267 +9,33 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/include/ "p1020si.dtsi" 12/include/ "fsl/p1020si-pre.dtsi"
13
14/ { 13/ {
15 model = "fsl,P1020RDB"; 14 model = "fsl,P1020RDB";
16 compatible = "fsl,P1020RDB"; 15 compatible = "fsl,P1020RDB";
17 16
18 aliases {
19 serial0 = &serial0;
20 serial1 = &serial1;
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 ethernet2 = &enet2;
24 pci0 = &pci0;
25 pci1 = &pci1;
26 };
27
28 memory { 17 memory {
29 device_type = "memory"; 18 device_type = "memory";
30 }; 19 };
31 20
32 localbus@ffe05000 { 21 board_lbc: lbc: localbus@ffe05000 {
22 reg = <0 0xffe05000 0 0x1000>;
33 23
34 /* NOR, NAND Flashes and Vitesse 5 port L2 switch */ 24 /* NOR, NAND Flashes and Vitesse 5 port L2 switch */
35 ranges = <0x0 0x0 0x0 0xef000000 0x01000000 25 ranges = <0x0 0x0 0x0 0xef000000 0x01000000
36 0x1 0x0 0x0 0xffa00000 0x00040000 26 0x1 0x0 0x0 0xffa00000 0x00040000
37 0x2 0x0 0x0 0xffb00000 0x00020000>; 27 0x2 0x0 0x0 0xffb00000 0x00020000>;
38
39 nor@0,0 {
40 #address-cells = <1>;
41 #size-cells = <1>;
42 compatible = "cfi-flash";
43 reg = <0x0 0x0 0x1000000>;
44 bank-width = <2>;
45 device-width = <1>;
46
47 partition@0 {
48 /* This location must not be altered */
49 /* 256KB for Vitesse 7385 Switch firmware */
50 reg = <0x0 0x00040000>;
51 label = "NOR (RO) Vitesse-7385 Firmware";
52 read-only;
53 };
54
55 partition@40000 {
56 /* 256KB for DTB Image */
57 reg = <0x00040000 0x00040000>;
58 label = "NOR (RO) DTB Image";
59 read-only;
60 };
61
62 partition@80000 {
63 /* 3.5 MB for Linux Kernel Image */
64 reg = <0x00080000 0x00380000>;
65 label = "NOR (RO) Linux Kernel Image";
66 read-only;
67 };
68
69 partition@400000 {
70 /* 11MB for JFFS2 based Root file System */
71 reg = <0x00400000 0x00b00000>;
72 label = "NOR (RW) JFFS2 Root File System";
73 };
74
75 partition@f00000 {
76 /* This location must not be altered */
77 /* 512KB for u-boot Bootloader Image */
78 /* 512KB for u-boot Environment Variables */
79 reg = <0x00f00000 0x00100000>;
80 label = "NOR (RO) U-Boot Image";
81 read-only;
82 };
83 };
84
85 nand@1,0 {
86 #address-cells = <1>;
87 #size-cells = <1>;
88 compatible = "fsl,p1020-fcm-nand",
89 "fsl,elbc-fcm-nand";
90 reg = <0x1 0x0 0x40000>;
91
92 partition@0 {
93 /* This location must not be altered */
94 /* 1MB for u-boot Bootloader Image */
95 reg = <0x0 0x00100000>;
96 label = "NAND (RO) U-Boot Image";
97 read-only;
98 };
99
100 partition@100000 {
101 /* 1MB for DTB Image */
102 reg = <0x00100000 0x00100000>;
103 label = "NAND (RO) DTB Image";
104 read-only;
105 };
106
107 partition@200000 {
108 /* 4MB for Linux Kernel Image */
109 reg = <0x00200000 0x00400000>;
110 label = "NAND (RO) Linux Kernel Image";
111 read-only;
112 };
113
114 partition@600000 {
115 /* 4MB for Compressed Root file System Image */
116 reg = <0x00600000 0x00400000>;
117 label = "NAND (RO) Compressed RFS Image";
118 read-only;
119 };
120
121 partition@a00000 {
122 /* 7MB for JFFS2 based Root file System */
123 reg = <0x00a00000 0x00700000>;
124 label = "NAND (RW) JFFS2 Root File System";
125 };
126
127 partition@1100000 {
128 /* 15MB for JFFS2 based Root file System */
129 reg = <0x01100000 0x00f00000>;
130 label = "NAND (RW) Writable User area";
131 };
132 };
133
134 L2switch@2,0 {
135 #address-cells = <1>;
136 #size-cells = <1>;
137 compatible = "vitesse-7385";
138 reg = <0x2 0x0 0x20000>;
139 };
140
141 }; 28 };
142 29
143 soc@ffe00000 { 30 board_soc: soc: soc@ffe00000 {
144 i2c@3000 { 31 ranges = <0x0 0x0 0xffe00000 0x100000>;
145 rtc@68 {
146 compatible = "dallas,ds1339";
147 reg = <0x68>;
148 };
149 };
150
151 spi@7000 {
152
153 fsl_m25p80@0 {
154 #address-cells = <1>;
155 #size-cells = <1>;
156 compatible = "fsl,espi-flash";
157 reg = <0>;
158 linux,modalias = "fsl_m25p80";
159 modal = "s25sl128b";
160 spi-max-frequency = <50000000>;
161 mode = <0>;
162
163 partition@0 {
164 /* 512KB for u-boot Bootloader Image */
165 reg = <0x0 0x00080000>;
166 label = "SPI (RO) U-Boot Image";
167 read-only;
168 };
169
170 partition@80000 {
171 /* 512KB for DTB Image */
172 reg = <0x00080000 0x00080000>;
173 label = "SPI (RO) DTB Image";
174 read-only;
175 };
176
177 partition@100000 {
178 /* 4MB for Linux Kernel Image */
179 reg = <0x00100000 0x00400000>;
180 label = "SPI (RO) Linux Kernel Image";
181 read-only;
182 };
183
184 partition@500000 {
185 /* 4MB for Compressed RFS Image */
186 reg = <0x00500000 0x00400000>;
187 label = "SPI (RO) Compressed RFS Image";
188 read-only;
189 };
190
191 partition@900000 {
192 /* 7MB for JFFS2 based RFS */
193 reg = <0x00900000 0x00700000>;
194 label = "SPI (RW) JFFS2 RFS";
195 };
196 };
197 };
198
199 mdio@24000 {
200
201 phy0: ethernet-phy@0 {
202 interrupt-parent = <&mpic>;
203 interrupts = <3 1>;
204 reg = <0x0>;
205 };
206
207 phy1: ethernet-phy@1 {
208 interrupt-parent = <&mpic>;
209 interrupts = <2 1>;
210 reg = <0x1>;
211 };
212 };
213
214 mdio@25000 {
215
216 tbi0: tbi-phy@11 {
217 reg = <0x11>;
218 device_type = "tbi-phy";
219 };
220 };
221
222 enet0: ethernet@b0000 {
223 fixed-link = <1 1 1000 0 0>;
224 phy-connection-type = "rgmii-id";
225
226 };
227
228 enet1: ethernet@b1000 {
229 phy-handle = <&phy0>;
230 tbi-handle = <&tbi0>;
231 phy-connection-type = "sgmii";
232
233 };
234
235 enet2: ethernet@b2000 {
236 phy-handle = <&phy1>;
237 phy-connection-type = "rgmii-id";
238
239 };
240
241 usb@22000 {
242 phy_type = "ulpi";
243 };
244
245 /* USB2 is shared with localbus, so it must be disabled
246 by default. We can't put 'status = "disabled";' here
247 since U-Boot doesn't clear the status property when
248 it enables USB2. OTOH, U-Boot does create a new node
249 when there isn't any. So, just comment it out.
250 usb@23000 {
251 phy_type = "ulpi";
252 };
253 */
254
255 }; 32 };
256 33
257 pci0: pcie@ffe09000 { 34 pci0: pcie@ffe09000 {
258 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 35 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
259 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 36 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
260 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 37 reg = <0 0xffe09000 0 0x1000>;
261 interrupt-map = <
262 /* IDSEL 0x0 */
263 0000 0x0 0x0 0x1 &mpic 0x4 0x1
264 0000 0x0 0x0 0x2 &mpic 0x5 0x1
265 0000 0x0 0x0 0x3 &mpic 0x6 0x1
266 0000 0x0 0x0 0x4 &mpic 0x7 0x1
267 >;
268 pcie@0 { 38 pcie@0 {
269 reg = <0x0 0x0 0x0 0x0 0x0>;
270 #size-cells = <2>;
271 #address-cells = <3>;
272 device_type = "pci";
273 ranges = <0x2000000 0x0 0xa0000000 39 ranges = <0x2000000 0x0 0xa0000000
274 0x2000000 0x0 0xa0000000 40 0x2000000 0x0 0xa0000000
275 0x0 0x20000000 41 0x0 0x20000000
@@ -281,21 +47,10 @@
281 }; 47 };
282 48
283 pci1: pcie@ffe0a000 { 49 pci1: pcie@ffe0a000 {
50 reg = <0 0xffe0a000 0 0x1000>;
284 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 51 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
285 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 52 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
286 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
287 interrupt-map = <
288 /* IDSEL 0x0 */
289 0000 0x0 0x0 0x1 &mpic 0x0 0x1
290 0000 0x0 0x0 0x2 &mpic 0x1 0x1
291 0000 0x0 0x0 0x3 &mpic 0x2 0x1
292 0000 0x0 0x0 0x4 &mpic 0x3 0x1
293 >;
294 pcie@0 { 53 pcie@0 {
295 reg = <0x0 0x0 0x0 0x0 0x0>;
296 #size-cells = <2>;
297 #address-cells = <3>;
298 device_type = "pci";
299 ranges = <0x2000000 0x0 0x80000000 54 ranges = <0x2000000 0x0 0x80000000
300 0x2000000 0x0 0x80000000 55 0x2000000 0x0 0x80000000
301 0x0 0x20000000 56 0x0 0x20000000
@@ -306,3 +61,6 @@
306 }; 61 };
307 }; 62 };
308}; 63};
64
65/include/ "p1020rdb.dtsi"
66/include/ "fsl/p1020si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p1020rdb.dtsi b/arch/powerpc/boot/dts/p1020rdb.dtsi
new file mode 100644
index 000000000000..b5bd86f4baf2
--- /dev/null
+++ b/arch/powerpc/boot/dts/p1020rdb.dtsi
@@ -0,0 +1,247 @@
1/*
2 * P1020 RDB Device Tree Source stub (no addresses or top-level ranges)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&board_lbc {
36 nor@0,0 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 compatible = "cfi-flash";
40 reg = <0x0 0x0 0x1000000>;
41 bank-width = <2>;
42 device-width = <1>;
43
44 partition@0 {
45 /* This location must not be altered */
46 /* 256KB for Vitesse 7385 Switch firmware */
47 reg = <0x0 0x00040000>;
48 label = "NOR (RO) Vitesse-7385 Firmware";
49 read-only;
50 };
51
52 partition@40000 {
53 /* 256KB for DTB Image */
54 reg = <0x00040000 0x00040000>;
55 label = "NOR (RO) DTB Image";
56 read-only;
57 };
58
59 partition@80000 {
60 /* 3.5 MB for Linux Kernel Image */
61 reg = <0x00080000 0x00380000>;
62 label = "NOR (RO) Linux Kernel Image";
63 read-only;
64 };
65
66 partition@400000 {
67 /* 11MB for JFFS2 based Root file System */
68 reg = <0x00400000 0x00b00000>;
69 label = "NOR (RW) JFFS2 Root File System";
70 };
71
72 partition@f00000 {
73 /* This location must not be altered */
74 /* 512KB for u-boot Bootloader Image */
75 /* 512KB for u-boot Environment Variables */
76 reg = <0x00f00000 0x00100000>;
77 label = "NOR (RO) U-Boot Image";
78 read-only;
79 };
80 };
81
82 nand@1,0 {
83 #address-cells = <1>;
84 #size-cells = <1>;
85 compatible = "fsl,p1020-fcm-nand",
86 "fsl,elbc-fcm-nand";
87 reg = <0x1 0x0 0x40000>;
88
89 partition@0 {
90 /* This location must not be altered */
91 /* 1MB for u-boot Bootloader Image */
92 reg = <0x0 0x00100000>;
93 label = "NAND (RO) U-Boot Image";
94 read-only;
95 };
96
97 partition@100000 {
98 /* 1MB for DTB Image */
99 reg = <0x00100000 0x00100000>;
100 label = "NAND (RO) DTB Image";
101 read-only;
102 };
103
104 partition@200000 {
105 /* 4MB for Linux Kernel Image */
106 reg = <0x00200000 0x00400000>;
107 label = "NAND (RO) Linux Kernel Image";
108 read-only;
109 };
110
111 partition@600000 {
112 /* 4MB for Compressed Root file System Image */
113 reg = <0x00600000 0x00400000>;
114 label = "NAND (RO) Compressed RFS Image";
115 read-only;
116 };
117
118 partition@a00000 {
119 /* 7MB for JFFS2 based Root file System */
120 reg = <0x00a00000 0x00700000>;
121 label = "NAND (RW) JFFS2 Root File System";
122 };
123
124 partition@1100000 {
125 /* 15MB for JFFS2 based Root file System */
126 reg = <0x01100000 0x00f00000>;
127 label = "NAND (RW) Writable User area";
128 };
129 };
130
131 L2switch@2,0 {
132 #address-cells = <1>;
133 #size-cells = <1>;
134 compatible = "vitesse-7385";
135 reg = <0x2 0x0 0x20000>;
136 };
137};
138
139&board_soc {
140 i2c@3000 {
141 rtc@68 {
142 compatible = "dallas,ds1339";
143 reg = <0x68>;
144 };
145 };
146
147 spi@7000 {
148 flash@0 {
149 #address-cells = <1>;
150 #size-cells = <1>;
151 compatible = "spansion,s25sl12801";
152 reg = <0>;
153 spi-max-frequency = <40000000>; /* input clock */
154
155 partition@u-boot {
156 /* 512KB for u-boot Bootloader Image */
157 reg = <0x0 0x00080000>;
158 label = "u-boot";
159 read-only;
160 };
161
162 partition@dtb {
163 /* 512KB for DTB Image */
164 reg = <0x00080000 0x00080000>;
165 label = "dtb";
166 read-only;
167 };
168
169 partition@kernel {
170 /* 4MB for Linux Kernel Image */
171 reg = <0x00100000 0x00400000>;
172 label = "kernel";
173 read-only;
174 };
175
176 partition@fs {
177 /* 4MB for Compressed RFS Image */
178 reg = <0x00500000 0x00400000>;
179 label = "file system";
180 read-only;
181 };
182
183 partition@jffs-fs {
184 /* 7MB for JFFS2 based RFS */
185 reg = <0x00900000 0x00700000>;
186 label = "file system jffs2";
187 };
188 };
189 };
190
191 usb@22000 {
192 phy_type = "ulpi";
193 };
194
195 /* USB2 is shared with localbus, so it must be disabled
196 by default. We can't put 'status = "disabled";' here
197 since U-Boot doesn't clear the status property when
198 it enables USB2. OTOH, U-Boot does create a new node
199 when there isn't any. So, just comment it out.
200 usb@23000 {
201 phy_type = "ulpi";
202 };
203 */
204
205 mdio@24000 {
206 phy0: ethernet-phy@0 {
207 interrupt-parent = <&mpic>;
208 interrupts = <3 1>;
209 reg = <0x0>;
210 };
211
212 phy1: ethernet-phy@1 {
213 interrupt-parent = <&mpic>;
214 interrupts = <2 1>;
215 reg = <0x1>;
216 };
217
218 tbi-phy@2 {
219 device_type = "tbi-phy";
220 reg = <0x2>;
221 };
222 };
223
224 mdio@25000 {
225 tbi0: tbi-phy@11 {
226 reg = <0x11>;
227 device_type = "tbi-phy";
228 };
229 };
230
231 enet0: ethernet@b0000 {
232 fixed-link = <1 1 1000 0 0>;
233 phy-connection-type = "rgmii-id";
234
235 };
236
237 enet1: ethernet@b1000 {
238 phy-handle = <&phy0>;
239 tbi-handle = <&tbi0>;
240 phy-connection-type = "sgmii";
241 };
242
243 enet2: ethernet@b2000 {
244 phy-handle = <&phy1>;
245 phy-connection-type = "rgmii-id";
246 };
247};
diff --git a/arch/powerpc/boot/dts/p1020rdb_36b.dts b/arch/powerpc/boot/dts/p1020rdb_36b.dts
new file mode 100644
index 000000000000..bdbdb6097e57
--- /dev/null
+++ b/arch/powerpc/boot/dts/p1020rdb_36b.dts
@@ -0,0 +1,66 @@
1/*
2 * P1020 RDB Device Tree Source (36-bit address map)
3 *
4 * Copyright 2009-2011 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/include/ "fsl/p1020si-pre.dtsi"
13/ {
14 model = "fsl,P1020RDB";
15 compatible = "fsl,P1020RDB";
16
17 memory {
18 device_type = "memory";
19 };
20
21 board_lbc: lbc: localbus@fffe05000 {
22 reg = <0xf 0xffe05000 0 0x1000>;
23
24 /* NOR, NAND Flashes and Vitesse 5 port L2 switch */
25 ranges = <0x0 0x0 0xf 0xef000000 0x01000000
26 0x1 0x0 0xf 0xffa00000 0x00040000
27 0x2 0x0 0xf 0xffb00000 0x00020000>;
28 };
29
30 board_soc: soc: soc@fffe00000 {
31 ranges = <0x0 0xf 0xffe00000 0x100000>;
32 };
33
34 pci0: pcie@fffe09000 {
35 reg = <0xf 0xffe09000 0 0x1000>;
36 ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000
37 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>;
38 pcie@0 {
39 ranges = <0x2000000 0x0 0xc0000000
40 0x2000000 0x0 0xc0000000
41 0x0 0x20000000
42
43 0x1000000 0x0 0x0
44 0x1000000 0x0 0x0
45 0x0 0x100000>;
46 };
47 };
48
49 pci1: pcie@fffe0a000 {
50 reg = <0xf 0xffe0a000 0 0x1000>;
51 ranges = <0x2000000 0x0 0x80000000 0xc 0x00000000 0x0 0x20000000
52 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>;
53 pcie@0 {
54 ranges = <0x2000000 0x0 0x80000000
55 0x2000000 0x0 0x80000000
56 0x0 0x20000000
57
58 0x1000000 0x0 0x0
59 0x1000000 0x0 0x0
60 0x0 0x100000>;
61 };
62 };
63};
64
65/include/ "p1020rdb.dtsi"
66/include/ "fsl/p1020si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p1020rdb_camp_core0.dts b/arch/powerpc/boot/dts/p1020rdb_camp_core0.dts
index f0bf7f42f097..41b4585c5da8 100644
--- a/arch/powerpc/boot/dts/p1020rdb_camp_core0.dts
+++ b/arch/powerpc/boot/dts/p1020rdb_camp_core0.dts
@@ -16,7 +16,7 @@
16 * option) any later version. 16 * option) any later version.
17 */ 17 */
18 18
19/include/ "p1020si.dtsi" 19/include/ "p1020rdb.dts"
20 20
21/ { 21/ {
22 model = "fsl,P1020RDB"; 22 model = "fsl,P1020RDB";
@@ -32,7 +32,7 @@
32 32
33 cpus { 33 cpus {
34 PowerPC,P1020@1 { 34 PowerPC,P1020@1 {
35 status = "disabled"; 35 status = "disabled";
36 }; 36 };
37 }; 37 };
38 38
@@ -45,169 +45,19 @@
45 }; 45 };
46 46
47 soc@ffe00000 { 47 soc@ffe00000 {
48 i2c@3000 {
49 rtc@68 {
50 compatible = "dallas,ds1339";
51 reg = <0x68>;
52 };
53 };
54
55 serial1: serial@4600 { 48 serial1: serial@4600 {
56 status = "disabled"; 49 status = "disabled";
57 }; 50 };
58 51
59 spi@7000 {
60 fsl_m25p80@0 {
61 #address-cells = <1>;
62 #size-cells = <1>;
63 compatible = "fsl,espi-flash";
64 reg = <0>;
65 linux,modalias = "fsl_m25p80";
66 spi-max-frequency = <40000000>;
67
68 partition@0 {
69 /* 512KB for u-boot Bootloader Image */
70 reg = <0x0 0x00080000>;
71 label = "SPI (RO) U-Boot Image";
72 read-only;
73 };
74
75 partition@80000 {
76 /* 512KB for DTB Image */
77 reg = <0x00080000 0x00080000>;
78 label = "SPI (RO) DTB Image";
79 read-only;
80 };
81
82 partition@100000 {
83 /* 4MB for Linux Kernel Image */
84 reg = <0x00100000 0x00400000>;
85 label = "SPI (RO) Linux Kernel Image";
86 read-only;
87 };
88
89 partition@500000 {
90 /* 4MB for Compressed RFS Image */
91 reg = <0x00500000 0x00400000>;
92 label = "SPI (RO) Compressed RFS Image";
93 read-only;
94 };
95
96 partition@900000 {
97 /* 7MB for JFFS2 based RFS */
98 reg = <0x00900000 0x00700000>;
99 label = "SPI (RW) JFFS2 RFS";
100 };
101 };
102 };
103
104 mdio@24000 {
105 phy0: ethernet-phy@0 {
106 interrupt-parent = <&mpic>;
107 interrupts = <3 1>;
108 reg = <0x0>;
109 };
110 phy1: ethernet-phy@1 {
111 interrupt-parent = <&mpic>;
112 interrupts = <2 1>;
113 reg = <0x1>;
114 };
115 };
116
117 mdio@25000 {
118 tbi0: tbi-phy@11 {
119 reg = <0x11>;
120 device_type = "tbi-phy";
121 };
122 };
123
124 enet0: ethernet@b0000 { 52 enet0: ethernet@b0000 {
125 status = "disabled"; 53 status = "disabled";
126 }; 54 };
127 55
128 enet1: ethernet@b1000 {
129 phy-handle = <&phy0>;
130 tbi-handle = <&tbi0>;
131 phy-connection-type = "sgmii";
132 };
133
134 enet2: ethernet@b2000 {
135 phy-handle = <&phy1>;
136 phy-connection-type = "rgmii-id";
137 };
138
139 usb@22000 {
140 phy_type = "ulpi";
141 };
142
143 /* USB2 is shared with localbus, so it must be disabled
144 by default. We can't put 'status = "disabled";' here
145 since U-Boot doesn't clear the status property when
146 it enables USB2. OTOH, U-Boot does create a new node
147 when there isn't any. So, just comment it out.
148 usb@23000 {
149 phy_type = "ulpi";
150 };
151 */
152
153 mpic: pic@40000 { 56 mpic: pic@40000 {
154 protected-sources = < 57 protected-sources = <
155 42 29 30 34 /* serial1, enet0-queue-group0 */ 58 42 29 30 34 /* serial1, enet0-queue-group0 */
156 17 18 24 45 /* enet0-queue-group1, crypto */ 59 17 18 24 45 /* enet0-queue-group1, crypto */
157 >; 60 >;
158 }; 61 };
159
160 };
161
162 pci0: pcie@ffe09000 {
163 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
164 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
165 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
166 interrupt-map = <
167 /* IDSEL 0x0 */
168 0000 0x0 0x0 0x1 &mpic 0x4 0x1
169 0000 0x0 0x0 0x2 &mpic 0x5 0x1
170 0000 0x0 0x0 0x3 &mpic 0x6 0x1
171 0000 0x0 0x0 0x4 &mpic 0x7 0x1
172 >;
173 pcie@0 {
174 reg = <0x0 0x0 0x0 0x0 0x0>;
175 #size-cells = <2>;
176 #address-cells = <3>;
177 device_type = "pci";
178 ranges = <0x2000000 0x0 0xa0000000
179 0x2000000 0x0 0xa0000000
180 0x0 0x20000000
181
182 0x1000000 0x0 0x0
183 0x1000000 0x0 0x0
184 0x0 0x100000>;
185 };
186 };
187
188 pci1: pcie@ffe0a000 {
189 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
190 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
191 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
192 interrupt-map = <
193 /* IDSEL 0x0 */
194 0000 0x0 0x0 0x1 &mpic 0x0 0x1
195 0000 0x0 0x0 0x2 &mpic 0x1 0x1
196 0000 0x0 0x0 0x3 &mpic 0x2 0x1
197 0000 0x0 0x0 0x4 &mpic 0x3 0x1
198 >;
199 pcie@0 {
200 reg = <0x0 0x0 0x0 0x0 0x0>;
201 #size-cells = <2>;
202 #address-cells = <3>;
203 device_type = "pci";
204 ranges = <0x2000000 0x0 0x80000000
205 0x2000000 0x0 0x80000000
206 0x0 0x20000000
207
208 0x1000000 0x0 0x0
209 0x1000000 0x0 0x0
210 0x0 0x100000>;
211 };
212 }; 62 };
213}; 63};
diff --git a/arch/powerpc/boot/dts/p1020rdb_camp_core1.dts b/arch/powerpc/boot/dts/p1020rdb_camp_core1.dts
index 6ec02204a44e..517453821884 100644
--- a/arch/powerpc/boot/dts/p1020rdb_camp_core1.dts
+++ b/arch/powerpc/boot/dts/p1020rdb_camp_core1.dts
@@ -15,7 +15,7 @@
15 * option) any later version. 15 * option) any later version.
16 */ 16 */
17 17
18/include/ "p1020si.dtsi" 18/include/ "p1020rdb.dts"
19 19
20/ { 20/ {
21 model = "fsl,P1020RDB"; 21 model = "fsl,P1020RDB";
@@ -28,7 +28,7 @@
28 28
29 cpus { 29 cpus {
30 PowerPC,P1020@0 { 30 PowerPC,P1020@0 {
31 status = "disabled"; 31 status = "disabled";
32 }; 32 };
33 }; 33 };
34 34
@@ -85,12 +85,6 @@
85 status = "disabled"; 85 status = "disabled";
86 }; 86 };
87 87
88 enet0: ethernet@b0000 {
89 fixed-link = <1 1 1000 0 0>;
90 phy-connection-type = "rgmii-id";
91
92 };
93
94 enet1: ethernet@b1000 { 88 enet1: ethernet@b1000 {
95 status = "disabled"; 89 status = "disabled";
96 }; 90 };
@@ -135,7 +129,6 @@
135 global-utilities@e0000 { //global utilities block 129 global-utilities@e0000 { //global utilities block
136 status = "disabled"; 130 status = "disabled";
137 }; 131 };
138
139 }; 132 };
140 133
141 pci0: pcie@ffe09000 { 134 pci0: pcie@ffe09000 {
diff --git a/arch/powerpc/boot/dts/p1020si.dtsi b/arch/powerpc/boot/dts/p1020si.dtsi
deleted file mode 100644
index 5c5acb66c3fc..000000000000
--- a/arch/powerpc/boot/dts/p1020si.dtsi
+++ /dev/null
@@ -1,377 +0,0 @@
1/*
2 * P1020si Device Tree Source
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/dts-v1/;
13/ {
14 compatible = "fsl,P1020";
15 #address-cells = <2>;
16 #size-cells = <2>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 PowerPC,P1020@0 {
23 device_type = "cpu";
24 reg = <0x0>;
25 next-level-cache = <&L2>;
26 };
27
28 PowerPC,P1020@1 {
29 device_type = "cpu";
30 reg = <0x1>;
31 next-level-cache = <&L2>;
32 };
33 };
34
35 localbus@ffe05000 {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,p1020-elbc", "fsl,elbc", "simple-bus";
39 reg = <0 0xffe05000 0 0x1000>;
40 interrupts = <19 2>;
41 interrupt-parent = <&mpic>;
42 };
43
44 soc@ffe00000 {
45 #address-cells = <1>;
46 #size-cells = <1>;
47 device_type = "soc";
48 compatible = "fsl,p1020-immr", "simple-bus";
49 ranges = <0x0 0x0 0xffe00000 0x100000>;
50 bus-frequency = <0>; // Filled out by uboot.
51
52 ecm-law@0 {
53 compatible = "fsl,ecm-law";
54 reg = <0x0 0x1000>;
55 fsl,num-laws = <12>;
56 };
57
58 ecm@1000 {
59 compatible = "fsl,p1020-ecm", "fsl,ecm";
60 reg = <0x1000 0x1000>;
61 interrupts = <16 2>;
62 interrupt-parent = <&mpic>;
63 };
64
65 memory-controller@2000 {
66 compatible = "fsl,p1020-memory-controller";
67 reg = <0x2000 0x1000>;
68 interrupt-parent = <&mpic>;
69 interrupts = <16 2>;
70 };
71
72 i2c@3000 {
73 #address-cells = <1>;
74 #size-cells = <0>;
75 cell-index = <0>;
76 compatible = "fsl-i2c";
77 reg = <0x3000 0x100>;
78 interrupts = <43 2>;
79 interrupt-parent = <&mpic>;
80 dfsrr;
81 };
82
83 i2c@3100 {
84 #address-cells = <1>;
85 #size-cells = <0>;
86 cell-index = <1>;
87 compatible = "fsl-i2c";
88 reg = <0x3100 0x100>;
89 interrupts = <43 2>;
90 interrupt-parent = <&mpic>;
91 dfsrr;
92 };
93
94 serial0: serial@4500 {
95 cell-index = <0>;
96 device_type = "serial";
97 compatible = "ns16550";
98 reg = <0x4500 0x100>;
99 clock-frequency = <0>;
100 interrupts = <42 2>;
101 interrupt-parent = <&mpic>;
102 };
103
104 serial1: serial@4600 {
105 cell-index = <1>;
106 device_type = "serial";
107 compatible = "ns16550";
108 reg = <0x4600 0x100>;
109 clock-frequency = <0>;
110 interrupts = <42 2>;
111 interrupt-parent = <&mpic>;
112 };
113
114 spi@7000 {
115 cell-index = <0>;
116 #address-cells = <1>;
117 #size-cells = <0>;
118 compatible = "fsl,espi";
119 reg = <0x7000 0x1000>;
120 interrupts = <59 0x2>;
121 interrupt-parent = <&mpic>;
122 mode = "cpu";
123 };
124
125 gpio: gpio-controller@f000 {
126 #gpio-cells = <2>;
127 compatible = "fsl,mpc8572-gpio";
128 reg = <0xf000 0x100>;
129 interrupts = <47 0x2>;
130 interrupt-parent = <&mpic>;
131 gpio-controller;
132 };
133
134 L2: l2-cache-controller@20000 {
135 compatible = "fsl,p1020-l2-cache-controller";
136 reg = <0x20000 0x1000>;
137 cache-line-size = <32>; // 32 bytes
138 cache-size = <0x40000>; // L2,256K
139 interrupt-parent = <&mpic>;
140 interrupts = <16 2>;
141 };
142
143 dma@21300 {
144 #address-cells = <1>;
145 #size-cells = <1>;
146 compatible = "fsl,eloplus-dma";
147 reg = <0x21300 0x4>;
148 ranges = <0x0 0x21100 0x200>;
149 cell-index = <0>;
150 dma-channel@0 {
151 compatible = "fsl,eloplus-dma-channel";
152 reg = <0x0 0x80>;
153 cell-index = <0>;
154 interrupt-parent = <&mpic>;
155 interrupts = <20 2>;
156 };
157 dma-channel@80 {
158 compatible = "fsl,eloplus-dma-channel";
159 reg = <0x80 0x80>;
160 cell-index = <1>;
161 interrupt-parent = <&mpic>;
162 interrupts = <21 2>;
163 };
164 dma-channel@100 {
165 compatible = "fsl,eloplus-dma-channel";
166 reg = <0x100 0x80>;
167 cell-index = <2>;
168 interrupt-parent = <&mpic>;
169 interrupts = <22 2>;
170 };
171 dma-channel@180 {
172 compatible = "fsl,eloplus-dma-channel";
173 reg = <0x180 0x80>;
174 cell-index = <3>;
175 interrupt-parent = <&mpic>;
176 interrupts = <23 2>;
177 };
178 };
179
180 mdio@24000 {
181 #address-cells = <1>;
182 #size-cells = <0>;
183 compatible = "fsl,etsec2-mdio";
184 reg = <0x24000 0x1000 0xb0030 0x4>;
185
186 };
187
188 mdio@25000 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 compatible = "fsl,etsec2-tbi";
192 reg = <0x25000 0x1000 0xb1030 0x4>;
193
194 };
195
196 enet0: ethernet@b0000 {
197 #address-cells = <1>;
198 #size-cells = <1>;
199 device_type = "network";
200 model = "eTSEC";
201 compatible = "fsl,etsec2";
202 fsl,num_rx_queues = <0x8>;
203 fsl,num_tx_queues = <0x8>;
204 local-mac-address = [ 00 00 00 00 00 00 ];
205 interrupt-parent = <&mpic>;
206
207 queue-group@0 {
208 #address-cells = <1>;
209 #size-cells = <1>;
210 reg = <0xb0000 0x1000>;
211 interrupts = <29 2 30 2 34 2>;
212 };
213
214 queue-group@1 {
215 #address-cells = <1>;
216 #size-cells = <1>;
217 reg = <0xb4000 0x1000>;
218 interrupts = <17 2 18 2 24 2>;
219 };
220 };
221
222 enet1: ethernet@b1000 {
223 #address-cells = <1>;
224 #size-cells = <1>;
225 device_type = "network";
226 model = "eTSEC";
227 compatible = "fsl,etsec2";
228 fsl,num_rx_queues = <0x8>;
229 fsl,num_tx_queues = <0x8>;
230 local-mac-address = [ 00 00 00 00 00 00 ];
231 interrupt-parent = <&mpic>;
232
233 queue-group@0 {
234 #address-cells = <1>;
235 #size-cells = <1>;
236 reg = <0xb1000 0x1000>;
237 interrupts = <35 2 36 2 40 2>;
238 };
239
240 queue-group@1 {
241 #address-cells = <1>;
242 #size-cells = <1>;
243 reg = <0xb5000 0x1000>;
244 interrupts = <51 2 52 2 67 2>;
245 };
246 };
247
248 enet2: ethernet@b2000 {
249 #address-cells = <1>;
250 #size-cells = <1>;
251 device_type = "network";
252 model = "eTSEC";
253 compatible = "fsl,etsec2";
254 fsl,num_rx_queues = <0x8>;
255 fsl,num_tx_queues = <0x8>;
256 local-mac-address = [ 00 00 00 00 00 00 ];
257 interrupt-parent = <&mpic>;
258
259 queue-group@0 {
260 #address-cells = <1>;
261 #size-cells = <1>;
262 reg = <0xb2000 0x1000>;
263 interrupts = <31 2 32 2 33 2>;
264 };
265
266 queue-group@1 {
267 #address-cells = <1>;
268 #size-cells = <1>;
269 reg = <0xb6000 0x1000>;
270 interrupts = <25 2 26 2 27 2>;
271 };
272 };
273
274 usb@22000 {
275 #address-cells = <1>;
276 #size-cells = <0>;
277 compatible = "fsl-usb2-dr";
278 reg = <0x22000 0x1000>;
279 interrupt-parent = <&mpic>;
280 interrupts = <28 0x2>;
281 };
282
283 /* USB2 is shared with localbus, so it must be disabled
284 by default. We can't put 'status = "disabled";' here
285 since U-Boot doesn't clear the status property when
286 it enables USB2. OTOH, U-Boot does create a new node
287 when there isn't any. So, just comment it out.
288 usb@23000 {
289 #address-cells = <1>;
290 #size-cells = <0>;
291 compatible = "fsl-usb2-dr";
292 reg = <0x23000 0x1000>;
293 interrupt-parent = <&mpic>;
294 interrupts = <46 0x2>;
295 phy_type = "ulpi";
296 };
297 */
298
299 sdhci@2e000 {
300 compatible = "fsl,p1020-esdhc", "fsl,esdhc";
301 reg = <0x2e000 0x1000>;
302 interrupts = <72 0x2>;
303 interrupt-parent = <&mpic>;
304 /* Filled in by U-Boot */
305 clock-frequency = <0>;
306 };
307
308 crypto@30000 {
309 compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
310 "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
311 reg = <0x30000 0x10000>;
312 interrupts = <45 2 58 2>;
313 interrupt-parent = <&mpic>;
314 fsl,num-channels = <4>;
315 fsl,channel-fifo-len = <24>;
316 fsl,exec-units-mask = <0xbfe>;
317 fsl,descriptor-types-mask = <0x3ab0ebf>;
318 };
319
320 mpic: pic@40000 {
321 interrupt-controller;
322 #address-cells = <0>;
323 #interrupt-cells = <2>;
324 reg = <0x40000 0x40000>;
325 compatible = "chrp,open-pic";
326 device_type = "open-pic";
327 };
328
329 msi@41600 {
330 compatible = "fsl,p1020-msi", "fsl,mpic-msi";
331 reg = <0x41600 0x80>;
332 msi-available-ranges = <0 0x100>;
333 interrupts = <
334 0xe0 0
335 0xe1 0
336 0xe2 0
337 0xe3 0
338 0xe4 0
339 0xe5 0
340 0xe6 0
341 0xe7 0>;
342 interrupt-parent = <&mpic>;
343 };
344
345 global-utilities@e0000 { //global utilities block
346 compatible = "fsl,p1020-guts","fsl,p2020-guts";
347 reg = <0xe0000 0x1000>;
348 fsl,has-rstcr;
349 };
350 };
351
352 pci0: pcie@ffe09000 {
353 compatible = "fsl,mpc8548-pcie";
354 device_type = "pci";
355 #interrupt-cells = <1>;
356 #size-cells = <2>;
357 #address-cells = <3>;
358 reg = <0 0xffe09000 0 0x1000>;
359 bus-range = <0 255>;
360 clock-frequency = <33333333>;
361 interrupt-parent = <&mpic>;
362 interrupts = <16 2>;
363 };
364
365 pci1: pcie@ffe0a000 {
366 compatible = "fsl,mpc8548-pcie";
367 device_type = "pci";
368 #interrupt-cells = <1>;
369 #size-cells = <2>;
370 #address-cells = <3>;
371 reg = <0 0xffe0a000 0 0x1000>;
372 bus-range = <0 255>;
373 clock-frequency = <33333333>;
374 interrupt-parent = <&mpic>;
375 interrupts = <16 2>;
376 };
377};
diff --git a/arch/powerpc/boot/dts/p1021mds.dts b/arch/powerpc/boot/dts/p1021mds.dts
index ad5b85269004..d9540791e434 100644
--- a/arch/powerpc/boot/dts/p1021mds.dts
+++ b/arch/powerpc/boot/dts/p1021mds.dts
@@ -9,53 +9,22 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/dts-v1/; 12/include/ "fsl/p1021si-pre.dtsi"
13/ { 13/ {
14 model = "fsl,P1021"; 14 model = "fsl,P1021";
15 compatible = "fsl,P1021MDS"; 15 compatible = "fsl,P1021MDS";
16 #address-cells = <2>;
17 #size-cells = <2>;
18 16
19 aliases { 17 aliases {
20 serial0 = &serial0;
21 serial1 = &serial1;
22 ethernet0 = &enet0;
23 ethernet1 = &enet1;
24 ethernet2 = &enet2;
25 ethernet3 = &enet3; 18 ethernet3 = &enet3;
26 ethernet4 = &enet4; 19 ethernet4 = &enet4;
27 pci0 = &pci0;
28 pci1 = &pci1;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 PowerPC,P1021@0 {
36 device_type = "cpu";
37 reg = <0x0>;
38 next-level-cache = <&L2>;
39 };
40
41 PowerPC,P1021@1 {
42 device_type = "cpu";
43 reg = <0x1>;
44 next-level-cache = <&L2>;
45 };
46 }; 20 };
47 21
48 memory { 22 memory {
49 device_type = "memory"; 23 device_type = "memory";
50 }; 24 };
51 25
52 localbus@ffe05000 { 26 lbc: localbus@ffe05000 {
53 #address-cells = <2>; 27 reg = <0x0 0xffe05000 0x0 0x1000>;
54 #size-cells = <1>;
55 compatible = "fsl,p1021-elbc", "fsl,elbc", "simple-bus";
56 reg = <0 0xffe05000 0 0x1000>;
57 interrupts = <19 2>;
58 interrupt-parent = <&mpic>;
59 28
60 /* NAND Flash, BCSR, PMC0/1*/ 29 /* NAND Flash, BCSR, PMC0/1*/
61 ranges = <0x0 0x0 0x0 0xfc000000 0x02000000 30 ranges = <0x0 0x0 0x0 0xfc000000 0x02000000
@@ -138,99 +107,26 @@
138 }; 107 };
139 }; 108 };
140 109
141 soc@ffe00000 { 110 soc: soc@ffe00000 {
142
143 #address-cells = <1>;
144 #size-cells = <1>;
145 device_type = "soc";
146 compatible = "fsl,p1021-immr", "simple-bus"; 111 compatible = "fsl,p1021-immr", "simple-bus";
147 ranges = <0x0 0x0 0xffe00000 0x100000>; 112 ranges = <0x0 0x0 0xffe00000 0x100000>;
148 bus-frequency = <0>; // Filled out by uboot.
149
150 ecm-law@0 {
151 compatible = "fsl,ecm-law";
152 reg = <0x0 0x1000>;
153 fsl,num-laws = <12>;
154 };
155
156 ecm@1000 {
157 compatible = "fsl,p1021-ecm", "fsl,ecm";
158 reg = <0x1000 0x1000>;
159 interrupts = <16 2>;
160 interrupt-parent = <&mpic>;
161 };
162
163 memory-controller@2000 {
164 compatible = "fsl,p1021-memory-controller";
165 reg = <0x2000 0x1000>;
166 interrupt-parent = <&mpic>;
167 interrupts = <16 2>;
168 };
169 113
170 i2c@3000 { 114 i2c@3000 {
171 #address-cells = <1>;
172 #size-cells = <0>;
173 cell-index = <0>;
174 compatible = "fsl-i2c";
175 reg = <0x3000 0x100>;
176 interrupts = <43 2>;
177 interrupt-parent = <&mpic>;
178 dfsrr;
179 rtc@68 { 115 rtc@68 {
180 compatible = "dallas,ds1374"; 116 compatible = "dallas,ds1374";
181 reg = <0x68>; 117 reg = <0x68>;
182 }; 118 };
183 }; 119 };
184 120
185 i2c@3100 {
186 #address-cells = <1>;
187 #size-cells = <0>;
188 cell-index = <1>;
189 compatible = "fsl-i2c";
190 reg = <0x3100 0x100>;
191 interrupts = <43 2>;
192 interrupt-parent = <&mpic>;
193 dfsrr;
194 };
195
196 serial0: serial@4500 {
197 cell-index = <0>;
198 device_type = "serial";
199 compatible = "ns16550";
200 reg = <0x4500 0x100>;
201 clock-frequency = <0>;
202 interrupts = <42 2>;
203 interrupt-parent = <&mpic>;
204 };
205
206 serial1: serial@4600 {
207 cell-index = <1>;
208 device_type = "serial";
209 compatible = "ns16550";
210 reg = <0x4600 0x100>;
211 clock-frequency = <0>;
212 interrupts = <42 2>;
213 interrupt-parent = <&mpic>;
214 };
215
216 spi@7000 { 121 spi@7000 {
217 cell-index = <0>; 122
218 #address-cells = <1>; 123 flash@0 {
219 #size-cells = <0>;
220 compatible = "fsl,espi";
221 reg = <0x7000 0x1000>;
222 interrupts = <59 0x2>;
223 interrupt-parent = <&mpic>;
224 espi,num-ss-bits = <4>;
225 mode = "cpu";
226
227 fsl_m25p80@0 {
228 #address-cells = <1>; 124 #address-cells = <1>;
229 #size-cells = <1>; 125 #size-cells = <1>;
230 compatible = "fsl,espi-flash"; 126 compatible = "spansion,s25sl12801";
231 reg = <0>; 127 reg = <0>;
232 linux,modalias = "fsl_m25p80";
233 spi-max-frequency = <40000000>; /* input clock */ 128 spi-max-frequency = <40000000>; /* input clock */
129
234 partition@u-boot { 130 partition@u-boot {
235 label = "u-boot-spi"; 131 label = "u-boot-spi";
236 reg = <0x00000000 0x00100000>; 132 reg = <0x00000000 0x00100000>;
@@ -253,237 +149,49 @@
253 }; 149 };
254 }; 150 };
255 151
256 gpio: gpio-controller@f000 {
257 #gpio-cells = <2>;
258 compatible = "fsl,mpc8572-gpio";
259 reg = <0xf000 0x100>;
260 interrupts = <47 0x2>;
261 interrupt-parent = <&mpic>;
262 gpio-controller;
263 };
264
265 L2: l2-cache-controller@20000 {
266 compatible = "fsl,p1021-l2-cache-controller";
267 reg = <0x20000 0x1000>;
268 cache-line-size = <32>; // 32 bytes
269 cache-size = <0x40000>; // L2,256K
270 interrupt-parent = <&mpic>;
271 interrupts = <16 2>;
272 };
273
274 dma@21300 {
275 #address-cells = <1>;
276 #size-cells = <1>;
277 compatible = "fsl,eloplus-dma";
278 reg = <0x21300 0x4>;
279 ranges = <0x0 0x21100 0x200>;
280 cell-index = <0>;
281 dma-channel@0 {
282 compatible = "fsl,eloplus-dma-channel";
283 reg = <0x0 0x80>;
284 cell-index = <0>;
285 interrupt-parent = <&mpic>;
286 interrupts = <20 2>;
287 };
288 dma-channel@80 {
289 compatible = "fsl,eloplus-dma-channel";
290 reg = <0x80 0x80>;
291 cell-index = <1>;
292 interrupt-parent = <&mpic>;
293 interrupts = <21 2>;
294 };
295 dma-channel@100 {
296 compatible = "fsl,eloplus-dma-channel";
297 reg = <0x100 0x80>;
298 cell-index = <2>;
299 interrupt-parent = <&mpic>;
300 interrupts = <22 2>;
301 };
302 dma-channel@180 {
303 compatible = "fsl,eloplus-dma-channel";
304 reg = <0x180 0x80>;
305 cell-index = <3>;
306 interrupt-parent = <&mpic>;
307 interrupts = <23 2>;
308 };
309 };
310
311 usb@22000 { 152 usb@22000 {
312 #address-cells = <1>;
313 #size-cells = <0>;
314 compatible = "fsl-usb2-dr";
315 reg = <0x22000 0x1000>;
316 interrupt-parent = <&mpic>;
317 interrupts = <28 0x2>;
318 phy_type = "ulpi"; 153 phy_type = "ulpi";
319 }; 154 };
320 155
321 mdio@24000 { 156 mdio@24000 {
322 #address-cells = <1>;
323 #size-cells = <0>;
324 compatible = "fsl,etsec2-mdio";
325 reg = <0x24000 0x1000 0xb0030 0x4>;
326
327 phy0: ethernet-phy@0 { 157 phy0: ethernet-phy@0 {
328 interrupt-parent = <&mpic>; 158 interrupts = <1 1 0 0>;
329 interrupts = <1 1>;
330 reg = <0x0>; 159 reg = <0x0>;
331 }; 160 };
332 phy1: ethernet-phy@1 { 161 phy1: ethernet-phy@1 {
333 interrupt-parent = <&mpic>; 162 interrupts = <2 1 0 0>;
334 interrupts = <2 1>;
335 reg = <0x1>; 163 reg = <0x1>;
336 }; 164 };
337 phy4: ethernet-phy@4 { 165 phy4: ethernet-phy@4 {
338 interrupt-parent = <&mpic>;
339 reg = <0x4>; 166 reg = <0x4>;
340 }; 167 };
168 tbi-phy@5 {
169 device_type = "tbi-phy";
170 reg = <0x5>;
171 };
341 }; 172 };
342 173
343 mdio@25000 { 174 mdio@25000 {
344 #address-cells = <1>;
345 #size-cells = <0>;
346 compatible = "fsl,etsec2-tbi";
347 reg = <0x25000 0x1000 0xb1030 0x4>;
348 tbi0: tbi-phy@11 { 175 tbi0: tbi-phy@11 {
349 reg = <0x11>; 176 reg = <0x11>;
350 device_type = "tbi-phy"; 177 device_type = "tbi-phy";
351 }; 178 };
352 }; 179 };
353 180
354 enet0: ethernet@B0000 { 181 ethernet@b0000 {
355 #address-cells = <1>;
356 #size-cells = <1>;
357 cell-index = <0>;
358 device_type = "network";
359 model = "eTSEC";
360 compatible = "fsl,etsec2";
361 fsl,num_rx_queues = <0x8>;
362 fsl,num_tx_queues = <0x8>;
363 local-mac-address = [ 00 00 00 00 00 00 ];
364 interrupt-parent = <&mpic>;
365 phy-handle = <&phy0>; 182 phy-handle = <&phy0>;
366 phy-connection-type = "rgmii-id"; 183 phy-connection-type = "rgmii-id";
367 queue-group@0{
368 #address-cells = <1>;
369 #size-cells = <1>;
370 reg = <0xB0000 0x1000>;
371 interrupts = <29 2 30 2 34 2>;
372 };
373 queue-group@1{
374 #address-cells = <1>;
375 #size-cells = <1>;
376 reg = <0xB4000 0x1000>;
377 interrupts = <17 2 18 2 24 2>;
378 };
379 }; 184 };
380 185
381 enet1: ethernet@B1000 { 186 ethernet@b1000 {
382 #address-cells = <1>;
383 #size-cells = <1>;
384 cell-index = <0>;
385 device_type = "network";
386 model = "eTSEC";
387 compatible = "fsl,etsec2";
388 fsl,num_rx_queues = <0x8>;
389 fsl,num_tx_queues = <0x8>;
390 local-mac-address = [ 00 00 00 00 00 00 ];
391 interrupt-parent = <&mpic>;
392 phy-handle = <&phy4>; 187 phy-handle = <&phy4>;
393 tbi-handle = <&tbi0>; 188 tbi-handle = <&tbi0>;
394 phy-connection-type = "sgmii"; 189 phy-connection-type = "sgmii";
395 queue-group@0{
396 #address-cells = <1>;
397 #size-cells = <1>;
398 reg = <0xB1000 0x1000>;
399 interrupts = <35 2 36 2 40 2>;
400 };
401 queue-group@1{
402 #address-cells = <1>;
403 #size-cells = <1>;
404 reg = <0xB5000 0x1000>;
405 interrupts = <51 2 52 2 67 2>;
406 };
407 }; 190 };
408 191
409 enet2: ethernet@B2000 { 192 ethernet@b2000 {
410 #address-cells = <1>;
411 #size-cells = <1>;
412 cell-index = <0>;
413 device_type = "network";
414 model = "eTSEC";
415 compatible = "fsl,etsec2";
416 fsl,num_rx_queues = <0x8>;
417 fsl,num_tx_queues = <0x8>;
418 local-mac-address = [ 00 00 00 00 00 00 ];
419 interrupt-parent = <&mpic>;
420 phy-handle = <&phy1>; 193 phy-handle = <&phy1>;
421 phy-connection-type = "rgmii-id"; 194 phy-connection-type = "rgmii-id";
422 queue-group@0{
423 #address-cells = <1>;
424 #size-cells = <1>;
425 reg = <0xB2000 0x1000>;
426 interrupts = <31 2 32 2 33 2>;
427 };
428 queue-group@1{
429 #address-cells = <1>;
430 #size-cells = <1>;
431 reg = <0xB6000 0x1000>;
432 interrupts = <25 2 26 2 27 2>;
433 };
434 };
435
436 sdhci@2e000 {
437 compatible = "fsl,p1021-esdhc", "fsl,esdhc";
438 reg = <0x2e000 0x1000>;
439 interrupts = <72 0x2>;
440 interrupt-parent = <&mpic>;
441 /* Filled in by U-Boot */
442 clock-frequency = <0>;
443 };
444
445 crypto@30000 {
446 compatible = "fsl,sec3.3", "fsl,sec3.1",
447 "fsl,sec3.0", "fsl,sec2.4",
448 "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
449 reg = <0x30000 0x10000>;
450 interrupts = <45 2 58 2>;
451 interrupt-parent = <&mpic>;
452 fsl,num-channels = <4>;
453 fsl,channel-fifo-len = <24>;
454 fsl,exec-units-mask = <0x97c>;
455 fsl,descriptor-types-mask = <0x3a30abf>;
456 };
457
458 mpic: pic@40000 {
459 interrupt-controller;
460 #address-cells = <0>;
461 #interrupt-cells = <2>;
462 reg = <0x40000 0x40000>;
463 compatible = "chrp,open-pic";
464 device_type = "open-pic";
465 };
466
467 msi@41600 {
468 compatible = "fsl,p1021-msi", "fsl,mpic-msi";
469 reg = <0x41600 0x80>;
470 msi-available-ranges = <0 0x100>;
471 interrupts = <
472 0xe0 0
473 0xe1 0
474 0xe2 0
475 0xe3 0
476 0xe4 0
477 0xe5 0
478 0xe6 0
479 0xe7 0>;
480 interrupt-parent = <&mpic>;
481 };
482
483 global-utilities@e0000 { //global utilities block
484 compatible = "fsl,p1021-guts";
485 reg = <0xe0000 0x1000>;
486 fsl,has-rstcr;
487 }; 195 };
488 196
489 par_io@e0100 { 197 par_io@e0100 {
@@ -499,8 +207,7 @@
499 0x1 0x13 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */ 207 0x1 0x13 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */
500 0x1 0x14 0x3 0x0 0x1 0x0 /* QE_MUX_MDIO */ 208 0x1 0x14 0x3 0x0 0x1 0x0 /* QE_MUX_MDIO */
501 0x0 0x17 0x2 0x0 0x2 0x0 /* CLK12 */ 209 0x0 0x17 0x2 0x0 0x2 0x0 /* CLK12 */
502 0x0 0x18 0x2 0x0 0x1 0x0 /* CLK9 210 0x0 0x18 0x2 0x0 0x1 0x0 /* CLK9 */
503*/
504 0x0 0x7 0x1 0x0 0x2 0x0 /* ENET1_TXD0_SER1_TXD0 */ 211 0x0 0x7 0x1 0x0 0x2 0x0 /* ENET1_TXD0_SER1_TXD0 */
505 0x0 0x9 0x1 0x0 0x2 0x0 /* ENET1_TXD1_SER1_TXD1 */ 212 0x0 0x9 0x1 0x0 0x2 0x0 /* ENET1_TXD1_SER1_TXD1 */
506 0x0 0xb 0x1 0x0 0x2 0x0 /* ENET1_TXD2_SER1_TXD2 */ 213 0x0 0xb 0x1 0x0 0x2 0x0 /* ENET1_TXD2_SER1_TXD2 */
@@ -535,31 +242,10 @@
535 }; 242 };
536 243
537 pci0: pcie@ffe09000 { 244 pci0: pcie@ffe09000 {
538 compatible = "fsl,mpc8548-pcie";
539 device_type = "pci";
540 #interrupt-cells = <1>;
541 #size-cells = <2>;
542 #address-cells = <3>;
543 reg = <0 0xffe09000 0 0x1000>; 245 reg = <0 0xffe09000 0 0x1000>;
544 bus-range = <0 255>;
545 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 246 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
546 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 247 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
547 clock-frequency = <33333333>;
548 interrupt-parent = <&mpic>;
549 interrupts = <16 2>;
550 interrupt-map-mask = <0xf800 0 0 7>;
551 interrupt-map = <
552 /* IDSEL 0x0 */
553 0000 0 0 1 &mpic 4 1
554 0000 0 0 2 &mpic 5 1
555 0000 0 0 3 &mpic 6 1
556 0000 0 0 4 &mpic 7 1
557 >;
558 pcie@0 { 248 pcie@0 {
559 reg = <0x0 0x0 0x0 0x0 0x0>;
560 #size-cells = <2>;
561 #address-cells = <3>;
562 device_type = "pci";
563 ranges = <0x2000000 0x0 0xa0000000 249 ranges = <0x2000000 0x0 0xa0000000
564 0x2000000 0x0 0xa0000000 250 0x2000000 0x0 0xa0000000
565 0x0 0x20000000 251 0x0 0x20000000
@@ -571,31 +257,10 @@
571 }; 257 };
572 258
573 pci1: pcie@ffe0a000 { 259 pci1: pcie@ffe0a000 {
574 compatible = "fsl,mpc8548-pcie";
575 device_type = "pci";
576 #interrupt-cells = <1>;
577 #size-cells = <2>;
578 #address-cells = <3>;
579 reg = <0 0xffe0a000 0 0x1000>; 260 reg = <0 0xffe0a000 0 0x1000>;
580 bus-range = <0 255>;
581 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 261 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
582 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; 262 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
583 clock-frequency = <33333333>;
584 interrupt-parent = <&mpic>;
585 interrupts = <16 2>;
586 interrupt-map-mask = <0xf800 0 0 7>;
587 interrupt-map = <
588 /* IDSEL 0x0 */
589 0000 0 0 1 &mpic 0 1
590 0000 0 0 2 &mpic 1 1
591 0000 0 0 3 &mpic 2 1
592 0000 0 0 4 &mpic 3 1
593 >;
594 pcie@0 { 263 pcie@0 {
595 reg = <0x0 0x0 0x0 0x0 0x0>;
596 #size-cells = <2>;
597 #address-cells = <3>;
598 device_type = "pci";
599 ranges = <0x2000000 0x0 0xc0000000 264 ranges = <0x2000000 0x0 0xc0000000
600 0x2000000 0x0 0xc0000000 265 0x2000000 0x0 0xc0000000
601 0x0 0x20000000 266 0x0 0x20000000
@@ -606,36 +271,16 @@
606 }; 271 };
607 }; 272 };
608 273
609 qe@ffe80000 { 274 qe: qe@ffe80000 {
610 #address-cells = <1>;
611 #size-cells = <1>;
612 device_type = "qe";
613 compatible = "fsl,qe";
614 ranges = <0x0 0x0 0xffe80000 0x40000>; 275 ranges = <0x0 0x0 0xffe80000 0x40000>;
615 reg = <0 0xffe80000 0 0x480>; 276 reg = <0 0xffe80000 0 0x480>;
616 brg-frequency = <0>; 277 brg-frequency = <0>;
617 bus-frequency = <0>; 278 bus-frequency = <0>;
618 fsl,qe-num-riscs = <1>;
619 fsl,qe-num-snums = <28>;
620 status = "disabled"; /* no firmware loaded */ 279 status = "disabled"; /* no firmware loaded */
621 280
622 qeic: interrupt-controller@80 {
623 interrupt-controller;
624 compatible = "fsl,qe-ic";
625 #address-cells = <0>;
626 #interrupt-cells = <1>;
627 reg = <0x80 0x80>;
628 interrupts = <63 2 60 2>; //high:47 low:44
629 interrupt-parent = <&mpic>;
630 };
631
632 enet3: ucc@2000 { 281 enet3: ucc@2000 {
633 device_type = "network"; 282 device_type = "network";
634 compatible = "ucc_geth"; 283 compatible = "ucc_geth";
635 cell-index = <1>;
636 reg = <0x2000 0x200>;
637 interrupts = <32>;
638 interrupt-parent = <&qeic>;
639 local-mac-address = [ 00 00 00 00 00 00 ]; 284 local-mac-address = [ 00 00 00 00 00 00 ];
640 rx-clock-name = "clk12"; 285 rx-clock-name = "clk12";
641 tx-clock-name = "clk9"; 286 tx-clock-name = "clk9";
@@ -645,20 +290,15 @@
645 }; 290 };
646 291
647 mdio@2120 { 292 mdio@2120 {
648 #address-cells = <1>;
649 #size-cells = <0>;
650 reg = <0x2120 0x18>;
651 compatible = "fsl,ucc-mdio";
652
653 qe_phy0: ethernet-phy@0 { 293 qe_phy0: ethernet-phy@0 {
654 interrupt-parent = <&mpic>; 294 interrupt-parent = <&mpic>;
655 interrupts = <4 1>; 295 interrupts = <4 1 0 0>;
656 reg = <0x0>; 296 reg = <0x0>;
657 device_type = "ethernet-phy"; 297 device_type = "ethernet-phy";
658 }; 298 };
659 qe_phy1: ethernet-phy@03 { 299 qe_phy1: ethernet-phy@03 {
660 interrupt-parent = <&mpic>; 300 interrupt-parent = <&mpic>;
661 interrupts = <5 1>; 301 interrupts = <5 1 0 0>;
662 reg = <0x3>; 302 reg = <0x3>;
663 device_type = "ethernet-phy"; 303 device_type = "ethernet-phy";
664 }; 304 };
@@ -671,10 +311,6 @@
671 enet4: ucc@2400 { 311 enet4: ucc@2400 {
672 device_type = "network"; 312 device_type = "network";
673 compatible = "ucc_geth"; 313 compatible = "ucc_geth";
674 cell-index = <5>;
675 reg = <0x2400 0x200>;
676 interrupts = <40>;
677 interrupt-parent = <&qeic>;
678 local-mac-address = [ 00 00 00 00 00 00 ]; 314 local-mac-address = [ 00 00 00 00 00 00 ];
679 rx-clock-name = "none"; 315 rx-clock-name = "none";
680 tx-clock-name = "clk13"; 316 tx-clock-name = "clk13";
@@ -682,18 +318,7 @@
682 phy-handle = <&qe_phy1>; 318 phy-handle = <&qe_phy1>;
683 phy-connection-type = "rmii"; 319 phy-connection-type = "rmii";
684 }; 320 };
685
686 muram@10000 {
687 #address-cells = <1>;
688 #size-cells = <1>;
689 compatible = "fsl,qe-muram", "fsl,cpm-muram";
690 ranges = <0x0 0x10000 0x6000>;
691
692 data-only@0 {
693 compatible = "fsl,qe-muram-data",
694 "fsl,cpm-muram-data";
695 reg = <0x0 0x6000>;
696 };
697 };
698 }; 321 };
699}; 322};
323
324/include/ "fsl/p1021si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts
index b9b8719a6204..ef95717db4bc 100644
--- a/arch/powerpc/boot/dts/p1022ds.dts
+++ b/arch/powerpc/boot/dts/p1022ds.dts
@@ -8,57 +8,36 @@
8 * kind, whether express or implied. 8 * kind, whether express or implied.
9 */ 9 */
10 10
11/dts-v1/; 11/include/ "fsl/p1022si-pre.dtsi"
12/ { 12/ {
13 model = "fsl,P1022"; 13 model = "fsl,P1022DS";
14 compatible = "fsl,P1022DS"; 14 compatible = "fsl,P1022DS";
15 #address-cells = <2>;
16 #size-cells = <2>;
17 interrupt-parent = <&mpic>;
18
19 aliases {
20 ethernet0 = &enet0;
21 ethernet1 = &enet1;
22 serial0 = &serial0;
23 serial1 = &serial1;
24 pci0 = &pci0;
25 pci1 = &pci1;
26 pci2 = &pci2;
27 };
28
29 cpus {
30 #address-cells = <1>;
31 #size-cells = <0>;
32
33 PowerPC,P1022@0 {
34 device_type = "cpu";
35 reg = <0x0>;
36 next-level-cache = <&L2>;
37 };
38
39 PowerPC,P1022@1 {
40 device_type = "cpu";
41 reg = <0x1>;
42 next-level-cache = <&L2>;
43 };
44 };
45 15
46 memory { 16 memory {
47 device_type = "memory"; 17 device_type = "memory";
48 }; 18 };
49 19
50 localbus@fffe05000 { 20 lbc: localbus@fffe05000 {
51 #address-cells = <2>; 21 reg = <0xf 0xffe05000 0 0x1000>;
52 #size-cells = <1>;
53 compatible = "fsl,p1022-elbc", "fsl,elbc", "simple-bus";
54 reg = <0 0xffe05000 0 0x1000>;
55 interrupts = <19 2 0 0>;
56
57 ranges = <0x0 0x0 0xf 0xe8000000 0x08000000 22 ranges = <0x0 0x0 0xf 0xe8000000 0x08000000
58 0x1 0x0 0xf 0xe0000000 0x08000000 23 0x1 0x0 0xf 0xe0000000 0x08000000
59 0x2 0x0 0x0 0xffa00000 0x00040000 24 0x2 0x0 0xf 0xff800000 0x00040000
60 0x3 0x0 0xf 0xffdf0000 0x00008000>; 25 0x3 0x0 0xf 0xffdf0000 0x00008000>;
61 26
27 /*
28 * This node is used to access the pixis via "indirect" mode,
29 * which is done by writing the pixis register index to chip
30 * select 0 and the value to/from chip select 1. Indirect
31 * mode is the only way to access the pixis when DIU video
32 * is enabled. Note that this assumes that the first column
33 * of the 'ranges' property above is the chip select number.
34 */
35 board-control@0,0 {
36 compatible = "fsl,p1022ds-indirect-pixis";
37 reg = <0x0 0x0 1 /* CS0 */
38 0x1 0x0 1>; /* CS1 */
39 };
40
62 nor@0,0 { 41 nor@0,0 {
63 #address-cells = <1>; 42 #address-cells = <1>;
64 #size-cells = <1>; 43 #size-cells = <1>;
@@ -161,51 +140,10 @@
161 }; 140 };
162 }; 141 };
163 142
164 soc@fffe00000 { 143 soc: soc@fffe00000 {
165 #address-cells = <1>;
166 #size-cells = <1>;
167 device_type = "soc";
168 compatible = "fsl,p1022-immr", "simple-bus";
169 ranges = <0x0 0xf 0xffe00000 0x100000>; 144 ranges = <0x0 0xf 0xffe00000 0x100000>;
170 bus-frequency = <0>; // Filled out by uboot.
171
172 ecm-law@0 {
173 compatible = "fsl,ecm-law";
174 reg = <0x0 0x1000>;
175 fsl,num-laws = <12>;
176 };
177
178 ecm@1000 {
179 compatible = "fsl,p1022-ecm", "fsl,ecm";
180 reg = <0x1000 0x1000>;
181 interrupts = <16 2 0 0>;
182 };
183
184 memory-controller@2000 {
185 compatible = "fsl,p1022-memory-controller";
186 reg = <0x2000 0x1000>;
187 interrupts = <16 2 0 0>;
188 };
189
190 i2c@3000 {
191 #address-cells = <1>;
192 #size-cells = <0>;
193 cell-index = <0>;
194 compatible = "fsl-i2c";
195 reg = <0x3000 0x100>;
196 interrupts = <43 2 0 0>;
197 dfsrr;
198 };
199 145
200 i2c@3100 { 146 i2c@3100 {
201 #address-cells = <1>;
202 #size-cells = <0>;
203 cell-index = <1>;
204 compatible = "fsl-i2c";
205 reg = <0x3100 0x100>;
206 interrupts = <43 2 0 0>;
207 dfsrr;
208
209 wm8776:codec@1a { 147 wm8776:codec@1a {
210 compatible = "wlf,wm8776"; 148 compatible = "wlf,wm8776";
211 reg = <0x1a>; 149 reg = <0x1a>;
@@ -216,41 +154,14 @@
216 }; 154 };
217 }; 155 };
218 156
219 serial0: serial@4500 {
220 cell-index = <0>;
221 device_type = "serial";
222 compatible = "ns16550";
223 reg = <0x4500 0x100>;
224 clock-frequency = <0>;
225 interrupts = <42 2 0 0>;
226 };
227
228 serial1: serial@4600 {
229 cell-index = <1>;
230 device_type = "serial";
231 compatible = "ns16550";
232 reg = <0x4600 0x100>;
233 clock-frequency = <0>;
234 interrupts = <42 2 0 0>;
235 };
236
237 spi@7000 { 157 spi@7000 {
238 cell-index = <0>; 158 flash@0 {
239 #address-cells = <1>;
240 #size-cells = <0>;
241 compatible = "fsl,espi";
242 reg = <0x7000 0x1000>;
243 interrupts = <59 0x2 0 0>;
244 espi,num-ss-bits = <4>;
245 mode = "cpu";
246
247 fsl_m25p80@0 {
248 #address-cells = <1>; 159 #address-cells = <1>;
249 #size-cells = <1>; 160 #size-cells = <1>;
250 compatible = "fsl,espi-flash"; 161 compatible = "spansion,s25sl12801";
251 reg = <0>; 162 reg = <0>;
252 linux,modalias = "fsl_m25p80";
253 spi-max-frequency = <40000000>; /* input clock */ 163 spi-max-frequency = <40000000>; /* input clock */
164
254 partition@0 { 165 partition@0 {
255 label = "u-boot-spi"; 166 label = "u-boot-spi";
256 reg = <0x00000000 0x00100000>; 167 reg = <0x00000000 0x00100000>;
@@ -274,115 +185,20 @@
274 }; 185 };
275 186
276 ssi@15000 { 187 ssi@15000 {
277 compatible = "fsl,mpc8610-ssi";
278 cell-index = <0>;
279 reg = <0x15000 0x100>;
280 interrupts = <75 2 0 0>;
281 fsl,mode = "i2s-slave"; 188 fsl,mode = "i2s-slave";
282 codec-handle = <&wm8776>; 189 codec-handle = <&wm8776>;
283 fsl,playback-dma = <&dma00>;
284 fsl,capture-dma = <&dma01>;
285 fsl,fifo-depth = <15>;
286 fsl,ssi-asynchronous; 190 fsl,ssi-asynchronous;
287 }; 191 };
288 192
289 dma@c300 {
290 #address-cells = <1>;
291 #size-cells = <1>;
292 compatible = "fsl,eloplus-dma";
293 reg = <0xc300 0x4>;
294 ranges = <0x0 0xc100 0x200>;
295 cell-index = <1>;
296 dma00: dma-channel@0 {
297 compatible = "fsl,ssi-dma-channel";
298 reg = <0x0 0x80>;
299 cell-index = <0>;
300 interrupts = <76 2 0 0>;
301 };
302 dma01: dma-channel@80 {
303 compatible = "fsl,ssi-dma-channel";
304 reg = <0x80 0x80>;
305 cell-index = <1>;
306 interrupts = <77 2 0 0>;
307 };
308 dma-channel@100 {
309 compatible = "fsl,eloplus-dma-channel";
310 reg = <0x100 0x80>;
311 cell-index = <2>;
312 interrupts = <78 2 0 0>;
313 };
314 dma-channel@180 {
315 compatible = "fsl,eloplus-dma-channel";
316 reg = <0x180 0x80>;
317 cell-index = <3>;
318 interrupts = <79 2 0 0>;
319 };
320 };
321
322 gpio: gpio-controller@f000 {
323 #gpio-cells = <2>;
324 compatible = "fsl,mpc8572-gpio";
325 reg = <0xf000 0x100>;
326 interrupts = <47 0x2 0 0>;
327 gpio-controller;
328 };
329
330 L2: l2-cache-controller@20000 {
331 compatible = "fsl,p1022-l2-cache-controller";
332 reg = <0x20000 0x1000>;
333 cache-line-size = <32>; // 32 bytes
334 cache-size = <0x40000>; // L2, 256K
335 interrupts = <16 2 0 0>;
336 };
337
338 dma@21300 {
339 #address-cells = <1>;
340 #size-cells = <1>;
341 compatible = "fsl,eloplus-dma";
342 reg = <0x21300 0x4>;
343 ranges = <0x0 0x21100 0x200>;
344 cell-index = <0>;
345 dma-channel@0 {
346 compatible = "fsl,eloplus-dma-channel";
347 reg = <0x0 0x80>;
348 cell-index = <0>;
349 interrupts = <20 2 0 0>;
350 };
351 dma-channel@80 {
352 compatible = "fsl,eloplus-dma-channel";
353 reg = <0x80 0x80>;
354 cell-index = <1>;
355 interrupts = <21 2 0 0>;
356 };
357 dma-channel@100 {
358 compatible = "fsl,eloplus-dma-channel";
359 reg = <0x100 0x80>;
360 cell-index = <2>;
361 interrupts = <22 2 0 0>;
362 };
363 dma-channel@180 {
364 compatible = "fsl,eloplus-dma-channel";
365 reg = <0x180 0x80>;
366 cell-index = <3>;
367 interrupts = <23 2 0 0>;
368 };
369 };
370
371 usb@22000 { 193 usb@22000 {
372 #address-cells = <1>;
373 #size-cells = <0>;
374 compatible = "fsl-usb2-dr";
375 reg = <0x22000 0x1000>;
376 interrupts = <28 0x2 0 0>;
377 phy_type = "ulpi"; 194 phy_type = "ulpi";
378 }; 195 };
379 196
380 mdio@24000 { 197 usb@23000 {
381 #address-cells = <1>; 198 status = "disabled";
382 #size-cells = <0>; 199 };
383 compatible = "fsl,etsec2-mdio";
384 reg = <0x24000 0x1000 0xb0030 0x4>;
385 200
201 mdio@24000 {
386 phy0: ethernet-phy@0 { 202 phy0: ethernet-phy@0 {
387 interrupts = <3 1 0 0>; 203 interrupts = <3 1 0 0>;
388 reg = <0x1>; 204 reg = <0x1>;
@@ -391,189 +207,28 @@
391 interrupts = <9 1 0 0>; 207 interrupts = <9 1 0 0>;
392 reg = <0x2>; 208 reg = <0x2>;
393 }; 209 };
210 tbi-phy@2 {
211 device_type = "tbi-phy";
212 reg = <0x2>;
213 };
394 }; 214 };
395 215
396 mdio@25000 { 216 ethernet@b0000 {
397 #address-cells = <1>;
398 #size-cells = <0>;
399 compatible = "fsl,etsec2-mdio";
400 reg = <0x25000 0x1000 0xb1030 0x4>;
401 };
402
403 enet0: ethernet@B0000 {
404 #address-cells = <1>;
405 #size-cells = <1>;
406 cell-index = <0>;
407 device_type = "network";
408 model = "eTSEC";
409 compatible = "fsl,etsec2";
410 fsl,num_rx_queues = <0x8>;
411 fsl,num_tx_queues = <0x8>;
412 fsl,magic-packet;
413 fsl,wake-on-filer;
414 local-mac-address = [ 00 00 00 00 00 00 ];
415 phy-handle = <&phy0>; 217 phy-handle = <&phy0>;
416 phy-connection-type = "rgmii-id"; 218 phy-connection-type = "rgmii-id";
417 queue-group@0{
418 #address-cells = <1>;
419 #size-cells = <1>;
420 reg = <0xB0000 0x1000>;
421 interrupts = <29 2 0 0 30 2 0 0 34 2 0 0>;
422 };
423 queue-group@1{
424 #address-cells = <1>;
425 #size-cells = <1>;
426 reg = <0xB4000 0x1000>;
427 interrupts = <17 2 0 0 18 2 0 0 24 2 0 0>;
428 };
429 }; 219 };
430 220
431 enet1: ethernet@B1000 { 221 ethernet@b1000 {
432 #address-cells = <1>;
433 #size-cells = <1>;
434 cell-index = <0>;
435 device_type = "network";
436 model = "eTSEC";
437 compatible = "fsl,etsec2";
438 fsl,num_rx_queues = <0x8>;
439 fsl,num_tx_queues = <0x8>;
440 local-mac-address = [ 00 00 00 00 00 00 ];
441 phy-handle = <&phy1>; 222 phy-handle = <&phy1>;
442 phy-connection-type = "rgmii-id"; 223 phy-connection-type = "rgmii-id";
443 queue-group@0{
444 #address-cells = <1>;
445 #size-cells = <1>;
446 reg = <0xB1000 0x1000>;
447 interrupts = <35 2 0 0 36 2 0 0 40 2 0 0>;
448 };
449 queue-group@1{
450 #address-cells = <1>;
451 #size-cells = <1>;
452 reg = <0xB5000 0x1000>;
453 interrupts = <51 2 0 0 52 2 0 0 67 2 0 0>;
454 };
455 };
456
457 sdhci@2e000 {
458 compatible = "fsl,p1022-esdhc", "fsl,esdhc";
459 reg = <0x2e000 0x1000>;
460 interrupts = <72 0x2 0 0>;
461 fsl,sdhci-auto-cmd12;
462 /* Filled in by U-Boot */
463 clock-frequency = <0>;
464 };
465
466 crypto@30000 {
467 compatible = "fsl,sec3.3", "fsl,sec3.1", "fsl,sec3.0",
468 "fsl,sec2.4", "fsl,sec2.2", "fsl,sec2.1",
469 "fsl,sec2.0";
470 reg = <0x30000 0x10000>;
471 interrupts = <45 2 0 0 58 2 0 0>;
472 fsl,num-channels = <4>;
473 fsl,channel-fifo-len = <24>;
474 fsl,exec-units-mask = <0x97c>;
475 fsl,descriptor-types-mask = <0x3a30abf>;
476 };
477
478 sata@18000 {
479 compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
480 reg = <0x18000 0x1000>;
481 cell-index = <1>;
482 interrupts = <74 0x2 0 0>;
483 };
484
485 sata@19000 {
486 compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
487 reg = <0x19000 0x1000>;
488 cell-index = <2>;
489 interrupts = <41 0x2 0 0>;
490 };
491
492 power@e0070{
493 compatible = "fsl,mpc8536-pmc", "fsl,mpc8548-pmc";
494 reg = <0xe0070 0x20>;
495 };
496
497 display@10000 {
498 compatible = "fsl,diu", "fsl,p1022-diu";
499 reg = <0x10000 1000>;
500 interrupts = <64 2 0 0>;
501 };
502
503 timer@41100 {
504 compatible = "fsl,mpic-global-timer";
505 reg = <0x41100 0x100 0x41300 4>;
506 interrupts = <0 0 3 0
507 1 0 3 0
508 2 0 3 0
509 3 0 3 0>;
510 };
511
512 timer@42100 {
513 compatible = "fsl,mpic-global-timer";
514 reg = <0x42100 0x100 0x42300 4>;
515 interrupts = <4 0 3 0
516 5 0 3 0
517 6 0 3 0
518 7 0 3 0>;
519 };
520
521 mpic: pic@40000 {
522 interrupt-controller;
523 #address-cells = <0>;
524 #interrupt-cells = <4>;
525 reg = <0x40000 0x40000>;
526 compatible = "fsl,mpic";
527 device_type = "open-pic";
528 };
529
530 msi@41600 {
531 compatible = "fsl,p1022-msi", "fsl,mpic-msi";
532 reg = <0x41600 0x80>;
533 msi-available-ranges = <0 0x100>;
534 interrupts = <
535 0xe0 0 0 0
536 0xe1 0 0 0
537 0xe2 0 0 0
538 0xe3 0 0 0
539 0xe4 0 0 0
540 0xe5 0 0 0
541 0xe6 0 0 0
542 0xe7 0 0 0>;
543 };
544
545 global-utilities@e0000 { //global utilities block
546 compatible = "fsl,p1022-guts";
547 reg = <0xe0000 0x1000>;
548 fsl,has-rstcr;
549 }; 224 };
550 }; 225 };
551 226
552 pci0: pcie@fffe09000 { 227 pci0: pcie@fffe09000 {
553 compatible = "fsl,p1022-pcie";
554 device_type = "pci";
555 #interrupt-cells = <1>;
556 #size-cells = <2>;
557 #address-cells = <3>;
558 reg = <0xf 0xffe09000 0 0x1000>; 228 reg = <0xf 0xffe09000 0 0x1000>;
559 bus-range = <0 255>; 229 ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
560 ranges = <0x2000000 0x0 0xa0000000 0xc 0x20000000 0x0 0x20000000
561 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>; 230 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>;
562 clock-frequency = <33333333>;
563 interrupts = <16 2 0 0>;
564 interrupt-map-mask = <0xf800 0 0 7>;
565 interrupt-map = <
566 /* IDSEL 0x0 */
567 0000 0 0 1 &mpic 4 1
568 0000 0 0 2 &mpic 5 1
569 0000 0 0 3 &mpic 6 1
570 0000 0 0 4 &mpic 7 1
571 >;
572 pcie@0 { 231 pcie@0 {
573 reg = <0x0 0x0 0x0 0x0 0x0>;
574 #size-cells = <2>;
575 #address-cells = <3>;
576 device_type = "pci";
577 ranges = <0x2000000 0x0 0xe0000000 232 ranges = <0x2000000 0x0 0xe0000000
578 0x2000000 0x0 0xe0000000 233 0x2000000 0x0 0xe0000000
579 0x0 0x20000000 234 0x0 0x20000000
@@ -585,30 +240,11 @@
585 }; 240 };
586 241
587 pci1: pcie@fffe0a000 { 242 pci1: pcie@fffe0a000 {
588 compatible = "fsl,p1022-pcie";
589 device_type = "pci";
590 #interrupt-cells = <1>;
591 #size-cells = <2>;
592 #address-cells = <3>;
593 reg = <0xf 0xffe0a000 0 0x1000>; 243 reg = <0xf 0xffe0a000 0 0x1000>;
594 bus-range = <0 255>; 244 ranges = <0x2000000 0x0 0xe0000000 0xc 0x40000000 0x0 0x20000000
595 ranges = <0x2000000 0x0 0xc0000000 0xc 0x40000000 0x0 0x20000000
596 0x1000000 0x0 0x00000000 0xf 0xffc20000 0x0 0x10000>; 245 0x1000000 0x0 0x00000000 0xf 0xffc20000 0x0 0x10000>;
597 clock-frequency = <33333333>;
598 interrupts = <16 2 0 0>;
599 interrupt-map-mask = <0xf800 0 0 7>;
600 interrupt-map = <
601 /* IDSEL 0x0 */
602 0000 0 0 1 &mpic 0 1
603 0000 0 0 2 &mpic 1 1
604 0000 0 0 3 &mpic 2 1
605 0000 0 0 4 &mpic 3 1
606 >;
607 pcie@0 { 246 pcie@0 {
608 reg = <0x0 0x0 0x0 0x0 0x0>; 247 reg = <0x0 0x0 0x0 0x0 0x0>;
609 #size-cells = <2>;
610 #address-cells = <3>;
611 device_type = "pci";
612 ranges = <0x2000000 0x0 0xe0000000 248 ranges = <0x2000000 0x0 0xe0000000
613 0x2000000 0x0 0xe0000000 249 0x2000000 0x0 0xe0000000
614 0x0 0x20000000 250 0x0 0x20000000
@@ -619,32 +255,11 @@
619 }; 255 };
620 }; 256 };
621 257
622
623 pci2: pcie@fffe0b000 { 258 pci2: pcie@fffe0b000 {
624 compatible = "fsl,p1022-pcie";
625 device_type = "pci";
626 #interrupt-cells = <1>;
627 #size-cells = <2>;
628 #address-cells = <3>;
629 reg = <0xf 0xffe0b000 0 0x1000>; 259 reg = <0xf 0xffe0b000 0 0x1000>;
630 bus-range = <0 255>; 260 ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000
631 ranges = <0x2000000 0x0 0x80000000 0xc 0x00000000 0x0 0x20000000
632 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>; 261 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>;
633 clock-frequency = <33333333>;
634 interrupts = <16 2 0 0>;
635 interrupt-map-mask = <0xf800 0 0 7>;
636 interrupt-map = <
637 /* IDSEL 0x0 */
638 0000 0 0 1 &mpic 8 1
639 0000 0 0 2 &mpic 9 1
640 0000 0 0 3 &mpic 10 1
641 0000 0 0 4 &mpic 11 1
642 >;
643 pcie@0 { 262 pcie@0 {
644 reg = <0x0 0x0 0x0 0x0 0x0>;
645 #size-cells = <2>;
646 #address-cells = <3>;
647 device_type = "pci";
648 ranges = <0x2000000 0x0 0xe0000000 263 ranges = <0x2000000 0x0 0xe0000000
649 0x2000000 0x0 0xe0000000 264 0x2000000 0x0 0xe0000000
650 0x0 0x20000000 265 0x0 0x20000000
@@ -655,3 +270,5 @@
655 }; 270 };
656 }; 271 };
657}; 272};
273
274/include/ "fsl/p1022si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p1023rds.dts b/arch/powerpc/boot/dts/p1023rds.dts
index d9b776740a67..beb6cb12e59d 100644
--- a/arch/powerpc/boot/dts/p1023rds.dts
+++ b/arch/powerpc/boot/dts/p1023rds.dts
@@ -34,137 +34,30 @@
34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */ 35 */
36 36
37/dts-v1/; 37/include/ "fsl/p1023si-pre.dtsi"
38 38
39/ { 39/ {
40 model = "fsl,P1023"; 40 model = "fsl,P1023";
41 compatible = "fsl,P1023RDS"; 41 compatible = "fsl,P1023RDS";
42 #address-cells = <2>; 42 #address-cells = <2>;
43 #size-cells = <2>; 43 #size-cells = <2>;
44 44 interrupt-parent = <&mpic>;
45 aliases {
46 serial0 = &serial0;
47 serial1 = &serial1;
48 pci0 = &pci0;
49 pci1 = &pci1;
50 pci2 = &pci2;
51
52 crypto = &crypto;
53 sec_jr0 = &sec_jr0;
54 sec_jr1 = &sec_jr1;
55 sec_jr2 = &sec_jr2;
56 sec_jr3 = &sec_jr3;
57 rtic_a = &rtic_a;
58 rtic_b = &rtic_b;
59 rtic_c = &rtic_c;
60 rtic_d = &rtic_d;
61 };
62
63 cpus {
64 #address-cells = <1>;
65 #size-cells = <0>;
66
67 cpu0: PowerPC,P1023@0 {
68 device_type = "cpu";
69 reg = <0x0>;
70 next-level-cache = <&L2>;
71 };
72
73 cpu1: PowerPC,P1023@1 {
74 device_type = "cpu";
75 reg = <0x1>;
76 next-level-cache = <&L2>;
77 };
78 };
79 45
80 memory { 46 memory {
81 device_type = "memory"; 47 device_type = "memory";
82 }; 48 };
83 49
84 soc@ff600000 { 50 soc: soc@ff600000 {
85 #address-cells = <1>;
86 #size-cells = <1>;
87 device_type = "soc";
88 compatible = "fsl,p1023-immr", "simple-bus";
89 ranges = <0x0 0x0 0xff600000 0x200000>; 51 ranges = <0x0 0x0 0xff600000 0x200000>;
90 bus-frequency = <0>; // Filled out by uboot.
91
92 ecm-law@0 {
93 compatible = "fsl,ecm-law";
94 reg = <0x0 0x1000>;
95 fsl,num-laws = <12>;
96 };
97
98 ecm@1000 {
99 compatible = "fsl,p1023-ecm", "fsl,ecm";
100 reg = <0x1000 0x1000>;
101 interrupts = <16 2>;
102 interrupt-parent = <&mpic>;
103 };
104
105 memory-controller@2000 {
106 compatible = "fsl,p1023-memory-controller";
107 reg = <0x2000 0x1000>;
108 interrupt-parent = <&mpic>;
109 interrupts = <16 2>;
110 };
111 52
112 i2c@3000 { 53 i2c@3000 {
113 #address-cells = <1>;
114 #size-cells = <0>;
115 cell-index = <0>;
116 compatible = "fsl-i2c";
117 reg = <0x3000 0x100>;
118 interrupts = <43 2>;
119 interrupt-parent = <&mpic>;
120 dfsrr;
121 rtc@68 { 54 rtc@68 {
122 compatible = "dallas,ds1374"; 55 compatible = "dallas,ds1374";
123 reg = <0x68>; 56 reg = <0x68>;
124 }; 57 };
125 }; 58 };
126 59
127 i2c@3100 {
128 #address-cells = <1>;
129 #size-cells = <0>;
130 cell-index = <1>;
131 compatible = "fsl-i2c";
132 reg = <0x3100 0x100>;
133 interrupts = <43 2>;
134 interrupt-parent = <&mpic>;
135 dfsrr;
136 };
137
138 serial0: serial@4500 {
139 cell-index = <0>;
140 device_type = "serial";
141 compatible = "ns16550";
142 reg = <0x4500 0x100>;
143 clock-frequency = <0>;
144 interrupts = <42 2>;
145 interrupt-parent = <&mpic>;
146 };
147
148 serial1: serial@4600 {
149 cell-index = <1>;
150 device_type = "serial";
151 compatible = "ns16550";
152 reg = <0x4600 0x100>;
153 clock-frequency = <0>;
154 interrupts = <42 2>;
155 interrupt-parent = <&mpic>;
156 };
157
158 spi@7000 { 60 spi@7000 {
159 cell-index = <0>;
160 #address-cells = <1>;
161 #size-cells = <0>;
162 compatible = "fsl,p1023-espi", "fsl,mpc8536-espi";
163 reg = <0x7000 0x1000>;
164 interrupts = <59 0x2>;
165 interrupt-parent = <&mpic>;
166 fsl,espi-num-chipselects = <4>;
167
168 fsl_dataflash@0 { 61 fsl_dataflash@0 {
169 #address-cells = <1>; 62 #address-cells = <1>;
170 #size-cells = <1>; 63 #size-cells = <1>;
@@ -186,197 +79,14 @@
186 }; 79 };
187 }; 80 };
188 81
189 gpio: gpio-controller@f000 {
190 #gpio-cells = <2>;
191 compatible = "fsl,qoriq-gpio";
192 reg = <0xf000 0x100>;
193 interrupts = <47 0x2>;
194 interrupt-parent = <&mpic>;
195 gpio-controller;
196 };
197
198 L2: l2-cache-controller@20000 {
199 compatible = "fsl,p1023-l2-cache-controller";
200 reg = <0x20000 0x1000>;
201 cache-line-size = <32>; // 32 bytes
202 cache-size = <0x40000>; // L2,256K
203 interrupt-parent = <&mpic>;
204 interrupts = <16 2>;
205 };
206
207 dma@21300 {
208 #address-cells = <1>;
209 #size-cells = <1>;
210 compatible = "fsl,eloplus-dma";
211 reg = <0x21300 0x4>;
212 ranges = <0x0 0x21100 0x200>;
213 cell-index = <0>;
214 dma-channel@0 {
215 compatible = "fsl,eloplus-dma-channel";
216 reg = <0x0 0x80>;
217 cell-index = <0>;
218 interrupt-parent = <&mpic>;
219 interrupts = <20 2>;
220 };
221 dma-channel@80 {
222 compatible = "fsl,eloplus-dma-channel";
223 reg = <0x80 0x80>;
224 cell-index = <1>;
225 interrupt-parent = <&mpic>;
226 interrupts = <21 2>;
227 };
228 dma-channel@100 {
229 compatible = "fsl,eloplus-dma-channel";
230 reg = <0x100 0x80>;
231 cell-index = <2>;
232 interrupt-parent = <&mpic>;
233 interrupts = <22 2>;
234 };
235 dma-channel@180 {
236 compatible = "fsl,eloplus-dma-channel";
237 reg = <0x180 0x80>;
238 cell-index = <3>;
239 interrupt-parent = <&mpic>;
240 interrupts = <23 2>;
241 };
242 };
243
244 usb@22000 { 82 usb@22000 {
245 #address-cells = <1>;
246 #size-cells = <0>;
247 compatible = "fsl-usb2-dr";
248 reg = <0x22000 0x1000>;
249 interrupt-parent = <&mpic>;
250 interrupts = <28 0x2>;
251 dr_mode = "host"; 83 dr_mode = "host";
252 phy_type = "ulpi"; 84 phy_type = "ulpi";
253 }; 85 };
254
255 crypto: crypto@300000 {
256 compatible = "fsl,sec-v4.2", "fsl,sec-v4.0";
257 #address-cells = <1>;
258 #size-cells = <1>;
259 reg = <0x30000 0x10000>;
260 ranges = <0 0x30000 0x10000>;
261 interrupt-parent = <&mpic>;
262 interrupts = <58 2>;
263
264 sec_jr0: jr@1000 {
265 compatible = "fsl,sec-v4.2-job-ring",
266 "fsl,sec-v4.0-job-ring";
267 reg = <0x1000 0x1000>;
268 interrupts = <45 2>;
269 };
270
271 sec_jr1: jr@2000 {
272 compatible = "fsl,sec-v4.2-job-ring",
273 "fsl,sec-v4.0-job-ring";
274 reg = <0x2000 0x1000>;
275 interrupts = <45 2>;
276 };
277
278 sec_jr2: jr@3000 {
279 compatible = "fsl,sec-v4.2-job-ring",
280 "fsl,sec-v4.0-job-ring";
281 reg = <0x3000 0x1000>;
282 interrupts = <57 2>;
283 };
284
285 sec_jr3: jr@4000 {
286 compatible = "fsl,sec-v4.2-job-ring",
287 "fsl,sec-v4.0-job-ring";
288 reg = <0x4000 0x1000>;
289 interrupts = <57 2>;
290 };
291
292 rtic@6000 {
293 compatible = "fsl,sec-v4.2-rtic",
294 "fsl,sec-v4.0-rtic";
295 #address-cells = <1>;
296 #size-cells = <1>;
297 reg = <0x6000 0x100>;
298 ranges = <0x0 0x6100 0xe00>;
299
300 rtic_a: rtic-a@0 {
301 compatible = "fsl,sec-v4.2-rtic-memory",
302 "fsl,sec-v4.0-rtic-memory";
303 reg = <0x00 0x20 0x100 0x80>;
304 };
305
306 rtic_b: rtic-b@20 {
307 compatible = "fsl,sec-v4.2-rtic-memory",
308 "fsl,sec-v4.0-rtic-memory";
309 reg = <0x20 0x20 0x200 0x80>;
310 };
311
312 rtic_c: rtic-c@40 {
313 compatible = "fsl,sec-v4.2-rtic-memory",
314 "fsl,sec-v4.0-rtic-memory";
315 reg = <0x40 0x20 0x300 0x80>;
316 };
317
318 rtic_d: rtic-d@60 {
319 compatible = "fsl,sec-v4.2-rtic-memory",
320 "fsl,sec-v4.0-rtic-memory";
321 reg = <0x60 0x20 0x500 0x80>;
322 };
323 };
324 };
325
326 power@e0070{
327 compatible = "fsl,mpc8536-pmc", "fsl,mpc8548-pmc",
328 "fsl,p1022-pmc";
329 reg = <0xe0070 0x20>;
330 etsec1_clk: soc-clk@B0{
331 fsl,pmcdr-mask = <0x00000080>;
332 };
333 etsec2_clk: soc-clk@B1{
334 fsl,pmcdr-mask = <0x00000040>;
335 };
336 etsec3_clk: soc-clk@B2{
337 fsl,pmcdr-mask = <0x00000020>;
338 };
339 };
340
341 mpic: pic@40000 {
342 interrupt-controller;
343 #address-cells = <0>;
344 #interrupt-cells = <2>;
345 reg = <0x40000 0x40000>;
346 compatible = "chrp,open-pic";
347 device_type = "open-pic";
348 };
349
350 msi@41600 {
351 compatible = "fsl,p1023-msi", "fsl,mpic-msi";
352 reg = <0x41600 0x80>;
353 msi-available-ranges = <0 0x100>;
354 interrupts = <
355 0xe0 0
356 0xe1 0
357 0xe2 0
358 0xe3 0
359 0xe4 0
360 0xe5 0
361 0xe6 0
362 0xe7 0>;
363 interrupt-parent = <&mpic>;
364 };
365
366 global-utilities@e0000 { //global utilities block
367 compatible = "fsl,p1023-guts";
368 reg = <0xe0000 0x1000>;
369 fsl,has-rstcr;
370 };
371 }; 86 };
372 87
373 localbus@ff605000 { 88 lbc: localbus@ff605000 {
374 #address-cells = <2>;
375 #size-cells = <1>;
376 compatible = "fsl,p1023-elbc", "fsl,elbc", "simple-bus";
377 reg = <0 0xff605000 0 0x1000>; 89 reg = <0 0xff605000 0 0x1000>;
378 interrupts = <19 2>;
379 interrupt-parent = <&mpic>;
380 90
381 /* NOR Flash, BCSR */ 91 /* NOR Flash, BCSR */
382 ranges = <0x0 0x0 0x0 0xee000000 0x02000000 92 ranges = <0x0 0x0 0x0 0xee000000 0x02000000
@@ -428,33 +138,18 @@
428 }; 138 };
429 139
430 pci0: pcie@ff60a000 { 140 pci0: pcie@ff60a000 {
431 compatible = "fsl,p1023-pcie", "fsl,qoriq-pcie-v2.2";
432 cell-index = <1>;
433 device_type = "pci";
434 #size-cells = <2>;
435 #address-cells = <3>;
436 reg = <0 0xff60a000 0 0x1000>; 141 reg = <0 0xff60a000 0 0x1000>;
437 bus-range = <0 255>;
438 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 142 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
439 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; 143 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
440 clock-frequency = <33333333>;
441 interrupt-parent = <&mpic>;
442 interrupts = <16 2>;
443 pcie@0 { 144 pcie@0 {
444 reg = <0x0 0x0 0x0 0x0 0x0>; 145 /* IRQ[0:3] are pulled up on board, set to active-low */
445 #interrupt-cells = <1>;
446 #size-cells = <2>;
447 #address-cells = <3>;
448 device_type = "pci";
449 interrupt-parent = <&mpic>;
450 interrupts = <16 2>;
451 interrupt-map-mask = <0xf800 0 0 7>; 146 interrupt-map-mask = <0xf800 0 0 7>;
452 interrupt-map = < 147 interrupt-map = <
453 /* IDSEL 0x0 */ 148 /* IDSEL 0x0 */
454 0000 0 0 1 &mpic 0 1 149 0000 0 0 1 &mpic 0 1 0 0
455 0000 0 0 2 &mpic 1 1 150 0000 0 0 2 &mpic 1 1 0 0
456 0000 0 0 3 &mpic 2 1 151 0000 0 0 3 &mpic 2 1 0 0
457 0000 0 0 4 &mpic 3 1 152 0000 0 0 4 &mpic 3 1 0 0
458 >; 153 >;
459 ranges = <0x2000000 0x0 0xc0000000 154 ranges = <0x2000000 0x0 0xc0000000
460 0x2000000 0x0 0xc0000000 155 0x2000000 0x0 0xc0000000
@@ -466,34 +161,22 @@
466 }; 161 };
467 }; 162 };
468 163
469 pci1: pcie@ff609000 { 164 board_pci1: pci1: pcie@ff609000 {
470 compatible = "fsl,p1023-pcie", "fsl,qoriq-pcie-v2.2";
471 cell-index = <2>;
472 device_type = "pci";
473 #size-cells = <2>;
474 #address-cells = <3>;
475 reg = <0 0xff609000 0 0x1000>; 165 reg = <0 0xff609000 0 0x1000>;
476 bus-range = <0 255>;
477 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 166 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
478 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 167 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
479 clock-frequency = <33333333>;
480 interrupt-parent = <&mpic>;
481 interrupts = <16 2>;
482 pcie@0 { 168 pcie@0 {
483 reg = <0x0 0x0 0x0 0x0 0x0>; 169 /*
484 #interrupt-cells = <1>; 170 * IRQ[4:6] only for PCIe, set to active-high,
485 #size-cells = <2>; 171 * IRQ[7] is pulled up on board, set to active-low
486 #address-cells = <3>; 172 */
487 device_type = "pci";
488 interrupt-parent = <&mpic>;
489 interrupts = <16 2>;
490 interrupt-map-mask = <0xf800 0 0 7>; 173 interrupt-map-mask = <0xf800 0 0 7>;
491 interrupt-map = < 174 interrupt-map = <
492 /* IDSEL 0x0 */ 175 /* IDSEL 0x0 */
493 0000 0 0 1 &mpic 4 1 176 0000 0 0 1 &mpic 4 2 0 0
494 0000 0 0 2 &mpic 5 1 177 0000 0 0 2 &mpic 5 2 0 0
495 0000 0 0 3 &mpic 6 1 178 0000 0 0 3 &mpic 6 2 0 0
496 0000 0 0 4 &mpic 7 1 179 0000 0 0 4 &mpic 7 1 0 0
497 >; 180 >;
498 ranges = <0x2000000 0x0 0xa0000000 181 ranges = <0x2000000 0x0 0xa0000000
499 0x2000000 0x0 0xa0000000 182 0x2000000 0x0 0xa0000000
@@ -506,33 +189,21 @@
506 }; 189 };
507 190
508 pci2: pcie@ff60b000 { 191 pci2: pcie@ff60b000 {
509 cell-index = <3>;
510 compatible = "fsl,p1023-pcie", "fsl,qoriq-pcie-v2.2";
511 device_type = "pci";
512 #size-cells = <2>;
513 #address-cells = <3>;
514 reg = <0 0xff60b000 0 0x1000>; 192 reg = <0 0xff60b000 0 0x1000>;
515 bus-range = <0 255>;
516 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 193 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
517 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 194 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
518 clock-frequency = <33333333>;
519 interrupt-parent = <&mpic>;
520 interrupts = <16 2>;
521 pcie@0 { 195 pcie@0 {
522 reg = <0x0 0x0 0x0 0x0 0x0>; 196 /*
523 #interrupt-cells = <1>; 197 * IRQ[8:10] are pulled up on board, set to active-low
524 #size-cells = <2>; 198 * IRQ[11] only for PCIe, set to active-high,
525 #address-cells = <3>; 199 */
526 device_type = "pci";
527 interrupt-parent = <&mpic>;
528 interrupts = <16 2>;
529 interrupt-map-mask = <0xf800 0 0 7>; 200 interrupt-map-mask = <0xf800 0 0 7>;
530 interrupt-map = < 201 interrupt-map = <
531 /* IDSEL 0x0 */ 202 /* IDSEL 0x0 */
532 0000 0 0 1 &mpic 8 1 203 0000 0 0 1 &mpic 8 1 0 0
533 0000 0 0 2 &mpic 9 1 204 0000 0 0 2 &mpic 9 1 0 0
534 0000 0 0 3 &mpic 10 1 205 0000 0 0 3 &mpic 10 1 0 0
535 0000 0 0 4 &mpic 11 1 206 0000 0 0 4 &mpic 11 2 0 0
536 >; 207 >;
537 ranges = <0x2000000 0x0 0x80000000 208 ranges = <0x2000000 0x0 0x80000000
538 0x2000000 0x0 0x80000000 209 0x2000000 0x0 0x80000000
@@ -544,3 +215,5 @@
544 }; 215 };
545 }; 216 };
546}; 217};
218
219/include/ "fsl/p1023si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p2020ds.dts b/arch/powerpc/boot/dts/p2020ds.dts
index 66f03d6477b2..237310cc7e6c 100644
--- a/arch/powerpc/boot/dts/p2020ds.dts
+++ b/arch/powerpc/boot/dts/p2020ds.dts
@@ -9,30 +9,17 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/include/ "p2020si.dtsi" 12/include/ "fsl/p2020si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "fsl,P2020DS"; 15 model = "fsl,P2020DS";
16 compatible = "fsl,P2020DS"; 16 compatible = "fsl,P2020DS";
17 17
18 aliases {
19 ethernet0 = &enet0;
20 ethernet1 = &enet1;
21 ethernet2 = &enet2;
22 serial0 = &serial0;
23 serial1 = &serial1;
24 pci0 = &pci0;
25 pci1 = &pci1;
26 pci2 = &pci2;
27 };
28
29
30 memory { 18 memory {
31 device_type = "memory"; 19 device_type = "memory";
32 }; 20 };
33 21
34 localbus@ffe05000 { 22 board_lbc: lbc: localbus@ffe05000 {
35 compatible = "fsl,elbc", "simple-bus";
36 ranges = <0x0 0x0 0x0 0xe8000000 0x08000000 23 ranges = <0x0 0x0 0x0 0xe8000000 0x08000000
37 0x1 0x0 0x0 0xe0000000 0x08000000 24 0x1 0x0 0x0 0xe0000000 0x08000000
38 0x2 0x0 0x0 0xffa00000 0x00040000 25 0x2 0x0 0x0 0xffa00000 0x00040000
@@ -40,203 +27,18 @@
40 0x4 0x0 0x0 0xffa40000 0x00040000 27 0x4 0x0 0x0 0xffa40000 0x00040000
41 0x5 0x0 0x0 0xffa80000 0x00040000 28 0x5 0x0 0x0 0xffa80000 0x00040000
42 0x6 0x0 0x0 0xffac0000 0x00040000>; 29 0x6 0x0 0x0 0xffac0000 0x00040000>;
43 30 reg = <0 0xffe05000 0 0x1000>;
44 nor@0,0 {
45 #address-cells = <1>;
46 #size-cells = <1>;
47 compatible = "cfi-flash";
48 reg = <0x0 0x0 0x8000000>;
49 bank-width = <2>;
50 device-width = <1>;
51
52 ramdisk@0 {
53 reg = <0x0 0x03000000>;
54 read-only;
55 };
56
57 diagnostic@3000000 {
58 reg = <0x03000000 0x00e00000>;
59 read-only;
60 };
61
62 dink@3e00000 {
63 reg = <0x03e00000 0x00200000>;
64 read-only;
65 };
66
67 kernel@4000000 {
68 reg = <0x04000000 0x00400000>;
69 read-only;
70 };
71
72 jffs2@4400000 {
73 reg = <0x04400000 0x03b00000>;
74 };
75
76 dtb@7f00000 {
77 reg = <0x07f00000 0x00080000>;
78 read-only;
79 };
80
81 u-boot@7f80000 {
82 reg = <0x07f80000 0x00080000>;
83 read-only;
84 };
85 };
86
87 nand@2,0 {
88 #address-cells = <1>;
89 #size-cells = <1>;
90 compatible = "fsl,elbc-fcm-nand";
91 reg = <0x2 0x0 0x40000>;
92
93 u-boot@0 {
94 reg = <0x0 0x02000000>;
95 read-only;
96 };
97
98 jffs2@2000000 {
99 reg = <0x02000000 0x10000000>;
100 };
101
102 ramdisk@12000000 {
103 reg = <0x12000000 0x08000000>;
104 read-only;
105 };
106
107 kernel@1a000000 {
108 reg = <0x1a000000 0x04000000>;
109 };
110
111 dtb@1e000000 {
112 reg = <0x1e000000 0x01000000>;
113 read-only;
114 };
115
116 empty@1f000000 {
117 reg = <0x1f000000 0x21000000>;
118 };
119 };
120
121 board-control@3,0 {
122 compatible = "fsl,p2020ds-fpga", "fsl,fpga-ngpixis";
123 reg = <0x3 0x0 0x30>;
124 };
125
126 nand@4,0 {
127 compatible = "fsl,elbc-fcm-nand";
128 reg = <0x4 0x0 0x40000>;
129 };
130
131 nand@5,0 {
132 compatible = "fsl,elbc-fcm-nand";
133 reg = <0x5 0x0 0x40000>;
134 };
135
136 nand@6,0 {
137 compatible = "fsl,elbc-fcm-nand";
138 reg = <0x6 0x0 0x40000>;
139 };
140 }; 31 };
141 32
142 soc@ffe00000 { 33 board_soc: soc: soc@ffe00000 {
143 34 ranges = <0x0 0x0 0xffe00000 0x100000>;
144 usb@22000 {
145 phy_type = "ulpi";
146 };
147
148 mdio@24520 {
149 phy0: ethernet-phy@0 {
150 interrupt-parent = <&mpic>;
151 interrupts = <3 1>;
152 reg = <0x0>;
153 };
154 phy1: ethernet-phy@1 {
155 interrupt-parent = <&mpic>;
156 interrupts = <3 1>;
157 reg = <0x1>;
158 };
159 phy2: ethernet-phy@2 {
160 interrupt-parent = <&mpic>;
161 interrupts = <3 1>;
162 reg = <0x2>;
163 };
164 tbi0: tbi-phy@11 {
165 reg = <0x11>;
166 device_type = "tbi-phy";
167 };
168
169 };
170
171 mdio@25520 {
172 tbi1: tbi-phy@11 {
173 reg = <0x11>;
174 device_type = "tbi-phy";
175 };
176 };
177
178 mdio@26520 {
179 tbi2: tbi-phy@11 {
180 reg = <0x11>;
181 device_type = "tbi-phy";
182 };
183
184 };
185
186 ptp_clock@24E00 {
187 compatible = "fsl,etsec-ptp";
188 reg = <0x24E00 0xB0>;
189 interrupts = <68 2 69 2 70 2>;
190 interrupt-parent = < &mpic >;
191 fsl,tclk-period = <5>;
192 fsl,tmr-prsc = <200>;
193 fsl,tmr-add = <0xCCCCCCCD>;
194 fsl,tmr-fiper1 = <0x3B9AC9FB>;
195 fsl,tmr-fiper2 = <0x0001869B>;
196 fsl,max-adj = <249999999>;
197 };
198
199 enet0: ethernet@24000 {
200 tbi-handle = <&tbi0>;
201 phy-handle = <&phy0>;
202 phy-connection-type = "rgmii-id";
203 };
204
205 enet1: ethernet@25000 {
206 tbi-handle = <&tbi1>;
207 phy-handle = <&phy1>;
208 phy-connection-type = "rgmii-id";
209
210 };
211
212 enet2: ethernet@26000 {
213 tbi-handle = <&tbi2>;
214 phy-handle = <&phy2>;
215 phy-connection-type = "rgmii-id";
216 };
217
218
219 msi@41600 {
220 compatible = "fsl,mpic-msi";
221 };
222 }; 35 };
223 36
224 pci0: pcie@ffe08000 { 37 pci2: pcie@ffe08000 {
225 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 38 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
226 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 39 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
227 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 40 reg = <0 0xffe08000 0 0x1000>;
228 interrupt-map = <
229 /* IDSEL 0x0 */
230 0000 0x0 0x0 0x1 &mpic 0x8 0x1
231 0000 0x0 0x0 0x2 &mpic 0x9 0x1
232 0000 0x0 0x0 0x3 &mpic 0xa 0x1
233 0000 0x0 0x0 0x4 &mpic 0xb 0x1
234 >;
235 pcie@0 { 41 pcie@0 {
236 reg = <0x0 0x0 0x0 0x0 0x0>;
237 #size-cells = <2>;
238 #address-cells = <3>;
239 device_type = "pci";
240 ranges = <0x2000000 0x0 0x80000000 42 ranges = <0x2000000 0x0 0x80000000
241 0x2000000 0x0 0x80000000 43 0x2000000 0x0 0x80000000
242 0x0 0x20000000 44 0x0 0x20000000
@@ -247,61 +49,11 @@
247 }; 49 };
248 }; 50 };
249 51
250 pci1: pcie@ffe09000 { 52 board_pci1: pci1: pcie@ffe09000 {
251 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 53 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
252 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 54 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
253 interrupt-map-mask = <0xff00 0x0 0x0 0x7>; 55 reg = <0 0xffe09000 0 0x1000>;
254 interrupt-map = <
255
256 // IDSEL 0x11 func 0 - PCI slot 1
257 0x8800 0x0 0x0 0x1 &i8259 0x9 0x2
258 0x8800 0x0 0x0 0x2 &i8259 0xa 0x2
259
260 // IDSEL 0x11 func 1 - PCI slot 1
261 0x8900 0x0 0x0 0x1 &i8259 0x9 0x2
262 0x8900 0x0 0x0 0x2 &i8259 0xa 0x2
263
264 // IDSEL 0x11 func 2 - PCI slot 1
265 0x8a00 0x0 0x0 0x1 &i8259 0x9 0x2
266 0x8a00 0x0 0x0 0x2 &i8259 0xa 0x2
267
268 // IDSEL 0x11 func 3 - PCI slot 1
269 0x8b00 0x0 0x0 0x1 &i8259 0x9 0x2
270 0x8b00 0x0 0x0 0x2 &i8259 0xa 0x2
271
272 // IDSEL 0x11 func 4 - PCI slot 1
273 0x8c00 0x0 0x0 0x1 &i8259 0x9 0x2
274 0x8c00 0x0 0x0 0x2 &i8259 0xa 0x2
275
276 // IDSEL 0x11 func 5 - PCI slot 1
277 0x8d00 0x0 0x0 0x1 &i8259 0x9 0x2
278 0x8d00 0x0 0x0 0x2 &i8259 0xa 0x2
279
280 // IDSEL 0x11 func 6 - PCI slot 1
281 0x8e00 0x0 0x0 0x1 &i8259 0x9 0x2
282 0x8e00 0x0 0x0 0x2 &i8259 0xa 0x2
283
284 // IDSEL 0x11 func 7 - PCI slot 1
285 0x8f00 0x0 0x0 0x1 &i8259 0x9 0x2
286 0x8f00 0x0 0x0 0x2 &i8259 0xa 0x2
287
288 // IDSEL 0x1d Audio
289 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
290
291 // IDSEL 0x1e Legacy
292 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
293 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
294
295 // IDSEL 0x1f IDE/SATA
296 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
297 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
298 >;
299
300 pcie@0 { 56 pcie@0 {
301 reg = <0x0 0x0 0x0 0x0 0x0>;
302 #size-cells = <2>;
303 #address-cells = <3>;
304 device_type = "pci";
305 ranges = <0x2000000 0x0 0xa0000000 57 ranges = <0x2000000 0x0 0xa0000000
306 0x2000000 0x0 0xa0000000 58 0x2000000 0x0 0xa0000000
307 0x0 0x20000000 59 0x0 0x20000000
@@ -309,89 +61,14 @@
309 0x1000000 0x0 0x0 61 0x1000000 0x0 0x0
310 0x1000000 0x0 0x0 62 0x1000000 0x0 0x0
311 0x0 0x10000>; 63 0x0 0x10000>;
312 uli1575@0 {
313 reg = <0x0 0x0 0x0 0x0 0x0>;
314 #size-cells = <2>;
315 #address-cells = <3>;
316 ranges = <0x2000000 0x0 0xa0000000
317 0x2000000 0x0 0xa0000000
318 0x0 0x20000000
319
320 0x1000000 0x0 0x0
321 0x1000000 0x0 0x0
322 0x0 0x10000>;
323 isa@1e {
324 device_type = "isa";
325 #interrupt-cells = <2>;
326 #size-cells = <1>;
327 #address-cells = <2>;
328 reg = <0xf000 0x0 0x0 0x0 0x0>;
329 ranges = <0x1 0x0 0x1000000 0x0 0x0
330 0x1000>;
331 interrupt-parent = <&i8259>;
332
333 i8259: interrupt-controller@20 {
334 reg = <0x1 0x20 0x2
335 0x1 0xa0 0x2
336 0x1 0x4d0 0x2>;
337 interrupt-controller;
338 device_type = "interrupt-controller";
339 #address-cells = <0>;
340 #interrupt-cells = <2>;
341 compatible = "chrp,iic";
342 interrupts = <4 1>;
343 interrupt-parent = <&mpic>;
344 };
345
346 i8042@60 {
347 #size-cells = <0>;
348 #address-cells = <1>;
349 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
350 interrupts = <1 3 12 3>;
351 interrupt-parent =
352 <&i8259>;
353
354 keyboard@0 {
355 reg = <0x0>;
356 compatible = "pnpPNP,303";
357 };
358
359 mouse@1 {
360 reg = <0x1>;
361 compatible = "pnpPNP,f03";
362 };
363 };
364
365 rtc@70 {
366 compatible = "pnpPNP,b00";
367 reg = <0x1 0x70 0x2>;
368 };
369
370 gpio@400 {
371 reg = <0x1 0x400 0x80>;
372 };
373 };
374 };
375 }; 64 };
376
377 }; 65 };
378 66
379 pci2: pcie@ffe0a000 { 67 pci0: pcie@ffe0a000 {
380 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 68 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
381 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; 69 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
382 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 70 reg = <0 0xffe0a000 0 0x1000>;
383 interrupt-map = <
384 /* IDSEL 0x0 */
385 0000 0x0 0x0 0x1 &mpic 0x0 0x1
386 0000 0x0 0x0 0x2 &mpic 0x1 0x1
387 0000 0x0 0x0 0x3 &mpic 0x2 0x1
388 0000 0x0 0x0 0x4 &mpic 0x3 0x1
389 >;
390 pcie@0 { 71 pcie@0 {
391 reg = <0x0 0x0 0x0 0x0 0x0>;
392 #size-cells = <2>;
393 #address-cells = <3>;
394 device_type = "pci";
395 ranges = <0x2000000 0x0 0xc0000000 72 ranges = <0x2000000 0x0 0xc0000000
396 0x2000000 0x0 0xc0000000 73 0x2000000 0x0 0xc0000000
397 0x0 0x20000000 74 0x0 0x20000000
@@ -402,3 +79,11 @@
402 }; 79 };
403 }; 80 };
404}; 81};
82
83/*
84 * p2020ds.dtsi must be last to ensure board_pci0 overrides pci0 settings
85 * for interrupt-map & interrupt-map-mask
86 */
87
88/include/ "fsl/p2020si-post.dtsi"
89/include/ "p2020ds.dtsi"
diff --git a/arch/powerpc/boot/dts/p2020ds.dtsi b/arch/powerpc/boot/dts/p2020ds.dtsi
new file mode 100644
index 000000000000..c1cf6cef4dd6
--- /dev/null
+++ b/arch/powerpc/boot/dts/p2020ds.dtsi
@@ -0,0 +1,316 @@
1/*
2 * P2020DS Device Tree Source stub (no addresses or top-level ranges)
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35&board_lbc {
36 nor@0,0 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 compatible = "cfi-flash";
40 reg = <0x0 0x0 0x8000000>;
41 bank-width = <2>;
42 device-width = <1>;
43
44 ramdisk@0 {
45 reg = <0x0 0x03000000>;
46 read-only;
47 };
48
49 diagnostic@3000000 {
50 reg = <0x03000000 0x00e00000>;
51 read-only;
52 };
53
54 dink@3e00000 {
55 reg = <0x03e00000 0x00200000>;
56 read-only;
57 };
58
59 kernel@4000000 {
60 reg = <0x04000000 0x00400000>;
61 read-only;
62 };
63
64 jffs2@4400000 {
65 reg = <0x04400000 0x03b00000>;
66 };
67
68 dtb@7f00000 {
69 reg = <0x07f00000 0x00080000>;
70 read-only;
71 };
72
73 u-boot@7f80000 {
74 reg = <0x07f80000 0x00080000>;
75 read-only;
76 };
77 };
78
79 nand@2,0 {
80 #address-cells = <1>;
81 #size-cells = <1>;
82 compatible = "fsl,elbc-fcm-nand";
83 reg = <0x2 0x0 0x40000>;
84
85 u-boot@0 {
86 reg = <0x0 0x02000000>;
87 read-only;
88 };
89
90 jffs2@2000000 {
91 reg = <0x02000000 0x10000000>;
92 };
93
94 ramdisk@12000000 {
95 reg = <0x12000000 0x08000000>;
96 read-only;
97 };
98
99 kernel@1a000000 {
100 reg = <0x1a000000 0x04000000>;
101 };
102
103 dtb@1e000000 {
104 reg = <0x1e000000 0x01000000>;
105 read-only;
106 };
107
108 empty@1f000000 {
109 reg = <0x1f000000 0x21000000>;
110 };
111 };
112
113 board-control@3,0 {
114 compatible = "fsl,p2020ds-fpga", "fsl,fpga-ngpixis";
115 reg = <0x3 0x0 0x30>;
116 };
117
118 nand@4,0 {
119 compatible = "fsl,elbc-fcm-nand";
120 reg = <0x4 0x0 0x40000>;
121 };
122
123 nand@5,0 {
124 compatible = "fsl,elbc-fcm-nand";
125 reg = <0x5 0x0 0x40000>;
126 };
127
128 nand@6,0 {
129 compatible = "fsl,elbc-fcm-nand";
130 reg = <0x6 0x0 0x40000>;
131 };
132};
133
134&board_soc {
135 usb@22000 {
136 phy_type = "ulpi";
137 };
138
139 mdio@24520 {
140 phy0: ethernet-phy@0 {
141 interrupts = <3 1 0 0>;
142 reg = <0x0>;
143 };
144 phy1: ethernet-phy@1 {
145 interrupts = <3 1 0 0>;
146 reg = <0x1>;
147 };
148 phy2: ethernet-phy@2 {
149 interrupts = <3 1 0 0>;
150 reg = <0x2>;
151 };
152 tbi0: tbi-phy@11 {
153 reg = <0x11>;
154 device_type = "tbi-phy";
155 };
156
157 };
158
159 mdio@25520 {
160 tbi1: tbi-phy@11 {
161 reg = <0x11>;
162 device_type = "tbi-phy";
163 };
164 };
165
166 mdio@26520 {
167 tbi2: tbi-phy@11 {
168 reg = <0x11>;
169 device_type = "tbi-phy";
170 };
171
172 };
173
174 ptp_clock@24e00 {
175 fsl,tclk-period = <5>;
176 fsl,tmr-prsc = <200>;
177 fsl,tmr-add = <0xCCCCCCCD>;
178 fsl,tmr-fiper1 = <0x3B9AC9FB>;
179 fsl,tmr-fiper2 = <0x0001869B>;
180 fsl,max-adj = <249999999>;
181 };
182
183 enet0: ethernet@24000 {
184 tbi-handle = <&tbi0>;
185 phy-handle = <&phy0>;
186 phy-connection-type = "rgmii-id";
187 };
188
189 enet1: ethernet@25000 {
190 tbi-handle = <&tbi1>;
191 phy-handle = <&phy1>;
192 phy-connection-type = "rgmii-id";
193
194 };
195
196 enet2: ethernet@26000 {
197 tbi-handle = <&tbi2>;
198 phy-handle = <&phy2>;
199 phy-connection-type = "rgmii-id";
200 };
201};
202
203&board_pci1 {
204 pcie@0 {
205 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
206 interrupt-map = <
207
208 // IDSEL 0x11 func 0 - PCI slot 1
209 0x8800 0x0 0x0 0x1 &i8259 0x9 0x2
210 0x8800 0x0 0x0 0x2 &i8259 0xa 0x2
211
212 // IDSEL 0x11 func 1 - PCI slot 1
213 0x8900 0x0 0x0 0x1 &i8259 0x9 0x2
214 0x8900 0x0 0x0 0x2 &i8259 0xa 0x2
215
216 // IDSEL 0x11 func 2 - PCI slot 1
217 0x8a00 0x0 0x0 0x1 &i8259 0x9 0x2
218 0x8a00 0x0 0x0 0x2 &i8259 0xa 0x2
219
220 // IDSEL 0x11 func 3 - PCI slot 1
221 0x8b00 0x0 0x0 0x1 &i8259 0x9 0x2
222 0x8b00 0x0 0x0 0x2 &i8259 0xa 0x2
223
224 // IDSEL 0x11 func 4 - PCI slot 1
225 0x8c00 0x0 0x0 0x1 &i8259 0x9 0x2
226 0x8c00 0x0 0x0 0x2 &i8259 0xa 0x2
227
228 // IDSEL 0x11 func 5 - PCI slot 1
229 0x8d00 0x0 0x0 0x1 &i8259 0x9 0x2
230 0x8d00 0x0 0x0 0x2 &i8259 0xa 0x2
231
232 // IDSEL 0x11 func 6 - PCI slot 1
233 0x8e00 0x0 0x0 0x1 &i8259 0x9 0x2
234 0x8e00 0x0 0x0 0x2 &i8259 0xa 0x2
235
236 // IDSEL 0x11 func 7 - PCI slot 1
237 0x8f00 0x0 0x0 0x1 &i8259 0x9 0x2
238 0x8f00 0x0 0x0 0x2 &i8259 0xa 0x2
239
240 // IDSEL 0x1d Audio
241 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
242
243 // IDSEL 0x1e Legacy
244 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
245 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
246
247 // IDSEL 0x1f IDE/SATA
248 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
249 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
250 >;
251
252 uli1575@0 {
253 reg = <0x0 0x0 0x0 0x0 0x0>;
254 #size-cells = <2>;
255 #address-cells = <3>;
256 ranges = <0x2000000 0x0 0xa0000000
257 0x2000000 0x0 0xa0000000
258 0x0 0x20000000
259
260 0x1000000 0x0 0x0
261 0x1000000 0x0 0x0
262 0x0 0x10000>;
263 isa@1e {
264 device_type = "isa";
265 #interrupt-cells = <2>;
266 #size-cells = <1>;
267 #address-cells = <2>;
268 reg = <0xf000 0x0 0x0 0x0 0x0>;
269 ranges = <0x1 0x0 0x1000000 0x0 0x0
270 0x1000>;
271 interrupt-parent = <&i8259>;
272
273 i8259: interrupt-controller@20 {
274 reg = <0x1 0x20 0x2
275 0x1 0xa0 0x2
276 0x1 0x4d0 0x2>;
277 interrupt-controller;
278 device_type = "interrupt-controller";
279 #address-cells = <0>;
280 #interrupt-cells = <2>;
281 compatible = "chrp,iic";
282 interrupts = <4 1 0 0>;
283 interrupt-parent = <&mpic>;
284 };
285
286 i8042@60 {
287 #size-cells = <0>;
288 #address-cells = <1>;
289 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
290 interrupts = <1 3 12 3>;
291 interrupt-parent =
292 <&i8259>;
293
294 keyboard@0 {
295 reg = <0x0>;
296 compatible = "pnpPNP,303";
297 };
298
299 mouse@1 {
300 reg = <0x1>;
301 compatible = "pnpPNP,f03";
302 };
303 };
304
305 rtc@70 {
306 compatible = "pnpPNP,b00";
307 reg = <0x1 0x70 0x2>;
308 };
309
310 gpio@400 {
311 reg = <0x1 0x400 0x80>;
312 };
313 };
314 };
315 };
316};
diff --git a/arch/powerpc/boot/dts/p2020rdb.dts b/arch/powerpc/boot/dts/p2020rdb.dts
index 1d7a05f3021e..26759a591712 100644
--- a/arch/powerpc/boot/dts/p2020rdb.dts
+++ b/arch/powerpc/boot/dts/p2020rdb.dts
@@ -9,7 +9,7 @@
9 * option) any later version. 9 * option) any later version.
10 */ 10 */
11 11
12/include/ "p2020si.dtsi" 12/include/ "fsl/p2020si-pre.dtsi"
13 13
14/ { 14/ {
15 model = "fsl,P2020RDB"; 15 model = "fsl,P2020RDB";
@@ -29,7 +29,8 @@
29 device_type = "memory"; 29 device_type = "memory";
30 }; 30 };
31 31
32 localbus@ffe05000 { 32 lbc: localbus@ffe05000 {
33 reg = <0 0xffe05000 0 0x1000>;
33 34
34 /* NOR and NAND Flashes */ 35 /* NOR and NAND Flashes */
35 ranges = <0x0 0x0 0x0 0xef000000 0x01000000 36 ranges = <0x0 0x0 0x0 0xef000000 0x01000000
@@ -140,7 +141,9 @@
140 141
141 }; 142 };
142 143
143 soc@ffe00000 { 144 soc: soc@ffe00000 {
145 ranges = <0x0 0x0 0xffe00000 0x100000>;
146
144 i2c@3000 { 147 i2c@3000 {
145 rtc@68 { 148 rtc@68 {
146 compatible = "dallas,ds1339"; 149 compatible = "dallas,ds1339";
@@ -148,17 +151,13 @@
148 }; 151 };
149 }; 152 };
150 153
151 spi@7000 { 154 spi@7000 {
152 155 flash@0 {
153 fsl_m25p80@0 {
154 #address-cells = <1>; 156 #address-cells = <1>;
155 #size-cells = <1>; 157 #size-cells = <1>;
156 compatible = "fsl,espi-flash"; 158 compatible = "spansion,s25sl12801";
157 reg = <0>; 159 reg = <0>;
158 linux,modalias = "fsl_m25p80";
159 modal = "s25sl128b";
160 spi-max-frequency = <50000000>; 160 spi-max-frequency = <50000000>;
161 mode = <0>;
162 161
163 partition@0 { 162 partition@0 {
164 /* 512KB for u-boot Bootloader Image */ 163 /* 512KB for u-boot Bootloader Image */
@@ -202,15 +201,17 @@
202 201
203 mdio@24520 { 202 mdio@24520 {
204 phy0: ethernet-phy@0 { 203 phy0: ethernet-phy@0 {
205 interrupt-parent = <&mpic>; 204 interrupts = <3 1 0 0>;
206 interrupts = <3 1>;
207 reg = <0x0>; 205 reg = <0x0>;
208 }; 206 };
209 phy1: ethernet-phy@1 { 207 phy1: ethernet-phy@1 {
210 interrupt-parent = <&mpic>; 208 interrupts = <3 1 0 0>;
211 interrupts = <3 1>;
212 reg = <0x1>; 209 reg = <0x1>;
213 }; 210 };
211 tbi-phy@2 {
212 device_type = "tbi-phy";
213 reg = <0x2>;
214 };
214 }; 215 };
215 216
216 mdio@25520 { 217 mdio@25520 {
@@ -224,11 +225,7 @@
224 status = "disabled"; 225 status = "disabled";
225 }; 226 };
226 227
227 ptp_clock@24E00 { 228 ptp_clock@24e00 {
228 compatible = "fsl,etsec-ptp";
229 reg = <0x24E00 0xB0>;
230 interrupts = <68 2 69 2 70 2>;
231 interrupt-parent = < &mpic >;
232 fsl,tclk-period = <5>; 229 fsl,tclk-period = <5>;
233 fsl,tmr-prsc = <200>; 230 fsl,tmr-prsc = <200>;
234 fsl,tmr-add = <0xCCCCCCCD>; 231 fsl,tmr-add = <0xCCCCCCCD>;
@@ -252,29 +249,18 @@
252 phy-handle = <&phy1>; 249 phy-handle = <&phy1>;
253 phy-connection-type = "rgmii-id"; 250 phy-connection-type = "rgmii-id";
254 }; 251 };
255
256 }; 252 };
257 253
258 pci0: pcie@ffe08000 { 254 pci0: pcie@ffe08000 {
255 reg = <0 0xffe08000 0 0x1000>;
259 status = "disabled"; 256 status = "disabled";
260 }; 257 };
261 258
262 pci1: pcie@ffe09000 { 259 pci1: pcie@ffe09000 {
260 reg = <0 0xffe09000 0 0x1000>;
263 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 261 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
264 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 262 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
265 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 263 pcie@0 {
266 interrupt-map = <
267 /* IDSEL 0x0 */
268 0000 0x0 0x0 0x1 &mpic 0x4 0x1
269 0000 0x0 0x0 0x2 &mpic 0x5 0x1
270 0000 0x0 0x0 0x3 &mpic 0x6 0x1
271 0000 0x0 0x0 0x4 &mpic 0x7 0x1
272 >;
273 pcie@0 {
274 reg = <0x0 0x0 0x0 0x0 0x0>;
275 #size-cells = <2>;
276 #address-cells = <3>;
277 device_type = "pci";
278 ranges = <0x2000000 0x0 0xa0000000 264 ranges = <0x2000000 0x0 0xa0000000
279 0x2000000 0x0 0xa0000000 265 0x2000000 0x0 0xa0000000
280 0x0 0x20000000 266 0x0 0x20000000
@@ -286,21 +272,10 @@
286 }; 272 };
287 273
288 pci2: pcie@ffe0a000 { 274 pci2: pcie@ffe0a000 {
275 reg = <0 0xffe0a000 0 0x1000>;
289 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 276 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
290 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 277 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
291 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
292 interrupt-map = <
293 /* IDSEL 0x0 */
294 0000 0x0 0x0 0x1 &mpic 0x0 0x1
295 0000 0x0 0x0 0x2 &mpic 0x1 0x1
296 0000 0x0 0x0 0x3 &mpic 0x2 0x1
297 0000 0x0 0x0 0x4 &mpic 0x3 0x1
298 >;
299 pcie@0 { 278 pcie@0 {
300 reg = <0x0 0x0 0x0 0x0 0x0>;
301 #size-cells = <2>;
302 #address-cells = <3>;
303 device_type = "pci";
304 ranges = <0x2000000 0x0 0x80000000 279 ranges = <0x2000000 0x0 0x80000000
305 0x2000000 0x0 0x80000000 280 0x2000000 0x0 0x80000000
306 0x0 0x20000000 281 0x0 0x20000000
@@ -311,3 +286,5 @@
311 }; 286 };
312 }; 287 };
313}; 288};
289
290/include/ "fsl/p2020si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p2020rdb_camp_core0.dts b/arch/powerpc/boot/dts/p2020rdb_camp_core0.dts
index fc8ddddfccb6..66aac864c4cc 100644
--- a/arch/powerpc/boot/dts/p2020rdb_camp_core0.dts
+++ b/arch/powerpc/boot/dts/p2020rdb_camp_core0.dts
@@ -14,28 +14,16 @@
14 * option) any later version. 14 * option) any later version.
15 */ 15 */
16 16
17/include/ "p2020si.dtsi" 17/include/ "p2020rdb.dts"
18 18
19/ { 19/ {
20 model = "fsl,P2020RDB"; 20 model = "fsl,P2020RDB";
21 compatible = "fsl,P2020RDB", "fsl,MPC85XXRDB-CAMP"; 21 compatible = "fsl,P2020RDB", "fsl,MPC85XXRDB-CAMP";
22 22
23 aliases {
24 ethernet1 = &enet1;
25 ethernet2 = &enet2;
26 serial0 = &serial0;
27 pci0 = &pci0;
28 };
29
30 cpus { 23 cpus {
31 PowerPC,P2020@1 { 24 PowerPC,P2020@1 {
32 status = "disabled"; 25 status = "disabled";
33 }; 26 };
34
35 };
36
37 memory {
38 device_type = "memory";
39 }; 27 };
40 28
41 localbus@ffe05000 { 29 localbus@ffe05000 {
@@ -43,115 +31,18 @@
43 }; 31 };
44 32
45 soc@ffe00000 { 33 soc@ffe00000 {
46 i2c@3000 {
47 rtc@68 {
48 compatible = "dallas,ds1339";
49 reg = <0x68>;
50 };
51 };
52
53 serial1: serial@4600 { 34 serial1: serial@4600 {
54 status = "disabled"; 35 status = "disabled";
55 }; 36 };
56 37
57 spi@7000 {
58
59 fsl_m25p80@0 {
60 #address-cells = <1>;
61 #size-cells = <1>;
62 compatible = "fsl,espi-flash";
63 reg = <0>;
64 linux,modalias = "fsl_m25p80";
65 modal = "s25sl128b";
66 spi-max-frequency = <50000000>;
67 mode = <0>;
68
69 partition@0 {
70 /* 512KB for u-boot Bootloader Image */
71 reg = <0x0 0x00080000>;
72 label = "SPI (RO) U-Boot Image";
73 read-only;
74 };
75
76 partition@80000 {
77 /* 512KB for DTB Image */
78 reg = <0x00080000 0x00080000>;
79 label = "SPI (RO) DTB Image";
80 read-only;
81 };
82
83 partition@100000 {
84 /* 4MB for Linux Kernel Image */
85 reg = <0x00100000 0x00400000>;
86 label = "SPI (RO) Linux Kernel Image";
87 read-only;
88 };
89
90 partition@500000 {
91 /* 4MB for Compressed RFS Image */
92 reg = <0x00500000 0x00400000>;
93 label = "SPI (RO) Compressed RFS Image";
94 read-only;
95 };
96
97 partition@900000 {
98 /* 7MB for JFFS2 based RFS */
99 reg = <0x00900000 0x00700000>;
100 label = "SPI (RW) JFFS2 RFS";
101 };
102 };
103 };
104
105 dma@c300 { 38 dma@c300 {
106 status = "disabled"; 39 status = "disabled";
107 }; 40 };
108 41
109 usb@22000 {
110 phy_type = "ulpi";
111 };
112
113 mdio@24520 {
114
115 phy0: ethernet-phy@0 {
116 interrupt-parent = <&mpic>;
117 interrupts = <3 1>;
118 reg = <0x0>;
119 };
120 phy1: ethernet-phy@1 {
121 interrupt-parent = <&mpic>;
122 interrupts = <3 1>;
123 reg = <0x1>;
124 };
125 };
126
127 mdio@25520 {
128 tbi0: tbi-phy@11 {
129 reg = <0x11>;
130 device_type = "tbi-phy";
131 };
132 };
133
134 mdio@26520 {
135 status = "disabled";
136 };
137
138 enet0: ethernet@24000 { 42 enet0: ethernet@24000 {
139 status = "disabled"; 43 status = "disabled";
140 }; 44 };
141 45
142 enet1: ethernet@25000 {
143 tbi-handle = <&tbi0>;
144 phy-handle = <&phy0>;
145 phy-connection-type = "sgmii";
146
147 };
148
149 enet2: ethernet@26000 {
150 phy-handle = <&phy1>;
151 phy-connection-type = "rgmii-id";
152 };
153
154
155 mpic: pic@40000 { 46 mpic: pic@40000 {
156 protected-sources = < 47 protected-sources = <
157 42 76 77 78 79 /* serial1 , dma2 */ 48 42 76 77 78 79 /* serial1 , dma2 */
@@ -164,40 +55,12 @@
164 msi@41600 { 55 msi@41600 {
165 status = "disabled"; 56 status = "disabled";
166 }; 57 };
167
168
169 }; 58 };
170 59
171 pci0: pcie@ffe08000 { 60 pci0: pcie@ffe08000 {
172 status = "disabled"; 61 status = "disabled";
173 }; 62 };
174 63
175 pci1: pcie@ffe09000 {
176 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
177 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
178 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
179 interrupt-map = <
180 /* IDSEL 0x0 */
181 0000 0x0 0x0 0x1 &mpic 0x4 0x1
182 0000 0x0 0x0 0x2 &mpic 0x5 0x1
183 0000 0x0 0x0 0x3 &mpic 0x6 0x1
184 0000 0x0 0x0 0x4 &mpic 0x7 0x1
185 >;
186 pcie@0 {
187 reg = <0x0 0x0 0x0 0x0 0x0>;
188 #size-cells = <2>;
189 #address-cells = <3>;
190 device_type = "pci";
191 ranges = <0x2000000 0x0 0xa0000000
192 0x2000000 0x0 0xa0000000
193 0x0 0x20000000
194
195 0x1000000 0x0 0x0
196 0x1000000 0x0 0x0
197 0x0 0x100000>;
198 };
199 };
200
201 pci2: pcie@ffe0a000 { 64 pci2: pcie@ffe0a000 {
202 status = "disabled"; 65 status = "disabled";
203 }; 66 };
diff --git a/arch/powerpc/boot/dts/p2020rdb_camp_core1.dts b/arch/powerpc/boot/dts/p2020rdb_camp_core1.dts
index 261c34ba45ec..9bd8ef493dd2 100644
--- a/arch/powerpc/boot/dts/p2020rdb_camp_core1.dts
+++ b/arch/powerpc/boot/dts/p2020rdb_camp_core1.dts
@@ -15,28 +15,18 @@
15 * option) any later version. 15 * option) any later version.
16 */ 16 */
17 17
18/include/ "p2020si.dtsi" 18/include/ "p2020rdb.dts"
19 19
20/ { 20/ {
21 model = "fsl,P2020RDB"; 21 model = "fsl,P2020RDB";
22 compatible = "fsl,P2020RDB", "fsl,MPC85XXRDB-CAMP"; 22 compatible = "fsl,P2020RDB", "fsl,MPC85XXRDB-CAMP";
23 23
24 aliases {
25 ethernet0 = &enet0;
26 serial0 = &serial1;
27 pci1 = &pci1;
28 };
29
30 cpus { 24 cpus {
31 PowerPC,P2020@0 { 25 PowerPC,P2020@0 {
32 status = "disabled"; 26 status = "disabled";
33 }; 27 };
34 }; 28 };
35 29
36 memory {
37 device_type = "memory";
38 };
39
40 localbus@ffe05000 { 30 localbus@ffe05000 {
41 status = "disabled"; 31 status = "disabled";
42 }; 32 };
@@ -70,55 +60,10 @@
70 status = "disabled"; 60 status = "disabled";
71 }; 61 };
72 62
73 dma@c300 {
74 #address-cells = <1>;
75 #size-cells = <1>;
76 compatible = "fsl,eloplus-dma";
77 reg = <0xc300 0x4>;
78 ranges = <0x0 0xc100 0x200>;
79 cell-index = <1>;
80 dma-channel@0 {
81 compatible = "fsl,eloplus-dma-channel";
82 reg = <0x0 0x80>;
83 cell-index = <0>;
84 interrupt-parent = <&mpic>;
85 interrupts = <76 2>;
86 };
87 dma-channel@80 {
88 compatible = "fsl,eloplus-dma-channel";
89 reg = <0x80 0x80>;
90 cell-index = <1>;
91 interrupt-parent = <&mpic>;
92 interrupts = <77 2>;
93 };
94 dma-channel@100 {
95 compatible = "fsl,eloplus-dma-channel";
96 reg = <0x100 0x80>;
97 cell-index = <2>;
98 interrupt-parent = <&mpic>;
99 interrupts = <78 2>;
100 };
101 dma-channel@180 {
102 compatible = "fsl,eloplus-dma-channel";
103 reg = <0x180 0x80>;
104 cell-index = <3>;
105 interrupt-parent = <&mpic>;
106 interrupts = <79 2>;
107 };
108 };
109
110 gpio: gpio-controller@f000 { 63 gpio: gpio-controller@f000 {
111 status = "disabled"; 64 status = "disabled";
112 }; 65 };
113 66
114 L2: l2-cache-controller@20000 {
115 compatible = "fsl,p2020-l2-cache-controller";
116 reg = <0x20000 0x1000>;
117 cache-line-size = <32>; // 32 bytes
118 cache-size = <0x80000>; // L2,512K
119 interrupt-parent = <&mpic>;
120 };
121
122 dma@21300 { 67 dma@21300 {
123 status = "disabled"; 68 status = "disabled";
124 }; 69 };
@@ -139,12 +84,6 @@
139 status = "disabled"; 84 status = "disabled";
140 }; 85 };
141 86
142 enet0: ethernet@24000 {
143 fixed-link = <1 1 1000 0 0>;
144 phy-connection-type = "rgmii-id";
145
146 };
147
148 enet1: ethernet@25000 { 87 enet1: ethernet@25000 {
149 status = "disabled"; 88 status = "disabled";
150 }; 89 };
@@ -170,22 +109,6 @@
170 >; 109 >;
171 }; 110 };
172 111
173 msi@41600 {
174 compatible = "fsl,p2020-msi", "fsl,mpic-msi";
175 reg = <0x41600 0x80>;
176 msi-available-ranges = <0 0x100>;
177 interrupts = <
178 0xe0 0
179 0xe1 0
180 0xe2 0
181 0xe3 0
182 0xe4 0
183 0xe5 0
184 0xe6 0
185 0xe7 0>;
186 interrupt-parent = <&mpic>;
187 };
188
189 global-utilities@e0000 { //global utilities block 112 global-utilities@e0000 { //global utilities block
190 status = "disabled"; 113 status = "disabled";
191 }; 114 };
@@ -199,30 +122,4 @@
199 pci1: pcie@ffe09000 { 122 pci1: pcie@ffe09000 {
200 status = "disabled"; 123 status = "disabled";
201 }; 124 };
202
203 pci2: pcie@ffe0a000 {
204 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
205 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
206 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
207 interrupt-map = <
208 /* IDSEL 0x0 */
209 0000 0x0 0x0 0x1 &mpic 0x0 0x1
210 0000 0x0 0x0 0x2 &mpic 0x1 0x1
211 0000 0x0 0x0 0x3 &mpic 0x2 0x1
212 0000 0x0 0x0 0x4 &mpic 0x3 0x1
213 >;
214 pcie@0 {
215 reg = <0x0 0x0 0x0 0x0 0x0>;
216 #size-cells = <2>;
217 #address-cells = <3>;
218 device_type = "pci";
219 ranges = <0x2000000 0x0 0x80000000
220 0x2000000 0x0 0x80000000
221 0x0 0x20000000
222
223 0x1000000 0x0 0x0
224 0x1000000 0x0 0x0
225 0x0 0x100000>;
226 };
227 };
228}; 125};
diff --git a/arch/powerpc/boot/dts/p2020si.dtsi b/arch/powerpc/boot/dts/p2020si.dtsi
deleted file mode 100644
index 6def17f265d3..000000000000
--- a/arch/powerpc/boot/dts/p2020si.dtsi
+++ /dev/null
@@ -1,382 +0,0 @@
1/*
2 * P2020 Device Tree Source
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/dts-v1/;
13/ {
14 compatible = "fsl,P2020";
15 #address-cells = <2>;
16 #size-cells = <2>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 PowerPC,P2020@0 {
23 device_type = "cpu";
24 reg = <0x0>;
25 next-level-cache = <&L2>;
26 };
27
28 PowerPC,P2020@1 {
29 device_type = "cpu";
30 reg = <0x1>;
31 next-level-cache = <&L2>;
32 };
33 };
34
35 localbus@ffe05000 {
36 #address-cells = <2>;
37 #size-cells = <1>;
38 compatible = "fsl,p2020-elbc", "fsl,elbc", "simple-bus";
39 reg = <0 0xffe05000 0 0x1000>;
40 interrupts = <19 2>;
41 interrupt-parent = <&mpic>;
42 };
43
44 soc@ffe00000 {
45 #address-cells = <1>;
46 #size-cells = <1>;
47 device_type = "soc";
48 compatible = "fsl,p2020-immr", "simple-bus";
49 ranges = <0x0 0x0 0xffe00000 0x100000>;
50 bus-frequency = <0>; // Filled out by uboot.
51
52 ecm-law@0 {
53 compatible = "fsl,ecm-law";
54 reg = <0x0 0x1000>;
55 fsl,num-laws = <12>;
56 };
57
58 ecm@1000 {
59 compatible = "fsl,p2020-ecm", "fsl,ecm";
60 reg = <0x1000 0x1000>;
61 interrupts = <17 2>;
62 interrupt-parent = <&mpic>;
63 };
64
65 memory-controller@2000 {
66 compatible = "fsl,p2020-memory-controller";
67 reg = <0x2000 0x1000>;
68 interrupt-parent = <&mpic>;
69 interrupts = <18 2>;
70 };
71
72 i2c@3000 {
73 #address-cells = <1>;
74 #size-cells = <0>;
75 cell-index = <0>;
76 compatible = "fsl-i2c";
77 reg = <0x3000 0x100>;
78 interrupts = <43 2>;
79 interrupt-parent = <&mpic>;
80 dfsrr;
81 };
82
83 i2c@3100 {
84 #address-cells = <1>;
85 #size-cells = <0>;
86 cell-index = <1>;
87 compatible = "fsl-i2c";
88 reg = <0x3100 0x100>;
89 interrupts = <43 2>;
90 interrupt-parent = <&mpic>;
91 dfsrr;
92 };
93
94 serial0: serial@4500 {
95 cell-index = <0>;
96 device_type = "serial";
97 compatible = "ns16550";
98 reg = <0x4500 0x100>;
99 clock-frequency = <0>;
100 interrupts = <42 2>;
101 interrupt-parent = <&mpic>;
102 };
103
104 serial1: serial@4600 {
105 cell-index = <1>;
106 device_type = "serial";
107 compatible = "ns16550";
108 reg = <0x4600 0x100>;
109 clock-frequency = <0>;
110 interrupts = <42 2>;
111 interrupt-parent = <&mpic>;
112 };
113
114 spi@7000 {
115 cell-index = <0>;
116 #address-cells = <1>;
117 #size-cells = <0>;
118 compatible = "fsl,espi";
119 reg = <0x7000 0x1000>;
120 interrupts = <59 0x2>;
121 interrupt-parent = <&mpic>;
122 mode = "cpu";
123 };
124
125 dma@c300 {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 compatible = "fsl,eloplus-dma";
129 reg = <0xc300 0x4>;
130 ranges = <0x0 0xc100 0x200>;
131 cell-index = <1>;
132 dma-channel@0 {
133 compatible = "fsl,eloplus-dma-channel";
134 reg = <0x0 0x80>;
135 cell-index = <0>;
136 interrupt-parent = <&mpic>;
137 interrupts = <76 2>;
138 };
139 dma-channel@80 {
140 compatible = "fsl,eloplus-dma-channel";
141 reg = <0x80 0x80>;
142 cell-index = <1>;
143 interrupt-parent = <&mpic>;
144 interrupts = <77 2>;
145 };
146 dma-channel@100 {
147 compatible = "fsl,eloplus-dma-channel";
148 reg = <0x100 0x80>;
149 cell-index = <2>;
150 interrupt-parent = <&mpic>;
151 interrupts = <78 2>;
152 };
153 dma-channel@180 {
154 compatible = "fsl,eloplus-dma-channel";
155 reg = <0x180 0x80>;
156 cell-index = <3>;
157 interrupt-parent = <&mpic>;
158 interrupts = <79 2>;
159 };
160 };
161
162 gpio: gpio-controller@f000 {
163 #gpio-cells = <2>;
164 compatible = "fsl,mpc8572-gpio";
165 reg = <0xf000 0x100>;
166 interrupts = <47 0x2>;
167 interrupt-parent = <&mpic>;
168 gpio-controller;
169 };
170
171 L2: l2-cache-controller@20000 {
172 compatible = "fsl,p2020-l2-cache-controller";
173 reg = <0x20000 0x1000>;
174 cache-line-size = <32>; // 32 bytes
175 cache-size = <0x80000>; // L2,512K
176 interrupt-parent = <&mpic>;
177 interrupts = <16 2>;
178 };
179
180 dma@21300 {
181 #address-cells = <1>;
182 #size-cells = <1>;
183 compatible = "fsl,eloplus-dma";
184 reg = <0x21300 0x4>;
185 ranges = <0x0 0x21100 0x200>;
186 cell-index = <0>;
187 dma-channel@0 {
188 compatible = "fsl,eloplus-dma-channel";
189 reg = <0x0 0x80>;
190 cell-index = <0>;
191 interrupt-parent = <&mpic>;
192 interrupts = <20 2>;
193 };
194 dma-channel@80 {
195 compatible = "fsl,eloplus-dma-channel";
196 reg = <0x80 0x80>;
197 cell-index = <1>;
198 interrupt-parent = <&mpic>;
199 interrupts = <21 2>;
200 };
201 dma-channel@100 {
202 compatible = "fsl,eloplus-dma-channel";
203 reg = <0x100 0x80>;
204 cell-index = <2>;
205 interrupt-parent = <&mpic>;
206 interrupts = <22 2>;
207 };
208 dma-channel@180 {
209 compatible = "fsl,eloplus-dma-channel";
210 reg = <0x180 0x80>;
211 cell-index = <3>;
212 interrupt-parent = <&mpic>;
213 interrupts = <23 2>;
214 };
215 };
216
217 usb@22000 {
218 #address-cells = <1>;
219 #size-cells = <0>;
220 compatible = "fsl-usb2-dr";
221 reg = <0x22000 0x1000>;
222 interrupt-parent = <&mpic>;
223 interrupts = <28 0x2>;
224 };
225
226 mdio@24520 {
227 #address-cells = <1>;
228 #size-cells = <0>;
229 compatible = "fsl,gianfar-mdio";
230 reg = <0x24520 0x20>;
231 };
232
233 mdio@25520 {
234 #address-cells = <1>;
235 #size-cells = <0>;
236 compatible = "fsl,gianfar-tbi";
237 reg = <0x26520 0x20>;
238 };
239
240 mdio@26520 {
241 #address-cells = <1>;
242 #size-cells = <0>;
243 compatible = "fsl,gianfar-tbi";
244 reg = <0x520 0x20>;
245 };
246
247 enet0: ethernet@24000 {
248 #address-cells = <1>;
249 #size-cells = <1>;
250 cell-index = <0>;
251 device_type = "network";
252 model = "eTSEC";
253 compatible = "gianfar";
254 reg = <0x24000 0x1000>;
255 ranges = <0x0 0x24000 0x1000>;
256 local-mac-address = [ 00 00 00 00 00 00 ];
257 interrupts = <29 2 30 2 34 2>;
258 interrupt-parent = <&mpic>;
259 };
260
261 enet1: ethernet@25000 {
262 #address-cells = <1>;
263 #size-cells = <1>;
264 cell-index = <1>;
265 device_type = "network";
266 model = "eTSEC";
267 compatible = "gianfar";
268 reg = <0x25000 0x1000>;
269 ranges = <0x0 0x25000 0x1000>;
270 local-mac-address = [ 00 00 00 00 00 00 ];
271 interrupts = <35 2 36 2 40 2>;
272 interrupt-parent = <&mpic>;
273
274 };
275
276 enet2: ethernet@26000 {
277 #address-cells = <1>;
278 #size-cells = <1>;
279 cell-index = <2>;
280 device_type = "network";
281 model = "eTSEC";
282 compatible = "gianfar";
283 reg = <0x26000 0x1000>;
284 ranges = <0x0 0x26000 0x1000>;
285 local-mac-address = [ 00 00 00 00 00 00 ];
286 interrupts = <31 2 32 2 33 2>;
287 interrupt-parent = <&mpic>;
288
289 };
290
291 sdhci@2e000 {
292 compatible = "fsl,p2020-esdhc", "fsl,esdhc";
293 reg = <0x2e000 0x1000>;
294 interrupts = <72 0x2>;
295 interrupt-parent = <&mpic>;
296 /* Filled in by U-Boot */
297 clock-frequency = <0>;
298 };
299
300 crypto@30000 {
301 compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
302 "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
303 reg = <0x30000 0x10000>;
304 interrupts = <45 2 58 2>;
305 interrupt-parent = <&mpic>;
306 fsl,num-channels = <4>;
307 fsl,channel-fifo-len = <24>;
308 fsl,exec-units-mask = <0xbfe>;
309 fsl,descriptor-types-mask = <0x3ab0ebf>;
310 };
311
312 mpic: pic@40000 {
313 interrupt-controller;
314 #address-cells = <0>;
315 #interrupt-cells = <2>;
316 reg = <0x40000 0x40000>;
317 compatible = "chrp,open-pic";
318 device_type = "open-pic";
319 };
320
321 msi@41600 {
322 compatible = "fsl,p2020-msi", "fsl,mpic-msi";
323 reg = <0x41600 0x80>;
324 msi-available-ranges = <0 0x100>;
325 interrupts = <
326 0xe0 0
327 0xe1 0
328 0xe2 0
329 0xe3 0
330 0xe4 0
331 0xe5 0
332 0xe6 0
333 0xe7 0>;
334 interrupt-parent = <&mpic>;
335 };
336
337 global-utilities@e0000 { //global utilities block
338 compatible = "fsl,p2020-guts";
339 reg = <0xe0000 0x1000>;
340 fsl,has-rstcr;
341 };
342 };
343
344 pci0: pcie@ffe08000 {
345 compatible = "fsl,mpc8548-pcie";
346 device_type = "pci";
347 #interrupt-cells = <1>;
348 #size-cells = <2>;
349 #address-cells = <3>;
350 reg = <0 0xffe08000 0 0x1000>;
351 bus-range = <0 255>;
352 clock-frequency = <33333333>;
353 interrupt-parent = <&mpic>;
354 interrupts = <24 2>;
355 };
356
357 pci1: pcie@ffe09000 {
358 compatible = "fsl,mpc8548-pcie";
359 device_type = "pci";
360 #interrupt-cells = <1>;
361 #size-cells = <2>;
362 #address-cells = <3>;
363 reg = <0 0xffe09000 0 0x1000>;
364 bus-range = <0 255>;
365 clock-frequency = <33333333>;
366 interrupt-parent = <&mpic>;
367 interrupts = <25 2>;
368 };
369
370 pci2: pcie@ffe0a000 {
371 compatible = "fsl,mpc8548-pcie";
372 device_type = "pci";
373 #interrupt-cells = <1>;
374 #size-cells = <2>;
375 #address-cells = <3>;
376 reg = <0 0xffe0a000 0 0x1000>;
377 bus-range = <0 255>;
378 clock-frequency = <33333333>;
379 interrupt-parent = <&mpic>;
380 interrupts = <26 2>;
381 };
382};
diff --git a/arch/powerpc/boot/dts/p2041rdb.dts b/arch/powerpc/boot/dts/p2041rdb.dts
index 79b6895027c0..4f957db01230 100644
--- a/arch/powerpc/boot/dts/p2041rdb.dts
+++ b/arch/powerpc/boot/dts/p2041rdb.dts
@@ -32,7 +32,7 @@
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35/include/ "p2041si.dtsi" 35/include/ "fsl/p2041si-pre.dtsi"
36 36
37/ { 37/ {
38 model = "fsl,P2041RDB"; 38 model = "fsl,P2041RDB";
@@ -50,6 +50,8 @@
50 }; 50 };
51 51
52 soc: soc@ffe000000 { 52 soc: soc@ffe000000 {
53 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
54 reg = <0xf 0xfe000000 0 0x00001000>;
53 spi@110000 { 55 spi@110000 {
54 flash@0 { 56 flash@0 {
55 #address-cells = <1>; 57 #address-cells = <1>;
@@ -106,7 +108,18 @@
106 }; 108 };
107 }; 109 };
108 110
109 localbus@ffe124000 { 111 rio: rapidio@ffe0c0000 {
112 reg = <0xf 0xfe0c0000 0 0x11000>;
113
114 port1 {
115 ranges = <0 0 0xc 0x20000000 0 0x10000000>;
116 };
117 port2 {
118 ranges = <0 0 0xc 0x30000000 0 0x10000000>;
119 };
120 };
121
122 lbc: localbus@ffe124000 {
110 reg = <0xf 0xfe124000 0 0x1000>; 123 reg = <0xf 0xfe124000 0 0x1000>;
111 ranges = <0 0 0xf 0xe8000000 0x08000000>; 124 ranges = <0 0 0xf 0xe8000000 0x08000000>;
112 125
@@ -122,6 +135,7 @@
122 reg = <0xf 0xfe200000 0 0x1000>; 135 reg = <0xf 0xfe200000 0 0x1000>;
123 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 136 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000
124 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 137 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;
138 fsl,msi = <&msi0>;
125 pcie@0 { 139 pcie@0 {
126 ranges = <0x02000000 0 0xe0000000 140 ranges = <0x02000000 0 0xe0000000
127 0x02000000 0 0xe0000000 141 0x02000000 0 0xe0000000
@@ -137,6 +151,7 @@
137 reg = <0xf 0xfe201000 0 0x1000>; 151 reg = <0xf 0xfe201000 0 0x1000>;
138 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 152 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
139 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 153 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>;
154 fsl,msi = <&msi1>;
140 pcie@0 { 155 pcie@0 {
141 ranges = <0x02000000 0 0xe0000000 156 ranges = <0x02000000 0 0xe0000000
142 0x02000000 0 0xe0000000 157 0x02000000 0 0xe0000000
@@ -152,6 +167,7 @@
152 reg = <0xf 0xfe202000 0 0x1000>; 167 reg = <0xf 0xfe202000 0 0x1000>;
153 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 168 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000
154 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; 169 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;
170 fsl,msi = <&msi2>;
155 pcie@0 { 171 pcie@0 {
156 ranges = <0x02000000 0 0xe0000000 172 ranges = <0x02000000 0 0xe0000000
157 0x02000000 0 0xe0000000 173 0x02000000 0 0xe0000000
@@ -163,3 +179,5 @@
163 }; 179 };
164 }; 180 };
165}; 181};
182
183/include/ "fsl/p2041si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p2041si.dtsi b/arch/powerpc/boot/dts/p2041si.dtsi
deleted file mode 100644
index f7492edd0dfd..000000000000
--- a/arch/powerpc/boot/dts/p2041si.dtsi
+++ /dev/null
@@ -1,692 +0,0 @@
1/*
2 * P2041 Silicon Device Tree Source
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36
37/ {
38 compatible = "fsl,P2041";
39 #address-cells = <2>;
40 #size-cells = <2>;
41 interrupt-parent = <&mpic>;
42
43 aliases {
44 ccsr = &soc;
45 dcsr = &dcsr;
46
47 serial0 = &serial0;
48 serial1 = &serial1;
49 serial2 = &serial2;
50 serial3 = &serial3;
51 pci0 = &pci0;
52 pci1 = &pci1;
53 pci2 = &pci2;
54 usb0 = &usb0;
55 usb1 = &usb1;
56 dma0 = &dma0;
57 dma1 = &dma1;
58 sdhc = &sdhc;
59 msi0 = &msi0;
60 msi1 = &msi1;
61 msi2 = &msi2;
62
63 crypto = &crypto;
64 sec_jr0 = &sec_jr0;
65 sec_jr1 = &sec_jr1;
66 sec_jr2 = &sec_jr2;
67 sec_jr3 = &sec_jr3;
68 rtic_a = &rtic_a;
69 rtic_b = &rtic_b;
70 rtic_c = &rtic_c;
71 rtic_d = &rtic_d;
72 sec_mon = &sec_mon;
73 };
74
75 cpus {
76 #address-cells = <1>;
77 #size-cells = <0>;
78
79 cpu0: PowerPC,e500mc@0 {
80 device_type = "cpu";
81 reg = <0>;
82 next-level-cache = <&L2_0>;
83 L2_0: l2-cache {
84 next-level-cache = <&cpc>;
85 };
86 };
87 cpu1: PowerPC,e500mc@1 {
88 device_type = "cpu";
89 reg = <1>;
90 next-level-cache = <&L2_1>;
91 L2_1: l2-cache {
92 next-level-cache = <&cpc>;
93 };
94 };
95 cpu2: PowerPC,e500mc@2 {
96 device_type = "cpu";
97 reg = <2>;
98 next-level-cache = <&L2_2>;
99 L2_2: l2-cache {
100 next-level-cache = <&cpc>;
101 };
102 };
103 cpu3: PowerPC,e500mc@3 {
104 device_type = "cpu";
105 reg = <3>;
106 next-level-cache = <&L2_3>;
107 L2_3: l2-cache {
108 next-level-cache = <&cpc>;
109 };
110 };
111 };
112
113 dcsr: dcsr@f00000000 {
114 #address-cells = <1>;
115 #size-cells = <1>;
116 compatible = "fsl,dcsr", "simple-bus";
117
118 dcsr-epu@0 {
119 compatible = "fsl,dcsr-epu";
120 interrupts = <52 2 0 0
121 84 2 0 0
122 85 2 0 0>;
123 interrupt-parent = <&mpic>;
124 reg = <0x0 0x1000>;
125 };
126 dcsr-npc {
127 compatible = "fsl,dcsr-npc";
128 reg = <0x1000 0x1000 0x1000000 0x8000>;
129 };
130 dcsr-nxc@2000 {
131 compatible = "fsl,dcsr-nxc";
132 reg = <0x2000 0x1000>;
133 };
134 dcsr-corenet {
135 compatible = "fsl,dcsr-corenet";
136 reg = <0x8000 0x1000 0xB0000 0x1000>;
137 };
138 dcsr-dpaa@9000 {
139 compatible = "fsl,p2041-dcsr-dpaa", "fsl,dcsr-dpaa";
140 reg = <0x9000 0x1000>;
141 };
142 dcsr-ocn@11000 {
143 compatible = "fsl,p2041-dcsr-ocn", "fsl,dcsr-ocn";
144 reg = <0x11000 0x1000>;
145 };
146 dcsr-ddr@12000 {
147 compatible = "fsl,dcsr-ddr";
148 dev-handle = <&ddr>;
149 reg = <0x12000 0x1000>;
150 };
151 dcsr-nal@18000 {
152 compatible = "fsl,p2041-dcsr-nal", "fsl,dcsr-nal";
153 reg = <0x18000 0x1000>;
154 };
155 dcsr-rcpm@22000 {
156 compatible = "fsl,p2041-dcsr-rcpm", "fsl,dcsr-rcpm";
157 reg = <0x22000 0x1000>;
158 };
159 dcsr-cpu-sb-proxy@40000 {
160 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
161 cpu-handle = <&cpu0>;
162 reg = <0x40000 0x1000>;
163 };
164 dcsr-cpu-sb-proxy@41000 {
165 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
166 cpu-handle = <&cpu1>;
167 reg = <0x41000 0x1000>;
168 };
169 dcsr-cpu-sb-proxy@42000 {
170 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
171 cpu-handle = <&cpu2>;
172 reg = <0x42000 0x1000>;
173 };
174 dcsr-cpu-sb-proxy@43000 {
175 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
176 cpu-handle = <&cpu3>;
177 reg = <0x43000 0x1000>;
178 };
179 };
180
181 soc: soc@ffe000000 {
182 #address-cells = <1>;
183 #size-cells = <1>;
184 device_type = "soc";
185 compatible = "simple-bus";
186 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
187 reg = <0xf 0xfe000000 0 0x00001000>;
188
189 soc-sram-error {
190 compatible = "fsl,soc-sram-error";
191 interrupts = <16 2 1 29>;
192 };
193
194 corenet-law@0 {
195 compatible = "fsl,corenet-law";
196 reg = <0x0 0x1000>;
197 fsl,num-laws = <32>;
198 };
199
200 ddr: memory-controller@8000 {
201 compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
202 reg = <0x8000 0x1000>;
203 interrupts = <16 2 1 23>;
204 };
205
206 cpc: l3-cache-controller@10000 {
207 compatible = "fsl,p2041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache";
208 reg = <0x10000 0x1000>;
209 interrupts = <16 2 1 27>;
210 };
211
212 corenet-cf@18000 {
213 compatible = "fsl,corenet-cf";
214 reg = <0x18000 0x1000>;
215 interrupts = <16 2 1 31>;
216 fsl,ccf-num-csdids = <32>;
217 fsl,ccf-num-snoopids = <32>;
218 };
219
220 iommu@20000 {
221 compatible = "fsl,pamu-v1.0", "fsl,pamu";
222 reg = <0x20000 0x4000>;
223 interrupts = <
224 24 2 0 0
225 16 2 1 30>;
226 };
227
228 mpic: pic@40000 {
229 clock-frequency = <0>;
230 interrupt-controller;
231 #address-cells = <0>;
232 #interrupt-cells = <4>;
233 reg = <0x40000 0x40000>;
234 compatible = "fsl,mpic", "chrp,open-pic";
235 device_type = "open-pic";
236 };
237
238 msi0: msi@41600 {
239 compatible = "fsl,mpic-msi";
240 reg = <0x41600 0x200>;
241 msi-available-ranges = <0 0x100>;
242 interrupts = <
243 0xe0 0 0 0
244 0xe1 0 0 0
245 0xe2 0 0 0
246 0xe3 0 0 0
247 0xe4 0 0 0
248 0xe5 0 0 0
249 0xe6 0 0 0
250 0xe7 0 0 0>;
251 };
252
253 msi1: msi@41800 {
254 compatible = "fsl,mpic-msi";
255 reg = <0x41800 0x200>;
256 msi-available-ranges = <0 0x100>;
257 interrupts = <
258 0xe8 0 0 0
259 0xe9 0 0 0
260 0xea 0 0 0
261 0xeb 0 0 0
262 0xec 0 0 0
263 0xed 0 0 0
264 0xee 0 0 0
265 0xef 0 0 0>;
266 };
267
268 msi2: msi@41a00 {
269 compatible = "fsl,mpic-msi";
270 reg = <0x41a00 0x200>;
271 msi-available-ranges = <0 0x100>;
272 interrupts = <
273 0xf0 0 0 0
274 0xf1 0 0 0
275 0xf2 0 0 0
276 0xf3 0 0 0
277 0xf4 0 0 0
278 0xf5 0 0 0
279 0xf6 0 0 0
280 0xf7 0 0 0>;
281 };
282
283 guts: global-utilities@e0000 {
284 compatible = "fsl,qoriq-device-config-1.0";
285 reg = <0xe0000 0xe00>;
286 fsl,has-rstcr;
287 #sleep-cells = <1>;
288 fsl,liodn-bits = <12>;
289 };
290
291 pins: global-utilities@e0e00 {
292 compatible = "fsl,qoriq-pin-control-1.0";
293 reg = <0xe0e00 0x200>;
294 #sleep-cells = <2>;
295 };
296
297 clockgen: global-utilities@e1000 {
298 compatible = "fsl,p2041-clockgen", "fsl,qoriq-clockgen-1.0";
299 reg = <0xe1000 0x1000>;
300 clock-frequency = <0>;
301 };
302
303 rcpm: global-utilities@e2000 {
304 compatible = "fsl,qoriq-rcpm-1.0";
305 reg = <0xe2000 0x1000>;
306 #sleep-cells = <1>;
307 };
308
309 sfp: sfp@e8000 {
310 compatible = "fsl,p2041-sfp", "fsl,qoriq-sfp-1.0";
311 reg = <0xe8000 0x1000>;
312 };
313
314 serdes: serdes@ea000 {
315 compatible = "fsl,p2041-serdes";
316 reg = <0xea000 0x1000>;
317 };
318
319 dma0: dma@100300 {
320 #address-cells = <1>;
321 #size-cells = <1>;
322 compatible = "fsl,p2041-dma", "fsl,eloplus-dma";
323 reg = <0x100300 0x4>;
324 ranges = <0x0 0x100100 0x200>;
325 cell-index = <0>;
326 dma-channel@0 {
327 compatible = "fsl,p2041-dma-channel",
328 "fsl,eloplus-dma-channel";
329 reg = <0x0 0x80>;
330 cell-index = <0>;
331 interrupts = <28 2 0 0>;
332 };
333 dma-channel@80 {
334 compatible = "fsl,p2041-dma-channel",
335 "fsl,eloplus-dma-channel";
336 reg = <0x80 0x80>;
337 cell-index = <1>;
338 interrupts = <29 2 0 0>;
339 };
340 dma-channel@100 {
341 compatible = "fsl,p2041-dma-channel",
342 "fsl,eloplus-dma-channel";
343 reg = <0x100 0x80>;
344 cell-index = <2>;
345 interrupts = <30 2 0 0>;
346 };
347 dma-channel@180 {
348 compatible = "fsl,p2041-dma-channel",
349 "fsl,eloplus-dma-channel";
350 reg = <0x180 0x80>;
351 cell-index = <3>;
352 interrupts = <31 2 0 0>;
353 };
354 };
355
356 dma1: dma@101300 {
357 #address-cells = <1>;
358 #size-cells = <1>;
359 compatible = "fsl,p2041-dma", "fsl,eloplus-dma";
360 reg = <0x101300 0x4>;
361 ranges = <0x0 0x101100 0x200>;
362 cell-index = <1>;
363 dma-channel@0 {
364 compatible = "fsl,p2041-dma-channel",
365 "fsl,eloplus-dma-channel";
366 reg = <0x0 0x80>;
367 cell-index = <0>;
368 interrupts = <32 2 0 0>;
369 };
370 dma-channel@80 {
371 compatible = "fsl,p2041-dma-channel",
372 "fsl,eloplus-dma-channel";
373 reg = <0x80 0x80>;
374 cell-index = <1>;
375 interrupts = <33 2 0 0>;
376 };
377 dma-channel@100 {
378 compatible = "fsl,p2041-dma-channel",
379 "fsl,eloplus-dma-channel";
380 reg = <0x100 0x80>;
381 cell-index = <2>;
382 interrupts = <34 2 0 0>;
383 };
384 dma-channel@180 {
385 compatible = "fsl,p2041-dma-channel",
386 "fsl,eloplus-dma-channel";
387 reg = <0x180 0x80>;
388 cell-index = <3>;
389 interrupts = <35 2 0 0>;
390 };
391 };
392
393 spi@110000 {
394 #address-cells = <1>;
395 #size-cells = <0>;
396 compatible = "fsl,p2041-espi", "fsl,mpc8536-espi";
397 reg = <0x110000 0x1000>;
398 interrupts = <53 0x2 0 0>;
399 fsl,espi-num-chipselects = <4>;
400 };
401
402 sdhc: sdhc@114000 {
403 compatible = "fsl,p2041-esdhc", "fsl,esdhc";
404 reg = <0x114000 0x1000>;
405 interrupts = <48 2 0 0>;
406 sdhci,auto-cmd12;
407 clock-frequency = <0>;
408 };
409
410 i2c@118000 {
411 #address-cells = <1>;
412 #size-cells = <0>;
413 cell-index = <0>;
414 compatible = "fsl-i2c";
415 reg = <0x118000 0x100>;
416 interrupts = <38 2 0 0>;
417 dfsrr;
418 };
419
420 i2c@118100 {
421 #address-cells = <1>;
422 #size-cells = <0>;
423 cell-index = <1>;
424 compatible = "fsl-i2c";
425 reg = <0x118100 0x100>;
426 interrupts = <38 2 0 0>;
427 dfsrr;
428 };
429
430 i2c@119000 {
431 #address-cells = <1>;
432 #size-cells = <0>;
433 cell-index = <2>;
434 compatible = "fsl-i2c";
435 reg = <0x119000 0x100>;
436 interrupts = <39 2 0 0>;
437 dfsrr;
438 };
439
440 i2c@119100 {
441 #address-cells = <1>;
442 #size-cells = <0>;
443 cell-index = <3>;
444 compatible = "fsl-i2c";
445 reg = <0x119100 0x100>;
446 interrupts = <39 2 0 0>;
447 dfsrr;
448 };
449
450 serial0: serial@11c500 {
451 cell-index = <0>;
452 device_type = "serial";
453 compatible = "ns16550";
454 reg = <0x11c500 0x100>;
455 clock-frequency = <0>;
456 interrupts = <36 2 0 0>;
457 };
458
459 serial1: serial@11c600 {
460 cell-index = <1>;
461 device_type = "serial";
462 compatible = "ns16550";
463 reg = <0x11c600 0x100>;
464 clock-frequency = <0>;
465 interrupts = <36 2 0 0>;
466 };
467
468 serial2: serial@11d500 {
469 cell-index = <2>;
470 device_type = "serial";
471 compatible = "ns16550";
472 reg = <0x11d500 0x100>;
473 clock-frequency = <0>;
474 interrupts = <37 2 0 0>;
475 };
476
477 serial3: serial@11d600 {
478 cell-index = <3>;
479 device_type = "serial";
480 compatible = "ns16550";
481 reg = <0x11d600 0x100>;
482 clock-frequency = <0>;
483 interrupts = <37 2 0 0>;
484 };
485
486 gpio0: gpio@130000 {
487 compatible = "fsl,p2041-gpio", "fsl,qoriq-gpio";
488 reg = <0x130000 0x1000>;
489 interrupts = <55 2 0 0>;
490 #gpio-cells = <2>;
491 gpio-controller;
492 };
493
494 usb0: usb@210000 {
495 compatible = "fsl,p2041-usb2-mph",
496 "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph";
497 reg = <0x210000 0x1000>;
498 #address-cells = <1>;
499 #size-cells = <0>;
500 interrupts = <44 0x2 0 0>;
501 phy_type = "utmi";
502 port0;
503 };
504
505 usb1: usb@211000 {
506 compatible = "fsl,p2041-usb2-dr",
507 "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr";
508 reg = <0x211000 0x1000>;
509 #address-cells = <1>;
510 #size-cells = <0>;
511 interrupts = <45 0x2 0 0>;
512 phy_type = "utmi";
513 };
514
515 sata@220000 {
516 compatible = "fsl,p2041-sata", "fsl,pq-sata-v2";
517 reg = <0x220000 0x1000>;
518 interrupts = <68 0x2 0 0>;
519 };
520
521 sata@221000 {
522 compatible = "fsl,p2041-sata", "fsl,pq-sata-v2";
523 reg = <0x221000 0x1000>;
524 interrupts = <69 0x2 0 0>;
525 };
526
527 crypto: crypto@300000 {
528 compatible = "fsl,sec-v4.2", "fsl,sec-v4.0";
529 #address-cells = <1>;
530 #size-cells = <1>;
531 reg = <0x300000 0x10000>;
532 ranges = <0 0x300000 0x10000>;
533 interrupts = <92 2 0 0>;
534
535 sec_jr0: jr@1000 {
536 compatible = "fsl,sec-v4.2-job-ring",
537 "fsl,sec-v4.0-job-ring";
538 reg = <0x1000 0x1000>;
539 interrupts = <88 2 0 0>;
540 };
541
542 sec_jr1: jr@2000 {
543 compatible = "fsl,sec-v4.2-job-ring",
544 "fsl,sec-v4.0-job-ring";
545 reg = <0x2000 0x1000>;
546 interrupts = <89 2 0 0>;
547 };
548
549 sec_jr2: jr@3000 {
550 compatible = "fsl,sec-v4.2-job-ring",
551 "fsl,sec-v4.0-job-ring";
552 reg = <0x3000 0x1000>;
553 interrupts = <90 2 0 0>;
554 };
555
556 sec_jr3: jr@4000 {
557 compatible = "fsl,sec-v4.2-job-ring",
558 "fsl,sec-v4.0-job-ring";
559 reg = <0x4000 0x1000>;
560 interrupts = <91 2 0 0>;
561 };
562
563 rtic@6000 {
564 compatible = "fsl,sec-v4.2-rtic",
565 "fsl,sec-v4.0-rtic";
566 #address-cells = <1>;
567 #size-cells = <1>;
568 reg = <0x6000 0x100>;
569 ranges = <0x0 0x6100 0xe00>;
570
571 rtic_a: rtic-a@0 {
572 compatible = "fsl,sec-v4.2-rtic-memory",
573 "fsl,sec-v4.0-rtic-memory";
574 reg = <0x00 0x20 0x100 0x80>;
575 };
576
577 rtic_b: rtic-b@20 {
578 compatible = "fsl,sec-v4.2-rtic-memory",
579 "fsl,sec-v4.0-rtic-memory";
580 reg = <0x20 0x20 0x200 0x80>;
581 };
582
583 rtic_c: rtic-c@40 {
584 compatible = "fsl,sec-v4.2-rtic-memory",
585 "fsl,sec-v4.0-rtic-memory";
586 reg = <0x40 0x20 0x300 0x80>;
587 };
588
589 rtic_d: rtic-d@60 {
590 compatible = "fsl,sec-v4.2-rtic-memory",
591 "fsl,sec-v4.0-rtic-memory";
592 reg = <0x60 0x20 0x500 0x80>;
593 };
594 };
595 };
596
597 sec_mon: sec_mon@314000 {
598 compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon";
599 reg = <0x314000 0x1000>;
600 interrupts = <93 2 0 0>;
601 };
602
603 };
604
605 localbus@ffe124000 {
606 compatible = "fsl,p2041-elbc", "fsl,elbc", "simple-bus";
607 interrupts = <25 2 0 0>;
608 #address-cells = <2>;
609 #size-cells = <1>;
610 };
611
612 pci0: pcie@ffe200000 {
613 compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";
614 device_type = "pci";
615 #size-cells = <2>;
616 #address-cells = <3>;
617 bus-range = <0x0 0xff>;
618 clock-frequency = <33333333>;
619 fsl,msi = <&msi0>;
620 interrupts = <16 2 1 15>;
621 pcie@0 {
622 reg = <0 0 0 0 0>;
623 #interrupt-cells = <1>;
624 #size-cells = <2>;
625 #address-cells = <3>;
626 device_type = "pci";
627 interrupts = <16 2 1 15>;
628 interrupt-map-mask = <0xf800 0 0 7>;
629 interrupt-map = <
630 /* IDSEL 0x0 */
631 0000 0 0 1 &mpic 40 1 0 0
632 0000 0 0 2 &mpic 1 1 0 0
633 0000 0 0 3 &mpic 2 1 0 0
634 0000 0 0 4 &mpic 3 1 0 0
635 >;
636 };
637 };
638
639 pci1: pcie@ffe201000 {
640 compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";
641 device_type = "pci";
642 #size-cells = <2>;
643 #address-cells = <3>;
644 bus-range = <0 0xff>;
645 clock-frequency = <33333333>;
646 fsl,msi = <&msi1>;
647 interrupts = <16 2 1 14>;
648 pcie@0 {
649 reg = <0 0 0 0 0>;
650 #interrupt-cells = <1>;
651 #size-cells = <2>;
652 #address-cells = <3>;
653 device_type = "pci";
654 interrupts = <16 2 1 14>;
655 interrupt-map-mask = <0xf800 0 0 7>;
656 interrupt-map = <
657 /* IDSEL 0x0 */
658 0000 0 0 1 &mpic 41 1 0 0
659 0000 0 0 2 &mpic 5 1 0 0
660 0000 0 0 3 &mpic 6 1 0 0
661 0000 0 0 4 &mpic 7 1 0 0
662 >;
663 };
664 };
665
666 pci2: pcie@ffe202000 {
667 compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";
668 device_type = "pci";
669 #size-cells = <2>;
670 #address-cells = <3>;
671 bus-range = <0x0 0xff>;
672 clock-frequency = <33333333>;
673 fsl,msi = <&msi2>;
674 interrupts = <16 2 1 13>;
675 pcie@0 {
676 reg = <0 0 0 0 0>;
677 #interrupt-cells = <1>;
678 #size-cells = <2>;
679 #address-cells = <3>;
680 device_type = "pci";
681 interrupts = <16 2 1 13>;
682 interrupt-map-mask = <0xf800 0 0 7>;
683 interrupt-map = <
684 /* IDSEL 0x0 */
685 0000 0 0 1 &mpic 42 1 0 0
686 0000 0 0 2 &mpic 9 1 0 0
687 0000 0 0 3 &mpic 10 1 0 0
688 0000 0 0 4 &mpic 11 1 0 0
689 >;
690 };
691 };
692};
diff --git a/arch/powerpc/boot/dts/p3041ds.dts b/arch/powerpc/boot/dts/p3041ds.dts
index bbd113b49a8f..f469145abaeb 100644
--- a/arch/powerpc/boot/dts/p3041ds.dts
+++ b/arch/powerpc/boot/dts/p3041ds.dts
@@ -32,7 +32,7 @@
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35/include/ "p3041si.dtsi" 35/include/ "fsl/p3041si-pre.dtsi"
36 36
37/ { 37/ {
38 model = "fsl,P3041DS"; 38 model = "fsl,P3041DS";
@@ -50,6 +50,8 @@
50 }; 50 };
51 51
52 soc: soc@ffe000000 { 52 soc: soc@ffe000000 {
53 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
54 reg = <0xf 0xfe000000 0 0x00001000>;
53 spi@110000 { 55 spi@110000 {
54 flash@0 { 56 flash@0 {
55 #address-cells = <1>; 57 #address-cells = <1>;
@@ -99,7 +101,18 @@
99 }; 101 };
100 }; 102 };
101 103
102 localbus@ffe124000 { 104 rio: rapidio@ffe0c0000 {
105 reg = <0xf 0xfe0c0000 0 0x11000>;
106
107 port1 {
108 ranges = <0 0 0xc 0x20000000 0 0x10000000>;
109 };
110 port2 {
111 ranges = <0 0 0xc 0x30000000 0 0x10000000>;
112 };
113 };
114
115 lbc: localbus@ffe124000 {
103 reg = <0xf 0xfe124000 0 0x1000>; 116 reg = <0xf 0xfe124000 0 0x1000>;
104 ranges = <0 0 0xf 0xe8000000 0x08000000 117 ranges = <0 0 0xf 0xe8000000 0x08000000
105 2 0 0xf 0xffa00000 0x00040000 118 2 0 0xf 0xffa00000 0x00040000
@@ -160,6 +173,7 @@
160 reg = <0xf 0xfe200000 0 0x1000>; 173 reg = <0xf 0xfe200000 0 0x1000>;
161 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 174 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000
162 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 175 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;
176 fsl,msi = <&msi0>;
163 pcie@0 { 177 pcie@0 {
164 ranges = <0x02000000 0 0xe0000000 178 ranges = <0x02000000 0 0xe0000000
165 0x02000000 0 0xe0000000 179 0x02000000 0 0xe0000000
@@ -175,6 +189,7 @@
175 reg = <0xf 0xfe201000 0 0x1000>; 189 reg = <0xf 0xfe201000 0 0x1000>;
176 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 190 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
177 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 191 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>;
192 fsl,msi = <&msi1>;
178 pcie@0 { 193 pcie@0 {
179 ranges = <0x02000000 0 0xe0000000 194 ranges = <0x02000000 0 0xe0000000
180 0x02000000 0 0xe0000000 195 0x02000000 0 0xe0000000
@@ -190,6 +205,7 @@
190 reg = <0xf 0xfe202000 0 0x1000>; 205 reg = <0xf 0xfe202000 0 0x1000>;
191 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 206 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000
192 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; 207 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;
208 fsl,msi = <&msi2>;
193 pcie@0 { 209 pcie@0 {
194 ranges = <0x02000000 0 0xe0000000 210 ranges = <0x02000000 0 0xe0000000
195 0x02000000 0 0xe0000000 211 0x02000000 0 0xe0000000
@@ -205,6 +221,7 @@
205 reg = <0xf 0xfe203000 0 0x1000>; 221 reg = <0xf 0xfe203000 0 0x1000>;
206 ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000 222 ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000
207 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; 223 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>;
224 fsl,msi = <&msi2>;
208 pcie@0 { 225 pcie@0 {
209 ranges = <0x02000000 0 0xe0000000 226 ranges = <0x02000000 0 0xe0000000
210 0x02000000 0 0xe0000000 227 0x02000000 0 0xe0000000
@@ -216,3 +233,5 @@
216 }; 233 };
217 }; 234 };
218}; 235};
236
237/include/ "fsl/p3041si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p3041si.dtsi b/arch/powerpc/boot/dts/p3041si.dtsi
deleted file mode 100644
index 87130b732bc7..000000000000
--- a/arch/powerpc/boot/dts/p3041si.dtsi
+++ /dev/null
@@ -1,729 +0,0 @@
1/*
2 * P3041 Silicon Device Tree Source
3 *
4 * Copyright 2010-2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36
37/ {
38 compatible = "fsl,P3041";
39 #address-cells = <2>;
40 #size-cells = <2>;
41 interrupt-parent = <&mpic>;
42
43 aliases {
44 ccsr = &soc;
45 dcsr = &dcsr;
46
47 serial0 = &serial0;
48 serial1 = &serial1;
49 serial2 = &serial2;
50 serial3 = &serial3;
51 pci0 = &pci0;
52 pci1 = &pci1;
53 pci2 = &pci2;
54 pci3 = &pci3;
55 usb0 = &usb0;
56 usb1 = &usb1;
57 dma0 = &dma0;
58 dma1 = &dma1;
59 sdhc = &sdhc;
60 msi0 = &msi0;
61 msi1 = &msi1;
62 msi2 = &msi2;
63
64 crypto = &crypto;
65 sec_jr0 = &sec_jr0;
66 sec_jr1 = &sec_jr1;
67 sec_jr2 = &sec_jr2;
68 sec_jr3 = &sec_jr3;
69 rtic_a = &rtic_a;
70 rtic_b = &rtic_b;
71 rtic_c = &rtic_c;
72 rtic_d = &rtic_d;
73 sec_mon = &sec_mon;
74
75/*
76 rio0 = &rapidio0;
77 */
78 };
79
80 cpus {
81 #address-cells = <1>;
82 #size-cells = <0>;
83
84 cpu0: PowerPC,e500mc@0 {
85 device_type = "cpu";
86 reg = <0>;
87 next-level-cache = <&L2_0>;
88 L2_0: l2-cache {
89 next-level-cache = <&cpc>;
90 };
91 };
92 cpu1: PowerPC,e500mc@1 {
93 device_type = "cpu";
94 reg = <1>;
95 next-level-cache = <&L2_1>;
96 L2_1: l2-cache {
97 next-level-cache = <&cpc>;
98 };
99 };
100 cpu2: PowerPC,e500mc@2 {
101 device_type = "cpu";
102 reg = <2>;
103 next-level-cache = <&L2_2>;
104 L2_2: l2-cache {
105 next-level-cache = <&cpc>;
106 };
107 };
108 cpu3: PowerPC,e500mc@3 {
109 device_type = "cpu";
110 reg = <3>;
111 next-level-cache = <&L2_3>;
112 L2_3: l2-cache {
113 next-level-cache = <&cpc>;
114 };
115 };
116 };
117
118 dcsr: dcsr@f00000000 {
119 #address-cells = <1>;
120 #size-cells = <1>;
121 compatible = "fsl,dcsr", "simple-bus";
122
123 dcsr-epu@0 {
124 compatible = "fsl,dcsr-epu";
125 interrupts = <52 2 0 0
126 84 2 0 0
127 85 2 0 0>;
128 interrupt-parent = <&mpic>;
129 reg = <0x0 0x1000>;
130 };
131 dcsr-npc {
132 compatible = "fsl,dcsr-npc";
133 reg = <0x1000 0x1000 0x1000000 0x8000>;
134 };
135 dcsr-nxc@2000 {
136 compatible = "fsl,dcsr-nxc";
137 reg = <0x2000 0x1000>;
138 };
139 dcsr-corenet {
140 compatible = "fsl,dcsr-corenet";
141 reg = <0x8000 0x1000 0xB0000 0x1000>;
142 };
143 dcsr-dpaa@9000 {
144 compatible = "fsl,p43041-dcsr-dpaa", "fsl,dcsr-dpaa";
145 reg = <0x9000 0x1000>;
146 };
147 dcsr-ocn@11000 {
148 compatible = "fsl,p43041-dcsr-ocn", "fsl,dcsr-ocn";
149 reg = <0x11000 0x1000>;
150 };
151 dcsr-ddr@12000 {
152 compatible = "fsl,dcsr-ddr";
153 dev-handle = <&ddr>;
154 reg = <0x12000 0x1000>;
155 };
156 dcsr-nal@18000 {
157 compatible = "fsl,p43041-dcsr-nal", "fsl,dcsr-nal";
158 reg = <0x18000 0x1000>;
159 };
160 dcsr-rcpm@22000 {
161 compatible = "fsl,p43041-dcsr-rcpm", "fsl,dcsr-rcpm";
162 reg = <0x22000 0x1000>;
163 };
164 dcsr-cpu-sb-proxy@40000 {
165 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
166 cpu-handle = <&cpu0>;
167 reg = <0x40000 0x1000>;
168 };
169 dcsr-cpu-sb-proxy@41000 {
170 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
171 cpu-handle = <&cpu1>;
172 reg = <0x41000 0x1000>;
173 };
174 dcsr-cpu-sb-proxy@42000 {
175 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
176 cpu-handle = <&cpu2>;
177 reg = <0x42000 0x1000>;
178 };
179 dcsr-cpu-sb-proxy@43000 {
180 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
181 cpu-handle = <&cpu3>;
182 reg = <0x43000 0x1000>;
183 };
184 };
185
186 soc: soc@ffe000000 {
187 #address-cells = <1>;
188 #size-cells = <1>;
189 device_type = "soc";
190 compatible = "simple-bus";
191 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
192 reg = <0xf 0xfe000000 0 0x00001000>;
193
194 soc-sram-error {
195 compatible = "fsl,soc-sram-error";
196 interrupts = <16 2 1 29>;
197 };
198
199 corenet-law@0 {
200 compatible = "fsl,corenet-law";
201 reg = <0x0 0x1000>;
202 fsl,num-laws = <32>;
203 };
204
205 ddr: memory-controller@8000 {
206 compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
207 reg = <0x8000 0x1000>;
208 interrupts = <16 2 1 23>;
209 };
210
211 cpc: l3-cache-controller@10000 {
212 compatible = "fsl,p3041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache";
213 reg = <0x10000 0x1000>;
214 interrupts = <16 2 1 27>;
215 };
216
217 corenet-cf@18000 {
218 compatible = "fsl,corenet-cf";
219 reg = <0x18000 0x1000>;
220 interrupts = <16 2 1 31>;
221 fsl,ccf-num-csdids = <32>;
222 fsl,ccf-num-snoopids = <32>;
223 };
224
225 iommu@20000 {
226 compatible = "fsl,pamu-v1.0", "fsl,pamu";
227 reg = <0x20000 0x4000>;
228 interrupts = <
229 24 2 0 0
230 16 2 1 30>;
231 };
232
233 mpic: pic@40000 {
234 clock-frequency = <0>;
235 interrupt-controller;
236 #address-cells = <0>;
237 #interrupt-cells = <4>;
238 reg = <0x40000 0x40000>;
239 compatible = "fsl,mpic", "chrp,open-pic";
240 device_type = "open-pic";
241 };
242
243 msi0: msi@41600 {
244 compatible = "fsl,mpic-msi";
245 reg = <0x41600 0x200>;
246 msi-available-ranges = <0 0x100>;
247 interrupts = <
248 0xe0 0 0 0
249 0xe1 0 0 0
250 0xe2 0 0 0
251 0xe3 0 0 0
252 0xe4 0 0 0
253 0xe5 0 0 0
254 0xe6 0 0 0
255 0xe7 0 0 0>;
256 };
257
258 msi1: msi@41800 {
259 compatible = "fsl,mpic-msi";
260 reg = <0x41800 0x200>;
261 msi-available-ranges = <0 0x100>;
262 interrupts = <
263 0xe8 0 0 0
264 0xe9 0 0 0
265 0xea 0 0 0
266 0xeb 0 0 0
267 0xec 0 0 0
268 0xed 0 0 0
269 0xee 0 0 0
270 0xef 0 0 0>;
271 };
272
273 msi2: msi@41a00 {
274 compatible = "fsl,mpic-msi";
275 reg = <0x41a00 0x200>;
276 msi-available-ranges = <0 0x100>;
277 interrupts = <
278 0xf0 0 0 0
279 0xf1 0 0 0
280 0xf2 0 0 0
281 0xf3 0 0 0
282 0xf4 0 0 0
283 0xf5 0 0 0
284 0xf6 0 0 0
285 0xf7 0 0 0>;
286 };
287
288 guts: global-utilities@e0000 {
289 compatible = "fsl,qoriq-device-config-1.0";
290 reg = <0xe0000 0xe00>;
291 fsl,has-rstcr;
292 #sleep-cells = <1>;
293 fsl,liodn-bits = <12>;
294 };
295
296 pins: global-utilities@e0e00 {
297 compatible = "fsl,qoriq-pin-control-1.0";
298 reg = <0xe0e00 0x200>;
299 #sleep-cells = <2>;
300 };
301
302 clockgen: global-utilities@e1000 {
303 compatible = "fsl,p3041-clockgen", "fsl,qoriq-clockgen-1.0";
304 reg = <0xe1000 0x1000>;
305 clock-frequency = <0>;
306 };
307
308 rcpm: global-utilities@e2000 {
309 compatible = "fsl,qoriq-rcpm-1.0";
310 reg = <0xe2000 0x1000>;
311 #sleep-cells = <1>;
312 };
313
314 sfp: sfp@e8000 {
315 compatible = "fsl,p3041-sfp", "fsl,qoriq-sfp-1.0";
316 reg = <0xe8000 0x1000>;
317 };
318
319 serdes: serdes@ea000 {
320 compatible = "fsl,p3041-serdes";
321 reg = <0xea000 0x1000>;
322 };
323
324 dma0: dma@100300 {
325 #address-cells = <1>;
326 #size-cells = <1>;
327 compatible = "fsl,p3041-dma", "fsl,eloplus-dma";
328 reg = <0x100300 0x4>;
329 ranges = <0x0 0x100100 0x200>;
330 cell-index = <0>;
331 dma-channel@0 {
332 compatible = "fsl,p3041-dma-channel",
333 "fsl,eloplus-dma-channel";
334 reg = <0x0 0x80>;
335 cell-index = <0>;
336 interrupts = <28 2 0 0>;
337 };
338 dma-channel@80 {
339 compatible = "fsl,p3041-dma-channel",
340 "fsl,eloplus-dma-channel";
341 reg = <0x80 0x80>;
342 cell-index = <1>;
343 interrupts = <29 2 0 0>;
344 };
345 dma-channel@100 {
346 compatible = "fsl,p3041-dma-channel",
347 "fsl,eloplus-dma-channel";
348 reg = <0x100 0x80>;
349 cell-index = <2>;
350 interrupts = <30 2 0 0>;
351 };
352 dma-channel@180 {
353 compatible = "fsl,p3041-dma-channel",
354 "fsl,eloplus-dma-channel";
355 reg = <0x180 0x80>;
356 cell-index = <3>;
357 interrupts = <31 2 0 0>;
358 };
359 };
360
361 dma1: dma@101300 {
362 #address-cells = <1>;
363 #size-cells = <1>;
364 compatible = "fsl,p3041-dma", "fsl,eloplus-dma";
365 reg = <0x101300 0x4>;
366 ranges = <0x0 0x101100 0x200>;
367 cell-index = <1>;
368 dma-channel@0 {
369 compatible = "fsl,p3041-dma-channel",
370 "fsl,eloplus-dma-channel";
371 reg = <0x0 0x80>;
372 cell-index = <0>;
373 interrupts = <32 2 0 0>;
374 };
375 dma-channel@80 {
376 compatible = "fsl,p3041-dma-channel",
377 "fsl,eloplus-dma-channel";
378 reg = <0x80 0x80>;
379 cell-index = <1>;
380 interrupts = <33 2 0 0>;
381 };
382 dma-channel@100 {
383 compatible = "fsl,p3041-dma-channel",
384 "fsl,eloplus-dma-channel";
385 reg = <0x100 0x80>;
386 cell-index = <2>;
387 interrupts = <34 2 0 0>;
388 };
389 dma-channel@180 {
390 compatible = "fsl,p3041-dma-channel",
391 "fsl,eloplus-dma-channel";
392 reg = <0x180 0x80>;
393 cell-index = <3>;
394 interrupts = <35 2 0 0>;
395 };
396 };
397
398 spi@110000 {
399 #address-cells = <1>;
400 #size-cells = <0>;
401 compatible = "fsl,p3041-espi", "fsl,mpc8536-espi";
402 reg = <0x110000 0x1000>;
403 interrupts = <53 0x2 0 0>;
404 fsl,espi-num-chipselects = <4>;
405 };
406
407 sdhc: sdhc@114000 {
408 compatible = "fsl,p3041-esdhc", "fsl,esdhc";
409 reg = <0x114000 0x1000>;
410 interrupts = <48 2 0 0>;
411 sdhci,auto-cmd12;
412 clock-frequency = <0>;
413 };
414
415 i2c@118000 {
416 #address-cells = <1>;
417 #size-cells = <0>;
418 cell-index = <0>;
419 compatible = "fsl-i2c";
420 reg = <0x118000 0x100>;
421 interrupts = <38 2 0 0>;
422 dfsrr;
423 };
424
425 i2c@118100 {
426 #address-cells = <1>;
427 #size-cells = <0>;
428 cell-index = <1>;
429 compatible = "fsl-i2c";
430 reg = <0x118100 0x100>;
431 interrupts = <38 2 0 0>;
432 dfsrr;
433 };
434
435 i2c@119000 {
436 #address-cells = <1>;
437 #size-cells = <0>;
438 cell-index = <2>;
439 compatible = "fsl-i2c";
440 reg = <0x119000 0x100>;
441 interrupts = <39 2 0 0>;
442 dfsrr;
443 };
444
445 i2c@119100 {
446 #address-cells = <1>;
447 #size-cells = <0>;
448 cell-index = <3>;
449 compatible = "fsl-i2c";
450 reg = <0x119100 0x100>;
451 interrupts = <39 2 0 0>;
452 dfsrr;
453 };
454
455 serial0: serial@11c500 {
456 cell-index = <0>;
457 device_type = "serial";
458 compatible = "ns16550";
459 reg = <0x11c500 0x100>;
460 clock-frequency = <0>;
461 interrupts = <36 2 0 0>;
462 };
463
464 serial1: serial@11c600 {
465 cell-index = <1>;
466 device_type = "serial";
467 compatible = "ns16550";
468 reg = <0x11c600 0x100>;
469 clock-frequency = <0>;
470 interrupts = <36 2 0 0>;
471 };
472
473 serial2: serial@11d500 {
474 cell-index = <2>;
475 device_type = "serial";
476 compatible = "ns16550";
477 reg = <0x11d500 0x100>;
478 clock-frequency = <0>;
479 interrupts = <37 2 0 0>;
480 };
481
482 serial3: serial@11d600 {
483 cell-index = <3>;
484 device_type = "serial";
485 compatible = "ns16550";
486 reg = <0x11d600 0x100>;
487 clock-frequency = <0>;
488 interrupts = <37 2 0 0>;
489 };
490
491 gpio0: gpio@130000 {
492 compatible = "fsl,p3041-gpio", "fsl,qoriq-gpio";
493 reg = <0x130000 0x1000>;
494 interrupts = <55 2 0 0>;
495 #gpio-cells = <2>;
496 gpio-controller;
497 };
498
499 usb0: usb@210000 {
500 compatible = "fsl,p3041-usb2-mph",
501 "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph";
502 reg = <0x210000 0x1000>;
503 #address-cells = <1>;
504 #size-cells = <0>;
505 interrupts = <44 0x2 0 0>;
506 phy_type = "utmi";
507 port0;
508 };
509
510 usb1: usb@211000 {
511 compatible = "fsl,p3041-usb2-dr",
512 "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr";
513 reg = <0x211000 0x1000>;
514 #address-cells = <1>;
515 #size-cells = <0>;
516 interrupts = <45 0x2 0 0>;
517 dr_mode = "host";
518 phy_type = "utmi";
519 };
520
521 sata@220000 {
522 compatible = "fsl,p3041-sata", "fsl,pq-sata-v2";
523 reg = <0x220000 0x1000>;
524 interrupts = <68 0x2 0 0>;
525 };
526
527 sata@221000 {
528 compatible = "fsl,p3041-sata", "fsl,pq-sata-v2";
529 reg = <0x221000 0x1000>;
530 interrupts = <69 0x2 0 0>;
531 };
532
533 crypto: crypto@300000 {
534 compatible = "fsl,sec-v4.2", "fsl,sec-v4.0";
535 #address-cells = <1>;
536 #size-cells = <1>;
537 reg = <0x300000 0x10000>;
538 ranges = <0 0x300000 0x10000>;
539 interrupts = <92 2 0 0>;
540
541 sec_jr0: jr@1000 {
542 compatible = "fsl,sec-v4.2-job-ring",
543 "fsl,sec-v4.0-job-ring";
544 reg = <0x1000 0x1000>;
545 interrupts = <88 2 0 0>;
546 };
547
548 sec_jr1: jr@2000 {
549 compatible = "fsl,sec-v4.2-job-ring",
550 "fsl,sec-v4.0-job-ring";
551 reg = <0x2000 0x1000>;
552 interrupts = <89 2 0 0>;
553 };
554
555 sec_jr2: jr@3000 {
556 compatible = "fsl,sec-v4.2-job-ring",
557 "fsl,sec-v4.0-job-ring";
558 reg = <0x3000 0x1000>;
559 interrupts = <90 2 0 0>;
560 };
561
562 sec_jr3: jr@4000 {
563 compatible = "fsl,sec-v4.2-job-ring",
564 "fsl,sec-v4.0-job-ring";
565 reg = <0x4000 0x1000>;
566 interrupts = <91 2 0 0>;
567 };
568
569 rtic@6000 {
570 compatible = "fsl,sec-v4.2-rtic",
571 "fsl,sec-v4.0-rtic";
572 #address-cells = <1>;
573 #size-cells = <1>;
574 reg = <0x6000 0x100>;
575 ranges = <0x0 0x6100 0xe00>;
576
577 rtic_a: rtic-a@0 {
578 compatible = "fsl,sec-v4.2-rtic-memory",
579 "fsl,sec-v4.0-rtic-memory";
580 reg = <0x00 0x20 0x100 0x80>;
581 };
582
583 rtic_b: rtic-b@20 {
584 compatible = "fsl,sec-v4.2-rtic-memory",
585 "fsl,sec-v4.0-rtic-memory";
586 reg = <0x20 0x20 0x200 0x80>;
587 };
588
589 rtic_c: rtic-c@40 {
590 compatible = "fsl,sec-v4.2-rtic-memory",
591 "fsl,sec-v4.0-rtic-memory";
592 reg = <0x40 0x20 0x300 0x80>;
593 };
594
595 rtic_d: rtic-d@60 {
596 compatible = "fsl,sec-v4.2-rtic-memory",
597 "fsl,sec-v4.0-rtic-memory";
598 reg = <0x60 0x20 0x500 0x80>;
599 };
600 };
601 };
602
603 sec_mon: sec_mon@314000 {
604 compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon";
605 reg = <0x314000 0x1000>;
606 interrupts = <93 2 0 0>;
607 };
608 };
609
610/*
611 rapidio0: rapidio@ffe0c0000
612*/
613
614 localbus@ffe124000 {
615 compatible = "fsl,p3041-elbc", "fsl,elbc", "simple-bus";
616 interrupts = <25 2 0 0>;
617 #address-cells = <2>;
618 #size-cells = <1>;
619 };
620
621 pci0: pcie@ffe200000 {
622 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
623 device_type = "pci";
624 #size-cells = <2>;
625 #address-cells = <3>;
626 bus-range = <0x0 0xff>;
627 clock-frequency = <0x1fca055>;
628 fsl,msi = <&msi0>;
629 interrupts = <16 2 1 15>;
630
631 pcie@0 {
632 reg = <0 0 0 0 0>;
633 #interrupt-cells = <1>;
634 #size-cells = <2>;
635 #address-cells = <3>;
636 device_type = "pci";
637 interrupts = <16 2 1 15>;
638 interrupt-map-mask = <0xf800 0 0 7>;
639 interrupt-map = <
640 /* IDSEL 0x0 */
641 0000 0 0 1 &mpic 40 1 0 0
642 0000 0 0 2 &mpic 1 1 0 0
643 0000 0 0 3 &mpic 2 1 0 0
644 0000 0 0 4 &mpic 3 1 0 0
645 >;
646 };
647 };
648
649 pci1: pcie@ffe201000 {
650 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
651 device_type = "pci";
652 #size-cells = <2>;
653 #address-cells = <3>;
654 bus-range = <0 0xff>;
655 clock-frequency = <0x1fca055>;
656 fsl,msi = <&msi1>;
657 interrupts = <16 2 1 14>;
658 pcie@0 {
659 reg = <0 0 0 0 0>;
660 #interrupt-cells = <1>;
661 #size-cells = <2>;
662 #address-cells = <3>;
663 device_type = "pci";
664 interrupts = <16 2 1 14>;
665 interrupt-map-mask = <0xf800 0 0 7>;
666 interrupt-map = <
667 /* IDSEL 0x0 */
668 0000 0 0 1 &mpic 41 1 0 0
669 0000 0 0 2 &mpic 5 1 0 0
670 0000 0 0 3 &mpic 6 1 0 0
671 0000 0 0 4 &mpic 7 1 0 0
672 >;
673 };
674 };
675
676 pci2: pcie@ffe202000 {
677 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
678 device_type = "pci";
679 #size-cells = <2>;
680 #address-cells = <3>;
681 bus-range = <0x0 0xff>;
682 clock-frequency = <0x1fca055>;
683 fsl,msi = <&msi2>;
684 interrupts = <16 2 1 13>;
685 pcie@0 {
686 reg = <0 0 0 0 0>;
687 #interrupt-cells = <1>;
688 #size-cells = <2>;
689 #address-cells = <3>;
690 device_type = "pci";
691 interrupts = <16 2 1 13>;
692 interrupt-map-mask = <0xf800 0 0 7>;
693 interrupt-map = <
694 /* IDSEL 0x0 */
695 0000 0 0 1 &mpic 42 1 0 0
696 0000 0 0 2 &mpic 9 1 0 0
697 0000 0 0 3 &mpic 10 1 0 0
698 0000 0 0 4 &mpic 11 1 0 0
699 >;
700 };
701 };
702
703 pci3: pcie@ffe203000 {
704 compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2";
705 device_type = "pci";
706 #size-cells = <2>;
707 #address-cells = <3>;
708 bus-range = <0x0 0xff>;
709 clock-frequency = <0x1fca055>;
710 fsl,msi = <&msi2>;
711 interrupts = <16 2 1 12>;
712 pcie@0 {
713 reg = <0 0 0 0 0>;
714 #interrupt-cells = <1>;
715 #size-cells = <2>;
716 #address-cells = <3>;
717 device_type = "pci";
718 interrupts = <16 2 1 12>;
719 interrupt-map-mask = <0xf800 0 0 7>;
720 interrupt-map = <
721 /* IDSEL 0x0 */
722 0000 0 0 1 &mpic 43 1 0 0
723 0000 0 0 2 &mpic 0 1 0 0
724 0000 0 0 3 &mpic 4 1 0 0
725 0000 0 0 4 &mpic 8 1 0 0
726 >;
727 };
728 };
729};
diff --git a/arch/powerpc/boot/dts/p3060qds.dts b/arch/powerpc/boot/dts/p3060qds.dts
index 08b9193213e7..529042e4b9a2 100644
--- a/arch/powerpc/boot/dts/p3060qds.dts
+++ b/arch/powerpc/boot/dts/p3060qds.dts
@@ -32,7 +32,7 @@
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35/include/ "p3060si.dtsi" 35/include/ "fsl/p3060si-pre.dtsi"
36 36
37/ { 37/ {
38 model = "fsl,P3060QDS"; 38 model = "fsl,P3060QDS";
@@ -50,6 +50,8 @@
50 }; 50 };
51 51
52 soc: soc@ffe000000 { 52 soc: soc@ffe000000 {
53 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
54 reg = <0xf 0xfe000000 0 0x00001000>;
53 spi@110000 { 55 spi@110000 {
54 flash@0 { 56 flash@0 {
55 #address-cells = <1>; 57 #address-cells = <1>;
@@ -138,7 +140,7 @@
138 }; 140 };
139 }; 141 };
140 142
141 rapidio@ffe0c0000 { 143 rio: rapidio@ffe0c0000 {
142 reg = <0xf 0xfe0c0000 0 0x11000>; 144 reg = <0xf 0xfe0c0000 0 0x11000>;
143 145
144 port1 { 146 port1 {
@@ -149,7 +151,7 @@
149 }; 151 };
150 }; 152 };
151 153
152 localbus@ffe124000 { 154 lbc: localbus@ffe124000 {
153 reg = <0xf 0xfe124000 0 0x1000>; 155 reg = <0xf 0xfe124000 0 0x1000>;
154 ranges = <0 0 0xf 0xe8000000 0x08000000 156 ranges = <0 0 0xf 0xe8000000 0x08000000
155 2 0 0xf 0xffa00000 0x00040000 157 2 0 0xf 0xffa00000 0x00040000
@@ -210,6 +212,7 @@
210 reg = <0xf 0xfe200000 0 0x1000>; 212 reg = <0xf 0xfe200000 0 0x1000>;
211 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 213 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000
212 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 214 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;
215 fsl,msi = <&msi0>;
213 pcie@0 { 216 pcie@0 {
214 ranges = <0x02000000 0 0xe0000000 217 ranges = <0x02000000 0 0xe0000000
215 0x02000000 0 0xe0000000 218 0x02000000 0 0xe0000000
@@ -225,6 +228,7 @@
225 reg = <0xf 0xfe201000 0 0x1000>; 228 reg = <0xf 0xfe201000 0 0x1000>;
226 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 229 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
227 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 230 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>;
231 fsl,msi = <&msi1>;
228 pcie@0 { 232 pcie@0 {
229 ranges = <0x02000000 0 0xe0000000 233 ranges = <0x02000000 0 0xe0000000
230 0x02000000 0 0xe0000000 234 0x02000000 0 0xe0000000
@@ -236,3 +240,5 @@
236 }; 240 };
237 }; 241 };
238}; 242};
243
244/include/ "fsl/p3060si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p3060si.dtsi b/arch/powerpc/boot/dts/p3060si.dtsi
deleted file mode 100644
index 68947e157bbc..000000000000
--- a/arch/powerpc/boot/dts/p3060si.dtsi
+++ /dev/null
@@ -1,719 +0,0 @@
1/*
2 * P3060 Silicon Device Tree Source
3 *
4 * Copyright 2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36
37/ {
38 compatible = "fsl,P3060";
39 #address-cells = <2>;
40 #size-cells = <2>;
41 interrupt-parent = <&mpic>;
42
43 aliases {
44 ccsr = &soc;
45 dcsr = &dcsr;
46
47 serial0 = &serial0;
48 serial1 = &serial1;
49 serial2 = &serial2;
50 serial3 = &serial3;
51 pci0 = &pci0;
52 pci1 = &pci1;
53 usb0 = &usb0;
54 usb1 = &usb1;
55 dma0 = &dma0;
56 dma1 = &dma1;
57 msi0 = &msi0;
58 msi1 = &msi1;
59 msi2 = &msi2;
60
61 crypto = &crypto;
62 sec_jr0 = &sec_jr0;
63 sec_jr1 = &sec_jr1;
64 sec_jr2 = &sec_jr2;
65 sec_jr3 = &sec_jr3;
66 rtic_a = &rtic_a;
67 rtic_b = &rtic_b;
68 rtic_c = &rtic_c;
69 rtic_d = &rtic_d;
70 sec_mon = &sec_mon;
71 };
72
73 cpus {
74 #address-cells = <1>;
75 #size-cells = <0>;
76
77 cpu0: PowerPC,e500mc@0 {
78 device_type = "cpu";
79 reg = <0>;
80 next-level-cache = <&L2_0>;
81 L2_0: l2-cache {
82 next-level-cache = <&cpc>;
83 };
84 };
85 cpu1: PowerPC,e500mc@1 {
86 device_type = "cpu";
87 reg = <1>;
88 next-level-cache = <&L2_1>;
89 L2_1: l2-cache {
90 next-level-cache = <&cpc>;
91 };
92 };
93 cpu4: PowerPC,e500mc@4 {
94 device_type = "cpu";
95 reg = <4>;
96 next-level-cache = <&L2_4>;
97 L2_4: l2-cache {
98 next-level-cache = <&cpc>;
99 };
100 };
101 cpu5: PowerPC,e500mc@5 {
102 device_type = "cpu";
103 reg = <5>;
104 next-level-cache = <&L2_5>;
105 L2_5: l2-cache {
106 next-level-cache = <&cpc>;
107 };
108 };
109 cpu6: PowerPC,e500mc@6 {
110 device_type = "cpu";
111 reg = <6>;
112 next-level-cache = <&L2_6>;
113 L2_6: l2-cache {
114 next-level-cache = <&cpc>;
115 };
116 };
117 cpu7: PowerPC,e500mc@7 {
118 device_type = "cpu";
119 reg = <7>;
120 next-level-cache = <&L2_7>;
121 L2_7: l2-cache {
122 next-level-cache = <&cpc>;
123 };
124 };
125 };
126
127 dcsr: dcsr@f00000000 {
128 #address-cells = <1>;
129 #size-cells = <1>;
130 compatible = "fsl,dcsr", "simple-bus";
131
132 dcsr-epu@0 {
133 compatible = "fsl,dcsr-epu";
134 interrupts = <52 2 0 0
135 84 2 0 0
136 85 2 0 0>;
137 interrupt-parent = <&mpic>;
138 reg = <0x0 0x1000>;
139 };
140 dcsr-npc {
141 compatible = "fsl,dcsr-npc";
142 reg = <0x1000 0x1000 0x1000000 0x8000>;
143 };
144 dcsr-nxc@2000 {
145 compatible = "fsl,dcsr-nxc";
146 reg = <0x2000 0x1000>;
147 };
148 dcsr-corenet {
149 compatible = "fsl,dcsr-corenet";
150 reg = <0x8000 0x1000 0xB0000 0x1000>;
151 };
152 dcsr-dpaa@9000 {
153 compatible = "fsl,p3060-dcsr-dpaa", "fsl,dcsr-dpaa";
154 reg = <0x9000 0x1000>;
155 };
156 dcsr-ocn@11000 {
157 compatible = "fsl,p3060-dcsr-ocn", "fsl,dcsr-ocn";
158 reg = <0x11000 0x1000>;
159 };
160 dcsr-ddr@12000 {
161 compatible = "fsl,dcsr-ddr";
162 dev-handle = <&ddr>;
163 reg = <0x12000 0x1000>;
164 };
165 dcsr-nal@18000 {
166 compatible = "fsl,p3060-dcsr-nal", "fsl,dcsr-nal";
167 reg = <0x18000 0x1000>;
168 };
169 dcsr-rcpm@22000 {
170 compatible = "fsl,p3060-dcsr-rcpm", "fsl,dcsr-rcpm";
171 reg = <0x22000 0x1000>;
172 };
173 dcsr-cpu-sb-proxy@40000 {
174 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
175 cpu-handle = <&cpu0>;
176 reg = <0x40000 0x1000>;
177 };
178 dcsr-cpu-sb-proxy@41000 {
179 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
180 cpu-handle = <&cpu1>;
181 reg = <0x41000 0x1000>;
182 };
183 dcsr-cpu-sb-proxy@44000 {
184 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
185 cpu-handle = <&cpu4>;
186 reg = <0x44000 0x1000>;
187 };
188 dcsr-cpu-sb-proxy@45000 {
189 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
190 cpu-handle = <&cpu5>;
191 reg = <0x45000 0x1000>;
192 };
193 dcsr-cpu-sb-proxy@46000 {
194 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
195 cpu-handle = <&cpu6>;
196 reg = <0x46000 0x1000>;
197 };
198 dcsr-cpu-sb-proxy@47000 {
199 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
200 cpu-handle = <&cpu7>;
201 reg = <0x47000 0x1000>;
202 };
203 };
204
205 soc: soc@ffe000000 {
206 #address-cells = <1>;
207 #size-cells = <1>;
208 device_type = "soc";
209 compatible = "simple-bus";
210 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
211 reg = <0xf 0xfe000000 0 0x00001000>;
212
213 soc-sram-error {
214 compatible = "fsl,soc-sram-error";
215 interrupts = <16 2 1 29>;
216 };
217
218 corenet-law@0 {
219 compatible = "fsl,corenet-law";
220 reg = <0x0 0x1000>;
221 fsl,num-laws = <32>;
222 };
223
224 ddr: memory-controller@8000 {
225 compatible = "fsl,qoriq-memory-controller-v4.4", "fsl,qoriq-memory-controller";
226 reg = <0x8000 0x1000>;
227 interrupts = <16 2 1 23>;
228 };
229
230 cpc: l3-cache-controller@10000 {
231 compatible = "fsl,p3060-l3-cache-controller", "cache";
232 reg = <0x10000 0x1000
233 0x11000 0x1000>;
234 interrupts = <16 2 1 27>;
235 };
236
237 corenet-cf@18000 {
238 compatible = "fsl,corenet-cf";
239 reg = <0x18000 0x1000>;
240 interrupts = <16 2 1 31>;
241 fsl,ccf-num-csdids = <32>;
242 fsl,ccf-num-snoopids = <32>;
243 };
244
245 iommu@20000 {
246 compatible = "fsl,pamu-v1.0", "fsl,pamu";
247 reg = <0x20000 0x5000>;
248 interrupts = <
249 24 2 0 0
250 16 2 1 30>;
251 };
252
253 mpic: pic@40000 {
254 clock-frequency = <0>;
255 interrupt-controller;
256 #address-cells = <0>;
257 #interrupt-cells = <4>;
258 reg = <0x40000 0x40000>;
259 compatible = "fsl,mpic", "chrp,open-pic";
260 device_type = "open-pic";
261 };
262
263 msi0: msi@41600 {
264 compatible = "fsl,mpic-msi";
265 reg = <0x41600 0x200>;
266 msi-available-ranges = <0 0x100>;
267 interrupts = <
268 0xe0 0 0 0
269 0xe1 0 0 0
270 0xe2 0 0 0
271 0xe3 0 0 0
272 0xe4 0 0 0
273 0xe5 0 0 0
274 0xe6 0 0 0
275 0xe7 0 0 0>;
276 };
277
278 msi1: msi@41800 {
279 compatible = "fsl,mpic-msi";
280 reg = <0x41800 0x200>;
281 msi-available-ranges = <0 0x100>;
282 interrupts = <
283 0xe8 0 0 0
284 0xe9 0 0 0
285 0xea 0 0 0
286 0xeb 0 0 0
287 0xec 0 0 0
288 0xed 0 0 0
289 0xee 0 0 0
290 0xef 0 0 0>;
291 };
292
293 msi2: msi@41a00 {
294 compatible = "fsl,mpic-msi";
295 reg = <0x41a00 0x200>;
296 msi-available-ranges = <0 0x100>;
297 interrupts = <
298 0xf0 0 0 0
299 0xf1 0 0 0
300 0xf2 0 0 0
301 0xf3 0 0 0
302 0xf4 0 0 0
303 0xf5 0 0 0
304 0xf6 0 0 0
305 0xf7 0 0 0>;
306 };
307
308 rmu: rmu@d3000 {
309 #address-cells = <1>;
310 #size-cells = <1>;
311 compatible = "fsl,srio-rmu";
312 reg = <0xd3000 0x500>;
313 ranges = <0x0 0xd3000 0x500>;
314
315 message-unit@0 {
316 compatible = "fsl,srio-msg-unit";
317 reg = <0x0 0x100>;
318 interrupts = <
319 60 2 0 0 /* msg1_tx_irq */
320 61 2 0 0>;/* msg1_rx_irq */
321 };
322 message-unit@100 {
323 compatible = "fsl,srio-msg-unit";
324 reg = <0x100 0x100>;
325 interrupts = <
326 62 2 0 0 /* msg2_tx_irq */
327 63 2 0 0>;/* msg2_rx_irq */
328 };
329 doorbell-unit@400 {
330 compatible = "fsl,srio-dbell-unit";
331 reg = <0x400 0x80>;
332 interrupts = <
333 56 2 0 0 /* bell_outb_irq */
334 57 2 0 0>;/* bell_inb_irq */
335 };
336 port-write-unit@4e0 {
337 compatible = "fsl,srio-port-write-unit";
338 reg = <0x4e0 0x20>;
339 interrupts = <16 2 1 11>;
340 };
341 };
342
343 guts: global-utilities@e0000 {
344 compatible = "fsl,qoriq-device-config-1.0";
345 reg = <0xe0000 0xe00>;
346 fsl,has-rstcr;
347 #sleep-cells = <1>;
348 fsl,liodn-bits = <12>;
349 };
350
351 pins: global-utilities@e0e00 {
352 compatible = "fsl,qoriq-pin-control-1.0";
353 reg = <0xe0e00 0x200>;
354 #sleep-cells = <2>;
355 };
356
357 clockgen: global-utilities@e1000 {
358 compatible = "fsl,p3060-clockgen", "fsl,qoriq-clockgen-1.0";
359 reg = <0xe1000 0x1000>;
360 clock-frequency = <0>;
361 };
362
363 rcpm: global-utilities@e2000 {
364 compatible = "fsl,qoriq-rcpm-1.0";
365 reg = <0xe2000 0x1000>;
366 #sleep-cells = <1>;
367 };
368
369 sfp: sfp@e8000 {
370 compatible = "fsl,p3060-sfp", "fsl,qoriq-sfp-1.0";
371 reg = <0xe8000 0x1000>;
372 };
373
374 serdes: serdes@ea000 {
375 compatible = "fsl,p3060-serdes";
376 reg = <0xea000 0x1000>;
377 };
378
379 dma0: dma@100300 {
380 #address-cells = <1>;
381 #size-cells = <1>;
382 compatible = "fsl,p3060-dma", "fsl,eloplus-dma";
383 reg = <0x100300 0x4>;
384 ranges = <0x0 0x100100 0x200>;
385 cell-index = <0>;
386 dma-channel@0 {
387 compatible = "fsl,p3060-dma-channel",
388 "fsl,eloplus-dma-channel";
389 reg = <0x0 0x80>;
390 cell-index = <0>;
391 interrupts = <28 2 0 0>;
392 };
393 dma-channel@80 {
394 compatible = "fsl,p3060-dma-channel",
395 "fsl,eloplus-dma-channel";
396 reg = <0x80 0x80>;
397 cell-index = <1>;
398 interrupts = <29 2 0 0>;
399 };
400 dma-channel@100 {
401 compatible = "fsl,p3060-dma-channel",
402 "fsl,eloplus-dma-channel";
403 reg = <0x100 0x80>;
404 cell-index = <2>;
405 interrupts = <30 2 0 0>;
406 };
407 dma-channel@180 {
408 compatible = "fsl,p3060-dma-channel",
409 "fsl,eloplus-dma-channel";
410 reg = <0x180 0x80>;
411 cell-index = <3>;
412 interrupts = <31 2 0 0>;
413 };
414 };
415
416 dma1: dma@101300 {
417 #address-cells = <1>;
418 #size-cells = <1>;
419 compatible = "fsl,p3060-dma", "fsl,eloplus-dma";
420 reg = <0x101300 0x4>;
421 ranges = <0x0 0x101100 0x200>;
422 cell-index = <1>;
423 dma-channel@0 {
424 compatible = "fsl,p3060-dma-channel",
425 "fsl,eloplus-dma-channel";
426 reg = <0x0 0x80>;
427 cell-index = <0>;
428 interrupts = <32 2 0 0>;
429 };
430 dma-channel@80 {
431 compatible = "fsl,p3060-dma-channel",
432 "fsl,eloplus-dma-channel";
433 reg = <0x80 0x80>;
434 cell-index = <1>;
435 interrupts = <33 2 0 0>;
436 };
437 dma-channel@100 {
438 compatible = "fsl,p3060-dma-channel",
439 "fsl,eloplus-dma-channel";
440 reg = <0x100 0x80>;
441 cell-index = <2>;
442 interrupts = <34 2 0 0>;
443 };
444 dma-channel@180 {
445 compatible = "fsl,p3060-dma-channel",
446 "fsl,eloplus-dma-channel";
447 reg = <0x180 0x80>;
448 cell-index = <3>;
449 interrupts = <35 2 0 0>;
450 };
451 };
452
453 spi@110000 {
454 #address-cells = <1>;
455 #size-cells = <0>;
456 compatible = "fsl,p3060-espi", "fsl,mpc8536-espi";
457 reg = <0x110000 0x1000>;
458 interrupts = <53 0x2 0 0>;
459 fsl,espi-num-chipselects = <4>;
460 };
461
462 i2c@118000 {
463 #address-cells = <1>;
464 #size-cells = <0>;
465 cell-index = <0>;
466 compatible = "fsl-i2c";
467 reg = <0x118000 0x100>;
468 interrupts = <38 2 0 0>;
469 dfsrr;
470 };
471
472 i2c@118100 {
473 #address-cells = <1>;
474 #size-cells = <0>;
475 cell-index = <1>;
476 compatible = "fsl-i2c";
477 reg = <0x118100 0x100>;
478 interrupts = <38 2 0 0>;
479 dfsrr;
480 };
481
482 i2c@119000 {
483 #address-cells = <1>;
484 #size-cells = <0>;
485 cell-index = <2>;
486 compatible = "fsl-i2c";
487 reg = <0x119000 0x100>;
488 interrupts = <39 2 0 0>;
489 dfsrr;
490 };
491
492 i2c@119100 {
493 #address-cells = <1>;
494 #size-cells = <0>;
495 cell-index = <3>;
496 compatible = "fsl-i2c";
497 reg = <0x119100 0x100>;
498 interrupts = <39 2 0 0>;
499 dfsrr;
500 };
501
502 serial0: serial@11c500 {
503 cell-index = <0>;
504 device_type = "serial";
505 compatible = "ns16550";
506 reg = <0x11c500 0x100>;
507 clock-frequency = <0>;
508 interrupts = <36 2 0 0>;
509 };
510
511 serial1: serial@11c600 {
512 cell-index = <1>;
513 device_type = "serial";
514 compatible = "ns16550";
515 reg = <0x11c600 0x100>;
516 clock-frequency = <0>;
517 interrupts = <36 2 0 0>;
518 };
519
520 serial2: serial@11d500 {
521 cell-index = <2>;
522 device_type = "serial";
523 compatible = "ns16550";
524 reg = <0x11d500 0x100>;
525 clock-frequency = <0>;
526 interrupts = <37 2 0 0>;
527 };
528
529 serial3: serial@11d600 {
530 cell-index = <3>;
531 device_type = "serial";
532 compatible = "ns16550";
533 reg = <0x11d600 0x100>;
534 clock-frequency = <0>;
535 interrupts = <37 2 0 0>;
536 };
537
538 gpio0: gpio@130000 {
539 compatible = "fsl,p3060-gpio", "fsl,qoriq-gpio";
540 reg = <0x130000 0x1000>;
541 interrupts = <55 2 0 0>;
542 #gpio-cells = <2>;
543 gpio-controller;
544 };
545
546 usb0: usb@210000 {
547 compatible = "fsl,p3060-usb2-mph",
548 "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph";
549 reg = <0x210000 0x1000>;
550 #address-cells = <1>;
551 #size-cells = <0>;
552 interrupts = <44 0x2 0 0>;
553 };
554
555 usb1: usb@211000 {
556 compatible = "fsl,p3060-usb2-dr",
557 "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr";
558 reg = <0x211000 0x1000>;
559 #address-cells = <1>;
560 #size-cells = <0>;
561 interrupts = <45 0x2 0 0>;
562 };
563
564 crypto: crypto@300000 {
565 compatible = "fsl,sec-v4.1", "fsl,sec-v4.0";
566 #address-cells = <1>;
567 #size-cells = <1>;
568 reg = <0x300000 0x10000>;
569 ranges = <0 0x300000 0x10000>;
570 interrupt-parent = <&mpic>;
571 interrupts = <92 2 0 0>;
572
573 sec_jr0: jr@1000 {
574 compatible = "fsl,sec-v4.1-job-ring", "fsl,sec-v4.0-job-ring";
575 reg = <0x1000 0x1000>;
576 interrupt-parent = <&mpic>;
577 interrupts = <88 2 0 0>;
578 };
579
580 sec_jr1: jr@2000 {
581 compatible = "fsl,sec-v4.1-job-ring", "fsl,sec-v4.0-job-ring";
582 reg = <0x2000 0x1000>;
583 interrupt-parent = <&mpic>;
584 interrupts = <89 2 0 0>;
585 };
586
587 sec_jr2: jr@3000 {
588 compatible = "fsl,sec-v4.1-job-ring", "fsl,sec-v4.0-job-ring";
589 reg = <0x3000 0x1000>;
590 interrupt-parent = <&mpic>;
591 interrupts = <90 2 0 0>;
592 };
593
594 sec_jr3: jr@4000 {
595 compatible = "fsl,sec-v4.1-job-ring", "fsl,sec-v4.0-job-ring";
596 reg = <0x4000 0x1000>;
597 interrupt-parent = <&mpic>;
598 interrupts = <91 2 0 0>;
599 };
600
601 rtic@6000 {
602 compatible = "fsl,sec-v4.1-rtic", "fsl,sec-v4.0-rtic";
603 #address-cells = <1>;
604 #size-cells = <1>;
605 reg = <0x6000 0x100>;
606 ranges = <0x0 0x6100 0xe00>;
607
608 rtic_a: rtic-a@0 {
609 compatible = "fsl,sec-v4.1-rtic-memory", "fsl,sec-v4.0-rtic-memory";
610 reg = <0x00 0x20 0x100 0x80>;
611 };
612
613 rtic_b: rtic-b@20 {
614 compatible = "fsl,sec-v4.1-rtic-memory", "fsl,sec-v4.0-rtic-memory";
615 reg = <0x20 0x20 0x200 0x80>;
616 };
617
618 rtic_c: rtic-c@40 {
619 compatible = "fsl,sec-v4.1-rtic-memory", "fsl,sec-v4.0-rtic-memory";
620 reg = <0x40 0x20 0x300 0x80>;
621 };
622
623 rtic_d: rtic-d@60 {
624 compatible = "fsl,sec-v4.1-rtic-memory", "fsl,sec-v4.0-rtic-memory";
625 reg = <0x60 0x20 0x500 0x80>;
626 };
627 };
628 };
629
630 sec_mon: sec_mon@314000 {
631 compatible = "fsl,sec-v4.1-mon", "fsl,sec-v4.0-mon";
632 reg = <0x314000 0x1000>;
633 interrupt-parent = <&mpic>;
634 interrupts = <93 2 0 0>;
635 };
636 };
637
638 rapidio@ffe0c0000 {
639 compatible = "fsl,srio";
640 interrupts = <16 2 1 11>;
641 #address-cells = <2>;
642 #size-cells = <2>;
643 fsl,srio-rmu-handle = <&rmu>;
644 ranges;
645
646 port1 {
647 #address-cells = <2>;
648 #size-cells = <2>;
649 cell-index = <1>;
650 };
651
652 port2 {
653 #address-cells = <2>;
654 #size-cells = <2>;
655 cell-index = <2>;
656 };
657 };
658
659 localbus@ffe124000 {
660 compatible = "fsl,p3060-elbc", "fsl,elbc", "simple-bus";
661 interrupts = <25 2 0 0>;
662 #address-cells = <2>;
663 #size-cells = <1>;
664 };
665
666 pci0: pcie@ffe200000 {
667 compatible = "fsl,p3060-pcie", "fsl,qoriq-pcie-v2.2";
668 device_type = "pci";
669 #size-cells = <2>;
670 #address-cells = <3>;
671 bus-range = <0x0 0xff>;
672 clock-frequency = <33333333>;
673 fsl,msi = <&msi0>;
674 interrupts = <16 2 1 15>;
675 pcie@0 {
676 reg = <0 0 0 0 0>;
677 #interrupt-cells = <1>;
678 #size-cells = <2>;
679 #address-cells = <3>;
680 device_type = "pci";
681 interrupts = <16 2 1 15>;
682 interrupt-map-mask = <0xf800 0 0 7>;
683 interrupt-map = <
684 /* IDSEL 0x0 */
685 0000 0 0 1 &mpic 40 1 0 0
686 0000 0 0 2 &mpic 1 1 0 0
687 0000 0 0 3 &mpic 2 1 0 0
688 0000 0 0 4 &mpic 3 1 0 0
689 >;
690 };
691 };
692
693 pci1: pcie@ffe201000 {
694 compatible = "fsl,p3060-pcie", "fsl,qoriq-pcie-v2.2";
695 device_type = "pci";
696 #size-cells = <2>;
697 #address-cells = <3>;
698 bus-range = <0 0xff>;
699 clock-frequency = <33333333>;
700 fsl,msi = <&msi1>;
701 interrupts = <16 2 1 14>;
702 pcie@0 {
703 reg = <0 0 0 0 0>;
704 #interrupt-cells = <1>;
705 #size-cells = <2>;
706 #address-cells = <3>;
707 device_type = "pci";
708 interrupts = <16 2 1 14>;
709 interrupt-map-mask = <0xf800 0 0 7>;
710 interrupt-map = <
711 /* IDSEL 0x0 */
712 0000 0 0 1 &mpic 41 1 0 0
713 0000 0 0 2 &mpic 5 1 0 0
714 0000 0 0 3 &mpic 6 1 0 0
715 0000 0 0 4 &mpic 7 1 0 0
716 >;
717 };
718 };
719};
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index c7916dc28014..6d60e54e50a0 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -32,7 +32,7 @@
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35/include/ "p4080si.dtsi" 35/include/ "fsl/p4080si-pre.dtsi"
36 36
37/ { 37/ {
38 model = "fsl,P4080DS"; 38 model = "fsl,P4080DS";
@@ -50,6 +50,9 @@
50 }; 50 };
51 51
52 soc: soc@ffe000000 { 52 soc: soc@ffe000000 {
53 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
54 reg = <0xf 0xfe000000 0 0x00001000>;
55
53 spi@110000 { 56 spi@110000 {
54 flash@0 { 57 flash@0 {
55 #address-cells = <1>; 58 #address-cells = <1>;
@@ -105,12 +108,18 @@
105 }; 108 };
106 }; 109 };
107 110
108 rapidio0: rapidio@ffe0c0000 { 111 rio: rapidio@ffe0c0000 {
109 reg = <0xf 0xfe0c0000 0 0x20000>; 112 reg = <0xf 0xfe0c0000 0 0x11000>;
110 ranges = <0 0 0xc 0x20000000 0 0x01000000>; 113
114 port1 {
115 ranges = <0 0 0xc 0x20000000 0 0x10000000>;
116 };
117 port2 {
118 ranges = <0 0 0xc 0x30000000 0 0x10000000>;
119 };
111 }; 120 };
112 121
113 localbus@ffe124000 { 122 lbc: localbus@ffe124000 {
114 reg = <0xf 0xfe124000 0 0x1000>; 123 reg = <0xf 0xfe124000 0 0x1000>;
115 ranges = <0 0 0xf 0xe8000000 0x08000000 124 ranges = <0 0 0xf 0xe8000000 0x08000000
116 3 0 0xf 0xffdf0000 0x00008000>; 125 3 0 0xf 0xffdf0000 0x00008000>;
@@ -132,6 +141,7 @@
132 reg = <0xf 0xfe200000 0 0x1000>; 141 reg = <0xf 0xfe200000 0 0x1000>;
133 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 142 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000
134 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 143 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;
144 fsl,msi = <&msi0>;
135 pcie@0 { 145 pcie@0 {
136 ranges = <0x02000000 0 0xe0000000 146 ranges = <0x02000000 0 0xe0000000
137 0x02000000 0 0xe0000000 147 0x02000000 0 0xe0000000
@@ -147,6 +157,7 @@
147 reg = <0xf 0xfe201000 0 0x1000>; 157 reg = <0xf 0xfe201000 0 0x1000>;
148 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 158 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
149 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 159 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>;
160 fsl,msi = <&msi1>;
150 pcie@0 { 161 pcie@0 {
151 ranges = <0x02000000 0 0xe0000000 162 ranges = <0x02000000 0 0xe0000000
152 0x02000000 0 0xe0000000 163 0x02000000 0 0xe0000000
@@ -162,6 +173,7 @@
162 reg = <0xf 0xfe202000 0 0x1000>; 173 reg = <0xf 0xfe202000 0 0x1000>;
163 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 174 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000
164 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; 175 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;
176 fsl,msi = <&msi2>;
165 pcie@0 { 177 pcie@0 {
166 ranges = <0x02000000 0 0xe0000000 178 ranges = <0x02000000 0 0xe0000000
167 0x02000000 0 0xe0000000 179 0x02000000 0 0xe0000000
@@ -174,3 +186,5 @@
174 }; 186 };
175 187
176}; 188};
189
190/include/ "fsl/p4080si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p4080si.dtsi b/arch/powerpc/boot/dts/p4080si.dtsi
deleted file mode 100644
index f20c01ab2473..000000000000
--- a/arch/powerpc/boot/dts/p4080si.dtsi
+++ /dev/null
@@ -1,755 +0,0 @@
1/*
2 * P4080 Silicon Device Tree Source
3 *
4 * Copyright 2009-2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36
37/ {
38 compatible = "fsl,P4080";
39 #address-cells = <2>;
40 #size-cells = <2>;
41 interrupt-parent = <&mpic>;
42
43 aliases {
44 ccsr = &soc;
45 dcsr = &dcsr;
46
47 serial0 = &serial0;
48 serial1 = &serial1;
49 serial2 = &serial2;
50 serial3 = &serial3;
51 pci0 = &pci0;
52 pci1 = &pci1;
53 pci2 = &pci2;
54 usb0 = &usb0;
55 usb1 = &usb1;
56 dma0 = &dma0;
57 dma1 = &dma1;
58 sdhc = &sdhc;
59 msi0 = &msi0;
60 msi1 = &msi1;
61 msi2 = &msi2;
62
63 crypto = &crypto;
64 sec_jr0 = &sec_jr0;
65 sec_jr1 = &sec_jr1;
66 sec_jr2 = &sec_jr2;
67 sec_jr3 = &sec_jr3;
68 rtic_a = &rtic_a;
69 rtic_b = &rtic_b;
70 rtic_c = &rtic_c;
71 rtic_d = &rtic_d;
72 sec_mon = &sec_mon;
73
74 rio0 = &rapidio0;
75 };
76
77 cpus {
78 #address-cells = <1>;
79 #size-cells = <0>;
80
81 cpu0: PowerPC,e500mc@0 {
82 device_type = "cpu";
83 reg = <0>;
84 next-level-cache = <&L2_0>;
85 L2_0: l2-cache {
86 next-level-cache = <&cpc>;
87 };
88 };
89 cpu1: PowerPC,e500mc@1 {
90 device_type = "cpu";
91 reg = <1>;
92 next-level-cache = <&L2_1>;
93 L2_1: l2-cache {
94 next-level-cache = <&cpc>;
95 };
96 };
97 cpu2: PowerPC,e500mc@2 {
98 device_type = "cpu";
99 reg = <2>;
100 next-level-cache = <&L2_2>;
101 L2_2: l2-cache {
102 next-level-cache = <&cpc>;
103 };
104 };
105 cpu3: PowerPC,e500mc@3 {
106 device_type = "cpu";
107 reg = <3>;
108 next-level-cache = <&L2_3>;
109 L2_3: l2-cache {
110 next-level-cache = <&cpc>;
111 };
112 };
113 cpu4: PowerPC,e500mc@4 {
114 device_type = "cpu";
115 reg = <4>;
116 next-level-cache = <&L2_4>;
117 L2_4: l2-cache {
118 next-level-cache = <&cpc>;
119 };
120 };
121 cpu5: PowerPC,e500mc@5 {
122 device_type = "cpu";
123 reg = <5>;
124 next-level-cache = <&L2_5>;
125 L2_5: l2-cache {
126 next-level-cache = <&cpc>;
127 };
128 };
129 cpu6: PowerPC,e500mc@6 {
130 device_type = "cpu";
131 reg = <6>;
132 next-level-cache = <&L2_6>;
133 L2_6: l2-cache {
134 next-level-cache = <&cpc>;
135 };
136 };
137 cpu7: PowerPC,e500mc@7 {
138 device_type = "cpu";
139 reg = <7>;
140 next-level-cache = <&L2_7>;
141 L2_7: l2-cache {
142 next-level-cache = <&cpc>;
143 };
144 };
145 };
146
147 dcsr: dcsr@f00000000 {
148 #address-cells = <1>;
149 #size-cells = <1>;
150 compatible = "fsl,dcsr", "simple-bus";
151
152 dcsr-epu@0 {
153 compatible = "fsl,dcsr-epu";
154 interrupts = <52 2 0 0
155 84 2 0 0
156 85 2 0 0>;
157 interrupt-parent = <&mpic>;
158 reg = <0x0 0x1000>;
159 };
160 dcsr-npc {
161 compatible = "fsl,dcsr-npc";
162 reg = <0x1000 0x1000 0x1000000 0x8000>;
163 };
164 dcsr-nxc@2000 {
165 compatible = "fsl,dcsr-nxc";
166 reg = <0x2000 0x1000>;
167 };
168 dcsr-corenet {
169 compatible = "fsl,dcsr-corenet";
170 reg = <0x8000 0x1000 0xB0000 0x1000>;
171 };
172 dcsr-dpaa@9000 {
173 compatible = "fsl,p4080-dcsr-dpaa", "fsl,dcsr-dpaa";
174 reg = <0x9000 0x1000>;
175 };
176 dcsr-ocn@11000 {
177 compatible = "fsl,p4080-dcsr-ocn", "fsl,dcsr-ocn";
178 reg = <0x11000 0x1000>;
179 };
180 dcsr-ddr@12000 {
181 compatible = "fsl,dcsr-ddr";
182 dev-handle = <&ddr1>;
183 reg = <0x12000 0x1000>;
184 };
185 dcsr-ddr@13000 {
186 compatible = "fsl,dcsr-ddr";
187 dev-handle = <&ddr2>;
188 reg = <0x13000 0x1000>;
189 };
190 dcsr-nal@18000 {
191 compatible = "fsl,p4080-dcsr-nal", "fsl,dcsr-nal";
192 reg = <0x18000 0x1000>;
193 };
194 dcsr-rcpm@22000 {
195 compatible = "fsl,p4080-dcsr-rcpm", "fsl,dcsr-rcpm";
196 reg = <0x22000 0x1000>;
197 };
198 dcsr-cpu-sb-proxy@40000 {
199 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
200 cpu-handle = <&cpu0>;
201 reg = <0x40000 0x1000>;
202 };
203 dcsr-cpu-sb-proxy@41000 {
204 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
205 cpu-handle = <&cpu1>;
206 reg = <0x41000 0x1000>;
207 };
208 dcsr-cpu-sb-proxy@42000 {
209 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
210 cpu-handle = <&cpu2>;
211 reg = <0x42000 0x1000>;
212 };
213 dcsr-cpu-sb-proxy@43000 {
214 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
215 cpu-handle = <&cpu3>;
216 reg = <0x43000 0x1000>;
217 };
218 dcsr-cpu-sb-proxy@44000 {
219 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
220 cpu-handle = <&cpu4>;
221 reg = <0x44000 0x1000>;
222 };
223 dcsr-cpu-sb-proxy@45000 {
224 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
225 cpu-handle = <&cpu5>;
226 reg = <0x45000 0x1000>;
227 };
228 dcsr-cpu-sb-proxy@46000 {
229 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
230 cpu-handle = <&cpu6>;
231 reg = <0x46000 0x1000>;
232 };
233 dcsr-cpu-sb-proxy@47000 {
234 compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
235 cpu-handle = <&cpu7>;
236 reg = <0x47000 0x1000>;
237 };
238 };
239
240 soc: soc@ffe000000 {
241 #address-cells = <1>;
242 #size-cells = <1>;
243 device_type = "soc";
244 compatible = "simple-bus";
245 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
246 reg = <0xf 0xfe000000 0 0x00001000>;
247
248 soc-sram-error {
249 compatible = "fsl,soc-sram-error";
250 interrupts = <16 2 1 29>;
251 };
252
253 corenet-law@0 {
254 compatible = "fsl,corenet-law";
255 reg = <0x0 0x1000>;
256 fsl,num-laws = <32>;
257 };
258
259 ddr1: memory-controller@8000 {
260 compatible = "fsl,qoriq-memory-controller-v4.4", "fsl,qoriq-memory-controller";
261 reg = <0x8000 0x1000>;
262 interrupts = <16 2 1 23>;
263 };
264
265 ddr2: memory-controller@9000 {
266 compatible = "fsl,qoriq-memory-controller-v4.4","fsl,qoriq-memory-controller";
267 reg = <0x9000 0x1000>;
268 interrupts = <16 2 1 22>;
269 };
270
271 cpc: l3-cache-controller@10000 {
272 compatible = "fsl,p4080-l3-cache-controller", "cache";
273 reg = <0x10000 0x1000
274 0x11000 0x1000>;
275 interrupts = <16 2 1 27
276 16 2 1 26>;
277 };
278
279 corenet-cf@18000 {
280 compatible = "fsl,corenet-cf";
281 reg = <0x18000 0x1000>;
282 interrupts = <16 2 1 31>;
283 fsl,ccf-num-csdids = <32>;
284 fsl,ccf-num-snoopids = <32>;
285 };
286
287 iommu@20000 {
288 compatible = "fsl,pamu-v1.0", "fsl,pamu";
289 reg = <0x20000 0x5000>;
290 interrupts = <
291 24 2 0 0
292 16 2 1 30>;
293 };
294
295 mpic: pic@40000 {
296 clock-frequency = <0>;
297 interrupt-controller;
298 #address-cells = <0>;
299 #interrupt-cells = <4>;
300 reg = <0x40000 0x40000>;
301 compatible = "fsl,mpic", "chrp,open-pic";
302 device_type = "open-pic";
303 };
304
305 msi0: msi@41600 {
306 compatible = "fsl,mpic-msi";
307 reg = <0x41600 0x200>;
308 msi-available-ranges = <0 0x100>;
309 interrupts = <
310 0xe0 0 0 0
311 0xe1 0 0 0
312 0xe2 0 0 0
313 0xe3 0 0 0
314 0xe4 0 0 0
315 0xe5 0 0 0
316 0xe6 0 0 0
317 0xe7 0 0 0>;
318 };
319
320 msi1: msi@41800 {
321 compatible = "fsl,mpic-msi";
322 reg = <0x41800 0x200>;
323 msi-available-ranges = <0 0x100>;
324 interrupts = <
325 0xe8 0 0 0
326 0xe9 0 0 0
327 0xea 0 0 0
328 0xeb 0 0 0
329 0xec 0 0 0
330 0xed 0 0 0
331 0xee 0 0 0
332 0xef 0 0 0>;
333 };
334
335 msi2: msi@41a00 {
336 compatible = "fsl,mpic-msi";
337 reg = <0x41a00 0x200>;
338 msi-available-ranges = <0 0x100>;
339 interrupts = <
340 0xf0 0 0 0
341 0xf1 0 0 0
342 0xf2 0 0 0
343 0xf3 0 0 0
344 0xf4 0 0 0
345 0xf5 0 0 0
346 0xf6 0 0 0
347 0xf7 0 0 0>;
348 };
349
350 guts: global-utilities@e0000 {
351 compatible = "fsl,qoriq-device-config-1.0";
352 reg = <0xe0000 0xe00>;
353 fsl,has-rstcr;
354 #sleep-cells = <1>;
355 fsl,liodn-bits = <12>;
356 };
357
358 pins: global-utilities@e0e00 {
359 compatible = "fsl,qoriq-pin-control-1.0";
360 reg = <0xe0e00 0x200>;
361 #sleep-cells = <2>;
362 };
363
364 clockgen: global-utilities@e1000 {
365 compatible = "fsl,p4080-clockgen", "fsl,qoriq-clockgen-1.0";
366 reg = <0xe1000 0x1000>;
367 clock-frequency = <0>;
368 };
369
370 rcpm: global-utilities@e2000 {
371 compatible = "fsl,qoriq-rcpm-1.0";
372 reg = <0xe2000 0x1000>;
373 #sleep-cells = <1>;
374 };
375
376 sfp: sfp@e8000 {
377 compatible = "fsl,p4080-sfp", "fsl,qoriq-sfp-1.0";
378 reg = <0xe8000 0x1000>;
379 };
380
381 serdes: serdes@ea000 {
382 compatible = "fsl,p4080-serdes";
383 reg = <0xea000 0x1000>;
384 };
385
386 dma0: dma@100300 {
387 #address-cells = <1>;
388 #size-cells = <1>;
389 compatible = "fsl,p4080-dma", "fsl,eloplus-dma";
390 reg = <0x100300 0x4>;
391 ranges = <0x0 0x100100 0x200>;
392 cell-index = <0>;
393 dma-channel@0 {
394 compatible = "fsl,p4080-dma-channel",
395 "fsl,eloplus-dma-channel";
396 reg = <0x0 0x80>;
397 cell-index = <0>;
398 interrupts = <28 2 0 0>;
399 };
400 dma-channel@80 {
401 compatible = "fsl,p4080-dma-channel",
402 "fsl,eloplus-dma-channel";
403 reg = <0x80 0x80>;
404 cell-index = <1>;
405 interrupts = <29 2 0 0>;
406 };
407 dma-channel@100 {
408 compatible = "fsl,p4080-dma-channel",
409 "fsl,eloplus-dma-channel";
410 reg = <0x100 0x80>;
411 cell-index = <2>;
412 interrupts = <30 2 0 0>;
413 };
414 dma-channel@180 {
415 compatible = "fsl,p4080-dma-channel",
416 "fsl,eloplus-dma-channel";
417 reg = <0x180 0x80>;
418 cell-index = <3>;
419 interrupts = <31 2 0 0>;
420 };
421 };
422
423 dma1: dma@101300 {
424 #address-cells = <1>;
425 #size-cells = <1>;
426 compatible = "fsl,p4080-dma", "fsl,eloplus-dma";
427 reg = <0x101300 0x4>;
428 ranges = <0x0 0x101100 0x200>;
429 cell-index = <1>;
430 dma-channel@0 {
431 compatible = "fsl,p4080-dma-channel",
432 "fsl,eloplus-dma-channel";
433 reg = <0x0 0x80>;
434 cell-index = <0>;
435 interrupts = <32 2 0 0>;
436 };
437 dma-channel@80 {
438 compatible = "fsl,p4080-dma-channel",
439 "fsl,eloplus-dma-channel";
440 reg = <0x80 0x80>;
441 cell-index = <1>;
442 interrupts = <33 2 0 0>;
443 };
444 dma-channel@100 {
445 compatible = "fsl,p4080-dma-channel",
446 "fsl,eloplus-dma-channel";
447 reg = <0x100 0x80>;
448 cell-index = <2>;
449 interrupts = <34 2 0 0>;
450 };
451 dma-channel@180 {
452 compatible = "fsl,p4080-dma-channel",
453 "fsl,eloplus-dma-channel";
454 reg = <0x180 0x80>;
455 cell-index = <3>;
456 interrupts = <35 2 0 0>;
457 };
458 };
459
460 spi@110000 {
461 #address-cells = <1>;
462 #size-cells = <0>;
463 compatible = "fsl,p4080-espi", "fsl,mpc8536-espi";
464 reg = <0x110000 0x1000>;
465 interrupts = <53 0x2 0 0>;
466 fsl,espi-num-chipselects = <4>;
467 };
468
469 sdhc: sdhc@114000 {
470 compatible = "fsl,p4080-esdhc", "fsl,esdhc";
471 reg = <0x114000 0x1000>;
472 interrupts = <48 2 0 0>;
473 voltage-ranges = <3300 3300>;
474 sdhci,auto-cmd12;
475 clock-frequency = <0>;
476 };
477
478 i2c@118000 {
479 #address-cells = <1>;
480 #size-cells = <0>;
481 cell-index = <0>;
482 compatible = "fsl-i2c";
483 reg = <0x118000 0x100>;
484 interrupts = <38 2 0 0>;
485 dfsrr;
486 };
487
488 i2c@118100 {
489 #address-cells = <1>;
490 #size-cells = <0>;
491 cell-index = <1>;
492 compatible = "fsl-i2c";
493 reg = <0x118100 0x100>;
494 interrupts = <38 2 0 0>;
495 dfsrr;
496 };
497
498 i2c@119000 {
499 #address-cells = <1>;
500 #size-cells = <0>;
501 cell-index = <2>;
502 compatible = "fsl-i2c";
503 reg = <0x119000 0x100>;
504 interrupts = <39 2 0 0>;
505 dfsrr;
506 };
507
508 i2c@119100 {
509 #address-cells = <1>;
510 #size-cells = <0>;
511 cell-index = <3>;
512 compatible = "fsl-i2c";
513 reg = <0x119100 0x100>;
514 interrupts = <39 2 0 0>;
515 dfsrr;
516 };
517
518 serial0: serial@11c500 {
519 cell-index = <0>;
520 device_type = "serial";
521 compatible = "ns16550";
522 reg = <0x11c500 0x100>;
523 clock-frequency = <0>;
524 interrupts = <36 2 0 0>;
525 };
526
527 serial1: serial@11c600 {
528 cell-index = <1>;
529 device_type = "serial";
530 compatible = "ns16550";
531 reg = <0x11c600 0x100>;
532 clock-frequency = <0>;
533 interrupts = <36 2 0 0>;
534 };
535
536 serial2: serial@11d500 {
537 cell-index = <2>;
538 device_type = "serial";
539 compatible = "ns16550";
540 reg = <0x11d500 0x100>;
541 clock-frequency = <0>;
542 interrupts = <37 2 0 0>;
543 };
544
545 serial3: serial@11d600 {
546 cell-index = <3>;
547 device_type = "serial";
548 compatible = "ns16550";
549 reg = <0x11d600 0x100>;
550 clock-frequency = <0>;
551 interrupts = <37 2 0 0>;
552 };
553
554 gpio0: gpio@130000 {
555 compatible = "fsl,p4080-gpio", "fsl,qoriq-gpio";
556 reg = <0x130000 0x1000>;
557 interrupts = <55 2 0 0>;
558 #gpio-cells = <2>;
559 gpio-controller;
560 };
561
562 usb0: usb@210000 {
563 compatible = "fsl,p4080-usb2-mph",
564 "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph";
565 reg = <0x210000 0x1000>;
566 #address-cells = <1>;
567 #size-cells = <0>;
568 interrupts = <44 0x2 0 0>;
569 };
570
571 usb1: usb@211000 {
572 compatible = "fsl,p4080-usb2-dr",
573 "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr";
574 reg = <0x211000 0x1000>;
575 #address-cells = <1>;
576 #size-cells = <0>;
577 interrupts = <45 0x2 0 0>;
578 };
579
580 crypto: crypto@300000 {
581 compatible = "fsl,sec-v4.0";
582 #address-cells = <1>;
583 #size-cells = <1>;
584 reg = <0x300000 0x10000>;
585 ranges = <0 0x300000 0x10000>;
586 interrupt-parent = <&mpic>;
587 interrupts = <92 2 0 0>;
588
589 sec_jr0: jr@1000 {
590 compatible = "fsl,sec-v4.0-job-ring";
591 reg = <0x1000 0x1000>;
592 interrupt-parent = <&mpic>;
593 interrupts = <88 2 0 0>;
594 };
595
596 sec_jr1: jr@2000 {
597 compatible = "fsl,sec-v4.0-job-ring";
598 reg = <0x2000 0x1000>;
599 interrupt-parent = <&mpic>;
600 interrupts = <89 2 0 0>;
601 };
602
603 sec_jr2: jr@3000 {
604 compatible = "fsl,sec-v4.0-job-ring";
605 reg = <0x3000 0x1000>;
606 interrupt-parent = <&mpic>;
607 interrupts = <90 2 0 0>;
608 };
609
610 sec_jr3: jr@4000 {
611 compatible = "fsl,sec-v4.0-job-ring";
612 reg = <0x4000 0x1000>;
613 interrupt-parent = <&mpic>;
614 interrupts = <91 2 0 0>;
615 };
616
617 rtic@6000 {
618 compatible = "fsl,sec-v4.0-rtic";
619 #address-cells = <1>;
620 #size-cells = <1>;
621 reg = <0x6000 0x100>;
622 ranges = <0x0 0x6100 0xe00>;
623
624 rtic_a: rtic-a@0 {
625 compatible = "fsl,sec-v4.0-rtic-memory";
626 reg = <0x00 0x20 0x100 0x80>;
627 };
628
629 rtic_b: rtic-b@20 {
630 compatible = "fsl,sec-v4.0-rtic-memory";
631 reg = <0x20 0x20 0x200 0x80>;
632 };
633
634 rtic_c: rtic-c@40 {
635 compatible = "fsl,sec-v4.0-rtic-memory";
636 reg = <0x40 0x20 0x300 0x80>;
637 };
638
639 rtic_d: rtic-d@60 {
640 compatible = "fsl,sec-v4.0-rtic-memory";
641 reg = <0x60 0x20 0x500 0x80>;
642 };
643 };
644 };
645
646 sec_mon: sec_mon@314000 {
647 compatible = "fsl,sec-v4.0-mon";
648 reg = <0x314000 0x1000>;
649 interrupt-parent = <&mpic>;
650 interrupts = <93 2 0 0>;
651 };
652 };
653
654 rapidio0: rapidio@ffe0c0000 {
655 #address-cells = <2>;
656 #size-cells = <2>;
657 compatible = "fsl,rapidio-delta";
658 interrupts = <
659 16 2 1 11 /* err_irq */
660 56 2 0 0 /* bell_outb_irq */
661 57 2 0 0 /* bell_inb_irq */
662 60 2 0 0 /* msg1_tx_irq */
663 61 2 0 0 /* msg1_rx_irq */
664 62 2 0 0 /* msg2_tx_irq */
665 63 2 0 0>; /* msg2_rx_irq */
666 };
667
668 localbus@ffe124000 {
669 compatible = "fsl,p4080-elbc", "fsl,elbc", "simple-bus";
670 interrupts = <25 2 0 0>;
671 #address-cells = <2>;
672 #size-cells = <1>;
673 };
674
675 pci0: pcie@ffe200000 {
676 compatible = "fsl,p4080-pcie";
677 device_type = "pci";
678 #size-cells = <2>;
679 #address-cells = <3>;
680 bus-range = <0x0 0xff>;
681 clock-frequency = <0x1fca055>;
682 fsl,msi = <&msi0>;
683 interrupts = <16 2 1 15>;
684 pcie@0 {
685 reg = <0 0 0 0 0>;
686 #interrupt-cells = <1>;
687 #size-cells = <2>;
688 #address-cells = <3>;
689 device_type = "pci";
690 interrupts = <16 2 1 15>;
691 interrupt-map-mask = <0xf800 0 0 7>;
692 interrupt-map = <
693 /* IDSEL 0x0 */
694 0000 0 0 1 &mpic 40 1 0 0
695 0000 0 0 2 &mpic 1 1 0 0
696 0000 0 0 3 &mpic 2 1 0 0
697 0000 0 0 4 &mpic 3 1 0 0
698 >;
699 };
700 };
701
702 pci1: pcie@ffe201000 {
703 compatible = "fsl,p4080-pcie";
704 device_type = "pci";
705 #size-cells = <2>;
706 #address-cells = <3>;
707 bus-range = <0 0xff>;
708 clock-frequency = <0x1fca055>;
709 fsl,msi = <&msi1>;
710 interrupts = <16 2 1 14>;
711 pcie@0 {
712 reg = <0 0 0 0 0>;
713 #interrupt-cells = <1>;
714 #size-cells = <2>;
715 #address-cells = <3>;
716 device_type = "pci";
717 interrupts = <16 2 1 14>;
718 interrupt-map-mask = <0xf800 0 0 7>;
719 interrupt-map = <
720 /* IDSEL 0x0 */
721 0000 0 0 1 &mpic 41 1 0 0
722 0000 0 0 2 &mpic 5 1 0 0
723 0000 0 0 3 &mpic 6 1 0 0
724 0000 0 0 4 &mpic 7 1 0 0
725 >;
726 };
727 };
728
729 pci2: pcie@ffe202000 {
730 compatible = "fsl,p4080-pcie";
731 device_type = "pci";
732 #size-cells = <2>;
733 #address-cells = <3>;
734 bus-range = <0x0 0xff>;
735 clock-frequency = <0x1fca055>;
736 fsl,msi = <&msi2>;
737 interrupts = <16 2 1 13>;
738 pcie@0 {
739 reg = <0 0 0 0 0>;
740 #interrupt-cells = <1>;
741 #size-cells = <2>;
742 #address-cells = <3>;
743 device_type = "pci";
744 interrupts = <16 2 1 13>;
745 interrupt-map-mask = <0xf800 0 0 7>;
746 interrupt-map = <
747 /* IDSEL 0x0 */
748 0000 0 0 1 &mpic 42 1 0 0
749 0000 0 0 2 &mpic 9 1 0 0
750 0000 0 0 3 &mpic 10 1 0 0
751 0000 0 0 4 &mpic 11 1 0 0
752 >;
753 };
754 };
755};
diff --git a/arch/powerpc/boot/dts/p5020ds.dts b/arch/powerpc/boot/dts/p5020ds.dts
index e6d40999ccd7..1c250684c902 100644
--- a/arch/powerpc/boot/dts/p5020ds.dts
+++ b/arch/powerpc/boot/dts/p5020ds.dts
@@ -32,7 +32,7 @@
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35/include/ "p5020si.dtsi" 35/include/ "fsl/p5020si-pre.dtsi"
36 36
37/ { 37/ {
38 model = "fsl,P5020DS"; 38 model = "fsl,P5020DS";
@@ -50,6 +50,8 @@
50 }; 50 };
51 51
52 soc: soc@ffe000000 { 52 soc: soc@ffe000000 {
53 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
54 reg = <0xf 0xfe000000 0 0x00001000>;
53 spi@110000 { 55 spi@110000 {
54 flash@0 { 56 flash@0 {
55 #address-cells = <1>; 57 #address-cells = <1>;
@@ -99,7 +101,18 @@
99 }; 101 };
100 }; 102 };
101 103
102 localbus@ffe124000 { 104 rio: rapidio@ffe0c0000 {
105 reg = <0xf 0xfe0c0000 0 0x11000>;
106
107 port1 {
108 ranges = <0 0 0xc 0x20000000 0 0x10000000>;
109 };
110 port2 {
111 ranges = <0 0 0xc 0x30000000 0 0x10000000>;
112 };
113 };
114
115 lbc: localbus@ffe124000 {
103 reg = <0xf 0xfe124000 0 0x1000>; 116 reg = <0xf 0xfe124000 0 0x1000>;
104 ranges = <0 0 0xf 0xe8000000 0x08000000 117 ranges = <0 0 0xf 0xe8000000 0x08000000
105 2 0 0xf 0xffa00000 0x00040000 118 2 0 0xf 0xffa00000 0x00040000
@@ -160,7 +173,7 @@
160 reg = <0xf 0xfe200000 0 0x1000>; 173 reg = <0xf 0xfe200000 0 0x1000>;
161 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 174 ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000
162 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 175 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;
163 176 fsl,msi = <&msi0>;
164 pcie@0 { 177 pcie@0 {
165 ranges = <0x02000000 0 0xe0000000 178 ranges = <0x02000000 0 0xe0000000
166 0x02000000 0 0xe0000000 179 0x02000000 0 0xe0000000
@@ -176,6 +189,7 @@
176 reg = <0xf 0xfe201000 0 0x1000>; 189 reg = <0xf 0xfe201000 0 0x1000>;
177 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 190 ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
178 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 191 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>;
192 fsl,msi = <&msi1>;
179 pcie@0 { 193 pcie@0 {
180 ranges = <0x02000000 0 0xe0000000 194 ranges = <0x02000000 0 0xe0000000
181 0x02000000 0 0xe0000000 195 0x02000000 0 0xe0000000
@@ -191,6 +205,7 @@
191 reg = <0xf 0xfe202000 0 0x1000>; 205 reg = <0xf 0xfe202000 0 0x1000>;
192 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 206 ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000
193 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; 207 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;
208 fsl,msi = <&msi2>;
194 pcie@0 { 209 pcie@0 {
195 ranges = <0x02000000 0 0xe0000000 210 ranges = <0x02000000 0 0xe0000000
196 0x02000000 0 0xe0000000 211 0x02000000 0 0xe0000000
@@ -206,6 +221,7 @@
206 reg = <0xf 0xfe203000 0 0x1000>; 221 reg = <0xf 0xfe203000 0 0x1000>;
207 ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000 222 ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000
208 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; 223 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>;
224 fsl,msi = <&msi2>;
209 pcie@0 { 225 pcie@0 {
210 ranges = <0x02000000 0 0xe0000000 226 ranges = <0x02000000 0 0xe0000000
211 0x02000000 0 0xe0000000 227 0x02000000 0 0xe0000000
@@ -217,3 +233,5 @@
217 }; 233 };
218 }; 234 };
219}; 235};
236
237/include/ "fsl/p5020si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p5020si.dtsi b/arch/powerpc/boot/dts/p5020si.dtsi
deleted file mode 100644
index e7948ad71fa3..000000000000
--- a/arch/powerpc/boot/dts/p5020si.dtsi
+++ /dev/null
@@ -1,716 +0,0 @@
1/*
2 * P5020 Silicon Device Tree Source
3 *
4 * Copyright 2010-2011 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/dts-v1/;
36
37/ {
38 compatible = "fsl,P5020";
39 #address-cells = <2>;
40 #size-cells = <2>;
41 interrupt-parent = <&mpic>;
42
43 aliases {
44 ccsr = &soc;
45 dcsr = &dcsr;
46
47 serial0 = &serial0;
48 serial1 = &serial1;
49 serial2 = &serial2;
50 serial3 = &serial3;
51 pci0 = &pci0;
52 pci1 = &pci1;
53 pci2 = &pci2;
54 pci3 = &pci3;
55 usb0 = &usb0;
56 usb1 = &usb1;
57 dma0 = &dma0;
58 dma1 = &dma1;
59 sdhc = &sdhc;
60 msi0 = &msi0;
61 msi1 = &msi1;
62 msi2 = &msi2;
63
64 crypto = &crypto;
65 sec_jr0 = &sec_jr0;
66 sec_jr1 = &sec_jr1;
67 sec_jr2 = &sec_jr2;
68 sec_jr3 = &sec_jr3;
69 rtic_a = &rtic_a;
70 rtic_b = &rtic_b;
71 rtic_c = &rtic_c;
72 rtic_d = &rtic_d;
73 sec_mon = &sec_mon;
74
75/*
76 rio0 = &rapidio0;
77 */
78 };
79
80 cpus {
81 #address-cells = <1>;
82 #size-cells = <0>;
83
84 cpu0: PowerPC,e5500@0 {
85 device_type = "cpu";
86 reg = <0>;
87 next-level-cache = <&L2_0>;
88 L2_0: l2-cache {
89 next-level-cache = <&cpc>;
90 };
91 };
92 cpu1: PowerPC,e5500@1 {
93 device_type = "cpu";
94 reg = <1>;
95 next-level-cache = <&L2_1>;
96 L2_1: l2-cache {
97 next-level-cache = <&cpc>;
98 };
99 };
100 };
101
102 dcsr: dcsr@f00000000 {
103 #address-cells = <1>;
104 #size-cells = <1>;
105 compatible = "fsl,dcsr", "simple-bus";
106
107 dcsr-epu@0 {
108 compatible = "fsl,dcsr-epu";
109 interrupts = <52 2 0 0
110 84 2 0 0
111 85 2 0 0>;
112 interrupt-parent = <&mpic>;
113 reg = <0x0 0x1000>;
114 };
115 dcsr-npc {
116 compatible = "fsl,dcsr-npc";
117 reg = <0x1000 0x1000 0x1000000 0x8000>;
118 };
119 dcsr-nxc@2000 {
120 compatible = "fsl,dcsr-nxc";
121 reg = <0x2000 0x1000>;
122 };
123 dcsr-corenet {
124 compatible = "fsl,dcsr-corenet";
125 reg = <0x8000 0x1000 0xB0000 0x1000>;
126 };
127 dcsr-dpaa@9000 {
128 compatible = "fsl,p5020-dcsr-dpaa", "fsl,dcsr-dpaa";
129 reg = <0x9000 0x1000>;
130 };
131 dcsr-ocn@11000 {
132 compatible = "fsl,p5020-dcsr-ocn", "fsl,dcsr-ocn";
133 reg = <0x11000 0x1000>;
134 };
135 dcsr-ddr@12000 {
136 compatible = "fsl,dcsr-ddr";
137 dev-handle = <&ddr1>;
138 reg = <0x12000 0x1000>;
139 };
140 dcsr-ddr@13000 {
141 compatible = "fsl,dcsr-ddr";
142 dev-handle = <&ddr2>;
143 reg = <0x13000 0x1000>;
144 };
145 dcsr-nal@18000 {
146 compatible = "fsl,p5020-dcsr-nal", "fsl,dcsr-nal";
147 reg = <0x18000 0x1000>;
148 };
149 dcsr-rcpm@22000 {
150 compatible = "fsl,p5020-dcsr-rcpm", "fsl,dcsr-rcpm";
151 reg = <0x22000 0x1000>;
152 };
153 dcsr-cpu-sb-proxy@40000 {
154 compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
155 cpu-handle = <&cpu0>;
156 reg = <0x40000 0x1000>;
157 };
158 dcsr-cpu-sb-proxy@41000 {
159 compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
160 cpu-handle = <&cpu1>;
161 reg = <0x41000 0x1000>;
162 };
163 };
164
165 soc: soc@ffe000000 {
166 #address-cells = <1>;
167 #size-cells = <1>;
168 device_type = "soc";
169 compatible = "simple-bus";
170 ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
171 reg = <0xf 0xfe000000 0 0x00001000>;
172
173 soc-sram-error {
174 compatible = "fsl,soc-sram-error";
175 interrupts = <16 2 1 29>;
176 };
177
178 corenet-law@0 {
179 compatible = "fsl,corenet-law";
180 reg = <0x0 0x1000>;
181 fsl,num-laws = <32>;
182 };
183
184 ddr1: memory-controller@8000 {
185 compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
186 reg = <0x8000 0x1000>;
187 interrupts = <16 2 1 23>;
188 };
189
190 ddr2: memory-controller@9000 {
191 compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
192 reg = <0x9000 0x1000>;
193 interrupts = <16 2 1 22>;
194 };
195
196 cpc: l3-cache-controller@10000 {
197 compatible = "fsl,p5020-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache";
198 reg = <0x10000 0x1000
199 0x11000 0x1000>;
200 interrupts = <16 2 1 27
201 16 2 1 26>;
202 };
203
204 corenet-cf@18000 {
205 compatible = "fsl,corenet-cf";
206 reg = <0x18000 0x1000>;
207 interrupts = <16 2 1 31>;
208 fsl,ccf-num-csdids = <32>;
209 fsl,ccf-num-snoopids = <32>;
210 };
211
212 iommu@20000 {
213 compatible = "fsl,pamu-v1.0", "fsl,pamu";
214 reg = <0x20000 0x4000>;
215 interrupts = <
216 24 2 0 0
217 16 2 1 30>;
218 };
219
220 mpic: pic@40000 {
221 clock-frequency = <0>;
222 interrupt-controller;
223 #address-cells = <0>;
224 #interrupt-cells = <4>;
225 reg = <0x40000 0x40000>;
226 compatible = "fsl,mpic", "chrp,open-pic";
227 device_type = "open-pic";
228 };
229
230 msi0: msi@41600 {
231 compatible = "fsl,mpic-msi";
232 reg = <0x41600 0x200>;
233 msi-available-ranges = <0 0x100>;
234 interrupts = <
235 0xe0 0 0 0
236 0xe1 0 0 0
237 0xe2 0 0 0
238 0xe3 0 0 0
239 0xe4 0 0 0
240 0xe5 0 0 0
241 0xe6 0 0 0
242 0xe7 0 0 0>;
243 };
244
245 msi1: msi@41800 {
246 compatible = "fsl,mpic-msi";
247 reg = <0x41800 0x200>;
248 msi-available-ranges = <0 0x100>;
249 interrupts = <
250 0xe8 0 0 0
251 0xe9 0 0 0
252 0xea 0 0 0
253 0xeb 0 0 0
254 0xec 0 0 0
255 0xed 0 0 0
256 0xee 0 0 0
257 0xef 0 0 0>;
258 };
259
260 msi2: msi@41a00 {
261 compatible = "fsl,mpic-msi";
262 reg = <0x41a00 0x200>;
263 msi-available-ranges = <0 0x100>;
264 interrupts = <
265 0xf0 0 0 0
266 0xf1 0 0 0
267 0xf2 0 0 0
268 0xf3 0 0 0
269 0xf4 0 0 0
270 0xf5 0 0 0
271 0xf6 0 0 0
272 0xf7 0 0 0>;
273 };
274
275 guts: global-utilities@e0000 {
276 compatible = "fsl,qoriq-device-config-1.0";
277 reg = <0xe0000 0xe00>;
278 fsl,has-rstcr;
279 #sleep-cells = <1>;
280 fsl,liodn-bits = <12>;
281 };
282
283 pins: global-utilities@e0e00 {
284 compatible = "fsl,qoriq-pin-control-1.0";
285 reg = <0xe0e00 0x200>;
286 #sleep-cells = <2>;
287 };
288
289 clockgen: global-utilities@e1000 {
290 compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0";
291 reg = <0xe1000 0x1000>;
292 clock-frequency = <0>;
293 };
294
295 rcpm: global-utilities@e2000 {
296 compatible = "fsl,qoriq-rcpm-1.0";
297 reg = <0xe2000 0x1000>;
298 #sleep-cells = <1>;
299 };
300
301 sfp: sfp@e8000 {
302 compatible = "fsl,p5020-sfp", "fsl,qoriq-sfp-1.0";
303 reg = <0xe8000 0x1000>;
304 };
305
306 serdes: serdes@ea000 {
307 compatible = "fsl,p5020-serdes";
308 reg = <0xea000 0x1000>;
309 };
310
311 dma0: dma@100300 {
312 #address-cells = <1>;
313 #size-cells = <1>;
314 compatible = "fsl,p5020-dma", "fsl,eloplus-dma";
315 reg = <0x100300 0x4>;
316 ranges = <0x0 0x100100 0x200>;
317 cell-index = <0>;
318 dma-channel@0 {
319 compatible = "fsl,p5020-dma-channel",
320 "fsl,eloplus-dma-channel";
321 reg = <0x0 0x80>;
322 cell-index = <0>;
323 interrupts = <28 2 0 0>;
324 };
325 dma-channel@80 {
326 compatible = "fsl,p5020-dma-channel",
327 "fsl,eloplus-dma-channel";
328 reg = <0x80 0x80>;
329 cell-index = <1>;
330 interrupts = <29 2 0 0>;
331 };
332 dma-channel@100 {
333 compatible = "fsl,p5020-dma-channel",
334 "fsl,eloplus-dma-channel";
335 reg = <0x100 0x80>;
336 cell-index = <2>;
337 interrupts = <30 2 0 0>;
338 };
339 dma-channel@180 {
340 compatible = "fsl,p5020-dma-channel",
341 "fsl,eloplus-dma-channel";
342 reg = <0x180 0x80>;
343 cell-index = <3>;
344 interrupts = <31 2 0 0>;
345 };
346 };
347
348 dma1: dma@101300 {
349 #address-cells = <1>;
350 #size-cells = <1>;
351 compatible = "fsl,p5020-dma", "fsl,eloplus-dma";
352 reg = <0x101300 0x4>;
353 ranges = <0x0 0x101100 0x200>;
354 cell-index = <1>;
355 dma-channel@0 {
356 compatible = "fsl,p5020-dma-channel",
357 "fsl,eloplus-dma-channel";
358 reg = <0x0 0x80>;
359 cell-index = <0>;
360 interrupts = <32 2 0 0>;
361 };
362 dma-channel@80 {
363 compatible = "fsl,p5020-dma-channel",
364 "fsl,eloplus-dma-channel";
365 reg = <0x80 0x80>;
366 cell-index = <1>;
367 interrupts = <33 2 0 0>;
368 };
369 dma-channel@100 {
370 compatible = "fsl,p5020-dma-channel",
371 "fsl,eloplus-dma-channel";
372 reg = <0x100 0x80>;
373 cell-index = <2>;
374 interrupts = <34 2 0 0>;
375 };
376 dma-channel@180 {
377 compatible = "fsl,p5020-dma-channel",
378 "fsl,eloplus-dma-channel";
379 reg = <0x180 0x80>;
380 cell-index = <3>;
381 interrupts = <35 2 0 0>;
382 };
383 };
384
385 spi@110000 {
386 #address-cells = <1>;
387 #size-cells = <0>;
388 compatible = "fsl,p5020-espi", "fsl,mpc8536-espi";
389 reg = <0x110000 0x1000>;
390 interrupts = <53 0x2 0 0>;
391 fsl,espi-num-chipselects = <4>;
392 };
393
394 sdhc: sdhc@114000 {
395 compatible = "fsl,p5020-esdhc", "fsl,esdhc";
396 reg = <0x114000 0x1000>;
397 interrupts = <48 2 0 0>;
398 sdhci,auto-cmd12;
399 clock-frequency = <0>;
400 };
401
402 i2c@118000 {
403 #address-cells = <1>;
404 #size-cells = <0>;
405 cell-index = <0>;
406 compatible = "fsl-i2c";
407 reg = <0x118000 0x100>;
408 interrupts = <38 2 0 0>;
409 dfsrr;
410 };
411
412 i2c@118100 {
413 #address-cells = <1>;
414 #size-cells = <0>;
415 cell-index = <1>;
416 compatible = "fsl-i2c";
417 reg = <0x118100 0x100>;
418 interrupts = <38 2 0 0>;
419 dfsrr;
420 };
421
422 i2c@119000 {
423 #address-cells = <1>;
424 #size-cells = <0>;
425 cell-index = <2>;
426 compatible = "fsl-i2c";
427 reg = <0x119000 0x100>;
428 interrupts = <39 2 0 0>;
429 dfsrr;
430 };
431
432 i2c@119100 {
433 #address-cells = <1>;
434 #size-cells = <0>;
435 cell-index = <3>;
436 compatible = "fsl-i2c";
437 reg = <0x119100 0x100>;
438 interrupts = <39 2 0 0>;
439 dfsrr;
440 };
441
442 serial0: serial@11c500 {
443 cell-index = <0>;
444 device_type = "serial";
445 compatible = "ns16550";
446 reg = <0x11c500 0x100>;
447 clock-frequency = <0>;
448 interrupts = <36 2 0 0>;
449 };
450
451 serial1: serial@11c600 {
452 cell-index = <1>;
453 device_type = "serial";
454 compatible = "ns16550";
455 reg = <0x11c600 0x100>;
456 clock-frequency = <0>;
457 interrupts = <36 2 0 0>;
458 };
459
460 serial2: serial@11d500 {
461 cell-index = <2>;
462 device_type = "serial";
463 compatible = "ns16550";
464 reg = <0x11d500 0x100>;
465 clock-frequency = <0>;
466 interrupts = <37 2 0 0>;
467 };
468
469 serial3: serial@11d600 {
470 cell-index = <3>;
471 device_type = "serial";
472 compatible = "ns16550";
473 reg = <0x11d600 0x100>;
474 clock-frequency = <0>;
475 interrupts = <37 2 0 0>;
476 };
477
478 gpio0: gpio@130000 {
479 compatible = "fsl,p5020-gpio", "fsl,qoriq-gpio";
480 reg = <0x130000 0x1000>;
481 interrupts = <55 2 0 0>;
482 #gpio-cells = <2>;
483 gpio-controller;
484 };
485
486 usb0: usb@210000 {
487 compatible = "fsl,p5020-usb2-mph",
488 "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph";
489 reg = <0x210000 0x1000>;
490 #address-cells = <1>;
491 #size-cells = <0>;
492 interrupts = <44 0x2 0 0>;
493 phy_type = "utmi";
494 port0;
495 };
496
497 usb1: usb@211000 {
498 compatible = "fsl,p5020-usb2-dr",
499 "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr";
500 reg = <0x211000 0x1000>;
501 #address-cells = <1>;
502 #size-cells = <0>;
503 interrupts = <45 0x2 0 0>;
504 dr_mode = "host";
505 phy_type = "utmi";
506 };
507
508 sata@220000 {
509 compatible = "fsl,p5020-sata", "fsl,pq-sata-v2";
510 reg = <0x220000 0x1000>;
511 interrupts = <68 0x2 0 0>;
512 };
513
514 sata@221000 {
515 compatible = "fsl,p5020-sata", "fsl,pq-sata-v2";
516 reg = <0x221000 0x1000>;
517 interrupts = <69 0x2 0 0>;
518 };
519
520 crypto: crypto@300000 {
521 compatible = "fsl,sec-v4.2", "fsl,sec-v4.0";
522 #address-cells = <1>;
523 #size-cells = <1>;
524 reg = <0x300000 0x10000>;
525 ranges = <0 0x300000 0x10000>;
526 interrupts = <92 2 0 0>;
527
528 sec_jr0: jr@1000 {
529 compatible = "fsl,sec-v4.2-job-ring",
530 "fsl,sec-v4.0-job-ring";
531 reg = <0x1000 0x1000>;
532 interrupts = <88 2 0 0>;
533 };
534
535 sec_jr1: jr@2000 {
536 compatible = "fsl,sec-v4.2-job-ring",
537 "fsl,sec-v4.0-job-ring";
538 reg = <0x2000 0x1000>;
539 interrupts = <89 2 0 0>;
540 };
541
542 sec_jr2: jr@3000 {
543 compatible = "fsl,sec-v4.2-job-ring",
544 "fsl,sec-v4.0-job-ring";
545 reg = <0x3000 0x1000>;
546 interrupts = <90 2 0 0>;
547 };
548
549 sec_jr3: jr@4000 {
550 compatible = "fsl,sec-v4.2-job-ring",
551 "fsl,sec-v4.0-job-ring";
552 reg = <0x4000 0x1000>;
553 interrupts = <91 2 0 0>;
554 };
555
556 rtic@6000 {
557 compatible = "fsl,sec-v4.2-rtic",
558 "fsl,sec-v4.0-rtic";
559 #address-cells = <1>;
560 #size-cells = <1>;
561 reg = <0x6000 0x100>;
562 ranges = <0x0 0x6100 0xe00>;
563
564 rtic_a: rtic-a@0 {
565 compatible = "fsl,sec-v4.2-rtic-memory",
566 "fsl,sec-v4.0-rtic-memory";
567 reg = <0x00 0x20 0x100 0x80>;
568 };
569
570 rtic_b: rtic-b@20 {
571 compatible = "fsl,sec-v4.2-rtic-memory",
572 "fsl,sec-v4.0-rtic-memory";
573 reg = <0x20 0x20 0x200 0x80>;
574 };
575
576 rtic_c: rtic-c@40 {
577 compatible = "fsl,sec-v4.2-rtic-memory",
578 "fsl,sec-v4.0-rtic-memory";
579 reg = <0x40 0x20 0x300 0x80>;
580 };
581
582 rtic_d: rtic-d@60 {
583 compatible = "fsl,sec-v4.2-rtic-memory",
584 "fsl,sec-v4.0-rtic-memory";
585 reg = <0x60 0x20 0x500 0x80>;
586 };
587 };
588 };
589
590 sec_mon: sec_mon@314000 {
591 compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon";
592 reg = <0x314000 0x1000>;
593 interrupts = <93 2 0 0>;
594 };
595 };
596
597/*
598 rapidio0: rapidio@ffe0c0000
599*/
600
601 localbus@ffe124000 {
602 compatible = "fsl,p5020-elbc", "fsl,elbc", "simple-bus";
603 interrupts = <25 2 0 0>;
604 #address-cells = <2>;
605 #size-cells = <1>;
606 };
607
608 pci0: pcie@ffe200000 {
609 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
610 device_type = "pci";
611 #size-cells = <2>;
612 #address-cells = <3>;
613 bus-range = <0x0 0xff>;
614 clock-frequency = <0x1fca055>;
615 fsl,msi = <&msi0>;
616 interrupts = <16 2 1 15>;
617
618 pcie@0 {
619 reg = <0 0 0 0 0>;
620 #interrupt-cells = <1>;
621 #size-cells = <2>;
622 #address-cells = <3>;
623 device_type = "pci";
624 interrupts = <16 2 1 15>;
625 interrupt-map-mask = <0xf800 0 0 7>;
626 interrupt-map = <
627 /* IDSEL 0x0 */
628 0000 0 0 1 &mpic 40 1 0 0
629 0000 0 0 2 &mpic 1 1 0 0
630 0000 0 0 3 &mpic 2 1 0 0
631 0000 0 0 4 &mpic 3 1 0 0
632 >;
633 };
634 };
635
636 pci1: pcie@ffe201000 {
637 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
638 device_type = "pci";
639 #size-cells = <2>;
640 #address-cells = <3>;
641 bus-range = <0 0xff>;
642 clock-frequency = <0x1fca055>;
643 fsl,msi = <&msi1>;
644 interrupts = <16 2 1 14>;
645 pcie@0 {
646 reg = <0 0 0 0 0>;
647 #interrupt-cells = <1>;
648 #size-cells = <2>;
649 #address-cells = <3>;
650 device_type = "pci";
651 interrupts = <16 2 1 14>;
652 interrupt-map-mask = <0xf800 0 0 7>;
653 interrupt-map = <
654 /* IDSEL 0x0 */
655 0000 0 0 1 &mpic 41 1 0 0
656 0000 0 0 2 &mpic 5 1 0 0
657 0000 0 0 3 &mpic 6 1 0 0
658 0000 0 0 4 &mpic 7 1 0 0
659 >;
660 };
661 };
662
663 pci2: pcie@ffe202000 {
664 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
665 device_type = "pci";
666 #size-cells = <2>;
667 #address-cells = <3>;
668 bus-range = <0x0 0xff>;
669 clock-frequency = <0x1fca055>;
670 fsl,msi = <&msi2>;
671 interrupts = <16 2 1 13>;
672 pcie@0 {
673 reg = <0 0 0 0 0>;
674 #interrupt-cells = <1>;
675 #size-cells = <2>;
676 #address-cells = <3>;
677 device_type = "pci";
678 interrupts = <16 2 1 13>;
679 interrupt-map-mask = <0xf800 0 0 7>;
680 interrupt-map = <
681 /* IDSEL 0x0 */
682 0000 0 0 1 &mpic 42 1 0 0
683 0000 0 0 2 &mpic 9 1 0 0
684 0000 0 0 3 &mpic 10 1 0 0
685 0000 0 0 4 &mpic 11 1 0 0
686 >;
687 };
688 };
689
690 pci3: pcie@ffe203000 {
691 compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2";
692 device_type = "pci";
693 #size-cells = <2>;
694 #address-cells = <3>;
695 bus-range = <0x0 0xff>;
696 clock-frequency = <0x1fca055>;
697 fsl,msi = <&msi2>;
698 interrupts = <16 2 1 12>;
699 pcie@0 {
700 reg = <0 0 0 0 0>;
701 #interrupt-cells = <1>;
702 #size-cells = <2>;
703 #address-cells = <3>;
704 device_type = "pci";
705 interrupts = <16 2 1 12>;
706 interrupt-map-mask = <0xf800 0 0 7>;
707 interrupt-map = <
708 /* IDSEL 0x0 */
709 0000 0 0 1 &mpic 43 1 0 0
710 0000 0 0 2 &mpic 0 1 0 0
711 0000 0 0 3 &mpic 4 1 0 0
712 0000 0 0 4 &mpic 8 1 0 0
713 >;
714 };
715 };
716};
diff --git a/arch/powerpc/boot/dts/sbc8349.dts b/arch/powerpc/boot/dts/sbc8349.dts
index 0dc90f9bd814..b1e45a8537a5 100644
--- a/arch/powerpc/boot/dts/sbc8349.dts
+++ b/arch/powerpc/boot/dts/sbc8349.dts
@@ -222,7 +222,7 @@
222 serial0: serial@4500 { 222 serial0: serial@4500 {
223 cell-index = <0>; 223 cell-index = <0>;
224 device_type = "serial"; 224 device_type = "serial";
225 compatible = "ns16550"; 225 compatible = "fsl,ns16550", "ns16550";
226 reg = <0x4500 0x100>; 226 reg = <0x4500 0x100>;
227 clock-frequency = <0>; 227 clock-frequency = <0>;
228 interrupts = <9 0x8>; 228 interrupts = <9 0x8>;
@@ -232,7 +232,7 @@
232 serial1: serial@4600 { 232 serial1: serial@4600 {
233 cell-index = <1>; 233 cell-index = <1>;
234 device_type = "serial"; 234 device_type = "serial";
235 compatible = "ns16550"; 235 compatible = "fsl,ns16550", "ns16550";
236 reg = <0x4600 0x100>; 236 reg = <0x4600 0x100>;
237 clock-frequency = <0>; 237 clock-frequency = <0>;
238 interrupts = <10 0x8>; 238 interrupts = <10 0x8>;
diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts
index 94a332251710..77be77116c2e 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -316,7 +316,7 @@
316 serial0: serial@4500 { 316 serial0: serial@4500 {
317 cell-index = <0>; 317 cell-index = <0>;
318 device_type = "serial"; 318 device_type = "serial";
319 compatible = "ns16550"; 319 compatible = "fsl,ns16550", "ns16550";
320 reg = <0x4500 0x100>; // reg base, size 320 reg = <0x4500 0x100>; // reg base, size
321 clock-frequency = <0>; // should we fill in in uboot? 321 clock-frequency = <0>; // should we fill in in uboot?
322 interrupts = <0x2a 0x2>; 322 interrupts = <0x2a 0x2>;
@@ -326,7 +326,7 @@
326 serial1: serial@4600 { 326 serial1: serial@4600 {
327 cell-index = <1>; 327 cell-index = <1>;
328 device_type = "serial"; 328 device_type = "serial";
329 compatible = "ns16550"; 329 compatible = "fsl,ns16550", "ns16550";
330 reg = <0x4600 0x100>; // reg base, size 330 reg = <0x4600 0x100>; // reg base, size
331 clock-frequency = <0>; // should we fill in in uboot? 331 clock-frequency = <0>; // should we fill in in uboot?
332 interrupts = <0x2a 0x2>; 332 interrupts = <0x2a 0x2>;
diff --git a/arch/powerpc/boot/dts/sbc8641d.dts b/arch/powerpc/boot/dts/sbc8641d.dts
index ee5538feb455..56bebce87842 100644
--- a/arch/powerpc/boot/dts/sbc8641d.dts
+++ b/arch/powerpc/boot/dts/sbc8641d.dts
@@ -347,7 +347,7 @@
347 serial0: serial@4500 { 347 serial0: serial@4500 {
348 cell-index = <0>; 348 cell-index = <0>;
349 device_type = "serial"; 349 device_type = "serial";
350 compatible = "ns16550"; 350 compatible = "fsl,ns16550", "ns16550";
351 reg = <0x4500 0x100>; 351 reg = <0x4500 0x100>;
352 clock-frequency = <0>; 352 clock-frequency = <0>;
353 interrupts = <42 2>; 353 interrupts = <42 2>;
@@ -357,7 +357,7 @@
357 serial1: serial@4600 { 357 serial1: serial@4600 {
358 cell-index = <1>; 358 cell-index = <1>;
359 device_type = "serial"; 359 device_type = "serial";
360 compatible = "ns16550"; 360 compatible = "fsl,ns16550", "ns16550";
361 reg = <0x4600 0x100>; 361 reg = <0x4600 0x100>;
362 clock-frequency = <0>; 362 clock-frequency = <0>;
363 interrupts = <28 2>; 363 interrupts = <28 2>;
diff --git a/arch/powerpc/boot/dts/socrates.dts b/arch/powerpc/boot/dts/socrates.dts
index 38c35404bdc3..134a5ff917e1 100644
--- a/arch/powerpc/boot/dts/socrates.dts
+++ b/arch/powerpc/boot/dts/socrates.dts
@@ -199,7 +199,7 @@
199 serial0: serial@4500 { 199 serial0: serial@4500 {
200 cell-index = <0>; 200 cell-index = <0>;
201 device_type = "serial"; 201 device_type = "serial";
202 compatible = "ns16550"; 202 compatible = "fsl,ns16550", "ns16550";
203 reg = <0x4500 0x100>; 203 reg = <0x4500 0x100>;
204 clock-frequency = <0>; 204 clock-frequency = <0>;
205 interrupts = <42 2>; 205 interrupts = <42 2>;
@@ -209,7 +209,7 @@
209 serial1: serial@4600 { 209 serial1: serial@4600 {
210 cell-index = <1>; 210 cell-index = <1>;
211 device_type = "serial"; 211 device_type = "serial";
212 compatible = "ns16550"; 212 compatible = "fsl,ns16550", "ns16550";
213 reg = <0x4600 0x100>; 213 reg = <0x4600 0x100>;
214 clock-frequency = <0>; 214 clock-frequency = <0>;
215 interrupts = <42 2>; 215 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/storcenter.dts b/arch/powerpc/boot/dts/storcenter.dts
index eab680ce10da..2a555738517e 100644
--- a/arch/powerpc/boot/dts/storcenter.dts
+++ b/arch/powerpc/boot/dts/storcenter.dts
@@ -74,7 +74,7 @@
74 serial0: serial@4500 { 74 serial0: serial@4500 {
75 cell-index = <0>; 75 cell-index = <0>;
76 device_type = "serial"; 76 device_type = "serial";
77 compatible = "ns16550"; 77 compatible = "fsl,ns16550", "ns16550";
78 reg = <0x4500 0x20>; 78 reg = <0x4500 0x20>;
79 clock-frequency = <97553800>; /* Hz */ 79 clock-frequency = <97553800>; /* Hz */
80 current-speed = <115200>; 80 current-speed = <115200>;
@@ -85,7 +85,7 @@
85 serial1: serial@4600 { 85 serial1: serial@4600 {
86 cell-index = <1>; 86 cell-index = <1>;
87 device_type = "serial"; 87 device_type = "serial";
88 compatible = "ns16550"; 88 compatible = "fsl,ns16550", "ns16550";
89 reg = <0x4600 0x20>; 89 reg = <0x4600 0x20>;
90 clock-frequency = <97553800>; /* Hz */ 90 clock-frequency = <97553800>; /* Hz */
91 current-speed = <9600>; 91 current-speed = <9600>;
diff --git a/arch/powerpc/boot/dts/stxssa8555.dts b/arch/powerpc/boot/dts/stxssa8555.dts
index 49efd44057d7..4f166b01c1b6 100644
--- a/arch/powerpc/boot/dts/stxssa8555.dts
+++ b/arch/powerpc/boot/dts/stxssa8555.dts
@@ -210,7 +210,7 @@
210 serial0: serial@4500 { 210 serial0: serial@4500 {
211 cell-index = <0>; 211 cell-index = <0>;
212 device_type = "serial"; 212 device_type = "serial";
213 compatible = "ns16550"; 213 compatible = "fsl,ns16550", "ns16550";
214 reg = <0x4500 0x100>; // reg base, size 214 reg = <0x4500 0x100>; // reg base, size
215 clock-frequency = <0>; // should we fill in in uboot? 215 clock-frequency = <0>; // should we fill in in uboot?
216 interrupts = <42 2>; 216 interrupts = <42 2>;
@@ -220,7 +220,7 @@
220 serial1: serial@4600 { 220 serial1: serial@4600 {
221 cell-index = <1>; 221 cell-index = <1>;
222 device_type = "serial"; 222 device_type = "serial";
223 compatible = "ns16550"; 223 compatible = "fsl,ns16550", "ns16550";
224 reg = <0x4600 0x100>; // reg base, size 224 reg = <0x4600 0x100>; // reg base, size
225 clock-frequency = <0>; // should we fill in in uboot? 225 clock-frequency = <0>; // should we fill in in uboot?
226 interrupts = <42 2>; 226 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/tqm8540.dts b/arch/powerpc/boot/dts/tqm8540.dts
index 0a4cedbdcb55..ed264d9ae356 100644
--- a/arch/powerpc/boot/dts/tqm8540.dts
+++ b/arch/powerpc/boot/dts/tqm8540.dts
@@ -250,7 +250,7 @@
250 serial0: serial@4500 { 250 serial0: serial@4500 {
251 cell-index = <0>; 251 cell-index = <0>;
252 device_type = "serial"; 252 device_type = "serial";
253 compatible = "ns16550"; 253 compatible = "fsl,ns16550", "ns16550";
254 reg = <0x4500 0x100>; // reg base, size 254 reg = <0x4500 0x100>; // reg base, size
255 clock-frequency = <0>; // should we fill in in uboot? 255 clock-frequency = <0>; // should we fill in in uboot?
256 interrupts = <42 2>; 256 interrupts = <42 2>;
@@ -260,7 +260,7 @@
260 serial1: serial@4600 { 260 serial1: serial@4600 {
261 cell-index = <1>; 261 cell-index = <1>;
262 device_type = "serial"; 262 device_type = "serial";
263 compatible = "ns16550"; 263 compatible = "fsl,ns16550", "ns16550";
264 reg = <0x4600 0x100>; // reg base, size 264 reg = <0x4600 0x100>; // reg base, size
265 clock-frequency = <0>; // should we fill in in uboot? 265 clock-frequency = <0>; // should we fill in in uboot?
266 interrupts = <42 2>; 266 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/tqm8541.dts b/arch/powerpc/boot/dts/tqm8541.dts
index f49d09181312..925242115814 100644
--- a/arch/powerpc/boot/dts/tqm8541.dts
+++ b/arch/powerpc/boot/dts/tqm8541.dts
@@ -224,7 +224,7 @@
224 serial0: serial@4500 { 224 serial0: serial@4500 {
225 cell-index = <0>; 225 cell-index = <0>;
226 device_type = "serial"; 226 device_type = "serial";
227 compatible = "ns16550"; 227 compatible = "fsl,ns16550", "ns16550";
228 reg = <0x4500 0x100>; // reg base, size 228 reg = <0x4500 0x100>; // reg base, size
229 clock-frequency = <0>; // should we fill in in uboot? 229 clock-frequency = <0>; // should we fill in in uboot?
230 interrupts = <42 2>; 230 interrupts = <42 2>;
@@ -234,7 +234,7 @@
234 serial1: serial@4600 { 234 serial1: serial@4600 {
235 cell-index = <1>; 235 cell-index = <1>;
236 device_type = "serial"; 236 device_type = "serial";
237 compatible = "ns16550"; 237 compatible = "fsl,ns16550", "ns16550";
238 reg = <0x4600 0x100>; // reg base, size 238 reg = <0x4600 0x100>; // reg base, size
239 clock-frequency = <0>; // should we fill in in uboot? 239 clock-frequency = <0>; // should we fill in in uboot?
240 interrupts = <42 2>; 240 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/tqm8548-bigflash.dts b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
index 9452c3c05114..6e1ac50852a4 100644
--- a/arch/powerpc/boot/dts/tqm8548-bigflash.dts
+++ b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
@@ -305,7 +305,7 @@
305 serial0: serial@4500 { 305 serial0: serial@4500 {
306 cell-index = <0>; 306 cell-index = <0>;
307 device_type = "serial"; 307 device_type = "serial";
308 compatible = "ns16550"; 308 compatible = "fsl,ns16550", "ns16550";
309 reg = <0x4500 0x100>; // reg base, size 309 reg = <0x4500 0x100>; // reg base, size
310 clock-frequency = <0>; // should we fill in in uboot? 310 clock-frequency = <0>; // should we fill in in uboot?
311 current-speed = <115200>; 311 current-speed = <115200>;
@@ -316,7 +316,7 @@
316 serial1: serial@4600 { 316 serial1: serial@4600 {
317 cell-index = <1>; 317 cell-index = <1>;
318 device_type = "serial"; 318 device_type = "serial";
319 compatible = "ns16550"; 319 compatible = "fsl,ns16550", "ns16550";
320 reg = <0x4600 0x100>; // reg base, size 320 reg = <0x4600 0x100>; // reg base, size
321 clock-frequency = <0>; // should we fill in in uboot? 321 clock-frequency = <0>; // should we fill in in uboot?
322 current-speed = <115200>; 322 current-speed = <115200>;
@@ -352,7 +352,7 @@
352 ranges = < 352 ranges = <
353 0 0x0 0xfc000000 0x04000000 // NOR FLASH bank 1 353 0 0x0 0xfc000000 0x04000000 // NOR FLASH bank 1
354 1 0x0 0xf8000000 0x08000000 // NOR FLASH bank 0 354 1 0x0 0xf8000000 0x08000000 // NOR FLASH bank 0
355 2 0x0 0xa3000000 0x00008000 // CAN (2 x i82527) 355 2 0x0 0xa3000000 0x00008000 // CAN (2 x CC770)
356 3 0x0 0xa3010000 0x00008000 // NAND FLASH 356 3 0x0 0xa3010000 0x00008000 // NAND FLASH
357 357
358 >; 358 >;
@@ -393,18 +393,27 @@
393 }; 393 };
394 394
395 /* Note: CAN support needs be enabled in U-Boot */ 395 /* Note: CAN support needs be enabled in U-Boot */
396 can0@2,0 { 396 can@2,0 {
397 compatible = "intel,82527"; // Bosch CC770 397 compatible = "bosch,cc770"; // Bosch CC770
398 reg = <2 0x0 0x100>; 398 reg = <2 0x0 0x100>;
399 interrupts = <4 1>; 399 interrupts = <4 1>;
400 interrupt-parent = <&mpic>; 400 interrupt-parent = <&mpic>;
401 bosch,external-clock-frequency = <16000000>;
402 bosch,disconnect-rx1-input;
403 bosch,disconnect-tx1-output;
404 bosch,iso-low-speed-mux;
405 bosch,clock-out-frequency = <16000000>;
401 }; 406 };
402 407
403 can1@2,100 { 408 can@2,100 {
404 compatible = "intel,82527"; // Bosch CC770 409 compatible = "bosch,cc770"; // Bosch CC770
405 reg = <2 0x100 0x100>; 410 reg = <2 0x100 0x100>;
406 interrupts = <4 1>; 411 interrupts = <4 1>;
407 interrupt-parent = <&mpic>; 412 interrupt-parent = <&mpic>;
413 bosch,external-clock-frequency = <16000000>;
414 bosch,disconnect-rx1-input;
415 bosch,disconnect-tx1-output;
416 bosch,iso-low-speed-mux;
408 }; 417 };
409 418
410 /* Note: NAND support needs to be enabled in U-Boot */ 419 /* Note: NAND support needs to be enabled in U-Boot */
diff --git a/arch/powerpc/boot/dts/tqm8548.dts b/arch/powerpc/boot/dts/tqm8548.dts
index 619776f72c90..161e75eac7f7 100644
--- a/arch/powerpc/boot/dts/tqm8548.dts
+++ b/arch/powerpc/boot/dts/tqm8548.dts
@@ -305,7 +305,7 @@
305 serial0: serial@4500 { 305 serial0: serial@4500 {
306 cell-index = <0>; 306 cell-index = <0>;
307 device_type = "serial"; 307 device_type = "serial";
308 compatible = "ns16550"; 308 compatible = "fsl,ns16550", "ns16550";
309 reg = <0x4500 0x100>; // reg base, size 309 reg = <0x4500 0x100>; // reg base, size
310 clock-frequency = <0>; // should we fill in in uboot? 310 clock-frequency = <0>; // should we fill in in uboot?
311 current-speed = <115200>; 311 current-speed = <115200>;
@@ -316,7 +316,7 @@
316 serial1: serial@4600 { 316 serial1: serial@4600 {
317 cell-index = <1>; 317 cell-index = <1>;
318 device_type = "serial"; 318 device_type = "serial";
319 compatible = "ns16550"; 319 compatible = "fsl,ns16550", "ns16550";
320 reg = <0x4600 0x100>; // reg base, size 320 reg = <0x4600 0x100>; // reg base, size
321 clock-frequency = <0>; // should we fill in in uboot? 321 clock-frequency = <0>; // should we fill in in uboot?
322 current-speed = <115200>; 322 current-speed = <115200>;
@@ -352,7 +352,7 @@
352 ranges = < 352 ranges = <
353 0 0x0 0xfc000000 0x04000000 // NOR FLASH bank 1 353 0 0x0 0xfc000000 0x04000000 // NOR FLASH bank 1
354 1 0x0 0xf8000000 0x08000000 // NOR FLASH bank 0 354 1 0x0 0xf8000000 0x08000000 // NOR FLASH bank 0
355 2 0x0 0xe3000000 0x00008000 // CAN (2 x i82527) 355 2 0x0 0xe3000000 0x00008000 // CAN (2 x CC770)
356 3 0x0 0xe3010000 0x00008000 // NAND FLASH 356 3 0x0 0xe3010000 0x00008000 // NAND FLASH
357 357
358 >; 358 >;
@@ -393,18 +393,27 @@
393 }; 393 };
394 394
395 /* Note: CAN support needs be enabled in U-Boot */ 395 /* Note: CAN support needs be enabled in U-Boot */
396 can0@2,0 { 396 can@2,0 {
397 compatible = "intel,82527"; // Bosch CC770 397 compatible = "bosch,cc770"; // Bosch CC770
398 reg = <2 0x0 0x100>; 398 reg = <2 0x0 0x100>;
399 interrupts = <4 1>; 399 interrupts = <4 1>;
400 interrupt-parent = <&mpic>; 400 interrupt-parent = <&mpic>;
401 bosch,external-clock-frequency = <16000000>;
402 bosch,disconnect-rx1-input;
403 bosch,disconnect-tx1-output;
404 bosch,iso-low-speed-mux;
405 bosch,clock-out-frequency = <16000000>;
401 }; 406 };
402 407
403 can1@2,100 { 408 can@2,100 {
404 compatible = "intel,82527"; // Bosch CC770 409 compatible = "bosch,cc770"; // Bosch CC770
405 reg = <2 0x100 0x100>; 410 reg = <2 0x100 0x100>;
406 interrupts = <4 1>; 411 interrupts = <4 1>;
407 interrupt-parent = <&mpic>; 412 interrupt-parent = <&mpic>;
413 bosch,external-clock-frequency = <16000000>;
414 bosch,disconnect-rx1-input;
415 bosch,disconnect-tx1-output;
416 bosch,iso-low-speed-mux;
408 }; 417 };
409 418
410 /* Note: NAND support needs to be enabled in U-Boot */ 419 /* Note: NAND support needs to be enabled in U-Boot */
diff --git a/arch/powerpc/boot/dts/tqm8555.dts b/arch/powerpc/boot/dts/tqm8555.dts
index 81bad8cd3756..aa6ff0d3dd9a 100644
--- a/arch/powerpc/boot/dts/tqm8555.dts
+++ b/arch/powerpc/boot/dts/tqm8555.dts
@@ -224,7 +224,7 @@
224 serial0: serial@4500 { 224 serial0: serial@4500 {
225 cell-index = <0>; 225 cell-index = <0>;
226 device_type = "serial"; 226 device_type = "serial";
227 compatible = "ns16550"; 227 compatible = "fsl,ns16550", "ns16550";
228 reg = <0x4500 0x100>; // reg base, size 228 reg = <0x4500 0x100>; // reg base, size
229 clock-frequency = <0>; // should we fill in in uboot? 229 clock-frequency = <0>; // should we fill in in uboot?
230 interrupts = <42 2>; 230 interrupts = <42 2>;
@@ -234,7 +234,7 @@
234 serial1: serial@4600 { 234 serial1: serial@4600 {
235 cell-index = <1>; 235 cell-index = <1>;
236 device_type = "serial"; 236 device_type = "serial";
237 compatible = "ns16550"; 237 compatible = "fsl,ns16550", "ns16550";
238 reg = <0x4600 0x100>; // reg base, size 238 reg = <0x4600 0x100>; // reg base, size
239 clock-frequency = <0>; // should we fill in in uboot? 239 clock-frequency = <0>; // should we fill in in uboot?
240 interrupts = <42 2>; 240 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/tqm8xx.dts b/arch/powerpc/boot/dts/tqm8xx.dts
index f6da7ec49a8e..c3dba2518d8c 100644
--- a/arch/powerpc/boot/dts/tqm8xx.dts
+++ b/arch/powerpc/boot/dts/tqm8xx.dts
@@ -57,6 +57,7 @@
57 57
58 ranges = < 58 ranges = <
59 0x0 0x0 0x40000000 0x800000 59 0x0 0x0 0x40000000 0x800000
60 0x3 0x0 0xc0000000 0x200
60 >; 61 >;
61 62
62 flash@0,0 { 63 flash@0,0 {
@@ -67,6 +68,30 @@
67 bank-width = <4>; 68 bank-width = <4>;
68 device-width = <2>; 69 device-width = <2>;
69 }; 70 };
71
72 /* Note: CAN support needs be enabled in U-Boot */
73 can@3,0 {
74 compatible = "intc,82527";
75 reg = <3 0x0 0x80>;
76 interrupts = <8 1>;
77 interrupt-parent = <&PIC>;
78 bosch,external-clock-frequency = <16000000>;
79 bosch,disconnect-rx1-input;
80 bosch,disconnect-tx1-output;
81 bosch,iso-low-speed-mux;
82 bosch,clock-out-frequency = <16000000>;
83 };
84
85 can@3,100 {
86 compatible = "intc,82527";
87 reg = <3 0x100 0x80>;
88 interrupts = <8 1>;
89 interrupt-parent = <&PIC>;
90 bosch,external-clock-frequency = <16000000>;
91 bosch,disconnect-rx1-input;
92 bosch,disconnect-tx1-output;
93 bosch,iso-low-speed-mux;
94 };
70 }; 95 };
71 96
72 soc@fff00000 { 97 soc@fff00000 {
diff --git a/arch/powerpc/boot/dts/xcalibur1501.dts b/arch/powerpc/boot/dts/xcalibur1501.dts
index ac0a617b4299..cc00f4ddd9a7 100644
--- a/arch/powerpc/boot/dts/xcalibur1501.dts
+++ b/arch/powerpc/boot/dts/xcalibur1501.dts
@@ -531,7 +531,7 @@
531 serial0: serial@4500 { 531 serial0: serial@4500 {
532 cell-index = <0>; 532 cell-index = <0>;
533 device_type = "serial"; 533 device_type = "serial";
534 compatible = "ns16550"; 534 compatible = "fsl,ns16550", "ns16550";
535 reg = <0x4500 0x100>; 535 reg = <0x4500 0x100>;
536 clock-frequency = <0>; 536 clock-frequency = <0>;
537 interrupts = <42 2>; 537 interrupts = <42 2>;
@@ -542,7 +542,7 @@
542 serial1: serial@4600 { 542 serial1: serial@4600 {
543 cell-index = <1>; 543 cell-index = <1>;
544 device_type = "serial"; 544 device_type = "serial";
545 compatible = "ns16550"; 545 compatible = "fsl,ns16550", "ns16550";
546 reg = <0x4600 0x100>; 546 reg = <0x4600 0x100>;
547 clock-frequency = <0>; 547 clock-frequency = <0>;
548 interrupts = <42 2>; 548 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/xpedite5200.dts b/arch/powerpc/boot/dts/xpedite5200.dts
index c41a80c55e47..8fd7b7031357 100644
--- a/arch/powerpc/boot/dts/xpedite5200.dts
+++ b/arch/powerpc/boot/dts/xpedite5200.dts
@@ -333,7 +333,7 @@
333 serial0: serial@4500 { 333 serial0: serial@4500 {
334 cell-index = <0>; 334 cell-index = <0>;
335 device_type = "serial"; 335 device_type = "serial";
336 compatible = "ns16550"; 336 compatible = "fsl,ns16550", "ns16550";
337 reg = <0x4500 0x100>; 337 reg = <0x4500 0x100>;
338 clock-frequency = <0>; 338 clock-frequency = <0>;
339 current-speed = <115200>; 339 current-speed = <115200>;
@@ -344,7 +344,7 @@
344 serial1: serial@4600 { 344 serial1: serial@4600 {
345 cell-index = <1>; 345 cell-index = <1>;
346 device_type = "serial"; 346 device_type = "serial";
347 compatible = "ns16550"; 347 compatible = "fsl,ns16550", "ns16550";
348 reg = <0x4600 0x100>; 348 reg = <0x4600 0x100>;
349 clock-frequency = <0>; 349 clock-frequency = <0>;
350 current-speed = <115200>; 350 current-speed = <115200>;
diff --git a/arch/powerpc/boot/dts/xpedite5200_xmon.dts b/arch/powerpc/boot/dts/xpedite5200_xmon.dts
index c0efcbb45137..0baa8283d08c 100644
--- a/arch/powerpc/boot/dts/xpedite5200_xmon.dts
+++ b/arch/powerpc/boot/dts/xpedite5200_xmon.dts
@@ -337,7 +337,7 @@
337 serial0: serial@4500 { 337 serial0: serial@4500 {
338 cell-index = <0>; 338 cell-index = <0>;
339 device_type = "serial"; 339 device_type = "serial";
340 compatible = "ns16550"; 340 compatible = "fsl,ns16550", "ns16550";
341 reg = <0x4500 0x100>; 341 reg = <0x4500 0x100>;
342 clock-frequency = <0>; 342 clock-frequency = <0>;
343 current-speed = <9600>; 343 current-speed = <9600>;
@@ -348,7 +348,7 @@
348 serial1: serial@4600 { 348 serial1: serial@4600 {
349 cell-index = <1>; 349 cell-index = <1>;
350 device_type = "serial"; 350 device_type = "serial";
351 compatible = "ns16550"; 351 compatible = "fsl,ns16550", "ns16550";
352 reg = <0x4600 0x100>; 352 reg = <0x4600 0x100>;
353 clock-frequency = <0>; 353 clock-frequency = <0>;
354 current-speed = <9600>; 354 current-speed = <9600>;
diff --git a/arch/powerpc/boot/dts/xpedite5301.dts b/arch/powerpc/boot/dts/xpedite5301.dts
index db7faf5ebb39..53c1c6a9752f 100644
--- a/arch/powerpc/boot/dts/xpedite5301.dts
+++ b/arch/powerpc/boot/dts/xpedite5301.dts
@@ -441,7 +441,7 @@
441 serial0: serial@4500 { 441 serial0: serial@4500 {
442 cell-index = <0>; 442 cell-index = <0>;
443 device_type = "serial"; 443 device_type = "serial";
444 compatible = "ns16550"; 444 compatible = "fsl,ns16550", "ns16550";
445 reg = <0x4500 0x100>; 445 reg = <0x4500 0x100>;
446 clock-frequency = <0>; 446 clock-frequency = <0>;
447 interrupts = <42 2>; 447 interrupts = <42 2>;
@@ -452,7 +452,7 @@
452 serial1: serial@4600 { 452 serial1: serial@4600 {
453 cell-index = <1>; 453 cell-index = <1>;
454 device_type = "serial"; 454 device_type = "serial";
455 compatible = "ns16550"; 455 compatible = "fsl,ns16550", "ns16550";
456 reg = <0x4600 0x100>; 456 reg = <0x4600 0x100>;
457 clock-frequency = <0>; 457 clock-frequency = <0>;
458 interrupts = <42 2>; 458 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/xpedite5330.dts b/arch/powerpc/boot/dts/xpedite5330.dts
index c364ca6ff7d0..215225983150 100644
--- a/arch/powerpc/boot/dts/xpedite5330.dts
+++ b/arch/powerpc/boot/dts/xpedite5330.dts
@@ -477,7 +477,7 @@
477 serial0: serial@4500 { 477 serial0: serial@4500 {
478 cell-index = <0>; 478 cell-index = <0>;
479 device_type = "serial"; 479 device_type = "serial";
480 compatible = "ns16550"; 480 compatible = "fsl,ns16550", "ns16550";
481 reg = <0x4500 0x100>; 481 reg = <0x4500 0x100>;
482 clock-frequency = <0>; 482 clock-frequency = <0>;
483 interrupts = <42 2>; 483 interrupts = <42 2>;
@@ -488,7 +488,7 @@
488 serial1: serial@4600 { 488 serial1: serial@4600 {
489 cell-index = <1>; 489 cell-index = <1>;
490 device_type = "serial"; 490 device_type = "serial";
491 compatible = "ns16550"; 491 compatible = "fsl,ns16550", "ns16550";
492 reg = <0x4600 0x100>; 492 reg = <0x4600 0x100>;
493 clock-frequency = <0>; 493 clock-frequency = <0>;
494 interrupts = <42 2>; 494 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/dts/xpedite5370.dts b/arch/powerpc/boot/dts/xpedite5370.dts
index 7a8a4afd56cf..11dbda10d756 100644
--- a/arch/powerpc/boot/dts/xpedite5370.dts
+++ b/arch/powerpc/boot/dts/xpedite5370.dts
@@ -439,7 +439,7 @@
439 serial0: serial@4500 { 439 serial0: serial@4500 {
440 cell-index = <0>; 440 cell-index = <0>;
441 device_type = "serial"; 441 device_type = "serial";
442 compatible = "ns16550"; 442 compatible = "fsl,ns16550", "ns16550";
443 reg = <0x4500 0x100>; 443 reg = <0x4500 0x100>;
444 clock-frequency = <0>; 444 clock-frequency = <0>;
445 interrupts = <42 2>; 445 interrupts = <42 2>;
@@ -450,7 +450,7 @@
450 serial1: serial@4600 { 450 serial1: serial@4600 {
451 cell-index = <1>; 451 cell-index = <1>;
452 device_type = "serial"; 452 device_type = "serial";
453 compatible = "ns16550"; 453 compatible = "fsl,ns16550", "ns16550";
454 reg = <0x4600 0x100>; 454 reg = <0x4600 0x100>;
455 clock-frequency = <0>; 455 clock-frequency = <0>;
456 interrupts = <42 2>; 456 interrupts = <42 2>;
diff --git a/arch/powerpc/boot/treeboot-currituck.c b/arch/powerpc/boot/treeboot-currituck.c
new file mode 100644
index 000000000000..925ae43b7467
--- /dev/null
+++ b/arch/powerpc/boot/treeboot-currituck.c
@@ -0,0 +1,119 @@
1/*
2 * Copyright © 2011 Tony Breeds IBM Corporation
3 *
4 * Based on earlier code:
5 * Copyright (C) Paul Mackerras 1997.
6 *
7 * Matt Porter <mporter@kernel.crashing.org>
8 * Copyright 2002-2005 MontaVista Software Inc.
9 *
10 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
11 * Copyright (c) 2003, 2004 Zultys Technologies
12 *
13 * Copyright 2007 David Gibson, IBM Corporation.
14 * Copyright 2010 Ben. Herrenschmidt, IBM Corporation.
15 * Copyright © 2011 David Kleikamp IBM Corporation
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
21 */
22#include <stdarg.h>
23#include <stddef.h>
24#include "types.h"
25#include "elf.h"
26#include "string.h"
27#include "stdio.h"
28#include "page.h"
29#include "ops.h"
30#include "reg.h"
31#include "io.h"
32#include "dcr.h"
33#include "4xx.h"
34#include "44x.h"
35#include "libfdt.h"
36
37BSS_STACK(4096);
38
39#define MAX_RANKS 0x4
40#define DDR3_MR0CF 0x80010011U
41
42static unsigned long long ibm_currituck_memsize;
43static unsigned long long ibm_currituck_detect_memsize(void)
44{
45 u32 reg;
46 unsigned i;
47 unsigned long long memsize = 0;
48
49 for(i = 0; i < MAX_RANKS; i++){
50 reg = mfdcrx(DDR3_MR0CF + i);
51
52 if (!(reg & 1))
53 continue;
54
55 reg &= 0x0000f000;
56 reg >>= 12;
57 memsize += (0x800000ULL << reg);
58 }
59
60 return memsize;
61}
62
63static void ibm_currituck_fixups(void)
64{
65 void *devp = finddevice("/");
66 u32 dma_ranges[7];
67
68 dt_fixup_memory(0x0ULL, ibm_currituck_memsize);
69
70 while ((devp = find_node_by_devtype(devp, "pci"))) {
71 if (getprop(devp, "dma-ranges", dma_ranges, sizeof(dma_ranges)) < 0) {
72 printf("%s: Failed to get dma-ranges\r\n", __func__);
73 continue;
74 }
75
76 dma_ranges[5] = ibm_currituck_memsize >> 32;
77 dma_ranges[6] = ibm_currituck_memsize & 0xffffffffUL;
78
79 setprop(devp, "dma-ranges", dma_ranges, sizeof(dma_ranges));
80 }
81}
82
83#define SPRN_PIR 0x11E /* Processor Indentification Register */
84void platform_init(void)
85{
86 unsigned long end_of_ram, avail_ram;
87 u32 pir_reg;
88 int node, size;
89 const u32 *timebase;
90
91 ibm_currituck_memsize = ibm_currituck_detect_memsize();
92 if (ibm_currituck_memsize >> 32)
93 end_of_ram = ~0UL;
94 else
95 end_of_ram = ibm_currituck_memsize;
96 avail_ram = end_of_ram - (unsigned long)_end;
97
98 simple_alloc_init(_end, avail_ram, 128, 64);
99 platform_ops.fixups = ibm_currituck_fixups;
100 platform_ops.exit = ibm44x_dbcr_reset;
101 pir_reg = mfspr(SPRN_PIR);
102
103 /* Make sure FDT blob is sane */
104 if (fdt_check_header(_dtb_start) != 0)
105 fatal("Invalid device tree blob\n");
106
107 node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
108 "cpu", sizeof("cpu"));
109 if (!node)
110 fatal("Cannot find cpu node\n");
111 timebase = fdt_getprop(_dtb_start, node, "timebase-frequency", &size);
112 if (timebase && (size == 4))
113 timebase_period_ns = 1000000000 / *timebase;
114
115 fdt_set_boot_cpuid_phys(_dtb_start, pir_reg);
116 fdt_init(_dtb_start);
117
118 serial_console_init();
119}
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index c74531af72c0..f090e6d2907e 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -163,7 +163,7 @@ coff)
163 link_address='0x500000' 163 link_address='0x500000'
164 pie= 164 pie=
165 ;; 165 ;;
166miboot|uboot) 166miboot|uboot*)
167 # miboot and U-boot want just the bare bits, not an ELF binary 167 # miboot and U-boot want just the bare bits, not an ELF binary
168 ext=bin 168 ext=bin
169 objflags="-O binary" 169 objflags="-O binary"
@@ -244,6 +244,9 @@ gamecube|wii)
244 link_address='0x600000' 244 link_address='0x600000'
245 platformo="$object/$platform-head.o $object/$platform.o" 245 platformo="$object/$platform-head.o $object/$platform.o"
246 ;; 246 ;;
247treeboot-currituck)
248 link_address='0x1000000'
249 ;;
247treeboot-iss4xx-mpic) 250treeboot-iss4xx-mpic)
248 platformo="$object/treeboot-iss4xx.o" 251 platformo="$object/treeboot-iss4xx.o"
249 ;; 252 ;;
@@ -257,6 +260,8 @@ vmz="$tmpdir/`basename \"$kernel\"`.$ext"
257if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then 260if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
258 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" 261 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
259 262
263 strip_size=$(stat -c %s $vmz.$$)
264
260 if [ -n "$gzip" ]; then 265 if [ -n "$gzip" ]; then
261 gzip -n -f -9 "$vmz.$$" 266 gzip -n -f -9 "$vmz.$$"
262 fi 267 fi
@@ -266,6 +271,24 @@ if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
266 else 271 else
267 vmz="$vmz.$$" 272 vmz="$vmz.$$"
268 fi 273 fi
274else
275 # Calculate the vmlinux.strip size
276 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
277 strip_size=$(stat -c %s $vmz.$$)
278 rm -f $vmz.$$
279fi
280
281# Round the size to next higher MB limit
282round_size=$(((strip_size + 0xfffff) & 0xfff00000))
283
284round_size=0x$(printf "%x" $round_size)
285link_addr=$(printf "%d" $link_address)
286
287if [ $link_addr -lt $strip_size ]; then
288 echo "INFO: Uncompressed kernel (size 0x$(printf "%x\n" $strip_size))" \
289 "overlaps the address of the wrapper($link_address)"
290 echo "INFO: Fixing the link_address of wrapper to ($round_size)"
291 link_address=$round_size
269fi 292fi
270 293
271vmz="$vmz$gzip" 294vmz="$vmz$gzip"
@@ -291,6 +314,26 @@ uboot)
291 fi 314 fi
292 exit 0 315 exit 0
293 ;; 316 ;;
317uboot-obs600)
318 rm -f "$ofile"
319 # obs600 wants a multi image with an initrd, so we need to put a fake
320 # one in even when building a "normal" image.
321 if [ -n "$initrd" ]; then
322 real_rd="$initrd"
323 else
324 real_rd=`mktemp`
325 echo "\0" >>"$real_rd"
326 fi
327 ${MKIMAGE} -A ppc -O linux -T multi -C gzip -a $membase -e $membase \
328 $uboot_version -d "$vmz":"$real_rd":"$dtb" "$ofile"
329 if [ -z "$initrd" ]; then
330 rm -f "$real_rd"
331 fi
332 if [ -z "$cacheit" ]; then
333 rm -f "$vmz"
334 fi
335 exit 0
336 ;;
294esac 337esac
295 338
296addsec() { 339addsec() {
diff --git a/arch/powerpc/configs/40x/klondike_defconfig b/arch/powerpc/configs/40x/klondike_defconfig
new file mode 100644
index 000000000000..c0d228dc73dc
--- /dev/null
+++ b/arch/powerpc/configs/40x/klondike_defconfig
@@ -0,0 +1,55 @@
1CONFIG_40x=y
2CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_SYSFS_DEPRECATED=y
6CONFIG_SYSFS_DEPRECATED_V2=y
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_SYSCTL_SYSCALL=y
9CONFIG_EMBEDDED=y
10CONFIG_SLAB=y
11CONFIG_MODULES=y
12CONFIG_MODULE_UNLOAD=y
13# CONFIG_WALNUT is not set
14CONFIG_APM8018X=y
15# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
16CONFIG_MATH_EMULATION=y
17# CONFIG_MIGRATION is not set
18# CONFIG_SUSPEND is not set
19CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
20CONFIG_PROC_DEVICETREE=y
21CONFIG_BLK_DEV_RAM=y
22CONFIG_BLK_DEV_RAM_SIZE=35000
23CONFIG_SCSI=y
24CONFIG_BLK_DEV_SD=y
25CONFIG_CHR_DEV_SG=y
26CONFIG_SCSI_SAS_ATTRS=y
27# CONFIG_INPUT is not set
28# CONFIG_SERIO is not set
29# CONFIG_VT is not set
30# CONFIG_UNIX98_PTYS is not set
31# CONFIG_LEGACY_PTYS is not set
32# CONFIG_DEVKMEM is not set
33# CONFIG_HW_RANDOM is not set
34# CONFIG_HWMON is not set
35# CONFIG_USB_SUPPORT is not set
36# CONFIG_IOMMU_SUPPORT is not set
37CONFIG_EXT2_FS=y
38CONFIG_EXT3_FS=y
39# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
40CONFIG_EXT4_FS=y
41CONFIG_MSDOS_FS=y
42CONFIG_VFAT_FS=y
43CONFIG_PROC_KCORE=y
44CONFIG_TMPFS=y
45CONFIG_CRAMFS=y
46CONFIG_NLS_CODEPAGE_437=y
47CONFIG_NLS_ASCII=y
48CONFIG_NLS_ISO8859_1=y
49CONFIG_NLS_UTF8=y
50CONFIG_AVERAGE=y
51CONFIG_MAGIC_SYSRQ=y
52# CONFIG_SCHED_DEBUG is not set
53# CONFIG_DEBUG_BUGVERBOSE is not set
54CONFIG_SYSCTL_SYSCALL_CHECK=y
55# CONFIG_FTRACE is not set
diff --git a/arch/powerpc/configs/40x/obs600_defconfig b/arch/powerpc/configs/40x/obs600_defconfig
new file mode 100644
index 000000000000..91c110dad2d6
--- /dev/null
+++ b/arch/powerpc/configs/40x/obs600_defconfig
@@ -0,0 +1,83 @@
1CONFIG_40x=y
2CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_BLK_DEV_INITRD=y
7CONFIG_EXPERT=y
8CONFIG_KALLSYMS_ALL=y
9CONFIG_MODULES=y
10CONFIG_MODULE_UNLOAD=y
11# CONFIG_BLK_DEV_BSG is not set
12# CONFIG_WALNUT is not set
13CONFIG_OBS600=y
14CONFIG_NO_HZ=y
15CONFIG_HIGH_RES_TIMERS=y
16CONFIG_MATH_EMULATION=y
17CONFIG_NET=y
18CONFIG_PACKET=y
19CONFIG_UNIX=y
20CONFIG_INET=y
21CONFIG_IP_PNP=y
22CONFIG_IP_PNP_DHCP=y
23CONFIG_IP_PNP_BOOTP=y
24# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25# CONFIG_INET_XFRM_MODE_TUNNEL is not set
26# CONFIG_INET_XFRM_MODE_BEET is not set
27# CONFIG_INET_LRO is not set
28# CONFIG_IPV6 is not set
29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
30CONFIG_CONNECTOR=y
31CONFIG_MTD=y
32CONFIG_MTD_CMDLINE_PARTS=y
33CONFIG_MTD_OF_PARTS=y
34CONFIG_MTD_CHAR=y
35CONFIG_MTD_BLOCK=y
36CONFIG_MTD_CFI=y
37CONFIG_MTD_JEDECPROBE=y
38CONFIG_MTD_CFI_AMDSTD=y
39CONFIG_MTD_PHYSMAP_OF=y
40CONFIG_MTD_NAND=y
41CONFIG_MTD_NAND_NDFC=y
42CONFIG_PROC_DEVICETREE=y
43CONFIG_BLK_DEV_RAM=y
44CONFIG_BLK_DEV_RAM_SIZE=35000
45CONFIG_NETDEVICES=y
46CONFIG_IBM_EMAC=y
47CONFIG_IBM_EMAC_RXB=256
48CONFIG_IBM_EMAC_TXB=256
49# CONFIG_INPUT is not set
50# CONFIG_SERIO is not set
51# CONFIG_VT is not set
52CONFIG_SERIAL_8250=y
53CONFIG_SERIAL_8250_CONSOLE=y
54CONFIG_SERIAL_8250_EXTENDED=y
55CONFIG_SERIAL_8250_SHARE_IRQ=y
56CONFIG_SERIAL_OF_PLATFORM=y
57# CONFIG_HW_RANDOM is not set
58CONFIG_I2C=y
59CONFIG_I2C_CHARDEV=y
60CONFIG_I2C_IBM_IIC=y
61CONFIG_SENSORS_LM75=y
62CONFIG_THERMAL=y
63# CONFIG_USB_SUPPORT is not set
64CONFIG_RTC_CLASS=y
65CONFIG_RTC_DRV_DS1307=y
66CONFIG_EXT2_FS=y
67CONFIG_PROC_KCORE=y
68CONFIG_TMPFS=y
69CONFIG_CRAMFS=y
70CONFIG_NFS_FS=y
71CONFIG_NFS_V3=y
72CONFIG_ROOT_NFS=y
73CONFIG_MAGIC_SYSRQ=y
74CONFIG_DEBUG_FS=y
75CONFIG_DETECT_HUNG_TASK=y
76CONFIG_SYSCTL_SYSCALL_CHECK=y
77CONFIG_CRYPTO=y
78CONFIG_CRYPTO_CBC=y
79CONFIG_CRYPTO_ECB=y
80CONFIG_CRYPTO_PCBC=y
81CONFIG_CRYPTO_MD5=y
82CONFIG_CRYPTO_DES=y
83# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/powerpc/configs/44x/currituck_defconfig b/arch/powerpc/configs/44x/currituck_defconfig
new file mode 100644
index 000000000000..4192322f8a7f
--- /dev/null
+++ b/arch/powerpc/configs/44x/currituck_defconfig
@@ -0,0 +1,110 @@
1CONFIG_44x=y
2CONFIG_SMP=y
3CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y
5CONFIG_POSIX_MQUEUE=y
6CONFIG_SPARSE_IRQ=y
7CONFIG_LOG_BUF_SHIFT=14
8CONFIG_EXPERT=y
9CONFIG_KALLSYMS_ALL=y
10CONFIG_PROFILING=y
11CONFIG_OPROFILE=y
12CONFIG_MODULES=y
13CONFIG_MODULE_UNLOAD=y
14# CONFIG_BLK_DEV_BSG is not set
15CONFIG_PPC_47x=y
16# CONFIG_EBONY is not set
17CONFIG_CURRITUCK=y
18CONFIG_HIGHMEM=y
19CONFIG_HZ_100=y
20CONFIG_MATH_EMULATION=y
21CONFIG_IRQ_ALL_CPUS=y
22CONFIG_CMDLINE_BOOL=y
23CONFIG_CMDLINE=""
24# CONFIG_SUSPEND is not set
25CONFIG_NET=y
26CONFIG_PACKET=y
27CONFIG_UNIX=y
28CONFIG_INET=y
29CONFIG_IP_PNP=y
30CONFIG_IP_PNP_DHCP=y
31CONFIG_IP_PNP_BOOTP=y
32# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34# CONFIG_INET_XFRM_MODE_BEET is not set
35# CONFIG_INET_LRO is not set
36# CONFIG_IPV6 is not set
37CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
38CONFIG_DEVTMPFS=y
39CONFIG_DEVTMPFS_MOUNT=y
40CONFIG_CONNECTOR=y
41CONFIG_MTD=y
42CONFIG_MTD_CHAR=y
43CONFIG_MTD_BLOCK=y
44CONFIG_MTD_JEDECPROBE=y
45CONFIG_MTD_CFI_AMDSTD=y
46CONFIG_MTD_PHYSMAP_OF=y
47CONFIG_PROC_DEVICETREE=y
48CONFIG_BLK_DEV_RAM=y
49CONFIG_BLK_DEV_RAM_SIZE=35000
50# CONFIG_SCSI_PROC_FS is not set
51CONFIG_BLK_DEV_SD=y
52# CONFIG_SCSI_LOWLEVEL is not set
53CONFIG_ATA=y
54# CONFIG_SATA_PMP is not set
55CONFIG_SATA_SIL24=y
56# CONFIG_ATA_SFF is not set
57CONFIG_NETDEVICES=y
58CONFIG_E1000E=y
59# CONFIG_NETDEV_10000 is not set
60# CONFIG_INPUT is not set
61# CONFIG_SERIO is not set
62# CONFIG_VT is not set
63CONFIG_SERIAL_8250=y
64CONFIG_SERIAL_8250_CONSOLE=y
65CONFIG_SERIAL_8250_EXTENDED=y
66CONFIG_SERIAL_8250_SHARE_IRQ=y
67CONFIG_SERIAL_OF_PLATFORM=y
68# CONFIG_HW_RANDOM is not set
69CONFIG_I2C=y
70CONFIG_I2C_IBM_IIC=y
71# CONFIG_HWMON is not set
72CONFIG_THERMAL=y
73CONFIG_USB=y
74CONFIG_USB_DEBUG=y
75CONFIG_USB_EHCI_HCD=y
76CONFIG_USB_OHCI_HCD=y
77CONFIG_RTC_CLASS=y
78CONFIG_RTC_DRV_M41T80=y
79CONFIG_EXT2_FS=y
80CONFIG_EXT3_FS=y
81# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
82CONFIG_EXT3_FS_POSIX_ACL=y
83CONFIG_EXT3_FS_SECURITY=y
84CONFIG_PROC_KCORE=y
85CONFIG_TMPFS=y
86CONFIG_CRAMFS=y
87CONFIG_NFS_FS=y
88CONFIG_NFS_V3=y
89CONFIG_NFS_V3_ACL=y
90CONFIG_NFS_V4=y
91CONFIG_NLS_DEFAULT="n"
92CONFIG_MAGIC_SYSRQ=y
93CONFIG_DEBUG_FS=y
94CONFIG_DEBUG_KERNEL=y
95CONFIG_DETECT_HUNG_TASK=y
96CONFIG_DEBUG_INFO=y
97CONFIG_SYSCTL_SYSCALL_CHECK=y
98CONFIG_XMON=y
99CONFIG_XMON_DEFAULT=y
100CONFIG_PPC_EARLY_DEBUG=y
101CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0x10000000
102CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x200
103CONFIG_CRYPTO=y
104CONFIG_CRYPTO_CBC=y
105CONFIG_CRYPTO_ECB=y
106CONFIG_CRYPTO_PCBC=y
107CONFIG_CRYPTO_MD5=y
108CONFIG_CRYPTO_DES=y
109# CONFIG_CRYPTO_ANSI_CPRNG is not set
110# CONFIG_CRYPTO_HW is not set
diff --git a/arch/powerpc/configs/44x/iss476-smp_defconfig b/arch/powerpc/configs/44x/iss476-smp_defconfig
index a6eb6ad05b2d..ca00cf750d3e 100644
--- a/arch/powerpc/configs/44x/iss476-smp_defconfig
+++ b/arch/powerpc/configs/44x/iss476-smp_defconfig
@@ -25,7 +25,8 @@ CONFIG_CMDLINE_BOOL=y
25CONFIG_CMDLINE="root=/dev/issblk0" 25CONFIG_CMDLINE="root=/dev/issblk0"
26# CONFIG_PCI is not set 26# CONFIG_PCI is not set
27CONFIG_ADVANCED_OPTIONS=y 27CONFIG_ADVANCED_OPTIONS=y
28CONFIG_RELOCATABLE=y 28CONFIG_NONSTATIC_KERNEL=y
29CONFIG_DYNAMIC_MEMSTART=y
29CONFIG_NET=y 30CONFIG_NET=y
30CONFIG_PACKET=y 31CONFIG_PACKET=y
31CONFIG_UNIX=y 32CONFIG_UNIX=y
diff --git a/arch/powerpc/configs/chroma_defconfig b/arch/powerpc/configs/chroma_defconfig
new file mode 100644
index 000000000000..acf7fb280464
--- /dev/null
+++ b/arch/powerpc/configs/chroma_defconfig
@@ -0,0 +1,307 @@
1CONFIG_PPC64=y
2CONFIG_PPC_BOOK3E_64=y
3# CONFIG_VIRT_CPU_ACCOUNTING is not set
4CONFIG_SMP=y
5CONFIG_NR_CPUS=256
6CONFIG_EXPERIMENTAL=y
7CONFIG_SYSVIPC=y
8CONFIG_POSIX_MQUEUE=y
9CONFIG_BSD_PROCESS_ACCT=y
10CONFIG_TASKSTATS=y
11CONFIG_TASK_DELAY_ACCT=y
12CONFIG_TASK_XACCT=y
13CONFIG_TASK_IO_ACCOUNTING=y
14CONFIG_AUDIT=y
15CONFIG_AUDITSYSCALL=y
16CONFIG_IKCONFIG=y
17CONFIG_IKCONFIG_PROC=y
18CONFIG_LOG_BUF_SHIFT=19
19CONFIG_CGROUPS=y
20CONFIG_CGROUP_DEVICE=y
21CONFIG_CPUSETS=y
22CONFIG_CGROUP_CPUACCT=y
23CONFIG_RESOURCE_COUNTERS=y
24CONFIG_CGROUP_MEM_RES_CTLR=y
25CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
26CONFIG_NAMESPACES=y
27CONFIG_RELAY=y
28CONFIG_BLK_DEV_INITRD=y
29CONFIG_INITRAMFS_SOURCE=""
30CONFIG_RD_BZIP2=y
31CONFIG_RD_LZMA=y
32CONFIG_INITRAMFS_COMPRESSION_GZIP=y
33CONFIG_KALLSYMS_ALL=y
34CONFIG_EMBEDDED=y
35CONFIG_PERF_COUNTERS=y
36CONFIG_PROFILING=y
37CONFIG_OPROFILE=y
38CONFIG_KPROBES=y
39CONFIG_MODULES=y
40CONFIG_MODULE_FORCE_LOAD=y
41CONFIG_MODULE_UNLOAD=y
42CONFIG_MODULE_FORCE_UNLOAD=y
43CONFIG_MODVERSIONS=y
44CONFIG_MODULE_SRCVERSION_ALL=y
45CONFIG_SCOM_DEBUGFS=y
46CONFIG_PPC_A2_DD2=y
47CONFIG_KVM_GUEST=y
48CONFIG_NO_HZ=y
49CONFIG_HIGH_RES_TIMERS=y
50CONFIG_HZ_100=y
51# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
52CONFIG_BINFMT_MISC=y
53CONFIG_NUMA=y
54# CONFIG_MIGRATION is not set
55CONFIG_PPC_64K_PAGES=y
56CONFIG_SCHED_SMT=y
57CONFIG_CMDLINE_BOOL=y
58CONFIG_CMDLINE=""
59# CONFIG_SECCOMP is not set
60CONFIG_PCIEPORTBUS=y
61# CONFIG_PCIEASPM is not set
62CONFIG_PCI_MSI=y
63CONFIG_PACKET=y
64CONFIG_UNIX=y
65CONFIG_XFRM_USER=m
66CONFIG_XFRM_SUB_POLICY=y
67CONFIG_XFRM_STATISTICS=y
68CONFIG_NET_KEY=m
69CONFIG_NET_KEY_MIGRATE=y
70CONFIG_INET=y
71CONFIG_IP_MULTICAST=y
72CONFIG_IP_ADVANCED_ROUTER=y
73CONFIG_IP_ROUTE_MULTIPATH=y
74CONFIG_IP_ROUTE_VERBOSE=y
75CONFIG_IP_PNP=y
76CONFIG_IP_PNP_DHCP=y
77CONFIG_IP_PNP_BOOTP=y
78CONFIG_NET_IPIP=y
79CONFIG_IP_MROUTE=y
80CONFIG_IP_PIMSM_V1=y
81CONFIG_IP_PIMSM_V2=y
82CONFIG_SYN_COOKIES=y
83CONFIG_INET_AH=m
84CONFIG_INET_ESP=m
85CONFIG_INET_IPCOMP=m
86CONFIG_IPV6=y
87CONFIG_IPV6_PRIVACY=y
88CONFIG_IPV6_ROUTER_PREF=y
89CONFIG_IPV6_ROUTE_INFO=y
90CONFIG_IPV6_OPTIMISTIC_DAD=y
91CONFIG_INET6_AH=y
92CONFIG_INET6_ESP=y
93CONFIG_INET6_IPCOMP=y
94CONFIG_IPV6_MIP6=y
95CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y
96CONFIG_IPV6_TUNNEL=y
97CONFIG_IPV6_MULTIPLE_TABLES=y
98CONFIG_IPV6_SUBTREES=y
99CONFIG_IPV6_MROUTE=y
100CONFIG_IPV6_PIMSM_V2=y
101CONFIG_NETFILTER=y
102CONFIG_NF_CONNTRACK=m
103CONFIG_NF_CONNTRACK_EVENTS=y
104CONFIG_NF_CT_PROTO_UDPLITE=m
105CONFIG_NF_CONNTRACK_FTP=m
106CONFIG_NF_CONNTRACK_IRC=m
107CONFIG_NF_CONNTRACK_TFTP=m
108CONFIG_NF_CT_NETLINK=m
109CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
110CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
111CONFIG_NETFILTER_XT_TARGET_MARK=m
112CONFIG_NETFILTER_XT_TARGET_NFLOG=m
113CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
114CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
115CONFIG_NETFILTER_XT_MATCH_COMMENT=m
116CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
117CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
118CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
119CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
120CONFIG_NETFILTER_XT_MATCH_DCCP=m
121CONFIG_NETFILTER_XT_MATCH_DSCP=m
122CONFIG_NETFILTER_XT_MATCH_ESP=m
123CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
124CONFIG_NETFILTER_XT_MATCH_HELPER=m
125CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
126CONFIG_NETFILTER_XT_MATCH_LENGTH=m
127CONFIG_NETFILTER_XT_MATCH_LIMIT=m
128CONFIG_NETFILTER_XT_MATCH_MAC=m
129CONFIG_NETFILTER_XT_MATCH_MARK=m
130CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
131CONFIG_NETFILTER_XT_MATCH_OWNER=m
132CONFIG_NETFILTER_XT_MATCH_POLICY=m
133CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
134CONFIG_NETFILTER_XT_MATCH_QUOTA=m
135CONFIG_NETFILTER_XT_MATCH_RATEEST=m
136CONFIG_NETFILTER_XT_MATCH_REALM=m
137CONFIG_NETFILTER_XT_MATCH_RECENT=m
138CONFIG_NETFILTER_XT_MATCH_SCTP=m
139CONFIG_NETFILTER_XT_MATCH_STATE=m
140CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
141CONFIG_NETFILTER_XT_MATCH_STRING=m
142CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
143CONFIG_NETFILTER_XT_MATCH_TIME=m
144CONFIG_NETFILTER_XT_MATCH_U32=m
145CONFIG_NF_CONNTRACK_IPV4=m
146CONFIG_IP_NF_QUEUE=m
147CONFIG_IP_NF_IPTABLES=m
148CONFIG_IP_NF_MATCH_AH=m
149CONFIG_IP_NF_MATCH_ECN=m
150CONFIG_IP_NF_MATCH_TTL=m
151CONFIG_IP_NF_FILTER=m
152CONFIG_IP_NF_TARGET_REJECT=m
153CONFIG_IP_NF_TARGET_LOG=m
154CONFIG_IP_NF_TARGET_ULOG=m
155CONFIG_NF_NAT=m
156CONFIG_IP_NF_TARGET_MASQUERADE=m
157CONFIG_IP_NF_TARGET_NETMAP=m
158CONFIG_IP_NF_TARGET_REDIRECT=m
159CONFIG_NET_TCPPROBE=y
160# CONFIG_WIRELESS is not set
161CONFIG_NET_9P=y
162CONFIG_NET_9P_DEBUG=y
163CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
164CONFIG_DEVTMPFS=y
165CONFIG_MTD=y
166CONFIG_MTD_CHAR=y
167CONFIG_MTD_BLOCK=y
168CONFIG_MTD_CFI=y
169CONFIG_MTD_CFI_ADV_OPTIONS=y
170CONFIG_MTD_CFI_LE_BYTE_SWAP=y
171CONFIG_MTD_CFI_INTELEXT=y
172CONFIG_MTD_CFI_AMDSTD=y
173CONFIG_MTD_CFI_STAA=y
174CONFIG_MTD_PHYSMAP_OF=y
175CONFIG_PROC_DEVICETREE=y
176CONFIG_BLK_DEV_LOOP=y
177CONFIG_BLK_DEV_CRYPTOLOOP=y
178CONFIG_BLK_DEV_NBD=m
179CONFIG_BLK_DEV_RAM=y
180CONFIG_BLK_DEV_RAM_SIZE=65536
181CONFIG_CDROM_PKTCDVD=y
182CONFIG_MISC_DEVICES=y
183CONFIG_BLK_DEV_SD=y
184CONFIG_BLK_DEV_SR=y
185CONFIG_BLK_DEV_SR_VENDOR=y
186CONFIG_CHR_DEV_SG=y
187CONFIG_SCSI_MULTI_LUN=y
188CONFIG_SCSI_CONSTANTS=y
189CONFIG_SCSI_SPI_ATTRS=y
190CONFIG_SCSI_FC_ATTRS=y
191CONFIG_SCSI_ISCSI_ATTRS=m
192CONFIG_SCSI_SAS_ATTRS=m
193CONFIG_SCSI_SRP_ATTRS=y
194CONFIG_ATA=y
195CONFIG_SATA_AHCI=y
196CONFIG_SATA_SIL24=y
197CONFIG_SATA_MV=y
198CONFIG_SATA_SIL=y
199CONFIG_PATA_CMD64X=y
200CONFIG_PATA_MARVELL=y
201CONFIG_PATA_SIL680=y
202CONFIG_MD=y
203CONFIG_BLK_DEV_MD=y
204CONFIG_MD_LINEAR=y
205CONFIG_BLK_DEV_DM=y
206CONFIG_DM_CRYPT=y
207CONFIG_DM_SNAPSHOT=y
208CONFIG_DM_MIRROR=y
209CONFIG_DM_ZERO=y
210CONFIG_DM_UEVENT=y
211CONFIG_NETDEVICES=y
212CONFIG_TUN=y
213CONFIG_E1000E=y
214CONFIG_TIGON3=y
215# CONFIG_WLAN is not set
216# CONFIG_INPUT is not set
217# CONFIG_SERIO is not set
218# CONFIG_VT is not set
219CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
220CONFIG_SERIAL_8250=y
221CONFIG_SERIAL_8250_CONSOLE=y
222CONFIG_HW_RANDOM=y
223CONFIG_RAW_DRIVER=y
224CONFIG_MAX_RAW_DEVS=1024
225# CONFIG_HWMON is not set
226# CONFIG_VGA_ARB is not set
227# CONFIG_USB_SUPPORT is not set
228CONFIG_EDAC=y
229CONFIG_EDAC_MM_EDAC=y
230CONFIG_RTC_CLASS=y
231CONFIG_RTC_DRV_DS1511=y
232CONFIG_RTC_DRV_DS1553=y
233CONFIG_EXT2_FS=y
234CONFIG_EXT2_FS_XATTR=y
235CONFIG_EXT2_FS_POSIX_ACL=y
236CONFIG_EXT2_FS_SECURITY=y
237CONFIG_EXT2_FS_XIP=y
238CONFIG_EXT3_FS=y
239# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
240CONFIG_EXT3_FS_POSIX_ACL=y
241CONFIG_EXT3_FS_SECURITY=y
242CONFIG_EXT4_FS=y
243# CONFIG_DNOTIFY is not set
244CONFIG_FUSE_FS=y
245CONFIG_ISO9660_FS=y
246CONFIG_JOLIET=y
247CONFIG_ZISOFS=y
248CONFIG_UDF_FS=m
249CONFIG_MSDOS_FS=y
250CONFIG_VFAT_FS=y
251CONFIG_PROC_KCORE=y
252CONFIG_TMPFS=y
253CONFIG_TMPFS_POSIX_ACL=y
254CONFIG_CONFIGFS_FS=m
255CONFIG_CRAMFS=y
256CONFIG_NFS_FS=y
257CONFIG_NFS_V3=y
258CONFIG_NFS_V3_ACL=y
259CONFIG_NFS_V4=y
260CONFIG_NFS_V4_1=y
261CONFIG_ROOT_NFS=y
262CONFIG_CIFS=y
263CONFIG_CIFS_WEAK_PW_HASH=y
264CONFIG_CIFS_XATTR=y
265CONFIG_CIFS_POSIX=y
266CONFIG_NLS_CODEPAGE_437=y
267CONFIG_NLS_ASCII=y
268CONFIG_NLS_ISO8859_1=y
269CONFIG_CRC_CCITT=m
270CONFIG_CRC_T10DIF=y
271CONFIG_LIBCRC32C=m
272CONFIG_PRINTK_TIME=y
273CONFIG_MAGIC_SYSRQ=y
274CONFIG_STRIP_ASM_SYMS=y
275CONFIG_DETECT_HUNG_TASK=y
276# CONFIG_SCHED_DEBUG is not set
277CONFIG_DEBUG_INFO=y
278CONFIG_FTRACE_SYSCALLS=y
279CONFIG_PPC_EMULATED_STATS=y
280CONFIG_XMON=y
281CONFIG_XMON_DEFAULT=y
282CONFIG_VIRQ_DEBUG=y
283CONFIG_PPC_EARLY_DEBUG=y
284CONFIG_KEYS_DEBUG_PROC_KEYS=y
285CONFIG_CRYPTO_NULL=m
286CONFIG_CRYPTO_TEST=m
287CONFIG_CRYPTO_CCM=m
288CONFIG_CRYPTO_GCM=m
289CONFIG_CRYPTO_PCBC=m
290CONFIG_CRYPTO_MICHAEL_MIC=m
291CONFIG_CRYPTO_SHA256=m
292CONFIG_CRYPTO_SHA512=m
293CONFIG_CRYPTO_TGR192=m
294CONFIG_CRYPTO_WP512=m
295CONFIG_CRYPTO_AES=m
296CONFIG_CRYPTO_ANUBIS=m
297CONFIG_CRYPTO_BLOWFISH=m
298CONFIG_CRYPTO_CAST5=m
299CONFIG_CRYPTO_CAST6=m
300CONFIG_CRYPTO_KHAZAD=m
301CONFIG_CRYPTO_SALSA20=m
302CONFIG_CRYPTO_SERPENT=m
303CONFIG_CRYPTO_TEA=m
304CONFIG_CRYPTO_TWOFISH=m
305CONFIG_CRYPTO_LZO=m
306# CONFIG_CRYPTO_ANSI_CPRNG is not set
307CONFIG_VIRTUALIZATION=y
diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig
index f087de6ec03f..f8aef205d222 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -37,6 +37,8 @@ CONFIG_FSL_LBC=y
37CONFIG_PCI=y 37CONFIG_PCI=y
38CONFIG_PCIEPORTBUS=y 38CONFIG_PCIEPORTBUS=y
39# CONFIG_PCIEASPM is not set 39# CONFIG_PCIEASPM is not set
40CONFIG_RAPIDIO=y
41CONFIG_FSL_RIO=y
40CONFIG_NET=y 42CONFIG_NET=y
41CONFIG_PACKET=y 43CONFIG_PACKET=y
42CONFIG_UNIX=y 44CONFIG_UNIX=y
@@ -94,17 +96,17 @@ CONFIG_SATA_SIL24=y
94CONFIG_SATA_SIL=y 96CONFIG_SATA_SIL=y
95CONFIG_PATA_SIL680=y 97CONFIG_PATA_SIL680=y
96CONFIG_NETDEVICES=y 98CONFIG_NETDEVICES=y
97CONFIG_VITESSE_PHY=y 99CONFIG_FSL_PQ_MDIO=y
98CONFIG_FIXED_PHY=y
99CONFIG_NET_ETHERNET=y
100CONFIG_E1000=y 100CONFIG_E1000=y
101CONFIG_E1000E=y 101CONFIG_E1000E=y
102CONFIG_FSL_PQ_MDIO=y 102CONFIG_VITESSE_PHY=y
103CONFIG_FIXED_PHY=y
103# CONFIG_INPUT_MOUSEDEV is not set 104# CONFIG_INPUT_MOUSEDEV is not set
104# CONFIG_INPUT_KEYBOARD is not set 105# CONFIG_INPUT_KEYBOARD is not set
105# CONFIG_INPUT_MOUSE is not set 106# CONFIG_INPUT_MOUSE is not set
106CONFIG_SERIO_LIBPS2=y 107CONFIG_SERIO_LIBPS2=y
107# CONFIG_LEGACY_PTYS is not set 108# CONFIG_LEGACY_PTYS is not set
109CONFIG_PPC_EPAPR_HV_BYTECHAN=y
108CONFIG_SERIAL_8250=y 110CONFIG_SERIAL_8250=y
109CONFIG_SERIAL_8250_CONSOLE=y 111CONFIG_SERIAL_8250_CONSOLE=y
110CONFIG_SERIAL_8250_EXTENDED=y 112CONFIG_SERIAL_8250_EXTENDED=y
@@ -155,6 +157,7 @@ CONFIG_VFAT_FS=y
155CONFIG_NTFS_FS=y 157CONFIG_NTFS_FS=y
156CONFIG_PROC_KCORE=y 158CONFIG_PROC_KCORE=y
157CONFIG_TMPFS=y 159CONFIG_TMPFS=y
160CONFIG_HUGETLBFS=y
158CONFIG_JFFS2_FS=y 161CONFIG_JFFS2_FS=y
159CONFIG_CRAMFS=y 162CONFIG_CRAMFS=y
160CONFIG_NFS_FS=y 163CONFIG_NFS_FS=y
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index 782822c32d15..7ed8d4cf2719 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -23,6 +23,8 @@ CONFIG_P5020_DS=y
23CONFIG_NO_HZ=y 23CONFIG_NO_HZ=y
24CONFIG_HIGH_RES_TIMERS=y 24CONFIG_HIGH_RES_TIMERS=y
25CONFIG_BINFMT_MISC=m 25CONFIG_BINFMT_MISC=m
26CONFIG_RAPIDIO=y
27CONFIG_FSL_RIO=y
26CONFIG_NET=y 28CONFIG_NET=y
27CONFIG_PACKET=y 29CONFIG_PACKET=y
28CONFIG_UNIX=y 30CONFIG_UNIX=y
@@ -57,7 +59,6 @@ CONFIG_MISC_DEVICES=y
57CONFIG_EEPROM_LEGACY=y 59CONFIG_EEPROM_LEGACY=y
58CONFIG_NETDEVICES=y 60CONFIG_NETDEVICES=y
59CONFIG_DUMMY=y 61CONFIG_DUMMY=y
60CONFIG_NET_ETHERNET=y
61CONFIG_INPUT_FF_MEMLESS=m 62CONFIG_INPUT_FF_MEMLESS=m
62# CONFIG_INPUT_MOUSEDEV is not set 63# CONFIG_INPUT_MOUSEDEV is not set
63# CONFIG_INPUT_KEYBOARD is not set 64# CONFIG_INPUT_KEYBOARD is not set
@@ -81,6 +82,7 @@ CONFIG_EXT3_FS=y
81# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 82# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
82CONFIG_PROC_KCORE=y 83CONFIG_PROC_KCORE=y
83CONFIG_TMPFS=y 84CONFIG_TMPFS=y
85CONFIG_HUGETLBFS=y
84# CONFIG_MISC_FILESYSTEMS is not set 86# CONFIG_MISC_FILESYSTEMS is not set
85CONFIG_PARTITION_ADVANCED=y 87CONFIG_PARTITION_ADVANCED=y
86CONFIG_MAC_PARTITION=y 88CONFIG_MAC_PARTITION=y
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index a1e5a178a4ac..f37a2ab48881 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -1,5 +1,4 @@
1CONFIG_PPC_85xx=y 1CONFIG_PPC_85xx=y
2CONFIG_PHYS_64BIT=y
3CONFIG_EXPERIMENTAL=y 2CONFIG_EXPERIMENTAL=y
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
@@ -93,15 +92,14 @@ CONFIG_SATA_FSL=y
93CONFIG_PATA_ALI=y 92CONFIG_PATA_ALI=y
94CONFIG_NETDEVICES=y 93CONFIG_NETDEVICES=y
95CONFIG_DUMMY=y 94CONFIG_DUMMY=y
95CONFIG_FS_ENET=y
96CONFIG_UCC_GETH=y
97CONFIG_GIANFAR=y
96CONFIG_MARVELL_PHY=y 98CONFIG_MARVELL_PHY=y
97CONFIG_DAVICOM_PHY=y 99CONFIG_DAVICOM_PHY=y
98CONFIG_CICADA_PHY=y 100CONFIG_CICADA_PHY=y
99CONFIG_VITESSE_PHY=y 101CONFIG_VITESSE_PHY=y
100CONFIG_FIXED_PHY=y 102CONFIG_FIXED_PHY=y
101CONFIG_NET_ETHERNET=y
102CONFIG_FS_ENET=y
103CONFIG_GIANFAR=y
104CONFIG_UCC_GETH=y
105CONFIG_INPUT_FF_MEMLESS=m 103CONFIG_INPUT_FF_MEMLESS=m
106# CONFIG_INPUT_MOUSEDEV is not set 104# CONFIG_INPUT_MOUSEDEV is not set
107# CONFIG_INPUT_KEYBOARD is not set 105# CONFIG_INPUT_KEYBOARD is not set
@@ -120,6 +118,9 @@ CONFIG_NVRAM=y
120CONFIG_I2C=y 118CONFIG_I2C=y
121CONFIG_I2C_CPM=m 119CONFIG_I2C_CPM=m
122CONFIG_I2C_MPC=y 120CONFIG_I2C_MPC=y
121CONFIG_SPI=y
122CONFIG_SPI_FSL_SPI=y
123CONFIG_SPI_FSL_ESPI=y
123CONFIG_GPIO_MPC8XXX=y 124CONFIG_GPIO_MPC8XXX=y
124# CONFIG_HWMON is not set 125# CONFIG_HWMON is not set
125CONFIG_VIDEO_OUTPUT_CONTROL=y 126CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -163,6 +164,10 @@ CONFIG_USB_OHCI_HCD=y
163CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 164CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
164CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 165CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
165CONFIG_USB_STORAGE=y 166CONFIG_USB_STORAGE=y
167CONFIG_MMC=y
168CONFIG_MMC_SDHCI=y
169CONFIG_MMC_SDHCI_PLTFM=y
170CONFIG_MMC_SDHCI_OF_ESDHC=y
166CONFIG_EDAC=y 171CONFIG_EDAC=y
167CONFIG_EDAC_MM_EDAC=y 172CONFIG_EDAC_MM_EDAC=y
168CONFIG_RTC_CLASS=y 173CONFIG_RTC_CLASS=y
@@ -182,6 +187,7 @@ CONFIG_VFAT_FS=y
182CONFIG_NTFS_FS=y 187CONFIG_NTFS_FS=y
183CONFIG_PROC_KCORE=y 188CONFIG_PROC_KCORE=y
184CONFIG_TMPFS=y 189CONFIG_TMPFS=y
190CONFIG_HUGETLBFS=y
185CONFIG_ADFS_FS=m 191CONFIG_ADFS_FS=m
186CONFIG_AFFS_FS=m 192CONFIG_AFFS_FS=m
187CONFIG_HFS_FS=m 193CONFIG_HFS_FS=m
@@ -213,4 +219,5 @@ CONFIG_CRYPTO_SHA256=y
213CONFIG_CRYPTO_SHA512=y 219CONFIG_CRYPTO_SHA512=y
214CONFIG_CRYPTO_AES=y 220CONFIG_CRYPTO_AES=y
215# CONFIG_CRYPTO_ANSI_CPRNG is not set 221# CONFIG_CRYPTO_ANSI_CPRNG is not set
222CONFIG_CRYPTO_DEV_FSL_CAAM=y
216CONFIG_CRYPTO_DEV_TALITOS=y 223CONFIG_CRYPTO_DEV_TALITOS=y
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index dd1e41386c4c..abdcd317cda7 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -1,5 +1,4 @@
1CONFIG_PPC_85xx=y 1CONFIG_PPC_85xx=y
2CONFIG_PHYS_64BIT=y
3CONFIG_SMP=y 2CONFIG_SMP=y
4CONFIG_NR_CPUS=8 3CONFIG_NR_CPUS=8
5CONFIG_EXPERIMENTAL=y 4CONFIG_EXPERIMENTAL=y
@@ -26,6 +25,7 @@ CONFIG_MPC85xx_MDS=y
26CONFIG_MPC8536_DS=y 25CONFIG_MPC8536_DS=y
27CONFIG_MPC85xx_DS=y 26CONFIG_MPC85xx_DS=y
28CONFIG_MPC85xx_RDB=y 27CONFIG_MPC85xx_RDB=y
28CONFIG_P1010_RDB=y
29CONFIG_P1022_DS=y 29CONFIG_P1022_DS=y
30CONFIG_P1023_RDS=y 30CONFIG_P1023_RDS=y
31CONFIG_SOCRATES=y 31CONFIG_SOCRATES=y
@@ -94,15 +94,14 @@ CONFIG_SATA_FSL=y
94CONFIG_PATA_ALI=y 94CONFIG_PATA_ALI=y
95CONFIG_NETDEVICES=y 95CONFIG_NETDEVICES=y
96CONFIG_DUMMY=y 96CONFIG_DUMMY=y
97CONFIG_FS_ENET=y
98CONFIG_UCC_GETH=y
99CONFIG_GIANFAR=y
97CONFIG_MARVELL_PHY=y 100CONFIG_MARVELL_PHY=y
98CONFIG_DAVICOM_PHY=y 101CONFIG_DAVICOM_PHY=y
99CONFIG_CICADA_PHY=y 102CONFIG_CICADA_PHY=y
100CONFIG_VITESSE_PHY=y 103CONFIG_VITESSE_PHY=y
101CONFIG_FIXED_PHY=y 104CONFIG_FIXED_PHY=y
102CONFIG_NET_ETHERNET=y
103CONFIG_FS_ENET=y
104CONFIG_GIANFAR=y
105CONFIG_UCC_GETH=y
106CONFIG_INPUT_FF_MEMLESS=m 105CONFIG_INPUT_FF_MEMLESS=m
107# CONFIG_INPUT_MOUSEDEV is not set 106# CONFIG_INPUT_MOUSEDEV is not set
108# CONFIG_INPUT_KEYBOARD is not set 107# CONFIG_INPUT_KEYBOARD is not set
@@ -121,6 +120,9 @@ CONFIG_NVRAM=y
121CONFIG_I2C=y 120CONFIG_I2C=y
122CONFIG_I2C_CPM=m 121CONFIG_I2C_CPM=m
123CONFIG_I2C_MPC=y 122CONFIG_I2C_MPC=y
123CONFIG_SPI=y
124CONFIG_SPI_FSL_SPI=y
125CONFIG_SPI_FSL_ESPI=y
124CONFIG_GPIO_MPC8XXX=y 126CONFIG_GPIO_MPC8XXX=y
125# CONFIG_HWMON is not set 127# CONFIG_HWMON is not set
126CONFIG_VIDEO_OUTPUT_CONTROL=y 128CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -164,6 +166,10 @@ CONFIG_USB_OHCI_HCD=y
164CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 166CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
165CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 167CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
166CONFIG_USB_STORAGE=y 168CONFIG_USB_STORAGE=y
169CONFIG_MMC=y
170CONFIG_MMC_SDHCI=y
171CONFIG_MMC_SDHCI_PLTFM=y
172CONFIG_MMC_SDHCI_OF_ESDHC=y
167CONFIG_EDAC=y 173CONFIG_EDAC=y
168CONFIG_EDAC_MM_EDAC=y 174CONFIG_EDAC_MM_EDAC=y
169CONFIG_RTC_CLASS=y 175CONFIG_RTC_CLASS=y
@@ -183,6 +189,7 @@ CONFIG_VFAT_FS=y
183CONFIG_NTFS_FS=y 189CONFIG_NTFS_FS=y
184CONFIG_PROC_KCORE=y 190CONFIG_PROC_KCORE=y
185CONFIG_TMPFS=y 191CONFIG_TMPFS=y
192CONFIG_HUGETLBFS=y
186CONFIG_ADFS_FS=m 193CONFIG_ADFS_FS=m
187CONFIG_AFFS_FS=m 194CONFIG_AFFS_FS=m
188CONFIG_HFS_FS=m 195CONFIG_HFS_FS=m
@@ -214,4 +221,5 @@ CONFIG_CRYPTO_SHA256=y
214CONFIG_CRYPTO_SHA512=y 221CONFIG_CRYPTO_SHA512=y
215CONFIG_CRYPTO_AES=y 222CONFIG_CRYPTO_AES=y
216# CONFIG_CRYPTO_ANSI_CPRNG is not set 223# CONFIG_CRYPTO_ANSI_CPRNG is not set
224CONFIG_CRYPTO_DEV_FSL_CAAM=y
217CONFIG_CRYPTO_DEV_TALITOS=y 225CONFIG_CRYPTO_DEV_TALITOS=y
diff --git a/arch/powerpc/configs/ppc44x_defconfig b/arch/powerpc/configs/ppc44x_defconfig
index 6cdf1c0d2c8a..3b98d7354341 100644
--- a/arch/powerpc/configs/ppc44x_defconfig
+++ b/arch/powerpc/configs/ppc44x_defconfig
@@ -52,6 +52,8 @@ CONFIG_MTD_CFI=y
52CONFIG_MTD_JEDECPROBE=y 52CONFIG_MTD_JEDECPROBE=y
53CONFIG_MTD_CFI_AMDSTD=y 53CONFIG_MTD_CFI_AMDSTD=y
54CONFIG_MTD_PHYSMAP_OF=y 54CONFIG_MTD_PHYSMAP_OF=y
55CONFIG_MTD_NAND=m
56CONFIG_MTD_NAND_NDFC=m
55CONFIG_MTD_UBI=m 57CONFIG_MTD_UBI=m
56CONFIG_MTD_UBI_GLUEBI=m 58CONFIG_MTD_UBI_GLUEBI=m
57CONFIG_PROC_DEVICETREE=y 59CONFIG_PROC_DEVICETREE=y
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 535711fcb13c..2156e077859b 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -390,6 +390,11 @@ CONFIG_HUGETLBFS=y
390CONFIG_HFS_FS=m 390CONFIG_HFS_FS=m
391CONFIG_HFSPLUS_FS=m 391CONFIG_HFSPLUS_FS=m
392CONFIG_CRAMFS=m 392CONFIG_CRAMFS=m
393CONFIG_SQUASHFS=m
394CONFIG_SQUASHFS_XATTR=y
395CONFIG_SQUASHFS_ZLIB=y
396CONFIG_SQUASHFS_LZO=y
397CONFIG_SQUASHFS_XZ=y
393CONFIG_NFS_FS=y 398CONFIG_NFS_FS=y
394CONFIG_NFS_V3=y 399CONFIG_NFS_V3=y
395CONFIG_NFS_V3_ACL=y 400CONFIG_NFS_V3_ACL=y
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index 185c292b0f1c..ded867871e97 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -6,10 +6,10 @@ CONFIG_NR_CPUS=2
6CONFIG_EXPERIMENTAL=y 6CONFIG_EXPERIMENTAL=y
7CONFIG_SYSVIPC=y 7CONFIG_SYSVIPC=y
8CONFIG_POSIX_MQUEUE=y 8CONFIG_POSIX_MQUEUE=y
9CONFIG_NAMESPACES=y 9CONFIG_SPARSE_IRQ=y
10CONFIG_BLK_DEV_INITRD=y 10CONFIG_BLK_DEV_INITRD=y
11CONFIG_EXPERT=y 11CONFIG_CC_OPTIMIZE_FOR_SIZE=y
12CONFIG_KALLSYMS_EXTRA_PASS=y 12CONFIG_EMBEDDED=y
13# CONFIG_PERF_EVENTS is not set 13# CONFIG_PERF_EVENTS is not set
14# CONFIG_COMPAT_BRK is not set 14# CONFIG_COMPAT_BRK is not set
15CONFIG_SLAB=y 15CONFIG_SLAB=y
@@ -17,6 +17,7 @@ CONFIG_PROFILING=y
17CONFIG_OPROFILE=m 17CONFIG_OPROFILE=m
18CONFIG_MODULES=y 18CONFIG_MODULES=y
19CONFIG_MODULE_UNLOAD=y 19CONFIG_MODULE_UNLOAD=y
20# CONFIG_PPC_POWERNV is not set
20# CONFIG_PPC_PSERIES is not set 21# CONFIG_PPC_PSERIES is not set
21# CONFIG_PPC_PMAC is not set 22# CONFIG_PPC_PMAC is not set
22CONFIG_PPC_PS3=y 23CONFIG_PPC_PS3=y
@@ -27,14 +28,14 @@ CONFIG_PS3_VRAM=m
27CONFIG_PS3_LPM=m 28CONFIG_PS3_LPM=m
28# CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set 29# CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set
29CONFIG_HIGH_RES_TIMERS=y 30CONFIG_HIGH_RES_TIMERS=y
31# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
30CONFIG_BINFMT_MISC=y 32CONFIG_BINFMT_MISC=y
31CONFIG_KEXEC=y 33CONFIG_KEXEC=y
32CONFIG_SPARSE_IRQ=y
33# CONFIG_SPARSEMEM_VMEMMAP is not set 34# CONFIG_SPARSEMEM_VMEMMAP is not set
34CONFIG_SCHED_SMT=y 35CONFIG_SCHED_SMT=y
35CONFIG_CMDLINE_BOOL=y 36CONFIG_CMDLINE_BOOL=y
36CONFIG_CMDLINE="" 37CONFIG_CMDLINE=""
37CONFIG_PM=y 38CONFIG_PM_RUNTIME=y
38CONFIG_PM_DEBUG=y 39CONFIG_PM_DEBUG=y
39# CONFIG_SECCOMP is not set 40# CONFIG_SECCOMP is not set
40# CONFIG_PCI is not set 41# CONFIG_PCI is not set
@@ -81,20 +82,23 @@ CONFIG_SCSI_MULTI_LUN=y
81CONFIG_MD=y 82CONFIG_MD=y
82CONFIG_BLK_DEV_DM=m 83CONFIG_BLK_DEV_DM=m
83CONFIG_NETDEVICES=y 84CONFIG_NETDEVICES=y
84CONFIG_NET_ETHERNET=y 85# CONFIG_NET_VENDOR_BROADCOM is not set
86# CONFIG_NET_VENDOR_CHELSIO is not set
87# CONFIG_NET_VENDOR_INTEL is not set
88# CONFIG_NET_VENDOR_MARVELL is not set
89# CONFIG_NET_VENDOR_MICREL is not set
90# CONFIG_NET_VENDOR_NATSEMI is not set
91# CONFIG_NET_VENDOR_SEEQ is not set
92# CONFIG_NET_VENDOR_STMICRO is not set
85CONFIG_GELIC_NET=y 93CONFIG_GELIC_NET=y
86CONFIG_GELIC_WIRELESS=y 94CONFIG_GELIC_WIRELESS=y
87# CONFIG_NETDEV_10000 is not set 95# CONFIG_NET_VENDOR_XILINX is not set
88CONFIG_USB_USBNET=m 96CONFIG_USB_USBNET=m
89# CONFIG_USB_NET_CDCETHER is not set 97# CONFIG_USB_NET_CDCETHER is not set
98# CONFIG_USB_NET_CDC_NCM is not set
90# CONFIG_USB_NET_NET1080 is not set 99# CONFIG_USB_NET_NET1080 is not set
91# CONFIG_USB_NET_CDC_SUBSET is not set 100# CONFIG_USB_NET_CDC_SUBSET is not set
92# CONFIG_USB_NET_ZAURUS is not set 101# CONFIG_USB_NET_ZAURUS is not set
93CONFIG_PPP=m
94CONFIG_PPP_MULTILINK=y
95CONFIG_PPP_ASYNC=m
96CONFIG_PPP_DEFLATE=m
97CONFIG_PPPOE=m
98CONFIG_INPUT_FF_MEMLESS=m 102CONFIG_INPUT_FF_MEMLESS=m
99# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 103# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
100CONFIG_INPUT_JOYDEV=m 104CONFIG_INPUT_JOYDEV=m
@@ -135,22 +139,21 @@ CONFIG_USB=m
135CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 139CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
136CONFIG_USB_DEVICEFS=y 140CONFIG_USB_DEVICEFS=y
137# CONFIG_USB_DEVICE_CLASS is not set 141# CONFIG_USB_DEVICE_CLASS is not set
142CONFIG_USB_SUSPEND=y
138CONFIG_USB_MON=m 143CONFIG_USB_MON=m
139CONFIG_USB_EHCI_HCD=m 144CONFIG_USB_EHCI_HCD=m
140CONFIG_USB_EHCI_TT_NEWSCHED=y
141# CONFIG_USB_EHCI_HCD_PPC_OF is not set 145# CONFIG_USB_EHCI_HCD_PPC_OF is not set
142CONFIG_USB_OHCI_HCD=m 146CONFIG_USB_OHCI_HCD=m
143CONFIG_USB_STORAGE=m 147CONFIG_USB_STORAGE=m
144CONFIG_RTC_CLASS=y 148CONFIG_RTC_CLASS=y
145CONFIG_RTC_DRV_PS3=m 149CONFIG_RTC_DRV_PS3=y
150# CONFIG_IOMMU_SUPPORT is not set
146CONFIG_EXT2_FS=m 151CONFIG_EXT2_FS=m
147CONFIG_EXT3_FS=m 152CONFIG_EXT3_FS=m
148# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 153# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
149CONFIG_EXT4_FS=y 154CONFIG_EXT4_FS=y
150CONFIG_INOTIFY=y
151CONFIG_QUOTA=y 155CONFIG_QUOTA=y
152CONFIG_QFMT_V2=y 156CONFIG_QFMT_V2=y
153CONFIG_AUTOFS_FS=m
154CONFIG_AUTOFS4_FS=m 157CONFIG_AUTOFS4_FS=m
155CONFIG_ISO9660_FS=m 158CONFIG_ISO9660_FS=m
156CONFIG_JOLIET=y 159CONFIG_JOLIET=y
@@ -167,19 +170,17 @@ CONFIG_CIFS=m
167CONFIG_NLS=y 170CONFIG_NLS=y
168CONFIG_NLS_CODEPAGE_437=y 171CONFIG_NLS_CODEPAGE_437=y
169CONFIG_NLS_ISO8859_1=y 172CONFIG_NLS_ISO8859_1=y
173CONFIG_CRC_CCITT=m
170CONFIG_CRC_T10DIF=y 174CONFIG_CRC_T10DIF=y
171CONFIG_MAGIC_SYSRQ=y 175CONFIG_MAGIC_SYSRQ=y
172CONFIG_DEBUG_FS=y 176CONFIG_DEBUG_FS=y
173CONFIG_DEBUG_KERNEL=y
174CONFIG_DETECT_HUNG_TASK=y 177CONFIG_DETECT_HUNG_TASK=y
175CONFIG_PROVE_LOCKING=y 178CONFIG_PROVE_LOCKING=y
176CONFIG_DEBUG_LOCKDEP=y 179CONFIG_DEBUG_LOCKDEP=y
177CONFIG_DEBUG_SPINLOCK_SLEEP=y
178CONFIG_DEBUG_INFO=y 180CONFIG_DEBUG_INFO=y
179CONFIG_DEBUG_WRITECOUNT=y 181CONFIG_DEBUG_WRITECOUNT=y
180CONFIG_DEBUG_MEMORY_INIT=y 182CONFIG_DEBUG_MEMORY_INIT=y
181CONFIG_DEBUG_LIST=y 183CONFIG_DEBUG_LIST=y
182# CONFIG_RCU_CPU_STALL_DETECTOR is not set
183CONFIG_SYSCTL_SYSCALL_CHECK=y 184CONFIG_SYSCTL_SYSCALL_CHECK=y
184# CONFIG_FTRACE is not set 185# CONFIG_FTRACE is not set
185CONFIG_DEBUG_STACKOVERFLOW=y 186CONFIG_DEBUG_STACKOVERFLOW=y
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index a72f2415a647..30e7d0d20e49 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -304,6 +304,11 @@ CONFIG_PROC_KCORE=y
304CONFIG_TMPFS=y 304CONFIG_TMPFS=y
305CONFIG_HUGETLBFS=y 305CONFIG_HUGETLBFS=y
306CONFIG_CRAMFS=m 306CONFIG_CRAMFS=m
307CONFIG_SQUASHFS=m
308CONFIG_SQUASHFS_XATTR=y
309CONFIG_SQUASHFS_ZLIB=y
310CONFIG_SQUASHFS_LZO=y
311CONFIG_SQUASHFS_XZ=y
307CONFIG_NFS_FS=y 312CONFIG_NFS_FS=y
308CONFIG_NFS_V3=y 313CONFIG_NFS_V3=y
309CONFIG_NFS_V3_ACL=y 314CONFIG_NFS_V3_ACL=y
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index d51df17c7e6f..7e313f1ed183 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -34,3 +34,5 @@ header-y += termios.h
34header-y += types.h 34header-y += types.h
35header-y += ucontext.h 35header-y += ucontext.h
36header-y += unistd.h 36header-y += unistd.h
37
38generic-y += rwsem.h
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
index e2a4c26ad377..02e41b53488d 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -49,13 +49,13 @@ static __inline__ int atomic_add_return(int a, atomic_t *v)
49 int t; 49 int t;
50 50
51 __asm__ __volatile__( 51 __asm__ __volatile__(
52 PPC_RELEASE_BARRIER 52 PPC_ATOMIC_ENTRY_BARRIER
53"1: lwarx %0,0,%2 # atomic_add_return\n\ 53"1: lwarx %0,0,%2 # atomic_add_return\n\
54 add %0,%1,%0\n" 54 add %0,%1,%0\n"
55 PPC405_ERR77(0,%2) 55 PPC405_ERR77(0,%2)
56" stwcx. %0,0,%2 \n\ 56" stwcx. %0,0,%2 \n\
57 bne- 1b" 57 bne- 1b"
58 PPC_ACQUIRE_BARRIER 58 PPC_ATOMIC_EXIT_BARRIER
59 : "=&r" (t) 59 : "=&r" (t)
60 : "r" (a), "r" (&v->counter) 60 : "r" (a), "r" (&v->counter)
61 : "cc", "memory"); 61 : "cc", "memory");
@@ -85,13 +85,13 @@ static __inline__ int atomic_sub_return(int a, atomic_t *v)
85 int t; 85 int t;
86 86
87 __asm__ __volatile__( 87 __asm__ __volatile__(
88 PPC_RELEASE_BARRIER 88 PPC_ATOMIC_ENTRY_BARRIER
89"1: lwarx %0,0,%2 # atomic_sub_return\n\ 89"1: lwarx %0,0,%2 # atomic_sub_return\n\
90 subf %0,%1,%0\n" 90 subf %0,%1,%0\n"
91 PPC405_ERR77(0,%2) 91 PPC405_ERR77(0,%2)
92" stwcx. %0,0,%2 \n\ 92" stwcx. %0,0,%2 \n\
93 bne- 1b" 93 bne- 1b"
94 PPC_ACQUIRE_BARRIER 94 PPC_ATOMIC_EXIT_BARRIER
95 : "=&r" (t) 95 : "=&r" (t)
96 : "r" (a), "r" (&v->counter) 96 : "r" (a), "r" (&v->counter)
97 : "cc", "memory"); 97 : "cc", "memory");
@@ -119,13 +119,13 @@ static __inline__ int atomic_inc_return(atomic_t *v)
119 int t; 119 int t;
120 120
121 __asm__ __volatile__( 121 __asm__ __volatile__(
122 PPC_RELEASE_BARRIER 122 PPC_ATOMIC_ENTRY_BARRIER
123"1: lwarx %0,0,%1 # atomic_inc_return\n\ 123"1: lwarx %0,0,%1 # atomic_inc_return\n\
124 addic %0,%0,1\n" 124 addic %0,%0,1\n"
125 PPC405_ERR77(0,%1) 125 PPC405_ERR77(0,%1)
126" stwcx. %0,0,%1 \n\ 126" stwcx. %0,0,%1 \n\
127 bne- 1b" 127 bne- 1b"
128 PPC_ACQUIRE_BARRIER 128 PPC_ATOMIC_EXIT_BARRIER
129 : "=&r" (t) 129 : "=&r" (t)
130 : "r" (&v->counter) 130 : "r" (&v->counter)
131 : "cc", "xer", "memory"); 131 : "cc", "xer", "memory");
@@ -163,13 +163,13 @@ static __inline__ int atomic_dec_return(atomic_t *v)
163 int t; 163 int t;
164 164
165 __asm__ __volatile__( 165 __asm__ __volatile__(
166 PPC_RELEASE_BARRIER 166 PPC_ATOMIC_ENTRY_BARRIER
167"1: lwarx %0,0,%1 # atomic_dec_return\n\ 167"1: lwarx %0,0,%1 # atomic_dec_return\n\
168 addic %0,%0,-1\n" 168 addic %0,%0,-1\n"
169 PPC405_ERR77(0,%1) 169 PPC405_ERR77(0,%1)
170" stwcx. %0,0,%1\n\ 170" stwcx. %0,0,%1\n\
171 bne- 1b" 171 bne- 1b"
172 PPC_ACQUIRE_BARRIER 172 PPC_ATOMIC_EXIT_BARRIER
173 : "=&r" (t) 173 : "=&r" (t)
174 : "r" (&v->counter) 174 : "r" (&v->counter)
175 : "cc", "xer", "memory"); 175 : "cc", "xer", "memory");
@@ -194,7 +194,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
194 int t; 194 int t;
195 195
196 __asm__ __volatile__ ( 196 __asm__ __volatile__ (
197 PPC_RELEASE_BARRIER 197 PPC_ATOMIC_ENTRY_BARRIER
198"1: lwarx %0,0,%1 # __atomic_add_unless\n\ 198"1: lwarx %0,0,%1 # __atomic_add_unless\n\
199 cmpw 0,%0,%3 \n\ 199 cmpw 0,%0,%3 \n\
200 beq- 2f \n\ 200 beq- 2f \n\
@@ -202,7 +202,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
202 PPC405_ERR77(0,%2) 202 PPC405_ERR77(0,%2)
203" stwcx. %0,0,%1 \n\ 203" stwcx. %0,0,%1 \n\
204 bne- 1b \n" 204 bne- 1b \n"
205 PPC_ACQUIRE_BARRIER 205 PPC_ATOMIC_EXIT_BARRIER
206" subf %0,%2,%0 \n\ 206" subf %0,%2,%0 \n\
2072:" 2072:"
208 : "=&r" (t) 208 : "=&r" (t)
@@ -226,7 +226,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
226 int t; 226 int t;
227 227
228 __asm__ __volatile__( 228 __asm__ __volatile__(
229 PPC_RELEASE_BARRIER 229 PPC_ATOMIC_ENTRY_BARRIER
230"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ 230"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\
231 cmpwi %0,1\n\ 231 cmpwi %0,1\n\
232 addi %0,%0,-1\n\ 232 addi %0,%0,-1\n\
@@ -234,7 +234,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
234 PPC405_ERR77(0,%1) 234 PPC405_ERR77(0,%1)
235" stwcx. %0,0,%1\n\ 235" stwcx. %0,0,%1\n\
236 bne- 1b" 236 bne- 1b"
237 PPC_ACQUIRE_BARRIER 237 PPC_ATOMIC_EXIT_BARRIER
238 "\n\ 238 "\n\
2392:" : "=&b" (t) 2392:" : "=&b" (t)
240 : "r" (&v->counter) 240 : "r" (&v->counter)
@@ -285,12 +285,12 @@ static __inline__ long atomic64_add_return(long a, atomic64_t *v)
285 long t; 285 long t;
286 286
287 __asm__ __volatile__( 287 __asm__ __volatile__(
288 PPC_RELEASE_BARRIER 288 PPC_ATOMIC_ENTRY_BARRIER
289"1: ldarx %0,0,%2 # atomic64_add_return\n\ 289"1: ldarx %0,0,%2 # atomic64_add_return\n\
290 add %0,%1,%0\n\ 290 add %0,%1,%0\n\
291 stdcx. %0,0,%2 \n\ 291 stdcx. %0,0,%2 \n\
292 bne- 1b" 292 bne- 1b"
293 PPC_ACQUIRE_BARRIER 293 PPC_ATOMIC_EXIT_BARRIER
294 : "=&r" (t) 294 : "=&r" (t)
295 : "r" (a), "r" (&v->counter) 295 : "r" (a), "r" (&v->counter)
296 : "cc", "memory"); 296 : "cc", "memory");
@@ -319,12 +319,12 @@ static __inline__ long atomic64_sub_return(long a, atomic64_t *v)
319 long t; 319 long t;
320 320
321 __asm__ __volatile__( 321 __asm__ __volatile__(
322 PPC_RELEASE_BARRIER 322 PPC_ATOMIC_ENTRY_BARRIER
323"1: ldarx %0,0,%2 # atomic64_sub_return\n\ 323"1: ldarx %0,0,%2 # atomic64_sub_return\n\
324 subf %0,%1,%0\n\ 324 subf %0,%1,%0\n\
325 stdcx. %0,0,%2 \n\ 325 stdcx. %0,0,%2 \n\
326 bne- 1b" 326 bne- 1b"
327 PPC_ACQUIRE_BARRIER 327 PPC_ATOMIC_EXIT_BARRIER
328 : "=&r" (t) 328 : "=&r" (t)
329 : "r" (a), "r" (&v->counter) 329 : "r" (a), "r" (&v->counter)
330 : "cc", "memory"); 330 : "cc", "memory");
@@ -351,12 +351,12 @@ static __inline__ long atomic64_inc_return(atomic64_t *v)
351 long t; 351 long t;
352 352
353 __asm__ __volatile__( 353 __asm__ __volatile__(
354 PPC_RELEASE_BARRIER 354 PPC_ATOMIC_ENTRY_BARRIER
355"1: ldarx %0,0,%1 # atomic64_inc_return\n\ 355"1: ldarx %0,0,%1 # atomic64_inc_return\n\
356 addic %0,%0,1\n\ 356 addic %0,%0,1\n\
357 stdcx. %0,0,%1 \n\ 357 stdcx. %0,0,%1 \n\
358 bne- 1b" 358 bne- 1b"
359 PPC_ACQUIRE_BARRIER 359 PPC_ATOMIC_EXIT_BARRIER
360 : "=&r" (t) 360 : "=&r" (t)
361 : "r" (&v->counter) 361 : "r" (&v->counter)
362 : "cc", "xer", "memory"); 362 : "cc", "xer", "memory");
@@ -393,12 +393,12 @@ static __inline__ long atomic64_dec_return(atomic64_t *v)
393 long t; 393 long t;
394 394
395 __asm__ __volatile__( 395 __asm__ __volatile__(
396 PPC_RELEASE_BARRIER 396 PPC_ATOMIC_ENTRY_BARRIER
397"1: ldarx %0,0,%1 # atomic64_dec_return\n\ 397"1: ldarx %0,0,%1 # atomic64_dec_return\n\
398 addic %0,%0,-1\n\ 398 addic %0,%0,-1\n\
399 stdcx. %0,0,%1\n\ 399 stdcx. %0,0,%1\n\
400 bne- 1b" 400 bne- 1b"
401 PPC_ACQUIRE_BARRIER 401 PPC_ATOMIC_EXIT_BARRIER
402 : "=&r" (t) 402 : "=&r" (t)
403 : "r" (&v->counter) 403 : "r" (&v->counter)
404 : "cc", "xer", "memory"); 404 : "cc", "xer", "memory");
@@ -418,13 +418,13 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
418 long t; 418 long t;
419 419
420 __asm__ __volatile__( 420 __asm__ __volatile__(
421 PPC_RELEASE_BARRIER 421 PPC_ATOMIC_ENTRY_BARRIER
422"1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\ 422"1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\
423 addic. %0,%0,-1\n\ 423 addic. %0,%0,-1\n\
424 blt- 2f\n\ 424 blt- 2f\n\
425 stdcx. %0,0,%1\n\ 425 stdcx. %0,0,%1\n\
426 bne- 1b" 426 bne- 1b"
427 PPC_ACQUIRE_BARRIER 427 PPC_ATOMIC_EXIT_BARRIER
428 "\n\ 428 "\n\
4292:" : "=&r" (t) 4292:" : "=&r" (t)
430 : "r" (&v->counter) 430 : "r" (&v->counter)
@@ -450,14 +450,14 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
450 long t; 450 long t;
451 451
452 __asm__ __volatile__ ( 452 __asm__ __volatile__ (
453 PPC_RELEASE_BARRIER 453 PPC_ATOMIC_ENTRY_BARRIER
454"1: ldarx %0,0,%1 # __atomic_add_unless\n\ 454"1: ldarx %0,0,%1 # __atomic_add_unless\n\
455 cmpd 0,%0,%3 \n\ 455 cmpd 0,%0,%3 \n\
456 beq- 2f \n\ 456 beq- 2f \n\
457 add %0,%2,%0 \n" 457 add %0,%2,%0 \n"
458" stdcx. %0,0,%1 \n\ 458" stdcx. %0,0,%1 \n\
459 bne- 1b \n" 459 bne- 1b \n"
460 PPC_ACQUIRE_BARRIER 460 PPC_ATOMIC_EXIT_BARRIER
461" subf %0,%2,%0 \n\ 461" subf %0,%2,%0 \n\
4622:" 4622:"
463 : "=&r" (t) 463 : "=&r" (t)
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index e137afcc10fa..efdc92618b38 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -124,14 +124,14 @@ static __inline__ unsigned long fn( \
124 return (old & mask); \ 124 return (old & mask); \
125} 125}
126 126
127DEFINE_TESTOP(test_and_set_bits, or, PPC_RELEASE_BARRIER, 127DEFINE_TESTOP(test_and_set_bits, or, PPC_ATOMIC_ENTRY_BARRIER,
128 PPC_ACQUIRE_BARRIER, 0) 128 PPC_ATOMIC_EXIT_BARRIER, 0)
129DEFINE_TESTOP(test_and_set_bits_lock, or, "", 129DEFINE_TESTOP(test_and_set_bits_lock, or, "",
130 PPC_ACQUIRE_BARRIER, 1) 130 PPC_ACQUIRE_BARRIER, 1)
131DEFINE_TESTOP(test_and_clear_bits, andc, PPC_RELEASE_BARRIER, 131DEFINE_TESTOP(test_and_clear_bits, andc, PPC_ATOMIC_ENTRY_BARRIER,
132 PPC_ACQUIRE_BARRIER, 0) 132 PPC_ATOMIC_EXIT_BARRIER, 0)
133DEFINE_TESTOP(test_and_change_bits, xor, PPC_RELEASE_BARRIER, 133DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
134 PPC_ACQUIRE_BARRIER, 0) 134 PPC_ATOMIC_EXIT_BARRIER, 0)
135 135
136static __inline__ int test_and_set_bit(unsigned long nr, 136static __inline__ int test_and_set_bit(unsigned long nr,
137 volatile unsigned long *addr) 137 volatile unsigned long *addr)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index e30442c539ce..ad55a1ccb9fb 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -201,6 +201,7 @@ extern const char *powerpc_base_platform;
201#define CPU_FTR_POPCNTB LONG_ASM_CONST(0x0400000000000000) 201#define CPU_FTR_POPCNTB LONG_ASM_CONST(0x0400000000000000)
202#define CPU_FTR_POPCNTD LONG_ASM_CONST(0x0800000000000000) 202#define CPU_FTR_POPCNTD LONG_ASM_CONST(0x0800000000000000)
203#define CPU_FTR_ICSWX LONG_ASM_CONST(0x1000000000000000) 203#define CPU_FTR_ICSWX LONG_ASM_CONST(0x1000000000000000)
204#define CPU_FTR_VMX_COPY LONG_ASM_CONST(0x2000000000000000)
204 205
205#ifndef __ASSEMBLY__ 206#ifndef __ASSEMBLY__
206 207
@@ -425,7 +426,7 @@ extern const char *powerpc_base_platform;
425 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 426 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
426 CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ 427 CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \
427 CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ 428 CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
428 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE) 429 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY)
429#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 430#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
430 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 431 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
431 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 432 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -437,7 +438,7 @@ extern const char *powerpc_base_platform;
437#define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2) 438#define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2)
438 439
439#define CPU_FTRS_A2 (CPU_FTR_USE_TB | CPU_FTR_SMT | CPU_FTR_DBELL | \ 440#define CPU_FTRS_A2 (CPU_FTR_USE_TB | CPU_FTR_SMT | CPU_FTR_DBELL | \
440 CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN) 441 CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN | CPU_FTR_ICSWX)
441 442
442#ifdef __powerpc64__ 443#ifdef __powerpc64__
443#ifdef CONFIG_PPC_BOOK3E 444#ifdef CONFIG_PPC_BOOK3E
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h
index 1cf20bdfbeca..487d46ff68a1 100644
--- a/arch/powerpc/include/asm/cputime.h
+++ b/arch/powerpc/include/asm/cputime.h
@@ -29,25 +29,8 @@ static inline void setup_cputime_one_jiffy(void) { }
29#include <asm/time.h> 29#include <asm/time.h>
30#include <asm/param.h> 30#include <asm/param.h>
31 31
32typedef u64 cputime_t; 32typedef u64 __nocast cputime_t;
33typedef u64 cputime64_t; 33typedef u64 __nocast cputime64_t;
34
35#define cputime_zero ((cputime_t)0)
36#define cputime_max ((~((cputime_t)0) >> 1) - 1)
37#define cputime_add(__a, __b) ((__a) + (__b))
38#define cputime_sub(__a, __b) ((__a) - (__b))
39#define cputime_div(__a, __n) ((__a) / (__n))
40#define cputime_halve(__a) ((__a) >> 1)
41#define cputime_eq(__a, __b) ((__a) == (__b))
42#define cputime_gt(__a, __b) ((__a) > (__b))
43#define cputime_ge(__a, __b) ((__a) >= (__b))
44#define cputime_lt(__a, __b) ((__a) < (__b))
45#define cputime_le(__a, __b) ((__a) <= (__b))
46
47#define cputime64_zero ((cputime64_t)0)
48#define cputime64_add(__a, __b) ((__a) + (__b))
49#define cputime64_sub(__a, __b) ((__a) - (__b))
50#define cputime_to_cputime64(__ct) (__ct)
51 34
52#ifdef __KERNEL__ 35#ifdef __KERNEL__
53 36
@@ -65,7 +48,7 @@ DECLARE_PER_CPU(unsigned long, cputime_scaled_last_delta);
65 48
66static inline unsigned long cputime_to_jiffies(const cputime_t ct) 49static inline unsigned long cputime_to_jiffies(const cputime_t ct)
67{ 50{
68 return mulhdu(ct, __cputime_jiffies_factor); 51 return mulhdu((__force u64) ct, __cputime_jiffies_factor);
69} 52}
70 53
71/* Estimate the scaled cputime by scaling the real cputime based on 54/* Estimate the scaled cputime by scaling the real cputime based on
@@ -74,14 +57,15 @@ static inline cputime_t cputime_to_scaled(const cputime_t ct)
74{ 57{
75 if (cpu_has_feature(CPU_FTR_SPURR) && 58 if (cpu_has_feature(CPU_FTR_SPURR) &&
76 __get_cpu_var(cputime_last_delta)) 59 __get_cpu_var(cputime_last_delta))
77 return ct * __get_cpu_var(cputime_scaled_last_delta) / 60 return (__force u64) ct *
78 __get_cpu_var(cputime_last_delta); 61 __get_cpu_var(cputime_scaled_last_delta) /
62 __get_cpu_var(cputime_last_delta);
79 return ct; 63 return ct;
80} 64}
81 65
82static inline cputime_t jiffies_to_cputime(const unsigned long jif) 66static inline cputime_t jiffies_to_cputime(const unsigned long jif)
83{ 67{
84 cputime_t ct; 68 u64 ct;
85 unsigned long sec; 69 unsigned long sec;
86 70
87 /* have to be a little careful about overflow */ 71 /* have to be a little careful about overflow */
@@ -93,7 +77,7 @@ static inline cputime_t jiffies_to_cputime(const unsigned long jif)
93 } 77 }
94 if (sec) 78 if (sec)
95 ct += (cputime_t) sec * tb_ticks_per_sec; 79 ct += (cputime_t) sec * tb_ticks_per_sec;
96 return ct; 80 return (__force cputime_t) ct;
97} 81}
98 82
99static inline void setup_cputime_one_jiffy(void) 83static inline void setup_cputime_one_jiffy(void)
@@ -103,7 +87,7 @@ static inline void setup_cputime_one_jiffy(void)
103 87
104static inline cputime64_t jiffies64_to_cputime64(const u64 jif) 88static inline cputime64_t jiffies64_to_cputime64(const u64 jif)
105{ 89{
106 cputime_t ct; 90 u64 ct;
107 u64 sec; 91 u64 sec;
108 92
109 /* have to be a little careful about overflow */ 93 /* have to be a little careful about overflow */
@@ -114,28 +98,28 @@ static inline cputime64_t jiffies64_to_cputime64(const u64 jif)
114 do_div(ct, HZ); 98 do_div(ct, HZ);
115 } 99 }
116 if (sec) 100 if (sec)
117 ct += (cputime_t) sec * tb_ticks_per_sec; 101 ct += (u64) sec * tb_ticks_per_sec;
118 return ct; 102 return (__force cputime64_t) ct;
119} 103}
120 104
121static inline u64 cputime64_to_jiffies64(const cputime_t ct) 105static inline u64 cputime64_to_jiffies64(const cputime_t ct)
122{ 106{
123 return mulhdu(ct, __cputime_jiffies_factor); 107 return mulhdu((__force u64) ct, __cputime_jiffies_factor);
124} 108}
125 109
126/* 110/*
127 * Convert cputime <-> microseconds 111 * Convert cputime <-> microseconds
128 */ 112 */
129extern u64 __cputime_msec_factor; 113extern u64 __cputime_usec_factor;
130 114
131static inline unsigned long cputime_to_usecs(const cputime_t ct) 115static inline unsigned long cputime_to_usecs(const cputime_t ct)
132{ 116{
133 return mulhdu(ct, __cputime_msec_factor) * USEC_PER_MSEC; 117 return mulhdu((__force u64) ct, __cputime_usec_factor);
134} 118}
135 119
136static inline cputime_t usecs_to_cputime(const unsigned long us) 120static inline cputime_t usecs_to_cputime(const unsigned long us)
137{ 121{
138 cputime_t ct; 122 u64 ct;
139 unsigned long sec; 123 unsigned long sec;
140 124
141 /* have to be a little careful about overflow */ 125 /* have to be a little careful about overflow */
@@ -143,13 +127,15 @@ static inline cputime_t usecs_to_cputime(const unsigned long us)
143 sec = us / 1000000; 127 sec = us / 1000000;
144 if (ct) { 128 if (ct) {
145 ct *= tb_ticks_per_sec; 129 ct *= tb_ticks_per_sec;
146 do_div(ct, 1000); 130 do_div(ct, 1000000);
147 } 131 }
148 if (sec) 132 if (sec)
149 ct += (cputime_t) sec * tb_ticks_per_sec; 133 ct += (cputime_t) sec * tb_ticks_per_sec;
150 return ct; 134 return (__force cputime_t) ct;
151} 135}
152 136
137#define usecs_to_cputime64(us) usecs_to_cputime(us)
138
153/* 139/*
154 * Convert cputime <-> seconds 140 * Convert cputime <-> seconds
155 */ 141 */
@@ -157,12 +143,12 @@ extern u64 __cputime_sec_factor;
157 143
158static inline unsigned long cputime_to_secs(const cputime_t ct) 144static inline unsigned long cputime_to_secs(const cputime_t ct)
159{ 145{
160 return mulhdu(ct, __cputime_sec_factor); 146 return mulhdu((__force u64) ct, __cputime_sec_factor);
161} 147}
162 148
163static inline cputime_t secs_to_cputime(const unsigned long sec) 149static inline cputime_t secs_to_cputime(const unsigned long sec)
164{ 150{
165 return (cputime_t) sec * tb_ticks_per_sec; 151 return (__force cputime_t)((u64) sec * tb_ticks_per_sec);
166} 152}
167 153
168/* 154/*
@@ -170,7 +156,7 @@ static inline cputime_t secs_to_cputime(const unsigned long sec)
170 */ 156 */
171static inline void cputime_to_timespec(const cputime_t ct, struct timespec *p) 157static inline void cputime_to_timespec(const cputime_t ct, struct timespec *p)
172{ 158{
173 u64 x = ct; 159 u64 x = (__force u64) ct;
174 unsigned int frac; 160 unsigned int frac;
175 161
176 frac = do_div(x, tb_ticks_per_sec); 162 frac = do_div(x, tb_ticks_per_sec);
@@ -182,11 +168,11 @@ static inline void cputime_to_timespec(const cputime_t ct, struct timespec *p)
182 168
183static inline cputime_t timespec_to_cputime(const struct timespec *p) 169static inline cputime_t timespec_to_cputime(const struct timespec *p)
184{ 170{
185 cputime_t ct; 171 u64 ct;
186 172
187 ct = (u64) p->tv_nsec * tb_ticks_per_sec; 173 ct = (u64) p->tv_nsec * tb_ticks_per_sec;
188 do_div(ct, 1000000000); 174 do_div(ct, 1000000000);
189 return ct + (u64) p->tv_sec * tb_ticks_per_sec; 175 return (__force cputime_t)(ct + (u64) p->tv_sec * tb_ticks_per_sec);
190} 176}
191 177
192/* 178/*
@@ -194,7 +180,7 @@ static inline cputime_t timespec_to_cputime(const struct timespec *p)
194 */ 180 */
195static inline void cputime_to_timeval(const cputime_t ct, struct timeval *p) 181static inline void cputime_to_timeval(const cputime_t ct, struct timeval *p)
196{ 182{
197 u64 x = ct; 183 u64 x = (__force u64) ct;
198 unsigned int frac; 184 unsigned int frac;
199 185
200 frac = do_div(x, tb_ticks_per_sec); 186 frac = do_div(x, tb_ticks_per_sec);
@@ -206,11 +192,11 @@ static inline void cputime_to_timeval(const cputime_t ct, struct timeval *p)
206 192
207static inline cputime_t timeval_to_cputime(const struct timeval *p) 193static inline cputime_t timeval_to_cputime(const struct timeval *p)
208{ 194{
209 cputime_t ct; 195 u64 ct;
210 196
211 ct = (u64) p->tv_usec * tb_ticks_per_sec; 197 ct = (u64) p->tv_usec * tb_ticks_per_sec;
212 do_div(ct, 1000000); 198 do_div(ct, 1000000);
213 return ct + (u64) p->tv_sec * tb_ticks_per_sec; 199 return (__force cputime_t)(ct + (u64) p->tv_sec * tb_ticks_per_sec);
214} 200}
215 201
216/* 202/*
@@ -220,12 +206,12 @@ extern u64 __cputime_clockt_factor;
220 206
221static inline unsigned long cputime_to_clock_t(const cputime_t ct) 207static inline unsigned long cputime_to_clock_t(const cputime_t ct)
222{ 208{
223 return mulhdu(ct, __cputime_clockt_factor); 209 return mulhdu((__force u64) ct, __cputime_clockt_factor);
224} 210}
225 211
226static inline cputime_t clock_t_to_cputime(const unsigned long clk) 212static inline cputime_t clock_t_to_cputime(const unsigned long clk)
227{ 213{
228 cputime_t ct; 214 u64 ct;
229 unsigned long sec; 215 unsigned long sec;
230 216
231 /* have to be a little careful about overflow */ 217 /* have to be a little careful about overflow */
@@ -236,8 +222,8 @@ static inline cputime_t clock_t_to_cputime(const unsigned long clk)
236 do_div(ct, USER_HZ); 222 do_div(ct, USER_HZ);
237 } 223 }
238 if (sec) 224 if (sec)
239 ct += (cputime_t) sec * tb_ticks_per_sec; 225 ct += (u64) sec * tb_ticks_per_sec;
240 return ct; 226 return (__force cputime_t) ct;
241} 227}
242 228
243#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct)) 229#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct))
diff --git a/arch/powerpc/include/asm/fsl_ifc.h b/arch/powerpc/include/asm/fsl_ifc.h
new file mode 100644
index 000000000000..b955012939a2
--- /dev/null
+++ b/arch/powerpc/include/asm/fsl_ifc.h
@@ -0,0 +1,834 @@
1/* Freescale Integrated Flash Controller
2 *
3 * Copyright 2011 Freescale Semiconductor, Inc
4 *
5 * Author: Dipen Dudhat <dipen.dudhat@freescale.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef __ASM_FSL_IFC_H
23#define __ASM_FSL_IFC_H
24
25#include <linux/compiler.h>
26#include <linux/types.h>
27#include <linux/io.h>
28
29#include <linux/of_platform.h>
30#include <linux/interrupt.h>
31
32#define FSL_IFC_BANK_COUNT 4
33
34/*
35 * CSPR - Chip Select Property Register
36 */
37#define CSPR_BA 0xFFFF0000
38#define CSPR_BA_SHIFT 16
39#define CSPR_PORT_SIZE 0x00000180
40#define CSPR_PORT_SIZE_SHIFT 7
41/* Port Size 8 bit */
42#define CSPR_PORT_SIZE_8 0x00000080
43/* Port Size 16 bit */
44#define CSPR_PORT_SIZE_16 0x00000100
45/* Port Size 32 bit */
46#define CSPR_PORT_SIZE_32 0x00000180
47/* Write Protect */
48#define CSPR_WP 0x00000040
49#define CSPR_WP_SHIFT 6
50/* Machine Select */
51#define CSPR_MSEL 0x00000006
52#define CSPR_MSEL_SHIFT 1
53/* NOR */
54#define CSPR_MSEL_NOR 0x00000000
55/* NAND */
56#define CSPR_MSEL_NAND 0x00000002
57/* GPCM */
58#define CSPR_MSEL_GPCM 0x00000004
59/* Bank Valid */
60#define CSPR_V 0x00000001
61#define CSPR_V_SHIFT 0
62
63/*
64 * Address Mask Register
65 */
66#define IFC_AMASK_MASK 0xFFFF0000
67#define IFC_AMASK_SHIFT 16
68#define IFC_AMASK(n) (IFC_AMASK_MASK << \
69 (__ilog2(n) - IFC_AMASK_SHIFT))
70
71/*
72 * Chip Select Option Register IFC_NAND Machine
73 */
74/* Enable ECC Encoder */
75#define CSOR_NAND_ECC_ENC_EN 0x80000000
76#define CSOR_NAND_ECC_MODE_MASK 0x30000000
77/* 4 bit correction per 520 Byte sector */
78#define CSOR_NAND_ECC_MODE_4 0x00000000
79/* 8 bit correction per 528 Byte sector */
80#define CSOR_NAND_ECC_MODE_8 0x10000000
81/* Enable ECC Decoder */
82#define CSOR_NAND_ECC_DEC_EN 0x04000000
83/* Row Address Length */
84#define CSOR_NAND_RAL_MASK 0x01800000
85#define CSOR_NAND_RAL_SHIFT 20
86#define CSOR_NAND_RAL_1 0x00000000
87#define CSOR_NAND_RAL_2 0x00800000
88#define CSOR_NAND_RAL_3 0x01000000
89#define CSOR_NAND_RAL_4 0x01800000
90/* Page Size 512b, 2k, 4k */
91#define CSOR_NAND_PGS_MASK 0x00180000
92#define CSOR_NAND_PGS_SHIFT 16
93#define CSOR_NAND_PGS_512 0x00000000
94#define CSOR_NAND_PGS_2K 0x00080000
95#define CSOR_NAND_PGS_4K 0x00100000
96/* Spare region Size */
97#define CSOR_NAND_SPRZ_MASK 0x0000E000
98#define CSOR_NAND_SPRZ_SHIFT 13
99#define CSOR_NAND_SPRZ_16 0x00000000
100#define CSOR_NAND_SPRZ_64 0x00002000
101#define CSOR_NAND_SPRZ_128 0x00004000
102#define CSOR_NAND_SPRZ_210 0x00006000
103#define CSOR_NAND_SPRZ_218 0x00008000
104#define CSOR_NAND_SPRZ_224 0x0000A000
105/* Pages Per Block */
106#define CSOR_NAND_PB_MASK 0x00000700
107#define CSOR_NAND_PB_SHIFT 8
108#define CSOR_NAND_PB(n) ((__ilog2(n) - 5) << CSOR_NAND_PB_SHIFT)
109/* Time for Read Enable High to Output High Impedance */
110#define CSOR_NAND_TRHZ_MASK 0x0000001C
111#define CSOR_NAND_TRHZ_SHIFT 2
112#define CSOR_NAND_TRHZ_20 0x00000000
113#define CSOR_NAND_TRHZ_40 0x00000004
114#define CSOR_NAND_TRHZ_60 0x00000008
115#define CSOR_NAND_TRHZ_80 0x0000000C
116#define CSOR_NAND_TRHZ_100 0x00000010
117/* Buffer control disable */
118#define CSOR_NAND_BCTLD 0x00000001
119
120/*
121 * Chip Select Option Register - NOR Flash Mode
122 */
123/* Enable Address shift Mode */
124#define CSOR_NOR_ADM_SHFT_MODE_EN 0x80000000
125/* Page Read Enable from NOR device */
126#define CSOR_NOR_PGRD_EN 0x10000000
127/* AVD Toggle Enable during Burst Program */
128#define CSOR_NOR_AVD_TGL_PGM_EN 0x01000000
129/* Address Data Multiplexing Shift */
130#define CSOR_NOR_ADM_MASK 0x0003E000
131#define CSOR_NOR_ADM_SHIFT_SHIFT 13
132#define CSOR_NOR_ADM_SHIFT(n) ((n) << CSOR_NOR_ADM_SHIFT_SHIFT)
133/* Type of the NOR device hooked */
134#define CSOR_NOR_NOR_MODE_AYSNC_NOR 0x00000000
135#define CSOR_NOR_NOR_MODE_AVD_NOR 0x00000020
136/* Time for Read Enable High to Output High Impedance */
137#define CSOR_NOR_TRHZ_MASK 0x0000001C
138#define CSOR_NOR_TRHZ_SHIFT 2
139#define CSOR_NOR_TRHZ_20 0x00000000
140#define CSOR_NOR_TRHZ_40 0x00000004
141#define CSOR_NOR_TRHZ_60 0x00000008
142#define CSOR_NOR_TRHZ_80 0x0000000C
143#define CSOR_NOR_TRHZ_100 0x00000010
144/* Buffer control disable */
145#define CSOR_NOR_BCTLD 0x00000001
146
147/*
148 * Chip Select Option Register - GPCM Mode
149 */
150/* GPCM Mode - Normal */
151#define CSOR_GPCM_GPMODE_NORMAL 0x00000000
152/* GPCM Mode - GenericASIC */
153#define CSOR_GPCM_GPMODE_ASIC 0x80000000
154/* Parity Mode odd/even */
155#define CSOR_GPCM_PARITY_EVEN 0x40000000
156/* Parity Checking enable/disable */
157#define CSOR_GPCM_PAR_EN 0x20000000
158/* GPCM Timeout Count */
159#define CSOR_GPCM_GPTO_MASK 0x0F000000
160#define CSOR_GPCM_GPTO_SHIFT 24
161#define CSOR_GPCM_GPTO(n) ((__ilog2(n) - 8) << CSOR_GPCM_GPTO_SHIFT)
162/* GPCM External Access Termination mode for read access */
163#define CSOR_GPCM_RGETA_EXT 0x00080000
164/* GPCM External Access Termination mode for write access */
165#define CSOR_GPCM_WGETA_EXT 0x00040000
166/* Address Data Multiplexing Shift */
167#define CSOR_GPCM_ADM_MASK 0x0003E000
168#define CSOR_GPCM_ADM_SHIFT_SHIFT 13
169#define CSOR_GPCM_ADM_SHIFT(n) ((n) << CSOR_GPCM_ADM_SHIFT_SHIFT)
170/* Generic ASIC Parity error indication delay */
171#define CSOR_GPCM_GAPERRD_MASK 0x00000180
172#define CSOR_GPCM_GAPERRD_SHIFT 7
173#define CSOR_GPCM_GAPERRD(n) (((n) - 1) << CSOR_GPCM_GAPERRD_SHIFT)
174/* Time for Read Enable High to Output High Impedance */
175#define CSOR_GPCM_TRHZ_MASK 0x0000001C
176#define CSOR_GPCM_TRHZ_20 0x00000000
177#define CSOR_GPCM_TRHZ_40 0x00000004
178#define CSOR_GPCM_TRHZ_60 0x00000008
179#define CSOR_GPCM_TRHZ_80 0x0000000C
180#define CSOR_GPCM_TRHZ_100 0x00000010
181/* Buffer control disable */
182#define CSOR_GPCM_BCTLD 0x00000001
183
184/*
185 * Ready Busy Status Register (RB_STAT)
186 */
187/* CSn is READY */
188#define IFC_RB_STAT_READY_CS0 0x80000000
189#define IFC_RB_STAT_READY_CS1 0x40000000
190#define IFC_RB_STAT_READY_CS2 0x20000000
191#define IFC_RB_STAT_READY_CS3 0x10000000
192
193/*
194 * General Control Register (GCR)
195 */
196#define IFC_GCR_MASK 0x8000F800
197/* reset all IFC hardware */
198#define IFC_GCR_SOFT_RST_ALL 0x80000000
199/* Turnaroud Time of external buffer */
200#define IFC_GCR_TBCTL_TRN_TIME 0x0000F800
201#define IFC_GCR_TBCTL_TRN_TIME_SHIFT 11
202
203/*
204 * Common Event and Error Status Register (CM_EVTER_STAT)
205 */
206/* Chip select error */
207#define IFC_CM_EVTER_STAT_CSER 0x80000000
208
209/*
210 * Common Event and Error Enable Register (CM_EVTER_EN)
211 */
212/* Chip select error checking enable */
213#define IFC_CM_EVTER_EN_CSEREN 0x80000000
214
215/*
216 * Common Event and Error Interrupt Enable Register (CM_EVTER_INTR_EN)
217 */
218/* Chip select error interrupt enable */
219#define IFC_CM_EVTER_INTR_EN_CSERIREN 0x80000000
220
221/*
222 * Common Transfer Error Attribute Register-0 (CM_ERATTR0)
223 */
224/* transaction type of error Read/Write */
225#define IFC_CM_ERATTR0_ERTYP_READ 0x80000000
226#define IFC_CM_ERATTR0_ERAID 0x0FF00000
227#define IFC_CM_ERATTR0_ERAID_SHIFT 20
228#define IFC_CM_ERATTR0_ESRCID 0x0000FF00
229#define IFC_CM_ERATTR0_ESRCID_SHIFT 8
230
231/*
232 * Clock Control Register (CCR)
233 */
234#define IFC_CCR_MASK 0x0F0F8800
235/* Clock division ratio */
236#define IFC_CCR_CLK_DIV_MASK 0x0F000000
237#define IFC_CCR_CLK_DIV_SHIFT 24
238#define IFC_CCR_CLK_DIV(n) ((n-1) << IFC_CCR_CLK_DIV_SHIFT)
239/* IFC Clock Delay */
240#define IFC_CCR_CLK_DLY_MASK 0x000F0000
241#define IFC_CCR_CLK_DLY_SHIFT 16
242#define IFC_CCR_CLK_DLY(n) ((n) << IFC_CCR_CLK_DLY_SHIFT)
243/* Invert IFC clock before sending out */
244#define IFC_CCR_INV_CLK_EN 0x00008000
245/* Fedback IFC Clock */
246#define IFC_CCR_FB_IFC_CLK_SEL 0x00000800
247
248/*
249 * Clock Status Register (CSR)
250 */
251/* Clk is stable */
252#define IFC_CSR_CLK_STAT_STABLE 0x80000000
253
254/*
255 * IFC_NAND Machine Specific Registers
256 */
257/*
258 * NAND Configuration Register (NCFGR)
259 */
260/* Auto Boot Mode */
261#define IFC_NAND_NCFGR_BOOT 0x80000000
262/* Addressing Mode-ROW0+n/COL0 */
263#define IFC_NAND_NCFGR_ADDR_MODE_RC0 0x00000000
264/* Addressing Mode-ROW0+n/COL0+n */
265#define IFC_NAND_NCFGR_ADDR_MODE_RC1 0x00400000
266/* Number of loop iterations of FIR sequences for multi page operations */
267#define IFC_NAND_NCFGR_NUM_LOOP_MASK 0x0000F000
268#define IFC_NAND_NCFGR_NUM_LOOP_SHIFT 12
269#define IFC_NAND_NCFGR_NUM_LOOP(n) ((n) << IFC_NAND_NCFGR_NUM_LOOP_SHIFT)
270/* Number of wait cycles */
271#define IFC_NAND_NCFGR_NUM_WAIT_MASK 0x000000FF
272#define IFC_NAND_NCFGR_NUM_WAIT_SHIFT 0
273
274/*
275 * NAND Flash Command Registers (NAND_FCR0/NAND_FCR1)
276 */
277/* General purpose FCM flash command bytes CMD0-CMD7 */
278#define IFC_NAND_FCR0_CMD0 0xFF000000
279#define IFC_NAND_FCR0_CMD0_SHIFT 24
280#define IFC_NAND_FCR0_CMD1 0x00FF0000
281#define IFC_NAND_FCR0_CMD1_SHIFT 16
282#define IFC_NAND_FCR0_CMD2 0x0000FF00
283#define IFC_NAND_FCR0_CMD2_SHIFT 8
284#define IFC_NAND_FCR0_CMD3 0x000000FF
285#define IFC_NAND_FCR0_CMD3_SHIFT 0
286#define IFC_NAND_FCR1_CMD4 0xFF000000
287#define IFC_NAND_FCR1_CMD4_SHIFT 24
288#define IFC_NAND_FCR1_CMD5 0x00FF0000
289#define IFC_NAND_FCR1_CMD5_SHIFT 16
290#define IFC_NAND_FCR1_CMD6 0x0000FF00
291#define IFC_NAND_FCR1_CMD6_SHIFT 8
292#define IFC_NAND_FCR1_CMD7 0x000000FF
293#define IFC_NAND_FCR1_CMD7_SHIFT 0
294
295/*
296 * Flash ROW and COL Address Register (ROWn, COLn)
297 */
298/* Main/spare region locator */
299#define IFC_NAND_COL_MS 0x80000000
300/* Column Address */
301#define IFC_NAND_COL_CA_MASK 0x00000FFF
302
303/*
304 * NAND Flash Byte Count Register (NAND_BC)
305 */
306/* Byte Count for read/Write */
307#define IFC_NAND_BC 0x000001FF
308
309/*
310 * NAND Flash Instruction Registers (NAND_FIR0/NAND_FIR1/NAND_FIR2)
311 */
312/* NAND Machine specific opcodes OP0-OP14*/
313#define IFC_NAND_FIR0_OP0 0xFC000000
314#define IFC_NAND_FIR0_OP0_SHIFT 26
315#define IFC_NAND_FIR0_OP1 0x03F00000
316#define IFC_NAND_FIR0_OP1_SHIFT 20
317#define IFC_NAND_FIR0_OP2 0x000FC000
318#define IFC_NAND_FIR0_OP2_SHIFT 14
319#define IFC_NAND_FIR0_OP3 0x00003F00
320#define IFC_NAND_FIR0_OP3_SHIFT 8
321#define IFC_NAND_FIR0_OP4 0x000000FC
322#define IFC_NAND_FIR0_OP4_SHIFT 2
323#define IFC_NAND_FIR1_OP5 0xFC000000
324#define IFC_NAND_FIR1_OP5_SHIFT 26
325#define IFC_NAND_FIR1_OP6 0x03F00000
326#define IFC_NAND_FIR1_OP6_SHIFT 20
327#define IFC_NAND_FIR1_OP7 0x000FC000
328#define IFC_NAND_FIR1_OP7_SHIFT 14
329#define IFC_NAND_FIR1_OP8 0x00003F00
330#define IFC_NAND_FIR1_OP8_SHIFT 8
331#define IFC_NAND_FIR1_OP9 0x000000FC
332#define IFC_NAND_FIR1_OP9_SHIFT 2
333#define IFC_NAND_FIR2_OP10 0xFC000000
334#define IFC_NAND_FIR2_OP10_SHIFT 26
335#define IFC_NAND_FIR2_OP11 0x03F00000
336#define IFC_NAND_FIR2_OP11_SHIFT 20
337#define IFC_NAND_FIR2_OP12 0x000FC000
338#define IFC_NAND_FIR2_OP12_SHIFT 14
339#define IFC_NAND_FIR2_OP13 0x00003F00
340#define IFC_NAND_FIR2_OP13_SHIFT 8
341#define IFC_NAND_FIR2_OP14 0x000000FC
342#define IFC_NAND_FIR2_OP14_SHIFT 2
343
344/*
345 * Instruction opcodes to be programmed
346 * in FIR registers- 6bits
347 */
348enum ifc_nand_fir_opcodes {
349 IFC_FIR_OP_NOP,
350 IFC_FIR_OP_CA0,
351 IFC_FIR_OP_CA1,
352 IFC_FIR_OP_CA2,
353 IFC_FIR_OP_CA3,
354 IFC_FIR_OP_RA0,
355 IFC_FIR_OP_RA1,
356 IFC_FIR_OP_RA2,
357 IFC_FIR_OP_RA3,
358 IFC_FIR_OP_CMD0,
359 IFC_FIR_OP_CMD1,
360 IFC_FIR_OP_CMD2,
361 IFC_FIR_OP_CMD3,
362 IFC_FIR_OP_CMD4,
363 IFC_FIR_OP_CMD5,
364 IFC_FIR_OP_CMD6,
365 IFC_FIR_OP_CMD7,
366 IFC_FIR_OP_CW0,
367 IFC_FIR_OP_CW1,
368 IFC_FIR_OP_CW2,
369 IFC_FIR_OP_CW3,
370 IFC_FIR_OP_CW4,
371 IFC_FIR_OP_CW5,
372 IFC_FIR_OP_CW6,
373 IFC_FIR_OP_CW7,
374 IFC_FIR_OP_WBCD,
375 IFC_FIR_OP_RBCD,
376 IFC_FIR_OP_BTRD,
377 IFC_FIR_OP_RDSTAT,
378 IFC_FIR_OP_NWAIT,
379 IFC_FIR_OP_WFR,
380 IFC_FIR_OP_SBRD,
381 IFC_FIR_OP_UA,
382 IFC_FIR_OP_RB,
383};
384
385/*
386 * NAND Chip Select Register (NAND_CSEL)
387 */
388#define IFC_NAND_CSEL 0x0C000000
389#define IFC_NAND_CSEL_SHIFT 26
390#define IFC_NAND_CSEL_CS0 0x00000000
391#define IFC_NAND_CSEL_CS1 0x04000000
392#define IFC_NAND_CSEL_CS2 0x08000000
393#define IFC_NAND_CSEL_CS3 0x0C000000
394
395/*
396 * NAND Operation Sequence Start (NANDSEQ_STRT)
397 */
398/* NAND Flash Operation Start */
399#define IFC_NAND_SEQ_STRT_FIR_STRT 0x80000000
400/* Automatic Erase */
401#define IFC_NAND_SEQ_STRT_AUTO_ERS 0x00800000
402/* Automatic Program */
403#define IFC_NAND_SEQ_STRT_AUTO_PGM 0x00100000
404/* Automatic Copyback */
405#define IFC_NAND_SEQ_STRT_AUTO_CPB 0x00020000
406/* Automatic Read Operation */
407#define IFC_NAND_SEQ_STRT_AUTO_RD 0x00004000
408/* Automatic Status Read */
409#define IFC_NAND_SEQ_STRT_AUTO_STAT_RD 0x00000800
410
411/*
412 * NAND Event and Error Status Register (NAND_EVTER_STAT)
413 */
414/* Operation Complete */
415#define IFC_NAND_EVTER_STAT_OPC 0x80000000
416/* Flash Timeout Error */
417#define IFC_NAND_EVTER_STAT_FTOER 0x08000000
418/* Write Protect Error */
419#define IFC_NAND_EVTER_STAT_WPER 0x04000000
420/* ECC Error */
421#define IFC_NAND_EVTER_STAT_ECCER 0x02000000
422/* RCW Load Done */
423#define IFC_NAND_EVTER_STAT_RCW_DN 0x00008000
424/* Boot Loadr Done */
425#define IFC_NAND_EVTER_STAT_BOOT_DN 0x00004000
426/* Bad Block Indicator search select */
427#define IFC_NAND_EVTER_STAT_BBI_SRCH_SE 0x00000800
428
429/*
430 * NAND Flash Page Read Completion Event Status Register
431 * (PGRDCMPL_EVT_STAT)
432 */
433#define PGRDCMPL_EVT_STAT_MASK 0xFFFF0000
434/* Small Page 0-15 Done */
435#define PGRDCMPL_EVT_STAT_SECTION_SP(n) (1 << (31 - (n)))
436/* Large Page(2K) 0-3 Done */
437#define PGRDCMPL_EVT_STAT_LP_2K(n) (0xF << (28 - (n)*4))
438/* Large Page(4K) 0-1 Done */
439#define PGRDCMPL_EVT_STAT_LP_4K(n) (0xFF << (24 - (n)*8))
440
441/*
442 * NAND Event and Error Enable Register (NAND_EVTER_EN)
443 */
444/* Operation complete event enable */
445#define IFC_NAND_EVTER_EN_OPC_EN 0x80000000
446/* Page read complete event enable */
447#define IFC_NAND_EVTER_EN_PGRDCMPL_EN 0x20000000
448/* Flash Timeout error enable */
449#define IFC_NAND_EVTER_EN_FTOER_EN 0x08000000
450/* Write Protect error enable */
451#define IFC_NAND_EVTER_EN_WPER_EN 0x04000000
452/* ECC error logging enable */
453#define IFC_NAND_EVTER_EN_ECCER_EN 0x02000000
454
455/*
456 * NAND Event and Error Interrupt Enable Register (NAND_EVTER_INTR_EN)
457 */
458/* Enable interrupt for operation complete */
459#define IFC_NAND_EVTER_INTR_OPCIR_EN 0x80000000
460/* Enable interrupt for Page read complete */
461#define IFC_NAND_EVTER_INTR_PGRDCMPLIR_EN 0x20000000
462/* Enable interrupt for Flash timeout error */
463#define IFC_NAND_EVTER_INTR_FTOERIR_EN 0x08000000
464/* Enable interrupt for Write protect error */
465#define IFC_NAND_EVTER_INTR_WPERIR_EN 0x04000000
466/* Enable interrupt for ECC error*/
467#define IFC_NAND_EVTER_INTR_ECCERIR_EN 0x02000000
468
469/*
470 * NAND Transfer Error Attribute Register-0 (NAND_ERATTR0)
471 */
472#define IFC_NAND_ERATTR0_MASK 0x0C080000
473/* Error on CS0-3 for NAND */
474#define IFC_NAND_ERATTR0_ERCS_CS0 0x00000000
475#define IFC_NAND_ERATTR0_ERCS_CS1 0x04000000
476#define IFC_NAND_ERATTR0_ERCS_CS2 0x08000000
477#define IFC_NAND_ERATTR0_ERCS_CS3 0x0C000000
478/* Transaction type of error Read/Write */
479#define IFC_NAND_ERATTR0_ERTTYPE_READ 0x00080000
480
481/*
482 * NAND Flash Status Register (NAND_FSR)
483 */
484/* First byte of data read from read status op */
485#define IFC_NAND_NFSR_RS0 0xFF000000
486/* Second byte of data read from read status op */
487#define IFC_NAND_NFSR_RS1 0x00FF0000
488
489/*
490 * ECC Error Status Registers (ECCSTAT0-ECCSTAT3)
491 */
492/* Number of ECC errors on sector n (n = 0-15) */
493#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_MASK 0x0F000000
494#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_SHIFT 24
495#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_MASK 0x000F0000
496#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_SHIFT 16
497#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_MASK 0x00000F00
498#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_SHIFT 8
499#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_MASK 0x0000000F
500#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_SHIFT 0
501#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_MASK 0x0F000000
502#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_SHIFT 24
503#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_MASK 0x000F0000
504#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_SHIFT 16
505#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_MASK 0x00000F00
506#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_SHIFT 8
507#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_MASK 0x0000000F
508#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_SHIFT 0
509#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_MASK 0x0F000000
510#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_SHIFT 24
511#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_MASK 0x000F0000
512#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_SHIFT 16
513#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_MASK 0x00000F00
514#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_SHIFT 8
515#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_MASK 0x0000000F
516#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_SHIFT 0
517#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_MASK 0x0F000000
518#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_SHIFT 24
519#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_MASK 0x000F0000
520#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_SHIFT 16
521#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_MASK 0x00000F00
522#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_SHIFT 8
523#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_MASK 0x0000000F
524#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_SHIFT 0
525
526/*
527 * NAND Control Register (NANDCR)
528 */
529#define IFC_NAND_NCR_FTOCNT_MASK 0x1E000000
530#define IFC_NAND_NCR_FTOCNT_SHIFT 25
531#define IFC_NAND_NCR_FTOCNT(n) ((_ilog2(n) - 8) << IFC_NAND_NCR_FTOCNT_SHIFT)
532
533/*
534 * NAND_AUTOBOOT_TRGR
535 */
536/* Trigger RCW load */
537#define IFC_NAND_AUTOBOOT_TRGR_RCW_LD 0x80000000
538/* Trigget Auto Boot */
539#define IFC_NAND_AUTOBOOT_TRGR_BOOT_LD 0x20000000
540
541/*
542 * NAND_MDR
543 */
544/* 1st read data byte when opcode SBRD */
545#define IFC_NAND_MDR_RDATA0 0xFF000000
546/* 2nd read data byte when opcode SBRD */
547#define IFC_NAND_MDR_RDATA1 0x00FF0000
548
549/*
550 * NOR Machine Specific Registers
551 */
552/*
553 * NOR Event and Error Status Register (NOR_EVTER_STAT)
554 */
555/* NOR Command Sequence Operation Complete */
556#define IFC_NOR_EVTER_STAT_OPC_NOR 0x80000000
557/* Write Protect Error */
558#define IFC_NOR_EVTER_STAT_WPER 0x04000000
559/* Command Sequence Timeout Error */
560#define IFC_NOR_EVTER_STAT_STOER 0x01000000
561
562/*
563 * NOR Event and Error Enable Register (NOR_EVTER_EN)
564 */
565/* NOR Command Seq complete event enable */
566#define IFC_NOR_EVTER_EN_OPCEN_NOR 0x80000000
567/* Write Protect Error Checking Enable */
568#define IFC_NOR_EVTER_EN_WPEREN 0x04000000
569/* Timeout Error Enable */
570#define IFC_NOR_EVTER_EN_STOEREN 0x01000000
571
572/*
573 * NOR Event and Error Interrupt Enable Register (NOR_EVTER_INTR_EN)
574 */
575/* Enable interrupt for OPC complete */
576#define IFC_NOR_EVTER_INTR_OPCEN_NOR 0x80000000
577/* Enable interrupt for write protect error */
578#define IFC_NOR_EVTER_INTR_WPEREN 0x04000000
579/* Enable interrupt for timeout error */
580#define IFC_NOR_EVTER_INTR_STOEREN 0x01000000
581
582/*
583 * NOR Transfer Error Attribute Register-0 (NOR_ERATTR0)
584 */
585/* Source ID for error transaction */
586#define IFC_NOR_ERATTR0_ERSRCID 0xFF000000
587/* AXI ID for error transation */
588#define IFC_NOR_ERATTR0_ERAID 0x000FF000
589/* Chip select corresponds to NOR error */
590#define IFC_NOR_ERATTR0_ERCS_CS0 0x00000000
591#define IFC_NOR_ERATTR0_ERCS_CS1 0x00000010
592#define IFC_NOR_ERATTR0_ERCS_CS2 0x00000020
593#define IFC_NOR_ERATTR0_ERCS_CS3 0x00000030
594/* Type of transaction read/write */
595#define IFC_NOR_ERATTR0_ERTYPE_READ 0x00000001
596
597/*
598 * NOR Transfer Error Attribute Register-2 (NOR_ERATTR2)
599 */
600#define IFC_NOR_ERATTR2_ER_NUM_PHASE_EXP 0x000F0000
601#define IFC_NOR_ERATTR2_ER_NUM_PHASE_PER 0x00000F00
602
603/*
604 * NOR Control Register (NORCR)
605 */
606#define IFC_NORCR_MASK 0x0F0F0000
607/* No. of Address/Data Phase */
608#define IFC_NORCR_NUM_PHASE_MASK 0x0F000000
609#define IFC_NORCR_NUM_PHASE_SHIFT 24
610#define IFC_NORCR_NUM_PHASE(n) ((n-1) << IFC_NORCR_NUM_PHASE_SHIFT)
611/* Sequence Timeout Count */
612#define IFC_NORCR_STOCNT_MASK 0x000F0000
613#define IFC_NORCR_STOCNT_SHIFT 16
614#define IFC_NORCR_STOCNT(n) ((__ilog2(n) - 8) << IFC_NORCR_STOCNT_SHIFT)
615
616/*
617 * GPCM Machine specific registers
618 */
619/*
620 * GPCM Event and Error Status Register (GPCM_EVTER_STAT)
621 */
622/* Timeout error */
623#define IFC_GPCM_EVTER_STAT_TOER 0x04000000
624/* Parity error */
625#define IFC_GPCM_EVTER_STAT_PER 0x01000000
626
627/*
628 * GPCM Event and Error Enable Register (GPCM_EVTER_EN)
629 */
630/* Timeout error enable */
631#define IFC_GPCM_EVTER_EN_TOER_EN 0x04000000
632/* Parity error enable */
633#define IFC_GPCM_EVTER_EN_PER_EN 0x01000000
634
635/*
636 * GPCM Event and Error Interrupt Enable Register (GPCM_EVTER_INTR_EN)
637 */
638/* Enable Interrupt for timeout error */
639#define IFC_GPCM_EEIER_TOERIR_EN 0x04000000
640/* Enable Interrupt for Parity error */
641#define IFC_GPCM_EEIER_PERIR_EN 0x01000000
642
643/*
644 * GPCM Transfer Error Attribute Register-0 (GPCM_ERATTR0)
645 */
646/* Source ID for error transaction */
647#define IFC_GPCM_ERATTR0_ERSRCID 0xFF000000
648/* AXI ID for error transaction */
649#define IFC_GPCM_ERATTR0_ERAID 0x000FF000
650/* Chip select corresponds to GPCM error */
651#define IFC_GPCM_ERATTR0_ERCS_CS0 0x00000000
652#define IFC_GPCM_ERATTR0_ERCS_CS1 0x00000040
653#define IFC_GPCM_ERATTR0_ERCS_CS2 0x00000080
654#define IFC_GPCM_ERATTR0_ERCS_CS3 0x000000C0
655/* Type of transaction read/Write */
656#define IFC_GPCM_ERATTR0_ERTYPE_READ 0x00000001
657
658/*
659 * GPCM Transfer Error Attribute Register-2 (GPCM_ERATTR2)
660 */
661/* On which beat of address/data parity error is observed */
662#define IFC_GPCM_ERATTR2_PERR_BEAT 0x00000C00
663/* Parity Error on byte */
664#define IFC_GPCM_ERATTR2_PERR_BYTE 0x000000F0
665/* Parity Error reported in addr or data phase */
666#define IFC_GPCM_ERATTR2_PERR_DATA_PHASE 0x00000001
667
668/*
669 * GPCM Status Register (GPCM_STAT)
670 */
671#define IFC_GPCM_STAT_BSY 0x80000000 /* GPCM is busy */
672
673/*
674 * IFC Controller NAND Machine registers
675 */
676struct fsl_ifc_nand {
677 __be32 ncfgr;
678 u32 res1[0x4];
679 __be32 nand_fcr0;
680 __be32 nand_fcr1;
681 u32 res2[0x8];
682 __be32 row0;
683 u32 res3;
684 __be32 col0;
685 u32 res4;
686 __be32 row1;
687 u32 res5;
688 __be32 col1;
689 u32 res6;
690 __be32 row2;
691 u32 res7;
692 __be32 col2;
693 u32 res8;
694 __be32 row3;
695 u32 res9;
696 __be32 col3;
697 u32 res10[0x24];
698 __be32 nand_fbcr;
699 u32 res11;
700 __be32 nand_fir0;
701 __be32 nand_fir1;
702 __be32 nand_fir2;
703 u32 res12[0x10];
704 __be32 nand_csel;
705 u32 res13;
706 __be32 nandseq_strt;
707 u32 res14;
708 __be32 nand_evter_stat;
709 u32 res15;
710 __be32 pgrdcmpl_evt_stat;
711 u32 res16[0x2];
712 __be32 nand_evter_en;
713 u32 res17[0x2];
714 __be32 nand_evter_intr_en;
715 u32 res18[0x2];
716 __be32 nand_erattr0;
717 __be32 nand_erattr1;
718 u32 res19[0x10];
719 __be32 nand_fsr;
720 u32 res20;
721 __be32 nand_eccstat[4];
722 u32 res21[0x20];
723 __be32 nanndcr;
724 u32 res22[0x2];
725 __be32 nand_autoboot_trgr;
726 u32 res23;
727 __be32 nand_mdr;
728 u32 res24[0x5C];
729};
730
731/*
732 * IFC controller NOR Machine registers
733 */
734struct fsl_ifc_nor {
735 __be32 nor_evter_stat;
736 u32 res1[0x2];
737 __be32 nor_evter_en;
738 u32 res2[0x2];
739 __be32 nor_evter_intr_en;
740 u32 res3[0x2];
741 __be32 nor_erattr0;
742 __be32 nor_erattr1;
743 __be32 nor_erattr2;
744 u32 res4[0x4];
745 __be32 norcr;
746 u32 res5[0xEF];
747};
748
749/*
750 * IFC controller GPCM Machine registers
751 */
752struct fsl_ifc_gpcm {
753 __be32 gpcm_evter_stat;
754 u32 res1[0x2];
755 __be32 gpcm_evter_en;
756 u32 res2[0x2];
757 __be32 gpcm_evter_intr_en;
758 u32 res3[0x2];
759 __be32 gpcm_erattr0;
760 __be32 gpcm_erattr1;
761 __be32 gpcm_erattr2;
762 __be32 gpcm_stat;
763 u32 res4[0x1F3];
764};
765
766/*
767 * IFC Controller Registers
768 */
769struct fsl_ifc_regs {
770 __be32 ifc_rev;
771 u32 res1[0x3];
772 struct {
773 __be32 cspr;
774 u32 res2[0x2];
775 } cspr_cs[FSL_IFC_BANK_COUNT];
776 u32 res3[0x18];
777 struct {
778 __be32 amask;
779 u32 res4[0x2];
780 } amask_cs[FSL_IFC_BANK_COUNT];
781 u32 res5[0x18];
782 struct {
783 __be32 csor;
784 u32 res6[0x2];
785 } csor_cs[FSL_IFC_BANK_COUNT];
786 u32 res7[0x18];
787 struct {
788 __be32 ftim[4];
789 u32 res8[0x8];
790 } ftim_cs[FSL_IFC_BANK_COUNT];
791 u32 res9[0x60];
792 __be32 rb_stat;
793 u32 res10[0x2];
794 __be32 ifc_gcr;
795 u32 res11[0x2];
796 __be32 cm_evter_stat;
797 u32 res12[0x2];
798 __be32 cm_evter_en;
799 u32 res13[0x2];
800 __be32 cm_evter_intr_en;
801 u32 res14[0x2];
802 __be32 cm_erattr0;
803 __be32 cm_erattr1;
804 u32 res15[0x2];
805 __be32 ifc_ccr;
806 __be32 ifc_csr;
807 u32 res16[0x2EB];
808 struct fsl_ifc_nand ifc_nand;
809 struct fsl_ifc_nor ifc_nor;
810 struct fsl_ifc_gpcm ifc_gpcm;
811};
812
813extern unsigned int convert_ifc_address(phys_addr_t addr_base);
814extern int fsl_ifc_find(phys_addr_t addr_base);
815
816/* overview of the fsl ifc controller */
817
818struct fsl_ifc_ctrl {
819 /* device info */
820 struct device *dev;
821 struct fsl_ifc_regs __iomem *regs;
822 int irq;
823 int nand_irq;
824 spinlock_t lock;
825 void *nand;
826
827 u32 nand_stat;
828 wait_queue_head_t nand_wait;
829};
830
831extern struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
832
833
834#endif /* __ASM_FSL_IFC_H */
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index 8a0b5ece8f76..420b45368fcf 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -238,8 +238,6 @@ struct fsl_lbc_regs {
238#define FPAR_LP_CI_SHIFT 0 238#define FPAR_LP_CI_SHIFT 0
239 __be32 fbcr; /**< Flash Byte Count Register */ 239 __be32 fbcr; /**< Flash Byte Count Register */
240#define FBCR_BC 0x00000FFF 240#define FBCR_BC 0x00000FFF
241 u8 res11[0x8];
242 u8 res8[0xF00];
243}; 241};
244 242
245/* 243/*
@@ -294,6 +292,11 @@ struct fsl_lbc_ctrl {
294 292
295 /* status read from LTESR by irq handler */ 293 /* status read from LTESR by irq handler */
296 unsigned int irq_status; 294 unsigned int irq_status;
295
296#ifdef CONFIG_SUSPEND
297 /* save regs when system go to deep-sleep */
298 struct fsl_lbc_regs *saved_regs;
299#endif
297}; 300};
298 301
299extern int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, 302extern int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base,
diff --git a/arch/powerpc/include/asm/futex.h b/arch/powerpc/include/asm/futex.h
index c94e4a3fe2ef..2a9cf845473b 100644
--- a/arch/powerpc/include/asm/futex.h
+++ b/arch/powerpc/include/asm/futex.h
@@ -11,12 +11,13 @@
11 11
12#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ 12#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
13 __asm__ __volatile ( \ 13 __asm__ __volatile ( \
14 PPC_RELEASE_BARRIER \ 14 PPC_ATOMIC_ENTRY_BARRIER \
15"1: lwarx %0,0,%2\n" \ 15"1: lwarx %0,0,%2\n" \
16 insn \ 16 insn \
17 PPC405_ERR77(0, %2) \ 17 PPC405_ERR77(0, %2) \
18"2: stwcx. %1,0,%2\n" \ 18"2: stwcx. %1,0,%2\n" \
19 "bne- 1b\n" \ 19 "bne- 1b\n" \
20 PPC_ATOMIC_EXIT_BARRIER \
20 "li %1,0\n" \ 21 "li %1,0\n" \
21"3: .section .fixup,\"ax\"\n" \ 22"3: .section .fixup,\"ax\"\n" \
22"4: li %1,%3\n" \ 23"4: li %1,%3\n" \
@@ -92,14 +93,14 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
92 return -EFAULT; 93 return -EFAULT;
93 94
94 __asm__ __volatile__ ( 95 __asm__ __volatile__ (
95 PPC_RELEASE_BARRIER 96 PPC_ATOMIC_ENTRY_BARRIER
96"1: lwarx %1,0,%3 # futex_atomic_cmpxchg_inatomic\n\ 97"1: lwarx %1,0,%3 # futex_atomic_cmpxchg_inatomic\n\
97 cmpw 0,%1,%4\n\ 98 cmpw 0,%1,%4\n\
98 bne- 3f\n" 99 bne- 3f\n"
99 PPC405_ERR77(0,%3) 100 PPC405_ERR77(0,%3)
100"2: stwcx. %5,0,%3\n\ 101"2: stwcx. %5,0,%3\n\
101 bne- 1b\n" 102 bne- 1b\n"
102 PPC_ACQUIRE_BARRIER 103 PPC_ATOMIC_EXIT_BARRIER
103"3: .section .fixup,\"ax\"\n\ 104"3: .section .fixup,\"ax\"\n\
1044: li %0,%6\n\ 1054: li %0,%6\n\
105 b 3b\n\ 106 b 3b\n\
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 86004930a78e..dfdb95bc59a5 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -5,7 +5,6 @@
5#include <asm/page.h> 5#include <asm/page.h>
6 6
7extern struct kmem_cache *hugepte_cache; 7extern struct kmem_cache *hugepte_cache;
8extern void __init reserve_hugetlb_gpages(void);
9 8
10static inline pte_t *hugepd_page(hugepd_t hpd) 9static inline pte_t *hugepd_page(hugepd_t hpd)
11{ 10{
@@ -22,14 +21,14 @@ static inline pte_t *hugepte_offset(hugepd_t *hpdp, unsigned long addr,
22 unsigned pdshift) 21 unsigned pdshift)
23{ 22{
24 /* 23 /*
25 * On 32-bit, we have multiple higher-level table entries that point to 24 * On FSL BookE, we have multiple higher-level table entries that
26 * the same hugepte. Just use the first one since they're all 25 * point to the same hugepte. Just use the first one since they're all
27 * identical. So for that case, idx=0. 26 * identical. So for that case, idx=0.
28 */ 27 */
29 unsigned long idx = 0; 28 unsigned long idx = 0;
30 29
31 pte_t *dir = hugepd_page(*hpdp); 30 pte_t *dir = hugepd_page(*hpdp);
32#ifdef CONFIG_PPC64 31#ifndef CONFIG_PPC_FSL_BOOK3E
33 idx = (addr & ((1UL << pdshift) - 1)) >> hugepd_shift(*hpdp); 32 idx = (addr & ((1UL << pdshift) - 1)) >> hugepd_shift(*hpdp);
34#endif 33#endif
35 34
@@ -53,7 +52,8 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
53} 52}
54#endif 53#endif
55 54
56void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte); 55void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea,
56 pte_t pte);
57void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 57void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
58 58
59void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, 59void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
@@ -124,7 +124,17 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
124 unsigned long addr, pte_t *ptep, 124 unsigned long addr, pte_t *ptep,
125 pte_t pte, int dirty) 125 pte_t pte, int dirty)
126{ 126{
127#ifdef HUGETLB_NEED_PRELOAD
128 /*
129 * The "return 1" forces a call of update_mmu_cache, which will write a
130 * TLB entry. Without this, platforms that don't do a write of the TLB
131 * entry in the TLB miss handler asm will fault ad infinitum.
132 */
133 ptep_set_access_flags(vma, addr, ptep, pte, dirty);
134 return 1;
135#else
127 return ptep_set_access_flags(vma, addr, ptep, pte, dirty); 136 return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
137#endif
128} 138}
129 139
130static inline pte_t huge_ptep_get(pte_t *ptep) 140static inline pte_t huge_ptep_get(pte_t *ptep)
@@ -142,14 +152,24 @@ static inline void arch_release_hugepage(struct page *page)
142} 152}
143 153
144#else /* ! CONFIG_HUGETLB_PAGE */ 154#else /* ! CONFIG_HUGETLB_PAGE */
145static inline void reserve_hugetlb_gpages(void)
146{
147 pr_err("Cannot reserve gpages without hugetlb enabled\n");
148}
149static inline void flush_hugetlb_page(struct vm_area_struct *vma, 155static inline void flush_hugetlb_page(struct vm_area_struct *vma,
150 unsigned long vmaddr) 156 unsigned long vmaddr)
151{ 157{
152} 158}
159#endif /* CONFIG_HUGETLB_PAGE */
160
161
162/*
163 * FSL Book3E platforms require special gpage handling - the gpages
164 * are reserved early in the boot process by memblock instead of via
165 * the .dts as on IBM platforms.
166 */
167#if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PPC_FSL_BOOK3E)
168extern void __init reserve_hugetlb_gpages(void);
169#else
170static inline void reserve_hugetlb_gpages(void)
171{
172}
153#endif 173#endif
154 174
155#endif /* _ASM_POWERPC_HUGETLB_H */ 175#endif /* _ASM_POWERPC_HUGETLB_H */
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 45698d55cd6a..a3855b81eada 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -394,7 +394,7 @@ __do_out_asm(_rec_outl, "stwbrx")
394#endif /* CONFIG_PPC32 */ 394#endif /* CONFIG_PPC32 */
395 395
396/* The "__do_*" operations below provide the actual "base" implementation 396/* The "__do_*" operations below provide the actual "base" implementation
397 * for each of the defined acccessor. Some of them use the out_* functions 397 * for each of the defined accessors. Some of them use the out_* functions
398 * directly, some of them still use EEH, though we might change that in the 398 * directly, some of them still use EEH, though we might change that in the
399 * future. Those macros below provide the necessary argument swapping and 399 * future. Those macros below provide the necessary argument swapping and
400 * handling of the IO base for PIO. 400 * handling of the IO base for PIO.
diff --git a/arch/powerpc/include/asm/kdump.h b/arch/powerpc/include/asm/kdump.h
index bffd062adf79..c9776202d7ec 100644
--- a/arch/powerpc/include/asm/kdump.h
+++ b/arch/powerpc/include/asm/kdump.h
@@ -32,11 +32,11 @@
32 32
33#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
34 34
35#if defined(CONFIG_CRASH_DUMP) && !defined(CONFIG_RELOCATABLE) 35#if defined(CONFIG_CRASH_DUMP) && !defined(CONFIG_NONSTATIC_KERNEL)
36extern void reserve_kdump_trampoline(void); 36extern void reserve_kdump_trampoline(void);
37extern void setup_kdump_trampoline(void); 37extern void setup_kdump_trampoline(void);
38#else 38#else
39/* !CRASH_DUMP || RELOCATABLE */ 39/* !CRASH_DUMP || !NONSTATIC_KERNEL */
40static inline void reserve_kdump_trampoline(void) { ; } 40static inline void reserve_kdump_trampoline(void) { ; }
41static inline void setup_kdump_trampoline(void) { ; } 41static inline void setup_kdump_trampoline(void) { ; }
42#endif 42#endif
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index f921eb121d39..16d7e33d35e9 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -49,7 +49,6 @@
49#define KEXEC_STATE_REAL_MODE 2 49#define KEXEC_STATE_REAL_MODE 2
50 50
51#ifndef __ASSEMBLY__ 51#ifndef __ASSEMBLY__
52#include <linux/cpumask.h>
53#include <asm/reg.h> 52#include <asm/reg.h>
54 53
55typedef void (*crash_shutdown_t)(void); 54typedef void (*crash_shutdown_t)(void);
@@ -73,11 +72,6 @@ extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
73 master to copy new code to 0 */ 72 master to copy new code to 0 */
74extern int crashing_cpu; 73extern int crashing_cpu;
75extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)); 74extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *));
76extern cpumask_t cpus_in_sr;
77static inline int kexec_sr_activated(int cpu)
78{
79 return cpumask_test_cpu(cpu, &cpus_in_sr);
80}
81 75
82struct kimage; 76struct kimage;
83struct pt_regs; 77struct pt_regs;
@@ -94,7 +88,6 @@ extern void reserve_crashkernel(void);
94extern void machine_kexec_mask_interrupts(void); 88extern void machine_kexec_mask_interrupts(void);
95 89
96#else /* !CONFIG_KEXEC */ 90#else /* !CONFIG_KEXEC */
97static inline int kexec_sr_activated(int cpu) { return 0; }
98static inline void crash_kexec_secondary(struct pt_regs *regs) { } 91static inline void crash_kexec_secondary(struct pt_regs *regs) { }
99 92
100static inline int overlaps_crashkernel(unsigned long start, unsigned long size) 93static inline int overlaps_crashkernel(unsigned long start, unsigned long size)
diff --git a/arch/powerpc/include/asm/keylargo.h b/arch/powerpc/include/asm/keylargo.h
index d8520ef121f9..fc195d0b3c34 100644
--- a/arch/powerpc/include/asm/keylargo.h
+++ b/arch/powerpc/include/asm/keylargo.h
@@ -51,7 +51,7 @@
51 51
52#define KL_GPIO_SOUND_POWER (KEYLARGO_GPIO_0+0x05) 52#define KL_GPIO_SOUND_POWER (KEYLARGO_GPIO_0+0x05)
53 53
54/* Hrm... this one is only to be used on Pismo. It seeem to also 54/* Hrm... this one is only to be used on Pismo. It seems to also
55 * control the timebase enable on other machines. Still to be 55 * control the timebase enable on other machines. Still to be
56 * experimented... --BenH. 56 * experimented... --BenH.
57 */ 57 */
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
index 08fe69edcd10..0ad432bc81d6 100644
--- a/arch/powerpc/include/asm/kvm.h
+++ b/arch/powerpc/include/asm/kvm.h
@@ -149,12 +149,6 @@ struct kvm_regs {
149#define KVM_SREGS_E_UPDATE_DBSR (1 << 3) 149#define KVM_SREGS_E_UPDATE_DBSR (1 << 3)
150 150
151/* 151/*
152 * Book3S special bits to indicate contents in the struct by maintaining
153 * backwards compatibility with older structs. If adding a new field,
154 * please make sure to add a flag for that new field */
155#define KVM_SREGS_S_HIOR (1 << 0)
156
157/*
158 * In KVM_SET_SREGS, reserved/pad fields must be left untouched from a 152 * In KVM_SET_SREGS, reserved/pad fields must be left untouched from a
159 * previous KVM_GET_REGS. 153 * previous KVM_GET_REGS.
160 * 154 *
@@ -179,8 +173,6 @@ struct kvm_sregs {
179 __u64 ibat[8]; 173 __u64 ibat[8];
180 __u64 dbat[8]; 174 __u64 dbat[8];
181 } ppc32; 175 } ppc32;
182 __u64 flags; /* KVM_SREGS_S_ */
183 __u64 hior;
184 } s; 176 } s;
185 struct { 177 struct {
186 union { 178 union {
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index a384ffdf33de..69c7377d2071 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -90,8 +90,6 @@ struct kvmppc_vcpu_book3s {
90#endif 90#endif
91 int context_id[SID_CONTEXTS]; 91 int context_id[SID_CONTEXTS];
92 92
93 bool hior_sregs; /* HIOR is set by SREGS, not PVR */
94
95 struct hlist_head hpte_hash_pte[HPTEG_HASH_NUM_PTE]; 93 struct hlist_head hpte_hash_pte[HPTEG_HASH_NUM_PTE];
96 struct hlist_head hpte_hash_pte_long[HPTEG_HASH_NUM_PTE_LONG]; 94 struct hlist_head hpte_hash_pte_long[HPTEG_HASH_NUM_PTE_LONG];
97 struct hlist_head hpte_hash_vpte[HPTEG_HASH_NUM_VPTE]; 95 struct hlist_head hpte_hash_vpte[HPTEG_HASH_NUM_VPTE];
@@ -383,39 +381,6 @@ static inline bool kvmppc_critical_section(struct kvm_vcpu *vcpu)
383} 381}
384#endif 382#endif
385 383
386static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
387 unsigned long pte_index)
388{
389 unsigned long rb, va_low;
390
391 rb = (v & ~0x7fUL) << 16; /* AVA field */
392 va_low = pte_index >> 3;
393 if (v & HPTE_V_SECONDARY)
394 va_low = ~va_low;
395 /* xor vsid from AVA */
396 if (!(v & HPTE_V_1TB_SEG))
397 va_low ^= v >> 12;
398 else
399 va_low ^= v >> 24;
400 va_low &= 0x7ff;
401 if (v & HPTE_V_LARGE) {
402 rb |= 1; /* L field */
403 if (cpu_has_feature(CPU_FTR_ARCH_206) &&
404 (r & 0xff000)) {
405 /* non-16MB large page, must be 64k */
406 /* (masks depend on page size) */
407 rb |= 0x1000; /* page encoding in LP field */
408 rb |= (va_low & 0x7f) << 16; /* 7b of VA in AVA/LP field */
409 rb |= (va_low & 0xfe); /* AVAL field (P7 doesn't seem to care) */
410 }
411 } else {
412 /* 4kB page */
413 rb |= (va_low & 0x7ff) << 12; /* remaining 11b of VA */
414 }
415 rb |= (v >> 54) & 0x300; /* B field */
416 return rb;
417}
418
419/* Magic register values loaded into r3 and r4 before the 'sc' assembly 384/* Magic register values loaded into r3 and r4 before the 'sc' assembly
420 * instruction for the OSI hypercalls */ 385 * instruction for the OSI hypercalls */
421#define OSI_SC_MAGIC_R3 0x113724FA 386#define OSI_SC_MAGIC_R3 0x113724FA
diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
index e43fe42b9875..d0ac94f98f9e 100644
--- a/arch/powerpc/include/asm/kvm_book3s_64.h
+++ b/arch/powerpc/include/asm/kvm_book3s_64.h
@@ -29,4 +29,37 @@ static inline struct kvmppc_book3s_shadow_vcpu *to_svcpu(struct kvm_vcpu *vcpu)
29 29
30#define SPAPR_TCE_SHIFT 12 30#define SPAPR_TCE_SHIFT 12
31 31
32static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
33 unsigned long pte_index)
34{
35 unsigned long rb, va_low;
36
37 rb = (v & ~0x7fUL) << 16; /* AVA field */
38 va_low = pte_index >> 3;
39 if (v & HPTE_V_SECONDARY)
40 va_low = ~va_low;
41 /* xor vsid from AVA */
42 if (!(v & HPTE_V_1TB_SEG))
43 va_low ^= v >> 12;
44 else
45 va_low ^= v >> 24;
46 va_low &= 0x7ff;
47 if (v & HPTE_V_LARGE) {
48 rb |= 1; /* L field */
49 if (cpu_has_feature(CPU_FTR_ARCH_206) &&
50 (r & 0xff000)) {
51 /* non-16MB large page, must be 64k */
52 /* (masks depend on page size) */
53 rb |= 0x1000; /* page encoding in LP field */
54 rb |= (va_low & 0x7f) << 16; /* 7b of VA in AVA/LP field */
55 rb |= (va_low & 0xfe); /* AVAL field (P7 doesn't seem to care) */
56 }
57 } else {
58 /* 4kB page */
59 rb |= (va_low & 0x7ff) << 12; /* remaining 11b of VA */
60 }
61 rb |= (v >> 54) & 0x300; /* B field */
62 return rb;
63}
64
32#endif /* __ASM_KVM_BOOK3S_64_H__ */ 65#endif /* __ASM_KVM_BOOK3S_64_H__ */
diff --git a/arch/powerpc/include/asm/lv1call.h b/arch/powerpc/include/asm/lv1call.h
index f77c708c67a0..233f9ecae761 100644
--- a/arch/powerpc/include/asm/lv1call.h
+++ b/arch/powerpc/include/asm/lv1call.h
@@ -231,7 +231,7 @@ LV1_CALL(allocate_memory, 4, 2, 0 )
231LV1_CALL(write_htab_entry, 4, 0, 1 ) 231LV1_CALL(write_htab_entry, 4, 0, 1 )
232LV1_CALL(construct_virtual_address_space, 3, 2, 2 ) 232LV1_CALL(construct_virtual_address_space, 3, 2, 2 )
233LV1_CALL(invalidate_htab_entries, 5, 0, 3 ) 233LV1_CALL(invalidate_htab_entries, 5, 0, 3 )
234LV1_CALL(get_virtual_address_space_id_of_ppe, 1, 1, 4 ) 234LV1_CALL(get_virtual_address_space_id_of_ppe, 0, 1, 4 )
235LV1_CALL(query_logical_partition_address_region_info, 1, 5, 6 ) 235LV1_CALL(query_logical_partition_address_region_info, 1, 5, 6 )
236LV1_CALL(select_virtual_address_space, 1, 0, 7 ) 236LV1_CALL(select_virtual_address_space, 1, 0, 7 )
237LV1_CALL(pause, 1, 0, 9 ) 237LV1_CALL(pause, 1, 0, 9 )
@@ -264,7 +264,7 @@ LV1_CALL(configure_execution_time_variable, 1, 0, 77 )
264LV1_CALL(get_spe_irq_outlet, 2, 1, 78 ) 264LV1_CALL(get_spe_irq_outlet, 2, 1, 78 )
265LV1_CALL(set_spe_privilege_state_area_1_register, 3, 0, 79 ) 265LV1_CALL(set_spe_privilege_state_area_1_register, 3, 0, 79 )
266LV1_CALL(create_repository_node, 6, 0, 90 ) 266LV1_CALL(create_repository_node, 6, 0, 90 )
267LV1_CALL(get_repository_node_value, 5, 2, 91 ) 267LV1_CALL(read_repository_node, 5, 2, 91 )
268LV1_CALL(modify_repository_node_value, 6, 0, 92 ) 268LV1_CALL(modify_repository_node_value, 6, 0, 92 )
269LV1_CALL(remove_repository_node, 4, 0, 93 ) 269LV1_CALL(remove_repository_node, 4, 0, 93 )
270LV1_CALL(read_htab_entries, 2, 5, 95 ) 270LV1_CALL(read_htab_entries, 2, 5, 95 )
@@ -276,7 +276,7 @@ LV1_CALL(construct_io_irq_outlet, 1, 1, 120 )
276LV1_CALL(destruct_io_irq_outlet, 1, 0, 121 ) 276LV1_CALL(destruct_io_irq_outlet, 1, 0, 121 )
277LV1_CALL(map_htab, 1, 1, 122 ) 277LV1_CALL(map_htab, 1, 1, 122 )
278LV1_CALL(unmap_htab, 1, 0, 123 ) 278LV1_CALL(unmap_htab, 1, 0, 123 )
279LV1_CALL(get_version_info, 0, 1, 127 ) 279LV1_CALL(get_version_info, 0, 2, 127 )
280LV1_CALL(insert_htab_entry, 6, 3, 158 ) 280LV1_CALL(insert_htab_entry, 6, 3, 158 )
281LV1_CALL(read_virtual_uart, 3, 1, 162 ) 281LV1_CALL(read_virtual_uart, 3, 1, 162 )
282LV1_CALL(write_virtual_uart, 3, 1, 163 ) 282LV1_CALL(write_virtual_uart, 3, 1, 163 )
@@ -294,9 +294,9 @@ LV1_CALL(unmap_device_dma_region, 4, 0, 177 )
294LV1_CALL(net_add_multicast_address, 4, 0, 185 ) 294LV1_CALL(net_add_multicast_address, 4, 0, 185 )
295LV1_CALL(net_remove_multicast_address, 4, 0, 186 ) 295LV1_CALL(net_remove_multicast_address, 4, 0, 186 )
296LV1_CALL(net_start_tx_dma, 4, 0, 187 ) 296LV1_CALL(net_start_tx_dma, 4, 0, 187 )
297LV1_CALL(net_stop_tx_dma, 3, 0, 188 ) 297LV1_CALL(net_stop_tx_dma, 2, 0, 188 )
298LV1_CALL(net_start_rx_dma, 4, 0, 189 ) 298LV1_CALL(net_start_rx_dma, 4, 0, 189 )
299LV1_CALL(net_stop_rx_dma, 3, 0, 190 ) 299LV1_CALL(net_stop_rx_dma, 2, 0, 190 )
300LV1_CALL(net_set_interrupt_status_indicator, 4, 0, 191 ) 300LV1_CALL(net_set_interrupt_status_indicator, 4, 0, 191 )
301LV1_CALL(net_set_interrupt_mask, 4, 0, 193 ) 301LV1_CALL(net_set_interrupt_mask, 4, 0, 193 )
302LV1_CALL(net_control, 6, 2, 194 ) 302LV1_CALL(net_control, 6, 2, 194 )
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index b540d6fcedd6..bf37931d1ad6 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -213,6 +213,9 @@ struct machdep_calls {
213 * allow assignment/enabling of the device. */ 213 * allow assignment/enabling of the device. */
214 int (*pcibios_enable_device_hook)(struct pci_dev *); 214 int (*pcibios_enable_device_hook)(struct pci_dev *);
215 215
216 /* Called after scan and before resource survey */
217 void (*pcibios_fixup_phb)(struct pci_controller *hose);
218
216 /* Called to shutdown machine specific hardware not already controlled 219 /* Called to shutdown machine specific hardware not already controlled
217 * by other drivers. 220 * by other drivers.
218 */ 221 */
diff --git a/arch/powerpc/include/asm/memblock.h b/arch/powerpc/include/asm/memblock.h
deleted file mode 100644
index 43efc345065e..000000000000
--- a/arch/powerpc/include/asm/memblock.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _ASM_POWERPC_MEMBLOCK_H
2#define _ASM_POWERPC_MEMBLOCK_H
3
4#include <asm/udbg.h>
5
6#define MEMBLOCK_DBG(fmt...) udbg_printf(fmt)
7
8#endif /* _ASM_POWERPC_MEMBLOCK_H */
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h
index 0260ea5ec3c2..f5f89cafebd0 100644
--- a/arch/powerpc/include/asm/mmu-book3e.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -214,6 +214,10 @@ typedef struct {
214 unsigned int id; 214 unsigned int id;
215 unsigned int active; 215 unsigned int active;
216 unsigned long vdso_base; 216 unsigned long vdso_base;
217#ifdef CONFIG_PPC_ICSWX
218 struct spinlock *cop_lockp; /* guard cop related stuff */
219 unsigned long acop; /* mask of enabled coprocessor types */
220#endif /* CONFIG_PPC_ICSWX */
217#ifdef CONFIG_PPC_MM_SLICES 221#ifdef CONFIG_PPC_MM_SLICES
218 u64 low_slices_psize; /* SLB page size encodings */ 222 u64 low_slices_psize; /* SLB page size encodings */
219 u64 high_slices_psize; /* 4 bits per slice for now */ 223 u64 high_slices_psize; /* 4 bits per slice for now */
@@ -254,6 +258,13 @@ extern int mmu_vmemmap_psize;
254 258
255#ifdef CONFIG_PPC64 259#ifdef CONFIG_PPC64
256extern unsigned long linear_map_top; 260extern unsigned long linear_map_top;
261
262/*
263 * 64-bit booke platforms don't load the tlb in the tlb miss handler code.
264 * HUGETLB_NEED_PRELOAD handles this - it causes huge_ptep_set_access_flags to
265 * return 1, indicating that the tlb requires preloading.
266 */
267#define HUGETLB_NEED_PRELOAD
257#endif 268#endif
258 269
259#endif /* !__ASSEMBLY__ */ 270#endif /* !__ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index db645ec842bd..412ba493cb98 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -312,10 +312,9 @@ extern void slb_set_size(u16 size);
312 * (i.e. everything above 0xC000000000000000), except the very top 312 * (i.e. everything above 0xC000000000000000), except the very top
313 * segment, which simplifies several things. 313 * segment, which simplifies several things.
314 * 314 *
315 * - We allow for 15 significant bits of ESID and 20 bits of 315 * - We allow for 16 significant bits of ESID and 19 bits of
316 * context for user addresses. i.e. 8T (43 bits) of address space for 316 * context for user addresses. i.e. 16T (44 bits) of address space for
317 * up to 1M contexts (although the page table structure and context 317 * up to half a million contexts.
318 * allocation will need changes to take advantage of this).
319 * 318 *
320 * - The scramble function gives robust scattering in the hash 319 * - The scramble function gives robust scattering in the hash
321 * table (at least based on some initial results). The previous 320 * table (at least based on some initial results). The previous
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h
index e6fae49e0b74..67b4d9837236 100644
--- a/arch/powerpc/include/asm/mpic.h
+++ b/arch/powerpc/include/asm/mpic.h
@@ -251,6 +251,9 @@ struct mpic_irq_save {
251/* The instance data of a given MPIC */ 251/* The instance data of a given MPIC */
252struct mpic 252struct mpic
253{ 253{
254 /* The OpenFirmware dt node for this MPIC */
255 struct device_node *node;
256
254 /* The remapper for this MPIC */ 257 /* The remapper for this MPIC */
255 struct irq_host *irqhost; 258 struct irq_host *irqhost;
256 259
@@ -293,6 +296,9 @@ struct mpic
293 /* Register access method */ 296 /* Register access method */
294 enum mpic_reg_type reg_type; 297 enum mpic_reg_type reg_type;
295 298
299 /* The physical base address of the MPIC */
300 phys_addr_t paddr;
301
296 /* The various ioremap'ed bases */ 302 /* The various ioremap'ed bases */
297 struct mpic_reg_bank gregs; 303 struct mpic_reg_bank gregs;
298 struct mpic_reg_bank tmregs; 304 struct mpic_reg_bank tmregs;
@@ -331,11 +337,11 @@ struct mpic
331 * Note setting any ID (leaving those bits to 0) means standard MPIC 337 * Note setting any ID (leaving those bits to 0) means standard MPIC
332 */ 338 */
333 339
334/* This is the primary controller, only that one has IPIs and 340/*
335 * has afinity control. A non-primary MPIC always uses CPU0 341 * This is a secondary ("chained") controller; it only uses the CPU0
336 * registers only 342 * registers. Primary controllers have IPIs and affinity control.
337 */ 343 */
338#define MPIC_PRIMARY 0x00000001 344#define MPIC_SECONDARY 0x00000001
339 345
340/* Set this for a big-endian MPIC */ 346/* Set this for a big-endian MPIC */
341#define MPIC_BIG_ENDIAN 0x00000002 347#define MPIC_BIG_ENDIAN 0x00000002
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 2893e8f5406d..a4b28f165b6c 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -109,6 +109,14 @@ extern int opal_enter_rtas(struct rtas_args *args,
109#define OPAL_PCI_MAP_PE_DMA_WINDOW 44 109#define OPAL_PCI_MAP_PE_DMA_WINDOW 44
110#define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45 110#define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45
111#define OPAL_PCI_RESET 49 111#define OPAL_PCI_RESET 49
112#define OPAL_PCI_GET_HUB_DIAG_DATA 50
113#define OPAL_PCI_GET_PHB_DIAG_DATA 51
114#define OPAL_PCI_FENCE_PHB 52
115#define OPAL_PCI_REINIT 53
116#define OPAL_PCI_MASK_PE_ERROR 54
117#define OPAL_SET_SLOT_LED_STATUS 55
118#define OPAL_GET_EPOW_STATUS 56
119#define OPAL_SET_SYSTEM_ATTENTION_LED 57
112 120
113#ifndef __ASSEMBLY__ 121#ifndef __ASSEMBLY__
114 122
@@ -169,7 +177,11 @@ enum OpalPendingState {
169 OPAL_EVENT_NVRAM = 0x2, 177 OPAL_EVENT_NVRAM = 0x2,
170 OPAL_EVENT_RTC = 0x4, 178 OPAL_EVENT_RTC = 0x4,
171 OPAL_EVENT_CONSOLE_OUTPUT = 0x8, 179 OPAL_EVENT_CONSOLE_OUTPUT = 0x8,
172 OPAL_EVENT_CONSOLE_INPUT = 0x10 180 OPAL_EVENT_CONSOLE_INPUT = 0x10,
181 OPAL_EVENT_ERROR_LOG_AVAIL = 0x20,
182 OPAL_EVENT_ERROR_LOG = 0x40,
183 OPAL_EVENT_EPOW = 0x80,
184 OPAL_EVENT_LED_STATUS = 0x100
173}; 185};
174 186
175/* Machine check related definitions */ 187/* Machine check related definitions */
@@ -258,13 +270,49 @@ enum OpalPeAction {
258 OPAL_MAP_PE = 1 270 OPAL_MAP_PE = 1
259}; 271};
260 272
273enum OpalPeltvAction {
274 OPAL_REMOVE_PE_FROM_DOMAIN = 0,
275 OPAL_ADD_PE_TO_DOMAIN = 1
276};
277
278enum OpalMveEnableAction {
279 OPAL_DISABLE_MVE = 0,
280 OPAL_ENABLE_MVE = 1
281};
282
261enum OpalPciResetAndReinitScope { 283enum OpalPciResetAndReinitScope {
262 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3, 284 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3,
263 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5, 285 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5,
264 OPAL_PCI_IODA_RESET = 6, 286 OPAL_PCI_IODA_TABLE_RESET = 6,
287};
288
289enum OpalPciResetState {
290 OPAL_DEASSERT_RESET = 0,
291 OPAL_ASSERT_RESET = 1
265}; 292};
266 293
267enum OpalPciResetState { OPAL_DEASSERT_RESET = 0, OPAL_ASSERT_RESET = 1 }; 294enum OpalPciMaskAction {
295 OPAL_UNMASK_ERROR_TYPE = 0,
296 OPAL_MASK_ERROR_TYPE = 1
297};
298
299enum OpalSlotLedType {
300 OPAL_SLOT_LED_ID_TYPE = 0,
301 OPAL_SLOT_LED_FAULT_TYPE = 1
302};
303
304enum OpalLedAction {
305 OPAL_TURN_OFF_LED = 0,
306 OPAL_TURN_ON_LED = 1,
307 OPAL_QUERY_LED_STATE_AFTER_BUSY = 2
308};
309
310enum OpalEpowStatus {
311 OPAL_EPOW_NONE = 0,
312 OPAL_EPOW_UPS = 1,
313 OPAL_EPOW_OVER_AMBIENT_TEMP = 2,
314 OPAL_EPOW_OVER_INTERNAL_TEMP = 3
315};
268 316
269struct opal_machine_check_event { 317struct opal_machine_check_event {
270 enum OpalMCE_Version version:8; /* 0x00 */ 318 enum OpalMCE_Version version:8; /* 0x00 */
@@ -314,8 +362,74 @@ struct opal_machine_check_event {
314 } u; 362 } u;
315}; 363};
316 364
365/**
366 * This structure defines the overlay which will be used to store PHB error
367 * data upon request.
368 */
369enum {
370 OPAL_P7IOC_NUM_PEST_REGS = 128,
371};
372
373struct OpalIoP7IOCPhbErrorData {
374 uint32_t brdgCtl;
375
376 // P7IOC utl regs
377 uint32_t portStatusReg;
378 uint32_t rootCmplxStatus;
379 uint32_t busAgentStatus;
380
381 // P7IOC cfg regs
382 uint32_t deviceStatus;
383 uint32_t slotStatus;
384 uint32_t linkStatus;
385 uint32_t devCmdStatus;
386 uint32_t devSecStatus;
387
388 // cfg AER regs
389 uint32_t rootErrorStatus;
390 uint32_t uncorrErrorStatus;
391 uint32_t corrErrorStatus;
392 uint32_t tlpHdr1;
393 uint32_t tlpHdr2;
394 uint32_t tlpHdr3;
395 uint32_t tlpHdr4;
396 uint32_t sourceId;
397
398 uint32_t rsv3;
399
400 // Record data about the call to allocate a buffer.
401 uint64_t errorClass;
402 uint64_t correlator;
403
404 //P7IOC MMIO Error Regs
405 uint64_t p7iocPlssr; // n120
406 uint64_t p7iocCsr; // n110
407 uint64_t lemFir; // nC00
408 uint64_t lemErrorMask; // nC18
409 uint64_t lemWOF; // nC40
410 uint64_t phbErrorStatus; // nC80
411 uint64_t phbFirstErrorStatus; // nC88
412 uint64_t phbErrorLog0; // nCC0
413 uint64_t phbErrorLog1; // nCC8
414 uint64_t mmioErrorStatus; // nD00
415 uint64_t mmioFirstErrorStatus; // nD08
416 uint64_t mmioErrorLog0; // nD40
417 uint64_t mmioErrorLog1; // nD48
418 uint64_t dma0ErrorStatus; // nD80
419 uint64_t dma0FirstErrorStatus; // nD88
420 uint64_t dma0ErrorLog0; // nDC0
421 uint64_t dma0ErrorLog1; // nDC8
422 uint64_t dma1ErrorStatus; // nE00
423 uint64_t dma1FirstErrorStatus; // nE08
424 uint64_t dma1ErrorLog0; // nE40
425 uint64_t dma1ErrorLog1; // nE48
426 uint64_t pestA[OPAL_P7IOC_NUM_PEST_REGS];
427 uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS];
428};
429
317typedef struct oppanel_line { 430typedef struct oppanel_line {
318 /* XXX */ 431 const char * line;
432 uint64_t line_len;
319} oppanel_line_t; 433} oppanel_line_t;
320 434
321/* API functions */ 435/* API functions */
@@ -413,6 +527,15 @@ int64_t opal_pci_map_pe_dma_window_real(uint64_t phb_id, uint16_t pe_number,
413 uint64_t pci_mem_size); 527 uint64_t pci_mem_size);
414int64_t opal_pci_reset(uint64_t phb_id, uint8_t reset_scope, uint8_t assert_state); 528int64_t opal_pci_reset(uint64_t phb_id, uint8_t reset_scope, uint8_t assert_state);
415 529
530int64_t opal_pci_get_hub_diag_data(uint64_t hub_id, void *diag_buffer, uint64_t diag_buffer_len);
531int64_t opal_pci_get_phb_diag_data(uint64_t phb_id, void *diag_buffer, uint64_t diag_buffer_len);
532int64_t opal_pci_fence_phb(uint64_t phb_id);
533int64_t opal_pci_reinit(uint64_t phb_id, uint8_t reinit_scope);
534int64_t opal_pci_mask_pe_error(uint64_t phb_id, uint16_t pe_number, uint8_t error_type, uint8_t mask_action);
535int64_t opal_set_slot_led_status(uint64_t phb_id, uint64_t slot_id, uint8_t led_type, uint8_t led_action);
536int64_t opal_get_epow_status(uint64_t *status);
537int64_t opal_set_system_attention_led(uint8_t led_action);
538
416/* Internal functions */ 539/* Internal functions */
417extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data); 540extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data);
418 541
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 17722c73ba2e..269c05a36d91 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -135,6 +135,7 @@ struct paca_struct {
135 u8 hard_enabled; /* set if irqs are enabled in MSR */ 135 u8 hard_enabled; /* set if irqs are enabled in MSR */
136 u8 io_sync; /* writel() needs spin_unlock sync */ 136 u8 io_sync; /* writel() needs spin_unlock sync */
137 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */ 137 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */
138 u8 nap_state_lost; /* NV GPR values lost in power7_idle */
138 139
139#ifdef CONFIG_PPC_POWERNV 140#ifdef CONFIG_PPC_POWERNV
140 /* Pointer to OPAL machine check event structure set by the 141 /* Pointer to OPAL machine check event structure set by the
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index dd9c4fd038e0..f072e974f8a2 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -92,20 +92,34 @@ extern unsigned int HPAGE_SHIFT;
92#define PAGE_OFFSET ASM_CONST(CONFIG_PAGE_OFFSET) 92#define PAGE_OFFSET ASM_CONST(CONFIG_PAGE_OFFSET)
93#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_PHYSICAL_START)) 93#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_PHYSICAL_START))
94 94
95#if defined(CONFIG_RELOCATABLE) 95#if defined(CONFIG_NONSTATIC_KERNEL)
96#ifndef __ASSEMBLY__ 96#ifndef __ASSEMBLY__
97 97
98extern phys_addr_t memstart_addr; 98extern phys_addr_t memstart_addr;
99extern phys_addr_t kernstart_addr; 99extern phys_addr_t kernstart_addr;
100
101#ifdef CONFIG_RELOCATABLE_PPC32
102extern long long virt_phys_offset;
100#endif 103#endif
104
105#endif /* __ASSEMBLY__ */
101#define PHYSICAL_START kernstart_addr 106#define PHYSICAL_START kernstart_addr
102#else 107
108#else /* !CONFIG_NONSTATIC_KERNEL */
103#define PHYSICAL_START ASM_CONST(CONFIG_PHYSICAL_START) 109#define PHYSICAL_START ASM_CONST(CONFIG_PHYSICAL_START)
104#endif 110#endif
105 111
112/* See Description below for VIRT_PHYS_OFFSET */
113#ifdef CONFIG_RELOCATABLE_PPC32
114#define VIRT_PHYS_OFFSET virt_phys_offset
115#else
116#define VIRT_PHYS_OFFSET (KERNELBASE - PHYSICAL_START)
117#endif
118
119
106#ifdef CONFIG_PPC64 120#ifdef CONFIG_PPC64
107#define MEMORY_START 0UL 121#define MEMORY_START 0UL
108#elif defined(CONFIG_RELOCATABLE) 122#elif defined(CONFIG_NONSTATIC_KERNEL)
109#define MEMORY_START memstart_addr 123#define MEMORY_START memstart_addr
110#else 124#else
111#define MEMORY_START (PHYSICAL_START + PAGE_OFFSET - KERNELBASE) 125#define MEMORY_START (PHYSICAL_START + PAGE_OFFSET - KERNELBASE)
@@ -125,12 +139,77 @@ extern phys_addr_t kernstart_addr;
125 * determine MEMORY_START until then. However we can determine PHYSICAL_START 139 * determine MEMORY_START until then. However we can determine PHYSICAL_START
126 * from information at hand (program counter, TLB lookup). 140 * from information at hand (program counter, TLB lookup).
127 * 141 *
142 * On BookE with RELOCATABLE (RELOCATABLE_PPC32)
143 *
144 * With RELOCATABLE_PPC32, we support loading the kernel at any physical
145 * address without any restriction on the page alignment.
146 *
147 * We find the runtime address of _stext and relocate ourselves based on
148 * the following calculation:
149 *
150 * virtual_base = ALIGN_DOWN(KERNELBASE,256M) +
151 * MODULO(_stext.run,256M)
152 * and create the following mapping:
153 *
154 * ALIGN_DOWN(_stext.run,256M) => ALIGN_DOWN(KERNELBASE,256M)
155 *
156 * When we process relocations, we cannot depend on the
157 * existing equation for the __va()/__pa() translations:
158 *
159 * __va(x) = (x) - PHYSICAL_START + KERNELBASE
160 *
161 * Where:
162 * PHYSICAL_START = kernstart_addr = Physical address of _stext
163 * KERNELBASE = Compiled virtual address of _stext.
164 *
165 * This formula holds true iff, kernel load address is TLB page aligned.
166 *
167 * In our case, we need to also account for the shift in the kernel Virtual
168 * address.
169 *
170 * E.g.,
171 *
172 * Let the kernel be loaded at 64MB and KERNELBASE be 0xc0000000 (same as PAGE_OFFSET).
173 * In this case, we would be mapping 0 to 0xc0000000, and kernstart_addr = 64M
174 *
175 * Now __va(1MB) = (0x100000) - (0x4000000) + 0xc0000000
176 * = 0xbc100000 , which is wrong.
177 *
178 * Rather, it should be : 0xc0000000 + 0x100000 = 0xc0100000
179 * according to our mapping.
180 *
181 * Hence we use the following formula to get the translations right:
182 *
183 * __va(x) = (x) - [ PHYSICAL_START - Effective KERNELBASE ]
184 *
185 * Where :
186 * PHYSICAL_START = dynamic load address.(kernstart_addr variable)
187 * Effective KERNELBASE = virtual_base =
188 * = ALIGN_DOWN(KERNELBASE,256M) +
189 * MODULO(PHYSICAL_START,256M)
190 *
191 * To make the cost of __va() / __pa() more light weight, we introduce
192 * a new variable virt_phys_offset, which will hold :
193 *
194 * virt_phys_offset = Effective KERNELBASE - PHYSICAL_START
195 * = ALIGN_DOWN(KERNELBASE,256M) -
196 * ALIGN_DOWN(PHYSICALSTART,256M)
197 *
198 * Hence :
199 *
200 * __va(x) = x - PHYSICAL_START + Effective KERNELBASE
201 * = x + virt_phys_offset
202 *
203 * and
204 * __pa(x) = x + PHYSICAL_START - Effective KERNELBASE
205 * = x - virt_phys_offset
206 *
128 * On non-Book-E PPC64 PAGE_OFFSET and MEMORY_START are constants so use 207 * On non-Book-E PPC64 PAGE_OFFSET and MEMORY_START are constants so use
129 * the other definitions for __va & __pa. 208 * the other definitions for __va & __pa.
130 */ 209 */
131#ifdef CONFIG_BOOKE 210#ifdef CONFIG_BOOKE
132#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) - PHYSICAL_START + KERNELBASE)) 211#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
133#define __pa(x) ((unsigned long)(x) + PHYSICAL_START - KERNELBASE) 212#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
134#else 213#else
135#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START)) 214#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START))
136#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) 215#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START)
@@ -290,6 +369,7 @@ extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
290extern void copy_user_page(void *to, void *from, unsigned long vaddr, 369extern void copy_user_page(void *to, void *from, unsigned long vaddr,
291 struct page *p); 370 struct page *p);
292extern int page_is_ram(unsigned long pfn); 371extern int page_is_ram(unsigned long pfn);
372extern int devmem_is_allowed(unsigned long pfn);
293 373
294#ifdef CONFIG_PPC_SMLPAR 374#ifdef CONFIG_PPC_SMLPAR
295void arch_free_page(struct page *page, int order); 375void arch_free_page(struct page *page, int order);
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index fb40ede6bc0d..fed85e6290e1 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -130,7 +130,9 @@ do { \
130 130
131#ifdef CONFIG_HUGETLB_PAGE 131#ifdef CONFIG_HUGETLB_PAGE
132 132
133#ifdef CONFIG_PPC_MM_SLICES
133#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA 134#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
135#endif
134 136
135#endif /* !CONFIG_HUGETLB_PAGE */ 137#endif /* !CONFIG_HUGETLB_PAGE */
136 138
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 56b879ab3a40..882b6aa6c857 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -153,8 +153,8 @@ struct pci_dn {
153 153
154 int pci_ext_config_space; /* for pci devices */ 154 int pci_ext_config_space; /* for pci devices */
155 155
156#ifdef CONFIG_EEH
157 struct pci_dev *pcidev; /* back-pointer to the pci device */ 156 struct pci_dev *pcidev; /* back-pointer to the pci device */
157#ifdef CONFIG_EEH
158 int class_code; /* pci device class */ 158 int class_code; /* pci device class */
159 int eeh_mode; /* See eeh.h for possible EEH_MODEs */ 159 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
160 int eeh_config_addr; 160 int eeh_config_addr;
@@ -164,6 +164,10 @@ struct pci_dn {
164 int eeh_false_positives; /* # times this device reported #ff's */ 164 int eeh_false_positives; /* # times this device reported #ff's */
165 u32 config_space[16]; /* saved PCI config space */ 165 u32 config_space[16]; /* saved PCI config space */
166#endif 166#endif
167#define IODA_INVALID_PE (-1)
168#ifdef CONFIG_PPC_POWERNV
169 int pe_number;
170#endif
167}; 171};
168 172
169/* Get the pointer to a device_node's pci_dn */ 173/* Get the pointer to a device_node's pci_dn */
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index 49c3de582be0..1c92013466e3 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -184,8 +184,6 @@ extern void of_scan_pci_bridge(struct pci_dev *dev);
184extern void of_scan_bus(struct device_node *node, struct pci_bus *bus); 184extern void of_scan_bus(struct device_node *node, struct pci_bus *bus);
185extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus); 185extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus);
186 186
187extern int pci_read_irq_line(struct pci_dev *dev);
188
189struct file; 187struct file;
190extern pgprot_t pci_phys_mem_access_prot(struct file *file, 188extern pgprot_t pci_phys_mem_access_prot(struct file *file,
191 unsigned long pfn, 189 unsigned long pfn,
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 88b0bd925a8b..2e0e4110f7ae 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -170,6 +170,9 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addre
170#define pgprot_cached_wthru(prot) (__pgprot((pgprot_val(prot) & ~_PAGE_CACHE_CTL) | \ 170#define pgprot_cached_wthru(prot) (__pgprot((pgprot_val(prot) & ~_PAGE_CACHE_CTL) | \
171 _PAGE_COHERENT | _PAGE_WRITETHRU)) 171 _PAGE_COHERENT | _PAGE_WRITETHRU))
172 172
173#define pgprot_cached_noncoherent(prot) \
174 (__pgprot(pgprot_val(prot) & ~_PAGE_CACHE_CTL))
175
173#define pgprot_writecombine pgprot_noncached_wc 176#define pgprot_writecombine pgprot_noncached_wc
174 177
175struct file; 178struct file;
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index eb11a446720e..b585bff1a022 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -382,6 +382,9 @@ static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
382} 382}
383#endif 383#endif
384 384
385extern unsigned long cpuidle_disable;
386enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
387
385#endif /* __KERNEL__ */ 388#endif /* __KERNEL__ */
386#endif /* __ASSEMBLY__ */ 389#endif /* __ASSEMBLY__ */
387#endif /* _ASM_POWERPC_PROCESSOR_H */ 390#endif /* _ASM_POWERPC_PROCESSOR_H */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 559da199edb5..7fdc2c0b7fa0 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -951,6 +951,7 @@
951#define PVR_403GCX 0x00201400 951#define PVR_403GCX 0x00201400
952#define PVR_405GP 0x40110000 952#define PVR_405GP 0x40110000
953#define PVR_476 0x11a52000 953#define PVR_476 0x11a52000
954#define PVR_476FPE 0x7ff50000
954#define PVR_STB03XXX 0x40310000 955#define PVR_STB03XXX 0x40310000
955#define PVR_NP405H 0x41410000 956#define PVR_NP405H 0x41410000
956#define PVR_NP405L 0x41610000 957#define PVR_NP405L 0x41610000
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 28cdbd9f399c..500fe1dc43e6 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -31,7 +31,7 @@
31 31
32#define MSR_ MSR_ME | MSR_CE 32#define MSR_ MSR_ME | MSR_CE
33#define MSR_KERNEL MSR_ | MSR_64BIT 33#define MSR_KERNEL MSR_ | MSR_64BIT
34#define MSR_USER32 MSR_ | MSR_PR | MSR_EE | MSR_DE 34#define MSR_USER32 MSR_ | MSR_PR | MSR_EE
35#define MSR_USER64 MSR_USER32 | MSR_64BIT 35#define MSR_USER64 MSR_USER32 | MSR_64BIT
36#elif defined (CONFIG_40x) 36#elif defined (CONFIG_40x)
37#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE) 37#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE)
@@ -187,6 +187,10 @@
187#define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */ 187#define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */
188#endif 188#endif
189 189
190#ifdef CONFIG_PPC_ICSWX
191#define SPRN_HACOP 0x15F /* Hypervisor Available Coprocessor Register */
192#endif
193
190/* Bit definitions for CCR1. */ 194/* Bit definitions for CCR1. */
191#define CCR1_DPC 0x00000100 /* Disable L1 I-Cache/D-Cache parity checking */ 195#define CCR1_DPC 0x00000100 /* Disable L1 I-Cache/D-Cache parity checking */
192#define CCR1_TCS 0x00000080 /* Timer Clock Select */ 196#define CCR1_TCS 0x00000080 /* Timer Clock Select */
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 41f69ae79d4e..01c143bb77ae 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -245,6 +245,12 @@ extern int early_init_dt_scan_rtas(unsigned long node,
245 245
246extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); 246extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
247 247
248#ifdef CONFIG_PPC_RTAS_DAEMON
249extern void rtas_cancel_event_scan(void);
250#else
251static inline void rtas_cancel_event_scan(void) { }
252#endif
253
248/* Error types logged. */ 254/* Error types logged. */
249#define ERR_FLAG_ALREADY_LOGGED 0x0 255#define ERR_FLAG_ALREADY_LOGGED 0x0
250#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM on boot */ 256#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM on boot */
@@ -307,5 +313,17 @@ static inline u32 rtas_config_addr(int busno, int devfn, int reg)
307extern void __cpuinit rtas_give_timebase(void); 313extern void __cpuinit rtas_give_timebase(void);
308extern void __cpuinit rtas_take_timebase(void); 314extern void __cpuinit rtas_take_timebase(void);
309 315
316#ifdef CONFIG_PPC_RTAS
317static inline int page_is_rtas_user_buf(unsigned long pfn)
318{
319 unsigned long paddr = (pfn << PAGE_SHIFT);
320 if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_RMOBUF_MAX))
321 return 1;
322 return 0;
323}
324#else
325static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;}
326#endif
327
310#endif /* __KERNEL__ */ 328#endif /* __KERNEL__ */
311#endif /* _POWERPC_RTAS_H */ 329#endif /* _POWERPC_RTAS_H */
diff --git a/arch/powerpc/include/asm/rwsem.h b/arch/powerpc/include/asm/rwsem.h
deleted file mode 100644
index bb1e2cdeb9bf..000000000000
--- a/arch/powerpc/include/asm/rwsem.h
+++ /dev/null
@@ -1,132 +0,0 @@
1#ifndef _ASM_POWERPC_RWSEM_H
2#define _ASM_POWERPC_RWSEM_H
3
4#ifndef _LINUX_RWSEM_H
5#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
6#endif
7
8#ifdef __KERNEL__
9
10/*
11 * R/W semaphores for PPC using the stuff in lib/rwsem.c.
12 * Adapted largely from include/asm-i386/rwsem.h
13 * by Paul Mackerras <paulus@samba.org>.
14 */
15
16/*
17 * the semaphore definition
18 */
19#ifdef CONFIG_PPC64
20# define RWSEM_ACTIVE_MASK 0xffffffffL
21#else
22# define RWSEM_ACTIVE_MASK 0x0000ffffL
23#endif
24
25#define RWSEM_UNLOCKED_VALUE 0x00000000L
26#define RWSEM_ACTIVE_BIAS 0x00000001L
27#define RWSEM_WAITING_BIAS (-RWSEM_ACTIVE_MASK-1)
28#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
29#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
30
31/*
32 * lock for reading
33 */
34static inline void __down_read(struct rw_semaphore *sem)
35{
36 if (unlikely(atomic_long_inc_return((atomic_long_t *)&sem->count) <= 0))
37 rwsem_down_read_failed(sem);
38}
39
40static inline int __down_read_trylock(struct rw_semaphore *sem)
41{
42 long tmp;
43
44 while ((tmp = sem->count) >= 0) {
45 if (tmp == cmpxchg(&sem->count, tmp,
46 tmp + RWSEM_ACTIVE_READ_BIAS)) {
47 return 1;
48 }
49 }
50 return 0;
51}
52
53/*
54 * lock for writing
55 */
56static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
57{
58 long tmp;
59
60 tmp = atomic_long_add_return(RWSEM_ACTIVE_WRITE_BIAS,
61 (atomic_long_t *)&sem->count);
62 if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS))
63 rwsem_down_write_failed(sem);
64}
65
66static inline void __down_write(struct rw_semaphore *sem)
67{
68 __down_write_nested(sem, 0);
69}
70
71static inline int __down_write_trylock(struct rw_semaphore *sem)
72{
73 long tmp;
74
75 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
76 RWSEM_ACTIVE_WRITE_BIAS);
77 return tmp == RWSEM_UNLOCKED_VALUE;
78}
79
80/*
81 * unlock after reading
82 */
83static inline void __up_read(struct rw_semaphore *sem)
84{
85 long tmp;
86
87 tmp = atomic_long_dec_return((atomic_long_t *)&sem->count);
88 if (unlikely(tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0))
89 rwsem_wake(sem);
90}
91
92/*
93 * unlock after writing
94 */
95static inline void __up_write(struct rw_semaphore *sem)
96{
97 if (unlikely(atomic_long_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
98 (atomic_long_t *)&sem->count) < 0))
99 rwsem_wake(sem);
100}
101
102/*
103 * implement atomic add functionality
104 */
105static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
106{
107 atomic_long_add(delta, (atomic_long_t *)&sem->count);
108}
109
110/*
111 * downgrade write lock to read lock
112 */
113static inline void __downgrade_write(struct rw_semaphore *sem)
114{
115 long tmp;
116
117 tmp = atomic_long_add_return(-RWSEM_WAITING_BIAS,
118 (atomic_long_t *)&sem->count);
119 if (tmp < 0)
120 rwsem_downgrade_wake(sem);
121}
122
123/*
124 * implement exchange and add functionality
125 */
126static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
127{
128 return atomic_long_add_return(delta, (atomic_long_t *)&sem->count);
129}
130
131#endif /* __KERNEL__ */
132#endif /* _ASM_POWERPC_RWSEM_H */
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
index 6fbce725c710..a0f358d4a00c 100644
--- a/arch/powerpc/include/asm/sections.h
+++ b/arch/powerpc/include/asm/sections.h
@@ -8,7 +8,7 @@
8 8
9#ifdef __powerpc64__ 9#ifdef __powerpc64__
10 10
11extern char _end[]; 11extern char __end_interrupts[];
12 12
13static inline int in_kernel_text(unsigned long addr) 13static inline int in_kernel_text(unsigned long addr)
14{ 14{
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h
index 866f7606da68..2fc2af8fbf59 100644
--- a/arch/powerpc/include/asm/socket.h
+++ b/arch/powerpc/include/asm/socket.h
@@ -69,4 +69,7 @@
69 69
70#define SO_RXQ_OVFL 40 70#define SO_RXQ_OVFL 40
71 71
72#define SO_WIFI_STATUS 41
73#define SCM_WIFI_STATUS SO_WIFI_STATUS
74
72#endif /* _ASM_POWERPC_SOCKET_H */ 75#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/powerpc/include/asm/spu.h b/arch/powerpc/include/asm/spu.h
index 4e360bd4a35a..93f280e23279 100644
--- a/arch/powerpc/include/asm/spu.h
+++ b/arch/powerpc/include/asm/spu.h
@@ -25,7 +25,7 @@
25#ifdef __KERNEL__ 25#ifdef __KERNEL__
26 26
27#include <linux/workqueue.h> 27#include <linux/workqueue.h>
28#include <linux/sysdev.h> 28#include <linux/device.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30 30
31#define LS_SIZE (256 * 1024) 31#define LS_SIZE (256 * 1024)
@@ -166,7 +166,7 @@ struct spu {
166 /* beat only */ 166 /* beat only */
167 u64 shadow_int_mask_RW[3]; 167 u64 shadow_int_mask_RW[3];
168 168
169 struct sys_device sysdev; 169 struct device dev;
170 170
171 int has_mem_affinity; 171 int has_mem_affinity;
172 struct list_head aff_list; 172 struct list_head aff_list;
@@ -237,7 +237,7 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
237struct file; 237struct file;
238struct spufs_calls { 238struct spufs_calls {
239 long (*create_thread)(const char __user *name, 239 long (*create_thread)(const char __user *name,
240 unsigned int flags, mode_t mode, 240 unsigned int flags, umode_t mode,
241 struct file *neighbor); 241 struct file *neighbor);
242 long (*spu_run)(struct file *filp, __u32 __user *unpc, 242 long (*spu_run)(struct file *filp, __u32 __user *unpc,
243 __u32 __user *ustatus); 243 __u32 __user *ustatus);
@@ -270,11 +270,11 @@ struct spufs_calls {
270int register_spu_syscalls(struct spufs_calls *calls); 270int register_spu_syscalls(struct spufs_calls *calls);
271void unregister_spu_syscalls(struct spufs_calls *calls); 271void unregister_spu_syscalls(struct spufs_calls *calls);
272 272
273int spu_add_sysdev_attr(struct sysdev_attribute *attr); 273int spu_add_dev_attr(struct device_attribute *attr);
274void spu_remove_sysdev_attr(struct sysdev_attribute *attr); 274void spu_remove_dev_attr(struct device_attribute *attr);
275 275
276int spu_add_sysdev_attr_group(struct attribute_group *attrs); 276int spu_add_dev_attr_group(struct attribute_group *attrs);
277void spu_remove_sysdev_attr_group(struct attribute_group *attrs); 277void spu_remove_dev_attr_group(struct attribute_group *attrs);
278 278
279int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea, 279int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
280 unsigned long dsisr, unsigned *flt); 280 unsigned long dsisr, unsigned *flt);
diff --git a/arch/powerpc/include/asm/synch.h b/arch/powerpc/include/asm/synch.h
index d7cab44643c5..e682a7143edb 100644
--- a/arch/powerpc/include/asm/synch.h
+++ b/arch/powerpc/include/asm/synch.h
@@ -13,6 +13,7 @@
13extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup; 13extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
14extern void do_lwsync_fixups(unsigned long value, void *fixup_start, 14extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
15 void *fixup_end); 15 void *fixup_end);
16extern void do_final_fixups(void);
16 17
17static inline void eieio(void) 18static inline void eieio(void)
18{ 19{
@@ -41,11 +42,15 @@ static inline void isync(void)
41 START_LWSYNC_SECTION(97); \ 42 START_LWSYNC_SECTION(97); \
42 isync; \ 43 isync; \
43 MAKE_LWSYNC_SECTION_ENTRY(97, __lwsync_fixup); 44 MAKE_LWSYNC_SECTION_ENTRY(97, __lwsync_fixup);
44#define PPC_ACQUIRE_BARRIER "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER) 45#define PPC_ACQUIRE_BARRIER "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER)
45#define PPC_RELEASE_BARRIER stringify_in_c(LWSYNC) "\n" 46#define PPC_RELEASE_BARRIER stringify_in_c(LWSYNC) "\n"
47#define PPC_ATOMIC_ENTRY_BARRIER "\n" stringify_in_c(LWSYNC) "\n"
48#define PPC_ATOMIC_EXIT_BARRIER "\n" stringify_in_c(sync) "\n"
46#else 49#else
47#define PPC_ACQUIRE_BARRIER 50#define PPC_ACQUIRE_BARRIER
48#define PPC_RELEASE_BARRIER 51#define PPC_RELEASE_BARRIER
52#define PPC_ATOMIC_ENTRY_BARRIER
53#define PPC_ATOMIC_EXIT_BARRIER
49#endif 54#endif
50 55
51#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
index e30a13d1ee76..c377457d1b89 100644
--- a/arch/powerpc/include/asm/system.h
+++ b/arch/powerpc/include/asm/system.h
@@ -193,8 +193,8 @@ extern void cacheable_memzero(void *p, unsigned int nb);
193extern void *cacheable_memcpy(void *, const void *, unsigned int); 193extern void *cacheable_memcpy(void *, const void *, unsigned int);
194extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); 194extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
195extern void bad_page_fault(struct pt_regs *, unsigned long, int); 195extern void bad_page_fault(struct pt_regs *, unsigned long, int);
196extern int die(const char *, struct pt_regs *, long);
197extern void _exception(int, struct pt_regs *, int, unsigned long); 196extern void _exception(int, struct pt_regs *, int, unsigned long);
197extern void die(const char *, struct pt_regs *, long);
198extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); 198extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
199 199
200#ifdef CONFIG_BOOKE_WDT 200#ifdef CONFIG_BOOKE_WDT
@@ -221,6 +221,15 @@ extern unsigned long klimit;
221extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); 221extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
222 222
223extern int powersave_nap; /* set if nap mode can be used in idle loop */ 223extern int powersave_nap; /* set if nap mode can be used in idle loop */
224void cpu_idle_wait(void);
225
226#ifdef CONFIG_PSERIES_IDLE
227extern void update_smt_snooze_delay(int snooze);
228extern int pseries_notify_cpuidle_add_cpu(int cpu);
229#else
230static inline void update_smt_snooze_delay(int snooze) {}
231static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; }
232#endif
224 233
225/* 234/*
226 * Atomic exchange 235 * Atomic exchange
diff --git a/arch/powerpc/include/asm/tce.h b/arch/powerpc/include/asm/tce.h
index f663634cccc9..743f36b38e5d 100644
--- a/arch/powerpc/include/asm/tce.h
+++ b/arch/powerpc/include/asm/tce.h
@@ -26,10 +26,14 @@
26 26
27/* 27/*
28 * Tces come in two formats, one for the virtual bus and a different 28 * Tces come in two formats, one for the virtual bus and a different
29 * format for PCI 29 * format for PCI. PCI TCEs can have hardware or software maintianed
30 * coherency.
30 */ 31 */
31#define TCE_VB 0 32#define TCE_VB 0
32#define TCE_PCI 1 33#define TCE_PCI 1
34#define TCE_PCI_SWINV_CREATE 2
35#define TCE_PCI_SWINV_FREE 4
36#define TCE_PCI_SWINV_PAIR 8
33 37
34/* TCE page size is 4096 bytes (1 << 12) */ 38/* TCE page size is 4096 bytes (1 << 12) */
35 39
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 836f231ec1f0..964714940961 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -109,7 +109,6 @@ static inline struct thread_info *current_thread_info(void)
109#define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ 109#define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */
110#define TIF_NOERROR 12 /* Force successful syscall return */ 110#define TIF_NOERROR 12 /* Force successful syscall return */
111#define TIF_NOTIFY_RESUME 13 /* callback before returning to user */ 111#define TIF_NOTIFY_RESUME 13 /* callback before returning to user */
112#define TIF_FREEZE 14 /* Freezing for suspend */
113#define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */ 112#define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */
114#define TIF_RUNLATCH 16 /* Is the runlatch enabled? */ 113#define TIF_RUNLATCH 16 /* Is the runlatch enabled? */
115 114
@@ -127,7 +126,6 @@ static inline struct thread_info *current_thread_info(void)
127#define _TIF_RESTOREALL (1<<TIF_RESTOREALL) 126#define _TIF_RESTOREALL (1<<TIF_RESTOREALL)
128#define _TIF_NOERROR (1<<TIF_NOERROR) 127#define _TIF_NOERROR (1<<TIF_NOERROR)
129#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 128#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
130#define _TIF_FREEZE (1<<TIF_FREEZE)
131#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) 129#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
132#define _TIF_RUNLATCH (1<<TIF_RUNLATCH) 130#define _TIF_RUNLATCH (1<<TIF_RUNLATCH)
133#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ 131#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
index fe6f7c2c9c68..7eb10fb96cd0 100644
--- a/arch/powerpc/include/asm/time.h
+++ b/arch/powerpc/include/asm/time.h
@@ -219,5 +219,7 @@ DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
219extern void secondary_cpu_time_init(void); 219extern void secondary_cpu_time_init(void);
220extern void iSeries_time_init_early(void); 220extern void iSeries_time_init_early(void);
221 221
222DECLARE_PER_CPU(u64, decrementers_next_tb);
223
222#endif /* __KERNEL__ */ 224#endif /* __KERNEL__ */
223#endif /* __POWERPC_TIME_H */ 225#endif /* __POWERPC_TIME_H */
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 1e104af08483..c97185885c6d 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -3,7 +3,7 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5 5
6struct sys_device; 6struct device;
7struct device_node; 7struct device_node;
8 8
9#ifdef CONFIG_NUMA 9#ifdef CONFIG_NUMA
@@ -86,19 +86,19 @@ extern int __node_distance(int, int);
86 86
87extern void __init dump_numa_cpu_topology(void); 87extern void __init dump_numa_cpu_topology(void);
88 88
89extern int sysfs_add_device_to_node(struct sys_device *dev, int nid); 89extern int sysfs_add_device_to_node(struct device *dev, int nid);
90extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid); 90extern void sysfs_remove_device_from_node(struct device *dev, int nid);
91 91
92#else 92#else
93 93
94static inline void dump_numa_cpu_topology(void) {} 94static inline void dump_numa_cpu_topology(void) {}
95 95
96static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid) 96static inline int sysfs_add_device_to_node(struct device *dev, int nid)
97{ 97{
98 return 0; 98 return 0;
99} 99}
100 100
101static inline void sysfs_remove_device_from_node(struct sys_device *dev, 101static inline void sysfs_remove_device_from_node(struct device *dev,
102 int nid) 102 int nid)
103{ 103{
104} 104}
diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h
index 8947b9827bc4..0abf7f2c6df9 100644
--- a/arch/powerpc/include/asm/types.h
+++ b/arch/powerpc/include/asm/types.h
@@ -5,8 +5,11 @@
5 * This is here because we used to use l64 for 64bit powerpc 5 * This is here because we used to use l64 for 64bit powerpc
6 * and we don't want to impact user mode with our change to ll64 6 * and we don't want to impact user mode with our change to ll64
7 * in the kernel. 7 * in the kernel.
8 *
9 * However, some user programs are fine with this. They can
10 * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
8 */ 11 */
9#if defined(__powerpc64__) && !defined(__KERNEL__) 12#if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__) && !defined(__KERNEL__)
10# include <asm-generic/int-l64.h> 13# include <asm-generic/int-l64.h>
11#else 14#else
12# include <asm-generic/int-ll64.h> 15# include <asm-generic/int-ll64.h>
@@ -27,12 +30,6 @@
27 * 2 of the License, or (at your option) any later version. 30 * 2 of the License, or (at your option) any later version.
28 */ 31 */
29 32
30#ifdef __powerpc64__
31typedef unsigned int umode_t;
32#else
33typedef unsigned short umode_t;
34#endif
35
36typedef struct { 33typedef struct {
37 __u32 u[4]; 34 __u32 u[4];
38} __attribute__((aligned(16))) __vector128; 35} __attribute__((aligned(16))) __vector128;
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index ce4f7f179117..ee728e433aa2 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -85,6 +85,8 @@ extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
85extra-$(CONFIG_8xx) := head_8xx.o 85extra-$(CONFIG_8xx) := head_8xx.o
86extra-y += vmlinux.lds 86extra-y += vmlinux.lds
87 87
88obj-$(CONFIG_RELOCATABLE_PPC32) += reloc_32.o
89
88obj-$(CONFIG_PPC32) += entry_32.o setup_32.o 90obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
89obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o 91obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o
90obj-$(CONFIG_KGDB) += kgdb.o 92obj-$(CONFIG_KGDB) += kgdb.o
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 7c5324f1ec9c..04caee7d9bc1 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -208,6 +208,7 @@ int main(void)
208 DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time)); 208 DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
209 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); 209 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
210 DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); 210 DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save));
211 DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost));
211#endif /* CONFIG_PPC64 */ 212#endif /* CONFIG_PPC64 */
212 213
213 /* RTAS */ 214 /* RTAS */
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index a3c684b4c862..92c6b008dd2b 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -451,15 +451,15 @@ out:
451static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id) 451static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id)
452{ 452{
453 struct cache_dir *cache_dir; 453 struct cache_dir *cache_dir;
454 struct sys_device *sysdev; 454 struct device *dev;
455 struct kobject *kobj = NULL; 455 struct kobject *kobj = NULL;
456 456
457 sysdev = get_cpu_sysdev(cpu_id); 457 dev = get_cpu_device(cpu_id);
458 WARN_ONCE(!sysdev, "no sysdev for CPU %i\n", cpu_id); 458 WARN_ONCE(!dev, "no dev for CPU %i\n", cpu_id);
459 if (!sysdev) 459 if (!dev)
460 goto err; 460 goto err;
461 461
462 kobj = kobject_create_and_add("cache", &sysdev->kobj); 462 kobj = kobject_create_and_add("cache", &dev->kobj);
463 if (!kobj) 463 if (!kobj)
464 goto err; 464 goto err;
465 465
diff --git a/arch/powerpc/kernel/cpu_setup_a2.S b/arch/powerpc/kernel/cpu_setup_a2.S
index 7f818feaa7a5..ebc62f42a237 100644
--- a/arch/powerpc/kernel/cpu_setup_a2.S
+++ b/arch/powerpc/kernel/cpu_setup_a2.S
@@ -41,11 +41,16 @@ _GLOBAL(__setup_cpu_a2)
41 * core local but doing it always won't hurt 41 * core local but doing it always won't hurt
42 */ 42 */
43 43
44#ifdef CONFIG_PPC_WSP_COPRO 44#ifdef CONFIG_PPC_ICSWX
45 /* Make sure ACOP starts out as zero */ 45 /* Make sure ACOP starts out as zero */
46 li r3,0 46 li r3,0
47 mtspr SPRN_ACOP,r3 47 mtspr SPRN_ACOP,r3
48 48
49 /* Skip the following if we are in Guest mode */
50 mfmsr r3
51 andis. r0,r3,MSR_GS@h
52 bne _icswx_skip_guest
53
49 /* Enable icswx instruction */ 54 /* Enable icswx instruction */
50 mfspr r3,SPRN_A2_CCR2 55 mfspr r3,SPRN_A2_CCR2
51 ori r3,r3,A2_CCR2_ENABLE_ICSWX 56 ori r3,r3,A2_CCR2_ENABLE_ICSWX
@@ -54,7 +59,8 @@ _GLOBAL(__setup_cpu_a2)
54 /* Unmask all CTs in HACOP */ 59 /* Unmask all CTs in HACOP */
55 li r3,-1 60 li r3,-1
56 mtspr SPRN_HACOP,r3 61 mtspr SPRN_HACOP,r3
57#endif /* CONFIG_PPC_WSP_COPRO */ 62_icswx_skip_guest:
63#endif /* CONFIG_PPC_ICSWX */
58 64
59 /* Enable doorbell */ 65 /* Enable doorbell */
60 mfspr r3,SPRN_A2_CCR2 66 mfspr r3,SPRN_A2_CCR2
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index edae5bb06f1f..81db9e2a8a20 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1505,6 +1505,19 @@ static struct cpu_spec __initdata cpu_specs[] = {
1505 .machine_check = machine_check_4xx, 1505 .machine_check = machine_check_4xx,
1506 .platform = "ppc405", 1506 .platform = "ppc405",
1507 }, 1507 },
1508 { /* APM8018X */
1509 .pvr_mask = 0xffff0000,
1510 .pvr_value = 0x7ff11432,
1511 .cpu_name = "APM8018X",
1512 .cpu_features = CPU_FTRS_40X,
1513 .cpu_user_features = PPC_FEATURE_32 |
1514 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1515 .mmu_features = MMU_FTR_TYPE_40x,
1516 .icache_bsize = 32,
1517 .dcache_bsize = 32,
1518 .machine_check = machine_check_4xx,
1519 .platform = "ppc405",
1520 },
1508 { /* default match */ 1521 { /* default match */
1509 .pvr_mask = 0x00000000, 1522 .pvr_mask = 0x00000000,
1510 .pvr_value = 0x00000000, 1523 .pvr_value = 0x00000000,
@@ -1830,6 +1843,20 @@ static struct cpu_spec __initdata cpu_specs[] = {
1830 .machine_check = machine_check_47x, 1843 .machine_check = machine_check_47x,
1831 .platform = "ppc470", 1844 .platform = "ppc470",
1832 }, 1845 },
1846 { /* 476fpe */
1847 .pvr_mask = 0xffff0000,
1848 .pvr_value = 0x7ff50000,
1849 .cpu_name = "476fpe",
1850 .cpu_features = CPU_FTRS_47X | CPU_FTR_476_DD2,
1851 .cpu_user_features = COMMON_USER_BOOKE |
1852 PPC_FEATURE_HAS_FPU,
1853 .mmu_features = MMU_FTR_TYPE_47x |
1854 MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
1855 .icache_bsize = 32,
1856 .dcache_bsize = 128,
1857 .machine_check = machine_check_47x,
1858 .platform = "ppc470",
1859 },
1833 { /* 476 iss */ 1860 { /* 476 iss */
1834 .pvr_mask = 0xffff0000, 1861 .pvr_mask = 0xffff0000,
1835 .pvr_value = 0x00050000, 1862 .pvr_value = 0x00050000,
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index d879809d5c45..28be3452e67a 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -10,85 +10,85 @@
10 * 10 *
11 */ 11 */
12 12
13#undef DEBUG
14
15#include <linux/kernel.h> 13#include <linux/kernel.h>
16#include <linux/smp.h> 14#include <linux/smp.h>
17#include <linux/reboot.h> 15#include <linux/reboot.h>
18#include <linux/kexec.h> 16#include <linux/kexec.h>
19#include <linux/bootmem.h>
20#include <linux/export.h> 17#include <linux/export.h>
21#include <linux/crash_dump.h> 18#include <linux/crash_dump.h>
22#include <linux/delay.h> 19#include <linux/delay.h>
23#include <linux/elf.h>
24#include <linux/elfcore.h>
25#include <linux/init.h> 20#include <linux/init.h>
26#include <linux/irq.h> 21#include <linux/irq.h>
27#include <linux/types.h> 22#include <linux/types.h>
28#include <linux/memblock.h>
29 23
30#include <asm/processor.h> 24#include <asm/processor.h>
31#include <asm/machdep.h> 25#include <asm/machdep.h>
32#include <asm/kexec.h> 26#include <asm/kexec.h>
33#include <asm/kdump.h> 27#include <asm/kdump.h>
34#include <asm/prom.h> 28#include <asm/prom.h>
35#include <asm/firmware.h>
36#include <asm/smp.h> 29#include <asm/smp.h>
37#include <asm/system.h> 30#include <asm/system.h>
38#include <asm/setjmp.h> 31#include <asm/setjmp.h>
39 32
40#ifdef DEBUG 33/*
41#include <asm/udbg.h> 34 * The primary CPU waits a while for all secondary CPUs to enter. This is to
42#define DBG(fmt...) udbg_printf(fmt) 35 * avoid sending an IPI if the secondary CPUs are entering
43#else 36 * crash_kexec_secondary on their own (eg via a system reset).
44#define DBG(fmt...) 37 *
45#endif 38 * The secondary timeout has to be longer than the primary. Both timeouts are
39 * in milliseconds.
40 */
41#define PRIMARY_TIMEOUT 500
42#define SECONDARY_TIMEOUT 1000
46 43
47/* This keeps a track of which one is crashing cpu. */ 44#define IPI_TIMEOUT 10000
45#define REAL_MODE_TIMEOUT 10000
46
47/* This keeps a track of which one is the crashing cpu. */
48int crashing_cpu = -1; 48int crashing_cpu = -1;
49static cpumask_t cpus_in_crash = CPU_MASK_NONE; 49static atomic_t cpus_in_crash;
50cpumask_t cpus_in_sr = CPU_MASK_NONE; 50static int time_to_dump;
51 51
52#define CRASH_HANDLER_MAX 3 52#define CRASH_HANDLER_MAX 3
53/* NULL terminated list of shutdown handles */ 53/* NULL terminated list of shutdown handles */
54static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1]; 54static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1];
55static DEFINE_SPINLOCK(crash_handlers_lock); 55static DEFINE_SPINLOCK(crash_handlers_lock);
56 56
57static unsigned long crash_shutdown_buf[JMP_BUF_LEN];
58static int crash_shutdown_cpu = -1;
59
60static int handle_fault(struct pt_regs *regs)
61{
62 if (crash_shutdown_cpu == smp_processor_id())
63 longjmp(crash_shutdown_buf, 1);
64 return 0;
65}
66
57#ifdef CONFIG_SMP 67#ifdef CONFIG_SMP
58static atomic_t enter_on_soft_reset = ATOMIC_INIT(0);
59 68
60void crash_ipi_callback(struct pt_regs *regs) 69void crash_ipi_callback(struct pt_regs *regs)
61{ 70{
71 static cpumask_t cpus_state_saved = CPU_MASK_NONE;
72
62 int cpu = smp_processor_id(); 73 int cpu = smp_processor_id();
63 74
64 if (!cpu_online(cpu)) 75 if (!cpu_online(cpu))
65 return; 76 return;
66 77
67 hard_irq_disable(); 78 hard_irq_disable();
68 if (!cpumask_test_cpu(cpu, &cpus_in_crash)) 79 if (!cpumask_test_cpu(cpu, &cpus_state_saved)) {
69 crash_save_cpu(regs, cpu); 80 crash_save_cpu(regs, cpu);
70 cpumask_set_cpu(cpu, &cpus_in_crash); 81 cpumask_set_cpu(cpu, &cpus_state_saved);
71
72 /*
73 * Entered via soft-reset - could be the kdump
74 * process is invoked using soft-reset or user activated
75 * it if some CPU did not respond to an IPI.
76 * For soft-reset, the secondary CPU can enter this func
77 * twice. 1 - using IPI, and 2. soft-reset.
78 * Tell the kexec CPU that entered via soft-reset and ready
79 * to go down.
80 */
81 if (cpumask_test_cpu(cpu, &cpus_in_sr)) {
82 cpumask_clear_cpu(cpu, &cpus_in_sr);
83 atomic_inc(&enter_on_soft_reset);
84 } 82 }
85 83
84 atomic_inc(&cpus_in_crash);
85 smp_mb__after_atomic_inc();
86
86 /* 87 /*
87 * Starting the kdump boot. 88 * Starting the kdump boot.
88 * This barrier is needed to make sure that all CPUs are stopped. 89 * This barrier is needed to make sure that all CPUs are stopped.
89 * If not, soft-reset will be invoked to bring other CPUs.
90 */ 90 */
91 while (!cpumask_test_cpu(crashing_cpu, &cpus_in_crash)) 91 while (!time_to_dump)
92 cpu_relax(); 92 cpu_relax();
93 93
94 if (ppc_md.kexec_cpu_down) 94 if (ppc_md.kexec_cpu_down)
@@ -103,106 +103,99 @@ void crash_ipi_callback(struct pt_regs *regs)
103 /* NOTREACHED */ 103 /* NOTREACHED */
104} 104}
105 105
106/*
107 * Wait until all CPUs are entered via soft-reset.
108 */
109static void crash_soft_reset_check(int cpu)
110{
111 unsigned int ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */
112
113 cpumask_clear_cpu(cpu, &cpus_in_sr);
114 while (atomic_read(&enter_on_soft_reset) != ncpus)
115 cpu_relax();
116}
117
118
119static void crash_kexec_prepare_cpus(int cpu) 106static void crash_kexec_prepare_cpus(int cpu)
120{ 107{
121 unsigned int msecs; 108 unsigned int msecs;
122
123 unsigned int ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */ 109 unsigned int ncpus = num_online_cpus() - 1;/* Excluding the panic cpu */
110 int tries = 0;
111 int (*old_handler)(struct pt_regs *regs);
112
113 printk(KERN_EMERG "Sending IPI to other CPUs\n");
124 114
125 crash_send_ipi(crash_ipi_callback); 115 crash_send_ipi(crash_ipi_callback);
126 smp_wmb(); 116 smp_wmb();
127 117
118again:
128 /* 119 /*
129 * FIXME: Until we will have the way to stop other CPUs reliably, 120 * FIXME: Until we will have the way to stop other CPUs reliably,
130 * the crash CPU will send an IPI and wait for other CPUs to 121 * the crash CPU will send an IPI and wait for other CPUs to
131 * respond. 122 * respond.
132 * Delay of at least 10 seconds.
133 */ 123 */
134 printk(KERN_EMERG "Sending IPI to other cpus...\n"); 124 msecs = IPI_TIMEOUT;
135 msecs = 10000; 125 while ((atomic_read(&cpus_in_crash) < ncpus) && (--msecs > 0))
136 while ((cpumask_weight(&cpus_in_crash) < ncpus) && (--msecs > 0)) {
137 cpu_relax();
138 mdelay(1); 126 mdelay(1);
139 }
140 127
141 /* Would it be better to replace the trap vector here? */ 128 /* Would it be better to replace the trap vector here? */
142 129
130 if (atomic_read(&cpus_in_crash) >= ncpus) {
131 printk(KERN_EMERG "IPI complete\n");
132 return;
133 }
134
135 printk(KERN_EMERG "ERROR: %d cpu(s) not responding\n",
136 ncpus - atomic_read(&cpus_in_crash));
137
143 /* 138 /*
144 * FIXME: In case if we do not get all CPUs, one possibility: ask the 139 * If we have a panic timeout set then we can't wait indefinitely
145 * user to do soft reset such that we get all. 140 * for someone to activate system reset. We also give up on the
146 * Soft-reset will be used until better mechanism is implemented. 141 * second time through if system reset fail to work.
147 */ 142 */
148 if (cpumask_weight(&cpus_in_crash) < ncpus) { 143 if ((panic_timeout > 0) || (tries > 0))
149 printk(KERN_EMERG "done waiting: %d cpu(s) not responding\n", 144 return;
150 ncpus - cpumask_weight(&cpus_in_crash)); 145
151 printk(KERN_EMERG "Activate soft-reset to stop other cpu(s)\n");
152 cpumask_clear(&cpus_in_sr);
153 atomic_set(&enter_on_soft_reset, 0);
154 while (cpumask_weight(&cpus_in_crash) < ncpus)
155 cpu_relax();
156 }
157 /* 146 /*
158 * Make sure all CPUs are entered via soft-reset if the kdump is 147 * A system reset will cause all CPUs to take an 0x100 exception.
159 * invoked using soft-reset. 148 * The primary CPU returns here via setjmp, and the secondary
149 * CPUs reexecute the crash_kexec_secondary path.
160 */ 150 */
161 if (cpumask_test_cpu(cpu, &cpus_in_sr)) 151 old_handler = __debugger;
162 crash_soft_reset_check(cpu); 152 __debugger = handle_fault;
163 /* Leave the IPI callback set */ 153 crash_shutdown_cpu = smp_processor_id();
154
155 if (setjmp(crash_shutdown_buf) == 0) {
156 printk(KERN_EMERG "Activate system reset (dumprestart) "
157 "to stop other cpu(s)\n");
158
159 /*
160 * A system reset will force all CPUs to execute the
161 * crash code again. We need to reset cpus_in_crash so we
162 * wait for everyone to do this.
163 */
164 atomic_set(&cpus_in_crash, 0);
165 smp_mb();
166
167 while (atomic_read(&cpus_in_crash) < ncpus)
168 cpu_relax();
169 }
170
171 crash_shutdown_cpu = -1;
172 __debugger = old_handler;
173
174 tries++;
175 goto again;
164} 176}
165 177
166/* 178/*
167 * This function will be called by secondary cpus or by kexec cpu 179 * This function will be called by secondary cpus.
168 * if soft-reset is activated to stop some CPUs.
169 */ 180 */
170void crash_kexec_secondary(struct pt_regs *regs) 181void crash_kexec_secondary(struct pt_regs *regs)
171{ 182{
172 int cpu = smp_processor_id();
173 unsigned long flags; 183 unsigned long flags;
174 int msecs = 5; 184 int msecs = SECONDARY_TIMEOUT;
175 185
176 local_irq_save(flags); 186 local_irq_save(flags);
177 /* Wait 5ms if the kexec CPU is not entered yet. */ 187
188 /* Wait for the primary crash CPU to signal its progress */
178 while (crashing_cpu < 0) { 189 while (crashing_cpu < 0) {
179 if (--msecs < 0) { 190 if (--msecs < 0) {
180 /* 191 /* No response, kdump image may not have been loaded */
181 * Either kdump image is not loaded or
182 * kdump process is not started - Probably xmon
183 * exited using 'x'(exit and recover) or
184 * kexec_should_crash() failed for all running tasks.
185 */
186 cpumask_clear_cpu(cpu, &cpus_in_sr);
187 local_irq_restore(flags); 192 local_irq_restore(flags);
188 return; 193 return;
189 } 194 }
195
190 mdelay(1); 196 mdelay(1);
191 cpu_relax();
192 }
193 if (cpu == crashing_cpu) {
194 /*
195 * Panic CPU will enter this func only via soft-reset.
196 * Wait until all secondary CPUs entered and
197 * then start kexec boot.
198 */
199 crash_soft_reset_check(cpu);
200 cpumask_set_cpu(crashing_cpu, &cpus_in_crash);
201 if (ppc_md.kexec_cpu_down)
202 ppc_md.kexec_cpu_down(1, 0);
203 machine_kexec(kexec_crash_image);
204 /* NOTREACHED */
205 } 197 }
198
206 crash_ipi_callback(regs); 199 crash_ipi_callback(regs);
207} 200}
208 201
@@ -211,7 +204,7 @@ void crash_kexec_secondary(struct pt_regs *regs)
211static void crash_kexec_prepare_cpus(int cpu) 204static void crash_kexec_prepare_cpus(int cpu)
212{ 205{
213 /* 206 /*
214 * move the secondarys to us so that we can copy 207 * move the secondaries to us so that we can copy
215 * the new kernel 0-0x100 safely 208 * the new kernel 0-0x100 safely
216 * 209 *
217 * do this if kexec in setup.c ? 210 * do this if kexec in setup.c ?
@@ -225,7 +218,6 @@ static void crash_kexec_prepare_cpus(int cpu)
225 218
226void crash_kexec_secondary(struct pt_regs *regs) 219void crash_kexec_secondary(struct pt_regs *regs)
227{ 220{
228 cpumask_clear(&cpus_in_sr);
229} 221}
230#endif /* CONFIG_SMP */ 222#endif /* CONFIG_SMP */
231 223
@@ -236,7 +228,7 @@ static void crash_kexec_wait_realmode(int cpu)
236 unsigned int msecs; 228 unsigned int msecs;
237 int i; 229 int i;
238 230
239 msecs = 10000; 231 msecs = REAL_MODE_TIMEOUT;
240 for (i=0; i < nr_cpu_ids && msecs > 0; i++) { 232 for (i=0; i < nr_cpu_ids && msecs > 0; i++) {
241 if (i == cpu) 233 if (i == cpu)
242 continue; 234 continue;
@@ -308,22 +300,11 @@ int crash_shutdown_unregister(crash_shutdown_t handler)
308} 300}
309EXPORT_SYMBOL(crash_shutdown_unregister); 301EXPORT_SYMBOL(crash_shutdown_unregister);
310 302
311static unsigned long crash_shutdown_buf[JMP_BUF_LEN];
312static int crash_shutdown_cpu = -1;
313
314static int handle_fault(struct pt_regs *regs)
315{
316 if (crash_shutdown_cpu == smp_processor_id())
317 longjmp(crash_shutdown_buf, 1);
318 return 0;
319}
320
321void default_machine_crash_shutdown(struct pt_regs *regs) 303void default_machine_crash_shutdown(struct pt_regs *regs)
322{ 304{
323 unsigned int i; 305 unsigned int i;
324 int (*old_handler)(struct pt_regs *regs); 306 int (*old_handler)(struct pt_regs *regs);
325 307
326
327 /* 308 /*
328 * This function is only called after the system 309 * This function is only called after the system
329 * has panicked or is otherwise in a critical state. 310 * has panicked or is otherwise in a critical state.
@@ -341,15 +322,26 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
341 * such that another IPI will not be sent. 322 * such that another IPI will not be sent.
342 */ 323 */
343 crashing_cpu = smp_processor_id(); 324 crashing_cpu = smp_processor_id();
344 crash_save_cpu(regs, crashing_cpu); 325
326 /*
327 * If we came in via system reset, wait a while for the secondary
328 * CPUs to enter.
329 */
330 if (TRAP(regs) == 0x100)
331 mdelay(PRIMARY_TIMEOUT);
332
345 crash_kexec_prepare_cpus(crashing_cpu); 333 crash_kexec_prepare_cpus(crashing_cpu);
346 cpumask_set_cpu(crashing_cpu, &cpus_in_crash); 334
335 crash_save_cpu(regs, crashing_cpu);
336
337 time_to_dump = 1;
338
347 crash_kexec_wait_realmode(crashing_cpu); 339 crash_kexec_wait_realmode(crashing_cpu);
348 340
349 machine_kexec_mask_interrupts(); 341 machine_kexec_mask_interrupts();
350 342
351 /* 343 /*
352 * Call registered shutdown routines savely. Swap out 344 * Call registered shutdown routines safely. Swap out
353 * __debugger_fault_handler, and replace on exit. 345 * __debugger_fault_handler, and replace on exit.
354 */ 346 */
355 old_handler = __debugger_fault_handler; 347 old_handler = __debugger_fault_handler;
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 424afb6b8fba..b3ba5163eae2 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -28,7 +28,7 @@
28#define DBG(fmt...) 28#define DBG(fmt...)
29#endif 29#endif
30 30
31#ifndef CONFIG_RELOCATABLE 31#ifndef CONFIG_NONSTATIC_KERNEL
32void __init reserve_kdump_trampoline(void) 32void __init reserve_kdump_trampoline(void)
33{ 33{
34 memblock_reserve(0, KDUMP_RESERVE_LIMIT); 34 memblock_reserve(0, KDUMP_RESERVE_LIMIT);
@@ -67,7 +67,7 @@ void __init setup_kdump_trampoline(void)
67 67
68 DBG(" <- setup_kdump_trampoline()\n"); 68 DBG(" <- setup_kdump_trampoline()\n");
69} 69}
70#endif /* CONFIG_RELOCATABLE */ 70#endif /* CONFIG_NONSTATIC_KERNEL */
71 71
72static int __init parse_savemaxmem(char *p) 72static int __init parse_savemaxmem(char *p)
73{ 73{
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 56212bc0ab08..4f80cf1ce77b 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -215,7 +215,22 @@ reenable_mmu: /* re-enable mmu so we can */
215 stw r9,8(r1) 215 stw r9,8(r1)
216 stw r11,12(r1) 216 stw r11,12(r1)
217 stw r3,ORIG_GPR3(r1) 217 stw r3,ORIG_GPR3(r1)
218 /*
219 * The trace_hardirqs_off will use CALLER_ADDR0 and CALLER_ADDR1.
220 * If from user mode there is only one stack frame on the stack, and
221 * accessing CALLER_ADDR1 will cause oops. So we need create a dummy
222 * stack frame to make trace_hardirqs_off happy.
223 */
224 andi. r12,r12,MSR_PR
225 beq 11f
226 stwu r1,-16(r1)
227 bl trace_hardirqs_off
228 addi r1,r1,16
229 b 12f
230
23111:
218 bl trace_hardirqs_off 232 bl trace_hardirqs_off
23312:
219 lwz r0,GPR0(r1) 234 lwz r0,GPR0(r1)
220 lwz r3,ORIG_GPR3(r1) 235 lwz r3,ORIG_GPR3(r1)
221 lwz r4,GPR4(r1) 236 lwz r4,GPR4(r1)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index cf9c69b9189c..d4be7bb3dbdf 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -65,7 +65,7 @@ BEGIN_FTR_SECTION
65 lbz r0,PACAPROCSTART(r13) 65 lbz r0,PACAPROCSTART(r13)
66 cmpwi r0,0x80 66 cmpwi r0,0x80
67 bne 1f 67 bne 1f
68 li r0,0 68 li r0,1
69 stb r0,PACAPROCSTART(r13) 69 stb r0,PACAPROCSTART(r13)
70 b kvm_start_guest 70 b kvm_start_guest
711: 711:
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index b725dab0f88a..7dd2981bcc50 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -64,6 +64,35 @@ _ENTRY(_start);
64 mr r31,r3 /* save device tree ptr */ 64 mr r31,r3 /* save device tree ptr */
65 li r24,0 /* CPU number */ 65 li r24,0 /* CPU number */
66 66
67#ifdef CONFIG_RELOCATABLE
68/*
69 * Relocate ourselves to the current runtime address.
70 * This is called only by the Boot CPU.
71 * "relocate" is called with our current runtime virutal
72 * address.
73 * r21 will be loaded with the physical runtime address of _stext
74 */
75 bl 0f /* Get our runtime address */
760: mflr r21 /* Make it accessible */
77 addis r21,r21,(_stext - 0b)@ha
78 addi r21,r21,(_stext - 0b)@l /* Get our current runtime base */
79
80 /*
81 * We have the runtime (virutal) address of our base.
82 * We calculate our shift of offset from a 256M page.
83 * We could map the 256M page we belong to at PAGE_OFFSET and
84 * get going from there.
85 */
86 lis r4,KERNELBASE@h
87 ori r4,r4,KERNELBASE@l
88 rlwinm r6,r21,0,4,31 /* r6 = PHYS_START % 256M */
89 rlwinm r5,r4,0,4,31 /* r5 = KERNELBASE % 256M */
90 subf r3,r5,r6 /* r3 = r6 - r5 */
91 add r3,r4,r3 /* Required Virutal Address */
92
93 bl relocate
94#endif
95
67 bl init_cpu_state 96 bl init_cpu_state
68 97
69 /* 98 /*
@@ -88,6 +117,65 @@ _ENTRY(_start);
88 117
89#ifdef CONFIG_RELOCATABLE 118#ifdef CONFIG_RELOCATABLE
90 /* 119 /*
120 * Relocatable kernel support based on processing of dynamic
121 * relocation entries.
122 *
123 * r25 will contain RPN/ERPN for the start address of memory
124 * r21 will contain the current offset of _stext
125 */
126 lis r3,kernstart_addr@ha
127 la r3,kernstart_addr@l(r3)
128
129 /*
130 * Compute the kernstart_addr.
131 * kernstart_addr => (r6,r8)
132 * kernstart_addr & ~0xfffffff => (r6,r7)
133 */
134 rlwinm r6,r25,0,28,31 /* ERPN. Bits 32-35 of Address */
135 rlwinm r7,r25,0,0,3 /* RPN - assuming 256 MB page size */
136 rlwinm r8,r21,0,4,31 /* r8 = (_stext & 0xfffffff) */
137 or r8,r7,r8 /* Compute the lower 32bit of kernstart_addr */
138
139 /* Store kernstart_addr */
140 stw r6,0(r3) /* higher 32bit */
141 stw r8,4(r3) /* lower 32bit */
142
143 /*
144 * Compute the virt_phys_offset :
145 * virt_phys_offset = stext.run - kernstart_addr
146 *
147 * stext.run = (KERNELBASE & ~0xfffffff) + (kernstart_addr & 0xfffffff)
148 * When we relocate, we have :
149 *
150 * (kernstart_addr & 0xfffffff) = (stext.run & 0xfffffff)
151 *
152 * hence:
153 * virt_phys_offset = (KERNELBASE & ~0xfffffff) - (kernstart_addr & ~0xfffffff)
154 *
155 */
156
157 /* KERNELBASE&~0xfffffff => (r4,r5) */
158 li r4, 0 /* higer 32bit */
159 lis r5,KERNELBASE@h
160 rlwinm r5,r5,0,0,3 /* Align to 256M, lower 32bit */
161
162 /*
163 * 64bit subtraction.
164 */
165 subfc r5,r7,r5
166 subfe r4,r6,r4
167
168 /* Store virt_phys_offset */
169 lis r3,virt_phys_offset@ha
170 la r3,virt_phys_offset@l(r3)
171
172 stw r4,0(r3)
173 stw r5,4(r3)
174
175#elif defined(CONFIG_DYNAMIC_MEMSTART)
176 /*
177 * Mapping based, page aligned dynamic kernel loading.
178 *
91 * r25 will contain RPN/ERPN for the start address of memory 179 * r25 will contain RPN/ERPN for the start address of memory
92 * 180 *
93 * Add the difference between KERNELBASE and PAGE_OFFSET to the 181 * Add the difference between KERNELBASE and PAGE_OFFSET to the
@@ -732,6 +820,8 @@ _GLOBAL(init_cpu_state)
732 /* We use the PVR to differenciate 44x cores from 476 */ 820 /* We use the PVR to differenciate 44x cores from 476 */
733 mfspr r3,SPRN_PVR 821 mfspr r3,SPRN_PVR
734 srwi r3,r3,16 822 srwi r3,r3,16
823 cmplwi cr0,r3,PVR_476FPE@h
824 beq head_start_47x
735 cmplwi cr0,r3,PVR_476@h 825 cmplwi cr0,r3,PVR_476@h
736 beq head_start_47x 826 beq head_start_47x
737 cmplwi cr0,r3,PVR_476_ISS@h 827 cmplwi cr0,r3,PVR_476_ISS@h
@@ -800,12 +890,29 @@ skpinv: addi r4,r4,1 /* Increment */
800/* 890/*
801 * Configure and load pinned entry into TLB slot 63. 891 * Configure and load pinned entry into TLB slot 63.
802 */ 892 */
893#ifdef CONFIG_NONSTATIC_KERNEL
894 /*
895 * In case of a NONSTATIC_KERNEL we reuse the TLB XLAT
896 * entries of the initial mapping set by the boot loader.
897 * The XLAT entry is stored in r25
898 */
899
900 /* Read the XLAT entry for our current mapping */
901 tlbre r25,r23,PPC44x_TLB_XLAT
902
903 lis r3,KERNELBASE@h
904 ori r3,r3,KERNELBASE@l
905
906 /* Use our current RPN entry */
907 mr r4,r25
908#else
803 909
804 lis r3,PAGE_OFFSET@h 910 lis r3,PAGE_OFFSET@h
805 ori r3,r3,PAGE_OFFSET@l 911 ori r3,r3,PAGE_OFFSET@l
806 912
807 /* Kernel is at the base of RAM */ 913 /* Kernel is at the base of RAM */
808 li r4, 0 /* Load the kernel physical address */ 914 li r4, 0 /* Load the kernel physical address */
915#endif
809 916
810 /* Load the kernel PID = 0 */ 917 /* Load the kernel PID = 0 */
811 li r0,0 918 li r0,0
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 9f5d210ddf3f..d5d78c4ceef6 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -197,7 +197,7 @@ _ENTRY(__early_start)
197 197
198 bl early_init 198 bl early_init
199 199
200#ifdef CONFIG_RELOCATABLE 200#ifdef CONFIG_DYNAMIC_MEMSTART
201 lis r3,kernstart_addr@ha 201 lis r3,kernstart_addr@ha
202 la r3,kernstart_addr@l(r3) 202 la r3,kernstart_addr@l(r3)
203#ifdef CONFIG_PHYS_64BIT 203#ifdef CONFIG_PHYS_64BIT
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 39a2baa6ad58..7c66ce13da89 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -39,13 +39,23 @@
39#define cpu_should_die() 0 39#define cpu_should_die() 0
40#endif 40#endif
41 41
42unsigned long cpuidle_disable = IDLE_NO_OVERRIDE;
43EXPORT_SYMBOL(cpuidle_disable);
44
42static int __init powersave_off(char *arg) 45static int __init powersave_off(char *arg)
43{ 46{
44 ppc_md.power_save = NULL; 47 ppc_md.power_save = NULL;
48 cpuidle_disable = IDLE_POWERSAVE_OFF;
45 return 0; 49 return 0;
46} 50}
47__setup("powersave=off", powersave_off); 51__setup("powersave=off", powersave_off);
48 52
53#if defined(CONFIG_PPC_PSERIES) && defined(CONFIG_TRACEPOINTS)
54static const bool idle_uses_rcu = 1;
55#else
56static const bool idle_uses_rcu;
57#endif
58
49/* 59/*
50 * The body of the idle task. 60 * The body of the idle task.
51 */ 61 */
@@ -56,7 +66,10 @@ void cpu_idle(void)
56 66
57 set_thread_flag(TIF_POLLING_NRFLAG); 67 set_thread_flag(TIF_POLLING_NRFLAG);
58 while (1) { 68 while (1) {
59 tick_nohz_stop_sched_tick(1); 69 tick_nohz_idle_enter();
70 if (!idle_uses_rcu)
71 rcu_idle_enter();
72
60 while (!need_resched() && !cpu_should_die()) { 73 while (!need_resched() && !cpu_should_die()) {
61 ppc64_runlatch_off(); 74 ppc64_runlatch_off();
62 75
@@ -93,7 +106,9 @@ void cpu_idle(void)
93 106
94 HMT_medium(); 107 HMT_medium();
95 ppc64_runlatch_on(); 108 ppc64_runlatch_on();
96 tick_nohz_restart_sched_tick(); 109 if (!idle_uses_rcu)
110 rcu_idle_exit();
111 tick_nohz_idle_exit();
97 preempt_enable_no_resched(); 112 preempt_enable_no_resched();
98 if (cpu_should_die()) 113 if (cpu_should_die())
99 cpu_die(); 114 cpu_die();
@@ -102,6 +117,29 @@ void cpu_idle(void)
102 } 117 }
103} 118}
104 119
120
121/*
122 * cpu_idle_wait - Used to ensure that all the CPUs come out of the old
123 * idle loop and start using the new idle loop.
124 * Required while changing idle handler on SMP systems.
125 * Caller must have changed idle handler to the new value before the call.
126 * This window may be larger on shared systems.
127 */
128void cpu_idle_wait(void)
129{
130 int cpu;
131 smp_mb();
132
133 /* kick all the CPUs so that they exit out of old idle routine */
134 get_online_cpus();
135 for_each_online_cpu(cpu) {
136 if (cpu != smp_processor_id())
137 smp_send_reschedule(cpu);
138 }
139 put_online_cpus();
140}
141EXPORT_SYMBOL_GPL(cpu_idle_wait);
142
105int powersave_nap; 143int powersave_nap;
106 144
107#ifdef CONFIG_SYSCTL 145#ifdef CONFIG_SYSCTL
diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S
index 3a70845a51c7..fcdff198da4b 100644
--- a/arch/powerpc/kernel/idle_power7.S
+++ b/arch/powerpc/kernel/idle_power7.S
@@ -54,6 +54,7 @@ _GLOBAL(power7_idle)
54 li r0,0 54 li r0,0
55 stb r0,PACASOFTIRQEN(r13) /* we'll hard-enable shortly */ 55 stb r0,PACASOFTIRQEN(r13) /* we'll hard-enable shortly */
56 stb r0,PACAHARDIRQEN(r13) 56 stb r0,PACAHARDIRQEN(r13)
57 stb r0,PACA_NAPSTATELOST(r13)
57 58
58 /* Continue saving state */ 59 /* Continue saving state */
59 SAVE_GPR(2, r1) 60 SAVE_GPR(2, r1)
@@ -86,6 +87,9 @@ _GLOBAL(power7_wakeup_loss)
86 rfid 87 rfid
87 88
88_GLOBAL(power7_wakeup_noloss) 89_GLOBAL(power7_wakeup_noloss)
90 lbz r0,PACA_NAPSTATELOST(r13)
91 cmpwi r0,0
92 bne .power7_wakeup_loss
89 ld r1,PACAR1(r13) 93 ld r1,PACAR1(r13)
90 ld r4,_MSR(r1) 94 ld r4,_MSR(r1)
91 ld r5,_NIP(r1) 95 ld r5,_NIP(r1)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 5c3c46948d94..701d4aceb4f4 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -115,6 +115,15 @@ static inline notrace void set_soft_enabled(unsigned long enable)
115 : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled))); 115 : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled)));
116} 116}
117 117
118static inline notrace void decrementer_check_overflow(void)
119{
120 u64 now = get_tb_or_rtc();
121 u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
122
123 if (now >= *next_tb)
124 set_dec(1);
125}
126
118notrace void arch_local_irq_restore(unsigned long en) 127notrace void arch_local_irq_restore(unsigned long en)
119{ 128{
120 /* 129 /*
@@ -164,24 +173,21 @@ notrace void arch_local_irq_restore(unsigned long en)
164 */ 173 */
165 local_paca->hard_enabled = en; 174 local_paca->hard_enabled = en;
166 175
167#ifndef CONFIG_BOOKE 176 /*
168 /* On server, re-trigger the decrementer if it went negative since 177 * Trigger the decrementer if we have a pending event. Some processors
169 * some processors only trigger on edge transitions of the sign bit. 178 * only trigger on edge transitions of the sign bit. We might also
170 * 179 * have disabled interrupts long enough that the decrementer wrapped
171 * BookE has a level sensitive decrementer (latches in TSR) so we 180 * to positive.
172 * don't need that
173 */ 181 */
174 if ((int)mfspr(SPRN_DEC) < 0) 182 decrementer_check_overflow();
175 mtspr(SPRN_DEC, 1);
176#endif /* CONFIG_BOOKE */
177 183
178 /* 184 /*
179 * Force the delivery of pending soft-disabled interrupts on PS3. 185 * Force the delivery of pending soft-disabled interrupts on PS3.
180 * Any HV call will have this side effect. 186 * Any HV call will have this side effect.
181 */ 187 */
182 if (firmware_has_feature(FW_FEATURE_PS3_LV1)) { 188 if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
183 u64 tmp; 189 u64 tmp, tmp2;
184 lv1_get_version_info(&tmp); 190 lv1_get_version_info(&tmp, &tmp2);
185 } 191 }
186 192
187 __hard_irq_enable(); 193 __hard_irq_enable();
diff --git a/arch/powerpc/kernel/jump_label.c b/arch/powerpc/kernel/jump_label.c
index 368d158d665d..a1ed8a8c7cb4 100644
--- a/arch/powerpc/kernel/jump_label.c
+++ b/arch/powerpc/kernel/jump_label.c
@@ -11,6 +11,7 @@
11#include <linux/jump_label.h> 11#include <linux/jump_label.h>
12#include <asm/code-patching.h> 12#include <asm/code-patching.h>
13 13
14#ifdef HAVE_JUMP_LABEL
14void arch_jump_label_transform(struct jump_entry *entry, 15void arch_jump_label_transform(struct jump_entry *entry,
15 enum jump_label_type type) 16 enum jump_label_type type)
16{ 17{
@@ -21,3 +22,4 @@ void arch_jump_label_transform(struct jump_entry *entry,
21 else 22 else
22 patch_instruction(addr, PPC_INST_NOP); 23 patch_instruction(addr, PPC_INST_NOP);
23} 24}
25#endif
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 35f27646c4ff..2985338d0e10 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -132,7 +132,6 @@ static void kvm_patch_ins_b(u32 *inst, int addr)
132 /* On relocatable kernels interrupts handlers and our code 132 /* On relocatable kernels interrupts handlers and our code
133 can be in different regions, so we don't patch them */ 133 can be in different regions, so we don't patch them */
134 134
135 extern u32 __end_interrupts;
136 if ((ulong)inst < (ulong)&__end_interrupts) 135 if ((ulong)inst < (ulong)&__end_interrupts)
137 return; 136 return;
138#endif 137#endif
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 84daabe2fcba..578f35f18723 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -783,7 +783,7 @@ static const struct file_operations lparcfg_fops = {
783static int __init lparcfg_init(void) 783static int __init lparcfg_init(void)
784{ 784{
785 struct proc_dir_entry *ent; 785 struct proc_dir_entry *ent;
786 mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 786 umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
787 787
788 /* Allow writing if we have FW_FEATURE_SPLPAR */ 788 /* Allow writing if we have FW_FEATURE_SPLPAR */
789 if (firmware_has_feature(FW_FEATURE_SPLPAR) && 789 if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index 9ce1672afb59..c957b1202bdc 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -107,9 +107,6 @@ void __init reserve_crashkernel(void)
107 unsigned long long crash_size, crash_base; 107 unsigned long long crash_size, crash_base;
108 int ret; 108 int ret;
109 109
110 /* this is necessary because of memblock_phys_mem_size() */
111 memblock_analyze();
112
113 /* use common parsing */ 110 /* use common parsing */
114 ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), 111 ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
115 &crash_size, &crash_base); 112 &crash_size, &crash_base);
@@ -128,7 +125,7 @@ void __init reserve_crashkernel(void)
128 125
129 crash_size = resource_size(&crashk_res); 126 crash_size = resource_size(&crashk_res);
130 127
131#ifndef CONFIG_RELOCATABLE 128#ifndef CONFIG_NONSTATIC_KERNEL
132 if (crashk_res.start != KDUMP_KERNELBASE) 129 if (crashk_res.start != KDUMP_KERNELBASE)
133 printk("Crash kernel location must be 0x%x\n", 130 printk("Crash kernel location must be 0x%x\n",
134 KDUMP_KERNELBASE); 131 KDUMP_KERNELBASE);
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index f7d760ab5ca1..7cd07b42ca1a 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -738,7 +738,7 @@ relocate_new_kernel:
738 mr r5, r31 738 mr r5, r31
739 739
740 li r0, 0 740 li r0, 0
741#elif defined(CONFIG_44x) && !defined(CONFIG_47x) 741#elif defined(CONFIG_44x) && !defined(CONFIG_PPC_47x)
742 742
743/* 743/*
744 * Code for setting up 1:1 mapping for PPC440x for KEXEC 744 * Code for setting up 1:1 mapping for PPC440x for KEXEC
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 458ed3bee663..fa4a573d6716 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -214,7 +214,7 @@ char __devinit *pcibios_setup(char *str)
214 * If the interrupt is used, then gets the interrupt line from the 214 * If the interrupt is used, then gets the interrupt line from the
215 * openfirmware and sets it in the pci_dev and pci_config line. 215 * openfirmware and sets it in the pci_dev and pci_config line.
216 */ 216 */
217int pci_read_irq_line(struct pci_dev *pci_dev) 217static int pci_read_irq_line(struct pci_dev *pci_dev)
218{ 218{
219 struct of_irq oirq; 219 struct of_irq oirq;
220 unsigned int virq; 220 unsigned int virq;
@@ -283,7 +283,6 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
283 283
284 return 0; 284 return 0;
285} 285}
286EXPORT_SYMBOL(pci_read_irq_line);
287 286
288/* 287/*
289 * Platform support for /proc/bus/pci/X/Y mmap()s, 288 * Platform support for /proc/bus/pci/X/Y mmap()s,
@@ -921,18 +920,22 @@ static void __devinit pcibios_fixup_resources(struct pci_dev *dev)
921 struct resource *res = dev->resource + i; 920 struct resource *res = dev->resource + i;
922 if (!res->flags) 921 if (!res->flags)
923 continue; 922 continue;
924 /* On platforms that have PCI_PROBE_ONLY set, we don't 923
925 * consider 0 as an unassigned BAR value. It's technically 924 /* If we're going to re-assign everything, we mark all resources
926 * a valid value, but linux doesn't like it... so when we can 925 * as unset (and 0-base them). In addition, we mark BARs starting
927 * re-assign things, we do so, but if we can't, we keep it 926 * at 0 as unset as well, except if PCI_PROBE_ONLY is also set
928 * around and hope for the best... 927 * since in that case, we don't want to re-assign anything
929 */ 928 */
930 if (res->start == 0 && !pci_has_flag(PCI_PROBE_ONLY)) { 929 if (pci_has_flag(PCI_REASSIGN_ALL_RSRC) ||
931 pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] is unassigned\n", 930 (res->start == 0 && !pci_has_flag(PCI_PROBE_ONLY))) {
932 pci_name(dev), i, 931 /* Only print message if not re-assigning */
933 (unsigned long long)res->start, 932 if (!pci_has_flag(PCI_REASSIGN_ALL_RSRC))
934 (unsigned long long)res->end, 933 pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] "
935 (unsigned int)res->flags); 934 "is unassigned\n",
935 pci_name(dev), i,
936 (unsigned long long)res->start,
937 (unsigned long long)res->end,
938 (unsigned int)res->flags);
936 res->end -= res->start; 939 res->end -= res->start;
937 res->start = 0; 940 res->start = 0;
938 res->flags |= IORESOURCE_UNSET; 941 res->flags |= IORESOURCE_UNSET;
@@ -1042,6 +1045,16 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
1042 if (i >= 3 && bus->self->transparent) 1045 if (i >= 3 && bus->self->transparent)
1043 continue; 1046 continue;
1044 1047
1048 /* If we are going to re-assign everything, mark the resource
1049 * as unset and move it down to 0
1050 */
1051 if (pci_has_flag(PCI_REASSIGN_ALL_RSRC)) {
1052 res->flags |= IORESOURCE_UNSET;
1053 res->end -= res->start;
1054 res->start = 0;
1055 continue;
1056 }
1057
1045 pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n", 1058 pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n",
1046 pci_name(dev), i, 1059 pci_name(dev), i,
1047 (unsigned long long)res->start,\ 1060 (unsigned long long)res->start,\
@@ -1262,18 +1275,15 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1262 pci_bus_for_each_resource(bus, res, i) { 1275 pci_bus_for_each_resource(bus, res, i) {
1263 if (!res || !res->flags || res->start > res->end || res->parent) 1276 if (!res || !res->flags || res->start > res->end || res->parent)
1264 continue; 1277 continue;
1278
1279 /* If the resource was left unset at this point, we clear it */
1280 if (res->flags & IORESOURCE_UNSET)
1281 goto clear_resource;
1282
1265 if (bus->parent == NULL) 1283 if (bus->parent == NULL)
1266 pr = (res->flags & IORESOURCE_IO) ? 1284 pr = (res->flags & IORESOURCE_IO) ?
1267 &ioport_resource : &iomem_resource; 1285 &ioport_resource : &iomem_resource;
1268 else { 1286 else {
1269 /* Don't bother with non-root busses when
1270 * re-assigning all resources. We clear the
1271 * resource flags as if they were colliding
1272 * and as such ensure proper re-allocation
1273 * later.
1274 */
1275 if (pci_has_flag(PCI_REASSIGN_ALL_RSRC))
1276 goto clear_resource;
1277 pr = pci_find_parent_resource(bus->self, res); 1287 pr = pci_find_parent_resource(bus->self, res);
1278 if (pr == res) { 1288 if (pr == res) {
1279 /* this happens when the generic PCI 1289 /* this happens when the generic PCI
@@ -1304,9 +1314,9 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1304 if (reparent_resources(pr, res) == 0) 1314 if (reparent_resources(pr, res) == 0)
1305 continue; 1315 continue;
1306 } 1316 }
1307 printk(KERN_WARNING "PCI: Cannot allocate resource region " 1317 pr_warning("PCI: Cannot allocate resource region "
1308 "%d of PCI bridge %d, will remap\n", i, bus->number); 1318 "%d of PCI bridge %d, will remap\n", i, bus->number);
1309clear_resource: 1319 clear_resource:
1310 res->start = res->end = 0; 1320 res->start = res->end = 0;
1311 res->flags = 0; 1321 res->flags = 0;
1312 } 1322 }
@@ -1451,16 +1461,11 @@ void __init pcibios_resource_survey(void)
1451{ 1461{
1452 struct pci_bus *b; 1462 struct pci_bus *b;
1453 1463
1454 /* Allocate and assign resources. If we re-assign everything, then 1464 /* Allocate and assign resources */
1455 * we skip the allocate phase
1456 */
1457 list_for_each_entry(b, &pci_root_buses, node) 1465 list_for_each_entry(b, &pci_root_buses, node)
1458 pcibios_allocate_bus_resources(b); 1466 pcibios_allocate_bus_resources(b);
1459 1467 pcibios_allocate_resources(0);
1460 if (!pci_has_flag(PCI_REASSIGN_ALL_RSRC)) { 1468 pcibios_allocate_resources(1);
1461 pcibios_allocate_resources(0);
1462 pcibios_allocate_resources(1);
1463 }
1464 1469
1465 /* Before we start assigning unassigned resource, we try to reserve 1470 /* Before we start assigning unassigned resource, we try to reserve
1466 * the low IO area and the VGA memory area if they intersect the 1471 * the low IO area and the VGA memory area if they intersect the
@@ -1732,6 +1737,12 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
1732 if (mode == PCI_PROBE_NORMAL) 1737 if (mode == PCI_PROBE_NORMAL)
1733 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus); 1738 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
1734 1739
1740 /* Platform gets a chance to do some global fixups before
1741 * we proceed to resource allocation
1742 */
1743 if (ppc_md.pcibios_fixup_phb)
1744 ppc_md.pcibios_fixup_phb(hose);
1745
1735 /* Configure PCI Express settings */ 1746 /* Configure PCI Express settings */
1736 if (bus && !pci_has_flag(PCI_PROBE_ONLY)) { 1747 if (bus && !pci_has_flag(PCI_PROBE_ONLY)) {
1737 struct pci_bus *child; 1748 struct pci_bus *child;
@@ -1747,10 +1758,13 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
1747static void fixup_hide_host_resource_fsl(struct pci_dev *dev) 1758static void fixup_hide_host_resource_fsl(struct pci_dev *dev)
1748{ 1759{
1749 int i, class = dev->class >> 8; 1760 int i, class = dev->class >> 8;
1761 /* When configured as agent, programing interface = 1 */
1762 int prog_if = dev->class & 0xf;
1750 1763
1751 if ((class == PCI_CLASS_PROCESSOR_POWERPC || 1764 if ((class == PCI_CLASS_PROCESSOR_POWERPC ||
1752 class == PCI_CLASS_BRIDGE_OTHER) && 1765 class == PCI_CLASS_BRIDGE_OTHER) &&
1753 (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) && 1766 (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) &&
1767 (prog_if == 0) &&
1754 (dev->bus->parent == NULL)) { 1768 (dev->bus->parent == NULL)) {
1755 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 1769 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
1756 dev->resource[i].start = 0; 1770 dev->resource[i].start = 0;
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 4e69deb89b37..dd9e4a04bf79 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -50,6 +50,9 @@ void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
50 dn->data = pdn; 50 dn->data = pdn;
51 pdn->node = dn; 51 pdn->node = dn;
52 pdn->phb = phb; 52 pdn->phb = phb;
53#ifdef CONFIG_PPC_POWERNV
54 pdn->pe_number = IODA_INVALID_PE;
55#endif
53 regs = of_get_property(dn, "reg", NULL); 56 regs = of_get_property(dn, "reg", NULL);
54 if (regs) { 57 if (regs) {
55 /* First register entry is addr (00BBSS00) */ 58 /* First register entry is addr (00BBSS00) */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 9054ca9ab4f9..ebe5766781aa 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -486,28 +486,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
486 new_thread = &new->thread; 486 new_thread = &new->thread;
487 old_thread = &current->thread; 487 old_thread = &current->thread;
488 488
489#if defined(CONFIG_PPC_BOOK3E_64)
490 /* XXX Current Book3E code doesn't deal with kernel side DBCR0,
491 * we always hold the user values, so we set it now.
492 *
493 * However, we ensure the kernel MSR:DE is appropriately cleared too
494 * to avoid spurrious single step exceptions in the kernel.
495 *
496 * This will have to change to merge with the ppc32 code at some point,
497 * but I don't like much what ppc32 is doing today so there's some
498 * thinking needed there
499 */
500 if ((new_thread->dbcr0 | old_thread->dbcr0) & DBCR0_IDM) {
501 u32 dbcr0;
502
503 mtmsr(mfmsr() & ~MSR_DE);
504 isync();
505 dbcr0 = mfspr(SPRN_DBCR0);
506 dbcr0 = (dbcr0 & DBCR0_EDM) | new_thread->dbcr0;
507 mtspr(SPRN_DBCR0, dbcr0);
508 }
509#endif /* CONFIG_PPC64_BOOK3E */
510
511#ifdef CONFIG_PPC64 489#ifdef CONFIG_PPC64
512 /* 490 /*
513 * Collect processor utilization data per process 491 * Collect processor utilization data per process
@@ -606,16 +584,32 @@ static struct regbit {
606 unsigned long bit; 584 unsigned long bit;
607 const char *name; 585 const char *name;
608} msr_bits[] = { 586} msr_bits[] = {
587#if defined(CONFIG_PPC64) && !defined(CONFIG_BOOKE)
588 {MSR_SF, "SF"},
589 {MSR_HV, "HV"},
590#endif
591 {MSR_VEC, "VEC"},
592 {MSR_VSX, "VSX"},
593#ifdef CONFIG_BOOKE
594 {MSR_CE, "CE"},
595#endif
609 {MSR_EE, "EE"}, 596 {MSR_EE, "EE"},
610 {MSR_PR, "PR"}, 597 {MSR_PR, "PR"},
611 {MSR_FP, "FP"}, 598 {MSR_FP, "FP"},
612 {MSR_VEC, "VEC"},
613 {MSR_VSX, "VSX"},
614 {MSR_ME, "ME"}, 599 {MSR_ME, "ME"},
615 {MSR_CE, "CE"}, 600#ifdef CONFIG_BOOKE
616 {MSR_DE, "DE"}, 601 {MSR_DE, "DE"},
602#else
603 {MSR_SE, "SE"},
604 {MSR_BE, "BE"},
605#endif
617 {MSR_IR, "IR"}, 606 {MSR_IR, "IR"},
618 {MSR_DR, "DR"}, 607 {MSR_DR, "DR"},
608 {MSR_PMM, "PMM"},
609#ifndef CONFIG_BOOKE
610 {MSR_RI, "RI"},
611 {MSR_LE, "LE"},
612#endif
619 {0, NULL} 613 {0, NULL}
620}; 614};
621 615
@@ -657,7 +651,7 @@ void show_regs(struct pt_regs * regs)
657 if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR)) 651 if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
658 printk("CFAR: "REG"\n", regs->orig_gpr3); 652 printk("CFAR: "REG"\n", regs->orig_gpr3);
659 if (trap == 0x300 || trap == 0x600) 653 if (trap == 0x300 || trap == 0x600)
660#ifdef CONFIG_PPC_ADV_DEBUG_REGS 654#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
661 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr); 655 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
662#else 656#else
663 printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr); 657 printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index fa1235b0503b..abe405dab34d 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -733,8 +733,6 @@ void __init early_init_devtree(void *params)
733 of_scan_flat_dt(early_init_dt_scan_chosen_ppc, cmd_line); 733 of_scan_flat_dt(early_init_dt_scan_chosen_ppc, cmd_line);
734 734
735 /* Scan memory nodes and rebuild MEMBLOCKs */ 735 /* Scan memory nodes and rebuild MEMBLOCKs */
736 memblock_init();
737
738 of_scan_flat_dt(early_init_dt_scan_root, NULL); 736 of_scan_flat_dt(early_init_dt_scan_root, NULL);
739 of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL); 737 of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
740 738
@@ -756,20 +754,14 @@ void __init early_init_devtree(void *params)
756 early_reserve_mem(); 754 early_reserve_mem();
757 phyp_dump_reserve_mem(); 755 phyp_dump_reserve_mem();
758 756
759 limit = memory_limit; 757 /*
760 if (! limit) { 758 * Ensure that total memory size is page-aligned, because otherwise
761 phys_addr_t memsize; 759 * mark_bootmem() gets upset.
762 760 */
763 /* Ensure that total memory size is page-aligned, because 761 limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
764 * otherwise mark_bootmem() gets upset. */
765 memblock_analyze();
766 memsize = memblock_phys_mem_size();
767 if ((memsize & PAGE_MASK) != memsize)
768 limit = memsize & PAGE_MASK;
769 }
770 memblock_enforce_memory_limit(limit); 762 memblock_enforce_memory_limit(limit);
771 763
772 memblock_analyze(); 764 memblock_allow_resize();
773 memblock_dump_all(); 765 memblock_dump_all();
774 766
775 DBG("Phys. mem: %llx\n", memblock_phys_mem_size()); 767 DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index b4fa66127495..eca626ea3f23 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -742,7 +742,7 @@ static unsigned char ibm_architecture_vec[] = {
742 W(0xffffffff), /* virt_base */ 742 W(0xffffffff), /* virt_base */
743 W(0xffffffff), /* virt_size */ 743 W(0xffffffff), /* virt_size */
744 W(0xffffffff), /* load_base */ 744 W(0xffffffff), /* load_base */
745 W(64), /* 64MB min RMA */ 745 W(256), /* 256MB min RMA */
746 W(0xffffffff), /* full client load */ 746 W(0xffffffff), /* full client load */
747 0, /* min RMA percentage of total RAM */ 747 0, /* min RMA percentage of total RAM */
748 48, /* max log_2(hash table size) */ 748 48, /* max log_2(hash table size) */
@@ -1224,14 +1224,6 @@ static void __init prom_init_mem(void)
1224 1224
1225 RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000); 1225 RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000);
1226 1226
1227 /* Check if we have an initrd after the kernel, if we do move our bottom
1228 * point to after it
1229 */
1230 if (RELOC(prom_initrd_start)) {
1231 if (RELOC(prom_initrd_end) > RELOC(alloc_bottom))
1232 RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end));
1233 }
1234
1235 /* 1227 /*
1236 * If prom_memory_limit is set we reduce the upper limits *except* for 1228 * If prom_memory_limit is set we reduce the upper limits *except* for
1237 * alloc_top_high. This must be the real top of RAM so we can put 1229 * alloc_top_high. This must be the real top of RAM so we can put
@@ -1269,6 +1261,15 @@ static void __init prom_init_mem(void)
1269 RELOC(alloc_top) = RELOC(rmo_top); 1261 RELOC(alloc_top) = RELOC(rmo_top);
1270 RELOC(alloc_top_high) = RELOC(ram_top); 1262 RELOC(alloc_top_high) = RELOC(ram_top);
1271 1263
1264 /*
1265 * Check if we have an initrd after the kernel but still inside
1266 * the RMO. If we do move our bottom point to after it.
1267 */
1268 if (RELOC(prom_initrd_start) &&
1269 RELOC(prom_initrd_start) < RELOC(rmo_top) &&
1270 RELOC(prom_initrd_end) > RELOC(alloc_bottom))
1271 RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end));
1272
1272 prom_printf("memory layout at init:\n"); 1273 prom_printf("memory layout at init:\n");
1273 prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit)); 1274 prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));
1274 prom_printf(" alloc_bottom : %x\n", RELOC(alloc_bottom)); 1275 prom_printf(" alloc_bottom : %x\n", RELOC(alloc_bottom));
@@ -1579,10 +1580,8 @@ static void __init prom_instantiate_rtas(void)
1579 return; 1580 return;
1580 1581
1581 base = alloc_down(size, PAGE_SIZE, 0); 1582 base = alloc_down(size, PAGE_SIZE, 0);
1582 if (base == 0) { 1583 if (base == 0)
1583 prom_printf("RTAS allocation failed !\n"); 1584 prom_panic("Could not allocate memory for RTAS\n");
1584 return;
1585 }
1586 1585
1587 rtas_inst = call_prom("open", 1, 1, ADDR("/rtas")); 1586 rtas_inst = call_prom("open", 1, 1, ADDR("/rtas"));
1588 if (!IHANDLE_VALID(rtas_inst)) { 1587 if (!IHANDLE_VALID(rtas_inst)) {
@@ -2081,7 +2080,7 @@ static void __init prom_check_displays(void)
2081 /* Setup a usable color table when the appropriate 2080 /* Setup a usable color table when the appropriate
2082 * method is available. Should update this to set-colors */ 2081 * method is available. Should update this to set-colors */
2083 clut = RELOC(default_colors); 2082 clut = RELOC(default_colors);
2084 for (i = 0; i < 32; i++, clut += 3) 2083 for (i = 0; i < 16; i++, clut += 3)
2085 if (prom_set_color(ih, i, clut[0], clut[1], 2084 if (prom_set_color(ih, i, clut[0], clut[1],
2086 clut[2]) != 0) 2085 clut[2]) != 0)
2087 break; 2086 break;
@@ -2846,7 +2845,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2846 RELOC(of_platform) = prom_find_machine_type(); 2845 RELOC(of_platform) = prom_find_machine_type();
2847 prom_printf("Detected machine type: %x\n", RELOC(of_platform)); 2846 prom_printf("Detected machine type: %x\n", RELOC(of_platform));
2848 2847
2849#ifndef CONFIG_RELOCATABLE 2848#ifndef CONFIG_NONSTATIC_KERNEL
2850 /* Bail if this is a kdump kernel. */ 2849 /* Bail if this is a kdump kernel. */
2851 if (PHYSICAL_START > 0) 2850 if (PHYSICAL_START > 0)
2852 prom_panic("Error: You can't boot a kdump kernel from OF!\n"); 2851 prom_panic("Error: You can't boot a kdump kernel from OF!\n");
@@ -2971,9 +2970,11 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2971 /* 2970 /*
2972 * in case stdin is USB and still active on IBM machines... 2971 * in case stdin is USB and still active on IBM machines...
2973 * Unfortunately quiesce crashes on some powermacs if we have 2972 * Unfortunately quiesce crashes on some powermacs if we have
2974 * closed stdin already (in particular the powerbook 101). 2973 * closed stdin already (in particular the powerbook 101). It
2974 * appears that the OPAL version of OFW doesn't like it either.
2975 */ 2975 */
2976 if (RELOC(of_platform) != PLATFORM_POWERMAC) 2976 if (RELOC(of_platform) != PLATFORM_POWERMAC &&
2977 RELOC(of_platform) != PLATFORM_OPAL)
2977 prom_close_stdin(); 2978 prom_close_stdin();
2978 2979
2979 /* 2980 /*
@@ -2989,8 +2990,12 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2989 * is common to us and kexec 2990 * is common to us and kexec
2990 */ 2991 */
2991 hdr = RELOC(dt_header_start); 2992 hdr = RELOC(dt_header_start);
2992 prom_printf("returning from prom_init\n"); 2993
2993 prom_debug("->dt_header_start=0x%x\n", hdr); 2994 /* Don't print anything after quiesce under OPAL, it crashes OFW */
2995 if (RELOC(of_platform) != PLATFORM_OPAL) {
2996 prom_printf("returning from prom_init\n");
2997 prom_debug("->dt_header_start=0x%x\n", hdr);
2998 }
2994 2999
2995#ifdef CONFIG_PPC32 3000#ifdef CONFIG_PPC32
2996 reloc_got2(-offset); 3001 reloc_got2(-offset);
diff --git a/arch/powerpc/kernel/reloc_32.S b/arch/powerpc/kernel/reloc_32.S
new file mode 100644
index 000000000000..ef46ba6e094f
--- /dev/null
+++ b/arch/powerpc/kernel/reloc_32.S
@@ -0,0 +1,208 @@
1/*
2 * Code to process dynamic relocations for PPC32.
3 *
4 * Copyrights (C) IBM Corporation, 2011.
5 * Author: Suzuki Poulose <suzuki@in.ibm.com>
6 *
7 * - Based on ppc64 code - reloc_64.S
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15#include <asm/ppc_asm.h>
16
17/* Dynamic section table entry tags */
18DT_RELA = 7 /* Tag for Elf32_Rela section */
19DT_RELASZ = 8 /* Size of the Rela relocs */
20DT_RELAENT = 9 /* Size of one Rela reloc entry */
21
22STN_UNDEF = 0 /* Undefined symbol index */
23STB_LOCAL = 0 /* Local binding for the symbol */
24
25R_PPC_ADDR16_LO = 4 /* Lower half of (S+A) */
26R_PPC_ADDR16_HI = 5 /* Upper half of (S+A) */
27R_PPC_ADDR16_HA = 6 /* High Adjusted (S+A) */
28R_PPC_RELATIVE = 22
29
30/*
31 * r3 = desired final address
32 */
33
34_GLOBAL(relocate)
35
36 mflr r0 /* Save our LR */
37 bl 0f /* Find our current runtime address */
380: mflr r12 /* Make it accessible */
39 mtlr r0
40
41 lwz r11, (p_dyn - 0b)(r12)
42 add r11, r11, r12 /* runtime address of .dynamic section */
43 lwz r9, (p_rela - 0b)(r12)
44 add r9, r9, r12 /* runtime address of .rela.dyn section */
45 lwz r10, (p_st - 0b)(r12)
46 add r10, r10, r12 /* runtime address of _stext section */
47 lwz r13, (p_sym - 0b)(r12)
48 add r13, r13, r12 /* runtime address of .dynsym section */
49
50 /*
51 * Scan the dynamic section for RELA, RELASZ entries
52 */
53 li r6, 0
54 li r7, 0
55 li r8, 0
561: lwz r5, 0(r11) /* ELF_Dyn.d_tag */
57 cmpwi r5, 0 /* End of ELF_Dyn[] */
58 beq eodyn
59 cmpwi r5, DT_RELA
60 bne relasz
61 lwz r7, 4(r11) /* r7 = rela.link */
62 b skip
63relasz:
64 cmpwi r5, DT_RELASZ
65 bne relaent
66 lwz r8, 4(r11) /* r8 = Total Rela relocs size */
67 b skip
68relaent:
69 cmpwi r5, DT_RELAENT
70 bne skip
71 lwz r6, 4(r11) /* r6 = Size of one Rela reloc */
72skip:
73 addi r11, r11, 8
74 b 1b
75eodyn: /* End of Dyn Table scan */
76
77 /* Check if we have found all the entries */
78 cmpwi r7, 0
79 beq done
80 cmpwi r8, 0
81 beq done
82 cmpwi r6, 0
83 beq done
84
85
86 /*
87 * Work out the current offset from the link time address of .rela
88 * section.
89 * cur_offset[r7] = rela.run[r9] - rela.link [r7]
90 * _stext.link[r12] = _stext.run[r10] - cur_offset[r7]
91 * final_offset[r3] = _stext.final[r3] - _stext.link[r12]
92 */
93 subf r7, r7, r9 /* cur_offset */
94 subf r12, r7, r10
95 subf r3, r12, r3 /* final_offset */
96
97 subf r8, r6, r8 /* relaz -= relaent */
98 /*
99 * Scan through the .rela table and process each entry
100 * r9 - points to the current .rela table entry
101 * r13 - points to the symbol table
102 */
103
104 /*
105 * Check if we have a relocation based on symbol
106 * r5 will hold the value of the symbol.
107 */
108applyrela:
109 lwz r4, 4(r9) /* r4 = rela.r_info */
110 srwi r5, r4, 8 /* ELF32_R_SYM(r_info) */
111 cmpwi r5, STN_UNDEF /* sym == STN_UNDEF ? */
112 beq get_type /* value = 0 */
113 /* Find the value of the symbol at index(r5) */
114 slwi r5, r5, 4 /* r5 = r5 * sizeof(Elf32_Sym) */
115 add r12, r13, r5 /* r12 = &__dyn_sym[Index] */
116
117 /*
118 * GNU ld has a bug, where dynamic relocs based on
119 * STB_LOCAL symbols, the value should be assumed
120 * to be zero. - Alan Modra
121 */
122 /* XXX: Do we need to check if we are using GNU ld ? */
123 lbz r5, 12(r12) /* r5 = dyn_sym[Index].st_info */
124 extrwi r5, r5, 4, 24 /* r5 = ELF32_ST_BIND(r5) */
125 cmpwi r5, STB_LOCAL /* st_value = 0, ld bug */
126 beq get_type /* We have r5 = 0 */
127 lwz r5, 4(r12) /* r5 = __dyn_sym[Index].st_value */
128
129get_type:
130 /* Load the relocation type to r4 */
131 extrwi r4, r4, 8, 24 /* r4 = ELF32_R_TYPE(r_info) = ((char*)r4)[3] */
132
133 /* R_PPC_RELATIVE */
134 cmpwi r4, R_PPC_RELATIVE
135 bne hi16
136 lwz r4, 0(r9) /* r_offset */
137 lwz r0, 8(r9) /* r_addend */
138 add r0, r0, r3 /* final addend */
139 stwx r0, r4, r7 /* memory[r4+r7]) = (u32)r0 */
140 b nxtrela /* continue */
141
142 /* R_PPC_ADDR16_HI */
143hi16:
144 cmpwi r4, R_PPC_ADDR16_HI
145 bne ha16
146 lwz r4, 0(r9) /* r_offset */
147 lwz r0, 8(r9) /* r_addend */
148 add r0, r0, r3
149 add r0, r0, r5 /* r0 = (S+A+Offset) */
150 extrwi r0, r0, 16, 0 /* r0 = (r0 >> 16) */
151 b store_half
152
153 /* R_PPC_ADDR16_HA */
154ha16:
155 cmpwi r4, R_PPC_ADDR16_HA
156 bne lo16
157 lwz r4, 0(r9) /* r_offset */
158 lwz r0, 8(r9) /* r_addend */
159 add r0, r0, r3
160 add r0, r0, r5 /* r0 = (S+A+Offset) */
161 extrwi r5, r0, 1, 16 /* Extract bit 16 */
162 extrwi r0, r0, 16, 0 /* r0 = (r0 >> 16) */
163 add r0, r0, r5 /* Add it to r0 */
164 b store_half
165
166 /* R_PPC_ADDR16_LO */
167lo16:
168 cmpwi r4, R_PPC_ADDR16_LO
169 bne nxtrela
170 lwz r4, 0(r9) /* r_offset */
171 lwz r0, 8(r9) /* r_addend */
172 add r0, r0, r3
173 add r0, r0, r5 /* r0 = (S+A+Offset) */
174 extrwi r0, r0, 16, 16 /* r0 &= 0xffff */
175 /* Fall through to */
176
177 /* Store half word */
178store_half:
179 sthx r0, r4, r7 /* memory[r4+r7] = (u16)r0 */
180
181nxtrela:
182 /*
183 * We have to flush the modified instructions to the
184 * main storage from the d-cache. And also, invalidate the
185 * cached instructions in i-cache which has been modified.
186 *
187 * We delay the sync / isync operation till the end, since
188 * we won't be executing the modified instructions until
189 * we return from here.
190 */
191 dcbst r4,r7
192 sync /* Ensure the data is flushed before icbi */
193 icbi r4,r7
194 cmpwi r8, 0 /* relasz = 0 ? */
195 ble done
196 add r9, r9, r6 /* move to next entry in the .rela table */
197 subf r8, r6, r8 /* relasz -= relaent */
198 b applyrela
199
200done:
201 sync /* Wait for the flush to finish */
202 isync /* Discard prefetched instructions */
203 blr
204
205p_dyn: .long __dynamic_start - 0b
206p_rela: .long __rela_dyn_start - 0b
207p_sym: .long __dynamic_symtab - 0b
208p_st: .long _stext - 0b
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index e037c7494fd8..4174b4b23246 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -568,6 +568,12 @@ static void rtas_flash_firmware(int reboot_type)
568 } 568 }
569 569
570 /* 570 /*
571 * Just before starting the firmware flash, cancel the event scan work
572 * to avoid any soft lockup issues.
573 */
574 rtas_cancel_event_scan();
575
576 /*
571 * NOTE: the "first" block must be under 4GB, so we create 577 * NOTE: the "first" block must be under 4GB, so we create
572 * an entry with no data blocks in the reserved buffer in 578 * an entry with no data blocks in the reserved buffer in
573 * the kernel data segment. 579 * the kernel data segment.
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index 481ef064c8f1..1045ff49cc6d 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -472,6 +472,13 @@ static void start_event_scan(void)
472 &event_scan_work, event_scan_delay); 472 &event_scan_work, event_scan_delay);
473} 473}
474 474
475/* Cancel the rtas event scan work */
476void rtas_cancel_event_scan(void)
477{
478 cancel_delayed_work_sync(&event_scan_work);
479}
480EXPORT_SYMBOL_GPL(rtas_cancel_event_scan);
481
475static int __init rtas_init(void) 482static int __init rtas_init(void)
476{ 483{
477 struct proc_dir_entry *entry; 484 struct proc_dir_entry *entry;
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index c1ce86357ecb..ac7610815113 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -107,6 +107,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
107 PTRRELOC(&__start___lwsync_fixup), 107 PTRRELOC(&__start___lwsync_fixup),
108 PTRRELOC(&__stop___lwsync_fixup)); 108 PTRRELOC(&__stop___lwsync_fixup));
109 109
110 do_final_fixups();
111
110 return KERNELBASE + offset; 112 return KERNELBASE + offset;
111} 113}
112 114
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 1a9dea80a69b..4cb8f1e9d044 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -35,6 +35,8 @@
35#include <linux/pci.h> 35#include <linux/pci.h>
36#include <linux/lockdep.h> 36#include <linux/lockdep.h>
37#include <linux/memblock.h> 37#include <linux/memblock.h>
38#include <linux/hugetlb.h>
39
38#include <asm/io.h> 40#include <asm/io.h>
39#include <asm/kdump.h> 41#include <asm/kdump.h>
40#include <asm/prom.h> 42#include <asm/prom.h>
@@ -64,6 +66,7 @@
64#include <asm/mmu_context.h> 66#include <asm/mmu_context.h>
65#include <asm/code-patching.h> 67#include <asm/code-patching.h>
66#include <asm/kvm_ppc.h> 68#include <asm/kvm_ppc.h>
69#include <asm/hugetlb.h>
67 70
68#include "setup.h" 71#include "setup.h"
69 72
@@ -217,6 +220,13 @@ void __init early_setup(unsigned long dt_ptr)
217 /* Initialize the hash table or TLB handling */ 220 /* Initialize the hash table or TLB handling */
218 early_init_mmu(); 221 early_init_mmu();
219 222
223 /*
224 * Reserve any gigantic pages requested on the command line.
225 * memblock needs to have been initialized by the time this is
226 * called since this will reserve memory.
227 */
228 reserve_hugetlb_gpages();
229
220 DBG(" <- early_setup()\n"); 230 DBG(" <- early_setup()\n");
221} 231}
222 232
@@ -359,6 +369,7 @@ void __init setup_system(void)
359 &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup); 369 &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
360 do_lwsync_fixups(cur_cpu_spec->cpu_features, 370 do_lwsync_fixups(cur_cpu_spec->cpu_features,
361 &__start___lwsync_fixup, &__stop___lwsync_fixup); 371 &__start___lwsync_fixup, &__stop___lwsync_fixup);
372 do_final_fixups();
362 373
363 /* 374 /*
364 * Unflatten the device-tree passed by prom_init or kexec 375 * Unflatten the device-tree passed by prom_init or kexec
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 78b76dc54dfb..836a5a19eb2c 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -97,7 +97,7 @@ static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set)
97 compat_sigset_t cset; 97 compat_sigset_t cset;
98 98
99 switch (_NSIG_WORDS) { 99 switch (_NSIG_WORDS) {
100 case 4: cset.sig[5] = set->sig[3] & 0xffffffffull; 100 case 4: cset.sig[6] = set->sig[3] & 0xffffffffull;
101 cset.sig[7] = set->sig[3] >> 32; 101 cset.sig[7] = set->sig[3] >> 32;
102 case 3: cset.sig[4] = set->sig[2] & 0xffffffffull; 102 case 3: cset.sig[4] = set->sig[2] & 0xffffffffull;
103 cset.sig[5] = set->sig[2] >> 32; 103 cset.sig[5] = set->sig[2] >> 32;
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 6df70907d60a..46695febc09f 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -27,7 +27,7 @@
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/cache.h> 28#include <linux/cache.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/sysdev.h> 30#include <linux/device.h>
31#include <linux/cpu.h> 31#include <linux/cpu.h>
32#include <linux/notifier.h> 32#include <linux/notifier.h>
33#include <linux/topology.h> 33#include <linux/topology.h>
@@ -187,7 +187,8 @@ int smp_request_message_ipi(int virq, int msg)
187 return 1; 187 return 1;
188 } 188 }
189#endif 189#endif
190 err = request_irq(virq, smp_ipi_action[msg], IRQF_PERCPU, 190 err = request_irq(virq, smp_ipi_action[msg],
191 IRQF_PERCPU | IRQF_NO_THREAD,
191 smp_ipi_name[msg], 0); 192 smp_ipi_name[msg], 0);
192 WARN(err < 0, "unable to request_irq %d for %s (rc %d)\n", 193 WARN(err < 0, "unable to request_irq %d for %s (rc %d)\n",
193 virq, smp_ipi_name[msg], err); 194 virq, smp_ipi_name[msg], err);
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index ce035c1905f0..883e74c0d1b3 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -1,4 +1,4 @@
1#include <linux/sysdev.h> 1#include <linux/device.h>
2#include <linux/cpu.h> 2#include <linux/cpu.h>
3#include <linux/smp.h> 3#include <linux/smp.h>
4#include <linux/percpu.h> 4#include <linux/percpu.h>
@@ -18,6 +18,7 @@
18#include <asm/machdep.h> 18#include <asm/machdep.h>
19#include <asm/smp.h> 19#include <asm/smp.h>
20#include <asm/pmc.h> 20#include <asm/pmc.h>
21#include <asm/system.h>
21 22
22#include "cacheinfo.h" 23#include "cacheinfo.h"
23 24
@@ -37,12 +38,12 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
37/* Time in microseconds we delay before sleeping in the idle loop */ 38/* Time in microseconds we delay before sleeping in the idle loop */
38DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 }; 39DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 };
39 40
40static ssize_t store_smt_snooze_delay(struct sys_device *dev, 41static ssize_t store_smt_snooze_delay(struct device *dev,
41 struct sysdev_attribute *attr, 42 struct device_attribute *attr,
42 const char *buf, 43 const char *buf,
43 size_t count) 44 size_t count)
44{ 45{
45 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 46 struct cpu *cpu = container_of(dev, struct cpu, dev);
46 ssize_t ret; 47 ssize_t ret;
47 long snooze; 48 long snooze;
48 49
@@ -50,21 +51,22 @@ static ssize_t store_smt_snooze_delay(struct sys_device *dev,
50 if (ret != 1) 51 if (ret != 1)
51 return -EINVAL; 52 return -EINVAL;
52 53
53 per_cpu(smt_snooze_delay, cpu->sysdev.id) = snooze; 54 per_cpu(smt_snooze_delay, cpu->dev.id) = snooze;
55 update_smt_snooze_delay(snooze);
54 56
55 return count; 57 return count;
56} 58}
57 59
58static ssize_t show_smt_snooze_delay(struct sys_device *dev, 60static ssize_t show_smt_snooze_delay(struct device *dev,
59 struct sysdev_attribute *attr, 61 struct device_attribute *attr,
60 char *buf) 62 char *buf)
61{ 63{
62 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 64 struct cpu *cpu = container_of(dev, struct cpu, dev);
63 65
64 return sprintf(buf, "%ld\n", per_cpu(smt_snooze_delay, cpu->sysdev.id)); 66 return sprintf(buf, "%ld\n", per_cpu(smt_snooze_delay, cpu->dev.id));
65} 67}
66 68
67static SYSDEV_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay, 69static DEVICE_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay,
68 store_smt_snooze_delay); 70 store_smt_snooze_delay);
69 71
70static int __init setup_smt_snooze_delay(char *str) 72static int __init setup_smt_snooze_delay(char *str)
@@ -117,25 +119,25 @@ static void write_##NAME(void *val) \
117 ppc_enable_pmcs(); \ 119 ppc_enable_pmcs(); \
118 mtspr(ADDRESS, *(unsigned long *)val); \ 120 mtspr(ADDRESS, *(unsigned long *)val); \
119} \ 121} \
120static ssize_t show_##NAME(struct sys_device *dev, \ 122static ssize_t show_##NAME(struct device *dev, \
121 struct sysdev_attribute *attr, \ 123 struct device_attribute *attr, \
122 char *buf) \ 124 char *buf) \
123{ \ 125{ \
124 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ 126 struct cpu *cpu = container_of(dev, struct cpu, dev); \
125 unsigned long val; \ 127 unsigned long val; \
126 smp_call_function_single(cpu->sysdev.id, read_##NAME, &val, 1); \ 128 smp_call_function_single(cpu->dev.id, read_##NAME, &val, 1); \
127 return sprintf(buf, "%lx\n", val); \ 129 return sprintf(buf, "%lx\n", val); \
128} \ 130} \
129static ssize_t __used \ 131static ssize_t __used \
130 store_##NAME(struct sys_device *dev, struct sysdev_attribute *attr, \ 132 store_##NAME(struct device *dev, struct device_attribute *attr, \
131 const char *buf, size_t count) \ 133 const char *buf, size_t count) \
132{ \ 134{ \
133 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ 135 struct cpu *cpu = container_of(dev, struct cpu, dev); \
134 unsigned long val; \ 136 unsigned long val; \
135 int ret = sscanf(buf, "%lx", &val); \ 137 int ret = sscanf(buf, "%lx", &val); \
136 if (ret != 1) \ 138 if (ret != 1) \
137 return -EINVAL; \ 139 return -EINVAL; \
138 smp_call_function_single(cpu->sysdev.id, write_##NAME, &val, 1); \ 140 smp_call_function_single(cpu->dev.id, write_##NAME, &val, 1); \
139 return count; \ 141 return count; \
140} 142}
141 143
@@ -177,23 +179,25 @@ SYSFS_PMCSETUP(mmcra, SPRN_MMCRA);
177SYSFS_PMCSETUP(purr, SPRN_PURR); 179SYSFS_PMCSETUP(purr, SPRN_PURR);
178SYSFS_PMCSETUP(spurr, SPRN_SPURR); 180SYSFS_PMCSETUP(spurr, SPRN_SPURR);
179SYSFS_PMCSETUP(dscr, SPRN_DSCR); 181SYSFS_PMCSETUP(dscr, SPRN_DSCR);
182SYSFS_PMCSETUP(pir, SPRN_PIR);
180 183
181static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra); 184static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
182static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL); 185static DEVICE_ATTR(spurr, 0600, show_spurr, NULL);
183static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr); 186static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr);
184static SYSDEV_ATTR(purr, 0600, show_purr, store_purr); 187static DEVICE_ATTR(purr, 0600, show_purr, store_purr);
188static DEVICE_ATTR(pir, 0400, show_pir, NULL);
185 189
186unsigned long dscr_default = 0; 190unsigned long dscr_default = 0;
187EXPORT_SYMBOL(dscr_default); 191EXPORT_SYMBOL(dscr_default);
188 192
189static ssize_t show_dscr_default(struct sysdev_class *class, 193static ssize_t show_dscr_default(struct device *dev,
190 struct sysdev_class_attribute *attr, char *buf) 194 struct device_attribute *attr, char *buf)
191{ 195{
192 return sprintf(buf, "%lx\n", dscr_default); 196 return sprintf(buf, "%lx\n", dscr_default);
193} 197}
194 198
195static ssize_t __used store_dscr_default(struct sysdev_class *class, 199static ssize_t __used store_dscr_default(struct device *dev,
196 struct sysdev_class_attribute *attr, const char *buf, 200 struct device_attribute *attr, const char *buf,
197 size_t count) 201 size_t count)
198{ 202{
199 unsigned long val; 203 unsigned long val;
@@ -207,15 +211,14 @@ static ssize_t __used store_dscr_default(struct sysdev_class *class,
207 return count; 211 return count;
208} 212}
209 213
210static SYSDEV_CLASS_ATTR(dscr_default, 0600, 214static DEVICE_ATTR(dscr_default, 0600,
211 show_dscr_default, store_dscr_default); 215 show_dscr_default, store_dscr_default);
212 216
213static void sysfs_create_dscr_default(void) 217static void sysfs_create_dscr_default(void)
214{ 218{
215 int err = 0; 219 int err = 0;
216 if (cpu_has_feature(CPU_FTR_DSCR)) 220 if (cpu_has_feature(CPU_FTR_DSCR))
217 err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, 221 err = device_create_file(cpu_subsys.dev_root, &dev_attr_dscr_default);
218 &attr_dscr_default.attr);
219} 222}
220#endif /* CONFIG_PPC64 */ 223#endif /* CONFIG_PPC64 */
221 224
@@ -259,72 +262,72 @@ SYSFS_PMCSETUP(tsr3, SPRN_PA6T_TSR3);
259#endif /* HAS_PPC_PMC_PA6T */ 262#endif /* HAS_PPC_PMC_PA6T */
260 263
261#ifdef HAS_PPC_PMC_IBM 264#ifdef HAS_PPC_PMC_IBM
262static struct sysdev_attribute ibm_common_attrs[] = { 265static struct device_attribute ibm_common_attrs[] = {
263 _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), 266 __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
264 _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), 267 __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
265}; 268};
266#endif /* HAS_PPC_PMC_G4 */ 269#endif /* HAS_PPC_PMC_G4 */
267 270
268#ifdef HAS_PPC_PMC_G4 271#ifdef HAS_PPC_PMC_G4
269static struct sysdev_attribute g4_common_attrs[] = { 272static struct device_attribute g4_common_attrs[] = {
270 _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), 273 __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
271 _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), 274 __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
272 _SYSDEV_ATTR(mmcr2, 0600, show_mmcr2, store_mmcr2), 275 __ATTR(mmcr2, 0600, show_mmcr2, store_mmcr2),
273}; 276};
274#endif /* HAS_PPC_PMC_G4 */ 277#endif /* HAS_PPC_PMC_G4 */
275 278
276static struct sysdev_attribute classic_pmc_attrs[] = { 279static struct device_attribute classic_pmc_attrs[] = {
277 _SYSDEV_ATTR(pmc1, 0600, show_pmc1, store_pmc1), 280 __ATTR(pmc1, 0600, show_pmc1, store_pmc1),
278 _SYSDEV_ATTR(pmc2, 0600, show_pmc2, store_pmc2), 281 __ATTR(pmc2, 0600, show_pmc2, store_pmc2),
279 _SYSDEV_ATTR(pmc3, 0600, show_pmc3, store_pmc3), 282 __ATTR(pmc3, 0600, show_pmc3, store_pmc3),
280 _SYSDEV_ATTR(pmc4, 0600, show_pmc4, store_pmc4), 283 __ATTR(pmc4, 0600, show_pmc4, store_pmc4),
281 _SYSDEV_ATTR(pmc5, 0600, show_pmc5, store_pmc5), 284 __ATTR(pmc5, 0600, show_pmc5, store_pmc5),
282 _SYSDEV_ATTR(pmc6, 0600, show_pmc6, store_pmc6), 285 __ATTR(pmc6, 0600, show_pmc6, store_pmc6),
283#ifdef CONFIG_PPC64 286#ifdef CONFIG_PPC64
284 _SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7), 287 __ATTR(pmc7, 0600, show_pmc7, store_pmc7),
285 _SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8), 288 __ATTR(pmc8, 0600, show_pmc8, store_pmc8),
286#endif 289#endif
287}; 290};
288 291
289#ifdef HAS_PPC_PMC_PA6T 292#ifdef HAS_PPC_PMC_PA6T
290static struct sysdev_attribute pa6t_attrs[] = { 293static struct device_attribute pa6t_attrs[] = {
291 _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), 294 __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
292 _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), 295 __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
293 _SYSDEV_ATTR(pmc0, 0600, show_pa6t_pmc0, store_pa6t_pmc0), 296 __ATTR(pmc0, 0600, show_pa6t_pmc0, store_pa6t_pmc0),
294 _SYSDEV_ATTR(pmc1, 0600, show_pa6t_pmc1, store_pa6t_pmc1), 297 __ATTR(pmc1, 0600, show_pa6t_pmc1, store_pa6t_pmc1),
295 _SYSDEV_ATTR(pmc2, 0600, show_pa6t_pmc2, store_pa6t_pmc2), 298 __ATTR(pmc2, 0600, show_pa6t_pmc2, store_pa6t_pmc2),
296 _SYSDEV_ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3), 299 __ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3),
297 _SYSDEV_ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4), 300 __ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4),
298 _SYSDEV_ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5), 301 __ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5),
299#ifdef CONFIG_DEBUG_KERNEL 302#ifdef CONFIG_DEBUG_KERNEL
300 _SYSDEV_ATTR(hid0, 0600, show_hid0, store_hid0), 303 __ATTR(hid0, 0600, show_hid0, store_hid0),
301 _SYSDEV_ATTR(hid1, 0600, show_hid1, store_hid1), 304 __ATTR(hid1, 0600, show_hid1, store_hid1),
302 _SYSDEV_ATTR(hid4, 0600, show_hid4, store_hid4), 305 __ATTR(hid4, 0600, show_hid4, store_hid4),
303 _SYSDEV_ATTR(hid5, 0600, show_hid5, store_hid5), 306 __ATTR(hid5, 0600, show_hid5, store_hid5),
304 _SYSDEV_ATTR(ima0, 0600, show_ima0, store_ima0), 307 __ATTR(ima0, 0600, show_ima0, store_ima0),
305 _SYSDEV_ATTR(ima1, 0600, show_ima1, store_ima1), 308 __ATTR(ima1, 0600, show_ima1, store_ima1),
306 _SYSDEV_ATTR(ima2, 0600, show_ima2, store_ima2), 309 __ATTR(ima2, 0600, show_ima2, store_ima2),
307 _SYSDEV_ATTR(ima3, 0600, show_ima3, store_ima3), 310 __ATTR(ima3, 0600, show_ima3, store_ima3),
308 _SYSDEV_ATTR(ima4, 0600, show_ima4, store_ima4), 311 __ATTR(ima4, 0600, show_ima4, store_ima4),
309 _SYSDEV_ATTR(ima5, 0600, show_ima5, store_ima5), 312 __ATTR(ima5, 0600, show_ima5, store_ima5),
310 _SYSDEV_ATTR(ima6, 0600, show_ima6, store_ima6), 313 __ATTR(ima6, 0600, show_ima6, store_ima6),
311 _SYSDEV_ATTR(ima7, 0600, show_ima7, store_ima7), 314 __ATTR(ima7, 0600, show_ima7, store_ima7),
312 _SYSDEV_ATTR(ima8, 0600, show_ima8, store_ima8), 315 __ATTR(ima8, 0600, show_ima8, store_ima8),
313 _SYSDEV_ATTR(ima9, 0600, show_ima9, store_ima9), 316 __ATTR(ima9, 0600, show_ima9, store_ima9),
314 _SYSDEV_ATTR(imaat, 0600, show_imaat, store_imaat), 317 __ATTR(imaat, 0600, show_imaat, store_imaat),
315 _SYSDEV_ATTR(btcr, 0600, show_btcr, store_btcr), 318 __ATTR(btcr, 0600, show_btcr, store_btcr),
316 _SYSDEV_ATTR(pccr, 0600, show_pccr, store_pccr), 319 __ATTR(pccr, 0600, show_pccr, store_pccr),
317 _SYSDEV_ATTR(rpccr, 0600, show_rpccr, store_rpccr), 320 __ATTR(rpccr, 0600, show_rpccr, store_rpccr),
318 _SYSDEV_ATTR(der, 0600, show_der, store_der), 321 __ATTR(der, 0600, show_der, store_der),
319 _SYSDEV_ATTR(mer, 0600, show_mer, store_mer), 322 __ATTR(mer, 0600, show_mer, store_mer),
320 _SYSDEV_ATTR(ber, 0600, show_ber, store_ber), 323 __ATTR(ber, 0600, show_ber, store_ber),
321 _SYSDEV_ATTR(ier, 0600, show_ier, store_ier), 324 __ATTR(ier, 0600, show_ier, store_ier),
322 _SYSDEV_ATTR(sier, 0600, show_sier, store_sier), 325 __ATTR(sier, 0600, show_sier, store_sier),
323 _SYSDEV_ATTR(siar, 0600, show_siar, store_siar), 326 __ATTR(siar, 0600, show_siar, store_siar),
324 _SYSDEV_ATTR(tsr0, 0600, show_tsr0, store_tsr0), 327 __ATTR(tsr0, 0600, show_tsr0, store_tsr0),
325 _SYSDEV_ATTR(tsr1, 0600, show_tsr1, store_tsr1), 328 __ATTR(tsr1, 0600, show_tsr1, store_tsr1),
326 _SYSDEV_ATTR(tsr2, 0600, show_tsr2, store_tsr2), 329 __ATTR(tsr2, 0600, show_tsr2, store_tsr2),
327 _SYSDEV_ATTR(tsr3, 0600, show_tsr3, store_tsr3), 330 __ATTR(tsr3, 0600, show_tsr3, store_tsr3),
328#endif /* CONFIG_DEBUG_KERNEL */ 331#endif /* CONFIG_DEBUG_KERNEL */
329}; 332};
330#endif /* HAS_PPC_PMC_PA6T */ 333#endif /* HAS_PPC_PMC_PA6T */
@@ -333,14 +336,14 @@ static struct sysdev_attribute pa6t_attrs[] = {
333static void __cpuinit register_cpu_online(unsigned int cpu) 336static void __cpuinit register_cpu_online(unsigned int cpu)
334{ 337{
335 struct cpu *c = &per_cpu(cpu_devices, cpu); 338 struct cpu *c = &per_cpu(cpu_devices, cpu);
336 struct sys_device *s = &c->sysdev; 339 struct device *s = &c->dev;
337 struct sysdev_attribute *attrs, *pmc_attrs; 340 struct device_attribute *attrs, *pmc_attrs;
338 int i, nattrs; 341 int i, nattrs;
339 342
340#ifdef CONFIG_PPC64 343#ifdef CONFIG_PPC64
341 if (!firmware_has_feature(FW_FEATURE_ISERIES) && 344 if (!firmware_has_feature(FW_FEATURE_ISERIES) &&
342 cpu_has_feature(CPU_FTR_SMT)) 345 cpu_has_feature(CPU_FTR_SMT))
343 sysdev_create_file(s, &attr_smt_snooze_delay); 346 device_create_file(s, &dev_attr_smt_snooze_delay);
344#endif 347#endif
345 348
346 /* PMC stuff */ 349 /* PMC stuff */
@@ -348,14 +351,14 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
348#ifdef HAS_PPC_PMC_IBM 351#ifdef HAS_PPC_PMC_IBM
349 case PPC_PMC_IBM: 352 case PPC_PMC_IBM:
350 attrs = ibm_common_attrs; 353 attrs = ibm_common_attrs;
351 nattrs = sizeof(ibm_common_attrs) / sizeof(struct sysdev_attribute); 354 nattrs = sizeof(ibm_common_attrs) / sizeof(struct device_attribute);
352 pmc_attrs = classic_pmc_attrs; 355 pmc_attrs = classic_pmc_attrs;
353 break; 356 break;
354#endif /* HAS_PPC_PMC_IBM */ 357#endif /* HAS_PPC_PMC_IBM */
355#ifdef HAS_PPC_PMC_G4 358#ifdef HAS_PPC_PMC_G4
356 case PPC_PMC_G4: 359 case PPC_PMC_G4:
357 attrs = g4_common_attrs; 360 attrs = g4_common_attrs;
358 nattrs = sizeof(g4_common_attrs) / sizeof(struct sysdev_attribute); 361 nattrs = sizeof(g4_common_attrs) / sizeof(struct device_attribute);
359 pmc_attrs = classic_pmc_attrs; 362 pmc_attrs = classic_pmc_attrs;
360 break; 363 break;
361#endif /* HAS_PPC_PMC_G4 */ 364#endif /* HAS_PPC_PMC_G4 */
@@ -363,7 +366,7 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
363 case PPC_PMC_PA6T: 366 case PPC_PMC_PA6T:
364 /* PA Semi starts counting at PMC0 */ 367 /* PA Semi starts counting at PMC0 */
365 attrs = pa6t_attrs; 368 attrs = pa6t_attrs;
366 nattrs = sizeof(pa6t_attrs) / sizeof(struct sysdev_attribute); 369 nattrs = sizeof(pa6t_attrs) / sizeof(struct device_attribute);
367 pmc_attrs = NULL; 370 pmc_attrs = NULL;
368 break; 371 break;
369#endif /* HAS_PPC_PMC_PA6T */ 372#endif /* HAS_PPC_PMC_PA6T */
@@ -374,24 +377,27 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
374 } 377 }
375 378
376 for (i = 0; i < nattrs; i++) 379 for (i = 0; i < nattrs; i++)
377 sysdev_create_file(s, &attrs[i]); 380 device_create_file(s, &attrs[i]);
378 381
379 if (pmc_attrs) 382 if (pmc_attrs)
380 for (i = 0; i < cur_cpu_spec->num_pmcs; i++) 383 for (i = 0; i < cur_cpu_spec->num_pmcs; i++)
381 sysdev_create_file(s, &pmc_attrs[i]); 384 device_create_file(s, &pmc_attrs[i]);
382 385
383#ifdef CONFIG_PPC64 386#ifdef CONFIG_PPC64
384 if (cpu_has_feature(CPU_FTR_MMCRA)) 387 if (cpu_has_feature(CPU_FTR_MMCRA))
385 sysdev_create_file(s, &attr_mmcra); 388 device_create_file(s, &dev_attr_mmcra);
386 389
387 if (cpu_has_feature(CPU_FTR_PURR)) 390 if (cpu_has_feature(CPU_FTR_PURR))
388 sysdev_create_file(s, &attr_purr); 391 device_create_file(s, &dev_attr_purr);
389 392
390 if (cpu_has_feature(CPU_FTR_SPURR)) 393 if (cpu_has_feature(CPU_FTR_SPURR))
391 sysdev_create_file(s, &attr_spurr); 394 device_create_file(s, &dev_attr_spurr);
392 395
393 if (cpu_has_feature(CPU_FTR_DSCR)) 396 if (cpu_has_feature(CPU_FTR_DSCR))
394 sysdev_create_file(s, &attr_dscr); 397 device_create_file(s, &dev_attr_dscr);
398
399 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
400 device_create_file(s, &dev_attr_pir);
395#endif /* CONFIG_PPC64 */ 401#endif /* CONFIG_PPC64 */
396 402
397 cacheinfo_cpu_online(cpu); 403 cacheinfo_cpu_online(cpu);
@@ -401,8 +407,8 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
401static void unregister_cpu_online(unsigned int cpu) 407static void unregister_cpu_online(unsigned int cpu)
402{ 408{
403 struct cpu *c = &per_cpu(cpu_devices, cpu); 409 struct cpu *c = &per_cpu(cpu_devices, cpu);
404 struct sys_device *s = &c->sysdev; 410 struct device *s = &c->dev;
405 struct sysdev_attribute *attrs, *pmc_attrs; 411 struct device_attribute *attrs, *pmc_attrs;
406 int i, nattrs; 412 int i, nattrs;
407 413
408 BUG_ON(!c->hotpluggable); 414 BUG_ON(!c->hotpluggable);
@@ -410,7 +416,7 @@ static void unregister_cpu_online(unsigned int cpu)
410#ifdef CONFIG_PPC64 416#ifdef CONFIG_PPC64
411 if (!firmware_has_feature(FW_FEATURE_ISERIES) && 417 if (!firmware_has_feature(FW_FEATURE_ISERIES) &&
412 cpu_has_feature(CPU_FTR_SMT)) 418 cpu_has_feature(CPU_FTR_SMT))
413 sysdev_remove_file(s, &attr_smt_snooze_delay); 419 device_remove_file(s, &dev_attr_smt_snooze_delay);
414#endif 420#endif
415 421
416 /* PMC stuff */ 422 /* PMC stuff */
@@ -418,14 +424,14 @@ static void unregister_cpu_online(unsigned int cpu)
418#ifdef HAS_PPC_PMC_IBM 424#ifdef HAS_PPC_PMC_IBM
419 case PPC_PMC_IBM: 425 case PPC_PMC_IBM:
420 attrs = ibm_common_attrs; 426 attrs = ibm_common_attrs;
421 nattrs = sizeof(ibm_common_attrs) / sizeof(struct sysdev_attribute); 427 nattrs = sizeof(ibm_common_attrs) / sizeof(struct device_attribute);
422 pmc_attrs = classic_pmc_attrs; 428 pmc_attrs = classic_pmc_attrs;
423 break; 429 break;
424#endif /* HAS_PPC_PMC_IBM */ 430#endif /* HAS_PPC_PMC_IBM */
425#ifdef HAS_PPC_PMC_G4 431#ifdef HAS_PPC_PMC_G4
426 case PPC_PMC_G4: 432 case PPC_PMC_G4:
427 attrs = g4_common_attrs; 433 attrs = g4_common_attrs;
428 nattrs = sizeof(g4_common_attrs) / sizeof(struct sysdev_attribute); 434 nattrs = sizeof(g4_common_attrs) / sizeof(struct device_attribute);
429 pmc_attrs = classic_pmc_attrs; 435 pmc_attrs = classic_pmc_attrs;
430 break; 436 break;
431#endif /* HAS_PPC_PMC_G4 */ 437#endif /* HAS_PPC_PMC_G4 */
@@ -433,7 +439,7 @@ static void unregister_cpu_online(unsigned int cpu)
433 case PPC_PMC_PA6T: 439 case PPC_PMC_PA6T:
434 /* PA Semi starts counting at PMC0 */ 440 /* PA Semi starts counting at PMC0 */
435 attrs = pa6t_attrs; 441 attrs = pa6t_attrs;
436 nattrs = sizeof(pa6t_attrs) / sizeof(struct sysdev_attribute); 442 nattrs = sizeof(pa6t_attrs) / sizeof(struct device_attribute);
437 pmc_attrs = NULL; 443 pmc_attrs = NULL;
438 break; 444 break;
439#endif /* HAS_PPC_PMC_PA6T */ 445#endif /* HAS_PPC_PMC_PA6T */
@@ -444,24 +450,27 @@ static void unregister_cpu_online(unsigned int cpu)
444 } 450 }
445 451
446 for (i = 0; i < nattrs; i++) 452 for (i = 0; i < nattrs; i++)
447 sysdev_remove_file(s, &attrs[i]); 453 device_remove_file(s, &attrs[i]);
448 454
449 if (pmc_attrs) 455 if (pmc_attrs)
450 for (i = 0; i < cur_cpu_spec->num_pmcs; i++) 456 for (i = 0; i < cur_cpu_spec->num_pmcs; i++)
451 sysdev_remove_file(s, &pmc_attrs[i]); 457 device_remove_file(s, &pmc_attrs[i]);
452 458
453#ifdef CONFIG_PPC64 459#ifdef CONFIG_PPC64
454 if (cpu_has_feature(CPU_FTR_MMCRA)) 460 if (cpu_has_feature(CPU_FTR_MMCRA))
455 sysdev_remove_file(s, &attr_mmcra); 461 device_remove_file(s, &dev_attr_mmcra);
456 462
457 if (cpu_has_feature(CPU_FTR_PURR)) 463 if (cpu_has_feature(CPU_FTR_PURR))
458 sysdev_remove_file(s, &attr_purr); 464 device_remove_file(s, &dev_attr_purr);
459 465
460 if (cpu_has_feature(CPU_FTR_SPURR)) 466 if (cpu_has_feature(CPU_FTR_SPURR))
461 sysdev_remove_file(s, &attr_spurr); 467 device_remove_file(s, &dev_attr_spurr);
462 468
463 if (cpu_has_feature(CPU_FTR_DSCR)) 469 if (cpu_has_feature(CPU_FTR_DSCR))
464 sysdev_remove_file(s, &attr_dscr); 470 device_remove_file(s, &dev_attr_dscr);
471
472 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
473 device_remove_file(s, &dev_attr_pir);
465#endif /* CONFIG_PPC64 */ 474#endif /* CONFIG_PPC64 */
466 475
467 cacheinfo_cpu_offline(cpu); 476 cacheinfo_cpu_offline(cpu);
@@ -513,70 +522,70 @@ static struct notifier_block __cpuinitdata sysfs_cpu_nb = {
513 522
514static DEFINE_MUTEX(cpu_mutex); 523static DEFINE_MUTEX(cpu_mutex);
515 524
516int cpu_add_sysdev_attr(struct sysdev_attribute *attr) 525int cpu_add_dev_attr(struct device_attribute *attr)
517{ 526{
518 int cpu; 527 int cpu;
519 528
520 mutex_lock(&cpu_mutex); 529 mutex_lock(&cpu_mutex);
521 530
522 for_each_possible_cpu(cpu) { 531 for_each_possible_cpu(cpu) {
523 sysdev_create_file(get_cpu_sysdev(cpu), attr); 532 device_create_file(get_cpu_device(cpu), attr);
524 } 533 }
525 534
526 mutex_unlock(&cpu_mutex); 535 mutex_unlock(&cpu_mutex);
527 return 0; 536 return 0;
528} 537}
529EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr); 538EXPORT_SYMBOL_GPL(cpu_add_dev_attr);
530 539
531int cpu_add_sysdev_attr_group(struct attribute_group *attrs) 540int cpu_add_dev_attr_group(struct attribute_group *attrs)
532{ 541{
533 int cpu; 542 int cpu;
534 struct sys_device *sysdev; 543 struct device *dev;
535 int ret; 544 int ret;
536 545
537 mutex_lock(&cpu_mutex); 546 mutex_lock(&cpu_mutex);
538 547
539 for_each_possible_cpu(cpu) { 548 for_each_possible_cpu(cpu) {
540 sysdev = get_cpu_sysdev(cpu); 549 dev = get_cpu_device(cpu);
541 ret = sysfs_create_group(&sysdev->kobj, attrs); 550 ret = sysfs_create_group(&dev->kobj, attrs);
542 WARN_ON(ret != 0); 551 WARN_ON(ret != 0);
543 } 552 }
544 553
545 mutex_unlock(&cpu_mutex); 554 mutex_unlock(&cpu_mutex);
546 return 0; 555 return 0;
547} 556}
548EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr_group); 557EXPORT_SYMBOL_GPL(cpu_add_dev_attr_group);
549 558
550 559
551void cpu_remove_sysdev_attr(struct sysdev_attribute *attr) 560void cpu_remove_dev_attr(struct device_attribute *attr)
552{ 561{
553 int cpu; 562 int cpu;
554 563
555 mutex_lock(&cpu_mutex); 564 mutex_lock(&cpu_mutex);
556 565
557 for_each_possible_cpu(cpu) { 566 for_each_possible_cpu(cpu) {
558 sysdev_remove_file(get_cpu_sysdev(cpu), attr); 567 device_remove_file(get_cpu_device(cpu), attr);
559 } 568 }
560 569
561 mutex_unlock(&cpu_mutex); 570 mutex_unlock(&cpu_mutex);
562} 571}
563EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr); 572EXPORT_SYMBOL_GPL(cpu_remove_dev_attr);
564 573
565void cpu_remove_sysdev_attr_group(struct attribute_group *attrs) 574void cpu_remove_dev_attr_group(struct attribute_group *attrs)
566{ 575{
567 int cpu; 576 int cpu;
568 struct sys_device *sysdev; 577 struct device *dev;
569 578
570 mutex_lock(&cpu_mutex); 579 mutex_lock(&cpu_mutex);
571 580
572 for_each_possible_cpu(cpu) { 581 for_each_possible_cpu(cpu) {
573 sysdev = get_cpu_sysdev(cpu); 582 dev = get_cpu_device(cpu);
574 sysfs_remove_group(&sysdev->kobj, attrs); 583 sysfs_remove_group(&dev->kobj, attrs);
575 } 584 }
576 585
577 mutex_unlock(&cpu_mutex); 586 mutex_unlock(&cpu_mutex);
578} 587}
579EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr_group); 588EXPORT_SYMBOL_GPL(cpu_remove_dev_attr_group);
580 589
581 590
582/* NUMA stuff */ 591/* NUMA stuff */
@@ -590,18 +599,18 @@ static void register_nodes(void)
590 register_one_node(i); 599 register_one_node(i);
591} 600}
592 601
593int sysfs_add_device_to_node(struct sys_device *dev, int nid) 602int sysfs_add_device_to_node(struct device *dev, int nid)
594{ 603{
595 struct node *node = &node_devices[nid]; 604 struct node *node = &node_devices[nid];
596 return sysfs_create_link(&node->sysdev.kobj, &dev->kobj, 605 return sysfs_create_link(&node->dev.kobj, &dev->kobj,
597 kobject_name(&dev->kobj)); 606 kobject_name(&dev->kobj));
598} 607}
599EXPORT_SYMBOL_GPL(sysfs_add_device_to_node); 608EXPORT_SYMBOL_GPL(sysfs_add_device_to_node);
600 609
601void sysfs_remove_device_from_node(struct sys_device *dev, int nid) 610void sysfs_remove_device_from_node(struct device *dev, int nid)
602{ 611{
603 struct node *node = &node_devices[nid]; 612 struct node *node = &node_devices[nid];
604 sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj)); 613 sysfs_remove_link(&node->dev.kobj, kobject_name(&dev->kobj));
605} 614}
606EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node); 615EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node);
607 616
@@ -614,14 +623,14 @@ static void register_nodes(void)
614#endif 623#endif
615 624
616/* Only valid if CPU is present. */ 625/* Only valid if CPU is present. */
617static ssize_t show_physical_id(struct sys_device *dev, 626static ssize_t show_physical_id(struct device *dev,
618 struct sysdev_attribute *attr, char *buf) 627 struct device_attribute *attr, char *buf)
619{ 628{
620 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 629 struct cpu *cpu = container_of(dev, struct cpu, dev);
621 630
622 return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->sysdev.id)); 631 return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->dev.id));
623} 632}
624static SYSDEV_ATTR(physical_id, 0444, show_physical_id, NULL); 633static DEVICE_ATTR(physical_id, 0444, show_physical_id, NULL);
625 634
626static int __init topology_init(void) 635static int __init topology_init(void)
627{ 636{
@@ -646,7 +655,7 @@ static int __init topology_init(void)
646 if (cpu_online(cpu) || c->hotpluggable) { 655 if (cpu_online(cpu) || c->hotpluggable) {
647 register_cpu(c, cpu); 656 register_cpu(c, cpu);
648 657
649 sysdev_create_file(&c->sysdev, &attr_physical_id); 658 device_create_file(&c->dev, &dev_attr_physical_id);
650 } 659 }
651 660
652 if (cpu_online(cpu)) 661 if (cpu_online(cpu))
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 522bb1dfc353..567dd7c3ac2a 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -86,8 +86,6 @@ static struct clocksource clocksource_rtc = {
86 .rating = 400, 86 .rating = 400,
87 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 87 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
88 .mask = CLOCKSOURCE_MASK(64), 88 .mask = CLOCKSOURCE_MASK(64),
89 .shift = 22,
90 .mult = 0, /* To be filled in */
91 .read = rtc_read, 89 .read = rtc_read,
92}; 90};
93 91
@@ -97,8 +95,6 @@ static struct clocksource clocksource_timebase = {
97 .rating = 400, 95 .rating = 400,
98 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 96 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
99 .mask = CLOCKSOURCE_MASK(64), 97 .mask = CLOCKSOURCE_MASK(64),
100 .shift = 22,
101 .mult = 0, /* To be filled in */
102 .read = timebase_read, 98 .read = timebase_read,
103}; 99};
104 100
@@ -110,22 +106,16 @@ static void decrementer_set_mode(enum clock_event_mode mode,
110 struct clock_event_device *dev); 106 struct clock_event_device *dev);
111 107
112static struct clock_event_device decrementer_clockevent = { 108static struct clock_event_device decrementer_clockevent = {
113 .name = "decrementer", 109 .name = "decrementer",
114 .rating = 200, 110 .rating = 200,
115 .shift = 0, /* To be filled in */ 111 .irq = 0,
116 .mult = 0, /* To be filled in */ 112 .set_next_event = decrementer_set_next_event,
117 .irq = 0, 113 .set_mode = decrementer_set_mode,
118 .set_next_event = decrementer_set_next_event, 114 .features = CLOCK_EVT_FEAT_ONESHOT,
119 .set_mode = decrementer_set_mode,
120 .features = CLOCK_EVT_FEAT_ONESHOT,
121}; 115};
122 116
123struct decrementer_clock { 117DEFINE_PER_CPU(u64, decrementers_next_tb);
124 struct clock_event_device event; 118static DEFINE_PER_CPU(struct clock_event_device, decrementers);
125 u64 next_tb;
126};
127
128static DEFINE_PER_CPU(struct decrementer_clock, decrementers);
129 119
130#ifdef CONFIG_PPC_ISERIES 120#ifdef CONFIG_PPC_ISERIES
131static unsigned long __initdata iSeries_recal_titan; 121static unsigned long __initdata iSeries_recal_titan;
@@ -168,13 +158,13 @@ EXPORT_SYMBOL_GPL(ppc_tb_freq);
168#ifdef CONFIG_VIRT_CPU_ACCOUNTING 158#ifdef CONFIG_VIRT_CPU_ACCOUNTING
169/* 159/*
170 * Factors for converting from cputime_t (timebase ticks) to 160 * Factors for converting from cputime_t (timebase ticks) to
171 * jiffies, milliseconds, seconds, and clock_t (1/USER_HZ seconds). 161 * jiffies, microseconds, seconds, and clock_t (1/USER_HZ seconds).
172 * These are all stored as 0.64 fixed-point binary fractions. 162 * These are all stored as 0.64 fixed-point binary fractions.
173 */ 163 */
174u64 __cputime_jiffies_factor; 164u64 __cputime_jiffies_factor;
175EXPORT_SYMBOL(__cputime_jiffies_factor); 165EXPORT_SYMBOL(__cputime_jiffies_factor);
176u64 __cputime_msec_factor; 166u64 __cputime_usec_factor;
177EXPORT_SYMBOL(__cputime_msec_factor); 167EXPORT_SYMBOL(__cputime_usec_factor);
178u64 __cputime_sec_factor; 168u64 __cputime_sec_factor;
179EXPORT_SYMBOL(__cputime_sec_factor); 169EXPORT_SYMBOL(__cputime_sec_factor);
180u64 __cputime_clockt_factor; 170u64 __cputime_clockt_factor;
@@ -192,8 +182,8 @@ static void calc_cputime_factors(void)
192 182
193 div128_by_32(HZ, 0, tb_ticks_per_sec, &res); 183 div128_by_32(HZ, 0, tb_ticks_per_sec, &res);
194 __cputime_jiffies_factor = res.result_low; 184 __cputime_jiffies_factor = res.result_low;
195 div128_by_32(1000, 0, tb_ticks_per_sec, &res); 185 div128_by_32(1000000, 0, tb_ticks_per_sec, &res);
196 __cputime_msec_factor = res.result_low; 186 __cputime_usec_factor = res.result_low;
197 div128_by_32(1, 0, tb_ticks_per_sec, &res); 187 div128_by_32(1, 0, tb_ticks_per_sec, &res);
198 __cputime_sec_factor = res.result_low; 188 __cputime_sec_factor = res.result_low;
199 div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res); 189 div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res);
@@ -441,7 +431,7 @@ EXPORT_SYMBOL(profile_pc);
441/* 431/*
442 * This function recalibrates the timebase based on the 49-bit time-of-day 432 * This function recalibrates the timebase based on the 49-bit time-of-day
443 * value in the Titan chip. The Titan is much more accurate than the value 433 * value in the Titan chip. The Titan is much more accurate than the value
444 * returned by the service processor for the timebase frequency. 434 * returned by the service processor for the timebase frequency.
445 */ 435 */
446 436
447static int __init iSeries_tb_recal(void) 437static int __init iSeries_tb_recal(void)
@@ -576,9 +566,8 @@ void arch_irq_work_raise(void)
576void timer_interrupt(struct pt_regs * regs) 566void timer_interrupt(struct pt_regs * regs)
577{ 567{
578 struct pt_regs *old_regs; 568 struct pt_regs *old_regs;
579 struct decrementer_clock *decrementer = &__get_cpu_var(decrementers); 569 u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
580 struct clock_event_device *evt = &decrementer->event; 570 struct clock_event_device *evt = &__get_cpu_var(decrementers);
581 u64 now;
582 571
583 /* Ensure a positive value is written to the decrementer, or else 572 /* Ensure a positive value is written to the decrementer, or else
584 * some CPUs will continue to take decrementer exceptions. 573 * some CPUs will continue to take decrementer exceptions.
@@ -613,16 +602,9 @@ void timer_interrupt(struct pt_regs * regs)
613 get_lppaca()->int_dword.fields.decr_int = 0; 602 get_lppaca()->int_dword.fields.decr_int = 0;
614#endif 603#endif
615 604
616 now = get_tb_or_rtc(); 605 *next_tb = ~(u64)0;
617 if (now >= decrementer->next_tb) { 606 if (evt->event_handler)
618 decrementer->next_tb = ~(u64)0; 607 evt->event_handler(evt);
619 if (evt->event_handler)
620 evt->event_handler(evt);
621 } else {
622 now = decrementer->next_tb - now;
623 if (now <= DECREMENTER_MAX)
624 set_dec((int)now);
625 }
626 608
627#ifdef CONFIG_PPC_ISERIES 609#ifdef CONFIG_PPC_ISERIES
628 if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending()) 610 if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())
@@ -650,9 +632,9 @@ static void generic_suspend_disable_irqs(void)
650 * with suspending. 632 * with suspending.
651 */ 633 */
652 634
653 set_dec(0x7fffffff); 635 set_dec(DECREMENTER_MAX);
654 local_irq_disable(); 636 local_irq_disable();
655 set_dec(0x7fffffff); 637 set_dec(DECREMENTER_MAX);
656} 638}
657 639
658static void generic_suspend_enable_irqs(void) 640static void generic_suspend_enable_irqs(void)
@@ -824,9 +806,8 @@ void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
824 ++vdso_data->tb_update_count; 806 ++vdso_data->tb_update_count;
825 smp_mb(); 807 smp_mb();
826 808
827 /* XXX this assumes clock->shift == 22 */ 809 /* 19342813113834067 ~= 2^(20+64) / 1e9 */
828 /* 4611686018 ~= 2^(20+64-22) / 1e9 */ 810 new_tb_to_xs = (u64) mult * (19342813113834067ULL >> clock->shift);
829 new_tb_to_xs = (u64) mult * 4611686018ULL;
830 new_stamp_xsec = (u64) wall_time->tv_nsec * XSEC_PER_SEC; 811 new_stamp_xsec = (u64) wall_time->tv_nsec * XSEC_PER_SEC;
831 do_div(new_stamp_xsec, 1000000000); 812 do_div(new_stamp_xsec, 1000000000);
832 new_stamp_xsec += (u64) wall_time->tv_sec * XSEC_PER_SEC; 813 new_stamp_xsec += (u64) wall_time->tv_sec * XSEC_PER_SEC;
@@ -877,9 +858,7 @@ static void __init clocksource_init(void)
877 else 858 else
878 clock = &clocksource_timebase; 859 clock = &clocksource_timebase;
879 860
880 clock->mult = clocksource_hz2mult(tb_ticks_per_sec, clock->shift); 861 if (clocksource_register_hz(clock, tb_ticks_per_sec)) {
881
882 if (clocksource_register(clock)) {
883 printk(KERN_ERR "clocksource: %s is already registered\n", 862 printk(KERN_ERR "clocksource: %s is already registered\n",
884 clock->name); 863 clock->name);
885 return; 864 return;
@@ -892,7 +871,7 @@ static void __init clocksource_init(void)
892static int decrementer_set_next_event(unsigned long evt, 871static int decrementer_set_next_event(unsigned long evt,
893 struct clock_event_device *dev) 872 struct clock_event_device *dev)
894{ 873{
895 __get_cpu_var(decrementers).next_tb = get_tb_or_rtc() + evt; 874 __get_cpu_var(decrementers_next_tb) = get_tb_or_rtc() + evt;
896 set_dec(evt); 875 set_dec(evt);
897 return 0; 876 return 0;
898} 877}
@@ -904,34 +883,9 @@ static void decrementer_set_mode(enum clock_event_mode mode,
904 decrementer_set_next_event(DECREMENTER_MAX, dev); 883 decrementer_set_next_event(DECREMENTER_MAX, dev);
905} 884}
906 885
907static inline uint64_t div_sc64(unsigned long ticks, unsigned long nsec,
908 int shift)
909{
910 uint64_t tmp = ((uint64_t)ticks) << shift;
911
912 do_div(tmp, nsec);
913 return tmp;
914}
915
916static void __init setup_clockevent_multiplier(unsigned long hz)
917{
918 u64 mult, shift = 32;
919
920 while (1) {
921 mult = div_sc64(hz, NSEC_PER_SEC, shift);
922 if (mult && (mult >> 32UL) == 0UL)
923 break;
924
925 shift--;
926 }
927
928 decrementer_clockevent.shift = shift;
929 decrementer_clockevent.mult = mult;
930}
931
932static void register_decrementer_clockevent(int cpu) 886static void register_decrementer_clockevent(int cpu)
933{ 887{
934 struct clock_event_device *dec = &per_cpu(decrementers, cpu).event; 888 struct clock_event_device *dec = &per_cpu(decrementers, cpu);
935 889
936 *dec = decrementer_clockevent; 890 *dec = decrementer_clockevent;
937 dec->cpumask = cpumask_of(cpu); 891 dec->cpumask = cpumask_of(cpu);
@@ -946,7 +900,8 @@ static void __init init_decrementer_clockevent(void)
946{ 900{
947 int cpu = smp_processor_id(); 901 int cpu = smp_processor_id();
948 902
949 setup_clockevent_multiplier(ppc_tb_freq); 903 clockevents_calc_mult_shift(&decrementer_clockevent, ppc_tb_freq, 4);
904
950 decrementer_clockevent.max_delta_ns = 905 decrementer_clockevent.max_delta_ns =
951 clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent); 906 clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
952 decrementer_clockevent.min_delta_ns = 907 decrementer_clockevent.min_delta_ns =
@@ -1014,10 +969,10 @@ void __init time_init(void)
1014 boot_tb = get_tb_or_rtc(); 969 boot_tb = get_tb_or_rtc();
1015 970
1016 /* If platform provided a timezone (pmac), we correct the time */ 971 /* If platform provided a timezone (pmac), we correct the time */
1017 if (timezone_offset) { 972 if (timezone_offset) {
1018 sys_tz.tz_minuteswest = -timezone_offset / 60; 973 sys_tz.tz_minuteswest = -timezone_offset / 60;
1019 sys_tz.tz_dsttime = 0; 974 sys_tz.tz_dsttime = 0;
1020 } 975 }
1021 976
1022 vdso_data->tb_update_count = 0; 977 vdso_data->tb_update_count = 0;
1023 vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; 978 vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 4e5908264d1a..c091527efd89 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -98,18 +98,14 @@ static void pmac_backlight_unblank(void)
98static inline void pmac_backlight_unblank(void) { } 98static inline void pmac_backlight_unblank(void) { }
99#endif 99#endif
100 100
101int die(const char *str, struct pt_regs *regs, long err) 101static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
102static int die_owner = -1;
103static unsigned int die_nest_count;
104static int die_counter;
105
106static unsigned __kprobes long oops_begin(struct pt_regs *regs)
102{ 107{
103 static struct { 108 int cpu;
104 raw_spinlock_t lock;
105 u32 lock_owner;
106 int lock_owner_depth;
107 } die = {
108 .lock = __RAW_SPIN_LOCK_UNLOCKED(die.lock),
109 .lock_owner = -1,
110 .lock_owner_depth = 0
111 };
112 static int die_counter;
113 unsigned long flags; 109 unsigned long flags;
114 110
115 if (debugger(regs)) 111 if (debugger(regs))
@@ -117,66 +113,109 @@ int die(const char *str, struct pt_regs *regs, long err)
117 113
118 oops_enter(); 114 oops_enter();
119 115
120 if (die.lock_owner != raw_smp_processor_id()) { 116 /* racy, but better than risking deadlock. */
121 console_verbose(); 117 raw_local_irq_save(flags);
122 raw_spin_lock_irqsave(&die.lock, flags); 118 cpu = smp_processor_id();
123 die.lock_owner = smp_processor_id(); 119 if (!arch_spin_trylock(&die_lock)) {
124 die.lock_owner_depth = 0; 120 if (cpu == die_owner)
125 bust_spinlocks(1); 121 /* nested oops. should stop eventually */;
126 if (machine_is(powermac)) 122 else
127 pmac_backlight_unblank(); 123 arch_spin_lock(&die_lock);
128 } else {
129 local_save_flags(flags);
130 } 124 }
125 die_nest_count++;
126 die_owner = cpu;
127 console_verbose();
128 bust_spinlocks(1);
129 if (machine_is(powermac))
130 pmac_backlight_unblank();
131 return flags;
132}
131 133
132 if (++die.lock_owner_depth < 3) { 134static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs,
133 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); 135 int signr)
134#ifdef CONFIG_PREEMPT 136{
135 printk("PREEMPT "); 137 bust_spinlocks(0);
136#endif 138 die_owner = -1;
137#ifdef CONFIG_SMP 139 add_taint(TAINT_DIE);
138 printk("SMP NR_CPUS=%d ", NR_CPUS); 140 die_nest_count--;
139#endif 141 oops_exit();
140#ifdef CONFIG_DEBUG_PAGEALLOC 142 printk("\n");
141 printk("DEBUG_PAGEALLOC "); 143 if (!die_nest_count)
142#endif 144 /* Nest count reaches zero, release the lock. */
143#ifdef CONFIG_NUMA 145 arch_spin_unlock(&die_lock);
144 printk("NUMA "); 146 raw_local_irq_restore(flags);
145#endif
146 printk("%s\n", ppc_md.name ? ppc_md.name : "");
147 147
148 if (notify_die(DIE_OOPS, str, regs, err, 255, 148 /*
149 SIGSEGV) == NOTIFY_STOP) 149 * A system reset (0x100) is a request to dump, so we always send
150 return 1; 150 * it through the crashdump code.
151 */
152 if (kexec_should_crash(current) || (TRAP(regs) == 0x100)) {
153 crash_kexec(regs);
151 154
152 print_modules(); 155 /*
153 show_regs(regs); 156 * We aren't the primary crash CPU. We need to send it
154 } else { 157 * to a holding pattern to avoid it ending up in the panic
155 printk("Recursive die() failure, output suppressed\n"); 158 * code.
159 */
160 crash_kexec_secondary(regs);
156 } 161 }
157 162
158 bust_spinlocks(0); 163 if (!signr)
159 die.lock_owner = -1; 164 return;
160 add_taint(TAINT_DIE);
161 raw_spin_unlock_irqrestore(&die.lock, flags);
162 165
163 if (kexec_should_crash(current) || 166 /*
164 kexec_sr_activated(smp_processor_id())) 167 * While our oops output is serialised by a spinlock, output
165 crash_kexec(regs); 168 * from panic() called below can race and corrupt it. If we
166 crash_kexec_secondary(regs); 169 * know we are going to panic, delay for 1 second so we have a
170 * chance to get clean backtraces from all CPUs that are oopsing.
171 */
172 if (in_interrupt() || panic_on_oops || !current->pid ||
173 is_global_init(current)) {
174 mdelay(MSEC_PER_SEC);
175 }
167 176
168 if (in_interrupt()) 177 if (in_interrupt())
169 panic("Fatal exception in interrupt"); 178 panic("Fatal exception in interrupt");
170
171 if (panic_on_oops) 179 if (panic_on_oops)
172 panic("Fatal exception"); 180 panic("Fatal exception");
181 do_exit(signr);
182}
173 183
174 oops_exit(); 184static int __kprobes __die(const char *str, struct pt_regs *regs, long err)
175 do_exit(err); 185{
186 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
187#ifdef CONFIG_PREEMPT
188 printk("PREEMPT ");
189#endif
190#ifdef CONFIG_SMP
191 printk("SMP NR_CPUS=%d ", NR_CPUS);
192#endif
193#ifdef CONFIG_DEBUG_PAGEALLOC
194 printk("DEBUG_PAGEALLOC ");
195#endif
196#ifdef CONFIG_NUMA
197 printk("NUMA ");
198#endif
199 printk("%s\n", ppc_md.name ? ppc_md.name : "");
200
201 if (notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV) == NOTIFY_STOP)
202 return 1;
203
204 print_modules();
205 show_regs(regs);
176 206
177 return 0; 207 return 0;
178} 208}
179 209
210void die(const char *str, struct pt_regs *regs, long err)
211{
212 unsigned long flags = oops_begin(regs);
213
214 if (__die(str, regs, err))
215 err = 0;
216 oops_end(flags, regs, err);
217}
218
180void user_single_step_siginfo(struct task_struct *tsk, 219void user_single_step_siginfo(struct task_struct *tsk,
181 struct pt_regs *regs, siginfo_t *info) 220 struct pt_regs *regs, siginfo_t *info)
182{ 221{
@@ -195,10 +234,11 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
195 "at %016lx nip %016lx lr %016lx code %x\n"; 234 "at %016lx nip %016lx lr %016lx code %x\n";
196 235
197 if (!user_mode(regs)) { 236 if (!user_mode(regs)) {
198 if (die("Exception in kernel mode", regs, signr)) 237 die("Exception in kernel mode", regs, signr);
199 return; 238 return;
200 } else if (show_unhandled_signals && 239 }
201 unhandled_signal(current, signr)) { 240
241 if (show_unhandled_signals && unhandled_signal(current, signr)) {
202 printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32, 242 printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
203 current->comm, current->pid, signr, 243 current->comm, current->pid, signr,
204 addr, regs->nip, regs->link, code); 244 addr, regs->nip, regs->link, code);
@@ -220,25 +260,8 @@ void system_reset_exception(struct pt_regs *regs)
220 return; 260 return;
221 } 261 }
222 262
223#ifdef CONFIG_KEXEC
224 cpumask_set_cpu(smp_processor_id(), &cpus_in_sr);
225#endif
226
227 die("System Reset", regs, SIGABRT); 263 die("System Reset", regs, SIGABRT);
228 264
229 /*
230 * Some CPUs when released from the debugger will execute this path.
231 * These CPUs entered the debugger via a soft-reset. If the CPU was
232 * hung before entering the debugger it will return to the hung
233 * state when exiting this function. This causes a problem in
234 * kdump since the hung CPU(s) will not respond to the IPI sent
235 * from kdump. To prevent the problem we call crash_kexec_secondary()
236 * here. If a kdump had not been initiated or we exit the debugger
237 * with the "exit and recover" command (x) crash_kexec_secondary()
238 * will return after 5ms and the CPU returns to its previous state.
239 */
240 crash_kexec_secondary(regs);
241
242 /* Must die if the interrupt is not recoverable */ 265 /* Must die if the interrupt is not recoverable */
243 if (!(regs->msr & MSR_RI)) 266 if (!(regs->msr & MSR_RI))
244 panic("Unrecoverable System Reset"); 267 panic("Unrecoverable System Reset");
@@ -1298,14 +1321,12 @@ void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
1298 1321
1299 if (user_mode(regs)) { 1322 if (user_mode(regs)) {
1300 current->thread.dbcr0 &= ~DBCR0_IC; 1323 current->thread.dbcr0 &= ~DBCR0_IC;
1301#ifdef CONFIG_PPC_ADV_DEBUG_REGS
1302 if (DBCR_ACTIVE_EVENTS(current->thread.dbcr0, 1324 if (DBCR_ACTIVE_EVENTS(current->thread.dbcr0,
1303 current->thread.dbcr1)) 1325 current->thread.dbcr1))
1304 regs->msr |= MSR_DE; 1326 regs->msr |= MSR_DE;
1305 else 1327 else
1306 /* Make sure the IDM bit is off */ 1328 /* Make sure the IDM bit is off */
1307 current->thread.dbcr0 &= ~DBCR0_IDM; 1329 current->thread.dbcr0 &= ~DBCR0_IDM;
1308#endif
1309 } 1330 }
1310 1331
1311 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); 1332 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index f65af61996bd..8b086299ba25 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1406,7 +1406,6 @@ static struct bus_type vio_bus_type = {
1406 .match = vio_bus_match, 1406 .match = vio_bus_match,
1407 .probe = vio_bus_probe, 1407 .probe = vio_bus_probe,
1408 .remove = vio_bus_remove, 1408 .remove = vio_bus_remove,
1409 .pm = GENERIC_SUBSYS_PM_OPS,
1410}; 1409};
1411 1410
1412/** 1411/**
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 920276c0f6a1..710a54005dfb 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -170,7 +170,13 @@ SECTIONS
170 } 170 }
171#ifdef CONFIG_RELOCATABLE 171#ifdef CONFIG_RELOCATABLE
172 . = ALIGN(8); 172 . = ALIGN(8);
173 .dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET) { *(.dynsym) } 173 .dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET)
174 {
175#ifdef CONFIG_RELOCATABLE_PPC32
176 __dynamic_symtab = .;
177#endif
178 *(.dynsym)
179 }
174 .dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) } 180 .dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) }
175 .dynamic : AT(ADDR(.dynamic) - LOAD_OFFSET) 181 .dynamic : AT(ADDR(.dynamic) - LOAD_OFFSET)
176 { 182 {
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 0cdbc07cec14..336983da9e72 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -44,6 +44,7 @@
44#include <asm/processor.h> 44#include <asm/processor.h>
45#include <asm/cputhreads.h> 45#include <asm/cputhreads.h>
46#include <asm/page.h> 46#include <asm/page.h>
47#include <asm/hvcall.h>
47#include <linux/gfp.h> 48#include <linux/gfp.h>
48#include <linux/sched.h> 49#include <linux/sched.h>
49#include <linux/vmalloc.h> 50#include <linux/vmalloc.h>
@@ -537,7 +538,7 @@ static void kvmppc_start_thread(struct kvm_vcpu *vcpu)
537 tpaca->kvm_hstate.napping = 0; 538 tpaca->kvm_hstate.napping = 0;
538 vcpu->cpu = vc->pcpu; 539 vcpu->cpu = vc->pcpu;
539 smp_wmb(); 540 smp_wmb();
540#ifdef CONFIG_PPC_ICP_NATIVE 541#if defined(CONFIG_PPC_ICP_NATIVE) && defined(CONFIG_SMP)
541 if (vcpu->arch.ptid) { 542 if (vcpu->arch.ptid) {
542 tpaca->cpu_start = 0x80; 543 tpaca->cpu_start = 0x80;
543 wmb(); 544 wmb();
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 44d8829334ab..5c8b26183f50 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -112,6 +112,9 @@ kvm_start_guest:
112 stbcix r0, r5, r6 /* clear it */ 112 stbcix r0, r5, r6 /* clear it */
113 stwcix r8, r5, r7 /* EOI it */ 113 stwcix r8, r5, r7 /* EOI it */
114 114
115 /* NV GPR values from power7_idle() will no longer be valid */
116 stb r0, PACA_NAPSTATELOST(r13)
117
115.global kvmppc_hv_entry 118.global kvmppc_hv_entry
116kvmppc_hv_entry: 119kvmppc_hv_entry:
117 120
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index bc4d50dec78b..e2cfb9e1e20e 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -151,16 +151,14 @@ void kvmppc_set_pvr(struct kvm_vcpu *vcpu, u32 pvr)
151#ifdef CONFIG_PPC_BOOK3S_64 151#ifdef CONFIG_PPC_BOOK3S_64
152 if ((pvr >= 0x330000) && (pvr < 0x70330000)) { 152 if ((pvr >= 0x330000) && (pvr < 0x70330000)) {
153 kvmppc_mmu_book3s_64_init(vcpu); 153 kvmppc_mmu_book3s_64_init(vcpu);
154 if (!to_book3s(vcpu)->hior_sregs) 154 to_book3s(vcpu)->hior = 0xfff00000;
155 to_book3s(vcpu)->hior = 0xfff00000;
156 to_book3s(vcpu)->msr_mask = 0xffffffffffffffffULL; 155 to_book3s(vcpu)->msr_mask = 0xffffffffffffffffULL;
157 vcpu->arch.cpu_type = KVM_CPU_3S_64; 156 vcpu->arch.cpu_type = KVM_CPU_3S_64;
158 } else 157 } else
159#endif 158#endif
160 { 159 {
161 kvmppc_mmu_book3s_32_init(vcpu); 160 kvmppc_mmu_book3s_32_init(vcpu);
162 if (!to_book3s(vcpu)->hior_sregs) 161 to_book3s(vcpu)->hior = 0;
163 to_book3s(vcpu)->hior = 0;
164 to_book3s(vcpu)->msr_mask = 0xffffffffULL; 162 to_book3s(vcpu)->msr_mask = 0xffffffffULL;
165 vcpu->arch.cpu_type = KVM_CPU_3S_32; 163 vcpu->arch.cpu_type = KVM_CPU_3S_32;
166 } 164 }
@@ -660,10 +658,12 @@ program_interrupt:
660 ulong cmd = kvmppc_get_gpr(vcpu, 3); 658 ulong cmd = kvmppc_get_gpr(vcpu, 3);
661 int i; 659 int i;
662 660
661#ifdef CONFIG_KVM_BOOK3S_64_PR
663 if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) { 662 if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
664 r = RESUME_GUEST; 663 r = RESUME_GUEST;
665 break; 664 break;
666 } 665 }
666#endif
667 667
668 run->papr_hcall.nr = cmd; 668 run->papr_hcall.nr = cmd;
669 for (i = 0; i < 9; ++i) { 669 for (i = 0; i < 9; ++i) {
@@ -797,9 +797,6 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
797 } 797 }
798 } 798 }
799 799
800 if (sregs->u.s.flags & KVM_SREGS_S_HIOR)
801 sregs->u.s.hior = to_book3s(vcpu)->hior;
802
803 return 0; 800 return 0;
804} 801}
805 802
@@ -836,11 +833,6 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
836 /* Flush the MMU after messing with the segments */ 833 /* Flush the MMU after messing with the segments */
837 kvmppc_mmu_pte_flush(vcpu, 0, 0); 834 kvmppc_mmu_pte_flush(vcpu, 0, 0);
838 835
839 if (sregs->u.s.flags & KVM_SREGS_S_HIOR) {
840 to_book3s(vcpu)->hior_sregs = true;
841 to_book3s(vcpu)->hior = sregs->u.s.hior;
842 }
843
844 return 0; 836 return 0;
845} 837}
846 838
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
index 26d20903f2bc..8c0d45a6faf7 100644
--- a/arch/powerpc/kvm/e500.c
+++ b/arch/powerpc/kvm/e500.c
@@ -15,6 +15,7 @@
15#include <linux/kvm_host.h> 15#include <linux/kvm_host.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/export.h>
18 19
19#include <asm/reg.h> 20#include <asm/reg.h>
20#include <asm/cputable.h> 21#include <asm/cputable.h>
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index efbf9ad87203..607fbdf24b84 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -208,7 +208,6 @@ int kvm_dev_ioctl_check_extension(long ext)
208 case KVM_CAP_PPC_BOOKE_SREGS: 208 case KVM_CAP_PPC_BOOKE_SREGS:
209#else 209#else
210 case KVM_CAP_PPC_SEGSTATE: 210 case KVM_CAP_PPC_SEGSTATE:
211 case KVM_CAP_PPC_HIOR:
212 case KVM_CAP_PPC_PAPR: 211 case KVM_CAP_PPC_PAPR:
213#endif 212#endif
214 case KVM_CAP_PPC_UNSET_IRQ: 213 case KVM_CAP_PPC_UNSET_IRQ:
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 166a6a0ad544..7735a2c2e6d9 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -16,13 +16,15 @@ obj-$(CONFIG_HAS_IOMEM) += devres.o
16 16
17obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ 17obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \
18 memcpy_64.o usercopy_64.o mem_64.o string.o \ 18 memcpy_64.o usercopy_64.o mem_64.o string.o \
19 checksum_wrappers_64.o hweight_64.o 19 checksum_wrappers_64.o hweight_64.o \
20 copyuser_power7.o
20obj-$(CONFIG_XMON) += sstep.o ldstfp.o 21obj-$(CONFIG_XMON) += sstep.o ldstfp.o
21obj-$(CONFIG_KPROBES) += sstep.o ldstfp.o 22obj-$(CONFIG_KPROBES) += sstep.o ldstfp.o
22obj-$(CONFIG_HAVE_HW_BREAKPOINT) += sstep.o ldstfp.o 23obj-$(CONFIG_HAVE_HW_BREAKPOINT) += sstep.o ldstfp.o
23 24
24ifeq ($(CONFIG_PPC64),y) 25ifeq ($(CONFIG_PPC64),y)
25obj-$(CONFIG_SMP) += locks.o 26obj-$(CONFIG_SMP) += locks.o
27obj-$(CONFIG_ALTIVEC) += copyuser_power7_vmx.o
26endif 28endif
27 29
28obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o 30obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index 578b625d6a3c..773d38f90aaa 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -11,6 +11,12 @@
11 11
12 .align 7 12 .align 7
13_GLOBAL(__copy_tofrom_user) 13_GLOBAL(__copy_tofrom_user)
14BEGIN_FTR_SECTION
15 nop
16FTR_SECTION_ELSE
17 b __copy_tofrom_user_power7
18ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY)
19_GLOBAL(__copy_tofrom_user_base)
14 /* first check for a whole page copy on a page boundary */ 20 /* first check for a whole page copy on a page boundary */
15 cmpldi cr1,r5,16 21 cmpldi cr1,r5,16
16 cmpdi cr6,r5,4096 22 cmpdi cr6,r5,4096
diff --git a/arch/powerpc/lib/copyuser_power7.S b/arch/powerpc/lib/copyuser_power7.S
new file mode 100644
index 000000000000..497db7b23bb1
--- /dev/null
+++ b/arch/powerpc/lib/copyuser_power7.S
@@ -0,0 +1,683 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) IBM Corporation, 2011
17 *
18 * Author: Anton Blanchard <anton@au.ibm.com>
19 */
20#include <asm/ppc_asm.h>
21
22#define STACKFRAMESIZE 256
23#define STK_REG(i) (112 + ((i)-14)*8)
24
25 .macro err1
26100:
27 .section __ex_table,"a"
28 .align 3
29 .llong 100b,.Ldo_err1
30 .previous
31 .endm
32
33 .macro err2
34200:
35 .section __ex_table,"a"
36 .align 3
37 .llong 200b,.Ldo_err2
38 .previous
39 .endm
40
41#ifdef CONFIG_ALTIVEC
42 .macro err3
43300:
44 .section __ex_table,"a"
45 .align 3
46 .llong 300b,.Ldo_err3
47 .previous
48 .endm
49
50 .macro err4
51400:
52 .section __ex_table,"a"
53 .align 3
54 .llong 400b,.Ldo_err4
55 .previous
56 .endm
57
58
59.Ldo_err4:
60 ld r16,STK_REG(r16)(r1)
61 ld r15,STK_REG(r15)(r1)
62 ld r14,STK_REG(r14)(r1)
63.Ldo_err3:
64 bl .exit_vmx_copy
65 ld r0,STACKFRAMESIZE+16(r1)
66 mtlr r0
67 b .Lexit
68#endif /* CONFIG_ALTIVEC */
69
70.Ldo_err2:
71 ld r22,STK_REG(r22)(r1)
72 ld r21,STK_REG(r21)(r1)
73 ld r20,STK_REG(r20)(r1)
74 ld r19,STK_REG(r19)(r1)
75 ld r18,STK_REG(r18)(r1)
76 ld r17,STK_REG(r17)(r1)
77 ld r16,STK_REG(r16)(r1)
78 ld r15,STK_REG(r15)(r1)
79 ld r14,STK_REG(r14)(r1)
80.Lexit:
81 addi r1,r1,STACKFRAMESIZE
82.Ldo_err1:
83 ld r3,48(r1)
84 ld r4,56(r1)
85 ld r5,64(r1)
86 b __copy_tofrom_user_base
87
88
89_GLOBAL(__copy_tofrom_user_power7)
90#ifdef CONFIG_ALTIVEC
91 cmpldi r5,16
92 cmpldi cr1,r5,4096
93
94 std r3,48(r1)
95 std r4,56(r1)
96 std r5,64(r1)
97
98 blt .Lshort_copy
99 bgt cr1,.Lvmx_copy
100#else
101 cmpldi r5,16
102
103 std r3,48(r1)
104 std r4,56(r1)
105 std r5,64(r1)
106
107 blt .Lshort_copy
108#endif
109
110.Lnonvmx_copy:
111 /* Get the source 8B aligned */
112 neg r6,r4
113 mtocrf 0x01,r6
114 clrldi r6,r6,(64-3)
115
116 bf cr7*4+3,1f
117err1; lbz r0,0(r4)
118 addi r4,r4,1
119err1; stb r0,0(r3)
120 addi r3,r3,1
121
1221: bf cr7*4+2,2f
123err1; lhz r0,0(r4)
124 addi r4,r4,2
125err1; sth r0,0(r3)
126 addi r3,r3,2
127
1282: bf cr7*4+1,3f
129err1; lwz r0,0(r4)
130 addi r4,r4,4
131err1; stw r0,0(r3)
132 addi r3,r3,4
133
1343: sub r5,r5,r6
135 cmpldi r5,128
136 blt 5f
137
138 mflr r0
139 stdu r1,-STACKFRAMESIZE(r1)
140 std r14,STK_REG(r14)(r1)
141 std r15,STK_REG(r15)(r1)
142 std r16,STK_REG(r16)(r1)
143 std r17,STK_REG(r17)(r1)
144 std r18,STK_REG(r18)(r1)
145 std r19,STK_REG(r19)(r1)
146 std r20,STK_REG(r20)(r1)
147 std r21,STK_REG(r21)(r1)
148 std r22,STK_REG(r22)(r1)
149 std r0,STACKFRAMESIZE+16(r1)
150
151 srdi r6,r5,7
152 mtctr r6
153
154 /* Now do cacheline (128B) sized loads and stores. */
155 .align 5
1564:
157err2; ld r0,0(r4)
158err2; ld r6,8(r4)
159err2; ld r7,16(r4)
160err2; ld r8,24(r4)
161err2; ld r9,32(r4)
162err2; ld r10,40(r4)
163err2; ld r11,48(r4)
164err2; ld r12,56(r4)
165err2; ld r14,64(r4)
166err2; ld r15,72(r4)
167err2; ld r16,80(r4)
168err2; ld r17,88(r4)
169err2; ld r18,96(r4)
170err2; ld r19,104(r4)
171err2; ld r20,112(r4)
172err2; ld r21,120(r4)
173 addi r4,r4,128
174err2; std r0,0(r3)
175err2; std r6,8(r3)
176err2; std r7,16(r3)
177err2; std r8,24(r3)
178err2; std r9,32(r3)
179err2; std r10,40(r3)
180err2; std r11,48(r3)
181err2; std r12,56(r3)
182err2; std r14,64(r3)
183err2; std r15,72(r3)
184err2; std r16,80(r3)
185err2; std r17,88(r3)
186err2; std r18,96(r3)
187err2; std r19,104(r3)
188err2; std r20,112(r3)
189err2; std r21,120(r3)
190 addi r3,r3,128
191 bdnz 4b
192
193 clrldi r5,r5,(64-7)
194
195 ld r14,STK_REG(r14)(r1)
196 ld r15,STK_REG(r15)(r1)
197 ld r16,STK_REG(r16)(r1)
198 ld r17,STK_REG(r17)(r1)
199 ld r18,STK_REG(r18)(r1)
200 ld r19,STK_REG(r19)(r1)
201 ld r20,STK_REG(r20)(r1)
202 ld r21,STK_REG(r21)(r1)
203 ld r22,STK_REG(r22)(r1)
204 addi r1,r1,STACKFRAMESIZE
205
206 /* Up to 127B to go */
2075: srdi r6,r5,4
208 mtocrf 0x01,r6
209
2106: bf cr7*4+1,7f
211err1; ld r0,0(r4)
212err1; ld r6,8(r4)
213err1; ld r7,16(r4)
214err1; ld r8,24(r4)
215err1; ld r9,32(r4)
216err1; ld r10,40(r4)
217err1; ld r11,48(r4)
218err1; ld r12,56(r4)
219 addi r4,r4,64
220err1; std r0,0(r3)
221err1; std r6,8(r3)
222err1; std r7,16(r3)
223err1; std r8,24(r3)
224err1; std r9,32(r3)
225err1; std r10,40(r3)
226err1; std r11,48(r3)
227err1; std r12,56(r3)
228 addi r3,r3,64
229
230 /* Up to 63B to go */
2317: bf cr7*4+2,8f
232err1; ld r0,0(r4)
233err1; ld r6,8(r4)
234err1; ld r7,16(r4)
235err1; ld r8,24(r4)
236 addi r4,r4,32
237err1; std r0,0(r3)
238err1; std r6,8(r3)
239err1; std r7,16(r3)
240err1; std r8,24(r3)
241 addi r3,r3,32
242
243 /* Up to 31B to go */
2448: bf cr7*4+3,9f
245err1; ld r0,0(r4)
246err1; ld r6,8(r4)
247 addi r4,r4,16
248err1; std r0,0(r3)
249err1; std r6,8(r3)
250 addi r3,r3,16
251
2529: clrldi r5,r5,(64-4)
253
254 /* Up to 15B to go */
255.Lshort_copy:
256 mtocrf 0x01,r5
257 bf cr7*4+0,12f
258err1; lwz r0,0(r4) /* Less chance of a reject with word ops */
259err1; lwz r6,4(r4)
260 addi r4,r4,8
261err1; stw r0,0(r3)
262err1; stw r6,4(r3)
263 addi r3,r3,8
264
26512: bf cr7*4+1,13f
266err1; lwz r0,0(r4)
267 addi r4,r4,4
268err1; stw r0,0(r3)
269 addi r3,r3,4
270
27113: bf cr7*4+2,14f
272err1; lhz r0,0(r4)
273 addi r4,r4,2
274err1; sth r0,0(r3)
275 addi r3,r3,2
276
27714: bf cr7*4+3,15f
278err1; lbz r0,0(r4)
279err1; stb r0,0(r3)
280
28115: li r3,0
282 blr
283
284.Lunwind_stack_nonvmx_copy:
285 addi r1,r1,STACKFRAMESIZE
286 b .Lnonvmx_copy
287
288#ifdef CONFIG_ALTIVEC
289.Lvmx_copy:
290 mflr r0
291 std r0,16(r1)
292 stdu r1,-STACKFRAMESIZE(r1)
293 bl .enter_vmx_copy
294 cmpwi r3,0
295 ld r0,STACKFRAMESIZE+16(r1)
296 ld r3,STACKFRAMESIZE+48(r1)
297 ld r4,STACKFRAMESIZE+56(r1)
298 ld r5,STACKFRAMESIZE+64(r1)
299 mtlr r0
300
301 beq .Lunwind_stack_nonvmx_copy
302
303 /*
304 * If source and destination are not relatively aligned we use a
305 * slower permute loop.
306 */
307 xor r6,r4,r3
308 rldicl. r6,r6,0,(64-4)
309 bne .Lvmx_unaligned_copy
310
311 /* Get the destination 16B aligned */
312 neg r6,r3
313 mtocrf 0x01,r6
314 clrldi r6,r6,(64-4)
315
316 bf cr7*4+3,1f
317err3; lbz r0,0(r4)
318 addi r4,r4,1
319err3; stb r0,0(r3)
320 addi r3,r3,1
321
3221: bf cr7*4+2,2f
323err3; lhz r0,0(r4)
324 addi r4,r4,2
325err3; sth r0,0(r3)
326 addi r3,r3,2
327
3282: bf cr7*4+1,3f
329err3; lwz r0,0(r4)
330 addi r4,r4,4
331err3; stw r0,0(r3)
332 addi r3,r3,4
333
3343: bf cr7*4+0,4f
335err3; ld r0,0(r4)
336 addi r4,r4,8
337err3; std r0,0(r3)
338 addi r3,r3,8
339
3404: sub r5,r5,r6
341
342 /* Get the desination 128B aligned */
343 neg r6,r3
344 srdi r7,r6,4
345 mtocrf 0x01,r7
346 clrldi r6,r6,(64-7)
347
348 li r9,16
349 li r10,32
350 li r11,48
351
352 bf cr7*4+3,5f
353err3; lvx vr1,r0,r4
354 addi r4,r4,16
355err3; stvx vr1,r0,r3
356 addi r3,r3,16
357
3585: bf cr7*4+2,6f
359err3; lvx vr1,r0,r4
360err3; lvx vr0,r4,r9
361 addi r4,r4,32
362err3; stvx vr1,r0,r3
363err3; stvx vr0,r3,r9
364 addi r3,r3,32
365
3666: bf cr7*4+1,7f
367err3; lvx vr3,r0,r4
368err3; lvx vr2,r4,r9
369err3; lvx vr1,r4,r10
370err3; lvx vr0,r4,r11
371 addi r4,r4,64
372err3; stvx vr3,r0,r3
373err3; stvx vr2,r3,r9
374err3; stvx vr1,r3,r10
375err3; stvx vr0,r3,r11
376 addi r3,r3,64
377
3787: sub r5,r5,r6
379 srdi r6,r5,7
380
381 std r14,STK_REG(r14)(r1)
382 std r15,STK_REG(r15)(r1)
383 std r16,STK_REG(r16)(r1)
384
385 li r12,64
386 li r14,80
387 li r15,96
388 li r16,112
389
390 mtctr r6
391
392 /*
393 * Now do cacheline sized loads and stores. By this stage the
394 * cacheline stores are also cacheline aligned.
395 */
396 .align 5
3978:
398err4; lvx vr7,r0,r4
399err4; lvx vr6,r4,r9
400err4; lvx vr5,r4,r10
401err4; lvx vr4,r4,r11
402err4; lvx vr3,r4,r12
403err4; lvx vr2,r4,r14
404err4; lvx vr1,r4,r15
405err4; lvx vr0,r4,r16
406 addi r4,r4,128
407err4; stvx vr7,r0,r3
408err4; stvx vr6,r3,r9
409err4; stvx vr5,r3,r10
410err4; stvx vr4,r3,r11
411err4; stvx vr3,r3,r12
412err4; stvx vr2,r3,r14
413err4; stvx vr1,r3,r15
414err4; stvx vr0,r3,r16
415 addi r3,r3,128
416 bdnz 8b
417
418 ld r14,STK_REG(r14)(r1)
419 ld r15,STK_REG(r15)(r1)
420 ld r16,STK_REG(r16)(r1)
421
422 /* Up to 127B to go */
423 clrldi r5,r5,(64-7)
424 srdi r6,r5,4
425 mtocrf 0x01,r6
426
427 bf cr7*4+1,9f
428err3; lvx vr3,r0,r4
429err3; lvx vr2,r4,r9
430err3; lvx vr1,r4,r10
431err3; lvx vr0,r4,r11
432 addi r4,r4,64
433err3; stvx vr3,r0,r3
434err3; stvx vr2,r3,r9
435err3; stvx vr1,r3,r10
436err3; stvx vr0,r3,r11
437 addi r3,r3,64
438
4399: bf cr7*4+2,10f
440err3; lvx vr1,r0,r4
441err3; lvx vr0,r4,r9
442 addi r4,r4,32
443err3; stvx vr1,r0,r3
444err3; stvx vr0,r3,r9
445 addi r3,r3,32
446
44710: bf cr7*4+3,11f
448err3; lvx vr1,r0,r4
449 addi r4,r4,16
450err3; stvx vr1,r0,r3
451 addi r3,r3,16
452
453 /* Up to 15B to go */
45411: clrldi r5,r5,(64-4)
455 mtocrf 0x01,r5
456 bf cr7*4+0,12f
457err3; ld r0,0(r4)
458 addi r4,r4,8
459err3; std r0,0(r3)
460 addi r3,r3,8
461
46212: bf cr7*4+1,13f
463err3; lwz r0,0(r4)
464 addi r4,r4,4
465err3; stw r0,0(r3)
466 addi r3,r3,4
467
46813: bf cr7*4+2,14f
469err3; lhz r0,0(r4)
470 addi r4,r4,2
471err3; sth r0,0(r3)
472 addi r3,r3,2
473
47414: bf cr7*4+3,15f
475err3; lbz r0,0(r4)
476err3; stb r0,0(r3)
477
47815: addi r1,r1,STACKFRAMESIZE
479 b .exit_vmx_copy /* tail call optimise */
480
481.Lvmx_unaligned_copy:
482 /* Get the destination 16B aligned */
483 neg r6,r3
484 mtocrf 0x01,r6
485 clrldi r6,r6,(64-4)
486
487 bf cr7*4+3,1f
488err3; lbz r0,0(r4)
489 addi r4,r4,1
490err3; stb r0,0(r3)
491 addi r3,r3,1
492
4931: bf cr7*4+2,2f
494err3; lhz r0,0(r4)
495 addi r4,r4,2
496err3; sth r0,0(r3)
497 addi r3,r3,2
498
4992: bf cr7*4+1,3f
500err3; lwz r0,0(r4)
501 addi r4,r4,4
502err3; stw r0,0(r3)
503 addi r3,r3,4
504
5053: bf cr7*4+0,4f
506err3; lwz r0,0(r4) /* Less chance of a reject with word ops */
507err3; lwz r7,4(r4)
508 addi r4,r4,8
509err3; stw r0,0(r3)
510err3; stw r7,4(r3)
511 addi r3,r3,8
512
5134: sub r5,r5,r6
514
515 /* Get the desination 128B aligned */
516 neg r6,r3
517 srdi r7,r6,4
518 mtocrf 0x01,r7
519 clrldi r6,r6,(64-7)
520
521 li r9,16
522 li r10,32
523 li r11,48
524
525 lvsl vr16,0,r4 /* Setup permute control vector */
526err3; lvx vr0,0,r4
527 addi r4,r4,16
528
529 bf cr7*4+3,5f
530err3; lvx vr1,r0,r4
531 vperm vr8,vr0,vr1,vr16
532 addi r4,r4,16
533err3; stvx vr8,r0,r3
534 addi r3,r3,16
535 vor vr0,vr1,vr1
536
5375: bf cr7*4+2,6f
538err3; lvx vr1,r0,r4
539 vperm vr8,vr0,vr1,vr16
540err3; lvx vr0,r4,r9
541 vperm vr9,vr1,vr0,vr16
542 addi r4,r4,32
543err3; stvx vr8,r0,r3
544err3; stvx vr9,r3,r9
545 addi r3,r3,32
546
5476: bf cr7*4+1,7f
548err3; lvx vr3,r0,r4
549 vperm vr8,vr0,vr3,vr16
550err3; lvx vr2,r4,r9
551 vperm vr9,vr3,vr2,vr16
552err3; lvx vr1,r4,r10
553 vperm vr10,vr2,vr1,vr16
554err3; lvx vr0,r4,r11
555 vperm vr11,vr1,vr0,vr16
556 addi r4,r4,64
557err3; stvx vr8,r0,r3
558err3; stvx vr9,r3,r9
559err3; stvx vr10,r3,r10
560err3; stvx vr11,r3,r11
561 addi r3,r3,64
562
5637: sub r5,r5,r6
564 srdi r6,r5,7
565
566 std r14,STK_REG(r14)(r1)
567 std r15,STK_REG(r15)(r1)
568 std r16,STK_REG(r16)(r1)
569
570 li r12,64
571 li r14,80
572 li r15,96
573 li r16,112
574
575 mtctr r6
576
577 /*
578 * Now do cacheline sized loads and stores. By this stage the
579 * cacheline stores are also cacheline aligned.
580 */
581 .align 5
5828:
583err4; lvx vr7,r0,r4
584 vperm vr8,vr0,vr7,vr16
585err4; lvx vr6,r4,r9
586 vperm vr9,vr7,vr6,vr16
587err4; lvx vr5,r4,r10
588 vperm vr10,vr6,vr5,vr16
589err4; lvx vr4,r4,r11
590 vperm vr11,vr5,vr4,vr16
591err4; lvx vr3,r4,r12
592 vperm vr12,vr4,vr3,vr16
593err4; lvx vr2,r4,r14
594 vperm vr13,vr3,vr2,vr16
595err4; lvx vr1,r4,r15
596 vperm vr14,vr2,vr1,vr16
597err4; lvx vr0,r4,r16
598 vperm vr15,vr1,vr0,vr16
599 addi r4,r4,128
600err4; stvx vr8,r0,r3
601err4; stvx vr9,r3,r9
602err4; stvx vr10,r3,r10
603err4; stvx vr11,r3,r11
604err4; stvx vr12,r3,r12
605err4; stvx vr13,r3,r14
606err4; stvx vr14,r3,r15
607err4; stvx vr15,r3,r16
608 addi r3,r3,128
609 bdnz 8b
610
611 ld r14,STK_REG(r14)(r1)
612 ld r15,STK_REG(r15)(r1)
613 ld r16,STK_REG(r16)(r1)
614
615 /* Up to 127B to go */
616 clrldi r5,r5,(64-7)
617 srdi r6,r5,4
618 mtocrf 0x01,r6
619
620 bf cr7*4+1,9f
621err3; lvx vr3,r0,r4
622 vperm vr8,vr0,vr3,vr16
623err3; lvx vr2,r4,r9
624 vperm vr9,vr3,vr2,vr16
625err3; lvx vr1,r4,r10
626 vperm vr10,vr2,vr1,vr16
627err3; lvx vr0,r4,r11
628 vperm vr11,vr1,vr0,vr16
629 addi r4,r4,64
630err3; stvx vr8,r0,r3
631err3; stvx vr9,r3,r9
632err3; stvx vr10,r3,r10
633err3; stvx vr11,r3,r11
634 addi r3,r3,64
635
6369: bf cr7*4+2,10f
637err3; lvx vr1,r0,r4
638 vperm vr8,vr0,vr1,vr16
639err3; lvx vr0,r4,r9
640 vperm vr9,vr1,vr0,vr16
641 addi r4,r4,32
642err3; stvx vr8,r0,r3
643err3; stvx vr9,r3,r9
644 addi r3,r3,32
645
64610: bf cr7*4+3,11f
647err3; lvx vr1,r0,r4
648 vperm vr8,vr0,vr1,vr16
649 addi r4,r4,16
650err3; stvx vr8,r0,r3
651 addi r3,r3,16
652
653 /* Up to 15B to go */
65411: clrldi r5,r5,(64-4)
655 addi r4,r4,-16 /* Unwind the +16 load offset */
656 mtocrf 0x01,r5
657 bf cr7*4+0,12f
658err3; lwz r0,0(r4) /* Less chance of a reject with word ops */
659err3; lwz r6,4(r4)
660 addi r4,r4,8
661err3; stw r0,0(r3)
662err3; stw r6,4(r3)
663 addi r3,r3,8
664
66512: bf cr7*4+1,13f
666err3; lwz r0,0(r4)
667 addi r4,r4,4
668err3; stw r0,0(r3)
669 addi r3,r3,4
670
67113: bf cr7*4+2,14f
672err3; lhz r0,0(r4)
673 addi r4,r4,2
674err3; sth r0,0(r3)
675 addi r3,r3,2
676
67714: bf cr7*4+3,15f
678err3; lbz r0,0(r4)
679err3; stb r0,0(r3)
680
68115: addi r1,r1,STACKFRAMESIZE
682 b .exit_vmx_copy /* tail call optimise */
683#endif /* CONFiG_ALTIVEC */
diff --git a/arch/powerpc/lib/copyuser_power7_vmx.c b/arch/powerpc/lib/copyuser_power7_vmx.c
new file mode 100644
index 000000000000..6e1efadac48b
--- /dev/null
+++ b/arch/powerpc/lib/copyuser_power7_vmx.c
@@ -0,0 +1,50 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) IBM Corporation, 2011
17 *
18 * Authors: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
19 * Anton Blanchard <anton@au.ibm.com>
20 */
21#include <linux/uaccess.h>
22#include <linux/hardirq.h>
23
24int enter_vmx_copy(void)
25{
26 if (in_interrupt())
27 return 0;
28
29 /* This acts as preempt_disable() as well and will make
30 * enable_kernel_altivec(). We need to disable page faults
31 * as they can call schedule and thus make us lose the VMX
32 * context. So on page faults, we just fail which will cause
33 * a fallback to the normal non-vmx copy.
34 */
35 pagefault_disable();
36
37 enable_kernel_altivec();
38
39 return 1;
40}
41
42/*
43 * This function must return 0 because we tail call optimise when calling
44 * from __copy_tofrom_user_power7 which returns 0 on success.
45 */
46int exit_vmx_copy(void)
47{
48 pagefault_enable();
49 return 0;
50}
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index 0d08d0171392..7a8a7487cee8 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -18,6 +18,8 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <asm/cputable.h> 19#include <asm/cputable.h>
20#include <asm/code-patching.h> 20#include <asm/code-patching.h>
21#include <asm/page.h>
22#include <asm/sections.h>
21 23
22 24
23struct fixup_entry { 25struct fixup_entry {
@@ -128,6 +130,27 @@ void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
128 } 130 }
129} 131}
130 132
133void do_final_fixups(void)
134{
135#if defined(CONFIG_PPC64) && defined(CONFIG_RELOCATABLE)
136 int *src, *dest;
137 unsigned long length;
138
139 if (PHYSICAL_START == 0)
140 return;
141
142 src = (int *)(KERNELBASE + PHYSICAL_START);
143 dest = (int *)KERNELBASE;
144 length = (__end_interrupts - _stext) / sizeof(int);
145
146 while (length--) {
147 patch_instruction(dest, *src);
148 src++;
149 dest++;
150 }
151#endif
152}
153
131#ifdef CONFIG_FTR_FIXUP_SELFTEST 154#ifdef CONFIG_FTR_FIXUP_SELFTEST
132 155
133#define check(x) \ 156#define check(x) \
diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c
index f60e006d90c3..388b95e1a009 100644
--- a/arch/powerpc/mm/44x_mmu.c
+++ b/arch/powerpc/mm/44x_mmu.c
@@ -78,11 +78,7 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
78 "tlbwe %1,%3,%5\n" 78 "tlbwe %1,%3,%5\n"
79 "tlbwe %0,%3,%6\n" 79 "tlbwe %0,%3,%6\n"
80 : 80 :
81#ifdef CONFIG_PPC47x
82 : "r" (PPC47x_TLB2_S_RWX),
83#else
84 : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G), 81 : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
85#endif
86 "r" (phys), 82 "r" (phys),
87 "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M), 83 "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
88 "r" (entry), 84 "r" (entry),
@@ -221,7 +217,7 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
221{ 217{
222 u64 size; 218 u64 size;
223 219
224#ifndef CONFIG_RELOCATABLE 220#ifndef CONFIG_NONSTATIC_KERNEL
225 /* We don't currently support the first MEMBLOCK not mapping 0 221 /* We don't currently support the first MEMBLOCK not mapping 0
226 * physical on those processors 222 * physical on those processors
227 */ 223 */
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 991ee813d2a8..3787b61f7d20 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -21,6 +21,8 @@ obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o
21obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \ 21obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \
22 tlb_hash$(CONFIG_WORD_SIZE).o \ 22 tlb_hash$(CONFIG_WORD_SIZE).o \
23 mmu_context_hash$(CONFIG_WORD_SIZE).o 23 mmu_context_hash$(CONFIG_WORD_SIZE).o
24obj-$(CONFIG_PPC_ICSWX) += icswx.o
25obj-$(CONFIG_PPC_ICSWX_PID) += icswx_pid.o
24obj-$(CONFIG_40x) += 40x_mmu.o 26obj-$(CONFIG_40x) += 40x_mmu.o
25obj-$(CONFIG_44x) += 44x_mmu.o 27obj-$(CONFIG_44x) += 44x_mmu.o
26obj-$(CONFIG_PPC_FSL_BOOK3E) += fsl_booke_mmu.o 28obj-$(CONFIG_PPC_FSL_BOOK3E) += fsl_booke_mmu.o
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 5efe8c96d37f..2f0d1b032a89 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -44,6 +44,8 @@
44#include <asm/siginfo.h> 44#include <asm/siginfo.h>
45#include <mm/mmu_decl.h> 45#include <mm/mmu_decl.h>
46 46
47#include "icswx.h"
48
47#ifdef CONFIG_KPROBES 49#ifdef CONFIG_KPROBES
48static inline int notify_page_fault(struct pt_regs *regs) 50static inline int notify_page_fault(struct pt_regs *regs)
49{ 51{
@@ -143,6 +145,21 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
143 is_write = error_code & ESR_DST; 145 is_write = error_code & ESR_DST;
144#endif /* CONFIG_4xx || CONFIG_BOOKE */ 146#endif /* CONFIG_4xx || CONFIG_BOOKE */
145 147
148#ifdef CONFIG_PPC_ICSWX
149 /*
150 * we need to do this early because this "data storage
151 * interrupt" does not update the DAR/DEAR so we don't want to
152 * look at it
153 */
154 if (error_code & ICSWX_DSI_UCT) {
155 int ret;
156
157 ret = acop_handle_fault(regs, address, error_code);
158 if (ret)
159 return ret;
160 }
161#endif
162
146 if (notify_page_fault(regs)) 163 if (notify_page_fault(regs))
147 return 0; 164 return 0;
148 165
diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c
index 343ad0b87261..3bc700655fc8 100644
--- a/arch/powerpc/mm/hugetlbpage-book3e.c
+++ b/arch/powerpc/mm/hugetlbpage-book3e.c
@@ -37,31 +37,32 @@ static inline int book3e_tlb_exists(unsigned long ea, unsigned long pid)
37 return found; 37 return found;
38} 38}
39 39
40void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte) 40void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea,
41 pte_t pte)
41{ 42{
42 unsigned long mas1, mas2; 43 unsigned long mas1, mas2;
43 u64 mas7_3; 44 u64 mas7_3;
44 unsigned long psize, tsize, shift; 45 unsigned long psize, tsize, shift;
45 unsigned long flags; 46 unsigned long flags;
47 struct mm_struct *mm;
46 48
47#ifdef CONFIG_PPC_FSL_BOOK3E 49#ifdef CONFIG_PPC_FSL_BOOK3E
48 int index, lz, ncams; 50 int index, ncams;
49 struct vm_area_struct *vma;
50#endif 51#endif
51 52
52 if (unlikely(is_kernel_addr(ea))) 53 if (unlikely(is_kernel_addr(ea)))
53 return; 54 return;
54 55
56 mm = vma->vm_mm;
57
55#ifdef CONFIG_PPC_MM_SLICES 58#ifdef CONFIG_PPC_MM_SLICES
56 psize = mmu_get_tsize(get_slice_psize(mm, ea)); 59 psize = get_slice_psize(mm, ea);
57 tsize = mmu_get_psize(psize); 60 tsize = mmu_get_tsize(psize);
58 shift = mmu_psize_defs[psize].shift; 61 shift = mmu_psize_defs[psize].shift;
59#else 62#else
60 vma = find_vma(mm, ea); 63 psize = vma_mmu_pagesize(vma);
61 psize = vma_mmu_pagesize(vma); /* returns actual size in bytes */ 64 shift = __ilog2(psize);
62 asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (psize)); 65 tsize = shift - 10;
63 shift = 31 - lz;
64 tsize = 21 - lz;
65#endif 66#endif
66 67
67 /* 68 /*
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 5964371303ac..a8b3cc7d90fe 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
15#include <linux/of_fdt.h> 15#include <linux/of_fdt.h>
16#include <linux/memblock.h> 16#include <linux/memblock.h>
17#include <linux/bootmem.h> 17#include <linux/bootmem.h>
18#include <linux/moduleparam.h>
18#include <asm/pgtable.h> 19#include <asm/pgtable.h>
19#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
20#include <asm/tlb.h> 21#include <asm/tlb.h>
@@ -28,22 +29,22 @@ unsigned int HPAGE_SHIFT;
28 29
29/* 30/*
30 * Tracks gpages after the device tree is scanned and before the 31 * Tracks gpages after the device tree is scanned and before the
31 * huge_boot_pages list is ready. On 64-bit implementations, this is 32 * huge_boot_pages list is ready. On non-Freescale implementations, this is
32 * just used to track 16G pages and so is a single array. 32-bit 33 * just used to track 16G pages and so is a single array. FSL-based
33 * implementations may have more than one gpage size due to limitations 34 * implementations may have more than one gpage size, so we need multiple
34 * of the memory allocators, so we need multiple arrays 35 * arrays
35 */ 36 */
36#ifdef CONFIG_PPC64 37#ifdef CONFIG_PPC_FSL_BOOK3E
37#define MAX_NUMBER_GPAGES 1024
38static u64 gpage_freearray[MAX_NUMBER_GPAGES];
39static unsigned nr_gpages;
40#else
41#define MAX_NUMBER_GPAGES 128 38#define MAX_NUMBER_GPAGES 128
42struct psize_gpages { 39struct psize_gpages {
43 u64 gpage_list[MAX_NUMBER_GPAGES]; 40 u64 gpage_list[MAX_NUMBER_GPAGES];
44 unsigned int nr_gpages; 41 unsigned int nr_gpages;
45}; 42};
46static struct psize_gpages gpage_freearray[MMU_PAGE_COUNT]; 43static struct psize_gpages gpage_freearray[MMU_PAGE_COUNT];
44#else
45#define MAX_NUMBER_GPAGES 1024
46static u64 gpage_freearray[MAX_NUMBER_GPAGES];
47static unsigned nr_gpages;
47#endif 48#endif
48 49
49static inline int shift_to_mmu_psize(unsigned int shift) 50static inline int shift_to_mmu_psize(unsigned int shift)
@@ -114,12 +115,12 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
114 struct kmem_cache *cachep; 115 struct kmem_cache *cachep;
115 pte_t *new; 116 pte_t *new;
116 117
117#ifdef CONFIG_PPC64 118#ifdef CONFIG_PPC_FSL_BOOK3E
118 cachep = PGT_CACHE(pdshift - pshift);
119#else
120 int i; 119 int i;
121 int num_hugepd = 1 << (pshift - pdshift); 120 int num_hugepd = 1 << (pshift - pdshift);
122 cachep = hugepte_cache; 121 cachep = hugepte_cache;
122#else
123 cachep = PGT_CACHE(pdshift - pshift);
123#endif 124#endif
124 125
125 new = kmem_cache_zalloc(cachep, GFP_KERNEL|__GFP_REPEAT); 126 new = kmem_cache_zalloc(cachep, GFP_KERNEL|__GFP_REPEAT);
@@ -131,12 +132,7 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
131 return -ENOMEM; 132 return -ENOMEM;
132 133
133 spin_lock(&mm->page_table_lock); 134 spin_lock(&mm->page_table_lock);
134#ifdef CONFIG_PPC64 135#ifdef CONFIG_PPC_FSL_BOOK3E
135 if (!hugepd_none(*hpdp))
136 kmem_cache_free(cachep, new);
137 else
138 hpdp->pd = ((unsigned long)new & ~PD_HUGE) | pshift;
139#else
140 /* 136 /*
141 * We have multiple higher-level entries that point to the same 137 * We have multiple higher-level entries that point to the same
142 * actual pte location. Fill in each as we go and backtrack on error. 138 * actual pte location. Fill in each as we go and backtrack on error.
@@ -155,11 +151,28 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
155 hpdp->pd = 0; 151 hpdp->pd = 0;
156 kmem_cache_free(cachep, new); 152 kmem_cache_free(cachep, new);
157 } 153 }
154#else
155 if (!hugepd_none(*hpdp))
156 kmem_cache_free(cachep, new);
157 else
158 hpdp->pd = ((unsigned long)new & ~PD_HUGE) | pshift;
158#endif 159#endif
159 spin_unlock(&mm->page_table_lock); 160 spin_unlock(&mm->page_table_lock);
160 return 0; 161 return 0;
161} 162}
162 163
164/*
165 * These macros define how to determine which level of the page table holds
166 * the hpdp.
167 */
168#ifdef CONFIG_PPC_FSL_BOOK3E
169#define HUGEPD_PGD_SHIFT PGDIR_SHIFT
170#define HUGEPD_PUD_SHIFT PUD_SHIFT
171#else
172#define HUGEPD_PGD_SHIFT PUD_SHIFT
173#define HUGEPD_PUD_SHIFT PMD_SHIFT
174#endif
175
163pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz) 176pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz)
164{ 177{
165 pgd_t *pg; 178 pgd_t *pg;
@@ -172,12 +185,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
172 addr &= ~(sz-1); 185 addr &= ~(sz-1);
173 186
174 pg = pgd_offset(mm, addr); 187 pg = pgd_offset(mm, addr);
175 if (pshift >= PUD_SHIFT) { 188
189 if (pshift >= HUGEPD_PGD_SHIFT) {
176 hpdp = (hugepd_t *)pg; 190 hpdp = (hugepd_t *)pg;
177 } else { 191 } else {
178 pdshift = PUD_SHIFT; 192 pdshift = PUD_SHIFT;
179 pu = pud_alloc(mm, pg, addr); 193 pu = pud_alloc(mm, pg, addr);
180 if (pshift >= PMD_SHIFT) { 194 if (pshift >= HUGEPD_PUD_SHIFT) {
181 hpdp = (hugepd_t *)pu; 195 hpdp = (hugepd_t *)pu;
182 } else { 196 } else {
183 pdshift = PMD_SHIFT; 197 pdshift = PMD_SHIFT;
@@ -197,7 +211,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
197 return hugepte_offset(hpdp, addr, pdshift); 211 return hugepte_offset(hpdp, addr, pdshift);
198} 212}
199 213
200#ifdef CONFIG_PPC32 214#ifdef CONFIG_PPC_FSL_BOOK3E
201/* Build list of addresses of gigantic pages. This function is used in early 215/* Build list of addresses of gigantic pages. This function is used in early
202 * boot before the buddy or bootmem allocator is setup. 216 * boot before the buddy or bootmem allocator is setup.
203 */ 217 */
@@ -317,7 +331,7 @@ void __init reserve_hugetlb_gpages(void)
317 } 331 }
318} 332}
319 333
320#else /* PPC64 */ 334#else /* !PPC_FSL_BOOK3E */
321 335
322/* Build list of addresses of gigantic pages. This function is used in early 336/* Build list of addresses of gigantic pages. This function is used in early
323 * boot before the buddy or bootmem allocator is setup. 337 * boot before the buddy or bootmem allocator is setup.
@@ -355,7 +369,7 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
355 return 0; 369 return 0;
356} 370}
357 371
358#ifdef CONFIG_PPC32 372#ifdef CONFIG_PPC_FSL_BOOK3E
359#define HUGEPD_FREELIST_SIZE \ 373#define HUGEPD_FREELIST_SIZE \
360 ((PAGE_SIZE - sizeof(struct hugepd_freelist)) / sizeof(pte_t)) 374 ((PAGE_SIZE - sizeof(struct hugepd_freelist)) / sizeof(pte_t))
361 375
@@ -415,11 +429,11 @@ static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshif
415 unsigned long pdmask = ~((1UL << pdshift) - 1); 429 unsigned long pdmask = ~((1UL << pdshift) - 1);
416 unsigned int num_hugepd = 1; 430 unsigned int num_hugepd = 1;
417 431
418#ifdef CONFIG_PPC64 432#ifdef CONFIG_PPC_FSL_BOOK3E
419 unsigned int shift = hugepd_shift(*hpdp); 433 /* Note: On fsl the hpdp may be the first of several */
420#else
421 /* Note: On 32-bit the hpdp may be the first of several */
422 num_hugepd = (1 << (hugepd_shift(*hpdp) - pdshift)); 434 num_hugepd = (1 << (hugepd_shift(*hpdp) - pdshift));
435#else
436 unsigned int shift = hugepd_shift(*hpdp);
423#endif 437#endif
424 438
425 start &= pdmask; 439 start &= pdmask;
@@ -437,10 +451,11 @@ static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshif
437 hpdp->pd = 0; 451 hpdp->pd = 0;
438 452
439 tlb->need_flush = 1; 453 tlb->need_flush = 1;
440#ifdef CONFIG_PPC64 454
441 pgtable_free_tlb(tlb, hugepte, pdshift - shift); 455#ifdef CONFIG_PPC_FSL_BOOK3E
442#else
443 hugepd_free(tlb, hugepte); 456 hugepd_free(tlb, hugepte);
457#else
458 pgtable_free_tlb(tlb, hugepte, pdshift - shift);
444#endif 459#endif
445} 460}
446 461
@@ -453,14 +468,23 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
453 unsigned long start; 468 unsigned long start;
454 469
455 start = addr; 470 start = addr;
456 pmd = pmd_offset(pud, addr);
457 do { 471 do {
472 pmd = pmd_offset(pud, addr);
458 next = pmd_addr_end(addr, end); 473 next = pmd_addr_end(addr, end);
459 if (pmd_none(*pmd)) 474 if (pmd_none(*pmd))
460 continue; 475 continue;
476#ifdef CONFIG_PPC_FSL_BOOK3E
477 /*
478 * Increment next by the size of the huge mapping since
479 * there may be more than one entry at this level for a
480 * single hugepage, but all of them point to
481 * the same kmem cache that holds the hugepte.
482 */
483 next = addr + (1 << hugepd_shift(*(hugepd_t *)pmd));
484#endif
461 free_hugepd_range(tlb, (hugepd_t *)pmd, PMD_SHIFT, 485 free_hugepd_range(tlb, (hugepd_t *)pmd, PMD_SHIFT,
462 addr, next, floor, ceiling); 486 addr, next, floor, ceiling);
463 } while (pmd++, addr = next, addr != end); 487 } while (addr = next, addr != end);
464 488
465 start &= PUD_MASK; 489 start &= PUD_MASK;
466 if (start < floor) 490 if (start < floor)
@@ -487,8 +511,8 @@ static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
487 unsigned long start; 511 unsigned long start;
488 512
489 start = addr; 513 start = addr;
490 pud = pud_offset(pgd, addr);
491 do { 514 do {
515 pud = pud_offset(pgd, addr);
492 next = pud_addr_end(addr, end); 516 next = pud_addr_end(addr, end);
493 if (!is_hugepd(pud)) { 517 if (!is_hugepd(pud)) {
494 if (pud_none_or_clear_bad(pud)) 518 if (pud_none_or_clear_bad(pud))
@@ -496,10 +520,19 @@ static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
496 hugetlb_free_pmd_range(tlb, pud, addr, next, floor, 520 hugetlb_free_pmd_range(tlb, pud, addr, next, floor,
497 ceiling); 521 ceiling);
498 } else { 522 } else {
523#ifdef CONFIG_PPC_FSL_BOOK3E
524 /*
525 * Increment next by the size of the huge mapping since
526 * there may be more than one entry at this level for a
527 * single hugepage, but all of them point to
528 * the same kmem cache that holds the hugepte.
529 */
530 next = addr + (1 << hugepd_shift(*(hugepd_t *)pud));
531#endif
499 free_hugepd_range(tlb, (hugepd_t *)pud, PUD_SHIFT, 532 free_hugepd_range(tlb, (hugepd_t *)pud, PUD_SHIFT,
500 addr, next, floor, ceiling); 533 addr, next, floor, ceiling);
501 } 534 }
502 } while (pud++, addr = next, addr != end); 535 } while (addr = next, addr != end);
503 536
504 start &= PGDIR_MASK; 537 start &= PGDIR_MASK;
505 if (start < floor) 538 if (start < floor)
@@ -554,12 +587,12 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb,
554 continue; 587 continue;
555 hugetlb_free_pud_range(tlb, pgd, addr, next, floor, ceiling); 588 hugetlb_free_pud_range(tlb, pgd, addr, next, floor, ceiling);
556 } else { 589 } else {
557#ifdef CONFIG_PPC32 590#ifdef CONFIG_PPC_FSL_BOOK3E
558 /* 591 /*
559 * Increment next by the size of the huge mapping since 592 * Increment next by the size of the huge mapping since
560 * on 32-bit there may be more than one entry at the pgd 593 * there may be more than one entry at the pgd level
561 * level for a single hugepage, but all of them point to 594 * for a single hugepage, but all of them point to the
562 * the same kmem cache that holds the hugepte. 595 * same kmem cache that holds the hugepte.
563 */ 596 */
564 next = addr + (1 << hugepd_shift(*(hugepd_t *)pgd)); 597 next = addr + (1 << hugepd_shift(*(hugepd_t *)pgd));
565#endif 598#endif
@@ -697,19 +730,17 @@ int gup_hugepd(hugepd_t *hugepd, unsigned pdshift,
697 return 1; 730 return 1;
698} 731}
699 732
733#ifdef CONFIG_PPC_MM_SLICES
700unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, 734unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
701 unsigned long len, unsigned long pgoff, 735 unsigned long len, unsigned long pgoff,
702 unsigned long flags) 736 unsigned long flags)
703{ 737{
704#ifdef CONFIG_PPC_MM_SLICES
705 struct hstate *hstate = hstate_file(file); 738 struct hstate *hstate = hstate_file(file);
706 int mmu_psize = shift_to_mmu_psize(huge_page_shift(hstate)); 739 int mmu_psize = shift_to_mmu_psize(huge_page_shift(hstate));
707 740
708 return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1, 0); 741 return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1, 0);
709#else
710 return get_unmapped_area(file, addr, len, pgoff, flags);
711#endif
712} 742}
743#endif
713 744
714unsigned long vma_mmu_pagesize(struct vm_area_struct *vma) 745unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
715{ 746{
@@ -783,7 +814,7 @@ static int __init hugepage_setup_sz(char *str)
783} 814}
784__setup("hugepagesz=", hugepage_setup_sz); 815__setup("hugepagesz=", hugepage_setup_sz);
785 816
786#ifdef CONFIG_FSL_BOOKE 817#ifdef CONFIG_PPC_FSL_BOOK3E
787struct kmem_cache *hugepte_cache; 818struct kmem_cache *hugepte_cache;
788static int __init hugetlbpage_init(void) 819static int __init hugetlbpage_init(void)
789{ 820{
diff --git a/arch/powerpc/mm/icswx.c b/arch/powerpc/mm/icswx.c
new file mode 100644
index 000000000000..5d9a59eaad93
--- /dev/null
+++ b/arch/powerpc/mm/icswx.c
@@ -0,0 +1,273 @@
1/*
2 * ICSWX and ACOP Management
3 *
4 * Copyright (C) 2011 Anton Blanchard, IBM Corp. <anton@samba.org>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#include <linux/sched.h>
14#include <linux/kernel.h>
15#include <linux/errno.h>
16#include <linux/types.h>
17#include <linux/mm.h>
18#include <linux/spinlock.h>
19#include <linux/module.h>
20#include <linux/uaccess.h>
21
22#include "icswx.h"
23
24/*
25 * The processor and its L2 cache cause the icswx instruction to
26 * generate a COP_REQ transaction on PowerBus. The transaction has no
27 * address, and the processor does not perform an MMU access to
28 * authenticate the transaction. The command portion of the PowerBus
29 * COP_REQ transaction includes the LPAR_ID (LPID) and the coprocessor
30 * Process ID (PID), which the coprocessor compares to the authorized
31 * LPID and PID held in the coprocessor, to determine if the process
32 * is authorized to generate the transaction. The data of the COP_REQ
33 * transaction is 128-byte or less in size and is placed in cacheable
34 * memory on a 128-byte cache line boundary.
35 *
36 * The task to use a coprocessor should use use_cop() to mark the use
37 * of the Coprocessor Type (CT) and context switching. On a server
38 * class processor, the PID register is used only for coprocessor
39 * management + * and so a coprocessor PID is allocated before
40 * executing icswx + * instruction. Drop_cop() is used to free the
41 * coprocessor PID.
42 *
43 * Example:
44 * Host Fabric Interface (HFI) is a PowerPC network coprocessor.
45 * Each HFI have multiple windows. Each HFI window serves as a
46 * network device sending to and receiving from HFI network.
47 * HFI immediate send function uses icswx instruction. The immediate
48 * send function allows small (single cache-line) packets be sent
49 * without using the regular HFI send FIFO and doorbell, which are
50 * much slower than immediate send.
51 *
52 * For each task intending to use HFI immediate send, the HFI driver
53 * calls use_cop() to obtain a coprocessor PID for the task.
54 * The HFI driver then allocate a free HFI window and save the
55 * coprocessor PID to the HFI window to allow the task to use the
56 * HFI window.
57 *
58 * The HFI driver repeatedly creates immediate send packets and
59 * issues icswx instruction to send data through the HFI window.
60 * The HFI compares the coprocessor PID in the CPU PID register
61 * to the PID held in the HFI window to determine if the transaction
62 * is allowed.
63 *
64 * When the task to release the HFI window, the HFI driver calls
65 * drop_cop() to release the coprocessor PID.
66 */
67
68void switch_cop(struct mm_struct *next)
69{
70#ifdef CONFIG_ICSWX_PID
71 mtspr(SPRN_PID, next->context.cop_pid);
72#endif
73 mtspr(SPRN_ACOP, next->context.acop);
74}
75
76/**
77 * Start using a coprocessor.
78 * @acop: mask of coprocessor to be used.
79 * @mm: The mm the coprocessor to associate with. Most likely current mm.
80 *
81 * Return a positive PID if successful. Negative errno otherwise.
82 * The returned PID will be fed to the coprocessor to determine if an
83 * icswx transaction is authenticated.
84 */
85int use_cop(unsigned long acop, struct mm_struct *mm)
86{
87 int ret;
88
89 if (!cpu_has_feature(CPU_FTR_ICSWX))
90 return -ENODEV;
91
92 if (!mm || !acop)
93 return -EINVAL;
94
95 /* The page_table_lock ensures mm_users won't change under us */
96 spin_lock(&mm->page_table_lock);
97 spin_lock(mm->context.cop_lockp);
98
99 ret = get_cop_pid(mm);
100 if (ret < 0)
101 goto out;
102
103 /* update acop */
104 mm->context.acop |= acop;
105
106 sync_cop(mm);
107
108 /*
109 * If this is a threaded process then there might be other threads
110 * running. We need to send an IPI to force them to pick up any
111 * change in PID and ACOP.
112 */
113 if (atomic_read(&mm->mm_users) > 1)
114 smp_call_function(sync_cop, mm, 1);
115
116out:
117 spin_unlock(mm->context.cop_lockp);
118 spin_unlock(&mm->page_table_lock);
119
120 return ret;
121}
122EXPORT_SYMBOL_GPL(use_cop);
123
124/**
125 * Stop using a coprocessor.
126 * @acop: mask of coprocessor to be stopped.
127 * @mm: The mm the coprocessor associated with.
128 */
129void drop_cop(unsigned long acop, struct mm_struct *mm)
130{
131 int free_pid;
132
133 if (!cpu_has_feature(CPU_FTR_ICSWX))
134 return;
135
136 if (WARN_ON_ONCE(!mm))
137 return;
138
139 /* The page_table_lock ensures mm_users won't change under us */
140 spin_lock(&mm->page_table_lock);
141 spin_lock(mm->context.cop_lockp);
142
143 mm->context.acop &= ~acop;
144
145 free_pid = disable_cop_pid(mm);
146 sync_cop(mm);
147
148 /*
149 * If this is a threaded process then there might be other threads
150 * running. We need to send an IPI to force them to pick up any
151 * change in PID and ACOP.
152 */
153 if (atomic_read(&mm->mm_users) > 1)
154 smp_call_function(sync_cop, mm, 1);
155
156 if (free_pid != COP_PID_NONE)
157 free_cop_pid(free_pid);
158
159 spin_unlock(mm->context.cop_lockp);
160 spin_unlock(&mm->page_table_lock);
161}
162EXPORT_SYMBOL_GPL(drop_cop);
163
164static int acop_use_cop(int ct)
165{
166 /* todo */
167 return -1;
168}
169
170/*
171 * Get the instruction word at the NIP
172 */
173static u32 acop_get_inst(struct pt_regs *regs)
174{
175 u32 inst;
176 u32 __user *p;
177
178 p = (u32 __user *)regs->nip;
179 if (!access_ok(VERIFY_READ, p, sizeof(*p)))
180 return 0;
181
182 if (__get_user(inst, p))
183 return 0;
184
185 return inst;
186}
187
188/**
189 * @regs: regsiters at time of interrupt
190 * @address: storage address
191 * @error_code: Fault code, usually the DSISR or ESR depending on
192 * processor type
193 *
194 * Return 0 if we are able to resolve the data storage fault that
195 * results from a CT miss in the ACOP register.
196 */
197int acop_handle_fault(struct pt_regs *regs, unsigned long address,
198 unsigned long error_code)
199{
200 int ct;
201 u32 inst = 0;
202
203 if (!cpu_has_feature(CPU_FTR_ICSWX)) {
204 pr_info("No coprocessors available");
205 _exception(SIGILL, regs, ILL_ILLOPN, address);
206 }
207
208 if (!user_mode(regs)) {
209 /* this could happen if the HV denies the
210 * kernel access, for now we just die */
211 die("ICSWX from kernel failed", regs, SIGSEGV);
212 }
213
214 /* Some implementations leave us a hint for the CT */
215 ct = ICSWX_GET_CT_HINT(error_code);
216 if (ct < 0) {
217 /* we have to peek at the instruction word to figure out CT */
218 u32 ccw;
219 u32 rs;
220
221 inst = acop_get_inst(regs);
222 if (inst == 0)
223 return -1;
224
225 rs = (inst >> (31 - 10)) & 0x1f;
226 ccw = regs->gpr[rs];
227 ct = (ccw >> 16) & 0x3f;
228 }
229
230 if (!acop_use_cop(ct))
231 return 0;
232
233 /* at this point the CT is unknown to the system */
234 pr_warn("%s[%d]: Coprocessor %d is unavailable",
235 current->comm, current->pid, ct);
236
237 /* get inst if we don't already have it */
238 if (inst == 0) {
239 inst = acop_get_inst(regs);
240 if (inst == 0)
241 return -1;
242 }
243
244 /* Check if the instruction is the "record form" */
245 if (inst & 1) {
246 /*
247 * the instruction is "record" form so we can reject
248 * using CR0
249 */
250 regs->ccr &= ~(0xful << 28);
251 regs->ccr |= ICSWX_RC_NOT_FOUND << 28;
252
253 /* Move on to the next instruction */
254 regs->nip += 4;
255 } else {
256 /*
257 * There is no architected mechanism to report a bad
258 * CT so we could either SIGILL or report nothing.
259 * Since the non-record version should only bu used
260 * for "hints" or "don't care" we should probably do
261 * nothing. However, I could see how some people
262 * might want an SIGILL so it here if you want it.
263 */
264#ifdef CONFIG_PPC_ICSWX_USE_SIGILL
265 _exception(SIGILL, regs, ILL_ILLOPN, address);
266#else
267 regs->nip += 4;
268#endif
269 }
270
271 return 0;
272}
273EXPORT_SYMBOL_GPL(acop_handle_fault);
diff --git a/arch/powerpc/mm/icswx.h b/arch/powerpc/mm/icswx.h
new file mode 100644
index 000000000000..42176bd0884c
--- /dev/null
+++ b/arch/powerpc/mm/icswx.h
@@ -0,0 +1,62 @@
1#ifndef _ARCH_POWERPC_MM_ICSWX_H_
2#define _ARCH_POWERPC_MM_ICSWX_H_
3
4/*
5 * ICSWX and ACOP Management
6 *
7 * Copyright (C) 2011 Anton Blanchard, IBM Corp. <anton@samba.org>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16#include <asm/mmu_context.h>
17
18/* also used to denote that PIDs are not used */
19#define COP_PID_NONE 0
20
21static inline void sync_cop(void *arg)
22{
23 struct mm_struct *mm = arg;
24
25 if (mm == current->active_mm)
26 switch_cop(current->active_mm);
27}
28
29#ifdef CONFIG_PPC_ICSWX_PID
30extern int get_cop_pid(struct mm_struct *mm);
31extern int disable_cop_pid(struct mm_struct *mm);
32extern void free_cop_pid(int free_pid);
33#else
34#define get_cop_pid(m) (COP_PID_NONE)
35#define disable_cop_pid(m) (COP_PID_NONE)
36#define free_cop_pid(p)
37#endif
38
39/*
40 * These are implementation bits for architected registers. If this
41 * ever becomes architecture the should be moved to reg.h et. al.
42 */
43/* UCT is the same bit for Server and Embedded */
44#define ICSWX_DSI_UCT 0x00004000 /* Unavailable Coprocessor Type */
45
46#ifdef CONFIG_PPC_BOOK3E
47/* Embedded implementation gives us no hints as to what the CT is */
48#define ICSWX_GET_CT_HINT(x) (-1)
49#else
50/* Server implementation contains the CT value in the DSISR */
51#define ICSWX_DSISR_CTMASK 0x00003f00
52#define ICSWX_GET_CT_HINT(x) (((x) & ICSWX_DSISR_CTMASK) >> 8)
53#endif
54
55#define ICSWX_RC_STARTED 0x8 /* The request has been started */
56#define ICSWX_RC_NOT_IDLE 0x4 /* No coprocessor found idle */
57#define ICSWX_RC_NOT_FOUND 0x2 /* No coprocessor found */
58#define ICSWX_RC_UNDEFINED 0x1 /* Reserved */
59
60extern int acop_handle_fault(struct pt_regs *regs, unsigned long address,
61 unsigned long error_code);
62#endif /* !_ARCH_POWERPC_MM_ICSWX_H_ */
diff --git a/arch/powerpc/mm/icswx_pid.c b/arch/powerpc/mm/icswx_pid.c
new file mode 100644
index 000000000000..91e30eb7d054
--- /dev/null
+++ b/arch/powerpc/mm/icswx_pid.c
@@ -0,0 +1,87 @@
1/*
2 * ICSWX and ACOP/PID Management
3 *
4 * Copyright (C) 2011 Anton Blanchard, IBM Corp. <anton@samba.org>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#include <linux/sched.h>
14#include <linux/kernel.h>
15#include <linux/errno.h>
16#include <linux/types.h>
17#include <linux/mm.h>
18#include <linux/spinlock.h>
19#include <linux/idr.h>
20#include <linux/module.h>
21#include "icswx.h"
22
23#define COP_PID_MIN (COP_PID_NONE + 1)
24#define COP_PID_MAX (0xFFFF)
25
26static DEFINE_SPINLOCK(mmu_context_acop_lock);
27static DEFINE_IDA(cop_ida);
28
29static int new_cop_pid(struct ida *ida, int min_id, int max_id,
30 spinlock_t *lock)
31{
32 int index;
33 int err;
34
35again:
36 if (!ida_pre_get(ida, GFP_KERNEL))
37 return -ENOMEM;
38
39 spin_lock(lock);
40 err = ida_get_new_above(ida, min_id, &index);
41 spin_unlock(lock);
42
43 if (err == -EAGAIN)
44 goto again;
45 else if (err)
46 return err;
47
48 if (index > max_id) {
49 spin_lock(lock);
50 ida_remove(ida, index);
51 spin_unlock(lock);
52 return -ENOMEM;
53 }
54
55 return index;
56}
57
58int get_cop_pid(struct mm_struct *mm)
59{
60 int pid;
61
62 if (mm->context.cop_pid == COP_PID_NONE) {
63 pid = new_cop_pid(&cop_ida, COP_PID_MIN, COP_PID_MAX,
64 &mmu_context_acop_lock);
65 if (pid >= 0)
66 mm->context.cop_pid = pid;
67 }
68 return mm->context.cop_pid;
69}
70
71int disable_cop_pid(struct mm_struct *mm)
72{
73 int free_pid = COP_PID_NONE;
74
75 if ((!mm->context.acop) && (mm->context.cop_pid != COP_PID_NONE)) {
76 free_pid = mm->context.cop_pid;
77 mm->context.cop_pid = COP_PID_NONE;
78 }
79 return free_pid;
80}
81
82void free_cop_pid(int free_pid)
83{
84 spin_lock(&mmu_context_acop_lock);
85 ida_remove(&cop_ida, free_pid);
86 spin_unlock(&mmu_context_acop_lock);
87}
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 161cefde5c15..6157be2a7049 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -65,6 +65,13 @@ phys_addr_t memstart_addr = (phys_addr_t)~0ull;
65EXPORT_SYMBOL(memstart_addr); 65EXPORT_SYMBOL(memstart_addr);
66phys_addr_t kernstart_addr; 66phys_addr_t kernstart_addr;
67EXPORT_SYMBOL(kernstart_addr); 67EXPORT_SYMBOL(kernstart_addr);
68
69#ifdef CONFIG_RELOCATABLE_PPC32
70/* Used in __va()/__pa() */
71long long virt_phys_offset;
72EXPORT_SYMBOL(virt_phys_offset);
73#endif
74
68phys_addr_t lowmem_end_addr; 75phys_addr_t lowmem_end_addr;
69 76
70int boot_mapsize; 77int boot_mapsize;
@@ -134,8 +141,7 @@ void __init MMU_init(void)
134 141
135 if (memblock.memory.cnt > 1) { 142 if (memblock.memory.cnt > 1) {
136#ifndef CONFIG_WII 143#ifndef CONFIG_WII
137 memblock.memory.cnt = 1; 144 memblock_enforce_memory_limit(memblock.memory.regions[0].size);
138 memblock_analyze();
139 printk(KERN_WARNING "Only using first contiguous memory region"); 145 printk(KERN_WARNING "Only using first contiguous memory region");
140#else 146#else
141 wii_memory_fixups(); 147 wii_memory_fixups();
@@ -158,7 +164,6 @@ void __init MMU_init(void)
158#ifndef CONFIG_HIGHMEM 164#ifndef CONFIG_HIGHMEM
159 total_memory = total_lowmem; 165 total_memory = total_lowmem;
160 memblock_enforce_memory_limit(total_lowmem); 166 memblock_enforce_memory_limit(total_lowmem);
161 memblock_analyze();
162#endif /* CONFIG_HIGHMEM */ 167#endif /* CONFIG_HIGHMEM */
163 } 168 }
164 169
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 2dd6bdd31fe1..d974b79a3068 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -51,6 +51,7 @@
51#include <asm/vdso.h> 51#include <asm/vdso.h>
52#include <asm/fixmap.h> 52#include <asm/fixmap.h>
53#include <asm/swiotlb.h> 53#include <asm/swiotlb.h>
54#include <asm/rtas.h>
54 55
55#include "mmu_decl.h" 56#include "mmu_decl.h"
56 57
@@ -199,7 +200,7 @@ void __init do_init_bootmem(void)
199 unsigned long start_pfn, end_pfn; 200 unsigned long start_pfn, end_pfn;
200 start_pfn = memblock_region_memory_base_pfn(reg); 201 start_pfn = memblock_region_memory_base_pfn(reg);
201 end_pfn = memblock_region_memory_end_pfn(reg); 202 end_pfn = memblock_region_memory_end_pfn(reg);
202 add_active_range(0, start_pfn, end_pfn); 203 memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
203 } 204 }
204 205
205 /* Add all physical memory to the bootmem map, mark each area 206 /* Add all physical memory to the bootmem map, mark each area
@@ -553,7 +554,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
553#if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \ 554#if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \
554 && defined(CONFIG_HUGETLB_PAGE) 555 && defined(CONFIG_HUGETLB_PAGE)
555 if (is_vm_hugetlb_page(vma)) 556 if (is_vm_hugetlb_page(vma))
556 book3e_hugetlb_preload(vma->vm_mm, address, *ptep); 557 book3e_hugetlb_preload(vma, address, *ptep);
557#endif 558#endif
558} 559}
559 560
@@ -585,3 +586,23 @@ static int add_system_ram_resources(void)
585 return 0; 586 return 0;
586} 587}
587subsys_initcall(add_system_ram_resources); 588subsys_initcall(add_system_ram_resources);
589
590#ifdef CONFIG_STRICT_DEVMEM
591/*
592 * devmem_is_allowed(): check to see if /dev/mem access to a certain address
593 * is valid. The argument is a physical page number.
594 *
595 * Access has to be given to non-kernel-ram areas as well, these contain the
596 * PCI mmio resources as well as potential bios/acpi data regions.
597 */
598int devmem_is_allowed(unsigned long pfn)
599{
600 if (iomem_is_exclusive(pfn << PAGE_SHIFT))
601 return 0;
602 if (!page_is_ram(pfn))
603 return 1;
604 if (page_is_rtas_user_buf(pfn))
605 return 1;
606 return 0;
607}
608#endif /* CONFIG_STRICT_DEVMEM */
diff --git a/arch/powerpc/mm/mmap_64.c b/arch/powerpc/mm/mmap_64.c
index 5a783d8e8e8e..67a42ed0d2fc 100644
--- a/arch/powerpc/mm/mmap_64.c
+++ b/arch/powerpc/mm/mmap_64.c
@@ -53,14 +53,6 @@ static inline int mmap_is_legacy(void)
53 return sysctl_legacy_va_layout; 53 return sysctl_legacy_va_layout;
54} 54}
55 55
56/*
57 * Since get_random_int() returns the same value within a 1 jiffy window,
58 * we will almost always get the same randomisation for the stack and mmap
59 * region. This will mean the relative distance between stack and mmap will
60 * be the same.
61 *
62 * To avoid this we can shift the randomness by 1 bit.
63 */
64static unsigned long mmap_rnd(void) 56static unsigned long mmap_rnd(void)
65{ 57{
66 unsigned long rnd = 0; 58 unsigned long rnd = 0;
@@ -68,11 +60,11 @@ static unsigned long mmap_rnd(void)
68 if (current->flags & PF_RANDOMIZE) { 60 if (current->flags & PF_RANDOMIZE) {
69 /* 8MB for 32bit, 1GB for 64bit */ 61 /* 8MB for 32bit, 1GB for 64bit */
70 if (is_32bit_task()) 62 if (is_32bit_task())
71 rnd = (long)(get_random_int() % (1<<(22-PAGE_SHIFT))); 63 rnd = (long)(get_random_int() % (1<<(23-PAGE_SHIFT)));
72 else 64 else
73 rnd = (long)(get_random_int() % (1<<(29-PAGE_SHIFT))); 65 rnd = (long)(get_random_int() % (1<<(30-PAGE_SHIFT)));
74 } 66 }
75 return (rnd << PAGE_SHIFT) * 2; 67 return rnd << PAGE_SHIFT;
76} 68}
77 69
78static inline unsigned long mmap_base(void) 70static inline unsigned long mmap_base(void)
diff --git a/arch/powerpc/mm/mmu_context_hash64.c b/arch/powerpc/mm/mmu_context_hash64.c
index ca988a3d5fb2..40677aa0190e 100644
--- a/arch/powerpc/mm/mmu_context_hash64.c
+++ b/arch/powerpc/mm/mmu_context_hash64.c
@@ -24,200 +24,7 @@
24 24
25#include <asm/mmu_context.h> 25#include <asm/mmu_context.h>
26 26
27#ifdef CONFIG_PPC_ICSWX 27#include "icswx.h"
28/*
29 * The processor and its L2 cache cause the icswx instruction to
30 * generate a COP_REQ transaction on PowerBus. The transaction has
31 * no address, and the processor does not perform an MMU access
32 * to authenticate the transaction. The command portion of the
33 * PowerBus COP_REQ transaction includes the LPAR_ID (LPID) and
34 * the coprocessor Process ID (PID), which the coprocessor compares
35 * to the authorized LPID and PID held in the coprocessor, to determine
36 * if the process is authorized to generate the transaction.
37 * The data of the COP_REQ transaction is 128-byte or less and is
38 * placed in cacheable memory on a 128-byte cache line boundary.
39 *
40 * The task to use a coprocessor should use use_cop() to allocate
41 * a coprocessor PID before executing icswx instruction. use_cop()
42 * also enables the coprocessor context switching. Drop_cop() is
43 * used to free the coprocessor PID.
44 *
45 * Example:
46 * Host Fabric Interface (HFI) is a PowerPC network coprocessor.
47 * Each HFI have multiple windows. Each HFI window serves as a
48 * network device sending to and receiving from HFI network.
49 * HFI immediate send function uses icswx instruction. The immediate
50 * send function allows small (single cache-line) packets be sent
51 * without using the regular HFI send FIFO and doorbell, which are
52 * much slower than immediate send.
53 *
54 * For each task intending to use HFI immediate send, the HFI driver
55 * calls use_cop() to obtain a coprocessor PID for the task.
56 * The HFI driver then allocate a free HFI window and save the
57 * coprocessor PID to the HFI window to allow the task to use the
58 * HFI window.
59 *
60 * The HFI driver repeatedly creates immediate send packets and
61 * issues icswx instruction to send data through the HFI window.
62 * The HFI compares the coprocessor PID in the CPU PID register
63 * to the PID held in the HFI window to determine if the transaction
64 * is allowed.
65 *
66 * When the task to release the HFI window, the HFI driver calls
67 * drop_cop() to release the coprocessor PID.
68 */
69
70#define COP_PID_NONE 0
71#define COP_PID_MIN (COP_PID_NONE + 1)
72#define COP_PID_MAX (0xFFFF)
73
74static DEFINE_SPINLOCK(mmu_context_acop_lock);
75static DEFINE_IDA(cop_ida);
76
77void switch_cop(struct mm_struct *next)
78{
79 mtspr(SPRN_PID, next->context.cop_pid);
80 mtspr(SPRN_ACOP, next->context.acop);
81}
82
83static int new_cop_pid(struct ida *ida, int min_id, int max_id,
84 spinlock_t *lock)
85{
86 int index;
87 int err;
88
89again:
90 if (!ida_pre_get(ida, GFP_KERNEL))
91 return -ENOMEM;
92
93 spin_lock(lock);
94 err = ida_get_new_above(ida, min_id, &index);
95 spin_unlock(lock);
96
97 if (err == -EAGAIN)
98 goto again;
99 else if (err)
100 return err;
101
102 if (index > max_id) {
103 spin_lock(lock);
104 ida_remove(ida, index);
105 spin_unlock(lock);
106 return -ENOMEM;
107 }
108
109 return index;
110}
111
112static void sync_cop(void *arg)
113{
114 struct mm_struct *mm = arg;
115
116 if (mm == current->active_mm)
117 switch_cop(current->active_mm);
118}
119
120/**
121 * Start using a coprocessor.
122 * @acop: mask of coprocessor to be used.
123 * @mm: The mm the coprocessor to associate with. Most likely current mm.
124 *
125 * Return a positive PID if successful. Negative errno otherwise.
126 * The returned PID will be fed to the coprocessor to determine if an
127 * icswx transaction is authenticated.
128 */
129int use_cop(unsigned long acop, struct mm_struct *mm)
130{
131 int ret;
132
133 if (!cpu_has_feature(CPU_FTR_ICSWX))
134 return -ENODEV;
135
136 if (!mm || !acop)
137 return -EINVAL;
138
139 /* The page_table_lock ensures mm_users won't change under us */
140 spin_lock(&mm->page_table_lock);
141 spin_lock(mm->context.cop_lockp);
142
143 if (mm->context.cop_pid == COP_PID_NONE) {
144 ret = new_cop_pid(&cop_ida, COP_PID_MIN, COP_PID_MAX,
145 &mmu_context_acop_lock);
146 if (ret < 0)
147 goto out;
148
149 mm->context.cop_pid = ret;
150 }
151 mm->context.acop |= acop;
152
153 sync_cop(mm);
154
155 /*
156 * If this is a threaded process then there might be other threads
157 * running. We need to send an IPI to force them to pick up any
158 * change in PID and ACOP.
159 */
160 if (atomic_read(&mm->mm_users) > 1)
161 smp_call_function(sync_cop, mm, 1);
162
163 ret = mm->context.cop_pid;
164
165out:
166 spin_unlock(mm->context.cop_lockp);
167 spin_unlock(&mm->page_table_lock);
168
169 return ret;
170}
171EXPORT_SYMBOL_GPL(use_cop);
172
173/**
174 * Stop using a coprocessor.
175 * @acop: mask of coprocessor to be stopped.
176 * @mm: The mm the coprocessor associated with.
177 */
178void drop_cop(unsigned long acop, struct mm_struct *mm)
179{
180 int free_pid = COP_PID_NONE;
181
182 if (!cpu_has_feature(CPU_FTR_ICSWX))
183 return;
184
185 if (WARN_ON_ONCE(!mm))
186 return;
187
188 /* The page_table_lock ensures mm_users won't change under us */
189 spin_lock(&mm->page_table_lock);
190 spin_lock(mm->context.cop_lockp);
191
192 mm->context.acop &= ~acop;
193
194 if ((!mm->context.acop) && (mm->context.cop_pid != COP_PID_NONE)) {
195 free_pid = mm->context.cop_pid;
196 mm->context.cop_pid = COP_PID_NONE;
197 }
198
199 sync_cop(mm);
200
201 /*
202 * If this is a threaded process then there might be other threads
203 * running. We need to send an IPI to force them to pick up any
204 * change in PID and ACOP.
205 */
206 if (atomic_read(&mm->mm_users) > 1)
207 smp_call_function(sync_cop, mm, 1);
208
209 if (free_pid != COP_PID_NONE) {
210 spin_lock(&mmu_context_acop_lock);
211 ida_remove(&cop_ida, free_pid);
212 spin_unlock(&mmu_context_acop_lock);
213 }
214
215 spin_unlock(mm->context.cop_lockp);
216 spin_unlock(&mm->page_table_lock);
217}
218EXPORT_SYMBOL_GPL(drop_cop);
219
220#endif /* CONFIG_PPC_ICSWX */
221 28
222static DEFINE_SPINLOCK(mmu_context_lock); 29static DEFINE_SPINLOCK(mmu_context_lock);
223static DEFINE_IDA(mmu_context_ida); 30static DEFINE_IDA(mmu_context_ida);
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b22a83a91cb8..4ff3d8e411a7 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -127,45 +127,25 @@ static int __cpuinit fake_numa_create_new_node(unsigned long end_pfn,
127} 127}
128 128
129/* 129/*
130 * get_active_region_work_fn - A helper function for get_node_active_region 130 * get_node_active_region - Return active region containing pfn
131 * Returns datax set to the start_pfn and end_pfn if they contain
132 * the initial value of datax->start_pfn between them
133 * @start_pfn: start page(inclusive) of region to check
134 * @end_pfn: end page(exclusive) of region to check
135 * @datax: comes in with ->start_pfn set to value to search for and
136 * goes out with active range if it contains it
137 * Returns 1 if search value is in range else 0
138 */
139static int __init get_active_region_work_fn(unsigned long start_pfn,
140 unsigned long end_pfn, void *datax)
141{
142 struct node_active_region *data;
143 data = (struct node_active_region *)datax;
144
145 if (start_pfn <= data->start_pfn && end_pfn > data->start_pfn) {
146 data->start_pfn = start_pfn;
147 data->end_pfn = end_pfn;
148 return 1;
149 }
150 return 0;
151
152}
153
154/*
155 * get_node_active_region - Return active region containing start_pfn
156 * Active range returned is empty if none found. 131 * Active range returned is empty if none found.
157 * @start_pfn: The page to return the region for. 132 * @pfn: The page to return the region for
158 * @node_ar: Returned set to the active region containing start_pfn 133 * @node_ar: Returned set to the active region containing @pfn
159 */ 134 */
160static void __init get_node_active_region(unsigned long start_pfn, 135static void __init get_node_active_region(unsigned long pfn,
161 struct node_active_region *node_ar) 136 struct node_active_region *node_ar)
162{ 137{
163 int nid = early_pfn_to_nid(start_pfn); 138 unsigned long start_pfn, end_pfn;
139 int i, nid;
164 140
165 node_ar->nid = nid; 141 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
166 node_ar->start_pfn = start_pfn; 142 if (pfn >= start_pfn && pfn < end_pfn) {
167 node_ar->end_pfn = start_pfn; 143 node_ar->nid = nid;
168 work_with_active_regions(nid, get_active_region_work_fn, node_ar); 144 node_ar->start_pfn = start_pfn;
145 node_ar->end_pfn = end_pfn;
146 break;
147 }
148 }
169} 149}
170 150
171static void map_cpu_to_node(int cpu, int node) 151static void map_cpu_to_node(int cpu, int node)
@@ -406,7 +386,7 @@ static void __init get_n_mem_cells(int *n_addr_cells, int *n_size_cells)
406 of_node_put(memory); 386 of_node_put(memory);
407} 387}
408 388
409static unsigned long __devinit read_n_cells(int n, const unsigned int **buf) 389static unsigned long read_n_cells(int n, const unsigned int **buf)
410{ 390{
411 unsigned long result = 0; 391 unsigned long result = 0;
412 392
@@ -521,7 +501,7 @@ static int of_get_assoc_arrays(struct device_node *memory,
521 aa->n_arrays = *prop++; 501 aa->n_arrays = *prop++;
522 aa->array_sz = *prop++; 502 aa->array_sz = *prop++;
523 503
524 /* Now that we know the number of arrrays and size of each array, 504 /* Now that we know the number of arrays and size of each array,
525 * revalidate the size of the property read in. 505 * revalidate the size of the property read in.
526 */ 506 */
527 if (len < (aa->n_arrays * aa->array_sz + 2) * sizeof(unsigned int)) 507 if (len < (aa->n_arrays * aa->array_sz + 2) * sizeof(unsigned int))
@@ -710,9 +690,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
710 node_set_online(nid); 690 node_set_online(nid);
711 sz = numa_enforce_memory_limit(base, size); 691 sz = numa_enforce_memory_limit(base, size);
712 if (sz) 692 if (sz)
713 add_active_range(nid, base >> PAGE_SHIFT, 693 memblock_set_node(base, sz, nid);
714 (base >> PAGE_SHIFT)
715 + (sz >> PAGE_SHIFT));
716 } while (--ranges); 694 } while (--ranges);
717 } 695 }
718} 696}
@@ -802,8 +780,7 @@ new_range:
802 continue; 780 continue;
803 } 781 }
804 782
805 add_active_range(nid, start >> PAGE_SHIFT, 783 memblock_set_node(start, size, nid);
806 (start >> PAGE_SHIFT) + (size >> PAGE_SHIFT));
807 784
808 if (--ranges) 785 if (--ranges)
809 goto new_range; 786 goto new_range;
@@ -839,7 +816,8 @@ static void __init setup_nonnuma(void)
839 end_pfn = memblock_region_memory_end_pfn(reg); 816 end_pfn = memblock_region_memory_end_pfn(reg);
840 817
841 fake_numa_create_new_node(end_pfn, &nid); 818 fake_numa_create_new_node(end_pfn, &nid);
842 add_active_range(nid, start_pfn, end_pfn); 819 memblock_set_node(PFN_PHYS(start_pfn),
820 PFN_PHYS(end_pfn - start_pfn), nid);
843 node_set_online(nid); 821 node_set_online(nid);
844 } 822 }
845} 823}
@@ -969,7 +947,7 @@ static struct notifier_block __cpuinitdata ppc64_numa_nb = {
969 .priority = 1 /* Must run before sched domains notifier. */ 947 .priority = 1 /* Must run before sched domains notifier. */
970}; 948};
971 949
972static void mark_reserved_regions_for_nid(int nid) 950static void __init mark_reserved_regions_for_nid(int nid)
973{ 951{
974 struct pglist_data *node = NODE_DATA(nid); 952 struct pglist_data *node = NODE_DATA(nid);
975 struct memblock_region *reg; 953 struct memblock_region *reg;
@@ -1462,7 +1440,7 @@ int arch_update_cpu_topology(void)
1462{ 1440{
1463 int cpu, nid, old_nid; 1441 int cpu, nid, old_nid;
1464 unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0}; 1442 unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0};
1465 struct sys_device *sysdev; 1443 struct device *dev;
1466 1444
1467 for_each_cpu(cpu,&cpu_associativity_changes_mask) { 1445 for_each_cpu(cpu,&cpu_associativity_changes_mask) {
1468 vphn_get_associativity(cpu, associativity); 1446 vphn_get_associativity(cpu, associativity);
@@ -1483,9 +1461,9 @@ int arch_update_cpu_topology(void)
1483 register_cpu_under_node(cpu, nid); 1461 register_cpu_under_node(cpu, nid);
1484 put_online_cpus(); 1462 put_online_cpus();
1485 1463
1486 sysdev = get_cpu_sysdev(cpu); 1464 dev = get_cpu_device(cpu);
1487 if (sysdev) 1465 if (dev)
1488 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); 1466 kobject_uevent(&dev->kobj, KOBJ_CHANGE);
1489 } 1467 }
1490 1468
1491 return 1; 1469 return 1;
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index dc4a5f385e41..ff672bd8fea9 100644
--- a/arch/powerpc/mm/tlb_low_64e.S
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -94,11 +94,11 @@
94 94
95 srdi r15,r16,60 /* get region */ 95 srdi r15,r16,60 /* get region */
96 rldicl. r10,r16,64-PGTABLE_EADDR_SIZE,PGTABLE_EADDR_SIZE+4 96 rldicl. r10,r16,64-PGTABLE_EADDR_SIZE,PGTABLE_EADDR_SIZE+4
97 bne- dtlb_miss_fault_bolted 97 bne- dtlb_miss_fault_bolted /* Bail if fault addr is invalid */
98 98
99 rlwinm r10,r11,32-19,27,27 99 rlwinm r10,r11,32-19,27,27
100 rlwimi r10,r11,32-16,19,19 100 rlwimi r10,r11,32-16,19,19
101 cmpwi r15,0 101 cmpwi r15,0 /* user vs kernel check */
102 ori r10,r10,_PAGE_PRESENT 102 ori r10,r10,_PAGE_PRESENT
103 oris r11,r10,_PAGE_ACCESSED@h 103 oris r11,r10,_PAGE_ACCESSED@h
104 104
@@ -120,44 +120,38 @@ tlb_miss_common_bolted:
120 rldicl r15,r16,64-PGDIR_SHIFT+3,64-PGD_INDEX_SIZE-3 120 rldicl r15,r16,64-PGDIR_SHIFT+3,64-PGD_INDEX_SIZE-3
121 cmpldi cr0,r14,0 121 cmpldi cr0,r14,0
122 clrrdi r15,r15,3 122 clrrdi r15,r15,3
123 beq tlb_miss_fault_bolted 123 beq tlb_miss_fault_bolted /* No PGDIR, bail */
124 124
125BEGIN_MMU_FTR_SECTION 125BEGIN_MMU_FTR_SECTION
126 /* Set the TLB reservation and search for existing entry. Then load 126 /* Set the TLB reservation and search for existing entry. Then load
127 * the entry. 127 * the entry.
128 */ 128 */
129 PPC_TLBSRX_DOT(0,r16) 129 PPC_TLBSRX_DOT(0,r16)
130 ldx r14,r14,r15 130 ldx r14,r14,r15 /* grab pgd entry */
131 beq normal_tlb_miss_done 131 beq normal_tlb_miss_done /* tlb exists already, bail */
132MMU_FTR_SECTION_ELSE 132MMU_FTR_SECTION_ELSE
133 ldx r14,r14,r15 133 ldx r14,r14,r15 /* grab pgd entry */
134ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_USE_TLBRSRV) 134ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_USE_TLBRSRV)
135 135
136#ifndef CONFIG_PPC_64K_PAGES 136#ifndef CONFIG_PPC_64K_PAGES
137 rldicl r15,r16,64-PUD_SHIFT+3,64-PUD_INDEX_SIZE-3 137 rldicl r15,r16,64-PUD_SHIFT+3,64-PUD_INDEX_SIZE-3
138 clrrdi r15,r15,3 138 clrrdi r15,r15,3
139 139 cmpdi cr0,r14,0
140 cmpldi cr0,r14,0 140 bge tlb_miss_fault_bolted /* Bad pgd entry or hugepage; bail */
141 beq tlb_miss_fault_bolted 141 ldx r14,r14,r15 /* grab pud entry */
142
143 ldx r14,r14,r15
144#endif /* CONFIG_PPC_64K_PAGES */ 142#endif /* CONFIG_PPC_64K_PAGES */
145 143
146 rldicl r15,r16,64-PMD_SHIFT+3,64-PMD_INDEX_SIZE-3 144 rldicl r15,r16,64-PMD_SHIFT+3,64-PMD_INDEX_SIZE-3
147 clrrdi r15,r15,3 145 clrrdi r15,r15,3
148 146 cmpdi cr0,r14,0
149 cmpldi cr0,r14,0 147 bge tlb_miss_fault_bolted
150 beq tlb_miss_fault_bolted 148 ldx r14,r14,r15 /* Grab pmd entry */
151
152 ldx r14,r14,r15
153 149
154 rldicl r15,r16,64-PAGE_SHIFT+3,64-PTE_INDEX_SIZE-3 150 rldicl r15,r16,64-PAGE_SHIFT+3,64-PTE_INDEX_SIZE-3
155 clrrdi r15,r15,3 151 clrrdi r15,r15,3
156 152 cmpdi cr0,r14,0
157 cmpldi cr0,r14,0 153 bge tlb_miss_fault_bolted
158 beq tlb_miss_fault_bolted 154 ldx r14,r14,r15 /* Grab PTE, normal (!huge) page */
159
160 ldx r14,r14,r15
161 155
162 /* Check if required permissions are met */ 156 /* Check if required permissions are met */
163 andc. r15,r11,r14 157 andc. r15,r11,r14
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index 4e13d6f9023e..df32a838dcfa 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -52,7 +52,7 @@
52 * indirect page table entries. 52 * indirect page table entries.
53 */ 53 */
54#ifdef CONFIG_PPC_BOOK3E_MMU 54#ifdef CONFIG_PPC_BOOK3E_MMU
55#ifdef CONFIG_FSL_BOOKE 55#ifdef CONFIG_PPC_FSL_BOOK3E
56struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = { 56struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = {
57 [MMU_PAGE_4K] = { 57 [MMU_PAGE_4K] = {
58 .shift = 12, 58 .shift = 12,
@@ -615,7 +615,6 @@ static void __early_init_mmu(int boot_cpu)
615 615
616 /* limit memory so we dont have linear faults */ 616 /* limit memory so we dont have linear faults */
617 memblock_enforce_memory_limit(linear_map_top); 617 memblock_enforce_memory_limit(linear_map_top);
618 memblock_analyze();
619 618
620 patch_exception(0x1c0, exc_data_tlb_miss_bolted_book3e); 619 patch_exception(0x1c0, exc_data_tlb_miss_bolted_book3e);
621 patch_exception(0x1e0, exc_instruction_tlb_miss_bolted_book3e); 620 patch_exception(0x1e0, exc_instruction_tlb_miss_bolted_book3e);
diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index 153022971daa..a392d12dd21f 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -1,19 +1,3 @@
1#config BUBINGA
2# bool "Bubinga"
3# depends on 40x
4# default n
5# select 405EP
6# help
7# This option enables support for the IBM 405EP evaluation board.
8
9#config CPCI405
10# bool "CPCI405"
11# depends on 40x
12# default n
13# select 405GP
14# help
15# This option enables support for the CPCI405 board.
16
17config ACADIA 1config ACADIA
18 bool "Acadia" 2 bool "Acadia"
19 depends on 40x 3 depends on 40x
@@ -65,14 +49,6 @@ config MAKALU
65 help 49 help
66 This option enables support for the AMCC PPC405EX board. 50 This option enables support for the AMCC PPC405EX board.
67 51
68#config SYCAMORE
69# bool "Sycamore"
70# depends on 40x
71# default n
72# select 405GPR
73# help
74# This option enables support for the IBM PPC405GPr evaluation board.
75
76config WALNUT 52config WALNUT
77 bool "Walnut" 53 bool "Walnut"
78 depends on 40x 54 depends on 40x
@@ -100,6 +76,16 @@ config XILINX_VIRTEX_GENERIC_BOARD
100 Most Virtex designs should use this unless it needs to do some 76 Most Virtex designs should use this unless it needs to do some
101 special configuration at board probe time. 77 special configuration at board probe time.
102 78
79config OBS600
80 bool "OpenBlockS 600"
81 depends on 40x
82 default n
83 select 405EX
84 select PPC40x_SIMPLE
85 help
86 This option enables support for PlatHome OpenBlockS 600 server
87
88
103config PPC40x_SIMPLE 89config PPC40x_SIMPLE
104 bool "Simple PowerPC 40x board support" 90 bool "Simple PowerPC 40x board support"
105 depends on 40x 91 depends on 40x
@@ -173,16 +159,11 @@ config IBM405_ERR77
173config IBM405_ERR51 159config IBM405_ERR51
174 bool 160 bool
175 161
176#config BIOS_FIXUP 162config APM8018X
177# bool 163 bool "APM8018X"
178# depends on BUBINGA || EP405 || SYCAMORE || WALNUT 164 depends on 40x
179# default y 165 default n
180 166 select PPC40x_SIMPLE
181#config PPC4xx_DMA 167 help
182# bool "PPC4xx DMA controller support" 168 This option enables support for the AppliedMicro APM8018X evaluation
183# depends on 4xx 169 board.
184
185#config PPC4xx_EDMA
186# bool
187# depends on !STB03xxx && PPC4xx_DMA
188# default y
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
index e8dd5c5df7d9..97612068fae3 100644
--- a/arch/powerpc/platforms/40x/ppc40x_simple.c
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -55,7 +55,9 @@ static const char *board[] __initdata = {
55 "amcc,haleakala", 55 "amcc,haleakala",
56 "amcc,kilauea", 56 "amcc,kilauea",
57 "amcc,makalu", 57 "amcc,makalu",
58 "est,hotfoot" 58 "apm,klondike",
59 "est,hotfoot",
60 "plathome,obs600"
59}; 61};
60 62
61static int __init ppc40x_probe(void) 63static int __init ppc40x_probe(void)
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 762322ce24a9..fcf6bf2ceee9 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -75,7 +75,7 @@ config KATMAI
75 select PCI 75 select PCI
76 select PPC4xx_PCI_EXPRESS 76 select PPC4xx_PCI_EXPRESS
77 select PCI_MSI 77 select PCI_MSI
78 select PCC4xx_MSI 78 select PPC4xx_MSI
79 help 79 help
80 This option enables support for the AMCC PPC440SPe evaluation board. 80 This option enables support for the AMCC PPC440SPe evaluation board.
81 81
@@ -186,6 +186,16 @@ config ISS4xx
186 help 186 help
187 This option enables support for the IBM ISS simulation environment 187 This option enables support for the IBM ISS simulation environment
188 188
189config CURRITUCK
190 bool "IBM Currituck (476fpe) Support"
191 depends on PPC_47x
192 default n
193 select SWIOTLB
194 select 476FPE
195 select PPC4xx_PCI_EXPRESS
196 help
197 This option enables support for the IBM Currituck (476fpe) evaluation board
198
189config ICON 199config ICON
190 bool "Icon" 200 bool "Icon"
191 depends on 44x 201 depends on 44x
@@ -197,22 +207,6 @@ config ICON
197 help 207 help
198 This option enables support for the AMCC PPC440SPe evaluation board. 208 This option enables support for the AMCC PPC440SPe evaluation board.
199 209
200#config LUAN
201# bool "Luan"
202# depends on 44x
203# default n
204# select 440SP
205# help
206# This option enables support for the IBM PPC440SP evaluation board.
207
208#config OCOTEA
209# bool "Ocotea"
210# depends on 44x
211# default n
212# select 440GX
213# help
214# This option enables support for the IBM PPC440GX evaluation board.
215
216config XILINX_VIRTEX440_GENERIC_BOARD 210config XILINX_VIRTEX440_GENERIC_BOARD
217 bool "Generic Xilinx Virtex 5 FXT board support" 211 bool "Generic Xilinx Virtex 5 FXT board support"
218 depends on 44x 212 depends on 44x
@@ -308,6 +302,10 @@ config 460SX
308 select IBM_EMAC_ZMII 302 select IBM_EMAC_ZMII
309 select IBM_EMAC_TAH 303 select IBM_EMAC_TAH
310 304
305config 476FPE
306 bool
307 select PPC_FPU
308
311config APM821xx 309config APM821xx
312 bool 310 bool
313 select PPC_FPU 311 select PPC_FPU
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 553db6007217..d03833abec09 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
10obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o 10obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
11obj-$(CONFIG_ISS4xx) += iss4xx.o 11obj-$(CONFIG_ISS4xx) += iss4xx.o
12obj-$(CONFIG_CANYONLANDS)+= canyonlands.o 12obj-$(CONFIG_CANYONLANDS)+= canyonlands.o
13obj-$(CONFIG_CURRITUCK) += currituck.o
diff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c
new file mode 100644
index 000000000000..3f6229b5dee0
--- /dev/null
+++ b/arch/powerpc/platforms/44x/currituck.c
@@ -0,0 +1,204 @@
1/*
2 * Currituck board specific routines
3 *
4 * Copyright © 2011 Tony Breeds IBM Corporation
5 *
6 * Based on earlier code:
7 * Matt Porter <mporter@kernel.crashing.org>
8 * Copyright 2002-2005 MontaVista Software Inc.
9 *
10 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
11 * Copyright (c) 2003-2005 Zultys Technologies
12 *
13 * Rewritten and ported to the merged powerpc tree:
14 * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
15 * Copyright © 2011 David Kliekamp IBM Corporation
16 *
17 * This program is free software; you can redistribute it and/or modify it
18 * under the terms of the GNU General Public License as published by the
19 * Free Software Foundation; either version 2 of the License, or (at your
20 * option) any later version.
21 */
22
23#include <linux/init.h>
24#include <linux/memblock.h>
25#include <linux/of.h>
26#include <linux/of_platform.h>
27#include <linux/rtc.h>
28
29#include <asm/machdep.h>
30#include <asm/prom.h>
31#include <asm/udbg.h>
32#include <asm/time.h>
33#include <asm/uic.h>
34#include <asm/ppc4xx.h>
35#include <asm/mpic.h>
36#include <asm/mmu.h>
37
38#include <linux/pci.h>
39
40static __initdata struct of_device_id ppc47x_of_bus[] = {
41 { .compatible = "ibm,plb4", },
42 { .compatible = "ibm,plb6", },
43 { .compatible = "ibm,opb", },
44 { .compatible = "ibm,ebc", },
45 {},
46};
47
48/* The EEPROM is missing and the default values are bogus. This forces USB in
49 * to EHCI mode */
50static void __devinit quirk_ppc_currituck_usb_fixup(struct pci_dev *dev)
51{
52 if (of_machine_is_compatible("ibm,currituck")) {
53 pci_write_config_dword(dev, 0xe0, 0x0114231f);
54 pci_write_config_dword(dev, 0xe4, 0x00006c40);
55 }
56}
57DECLARE_PCI_FIXUP_HEADER(0x1033, 0x0035, quirk_ppc_currituck_usb_fixup);
58
59static int __init ppc47x_device_probe(void)
60{
61 of_platform_bus_probe(NULL, ppc47x_of_bus, NULL);
62
63 return 0;
64}
65machine_device_initcall(ppc47x, ppc47x_device_probe);
66
67/* We can have either UICs or MPICs */
68static void __init ppc47x_init_irq(void)
69{
70 struct device_node *np;
71
72 /* Find top level interrupt controller */
73 for_each_node_with_property(np, "interrupt-controller") {
74 if (of_get_property(np, "interrupts", NULL) == NULL)
75 break;
76 }
77 if (np == NULL)
78 panic("Can't find top level interrupt controller");
79
80 /* Check type and do appropriate initialization */
81 if (of_device_is_compatible(np, "chrp,open-pic")) {
82 /* The MPIC driver will get everything it needs from the
83 * device-tree, just pass 0 to all arguments
84 */
85 struct mpic *mpic =
86 mpic_alloc(np, 0, 0, 0, 0, " MPIC ");
87 BUG_ON(mpic == NULL);
88 mpic_init(mpic);
89 ppc_md.get_irq = mpic_get_irq;
90 } else
91 panic("Unrecognized top level interrupt controller");
92}
93
94#ifdef CONFIG_SMP
95static void __cpuinit smp_ppc47x_setup_cpu(int cpu)
96{
97 mpic_setup_this_cpu();
98}
99
100static int __cpuinit smp_ppc47x_kick_cpu(int cpu)
101{
102 struct device_node *cpunode = of_get_cpu_node(cpu, NULL);
103 const u64 *spin_table_addr_prop;
104 u32 *spin_table;
105 extern void start_secondary_47x(void);
106
107 BUG_ON(cpunode == NULL);
108
109 /* Assume spin table. We could test for the enable-method in
110 * the device-tree but currently there's little point as it's
111 * our only supported method
112 */
113 spin_table_addr_prop =
114 of_get_property(cpunode, "cpu-release-addr", NULL);
115
116 if (spin_table_addr_prop == NULL) {
117 pr_err("CPU%d: Can't start, missing cpu-release-addr !\n",
118 cpu);
119 return 1;
120 }
121
122 /* Assume it's mapped as part of the linear mapping. This is a bit
123 * fishy but will work fine for now
124 *
125 * XXX: Is there any reason to assume differently?
126 */
127 spin_table = (u32 *)__va(*spin_table_addr_prop);
128 pr_debug("CPU%d: Spin table mapped at %p\n", cpu, spin_table);
129
130 spin_table[3] = cpu;
131 smp_wmb();
132 spin_table[1] = __pa(start_secondary_47x);
133 mb();
134
135 return 0;
136}
137
138static struct smp_ops_t ppc47x_smp_ops = {
139 .probe = smp_mpic_probe,
140 .message_pass = smp_mpic_message_pass,
141 .setup_cpu = smp_ppc47x_setup_cpu,
142 .kick_cpu = smp_ppc47x_kick_cpu,
143 .give_timebase = smp_generic_give_timebase,
144 .take_timebase = smp_generic_take_timebase,
145};
146
147static void __init ppc47x_smp_init(void)
148{
149 if (mmu_has_feature(MMU_FTR_TYPE_47x))
150 smp_ops = &ppc47x_smp_ops;
151}
152
153#else /* CONFIG_SMP */
154static void __init ppc47x_smp_init(void) { }
155#endif /* CONFIG_SMP */
156
157static void __init ppc47x_setup_arch(void)
158{
159
160 /* No need to check the DMA config as we /know/ our windows are all of
161 * RAM. Lets hope that doesn't change */
162#ifdef CONFIG_SWIOTLB
163 if (memblock_end_of_DRAM() > 0xffffffff) {
164 ppc_swiotlb_enable = 1;
165 set_pci_dma_ops(&swiotlb_dma_ops);
166 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
167 }
168#endif
169 ppc47x_smp_init();
170}
171
172/*
173 * Called very early, MMU is off, device-tree isn't unflattened
174 */
175static int __init ppc47x_probe(void)
176{
177 unsigned long root = of_get_flat_dt_root();
178
179 if (!of_flat_dt_is_compatible(root, "ibm,currituck"))
180 return 0;
181
182 return 1;
183}
184
185/* Use USB controller should have been hardware swizzled but it wasn't :( */
186static void ppc47x_pci_irq_fixup(struct pci_dev *dev)
187{
188 if (dev->vendor == 0x1033 && (dev->device == 0x0035 ||
189 dev->device == 0x00e0)) {
190 dev->irq = irq_create_mapping(NULL, 47);
191 pr_info("%s: Mapping irq 47 %d\n", __func__, dev->irq);
192 }
193}
194
195define_machine(ppc47x) {
196 .name = "PowerPC 47x",
197 .probe = ppc47x_probe,
198 .progress = udbg_progress,
199 .init_IRQ = ppc47x_init_irq,
200 .setup_arch = ppc47x_setup_arch,
201 .pci_irq_fixup = ppc47x_pci_irq_fixup,
202 .restart = ppc4xx_reset_system,
203 .calibrate_decr = generic_calibrate_decr,
204};
diff --git a/arch/powerpc/platforms/44x/iss4xx.c b/arch/powerpc/platforms/44x/iss4xx.c
index 19395f18b1db..5b8cdbb82f80 100644
--- a/arch/powerpc/platforms/44x/iss4xx.c
+++ b/arch/powerpc/platforms/44x/iss4xx.c
@@ -71,7 +71,7 @@ static void __init iss4xx_init_irq(void)
71 /* The MPIC driver will get everything it needs from the 71 /* The MPIC driver will get everything it needs from the
72 * device-tree, just pass 0 to all arguments 72 * device-tree, just pass 0 to all arguments
73 */ 73 */
74 struct mpic *mpic = mpic_alloc(np, 0, MPIC_PRIMARY, 0, 0, 74 struct mpic *mpic = mpic_alloc(np, 0, 0, 0, 0,
75 " MPIC "); 75 " MPIC ");
76 BUG_ON(mpic == NULL); 76 BUG_ON(mpic == NULL);
77 mpic_init(mpic); 77 mpic_init(mpic);
diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
index b3ebce1aec07..c16999802ecf 100644
--- a/arch/powerpc/platforms/512x/Kconfig
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -12,7 +12,6 @@ config MPC5121_ADS
12 bool "Freescale MPC5121E ADS" 12 bool "Freescale MPC5121E ADS"
13 depends on PPC_MPC512x 13 depends on PPC_MPC512x
14 select DEFAULT_UIMAGE 14 select DEFAULT_UIMAGE
15 select MPC5121_ADS_CPLD
16 help 15 help
17 This option enables support for the MPC5121E ADS board. 16 This option enables support for the MPC5121E ADS board.
18 17
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index aa0d84d22585..464ea8e0292d 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -36,38 +36,7 @@ static void __init asp834x_setup_arch(void)
36 mpc834x_usb_cfg(); 36 mpc834x_usb_cfg();
37} 37}
38 38
39static void __init asp834x_init_IRQ(void) 39machine_device_initcall(asp834x, mpc83xx_declare_of_platform_devices);
40{
41 struct device_node *np;
42
43 np = of_find_node_by_type(NULL, "ipic");
44 if (!np)
45 return;
46
47 ipic_init(np, 0);
48
49 of_node_put(np);
50
51 /* Initialize the default interrupt mapping priorities,
52 * in case the boot rom changed something on us.
53 */
54 ipic_set_default_priority();
55}
56
57static struct __initdata of_device_id asp8347_ids[] = {
58 { .type = "soc", },
59 { .compatible = "soc", },
60 { .compatible = "simple-bus", },
61 { .compatible = "gianfar", },
62 {},
63};
64
65static int __init asp8347_declare_of_platform_devices(void)
66{
67 of_platform_bus_probe(NULL, asp8347_ids, NULL);
68 return 0;
69}
70machine_device_initcall(asp834x, asp8347_declare_of_platform_devices);
71 40
72/* 41/*
73 * Called very early, MMU is off, device-tree isn't unflattened 42 * Called very early, MMU is off, device-tree isn't unflattened
@@ -82,7 +51,7 @@ define_machine(asp834x) {
82 .name = "ASP8347E", 51 .name = "ASP8347E",
83 .probe = asp834x_probe, 52 .probe = asp834x_probe,
84 .setup_arch = asp834x_setup_arch, 53 .setup_arch = asp834x_setup_arch,
85 .init_IRQ = asp834x_init_IRQ, 54 .init_IRQ = mpc83xx_ipic_init_IRQ,
86 .get_irq = ipic_get_irq, 55 .get_irq = ipic_get_irq,
87 .restart = mpc83xx_restart, 56 .restart = mpc83xx_restart,
88 .time_init = mpc83xx_time_init, 57 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index c55129f5760a..65eb792a0d00 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -51,15 +51,14 @@
51 */ 51 */
52static void __init mpc83xx_km_setup_arch(void) 52static void __init mpc83xx_km_setup_arch(void)
53{ 53{
54#ifdef CONFIG_QUICC_ENGINE
54 struct device_node *np; 55 struct device_node *np;
56#endif
55 57
56 if (ppc_md.progress) 58 if (ppc_md.progress)
57 ppc_md.progress("kmpbec83xx_setup_arch()", 0); 59 ppc_md.progress("kmpbec83xx_setup_arch()", 0);
58 60
59#ifdef CONFIG_PCI 61 mpc83xx_setup_pci();
60 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
61 mpc83xx_add_bridge(np);
62#endif
63 62
64#ifdef CONFIG_QUICC_ENGINE 63#ifdef CONFIG_QUICC_ENGINE
65 qe_reset(); 64 qe_reset();
@@ -122,54 +121,7 @@ static void __init mpc83xx_km_setup_arch(void)
122#endif /* CONFIG_QUICC_ENGINE */ 121#endif /* CONFIG_QUICC_ENGINE */
123} 122}
124 123
125static struct of_device_id kmpbec83xx_ids[] = { 124machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices);
126 { .type = "soc", },
127 { .compatible = "soc", },
128 { .compatible = "simple-bus", },
129 { .type = "qe", },
130 { .compatible = "fsl,qe", },
131 {},
132};
133
134static int __init kmeter_declare_of_platform_devices(void)
135{
136 /* Publish the QE devices */
137 of_platform_bus_probe(NULL, kmpbec83xx_ids, NULL);
138
139 return 0;
140}
141machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices);
142
143static void __init mpc83xx_km_init_IRQ(void)
144{
145 struct device_node *np;
146
147 np = of_find_compatible_node(NULL, NULL, "fsl,pq2pro-pic");
148 if (!np) {
149 np = of_find_node_by_type(NULL, "ipic");
150 if (!np)
151 return;
152 }
153
154 ipic_init(np, 0);
155
156 /* Initialize the default interrupt mapping priorities,
157 * in case the boot rom changed something on us.
158 */
159 ipic_set_default_priority();
160 of_node_put(np);
161
162#ifdef CONFIG_QUICC_ENGINE
163 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
164 if (!np) {
165 np = of_find_node_by_type(NULL, "qeic");
166 if (!np)
167 return;
168 }
169 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
170 of_node_put(np);
171#endif /* CONFIG_QUICC_ENGINE */
172}
173 125
174/* list of the supported boards */ 126/* list of the supported boards */
175static char *board[] __initdata = { 127static char *board[] __initdata = {
@@ -198,7 +150,7 @@ define_machine(mpc83xx_km) {
198 .name = "mpc83xx-km-platform", 150 .name = "mpc83xx-km-platform",
199 .probe = mpc83xx_km_probe, 151 .probe = mpc83xx_km_probe,
200 .setup_arch = mpc83xx_km_setup_arch, 152 .setup_arch = mpc83xx_km_setup_arch,
201 .init_IRQ = mpc83xx_km_init_IRQ, 153 .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ,
202 .get_irq = ipic_get_irq, 154 .get_irq = ipic_get_irq,
203 .restart = mpc83xx_restart, 155 .restart = mpc83xx_restart,
204 .time_init = mpc83xx_time_init, 156 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index f01806c940e1..125336f750c6 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -11,10 +11,15 @@
11 11
12#include <linux/stddef.h> 12#include <linux/stddef.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/of_platform.h>
15#include <linux/pci.h>
14 16
15#include <asm/io.h> 17#include <asm/io.h>
16#include <asm/hw_irq.h> 18#include <asm/hw_irq.h>
19#include <asm/ipic.h>
20#include <asm/qe_ic.h>
17#include <sysdev/fsl_soc.h> 21#include <sysdev/fsl_soc.h>
22#include <sysdev/fsl_pci.h>
18 23
19#include "mpc83xx.h" 24#include "mpc83xx.h"
20 25
@@ -65,3 +70,75 @@ long __init mpc83xx_time_init(void)
65 70
66 return 0; 71 return 0;
67} 72}
73
74void __init mpc83xx_ipic_init_IRQ(void)
75{
76 struct device_node *np;
77
78 /* looking for fsl,pq2pro-pic which is asl compatible with fsl,ipic */
79 np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
80 if (!np)
81 np = of_find_node_by_type(NULL, "ipic");
82 if (!np)
83 return;
84
85 ipic_init(np, 0);
86
87 of_node_put(np);
88
89 /* Initialize the default interrupt mapping priorities,
90 * in case the boot rom changed something on us.
91 */
92 ipic_set_default_priority();
93}
94
95#ifdef CONFIG_QUICC_ENGINE
96void __init mpc83xx_qe_init_IRQ(void)
97{
98 struct device_node *np;
99
100 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
101 if (!np) {
102 np = of_find_node_by_type(NULL, "qeic");
103 if (!np)
104 return;
105 }
106 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
107 of_node_put(np);
108}
109
110void __init mpc83xx_ipic_and_qe_init_IRQ(void)
111{
112 mpc83xx_ipic_init_IRQ();
113 mpc83xx_qe_init_IRQ();
114}
115#endif /* CONFIG_QUICC_ENGINE */
116
117static struct of_device_id __initdata of_bus_ids[] = {
118 { .type = "soc", },
119 { .compatible = "soc", },
120 { .compatible = "simple-bus" },
121 { .compatible = "gianfar" },
122 { .compatible = "gpio-leds", },
123 { .type = "qe", },
124 { .compatible = "fsl,qe", },
125 {},
126};
127
128int __init mpc83xx_declare_of_platform_devices(void)
129{
130 of_platform_bus_probe(NULL, of_bus_ids, NULL);
131 return 0;
132}
133
134#ifdef CONFIG_PCI
135void __init mpc83xx_setup_pci(void)
136{
137 struct device_node *np;
138
139 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
140 mpc83xx_add_bridge(np);
141 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
142 mpc83xx_add_bridge(np);
143}
144#endif
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index d0c4e15b7794..4f2d9fea77b7 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -27,36 +27,13 @@
27 */ 27 */
28static void __init mpc830x_rdb_setup_arch(void) 28static void __init mpc830x_rdb_setup_arch(void)
29{ 29{
30#ifdef CONFIG_PCI
31 struct device_node *np;
32#endif
33
34 if (ppc_md.progress) 30 if (ppc_md.progress)
35 ppc_md.progress("mpc830x_rdb_setup_arch()", 0); 31 ppc_md.progress("mpc830x_rdb_setup_arch()", 0);
36 32
37#ifdef CONFIG_PCI 33 mpc83xx_setup_pci();
38 for_each_compatible_node(np, "pci", "fsl,mpc8308-pcie")
39 mpc83xx_add_bridge(np);
40#endif
41 mpc831x_usb_cfg(); 34 mpc831x_usb_cfg();
42} 35}
43 36
44static void __init mpc830x_rdb_init_IRQ(void)
45{
46 struct device_node *np;
47
48 np = of_find_node_by_type(NULL, "ipic");
49 if (!np)
50 return;
51
52 ipic_init(np, 0);
53
54 /* Initialize the default interrupt mapping priorities,
55 * in case the boot rom changed something on us.
56 */
57 ipic_set_default_priority();
58}
59
60static const char *board[] __initdata = { 37static const char *board[] __initdata = {
61 "MPC8308RDB", 38 "MPC8308RDB",
62 "fsl,mpc8308rdb", 39 "fsl,mpc8308rdb",
@@ -72,24 +49,13 @@ static int __init mpc830x_rdb_probe(void)
72 return of_flat_dt_match(of_get_flat_dt_root(), board); 49 return of_flat_dt_match(of_get_flat_dt_root(), board);
73} 50}
74 51
75static struct of_device_id __initdata of_bus_ids[] = { 52machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);
76 { .compatible = "simple-bus" },
77 { .compatible = "gianfar" },
78 {},
79};
80
81static int __init declare_of_platform_devices(void)
82{
83 of_platform_bus_probe(NULL, of_bus_ids, NULL);
84 return 0;
85}
86machine_device_initcall(mpc830x_rdb, declare_of_platform_devices);
87 53
88define_machine(mpc830x_rdb) { 54define_machine(mpc830x_rdb) {
89 .name = "MPC830x RDB", 55 .name = "MPC830x RDB",
90 .probe = mpc830x_rdb_probe, 56 .probe = mpc830x_rdb_probe,
91 .setup_arch = mpc830x_rdb_setup_arch, 57 .setup_arch = mpc830x_rdb_setup_arch,
92 .init_IRQ = mpc830x_rdb_init_IRQ, 58 .init_IRQ = mpc83xx_ipic_init_IRQ,
93 .get_irq = ipic_get_irq, 59 .get_irq = ipic_get_irq,
94 .restart = mpc83xx_restart, 60 .restart = mpc83xx_restart,
95 .time_init = mpc83xx_time_init, 61 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index f859ead49a8d..fa25977c52de 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -28,38 +28,13 @@
28 */ 28 */
29static void __init mpc831x_rdb_setup_arch(void) 29static void __init mpc831x_rdb_setup_arch(void)
30{ 30{
31#ifdef CONFIG_PCI
32 struct device_node *np;
33#endif
34
35 if (ppc_md.progress) 31 if (ppc_md.progress)
36 ppc_md.progress("mpc831x_rdb_setup_arch()", 0); 32 ppc_md.progress("mpc831x_rdb_setup_arch()", 0);
37 33
38#ifdef CONFIG_PCI 34 mpc83xx_setup_pci();
39 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
40 mpc83xx_add_bridge(np);
41 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
42 mpc83xx_add_bridge(np);
43#endif
44 mpc831x_usb_cfg(); 35 mpc831x_usb_cfg();
45} 36}
46 37
47static void __init mpc831x_rdb_init_IRQ(void)
48{
49 struct device_node *np;
50
51 np = of_find_node_by_type(NULL, "ipic");
52 if (!np)
53 return;
54
55 ipic_init(np, 0);
56
57 /* Initialize the default interrupt mapping priorities,
58 * in case the boot rom changed something on us.
59 */
60 ipic_set_default_priority();
61}
62
63static const char *board[] __initdata = { 38static const char *board[] __initdata = {
64 "MPC8313ERDB", 39 "MPC8313ERDB",
65 "fsl,mpc8315erdb", 40 "fsl,mpc8315erdb",
@@ -74,25 +49,13 @@ static int __init mpc831x_rdb_probe(void)
74 return of_flat_dt_match(of_get_flat_dt_root(), board); 49 return of_flat_dt_match(of_get_flat_dt_root(), board);
75} 50}
76 51
77static struct of_device_id __initdata of_bus_ids[] = { 52machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
78 { .compatible = "simple-bus" },
79 { .compatible = "gianfar" },
80 { .compatible = "gpio-leds", },
81 {},
82};
83
84static int __init declare_of_platform_devices(void)
85{
86 of_platform_bus_probe(NULL, of_bus_ids, NULL);
87 return 0;
88}
89machine_device_initcall(mpc831x_rdb, declare_of_platform_devices);
90 53
91define_machine(mpc831x_rdb) { 54define_machine(mpc831x_rdb) {
92 .name = "MPC831x RDB", 55 .name = "MPC831x RDB",
93 .probe = mpc831x_rdb_probe, 56 .probe = mpc831x_rdb_probe,
94 .setup_arch = mpc831x_rdb_setup_arch, 57 .setup_arch = mpc831x_rdb_setup_arch,
95 .init_IRQ = mpc831x_rdb_init_IRQ, 58 .init_IRQ = mpc83xx_ipic_init_IRQ,
96 .get_irq = ipic_get_irq, 59 .get_irq = ipic_get_irq,
97 .restart = mpc83xx_restart, 60 .restart = mpc83xx_restart,
98 .time_init = mpc83xx_time_init, 61 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 32a52896822f..e36bc611dd6e 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -72,10 +72,7 @@ static void __init mpc832x_sys_setup_arch(void)
72 of_node_put(np); 72 of_node_put(np);
73 } 73 }
74 74
75#ifdef CONFIG_PCI 75 mpc83xx_setup_pci();
76 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
77 mpc83xx_add_bridge(np);
78#endif
79 76
80#ifdef CONFIG_QUICC_ENGINE 77#ifdef CONFIG_QUICC_ENGINE
81 qe_reset(); 78 qe_reset();
@@ -101,51 +98,7 @@ static void __init mpc832x_sys_setup_arch(void)
101#endif /* CONFIG_QUICC_ENGINE */ 98#endif /* CONFIG_QUICC_ENGINE */
102} 99}
103 100
104static struct of_device_id mpc832x_ids[] = { 101machine_device_initcall(mpc832x_mds, mpc83xx_declare_of_platform_devices);
105 { .type = "soc", },
106 { .compatible = "soc", },
107 { .compatible = "simple-bus", },
108 { .type = "qe", },
109 { .compatible = "fsl,qe", },
110 {},
111};
112
113static int __init mpc832x_declare_of_platform_devices(void)
114{
115 /* Publish the QE devices */
116 of_platform_bus_probe(NULL, mpc832x_ids, NULL);
117
118 return 0;
119}
120machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
121
122static void __init mpc832x_sys_init_IRQ(void)
123{
124 struct device_node *np;
125
126 np = of_find_node_by_type(NULL, "ipic");
127 if (!np)
128 return;
129
130 ipic_init(np, 0);
131
132 /* Initialize the default interrupt mapping priorities,
133 * in case the boot rom changed something on us.
134 */
135 ipic_set_default_priority();
136 of_node_put(np);
137
138#ifdef CONFIG_QUICC_ENGINE
139 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
140 if (!np) {
141 np = of_find_node_by_type(NULL, "qeic");
142 if (!np)
143 return;
144 }
145 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
146 of_node_put(np);
147#endif /* CONFIG_QUICC_ENGINE */
148}
149 102
150/* 103/*
151 * Called very early, MMU is off, device-tree isn't unflattened 104 * Called very early, MMU is off, device-tree isn't unflattened
@@ -161,7 +114,7 @@ define_machine(mpc832x_mds) {
161 .name = "MPC832x MDS", 114 .name = "MPC832x MDS",
162 .probe = mpc832x_sys_probe, 115 .probe = mpc832x_sys_probe,
163 .setup_arch = mpc832x_sys_setup_arch, 116 .setup_arch = mpc832x_sys_setup_arch,
164 .init_IRQ = mpc832x_sys_init_IRQ, 117 .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ,
165 .get_irq = ipic_get_irq, 118 .get_irq = ipic_get_irq,
166 .restart = mpc83xx_restart, 119 .restart = mpc83xx_restart,
167 .time_init = mpc83xx_time_init, 120 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 17f99745f0e4..eff5baabc3fb 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -193,17 +193,14 @@ machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
193 */ 193 */
194static void __init mpc832x_rdb_setup_arch(void) 194static void __init mpc832x_rdb_setup_arch(void)
195{ 195{
196#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE) 196#if defined(CONFIG_QUICC_ENGINE)
197 struct device_node *np; 197 struct device_node *np;
198#endif 198#endif
199 199
200 if (ppc_md.progress) 200 if (ppc_md.progress)
201 ppc_md.progress("mpc832x_rdb_setup_arch()", 0); 201 ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
202 202
203#ifdef CONFIG_PCI 203 mpc83xx_setup_pci();
204 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
205 mpc83xx_add_bridge(np);
206#endif
207 204
208#ifdef CONFIG_QUICC_ENGINE 205#ifdef CONFIG_QUICC_ENGINE
209 qe_reset(); 206 qe_reset();
@@ -218,52 +215,7 @@ static void __init mpc832x_rdb_setup_arch(void)
218#endif /* CONFIG_QUICC_ENGINE */ 215#endif /* CONFIG_QUICC_ENGINE */
219} 216}
220 217
221static struct of_device_id mpc832x_ids[] = { 218machine_device_initcall(mpc832x_rdb, mpc83xx_declare_of_platform_devices);
222 { .type = "soc", },
223 { .compatible = "soc", },
224 { .compatible = "simple-bus", },
225 { .type = "qe", },
226 { .compatible = "fsl,qe", },
227 {},
228};
229
230static int __init mpc832x_declare_of_platform_devices(void)
231{
232 /* Publish the QE devices */
233 of_platform_bus_probe(NULL, mpc832x_ids, NULL);
234
235 return 0;
236}
237machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
238
239static void __init mpc832x_rdb_init_IRQ(void)
240{
241
242 struct device_node *np;
243
244 np = of_find_node_by_type(NULL, "ipic");
245 if (!np)
246 return;
247
248 ipic_init(np, 0);
249
250 /* Initialize the default interrupt mapping priorities,
251 * in case the boot rom changed something on us.
252 */
253 ipic_set_default_priority();
254 of_node_put(np);
255
256#ifdef CONFIG_QUICC_ENGINE
257 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
258 if (!np) {
259 np = of_find_node_by_type(NULL, "qeic");
260 if (!np)
261 return;
262 }
263 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
264 of_node_put(np);
265#endif /* CONFIG_QUICC_ENGINE */
266}
267 219
268/* 220/*
269 * Called very early, MMU is off, device-tree isn't unflattened 221 * Called very early, MMU is off, device-tree isn't unflattened
@@ -279,7 +231,7 @@ define_machine(mpc832x_rdb) {
279 .name = "MPC832x RDB", 231 .name = "MPC832x RDB",
280 .probe = mpc832x_rdb_probe, 232 .probe = mpc832x_rdb_probe,
281 .setup_arch = mpc832x_rdb_setup_arch, 233 .setup_arch = mpc832x_rdb_setup_arch,
282 .init_IRQ = mpc832x_rdb_init_IRQ, 234 .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ,
283 .get_irq = ipic_get_irq, 235 .get_irq = ipic_get_irq,
284 .restart = mpc83xx_restart, 236 .restart = mpc83xx_restart,
285 .time_init = mpc83xx_time_init, 237 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 6b45969567d4..39849dd1b5bb 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -41,13 +41,12 @@
41 41
42static struct of_device_id __initdata mpc834x_itx_ids[] = { 42static struct of_device_id __initdata mpc834x_itx_ids[] = {
43 { .compatible = "fsl,pq2pro-localbus", }, 43 { .compatible = "fsl,pq2pro-localbus", },
44 { .compatible = "simple-bus", },
45 { .compatible = "gianfar", },
46 {}, 44 {},
47}; 45};
48 46
49static int __init mpc834x_itx_declare_of_platform_devices(void) 47static int __init mpc834x_itx_declare_of_platform_devices(void)
50{ 48{
49 mpc83xx_declare_of_platform_devices();
51 return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL); 50 return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
52} 51}
53machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices); 52machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
@@ -59,37 +58,14 @@ machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
59 */ 58 */
60static void __init mpc834x_itx_setup_arch(void) 59static void __init mpc834x_itx_setup_arch(void)
61{ 60{
62#ifdef CONFIG_PCI
63 struct device_node *np;
64#endif
65
66 if (ppc_md.progress) 61 if (ppc_md.progress)
67 ppc_md.progress("mpc834x_itx_setup_arch()", 0); 62 ppc_md.progress("mpc834x_itx_setup_arch()", 0);
68 63
69#ifdef CONFIG_PCI 64 mpc83xx_setup_pci();
70 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
71 mpc83xx_add_bridge(np);
72#endif
73 65
74 mpc834x_usb_cfg(); 66 mpc834x_usb_cfg();
75} 67}
76 68
77static void __init mpc834x_itx_init_IRQ(void)
78{
79 struct device_node *np;
80
81 np = of_find_node_by_type(NULL, "ipic");
82 if (!np)
83 return;
84
85 ipic_init(np, 0);
86
87 /* Initialize the default interrupt mapping priorities,
88 * in case the boot rom changed something on us.
89 */
90 ipic_set_default_priority();
91}
92
93/* 69/*
94 * Called very early, MMU is off, device-tree isn't unflattened 70 * Called very early, MMU is off, device-tree isn't unflattened
95 */ 71 */
@@ -104,7 +80,7 @@ define_machine(mpc834x_itx) {
104 .name = "MPC834x ITX", 80 .name = "MPC834x ITX",
105 .probe = mpc834x_itx_probe, 81 .probe = mpc834x_itx_probe,
106 .setup_arch = mpc834x_itx_setup_arch, 82 .setup_arch = mpc834x_itx_setup_arch,
107 .init_IRQ = mpc834x_itx_init_IRQ, 83 .init_IRQ = mpc83xx_ipic_init_IRQ,
108 .get_irq = ipic_get_irq, 84 .get_irq = ipic_get_irq,
109 .restart = mpc83xx_restart, 85 .restart = mpc83xx_restart,
110 .time_init = mpc83xx_time_init, 86 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 041c5177e737..5828d8e97c37 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -77,51 +77,15 @@ static int mpc834xemds_usb_cfg(void)
77 */ 77 */
78static void __init mpc834x_mds_setup_arch(void) 78static void __init mpc834x_mds_setup_arch(void)
79{ 79{
80#ifdef CONFIG_PCI
81 struct device_node *np;
82#endif
83
84 if (ppc_md.progress) 80 if (ppc_md.progress)
85 ppc_md.progress("mpc834x_mds_setup_arch()", 0); 81 ppc_md.progress("mpc834x_mds_setup_arch()", 0);
86 82
87#ifdef CONFIG_PCI 83 mpc83xx_setup_pci();
88 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
89 mpc83xx_add_bridge(np);
90#endif
91 84
92 mpc834xemds_usb_cfg(); 85 mpc834xemds_usb_cfg();
93} 86}
94 87
95static void __init mpc834x_mds_init_IRQ(void) 88machine_device_initcall(mpc834x_mds, mpc83xx_declare_of_platform_devices);
96{
97 struct device_node *np;
98
99 np = of_find_node_by_type(NULL, "ipic");
100 if (!np)
101 return;
102
103 ipic_init(np, 0);
104
105 /* Initialize the default interrupt mapping priorities,
106 * in case the boot rom changed something on us.
107 */
108 ipic_set_default_priority();
109}
110
111static struct of_device_id mpc834x_ids[] = {
112 { .type = "soc", },
113 { .compatible = "soc", },
114 { .compatible = "simple-bus", },
115 { .compatible = "gianfar", },
116 {},
117};
118
119static int __init mpc834x_declare_of_platform_devices(void)
120{
121 of_platform_bus_probe(NULL, mpc834x_ids, NULL);
122 return 0;
123}
124machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
125 89
126/* 90/*
127 * Called very early, MMU is off, device-tree isn't unflattened 91 * Called very early, MMU is off, device-tree isn't unflattened
@@ -137,7 +101,7 @@ define_machine(mpc834x_mds) {
137 .name = "MPC834x MDS", 101 .name = "MPC834x MDS",
138 .probe = mpc834x_mds_probe, 102 .probe = mpc834x_mds_probe,
139 .setup_arch = mpc834x_mds_setup_arch, 103 .setup_arch = mpc834x_mds_setup_arch,
140 .init_IRQ = mpc834x_mds_init_IRQ, 104 .init_IRQ = mpc83xx_ipic_init_IRQ,
141 .get_irq = ipic_get_irq, 105 .get_irq = ipic_get_irq,
142 .restart = mpc83xx_restart, 106 .restart = mpc83xx_restart,
143 .time_init = mpc83xx_time_init, 107 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 934cc8c46bbc..ad8e4bcd7d55 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -80,10 +80,7 @@ static void __init mpc836x_mds_setup_arch(void)
80 of_node_put(np); 80 of_node_put(np);
81 } 81 }
82 82
83#ifdef CONFIG_PCI 83 mpc83xx_setup_pci();
84 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
85 mpc83xx_add_bridge(np);
86#endif
87 84
88#ifdef CONFIG_QUICC_ENGINE 85#ifdef CONFIG_QUICC_ENGINE
89 qe_reset(); 86 qe_reset();
@@ -144,23 +141,7 @@ static void __init mpc836x_mds_setup_arch(void)
144#endif /* CONFIG_QUICC_ENGINE */ 141#endif /* CONFIG_QUICC_ENGINE */
145} 142}
146 143
147static struct of_device_id mpc836x_ids[] = { 144machine_device_initcall(mpc836x_mds, mpc83xx_declare_of_platform_devices);
148 { .type = "soc", },
149 { .compatible = "soc", },
150 { .compatible = "simple-bus", },
151 { .type = "qe", },
152 { .compatible = "fsl,qe", },
153 {},
154};
155
156static int __init mpc836x_declare_of_platform_devices(void)
157{
158 /* Publish the QE devices */
159 of_platform_bus_probe(NULL, mpc836x_ids, NULL);
160
161 return 0;
162}
163machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
164 145
165#ifdef CONFIG_QE_USB 146#ifdef CONFIG_QE_USB
166static int __init mpc836x_usb_cfg(void) 147static int __init mpc836x_usb_cfg(void)
@@ -226,34 +207,6 @@ err:
226machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg); 207machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg);
227#endif /* CONFIG_QE_USB */ 208#endif /* CONFIG_QE_USB */
228 209
229static void __init mpc836x_mds_init_IRQ(void)
230{
231 struct device_node *np;
232
233 np = of_find_node_by_type(NULL, "ipic");
234 if (!np)
235 return;
236
237 ipic_init(np, 0);
238
239 /* Initialize the default interrupt mapping priorities,
240 * in case the boot rom changed something on us.
241 */
242 ipic_set_default_priority();
243 of_node_put(np);
244
245#ifdef CONFIG_QUICC_ENGINE
246 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
247 if (!np) {
248 np = of_find_node_by_type(NULL, "qeic");
249 if (!np)
250 return;
251 }
252 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
253 of_node_put(np);
254#endif /* CONFIG_QUICC_ENGINE */
255}
256
257/* 210/*
258 * Called very early, MMU is off, device-tree isn't unflattened 211 * Called very early, MMU is off, device-tree isn't unflattened
259 */ 212 */
@@ -268,7 +221,7 @@ define_machine(mpc836x_mds) {
268 .name = "MPC836x MDS", 221 .name = "MPC836x MDS",
269 .probe = mpc836x_mds_probe, 222 .probe = mpc836x_mds_probe,
270 .setup_arch = mpc836x_mds_setup_arch, 223 .setup_arch = mpc836x_mds_setup_arch,
271 .init_IRQ = mpc836x_mds_init_IRQ, 224 .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ,
272 .get_irq = ipic_get_irq, 225 .get_irq = ipic_get_irq,
273 .restart = mpc83xx_restart, 226 .restart = mpc83xx_restart,
274 .time_init = mpc83xx_time_init, 227 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index b0090aac9642..f8769d713d61 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -27,61 +27,19 @@
27 27
28#include "mpc83xx.h" 28#include "mpc83xx.h"
29 29
30static struct of_device_id __initdata mpc836x_rdk_ids[] = { 30machine_device_initcall(mpc836x_rdk, mpc83xx_declare_of_platform_devices);
31 { .compatible = "simple-bus", },
32 {},
33};
34
35static int __init mpc836x_rdk_declare_of_platform_devices(void)
36{
37 return of_platform_bus_probe(NULL, mpc836x_rdk_ids, NULL);
38}
39machine_device_initcall(mpc836x_rdk, mpc836x_rdk_declare_of_platform_devices);
40 31
41static void __init mpc836x_rdk_setup_arch(void) 32static void __init mpc836x_rdk_setup_arch(void)
42{ 33{
43#ifdef CONFIG_PCI
44 struct device_node *np;
45#endif
46
47 if (ppc_md.progress) 34 if (ppc_md.progress)
48 ppc_md.progress("mpc836x_rdk_setup_arch()", 0); 35 ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
49 36
50#ifdef CONFIG_PCI 37 mpc83xx_setup_pci();
51 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
52 mpc83xx_add_bridge(np);
53#endif
54#ifdef CONFIG_QUICC_ENGINE 38#ifdef CONFIG_QUICC_ENGINE
55 qe_reset(); 39 qe_reset();
56#endif 40#endif
57} 41}
58 42
59static void __init mpc836x_rdk_init_IRQ(void)
60{
61 struct device_node *np;
62
63 np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
64 if (!np)
65 return;
66
67 ipic_init(np, 0);
68
69 /*
70 * Initialize the default interrupt mapping priorities,
71 * in case the boot rom changed something on us.
72 */
73 ipic_set_default_priority();
74 of_node_put(np);
75#ifdef CONFIG_QUICC_ENGINE
76 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
77 if (!np)
78 return;
79
80 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
81 of_node_put(np);
82#endif
83}
84
85/* 43/*
86 * Called very early, MMU is off, device-tree isn't unflattened. 44 * Called very early, MMU is off, device-tree isn't unflattened.
87 */ 45 */
@@ -96,7 +54,7 @@ define_machine(mpc836x_rdk) {
96 .name = "MPC836x RDK", 54 .name = "MPC836x RDK",
97 .probe = mpc836x_rdk_probe, 55 .probe = mpc836x_rdk_probe,
98 .setup_arch = mpc836x_rdk_setup_arch, 56 .setup_arch = mpc836x_rdk_setup_arch,
99 .init_IRQ = mpc836x_rdk_init_IRQ, 57 .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ,
100 .get_irq = ipic_get_irq, 58 .get_irq = ipic_get_irq,
101 .restart = mpc83xx_restart, 59 .restart = mpc83xx_restart,
102 .time_init = mpc83xx_time_init, 60 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 83068322abd1..e53a60b6c863 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -79,54 +79,14 @@ out:
79 */ 79 */
80static void __init mpc837x_mds_setup_arch(void) 80static void __init mpc837x_mds_setup_arch(void)
81{ 81{
82#ifdef CONFIG_PCI
83 struct device_node *np;
84#endif
85
86 if (ppc_md.progress) 82 if (ppc_md.progress)
87 ppc_md.progress("mpc837x_mds_setup_arch()", 0); 83 ppc_md.progress("mpc837x_mds_setup_arch()", 0);
88 84
89#ifdef CONFIG_PCI 85 mpc83xx_setup_pci();
90 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
91 mpc83xx_add_bridge(np);
92 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
93 mpc83xx_add_bridge(np);
94#endif
95 mpc837xmds_usb_cfg(); 86 mpc837xmds_usb_cfg();
96} 87}
97 88
98static struct of_device_id mpc837x_ids[] = { 89machine_device_initcall(mpc837x_mds, mpc83xx_declare_of_platform_devices);
99 { .type = "soc", },
100 { .compatible = "soc", },
101 { .compatible = "simple-bus", },
102 { .compatible = "gianfar", },
103 {},
104};
105
106static int __init mpc837x_declare_of_platform_devices(void)
107{
108 /* Publish platform_device */
109 of_platform_bus_probe(NULL, mpc837x_ids, NULL);
110
111 return 0;
112}
113machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
114
115static void __init mpc837x_mds_init_IRQ(void)
116{
117 struct device_node *np;
118
119 np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
120 if (!np)
121 return;
122
123 ipic_init(np, 0);
124
125 /* Initialize the default interrupt mapping priorities,
126 * in case the boot rom changed something on us.
127 */
128 ipic_set_default_priority();
129}
130 90
131/* 91/*
132 * Called very early, MMU is off, device-tree isn't unflattened 92 * Called very early, MMU is off, device-tree isn't unflattened
@@ -142,7 +102,7 @@ define_machine(mpc837x_mds) {
142 .name = "MPC837x MDS", 102 .name = "MPC837x MDS",
143 .probe = mpc837x_mds_probe, 103 .probe = mpc837x_mds_probe,
144 .setup_arch = mpc837x_mds_setup_arch, 104 .setup_arch = mpc837x_mds_setup_arch,
145 .init_IRQ = mpc837x_mds_init_IRQ, 105 .init_IRQ = mpc83xx_ipic_init_IRQ,
146 .get_irq = ipic_get_irq, 106 .get_irq = ipic_get_irq,
147 .restart = mpc83xx_restart, 107 .restart = mpc83xx_restart,
148 .time_init = mpc83xx_time_init, 108 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 7bafbf2ec0f9..16c9c9cbbb7f 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -50,56 +50,15 @@ static void mpc837x_rdb_sd_cfg(void)
50 */ 50 */
51static void __init mpc837x_rdb_setup_arch(void) 51static void __init mpc837x_rdb_setup_arch(void)
52{ 52{
53#ifdef CONFIG_PCI
54 struct device_node *np;
55#endif
56
57 if (ppc_md.progress) 53 if (ppc_md.progress)
58 ppc_md.progress("mpc837x_rdb_setup_arch()", 0); 54 ppc_md.progress("mpc837x_rdb_setup_arch()", 0);
59 55
60#ifdef CONFIG_PCI 56 mpc83xx_setup_pci();
61 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
62 mpc83xx_add_bridge(np);
63 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
64 mpc83xx_add_bridge(np);
65#endif
66 mpc837x_usb_cfg(); 57 mpc837x_usb_cfg();
67 mpc837x_rdb_sd_cfg(); 58 mpc837x_rdb_sd_cfg();
68} 59}
69 60
70static struct of_device_id mpc837x_ids[] = { 61machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
71 { .type = "soc", },
72 { .compatible = "soc", },
73 { .compatible = "simple-bus", },
74 { .compatible = "gianfar", },
75 { .compatible = "gpio-leds", },
76 {},
77};
78
79static int __init mpc837x_declare_of_platform_devices(void)
80{
81 /* Publish platform_device */
82 of_platform_bus_probe(NULL, mpc837x_ids, NULL);
83
84 return 0;
85}
86machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
87
88static void __init mpc837x_rdb_init_IRQ(void)
89{
90 struct device_node *np;
91
92 np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
93 if (!np)
94 return;
95
96 ipic_init(np, 0);
97
98 /* Initialize the default interrupt mapping priorities,
99 * in case the boot rom changed something on us.
100 */
101 ipic_set_default_priority();
102}
103 62
104static const char *board[] __initdata = { 63static const char *board[] __initdata = {
105 "fsl,mpc8377rdb", 64 "fsl,mpc8377rdb",
@@ -121,7 +80,7 @@ define_machine(mpc837x_rdb) {
121 .name = "MPC837x RDB/WLAN", 80 .name = "MPC837x RDB/WLAN",
122 .probe = mpc837x_rdb_probe, 81 .probe = mpc837x_rdb_probe,
123 .setup_arch = mpc837x_rdb_setup_arch, 82 .setup_arch = mpc837x_rdb_setup_arch,
124 .init_IRQ = mpc837x_rdb_init_IRQ, 83 .init_IRQ = mpc83xx_ipic_init_IRQ,
125 .get_irq = ipic_get_irq, 84 .get_irq = ipic_get_irq,
126 .restart = mpc83xx_restart, 85 .restart = mpc83xx_restart,
127 .time_init = mpc83xx_time_init, 86 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 82a434510d83..0cf74d7ea1c5 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -70,5 +70,21 @@ extern long mpc83xx_time_init(void);
70extern int mpc837x_usb_cfg(void); 70extern int mpc837x_usb_cfg(void);
71extern int mpc834x_usb_cfg(void); 71extern int mpc834x_usb_cfg(void);
72extern int mpc831x_usb_cfg(void); 72extern int mpc831x_usb_cfg(void);
73extern void mpc83xx_ipic_init_IRQ(void);
74#ifdef CONFIG_QUICC_ENGINE
75extern void mpc83xx_qe_init_IRQ(void);
76extern void mpc83xx_ipic_and_qe_init_IRQ(void);
77#else
78static inline void __init mpc83xx_qe_init_IRQ(void) {}
79#define mpc83xx_ipic_and_qe_init_IRQ mpc83xx_ipic_init_IRQ
80#endif /* CONFIG_QUICC_ENGINE */
81
82#ifdef CONFIG_PCI
83extern void mpc83xx_setup_pci(void);
84#else
85#define mpc83xx_setup_pci() do {} while (0)
86#endif
87
88extern int mpc83xx_declare_of_platform_devices(void);
73 89
74#endif /* __MPC83XX_H__ */ 90#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index af41d8c810a8..8a81d7640b1f 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -48,52 +48,13 @@
48 */ 48 */
49static void __init sbc834x_setup_arch(void) 49static void __init sbc834x_setup_arch(void)
50{ 50{
51#ifdef CONFIG_PCI
52 struct device_node *np;
53#endif
54
55 if (ppc_md.progress) 51 if (ppc_md.progress)
56 ppc_md.progress("sbc834x_setup_arch()", 0); 52 ppc_md.progress("sbc834x_setup_arch()", 0);
57 53
58#ifdef CONFIG_PCI 54 mpc83xx_setup_pci();
59 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
60 mpc83xx_add_bridge(np);
61#endif
62
63} 55}
64 56
65static void __init sbc834x_init_IRQ(void) 57machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);
66{
67 struct device_node *np;
68
69 np = of_find_node_by_type(NULL, "ipic");
70 if (!np)
71 return;
72
73 ipic_init(np, 0);
74
75 /* Initialize the default interrupt mapping priorities,
76 * in case the boot rom changed something on us.
77 */
78 ipic_set_default_priority();
79
80 of_node_put(np);
81}
82
83static struct __initdata of_device_id sbc834x_ids[] = {
84 { .type = "soc", },
85 { .compatible = "soc", },
86 { .compatible = "simple-bus", },
87 { .compatible = "gianfar", },
88 {},
89};
90
91static int __init sbc834x_declare_of_platform_devices(void)
92{
93 of_platform_bus_probe(NULL, sbc834x_ids, NULL);
94 return 0;
95}
96machine_device_initcall(sbc834x, sbc834x_declare_of_platform_devices);
97 58
98/* 59/*
99 * Called very early, MMU is off, device-tree isn't unflattened 60 * Called very early, MMU is off, device-tree isn't unflattened
@@ -102,14 +63,14 @@ static int __init sbc834x_probe(void)
102{ 63{
103 unsigned long root = of_get_flat_dt_root(); 64 unsigned long root = of_get_flat_dt_root();
104 65
105 return of_flat_dt_is_compatible(root, "SBC834x"); 66 return of_flat_dt_is_compatible(root, "SBC834xE");
106} 67}
107 68
108define_machine(sbc834x) { 69define_machine(sbc834x) {
109 .name = "SBC834x", 70 .name = "SBC834xE",
110 .probe = sbc834x_probe, 71 .probe = sbc834x_probe,
111 .setup_arch = sbc834x_setup_arch, 72 .setup_arch = sbc834x_setup_arch,
112 .init_IRQ = sbc834x_init_IRQ, 73 .init_IRQ = mpc83xx_ipic_init_IRQ,
113 .get_irq = ipic_get_irq, 74 .get_irq = ipic_get_irq,
114 .restart = mpc83xx_restart, 75 .restart = mpc83xx_restart,
115 .time_init = mpc83xx_time_init, 76 .time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 45023e26aea3..d7946be298b6 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -203,7 +203,7 @@ config P3060_QDS
203 select PPC_E500MC 203 select PPC_E500MC
204 select PHYS_64BIT 204 select PHYS_64BIT
205 select SWIOTLB 205 select SWIOTLB
206 select MPC8xxx_GPIO 206 select GPIO_MPC8XXX
207 select HAS_RAPIDIO 207 select HAS_RAPIDIO
208 select PPC_EPAPR_HV_PIC 208 select PPC_EPAPR_HV_PIC
209 help 209 help
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index bc5acb95917a..9cb2d4320dcc 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -3,6 +3,8 @@
3# 3#
4obj-$(CONFIG_SMP) += smp.o 4obj-$(CONFIG_SMP) += smp.o
5 5
6obj-y += common.o
7
6obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o 8obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
7obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o 9obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
8obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o 10obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
new file mode 100644
index 000000000000..9fef5302adc1
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/common.c
@@ -0,0 +1,66 @@
1/*
2 * Routines common to most mpc85xx-based boards.
3 *
4 * This is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#include <linux/of_platform.h>
9
10#include <sysdev/cpm2_pic.h>
11
12#include "mpc85xx.h"
13
14static struct of_device_id __initdata mpc85xx_common_ids[] = {
15 { .type = "soc", },
16 { .compatible = "soc", },
17 { .compatible = "simple-bus", },
18 { .name = "cpm", },
19 { .name = "localbus", },
20 { .compatible = "gianfar", },
21 { .compatible = "fsl,qe", },
22 { .compatible = "fsl,cpm2", },
23 { .compatible = "fsl,srio", },
24 {},
25};
26
27int __init mpc85xx_common_publish_devices(void)
28{
29 return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
30}
31#ifdef CONFIG_CPM2
32static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
33{
34 struct irq_chip *chip = irq_desc_get_chip(desc);
35 int cascade_irq;
36
37 while ((cascade_irq = cpm2_get_irq()) >= 0)
38 generic_handle_irq(cascade_irq);
39
40 chip->irq_eoi(&desc->irq_data);
41}
42
43
44void __init mpc85xx_cpm2_pic_init(void)
45{
46 struct device_node *np;
47 int irq;
48
49 /* Setup CPM2 PIC */
50 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
51 if (np == NULL) {
52 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
53 return;
54 }
55 irq = irq_of_parse_and_map(np, 0);
56 if (irq == NO_IRQ) {
57 of_node_put(np);
58 printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
59 return;
60 }
61
62 cpm2_pic_init(np);
63 of_node_put(np);
64 irq_set_chained_handler(irq, cpm2_cascade);
65}
66#endif
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index 802ad110b757..07e3e6c47371 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -31,32 +31,18 @@
31#include <linux/of_platform.h> 31#include <linux/of_platform.h>
32#include <sysdev/fsl_soc.h> 32#include <sysdev/fsl_soc.h>
33#include <sysdev/fsl_pci.h> 33#include <sysdev/fsl_pci.h>
34#include "smp.h"
34 35
35void __init corenet_ds_pic_init(void) 36void __init corenet_ds_pic_init(void)
36{ 37{
37 struct mpic *mpic; 38 struct mpic *mpic;
38 struct resource r; 39 unsigned int flags = MPIC_BIG_ENDIAN |
39 struct device_node *np = NULL;
40 unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN |
41 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; 40 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU;
42 41
43 np = of_find_node_by_type(np, "open-pic");
44
45 if (np == NULL) {
46 printk(KERN_ERR "Could not find open-pic node\n");
47 return;
48 }
49
50 if (of_address_to_resource(np, 0, &r)) {
51 printk(KERN_ERR "Failed to map mpic register space\n");
52 of_node_put(np);
53 return;
54 }
55
56 if (ppc_md.get_irq == mpic_get_coreint_irq) 42 if (ppc_md.get_irq == mpic_get_coreint_irq)
57 flags |= MPIC_ENABLE_COREINT; 43 flags |= MPIC_ENABLE_COREINT;
58 44
59 mpic = mpic_alloc(np, r.start, flags, 0, 256, " OpenPIC "); 45 mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
60 BUG_ON(mpic == NULL); 46 BUG_ON(mpic == NULL);
61 47
62 mpic_init(mpic); 48 mpic_init(mpic);
@@ -65,10 +51,6 @@ void __init corenet_ds_pic_init(void)
65/* 51/*
66 * Setup the architecture 52 * Setup the architecture
67 */ 53 */
68#ifdef CONFIG_SMP
69void __init mpc85xx_smp_init(void);
70#endif
71
72void __init corenet_ds_setup_arch(void) 54void __init corenet_ds_setup_arch(void)
73{ 55{
74#ifdef CONFIG_PCI 56#ifdef CONFIG_PCI
@@ -77,9 +59,7 @@ void __init corenet_ds_setup_arch(void)
77#endif 59#endif
78 dma_addr_t max = 0xffffffff; 60 dma_addr_t max = 0xffffffff;
79 61
80#ifdef CONFIG_SMP
81 mpc85xx_smp_init(); 62 mpc85xx_smp_init();
82#endif
83 63
84#ifdef CONFIG_PCI 64#ifdef CONFIG_PCI
85 for_each_node_by_type(np, "pci") { 65 for_each_node_by_type(np, "pci") {
@@ -112,7 +92,7 @@ static const struct of_device_id of_device_ids[] __devinitconst = {
112 .compatible = "simple-bus" 92 .compatible = "simple-bus"
113 }, 93 },
114 { 94 {
115 .compatible = "fsl,rapidio-delta", 95 .compatible = "fsl,srio",
116 }, 96 },
117 { 97 {
118 .compatible = "fsl,p4080-pcie", 98 .compatible = "fsl,p4080-pcie",
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index c46f9359be15..20f75d7819c6 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -35,6 +35,7 @@
35#include <asm/cpm2.h> 35#include <asm/cpm2.h>
36#include <sysdev/cpm2_pic.h> 36#include <sysdev/cpm2_pic.h>
37 37
38#include "mpc85xx.h"
38 39
39#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */ 40#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */
40#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */ 41#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */
@@ -54,60 +55,15 @@ static void machine_restart(char *cmd)
54 for (;;); 55 for (;;);
55} 56}
56 57
57static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
58{
59 struct irq_chip *chip = irq_desc_get_chip(desc);
60 int cascade_irq;
61
62 while ((cascade_irq = cpm2_get_irq()) >= 0)
63 generic_handle_irq(cascade_irq);
64
65 chip->irq_eoi(&desc->irq_data);
66}
67
68static void __init ksi8560_pic_init(void) 58static void __init ksi8560_pic_init(void)
69{ 59{
70 struct mpic *mpic; 60 struct mpic *mpic = mpic_alloc(NULL, 0,
71 struct resource r; 61 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
72 struct device_node *np;
73#ifdef CONFIG_CPM2
74 int irq;
75#endif
76
77 np = of_find_node_by_type(NULL, "open-pic");
78
79 if (np == NULL) {
80 printk(KERN_ERR "Could not find open-pic node\n");
81 return;
82 }
83
84 if (of_address_to_resource(np, 0, &r)) {
85 printk(KERN_ERR "Could not map mpic register space\n");
86 of_node_put(np);
87 return;
88 }
89
90 mpic = mpic_alloc(np, r.start,
91 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
92 0, 256, " OpenPIC "); 62 0, 256, " OpenPIC ");
93 BUG_ON(mpic == NULL); 63 BUG_ON(mpic == NULL);
94 of_node_put(np);
95
96 mpic_init(mpic); 64 mpic_init(mpic);
97 65
98#ifdef CONFIG_CPM2 66 mpc85xx_cpm2_pic_init();
99 /* Setup CPM2 PIC */
100 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
101 if (np == NULL) {
102 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
103 return;
104 }
105 irq = irq_of_parse_and_map(np, 0);
106
107 cpm2_pic_init(np);
108 of_node_put(np);
109 irq_set_chained_handler(irq, cpm2_cascade);
110#endif
111} 67}
112 68
113#ifdef CONFIG_CPM2 69#ifdef CONFIG_CPM2
@@ -215,22 +171,7 @@ static void ksi8560_show_cpuinfo(struct seq_file *m)
215 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 171 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
216} 172}
217 173
218static struct of_device_id __initdata of_bus_ids[] = { 174machine_device_initcall(ksi8560, mpc85xx_common_publish_devices);
219 { .type = "soc", },
220 { .type = "simple-bus", },
221 { .name = "cpm", },
222 { .name = "localbus", },
223 { .compatible = "gianfar", },
224 {},
225};
226
227static int __init declare_of_platform_devices(void)
228{
229 of_platform_bus_probe(NULL, of_bus_ids, NULL);
230
231 return 0;
232}
233machine_device_initcall(ksi8560, declare_of_platform_devices);
234 175
235/* 176/*
236 * Called very early, device-tree isn't unflattened 177 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index f79f2f102141..cf266826682e 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -32,31 +32,15 @@
32#include <sysdev/fsl_soc.h> 32#include <sysdev/fsl_soc.h>
33#include <sysdev/fsl_pci.h> 33#include <sysdev/fsl_pci.h>
34 34
35#include "mpc85xx.h"
36
35void __init mpc8536_ds_pic_init(void) 37void __init mpc8536_ds_pic_init(void)
36{ 38{
37 struct mpic *mpic; 39 struct mpic *mpic = mpic_alloc(NULL, 0,
38 struct resource r; 40 MPIC_WANTS_RESET |
39 struct device_node *np;
40
41 np = of_find_node_by_type(NULL, "open-pic");
42 if (np == NULL) {
43 printk(KERN_ERR "Could not find open-pic node\n");
44 return;
45 }
46
47 if (of_address_to_resource(np, 0, &r)) {
48 printk(KERN_ERR "Failed to map mpic register space\n");
49 of_node_put(np);
50 return;
51 }
52
53 mpic = mpic_alloc(np, r.start,
54 MPIC_PRIMARY | MPIC_WANTS_RESET |
55 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, 41 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
56 0, 256, " OpenPIC "); 42 0, 256, " OpenPIC ");
57 BUG_ON(mpic == NULL); 43 BUG_ON(mpic == NULL);
58 of_node_put(np);
59
60 mpic_init(mpic); 44 mpic_init(mpic);
61} 45}
62 46
@@ -104,19 +88,7 @@ static void __init mpc8536_ds_setup_arch(void)
104 printk("MPC8536 DS board from Freescale Semiconductor\n"); 88 printk("MPC8536 DS board from Freescale Semiconductor\n");
105} 89}
106 90
107static struct of_device_id __initdata mpc8536_ds_ids[] = { 91machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
108 { .type = "soc", },
109 { .compatible = "soc", },
110 { .compatible = "simple-bus", },
111 { .compatible = "gianfar", },
112 {},
113};
114
115static int __init mpc8536_ds_publish_devices(void)
116{
117 return of_platform_bus_probe(NULL, mpc8536_ds_ids, NULL);
118}
119machine_device_initcall(mpc8536_ds, mpc8536_ds_publish_devices);
120 92
121machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier); 93machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
122 94
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h
new file mode 100644
index 000000000000..2aa7c5dc2c7f
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -0,0 +1,11 @@
1#ifndef MPC85xx_H
2#define MPC85xx_H
3extern int mpc85xx_common_publish_devices(void);
4
5#ifdef CONFIG_CPM2
6extern void mpc85xx_cpm2_pic_init(void);
7#else
8static inline void __init mpc85xx_cpm2_pic_init(void) {}
9#endif /* CONFIG_CPM2 */
10
11#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 3b2c9bb66199..3bebb5173bfc 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -35,6 +35,8 @@
35#include <sysdev/cpm2_pic.h> 35#include <sysdev/cpm2_pic.h>
36#endif 36#endif
37 37
38#include "mpc85xx.h"
39
38#ifdef CONFIG_PCI 40#ifdef CONFIG_PCI
39static int mpc85xx_exclude_device(struct pci_controller *hose, 41static int mpc85xx_exclude_device(struct pci_controller *hose,
40 u_char bus, u_char devfn) 42 u_char bus, u_char devfn)
@@ -46,63 +48,15 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
46} 48}
47#endif /* CONFIG_PCI */ 49#endif /* CONFIG_PCI */
48 50
49#ifdef CONFIG_CPM2
50
51static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
52{
53 struct irq_chip *chip = irq_desc_get_chip(desc);
54 int cascade_irq;
55
56 while ((cascade_irq = cpm2_get_irq()) >= 0)
57 generic_handle_irq(cascade_irq);
58
59 chip->irq_eoi(&desc->irq_data);
60}
61
62#endif /* CONFIG_CPM2 */
63
64static void __init mpc85xx_ads_pic_init(void) 51static void __init mpc85xx_ads_pic_init(void)
65{ 52{
66 struct mpic *mpic; 53 struct mpic *mpic = mpic_alloc(NULL, 0,
67 struct resource r; 54 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
68 struct device_node *np = NULL;
69#ifdef CONFIG_CPM2
70 int irq;
71#endif
72
73 np = of_find_node_by_type(np, "open-pic");
74 if (!np) {
75 printk(KERN_ERR "Could not find open-pic node\n");
76 return;
77 }
78
79 if (of_address_to_resource(np, 0, &r)) {
80 printk(KERN_ERR "Could not map mpic register space\n");
81 of_node_put(np);
82 return;
83 }
84
85 mpic = mpic_alloc(np, r.start,
86 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
87 0, 256, " OpenPIC "); 55 0, 256, " OpenPIC ");
88 BUG_ON(mpic == NULL); 56 BUG_ON(mpic == NULL);
89 of_node_put(np);
90
91 mpic_init(mpic); 57 mpic_init(mpic);
92 58
93#ifdef CONFIG_CPM2 59 mpc85xx_cpm2_pic_init();
94 /* Setup CPM2 PIC */
95 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
96 if (np == NULL) {
97 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
98 return;
99 }
100 irq = irq_of_parse_and_map(np, 0);
101
102 cpm2_pic_init(np);
103 of_node_put(np);
104 irq_set_chained_handler(irq, cpm2_cascade);
105#endif
106} 60}
107 61
108/* 62/*
@@ -221,23 +175,7 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
221 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 175 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
222} 176}
223 177
224static struct of_device_id __initdata of_bus_ids[] = { 178machine_device_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
225 { .name = "soc", },
226 { .type = "soc", },
227 { .name = "cpm", },
228 { .name = "localbus", },
229 { .compatible = "simple-bus", },
230 { .compatible = "gianfar", },
231 {},
232};
233
234static int __init declare_of_platform_devices(void)
235{
236 of_platform_bus_probe(NULL, of_bus_ids, NULL);
237
238 return 0;
239}
240machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
241 179
242/* 180/*
243 * Called very early, device-tree isn't unflattened 181 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 66cb8d64079f..40f03da616a9 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -46,6 +46,8 @@
46#include <sysdev/fsl_soc.h> 46#include <sysdev/fsl_soc.h>
47#include <sysdev/fsl_pci.h> 47#include <sysdev/fsl_pci.h>
48 48
49#include "mpc85xx.h"
50
49/* CADMUS info */ 51/* CADMUS info */
50/* xxx - galak, move into device tree */ 52/* xxx - galak, move into device tree */
51#define CADMUS_BASE (0xf8004000) 53#define CADMUS_BASE (0xf8004000)
@@ -177,7 +179,7 @@ static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
177 179
178static struct irqaction mpc85xxcds_8259_irqaction = { 180static struct irqaction mpc85xxcds_8259_irqaction = {
179 .handler = mpc85xx_8259_cascade_action, 181 .handler = mpc85xx_8259_cascade_action,
180 .flags = IRQF_SHARED, 182 .flags = IRQF_SHARED | IRQF_NO_THREAD,
181 .name = "8259 cascade", 183 .name = "8259 cascade",
182}; 184};
183#endif /* PPC_I8259 */ 185#endif /* PPC_I8259 */
@@ -186,30 +188,10 @@ static struct irqaction mpc85xxcds_8259_irqaction = {
186static void __init mpc85xx_cds_pic_init(void) 188static void __init mpc85xx_cds_pic_init(void)
187{ 189{
188 struct mpic *mpic; 190 struct mpic *mpic;
189 struct resource r; 191 mpic = mpic_alloc(NULL, 0,
190 struct device_node *np = NULL; 192 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
191
192 np = of_find_node_by_type(np, "open-pic");
193
194 if (np == NULL) {
195 printk(KERN_ERR "Could not find open-pic node\n");
196 return;
197 }
198
199 if (of_address_to_resource(np, 0, &r)) {
200 printk(KERN_ERR "Failed to map mpic register space\n");
201 of_node_put(np);
202 return;
203 }
204
205 mpic = mpic_alloc(np, r.start,
206 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
207 0, 256, " OpenPIC "); 193 0, 256, " OpenPIC ");
208 BUG_ON(mpic == NULL); 194 BUG_ON(mpic == NULL);
209
210 /* Return the mpic node */
211 of_node_put(np);
212
213 mpic_init(mpic); 195 mpic_init(mpic);
214} 196}
215 197
@@ -330,19 +312,7 @@ static int __init mpc85xx_cds_probe(void)
330 return of_flat_dt_is_compatible(root, "MPC85xxCDS"); 312 return of_flat_dt_is_compatible(root, "MPC85xxCDS");
331} 313}
332 314
333static struct of_device_id __initdata of_bus_ids[] = { 315machine_device_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
334 { .type = "soc", },
335 { .compatible = "soc", },
336 { .compatible = "simple-bus", },
337 { .compatible = "gianfar", },
338 {},
339};
340
341static int __init declare_of_platform_devices(void)
342{
343 return of_platform_bus_probe(NULL, of_bus_ids, NULL);
344}
345machine_device_initcall(mpc85xx_cds, declare_of_platform_devices);
346 316
347define_machine(mpc85xx_cds) { 317define_machine(mpc85xx_cds) {
348 .name = "MPC85xx CDS", 318 .name = "MPC85xx CDS",
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 1b9a8cf1873a..eefbb91e1d61 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -35,6 +35,9 @@
35 35
36#include <sysdev/fsl_soc.h> 36#include <sysdev/fsl_soc.h>
37#include <sysdev/fsl_pci.h> 37#include <sysdev/fsl_pci.h>
38#include "smp.h"
39
40#include "mpc85xx.h"
38 41
39#undef DEBUG 42#undef DEBUG
40 43
@@ -60,43 +63,27 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
60void __init mpc85xx_ds_pic_init(void) 63void __init mpc85xx_ds_pic_init(void)
61{ 64{
62 struct mpic *mpic; 65 struct mpic *mpic;
63 struct resource r;
64 struct device_node *np;
65#ifdef CONFIG_PPC_I8259 66#ifdef CONFIG_PPC_I8259
67 struct device_node *np;
66 struct device_node *cascade_node = NULL; 68 struct device_node *cascade_node = NULL;
67 int cascade_irq; 69 int cascade_irq;
68#endif 70#endif
69 unsigned long root = of_get_flat_dt_root(); 71 unsigned long root = of_get_flat_dt_root();
70 72
71 np = of_find_node_by_type(NULL, "open-pic");
72 if (np == NULL) {
73 printk(KERN_ERR "Could not find open-pic node\n");
74 return;
75 }
76
77 if (of_address_to_resource(np, 0, &r)) {
78 printk(KERN_ERR "Failed to map mpic register space\n");
79 of_node_put(np);
80 return;
81 }
82
83 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { 73 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) {
84 mpic = mpic_alloc(np, r.start, 74 mpic = mpic_alloc(NULL, 0,
85 MPIC_PRIMARY |
86 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 75 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
87 MPIC_SINGLE_DEST_CPU, 76 MPIC_SINGLE_DEST_CPU,
88 0, 256, " OpenPIC "); 77 0, 256, " OpenPIC ");
89 } else { 78 } else {
90 mpic = mpic_alloc(np, r.start, 79 mpic = mpic_alloc(NULL, 0,
91 MPIC_PRIMARY | MPIC_WANTS_RESET | 80 MPIC_WANTS_RESET |
92 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 81 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
93 MPIC_SINGLE_DEST_CPU, 82 MPIC_SINGLE_DEST_CPU,
94 0, 256, " OpenPIC "); 83 0, 256, " OpenPIC ");
95 } 84 }
96 85
97 BUG_ON(mpic == NULL); 86 BUG_ON(mpic == NULL);
98 of_node_put(np);
99
100 mpic_init(mpic); 87 mpic_init(mpic);
101 88
102#ifdef CONFIG_PPC_I8259 89#ifdef CONFIG_PPC_I8259
@@ -152,9 +139,6 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
152/* 139/*
153 * Setup the architecture 140 * Setup the architecture
154 */ 141 */
155#ifdef CONFIG_SMP
156extern void __init mpc85xx_smp_init(void);
157#endif
158static void __init mpc85xx_ds_setup_arch(void) 142static void __init mpc85xx_ds_setup_arch(void)
159{ 143{
160#ifdef CONFIG_PCI 144#ifdef CONFIG_PCI
@@ -187,9 +171,7 @@ static void __init mpc85xx_ds_setup_arch(void)
187 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 171 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
188#endif 172#endif
189 173
190#ifdef CONFIG_SMP
191 mpc85xx_smp_init(); 174 mpc85xx_smp_init();
192#endif
193 175
194#ifdef CONFIG_SWIOTLB 176#ifdef CONFIG_SWIOTLB
195 if (memblock_end_of_DRAM() > max) { 177 if (memblock_end_of_DRAM() > max) {
@@ -219,21 +201,9 @@ static int __init mpc8544_ds_probe(void)
219 return 0; 201 return 0;
220} 202}
221 203
222static struct of_device_id __initdata mpc85xxds_ids[] = { 204machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
223 { .type = "soc", }, 205machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
224 { .compatible = "soc", }, 206machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices);
225 { .compatible = "simple-bus", },
226 { .compatible = "gianfar", },
227 {},
228};
229
230static int __init mpc85xxds_publish_devices(void)
231{
232 return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL);
233}
234machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
235machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices);
236machine_device_initcall(p2020_ds, mpc85xxds_publish_devices);
237 207
238machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier); 208machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier);
239machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier); 209machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index a23a3ff634c5..1d15a0cd2c82 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -51,6 +51,9 @@
51#include <asm/qe_ic.h> 51#include <asm/qe_ic.h>
52#include <asm/mpic.h> 52#include <asm/mpic.h>
53#include <asm/swiotlb.h> 53#include <asm/swiotlb.h>
54#include "smp.h"
55
56#include "mpc85xx.h"
54 57
55#undef DEBUG 58#undef DEBUG
56#ifdef DEBUG 59#ifdef DEBUG
@@ -153,30 +156,7 @@ static int mpc8568_mds_phy_fixups(struct phy_device *phydev)
153 * Setup the architecture 156 * Setup the architecture
154 * 157 *
155 */ 158 */
156#ifdef CONFIG_SMP
157extern void __init mpc85xx_smp_init(void);
158#endif
159
160#ifdef CONFIG_QUICC_ENGINE 159#ifdef CONFIG_QUICC_ENGINE
161static struct of_device_id mpc85xx_qe_ids[] __initdata = {
162 { .type = "qe", },
163 { .compatible = "fsl,qe", },
164 { },
165};
166
167static void __init mpc85xx_publish_qe_devices(void)
168{
169 struct device_node *np;
170
171 np = of_find_compatible_node(NULL, NULL, "fsl,qe");
172 if (!of_device_is_available(np)) {
173 of_node_put(np);
174 return;
175 }
176
177 of_platform_bus_probe(NULL, mpc85xx_qe_ids, NULL);
178}
179
180static void __init mpc85xx_mds_reset_ucc_phys(void) 160static void __init mpc85xx_mds_reset_ucc_phys(void)
181{ 161{
182 struct device_node *np; 162 struct device_node *np;
@@ -347,7 +327,6 @@ static void __init mpc85xx_mds_qeic_init(void)
347 of_node_put(np); 327 of_node_put(np);
348} 328}
349#else 329#else
350static void __init mpc85xx_publish_qe_devices(void) { }
351static void __init mpc85xx_mds_qe_init(void) { } 330static void __init mpc85xx_mds_qe_init(void) { }
352static void __init mpc85xx_mds_qeic_init(void) { } 331static void __init mpc85xx_mds_qeic_init(void) { }
353#endif /* CONFIG_QUICC_ENGINE */ 332#endif /* CONFIG_QUICC_ENGINE */
@@ -381,9 +360,7 @@ static void __init mpc85xx_mds_setup_arch(void)
381 } 360 }
382#endif 361#endif
383 362
384#ifdef CONFIG_SMP
385 mpc85xx_smp_init(); 363 mpc85xx_smp_init();
386#endif
387 364
388 mpc85xx_mds_qe_init(); 365 mpc85xx_mds_qe_init();
389 366
@@ -429,24 +406,11 @@ machine_arch_initcall(mpc8568_mds, board_fixups);
429machine_arch_initcall(mpc8569_mds, board_fixups); 406machine_arch_initcall(mpc8569_mds, board_fixups);
430 407
431static struct of_device_id mpc85xx_ids[] = { 408static struct of_device_id mpc85xx_ids[] = {
432 { .type = "soc", },
433 { .compatible = "soc", },
434 { .compatible = "simple-bus", },
435 { .compatible = "gianfar", },
436 { .compatible = "fsl,rapidio-delta", },
437 { .compatible = "fsl,mpc8548-guts", }, 409 { .compatible = "fsl,mpc8548-guts", },
438 { .compatible = "gpio-leds", }, 410 { .compatible = "gpio-leds", },
439 {}, 411 {},
440}; 412};
441 413
442static struct of_device_id p1021_ids[] = {
443 { .type = "soc", },
444 { .compatible = "soc", },
445 { .compatible = "simple-bus", },
446 { .compatible = "gianfar", },
447 {},
448};
449
450static int __init mpc85xx_publish_devices(void) 414static int __init mpc85xx_publish_devices(void)
451{ 415{
452 if (machine_is(mpc8568_mds)) 416 if (machine_is(mpc8568_mds))
@@ -454,23 +418,15 @@ static int __init mpc85xx_publish_devices(void)
454 if (machine_is(mpc8569_mds)) 418 if (machine_is(mpc8569_mds))
455 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); 419 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
456 420
421 mpc85xx_common_publish_devices();
457 of_platform_bus_probe(NULL, mpc85xx_ids, NULL); 422 of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
458 mpc85xx_publish_qe_devices();
459
460 return 0;
461}
462
463static int __init p1021_publish_devices(void)
464{
465 of_platform_bus_probe(NULL, p1021_ids, NULL);
466 mpc85xx_publish_qe_devices();
467 423
468 return 0; 424 return 0;
469} 425}
470 426
471machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); 427machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
472machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices); 428machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
473machine_device_initcall(p1021_mds, p1021_publish_devices); 429machine_device_initcall(p1021_mds, mpc85xx_common_publish_devices);
474 430
475machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); 431machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier);
476machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); 432machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier);
@@ -478,26 +434,11 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier);
478 434
479static void __init mpc85xx_mds_pic_init(void) 435static void __init mpc85xx_mds_pic_init(void)
480{ 436{
481 struct mpic *mpic; 437 struct mpic *mpic = mpic_alloc(NULL, 0,
482 struct resource r; 438 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
483 struct device_node *np = NULL;
484
485 np = of_find_node_by_type(NULL, "open-pic");
486 if (!np)
487 return;
488
489 if (of_address_to_resource(np, 0, &r)) {
490 printk(KERN_ERR "Failed to map mpic register space\n");
491 of_node_put(np);
492 return;
493 }
494
495 mpic = mpic_alloc(np, r.start,
496 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
497 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, 439 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
498 0, 256, " OpenPIC "); 440 0, 256, " OpenPIC ");
499 BUG_ON(mpic == NULL); 441 BUG_ON(mpic == NULL);
500 of_node_put(np);
501 442
502 mpic_init(mpic); 443 mpic_init(mpic);
503 mpc85xx_mds_qeic_init(); 444 mpc85xx_mds_qeic_init();
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index f5ff9110c97e..ccf520e890be 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -29,6 +29,9 @@
29 29
30#include <sysdev/fsl_soc.h> 30#include <sysdev/fsl_soc.h>
31#include <sysdev/fsl_pci.h> 31#include <sysdev/fsl_pci.h>
32#include "smp.h"
33
34#include "mpc85xx.h"
32 35
33#undef DEBUG 36#undef DEBUG
34 37
@@ -42,49 +45,28 @@
42void __init mpc85xx_rdb_pic_init(void) 45void __init mpc85xx_rdb_pic_init(void)
43{ 46{
44 struct mpic *mpic; 47 struct mpic *mpic;
45 struct resource r;
46 struct device_node *np;
47 unsigned long root = of_get_flat_dt_root(); 48 unsigned long root = of_get_flat_dt_root();
48 49
49 np = of_find_node_by_type(NULL, "open-pic");
50 if (np == NULL) {
51 printk(KERN_ERR "Could not find open-pic node\n");
52 return;
53 }
54
55 if (of_address_to_resource(np, 0, &r)) {
56 printk(KERN_ERR "Failed to map mpic register space\n");
57 of_node_put(np);
58 return;
59 }
60
61 if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { 50 if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) {
62 mpic = mpic_alloc(np, r.start, 51 mpic = mpic_alloc(NULL, 0,
63 MPIC_PRIMARY |
64 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 52 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
65 MPIC_SINGLE_DEST_CPU, 53 MPIC_SINGLE_DEST_CPU,
66 0, 256, " OpenPIC "); 54 0, 256, " OpenPIC ");
67 } else { 55 } else {
68 mpic = mpic_alloc(np, r.start, 56 mpic = mpic_alloc(NULL, 0,
69 MPIC_PRIMARY | MPIC_WANTS_RESET | 57 MPIC_WANTS_RESET |
70 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 58 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
71 MPIC_SINGLE_DEST_CPU, 59 MPIC_SINGLE_DEST_CPU,
72 0, 256, " OpenPIC "); 60 0, 256, " OpenPIC ");
73 } 61 }
74 62
75 BUG_ON(mpic == NULL); 63 BUG_ON(mpic == NULL);
76 of_node_put(np);
77
78 mpic_init(mpic); 64 mpic_init(mpic);
79
80} 65}
81 66
82/* 67/*
83 * Setup the architecture 68 * Setup the architecture
84 */ 69 */
85#ifdef CONFIG_SMP
86extern void __init mpc85xx_smp_init(void);
87#endif
88static void __init mpc85xx_rdb_setup_arch(void) 70static void __init mpc85xx_rdb_setup_arch(void)
89{ 71{
90#ifdef CONFIG_PCI 72#ifdef CONFIG_PCI
@@ -102,27 +84,12 @@ static void __init mpc85xx_rdb_setup_arch(void)
102 84
103#endif 85#endif
104 86
105#ifdef CONFIG_SMP
106 mpc85xx_smp_init(); 87 mpc85xx_smp_init();
107#endif
108
109 printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); 88 printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
110} 89}
111 90
112static struct of_device_id __initdata mpc85xxrdb_ids[] = { 91machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices);
113 { .type = "soc", }, 92machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices);
114 { .compatible = "soc", },
115 { .compatible = "simple-bus", },
116 { .compatible = "gianfar", },
117 {},
118};
119
120static int __init mpc85xxrdb_publish_devices(void)
121{
122 return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
123}
124machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
125machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
126 93
127/* 94/*
128 * Called very early, device-tree isn't unflattened 95 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index d7387fa7f534..538bc3f57e9d 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -28,33 +28,18 @@
28#include <sysdev/fsl_soc.h> 28#include <sysdev/fsl_soc.h>
29#include <sysdev/fsl_pci.h> 29#include <sysdev/fsl_pci.h>
30 30
31#include "mpc85xx.h"
32
31void __init p1010_rdb_pic_init(void) 33void __init p1010_rdb_pic_init(void)
32{ 34{
33 struct mpic *mpic; 35 struct mpic *mpic = mpic_alloc(NULL, 0,
34 struct resource r; 36 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
35 struct device_node *np; 37 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
36
37 np = of_find_node_by_type(NULL, "open-pic");
38 if (np == NULL) {
39 printk(KERN_ERR "Could not find open-pic node\n");
40 return;
41 }
42
43 if (of_address_to_resource(np, 0, &r)) {
44 printk(KERN_ERR "Failed to map mpic register space\n");
45 of_node_put(np);
46 return;
47 }
48
49 mpic = mpic_alloc(np, r.start, MPIC_PRIMARY | MPIC_WANTS_RESET |
50 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
51 0, 256, " OpenPIC "); 38 0, 256, " OpenPIC ");
52 39
53 BUG_ON(mpic == NULL); 40 BUG_ON(mpic == NULL);
54 of_node_put(np);
55 41
56 mpic_init(mpic); 42 mpic_init(mpic);
57
58} 43}
59 44
60 45
@@ -81,18 +66,7 @@ static void __init p1010_rdb_setup_arch(void)
81 printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n"); 66 printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
82} 67}
83 68
84static struct of_device_id __initdata p1010rdb_ids[] = { 69machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
85 { .type = "soc", },
86 { .compatible = "soc", },
87 { .compatible = "simple-bus", },
88 {},
89};
90
91static int __init p1010rdb_publish_devices(void)
92{
93 return of_platform_bus_probe(NULL, p1010rdb_ids, NULL);
94}
95machine_device_initcall(p1010_rdb, p1010rdb_publish_devices);
96machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier); 70machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
97 71
98/* 72/*
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index fda15716fada..bb3d84f4046f 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -26,6 +26,9 @@
26#include <sysdev/fsl_soc.h> 26#include <sysdev/fsl_soc.h>
27#include <sysdev/fsl_pci.h> 27#include <sysdev/fsl_pci.h>
28#include <asm/fsl_guts.h> 28#include <asm/fsl_guts.h>
29#include "smp.h"
30
31#include "mpc85xx.h"
29 32
30#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 33#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
31 34
@@ -238,38 +241,15 @@ p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port)
238 241
239void __init p1022_ds_pic_init(void) 242void __init p1022_ds_pic_init(void)
240{ 243{
241 struct mpic *mpic; 244 struct mpic *mpic = mpic_alloc(NULL, 0,
242 struct resource r; 245 MPIC_WANTS_RESET |
243 struct device_node *np;
244
245 np = of_find_node_by_type(NULL, "open-pic");
246 if (!np) {
247 pr_err("Could not find open-pic node\n");
248 return;
249 }
250
251 if (of_address_to_resource(np, 0, &r)) {
252 pr_err("Failed to map mpic register space\n");
253 of_node_put(np);
254 return;
255 }
256
257 mpic = mpic_alloc(np, r.start,
258 MPIC_PRIMARY | MPIC_WANTS_RESET |
259 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | 246 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
260 MPIC_SINGLE_DEST_CPU, 247 MPIC_SINGLE_DEST_CPU,
261 0, 256, " OpenPIC "); 248 0, 256, " OpenPIC ");
262
263 BUG_ON(mpic == NULL); 249 BUG_ON(mpic == NULL);
264 of_node_put(np);
265
266 mpic_init(mpic); 250 mpic_init(mpic);
267} 251}
268 252
269#ifdef CONFIG_SMP
270void __init mpc85xx_smp_init(void);
271#endif
272
273/* 253/*
274 * Setup the architecture 254 * Setup the architecture
275 */ 255 */
@@ -309,9 +289,7 @@ static void __init p1022_ds_setup_arch(void)
309 diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; 289 diu_ops.valid_monitor_port = p1022ds_valid_monitor_port;
310#endif 290#endif
311 291
312#ifdef CONFIG_SMP
313 mpc85xx_smp_init(); 292 mpc85xx_smp_init();
314#endif
315 293
316#ifdef CONFIG_SWIOTLB 294#ifdef CONFIG_SWIOTLB
317 if (memblock_end_of_DRAM() > max) { 295 if (memblock_end_of_DRAM() > max) {
@@ -325,10 +303,6 @@ static void __init p1022_ds_setup_arch(void)
325} 303}
326 304
327static struct of_device_id __initdata p1022_ds_ids[] = { 305static struct of_device_id __initdata p1022_ds_ids[] = {
328 { .type = "soc", },
329 { .compatible = "soc", },
330 { .compatible = "simple-bus", },
331 { .compatible = "gianfar", },
332 /* So that the DMA channel nodes can be probed individually: */ 306 /* So that the DMA channel nodes can be probed individually: */
333 { .compatible = "fsl,eloplus-dma", }, 307 { .compatible = "fsl,eloplus-dma", },
334 {}, 308 {},
@@ -336,6 +310,7 @@ static struct of_device_id __initdata p1022_ds_ids[] = {
336 310
337static int __init p1022_ds_publish_devices(void) 311static int __init p1022_ds_publish_devices(void)
338{ 312{
313 mpc85xx_common_publish_devices();
339 return of_platform_bus_probe(NULL, p1022_ds_ids, NULL); 314 return of_platform_bus_probe(NULL, p1022_ds_ids, NULL);
340} 315}
341machine_device_initcall(p1022_ds, p1022_ds_publish_devices); 316machine_device_initcall(p1022_ds, p1022_ds_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c
index 835e0b335bfa..d951e7027bb6 100644
--- a/arch/powerpc/platforms/85xx/p1023_rds.c
+++ b/arch/powerpc/platforms/85xx/p1023_rds.c
@@ -30,19 +30,18 @@
30#include <asm/prom.h> 30#include <asm/prom.h>
31#include <asm/udbg.h> 31#include <asm/udbg.h>
32#include <asm/mpic.h> 32#include <asm/mpic.h>
33#include "smp.h"
33 34
34#include <sysdev/fsl_soc.h> 35#include <sysdev/fsl_soc.h>
35#include <sysdev/fsl_pci.h> 36#include <sysdev/fsl_pci.h>
36 37
38#include "mpc85xx.h"
39
37/* ************************************************************************ 40/* ************************************************************************
38 * 41 *
39 * Setup the architecture 42 * Setup the architecture
40 * 43 *
41 */ 44 */
42#ifdef CONFIG_SMP
43void __init mpc85xx_smp_init(void);
44#endif
45
46static void __init mpc85xx_rds_setup_arch(void) 45static void __init mpc85xx_rds_setup_arch(void)
47{ 46{
48 struct device_node *np; 47 struct device_node *np;
@@ -87,53 +86,19 @@ static void __init mpc85xx_rds_setup_arch(void)
87 fsl_add_bridge(np, 0); 86 fsl_add_bridge(np, 0);
88#endif 87#endif
89 88
90#ifdef CONFIG_SMP
91 mpc85xx_smp_init(); 89 mpc85xx_smp_init();
92#endif
93}
94
95static struct of_device_id p1023_ids[] = {
96 { .type = "soc", },
97 { .compatible = "soc", },
98 { .compatible = "simple-bus", },
99 {},
100};
101
102
103static int __init p1023_publish_devices(void)
104{
105 of_platform_bus_probe(NULL, p1023_ids, NULL);
106
107 return 0;
108} 90}
109 91
110machine_device_initcall(p1023_rds, p1023_publish_devices); 92machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
111 93
112static void __init mpc85xx_rds_pic_init(void) 94static void __init mpc85xx_rds_pic_init(void)
113{ 95{
114 struct mpic *mpic; 96 struct mpic *mpic = mpic_alloc(NULL, 0,
115 struct resource r; 97 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
116 struct device_node *np = NULL;
117
118 np = of_find_node_by_type(NULL, "open-pic");
119 if (!np) {
120 printk(KERN_ERR "Could not find open-pic node\n");
121 return;
122 }
123
124 if (of_address_to_resource(np, 0, &r)) {
125 printk(KERN_ERR "Failed to map mpic register space\n");
126 of_node_put(np);
127 return;
128 }
129
130 mpic = mpic_alloc(np, r.start,
131 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
132 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, 98 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
133 0, 256, " OpenPIC "); 99 0, 256, " OpenPIC ");
134 100
135 BUG_ON(mpic == NULL); 101 BUG_ON(mpic == NULL);
136 of_node_put(np);
137 102
138 mpic_init(mpic); 103 mpic_init(mpic);
139} 104}
diff --git a/arch/powerpc/platforms/85xx/p3060_qds.c b/arch/powerpc/platforms/85xx/p3060_qds.c
index 01dcf44871e9..081cf4ac1881 100644
--- a/arch/powerpc/platforms/85xx/p3060_qds.c
+++ b/arch/powerpc/platforms/85xx/p3060_qds.c
@@ -70,7 +70,7 @@ define_machine(p3060_qds) {
70 .power_save = e500_idle, 70 .power_save = e500_idle,
71}; 71};
72 72
73machine_device_initcall(p3060_qds, declare_of_platform_devices); 73machine_device_initcall(p3060_qds, corenet_ds_publish_devices);
74 74
75#ifdef CONFIG_SWIOTLB 75#ifdef CONFIG_SWIOTLB
76machine_arch_initcall(p3060_qds, swiotlb_setup_bus_notifier); 76machine_arch_initcall(p3060_qds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 14632a971225..184a50784617 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -48,35 +48,16 @@
48#include <sysdev/fsl_soc.h> 48#include <sysdev/fsl_soc.h>
49#include <sysdev/fsl_pci.h> 49#include <sysdev/fsl_pci.h>
50 50
51#include "mpc85xx.h"
52
51static int sbc_rev; 53static int sbc_rev;
52 54
53static void __init sbc8548_pic_init(void) 55static void __init sbc8548_pic_init(void)
54{ 56{
55 struct mpic *mpic; 57 struct mpic *mpic = mpic_alloc(NULL, 0,
56 struct resource r; 58 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
57 struct device_node *np = NULL;
58
59 np = of_find_node_by_type(np, "open-pic");
60
61 if (np == NULL) {
62 printk(KERN_ERR "Could not find open-pic node\n");
63 return;
64 }
65
66 if (of_address_to_resource(np, 0, &r)) {
67 printk(KERN_ERR "Failed to map mpic register space\n");
68 of_node_put(np);
69 return;
70 }
71
72 mpic = mpic_alloc(np, r.start,
73 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
74 0, 256, " OpenPIC "); 59 0, 256, " OpenPIC ");
75 BUG_ON(mpic == NULL); 60 BUG_ON(mpic == NULL);
76
77 /* Return the mpic node */
78 of_node_put(np);
79
80 mpic_init(mpic); 61 mpic_init(mpic);
81} 62}
82 63
@@ -149,21 +130,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
149 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 130 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
150} 131}
151 132
152static struct of_device_id __initdata of_bus_ids[] = { 133machine_device_initcall(sbc8548, mpc85xx_common_publish_devices);
153 { .name = "soc", },
154 { .type = "soc", },
155 { .compatible = "simple-bus", },
156 { .compatible = "gianfar", },
157 {},
158};
159
160static int __init declare_of_platform_devices(void)
161{
162 of_platform_bus_probe(NULL, of_bus_ids, NULL);
163
164 return 0;
165}
166machine_device_initcall(sbc8548, declare_of_platform_devices);
167 134
168/* 135/*
169 * Called very early, device-tree isn't unflattened 136 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index cebd786dc334..940752e93051 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -32,68 +32,22 @@
32#include <sysdev/fsl_soc.h> 32#include <sysdev/fsl_soc.h>
33#include <sysdev/fsl_pci.h> 33#include <sysdev/fsl_pci.h>
34 34
35#include "mpc85xx.h"
36
35#ifdef CONFIG_CPM2 37#ifdef CONFIG_CPM2
36#include <asm/cpm2.h> 38#include <asm/cpm2.h>
37#include <sysdev/cpm2_pic.h> 39#include <sysdev/cpm2_pic.h>
38#endif 40#endif
39 41
40#ifdef CONFIG_CPM2
41
42static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
43{
44 struct irq_chip *chip = irq_desc_get_chip(desc);
45 int cascade_irq;
46
47 while ((cascade_irq = cpm2_get_irq()) >= 0)
48 generic_handle_irq(cascade_irq);
49
50 chip->irq_eoi(&desc->irq_data);
51}
52
53#endif /* CONFIG_CPM2 */
54
55static void __init sbc8560_pic_init(void) 42static void __init sbc8560_pic_init(void)
56{ 43{
57 struct mpic *mpic; 44 struct mpic *mpic = mpic_alloc(NULL, 0,
58 struct resource r; 45 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
59 struct device_node *np = NULL;
60#ifdef CONFIG_CPM2
61 int irq;
62#endif
63
64 np = of_find_node_by_type(np, "open-pic");
65 if (!np) {
66 printk(KERN_ERR "Could not find open-pic node\n");
67 return;
68 }
69
70 if (of_address_to_resource(np, 0, &r)) {
71 printk(KERN_ERR "Could not map mpic register space\n");
72 of_node_put(np);
73 return;
74 }
75
76 mpic = mpic_alloc(np, r.start,
77 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
78 0, 256, " OpenPIC "); 46 0, 256, " OpenPIC ");
79 BUG_ON(mpic == NULL); 47 BUG_ON(mpic == NULL);
80 of_node_put(np);
81
82 mpic_init(mpic); 48 mpic_init(mpic);
83 49
84#ifdef CONFIG_CPM2 50 mpc85xx_cpm2_pic_init();
85 /* Setup CPM2 PIC */
86 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
87 if (np == NULL) {
88 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
89 return;
90 }
91 irq = irq_of_parse_and_map(np, 0);
92
93 cpm2_pic_init(np);
94 of_node_put(np);
95 irq_set_chained_handler(irq, cpm2_cascade);
96#endif
97} 51}
98 52
99/* 53/*
@@ -208,23 +162,7 @@ static void sbc8560_show_cpuinfo(struct seq_file *m)
208 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 162 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
209} 163}
210 164
211static struct of_device_id __initdata of_bus_ids[] = { 165machine_device_initcall(sbc8560, mpc85xx_common_publish_devices);
212 { .name = "soc", },
213 { .type = "soc", },
214 { .name = "cpm", },
215 { .name = "localbus", },
216 { .compatible = "simple-bus", },
217 { .compatible = "gianfar", },
218 {},
219};
220
221static int __init declare_of_platform_devices(void)
222{
223 of_platform_bus_probe(NULL, of_bus_ids, NULL);
224
225 return 0;
226}
227machine_device_initcall(sbc8560, declare_of_platform_devices);
228 166
229/* 167/*
230 * Called very early, device-tree isn't unflattened 168 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 2df4785ffd4e..ff4249044a3c 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -27,6 +27,7 @@
27 27
28#include <sysdev/fsl_soc.h> 28#include <sysdev/fsl_soc.h>
29#include <sysdev/mpic.h> 29#include <sysdev/mpic.h>
30#include "smp.h"
30 31
31extern void __early_start(void); 32extern void __early_start(void);
32 33
diff --git a/arch/powerpc/platforms/85xx/smp.h b/arch/powerpc/platforms/85xx/smp.h
new file mode 100644
index 000000000000..e2b44933ff19
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/smp.h
@@ -0,0 +1,15 @@
1#ifndef POWERPC_85XX_SMP_H_
2#define POWERPC_85XX_SMP_H_ 1
3
4#include <linux/init.h>
5
6#ifdef CONFIG_SMP
7void __init mpc85xx_smp_init(void);
8#else
9static inline void mpc85xx_smp_init(void)
10{
11 /* Nothing to do */
12}
13#endif
14
15#endif /* not POWERPC_85XX_SMP_H_ */
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index 747d8fb3ab82..18f635906b27 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -41,32 +41,17 @@
41#include <sysdev/fsl_soc.h> 41#include <sysdev/fsl_soc.h>
42#include <sysdev/fsl_pci.h> 42#include <sysdev/fsl_pci.h>
43 43
44#include "mpc85xx.h"
44#include "socrates_fpga_pic.h" 45#include "socrates_fpga_pic.h"
45 46
46static void __init socrates_pic_init(void) 47static void __init socrates_pic_init(void)
47{ 48{
48 struct mpic *mpic;
49 struct resource r;
50 struct device_node *np; 49 struct device_node *np;
51 50
52 np = of_find_node_by_type(NULL, "open-pic"); 51 struct mpic *mpic = mpic_alloc(NULL, 0,
53 if (!np) { 52 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
54 printk(KERN_ERR "Could not find open-pic node\n");
55 return;
56 }
57
58 if (of_address_to_resource(np, 0, &r)) {
59 printk(KERN_ERR "Could not map mpic register space\n");
60 of_node_put(np);
61 return;
62 }
63
64 mpic = mpic_alloc(np, r.start,
65 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
66 0, 256, " OpenPIC "); 53 0, 256, " OpenPIC ");
67 BUG_ON(mpic == NULL); 54 BUG_ON(mpic == NULL);
68 of_node_put(np);
69
70 mpic_init(mpic); 55 mpic_init(mpic);
71 56
72 np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic"); 57 np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic");
@@ -96,17 +81,7 @@ static void __init socrates_setup_arch(void)
96#endif 81#endif
97} 82}
98 83
99static struct of_device_id __initdata socrates_of_bus_ids[] = { 84machine_device_initcall(socrates, mpc85xx_common_publish_devices);
100 { .compatible = "simple-bus", },
101 { .compatible = "gianfar", },
102 {},
103};
104
105static int __init socrates_publish_devices(void)
106{
107 return of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
108}
109machine_device_initcall(socrates, socrates_publish_devices);
110 85
111/* 86/*
112 * Called very early, device-tree isn't unflattened 87 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index 5387e9f06bdb..e9e5234b4e76 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -40,70 +40,21 @@
40#include <sysdev/fsl_soc.h> 40#include <sysdev/fsl_soc.h>
41#include <sysdev/fsl_pci.h> 41#include <sysdev/fsl_pci.h>
42 42
43#include "mpc85xx.h"
44
43#ifdef CONFIG_CPM2 45#ifdef CONFIG_CPM2
44#include <asm/cpm2.h> 46#include <asm/cpm2.h>
45#include <sysdev/cpm2_pic.h>
46
47static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
48{
49 struct irq_chip *chip = irq_desc_get_chip(desc);
50 int cascade_irq;
51
52 while ((cascade_irq = cpm2_get_irq()) >= 0)
53 generic_handle_irq(cascade_irq);
54
55 chip->irq_eoi(&desc->irq_data);
56}
57#endif /* CONFIG_CPM2 */ 47#endif /* CONFIG_CPM2 */
58 48
59static void __init stx_gp3_pic_init(void) 49static void __init stx_gp3_pic_init(void)
60{ 50{
61 struct mpic *mpic; 51 struct mpic *mpic = mpic_alloc(NULL, 0,
62 struct resource r; 52 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
63 struct device_node *np;
64#ifdef CONFIG_CPM2
65 int irq;
66#endif
67
68 np = of_find_node_by_type(NULL, "open-pic");
69 if (!np) {
70 printk(KERN_ERR "Could not find open-pic node\n");
71 return;
72 }
73
74 if (of_address_to_resource(np, 0, &r)) {
75 printk(KERN_ERR "Could not map mpic register space\n");
76 of_node_put(np);
77 return;
78 }
79
80 mpic = mpic_alloc(np, r.start,
81 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
82 0, 256, " OpenPIC "); 53 0, 256, " OpenPIC ");
83 BUG_ON(mpic == NULL); 54 BUG_ON(mpic == NULL);
84 of_node_put(np);
85
86 mpic_init(mpic); 55 mpic_init(mpic);
87 56
88#ifdef CONFIG_CPM2 57 mpc85xx_cpm2_pic_init();
89 /* Setup CPM2 PIC */
90 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
91 if (np == NULL) {
92 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
93 return;
94 }
95 irq = irq_of_parse_and_map(np, 0);
96
97 if (irq == NO_IRQ) {
98 of_node_put(np);
99 printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
100 return;
101 }
102
103 cpm2_pic_init(np);
104 of_node_put(np);
105 irq_set_chained_handler(irq, cpm2_cascade);
106#endif
107} 58}
108 59
109/* 60/*
@@ -144,19 +95,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
144 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 95 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
145} 96}
146 97
147static struct of_device_id __initdata of_bus_ids[] = { 98machine_device_initcall(stx_gp3, mpc85xx_common_publish_devices);
148 { .compatible = "simple-bus", },
149 { .compatible = "gianfar", },
150 {},
151};
152
153static int __init declare_of_platform_devices(void)
154{
155 of_platform_bus_probe(NULL, of_bus_ids, NULL);
156
157 return 0;
158}
159machine_device_initcall(stx_gp3, declare_of_platform_devices);
160 99
161/* 100/*
162 * Called very early, device-tree isn't unflattened 101 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 325de772725a..bf7c89fb75bb 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -38,70 +38,21 @@
38#include <sysdev/fsl_soc.h> 38#include <sysdev/fsl_soc.h>
39#include <sysdev/fsl_pci.h> 39#include <sysdev/fsl_pci.h>
40 40
41#include "mpc85xx.h"
42
41#ifdef CONFIG_CPM2 43#ifdef CONFIG_CPM2
42#include <asm/cpm2.h> 44#include <asm/cpm2.h>
43#include <sysdev/cpm2_pic.h>
44
45static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
46{
47 struct irq_chip *chip = irq_desc_get_chip(desc);
48 int cascade_irq;
49
50 while ((cascade_irq = cpm2_get_irq()) >= 0)
51 generic_handle_irq(cascade_irq);
52
53 chip->irq_eoi(&desc->irq_data);
54}
55#endif /* CONFIG_CPM2 */ 45#endif /* CONFIG_CPM2 */
56 46
57static void __init tqm85xx_pic_init(void) 47static void __init tqm85xx_pic_init(void)
58{ 48{
59 struct mpic *mpic; 49 struct mpic *mpic = mpic_alloc(NULL, 0,
60 struct resource r; 50 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
61 struct device_node *np;
62#ifdef CONFIG_CPM2
63 int irq;
64#endif
65
66 np = of_find_node_by_type(NULL, "open-pic");
67 if (!np) {
68 printk(KERN_ERR "Could not find open-pic node\n");
69 return;
70 }
71
72 if (of_address_to_resource(np, 0, &r)) {
73 printk(KERN_ERR "Could not map mpic register space\n");
74 of_node_put(np);
75 return;
76 }
77
78 mpic = mpic_alloc(np, r.start,
79 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
80 0, 256, " OpenPIC "); 51 0, 256, " OpenPIC ");
81 BUG_ON(mpic == NULL); 52 BUG_ON(mpic == NULL);
82 of_node_put(np);
83
84 mpic_init(mpic); 53 mpic_init(mpic);
85 54
86#ifdef CONFIG_CPM2 55 mpc85xx_cpm2_pic_init();
87 /* Setup CPM2 PIC */
88 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
89 if (np == NULL) {
90 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
91 return;
92 }
93 irq = irq_of_parse_and_map(np, 0);
94
95 if (irq == NO_IRQ) {
96 of_node_put(np);
97 printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
98 return;
99 }
100
101 cpm2_pic_init(np);
102 of_node_put(np);
103 irq_set_chained_handler(irq, cpm2_cascade);
104#endif
105} 56}
106 57
107/* 58/*
@@ -173,19 +124,7 @@ static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev)
173DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520, 124DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,
174 tqm85xx_ti1520_fixup); 125 tqm85xx_ti1520_fixup);
175 126
176static struct of_device_id __initdata of_bus_ids[] = { 127machine_device_initcall(tqm85xx, mpc85xx_common_publish_devices);
177 { .compatible = "simple-bus", },
178 { .compatible = "gianfar", },
179 {},
180};
181
182static int __init declare_of_platform_devices(void)
183{
184 of_platform_bus_probe(NULL, of_bus_ids, NULL);
185
186 return 0;
187}
188machine_device_initcall(tqm85xx, declare_of_platform_devices);
189 128
190static const char *board[] __initdata = { 129static const char *board[] __initdata = {
191 "tqc,tqm8540", 130 "tqc,tqm8540",
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index a9dc5e795123..3a69f8b77de6 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -32,6 +32,9 @@
32 32
33#include <sysdev/fsl_soc.h> 33#include <sysdev/fsl_soc.h>
34#include <sysdev/fsl_pci.h> 34#include <sysdev/fsl_pci.h>
35#include "smp.h"
36
37#include "mpc85xx.h"
35 38
36/* A few bit definitions needed for fixups on some boards */ 39/* A few bit definitions needed for fixups on some boards */
37#define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */ 40#define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */
@@ -40,29 +43,11 @@
40 43
41void __init xes_mpc85xx_pic_init(void) 44void __init xes_mpc85xx_pic_init(void)
42{ 45{
43 struct mpic *mpic; 46 struct mpic *mpic = mpic_alloc(NULL, 0,
44 struct resource r; 47 MPIC_WANTS_RESET |
45 struct device_node *np;
46
47 np = of_find_node_by_type(NULL, "open-pic");
48 if (np == NULL) {
49 printk(KERN_ERR "Could not find open-pic node\n");
50 return;
51 }
52
53 if (of_address_to_resource(np, 0, &r)) {
54 printk(KERN_ERR "Failed to map mpic register space\n");
55 of_node_put(np);
56 return;
57 }
58
59 mpic = mpic_alloc(np, r.start,
60 MPIC_PRIMARY | MPIC_WANTS_RESET |
61 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, 48 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
62 0, 256, " OpenPIC "); 49 0, 256, " OpenPIC ");
63 BUG_ON(mpic == NULL); 50 BUG_ON(mpic == NULL);
64 of_node_put(np);
65
66 mpic_init(mpic); 51 mpic_init(mpic);
67} 52}
68 53
@@ -136,9 +121,6 @@ static int primary_phb_addr;
136/* 121/*
137 * Setup the architecture 122 * Setup the architecture
138 */ 123 */
139#ifdef CONFIG_SMP
140extern void __init mpc85xx_smp_init(void);
141#endif
142static void __init xes_mpc85xx_setup_arch(void) 124static void __init xes_mpc85xx_setup_arch(void)
143{ 125{
144#ifdef CONFIG_PCI 126#ifdef CONFIG_PCI
@@ -172,26 +154,12 @@ static void __init xes_mpc85xx_setup_arch(void)
172 } 154 }
173#endif 155#endif
174 156
175#ifdef CONFIG_SMP
176 mpc85xx_smp_init(); 157 mpc85xx_smp_init();
177#endif
178} 158}
179 159
180static struct of_device_id __initdata xes_mpc85xx_ids[] = { 160machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
181 { .type = "soc", }, 161machine_device_initcall(xes_mpc8548, mpc85xx_common_publish_devices);
182 { .compatible = "soc", }, 162machine_device_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
183 { .compatible = "simple-bus", },
184 { .compatible = "gianfar", },
185 {},
186};
187
188static int __init xes_mpc85xx_publish_devices(void)
189{
190 return of_platform_bus_probe(NULL, xes_mpc85xx_ids, NULL);
191}
192machine_device_initcall(xes_mpc8572, xes_mpc85xx_publish_devices);
193machine_device_initcall(xes_mpc8548, xes_mpc85xx_publish_devices);
194machine_device_initcall(xes_mpc8540, xes_mpc85xx_publish_devices);
195 163
196/* 164/*
197 * Called very early, device-tree isn't unflattened 165 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index b11c3535f350..569262ca499a 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -161,7 +161,7 @@ mpc86xx_time_init(void)
161 161
162static __initdata struct of_device_id of_bus_ids[] = { 162static __initdata struct of_device_id of_bus_ids[] = {
163 { .compatible = "simple-bus", }, 163 { .compatible = "simple-bus", },
164 { .compatible = "fsl,rapidio-delta", }, 164 { .compatible = "fsl,srio", },
165 { .compatible = "gianfar", }, 165 { .compatible = "gianfar", },
166 {}, 166 {},
167}; 167};
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c
index 8ef8960abda6..52bbfa031531 100644
--- a/arch/powerpc/platforms/86xx/pic.c
+++ b/arch/powerpc/platforms/86xx/pic.c
@@ -31,26 +31,16 @@ static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
31 31
32void __init mpc86xx_init_irq(void) 32void __init mpc86xx_init_irq(void)
33{ 33{
34 struct mpic *mpic;
35 struct device_node *np;
36 struct resource res;
37#ifdef CONFIG_PPC_I8259 34#ifdef CONFIG_PPC_I8259
35 struct device_node *np;
38 struct device_node *cascade_node = NULL; 36 struct device_node *cascade_node = NULL;
39 int cascade_irq; 37 int cascade_irq;
40#endif 38#endif
41 39
42 /* Determine PIC address. */ 40 struct mpic *mpic = mpic_alloc(NULL, 0,
43 np = of_find_node_by_type(NULL, "open-pic"); 41 MPIC_WANTS_RESET | MPIC_BIG_ENDIAN |
44 if (np == NULL) 42 MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
45 return;
46 of_address_to_resource(np, 0, &res);
47
48 mpic = mpic_alloc(np, res.start,
49 MPIC_PRIMARY | MPIC_WANTS_RESET |
50 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
51 MPIC_SINGLE_DEST_CPU,
52 0, 256, " MPIC "); 43 0, 256, " MPIC ");
53 of_node_put(np);
54 BUG_ON(mpic == NULL); 44 BUG_ON(mpic == NULL);
55 45
56 mpic_init(mpic); 46 mpic_init(mpic);
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index e4588721ef34..31e1adeaa92a 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -211,6 +211,12 @@ config PPC_PASEMI_CPUFREQ
211 211
212endmenu 212endmenu
213 213
214menu "CPUIdle driver"
215
216source "drivers/cpuidle/Kconfig"
217
218endmenu
219
214config PPC601_SYNC_FIX 220config PPC601_SYNC_FIX
215 bool "Workarounds for PPC601 bugs" 221 bool "Workarounds for PPC601 bugs"
216 depends on 6xx && (PPC_PREP || PPC_PMAC) 222 depends on 6xx && (PPC_PREP || PPC_PMAC)
@@ -347,7 +353,7 @@ config SIMPLE_GPIO
347 353
348config MCU_MPC8349EMITX 354config MCU_MPC8349EMITX
349 bool "MPC8349E-mITX MCU driver" 355 bool "MPC8349E-mITX MCU driver"
350 depends on I2C && PPC_83xx 356 depends on I2C=y && PPC_83xx
351 select GENERIC_GPIO 357 select GENERIC_GPIO
352 select ARCH_REQUIRE_GPIOLIB 358 select ARCH_REQUIRE_GPIOLIB
353 help 359 help
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index fbecae0fbb49..425db18580a2 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -174,7 +174,6 @@ config BOOKE
174config FSL_BOOKE 174config FSL_BOOKE
175 bool 175 bool
176 depends on (E200 || E500) && PPC32 176 depends on (E200 || E500) && PPC32
177 select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT
178 default y 177 default y
179 178
180# this is for common code between PPC32 & PPC64 FSL BOOKE 179# this is for common code between PPC32 & PPC64 FSL BOOKE
@@ -182,6 +181,7 @@ config PPC_FSL_BOOK3E
182 bool 181 bool
183 select FSL_EMB_PERFMON 182 select FSL_EMB_PERFMON
184 select PPC_SMP_MUXED_IPI 183 select PPC_SMP_MUXED_IPI
184 select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
185 default y if FSL_BOOKE 185 default y if FSL_BOOKE
186 186
187config PTE_64BIT 187config PTE_64BIT
@@ -236,7 +236,7 @@ config VSX
236 236
237config PPC_ICSWX 237config PPC_ICSWX
238 bool "Support for PowerPC icswx coprocessor instruction" 238 bool "Support for PowerPC icswx coprocessor instruction"
239 depends on POWER4 239 depends on POWER4 || PPC_A2
240 default n 240 default n
241 ---help--- 241 ---help---
242 242
@@ -252,6 +252,25 @@ config PPC_ICSWX
252 252
253 If in doubt, say N here. 253 If in doubt, say N here.
254 254
255config PPC_ICSWX_PID
256 bool "icswx requires direct PID management"
257 depends on PPC_ICSWX && POWER4
258 default y
259 ---help---
260 The PID register in server is used explicitly for ICSWX. In
261 embedded systems PID managment is done by the system.
262
263config PPC_ICSWX_USE_SIGILL
264 bool "Should a bad CT cause a SIGILL?"
265 depends on PPC_ICSWX
266 default n
267 ---help---
268 Should a bad CT used for "non-record form ICSWX" cause an
269 illegal intruction signal or should it be silent as
270 architected.
271
272 If in doubt, say N here.
273
255config SPE 274config SPE
256 bool "SPE Support" 275 bool "SPE Support"
257 depends on E200 || (E500 && !PPC_E500MC) 276 depends on E200 || (E500 && !PPC_E500MC)
@@ -290,7 +309,7 @@ config PPC_BOOK3E_MMU
290 309
291config PPC_MM_SLICES 310config PPC_MM_SLICES
292 bool 311 bool
293 default y if (PPC64 && HUGETLB_PAGE) || (PPC_STD_MMU_64 && PPC_64K_PAGES) 312 default y if (!PPC_FSL_BOOK3E && PPC64 && HUGETLB_PAGE) || (PPC_STD_MMU_64 && PPC_64K_PAGES)
294 default n 313 default n
295 314
296config VIRT_CPU_ACCOUNTING 315config VIRT_CPU_ACCOUNTING
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c
index 4d4c8c169124..94560db788bf 100644
--- a/arch/powerpc/platforms/cell/cbe_thermal.c
+++ b/arch/powerpc/platforms/cell/cbe_thermal.c
@@ -46,7 +46,7 @@
46 */ 46 */
47 47
48#include <linux/module.h> 48#include <linux/module.h>
49#include <linux/sysdev.h> 49#include <linux/device.h>
50#include <linux/kernel.h> 50#include <linux/kernel.h>
51#include <linux/cpu.h> 51#include <linux/cpu.h>
52#include <asm/spu.h> 52#include <asm/spu.h>
@@ -59,8 +59,8 @@
59#define TEMP_MIN 65 59#define TEMP_MIN 65
60#define TEMP_MAX 125 60#define TEMP_MAX 125
61 61
62#define SYSDEV_PREFIX_ATTR(_prefix,_name,_mode) \ 62#define DEVICE_PREFIX_ATTR(_prefix,_name,_mode) \
63struct sysdev_attribute attr_ ## _prefix ## _ ## _name = { \ 63struct device_attribute attr_ ## _prefix ## _ ## _name = { \
64 .attr = { .name = __stringify(_name), .mode = _mode }, \ 64 .attr = { .name = __stringify(_name), .mode = _mode }, \
65 .show = _prefix ## _show_ ## _name, \ 65 .show = _prefix ## _show_ ## _name, \
66 .store = _prefix ## _store_ ## _name, \ 66 .store = _prefix ## _store_ ## _name, \
@@ -76,36 +76,36 @@ static inline u8 temp_to_reg(u8 temp)
76 return ((temp - TEMP_MIN) >> 1) & 0x3f; 76 return ((temp - TEMP_MIN) >> 1) & 0x3f;
77} 77}
78 78
79static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev) 79static struct cbe_pmd_regs __iomem *get_pmd_regs(struct device *dev)
80{ 80{
81 struct spu *spu; 81 struct spu *spu;
82 82
83 spu = container_of(sysdev, struct spu, sysdev); 83 spu = container_of(dev, struct spu, dev);
84 84
85 return cbe_get_pmd_regs(spu_devnode(spu)); 85 return cbe_get_pmd_regs(spu_devnode(spu));
86} 86}
87 87
88/* returns the value for a given spu in a given register */ 88/* returns the value for a given spu in a given register */
89static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg) 89static u8 spu_read_register_value(struct device *dev, union spe_reg __iomem *reg)
90{ 90{
91 union spe_reg value; 91 union spe_reg value;
92 struct spu *spu; 92 struct spu *spu;
93 93
94 spu = container_of(sysdev, struct spu, sysdev); 94 spu = container_of(dev, struct spu, dev);
95 value.val = in_be64(&reg->val); 95 value.val = in_be64(&reg->val);
96 96
97 return value.spe[spu->spe_id]; 97 return value.spe[spu->spe_id];
98} 98}
99 99
100static ssize_t spu_show_temp(struct sys_device *sysdev, struct sysdev_attribute *attr, 100static ssize_t spu_show_temp(struct device *dev, struct device_attribute *attr,
101 char *buf) 101 char *buf)
102{ 102{
103 u8 value; 103 u8 value;
104 struct cbe_pmd_regs __iomem *pmd_regs; 104 struct cbe_pmd_regs __iomem *pmd_regs;
105 105
106 pmd_regs = get_pmd_regs(sysdev); 106 pmd_regs = get_pmd_regs(dev);
107 107
108 value = spu_read_register_value(sysdev, &pmd_regs->ts_ctsr1); 108 value = spu_read_register_value(dev, &pmd_regs->ts_ctsr1);
109 109
110 return sprintf(buf, "%d\n", reg_to_temp(value)); 110 return sprintf(buf, "%d\n", reg_to_temp(value));
111} 111}
@@ -147,48 +147,48 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char
147 return size; 147 return size;
148} 148}
149 149
150static ssize_t spu_show_throttle_end(struct sys_device *sysdev, 150static ssize_t spu_show_throttle_end(struct device *dev,
151 struct sysdev_attribute *attr, char *buf) 151 struct device_attribute *attr, char *buf)
152{ 152{
153 return show_throttle(get_pmd_regs(sysdev), buf, 0); 153 return show_throttle(get_pmd_regs(dev), buf, 0);
154} 154}
155 155
156static ssize_t spu_show_throttle_begin(struct sys_device *sysdev, 156static ssize_t spu_show_throttle_begin(struct device *dev,
157 struct sysdev_attribute *attr, char *buf) 157 struct device_attribute *attr, char *buf)
158{ 158{
159 return show_throttle(get_pmd_regs(sysdev), buf, 8); 159 return show_throttle(get_pmd_regs(dev), buf, 8);
160} 160}
161 161
162static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev, 162static ssize_t spu_show_throttle_full_stop(struct device *dev,
163 struct sysdev_attribute *attr, char *buf) 163 struct device_attribute *attr, char *buf)
164{ 164{
165 return show_throttle(get_pmd_regs(sysdev), buf, 16); 165 return show_throttle(get_pmd_regs(dev), buf, 16);
166} 166}
167 167
168static ssize_t spu_store_throttle_end(struct sys_device *sysdev, 168static ssize_t spu_store_throttle_end(struct device *dev,
169 struct sysdev_attribute *attr, const char *buf, size_t size) 169 struct device_attribute *attr, const char *buf, size_t size)
170{ 170{
171 return store_throttle(get_pmd_regs(sysdev), buf, size, 0); 171 return store_throttle(get_pmd_regs(dev), buf, size, 0);
172} 172}
173 173
174static ssize_t spu_store_throttle_begin(struct sys_device *sysdev, 174static ssize_t spu_store_throttle_begin(struct device *dev,
175 struct sysdev_attribute *attr, const char *buf, size_t size) 175 struct device_attribute *attr, const char *buf, size_t size)
176{ 176{
177 return store_throttle(get_pmd_regs(sysdev), buf, size, 8); 177 return store_throttle(get_pmd_regs(dev), buf, size, 8);
178} 178}
179 179
180static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev, 180static ssize_t spu_store_throttle_full_stop(struct device *dev,
181 struct sysdev_attribute *attr, const char *buf, size_t size) 181 struct device_attribute *attr, const char *buf, size_t size)
182{ 182{
183 return store_throttle(get_pmd_regs(sysdev), buf, size, 16); 183 return store_throttle(get_pmd_regs(dev), buf, size, 16);
184} 184}
185 185
186static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos) 186static ssize_t ppe_show_temp(struct device *dev, char *buf, int pos)
187{ 187{
188 struct cbe_pmd_regs __iomem *pmd_regs; 188 struct cbe_pmd_regs __iomem *pmd_regs;
189 u64 value; 189 u64 value;
190 190
191 pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id); 191 pmd_regs = cbe_get_cpu_pmd_regs(dev->id);
192 value = in_be64(&pmd_regs->ts_ctsr2); 192 value = in_be64(&pmd_regs->ts_ctsr2);
193 193
194 value = (value >> pos) & 0x3f; 194 value = (value >> pos) & 0x3f;
@@ -199,64 +199,64 @@ static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos)
199 199
200/* shows the temperature of the DTS on the PPE, 200/* shows the temperature of the DTS on the PPE,
201 * located near the linear thermal sensor */ 201 * located near the linear thermal sensor */
202static ssize_t ppe_show_temp0(struct sys_device *sysdev, 202static ssize_t ppe_show_temp0(struct device *dev,
203 struct sysdev_attribute *attr, char *buf) 203 struct device_attribute *attr, char *buf)
204{ 204{
205 return ppe_show_temp(sysdev, buf, 32); 205 return ppe_show_temp(dev, buf, 32);
206} 206}
207 207
208/* shows the temperature of the second DTS on the PPE */ 208/* shows the temperature of the second DTS on the PPE */
209static ssize_t ppe_show_temp1(struct sys_device *sysdev, 209static ssize_t ppe_show_temp1(struct device *dev,
210 struct sysdev_attribute *attr, char *buf) 210 struct device_attribute *attr, char *buf)
211{ 211{
212 return ppe_show_temp(sysdev, buf, 0); 212 return ppe_show_temp(dev, buf, 0);
213} 213}
214 214
215static ssize_t ppe_show_throttle_end(struct sys_device *sysdev, 215static ssize_t ppe_show_throttle_end(struct device *dev,
216 struct sysdev_attribute *attr, char *buf) 216 struct device_attribute *attr, char *buf)
217{ 217{
218 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 32); 218 return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 32);
219} 219}
220 220
221static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev, 221static ssize_t ppe_show_throttle_begin(struct device *dev,
222 struct sysdev_attribute *attr, char *buf) 222 struct device_attribute *attr, char *buf)
223{ 223{
224 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 40); 224 return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 40);
225} 225}
226 226
227static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev, 227static ssize_t ppe_show_throttle_full_stop(struct device *dev,
228 struct sysdev_attribute *attr, char *buf) 228 struct device_attribute *attr, char *buf)
229{ 229{
230 return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 48); 230 return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 48);
231} 231}
232 232
233static ssize_t ppe_store_throttle_end(struct sys_device *sysdev, 233static ssize_t ppe_store_throttle_end(struct device *dev,
234 struct sysdev_attribute *attr, const char *buf, size_t size) 234 struct device_attribute *attr, const char *buf, size_t size)
235{ 235{
236 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 32); 236 return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 32);
237} 237}
238 238
239static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev, 239static ssize_t ppe_store_throttle_begin(struct device *dev,
240 struct sysdev_attribute *attr, const char *buf, size_t size) 240 struct device_attribute *attr, const char *buf, size_t size)
241{ 241{
242 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 40); 242 return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 40);
243} 243}
244 244
245static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev, 245static ssize_t ppe_store_throttle_full_stop(struct device *dev,
246 struct sysdev_attribute *attr, const char *buf, size_t size) 246 struct device_attribute *attr, const char *buf, size_t size)
247{ 247{
248 return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 48); 248 return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 48);
249} 249}
250 250
251 251
252static struct sysdev_attribute attr_spu_temperature = { 252static struct device_attribute attr_spu_temperature = {
253 .attr = {.name = "temperature", .mode = 0400 }, 253 .attr = {.name = "temperature", .mode = 0400 },
254 .show = spu_show_temp, 254 .show = spu_show_temp,
255}; 255};
256 256
257static SYSDEV_PREFIX_ATTR(spu, throttle_end, 0600); 257static DEVICE_PREFIX_ATTR(spu, throttle_end, 0600);
258static SYSDEV_PREFIX_ATTR(spu, throttle_begin, 0600); 258static DEVICE_PREFIX_ATTR(spu, throttle_begin, 0600);
259static SYSDEV_PREFIX_ATTR(spu, throttle_full_stop, 0600); 259static DEVICE_PREFIX_ATTR(spu, throttle_full_stop, 0600);
260 260
261 261
262static struct attribute *spu_attributes[] = { 262static struct attribute *spu_attributes[] = {
@@ -272,19 +272,19 @@ static struct attribute_group spu_attribute_group = {
272 .attrs = spu_attributes, 272 .attrs = spu_attributes,
273}; 273};
274 274
275static struct sysdev_attribute attr_ppe_temperature0 = { 275static struct device_attribute attr_ppe_temperature0 = {
276 .attr = {.name = "temperature0", .mode = 0400 }, 276 .attr = {.name = "temperature0", .mode = 0400 },
277 .show = ppe_show_temp0, 277 .show = ppe_show_temp0,
278}; 278};
279 279
280static struct sysdev_attribute attr_ppe_temperature1 = { 280static struct device_attribute attr_ppe_temperature1 = {
281 .attr = {.name = "temperature1", .mode = 0400 }, 281 .attr = {.name = "temperature1", .mode = 0400 },
282 .show = ppe_show_temp1, 282 .show = ppe_show_temp1,
283}; 283};
284 284
285static SYSDEV_PREFIX_ATTR(ppe, throttle_end, 0600); 285static DEVICE_PREFIX_ATTR(ppe, throttle_end, 0600);
286static SYSDEV_PREFIX_ATTR(ppe, throttle_begin, 0600); 286static DEVICE_PREFIX_ATTR(ppe, throttle_begin, 0600);
287static SYSDEV_PREFIX_ATTR(ppe, throttle_full_stop, 0600); 287static DEVICE_PREFIX_ATTR(ppe, throttle_full_stop, 0600);
288 288
289static struct attribute *ppe_attributes[] = { 289static struct attribute *ppe_attributes[] = {
290 &attr_ppe_temperature0.attr, 290 &attr_ppe_temperature0.attr,
@@ -307,7 +307,7 @@ static int __init init_default_values(void)
307{ 307{
308 int cpu; 308 int cpu;
309 struct cbe_pmd_regs __iomem *pmd_regs; 309 struct cbe_pmd_regs __iomem *pmd_regs;
310 struct sys_device *sysdev; 310 struct device *dev;
311 union ppe_spe_reg tpr; 311 union ppe_spe_reg tpr;
312 union spe_reg str1; 312 union spe_reg str1;
313 u64 str2; 313 u64 str2;
@@ -349,14 +349,14 @@ static int __init init_default_values(void)
349 349
350 for_each_possible_cpu (cpu) { 350 for_each_possible_cpu (cpu) {
351 pr_debug("processing cpu %d\n", cpu); 351 pr_debug("processing cpu %d\n", cpu);
352 sysdev = get_cpu_sysdev(cpu); 352 dev = get_cpu_device(cpu);
353 353
354 if (!sysdev) { 354 if (!dev) {
355 pr_info("invalid sysdev pointer for cbe_thermal\n"); 355 pr_info("invalid dev pointer for cbe_thermal\n");
356 return -EINVAL; 356 return -EINVAL;
357 } 357 }
358 358
359 pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id); 359 pmd_regs = cbe_get_cpu_pmd_regs(dev->id);
360 360
361 if (!pmd_regs) { 361 if (!pmd_regs) {
362 pr_info("invalid CBE regs pointer for cbe_thermal\n"); 362 pr_info("invalid CBE regs pointer for cbe_thermal\n");
@@ -379,8 +379,8 @@ static int __init thermal_init(void)
379 int rc = init_default_values(); 379 int rc = init_default_values();
380 380
381 if (rc == 0) { 381 if (rc == 0) {
382 spu_add_sysdev_attr_group(&spu_attribute_group); 382 spu_add_dev_attr_group(&spu_attribute_group);
383 cpu_add_sysdev_attr_group(&ppe_attribute_group); 383 cpu_add_dev_attr_group(&ppe_attribute_group);
384 } 384 }
385 385
386 return rc; 386 return rc;
@@ -389,8 +389,8 @@ module_init(thermal_init);
389 389
390static void __exit thermal_exit(void) 390static void __exit thermal_exit(void)
391{ 391{
392 spu_remove_sysdev_attr_group(&spu_attribute_group); 392 spu_remove_dev_attr_group(&spu_attribute_group);
393 cpu_remove_sysdev_attr_group(&ppe_attribute_group); 393 cpu_remove_dev_attr_group(&ppe_attribute_group);
394} 394}
395module_exit(thermal_exit); 395module_exit(thermal_exit);
396 396
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 592c3d51b817..ae9fc7bc17d6 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -1037,6 +1037,8 @@ static int __init cell_iommu_fixed_mapping_init(void)
1037 1037
1038 /* The fixed mapping is only supported on axon machines */ 1038 /* The fixed mapping is only supported on axon machines */
1039 np = of_find_node_by_name(NULL, "axon"); 1039 np = of_find_node_by_name(NULL, "axon");
1040 of_node_put(np);
1041
1040 if (!np) { 1042 if (!np) {
1041 pr_debug("iommu: fixed mapping disabled, no axons found\n"); 1043 pr_debug("iommu: fixed mapping disabled, no axons found\n");
1042 return -1; 1044 return -1;
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 0fc9b7256126..62002a7edfed 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -184,24 +184,10 @@ static int __init cell_publish_devices(void)
184} 184}
185machine_subsys_initcall(cell, cell_publish_devices); 185machine_subsys_initcall(cell, cell_publish_devices);
186 186
187static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
188{
189 struct irq_chip *chip = irq_desc_get_chip(desc);
190 struct mpic *mpic = irq_desc_get_handler_data(desc);
191 unsigned int virq;
192
193 virq = mpic_get_one_irq(mpic);
194 if (virq != NO_IRQ)
195 generic_handle_irq(virq);
196
197 chip->irq_eoi(&desc->irq_data);
198}
199
200static void __init mpic_init_IRQ(void) 187static void __init mpic_init_IRQ(void)
201{ 188{
202 struct device_node *dn; 189 struct device_node *dn;
203 struct mpic *mpic; 190 struct mpic *mpic;
204 unsigned int virq;
205 191
206 for (dn = NULL; 192 for (dn = NULL;
207 (dn = of_find_node_by_name(dn, "interrupt-controller"));) { 193 (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
@@ -211,19 +197,10 @@ static void __init mpic_init_IRQ(void)
211 /* The MPIC driver will get everything it needs from the 197 /* The MPIC driver will get everything it needs from the
212 * device-tree, just pass 0 to all arguments 198 * device-tree, just pass 0 to all arguments
213 */ 199 */
214 mpic = mpic_alloc(dn, 0, 0, 0, 0, " MPIC "); 200 mpic = mpic_alloc(dn, 0, MPIC_SECONDARY, 0, 0, " MPIC ");
215 if (mpic == NULL) 201 if (mpic == NULL)
216 continue; 202 continue;
217 mpic_init(mpic); 203 mpic_init(mpic);
218
219 virq = irq_of_parse_and_map(dn, 0);
220 if (virq == NO_IRQ)
221 continue;
222
223 printk(KERN_INFO "%s : hooking up to IRQ %d\n",
224 dn->full_name, virq);
225 irq_set_handler_data(virq, mpic);
226 irq_set_chained_handler(virq, cell_mpic_cascade);
227 } 204 }
228} 205}
229 206
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index f5c5c762d5a3..4a255cf8cd17 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -23,7 +23,7 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/cache.h> 24#include <linux/cache.h>
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/cpu.h> 27#include <linux/cpu.h>
28 28
29#include <asm/ptrace.h> 29#include <asm/ptrace.h>
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index e94d3ecdd8bb..8b1213993b10 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -519,31 +519,32 @@ void spu_init_channels(struct spu *spu)
519} 519}
520EXPORT_SYMBOL_GPL(spu_init_channels); 520EXPORT_SYMBOL_GPL(spu_init_channels);
521 521
522static struct sysdev_class spu_sysdev_class = { 522static struct bus_type spu_subsys = {
523 .name = "spu", 523 .name = "spu",
524 .dev_name = "spu",
524}; 525};
525 526
526int spu_add_sysdev_attr(struct sysdev_attribute *attr) 527int spu_add_dev_attr(struct device_attribute *attr)
527{ 528{
528 struct spu *spu; 529 struct spu *spu;
529 530
530 mutex_lock(&spu_full_list_mutex); 531 mutex_lock(&spu_full_list_mutex);
531 list_for_each_entry(spu, &spu_full_list, full_list) 532 list_for_each_entry(spu, &spu_full_list, full_list)
532 sysdev_create_file(&spu->sysdev, attr); 533 device_create_file(&spu->dev, attr);
533 mutex_unlock(&spu_full_list_mutex); 534 mutex_unlock(&spu_full_list_mutex);
534 535
535 return 0; 536 return 0;
536} 537}
537EXPORT_SYMBOL_GPL(spu_add_sysdev_attr); 538EXPORT_SYMBOL_GPL(spu_add_dev_attr);
538 539
539int spu_add_sysdev_attr_group(struct attribute_group *attrs) 540int spu_add_dev_attr_group(struct attribute_group *attrs)
540{ 541{
541 struct spu *spu; 542 struct spu *spu;
542 int rc = 0; 543 int rc = 0;
543 544
544 mutex_lock(&spu_full_list_mutex); 545 mutex_lock(&spu_full_list_mutex);
545 list_for_each_entry(spu, &spu_full_list, full_list) { 546 list_for_each_entry(spu, &spu_full_list, full_list) {
546 rc = sysfs_create_group(&spu->sysdev.kobj, attrs); 547 rc = sysfs_create_group(&spu->dev.kobj, attrs);
547 548
548 /* we're in trouble here, but try unwinding anyway */ 549 /* we're in trouble here, but try unwinding anyway */
549 if (rc) { 550 if (rc) {
@@ -552,7 +553,7 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs)
552 553
553 list_for_each_entry_continue_reverse(spu, 554 list_for_each_entry_continue_reverse(spu,
554 &spu_full_list, full_list) 555 &spu_full_list, full_list)
555 sysfs_remove_group(&spu->sysdev.kobj, attrs); 556 sysfs_remove_group(&spu->dev.kobj, attrs);
556 break; 557 break;
557 } 558 }
558 } 559 }
@@ -561,45 +562,45 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs)
561 562
562 return rc; 563 return rc;
563} 564}
564EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group); 565EXPORT_SYMBOL_GPL(spu_add_dev_attr_group);
565 566
566 567
567void spu_remove_sysdev_attr(struct sysdev_attribute *attr) 568void spu_remove_dev_attr(struct device_attribute *attr)
568{ 569{
569 struct spu *spu; 570 struct spu *spu;
570 571
571 mutex_lock(&spu_full_list_mutex); 572 mutex_lock(&spu_full_list_mutex);
572 list_for_each_entry(spu, &spu_full_list, full_list) 573 list_for_each_entry(spu, &spu_full_list, full_list)
573 sysdev_remove_file(&spu->sysdev, attr); 574 device_remove_file(&spu->dev, attr);
574 mutex_unlock(&spu_full_list_mutex); 575 mutex_unlock(&spu_full_list_mutex);
575} 576}
576EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr); 577EXPORT_SYMBOL_GPL(spu_remove_dev_attr);
577 578
578void spu_remove_sysdev_attr_group(struct attribute_group *attrs) 579void spu_remove_dev_attr_group(struct attribute_group *attrs)
579{ 580{
580 struct spu *spu; 581 struct spu *spu;
581 582
582 mutex_lock(&spu_full_list_mutex); 583 mutex_lock(&spu_full_list_mutex);
583 list_for_each_entry(spu, &spu_full_list, full_list) 584 list_for_each_entry(spu, &spu_full_list, full_list)
584 sysfs_remove_group(&spu->sysdev.kobj, attrs); 585 sysfs_remove_group(&spu->dev.kobj, attrs);
585 mutex_unlock(&spu_full_list_mutex); 586 mutex_unlock(&spu_full_list_mutex);
586} 587}
587EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr_group); 588EXPORT_SYMBOL_GPL(spu_remove_dev_attr_group);
588 589
589static int spu_create_sysdev(struct spu *spu) 590static int spu_create_dev(struct spu *spu)
590{ 591{
591 int ret; 592 int ret;
592 593
593 spu->sysdev.id = spu->number; 594 spu->dev.id = spu->number;
594 spu->sysdev.cls = &spu_sysdev_class; 595 spu->dev.bus = &spu_subsys;
595 ret = sysdev_register(&spu->sysdev); 596 ret = device_register(&spu->dev);
596 if (ret) { 597 if (ret) {
597 printk(KERN_ERR "Can't register SPU %d with sysfs\n", 598 printk(KERN_ERR "Can't register SPU %d with sysfs\n",
598 spu->number); 599 spu->number);
599 return ret; 600 return ret;
600 } 601 }
601 602
602 sysfs_add_device_to_node(&spu->sysdev, spu->node); 603 sysfs_add_device_to_node(&spu->dev, spu->node);
603 604
604 return 0; 605 return 0;
605} 606}
@@ -635,7 +636,7 @@ static int __init create_spu(void *data)
635 if (ret) 636 if (ret)
636 goto out_destroy; 637 goto out_destroy;
637 638
638 ret = spu_create_sysdev(spu); 639 ret = spu_create_dev(spu);
639 if (ret) 640 if (ret)
640 goto out_free_irqs; 641 goto out_free_irqs;
641 642
@@ -692,10 +693,10 @@ static unsigned long long spu_acct_time(struct spu *spu,
692} 693}
693 694
694 695
695static ssize_t spu_stat_show(struct sys_device *sysdev, 696static ssize_t spu_stat_show(struct device *dev,
696 struct sysdev_attribute *attr, char *buf) 697 struct device_attribute *attr, char *buf)
697{ 698{
698 struct spu *spu = container_of(sysdev, struct spu, sysdev); 699 struct spu *spu = container_of(dev, struct spu, dev);
699 700
700 return sprintf(buf, "%s %llu %llu %llu %llu " 701 return sprintf(buf, "%s %llu %llu %llu %llu "
701 "%llu %llu %llu %llu %llu %llu %llu %llu\n", 702 "%llu %llu %llu %llu %llu %llu %llu %llu\n",
@@ -714,7 +715,7 @@ static ssize_t spu_stat_show(struct sys_device *sysdev,
714 spu->stats.libassist); 715 spu->stats.libassist);
715} 716}
716 717
717static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); 718static DEVICE_ATTR(stat, 0644, spu_stat_show, NULL);
718 719
719#ifdef CONFIG_KEXEC 720#ifdef CONFIG_KEXEC
720 721
@@ -813,8 +814,8 @@ static int __init init_spu_base(void)
813 if (!spu_management_ops) 814 if (!spu_management_ops)
814 goto out; 815 goto out;
815 816
816 /* create sysdev class for spus */ 817 /* create system subsystem for spus */
817 ret = sysdev_class_register(&spu_sysdev_class); 818 ret = subsys_system_register(&spu_subsys, NULL);
818 if (ret) 819 if (ret)
819 goto out; 820 goto out;
820 821
@@ -823,7 +824,7 @@ static int __init init_spu_base(void)
823 if (ret < 0) { 824 if (ret < 0) {
824 printk(KERN_WARNING "%s: Error initializing spus\n", 825 printk(KERN_WARNING "%s: Error initializing spus\n",
825 __func__); 826 __func__);
826 goto out_unregister_sysdev_class; 827 goto out_unregister_subsys;
827 } 828 }
828 829
829 if (ret > 0) 830 if (ret > 0)
@@ -833,15 +834,15 @@ static int __init init_spu_base(void)
833 xmon_register_spus(&spu_full_list); 834 xmon_register_spus(&spu_full_list);
834 crash_register_spus(&spu_full_list); 835 crash_register_spus(&spu_full_list);
835 mutex_unlock(&spu_full_list_mutex); 836 mutex_unlock(&spu_full_list_mutex);
836 spu_add_sysdev_attr(&attr_stat); 837 spu_add_dev_attr(&dev_attr_stat);
837 register_syscore_ops(&spu_syscore_ops); 838 register_syscore_ops(&spu_syscore_ops);
838 839
839 spu_init_affinity(); 840 spu_init_affinity();
840 841
841 return 0; 842 return 0;
842 843
843 out_unregister_sysdev_class: 844 out_unregister_subsys:
844 sysdev_class_unregister(&spu_sysdev_class); 845 bus_unregister(&spu_subsys);
845 out: 846 out:
846 return ret; 847 return ret;
847} 848}
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c
index 75530d99eda6..714bbfc3162c 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -65,8 +65,8 @@ static inline void spufs_calls_put(struct spufs_calls *calls) { }
65 65
66#endif /* CONFIG_SPU_FS_MODULE */ 66#endif /* CONFIG_SPU_FS_MODULE */
67 67
68asmlinkage long sys_spu_create(const char __user *name, 68SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
69 unsigned int flags, mode_t mode, int neighbor_fd) 69 umode_t, mode, int, neighbor_fd)
70{ 70{
71 long ret; 71 long ret;
72 struct file *neighbor; 72 struct file *neighbor;
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index e481f6b9a789..d4a094ca96f3 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -74,7 +74,6 @@ spufs_alloc_inode(struct super_block *sb)
74static void spufs_i_callback(struct rcu_head *head) 74static void spufs_i_callback(struct rcu_head *head)
75{ 75{
76 struct inode *inode = container_of(head, struct inode, i_rcu); 76 struct inode *inode = container_of(head, struct inode, i_rcu);
77 INIT_LIST_HEAD(&inode->i_dentry);
78 kmem_cache_free(spufs_inode_cache, SPUFS_I(inode)); 77 kmem_cache_free(spufs_inode_cache, SPUFS_I(inode));
79} 78}
80 79
@@ -92,7 +91,7 @@ spufs_init_once(void *p)
92} 91}
93 92
94static struct inode * 93static struct inode *
95spufs_new_inode(struct super_block *sb, int mode) 94spufs_new_inode(struct super_block *sb, umode_t mode)
96{ 95{
97 struct inode *inode; 96 struct inode *inode;
98 97
@@ -124,7 +123,7 @@ spufs_setattr(struct dentry *dentry, struct iattr *attr)
124 123
125static int 124static int
126spufs_new_file(struct super_block *sb, struct dentry *dentry, 125spufs_new_file(struct super_block *sb, struct dentry *dentry,
127 const struct file_operations *fops, int mode, 126 const struct file_operations *fops, umode_t mode,
128 size_t size, struct spu_context *ctx) 127 size_t size, struct spu_context *ctx)
129{ 128{
130 static const struct inode_operations spufs_file_iops = { 129 static const struct inode_operations spufs_file_iops = {
@@ -194,7 +193,7 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir)
194} 193}
195 194
196static int spufs_fill_dir(struct dentry *dir, 195static int spufs_fill_dir(struct dentry *dir,
197 const struct spufs_tree_descr *files, int mode, 196 const struct spufs_tree_descr *files, umode_t mode,
198 struct spu_context *ctx) 197 struct spu_context *ctx)
199{ 198{
200 struct dentry *dentry, *tmp; 199 struct dentry *dentry, *tmp;
@@ -264,7 +263,7 @@ EXPORT_SYMBOL_GPL(spufs_context_fops);
264 263
265static int 264static int
266spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, 265spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags,
267 int mode) 266 umode_t mode)
268{ 267{
269 int ret; 268 int ret;
270 struct inode *inode; 269 struct inode *inode;
@@ -447,7 +446,7 @@ spufs_set_affinity(unsigned int flags, struct spu_context *ctx,
447 446
448static int 447static int
449spufs_create_context(struct inode *inode, struct dentry *dentry, 448spufs_create_context(struct inode *inode, struct dentry *dentry,
450 struct vfsmount *mnt, int flags, int mode, 449 struct vfsmount *mnt, int flags, umode_t mode,
451 struct file *aff_filp) 450 struct file *aff_filp)
452{ 451{
453 int ret; 452 int ret;
@@ -521,7 +520,7 @@ out:
521} 520}
522 521
523static int 522static int
524spufs_mkgang(struct inode *dir, struct dentry *dentry, int mode) 523spufs_mkgang(struct inode *dir, struct dentry *dentry, umode_t mode)
525{ 524{
526 int ret; 525 int ret;
527 struct inode *inode; 526 struct inode *inode;
@@ -584,7 +583,7 @@ out:
584 583
585static int spufs_create_gang(struct inode *inode, 584static int spufs_create_gang(struct inode *inode,
586 struct dentry *dentry, 585 struct dentry *dentry,
587 struct vfsmount *mnt, int mode) 586 struct vfsmount *mnt, umode_t mode)
588{ 587{
589 int ret; 588 int ret;
590 589
@@ -612,7 +611,7 @@ out:
612static struct file_system_type spufs_type; 611static struct file_system_type spufs_type;
613 612
614long spufs_create(struct path *path, struct dentry *dentry, 613long spufs_create(struct path *path, struct dentry *dentry,
615 unsigned int flags, mode_t mode, struct file *filp) 614 unsigned int flags, umode_t mode, struct file *filp)
616{ 615{
617 int ret; 616 int ret;
618 617
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 099245f230b2..67852ade4c01 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -237,7 +237,7 @@ struct spufs_inode_info {
237struct spufs_tree_descr { 237struct spufs_tree_descr {
238 const char *name; 238 const char *name;
239 const struct file_operations *ops; 239 const struct file_operations *ops;
240 int mode; 240 umode_t mode;
241 size_t size; 241 size_t size;
242}; 242};
243 243
@@ -249,7 +249,7 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[];
249extern struct spufs_calls spufs_calls; 249extern struct spufs_calls spufs_calls;
250long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); 250long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status);
251long spufs_create(struct path *nd, struct dentry *dentry, unsigned int flags, 251long spufs_create(struct path *nd, struct dentry *dentry, unsigned int flags,
252 mode_t mode, struct file *filp); 252 umode_t mode, struct file *filp);
253/* ELF coredump callbacks for writing SPU ELF notes */ 253/* ELF coredump callbacks for writing SPU ELF notes */
254extern int spufs_coredump_extra_notes_size(void); 254extern int spufs_coredump_extra_notes_size(void);
255extern int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset); 255extern int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset);
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c
index 71a5b5207266..8591bb62d7fc 100644
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -60,7 +60,7 @@ out:
60} 60}
61 61
62static long do_spu_create(const char __user *pathname, unsigned int flags, 62static long do_spu_create(const char __user *pathname, unsigned int flags,
63 mode_t mode, struct file *neighbor) 63 umode_t mode, struct file *neighbor)
64{ 64{
65 struct path path; 65 struct path path;
66 struct dentry *dentry; 66 struct dentry *dentry;
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 122786498419..f1f17bb2c33c 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -435,8 +435,7 @@ static void __init chrp_find_openpic(void)
435 if (len > 1) 435 if (len > 1)
436 isu_size = iranges[3]; 436 isu_size = iranges[3];
437 437
438 chrp_mpic = mpic_alloc(np, opaddr, MPIC_PRIMARY, 438 chrp_mpic = mpic_alloc(np, opaddr, 0, isu_size, 0, " MPIC ");
439 isu_size, 0, " MPIC ");
440 if (chrp_mpic == NULL) { 439 if (chrp_mpic == NULL) {
441 printk(KERN_ERR "Failed to allocate MPIC structure\n"); 440 printk(KERN_ERR "Failed to allocate MPIC structure\n");
442 goto bail; 441 goto bail;
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index 2e9bcf6444c8..9cfcf20c0560 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -148,30 +148,14 @@ static void __init holly_setup_arch(void)
148static void __init holly_init_IRQ(void) 148static void __init holly_init_IRQ(void)
149{ 149{
150 struct mpic *mpic; 150 struct mpic *mpic;
151 phys_addr_t mpic_paddr = 0;
152 struct device_node *tsi_pic;
153#ifdef CONFIG_PCI 151#ifdef CONFIG_PCI
154 unsigned int cascade_pci_irq; 152 unsigned int cascade_pci_irq;
155 struct device_node *tsi_pci; 153 struct device_node *tsi_pci;
156 struct device_node *cascade_node = NULL; 154 struct device_node *cascade_node = NULL;
157#endif 155#endif
158 156
159 tsi_pic = of_find_node_by_type(NULL, "open-pic"); 157 mpic = mpic_alloc(NULL, 0,
160 if (tsi_pic) { 158 MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
161 unsigned int size;
162 const void *prop = of_get_property(tsi_pic, "reg", &size);
163 mpic_paddr = of_translate_address(tsi_pic, prop);
164 }
165
166 if (mpic_paddr == 0) {
167 printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__);
168 return;
169 }
170
171 pr_debug("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32) mpic_paddr);
172
173 mpic = mpic_alloc(tsi_pic, mpic_paddr,
174 MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
175 MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, 159 MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
176 24, 160 24,
177 NR_IRQS-4, /* num_sources used */ 161 NR_IRQS-4, /* num_sources used */
@@ -179,7 +163,7 @@ static void __init holly_init_IRQ(void)
179 163
180 BUG_ON(mpic == NULL); 164 BUG_ON(mpic == NULL);
181 165
182 mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); 166 mpic_assign_isu(mpic, 0, mpic->paddr + 0x100);
183 167
184 mpic_init(mpic); 168 mpic_init(mpic);
185 169
@@ -204,7 +188,6 @@ static void __init holly_init_IRQ(void)
204#endif 188#endif
205 /* Configure MPIC outputs to CPU0 */ 189 /* Configure MPIC outputs to CPU0 */
206 tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0); 190 tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
207 of_node_put(tsi_pic);
208} 191}
209 192
210void holly_show_cpuinfo(struct seq_file *m) 193void holly_show_cpuinfo(struct seq_file *m)
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index 244f997de791..bcfad92c9cec 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -81,29 +81,19 @@ static void __init linkstation_setup_arch(void)
81static void __init linkstation_init_IRQ(void) 81static void __init linkstation_init_IRQ(void)
82{ 82{
83 struct mpic *mpic; 83 struct mpic *mpic;
84 struct device_node *dnp;
85 const u32 *prop;
86 int size;
87 phys_addr_t paddr;
88 84
89 dnp = of_find_node_by_type(NULL, "open-pic"); 85 mpic = mpic_alloc(NULL, 0, MPIC_WANTS_RESET,
90 if (dnp == NULL) 86 4, 32, " EPIC ");
91 return;
92
93 prop = of_get_property(dnp, "reg", &size);
94 paddr = (phys_addr_t)of_translate_address(dnp, prop);
95
96 mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC ");
97 BUG_ON(mpic == NULL); 87 BUG_ON(mpic == NULL);
98 88
99 /* PCI IRQs */ 89 /* PCI IRQs */
100 mpic_assign_isu(mpic, 0, paddr + 0x10200); 90 mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);
101 91
102 /* I2C */ 92 /* I2C */
103 mpic_assign_isu(mpic, 1, paddr + 0x11000); 93 mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);
104 94
105 /* ttyS0, ttyS1 */ 95 /* ttyS0, ttyS1 */
106 mpic_assign_isu(mpic, 2, paddr + 0x11100); 96 mpic_assign_isu(mpic, 2, mpic->paddr + 0x11100);
107 97
108 mpic_init(mpic); 98 mpic_init(mpic);
109} 99}
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index f8f33e16c6b6..f3350d786f5b 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -102,31 +102,14 @@ static void __init mpc7448_hpc2_setup_arch(void)
102static void __init mpc7448_hpc2_init_IRQ(void) 102static void __init mpc7448_hpc2_init_IRQ(void)
103{ 103{
104 struct mpic *mpic; 104 struct mpic *mpic;
105 phys_addr_t mpic_paddr = 0;
106 struct device_node *tsi_pic;
107#ifdef CONFIG_PCI 105#ifdef CONFIG_PCI
108 unsigned int cascade_pci_irq; 106 unsigned int cascade_pci_irq;
109 struct device_node *tsi_pci; 107 struct device_node *tsi_pci;
110 struct device_node *cascade_node = NULL; 108 struct device_node *cascade_node = NULL;
111#endif 109#endif
112 110
113 tsi_pic = of_find_node_by_type(NULL, "open-pic"); 111 mpic = mpic_alloc(NULL, 0,
114 if (tsi_pic) { 112 MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
115 unsigned int size;
116 const void *prop = of_get_property(tsi_pic, "reg", &size);
117 mpic_paddr = of_translate_address(tsi_pic, prop);
118 }
119
120 if (mpic_paddr == 0) {
121 printk("%s: No tsi108 PIC found !\n", __func__);
122 return;
123 }
124
125 DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__,
126 (u32) mpic_paddr);
127
128 mpic = mpic_alloc(tsi_pic, mpic_paddr,
129 MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
130 MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, 113 MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
131 24, 114 24,
132 NR_IRQS-4, /* num_sources used */ 115 NR_IRQS-4, /* num_sources used */
@@ -134,7 +117,7 @@ static void __init mpc7448_hpc2_init_IRQ(void)
134 117
135 BUG_ON(mpic == NULL); 118 BUG_ON(mpic == NULL);
136 119
137 mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); 120 mpic_assign_isu(mpic, 0, mpic->paddr + 0x100);
138 121
139 mpic_init(mpic); 122 mpic_init(mpic);
140 123
@@ -159,7 +142,6 @@ static void __init mpc7448_hpc2_init_IRQ(void)
159#endif 142#endif
160 /* Configure MPIC outputs to CPU0 */ 143 /* Configure MPIC outputs to CPU0 */
161 tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0); 144 tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
162 of_node_put(tsi_pic);
163} 145}
164 146
165void mpc7448_hpc2_show_cpuinfo(struct seq_file *m) 147void mpc7448_hpc2_show_cpuinfo(struct seq_file *m)
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c
index f1eebcae9bf0..afa638834965 100644
--- a/arch/powerpc/platforms/embedded6xx/storcenter.c
+++ b/arch/powerpc/platforms/embedded6xx/storcenter.c
@@ -83,35 +83,17 @@ static void __init storcenter_setup_arch(void)
83static void __init storcenter_init_IRQ(void) 83static void __init storcenter_init_IRQ(void)
84{ 84{
85 struct mpic *mpic; 85 struct mpic *mpic;
86 struct device_node *dnp;
87 const void *prop;
88 int size;
89 phys_addr_t paddr;
90
91 dnp = of_find_node_by_type(NULL, "open-pic");
92 if (dnp == NULL)
93 return;
94
95 prop = of_get_property(dnp, "reg", &size);
96 if (prop == NULL) {
97 of_node_put(dnp);
98 return;
99 }
100
101 paddr = (phys_addr_t)of_translate_address(dnp, prop);
102 mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
103 16, 32, " OpenPIC ");
104
105 of_node_put(dnp);
106 86
87 mpic = mpic_alloc(NULL, 0, MPIC_WANTS_RESET,
88 16, 32, " OpenPIC ");
107 BUG_ON(mpic == NULL); 89 BUG_ON(mpic == NULL);
108 90
109 /* 91 /*
110 * 16 Serial Interrupts followed by 16 Internal Interrupts. 92 * 16 Serial Interrupts followed by 16 Internal Interrupts.
111 * I2C is the second internal, so it is at 17, 0x11020. 93 * I2C is the second internal, so it is at 17, 0x11020.
112 */ 94 */
113 mpic_assign_isu(mpic, 0, paddr + 0x10200); 95 mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);
114 mpic_assign_isu(mpic, 1, paddr + 0x11000); 96 mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);
115 97
116 mpic_init(mpic); 98 mpic_init(mpic);
117} 99}
diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c
index 1b5dc1a2e145..6d8dadf19f0b 100644
--- a/arch/powerpc/platforms/embedded6xx/wii.c
+++ b/arch/powerpc/platforms/embedded6xx/wii.c
@@ -79,24 +79,19 @@ void __init wii_memory_fixups(void)
79 BUG_ON(memblock.memory.cnt != 2); 79 BUG_ON(memblock.memory.cnt != 2);
80 BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base)); 80 BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base));
81 81
82 p[0].size = _ALIGN_DOWN(p[0].size, PAGE_SIZE); 82 /* trim unaligned tail */
83 p[1].size = _ALIGN_DOWN(p[1].size, PAGE_SIZE); 83 memblock_remove(ALIGN(p[1].base + p[1].size, PAGE_SIZE),
84 (phys_addr_t)ULLONG_MAX);
84 85
85 wii_hole_start = p[0].base + p[0].size; 86 /* determine hole, add & reserve them */
87 wii_hole_start = ALIGN(p[0].base + p[0].size, PAGE_SIZE);
86 wii_hole_size = p[1].base - wii_hole_start; 88 wii_hole_size = p[1].base - wii_hole_start;
87 89 memblock_add(wii_hole_start, wii_hole_size);
88 pr_info("MEM1: <%08llx %08llx>\n", p[0].base, p[0].size);
89 pr_info("HOLE: <%08lx %08lx>\n", wii_hole_start, wii_hole_size);
90 pr_info("MEM2: <%08llx %08llx>\n", p[1].base, p[1].size);
91
92 p[0].size += wii_hole_size + p[1].size;
93
94 memblock.memory.cnt = 1;
95 memblock_analyze();
96
97 /* reserve the hole */
98 memblock_reserve(wii_hole_start, wii_hole_size); 90 memblock_reserve(wii_hole_start, wii_hole_size);
99 91
92 BUG_ON(memblock.memory.cnt != 1);
93 __memblock_dump_all();
94
100 /* allow ioremapping the address space in the hole */ 95 /* allow ioremapping the address space in the hole */
101 __allow_ioremap_reserved = 1; 96 __allow_ioremap_reserved = 1;
102} 97}
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index ea0acbd8966d..8fc62586a973 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -563,7 +563,8 @@ static void yield_shared_processor(void)
563static void iseries_shared_idle(void) 563static void iseries_shared_idle(void)
564{ 564{
565 while (1) { 565 while (1) {
566 tick_nohz_stop_sched_tick(1); 566 tick_nohz_idle_enter();
567 rcu_idle_enter();
567 while (!need_resched() && !hvlpevent_is_pending()) { 568 while (!need_resched() && !hvlpevent_is_pending()) {
568 local_irq_disable(); 569 local_irq_disable();
569 ppc64_runlatch_off(); 570 ppc64_runlatch_off();
@@ -577,7 +578,8 @@ static void iseries_shared_idle(void)
577 } 578 }
578 579
579 ppc64_runlatch_on(); 580 ppc64_runlatch_on();
580 tick_nohz_restart_sched_tick(); 581 rcu_idle_exit();
582 tick_nohz_idle_exit();
581 583
582 if (hvlpevent_is_pending()) 584 if (hvlpevent_is_pending())
583 process_iSeries_events(); 585 process_iSeries_events();
@@ -593,7 +595,8 @@ static void iseries_dedicated_idle(void)
593 set_thread_flag(TIF_POLLING_NRFLAG); 595 set_thread_flag(TIF_POLLING_NRFLAG);
594 596
595 while (1) { 597 while (1) {
596 tick_nohz_stop_sched_tick(1); 598 tick_nohz_idle_enter();
599 rcu_idle_enter();
597 if (!need_resched()) { 600 if (!need_resched()) {
598 while (!need_resched()) { 601 while (!need_resched()) {
599 ppc64_runlatch_off(); 602 ppc64_runlatch_off();
@@ -610,7 +613,8 @@ static void iseries_dedicated_idle(void)
610 } 613 }
611 614
612 ppc64_runlatch_on(); 615 ppc64_runlatch_on();
613 tick_nohz_restart_sched_tick(); 616 rcu_idle_exit();
617 tick_nohz_idle_exit();
614 preempt_enable_no_resched(); 618 preempt_enable_no_resched();
615 schedule(); 619 schedule();
616 preempt_disable(); 620 preempt_disable();
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c
index 7e2a5515ed76..02df49fb59f0 100644
--- a/arch/powerpc/platforms/iseries/smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -24,7 +24,7 @@
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/cache.h> 25#include <linux/cache.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/cpu.h> 28#include <linux/cpu.h>
29 29
30#include <asm/ptrace.h> 30#include <asm/ptrace.h>
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index dd2e48b28508..401e3f3f74c8 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -207,6 +207,54 @@ static volatile void __iomem *u3_ht_cfg_access(struct pci_controller* hose,
207 return hose->cfg_data + u3_ht_cfa1(bus, devfn, offset); 207 return hose->cfg_data + u3_ht_cfa1(bus, devfn, offset);
208} 208}
209 209
210static int u3_ht_root_read_config(struct pci_controller *hose, u8 offset,
211 int len, u32 *val)
212{
213 volatile void __iomem *addr;
214
215 addr = hose->cfg_addr;
216 addr += ((offset & ~3) << 2) + (4 - len - (offset & 3));
217
218 switch (len) {
219 case 1:
220 *val = in_8(addr);
221 break;
222 case 2:
223 *val = in_be16(addr);
224 break;
225 default:
226 *val = in_be32(addr);
227 break;
228 }
229
230 return PCIBIOS_SUCCESSFUL;
231}
232
233static int u3_ht_root_write_config(struct pci_controller *hose, u8 offset,
234 int len, u32 val)
235{
236 volatile void __iomem *addr;
237
238 addr = hose->cfg_addr + ((offset & ~3) << 2) + (4 - len - (offset & 3));
239
240 if (offset >= PCI_BASE_ADDRESS_0 && offset < PCI_CAPABILITY_LIST)
241 return PCIBIOS_SUCCESSFUL;
242
243 switch (len) {
244 case 1:
245 out_8(addr, val);
246 break;
247 case 2:
248 out_be16(addr, val);
249 break;
250 default:
251 out_be32(addr, val);
252 break;
253 }
254
255 return PCIBIOS_SUCCESSFUL;
256}
257
210static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, 258static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
211 int offset, int len, u32 *val) 259 int offset, int len, u32 *val)
212{ 260{
@@ -217,6 +265,9 @@ static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
217 if (hose == NULL) 265 if (hose == NULL)
218 return PCIBIOS_DEVICE_NOT_FOUND; 266 return PCIBIOS_DEVICE_NOT_FOUND;
219 267
268 if (bus->number == hose->first_busno && devfn == PCI_DEVFN(0, 0))
269 return u3_ht_root_read_config(hose, offset, len, val);
270
220 if (offset > 0xff) 271 if (offset > 0xff)
221 return PCIBIOS_BAD_REGISTER_NUMBER; 272 return PCIBIOS_BAD_REGISTER_NUMBER;
222 273
@@ -252,6 +303,9 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
252 if (hose == NULL) 303 if (hose == NULL)
253 return PCIBIOS_DEVICE_NOT_FOUND; 304 return PCIBIOS_DEVICE_NOT_FOUND;
254 305
306 if (bus->number == hose->first_busno && devfn == PCI_DEVFN(0, 0))
307 return u3_ht_root_write_config(hose, offset, len, val);
308
255 if (offset > 0xff) 309 if (offset > 0xff)
256 return PCIBIOS_BAD_REGISTER_NUMBER; 310 return PCIBIOS_BAD_REGISTER_NUMBER;
257 311
@@ -428,6 +482,7 @@ static void __init setup_u3_ht(struct pci_controller* hose)
428 * reg_property and using some accessor functions instead 482 * reg_property and using some accessor functions instead
429 */ 483 */
430 hose->cfg_data = ioremap(0xf2000000, 0x02000000); 484 hose->cfg_data = ioremap(0xf2000000, 0x02000000);
485 hose->cfg_addr = ioremap(0xf8070000, 0x1000);
431 486
432 hose->first_busno = 0; 487 hose->first_busno = 0;
433 hose->last_busno = 0xef; 488 hose->last_busno = 0xef;
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 4c372047c94e..0bcbfe7b2c55 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -221,7 +221,7 @@ static void __init maple_init_IRQ(void)
221 unsigned long openpic_addr = 0; 221 unsigned long openpic_addr = 0;
222 int naddr, n, i, opplen, has_isus = 0; 222 int naddr, n, i, opplen, has_isus = 0;
223 struct mpic *mpic; 223 struct mpic *mpic;
224 unsigned int flags = MPIC_PRIMARY; 224 unsigned int flags = 0;
225 225
226 /* Locate MPIC in the device-tree. Note that there is a bug 226 /* Locate MPIC in the device-tree. Note that there is a bug
227 * in Maple device-tree where the type of the controller is 227 * in Maple device-tree where the type of the controller is
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 6f3558210554..98b7a7c13176 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -224,7 +224,7 @@ static __init void pas_init_IRQ(void)
224 openpic_addr = of_read_number(opprop, naddr); 224 openpic_addr = of_read_number(opprop, naddr);
225 printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); 225 printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
226 226
227 mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS; 227 mpic_flags = MPIC_LARGE_VECTORS | MPIC_NO_BIAS;
228 228
229 nmiprop = of_get_property(mpic_node, "nmi-source", NULL); 229 nmiprop = of_get_property(mpic_node, "nmi-source", NULL);
230 if (nmiprop) 230 if (nmiprop)
@@ -234,7 +234,7 @@ static __init void pas_init_IRQ(void)
234 mpic_flags, 0, 0, "PASEMI-OPIC"); 234 mpic_flags, 0, 0, "PASEMI-OPIC");
235 BUG_ON(!mpic); 235 BUG_ON(!mpic);
236 236
237 mpic_assign_isu(mpic, 0, openpic_addr + 0x10000); 237 mpic_assign_isu(mpic, 0, mpic->paddr + 0x10000);
238 mpic_init(mpic); 238 mpic_init(mpic);
239 /* The NMI/MCK source needs to be prio 15 */ 239 /* The NMI/MCK source needs to be prio 15 */
240 if (nmiprop) { 240 if (nmiprop) {
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index 04af5f48b4eb..1fc386a23f18 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -23,7 +23,7 @@
23#include <linux/pmu.h> 23#include <linux/pmu.h>
24#include <linux/cpufreq.h> 24#include <linux/cpufreq.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/hardirq.h> 27#include <linux/hardirq.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 901bfbddc3dd..7761aabfc293 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -52,13 +52,8 @@ struct device_node *of_irq_dflt_pic;
52/* Default addresses */ 52/* Default addresses */
53static volatile struct pmac_irq_hw __iomem *pmac_irq_hw[4]; 53static volatile struct pmac_irq_hw __iomem *pmac_irq_hw[4];
54 54
55#define GC_LEVEL_MASK 0x3ff00000
56#define OHARE_LEVEL_MASK 0x1ff00000
57#define HEATHROW_LEVEL_MASK 0x1ff00000
58
59static int max_irqs; 55static int max_irqs;
60static int max_real_irqs; 56static int max_real_irqs;
61static u32 level_mask[4];
62 57
63static DEFINE_RAW_SPINLOCK(pmac_pic_lock); 58static DEFINE_RAW_SPINLOCK(pmac_pic_lock);
64 59
@@ -217,8 +212,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
217 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) { 212 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) {
218 int i = irq >> 5; 213 int i = irq >> 5;
219 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; 214 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
220 /* We must read level interrupts from the level register */ 215 bits |= in_le32(&pmac_irq_hw[i]->level);
221 bits |= (in_le32(&pmac_irq_hw[i]->level) & level_mask[i]);
222 bits &= ppc_cached_irq_mask[i]; 216 bits &= ppc_cached_irq_mask[i];
223 if (bits == 0) 217 if (bits == 0)
224 continue; 218 continue;
@@ -248,8 +242,7 @@ static unsigned int pmac_pic_get_irq(void)
248 for (irq = max_real_irqs; (irq -= 32) >= 0; ) { 242 for (irq = max_real_irqs; (irq -= 32) >= 0; ) {
249 int i = irq >> 5; 243 int i = irq >> 5;
250 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; 244 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
251 /* We must read level interrupts from the level register */ 245 bits |= in_le32(&pmac_irq_hw[i]->level);
252 bits |= (in_le32(&pmac_irq_hw[i]->level) & level_mask[i]);
253 bits &= ppc_cached_irq_mask[i]; 246 bits &= ppc_cached_irq_mask[i];
254 if (bits == 0) 247 if (bits == 0)
255 continue; 248 continue;
@@ -284,19 +277,14 @@ static int pmac_pic_host_match(struct irq_host *h, struct device_node *node)
284static int pmac_pic_host_map(struct irq_host *h, unsigned int virq, 277static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
285 irq_hw_number_t hw) 278 irq_hw_number_t hw)
286{ 279{
287 int level;
288
289 if (hw >= max_irqs) 280 if (hw >= max_irqs)
290 return -EINVAL; 281 return -EINVAL;
291 282
292 /* Mark level interrupts, set delayed disable for edge ones and set 283 /* Mark level interrupts, set delayed disable for edge ones and set
293 * handlers 284 * handlers
294 */ 285 */
295 level = !!(level_mask[hw >> 5] & (1UL << (hw & 0x1f))); 286 irq_set_status_flags(virq, IRQ_LEVEL);
296 if (level) 287 irq_set_chip_and_handler(virq, &pmac_pic, handle_level_irq);
297 irq_set_status_flags(virq, IRQ_LEVEL);
298 irq_set_chip_and_handler(virq, &pmac_pic,
299 level ? handle_level_irq : handle_edge_irq);
300 return 0; 288 return 0;
301} 289}
302 290
@@ -334,21 +322,14 @@ static void __init pmac_pic_probe_oldstyle(void)
334 322
335 if ((master = of_find_node_by_name(NULL, "gc")) != NULL) { 323 if ((master = of_find_node_by_name(NULL, "gc")) != NULL) {
336 max_irqs = max_real_irqs = 32; 324 max_irqs = max_real_irqs = 32;
337 level_mask[0] = GC_LEVEL_MASK;
338 } else if ((master = of_find_node_by_name(NULL, "ohare")) != NULL) { 325 } else if ((master = of_find_node_by_name(NULL, "ohare")) != NULL) {
339 max_irqs = max_real_irqs = 32; 326 max_irqs = max_real_irqs = 32;
340 level_mask[0] = OHARE_LEVEL_MASK;
341
342 /* We might have a second cascaded ohare */ 327 /* We might have a second cascaded ohare */
343 slave = of_find_node_by_name(NULL, "pci106b,7"); 328 slave = of_find_node_by_name(NULL, "pci106b,7");
344 if (slave) { 329 if (slave)
345 max_irqs = 64; 330 max_irqs = 64;
346 level_mask[1] = OHARE_LEVEL_MASK;
347 }
348 } else if ((master = of_find_node_by_name(NULL, "mac-io")) != NULL) { 331 } else if ((master = of_find_node_by_name(NULL, "mac-io")) != NULL) {
349 max_irqs = max_real_irqs = 64; 332 max_irqs = max_real_irqs = 64;
350 level_mask[0] = HEATHROW_LEVEL_MASK;
351 level_mask[1] = 0;
352 333
353 /* We might have a second cascaded heathrow */ 334 /* We might have a second cascaded heathrow */
354 slave = of_find_node_by_name(master, "mac-io"); 335 slave = of_find_node_by_name(master, "mac-io");
@@ -363,11 +344,8 @@ static void __init pmac_pic_probe_oldstyle(void)
363 } 344 }
364 345
365 /* We found a slave */ 346 /* We found a slave */
366 if (slave) { 347 if (slave)
367 max_irqs = 128; 348 max_irqs = 128;
368 level_mask[2] = HEATHROW_LEVEL_MASK;
369 level_mask[3] = 0;
370 }
371 } 349 }
372 BUG_ON(master == NULL); 350 BUG_ON(master == NULL);
373 351
@@ -464,18 +442,6 @@ int of_irq_map_oldworld(struct device_node *device, int index,
464} 442}
465#endif /* CONFIG_PPC32 */ 443#endif /* CONFIG_PPC32 */
466 444
467static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc)
468{
469 struct irq_chip *chip = irq_desc_get_chip(desc);
470 struct mpic *mpic = irq_desc_get_handler_data(desc);
471 unsigned int cascade_irq = mpic_get_one_irq(mpic);
472
473 if (cascade_irq != NO_IRQ)
474 generic_handle_irq(cascade_irq);
475
476 chip->irq_eoi(&desc->irq_data);
477}
478
479static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) 445static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
480{ 446{
481#if defined(CONFIG_XMON) && defined(CONFIG_PPC32) 447#if defined(CONFIG_XMON) && defined(CONFIG_PPC32)
@@ -498,14 +464,8 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
498 int master) 464 int master)
499{ 465{
500 const char *name = master ? " MPIC 1 " : " MPIC 2 "; 466 const char *name = master ? " MPIC 1 " : " MPIC 2 ";
501 struct resource r;
502 struct mpic *mpic; 467 struct mpic *mpic;
503 unsigned int flags = master ? MPIC_PRIMARY : 0; 468 unsigned int flags = master ? 0 : MPIC_SECONDARY;
504 int rc;
505
506 rc = of_address_to_resource(np, 0, &r);
507 if (rc)
508 return NULL;
509 469
510 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); 470 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0);
511 471
@@ -519,7 +479,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
519 if (master && (flags & MPIC_BIG_ENDIAN)) 479 if (master && (flags & MPIC_BIG_ENDIAN))
520 flags |= MPIC_U3_HT_IRQS; 480 flags |= MPIC_U3_HT_IRQS;
521 481
522 mpic = mpic_alloc(np, r.start, flags, 0, 0, name); 482 mpic = mpic_alloc(np, 0, flags, 0, 0, name);
523 if (mpic == NULL) 483 if (mpic == NULL)
524 return NULL; 484 return NULL;
525 485
@@ -532,7 +492,6 @@ static int __init pmac_pic_probe_mpic(void)
532{ 492{
533 struct mpic *mpic1, *mpic2; 493 struct mpic *mpic1, *mpic2;
534 struct device_node *np, *master = NULL, *slave = NULL; 494 struct device_node *np, *master = NULL, *slave = NULL;
535 unsigned int cascade;
536 495
537 /* We can have up to 2 MPICs cascaded */ 496 /* We can have up to 2 MPICs cascaded */
538 for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) 497 for (np = NULL; (np = of_find_node_by_type(np, "open-pic"))
@@ -568,27 +527,14 @@ static int __init pmac_pic_probe_mpic(void)
568 527
569 of_node_put(master); 528 of_node_put(master);
570 529
571 /* No slave, let's go out */ 530 /* Set up a cascaded controller, if present */
572 if (slave == NULL) 531 if (slave) {
573 return 0; 532 mpic2 = pmac_setup_one_mpic(slave, 0);
574 533 if (mpic2 == NULL)
575 /* Get/Map slave interrupt */ 534 printk(KERN_ERR "Failed to setup slave MPIC\n");
576 cascade = irq_of_parse_and_map(slave, 0);
577 if (cascade == NO_IRQ) {
578 printk(KERN_ERR "Failed to map cascade IRQ\n");
579 return 0;
580 }
581
582 mpic2 = pmac_setup_one_mpic(slave, 0);
583 if (mpic2 == NULL) {
584 printk(KERN_ERR "Failed to setup slave MPIC\n");
585 of_node_put(slave); 535 of_node_put(slave);
586 return 0;
587 } 536 }
588 irq_set_handler_data(cascade, mpic2);
589 irq_set_chained_handler(cascade, pmac_u3_cascade);
590 537
591 of_node_put(slave);
592 return 0; 538 return 0;
593} 539}
594 540
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 96580b189ec2..970ea1de4298 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -494,11 +494,15 @@ static int __init pmac_declare_of_platform_devices(void)
494 return -1; 494 return -1;
495 495
496 np = of_find_node_by_name(NULL, "valkyrie"); 496 np = of_find_node_by_name(NULL, "valkyrie");
497 if (np) 497 if (np) {
498 of_platform_device_create(np, "valkyrie", NULL); 498 of_platform_device_create(np, "valkyrie", NULL);
499 of_node_put(np);
500 }
499 np = of_find_node_by_name(NULL, "platinum"); 501 np = of_find_node_by_name(NULL, "platinum");
500 if (np) 502 if (np) {
501 of_platform_device_create(np, "platinum", NULL); 503 of_platform_device_create(np, "platinum", NULL);
504 of_node_put(np);
505 }
502 np = of_find_node_by_type(NULL, "smu"); 506 np = of_find_node_by_type(NULL, "smu");
503 if (np) { 507 if (np) {
504 of_platform_device_create(np, "smu", NULL); 508 of_platform_device_create(np, "smu", NULL);
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 9b6a820bdd7d..44d769258ebf 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -200,7 +200,7 @@ static int psurge_secondary_ipi_init(void)
200 200
201 if (psurge_secondary_virq) 201 if (psurge_secondary_virq)
202 rc = request_irq(psurge_secondary_virq, psurge_ipi_intr, 202 rc = request_irq(psurge_secondary_virq, psurge_ipi_intr,
203 IRQF_PERCPU, "IPI", NULL); 203 IRQF_PERCPU | IRQF_NO_THREAD, "IPI", NULL);
204 204
205 if (rc) 205 if (rc)
206 pr_err("Failed to setup secondary cpu IPI\n"); 206 pr_err("Failed to setup secondary cpu IPI\n");
@@ -408,13 +408,13 @@ static int __init smp_psurge_kick_cpu(int nr)
408 408
409static struct irqaction psurge_irqaction = { 409static struct irqaction psurge_irqaction = {
410 .handler = psurge_ipi_intr, 410 .handler = psurge_ipi_intr,
411 .flags = IRQF_PERCPU, 411 .flags = IRQF_PERCPU | IRQF_NO_THREAD,
412 .name = "primary IPI", 412 .name = "primary IPI",
413}; 413};
414 414
415static void __init smp_psurge_setup_cpu(int cpu_nr) 415static void __init smp_psurge_setup_cpu(int cpu_nr)
416{ 416{
417 if (cpu_nr != 0) 417 if (cpu_nr != 0 || !psurge_start)
418 return; 418 return;
419 419
420 /* reset the entry point so if we get another intr we won't 420 /* reset the entry point so if we get another intr we won't
diff --git a/arch/powerpc/platforms/powernv/Makefile b/arch/powerpc/platforms/powernv/Makefile
index 31853008b418..bcc3cb48a44e 100644
--- a/arch/powerpc/platforms/powernv/Makefile
+++ b/arch/powerpc/platforms/powernv/Makefile
@@ -2,4 +2,4 @@ obj-y += setup.o opal-takeover.o opal-wrappers.o opal.o
2obj-y += opal-rtc.o opal-nvram.o 2obj-y += opal-rtc.o opal-nvram.o
3 3
4obj-$(CONFIG_SMP) += smp.o 4obj-$(CONFIG_SMP) += smp.o
5obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o 5obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
index 4a3f46d8533e..3bb07e5e43cd 100644
--- a/arch/powerpc/platforms/powernv/opal-wrappers.S
+++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
@@ -99,3 +99,11 @@ OPAL_CALL(opal_write_oppanel, OPAL_WRITE_OPPANEL);
99OPAL_CALL(opal_pci_map_pe_dma_window, OPAL_PCI_MAP_PE_DMA_WINDOW); 99OPAL_CALL(opal_pci_map_pe_dma_window, OPAL_PCI_MAP_PE_DMA_WINDOW);
100OPAL_CALL(opal_pci_map_pe_dma_window_real, OPAL_PCI_MAP_PE_DMA_WINDOW_REAL); 100OPAL_CALL(opal_pci_map_pe_dma_window_real, OPAL_PCI_MAP_PE_DMA_WINDOW_REAL);
101OPAL_CALL(opal_pci_reset, OPAL_PCI_RESET); 101OPAL_CALL(opal_pci_reset, OPAL_PCI_RESET);
102OPAL_CALL(opal_pci_get_hub_diag_data, OPAL_PCI_GET_HUB_DIAG_DATA);
103OPAL_CALL(opal_pci_get_phb_diag_data, OPAL_PCI_GET_PHB_DIAG_DATA);
104OPAL_CALL(opal_pci_fence_phb, OPAL_PCI_FENCE_PHB);
105OPAL_CALL(opal_pci_reinit, OPAL_PCI_REINIT);
106OPAL_CALL(opal_pci_mask_pe_error, OPAL_PCI_MASK_PE_ERROR);
107OPAL_CALL(opal_set_slot_led_status, OPAL_SET_SLOT_LED_STATUS);
108OPAL_CALL(opal_get_epow_status, OPAL_GET_EPOW_STATUS);
109OPAL_CALL(opal_set_system_attention_led, OPAL_SET_SYSTEM_ATTENTION_LED);
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
new file mode 100644
index 000000000000..f31162cfdaa9
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -0,0 +1,1330 @@
1/*
2 * Support PCI/PCIe on PowerNV platforms
3 *
4 * Copyright 2011 Benjamin Herrenschmidt, IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#undef DEBUG
13
14#include <linux/kernel.h>
15#include <linux/pci.h>
16#include <linux/delay.h>
17#include <linux/string.h>
18#include <linux/init.h>
19#include <linux/bootmem.h>
20#include <linux/irq.h>
21#include <linux/io.h>
22#include <linux/msi.h>
23
24#include <asm/sections.h>
25#include <asm/io.h>
26#include <asm/prom.h>
27#include <asm/pci-bridge.h>
28#include <asm/machdep.h>
29#include <asm/ppc-pci.h>
30#include <asm/opal.h>
31#include <asm/iommu.h>
32#include <asm/tce.h>
33#include <asm/abs_addr.h>
34
35#include "powernv.h"
36#include "pci.h"
37
38struct resource_wrap {
39 struct list_head link;
40 resource_size_t size;
41 resource_size_t align;
42 struct pci_dev *dev; /* Set if it's a device */
43 struct pci_bus *bus; /* Set if it's a bridge */
44};
45
46static int __pe_printk(const char *level, const struct pnv_ioda_pe *pe,
47 struct va_format *vaf)
48{
49 char pfix[32];
50
51 if (pe->pdev)
52 strlcpy(pfix, dev_name(&pe->pdev->dev), sizeof(pfix));
53 else
54 sprintf(pfix, "%04x:%02x ",
55 pci_domain_nr(pe->pbus), pe->pbus->number);
56 return printk("pci %s%s: [PE# %.3d] %pV", level, pfix, pe->pe_number, vaf);
57}
58
59#define define_pe_printk_level(func, kern_level) \
60static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \
61{ \
62 struct va_format vaf; \
63 va_list args; \
64 int r; \
65 \
66 va_start(args, fmt); \
67 \
68 vaf.fmt = fmt; \
69 vaf.va = &args; \
70 \
71 r = __pe_printk(kern_level, pe, &vaf); \
72 va_end(args); \
73 \
74 return r; \
75} \
76
77define_pe_printk_level(pe_err, KERN_ERR);
78define_pe_printk_level(pe_warn, KERN_WARNING);
79define_pe_printk_level(pe_info, KERN_INFO);
80
81
82/* Calculate resource usage & alignment requirement of a single
83 * device. This will also assign all resources within the device
84 * for a given type starting at 0 for the biggest one and then
85 * assigning in decreasing order of size.
86 */
87static void __devinit pnv_ioda_calc_dev(struct pci_dev *dev, unsigned int flags,
88 resource_size_t *size,
89 resource_size_t *align)
90{
91 resource_size_t start;
92 struct resource *r;
93 int i;
94
95 pr_devel(" -> CDR %s\n", pci_name(dev));
96
97 *size = *align = 0;
98
99 /* Clear the resources out and mark them all unset */
100 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
101 r = &dev->resource[i];
102 if (!(r->flags & flags))
103 continue;
104 if (r->start) {
105 r->end -= r->start;
106 r->start = 0;
107 }
108 r->flags |= IORESOURCE_UNSET;
109 }
110
111 /* We currently keep all memory resources together, we
112 * will handle prefetch & 64-bit separately in the future
113 * but for now we stick everybody in M32
114 */
115 start = 0;
116 for (;;) {
117 resource_size_t max_size = 0;
118 int max_no = -1;
119
120 /* Find next biggest resource */
121 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
122 r = &dev->resource[i];
123 if (!(r->flags & IORESOURCE_UNSET) ||
124 !(r->flags & flags))
125 continue;
126 if (resource_size(r) > max_size) {
127 max_size = resource_size(r);
128 max_no = i;
129 }
130 }
131 if (max_no < 0)
132 break;
133 r = &dev->resource[max_no];
134 if (max_size > *align)
135 *align = max_size;
136 *size += max_size;
137 r->start = start;
138 start += max_size;
139 r->end = r->start + max_size - 1;
140 r->flags &= ~IORESOURCE_UNSET;
141 pr_devel(" -> R%d %016llx..%016llx\n",
142 max_no, r->start, r->end);
143 }
144 pr_devel(" <- CDR %s size=%llx align=%llx\n",
145 pci_name(dev), *size, *align);
146}
147
148/* Allocate a resource "wrap" for a given device or bridge and
149 * insert it at the right position in the sorted list
150 */
151static void __devinit pnv_ioda_add_wrap(struct list_head *list,
152 struct pci_bus *bus,
153 struct pci_dev *dev,
154 resource_size_t size,
155 resource_size_t align)
156{
157 struct resource_wrap *w1, *w = kzalloc(sizeof(*w), GFP_KERNEL);
158
159 w->size = size;
160 w->align = align;
161 w->dev = dev;
162 w->bus = bus;
163
164 list_for_each_entry(w1, list, link) {
165 if (w1->align < align) {
166 list_add_tail(&w->link, &w1->link);
167 return;
168 }
169 }
170 list_add_tail(&w->link, list);
171}
172
173/* Offset device resources of a given type */
174static void __devinit pnv_ioda_offset_dev(struct pci_dev *dev,
175 unsigned int flags,
176 resource_size_t offset)
177{
178 struct resource *r;
179 int i;
180
181 pr_devel(" -> ODR %s [%x] +%016llx\n", pci_name(dev), flags, offset);
182
183 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
184 r = &dev->resource[i];
185 if (r->flags & flags) {
186 dev->resource[i].start += offset;
187 dev->resource[i].end += offset;
188 }
189 }
190
191 pr_devel(" <- ODR %s [%x] +%016llx\n", pci_name(dev), flags, offset);
192}
193
194/* Offset bus resources (& all children) of a given type */
195static void __devinit pnv_ioda_offset_bus(struct pci_bus *bus,
196 unsigned int flags,
197 resource_size_t offset)
198{
199 struct resource *r;
200 struct pci_dev *dev;
201 struct pci_bus *cbus;
202 int i;
203
204 pr_devel(" -> OBR %s [%x] +%016llx\n",
205 bus->self ? pci_name(bus->self) : "root", flags, offset);
206
207 for (i = 0; i < 2; i++) {
208 r = bus->resource[i];
209 if (r && (r->flags & flags)) {
210 bus->resource[i]->start += offset;
211 bus->resource[i]->end += offset;
212 }
213 }
214 list_for_each_entry(dev, &bus->devices, bus_list)
215 pnv_ioda_offset_dev(dev, flags, offset);
216 list_for_each_entry(cbus, &bus->children, node)
217 pnv_ioda_offset_bus(cbus, flags, offset);
218
219 pr_devel(" <- OBR %s [%x]\n",
220 bus->self ? pci_name(bus->self) : "root", flags);
221}
222
223/* This is the guts of our IODA resource allocation. This is called
224 * recursively for each bus in the system. It calculates all the
225 * necessary size and requirements for children and assign them
226 * resources such that:
227 *
228 * - Each function fits in it's own contiguous set of IO/M32
229 * segment
230 *
231 * - All segments behind a P2P bridge are contiguous and obey
232 * alignment constraints of those bridges
233 */
234static void __devinit pnv_ioda_calc_bus(struct pci_bus *bus, unsigned int flags,
235 resource_size_t *size,
236 resource_size_t *align)
237{
238 struct pci_controller *hose = pci_bus_to_host(bus);
239 struct pnv_phb *phb = hose->private_data;
240 resource_size_t dev_size, dev_align, start;
241 resource_size_t min_align, min_balign;
242 struct pci_dev *cdev;
243 struct pci_bus *cbus;
244 struct list_head head;
245 struct resource_wrap *w;
246 unsigned int bres;
247
248 *size = *align = 0;
249
250 pr_devel("-> CBR %s [%x]\n",
251 bus->self ? pci_name(bus->self) : "root", flags);
252
253 /* Calculate alignment requirements based on the type
254 * of resource we are working on
255 */
256 if (flags & IORESOURCE_IO) {
257 bres = 0;
258 min_align = phb->ioda.io_segsize;
259 min_balign = 0x1000;
260 } else {
261 bres = 1;
262 min_align = phb->ioda.m32_segsize;
263 min_balign = 0x100000;
264 }
265
266 /* Gather all our children resources ordered by alignment */
267 INIT_LIST_HEAD(&head);
268
269 /* - Busses */
270 list_for_each_entry(cbus, &bus->children, node) {
271 pnv_ioda_calc_bus(cbus, flags, &dev_size, &dev_align);
272 pnv_ioda_add_wrap(&head, cbus, NULL, dev_size, dev_align);
273 }
274
275 /* - Devices */
276 list_for_each_entry(cdev, &bus->devices, bus_list) {
277 pnv_ioda_calc_dev(cdev, flags, &dev_size, &dev_align);
278 /* Align them to segment size */
279 if (dev_align < min_align)
280 dev_align = min_align;
281 pnv_ioda_add_wrap(&head, NULL, cdev, dev_size, dev_align);
282 }
283 if (list_empty(&head))
284 goto empty;
285
286 /* Now we can do two things: assign offsets to them within that
287 * level and get our total alignment & size requirements. The
288 * assignment algorithm is going to be uber-trivial for now, we
289 * can try to be smarter later at filling out holes.
290 */
291 start = bus->self ? 0 : bus->resource[bres]->start;
292
293 /* Don't hand out IO 0 */
294 if ((flags & IORESOURCE_IO) && !bus->self)
295 start += 0x1000;
296
297 while(!list_empty(&head)) {
298 w = list_first_entry(&head, struct resource_wrap, link);
299 list_del(&w->link);
300 if (w->size) {
301 if (start) {
302 start = ALIGN(start, w->align);
303 if (w->dev)
304 pnv_ioda_offset_dev(w->dev,flags,start);
305 else if (w->bus)
306 pnv_ioda_offset_bus(w->bus,flags,start);
307 }
308 if (w->align > *align)
309 *align = w->align;
310 }
311 start += w->size;
312 kfree(w);
313 }
314 *size = start;
315
316 /* Align and setup bridge resources */
317 *align = max_t(resource_size_t, *align,
318 max_t(resource_size_t, min_align, min_balign));
319 *size = ALIGN(*size,
320 max_t(resource_size_t, min_align, min_balign));
321 empty:
322 /* Only setup P2P's, not the PHB itself */
323 if (bus->self) {
324 WARN_ON(bus->resource[bres] == NULL);
325 bus->resource[bres]->start = 0;
326 bus->resource[bres]->flags = (*size) ? flags : 0;
327 bus->resource[bres]->end = (*size) ? (*size - 1) : 0;
328
329 /* Clear prefetch bus resources for now */
330 bus->resource[2]->flags = 0;
331 }
332
333 pr_devel("<- CBR %s [%x] *size=%016llx *align=%016llx\n",
334 bus->self ? pci_name(bus->self) : "root", flags,*size,*align);
335}
336
337static struct pci_dn *pnv_ioda_get_pdn(struct pci_dev *dev)
338{
339 struct device_node *np;
340
341 np = pci_device_to_OF_node(dev);
342 if (!np)
343 return NULL;
344 return PCI_DN(np);
345}
346
347static void __devinit pnv_ioda_setup_pe_segments(struct pci_dev *dev)
348{
349 struct pci_controller *hose = pci_bus_to_host(dev->bus);
350 struct pnv_phb *phb = hose->private_data;
351 struct pci_dn *pdn = pnv_ioda_get_pdn(dev);
352 unsigned int pe, i;
353 resource_size_t pos;
354 struct resource io_res;
355 struct resource m32_res;
356 struct pci_bus_region region;
357 int rc;
358
359 /* Anything not referenced in the device-tree gets PE#0 */
360 pe = pdn ? pdn->pe_number : 0;
361
362 /* Calculate the device min/max */
363 io_res.start = m32_res.start = (resource_size_t)-1;
364 io_res.end = m32_res.end = 0;
365 io_res.flags = IORESOURCE_IO;
366 m32_res.flags = IORESOURCE_MEM;
367
368 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
369 struct resource *r = NULL;
370 if (dev->resource[i].flags & IORESOURCE_IO)
371 r = &io_res;
372 if (dev->resource[i].flags & IORESOURCE_MEM)
373 r = &m32_res;
374 if (!r)
375 continue;
376 if (dev->resource[i].start < r->start)
377 r->start = dev->resource[i].start;
378 if (dev->resource[i].end > r->end)
379 r->end = dev->resource[i].end;
380 }
381
382 /* Setup IO segments */
383 if (io_res.start < io_res.end) {
384 pcibios_resource_to_bus(dev, &region, &io_res);
385 pos = region.start;
386 i = pos / phb->ioda.io_segsize;
387 while(i < phb->ioda.total_pe && pos <= region.end) {
388 if (phb->ioda.io_segmap[i]) {
389 pr_err("%s: Trying to use IO seg #%d which is"
390 " already used by PE# %d\n",
391 pci_name(dev), i,
392 phb->ioda.io_segmap[i]);
393 /* XXX DO SOMETHING TO DISABLE DEVICE ? */
394 break;
395 }
396 phb->ioda.io_segmap[i] = pe;
397 rc = opal_pci_map_pe_mmio_window(phb->opal_id, pe,
398 OPAL_IO_WINDOW_TYPE,
399 0, i);
400 if (rc != OPAL_SUCCESS) {
401 pr_err("%s: OPAL error %d setting up mapping"
402 " for IO seg# %d\n",
403 pci_name(dev), rc, i);
404 /* XXX DO SOMETHING TO DISABLE DEVICE ? */
405 break;
406 }
407 pos += phb->ioda.io_segsize;
408 i++;
409 };
410 }
411
412 /* Setup M32 segments */
413 if (m32_res.start < m32_res.end) {
414 pcibios_resource_to_bus(dev, &region, &m32_res);
415 pos = region.start;
416 i = pos / phb->ioda.m32_segsize;
417 while(i < phb->ioda.total_pe && pos <= region.end) {
418 if (phb->ioda.m32_segmap[i]) {
419 pr_err("%s: Trying to use M32 seg #%d which is"
420 " already used by PE# %d\n",
421 pci_name(dev), i,
422 phb->ioda.m32_segmap[i]);
423 /* XXX DO SOMETHING TO DISABLE DEVICE ? */
424 break;
425 }
426 phb->ioda.m32_segmap[i] = pe;
427 rc = opal_pci_map_pe_mmio_window(phb->opal_id, pe,
428 OPAL_M32_WINDOW_TYPE,
429 0, i);
430 if (rc != OPAL_SUCCESS) {
431 pr_err("%s: OPAL error %d setting up mapping"
432 " for M32 seg# %d\n",
433 pci_name(dev), rc, i);
434 /* XXX DO SOMETHING TO DISABLE DEVICE ? */
435 break;
436 }
437 pos += phb->ioda.m32_segsize;
438 i++;
439 }
440 }
441}
442
443/* Check if a resource still fits in the total IO or M32 range
444 * for a given PHB
445 */
446static int __devinit pnv_ioda_resource_fit(struct pci_controller *hose,
447 struct resource *r)
448{
449 struct resource *bounds;
450
451 if (r->flags & IORESOURCE_IO)
452 bounds = &hose->io_resource;
453 else if (r->flags & IORESOURCE_MEM)
454 bounds = &hose->mem_resources[0];
455 else
456 return 1;
457
458 if (r->start >= bounds->start && r->end <= bounds->end)
459 return 1;
460 r->flags = 0;
461 return 0;
462}
463
464static void __devinit pnv_ioda_update_resources(struct pci_bus *bus)
465{
466 struct pci_controller *hose = pci_bus_to_host(bus);
467 struct pci_bus *cbus;
468 struct pci_dev *cdev;
469 unsigned int i;
470
471 /* We used to clear all device enables here. However it looks like
472 * clearing MEM enable causes Obsidian (IPR SCS) to go bonkers,
473 * and shoot fatal errors to the PHB which in turns fences itself
474 * and we can't recover from that ... yet. So for now, let's leave
475 * the enables as-is and hope for the best.
476 */
477
478 /* Check if bus resources fit in our IO or M32 range */
479 for (i = 0; bus->self && (i < 2); i++) {
480 struct resource *r = bus->resource[i];
481 if (r && !pnv_ioda_resource_fit(hose, r))
482 pr_err("%s: Bus %d resource %d disabled, no room\n",
483 pci_name(bus->self), bus->number, i);
484 }
485
486 /* Update self if it's not a PHB */
487 if (bus->self)
488 pci_setup_bridge(bus);
489
490 /* Update child devices */
491 list_for_each_entry(cdev, &bus->devices, bus_list) {
492 /* Check if resource fits, if not, disabled it */
493 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
494 struct resource *r = &cdev->resource[i];
495 if (!pnv_ioda_resource_fit(hose, r))
496 pr_err("%s: Resource %d disabled, no room\n",
497 pci_name(cdev), i);
498 }
499
500 /* Assign segments */
501 pnv_ioda_setup_pe_segments(cdev);
502
503 /* Update HW BARs */
504 for (i = 0; i <= PCI_ROM_RESOURCE; i++)
505 pci_update_resource(cdev, i);
506 }
507
508 /* Update child busses */
509 list_for_each_entry(cbus, &bus->children, node)
510 pnv_ioda_update_resources(cbus);
511}
512
513static int __devinit pnv_ioda_alloc_pe(struct pnv_phb *phb)
514{
515 unsigned long pe;
516
517 do {
518 pe = find_next_zero_bit(phb->ioda.pe_alloc,
519 phb->ioda.total_pe, 0);
520 if (pe >= phb->ioda.total_pe)
521 return IODA_INVALID_PE;
522 } while(test_and_set_bit(pe, phb->ioda.pe_alloc));
523
524 phb->ioda.pe_array[pe].pe_number = pe;
525 return pe;
526}
527
528static void __devinit pnv_ioda_free_pe(struct pnv_phb *phb, int pe)
529{
530 WARN_ON(phb->ioda.pe_array[pe].pdev);
531
532 memset(&phb->ioda.pe_array[pe], 0, sizeof(struct pnv_ioda_pe));
533 clear_bit(pe, phb->ioda.pe_alloc);
534}
535
536/* Currently those 2 are only used when MSIs are enabled, this will change
537 * but in the meantime, we need to protect them to avoid warnings
538 */
539#ifdef CONFIG_PCI_MSI
540static struct pnv_ioda_pe * __devinit __pnv_ioda_get_one_pe(struct pci_dev *dev)
541{
542 struct pci_controller *hose = pci_bus_to_host(dev->bus);
543 struct pnv_phb *phb = hose->private_data;
544 struct pci_dn *pdn = pnv_ioda_get_pdn(dev);
545
546 if (!pdn)
547 return NULL;
548 if (pdn->pe_number == IODA_INVALID_PE)
549 return NULL;
550 return &phb->ioda.pe_array[pdn->pe_number];
551}
552
553static struct pnv_ioda_pe * __devinit pnv_ioda_get_pe(struct pci_dev *dev)
554{
555 struct pnv_ioda_pe *pe = __pnv_ioda_get_one_pe(dev);
556
557 while (!pe && dev->bus->self) {
558 dev = dev->bus->self;
559 pe = __pnv_ioda_get_one_pe(dev);
560 if (pe)
561 pe = pe->bus_pe;
562 }
563 return pe;
564}
565#endif /* CONFIG_PCI_MSI */
566
567static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb,
568 struct pnv_ioda_pe *pe)
569{
570 struct pci_dev *parent;
571 uint8_t bcomp, dcomp, fcomp;
572 long rc, rid_end, rid;
573
574 /* Bus validation ? */
575 if (pe->pbus) {
576 int count;
577
578 dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER;
579 fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
580 parent = pe->pbus->self;
581 count = pe->pbus->subordinate - pe->pbus->secondary + 1;
582 switch(count) {
583 case 1: bcomp = OpalPciBusAll; break;
584 case 2: bcomp = OpalPciBus7Bits; break;
585 case 4: bcomp = OpalPciBus6Bits; break;
586 case 8: bcomp = OpalPciBus5Bits; break;
587 case 16: bcomp = OpalPciBus4Bits; break;
588 case 32: bcomp = OpalPciBus3Bits; break;
589 default:
590 pr_err("%s: Number of subordinate busses %d"
591 " unsupported\n",
592 pci_name(pe->pbus->self), count);
593 /* Do an exact match only */
594 bcomp = OpalPciBusAll;
595 }
596 rid_end = pe->rid + (count << 8);
597 } else {
598 parent = pe->pdev->bus->self;
599 bcomp = OpalPciBusAll;
600 dcomp = OPAL_COMPARE_RID_DEVICE_NUMBER;
601 fcomp = OPAL_COMPARE_RID_FUNCTION_NUMBER;
602 rid_end = pe->rid + 1;
603 }
604
605 /* Associate PE in PELT */
606 rc = opal_pci_set_pe(phb->opal_id, pe->pe_number, pe->rid,
607 bcomp, dcomp, fcomp, OPAL_MAP_PE);
608 if (rc) {
609 pe_err(pe, "OPAL error %ld trying to setup PELT table\n", rc);
610 return -ENXIO;
611 }
612 opal_pci_eeh_freeze_clear(phb->opal_id, pe->pe_number,
613 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
614
615 /* Add to all parents PELT-V */
616 while (parent) {
617 struct pci_dn *pdn = pnv_ioda_get_pdn(parent);
618 if (pdn && pdn->pe_number != IODA_INVALID_PE) {
619 rc = opal_pci_set_peltv(phb->opal_id, pdn->pe_number,
620 pe->pe_number, OPAL_ADD_PE_TO_DOMAIN);
621 /* XXX What to do in case of error ? */
622 }
623 parent = parent->bus->self;
624 }
625 /* Setup reverse map */
626 for (rid = pe->rid; rid < rid_end; rid++)
627 phb->ioda.pe_rmap[rid] = pe->pe_number;
628
629 /* Setup one MVTs on IODA1 */
630 if (phb->type == PNV_PHB_IODA1) {
631 pe->mve_number = pe->pe_number;
632 rc = opal_pci_set_mve(phb->opal_id, pe->mve_number,
633 pe->pe_number);
634 if (rc) {
635 pe_err(pe, "OPAL error %ld setting up MVE %d\n",
636 rc, pe->mve_number);
637 pe->mve_number = -1;
638 } else {
639 rc = opal_pci_set_mve_enable(phb->opal_id,
640 pe->mve_number, OPAL_ENABLE_MVE);
641 if (rc) {
642 pe_err(pe, "OPAL error %ld enabling MVE %d\n",
643 rc, pe->mve_number);
644 pe->mve_number = -1;
645 }
646 }
647 } else if (phb->type == PNV_PHB_IODA2)
648 pe->mve_number = 0;
649
650 return 0;
651}
652
653static void __devinit pnv_ioda_link_pe_by_weight(struct pnv_phb *phb,
654 struct pnv_ioda_pe *pe)
655{
656 struct pnv_ioda_pe *lpe;
657
658 list_for_each_entry(lpe, &phb->ioda.pe_list, link) {
659 if (lpe->dma_weight < pe->dma_weight) {
660 list_add_tail(&pe->link, &lpe->link);
661 return;
662 }
663 }
664 list_add_tail(&pe->link, &phb->ioda.pe_list);
665}
666
667static unsigned int pnv_ioda_dma_weight(struct pci_dev *dev)
668{
669 /* This is quite simplistic. The "base" weight of a device
670 * is 10. 0 means no DMA is to be accounted for it.
671 */
672
673 /* If it's a bridge, no DMA */
674 if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL)
675 return 0;
676
677 /* Reduce the weight of slow USB controllers */
678 if (dev->class == PCI_CLASS_SERIAL_USB_UHCI ||
679 dev->class == PCI_CLASS_SERIAL_USB_OHCI ||
680 dev->class == PCI_CLASS_SERIAL_USB_EHCI)
681 return 3;
682
683 /* Increase the weight of RAID (includes Obsidian) */
684 if ((dev->class >> 8) == PCI_CLASS_STORAGE_RAID)
685 return 15;
686
687 /* Default */
688 return 10;
689}
690
691static struct pnv_ioda_pe * __devinit pnv_ioda_setup_dev_PE(struct pci_dev *dev)
692{
693 struct pci_controller *hose = pci_bus_to_host(dev->bus);
694 struct pnv_phb *phb = hose->private_data;
695 struct pci_dn *pdn = pnv_ioda_get_pdn(dev);
696 struct pnv_ioda_pe *pe;
697 int pe_num;
698
699 if (!pdn) {
700 pr_err("%s: Device tree node not associated properly\n",
701 pci_name(dev));
702 return NULL;
703 }
704 if (pdn->pe_number != IODA_INVALID_PE)
705 return NULL;
706
707 /* PE#0 has been pre-set */
708 if (dev->bus->number == 0)
709 pe_num = 0;
710 else
711 pe_num = pnv_ioda_alloc_pe(phb);
712 if (pe_num == IODA_INVALID_PE) {
713 pr_warning("%s: Not enough PE# available, disabling device\n",
714 pci_name(dev));
715 return NULL;
716 }
717
718 /* NOTE: We get only one ref to the pci_dev for the pdn, not for the
719 * pointer in the PE data structure, both should be destroyed at the
720 * same time. However, this needs to be looked at more closely again
721 * once we actually start removing things (Hotplug, SR-IOV, ...)
722 *
723 * At some point we want to remove the PDN completely anyways
724 */
725 pe = &phb->ioda.pe_array[pe_num];
726 pci_dev_get(dev);
727 pdn->pcidev = dev;
728 pdn->pe_number = pe_num;
729 pe->pdev = dev;
730 pe->pbus = NULL;
731 pe->tce32_seg = -1;
732 pe->mve_number = -1;
733 pe->rid = dev->bus->number << 8 | pdn->devfn;
734
735 pe_info(pe, "Associated device to PE\n");
736
737 if (pnv_ioda_configure_pe(phb, pe)) {
738 /* XXX What do we do here ? */
739 if (pe_num)
740 pnv_ioda_free_pe(phb, pe_num);
741 pdn->pe_number = IODA_INVALID_PE;
742 pe->pdev = NULL;
743 pci_dev_put(dev);
744 return NULL;
745 }
746
747 /* Assign a DMA weight to the device */
748 pe->dma_weight = pnv_ioda_dma_weight(dev);
749 if (pe->dma_weight != 0) {
750 phb->ioda.dma_weight += pe->dma_weight;
751 phb->ioda.dma_pe_count++;
752 }
753
754 /* Link the PE */
755 pnv_ioda_link_pe_by_weight(phb, pe);
756
757 return pe;
758}
759
760static void pnv_ioda_setup_same_PE(struct pci_bus *bus, struct pnv_ioda_pe *pe)
761{
762 struct pci_dev *dev;
763
764 list_for_each_entry(dev, &bus->devices, bus_list) {
765 struct pci_dn *pdn = pnv_ioda_get_pdn(dev);
766
767 if (pdn == NULL) {
768 pr_warn("%s: No device node associated with device !\n",
769 pci_name(dev));
770 continue;
771 }
772 pci_dev_get(dev);
773 pdn->pcidev = dev;
774 pdn->pe_number = pe->pe_number;
775 pe->dma_weight += pnv_ioda_dma_weight(dev);
776 if (dev->subordinate)
777 pnv_ioda_setup_same_PE(dev->subordinate, pe);
778 }
779}
780
781static void __devinit pnv_ioda_setup_bus_PE(struct pci_dev *dev,
782 struct pnv_ioda_pe *ppe)
783{
784 struct pci_controller *hose = pci_bus_to_host(dev->bus);
785 struct pnv_phb *phb = hose->private_data;
786 struct pci_bus *bus = dev->subordinate;
787 struct pnv_ioda_pe *pe;
788 int pe_num;
789
790 if (!bus) {
791 pr_warning("%s: Bridge without a subordinate bus !\n",
792 pci_name(dev));
793 return;
794 }
795 pe_num = pnv_ioda_alloc_pe(phb);
796 if (pe_num == IODA_INVALID_PE) {
797 pr_warning("%s: Not enough PE# available, disabling bus\n",
798 pci_name(dev));
799 return;
800 }
801
802 pe = &phb->ioda.pe_array[pe_num];
803 ppe->bus_pe = pe;
804 pe->pbus = bus;
805 pe->pdev = NULL;
806 pe->tce32_seg = -1;
807 pe->mve_number = -1;
808 pe->rid = bus->secondary << 8;
809 pe->dma_weight = 0;
810
811 pe_info(pe, "Secondary busses %d..%d associated with PE\n",
812 bus->secondary, bus->subordinate);
813
814 if (pnv_ioda_configure_pe(phb, pe)) {
815 /* XXX What do we do here ? */
816 if (pe_num)
817 pnv_ioda_free_pe(phb, pe_num);
818 pe->pbus = NULL;
819 return;
820 }
821
822 /* Associate it with all child devices */
823 pnv_ioda_setup_same_PE(bus, pe);
824
825 /* Account for one DMA PE if at least one DMA capable device exist
826 * below the bridge
827 */
828 if (pe->dma_weight != 0) {
829 phb->ioda.dma_weight += pe->dma_weight;
830 phb->ioda.dma_pe_count++;
831 }
832
833 /* Link the PE */
834 pnv_ioda_link_pe_by_weight(phb, pe);
835}
836
837static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus)
838{
839 struct pci_dev *dev;
840 struct pnv_ioda_pe *pe;
841
842 list_for_each_entry(dev, &bus->devices, bus_list) {
843 pe = pnv_ioda_setup_dev_PE(dev);
844 if (pe == NULL)
845 continue;
846 /* Leaving the PCIe domain ... single PE# */
847 if (dev->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE)
848 pnv_ioda_setup_bus_PE(dev, pe);
849 else if (dev->subordinate)
850 pnv_ioda_setup_PEs(dev->subordinate);
851 }
852}
853
854static void __devinit pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb,
855 struct pci_dev *dev)
856{
857 /* We delay DMA setup after we have assigned all PE# */
858}
859
860static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,
861 struct pci_bus *bus)
862{
863 struct pci_dev *dev;
864
865 list_for_each_entry(dev, &bus->devices, bus_list) {
866 set_iommu_table_base(&dev->dev, &pe->tce32_table);
867 if (dev->subordinate)
868 pnv_ioda_setup_bus_dma(pe, dev->subordinate);
869 }
870}
871
872static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
873 struct pnv_ioda_pe *pe,
874 unsigned int base,
875 unsigned int segs)
876{
877
878 struct page *tce_mem = NULL;
879 const __be64 *swinvp;
880 struct iommu_table *tbl;
881 unsigned int i;
882 int64_t rc;
883 void *addr;
884
885 /* 256M DMA window, 4K TCE pages, 8 bytes TCE */
886#define TCE32_TABLE_SIZE ((0x10000000 / 0x1000) * 8)
887
888 /* XXX FIXME: Handle 64-bit only DMA devices */
889 /* XXX FIXME: Provide 64-bit DMA facilities & non-4K TCE tables etc.. */
890 /* XXX FIXME: Allocate multi-level tables on PHB3 */
891
892 /* We shouldn't already have a 32-bit DMA associated */
893 if (WARN_ON(pe->tce32_seg >= 0))
894 return;
895
896 /* Grab a 32-bit TCE table */
897 pe->tce32_seg = base;
898 pe_info(pe, " Setting up 32-bit TCE table at %08x..%08x\n",
899 (base << 28), ((base + segs) << 28) - 1);
900
901 /* XXX Currently, we allocate one big contiguous table for the
902 * TCEs. We only really need one chunk per 256M of TCE space
903 * (ie per segment) but that's an optimization for later, it
904 * requires some added smarts with our get/put_tce implementation
905 */
906 tce_mem = alloc_pages_node(phb->hose->node, GFP_KERNEL,
907 get_order(TCE32_TABLE_SIZE * segs));
908 if (!tce_mem) {
909 pe_err(pe, " Failed to allocate a 32-bit TCE memory\n");
910 goto fail;
911 }
912 addr = page_address(tce_mem);
913 memset(addr, 0, TCE32_TABLE_SIZE * segs);
914
915 /* Configure HW */
916 for (i = 0; i < segs; i++) {
917 rc = opal_pci_map_pe_dma_window(phb->opal_id,
918 pe->pe_number,
919 base + i, 1,
920 __pa(addr) + TCE32_TABLE_SIZE * i,
921 TCE32_TABLE_SIZE, 0x1000);
922 if (rc) {
923 pe_err(pe, " Failed to configure 32-bit TCE table,"
924 " err %ld\n", rc);
925 goto fail;
926 }
927 }
928
929 /* Setup linux iommu table */
930 tbl = &pe->tce32_table;
931 pnv_pci_setup_iommu_table(tbl, addr, TCE32_TABLE_SIZE * segs,
932 base << 28);
933
934 /* OPAL variant of P7IOC SW invalidated TCEs */
935 swinvp = of_get_property(phb->hose->dn, "ibm,opal-tce-kill", NULL);
936 if (swinvp) {
937 /* We need a couple more fields -- an address and a data
938 * to or. Since the bus is only printed out on table free
939 * errors, and on the first pass the data will be a relative
940 * bus number, print that out instead.
941 */
942 tbl->it_busno = 0;
943 tbl->it_index = (unsigned long)ioremap(be64_to_cpup(swinvp), 8);
944 tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE
945 | TCE_PCI_SWINV_PAIR;
946 }
947 iommu_init_table(tbl, phb->hose->node);
948
949 if (pe->pdev)
950 set_iommu_table_base(&pe->pdev->dev, tbl);
951 else
952 pnv_ioda_setup_bus_dma(pe, pe->pbus);
953
954 return;
955 fail:
956 /* XXX Failure: Try to fallback to 64-bit only ? */
957 if (pe->tce32_seg >= 0)
958 pe->tce32_seg = -1;
959 if (tce_mem)
960 __free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs));
961}
962
963static void __devinit pnv_ioda_setup_dma(struct pnv_phb *phb)
964{
965 struct pci_controller *hose = phb->hose;
966 unsigned int residual, remaining, segs, tw, base;
967 struct pnv_ioda_pe *pe;
968
969 /* If we have more PE# than segments available, hand out one
970 * per PE until we run out and let the rest fail. If not,
971 * then we assign at least one segment per PE, plus more based
972 * on the amount of devices under that PE
973 */
974 if (phb->ioda.dma_pe_count > phb->ioda.tce32_count)
975 residual = 0;
976 else
977 residual = phb->ioda.tce32_count -
978 phb->ioda.dma_pe_count;
979
980 pr_info("PCI: Domain %04x has %ld available 32-bit DMA segments\n",
981 hose->global_number, phb->ioda.tce32_count);
982 pr_info("PCI: %d PE# for a total weight of %d\n",
983 phb->ioda.dma_pe_count, phb->ioda.dma_weight);
984
985 /* Walk our PE list and configure their DMA segments, hand them
986 * out one base segment plus any residual segments based on
987 * weight
988 */
989 remaining = phb->ioda.tce32_count;
990 tw = phb->ioda.dma_weight;
991 base = 0;
992 list_for_each_entry(pe, &phb->ioda.pe_list, link) {
993 if (!pe->dma_weight)
994 continue;
995 if (!remaining) {
996 pe_warn(pe, "No DMA32 resources available\n");
997 continue;
998 }
999 segs = 1;
1000 if (residual) {
1001 segs += ((pe->dma_weight * residual) + (tw / 2)) / tw;
1002 if (segs > remaining)
1003 segs = remaining;
1004 }
1005 pe_info(pe, "DMA weight %d, assigned %d DMA32 segments\n",
1006 pe->dma_weight, segs);
1007 pnv_pci_ioda_setup_dma_pe(phb, pe, base, segs);
1008 remaining -= segs;
1009 base += segs;
1010 }
1011}
1012
1013#ifdef CONFIG_PCI_MSI
1014static int pnv_pci_ioda_msi_setup(struct pnv_phb *phb, struct pci_dev *dev,
1015 unsigned int hwirq, unsigned int is_64,
1016 struct msi_msg *msg)
1017{
1018 struct pnv_ioda_pe *pe = pnv_ioda_get_pe(dev);
1019 unsigned int xive_num = hwirq - phb->msi_base;
1020 uint64_t addr64;
1021 uint32_t addr32, data;
1022 int rc;
1023
1024 /* No PE assigned ? bail out ... no MSI for you ! */
1025 if (pe == NULL)
1026 return -ENXIO;
1027
1028 /* Check if we have an MVE */
1029 if (pe->mve_number < 0)
1030 return -ENXIO;
1031
1032 /* Assign XIVE to PE */
1033 rc = opal_pci_set_xive_pe(phb->opal_id, pe->pe_number, xive_num);
1034 if (rc) {
1035 pr_warn("%s: OPAL error %d setting XIVE %d PE\n",
1036 pci_name(dev), rc, xive_num);
1037 return -EIO;
1038 }
1039
1040 if (is_64) {
1041 rc = opal_get_msi_64(phb->opal_id, pe->mve_number, xive_num, 1,
1042 &addr64, &data);
1043 if (rc) {
1044 pr_warn("%s: OPAL error %d getting 64-bit MSI data\n",
1045 pci_name(dev), rc);
1046 return -EIO;
1047 }
1048 msg->address_hi = addr64 >> 32;
1049 msg->address_lo = addr64 & 0xfffffffful;
1050 } else {
1051 rc = opal_get_msi_32(phb->opal_id, pe->mve_number, xive_num, 1,
1052 &addr32, &data);
1053 if (rc) {
1054 pr_warn("%s: OPAL error %d getting 32-bit MSI data\n",
1055 pci_name(dev), rc);
1056 return -EIO;
1057 }
1058 msg->address_hi = 0;
1059 msg->address_lo = addr32;
1060 }
1061 msg->data = data;
1062
1063 pr_devel("%s: %s-bit MSI on hwirq %x (xive #%d),"
1064 " address=%x_%08x data=%x PE# %d\n",
1065 pci_name(dev), is_64 ? "64" : "32", hwirq, xive_num,
1066 msg->address_hi, msg->address_lo, data, pe->pe_number);
1067
1068 return 0;
1069}
1070
1071static void pnv_pci_init_ioda_msis(struct pnv_phb *phb)
1072{
1073 unsigned int bmap_size;
1074 const __be32 *prop = of_get_property(phb->hose->dn,
1075 "ibm,opal-msi-ranges", NULL);
1076 if (!prop) {
1077 /* BML Fallback */
1078 prop = of_get_property(phb->hose->dn, "msi-ranges", NULL);
1079 }
1080 if (!prop)
1081 return;
1082
1083 phb->msi_base = be32_to_cpup(prop);
1084 phb->msi_count = be32_to_cpup(prop + 1);
1085 bmap_size = BITS_TO_LONGS(phb->msi_count) * sizeof(unsigned long);
1086 phb->msi_map = zalloc_maybe_bootmem(bmap_size, GFP_KERNEL);
1087 if (!phb->msi_map) {
1088 pr_err("PCI %d: Failed to allocate MSI bitmap !\n",
1089 phb->hose->global_number);
1090 return;
1091 }
1092 phb->msi_setup = pnv_pci_ioda_msi_setup;
1093 phb->msi32_support = 1;
1094 pr_info(" Allocated bitmap for %d MSIs (base IRQ 0x%x)\n",
1095 phb->msi_count, phb->msi_base);
1096}
1097#else
1098static void pnv_pci_init_ioda_msis(struct pnv_phb *phb) { }
1099#endif /* CONFIG_PCI_MSI */
1100
1101/* This is the starting point of our IODA specific resource
1102 * allocation process
1103 */
1104static void __devinit pnv_pci_ioda_fixup_phb(struct pci_controller *hose)
1105{
1106 resource_size_t size, align;
1107 struct pci_bus *child;
1108
1109 /* Associate PEs per functions */
1110 pnv_ioda_setup_PEs(hose->bus);
1111
1112 /* Calculate all resources */
1113 pnv_ioda_calc_bus(hose->bus, IORESOURCE_IO, &size, &align);
1114 pnv_ioda_calc_bus(hose->bus, IORESOURCE_MEM, &size, &align);
1115
1116 /* Apply then to HW */
1117 pnv_ioda_update_resources(hose->bus);
1118
1119 /* Setup DMA */
1120 pnv_ioda_setup_dma(hose->private_data);
1121
1122 /* Configure PCI Express settings */
1123 list_for_each_entry(child, &hose->bus->children, node) {
1124 struct pci_dev *self = child->self;
1125 if (!self)
1126 continue;
1127 pcie_bus_configure_settings(child, self->pcie_mpss);
1128 }
1129}
1130
1131/* Prevent enabling devices for which we couldn't properly
1132 * assign a PE
1133 */
1134static int __devinit pnv_pci_enable_device_hook(struct pci_dev *dev)
1135{
1136 struct pci_dn *pdn = pnv_ioda_get_pdn(dev);
1137
1138 if (!pdn || pdn->pe_number == IODA_INVALID_PE)
1139 return -EINVAL;
1140 return 0;
1141}
1142
1143static u32 pnv_ioda_bdfn_to_pe(struct pnv_phb *phb, struct pci_bus *bus,
1144 u32 devfn)
1145{
1146 return phb->ioda.pe_rmap[(bus->number << 8) | devfn];
1147}
1148
1149void __init pnv_pci_init_ioda1_phb(struct device_node *np)
1150{
1151 struct pci_controller *hose;
1152 static int primary = 1;
1153 struct pnv_phb *phb;
1154 unsigned long size, m32map_off, iomap_off, pemap_off;
1155 const u64 *prop64;
1156 u64 phb_id;
1157 void *aux;
1158 long rc;
1159
1160 pr_info(" Initializing IODA OPAL PHB %s\n", np->full_name);
1161
1162 prop64 = of_get_property(np, "ibm,opal-phbid", NULL);
1163 if (!prop64) {
1164 pr_err(" Missing \"ibm,opal-phbid\" property !\n");
1165 return;
1166 }
1167 phb_id = be64_to_cpup(prop64);
1168 pr_debug(" PHB-ID : 0x%016llx\n", phb_id);
1169
1170 phb = alloc_bootmem(sizeof(struct pnv_phb));
1171 if (phb) {
1172 memset(phb, 0, sizeof(struct pnv_phb));
1173 phb->hose = hose = pcibios_alloc_controller(np);
1174 }
1175 if (!phb || !phb->hose) {
1176 pr_err("PCI: Failed to allocate PCI controller for %s\n",
1177 np->full_name);
1178 return;
1179 }
1180
1181 spin_lock_init(&phb->lock);
1182 /* XXX Use device-tree */
1183 hose->first_busno = 0;
1184 hose->last_busno = 0xff;
1185 hose->private_data = phb;
1186 phb->opal_id = phb_id;
1187 phb->type = PNV_PHB_IODA1;
1188
1189 /* Detect specific models for error handling */
1190 if (of_device_is_compatible(np, "ibm,p7ioc-pciex"))
1191 phb->model = PNV_PHB_MODEL_P7IOC;
1192 else
1193 phb->model = PNV_PHB_MODEL_UNKNOWN;
1194
1195 /* We parse "ranges" now since we need to deduce the register base
1196 * from the IO base
1197 */
1198 pci_process_bridge_OF_ranges(phb->hose, np, primary);
1199 primary = 0;
1200
1201 /* Magic formula from Milton */
1202 phb->regs = of_iomap(np, 0);
1203 if (phb->regs == NULL)
1204 pr_err(" Failed to map registers !\n");
1205
1206
1207 /* XXX This is hack-a-thon. This needs to be changed so that:
1208 * - we obtain stuff like PE# etc... from device-tree
1209 * - we properly re-allocate M32 ourselves
1210 * (the OFW one isn't very good)
1211 */
1212
1213 /* Initialize more IODA stuff */
1214 phb->ioda.total_pe = 128;
1215
1216 phb->ioda.m32_size = resource_size(&hose->mem_resources[0]);
1217 /* OFW Has already off top 64k of M32 space (MSI space) */
1218 phb->ioda.m32_size += 0x10000;
1219
1220 phb->ioda.m32_segsize = phb->ioda.m32_size / phb->ioda.total_pe;
1221 phb->ioda.m32_pci_base = hose->mem_resources[0].start -
1222 hose->pci_mem_offset;
1223 phb->ioda.io_size = hose->pci_io_size;
1224 phb->ioda.io_segsize = phb->ioda.io_size / phb->ioda.total_pe;
1225 phb->ioda.io_pci_base = 0; /* XXX calculate this ? */
1226
1227 /* Allocate aux data & arrays */
1228 size = _ALIGN_UP(phb->ioda.total_pe / 8, sizeof(unsigned long));
1229 m32map_off = size;
1230 size += phb->ioda.total_pe;
1231 iomap_off = size;
1232 size += phb->ioda.total_pe;
1233 pemap_off = size;
1234 size += phb->ioda.total_pe * sizeof(struct pnv_ioda_pe);
1235 aux = alloc_bootmem(size);
1236 memset(aux, 0, size);
1237 phb->ioda.pe_alloc = aux;
1238 phb->ioda.m32_segmap = aux + m32map_off;
1239 phb->ioda.io_segmap = aux + iomap_off;
1240 phb->ioda.pe_array = aux + pemap_off;
1241 set_bit(0, phb->ioda.pe_alloc);
1242
1243 INIT_LIST_HEAD(&phb->ioda.pe_list);
1244
1245 /* Calculate how many 32-bit TCE segments we have */
1246 phb->ioda.tce32_count = phb->ioda.m32_pci_base >> 28;
1247
1248 /* Clear unusable m64 */
1249 hose->mem_resources[1].flags = 0;
1250 hose->mem_resources[1].start = 0;
1251 hose->mem_resources[1].end = 0;
1252 hose->mem_resources[2].flags = 0;
1253 hose->mem_resources[2].start = 0;
1254 hose->mem_resources[2].end = 0;
1255
1256#if 0
1257 rc = opal_pci_set_phb_mem_window(opal->phb_id,
1258 window_type,
1259 window_num,
1260 starting_real_address,
1261 starting_pci_address,
1262 segment_size);
1263#endif
1264
1265 pr_info(" %d PE's M32: 0x%x [segment=0x%x] IO: 0x%x [segment=0x%x]\n",
1266 phb->ioda.total_pe,
1267 phb->ioda.m32_size, phb->ioda.m32_segsize,
1268 phb->ioda.io_size, phb->ioda.io_segsize);
1269
1270 if (phb->regs) {
1271 pr_devel(" BUID = 0x%016llx\n", in_be64(phb->regs + 0x100));
1272 pr_devel(" PHB2_CR = 0x%016llx\n", in_be64(phb->regs + 0x160));
1273 pr_devel(" IO_BAR = 0x%016llx\n", in_be64(phb->regs + 0x170));
1274 pr_devel(" IO_BAMR = 0x%016llx\n", in_be64(phb->regs + 0x178));
1275 pr_devel(" IO_SAR = 0x%016llx\n", in_be64(phb->regs + 0x180));
1276 pr_devel(" M32_BAR = 0x%016llx\n", in_be64(phb->regs + 0x190));
1277 pr_devel(" M32_BAMR = 0x%016llx\n", in_be64(phb->regs + 0x198));
1278 pr_devel(" M32_SAR = 0x%016llx\n", in_be64(phb->regs + 0x1a0));
1279 }
1280 phb->hose->ops = &pnv_pci_ops;
1281
1282 /* Setup RID -> PE mapping function */
1283 phb->bdfn_to_pe = pnv_ioda_bdfn_to_pe;
1284
1285 /* Setup TCEs */
1286 phb->dma_dev_setup = pnv_pci_ioda_dma_dev_setup;
1287
1288 /* Setup MSI support */
1289 pnv_pci_init_ioda_msis(phb);
1290
1291 /* We set both probe_only and PCI_REASSIGN_ALL_RSRC. This is an
1292 * odd combination which essentially means that we skip all resource
1293 * fixups and assignments in the generic code, and do it all
1294 * ourselves here
1295 */
1296 pci_probe_only = 1;
1297 ppc_md.pcibios_fixup_phb = pnv_pci_ioda_fixup_phb;
1298 ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook;
1299 pci_add_flags(PCI_REASSIGN_ALL_RSRC);
1300
1301 /* Reset IODA tables to a clean state */
1302 rc = opal_pci_reset(phb_id, OPAL_PCI_IODA_TABLE_RESET, OPAL_ASSERT_RESET);
1303 if (rc)
1304 pr_warning(" OPAL Error %ld performing IODA table reset !\n", rc);
1305 opal_pci_set_pe(phb_id, 0, 0, 7, 1, 1 , OPAL_MAP_PE);
1306}
1307
1308void __init pnv_pci_init_ioda_hub(struct device_node *np)
1309{
1310 struct device_node *phbn;
1311 const u64 *prop64;
1312 u64 hub_id;
1313
1314 pr_info("Probing IODA IO-Hub %s\n", np->full_name);
1315
1316 prop64 = of_get_property(np, "ibm,opal-hubid", NULL);
1317 if (!prop64) {
1318 pr_err(" Missing \"ibm,opal-hubid\" property !\n");
1319 return;
1320 }
1321 hub_id = be64_to_cpup(prop64);
1322 pr_devel(" HUB-ID : 0x%016llx\n", hub_id);
1323
1324 /* Count child PHBs */
1325 for_each_child_of_node(np, phbn) {
1326 /* Look for IODA1 PHBs */
1327 if (of_device_is_compatible(phbn, "ibm,ioda-phb"))
1328 pnv_pci_init_ioda1_phb(phbn);
1329 }
1330}
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
index 4c80f7c77d56..264967770c3a 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -137,6 +137,7 @@ static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
137 phb->hose->private_data = phb; 137 phb->hose->private_data = phb;
138 phb->opal_id = phb_id; 138 phb->opal_id = phb_id;
139 phb->type = PNV_PHB_P5IOC2; 139 phb->type = PNV_PHB_P5IOC2;
140 phb->model = PNV_PHB_MODEL_P5IOC2;
140 141
141 phb->regs = of_iomap(np, 0); 142 phb->regs = of_iomap(np, 0);
142 143
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 85bb66d7f933..a70bc1e385eb 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -144,6 +144,112 @@ static void pnv_teardown_msi_irqs(struct pci_dev *pdev)
144} 144}
145#endif /* CONFIG_PCI_MSI */ 145#endif /* CONFIG_PCI_MSI */
146 146
147static void pnv_pci_dump_p7ioc_diag_data(struct pnv_phb *phb)
148{
149 struct OpalIoP7IOCPhbErrorData *data = &phb->diag.p7ioc;
150 int i;
151
152 pr_info("PHB %d diagnostic data:\n", phb->hose->global_number);
153
154 pr_info(" brdgCtl = 0x%08x\n", data->brdgCtl);
155
156 pr_info(" portStatusReg = 0x%08x\n", data->portStatusReg);
157 pr_info(" rootCmplxStatus = 0x%08x\n", data->rootCmplxStatus);
158 pr_info(" busAgentStatus = 0x%08x\n", data->busAgentStatus);
159
160 pr_info(" deviceStatus = 0x%08x\n", data->deviceStatus);
161 pr_info(" slotStatus = 0x%08x\n", data->slotStatus);
162 pr_info(" linkStatus = 0x%08x\n", data->linkStatus);
163 pr_info(" devCmdStatus = 0x%08x\n", data->devCmdStatus);
164 pr_info(" devSecStatus = 0x%08x\n", data->devSecStatus);
165
166 pr_info(" rootErrorStatus = 0x%08x\n", data->rootErrorStatus);
167 pr_info(" uncorrErrorStatus = 0x%08x\n", data->uncorrErrorStatus);
168 pr_info(" corrErrorStatus = 0x%08x\n", data->corrErrorStatus);
169 pr_info(" tlpHdr1 = 0x%08x\n", data->tlpHdr1);
170 pr_info(" tlpHdr2 = 0x%08x\n", data->tlpHdr2);
171 pr_info(" tlpHdr3 = 0x%08x\n", data->tlpHdr3);
172 pr_info(" tlpHdr4 = 0x%08x\n", data->tlpHdr4);
173 pr_info(" sourceId = 0x%08x\n", data->sourceId);
174
175 pr_info(" errorClass = 0x%016llx\n", data->errorClass);
176 pr_info(" correlator = 0x%016llx\n", data->correlator);
177
178 pr_info(" p7iocPlssr = 0x%016llx\n", data->p7iocPlssr);
179 pr_info(" p7iocCsr = 0x%016llx\n", data->p7iocCsr);
180 pr_info(" lemFir = 0x%016llx\n", data->lemFir);
181 pr_info(" lemErrorMask = 0x%016llx\n", data->lemErrorMask);
182 pr_info(" lemWOF = 0x%016llx\n", data->lemWOF);
183 pr_info(" phbErrorStatus = 0x%016llx\n", data->phbErrorStatus);
184 pr_info(" phbFirstErrorStatus = 0x%016llx\n", data->phbFirstErrorStatus);
185 pr_info(" phbErrorLog0 = 0x%016llx\n", data->phbErrorLog0);
186 pr_info(" phbErrorLog1 = 0x%016llx\n", data->phbErrorLog1);
187 pr_info(" mmioErrorStatus = 0x%016llx\n", data->mmioErrorStatus);
188 pr_info(" mmioFirstErrorStatus = 0x%016llx\n", data->mmioFirstErrorStatus);
189 pr_info(" mmioErrorLog0 = 0x%016llx\n", data->mmioErrorLog0);
190 pr_info(" mmioErrorLog1 = 0x%016llx\n", data->mmioErrorLog1);
191 pr_info(" dma0ErrorStatus = 0x%016llx\n", data->dma0ErrorStatus);
192 pr_info(" dma0FirstErrorStatus = 0x%016llx\n", data->dma0FirstErrorStatus);
193 pr_info(" dma0ErrorLog0 = 0x%016llx\n", data->dma0ErrorLog0);
194 pr_info(" dma0ErrorLog1 = 0x%016llx\n", data->dma0ErrorLog1);
195 pr_info(" dma1ErrorStatus = 0x%016llx\n", data->dma1ErrorStatus);
196 pr_info(" dma1FirstErrorStatus = 0x%016llx\n", data->dma1FirstErrorStatus);
197 pr_info(" dma1ErrorLog0 = 0x%016llx\n", data->dma1ErrorLog0);
198 pr_info(" dma1ErrorLog1 = 0x%016llx\n", data->dma1ErrorLog1);
199
200 for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) {
201 if ((data->pestA[i] >> 63) == 0 &&
202 (data->pestB[i] >> 63) == 0)
203 continue;
204 pr_info(" PE[%3d] PESTA = 0x%016llx\n", i, data->pestA[i]);
205 pr_info(" PESTB = 0x%016llx\n", data->pestB[i]);
206 }
207}
208
209static void pnv_pci_dump_phb_diag_data(struct pnv_phb *phb)
210{
211 switch(phb->model) {
212 case PNV_PHB_MODEL_P7IOC:
213 pnv_pci_dump_p7ioc_diag_data(phb);
214 break;
215 default:
216 pr_warning("PCI %d: Can't decode this PHB diag data\n",
217 phb->hose->global_number);
218 }
219}
220
221static void pnv_pci_handle_eeh_config(struct pnv_phb *phb, u32 pe_no)
222{
223 unsigned long flags, rc;
224 int has_diag;
225
226 spin_lock_irqsave(&phb->lock, flags);
227
228 rc = opal_pci_get_phb_diag_data(phb->opal_id, phb->diag.blob, PNV_PCI_DIAG_BUF_SIZE);
229 has_diag = (rc == OPAL_SUCCESS);
230
231 rc = opal_pci_eeh_freeze_clear(phb->opal_id, pe_no,
232 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
233 if (rc) {
234 pr_warning("PCI %d: Failed to clear EEH freeze state"
235 " for PE#%d, err %ld\n",
236 phb->hose->global_number, pe_no, rc);
237
238 /* For now, let's only display the diag buffer when we fail to clear
239 * the EEH status. We'll do more sensible things later when we have
240 * proper EEH support. We need to make sure we don't pollute ourselves
241 * with the normal errors generated when probing empty slots
242 */
243 if (has_diag)
244 pnv_pci_dump_phb_diag_data(phb);
245 else
246 pr_warning("PCI %d: No diag data available\n",
247 phb->hose->global_number);
248 }
249
250 spin_unlock_irqrestore(&phb->lock, flags);
251}
252
147static void pnv_pci_config_check_eeh(struct pnv_phb *phb, struct pci_bus *bus, 253static void pnv_pci_config_check_eeh(struct pnv_phb *phb, struct pci_bus *bus,
148 u32 bdfn) 254 u32 bdfn)
149{ 255{
@@ -165,15 +271,8 @@ static void pnv_pci_config_check_eeh(struct pnv_phb *phb, struct pci_bus *bus,
165 } 271 }
166 cfg_dbg(" -> EEH check, bdfn=%04x PE%d fstate=%x\n", 272 cfg_dbg(" -> EEH check, bdfn=%04x PE%d fstate=%x\n",
167 bdfn, pe_no, fstate); 273 bdfn, pe_no, fstate);
168 if (fstate != 0) { 274 if (fstate != 0)
169 rc = opal_pci_eeh_freeze_clear(phb->opal_id, pe_no, 275 pnv_pci_handle_eeh_config(phb, pe_no);
170 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
171 if (rc) {
172 pr_warning("PCI %d: Failed to clear EEH freeze state"
173 " for PE#%d, err %lld\n",
174 phb->hose->global_number, pe_no, rc);
175 }
176 }
177} 276}
178 277
179static int pnv_pci_read_config(struct pci_bus *bus, 278static int pnv_pci_read_config(struct pci_bus *bus,
@@ -257,12 +356,54 @@ struct pci_ops pnv_pci_ops = {
257 .write = pnv_pci_write_config, 356 .write = pnv_pci_write_config,
258}; 357};
259 358
359
360static void pnv_tce_invalidate(struct iommu_table *tbl,
361 u64 *startp, u64 *endp)
362{
363 u64 __iomem *invalidate = (u64 __iomem *)tbl->it_index;
364 unsigned long start, end, inc;
365
366 start = __pa(startp);
367 end = __pa(endp);
368
369
370 /* BML uses this case for p6/p7/galaxy2: Shift addr and put in node */
371 if (tbl->it_busno) {
372 start <<= 12;
373 end <<= 12;
374 inc = 128 << 12;
375 start |= tbl->it_busno;
376 end |= tbl->it_busno;
377 }
378 /* p7ioc-style invalidation, 2 TCEs per write */
379 else if (tbl->it_type & TCE_PCI_SWINV_PAIR) {
380 start |= (1ull << 63);
381 end |= (1ull << 63);
382 inc = 16;
383 }
384 /* Default (older HW) */
385 else
386 inc = 128;
387
388 end |= inc - 1; /* round up end to be different than start */
389
390 mb(); /* Ensure above stores are visible */
391 while (start <= end) {
392 __raw_writeq(start, invalidate);
393 start += inc;
394 }
395 /* The iommu layer will do another mb() for us on build() and
396 * we don't care on free()
397 */
398}
399
400
260static int pnv_tce_build(struct iommu_table *tbl, long index, long npages, 401static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
261 unsigned long uaddr, enum dma_data_direction direction, 402 unsigned long uaddr, enum dma_data_direction direction,
262 struct dma_attrs *attrs) 403 struct dma_attrs *attrs)
263{ 404{
264 u64 proto_tce; 405 u64 proto_tce;
265 u64 *tcep; 406 u64 *tcep, *tces;
266 u64 rpn; 407 u64 rpn;
267 408
268 proto_tce = TCE_PCI_READ; // Read allowed 409 proto_tce = TCE_PCI_READ; // Read allowed
@@ -270,25 +411,33 @@ static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
270 if (direction != DMA_TO_DEVICE) 411 if (direction != DMA_TO_DEVICE)
271 proto_tce |= TCE_PCI_WRITE; 412 proto_tce |= TCE_PCI_WRITE;
272 413
273 tcep = ((u64 *)tbl->it_base) + index; 414 tces = tcep = ((u64 *)tbl->it_base) + index - tbl->it_offset;
415 rpn = __pa(uaddr) >> TCE_SHIFT;
274 416
275 while (npages--) { 417 while (npages--)
276 /* can't move this out since we might cross LMB boundary */ 418 *(tcep++) = proto_tce | (rpn++ << TCE_RPN_SHIFT);
277 rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; 419
278 *tcep = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT; 420 /* Some implementations won't cache invalid TCEs and thus may not
421 * need that flush. We'll probably turn it_type into a bit mask
422 * of flags if that becomes the case
423 */
424 if (tbl->it_type & TCE_PCI_SWINV_CREATE)
425 pnv_tce_invalidate(tbl, tces, tcep - 1);
279 426
280 uaddr += TCE_PAGE_SIZE;
281 tcep++;
282 }
283 return 0; 427 return 0;
284} 428}
285 429
286static void pnv_tce_free(struct iommu_table *tbl, long index, long npages) 430static void pnv_tce_free(struct iommu_table *tbl, long index, long npages)
287{ 431{
288 u64 *tcep = ((u64 *)tbl->it_base) + index; 432 u64 *tcep, *tces;
433
434 tces = tcep = ((u64 *)tbl->it_base) + index - tbl->it_offset;
289 435
290 while (npages--) 436 while (npages--)
291 *(tcep++) = 0; 437 *(tcep++) = 0;
438
439 if (tbl->it_type & TCE_PCI_SWINV_FREE)
440 pnv_tce_invalidate(tbl, tces, tcep - 1);
292} 441}
293 442
294void pnv_pci_setup_iommu_table(struct iommu_table *tbl, 443void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
@@ -308,13 +457,14 @@ static struct iommu_table * __devinit
308pnv_pci_setup_bml_iommu(struct pci_controller *hose) 457pnv_pci_setup_bml_iommu(struct pci_controller *hose)
309{ 458{
310 struct iommu_table *tbl; 459 struct iommu_table *tbl;
311 const __be64 *basep; 460 const __be64 *basep, *swinvp;
312 const __be32 *sizep; 461 const __be32 *sizep;
313 462
314 basep = of_get_property(hose->dn, "linux,tce-base", NULL); 463 basep = of_get_property(hose->dn, "linux,tce-base", NULL);
315 sizep = of_get_property(hose->dn, "linux,tce-size", NULL); 464 sizep = of_get_property(hose->dn, "linux,tce-size", NULL);
316 if (basep == NULL || sizep == NULL) { 465 if (basep == NULL || sizep == NULL) {
317 pr_err("PCI: %s has missing tce entries !\n", hose->dn->full_name); 466 pr_err("PCI: %s has missing tce entries !\n",
467 hose->dn->full_name);
318 return NULL; 468 return NULL;
319 } 469 }
320 tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, hose->node); 470 tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, hose->node);
@@ -323,6 +473,15 @@ pnv_pci_setup_bml_iommu(struct pci_controller *hose)
323 pnv_pci_setup_iommu_table(tbl, __va(be64_to_cpup(basep)), 473 pnv_pci_setup_iommu_table(tbl, __va(be64_to_cpup(basep)),
324 be32_to_cpup(sizep), 0); 474 be32_to_cpup(sizep), 0);
325 iommu_init_table(tbl, hose->node); 475 iommu_init_table(tbl, hose->node);
476
477 /* Deal with SW invalidated TCEs when needed (BML way) */
478 swinvp = of_get_property(hose->dn, "linux,tce-sw-invalidate-info",
479 NULL);
480 if (swinvp) {
481 tbl->it_busno = swinvp[1];
482 tbl->it_index = (unsigned long)ioremap(swinvp[0], 8);
483 tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
484 }
326 return tbl; 485 return tbl;
327} 486}
328 487
@@ -356,6 +515,13 @@ static void __devinit pnv_pci_dma_dev_setup(struct pci_dev *pdev)
356 pnv_pci_dma_fallback_setup(hose, pdev); 515 pnv_pci_dma_fallback_setup(hose, pdev);
357} 516}
358 517
518/* Fixup wrong class code in p7ioc root complex */
519static void __devinit pnv_p7ioc_rc_quirk(struct pci_dev *dev)
520{
521 dev->class = PCI_CLASS_BRIDGE_PCI << 8;
522}
523DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x3b9, pnv_p7ioc_rc_quirk);
524
359static int pnv_pci_probe_mode(struct pci_bus *bus) 525static int pnv_pci_probe_mode(struct pci_bus *bus)
360{ 526{
361 struct pci_controller *hose = pci_bus_to_host(bus); 527 struct pci_controller *hose = pci_bus_to_host(bus);
@@ -400,12 +566,24 @@ void __init pnv_pci_init(void)
400 init_pci_config_tokens(); 566 init_pci_config_tokens();
401 find_and_init_phbs(); 567 find_and_init_phbs();
402#endif /* CONFIG_PPC_POWERNV_RTAS */ 568#endif /* CONFIG_PPC_POWERNV_RTAS */
403 } else { 569 }
404 /* OPAL is here, do our normal stuff */ 570 /* OPAL is here, do our normal stuff */
571 else {
572 int found_ioda = 0;
573
574 /* Look for IODA IO-Hubs. We don't support mixing IODA
575 * and p5ioc2 due to the need to change some global
576 * probing flags
577 */
578 for_each_compatible_node(np, NULL, "ibm,ioda-hub") {
579 pnv_pci_init_ioda_hub(np);
580 found_ioda = 1;
581 }
405 582
406 /* Look for p5ioc2 IO-Hubs */ 583 /* Look for p5ioc2 IO-Hubs */
407 for_each_compatible_node(np, NULL, "ibm,p5ioc2") 584 if (!found_ioda)
408 pnv_pci_init_p5ioc2_hub(np); 585 for_each_compatible_node(np, NULL, "ibm,p5ioc2")
586 pnv_pci_init_p5ioc2_hub(np);
409 } 587 }
410 588
411 /* Setup the linkage between OF nodes and PHBs */ 589 /* Setup the linkage between OF nodes and PHBs */
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index d4dbc4950936..8bc479634643 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -9,9 +9,63 @@ enum pnv_phb_type {
9 PNV_PHB_IODA2, 9 PNV_PHB_IODA2,
10}; 10};
11 11
12/* Precise PHB model for error management */
13enum pnv_phb_model {
14 PNV_PHB_MODEL_UNKNOWN,
15 PNV_PHB_MODEL_P5IOC2,
16 PNV_PHB_MODEL_P7IOC,
17};
18
19#define PNV_PCI_DIAG_BUF_SIZE 4096
20
21/* Data associated with a PE, including IOMMU tracking etc.. */
22struct pnv_ioda_pe {
23 /* A PE can be associated with a single device or an
24 * entire bus (& children). In the former case, pdev
25 * is populated, in the later case, pbus is.
26 */
27 struct pci_dev *pdev;
28 struct pci_bus *pbus;
29
30 /* Effective RID (device RID for a device PE and base bus
31 * RID with devfn 0 for a bus PE)
32 */
33 unsigned int rid;
34
35 /* PE number */
36 unsigned int pe_number;
37
38 /* "Weight" assigned to the PE for the sake of DMA resource
39 * allocations
40 */
41 unsigned int dma_weight;
42
43 /* This is a PCI-E -> PCI-X bridge, this points to the
44 * corresponding bus PE
45 */
46 struct pnv_ioda_pe *bus_pe;
47
48 /* "Base" iommu table, ie, 4K TCEs, 32-bit DMA */
49 int tce32_seg;
50 int tce32_segcount;
51 struct iommu_table tce32_table;
52
53 /* XXX TODO: Add support for additional 64-bit iommus */
54
55 /* MSIs. MVE index is identical for for 32 and 64 bit MSI
56 * and -1 if not supported. (It's actually identical to the
57 * PE number)
58 */
59 int mve_number;
60
61 /* Link in list of PE#s */
62 struct list_head link;
63};
64
12struct pnv_phb { 65struct pnv_phb {
13 struct pci_controller *hose; 66 struct pci_controller *hose;
14 enum pnv_phb_type type; 67 enum pnv_phb_type type;
68 enum pnv_phb_model model;
15 u64 opal_id; 69 u64 opal_id;
16 void __iomem *regs; 70 void __iomem *regs;
17 spinlock_t lock; 71 spinlock_t lock;
@@ -34,7 +88,52 @@ struct pnv_phb {
34 struct { 88 struct {
35 struct iommu_table iommu_table; 89 struct iommu_table iommu_table;
36 } p5ioc2; 90 } p5ioc2;
91
92 struct {
93 /* Global bridge info */
94 unsigned int total_pe;
95 unsigned int m32_size;
96 unsigned int m32_segsize;
97 unsigned int m32_pci_base;
98 unsigned int io_size;
99 unsigned int io_segsize;
100 unsigned int io_pci_base;
101
102 /* PE allocation bitmap */
103 unsigned long *pe_alloc;
104
105 /* M32 & IO segment maps */
106 unsigned int *m32_segmap;
107 unsigned int *io_segmap;
108 struct pnv_ioda_pe *pe_array;
109
110 /* Reverse map of PEs, will have to extend if
111 * we are to support more than 256 PEs, indexed
112 * bus { bus, devfn }
113 */
114 unsigned char pe_rmap[0x10000];
115
116 /* 32-bit TCE tables allocation */
117 unsigned long tce32_count;
118
119 /* Total "weight" for the sake of DMA resources
120 * allocation
121 */
122 unsigned int dma_weight;
123 unsigned int dma_pe_count;
124
125 /* Sorted list of used PE's, sorted at
126 * boot for resource allocation purposes
127 */
128 struct list_head pe_list;
129 } ioda;
37 }; 130 };
131
132 /* PHB status structure */
133 union {
134 unsigned char blob[PNV_PCI_DIAG_BUF_SIZE];
135 struct OpalIoP7IOCPhbErrorData p7ioc;
136 } diag;
38}; 137};
39 138
40extern struct pci_ops pnv_pci_ops; 139extern struct pci_ops pnv_pci_ops;
@@ -43,6 +142,7 @@ extern void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
43 void *tce_mem, u64 tce_size, 142 void *tce_mem, u64 tce_size,
44 u64 dma_offset); 143 u64 dma_offset);
45extern void pnv_pci_init_p5ioc2_hub(struct device_node *np); 144extern void pnv_pci_init_p5ioc2_hub(struct device_node *np);
145extern void pnv_pci_init_ioda_hub(struct device_node *np);
46 146
47 147
48#endif /* __POWERNV_PCI_H */ 148#endif /* __POWERNV_PCI_H */
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index e87736685243..17210c526c52 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -75,7 +75,7 @@ int __devinit pnv_smp_kick_cpu(int nr)
75 /* On OPAL v2 the CPU are still spinning inside OPAL itself, 75 /* On OPAL v2 the CPU are still spinning inside OPAL itself,
76 * get them back now 76 * get them back now
77 */ 77 */
78 if (firmware_has_feature(FW_FEATURE_OPALv2)) { 78 if (!paca[nr].cpu_start && firmware_has_feature(FW_FEATURE_OPALv2)) {
79 pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n", nr, pcpu); 79 pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n", nr, pcpu);
80 rc = opal_start_cpu(pcpu, start_here); 80 rc = opal_start_cpu(pcpu, start_here);
81 if (rc != OPAL_SUCCESS) 81 if (rc != OPAL_SUCCESS)
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index 404bc52b7806..617efa12a3a5 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -31,18 +31,18 @@
31 31
32#if defined(DEBUG) 32#if defined(DEBUG)
33#define DBG udbg_printf 33#define DBG udbg_printf
34#define FAIL udbg_printf
34#else 35#else
35#define DBG pr_debug 36#define DBG pr_devel
37#define FAIL pr_debug
36#endif 38#endif
37 39
38/** 40/**
39 * struct ps3_bmp - a per cpu irq status and mask bitmap structure 41 * struct ps3_bmp - a per cpu irq status and mask bitmap structure
40 * @status: 256 bit status bitmap indexed by plug 42 * @status: 256 bit status bitmap indexed by plug
41 * @unused_1: 43 * @unused_1: Alignment
42 * @mask: 256 bit mask bitmap indexed by plug 44 * @mask: 256 bit mask bitmap indexed by plug
43 * @unused_2: 45 * @unused_2: Alignment
44 * @lock:
45 * @ipi_debug_brk_mask:
46 * 46 *
47 * The HV maintains per SMT thread mappings of HV outlet to HV plug on 47 * The HV maintains per SMT thread mappings of HV outlet to HV plug on
48 * behalf of the guest. These mappings are implemented as 256 bit guest 48 * behalf of the guest. These mappings are implemented as 256 bit guest
@@ -73,21 +73,25 @@ struct ps3_bmp {
73 unsigned long mask; 73 unsigned long mask;
74 u64 unused_2[3]; 74 u64 unused_2[3];
75 }; 75 };
76 u64 ipi_debug_brk_mask;
77 spinlock_t lock;
78}; 76};
79 77
80/** 78/**
81 * struct ps3_private - a per cpu data structure 79 * struct ps3_private - a per cpu data structure
82 * @bmp: ps3_bmp structure 80 * @bmp: ps3_bmp structure
81 * @bmp_lock: Syncronize access to bmp.
82 * @ipi_debug_brk_mask: Mask for debug break IPIs
83 * @ppe_id: HV logical_ppe_id 83 * @ppe_id: HV logical_ppe_id
84 * @thread_id: HV thread_id 84 * @thread_id: HV thread_id
85 * @ipi_mask: Mask of IPI virqs
85 */ 86 */
86 87
87struct ps3_private { 88struct ps3_private {
88 struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN))); 89 struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN)));
90 spinlock_t bmp_lock;
89 u64 ppe_id; 91 u64 ppe_id;
90 u64 thread_id; 92 u64 thread_id;
93 unsigned long ipi_debug_brk_mask;
94 unsigned long ipi_mask;
91}; 95};
92 96
93static DEFINE_PER_CPU(struct ps3_private, ps3_private); 97static DEFINE_PER_CPU(struct ps3_private, ps3_private);
@@ -104,7 +108,7 @@ static void ps3_chip_mask(struct irq_data *d)
104 struct ps3_private *pd = irq_data_get_irq_chip_data(d); 108 struct ps3_private *pd = irq_data_get_irq_chip_data(d);
105 unsigned long flags; 109 unsigned long flags;
106 110
107 pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__, 111 DBG("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
108 pd->thread_id, d->irq); 112 pd->thread_id, d->irq);
109 113
110 local_irq_save(flags); 114 local_irq_save(flags);
@@ -125,7 +129,7 @@ static void ps3_chip_unmask(struct irq_data *d)
125 struct ps3_private *pd = irq_data_get_irq_chip_data(d); 129 struct ps3_private *pd = irq_data_get_irq_chip_data(d);
126 unsigned long flags; 130 unsigned long flags;
127 131
128 pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__, 132 DBG("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
129 pd->thread_id, d->irq); 133 pd->thread_id, d->irq);
130 134
131 local_irq_save(flags); 135 local_irq_save(flags);
@@ -144,7 +148,11 @@ static void ps3_chip_unmask(struct irq_data *d)
144static void ps3_chip_eoi(struct irq_data *d) 148static void ps3_chip_eoi(struct irq_data *d)
145{ 149{
146 const struct ps3_private *pd = irq_data_get_irq_chip_data(d); 150 const struct ps3_private *pd = irq_data_get_irq_chip_data(d);
147 lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq); 151
152 /* non-IPIs are EOIed here. */
153
154 if (!test_bit(63 - d->irq, &pd->ipi_mask))
155 lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq);
148} 156}
149 157
150/** 158/**
@@ -185,19 +193,19 @@ static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
185 *virq = irq_create_mapping(NULL, outlet); 193 *virq = irq_create_mapping(NULL, outlet);
186 194
187 if (*virq == NO_IRQ) { 195 if (*virq == NO_IRQ) {
188 pr_debug("%s:%d: irq_create_mapping failed: outlet %lu\n", 196 FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n",
189 __func__, __LINE__, outlet); 197 __func__, __LINE__, outlet);
190 result = -ENOMEM; 198 result = -ENOMEM;
191 goto fail_create; 199 goto fail_create;
192 } 200 }
193 201
194 pr_debug("%s:%d: outlet %lu => cpu %u, virq %u\n", __func__, __LINE__, 202 DBG("%s:%d: outlet %lu => cpu %u, virq %u\n", __func__, __LINE__,
195 outlet, cpu, *virq); 203 outlet, cpu, *virq);
196 204
197 result = irq_set_chip_data(*virq, pd); 205 result = irq_set_chip_data(*virq, pd);
198 206
199 if (result) { 207 if (result) {
200 pr_debug("%s:%d: irq_set_chip_data failed\n", 208 FAIL("%s:%d: irq_set_chip_data failed\n",
201 __func__, __LINE__); 209 __func__, __LINE__);
202 goto fail_set; 210 goto fail_set;
203 } 211 }
@@ -223,13 +231,13 @@ static int ps3_virq_destroy(unsigned int virq)
223{ 231{
224 const struct ps3_private *pd = irq_get_chip_data(virq); 232 const struct ps3_private *pd = irq_get_chip_data(virq);
225 233
226 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__, 234 DBG("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
227 __LINE__, pd->ppe_id, pd->thread_id, virq); 235 __LINE__, pd->ppe_id, pd->thread_id, virq);
228 236
229 irq_set_chip_data(virq, NULL); 237 irq_set_chip_data(virq, NULL);
230 irq_dispose_mapping(virq); 238 irq_dispose_mapping(virq);
231 239
232 pr_debug("%s:%d <-\n", __func__, __LINE__); 240 DBG("%s:%d <-\n", __func__, __LINE__);
233 return 0; 241 return 0;
234} 242}
235 243
@@ -252,7 +260,7 @@ int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
252 result = ps3_virq_setup(cpu, outlet, virq); 260 result = ps3_virq_setup(cpu, outlet, virq);
253 261
254 if (result) { 262 if (result) {
255 pr_debug("%s:%d: ps3_virq_setup failed\n", __func__, __LINE__); 263 FAIL("%s:%d: ps3_virq_setup failed\n", __func__, __LINE__);
256 goto fail_setup; 264 goto fail_setup;
257 } 265 }
258 266
@@ -264,7 +272,7 @@ int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
264 outlet, 0); 272 outlet, 0);
265 273
266 if (result) { 274 if (result) {
267 pr_info("%s:%d: lv1_connect_irq_plug_ext failed: %s\n", 275 FAIL("%s:%d: lv1_connect_irq_plug_ext failed: %s\n",
268 __func__, __LINE__, ps3_result(result)); 276 __func__, __LINE__, ps3_result(result));
269 result = -EPERM; 277 result = -EPERM;
270 goto fail_connect; 278 goto fail_connect;
@@ -293,7 +301,7 @@ int ps3_irq_plug_destroy(unsigned int virq)
293 int result; 301 int result;
294 const struct ps3_private *pd = irq_get_chip_data(virq); 302 const struct ps3_private *pd = irq_get_chip_data(virq);
295 303
296 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__, 304 DBG("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
297 __LINE__, pd->ppe_id, pd->thread_id, virq); 305 __LINE__, pd->ppe_id, pd->thread_id, virq);
298 306
299 ps3_chip_mask(irq_get_irq_data(virq)); 307 ps3_chip_mask(irq_get_irq_data(virq));
@@ -301,7 +309,7 @@ int ps3_irq_plug_destroy(unsigned int virq)
301 result = lv1_disconnect_irq_plug_ext(pd->ppe_id, pd->thread_id, virq); 309 result = lv1_disconnect_irq_plug_ext(pd->ppe_id, pd->thread_id, virq);
302 310
303 if (result) 311 if (result)
304 pr_info("%s:%d: lv1_disconnect_irq_plug_ext failed: %s\n", 312 FAIL("%s:%d: lv1_disconnect_irq_plug_ext failed: %s\n",
305 __func__, __LINE__, ps3_result(result)); 313 __func__, __LINE__, ps3_result(result));
306 314
307 ps3_virq_destroy(virq); 315 ps3_virq_destroy(virq);
@@ -329,7 +337,7 @@ int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
329 result = lv1_construct_event_receive_port(&outlet); 337 result = lv1_construct_event_receive_port(&outlet);
330 338
331 if (result) { 339 if (result) {
332 pr_debug("%s:%d: lv1_construct_event_receive_port failed: %s\n", 340 FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n",
333 __func__, __LINE__, ps3_result(result)); 341 __func__, __LINE__, ps3_result(result));
334 *virq = NO_IRQ; 342 *virq = NO_IRQ;
335 return result; 343 return result;
@@ -355,14 +363,14 @@ int ps3_event_receive_port_destroy(unsigned int virq)
355{ 363{
356 int result; 364 int result;
357 365
358 pr_debug(" -> %s:%d virq %u\n", __func__, __LINE__, virq); 366 DBG(" -> %s:%d virq %u\n", __func__, __LINE__, virq);
359 367
360 ps3_chip_mask(irq_get_irq_data(virq)); 368 ps3_chip_mask(irq_get_irq_data(virq));
361 369
362 result = lv1_destruct_event_receive_port(virq_to_hw(virq)); 370 result = lv1_destruct_event_receive_port(virq_to_hw(virq));
363 371
364 if (result) 372 if (result)
365 pr_debug("%s:%d: lv1_destruct_event_receive_port failed: %s\n", 373 FAIL("%s:%d: lv1_destruct_event_receive_port failed: %s\n",
366 __func__, __LINE__, ps3_result(result)); 374 __func__, __LINE__, ps3_result(result));
367 375
368 /* 376 /*
@@ -370,7 +378,7 @@ int ps3_event_receive_port_destroy(unsigned int virq)
370 * calls from interrupt context (smp_call_function) when kexecing. 378 * calls from interrupt context (smp_call_function) when kexecing.
371 */ 379 */
372 380
373 pr_debug(" <- %s:%d\n", __func__, __LINE__); 381 DBG(" <- %s:%d\n", __func__, __LINE__);
374 return result; 382 return result;
375} 383}
376 384
@@ -406,7 +414,7 @@ int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev,
406 dev->dev_id, virq_to_hw(*virq), dev->interrupt_id); 414 dev->dev_id, virq_to_hw(*virq), dev->interrupt_id);
407 415
408 if (result) { 416 if (result) {
409 pr_debug("%s:%d: lv1_connect_interrupt_event_receive_port" 417 FAIL("%s:%d: lv1_connect_interrupt_event_receive_port"
410 " failed: %s\n", __func__, __LINE__, 418 " failed: %s\n", __func__, __LINE__,
411 ps3_result(result)); 419 ps3_result(result));
412 ps3_event_receive_port_destroy(*virq); 420 ps3_event_receive_port_destroy(*virq);
@@ -414,7 +422,7 @@ int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev,
414 return result; 422 return result;
415 } 423 }
416 424
417 pr_debug("%s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__, 425 DBG("%s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__,
418 dev->interrupt_id, *virq); 426 dev->interrupt_id, *virq);
419 427
420 return 0; 428 return 0;
@@ -428,14 +436,14 @@ int ps3_sb_event_receive_port_destroy(struct ps3_system_bus_device *dev,
428 436
429 int result; 437 int result;
430 438
431 pr_debug(" -> %s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__, 439 DBG(" -> %s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__,
432 dev->interrupt_id, virq); 440 dev->interrupt_id, virq);
433 441
434 result = lv1_disconnect_interrupt_event_receive_port(dev->bus_id, 442 result = lv1_disconnect_interrupt_event_receive_port(dev->bus_id,
435 dev->dev_id, virq_to_hw(virq), dev->interrupt_id); 443 dev->dev_id, virq_to_hw(virq), dev->interrupt_id);
436 444
437 if (result) 445 if (result)
438 pr_debug("%s:%d: lv1_disconnect_interrupt_event_receive_port" 446 FAIL("%s:%d: lv1_disconnect_interrupt_event_receive_port"
439 " failed: %s\n", __func__, __LINE__, 447 " failed: %s\n", __func__, __LINE__,
440 ps3_result(result)); 448 ps3_result(result));
441 449
@@ -450,7 +458,7 @@ int ps3_sb_event_receive_port_destroy(struct ps3_system_bus_device *dev,
450 result = ps3_virq_destroy(virq); 458 result = ps3_virq_destroy(virq);
451 BUG_ON(result); 459 BUG_ON(result);
452 460
453 pr_debug(" <- %s:%d\n", __func__, __LINE__); 461 DBG(" <- %s:%d\n", __func__, __LINE__);
454 return result; 462 return result;
455} 463}
456EXPORT_SYMBOL(ps3_sb_event_receive_port_destroy); 464EXPORT_SYMBOL(ps3_sb_event_receive_port_destroy);
@@ -475,7 +483,7 @@ int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
475 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet); 483 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
476 484
477 if (result) { 485 if (result) {
478 pr_debug("%s:%d: lv1_construct_io_irq_outlet failed: %s\n", 486 FAIL("%s:%d: lv1_construct_io_irq_outlet failed: %s\n",
479 __func__, __LINE__, ps3_result(result)); 487 __func__, __LINE__, ps3_result(result));
480 return result; 488 return result;
481 } 489 }
@@ -505,7 +513,7 @@ int ps3_io_irq_destroy(unsigned int virq)
505 result = lv1_destruct_io_irq_outlet(outlet); 513 result = lv1_destruct_io_irq_outlet(outlet);
506 514
507 if (result) 515 if (result)
508 pr_debug("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n", 516 FAIL("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n",
509 __func__, __LINE__, ps3_result(result)); 517 __func__, __LINE__, ps3_result(result));
510 518
511 return result; 519 return result;
@@ -537,7 +545,7 @@ int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
537 result = lv1_configure_virtual_uart_irq(lpar_addr, &outlet); 545 result = lv1_configure_virtual_uart_irq(lpar_addr, &outlet);
538 546
539 if (result) { 547 if (result) {
540 pr_debug("%s:%d: lv1_configure_virtual_uart_irq failed: %s\n", 548 FAIL("%s:%d: lv1_configure_virtual_uart_irq failed: %s\n",
541 __func__, __LINE__, ps3_result(result)); 549 __func__, __LINE__, ps3_result(result));
542 return result; 550 return result;
543 } 551 }
@@ -557,7 +565,7 @@ int ps3_vuart_irq_destroy(unsigned int virq)
557 result = lv1_deconfigure_virtual_uart_irq(); 565 result = lv1_deconfigure_virtual_uart_irq();
558 566
559 if (result) { 567 if (result) {
560 pr_debug("%s:%d: lv1_configure_virtual_uart_irq failed: %s\n", 568 FAIL("%s:%d: lv1_configure_virtual_uart_irq failed: %s\n",
561 __func__, __LINE__, ps3_result(result)); 569 __func__, __LINE__, ps3_result(result));
562 return result; 570 return result;
563 } 571 }
@@ -590,7 +598,7 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
590 result = lv1_get_spe_irq_outlet(spe_id, class, &outlet); 598 result = lv1_get_spe_irq_outlet(spe_id, class, &outlet);
591 599
592 if (result) { 600 if (result) {
593 pr_debug("%s:%d: lv1_get_spe_irq_outlet failed: %s\n", 601 FAIL("%s:%d: lv1_get_spe_irq_outlet failed: %s\n",
594 __func__, __LINE__, ps3_result(result)); 602 __func__, __LINE__, ps3_result(result));
595 return result; 603 return result;
596 } 604 }
@@ -621,7 +629,7 @@ int ps3_spe_irq_destroy(unsigned int virq)
621static void _dump_64_bmp(const char *header, const u64 *p, unsigned cpu, 629static void _dump_64_bmp(const char *header, const u64 *p, unsigned cpu,
622 const char* func, int line) 630 const char* func, int line)
623{ 631{
624 pr_debug("%s:%d: %s %u {%04lx_%04lx_%04lx_%04lx}\n", 632 pr_debug("%s:%d: %s %u {%04llx_%04llx_%04llx_%04llx}\n",
625 func, line, header, cpu, 633 func, line, header, cpu,
626 *p >> 48, (*p >> 32) & 0xffff, (*p >> 16) & 0xffff, 634 *p >> 48, (*p >> 32) & 0xffff, (*p >> 16) & 0xffff,
627 *p & 0xffff); 635 *p & 0xffff);
@@ -630,7 +638,7 @@ static void _dump_64_bmp(const char *header, const u64 *p, unsigned cpu,
630static void __maybe_unused _dump_256_bmp(const char *header, 638static void __maybe_unused _dump_256_bmp(const char *header,
631 const u64 *p, unsigned cpu, const char* func, int line) 639 const u64 *p, unsigned cpu, const char* func, int line)
632{ 640{
633 pr_debug("%s:%d: %s %u {%016lx:%016lx:%016lx:%016lx}\n", 641 pr_debug("%s:%d: %s %u {%016llx:%016llx:%016llx:%016llx}\n",
634 func, line, header, cpu, p[0], p[1], p[2], p[3]); 642 func, line, header, cpu, p[0], p[1], p[2], p[3]);
635} 643}
636 644
@@ -639,10 +647,10 @@ static void _dump_bmp(struct ps3_private* pd, const char* func, int line)
639{ 647{
640 unsigned long flags; 648 unsigned long flags;
641 649
642 spin_lock_irqsave(&pd->bmp.lock, flags); 650 spin_lock_irqsave(&pd->bmp_lock, flags);
643 _dump_64_bmp("stat", &pd->bmp.status, pd->thread_id, func, line); 651 _dump_64_bmp("stat", &pd->bmp.status, pd->thread_id, func, line);
644 _dump_64_bmp("mask", &pd->bmp.mask, pd->thread_id, func, line); 652 _dump_64_bmp("mask", (u64*)&pd->bmp.mask, pd->thread_id, func, line);
645 spin_unlock_irqrestore(&pd->bmp.lock, flags); 653 spin_unlock_irqrestore(&pd->bmp_lock, flags);
646} 654}
647 655
648#define dump_mask(_x) _dump_mask(_x, __func__, __LINE__) 656#define dump_mask(_x) _dump_mask(_x, __func__, __LINE__)
@@ -651,9 +659,9 @@ static void __maybe_unused _dump_mask(struct ps3_private *pd,
651{ 659{
652 unsigned long flags; 660 unsigned long flags;
653 661
654 spin_lock_irqsave(&pd->bmp.lock, flags); 662 spin_lock_irqsave(&pd->bmp_lock, flags);
655 _dump_64_bmp("mask", &pd->bmp.mask, pd->thread_id, func, line); 663 _dump_64_bmp("mask", (u64*)&pd->bmp.mask, pd->thread_id, func, line);
656 spin_unlock_irqrestore(&pd->bmp.lock, flags); 664 spin_unlock_irqrestore(&pd->bmp_lock, flags);
657} 665}
658#else 666#else
659static void dump_bmp(struct ps3_private* pd) {}; 667static void dump_bmp(struct ps3_private* pd) {};
@@ -662,7 +670,7 @@ static void dump_bmp(struct ps3_private* pd) {};
662static int ps3_host_map(struct irq_host *h, unsigned int virq, 670static int ps3_host_map(struct irq_host *h, unsigned int virq,
663 irq_hw_number_t hwirq) 671 irq_hw_number_t hwirq)
664{ 672{
665 pr_debug("%s:%d: hwirq %lu, virq %u\n", __func__, __LINE__, hwirq, 673 DBG("%s:%d: hwirq %lu, virq %u\n", __func__, __LINE__, hwirq,
666 virq); 674 virq);
667 675
668 irq_set_chip_and_handler(virq, &ps3_irq_chip, handle_fasteoi_irq); 676 irq_set_chip_and_handler(virq, &ps3_irq_chip, handle_fasteoi_irq);
@@ -685,10 +693,20 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
685{ 693{
686 struct ps3_private *pd = &per_cpu(ps3_private, cpu); 694 struct ps3_private *pd = &per_cpu(ps3_private, cpu);
687 695
688 pd->bmp.ipi_debug_brk_mask = 0x8000000000000000UL >> virq; 696 set_bit(63 - virq, &pd->ipi_debug_brk_mask);
689 697
690 pr_debug("%s:%d: cpu %u, virq %u, mask %llxh\n", __func__, __LINE__, 698 DBG("%s:%d: cpu %u, virq %u, mask %lxh\n", __func__, __LINE__,
691 cpu, virq, pd->bmp.ipi_debug_brk_mask); 699 cpu, virq, pd->ipi_debug_brk_mask);
700}
701
702void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq)
703{
704 struct ps3_private *pd = &per_cpu(ps3_private, cpu);
705
706 set_bit(63 - virq, &pd->ipi_mask);
707
708 DBG("%s:%d: cpu %u, virq %u, ipi_mask %lxh\n", __func__, __LINE__,
709 cpu, virq, pd->ipi_mask);
692} 710}
693 711
694static unsigned int ps3_get_irq(void) 712static unsigned int ps3_get_irq(void)
@@ -699,14 +717,14 @@ static unsigned int ps3_get_irq(void)
699 717
700 /* check for ipi break first to stop this cpu ASAP */ 718 /* check for ipi break first to stop this cpu ASAP */
701 719
702 if (x & pd->bmp.ipi_debug_brk_mask) 720 if (x & pd->ipi_debug_brk_mask)
703 x &= pd->bmp.ipi_debug_brk_mask; 721 x &= pd->ipi_debug_brk_mask;
704 722
705 asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x)); 723 asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x));
706 plug &= 0x3f; 724 plug &= 0x3f;
707 725
708 if (unlikely(plug == NO_IRQ)) { 726 if (unlikely(plug == NO_IRQ)) {
709 pr_debug("%s:%d: no plug found: thread_id %llu\n", __func__, 727 DBG("%s:%d: no plug found: thread_id %llu\n", __func__,
710 __LINE__, pd->thread_id); 728 __LINE__, pd->thread_id);
711 dump_bmp(&per_cpu(ps3_private, 0)); 729 dump_bmp(&per_cpu(ps3_private, 0));
712 dump_bmp(&per_cpu(ps3_private, 1)); 730 dump_bmp(&per_cpu(ps3_private, 1));
@@ -720,6 +738,12 @@ static unsigned int ps3_get_irq(void)
720 BUG(); 738 BUG();
721 } 739 }
722#endif 740#endif
741
742 /* IPIs are EOIed here. */
743
744 if (test_bit(63 - plug, &pd->ipi_mask))
745 lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, plug);
746
723 return plug; 747 return plug;
724} 748}
725 749
@@ -739,9 +763,9 @@ void __init ps3_init_IRQ(void)
739 763
740 lv1_get_logical_ppe_id(&pd->ppe_id); 764 lv1_get_logical_ppe_id(&pd->ppe_id);
741 pd->thread_id = get_hard_smp_processor_id(cpu); 765 pd->thread_id = get_hard_smp_processor_id(cpu);
742 spin_lock_init(&pd->bmp.lock); 766 spin_lock_init(&pd->bmp_lock);
743 767
744 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, bmp %lxh\n", 768 DBG("%s:%d: ppe_id %llu, thread_id %llu, bmp %lxh\n",
745 __func__, __LINE__, pd->ppe_id, pd->thread_id, 769 __func__, __LINE__, pd->ppe_id, pd->thread_id,
746 ps3_mm_phys_to_lpar(__pa(&pd->bmp))); 770 ps3_mm_phys_to_lpar(__pa(&pd->bmp)));
747 771
@@ -749,7 +773,7 @@ void __init ps3_init_IRQ(void)
749 pd->thread_id, ps3_mm_phys_to_lpar(__pa(&pd->bmp))); 773 pd->thread_id, ps3_mm_phys_to_lpar(__pa(&pd->bmp)));
750 774
751 if (result) 775 if (result)
752 pr_debug("%s:%d: lv1_configure_irq_state_bitmap failed:" 776 FAIL("%s:%d: lv1_configure_irq_state_bitmap failed:"
753 " %s\n", __func__, __LINE__, 777 " %s\n", __func__, __LINE__,
754 ps3_result(result)); 778 ps3_result(result));
755 } 779 }
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 72714ad27842..8bd6ba542691 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -319,7 +319,6 @@ static int __init ps3_mm_add_memory(void)
319 } 319 }
320 320
321 memblock_add(start_addr, map.r1.size); 321 memblock_add(start_addr, map.r1.size);
322 memblock_analyze();
323 322
324 result = online_pages(start_pfn, nr_pages); 323 result = online_pages(start_pfn, nr_pages);
325 324
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index 9a196a88eda7..1a633ed0fe98 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -43,6 +43,7 @@ void ps3_mm_shutdown(void);
43void ps3_init_IRQ(void); 43void ps3_init_IRQ(void);
44void ps3_shutdown_IRQ(int cpu); 44void ps3_shutdown_IRQ(int cpu);
45void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq); 45void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq);
46void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq);
46 47
47/* smp */ 48/* smp */
48 49
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
index ca40f6afd35d..7bdfea336f5e 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -44,7 +44,7 @@ static void _dump_field(const char *hdr, u64 n, const char *func, int line)
44 s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.'; 44 s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.';
45 s[i] = 0; 45 s[i] = 0;
46 46
47 pr_debug("%s:%d: %s%016llx : %s\n", func, line, hdr, n, s); 47 pr_devel("%s:%d: %s%016llx : %s\n", func, line, hdr, n, s);
48#endif 48#endif
49} 49}
50 50
@@ -53,7 +53,7 @@ static void _dump_field(const char *hdr, u64 n, const char *func, int line)
53static void _dump_node_name(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, 53static void _dump_node_name(unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
54 u64 n4, const char *func, int line) 54 u64 n4, const char *func, int line)
55{ 55{
56 pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id); 56 pr_devel("%s:%d: lpar: %u\n", func, line, lpar_id);
57 _dump_field("n1: ", n1, func, line); 57 _dump_field("n1: ", n1, func, line);
58 _dump_field("n2: ", n2, func, line); 58 _dump_field("n2: ", n2, func, line);
59 _dump_field("n3: ", n3, func, line); 59 _dump_field("n3: ", n3, func, line);
@@ -65,13 +65,13 @@ static void _dump_node_name(unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
65static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4, 65static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
66 u64 v1, u64 v2, const char *func, int line) 66 u64 v1, u64 v2, const char *func, int line)
67{ 67{
68 pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id); 68 pr_devel("%s:%d: lpar: %u\n", func, line, lpar_id);
69 _dump_field("n1: ", n1, func, line); 69 _dump_field("n1: ", n1, func, line);
70 _dump_field("n2: ", n2, func, line); 70 _dump_field("n2: ", n2, func, line);
71 _dump_field("n3: ", n3, func, line); 71 _dump_field("n3: ", n3, func, line);
72 _dump_field("n4: ", n4, func, line); 72 _dump_field("n4: ", n4, func, line);
73 pr_debug("%s:%d: v1: %016llx\n", func, line, v1); 73 pr_devel("%s:%d: v1: %016llx\n", func, line, v1);
74 pr_debug("%s:%d: v2: %016llx\n", func, line, v2); 74 pr_devel("%s:%d: v2: %016llx\n", func, line, v2);
75} 75}
76 76
77/** 77/**
@@ -131,11 +131,11 @@ static int read_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
131 lpar_id = id; 131 lpar_id = id;
132 } 132 }
133 133
134 result = lv1_get_repository_node_value(lpar_id, n1, n2, n3, n4, &v1, 134 result = lv1_read_repository_node(lpar_id, n1, n2, n3, n4, &v1,
135 &v2); 135 &v2);
136 136
137 if (result) { 137 if (result) {
138 pr_debug("%s:%d: lv1_get_repository_node_value failed: %s\n", 138 pr_warn("%s:%d: lv1_read_repository_node failed: %s\n",
139 __func__, __LINE__, ps3_result(result)); 139 __func__, __LINE__, ps3_result(result));
140 dump_node_name(lpar_id, n1, n2, n3, n4); 140 dump_node_name(lpar_id, n1, n2, n3, n4);
141 return -ENOENT; 141 return -ENOENT;
@@ -149,10 +149,10 @@ static int read_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
149 *_v2 = v2; 149 *_v2 = v2;
150 150
151 if (v1 && !_v1) 151 if (v1 && !_v1)
152 pr_debug("%s:%d: warning: discarding non-zero v1: %016llx\n", 152 pr_devel("%s:%d: warning: discarding non-zero v1: %016llx\n",
153 __func__, __LINE__, v1); 153 __func__, __LINE__, v1);
154 if (v2 && !_v2) 154 if (v2 && !_v2)
155 pr_debug("%s:%d: warning: discarding non-zero v2: %016llx\n", 155 pr_devel("%s:%d: warning: discarding non-zero v2: %016llx\n",
156 __func__, __LINE__, v2); 156 __func__, __LINE__, v2);
157 157
158 return 0; 158 return 0;
@@ -323,16 +323,16 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
323 result = ps3_repository_read_bus_num_dev(tmp.bus_index, &num_dev); 323 result = ps3_repository_read_bus_num_dev(tmp.bus_index, &num_dev);
324 324
325 if (result) { 325 if (result) {
326 pr_debug("%s:%d read_bus_num_dev failed\n", __func__, __LINE__); 326 pr_devel("%s:%d read_bus_num_dev failed\n", __func__, __LINE__);
327 return result; 327 return result;
328 } 328 }
329 329
330 pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %llu, num_dev %u\n", 330 pr_devel("%s:%d: bus_type %u, bus_index %u, bus_id %llu, num_dev %u\n",
331 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id, 331 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
332 num_dev); 332 num_dev);
333 333
334 if (tmp.dev_index >= num_dev) { 334 if (tmp.dev_index >= num_dev) {
335 pr_debug("%s:%d: no device found\n", __func__, __LINE__); 335 pr_devel("%s:%d: no device found\n", __func__, __LINE__);
336 return -ENODEV; 336 return -ENODEV;
337 } 337 }
338 338
@@ -340,7 +340,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
340 &tmp.dev_type); 340 &tmp.dev_type);
341 341
342 if (result) { 342 if (result) {
343 pr_debug("%s:%d read_dev_type failed\n", __func__, __LINE__); 343 pr_devel("%s:%d read_dev_type failed\n", __func__, __LINE__);
344 return result; 344 return result;
345 } 345 }
346 346
@@ -348,12 +348,12 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
348 &tmp.dev_id); 348 &tmp.dev_id);
349 349
350 if (result) { 350 if (result) {
351 pr_debug("%s:%d ps3_repository_read_dev_id failed\n", __func__, 351 pr_devel("%s:%d ps3_repository_read_dev_id failed\n", __func__,
352 __LINE__); 352 __LINE__);
353 return result; 353 return result;
354 } 354 }
355 355
356 pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %llu\n", 356 pr_devel("%s:%d: found: dev_type %u, dev_index %u, dev_id %llu\n",
357 __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id); 357 __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
358 358
359 *repo = tmp; 359 *repo = tmp;
@@ -367,14 +367,14 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
367 struct ps3_repository_device tmp; 367 struct ps3_repository_device tmp;
368 unsigned int num_dev; 368 unsigned int num_dev;
369 369
370 pr_debug(" -> %s:%u: find device by id %llu:%llu\n", __func__, __LINE__, 370 pr_devel(" -> %s:%u: find device by id %llu:%llu\n", __func__, __LINE__,
371 bus_id, dev_id); 371 bus_id, dev_id);
372 372
373 for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) { 373 for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) {
374 result = ps3_repository_read_bus_id(tmp.bus_index, 374 result = ps3_repository_read_bus_id(tmp.bus_index,
375 &tmp.bus_id); 375 &tmp.bus_id);
376 if (result) { 376 if (result) {
377 pr_debug("%s:%u read_bus_id(%u) failed\n", __func__, 377 pr_devel("%s:%u read_bus_id(%u) failed\n", __func__,
378 __LINE__, tmp.bus_index); 378 __LINE__, tmp.bus_index);
379 return result; 379 return result;
380 } 380 }
@@ -382,23 +382,23 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
382 if (tmp.bus_id == bus_id) 382 if (tmp.bus_id == bus_id)
383 goto found_bus; 383 goto found_bus;
384 384
385 pr_debug("%s:%u: skip, bus_id %llu\n", __func__, __LINE__, 385 pr_devel("%s:%u: skip, bus_id %llu\n", __func__, __LINE__,
386 tmp.bus_id); 386 tmp.bus_id);
387 } 387 }
388 pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__); 388 pr_devel(" <- %s:%u: bus not found\n", __func__, __LINE__);
389 return result; 389 return result;
390 390
391found_bus: 391found_bus:
392 result = ps3_repository_read_bus_type(tmp.bus_index, &tmp.bus_type); 392 result = ps3_repository_read_bus_type(tmp.bus_index, &tmp.bus_type);
393 if (result) { 393 if (result) {
394 pr_debug("%s:%u read_bus_type(%u) failed\n", __func__, 394 pr_devel("%s:%u read_bus_type(%u) failed\n", __func__,
395 __LINE__, tmp.bus_index); 395 __LINE__, tmp.bus_index);
396 return result; 396 return result;
397 } 397 }
398 398
399 result = ps3_repository_read_bus_num_dev(tmp.bus_index, &num_dev); 399 result = ps3_repository_read_bus_num_dev(tmp.bus_index, &num_dev);
400 if (result) { 400 if (result) {
401 pr_debug("%s:%u read_bus_num_dev failed\n", __func__, 401 pr_devel("%s:%u read_bus_num_dev failed\n", __func__,
402 __LINE__); 402 __LINE__);
403 return result; 403 return result;
404 } 404 }
@@ -408,7 +408,7 @@ found_bus:
408 tmp.dev_index, 408 tmp.dev_index,
409 &tmp.dev_id); 409 &tmp.dev_id);
410 if (result) { 410 if (result) {
411 pr_debug("%s:%u read_dev_id(%u:%u) failed\n", __func__, 411 pr_devel("%s:%u read_dev_id(%u:%u) failed\n", __func__,
412 __LINE__, tmp.bus_index, tmp.dev_index); 412 __LINE__, tmp.bus_index, tmp.dev_index);
413 return result; 413 return result;
414 } 414 }
@@ -416,21 +416,21 @@ found_bus:
416 if (tmp.dev_id == dev_id) 416 if (tmp.dev_id == dev_id)
417 goto found_dev; 417 goto found_dev;
418 418
419 pr_debug("%s:%u: skip, dev_id %llu\n", __func__, __LINE__, 419 pr_devel("%s:%u: skip, dev_id %llu\n", __func__, __LINE__,
420 tmp.dev_id); 420 tmp.dev_id);
421 } 421 }
422 pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__); 422 pr_devel(" <- %s:%u: dev not found\n", __func__, __LINE__);
423 return result; 423 return result;
424 424
425found_dev: 425found_dev:
426 result = ps3_repository_read_dev_type(tmp.bus_index, tmp.dev_index, 426 result = ps3_repository_read_dev_type(tmp.bus_index, tmp.dev_index,
427 &tmp.dev_type); 427 &tmp.dev_type);
428 if (result) { 428 if (result) {
429 pr_debug("%s:%u read_dev_type failed\n", __func__, __LINE__); 429 pr_devel("%s:%u read_dev_type failed\n", __func__, __LINE__);
430 return result; 430 return result;
431 } 431 }
432 432
433 pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%llu:%llu)\n", 433 pr_devel(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%llu:%llu)\n",
434 __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index, 434 __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index,
435 tmp.dev_index, tmp.bus_id, tmp.dev_id); 435 tmp.dev_index, tmp.bus_id, tmp.dev_id);
436 *repo = tmp; 436 *repo = tmp;
@@ -443,18 +443,18 @@ int __devinit ps3_repository_find_devices(enum ps3_bus_type bus_type,
443 int result = 0; 443 int result = 0;
444 struct ps3_repository_device repo; 444 struct ps3_repository_device repo;
445 445
446 pr_debug(" -> %s:%d: find bus_type %u\n", __func__, __LINE__, bus_type); 446 pr_devel(" -> %s:%d: find bus_type %u\n", __func__, __LINE__, bus_type);
447 447
448 repo.bus_type = bus_type; 448 repo.bus_type = bus_type;
449 result = ps3_repository_find_bus(repo.bus_type, 0, &repo.bus_index); 449 result = ps3_repository_find_bus(repo.bus_type, 0, &repo.bus_index);
450 if (result) { 450 if (result) {
451 pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__); 451 pr_devel(" <- %s:%u: bus not found\n", __func__, __LINE__);
452 return result; 452 return result;
453 } 453 }
454 454
455 result = ps3_repository_read_bus_id(repo.bus_index, &repo.bus_id); 455 result = ps3_repository_read_bus_id(repo.bus_index, &repo.bus_id);
456 if (result) { 456 if (result) {
457 pr_debug("%s:%d read_bus_id(%u) failed\n", __func__, __LINE__, 457 pr_devel("%s:%d read_bus_id(%u) failed\n", __func__, __LINE__,
458 repo.bus_index); 458 repo.bus_index);
459 return result; 459 return result;
460 } 460 }
@@ -469,13 +469,13 @@ int __devinit ps3_repository_find_devices(enum ps3_bus_type bus_type,
469 469
470 result = callback(&repo); 470 result = callback(&repo);
471 if (result) { 471 if (result) {
472 pr_debug("%s:%d: abort at callback\n", __func__, 472 pr_devel("%s:%d: abort at callback\n", __func__,
473 __LINE__); 473 __LINE__);
474 break; 474 break;
475 } 475 }
476 } 476 }
477 477
478 pr_debug(" <- %s:%d\n", __func__, __LINE__); 478 pr_devel(" <- %s:%d\n", __func__, __LINE__);
479 return result; 479 return result;
480} 480}
481 481
@@ -489,7 +489,7 @@ int ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from,
489 for (i = from; i < 10; i++) { 489 for (i = from; i < 10; i++) {
490 error = ps3_repository_read_bus_type(i, &type); 490 error = ps3_repository_read_bus_type(i, &type);
491 if (error) { 491 if (error) {
492 pr_debug("%s:%d read_bus_type failed\n", 492 pr_devel("%s:%d read_bus_type failed\n",
493 __func__, __LINE__); 493 __func__, __LINE__);
494 *bus_index = UINT_MAX; 494 *bus_index = UINT_MAX;
495 return error; 495 return error;
@@ -509,7 +509,7 @@ int ps3_repository_find_interrupt(const struct ps3_repository_device *repo,
509 int result = 0; 509 int result = 0;
510 unsigned int res_index; 510 unsigned int res_index;
511 511
512 pr_debug("%s:%d: find intr_type %u\n", __func__, __LINE__, intr_type); 512 pr_devel("%s:%d: find intr_type %u\n", __func__, __LINE__, intr_type);
513 513
514 *interrupt_id = UINT_MAX; 514 *interrupt_id = UINT_MAX;
515 515
@@ -521,7 +521,7 @@ int ps3_repository_find_interrupt(const struct ps3_repository_device *repo,
521 repo->dev_index, res_index, &t, &id); 521 repo->dev_index, res_index, &t, &id);
522 522
523 if (result) { 523 if (result) {
524 pr_debug("%s:%d read_dev_intr failed\n", 524 pr_devel("%s:%d read_dev_intr failed\n",
525 __func__, __LINE__); 525 __func__, __LINE__);
526 return result; 526 return result;
527 } 527 }
@@ -535,7 +535,7 @@ int ps3_repository_find_interrupt(const struct ps3_repository_device *repo,
535 if (res_index == 10) 535 if (res_index == 10)
536 return -ENODEV; 536 return -ENODEV;
537 537
538 pr_debug("%s:%d: found intr_type %u at res_index %u\n", 538 pr_devel("%s:%d: found intr_type %u at res_index %u\n",
539 __func__, __LINE__, intr_type, res_index); 539 __func__, __LINE__, intr_type, res_index);
540 540
541 return result; 541 return result;
@@ -547,7 +547,7 @@ int ps3_repository_find_reg(const struct ps3_repository_device *repo,
547 int result = 0; 547 int result = 0;
548 unsigned int res_index; 548 unsigned int res_index;
549 549
550 pr_debug("%s:%d: find reg_type %u\n", __func__, __LINE__, reg_type); 550 pr_devel("%s:%d: find reg_type %u\n", __func__, __LINE__, reg_type);
551 551
552 *bus_addr = *len = 0; 552 *bus_addr = *len = 0;
553 553
@@ -560,7 +560,7 @@ int ps3_repository_find_reg(const struct ps3_repository_device *repo,
560 repo->dev_index, res_index, &t, &a, &l); 560 repo->dev_index, res_index, &t, &a, &l);
561 561
562 if (result) { 562 if (result) {
563 pr_debug("%s:%d read_dev_reg failed\n", 563 pr_devel("%s:%d read_dev_reg failed\n",
564 __func__, __LINE__); 564 __func__, __LINE__);
565 return result; 565 return result;
566 } 566 }
@@ -575,7 +575,7 @@ int ps3_repository_find_reg(const struct ps3_repository_device *repo,
575 if (res_index == 10) 575 if (res_index == 10)
576 return -ENODEV; 576 return -ENODEV;
577 577
578 pr_debug("%s:%d: found reg_type %u at res_index %u\n", 578 pr_devel("%s:%d: found reg_type %u at res_index %u\n",
579 __func__, __LINE__, reg_type, res_index); 579 __func__, __LINE__, reg_type, res_index);
580 580
581 return result; 581 return result;
@@ -1009,7 +1009,7 @@ int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
1009 int result = 0; 1009 int result = 0;
1010 unsigned int res_index; 1010 unsigned int res_index;
1011 1011
1012 pr_debug(" -> %s:%d: (%u:%u)\n", __func__, __LINE__, 1012 pr_devel(" -> %s:%d: (%u:%u)\n", __func__, __LINE__,
1013 repo->bus_index, repo->dev_index); 1013 repo->bus_index, repo->dev_index);
1014 1014
1015 for (res_index = 0; res_index < 10; res_index++) { 1015 for (res_index = 0; res_index < 10; res_index++) {
@@ -1021,13 +1021,13 @@ int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
1021 1021
1022 if (result) { 1022 if (result) {
1023 if (result != LV1_NO_ENTRY) 1023 if (result != LV1_NO_ENTRY)
1024 pr_debug("%s:%d ps3_repository_read_dev_intr" 1024 pr_devel("%s:%d ps3_repository_read_dev_intr"
1025 " (%u:%u) failed\n", __func__, __LINE__, 1025 " (%u:%u) failed\n", __func__, __LINE__,
1026 repo->bus_index, repo->dev_index); 1026 repo->bus_index, repo->dev_index);
1027 break; 1027 break;
1028 } 1028 }
1029 1029
1030 pr_debug("%s:%d (%u:%u) intr_type %u, interrupt_id %u\n", 1030 pr_devel("%s:%d (%u:%u) intr_type %u, interrupt_id %u\n",
1031 __func__, __LINE__, repo->bus_index, repo->dev_index, 1031 __func__, __LINE__, repo->bus_index, repo->dev_index,
1032 intr_type, interrupt_id); 1032 intr_type, interrupt_id);
1033 } 1033 }
@@ -1042,18 +1042,18 @@ int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
1042 1042
1043 if (result) { 1043 if (result) {
1044 if (result != LV1_NO_ENTRY) 1044 if (result != LV1_NO_ENTRY)
1045 pr_debug("%s:%d ps3_repository_read_dev_reg" 1045 pr_devel("%s:%d ps3_repository_read_dev_reg"
1046 " (%u:%u) failed\n", __func__, __LINE__, 1046 " (%u:%u) failed\n", __func__, __LINE__,
1047 repo->bus_index, repo->dev_index); 1047 repo->bus_index, repo->dev_index);
1048 break; 1048 break;
1049 } 1049 }
1050 1050
1051 pr_debug("%s:%d (%u:%u) reg_type %u, bus_addr %lxh, len %lxh\n", 1051 pr_devel("%s:%d (%u:%u) reg_type %u, bus_addr %llxh, len %llxh\n",
1052 __func__, __LINE__, repo->bus_index, repo->dev_index, 1052 __func__, __LINE__, repo->bus_index, repo->dev_index,
1053 reg_type, bus_addr, len); 1053 reg_type, bus_addr, len);
1054 } 1054 }
1055 1055
1056 pr_debug(" <- %s:%d\n", __func__, __LINE__); 1056 pr_devel(" <- %s:%d\n", __func__, __LINE__);
1057 return result; 1057 return result;
1058} 1058}
1059 1059
@@ -1063,22 +1063,22 @@ static int dump_stor_dev_info(struct ps3_repository_device *repo)
1063 unsigned int num_regions, region_index; 1063 unsigned int num_regions, region_index;
1064 u64 port, blk_size, num_blocks; 1064 u64 port, blk_size, num_blocks;
1065 1065
1066 pr_debug(" -> %s:%d: (%u:%u)\n", __func__, __LINE__, 1066 pr_devel(" -> %s:%d: (%u:%u)\n", __func__, __LINE__,
1067 repo->bus_index, repo->dev_index); 1067 repo->bus_index, repo->dev_index);
1068 1068
1069 result = ps3_repository_read_stor_dev_info(repo->bus_index, 1069 result = ps3_repository_read_stor_dev_info(repo->bus_index,
1070 repo->dev_index, &port, &blk_size, &num_blocks, &num_regions); 1070 repo->dev_index, &port, &blk_size, &num_blocks, &num_regions);
1071 if (result) { 1071 if (result) {
1072 pr_debug("%s:%d ps3_repository_read_stor_dev_info" 1072 pr_devel("%s:%d ps3_repository_read_stor_dev_info"
1073 " (%u:%u) failed\n", __func__, __LINE__, 1073 " (%u:%u) failed\n", __func__, __LINE__,
1074 repo->bus_index, repo->dev_index); 1074 repo->bus_index, repo->dev_index);
1075 goto out; 1075 goto out;
1076 } 1076 }
1077 1077
1078 pr_debug("%s:%d (%u:%u): port %lu, blk_size %lu, num_blocks " 1078 pr_devel("%s:%d (%u:%u): port %llu, blk_size %llu, num_blocks "
1079 "%lu, num_regions %u\n", 1079 "%llu, num_regions %u\n",
1080 __func__, __LINE__, repo->bus_index, repo->dev_index, port, 1080 __func__, __LINE__, repo->bus_index, repo->dev_index,
1081 blk_size, num_blocks, num_regions); 1081 port, blk_size, num_blocks, num_regions);
1082 1082
1083 for (region_index = 0; region_index < num_regions; region_index++) { 1083 for (region_index = 0; region_index < num_regions; region_index++) {
1084 unsigned int region_id; 1084 unsigned int region_id;
@@ -1088,19 +1088,20 @@ static int dump_stor_dev_info(struct ps3_repository_device *repo)
1088 repo->dev_index, region_index, &region_id, 1088 repo->dev_index, region_index, &region_id,
1089 &region_start, &region_size); 1089 &region_start, &region_size);
1090 if (result) { 1090 if (result) {
1091 pr_debug("%s:%d ps3_repository_read_stor_dev_region" 1091 pr_devel("%s:%d ps3_repository_read_stor_dev_region"
1092 " (%u:%u) failed\n", __func__, __LINE__, 1092 " (%u:%u) failed\n", __func__, __LINE__,
1093 repo->bus_index, repo->dev_index); 1093 repo->bus_index, repo->dev_index);
1094 break; 1094 break;
1095 } 1095 }
1096 1096
1097 pr_debug("%s:%d (%u:%u) region_id %u, start %lxh, size %lxh\n", 1097 pr_devel("%s:%d (%u:%u) region_id %u, start %lxh, size %lxh\n",
1098 __func__, __LINE__, repo->bus_index, repo->dev_index, 1098 __func__, __LINE__, repo->bus_index, repo->dev_index,
1099 region_id, region_start, region_size); 1099 region_id, (unsigned long)region_start,
1100 (unsigned long)region_size);
1100 } 1101 }
1101 1102
1102out: 1103out:
1103 pr_debug(" <- %s:%d\n", __func__, __LINE__); 1104 pr_devel(" <- %s:%d\n", __func__, __LINE__);
1104 return result; 1105 return result;
1105} 1106}
1106 1107
@@ -1109,7 +1110,7 @@ static int dump_device_info(struct ps3_repository_device *repo,
1109{ 1110{
1110 int result = 0; 1111 int result = 0;
1111 1112
1112 pr_debug(" -> %s:%d: bus_%u\n", __func__, __LINE__, repo->bus_index); 1113 pr_devel(" -> %s:%d: bus_%u\n", __func__, __LINE__, repo->bus_index);
1113 1114
1114 for (repo->dev_index = 0; repo->dev_index < num_dev; 1115 for (repo->dev_index = 0; repo->dev_index < num_dev;
1115 repo->dev_index++) { 1116 repo->dev_index++) {
@@ -1118,7 +1119,7 @@ static int dump_device_info(struct ps3_repository_device *repo,
1118 repo->dev_index, &repo->dev_type); 1119 repo->dev_index, &repo->dev_type);
1119 1120
1120 if (result) { 1121 if (result) {
1121 pr_debug("%s:%d ps3_repository_read_dev_type" 1122 pr_devel("%s:%d ps3_repository_read_dev_type"
1122 " (%u:%u) failed\n", __func__, __LINE__, 1123 " (%u:%u) failed\n", __func__, __LINE__,
1123 repo->bus_index, repo->dev_index); 1124 repo->bus_index, repo->dev_index);
1124 break; 1125 break;
@@ -1128,15 +1129,15 @@ static int dump_device_info(struct ps3_repository_device *repo,
1128 repo->dev_index, &repo->dev_id); 1129 repo->dev_index, &repo->dev_id);
1129 1130
1130 if (result) { 1131 if (result) {
1131 pr_debug("%s:%d ps3_repository_read_dev_id" 1132 pr_devel("%s:%d ps3_repository_read_dev_id"
1132 " (%u:%u) failed\n", __func__, __LINE__, 1133 " (%u:%u) failed\n", __func__, __LINE__,
1133 repo->bus_index, repo->dev_index); 1134 repo->bus_index, repo->dev_index);
1134 continue; 1135 continue;
1135 } 1136 }
1136 1137
1137 pr_debug("%s:%d (%u:%u): dev_type %u, dev_id %lu\n", __func__, 1138 pr_devel("%s:%d (%u:%u): dev_type %u, dev_id %lu\n", __func__,
1138 __LINE__, repo->bus_index, repo->dev_index, 1139 __LINE__, repo->bus_index, repo->dev_index,
1139 repo->dev_type, repo->dev_id); 1140 repo->dev_type, (unsigned long)repo->dev_id);
1140 1141
1141 ps3_repository_dump_resource_info(repo); 1142 ps3_repository_dump_resource_info(repo);
1142 1143
@@ -1144,7 +1145,7 @@ static int dump_device_info(struct ps3_repository_device *repo,
1144 dump_stor_dev_info(repo); 1145 dump_stor_dev_info(repo);
1145 } 1146 }
1146 1147
1147 pr_debug(" <- %s:%d\n", __func__, __LINE__); 1148 pr_devel(" <- %s:%d\n", __func__, __LINE__);
1148 return result; 1149 return result;
1149} 1150}
1150 1151
@@ -1153,7 +1154,7 @@ int ps3_repository_dump_bus_info(void)
1153 int result = 0; 1154 int result = 0;
1154 struct ps3_repository_device repo; 1155 struct ps3_repository_device repo;
1155 1156
1156 pr_debug(" -> %s:%d\n", __func__, __LINE__); 1157 pr_devel(" -> %s:%d\n", __func__, __LINE__);
1157 1158
1158 memset(&repo, 0, sizeof(repo)); 1159 memset(&repo, 0, sizeof(repo));
1159 1160
@@ -1164,7 +1165,7 @@ int ps3_repository_dump_bus_info(void)
1164 &repo.bus_type); 1165 &repo.bus_type);
1165 1166
1166 if (result) { 1167 if (result) {
1167 pr_debug("%s:%d read_bus_type(%u) failed\n", 1168 pr_devel("%s:%d read_bus_type(%u) failed\n",
1168 __func__, __LINE__, repo.bus_index); 1169 __func__, __LINE__, repo.bus_index);
1169 break; 1170 break;
1170 } 1171 }
@@ -1173,32 +1174,32 @@ int ps3_repository_dump_bus_info(void)
1173 &repo.bus_id); 1174 &repo.bus_id);
1174 1175
1175 if (result) { 1176 if (result) {
1176 pr_debug("%s:%d read_bus_id(%u) failed\n", 1177 pr_devel("%s:%d read_bus_id(%u) failed\n",
1177 __func__, __LINE__, repo.bus_index); 1178 __func__, __LINE__, repo.bus_index);
1178 continue; 1179 continue;
1179 } 1180 }
1180 1181
1181 if (repo.bus_index != repo.bus_id) 1182 if (repo.bus_index != repo.bus_id)
1182 pr_debug("%s:%d bus_index != bus_id\n", 1183 pr_devel("%s:%d bus_index != bus_id\n",
1183 __func__, __LINE__); 1184 __func__, __LINE__);
1184 1185
1185 result = ps3_repository_read_bus_num_dev(repo.bus_index, 1186 result = ps3_repository_read_bus_num_dev(repo.bus_index,
1186 &num_dev); 1187 &num_dev);
1187 1188
1188 if (result) { 1189 if (result) {
1189 pr_debug("%s:%d read_bus_num_dev(%u) failed\n", 1190 pr_devel("%s:%d read_bus_num_dev(%u) failed\n",
1190 __func__, __LINE__, repo.bus_index); 1191 __func__, __LINE__, repo.bus_index);
1191 continue; 1192 continue;
1192 } 1193 }
1193 1194
1194 pr_debug("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n", 1195 pr_devel("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n",
1195 __func__, __LINE__, repo.bus_index, repo.bus_type, 1196 __func__, __LINE__, repo.bus_index, repo.bus_type,
1196 repo.bus_id, num_dev); 1197 (unsigned long)repo.bus_id, num_dev);
1197 1198
1198 dump_device_info(&repo, num_dev); 1199 dump_device_info(&repo, num_dev);
1199 } 1200 }
1200 1201
1201 pr_debug(" <- %s:%d\n", __func__, __LINE__); 1202 pr_devel(" <- %s:%d\n", __func__, __LINE__);
1202 return result; 1203 return result;
1203} 1204}
1204 1205
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index e8ec1b2bfffd..2d664c5a83b0 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -193,10 +193,12 @@ static int ps3_set_dabr(unsigned long dabr)
193 193
194static void __init ps3_setup_arch(void) 194static void __init ps3_setup_arch(void)
195{ 195{
196 u64 tmp;
196 197
197 DBG(" -> %s:%d\n", __func__, __LINE__); 198 DBG(" -> %s:%d\n", __func__, __LINE__);
198 199
199 lv1_get_version_info(&ps3_firmware_version.raw); 200 lv1_get_version_info(&ps3_firmware_version.raw, &tmp);
201
200 printk(KERN_INFO "PS3 firmware version %u.%u.%u\n", 202 printk(KERN_INFO "PS3 firmware version %u.%u.%u\n",
201 ps3_firmware_version.major, ps3_firmware_version.minor, 203 ps3_firmware_version.major, ps3_firmware_version.minor,
202 ps3_firmware_version.rev); 204 ps3_firmware_version.rev);
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index 4c44794faac0..4b35166229fe 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -57,48 +57,51 @@ static void ps3_smp_message_pass(int cpu, int msg)
57 " (%d)\n", __func__, __LINE__, cpu, msg, result); 57 " (%d)\n", __func__, __LINE__, cpu, msg, result);
58} 58}
59 59
60static int ps3_smp_probe(void) 60static int __init ps3_smp_probe(void)
61{ 61{
62 return 2; 62 int cpu;
63}
64 63
65static void __init ps3_smp_setup_cpu(int cpu) 64 for (cpu = 0; cpu < 2; cpu++) {
66{ 65 int result;
67 int result; 66 unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu);
68 unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu); 67 int i;
69 int i;
70 68
71 DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); 69 DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu);
72 70
73 /* 71 /*
74 * Check assumptions on ps3_ipi_virqs[] indexing. If this 72 * Check assumptions on ps3_ipi_virqs[] indexing. If this
75 * check fails, then a different mapping of PPC_MSG_ 73 * check fails, then a different mapping of PPC_MSG_
76 * to index needs to be setup. 74 * to index needs to be setup.
77 */ 75 */
78 76
79 BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0); 77 BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0);
80 BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1); 78 BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1);
81 BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2); 79 BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2);
82 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); 80 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
83 81
84 for (i = 0; i < MSG_COUNT; i++) { 82 for (i = 0; i < MSG_COUNT; i++) {
85 result = ps3_event_receive_port_setup(cpu, &virqs[i]); 83 result = ps3_event_receive_port_setup(cpu, &virqs[i]);
86 84
87 if (result) 85 if (result)
88 continue; 86 continue;
89 87
90 DBG("%s:%d: (%d, %d) => virq %u\n", 88 DBG("%s:%d: (%d, %d) => virq %u\n",
91 __func__, __LINE__, cpu, i, virqs[i]); 89 __func__, __LINE__, cpu, i, virqs[i]);
92 90
93 result = smp_request_message_ipi(virqs[i], i); 91 result = smp_request_message_ipi(virqs[i], i);
94 92
95 if (result) 93 if (result)
96 virqs[i] = NO_IRQ; 94 virqs[i] = NO_IRQ;
97 } 95 else
96 ps3_register_ipi_irq(cpu, virqs[i]);
97 }
98 98
99 ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]); 99 ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]);
100 100
101 DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); 101 DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu);
102 }
103
104 return 2;
102} 105}
103 106
104void ps3_smp_cleanup_cpu(int cpu) 107void ps3_smp_cleanup_cpu(int cpu)
@@ -121,7 +124,6 @@ static struct smp_ops_t ps3_smp_ops = {
121 .probe = ps3_smp_probe, 124 .probe = ps3_smp_probe,
122 .message_pass = ps3_smp_message_pass, 125 .message_pass = ps3_smp_message_pass,
123 .kick_cpu = smp_generic_kick_cpu, 126 .kick_cpu = smp_generic_kick_cpu,
124 .setup_cpu = ps3_smp_setup_cpu,
125}; 127};
126 128
127void smp_init_ps3(void) 129void smp_init_ps3(void)
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index 451fad1c92a8..e17fa1432d80 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -154,7 +154,7 @@ static unsigned long get_vas_id(void)
154 u64 id; 154 u64 id;
155 155
156 lv1_get_logical_ppe_id(&id); 156 lv1_get_logical_ppe_id(&id);
157 lv1_get_virtual_address_space_id_of_ppe(id, &id); 157 lv1_get_virtual_address_space_id_of_ppe(&id);
158 158
159 return id; 159 return id;
160} 160}
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index c81f6bb9c10f..ae7b6d41fed3 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -120,3 +120,12 @@ config DTL
120 which are accessible through a debugfs file. 120 which are accessible through a debugfs file.
121 121
122 Say N if you are unsure. 122 Say N if you are unsure.
123
124config PSERIES_IDLE
125 tristate "Cpuidle driver for pSeries platforms"
126 depends on CPU_IDLE
127 depends on PPC_PSERIES
128 default y
129 help
130 Select this option to enable processor idle state management
131 through cpuidle subsystem.
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 3556e402cbf5..236db46b4078 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_PHYP_DUMP) += phyp_dump.o
22obj-$(CONFIG_CMM) += cmm.o 22obj-$(CONFIG_CMM) += cmm.o
23obj-$(CONFIG_DTL) += dtl.o 23obj-$(CONFIG_DTL) += dtl.o
24obj-$(CONFIG_IO_EVENT_IRQ) += io_event_irq.o 24obj-$(CONFIG_IO_EVENT_IRQ) += io_event_irq.o
25obj-$(CONFIG_PSERIES_IDLE) += processor_idle.o
25 26
26ifeq ($(CONFIG_PPC_PSERIES),y) 27ifeq ($(CONFIG_PPC_PSERIES),y)
27obj-$(CONFIG_SUSPEND) += suspend.o 28obj-$(CONFIG_SUSPEND) += suspend.o
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 3cafc306b971..c638535753df 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -33,7 +33,7 @@
33#include <linux/sched.h> 33#include <linux/sched.h>
34#include <linux/stringify.h> 34#include <linux/stringify.h>
35#include <linux/swap.h> 35#include <linux/swap.h>
36#include <linux/sysdev.h> 36#include <linux/device.h>
37#include <asm/firmware.h> 37#include <asm/firmware.h>
38#include <asm/hvcall.h> 38#include <asm/hvcall.h>
39#include <asm/mmu.h> 39#include <asm/mmu.h>
@@ -65,7 +65,7 @@ static unsigned int oom_kb = CMM_OOM_KB;
65static unsigned int cmm_debug = CMM_DEBUG; 65static unsigned int cmm_debug = CMM_DEBUG;
66static unsigned int cmm_disabled = CMM_DISABLE; 66static unsigned int cmm_disabled = CMM_DISABLE;
67static unsigned long min_mem_mb = CMM_MIN_MEM_MB; 67static unsigned long min_mem_mb = CMM_MIN_MEM_MB;
68static struct sys_device cmm_sysdev; 68static struct device cmm_dev;
69 69
70MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>"); 70MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>");
71MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager"); 71MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager");
@@ -347,25 +347,25 @@ static int cmm_thread(void *dummy)
347} 347}
348 348
349#define CMM_SHOW(name, format, args...) \ 349#define CMM_SHOW(name, format, args...) \
350 static ssize_t show_##name(struct sys_device *dev, \ 350 static ssize_t show_##name(struct device *dev, \
351 struct sysdev_attribute *attr, \ 351 struct device_attribute *attr, \
352 char *buf) \ 352 char *buf) \
353 { \ 353 { \
354 return sprintf(buf, format, ##args); \ 354 return sprintf(buf, format, ##args); \
355 } \ 355 } \
356 static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) 356 static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
357 357
358CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages)); 358CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages));
359CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target)); 359CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target));
360 360
361static ssize_t show_oom_pages(struct sys_device *dev, 361static ssize_t show_oom_pages(struct device *dev,
362 struct sysdev_attribute *attr, char *buf) 362 struct device_attribute *attr, char *buf)
363{ 363{
364 return sprintf(buf, "%lu\n", PAGES2KB(oom_freed_pages)); 364 return sprintf(buf, "%lu\n", PAGES2KB(oom_freed_pages));
365} 365}
366 366
367static ssize_t store_oom_pages(struct sys_device *dev, 367static ssize_t store_oom_pages(struct device *dev,
368 struct sysdev_attribute *attr, 368 struct device_attribute *attr,
369 const char *buf, size_t count) 369 const char *buf, size_t count)
370{ 370{
371 unsigned long val = simple_strtoul (buf, NULL, 10); 371 unsigned long val = simple_strtoul (buf, NULL, 10);
@@ -379,17 +379,18 @@ static ssize_t store_oom_pages(struct sys_device *dev,
379 return count; 379 return count;
380} 380}
381 381
382static SYSDEV_ATTR(oom_freed_kb, S_IWUSR| S_IRUGO, 382static DEVICE_ATTR(oom_freed_kb, S_IWUSR | S_IRUGO,
383 show_oom_pages, store_oom_pages); 383 show_oom_pages, store_oom_pages);
384 384
385static struct sysdev_attribute *cmm_attrs[] = { 385static struct device_attribute *cmm_attrs[] = {
386 &attr_loaned_kb, 386 &dev_attr_loaned_kb,
387 &attr_loaned_target_kb, 387 &dev_attr_loaned_target_kb,
388 &attr_oom_freed_kb, 388 &dev_attr_oom_freed_kb,
389}; 389};
390 390
391static struct sysdev_class cmm_sysdev_class = { 391static struct bus_type cmm_subsys = {
392 .name = "cmm", 392 .name = "cmm",
393 .dev_name = "cmm",
393}; 394};
394 395
395/** 396/**
@@ -398,21 +399,21 @@ static struct sysdev_class cmm_sysdev_class = {
398 * Return value: 399 * Return value:
399 * 0 on success / other on failure 400 * 0 on success / other on failure
400 **/ 401 **/
401static int cmm_sysfs_register(struct sys_device *sysdev) 402static int cmm_sysfs_register(struct device *dev)
402{ 403{
403 int i, rc; 404 int i, rc;
404 405
405 if ((rc = sysdev_class_register(&cmm_sysdev_class))) 406 if ((rc = subsys_system_register(&cmm_subsys, NULL)))
406 return rc; 407 return rc;
407 408
408 sysdev->id = 0; 409 dev->id = 0;
409 sysdev->cls = &cmm_sysdev_class; 410 dev->bus = &cmm_subsys;
410 411
411 if ((rc = sysdev_register(sysdev))) 412 if ((rc = device_register(dev)))
412 goto class_unregister; 413 goto subsys_unregister;
413 414
414 for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) { 415 for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) {
415 if ((rc = sysdev_create_file(sysdev, cmm_attrs[i]))) 416 if ((rc = device_create_file(dev, cmm_attrs[i])))
416 goto fail; 417 goto fail;
417 } 418 }
418 419
@@ -420,10 +421,10 @@ static int cmm_sysfs_register(struct sys_device *sysdev)
420 421
421fail: 422fail:
422 while (--i >= 0) 423 while (--i >= 0)
423 sysdev_remove_file(sysdev, cmm_attrs[i]); 424 device_remove_file(dev, cmm_attrs[i]);
424 sysdev_unregister(sysdev); 425 device_unregister(dev);
425class_unregister: 426subsys_unregister:
426 sysdev_class_unregister(&cmm_sysdev_class); 427 bus_unregister(&cmm_subsys);
427 return rc; 428 return rc;
428} 429}
429 430
@@ -431,14 +432,14 @@ class_unregister:
431 * cmm_unregister_sysfs - Unregister from sysfs 432 * cmm_unregister_sysfs - Unregister from sysfs
432 * 433 *
433 **/ 434 **/
434static void cmm_unregister_sysfs(struct sys_device *sysdev) 435static void cmm_unregister_sysfs(struct device *dev)
435{ 436{
436 int i; 437 int i;
437 438
438 for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) 439 for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++)
439 sysdev_remove_file(sysdev, cmm_attrs[i]); 440 device_remove_file(dev, cmm_attrs[i]);
440 sysdev_unregister(sysdev); 441 device_unregister(dev);
441 sysdev_class_unregister(&cmm_sysdev_class); 442 bus_unregister(&cmm_subsys);
442} 443}
443 444
444/** 445/**
@@ -657,7 +658,7 @@ static int cmm_init(void)
657 if ((rc = register_reboot_notifier(&cmm_reboot_nb))) 658 if ((rc = register_reboot_notifier(&cmm_reboot_nb)))
658 goto out_oom_notifier; 659 goto out_oom_notifier;
659 660
660 if ((rc = cmm_sysfs_register(&cmm_sysdev))) 661 if ((rc = cmm_sysfs_register(&cmm_dev)))
661 goto out_reboot_notifier; 662 goto out_reboot_notifier;
662 663
663 if (register_memory_notifier(&cmm_mem_nb) || 664 if (register_memory_notifier(&cmm_mem_nb) ||
@@ -678,7 +679,7 @@ static int cmm_init(void)
678out_unregister_notifier: 679out_unregister_notifier:
679 unregister_memory_notifier(&cmm_mem_nb); 680 unregister_memory_notifier(&cmm_mem_nb);
680 unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); 681 unregister_memory_isolate_notifier(&cmm_mem_isolate_nb);
681 cmm_unregister_sysfs(&cmm_sysdev); 682 cmm_unregister_sysfs(&cmm_dev);
682out_reboot_notifier: 683out_reboot_notifier:
683 unregister_reboot_notifier(&cmm_reboot_nb); 684 unregister_reboot_notifier(&cmm_reboot_nb);
684out_oom_notifier: 685out_oom_notifier:
@@ -701,7 +702,7 @@ static void cmm_exit(void)
701 unregister_memory_notifier(&cmm_mem_nb); 702 unregister_memory_notifier(&cmm_mem_nb);
702 unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); 703 unregister_memory_isolate_notifier(&cmm_mem_isolate_nb);
703 cmm_free_pages(loaned_pages); 704 cmm_free_pages(loaned_pages);
704 cmm_unregister_sysfs(&cmm_sysdev); 705 cmm_unregister_sysfs(&cmm_dev);
705} 706}
706 707
707/** 708/**
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index f106662f4381..c9311cfdfcac 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -109,7 +109,7 @@ static void probe_hcall_entry(void *ignored, unsigned long opcode, unsigned long
109 if (opcode > MAX_HCALL_OPCODE) 109 if (opcode > MAX_HCALL_OPCODE)
110 return; 110 return;
111 111
112 h = &get_cpu_var(hcall_stats)[opcode / 4]; 112 h = &__get_cpu_var(hcall_stats)[opcode / 4];
113 h->tb_start = mftb(); 113 h->tb_start = mftb();
114 h->purr_start = mfspr(SPRN_PURR); 114 h->purr_start = mfspr(SPRN_PURR);
115} 115}
@@ -126,8 +126,6 @@ static void probe_hcall_exit(void *ignored, unsigned long opcode, unsigned long
126 h->num_calls++; 126 h->num_calls++;
127 h->tb_total += mftb() - h->tb_start; 127 h->tb_total += mftb() - h->tb_start;
128 h->purr_total += mfspr(SPRN_PURR) - h->purr_start; 128 h->purr_total += mfspr(SPRN_PURR) - h->purr_start;
129
130 put_cpu_var(hcall_stats);
131} 129}
132 130
133static int __init hcall_inst_init(void) 131static int __init hcall_inst_init(void)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index b719d9709730..c442f2b1980f 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -52,13 +52,42 @@
52#include "plpar_wrappers.h" 52#include "plpar_wrappers.h"
53 53
54 54
55static void tce_invalidate_pSeries_sw(struct iommu_table *tbl,
56 u64 *startp, u64 *endp)
57{
58 u64 __iomem *invalidate = (u64 __iomem *)tbl->it_index;
59 unsigned long start, end, inc;
60
61 start = __pa(startp);
62 end = __pa(endp);
63 inc = L1_CACHE_BYTES; /* invalidate a cacheline of TCEs at a time */
64
65 /* If this is non-zero, change the format. We shift the
66 * address and or in the magic from the device tree. */
67 if (tbl->it_busno) {
68 start <<= 12;
69 end <<= 12;
70 inc <<= 12;
71 start |= tbl->it_busno;
72 end |= tbl->it_busno;
73 }
74
75 end |= inc - 1; /* round up end to be different than start */
76
77 mb(); /* Make sure TCEs in memory are written */
78 while (start <= end) {
79 out_be64(invalidate, start);
80 start += inc;
81 }
82}
83
55static int tce_build_pSeries(struct iommu_table *tbl, long index, 84static int tce_build_pSeries(struct iommu_table *tbl, long index,
56 long npages, unsigned long uaddr, 85 long npages, unsigned long uaddr,
57 enum dma_data_direction direction, 86 enum dma_data_direction direction,
58 struct dma_attrs *attrs) 87 struct dma_attrs *attrs)
59{ 88{
60 u64 proto_tce; 89 u64 proto_tce;
61 u64 *tcep; 90 u64 *tcep, *tces;
62 u64 rpn; 91 u64 rpn;
63 92
64 proto_tce = TCE_PCI_READ; // Read allowed 93 proto_tce = TCE_PCI_READ; // Read allowed
@@ -66,7 +95,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
66 if (direction != DMA_TO_DEVICE) 95 if (direction != DMA_TO_DEVICE)
67 proto_tce |= TCE_PCI_WRITE; 96 proto_tce |= TCE_PCI_WRITE;
68 97
69 tcep = ((u64 *)tbl->it_base) + index; 98 tces = tcep = ((u64 *)tbl->it_base) + index;
70 99
71 while (npages--) { 100 while (npages--) {
72 /* can't move this out since we might cross MEMBLOCK boundary */ 101 /* can't move this out since we might cross MEMBLOCK boundary */
@@ -76,18 +105,24 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
76 uaddr += TCE_PAGE_SIZE; 105 uaddr += TCE_PAGE_SIZE;
77 tcep++; 106 tcep++;
78 } 107 }
108
109 if (tbl->it_type == TCE_PCI_SWINV_CREATE)
110 tce_invalidate_pSeries_sw(tbl, tces, tcep - 1);
79 return 0; 111 return 0;
80} 112}
81 113
82 114
83static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages) 115static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
84{ 116{
85 u64 *tcep; 117 u64 *tcep, *tces;
86 118
87 tcep = ((u64 *)tbl->it_base) + index; 119 tces = tcep = ((u64 *)tbl->it_base) + index;
88 120
89 while (npages--) 121 while (npages--)
90 *(tcep++) = 0; 122 *(tcep++) = 0;
123
124 if (tbl->it_type == TCE_PCI_SWINV_FREE)
125 tce_invalidate_pSeries_sw(tbl, tces, tcep - 1);
91} 126}
92 127
93static unsigned long tce_get_pseries(struct iommu_table *tbl, long index) 128static unsigned long tce_get_pseries(struct iommu_table *tbl, long index)
@@ -425,7 +460,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
425 struct iommu_table *tbl) 460 struct iommu_table *tbl)
426{ 461{
427 struct device_node *node; 462 struct device_node *node;
428 const unsigned long *basep; 463 const unsigned long *basep, *sw_inval;
429 const u32 *sizep; 464 const u32 *sizep;
430 465
431 node = phb->dn; 466 node = phb->dn;
@@ -462,6 +497,22 @@ static void iommu_table_setparms(struct pci_controller *phb,
462 tbl->it_index = 0; 497 tbl->it_index = 0;
463 tbl->it_blocksize = 16; 498 tbl->it_blocksize = 16;
464 tbl->it_type = TCE_PCI; 499 tbl->it_type = TCE_PCI;
500
501 sw_inval = of_get_property(node, "linux,tce-sw-invalidate-info", NULL);
502 if (sw_inval) {
503 /*
504 * This property contains information on how to
505 * invalidate the TCE entry. The first property is
506 * the base MMIO address used to invalidate entries.
507 * The second property tells us the format of the TCE
508 * invalidate (whether it needs to be shifted) and
509 * some magic routing info to add to our invalidate
510 * command.
511 */
512 tbl->it_index = (unsigned long) ioremap(sw_inval[0], 8);
513 tbl->it_busno = sw_inval[1]; /* overload this with magic */
514 tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
515 }
465} 516}
466 517
467/* 518/*
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 27a49508b410..948e0e3b3547 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -554,7 +554,10 @@ void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
554 goto out; 554 goto out;
555 555
556 (*depth)++; 556 (*depth)++;
557 preempt_disable();
557 trace_hcall_entry(opcode, args); 558 trace_hcall_entry(opcode, args);
559 if (opcode == H_CEDE)
560 rcu_idle_enter();
558 (*depth)--; 561 (*depth)--;
559 562
560out: 563out:
@@ -575,7 +578,10 @@ void __trace_hcall_exit(long opcode, unsigned long retval,
575 goto out; 578 goto out;
576 579
577 (*depth)++; 580 (*depth)++;
581 if (opcode == H_CEDE)
582 rcu_idle_exit();
578 trace_hcall_exit(opcode, retval, retbuf); 583 trace_hcall_exit(opcode, retval, retbuf);
584 preempt_enable();
579 (*depth)--; 585 (*depth)--;
580 586
581out: 587out:
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index a76b22844d18..330a57b7c17c 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -625,6 +625,8 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
625{ 625{
626 static unsigned int oops_count = 0; 626 static unsigned int oops_count = 0;
627 static bool panicking = false; 627 static bool panicking = false;
628 static DEFINE_SPINLOCK(lock);
629 unsigned long flags;
628 size_t text_len; 630 size_t text_len;
629 unsigned int err_type = ERR_TYPE_KERNEL_PANIC_GZ; 631 unsigned int err_type = ERR_TYPE_KERNEL_PANIC_GZ;
630 int rc = -1; 632 int rc = -1;
@@ -655,6 +657,9 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
655 if (clobbering_unread_rtas_event()) 657 if (clobbering_unread_rtas_event())
656 return; 658 return;
657 659
660 if (!spin_trylock_irqsave(&lock, flags))
661 return;
662
658 if (big_oops_buf) { 663 if (big_oops_buf) {
659 text_len = capture_last_msgs(old_msgs, old_len, 664 text_len = capture_last_msgs(old_msgs, old_len,
660 new_msgs, new_len, big_oops_buf, big_oops_buf_sz); 665 new_msgs, new_len, big_oops_buf, big_oops_buf_sz);
@@ -670,4 +675,6 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
670 675
671 (void) nvram_write_os_partition(&oops_log_partition, oops_buf, 676 (void) nvram_write_os_partition(&oops_log_partition, oops_buf,
672 (int) (sizeof(*oops_len) + *oops_len), err_type, ++oops_count); 677 (int) (sizeof(*oops_len) + *oops_len), err_type, ++oops_count);
678
679 spin_unlock_irqrestore(&lock, flags);
673} 680}
diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
new file mode 100644
index 000000000000..085fd3f45ad2
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/processor_idle.c
@@ -0,0 +1,329 @@
1/*
2 * processor_idle - idle state cpuidle driver.
3 * Adapted from drivers/idle/intel_idle.c and
4 * drivers/acpi/processor_idle.c
5 *
6 */
7
8#include <linux/kernel.h>
9#include <linux/module.h>
10#include <linux/init.h>
11#include <linux/moduleparam.h>
12#include <linux/cpuidle.h>
13#include <linux/cpu.h>
14
15#include <asm/paca.h>
16#include <asm/reg.h>
17#include <asm/system.h>
18#include <asm/machdep.h>
19#include <asm/firmware.h>
20
21#include "plpar_wrappers.h"
22#include "pseries.h"
23
24struct cpuidle_driver pseries_idle_driver = {
25 .name = "pseries_idle",
26 .owner = THIS_MODULE,
27};
28
29#define MAX_IDLE_STATE_COUNT 2
30
31static int max_idle_state = MAX_IDLE_STATE_COUNT - 1;
32static struct cpuidle_device __percpu *pseries_cpuidle_devices;
33static struct cpuidle_state *cpuidle_state_table;
34
35void update_smt_snooze_delay(int snooze)
36{
37 struct cpuidle_driver *drv = cpuidle_get_driver();
38 if (drv)
39 drv->states[0].target_residency = snooze;
40}
41
42static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before)
43{
44
45 *kt_before = ktime_get_real();
46 *in_purr = mfspr(SPRN_PURR);
47 /*
48 * Indicate to the HV that we are idle. Now would be
49 * a good time to find other work to dispatch.
50 */
51 get_lppaca()->idle = 1;
52}
53
54static inline s64 idle_loop_epilog(unsigned long in_purr, ktime_t kt_before)
55{
56 get_lppaca()->wait_state_cycles += mfspr(SPRN_PURR) - in_purr;
57 get_lppaca()->idle = 0;
58
59 return ktime_to_us(ktime_sub(ktime_get_real(), kt_before));
60}
61
62static int snooze_loop(struct cpuidle_device *dev,
63 struct cpuidle_driver *drv,
64 int index)
65{
66 unsigned long in_purr;
67 ktime_t kt_before;
68 unsigned long start_snooze;
69 long snooze = drv->states[0].target_residency;
70
71 idle_loop_prolog(&in_purr, &kt_before);
72
73 if (snooze) {
74 start_snooze = get_tb() + snooze * tb_ticks_per_usec;
75 local_irq_enable();
76 set_thread_flag(TIF_POLLING_NRFLAG);
77
78 while ((snooze < 0) || (get_tb() < start_snooze)) {
79 if (need_resched() || cpu_is_offline(dev->cpu))
80 goto out;
81 ppc64_runlatch_off();
82 HMT_low();
83 HMT_very_low();
84 }
85
86 HMT_medium();
87 clear_thread_flag(TIF_POLLING_NRFLAG);
88 smp_mb();
89 local_irq_disable();
90 }
91
92out:
93 HMT_medium();
94 dev->last_residency =
95 (int)idle_loop_epilog(in_purr, kt_before);
96 return index;
97}
98
99static int dedicated_cede_loop(struct cpuidle_device *dev,
100 struct cpuidle_driver *drv,
101 int index)
102{
103 unsigned long in_purr;
104 ktime_t kt_before;
105
106 idle_loop_prolog(&in_purr, &kt_before);
107 get_lppaca()->donate_dedicated_cpu = 1;
108
109 ppc64_runlatch_off();
110 HMT_medium();
111 cede_processor();
112
113 get_lppaca()->donate_dedicated_cpu = 0;
114 dev->last_residency =
115 (int)idle_loop_epilog(in_purr, kt_before);
116 return index;
117}
118
119static int shared_cede_loop(struct cpuidle_device *dev,
120 struct cpuidle_driver *drv,
121 int index)
122{
123 unsigned long in_purr;
124 ktime_t kt_before;
125
126 idle_loop_prolog(&in_purr, &kt_before);
127
128 /*
129 * Yield the processor to the hypervisor. We return if
130 * an external interrupt occurs (which are driven prior
131 * to returning here) or if a prod occurs from another
132 * processor. When returning here, external interrupts
133 * are enabled.
134 */
135 cede_processor();
136
137 dev->last_residency =
138 (int)idle_loop_epilog(in_purr, kt_before);
139 return index;
140}
141
142/*
143 * States for dedicated partition case.
144 */
145static struct cpuidle_state dedicated_states[MAX_IDLE_STATE_COUNT] = {
146 { /* Snooze */
147 .name = "snooze",
148 .desc = "snooze",
149 .flags = CPUIDLE_FLAG_TIME_VALID,
150 .exit_latency = 0,
151 .target_residency = 0,
152 .enter = &snooze_loop },
153 { /* CEDE */
154 .name = "CEDE",
155 .desc = "CEDE",
156 .flags = CPUIDLE_FLAG_TIME_VALID,
157 .exit_latency = 1,
158 .target_residency = 10,
159 .enter = &dedicated_cede_loop },
160};
161
162/*
163 * States for shared partition case.
164 */
165static struct cpuidle_state shared_states[MAX_IDLE_STATE_COUNT] = {
166 { /* Shared Cede */
167 .name = "Shared Cede",
168 .desc = "Shared Cede",
169 .flags = CPUIDLE_FLAG_TIME_VALID,
170 .exit_latency = 0,
171 .target_residency = 0,
172 .enter = &shared_cede_loop },
173};
174
175int pseries_notify_cpuidle_add_cpu(int cpu)
176{
177 struct cpuidle_device *dev =
178 per_cpu_ptr(pseries_cpuidle_devices, cpu);
179 if (dev && cpuidle_get_driver()) {
180 cpuidle_disable_device(dev);
181 cpuidle_enable_device(dev);
182 }
183 return 0;
184}
185
186/*
187 * pseries_cpuidle_driver_init()
188 */
189static int pseries_cpuidle_driver_init(void)
190{
191 int idle_state;
192 struct cpuidle_driver *drv = &pseries_idle_driver;
193
194 drv->state_count = 0;
195
196 for (idle_state = 0; idle_state < MAX_IDLE_STATE_COUNT; ++idle_state) {
197
198 if (idle_state > max_idle_state)
199 break;
200
201 /* is the state not enabled? */
202 if (cpuidle_state_table[idle_state].enter == NULL)
203 continue;
204
205 drv->states[drv->state_count] = /* structure copy */
206 cpuidle_state_table[idle_state];
207
208 if (cpuidle_state_table == dedicated_states)
209 drv->states[drv->state_count].target_residency =
210 __get_cpu_var(smt_snooze_delay);
211
212 drv->state_count += 1;
213 }
214
215 return 0;
216}
217
218/* pseries_idle_devices_uninit(void)
219 * unregister cpuidle devices and de-allocate memory
220 */
221static void pseries_idle_devices_uninit(void)
222{
223 int i;
224 struct cpuidle_device *dev;
225
226 for_each_possible_cpu(i) {
227 dev = per_cpu_ptr(pseries_cpuidle_devices, i);
228 cpuidle_unregister_device(dev);
229 }
230
231 free_percpu(pseries_cpuidle_devices);
232 return;
233}
234
235/* pseries_idle_devices_init()
236 * allocate, initialize and register cpuidle device
237 */
238static int pseries_idle_devices_init(void)
239{
240 int i;
241 struct cpuidle_driver *drv = &pseries_idle_driver;
242 struct cpuidle_device *dev;
243
244 pseries_cpuidle_devices = alloc_percpu(struct cpuidle_device);
245 if (pseries_cpuidle_devices == NULL)
246 return -ENOMEM;
247
248 for_each_possible_cpu(i) {
249 dev = per_cpu_ptr(pseries_cpuidle_devices, i);
250 dev->state_count = drv->state_count;
251 dev->cpu = i;
252 if (cpuidle_register_device(dev)) {
253 printk(KERN_DEBUG \
254 "cpuidle_register_device %d failed!\n", i);
255 return -EIO;
256 }
257 }
258
259 return 0;
260}
261
262/*
263 * pseries_idle_probe()
264 * Choose state table for shared versus dedicated partition
265 */
266static int pseries_idle_probe(void)
267{
268
269 if (!firmware_has_feature(FW_FEATURE_SPLPAR))
270 return -ENODEV;
271
272 if (cpuidle_disable != IDLE_NO_OVERRIDE)
273 return -ENODEV;
274
275 if (max_idle_state == 0) {
276 printk(KERN_DEBUG "pseries processor idle disabled.\n");
277 return -EPERM;
278 }
279
280 if (get_lppaca()->shared_proc)
281 cpuidle_state_table = shared_states;
282 else
283 cpuidle_state_table = dedicated_states;
284
285 return 0;
286}
287
288static int __init pseries_processor_idle_init(void)
289{
290 int retval;
291
292 retval = pseries_idle_probe();
293 if (retval)
294 return retval;
295
296 pseries_cpuidle_driver_init();
297 retval = cpuidle_register_driver(&pseries_idle_driver);
298 if (retval) {
299 printk(KERN_DEBUG "Registration of pseries driver failed.\n");
300 return retval;
301 }
302
303 retval = pseries_idle_devices_init();
304 if (retval) {
305 pseries_idle_devices_uninit();
306 cpuidle_unregister_driver(&pseries_idle_driver);
307 return retval;
308 }
309
310 printk(KERN_DEBUG "pseries_idle_driver registered\n");
311
312 return 0;
313}
314
315static void __exit pseries_processor_idle_exit(void)
316{
317
318 pseries_idle_devices_uninit();
319 cpuidle_unregister_driver(&pseries_idle_driver);
320
321 return;
322}
323
324module_init(pseries_processor_idle_init);
325module_exit(pseries_processor_idle_exit);
326
327MODULE_AUTHOR("Deepthi Dharwar <deepthi@linux.vnet.ibm.com>");
328MODULE_DESCRIPTION("Cpuidle driver for POWER");
329MODULE_LICENSE("GPL");
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 24c7162f11d9..9a3dda07566f 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -57,4 +57,7 @@ extern struct device_node *dlpar_configure_connector(u32);
57extern int dlpar_attach_node(struct device_node *); 57extern int dlpar_attach_node(struct device_node *);
58extern int dlpar_detach_node(struct device_node *); 58extern int dlpar_detach_node(struct device_node *);
59 59
60/* Snooze Delay, pseries_idle */
61DECLARE_PER_CPU(long, smt_snooze_delay);
62
60#endif /* _PSERIES_PSERIES_H */ 63#endif /* _PSERIES_PSERIES_H */
diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
index c8b3c69fe891..af281dce510a 100644
--- a/arch/powerpc/platforms/pseries/pseries_energy.c
+++ b/arch/powerpc/platforms/pseries/pseries_energy.c
@@ -15,7 +15,7 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/seq_file.h> 17#include <linux/seq_file.h>
18#include <linux/sysdev.h> 18#include <linux/device.h>
19#include <linux/cpu.h> 19#include <linux/cpu.h>
20#include <linux/of.h> 20#include <linux/of.h>
21#include <asm/cputhreads.h> 21#include <asm/cputhreads.h>
@@ -184,7 +184,7 @@ static ssize_t get_best_energy_list(char *page, int activate)
184 return s-page; 184 return s-page;
185} 185}
186 186
187static ssize_t get_best_energy_data(struct sys_device *dev, 187static ssize_t get_best_energy_data(struct device *dev,
188 char *page, int activate) 188 char *page, int activate)
189{ 189{
190 int rc; 190 int rc;
@@ -207,26 +207,26 @@ static ssize_t get_best_energy_data(struct sys_device *dev,
207 207
208/* Wrapper functions */ 208/* Wrapper functions */
209 209
210static ssize_t cpu_activate_hint_list_show(struct sysdev_class *class, 210static ssize_t cpu_activate_hint_list_show(struct device *dev,
211 struct sysdev_class_attribute *attr, char *page) 211 struct device_attribute *attr, char *page)
212{ 212{
213 return get_best_energy_list(page, 1); 213 return get_best_energy_list(page, 1);
214} 214}
215 215
216static ssize_t cpu_deactivate_hint_list_show(struct sysdev_class *class, 216static ssize_t cpu_deactivate_hint_list_show(struct device *dev,
217 struct sysdev_class_attribute *attr, char *page) 217 struct device_attribute *attr, char *page)
218{ 218{
219 return get_best_energy_list(page, 0); 219 return get_best_energy_list(page, 0);
220} 220}
221 221
222static ssize_t percpu_activate_hint_show(struct sys_device *dev, 222static ssize_t percpu_activate_hint_show(struct device *dev,
223 struct sysdev_attribute *attr, char *page) 223 struct device_attribute *attr, char *page)
224{ 224{
225 return get_best_energy_data(dev, page, 1); 225 return get_best_energy_data(dev, page, 1);
226} 226}
227 227
228static ssize_t percpu_deactivate_hint_show(struct sys_device *dev, 228static ssize_t percpu_deactivate_hint_show(struct device *dev,
229 struct sysdev_attribute *attr, char *page) 229 struct device_attribute *attr, char *page)
230{ 230{
231 return get_best_energy_data(dev, page, 0); 231 return get_best_energy_data(dev, page, 0);
232} 232}
@@ -241,48 +241,48 @@ static ssize_t percpu_deactivate_hint_show(struct sys_device *dev,
241 * Per-cpu value of the hint 241 * Per-cpu value of the hint
242 */ 242 */
243 243
244struct sysdev_class_attribute attr_cpu_activate_hint_list = 244struct device_attribute attr_cpu_activate_hint_list =
245 _SYSDEV_CLASS_ATTR(pseries_activate_hint_list, 0444, 245 __ATTR(pseries_activate_hint_list, 0444,
246 cpu_activate_hint_list_show, NULL); 246 cpu_activate_hint_list_show, NULL);
247 247
248struct sysdev_class_attribute attr_cpu_deactivate_hint_list = 248struct device_attribute attr_cpu_deactivate_hint_list =
249 _SYSDEV_CLASS_ATTR(pseries_deactivate_hint_list, 0444, 249 __ATTR(pseries_deactivate_hint_list, 0444,
250 cpu_deactivate_hint_list_show, NULL); 250 cpu_deactivate_hint_list_show, NULL);
251 251
252struct sysdev_attribute attr_percpu_activate_hint = 252struct device_attribute attr_percpu_activate_hint =
253 _SYSDEV_ATTR(pseries_activate_hint, 0444, 253 __ATTR(pseries_activate_hint, 0444,
254 percpu_activate_hint_show, NULL); 254 percpu_activate_hint_show, NULL);
255 255
256struct sysdev_attribute attr_percpu_deactivate_hint = 256struct device_attribute attr_percpu_deactivate_hint =
257 _SYSDEV_ATTR(pseries_deactivate_hint, 0444, 257 __ATTR(pseries_deactivate_hint, 0444,
258 percpu_deactivate_hint_show, NULL); 258 percpu_deactivate_hint_show, NULL);
259 259
260static int __init pseries_energy_init(void) 260static int __init pseries_energy_init(void)
261{ 261{
262 int cpu, err; 262 int cpu, err;
263 struct sys_device *cpu_sys_dev; 263 struct device *cpu_dev;
264 264
265 if (!check_for_h_best_energy()) { 265 if (!check_for_h_best_energy()) {
266 printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n"); 266 printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n");
267 return 0; 267 return 0;
268 } 268 }
269 /* Create the sysfs files */ 269 /* Create the sysfs files */
270 err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, 270 err = device_create_file(cpu_subsys.dev_root,
271 &attr_cpu_activate_hint_list.attr); 271 &attr_cpu_activate_hint_list);
272 if (!err) 272 if (!err)
273 err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, 273 err = device_create_file(cpu_subsys.dev_root,
274 &attr_cpu_deactivate_hint_list.attr); 274 &attr_cpu_deactivate_hint_list);
275 275
276 if (err) 276 if (err)
277 return err; 277 return err;
278 for_each_possible_cpu(cpu) { 278 for_each_possible_cpu(cpu) {
279 cpu_sys_dev = get_cpu_sysdev(cpu); 279 cpu_dev = get_cpu_device(cpu);
280 err = sysfs_create_file(&cpu_sys_dev->kobj, 280 err = device_create_file(cpu_dev,
281 &attr_percpu_activate_hint.attr); 281 &attr_percpu_activate_hint);
282 if (err) 282 if (err)
283 break; 283 break;
284 err = sysfs_create_file(&cpu_sys_dev->kobj, 284 err = device_create_file(cpu_dev,
285 &attr_percpu_deactivate_hint.attr); 285 &attr_percpu_deactivate_hint);
286 if (err) 286 if (err)
287 break; 287 break;
288 } 288 }
@@ -298,23 +298,20 @@ static int __init pseries_energy_init(void)
298static void __exit pseries_energy_cleanup(void) 298static void __exit pseries_energy_cleanup(void)
299{ 299{
300 int cpu; 300 int cpu;
301 struct sys_device *cpu_sys_dev; 301 struct device *cpu_dev;
302 302
303 if (!sysfs_entries) 303 if (!sysfs_entries)
304 return; 304 return;
305 305
306 /* Remove the sysfs files */ 306 /* Remove the sysfs files */
307 sysfs_remove_file(&cpu_sysdev_class.kset.kobj, 307 device_remove_file(cpu_subsys.dev_root, &attr_cpu_activate_hint_list);
308 &attr_cpu_activate_hint_list.attr); 308 device_remove_file(cpu_subsys.dev_root, &attr_cpu_deactivate_hint_list);
309
310 sysfs_remove_file(&cpu_sysdev_class.kset.kobj,
311 &attr_cpu_deactivate_hint_list.attr);
312 309
313 for_each_possible_cpu(cpu) { 310 for_each_possible_cpu(cpu) {
314 cpu_sys_dev = get_cpu_sysdev(cpu); 311 cpu_dev = get_cpu_device(cpu);
315 sysfs_remove_file(&cpu_sys_dev->kobj, 312 sysfs_remove_file(&cpu_dev->kobj,
316 &attr_percpu_activate_hint.attr); 313 &attr_percpu_activate_hint.attr);
317 sysfs_remove_file(&cpu_sys_dev->kobj, 314 sysfs_remove_file(&cpu_dev->kobj,
318 &attr_percpu_deactivate_hint.attr); 315 &attr_percpu_deactivate_hint.attr);
319 } 316 }
320} 317}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index c3408ca8855e..f79f1278dfca 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -39,6 +39,7 @@
39#include <linux/irq.h> 39#include <linux/irq.h>
40#include <linux/seq_file.h> 40#include <linux/seq_file.h>
41#include <linux/root_dev.h> 41#include <linux/root_dev.h>
42#include <linux/cpuidle.h>
42 43
43#include <asm/mmu.h> 44#include <asm/mmu.h>
44#include <asm/processor.h> 45#include <asm/processor.h>
@@ -74,9 +75,6 @@ EXPORT_SYMBOL(CMO_PageSize);
74 75
75int fwnmi_active; /* TRUE if an FWNMI handler is present */ 76int fwnmi_active; /* TRUE if an FWNMI handler is present */
76 77
77static void pseries_shared_idle_sleep(void);
78static void pseries_dedicated_idle_sleep(void);
79
80static struct device_node *pSeries_mpic_node; 78static struct device_node *pSeries_mpic_node;
81 79
82static void pSeries_show_cpuinfo(struct seq_file *m) 80static void pSeries_show_cpuinfo(struct seq_file *m)
@@ -192,8 +190,7 @@ static void __init pseries_mpic_init_IRQ(void)
192 BUG_ON(openpic_addr == 0); 190 BUG_ON(openpic_addr == 0);
193 191
194 /* Setup the openpic driver */ 192 /* Setup the openpic driver */
195 mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, 193 mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, 0,
196 MPIC_PRIMARY,
197 16, 250, /* isu size, irq count */ 194 16, 250, /* isu size, irq count */
198 " MPIC "); 195 " MPIC ");
199 BUG_ON(mpic == NULL); 196 BUG_ON(mpic == NULL);
@@ -352,8 +349,25 @@ static int alloc_dispatch_log_kmem_cache(void)
352} 349}
353early_initcall(alloc_dispatch_log_kmem_cache); 350early_initcall(alloc_dispatch_log_kmem_cache);
354 351
352static void pSeries_idle(void)
353{
354 /* This would call on the cpuidle framework, and the back-end pseries
355 * driver to go to idle states
356 */
357 if (cpuidle_idle_call()) {
358 /* On error, execute default handler
359 * to go into low thread priority and possibly
360 * low power mode.
361 */
362 HMT_low();
363 HMT_very_low();
364 }
365}
366
355static void __init pSeries_setup_arch(void) 367static void __init pSeries_setup_arch(void)
356{ 368{
369 panic_timeout = 10;
370
357 /* Discover PIC type and setup ppc_md accordingly */ 371 /* Discover PIC type and setup ppc_md accordingly */
358 pseries_discover_pic(); 372 pseries_discover_pic();
359 373
@@ -374,18 +388,9 @@ static void __init pSeries_setup_arch(void)
374 388
375 pSeries_nvram_init(); 389 pSeries_nvram_init();
376 390
377 /* Choose an idle loop */
378 if (firmware_has_feature(FW_FEATURE_SPLPAR)) { 391 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
379 vpa_init(boot_cpuid); 392 vpa_init(boot_cpuid);
380 if (get_lppaca()->shared_proc) { 393 ppc_md.power_save = pSeries_idle;
381 printk(KERN_DEBUG "Using shared processor idle loop\n");
382 ppc_md.power_save = pseries_shared_idle_sleep;
383 } else {
384 printk(KERN_DEBUG "Using dedicated idle loop\n");
385 ppc_md.power_save = pseries_dedicated_idle_sleep;
386 }
387 } else {
388 printk(KERN_DEBUG "Using default idle loop\n");
389 } 394 }
390 395
391 if (firmware_has_feature(FW_FEATURE_LPAR)) 396 if (firmware_has_feature(FW_FEATURE_LPAR))
@@ -586,80 +591,6 @@ static int __init pSeries_probe(void)
586 return 1; 591 return 1;
587} 592}
588 593
589
590DECLARE_PER_CPU(long, smt_snooze_delay);
591
592static void pseries_dedicated_idle_sleep(void)
593{
594 unsigned int cpu = smp_processor_id();
595 unsigned long start_snooze;
596 unsigned long in_purr, out_purr;
597 long snooze = __get_cpu_var(smt_snooze_delay);
598
599 /*
600 * Indicate to the HV that we are idle. Now would be
601 * a good time to find other work to dispatch.
602 */
603 get_lppaca()->idle = 1;
604 get_lppaca()->donate_dedicated_cpu = 1;
605 in_purr = mfspr(SPRN_PURR);
606
607 /*
608 * We come in with interrupts disabled, and need_resched()
609 * has been checked recently. If we should poll for a little
610 * while, do so.
611 */
612 if (snooze) {
613 start_snooze = get_tb() + snooze * tb_ticks_per_usec;
614 local_irq_enable();
615 set_thread_flag(TIF_POLLING_NRFLAG);
616
617 while ((snooze < 0) || (get_tb() < start_snooze)) {
618 if (need_resched() || cpu_is_offline(cpu))
619 goto out;
620 ppc64_runlatch_off();
621 HMT_low();
622 HMT_very_low();
623 }
624
625 HMT_medium();
626 clear_thread_flag(TIF_POLLING_NRFLAG);
627 smp_mb();
628 local_irq_disable();
629 if (need_resched() || cpu_is_offline(cpu))
630 goto out;
631 }
632
633 cede_processor();
634
635out:
636 HMT_medium();
637 out_purr = mfspr(SPRN_PURR);
638 get_lppaca()->wait_state_cycles += out_purr - in_purr;
639 get_lppaca()->donate_dedicated_cpu = 0;
640 get_lppaca()->idle = 0;
641}
642
643static void pseries_shared_idle_sleep(void)
644{
645 /*
646 * Indicate to the HV that we are idle. Now would be
647 * a good time to find other work to dispatch.
648 */
649 get_lppaca()->idle = 1;
650
651 /*
652 * Yield the processor to the hypervisor. We return if
653 * an external interrupt occurs (which are driven prior
654 * to returning here) or if a prod occurs from another
655 * processor. When returning here, external interrupts
656 * are enabled.
657 */
658 cede_processor();
659
660 get_lppaca()->idle = 0;
661}
662
663static int pSeries_pci_probe_mode(struct pci_bus *bus) 594static int pSeries_pci_probe_mode(struct pci_bus *bus)
664{ 595{
665 if (firmware_has_feature(FW_FEATURE_LPAR)) 596 if (firmware_has_feature(FW_FEATURE_LPAR))
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 26e93fd4c62b..eadba9521a35 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -22,7 +22,7 @@
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/cache.h> 23#include <linux/cache.h>
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/sysdev.h> 25#include <linux/device.h>
26#include <linux/cpu.h> 26#include <linux/cpu.h>
27 27
28#include <asm/ptrace.h> 28#include <asm/ptrace.h>
@@ -148,6 +148,7 @@ static void __devinit smp_xics_setup_cpu(int cpu)
148 set_cpu_current_state(cpu, CPU_STATE_ONLINE); 148 set_cpu_current_state(cpu, CPU_STATE_ONLINE);
149 set_default_offline_state(cpu); 149 set_default_offline_state(cpu);
150#endif 150#endif
151 pseries_notify_cpuidle_add_cpu(cpu);
151} 152}
152 153
153static int __devinit smp_pSeries_kick_cpu(int nr) 154static int __devinit smp_pSeries_kick_cpu(int nr)
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index d3de0849f296..b84a8b2238dd 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -26,7 +26,7 @@
26#include <asm/rtas.h> 26#include <asm/rtas.h>
27 27
28static u64 stream_id; 28static u64 stream_id;
29static struct sys_device suspend_sysdev; 29static struct device suspend_dev;
30static DECLARE_COMPLETION(suspend_work); 30static DECLARE_COMPLETION(suspend_work);
31static struct rtas_suspend_me_data suspend_data; 31static struct rtas_suspend_me_data suspend_data;
32static atomic_t suspending; 32static atomic_t suspending;
@@ -110,8 +110,8 @@ static int pseries_prepare_late(void)
110 110
111/** 111/**
112 * store_hibernate - Initiate partition hibernation 112 * store_hibernate - Initiate partition hibernation
113 * @classdev: sysdev class struct 113 * @dev: subsys root device
114 * @attr: class device attribute struct 114 * @attr: device attribute struct
115 * @buf: buffer 115 * @buf: buffer
116 * @count: buffer size 116 * @count: buffer size
117 * 117 *
@@ -121,8 +121,8 @@ static int pseries_prepare_late(void)
121 * Return value: 121 * Return value:
122 * number of bytes printed to buffer / other on failure 122 * number of bytes printed to buffer / other on failure
123 **/ 123 **/
124static ssize_t store_hibernate(struct sysdev_class *classdev, 124static ssize_t store_hibernate(struct device *dev,
125 struct sysdev_class_attribute *attr, 125 struct device_attribute *attr,
126 const char *buf, size_t count) 126 const char *buf, size_t count)
127{ 127{
128 int rc; 128 int rc;
@@ -148,10 +148,11 @@ static ssize_t store_hibernate(struct sysdev_class *classdev,
148 return rc; 148 return rc;
149} 149}
150 150
151static SYSDEV_CLASS_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); 151static DEVICE_ATTR(hibernate, S_IWUSR, NULL, store_hibernate);
152 152
153static struct sysdev_class suspend_sysdev_class = { 153static struct bus_type suspend_subsys = {
154 .name = "power", 154 .name = "power",
155 .dev_name = "power",
155}; 156};
156 157
157static const struct platform_suspend_ops pseries_suspend_ops = { 158static const struct platform_suspend_ops pseries_suspend_ops = {
@@ -167,23 +168,23 @@ static const struct platform_suspend_ops pseries_suspend_ops = {
167 * Return value: 168 * Return value:
168 * 0 on success / other on failure 169 * 0 on success / other on failure
169 **/ 170 **/
170static int pseries_suspend_sysfs_register(struct sys_device *sysdev) 171static int pseries_suspend_sysfs_register(struct device *dev)
171{ 172{
172 int rc; 173 int rc;
173 174
174 if ((rc = sysdev_class_register(&suspend_sysdev_class))) 175 if ((rc = subsys_system_register(&suspend_subsys, NULL)))
175 return rc; 176 return rc;
176 177
177 sysdev->id = 0; 178 dev->id = 0;
178 sysdev->cls = &suspend_sysdev_class; 179 dev->bus = &suspend_subsys;
179 180
180 if ((rc = sysdev_class_create_file(&suspend_sysdev_class, &attr_hibernate))) 181 if ((rc = device_create_file(suspend_subsys.dev_root, &dev_attr_hibernate)))
181 goto class_unregister; 182 goto subsys_unregister;
182 183
183 return 0; 184 return 0;
184 185
185class_unregister: 186subsys_unregister:
186 sysdev_class_unregister(&suspend_sysdev_class); 187 bus_unregister(&suspend_subsys);
187 return rc; 188 return rc;
188} 189}
189 190
@@ -204,7 +205,7 @@ static int __init pseries_suspend_init(void)
204 if (suspend_data.token == RTAS_UNKNOWN_SERVICE) 205 if (suspend_data.token == RTAS_UNKNOWN_SERVICE)
205 return 0; 206 return 0;
206 207
207 if ((rc = pseries_suspend_sysfs_register(&suspend_sysdev))) 208 if ((rc = pseries_suspend_sysfs_register(&suspend_dev)))
208 return rc; 209 return rc;
209 210
210 ppc_md.suspend_disable_cpu = pseries_suspend_cpu; 211 ppc_md.suspend_disable_cpu = pseries_suspend_cpu;
diff --git a/arch/powerpc/platforms/wsp/Kconfig b/arch/powerpc/platforms/wsp/Kconfig
index bd560c786ed6..57d22a2f4ba9 100644
--- a/arch/powerpc/platforms/wsp/Kconfig
+++ b/arch/powerpc/platforms/wsp/Kconfig
@@ -1,20 +1,28 @@
1config PPC_WSP 1config PPC_WSP
2 bool 2 bool
3 select PPC_A2 3 select PPC_A2
4 select GENERIC_TBSYNC
5 select PPC_ICSWX
4 select PPC_SCOM 6 select PPC_SCOM
5 select PPC_XICS 7 select PPC_XICS
6 select PPC_ICP_NATIVE 8 select PPC_ICP_NATIVE
7 select PCI 9 select PCI
8 select PPC_IO_WORKAROUNDS if PCI 10 select PPC_IO_WORKAROUNDS if PCI
9 select PPC_INDIRECT_PIO if PCI 11 select PPC_INDIRECT_PIO if PCI
12 select PPC_WSP_COPRO
10 default n 13 default n
11 14
12menu "WSP platform selection" 15menu "WSP platform selection"
13 depends on PPC_BOOK3E_64 16 depends on PPC_BOOK3E_64
14 17
15config PPC_PSR2 18config PPC_PSR2
16 bool "PSR-2 platform" 19 bool "PowerEN System Reference Platform 2"
17 select GENERIC_TBSYNC 20 select EPAPR_BOOT
21 select PPC_WSP
22 default y
23
24config PPC_CHROMA
25 bool "PowerEN PCIe Chroma Card"
18 select EPAPR_BOOT 26 select EPAPR_BOOT
19 select PPC_WSP 27 select PPC_WSP
20 default y 28 default y
diff --git a/arch/powerpc/platforms/wsp/Makefile b/arch/powerpc/platforms/wsp/Makefile
index a1486b436f02..56817ac98fc9 100644
--- a/arch/powerpc/platforms/wsp/Makefile
+++ b/arch/powerpc/platforms/wsp/Makefile
@@ -1,8 +1,10 @@
1ccflags-y += -mno-minimal-toc 1ccflags-y += -mno-minimal-toc
2 2
3obj-y += setup.o ics.o 3obj-y += setup.o ics.o wsp.o
4obj-$(CONFIG_PPC_PSR2) += psr2.o opb_pic.o 4obj-$(CONFIG_PPC_PSR2) += psr2.o
5obj-$(CONFIG_PPC_CHROMA) += chroma.o h8.o
6obj-$(CONFIG_PPC_WSP) += opb_pic.o
5obj-$(CONFIG_PPC_WSP) += scom_wsp.o 7obj-$(CONFIG_PPC_WSP) += scom_wsp.o
6obj-$(CONFIG_SMP) += smp.o scom_smp.o 8obj-$(CONFIG_SMP) += smp.o scom_smp.o
7obj-$(CONFIG_PCI) += wsp_pci.o 9obj-$(CONFIG_PCI) += wsp_pci.o
8obj-$(CONFIG_PCI_MSI) += msi.o \ No newline at end of file 10obj-$(CONFIG_PCI_MSI) += msi.o
diff --git a/arch/powerpc/platforms/wsp/chroma.c b/arch/powerpc/platforms/wsp/chroma.c
new file mode 100644
index 000000000000..ca6fa26f6e63
--- /dev/null
+++ b/arch/powerpc/platforms/wsp/chroma.c
@@ -0,0 +1,56 @@
1/*
2 * Copyright 2008-2011, IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include <linux/delay.h>
11#include <linux/init.h>
12#include <linux/irq.h>
13#include <linux/kernel.h>
14#include <linux/mm.h>
15#include <linux/of.h>
16#include <linux/smp.h>
17#include <linux/time.h>
18
19#include <asm/machdep.h>
20#include <asm/system.h>
21#include <asm/udbg.h>
22
23#include "ics.h"
24#include "wsp.h"
25
26void __init chroma_setup_arch(void)
27{
28 wsp_setup_arch();
29 wsp_setup_h8();
30
31}
32
33static int __init chroma_probe(void)
34{
35 unsigned long root = of_get_flat_dt_root();
36
37 if (!of_flat_dt_is_compatible(root, "ibm,wsp-chroma"))
38 return 0;
39
40 return 1;
41}
42
43define_machine(chroma_md) {
44 .name = "Chroma PCIe",
45 .probe = chroma_probe,
46 .setup_arch = chroma_setup_arch,
47 .restart = wsp_h8_restart,
48 .power_off = wsp_h8_power_off,
49 .halt = wsp_halt,
50 .calibrate_decr = generic_calibrate_decr,
51 .init_IRQ = wsp_setup_irq,
52 .progress = udbg_progress,
53 .power_save = book3e_idle,
54};
55
56machine_arch_initcall(chroma_md, wsp_probe_devices);
diff --git a/arch/powerpc/platforms/wsp/h8.c b/arch/powerpc/platforms/wsp/h8.c
new file mode 100644
index 000000000000..d18e6cc19df3
--- /dev/null
+++ b/arch/powerpc/platforms/wsp/h8.c
@@ -0,0 +1,134 @@
1/*
2 * Copyright 2008-2011, IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include <linux/kernel.h>
11#include <linux/of.h>
12#include <linux/io.h>
13
14#include "wsp.h"
15
16/*
17 * The UART connection to the H8 is over ttyS1 which is just a 16550.
18 * We assume that FW has it setup right and no one messes with it.
19 */
20
21
22static u8 __iomem *h8;
23
24#define RBR 0 /* Receiver Buffer Register */
25#define THR 0 /* Transmitter Holding Register */
26#define LSR 5 /* Line Status Register */
27#define LSR_DR 0x01 /* LSR value for Data-Ready */
28#define LSR_THRE 0x20 /* LSR value for Transmitter-Holding-Register-Empty */
29static void wsp_h8_putc(int c)
30{
31 u8 lsr;
32
33 do {
34 lsr = readb(h8 + LSR);
35 } while ((lsr & LSR_THRE) != LSR_THRE);
36 writeb(c, h8 + THR);
37}
38
39static int wsp_h8_getc(void)
40{
41 u8 lsr;
42
43 do {
44 lsr = readb(h8 + LSR);
45 } while ((lsr & LSR_DR) != LSR_DR);
46
47 return readb(h8 + RBR);
48}
49
50static void wsp_h8_puts(const char *s, int sz)
51{
52 int i;
53
54 for (i = 0; i < sz; i++) {
55 wsp_h8_putc(s[i]);
56
57 /* no flow control so wait for echo */
58 wsp_h8_getc();
59 }
60 wsp_h8_putc('\r');
61 wsp_h8_putc('\n');
62}
63
64static void wsp_h8_terminal_cmd(const char *cmd, int sz)
65{
66 hard_irq_disable();
67 wsp_h8_puts(cmd, sz);
68 /* should never return, but just in case */
69 for (;;)
70 continue;
71}
72
73
74void wsp_h8_restart(char *cmd)
75{
76 static const char restart[] = "warm-reset";
77
78 (void)cmd;
79 wsp_h8_terminal_cmd(restart, sizeof(restart) - 1);
80}
81
82void wsp_h8_power_off(void)
83{
84 static const char off[] = "power-off";
85
86 wsp_h8_terminal_cmd(off, sizeof(off) - 1);
87}
88
89static void __iomem *wsp_h8_getaddr(void)
90{
91 struct device_node *aliases;
92 struct device_node *uart;
93 struct property *path;
94 void __iomem *va = NULL;
95
96 /*
97 * there is nothing in the devtree to tell us which is mapped
98 * to the H8, but se know it is the second serial port.
99 */
100
101 aliases = of_find_node_by_path("/aliases");
102 if (aliases == NULL)
103 return NULL;
104
105 path = of_find_property(aliases, "serial1", NULL);
106 if (path == NULL)
107 goto out;
108
109 uart = of_find_node_by_path(path->value);
110 if (uart == NULL)
111 goto out;
112
113 va = of_iomap(uart, 0);
114
115 /* remove it so no one messes with it */
116 of_detach_node(uart);
117 of_node_put(uart);
118
119out:
120 of_node_put(aliases);
121
122 return va;
123}
124
125void __init wsp_setup_h8(void)
126{
127 h8 = wsp_h8_getaddr();
128
129 /* Devtree change? lets hard map it anyway */
130 if (h8 == NULL) {
131 pr_warn("UART to H8 could not be found");
132 h8 = ioremap(0xffc0008000ULL, 0x100);
133 }
134}
diff --git a/arch/powerpc/platforms/wsp/opb_pic.c b/arch/powerpc/platforms/wsp/opb_pic.c
index be05631a3c1c..19f353dfcd03 100644
--- a/arch/powerpc/platforms/wsp/opb_pic.c
+++ b/arch/powerpc/platforms/wsp/opb_pic.c
@@ -320,7 +320,8 @@ void __init opb_pic_init(void)
320 } 320 }
321 321
322 /* Attach opb interrupt handler to new virtual IRQ */ 322 /* Attach opb interrupt handler to new virtual IRQ */
323 rc = request_irq(virq, opb_irq_handler, 0, "OPB LS Cascade", opb); 323 rc = request_irq(virq, opb_irq_handler, IRQF_NO_THREAD,
324 "OPB LS Cascade", opb);
324 if (rc) { 325 if (rc) {
325 printk("opb: request_irq failed: %d\n", rc); 326 printk("opb: request_irq failed: %d\n", rc);
326 continue; 327 continue;
diff --git a/arch/powerpc/platforms/wsp/psr2.c b/arch/powerpc/platforms/wsp/psr2.c
index 166f2e4b4bee..0c1ae06d0be1 100644
--- a/arch/powerpc/platforms/wsp/psr2.c
+++ b/arch/powerpc/platforms/wsp/psr2.c
@@ -14,10 +14,10 @@
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/smp.h> 16#include <linux/smp.h>
17#include <linux/time.h>
17 18
18#include <asm/machdep.h> 19#include <asm/machdep.h>
19#include <asm/system.h> 20#include <asm/system.h>
20#include <asm/time.h>
21#include <asm/udbg.h> 21#include <asm/udbg.h>
22 22
23#include "ics.h" 23#include "ics.h"
@@ -27,7 +27,8 @@
27static void psr2_spin(void) 27static void psr2_spin(void)
28{ 28{
29 hard_irq_disable(); 29 hard_irq_disable();
30 for (;;) ; 30 for (;;)
31 continue;
31} 32}
32 33
33static void psr2_restart(char *cmd) 34static void psr2_restart(char *cmd)
@@ -35,65 +36,32 @@ static void psr2_restart(char *cmd)
35 psr2_spin(); 36 psr2_spin();
36} 37}
37 38
38static int psr2_probe_devices(void)
39{
40 struct device_node *np;
41
42 /* Our RTC is a ds1500. It seems to be programatically compatible
43 * with the ds1511 for which we have a driver so let's use that
44 */
45 np = of_find_compatible_node(NULL, NULL, "dallas,ds1500");
46 if (np != NULL) {
47 struct resource res;
48 if (of_address_to_resource(np, 0, &res) == 0)
49 platform_device_register_simple("ds1511", 0, &res, 1);
50 }
51 return 0;
52}
53machine_arch_initcall(psr2_md, psr2_probe_devices);
54
55static void __init psr2_setup_arch(void)
56{
57 /* init to some ~sane value until calibrate_delay() runs */
58 loops_per_jiffy = 50000000;
59
60 scom_init_wsp();
61
62 /* Setup SMP callback */
63#ifdef CONFIG_SMP
64 a2_setup_smp();
65#endif
66#ifdef CONFIG_PCI
67 wsp_setup_pci();
68#endif
69
70}
71
72static int __init psr2_probe(void) 39static int __init psr2_probe(void)
73{ 40{
74 unsigned long root = of_get_flat_dt_root(); 41 unsigned long root = of_get_flat_dt_root();
75 42
43 if (of_flat_dt_is_compatible(root, "ibm,wsp-chroma")) {
44 /* chroma systems also claim they are psr2s */
45 return 0;
46 }
47
76 if (!of_flat_dt_is_compatible(root, "ibm,psr2")) 48 if (!of_flat_dt_is_compatible(root, "ibm,psr2"))
77 return 0; 49 return 0;
78 50
79 return 1; 51 return 1;
80} 52}
81 53
82static void __init psr2_init_irq(void)
83{
84 wsp_init_irq();
85 opb_pic_init();
86}
87
88define_machine(psr2_md) { 54define_machine(psr2_md) {
89 .name = "PSR2 A2", 55 .name = "PSR2 A2",
90 .probe = psr2_probe, 56 .probe = psr2_probe,
91 .setup_arch = psr2_setup_arch, 57 .setup_arch = wsp_setup_arch,
92 .restart = psr2_restart, 58 .restart = psr2_restart,
93 .power_off = psr2_spin, 59 .power_off = psr2_spin,
94 .halt = psr2_spin, 60 .halt = psr2_spin,
95 .calibrate_decr = generic_calibrate_decr, 61 .calibrate_decr = generic_calibrate_decr,
96 .init_IRQ = psr2_init_irq, 62 .init_IRQ = wsp_setup_irq,
97 .progress = udbg_progress, 63 .progress = udbg_progress,
98 .power_save = book3e_idle, 64 .power_save = book3e_idle,
99}; 65};
66
67machine_arch_initcall(psr2_md, wsp_probe_devices);
diff --git a/arch/powerpc/platforms/wsp/wsp.c b/arch/powerpc/platforms/wsp/wsp.c
new file mode 100644
index 000000000000..d25cc96c21b8
--- /dev/null
+++ b/arch/powerpc/platforms/wsp/wsp.c
@@ -0,0 +1,115 @@
1/*
2 * Copyright 2008-2011, IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include <linux/kernel.h>
11#include <linux/of.h>
12#include <linux/of_device.h>
13#include <linux/smp.h>
14#include <linux/delay.h>
15#include <linux/time.h>
16
17#include <asm/scom.h>
18
19#include "wsp.h"
20#include "ics.h"
21
22#define WSP_SOC_COMPATIBLE "ibm,wsp-soc"
23#define PBIC_COMPATIBLE "ibm,wsp-pbic"
24#define COPRO_COMPATIBLE "ibm,wsp-coprocessor"
25
26static int __init wsp_probe_buses(void)
27{
28 static __initdata struct of_device_id bus_ids[] = {
29 /*
30 * every node in between needs to be here or you won't
31 * find it
32 */
33 { .compatible = WSP_SOC_COMPATIBLE, },
34 { .compatible = PBIC_COMPATIBLE, },
35 { .compatible = COPRO_COMPATIBLE, },
36 {},
37 };
38 of_platform_bus_probe(NULL, bus_ids, NULL);
39
40 return 0;
41}
42
43void __init wsp_setup_arch(void)
44{
45 /* init to some ~sane value until calibrate_delay() runs */
46 loops_per_jiffy = 50000000;
47
48 scom_init_wsp();
49
50 /* Setup SMP callback */
51#ifdef CONFIG_SMP
52 a2_setup_smp();
53#endif
54#ifdef CONFIG_PCI
55 wsp_setup_pci();
56#endif
57}
58
59void __init wsp_setup_irq(void)
60{
61 wsp_init_irq();
62 opb_pic_init();
63}
64
65
66int __init wsp_probe_devices(void)
67{
68 struct device_node *np;
69
70 /* Our RTC is a ds1500. It seems to be programatically compatible
71 * with the ds1511 for which we have a driver so let's use that
72 */
73 np = of_find_compatible_node(NULL, NULL, "dallas,ds1500");
74 if (np != NULL) {
75 struct resource res;
76 if (of_address_to_resource(np, 0, &res) == 0)
77 platform_device_register_simple("ds1511", 0, &res, 1);
78 }
79
80 wsp_probe_buses();
81
82 return 0;
83}
84
85void wsp_halt(void)
86{
87 u64 val;
88 scom_map_t m;
89 struct device_node *dn;
90 struct device_node *mine;
91 struct device_node *me;
92
93 me = of_get_cpu_node(smp_processor_id(), NULL);
94 mine = scom_find_parent(me);
95
96 /* This will halt all the A2s but not power off the chip */
97 for_each_node_with_property(dn, "scom-controller") {
98 if (dn == mine)
99 continue;
100 m = scom_map(dn, 0, 1);
101
102 /* read-modify-write it so the HW probe does not get
103 * confused */
104 val = scom_read(m, 0);
105 val |= 1;
106 scom_write(m, 0, val);
107 scom_unmap(m);
108 }
109 m = scom_map(mine, 0, 1);
110 val = scom_read(m, 0);
111 val |= 1;
112 scom_write(m, 0, val);
113 /* should never return */
114 scom_unmap(m);
115}
diff --git a/arch/powerpc/platforms/wsp/wsp.h b/arch/powerpc/platforms/wsp/wsp.h
index 33479818f62a..10c1d1fff362 100644
--- a/arch/powerpc/platforms/wsp/wsp.h
+++ b/arch/powerpc/platforms/wsp/wsp.h
@@ -6,15 +6,25 @@
6/* Devtree compatible strings for major devices */ 6/* Devtree compatible strings for major devices */
7#define PCIE_COMPATIBLE "ibm,wsp-pciex" 7#define PCIE_COMPATIBLE "ibm,wsp-pciex"
8 8
9extern void wsp_setup_arch(void);
10extern void wsp_setup_irq(void);
11extern int wsp_probe_devices(void);
12extern void wsp_halt(void);
13
9extern void wsp_setup_pci(void); 14extern void wsp_setup_pci(void);
10extern void scom_init_wsp(void); 15extern void scom_init_wsp(void);
11 16
12extern void a2_setup_smp(void); 17extern void a2_setup_smp(void);
13extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx, 18extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx,
14 struct device_node *np); 19 struct device_node *np);
15int smp_a2_cpu_bootable(unsigned int nr); 20extern int smp_a2_cpu_bootable(unsigned int nr);
16int __devinit smp_a2_kick_cpu(int nr); 21extern int __devinit smp_a2_kick_cpu(int nr);
22
23extern void opb_pic_init(void);
17 24
18void opb_pic_init(void); 25/* chroma specific managment */
26extern void wsp_h8_restart(char *cmd);
27extern void wsp_h8_power_off(void);
28extern void __init wsp_setup_h8(void);
19 29
20#endif /* __WSP_H */ 30#endif /* __WSP_H */
diff --git a/arch/powerpc/relocs_check.pl b/arch/powerpc/relocs_check.pl
index d2571096c3e9..7f5b83808862 100755
--- a/arch/powerpc/relocs_check.pl
+++ b/arch/powerpc/relocs_check.pl
@@ -32,8 +32,18 @@ while (<FD>) {
32 next if (!/\s+R_/); 32 next if (!/\s+R_/);
33 33
34 # These relocations are okay 34 # These relocations are okay
35 next if (/R_PPC64_RELATIVE/ or /R_PPC64_NONE/ or 35 # On PPC64:
36 /R_PPC64_ADDR64\s+mach_/); 36 # R_PPC64_RELATIVE, R_PPC64_NONE, R_PPC64_ADDR64
37 # On PPC:
38 # R_PPC_RELATIVE, R_PPC_ADDR16_HI,
39 # R_PPC_ADDR16_HA,R_PPC_ADDR16_LO,
40 # R_PPC_NONE
41
42 next if (/\bR_PPC64_RELATIVE\b/ or /\bR_PPC64_NONE\b/ or
43 /\bR_PPC64_ADDR64\s+mach_/);
44 next if (/\bR_PPC_ADDR16_LO\b/ or /\bR_PPC_ADDR16_HI\b/ or
45 /\bR_PPC_ADDR16_HA\b/ or /\bR_PPC_RELATIVE\b/ or
46 /\bR_PPC_NONE\b/);
37 47
38 # If we see this type of relcoation it's an idication that 48 # If we see this type of relcoation it's an idication that
39 # we /may/ be using an old version of binutils. 49 # we /may/ be using an old version of binutils.
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 84e13253aec5..5e37b4717864 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -17,10 +17,11 @@ obj-$(CONFIG_FSL_SOC) += fsl_soc.o
17obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y) 17obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y)
18obj-$(CONFIG_FSL_PMC) += fsl_pmc.o 18obj-$(CONFIG_FSL_PMC) += fsl_pmc.o
19obj-$(CONFIG_FSL_LBC) += fsl_lbc.o 19obj-$(CONFIG_FSL_LBC) += fsl_lbc.o
20obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
20obj-$(CONFIG_FSL_GTM) += fsl_gtm.o 21obj-$(CONFIG_FSL_GTM) += fsl_gtm.o
21obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o 22obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o
22obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o 23obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o
23obj-$(CONFIG_FSL_RIO) += fsl_rio.o 24obj-$(CONFIG_FSL_RIO) += fsl_rio.o fsl_rmu.o
24obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o 25obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
25obj-$(CONFIG_QUICC_ENGINE) += qe_lib/ 26obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
26obj-$(CONFIG_PPC_BESTCOMM) += bestcomm/ 27obj-$(CONFIG_PPC_BESTCOMM) += bestcomm/
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index ba4271919062..1c16141c031c 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -25,7 +25,6 @@
25 25
26#include <linux/bio.h> 26#include <linux/bio.h>
27#include <linux/blkdev.h> 27#include <linux/blkdev.h>
28#include <linux/buffer_head.h>
29#include <linux/device.h> 28#include <linux/device.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/fs.h> 30#include <linux/fs.h>
diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c
index af1a5df46b3e..b6731e4a6646 100644
--- a/arch/powerpc/sysdev/ehv_pic.c
+++ b/arch/powerpc/sysdev/ehv_pic.c
@@ -280,6 +280,7 @@ void __init ehv_pic_init(void)
280 280
281 if (!ehv_pic->irqhost) { 281 if (!ehv_pic->irqhost) {
282 of_node_put(np); 282 of_node_put(np);
283 kfree(ehv_pic);
283 return; 284 return;
284 } 285 }
285 286
diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/arch/powerpc/sysdev/fsl_ifc.c
new file mode 100644
index 000000000000..b31f19f61031
--- /dev/null
+++ b/arch/powerpc/sysdev/fsl_ifc.c
@@ -0,0 +1,310 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc
3 *
4 * Freescale Integrated Flash Controller
5 *
6 * Author: Dipen Dudhat <Dipen.Dudhat@freescale.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/kernel.h>
25#include <linux/compiler.h>
26#include <linux/spinlock.h>
27#include <linux/types.h>
28#include <linux/slab.h>
29#include <linux/io.h>
30#include <linux/of.h>
31#include <linux/of_device.h>
32#include <linux/platform_device.h>
33#include <asm/prom.h>
34#include <asm/fsl_ifc.h>
35
36struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
37EXPORT_SYMBOL(fsl_ifc_ctrl_dev);
38
39/*
40 * convert_ifc_address - convert the base address
41 * @addr_base: base address of the memory bank
42 */
43unsigned int convert_ifc_address(phys_addr_t addr_base)
44{
45 return addr_base & CSPR_BA;
46}
47EXPORT_SYMBOL(convert_ifc_address);
48
49/*
50 * fsl_ifc_find - find IFC bank
51 * @addr_base: base address of the memory bank
52 *
53 * This function walks IFC banks comparing "Base address" field of the CSPR
54 * registers with the supplied addr_base argument. When bases match this
55 * function returns bank number (starting with 0), otherwise it returns
56 * appropriate errno value.
57 */
58int fsl_ifc_find(phys_addr_t addr_base)
59{
60 int i = 0;
61
62 if (!fsl_ifc_ctrl_dev || !fsl_ifc_ctrl_dev->regs)
63 return -ENODEV;
64
65 for (i = 0; i < ARRAY_SIZE(fsl_ifc_ctrl_dev->regs->cspr_cs); i++) {
66 __be32 cspr = in_be32(&fsl_ifc_ctrl_dev->regs->cspr_cs[i].cspr);
67 if (cspr & CSPR_V && (cspr & CSPR_BA) ==
68 convert_ifc_address(addr_base))
69 return i;
70 }
71
72 return -ENOENT;
73}
74EXPORT_SYMBOL(fsl_ifc_find);
75
76static int __devinit fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl)
77{
78 struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
79
80 /*
81 * Clear all the common status and event registers
82 */
83 if (in_be32(&ifc->cm_evter_stat) & IFC_CM_EVTER_STAT_CSER)
84 out_be32(&ifc->cm_evter_stat, IFC_CM_EVTER_STAT_CSER);
85
86 /* enable all error and events */
87 out_be32(&ifc->cm_evter_en, IFC_CM_EVTER_EN_CSEREN);
88
89 /* enable all error and event interrupts */
90 out_be32(&ifc->cm_evter_intr_en, IFC_CM_EVTER_INTR_EN_CSERIREN);
91 out_be32(&ifc->cm_erattr0, 0x0);
92 out_be32(&ifc->cm_erattr1, 0x0);
93
94 return 0;
95}
96
97static int fsl_ifc_ctrl_remove(struct platform_device *dev)
98{
99 struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev);
100
101 free_irq(ctrl->nand_irq, ctrl);
102 free_irq(ctrl->irq, ctrl);
103
104 irq_dispose_mapping(ctrl->nand_irq);
105 irq_dispose_mapping(ctrl->irq);
106
107 iounmap(ctrl->regs);
108
109 dev_set_drvdata(&dev->dev, NULL);
110 kfree(ctrl);
111
112 return 0;
113}
114
115/*
116 * NAND events are split between an operational interrupt which only
117 * receives OPC, and an error interrupt that receives everything else,
118 * including non-NAND errors. Whichever interrupt gets to it first
119 * records the status and wakes the wait queue.
120 */
121static DEFINE_SPINLOCK(nand_irq_lock);
122
123static u32 check_nand_stat(struct fsl_ifc_ctrl *ctrl)
124{
125 struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
126 unsigned long flags;
127 u32 stat;
128
129 spin_lock_irqsave(&nand_irq_lock, flags);
130
131 stat = in_be32(&ifc->ifc_nand.nand_evter_stat);
132 if (stat) {
133 out_be32(&ifc->ifc_nand.nand_evter_stat, stat);
134 ctrl->nand_stat = stat;
135 wake_up(&ctrl->nand_wait);
136 }
137
138 spin_unlock_irqrestore(&nand_irq_lock, flags);
139
140 return stat;
141}
142
143static irqreturn_t fsl_ifc_nand_irq(int irqno, void *data)
144{
145 struct fsl_ifc_ctrl *ctrl = data;
146
147 if (check_nand_stat(ctrl))
148 return IRQ_HANDLED;
149
150 return IRQ_NONE;
151}
152
153/*
154 * NOTE: This interrupt is used to report ifc events of various kinds,
155 * such as transaction errors on the chipselects.
156 */
157static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)
158{
159 struct fsl_ifc_ctrl *ctrl = data;
160 struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
161 u32 err_axiid, err_srcid, status, cs_err, err_addr;
162 irqreturn_t ret = IRQ_NONE;
163
164 /* read for chip select error */
165 cs_err = in_be32(&ifc->cm_evter_stat);
166 if (cs_err) {
167 dev_err(ctrl->dev, "transaction sent to IFC is not mapped to"
168 "any memory bank 0x%08X\n", cs_err);
169 /* clear the chip select error */
170 out_be32(&ifc->cm_evter_stat, IFC_CM_EVTER_STAT_CSER);
171
172 /* read error attribute registers print the error information */
173 status = in_be32(&ifc->cm_erattr0);
174 err_addr = in_be32(&ifc->cm_erattr1);
175
176 if (status & IFC_CM_ERATTR0_ERTYP_READ)
177 dev_err(ctrl->dev, "Read transaction error"
178 "CM_ERATTR0 0x%08X\n", status);
179 else
180 dev_err(ctrl->dev, "Write transaction error"
181 "CM_ERATTR0 0x%08X\n", status);
182
183 err_axiid = (status & IFC_CM_ERATTR0_ERAID) >>
184 IFC_CM_ERATTR0_ERAID_SHIFT;
185 dev_err(ctrl->dev, "AXI ID of the error"
186 "transaction 0x%08X\n", err_axiid);
187
188 err_srcid = (status & IFC_CM_ERATTR0_ESRCID) >>
189 IFC_CM_ERATTR0_ESRCID_SHIFT;
190 dev_err(ctrl->dev, "SRC ID of the error"
191 "transaction 0x%08X\n", err_srcid);
192
193 dev_err(ctrl->dev, "Transaction Address corresponding to error"
194 "ERADDR 0x%08X\n", err_addr);
195
196 ret = IRQ_HANDLED;
197 }
198
199 if (check_nand_stat(ctrl))
200 ret = IRQ_HANDLED;
201
202 return ret;
203}
204
205/*
206 * fsl_ifc_ctrl_probe
207 *
208 * called by device layer when it finds a device matching
209 * one our driver can handled. This code allocates all of
210 * the resources needed for the controller only. The
211 * resources for the NAND banks themselves are allocated
212 * in the chip probe function.
213*/
214static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev)
215{
216 int ret = 0;
217
218
219 dev_info(&dev->dev, "Freescale Integrated Flash Controller\n");
220
221 fsl_ifc_ctrl_dev = kzalloc(sizeof(*fsl_ifc_ctrl_dev), GFP_KERNEL);
222 if (!fsl_ifc_ctrl_dev)
223 return -ENOMEM;
224
225 dev_set_drvdata(&dev->dev, fsl_ifc_ctrl_dev);
226
227 /* IOMAP the entire IFC region */
228 fsl_ifc_ctrl_dev->regs = of_iomap(dev->dev.of_node, 0);
229 if (!fsl_ifc_ctrl_dev->regs) {
230 dev_err(&dev->dev, "failed to get memory region\n");
231 ret = -ENODEV;
232 goto err;
233 }
234
235 /* get the Controller level irq */
236 fsl_ifc_ctrl_dev->irq = irq_of_parse_and_map(dev->dev.of_node, 0);
237 if (fsl_ifc_ctrl_dev->irq == NO_IRQ) {
238 dev_err(&dev->dev, "failed to get irq resource "
239 "for IFC\n");
240 ret = -ENODEV;
241 goto err;
242 }
243
244 /* get the nand machine irq */
245 fsl_ifc_ctrl_dev->nand_irq =
246 irq_of_parse_and_map(dev->dev.of_node, 1);
247 if (fsl_ifc_ctrl_dev->nand_irq == NO_IRQ) {
248 dev_err(&dev->dev, "failed to get irq resource "
249 "for NAND Machine\n");
250 ret = -ENODEV;
251 goto err;
252 }
253
254 fsl_ifc_ctrl_dev->dev = &dev->dev;
255
256 ret = fsl_ifc_ctrl_init(fsl_ifc_ctrl_dev);
257 if (ret < 0)
258 goto err;
259
260 init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
261
262 ret = request_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_irq, IRQF_SHARED,
263 "fsl-ifc", fsl_ifc_ctrl_dev);
264 if (ret != 0) {
265 dev_err(&dev->dev, "failed to install irq (%d)\n",
266 fsl_ifc_ctrl_dev->irq);
267 goto err_irq;
268 }
269
270 ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq, 0,
271 "fsl-ifc-nand", fsl_ifc_ctrl_dev);
272 if (ret != 0) {
273 dev_err(&dev->dev, "failed to install irq (%d)\n",
274 fsl_ifc_ctrl_dev->nand_irq);
275 goto err_nandirq;
276 }
277
278 return 0;
279
280err_nandirq:
281 free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
282 irq_dispose_mapping(fsl_ifc_ctrl_dev->nand_irq);
283err_irq:
284 free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
285 irq_dispose_mapping(fsl_ifc_ctrl_dev->irq);
286err:
287 return ret;
288}
289
290static const struct of_device_id fsl_ifc_match[] = {
291 {
292 .compatible = "fsl,ifc",
293 },
294 {},
295};
296
297static struct platform_driver fsl_ifc_ctrl_driver = {
298 .driver = {
299 .name = "fsl-ifc",
300 .of_match_table = fsl_ifc_match,
301 },
302 .probe = fsl_ifc_ctrl_probe,
303 .remove = fsl_ifc_ctrl_remove,
304};
305
306module_platform_driver(fsl_ifc_ctrl_driver);
307
308MODULE_LICENSE("GPL");
309MODULE_AUTHOR("Freescale Semiconductor");
310MODULE_DESCRIPTION("Freescale Integrated Flash Controller driver");
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index c4d96fa32ba5..483126d7b3c0 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -328,9 +328,42 @@ static int __devinit fsl_lbc_ctrl_probe(struct platform_device *dev)
328err: 328err:
329 iounmap(fsl_lbc_ctrl_dev->regs); 329 iounmap(fsl_lbc_ctrl_dev->regs);
330 kfree(fsl_lbc_ctrl_dev); 330 kfree(fsl_lbc_ctrl_dev);
331 fsl_lbc_ctrl_dev = NULL;
331 return ret; 332 return ret;
332} 333}
333 334
335#ifdef CONFIG_SUSPEND
336
337/* save lbc registers */
338static int fsl_lbc_suspend(struct platform_device *pdev, pm_message_t state)
339{
340 struct fsl_lbc_ctrl *ctrl = dev_get_drvdata(&pdev->dev);
341 struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
342
343 ctrl->saved_regs = kmalloc(sizeof(struct fsl_lbc_regs), GFP_KERNEL);
344 if (!ctrl->saved_regs)
345 return -ENOMEM;
346
347 _memcpy_fromio(ctrl->saved_regs, lbc, sizeof(struct fsl_lbc_regs));
348 return 0;
349}
350
351/* restore lbc registers */
352static int fsl_lbc_resume(struct platform_device *pdev)
353{
354 struct fsl_lbc_ctrl *ctrl = dev_get_drvdata(&pdev->dev);
355 struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
356
357 if (ctrl->saved_regs) {
358 _memcpy_toio(lbc, ctrl->saved_regs,
359 sizeof(struct fsl_lbc_regs));
360 kfree(ctrl->saved_regs);
361 ctrl->saved_regs = NULL;
362 }
363 return 0;
364}
365#endif /* CONFIG_SUSPEND */
366
334static const struct of_device_id fsl_lbc_match[] = { 367static const struct of_device_id fsl_lbc_match[] = {
335 { .compatible = "fsl,elbc", }, 368 { .compatible = "fsl,elbc", },
336 { .compatible = "fsl,pq3-localbus", }, 369 { .compatible = "fsl,pq3-localbus", },
@@ -345,6 +378,10 @@ static struct platform_driver fsl_lbc_ctrl_driver = {
345 .of_match_table = fsl_lbc_match, 378 .of_match_table = fsl_lbc_match,
346 }, 379 },
347 .probe = fsl_lbc_ctrl_probe, 380 .probe = fsl_lbc_ctrl_probe,
381#ifdef CONFIG_SUSPEND
382 .suspend = fsl_lbc_suspend,
383 .resume = fsl_lbc_resume,
384#endif
348}; 385};
349 386
350static int __init fsl_lbc_init(void) 387static int __init fsl_lbc_init(void)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index e5c344d336ea..ecb5c1946d22 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -23,6 +23,8 @@
23#include <asm/hw_irq.h> 23#include <asm/hw_irq.h>
24#include <asm/ppc-pci.h> 24#include <asm/ppc-pci.h>
25#include <asm/mpic.h> 25#include <asm/mpic.h>
26#include <asm/fsl_hcalls.h>
27
26#include "fsl_msi.h" 28#include "fsl_msi.h"
27#include "fsl_pci.h" 29#include "fsl_pci.h"
28 30
@@ -148,14 +150,49 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
148 150
149static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) 151static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
150{ 152{
153 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
154 struct device_node *np;
155 phandle phandle = 0;
151 int rc, hwirq = -ENOMEM; 156 int rc, hwirq = -ENOMEM;
152 unsigned int virq; 157 unsigned int virq;
153 struct msi_desc *entry; 158 struct msi_desc *entry;
154 struct msi_msg msg; 159 struct msi_msg msg;
155 struct fsl_msi *msi_data; 160 struct fsl_msi *msi_data;
156 161
162 /*
163 * If the PCI node has an fsl,msi property, then we need to use it
164 * to find the specific MSI.
165 */
166 np = of_parse_phandle(hose->dn, "fsl,msi", 0);
167 if (np) {
168 if (of_device_is_compatible(np, "fsl,mpic-msi") ||
169 of_device_is_compatible(np, "fsl,vmpic-msi"))
170 phandle = np->phandle;
171 else {
172 dev_err(&pdev->dev,
173 "node %s has an invalid fsl,msi phandle %u\n",
174 hose->dn->full_name, np->phandle);
175 return -EINVAL;
176 }
177 }
178
157 list_for_each_entry(entry, &pdev->msi_list, list) { 179 list_for_each_entry(entry, &pdev->msi_list, list) {
180 /*
181 * Loop over all the MSI devices until we find one that has an
182 * available interrupt.
183 */
158 list_for_each_entry(msi_data, &msi_head, list) { 184 list_for_each_entry(msi_data, &msi_head, list) {
185 /*
186 * If the PCI node has an fsl,msi property, then we
187 * restrict our search to the corresponding MSI node.
188 * The simplest way is to skip over MSI nodes with the
189 * wrong phandle. Under the Freescale hypervisor, this
190 * has the additional benefit of skipping over MSI
191 * nodes that are not mapped in the PAMU.
192 */
193 if (phandle && (phandle != msi_data->phandle))
194 continue;
195
159 hwirq = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1); 196 hwirq = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1);
160 if (hwirq >= 0) 197 if (hwirq >= 0)
161 break; 198 break;
@@ -163,16 +200,14 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
163 200
164 if (hwirq < 0) { 201 if (hwirq < 0) {
165 rc = hwirq; 202 rc = hwirq;
166 pr_debug("%s: fail allocating msi interrupt\n", 203 dev_err(&pdev->dev, "could not allocate MSI interrupt\n");
167 __func__);
168 goto out_free; 204 goto out_free;
169 } 205 }
170 206
171 virq = irq_create_mapping(msi_data->irqhost, hwirq); 207 virq = irq_create_mapping(msi_data->irqhost, hwirq);
172 208
173 if (virq == NO_IRQ) { 209 if (virq == NO_IRQ) {
174 pr_debug("%s: fail mapping hwirq 0x%x\n", 210 dev_err(&pdev->dev, "fail mapping hwirq %i\n", hwirq);
175 __func__, hwirq);
176 msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); 211 msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
177 rc = -ENOSPC; 212 rc = -ENOSPC;
178 goto out_free; 213 goto out_free;
@@ -201,6 +236,7 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
201 u32 intr_index; 236 u32 intr_index;
202 u32 have_shift = 0; 237 u32 have_shift = 0;
203 struct fsl_msi_cascade_data *cascade_data; 238 struct fsl_msi_cascade_data *cascade_data;
239 unsigned int ret;
204 240
205 cascade_data = irq_get_handler_data(irq); 241 cascade_data = irq_get_handler_data(irq);
206 msi_data = cascade_data->msi_data; 242 msi_data = cascade_data->msi_data;
@@ -232,6 +268,14 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
232 case FSL_PIC_IP_IPIC: 268 case FSL_PIC_IP_IPIC:
233 msir_value = fsl_msi_read(msi_data->msi_regs, msir_index * 0x4); 269 msir_value = fsl_msi_read(msi_data->msi_regs, msir_index * 0x4);
234 break; 270 break;
271 case FSL_PIC_IP_VMPIC:
272 ret = fh_vmpic_get_msir(virq_to_hw(irq), &msir_value);
273 if (ret) {
274 pr_err("fsl-msi: fh_vmpic_get_msir() failed for "
275 "irq %u (ret=%u)\n", irq, ret);
276 msir_value = 0;
277 }
278 break;
235 } 279 }
236 280
237 while (msir_value) { 281 while (msir_value) {
@@ -249,6 +293,7 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
249 293
250 switch (msi_data->feature & FSL_PIC_IP_MASK) { 294 switch (msi_data->feature & FSL_PIC_IP_MASK) {
251 case FSL_PIC_IP_MPIC: 295 case FSL_PIC_IP_MPIC:
296 case FSL_PIC_IP_VMPIC:
252 chip->irq_eoi(idata); 297 chip->irq_eoi(idata);
253 break; 298 break;
254 case FSL_PIC_IP_IPIC: 299 case FSL_PIC_IP_IPIC:
@@ -278,7 +323,8 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
278 } 323 }
279 if (msi->bitmap.bitmap) 324 if (msi->bitmap.bitmap)
280 msi_bitmap_free(&msi->bitmap); 325 msi_bitmap_free(&msi->bitmap);
281 iounmap(msi->msi_regs); 326 if ((msi->feature & FSL_PIC_IP_MASK) != FSL_PIC_IP_VMPIC)
327 iounmap(msi->msi_regs);
282 kfree(msi); 328 kfree(msi);
283 329
284 return 0; 330 return 0;
@@ -350,25 +396,37 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
350 goto error_out; 396 goto error_out;
351 } 397 }
352 398
353 /* Get the MSI reg base */ 399 /*
354 err = of_address_to_resource(dev->dev.of_node, 0, &res); 400 * Under the Freescale hypervisor, the msi nodes don't have a 'reg'
355 if (err) { 401 * property. Instead, we use hypercalls to access the MSI.
356 dev_err(&dev->dev, "%s resource error!\n", 402 */
403 if ((features->fsl_pic_ip & FSL_PIC_IP_MASK) != FSL_PIC_IP_VMPIC) {
404 err = of_address_to_resource(dev->dev.of_node, 0, &res);
405 if (err) {
406 dev_err(&dev->dev, "invalid resource for node %s\n",
357 dev->dev.of_node->full_name); 407 dev->dev.of_node->full_name);
358 goto error_out; 408 goto error_out;
359 } 409 }
360 410
361 msi->msi_regs = ioremap(res.start, resource_size(&res)); 411 msi->msi_regs = ioremap(res.start, resource_size(&res));
362 if (!msi->msi_regs) { 412 if (!msi->msi_regs) {
363 dev_err(&dev->dev, "ioremap problem failed\n"); 413 dev_err(&dev->dev, "could not map node %s\n",
364 goto error_out; 414 dev->dev.of_node->full_name);
415 goto error_out;
416 }
417 msi->msiir_offset =
418 features->msiir_offset + (res.start & 0xfffff);
365 } 419 }
366 420
367 msi->feature = features->fsl_pic_ip; 421 msi->feature = features->fsl_pic_ip;
368 422
369 msi->irqhost->host_data = msi; 423 msi->irqhost->host_data = msi;
370 424
371 msi->msiir_offset = features->msiir_offset + (res.start & 0xfffff); 425 /*
426 * Remember the phandle, so that we can match with any PCI nodes
427 * that have an "fsl,msi" property.
428 */
429 msi->phandle = dev->dev.of_node->phandle;
372 430
373 rc = fsl_msi_init_allocator(msi); 431 rc = fsl_msi_init_allocator(msi);
374 if (rc) { 432 if (rc) {
@@ -437,6 +495,11 @@ static const struct fsl_msi_feature ipic_msi_feature = {
437 .msiir_offset = 0x38, 495 .msiir_offset = 0x38,
438}; 496};
439 497
498static const struct fsl_msi_feature vmpic_msi_feature = {
499 .fsl_pic_ip = FSL_PIC_IP_VMPIC,
500 .msiir_offset = 0,
501};
502
440static const struct of_device_id fsl_of_msi_ids[] = { 503static const struct of_device_id fsl_of_msi_ids[] = {
441 { 504 {
442 .compatible = "fsl,mpic-msi", 505 .compatible = "fsl,mpic-msi",
@@ -446,6 +509,10 @@ static const struct of_device_id fsl_of_msi_ids[] = {
446 .compatible = "fsl,ipic-msi", 509 .compatible = "fsl,ipic-msi",
447 .data = (void *)&ipic_msi_feature, 510 .data = (void *)&ipic_msi_feature,
448 }, 511 },
512 {
513 .compatible = "fsl,vmpic-msi",
514 .data = (void *)&vmpic_msi_feature,
515 },
449 {} 516 {}
450}; 517};
451 518
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h
index 1313abbc5200..f6c646a52541 100644
--- a/arch/powerpc/sysdev/fsl_msi.h
+++ b/arch/powerpc/sysdev/fsl_msi.h
@@ -13,15 +13,17 @@
13#ifndef _POWERPC_SYSDEV_FSL_MSI_H 13#ifndef _POWERPC_SYSDEV_FSL_MSI_H
14#define _POWERPC_SYSDEV_FSL_MSI_H 14#define _POWERPC_SYSDEV_FSL_MSI_H
15 15
16#include <linux/of.h>
16#include <asm/msi_bitmap.h> 17#include <asm/msi_bitmap.h>
17 18
18#define NR_MSI_REG 8 19#define NR_MSI_REG 8
19#define IRQS_PER_MSI_REG 32 20#define IRQS_PER_MSI_REG 32
20#define NR_MSI_IRQS (NR_MSI_REG * IRQS_PER_MSI_REG) 21#define NR_MSI_IRQS (NR_MSI_REG * IRQS_PER_MSI_REG)
21 22
22#define FSL_PIC_IP_MASK 0x0000000F 23#define FSL_PIC_IP_MASK 0x0000000F
23#define FSL_PIC_IP_MPIC 0x00000001 24#define FSL_PIC_IP_MPIC 0x00000001
24#define FSL_PIC_IP_IPIC 0x00000002 25#define FSL_PIC_IP_IPIC 0x00000002
26#define FSL_PIC_IP_VMPIC 0x00000003
25 27
26struct fsl_msi { 28struct fsl_msi {
27 struct irq_host *irqhost; 29 struct irq_host *irqhost;
@@ -36,6 +38,8 @@ struct fsl_msi {
36 struct msi_bitmap bitmap; 38 struct msi_bitmap bitmap;
37 39
38 struct list_head list; /* support multiple MSI banks */ 40 struct list_head list; /* support multiple MSI banks */
41
42 phandle phandle;
39}; 43};
40 44
41#endif /* _POWERPC_SYSDEV_FSL_MSI_H */ 45#endif /* _POWERPC_SYSDEV_FSL_MSI_H */
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4ce547e00473..3b61e8cf3421 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -65,6 +65,30 @@ static int __init fsl_pcie_check_link(struct pci_controller *hose)
65} 65}
66 66
67#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx) 67#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
68
69#define MAX_PHYS_ADDR_BITS 40
70static u64 pci64_dma_offset = 1ull << MAX_PHYS_ADDR_BITS;
71
72static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
73{
74 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
75 return -EIO;
76
77 /*
78 * Fixup PCI devices that are able to DMA to above the physical
79 * address width of the SoC such that we can address any internal
80 * SoC address from across PCI if needed
81 */
82 if ((dev->bus == &pci_bus_type) &&
83 dma_mask >= DMA_BIT_MASK(MAX_PHYS_ADDR_BITS)) {
84 set_dma_ops(dev, &dma_direct_ops);
85 set_dma_offset(dev, pci64_dma_offset);
86 }
87
88 *dev->dma_mask = dma_mask;
89 return 0;
90}
91
68static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, 92static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
69 unsigned int index, const struct resource *res, 93 unsigned int index, const struct resource *res,
70 resource_size_t offset) 94 resource_size_t offset)
@@ -113,6 +137,8 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
113 u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL | 137 u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL |
114 PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP; 138 PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP;
115 char *name = hose->dn->full_name; 139 char *name = hose->dn->full_name;
140 const u64 *reg;
141 int len;
116 142
117 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", 143 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
118 (u64)rsrc->start, (u64)resource_size(rsrc)); 144 (u64)rsrc->start, (u64)resource_size(rsrc));
@@ -205,6 +231,33 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
205 231
206 /* Setup inbound mem window */ 232 /* Setup inbound mem window */
207 mem = memblock_end_of_DRAM(); 233 mem = memblock_end_of_DRAM();
234
235 /*
236 * The msi-address-64 property, if it exists, indicates the physical
237 * address of the MSIIR register. Normally, this register is located
238 * inside CCSR, so the ATMU that covers all of CCSR is used. But if
239 * this property exists, then we normally need to create a new ATMU
240 * for it. For now, however, we cheat. The only entity that creates
241 * this property is the Freescale hypervisor, and the address is
242 * specified in the partition configuration. Typically, the address
243 * is located in the page immediately after the end of DDR. If so, we
244 * can avoid allocating a new ATMU by extending the DDR ATMU by one
245 * page.
246 */
247 reg = of_get_property(hose->dn, "msi-address-64", &len);
248 if (reg && (len == sizeof(u64))) {
249 u64 address = be64_to_cpup(reg);
250
251 if ((address >= mem) && (address < (mem + PAGE_SIZE))) {
252 pr_info("%s: extending DDR ATMU to cover MSIIR", name);
253 mem += PAGE_SIZE;
254 } else {
255 /* TODO: Create a new ATMU for MSIIR */
256 pr_warn("%s: msi-address-64 address of %llx is "
257 "unsupported\n", name, address);
258 }
259 }
260
208 sz = min(mem, paddr_lo); 261 sz = min(mem, paddr_lo);
209 mem_log = __ilog2_u64(sz); 262 mem_log = __ilog2_u64(sz);
210 263
@@ -228,6 +281,37 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
228 281
229 hose->dma_window_base_cur = 0x00000000; 282 hose->dma_window_base_cur = 0x00000000;
230 hose->dma_window_size = (resource_size_t)sz; 283 hose->dma_window_size = (resource_size_t)sz;
284
285 /*
286 * if we have >4G of memory setup second PCI inbound window to
287 * let devices that are 64-bit address capable to work w/o
288 * SWIOTLB and access the full range of memory
289 */
290 if (sz != mem) {
291 mem_log = __ilog2_u64(mem);
292
293 /* Size window up if we dont fit in exact power-of-2 */
294 if ((1ull << mem_log) != mem)
295 mem_log++;
296
297 piwar = (piwar & ~PIWAR_SZ_MASK) | (mem_log - 1);
298
299 /* Setup inbound memory window */
300 out_be32(&pci->piw[win_idx].pitar, 0x00000000);
301 out_be32(&pci->piw[win_idx].piwbear,
302 pci64_dma_offset >> 44);
303 out_be32(&pci->piw[win_idx].piwbar,
304 pci64_dma_offset >> 12);
305 out_be32(&pci->piw[win_idx].piwar, piwar);
306
307 /*
308 * install our own dma_set_mask handler to fixup dma_ops
309 * and dma_offset
310 */
311 ppc_md.dma_set_mask = fsl_pci_dma_set_mask;
312
313 pr_info("%s: Setup 64-bit PCI DMA window\n", name);
314 }
231 } else { 315 } else {
232 u64 paddr = 0; 316 u64 paddr = 0;
233 317
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 22ffccd8bef5..a4c4f4a932d8 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -10,7 +10,7 @@
10 * - Added Port-Write message handling 10 * - Added Port-Write message handling
11 * - Added Machine Check exception handling 11 * - Added Machine Check exception handling
12 * 12 *
13 * Copyright (C) 2007, 2008, 2010 Freescale Semiconductor, Inc. 13 * Copyright (C) 2007, 2008, 2010, 2011 Freescale Semiconductor, Inc.
14 * Zhang Wei <wei.zhang@freescale.com> 14 * Zhang Wei <wei.zhang@freescale.com>
15 * 15 *
16 * Copyright 2005 MontaVista Software, Inc. 16 * Copyright 2005 MontaVista Software, Inc.
@@ -28,240 +28,33 @@
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/rio.h>
32#include <linux/rio_drv.h>
33#include <linux/of_platform.h> 31#include <linux/of_platform.h>
34#include <linux/delay.h> 32#include <linux/delay.h>
35#include <linux/slab.h> 33#include <linux/slab.h>
36#include <linux/kfifo.h>
37 34
38#include <asm/io.h> 35#include <linux/io.h>
36#include <linux/uaccess.h>
39#include <asm/machdep.h> 37#include <asm/machdep.h>
40#include <asm/uaccess.h>
41 38
42#undef DEBUG_PW /* Port-Write debugging */ 39#include "fsl_rio.h"
43 40
44/* RapidIO definition irq, which read from OF-tree */ 41#undef DEBUG_PW /* Port-Write debugging */
45#define IRQ_RIO_BELL(m) (((struct rio_priv *)(m->priv))->bellirq)
46#define IRQ_RIO_TX(m) (((struct rio_priv *)(m->priv))->txirq)
47#define IRQ_RIO_RX(m) (((struct rio_priv *)(m->priv))->rxirq)
48#define IRQ_RIO_PW(m) (((struct rio_priv *)(m->priv))->pwirq)
49
50#define IPWSR_CLEAR 0x98
51#define OMSR_CLEAR 0x1cb3
52#define IMSR_CLEAR 0x491
53#define IDSR_CLEAR 0x91
54#define ODSR_CLEAR 0x1c00
55#define LTLEECSR_ENABLE_ALL 0xFFC000FC
56#define ESCSR_CLEAR 0x07120204
57#define IECSR_CLEAR 0x80000000
58 42
59#define RIO_PORT1_EDCSR 0x0640 43#define RIO_PORT1_EDCSR 0x0640
60#define RIO_PORT2_EDCSR 0x0680 44#define RIO_PORT2_EDCSR 0x0680
61#define RIO_PORT1_IECSR 0x10130 45#define RIO_PORT1_IECSR 0x10130
62#define RIO_PORT2_IECSR 0x101B0 46#define RIO_PORT2_IECSR 0x101B0
63#define RIO_IM0SR 0x13064 47
64#define RIO_IM1SR 0x13164
65#define RIO_OM0SR 0x13004
66#define RIO_OM1SR 0x13104
67
68#define RIO_ATMU_REGS_OFFSET 0x10c00
69#define RIO_P_MSG_REGS_OFFSET 0x11000
70#define RIO_S_MSG_REGS_OFFSET 0x13000
71#define RIO_GCCSR 0x13c 48#define RIO_GCCSR 0x13c
72#define RIO_ESCSR 0x158 49#define RIO_ESCSR 0x158
50#define ESCSR_CLEAR 0x07120204
73#define RIO_PORT2_ESCSR 0x178 51#define RIO_PORT2_ESCSR 0x178
74#define RIO_CCSR 0x15c 52#define RIO_CCSR 0x15c
75#define RIO_LTLEDCSR 0x0608
76#define RIO_LTLEDCSR_IER 0x80000000 53#define RIO_LTLEDCSR_IER 0x80000000
77#define RIO_LTLEDCSR_PRT 0x01000000 54#define RIO_LTLEDCSR_PRT 0x01000000
78#define RIO_LTLEECSR 0x060c 55#define IECSR_CLEAR 0x80000000
79#define RIO_EPWISR 0x10010
80#define RIO_ISR_AACR 0x10120 56#define RIO_ISR_AACR 0x10120
81#define RIO_ISR_AACR_AA 0x1 /* Accept All ID */ 57#define RIO_ISR_AACR_AA 0x1 /* Accept All ID */
82#define RIO_MAINT_WIN_SIZE 0x400000
83#define RIO_DBELL_WIN_SIZE 0x1000
84
85#define RIO_MSG_OMR_MUI 0x00000002
86#define RIO_MSG_OSR_TE 0x00000080
87#define RIO_MSG_OSR_QOI 0x00000020
88#define RIO_MSG_OSR_QFI 0x00000010
89#define RIO_MSG_OSR_MUB 0x00000004
90#define RIO_MSG_OSR_EOMI 0x00000002
91#define RIO_MSG_OSR_QEI 0x00000001
92
93#define RIO_MSG_IMR_MI 0x00000002
94#define RIO_MSG_ISR_TE 0x00000080
95#define RIO_MSG_ISR_QFI 0x00000010
96#define RIO_MSG_ISR_DIQI 0x00000001
97
98#define RIO_IPWMR_SEN 0x00100000
99#define RIO_IPWMR_QFIE 0x00000100
100#define RIO_IPWMR_EIE 0x00000020
101#define RIO_IPWMR_CQ 0x00000002
102#define RIO_IPWMR_PWE 0x00000001
103
104#define RIO_IPWSR_QF 0x00100000
105#define RIO_IPWSR_TE 0x00000080
106#define RIO_IPWSR_QFI 0x00000010
107#define RIO_IPWSR_PWD 0x00000008
108#define RIO_IPWSR_PWB 0x00000004
109
110/* EPWISR Error match value */
111#define RIO_EPWISR_PINT1 0x80000000
112#define RIO_EPWISR_PINT2 0x40000000
113#define RIO_EPWISR_MU 0x00000002
114#define RIO_EPWISR_PW 0x00000001
115
116#define RIO_MSG_DESC_SIZE 32
117#define RIO_MSG_BUFFER_SIZE 4096
118#define RIO_MIN_TX_RING_SIZE 2
119#define RIO_MAX_TX_RING_SIZE 2048
120#define RIO_MIN_RX_RING_SIZE 2
121#define RIO_MAX_RX_RING_SIZE 2048
122
123#define DOORBELL_DMR_DI 0x00000002
124#define DOORBELL_DSR_TE 0x00000080
125#define DOORBELL_DSR_QFI 0x00000010
126#define DOORBELL_DSR_DIQI 0x00000001
127#define DOORBELL_TID_OFFSET 0x02
128#define DOORBELL_SID_OFFSET 0x04
129#define DOORBELL_INFO_OFFSET 0x06
130
131#define DOORBELL_MESSAGE_SIZE 0x08
132#define DBELL_SID(x) (*(u16 *)(x + DOORBELL_SID_OFFSET))
133#define DBELL_TID(x) (*(u16 *)(x + DOORBELL_TID_OFFSET))
134#define DBELL_INF(x) (*(u16 *)(x + DOORBELL_INFO_OFFSET))
135
136struct rio_atmu_regs {
137 u32 rowtar;
138 u32 rowtear;
139 u32 rowbar;
140 u32 pad2;
141 u32 rowar;
142 u32 pad3[3];
143};
144
145struct rio_msg_regs {
146 u32 omr; /* 0xD_3000 - Outbound message 0 mode register */
147 u32 osr; /* 0xD_3004 - Outbound message 0 status register */
148 u32 pad1;
149 u32 odqdpar; /* 0xD_300C - Outbound message 0 descriptor queue
150 dequeue pointer address register */
151 u32 pad2;
152 u32 osar; /* 0xD_3014 - Outbound message 0 source address
153 register */
154 u32 odpr; /* 0xD_3018 - Outbound message 0 destination port
155 register */
156 u32 odatr; /* 0xD_301C - Outbound message 0 destination attributes
157 Register*/
158 u32 odcr; /* 0xD_3020 - Outbound message 0 double-word count
159 register */
160 u32 pad3;
161 u32 odqepar; /* 0xD_3028 - Outbound message 0 descriptor queue
162 enqueue pointer address register */
163 u32 pad4[13];
164 u32 imr; /* 0xD_3060 - Inbound message 0 mode register */
165 u32 isr; /* 0xD_3064 - Inbound message 0 status register */
166 u32 pad5;
167 u32 ifqdpar; /* 0xD_306C - Inbound message 0 frame queue dequeue
168 pointer address register*/
169 u32 pad6;
170 u32 ifqepar; /* 0xD_3074 - Inbound message 0 frame queue enqueue
171 pointer address register */
172 u32 pad7[226];
173 u32 odmr; /* 0xD_3400 - Outbound doorbell mode register */
174 u32 odsr; /* 0xD_3404 - Outbound doorbell status register */
175 u32 res0[4];
176 u32 oddpr; /* 0xD_3418 - Outbound doorbell destination port
177 register */
178 u32 oddatr; /* 0xD_341c - Outbound doorbell destination attributes
179 register */
180 u32 res1[3];
181 u32 odretcr; /* 0xD_342C - Outbound doorbell retry error threshold
182 configuration register */
183 u32 res2[12];
184 u32 dmr; /* 0xD_3460 - Inbound doorbell mode register */
185 u32 dsr; /* 0xD_3464 - Inbound doorbell status register */
186 u32 pad8;
187 u32 dqdpar; /* 0xD_346C - Inbound doorbell queue dequeue Pointer
188 address register */
189 u32 pad9;
190 u32 dqepar; /* 0xD_3474 - Inbound doorbell Queue enqueue pointer
191 address register */
192 u32 pad10[26];
193 u32 pwmr; /* 0xD_34E0 - Inbound port-write mode register */
194 u32 pwsr; /* 0xD_34E4 - Inbound port-write status register */
195 u32 epwqbar; /* 0xD_34E8 - Extended Port-Write Queue Base Address
196 register */
197 u32 pwqbar; /* 0xD_34EC - Inbound port-write queue base address
198 register */
199};
200
201struct rio_tx_desc {
202 u32 res1;
203 u32 saddr;
204 u32 dport;
205 u32 dattr;
206 u32 res2;
207 u32 res3;
208 u32 dwcnt;
209 u32 res4;
210};
211
212struct rio_dbell_ring {
213 void *virt;
214 dma_addr_t phys;
215};
216
217struct rio_msg_tx_ring {
218 void *virt;
219 dma_addr_t phys;
220 void *virt_buffer[RIO_MAX_TX_RING_SIZE];
221 dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
222 int tx_slot;
223 int size;
224 void *dev_id;
225};
226
227struct rio_msg_rx_ring {
228 void *virt;
229 dma_addr_t phys;
230 void *virt_buffer[RIO_MAX_RX_RING_SIZE];
231 int rx_slot;
232 int size;
233 void *dev_id;
234};
235
236struct rio_port_write_msg {
237 void *virt;
238 dma_addr_t phys;
239 u32 msg_count;
240 u32 err_count;
241 u32 discard_count;
242};
243
244struct rio_priv {
245 struct device *dev;
246 void __iomem *regs_win;
247 struct rio_atmu_regs __iomem *atmu_regs;
248 struct rio_atmu_regs __iomem *maint_atmu_regs;
249 struct rio_atmu_regs __iomem *dbell_atmu_regs;
250 void __iomem *dbell_win;
251 void __iomem *maint_win;
252 struct rio_msg_regs __iomem *msg_regs;
253 struct rio_dbell_ring dbell_ring;
254 struct rio_msg_tx_ring msg_tx_ring;
255 struct rio_msg_rx_ring msg_rx_ring;
256 struct rio_port_write_msg port_write_msg;
257 int bellirq;
258 int txirq;
259 int rxirq;
260 int pwirq;
261 struct work_struct pw_work;
262 struct kfifo pw_fifo;
263 spinlock_t pw_fifo_lock;
264};
265 58
266#define __fsl_read_rio_config(x, addr, err, op) \ 59#define __fsl_read_rio_config(x, addr, err, op) \
267 __asm__ __volatile__( \ 60 __asm__ __volatile__( \
@@ -279,7 +72,12 @@ struct rio_priv {
279 : "=r" (err), "=r" (x) \ 72 : "=r" (err), "=r" (x) \
280 : "b" (addr), "i" (-EFAULT), "0" (err)) 73 : "b" (addr), "i" (-EFAULT), "0" (err))
281 74
282static void __iomem *rio_regs_win; 75void __iomem *rio_regs_win;
76void __iomem *rmu_regs_win;
77resource_size_t rio_law_start;
78
79struct fsl_rio_dbell *dbell;
80struct fsl_rio_pw *pw;
283 81
284#ifdef CONFIG_E500 82#ifdef CONFIG_E500
285int fsl_rio_mcheck_exception(struct pt_regs *regs) 83int fsl_rio_mcheck_exception(struct pt_regs *regs)
@@ -311,42 +109,6 @@ EXPORT_SYMBOL_GPL(fsl_rio_mcheck_exception);
311#endif 109#endif
312 110
313/** 111/**
314 * fsl_rio_doorbell_send - Send a MPC85xx doorbell message
315 * @mport: RapidIO master port info
316 * @index: ID of RapidIO interface
317 * @destid: Destination ID of target device
318 * @data: 16-bit info field of RapidIO doorbell message
319 *
320 * Sends a MPC85xx doorbell message. Returns %0 on success or
321 * %-EINVAL on failure.
322 */
323static int fsl_rio_doorbell_send(struct rio_mport *mport,
324 int index, u16 destid, u16 data)
325{
326 struct rio_priv *priv = mport->priv;
327 pr_debug("fsl_doorbell_send: index %d destid %4.4x data %4.4x\n",
328 index, destid, data);
329 switch (mport->phy_type) {
330 case RIO_PHY_PARALLEL:
331 out_be32(&priv->dbell_atmu_regs->rowtar, destid << 22);
332 out_be16(priv->dbell_win, data);
333 break;
334 case RIO_PHY_SERIAL:
335 /* In the serial version silicons, such as MPC8548, MPC8641,
336 * below operations is must be.
337 */
338 out_be32(&priv->msg_regs->odmr, 0x00000000);
339 out_be32(&priv->msg_regs->odretcr, 0x00000004);
340 out_be32(&priv->msg_regs->oddpr, destid << 16);
341 out_be32(&priv->msg_regs->oddatr, data);
342 out_be32(&priv->msg_regs->odmr, 0x00000001);
343 break;
344 }
345
346 return 0;
347}
348
349/**
350 * fsl_local_config_read - Generate a MPC85xx local config space read 112 * fsl_local_config_read - Generate a MPC85xx local config space read
351 * @mport: RapidIO master port info 113 * @mport: RapidIO master port info
352 * @index: ID of RapdiIO interface 114 * @index: ID of RapdiIO interface
@@ -384,8 +146,8 @@ static int fsl_local_config_write(struct rio_mport *mport,
384{ 146{
385 struct rio_priv *priv = mport->priv; 147 struct rio_priv *priv = mport->priv;
386 pr_debug 148 pr_debug
387 ("fsl_local_config_write: index %d offset %8.8x data %8.8x\n", 149 ("fsl_local_config_write: index %d offset %8.8x data %8.8x\n",
388 index, offset, data); 150 index, offset, data);
389 out_be32(priv->regs_win + offset, data); 151 out_be32(priv->regs_win + offset, data);
390 152
391 return 0; 153 return 0;
@@ -413,8 +175,9 @@ fsl_rio_config_read(struct rio_mport *mport, int index, u16 destid,
413 u32 rval, err = 0; 175 u32 rval, err = 0;
414 176
415 pr_debug 177 pr_debug
416 ("fsl_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n", 178 ("fsl_rio_config_read:"
417 index, destid, hopcount, offset, len); 179 " index %d destid %d hopcount %d offset %8.8x len %d\n",
180 index, destid, hopcount, offset, len);
418 181
419 /* 16MB maintenance window possible */ 182 /* 16MB maintenance window possible */
420 /* allow only aligned access to maintenance registers */ 183 /* allow only aligned access to maintenance registers */
@@ -423,7 +186,7 @@ fsl_rio_config_read(struct rio_mport *mport, int index, u16 destid,
423 186
424 out_be32(&priv->maint_atmu_regs->rowtar, 187 out_be32(&priv->maint_atmu_regs->rowtar,
425 (destid << 22) | (hopcount << 12) | (offset >> 12)); 188 (destid << 22) | (hopcount << 12) | (offset >> 12));
426 out_be32(&priv->maint_atmu_regs->rowtear, (destid >> 10)); 189 out_be32(&priv->maint_atmu_regs->rowtear, (destid >> 10));
427 190
428 data = (u8 *) priv->maint_win + (offset & (RIO_MAINT_WIN_SIZE - 1)); 191 data = (u8 *) priv->maint_win + (offset & (RIO_MAINT_WIN_SIZE - 1));
429 switch (len) { 192 switch (len) {
@@ -470,8 +233,9 @@ fsl_rio_config_write(struct rio_mport *mport, int index, u16 destid,
470 struct rio_priv *priv = mport->priv; 233 struct rio_priv *priv = mport->priv;
471 u8 *data; 234 u8 *data;
472 pr_debug 235 pr_debug
473 ("fsl_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n", 236 ("fsl_rio_config_write:"
474 index, destid, hopcount, offset, len, val); 237 " index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
238 index, destid, hopcount, offset, len, val);
475 239
476 /* 16MB maintenance windows possible */ 240 /* 16MB maintenance windows possible */
477 /* allow only aligned access to maintenance registers */ 241 /* allow only aligned access to maintenance registers */
@@ -480,7 +244,7 @@ fsl_rio_config_write(struct rio_mport *mport, int index, u16 destid,
480 244
481 out_be32(&priv->maint_atmu_regs->rowtar, 245 out_be32(&priv->maint_atmu_regs->rowtar,
482 (destid << 22) | (hopcount << 12) | (offset >> 12)); 246 (destid << 22) | (hopcount << 12) | (offset >> 12));
483 out_be32(&priv->maint_atmu_regs->rowtear, (destid >> 10)); 247 out_be32(&priv->maint_atmu_regs->rowtear, (destid >> 10));
484 248
485 data = (u8 *) priv->maint_win + (offset & (RIO_MAINT_WIN_SIZE - 1)); 249 data = (u8 *) priv->maint_win + (offset & (RIO_MAINT_WIN_SIZE - 1));
486 switch (len) { 250 switch (len) {
@@ -500,590 +264,7 @@ fsl_rio_config_write(struct rio_mport *mport, int index, u16 destid,
500 return 0; 264 return 0;
501} 265}
502 266
503/** 267void fsl_rio_port_error_handler(int offset)
504 * fsl_add_outb_message - Add message to the MPC85xx outbound message queue
505 * @mport: Master port with outbound message queue
506 * @rdev: Target of outbound message
507 * @mbox: Outbound mailbox
508 * @buffer: Message to add to outbound queue
509 * @len: Length of message
510 *
511 * Adds the @buffer message to the MPC85xx outbound message queue. Returns
512 * %0 on success or %-EINVAL on failure.
513 */
514static int
515fsl_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
516 void *buffer, size_t len)
517{
518 struct rio_priv *priv = mport->priv;
519 u32 omr;
520 struct rio_tx_desc *desc = (struct rio_tx_desc *)priv->msg_tx_ring.virt
521 + priv->msg_tx_ring.tx_slot;
522 int ret = 0;
523
524 pr_debug("RIO: fsl_add_outb_message(): destid %4.4x mbox %d buffer " \
525 "%8.8x len %8.8x\n", rdev->destid, mbox, (int)buffer, len);
526
527 if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
528 ret = -EINVAL;
529 goto out;
530 }
531
532 /* Copy and clear rest of buffer */
533 memcpy(priv->msg_tx_ring.virt_buffer[priv->msg_tx_ring.tx_slot], buffer,
534 len);
535 if (len < (RIO_MAX_MSG_SIZE - 4))
536 memset(priv->msg_tx_ring.virt_buffer[priv->msg_tx_ring.tx_slot]
537 + len, 0, RIO_MAX_MSG_SIZE - len);
538
539 switch (mport->phy_type) {
540 case RIO_PHY_PARALLEL:
541 /* Set mbox field for message */
542 desc->dport = mbox & 0x3;
543
544 /* Enable EOMI interrupt, set priority, and set destid */
545 desc->dattr = 0x28000000 | (rdev->destid << 2);
546 break;
547 case RIO_PHY_SERIAL:
548 /* Set mbox field for message, and set destid */
549 desc->dport = (rdev->destid << 16) | (mbox & 0x3);
550
551 /* Enable EOMI interrupt and priority */
552 desc->dattr = 0x28000000;
553 break;
554 }
555
556 /* Set transfer size aligned to next power of 2 (in double words) */
557 desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
558
559 /* Set snooping and source buffer address */
560 desc->saddr = 0x00000004
561 | priv->msg_tx_ring.phys_buffer[priv->msg_tx_ring.tx_slot];
562
563 /* Increment enqueue pointer */
564 omr = in_be32(&priv->msg_regs->omr);
565 out_be32(&priv->msg_regs->omr, omr | RIO_MSG_OMR_MUI);
566
567 /* Go to next descriptor */
568 if (++priv->msg_tx_ring.tx_slot == priv->msg_tx_ring.size)
569 priv->msg_tx_ring.tx_slot = 0;
570
571 out:
572 return ret;
573}
574
575/**
576 * fsl_rio_tx_handler - MPC85xx outbound message interrupt handler
577 * @irq: Linux interrupt number
578 * @dev_instance: Pointer to interrupt-specific data
579 *
580 * Handles outbound message interrupts. Executes a register outbound
581 * mailbox event handler and acks the interrupt occurrence.
582 */
583static irqreturn_t
584fsl_rio_tx_handler(int irq, void *dev_instance)
585{
586 int osr;
587 struct rio_mport *port = (struct rio_mport *)dev_instance;
588 struct rio_priv *priv = port->priv;
589
590 osr = in_be32(&priv->msg_regs->osr);
591
592 if (osr & RIO_MSG_OSR_TE) {
593 pr_info("RIO: outbound message transmission error\n");
594 out_be32(&priv->msg_regs->osr, RIO_MSG_OSR_TE);
595 goto out;
596 }
597
598 if (osr & RIO_MSG_OSR_QOI) {
599 pr_info("RIO: outbound message queue overflow\n");
600 out_be32(&priv->msg_regs->osr, RIO_MSG_OSR_QOI);
601 goto out;
602 }
603
604 if (osr & RIO_MSG_OSR_EOMI) {
605 u32 dqp = in_be32(&priv->msg_regs->odqdpar);
606 int slot = (dqp - priv->msg_tx_ring.phys) >> 5;
607 port->outb_msg[0].mcback(port, priv->msg_tx_ring.dev_id, -1,
608 slot);
609
610 /* Ack the end-of-message interrupt */
611 out_be32(&priv->msg_regs->osr, RIO_MSG_OSR_EOMI);
612 }
613
614 out:
615 return IRQ_HANDLED;
616}
617
618/**
619 * fsl_open_outb_mbox - Initialize MPC85xx outbound mailbox
620 * @mport: Master port implementing the outbound message unit
621 * @dev_id: Device specific pointer to pass on event
622 * @mbox: Mailbox to open
623 * @entries: Number of entries in the outbound mailbox ring
624 *
625 * Initializes buffer ring, request the outbound message interrupt,
626 * and enables the outbound message unit. Returns %0 on success and
627 * %-EINVAL or %-ENOMEM on failure.
628 */
629static int
630fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
631{
632 int i, j, rc = 0;
633 struct rio_priv *priv = mport->priv;
634
635 if ((entries < RIO_MIN_TX_RING_SIZE) ||
636 (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
637 rc = -EINVAL;
638 goto out;
639 }
640
641 /* Initialize shadow copy ring */
642 priv->msg_tx_ring.dev_id = dev_id;
643 priv->msg_tx_ring.size = entries;
644
645 for (i = 0; i < priv->msg_tx_ring.size; i++) {
646 priv->msg_tx_ring.virt_buffer[i] =
647 dma_alloc_coherent(priv->dev, RIO_MSG_BUFFER_SIZE,
648 &priv->msg_tx_ring.phys_buffer[i], GFP_KERNEL);
649 if (!priv->msg_tx_ring.virt_buffer[i]) {
650 rc = -ENOMEM;
651 for (j = 0; j < priv->msg_tx_ring.size; j++)
652 if (priv->msg_tx_ring.virt_buffer[j])
653 dma_free_coherent(priv->dev,
654 RIO_MSG_BUFFER_SIZE,
655 priv->msg_tx_ring.
656 virt_buffer[j],
657 priv->msg_tx_ring.
658 phys_buffer[j]);
659 goto out;
660 }
661 }
662
663 /* Initialize outbound message descriptor ring */
664 priv->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
665 priv->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
666 &priv->msg_tx_ring.phys, GFP_KERNEL);
667 if (!priv->msg_tx_ring.virt) {
668 rc = -ENOMEM;
669 goto out_dma;
670 }
671 memset(priv->msg_tx_ring.virt, 0,
672 priv->msg_tx_ring.size * RIO_MSG_DESC_SIZE);
673 priv->msg_tx_ring.tx_slot = 0;
674
675 /* Point dequeue/enqueue pointers at first entry in ring */
676 out_be32(&priv->msg_regs->odqdpar, priv->msg_tx_ring.phys);
677 out_be32(&priv->msg_regs->odqepar, priv->msg_tx_ring.phys);
678
679 /* Configure for snooping */
680 out_be32(&priv->msg_regs->osar, 0x00000004);
681
682 /* Clear interrupt status */
683 out_be32(&priv->msg_regs->osr, 0x000000b3);
684
685 /* Hook up outbound message handler */
686 rc = request_irq(IRQ_RIO_TX(mport), fsl_rio_tx_handler, 0,
687 "msg_tx", (void *)mport);
688 if (rc < 0)
689 goto out_irq;
690
691 /*
692 * Configure outbound message unit
693 * Snooping
694 * Interrupts (all enabled, except QEIE)
695 * Chaining mode
696 * Disable
697 */
698 out_be32(&priv->msg_regs->omr, 0x00100220);
699
700 /* Set number of entries */
701 out_be32(&priv->msg_regs->omr,
702 in_be32(&priv->msg_regs->omr) |
703 ((get_bitmask_order(entries) - 2) << 12));
704
705 /* Now enable the unit */
706 out_be32(&priv->msg_regs->omr, in_be32(&priv->msg_regs->omr) | 0x1);
707
708 out:
709 return rc;
710
711 out_irq:
712 dma_free_coherent(priv->dev,
713 priv->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
714 priv->msg_tx_ring.virt, priv->msg_tx_ring.phys);
715
716 out_dma:
717 for (i = 0; i < priv->msg_tx_ring.size; i++)
718 dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE,
719 priv->msg_tx_ring.virt_buffer[i],
720 priv->msg_tx_ring.phys_buffer[i]);
721
722 return rc;
723}
724
725/**
726 * fsl_close_outb_mbox - Shut down MPC85xx outbound mailbox
727 * @mport: Master port implementing the outbound message unit
728 * @mbox: Mailbox to close
729 *
730 * Disables the outbound message unit, free all buffers, and
731 * frees the outbound message interrupt.
732 */
733static void fsl_close_outb_mbox(struct rio_mport *mport, int mbox)
734{
735 struct rio_priv *priv = mport->priv;
736 /* Disable inbound message unit */
737 out_be32(&priv->msg_regs->omr, 0);
738
739 /* Free ring */
740 dma_free_coherent(priv->dev,
741 priv->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
742 priv->msg_tx_ring.virt, priv->msg_tx_ring.phys);
743
744 /* Free interrupt */
745 free_irq(IRQ_RIO_TX(mport), (void *)mport);
746}
747
748/**
749 * fsl_rio_rx_handler - MPC85xx inbound message interrupt handler
750 * @irq: Linux interrupt number
751 * @dev_instance: Pointer to interrupt-specific data
752 *
753 * Handles inbound message interrupts. Executes a registered inbound
754 * mailbox event handler and acks the interrupt occurrence.
755 */
756static irqreturn_t
757fsl_rio_rx_handler(int irq, void *dev_instance)
758{
759 int isr;
760 struct rio_mport *port = (struct rio_mport *)dev_instance;
761 struct rio_priv *priv = port->priv;
762
763 isr = in_be32(&priv->msg_regs->isr);
764
765 if (isr & RIO_MSG_ISR_TE) {
766 pr_info("RIO: inbound message reception error\n");
767 out_be32((void *)&priv->msg_regs->isr, RIO_MSG_ISR_TE);
768 goto out;
769 }
770
771 /* XXX Need to check/dispatch until queue empty */
772 if (isr & RIO_MSG_ISR_DIQI) {
773 /*
774 * We implement *only* mailbox 0, but can receive messages
775 * for any mailbox/letter to that mailbox destination. So,
776 * make the callback with an unknown/invalid mailbox number
777 * argument.
778 */
779 port->inb_msg[0].mcback(port, priv->msg_rx_ring.dev_id, -1, -1);
780
781 /* Ack the queueing interrupt */
782 out_be32(&priv->msg_regs->isr, RIO_MSG_ISR_DIQI);
783 }
784
785 out:
786 return IRQ_HANDLED;
787}
788
789/**
790 * fsl_open_inb_mbox - Initialize MPC85xx inbound mailbox
791 * @mport: Master port implementing the inbound message unit
792 * @dev_id: Device specific pointer to pass on event
793 * @mbox: Mailbox to open
794 * @entries: Number of entries in the inbound mailbox ring
795 *
796 * Initializes buffer ring, request the inbound message interrupt,
797 * and enables the inbound message unit. Returns %0 on success
798 * and %-EINVAL or %-ENOMEM on failure.
799 */
800static int
801fsl_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
802{
803 int i, rc = 0;
804 struct rio_priv *priv = mport->priv;
805
806 if ((entries < RIO_MIN_RX_RING_SIZE) ||
807 (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
808 rc = -EINVAL;
809 goto out;
810 }
811
812 /* Initialize client buffer ring */
813 priv->msg_rx_ring.dev_id = dev_id;
814 priv->msg_rx_ring.size = entries;
815 priv->msg_rx_ring.rx_slot = 0;
816 for (i = 0; i < priv->msg_rx_ring.size; i++)
817 priv->msg_rx_ring.virt_buffer[i] = NULL;
818
819 /* Initialize inbound message ring */
820 priv->msg_rx_ring.virt = dma_alloc_coherent(priv->dev,
821 priv->msg_rx_ring.size * RIO_MAX_MSG_SIZE,
822 &priv->msg_rx_ring.phys, GFP_KERNEL);
823 if (!priv->msg_rx_ring.virt) {
824 rc = -ENOMEM;
825 goto out;
826 }
827
828 /* Point dequeue/enqueue pointers at first entry in ring */
829 out_be32(&priv->msg_regs->ifqdpar, (u32) priv->msg_rx_ring.phys);
830 out_be32(&priv->msg_regs->ifqepar, (u32) priv->msg_rx_ring.phys);
831
832 /* Clear interrupt status */
833 out_be32(&priv->msg_regs->isr, 0x00000091);
834
835 /* Hook up inbound message handler */
836 rc = request_irq(IRQ_RIO_RX(mport), fsl_rio_rx_handler, 0,
837 "msg_rx", (void *)mport);
838 if (rc < 0) {
839 dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE,
840 priv->msg_tx_ring.virt_buffer[i],
841 priv->msg_tx_ring.phys_buffer[i]);
842 goto out;
843 }
844
845 /*
846 * Configure inbound message unit:
847 * Snooping
848 * 4KB max message size
849 * Unmask all interrupt sources
850 * Disable
851 */
852 out_be32(&priv->msg_regs->imr, 0x001b0060);
853
854 /* Set number of queue entries */
855 setbits32(&priv->msg_regs->imr, (get_bitmask_order(entries) - 2) << 12);
856
857 /* Now enable the unit */
858 setbits32(&priv->msg_regs->imr, 0x1);
859
860 out:
861 return rc;
862}
863
864/**
865 * fsl_close_inb_mbox - Shut down MPC85xx inbound mailbox
866 * @mport: Master port implementing the inbound message unit
867 * @mbox: Mailbox to close
868 *
869 * Disables the inbound message unit, free all buffers, and
870 * frees the inbound message interrupt.
871 */
872static void fsl_close_inb_mbox(struct rio_mport *mport, int mbox)
873{
874 struct rio_priv *priv = mport->priv;
875 /* Disable inbound message unit */
876 out_be32(&priv->msg_regs->imr, 0);
877
878 /* Free ring */
879 dma_free_coherent(priv->dev, priv->msg_rx_ring.size * RIO_MAX_MSG_SIZE,
880 priv->msg_rx_ring.virt, priv->msg_rx_ring.phys);
881
882 /* Free interrupt */
883 free_irq(IRQ_RIO_RX(mport), (void *)mport);
884}
885
886/**
887 * fsl_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
888 * @mport: Master port implementing the inbound message unit
889 * @mbox: Inbound mailbox number
890 * @buf: Buffer to add to inbound queue
891 *
892 * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
893 * %0 on success or %-EINVAL on failure.
894 */
895static int fsl_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
896{
897 int rc = 0;
898 struct rio_priv *priv = mport->priv;
899
900 pr_debug("RIO: fsl_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
901 priv->msg_rx_ring.rx_slot);
902
903 if (priv->msg_rx_ring.virt_buffer[priv->msg_rx_ring.rx_slot]) {
904 printk(KERN_ERR
905 "RIO: error adding inbound buffer %d, buffer exists\n",
906 priv->msg_rx_ring.rx_slot);
907 rc = -EINVAL;
908 goto out;
909 }
910
911 priv->msg_rx_ring.virt_buffer[priv->msg_rx_ring.rx_slot] = buf;
912 if (++priv->msg_rx_ring.rx_slot == priv->msg_rx_ring.size)
913 priv->msg_rx_ring.rx_slot = 0;
914
915 out:
916 return rc;
917}
918
919/**
920 * fsl_get_inb_message - Fetch inbound message from the MPC85xx message unit
921 * @mport: Master port implementing the inbound message unit
922 * @mbox: Inbound mailbox number
923 *
924 * Gets the next available inbound message from the inbound message queue.
925 * A pointer to the message is returned on success or NULL on failure.
926 */
927static void *fsl_get_inb_message(struct rio_mport *mport, int mbox)
928{
929 struct rio_priv *priv = mport->priv;
930 u32 phys_buf, virt_buf;
931 void *buf = NULL;
932 int buf_idx;
933
934 phys_buf = in_be32(&priv->msg_regs->ifqdpar);
935
936 /* If no more messages, then bail out */
937 if (phys_buf == in_be32(&priv->msg_regs->ifqepar))
938 goto out2;
939
940 virt_buf = (u32) priv->msg_rx_ring.virt + (phys_buf
941 - priv->msg_rx_ring.phys);
942 buf_idx = (phys_buf - priv->msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
943 buf = priv->msg_rx_ring.virt_buffer[buf_idx];
944
945 if (!buf) {
946 printk(KERN_ERR
947 "RIO: inbound message copy failed, no buffers\n");
948 goto out1;
949 }
950
951 /* Copy max message size, caller is expected to allocate that big */
952 memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
953
954 /* Clear the available buffer */
955 priv->msg_rx_ring.virt_buffer[buf_idx] = NULL;
956
957 out1:
958 setbits32(&priv->msg_regs->imr, RIO_MSG_IMR_MI);
959
960 out2:
961 return buf;
962}
963
964/**
965 * fsl_rio_dbell_handler - MPC85xx doorbell interrupt handler
966 * @irq: Linux interrupt number
967 * @dev_instance: Pointer to interrupt-specific data
968 *
969 * Handles doorbell interrupts. Parses a list of registered
970 * doorbell event handlers and executes a matching event handler.
971 */
972static irqreturn_t
973fsl_rio_dbell_handler(int irq, void *dev_instance)
974{
975 int dsr;
976 struct rio_mport *port = (struct rio_mport *)dev_instance;
977 struct rio_priv *priv = port->priv;
978
979 dsr = in_be32(&priv->msg_regs->dsr);
980
981 if (dsr & DOORBELL_DSR_TE) {
982 pr_info("RIO: doorbell reception error\n");
983 out_be32(&priv->msg_regs->dsr, DOORBELL_DSR_TE);
984 goto out;
985 }
986
987 if (dsr & DOORBELL_DSR_QFI) {
988 pr_info("RIO: doorbell queue full\n");
989 out_be32(&priv->msg_regs->dsr, DOORBELL_DSR_QFI);
990 }
991
992 /* XXX Need to check/dispatch until queue empty */
993 if (dsr & DOORBELL_DSR_DIQI) {
994 u32 dmsg =
995 (u32) priv->dbell_ring.virt +
996 (in_be32(&priv->msg_regs->dqdpar) & 0xfff);
997 struct rio_dbell *dbell;
998 int found = 0;
999
1000 pr_debug
1001 ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
1002 DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
1003
1004 list_for_each_entry(dbell, &port->dbells, node) {
1005 if ((dbell->res->start <= DBELL_INF(dmsg)) &&
1006 (dbell->res->end >= DBELL_INF(dmsg))) {
1007 found = 1;
1008 break;
1009 }
1010 }
1011 if (found) {
1012 dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
1013 DBELL_INF(dmsg));
1014 } else {
1015 pr_debug
1016 ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
1017 DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
1018 }
1019 setbits32(&priv->msg_regs->dmr, DOORBELL_DMR_DI);
1020 out_be32(&priv->msg_regs->dsr, DOORBELL_DSR_DIQI);
1021 }
1022
1023 out:
1024 return IRQ_HANDLED;
1025}
1026
1027/**
1028 * fsl_rio_doorbell_init - MPC85xx doorbell interface init
1029 * @mport: Master port implementing the inbound doorbell unit
1030 *
1031 * Initializes doorbell unit hardware and inbound DMA buffer
1032 * ring. Called from fsl_rio_setup(). Returns %0 on success
1033 * or %-ENOMEM on failure.
1034 */
1035static int fsl_rio_doorbell_init(struct rio_mport *mport)
1036{
1037 struct rio_priv *priv = mport->priv;
1038 int rc = 0;
1039
1040 /* Map outbound doorbell window immediately after maintenance window */
1041 priv->dbell_win = ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
1042 RIO_DBELL_WIN_SIZE);
1043 if (!priv->dbell_win) {
1044 printk(KERN_ERR
1045 "RIO: unable to map outbound doorbell window\n");
1046 rc = -ENOMEM;
1047 goto out;
1048 }
1049
1050 /* Initialize inbound doorbells */
1051 priv->dbell_ring.virt = dma_alloc_coherent(priv->dev, 512 *
1052 DOORBELL_MESSAGE_SIZE, &priv->dbell_ring.phys, GFP_KERNEL);
1053 if (!priv->dbell_ring.virt) {
1054 printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
1055 rc = -ENOMEM;
1056 iounmap(priv->dbell_win);
1057 goto out;
1058 }
1059
1060 /* Point dequeue/enqueue pointers at first entry in ring */
1061 out_be32(&priv->msg_regs->dqdpar, (u32) priv->dbell_ring.phys);
1062 out_be32(&priv->msg_regs->dqepar, (u32) priv->dbell_ring.phys);
1063
1064 /* Clear interrupt status */
1065 out_be32(&priv->msg_regs->dsr, 0x00000091);
1066
1067 /* Hook up doorbell handler */
1068 rc = request_irq(IRQ_RIO_BELL(mport), fsl_rio_dbell_handler, 0,
1069 "dbell_rx", (void *)mport);
1070 if (rc < 0) {
1071 iounmap(priv->dbell_win);
1072 dma_free_coherent(priv->dev, 512 * DOORBELL_MESSAGE_SIZE,
1073 priv->dbell_ring.virt, priv->dbell_ring.phys);
1074 printk(KERN_ERR
1075 "MPC85xx RIO: unable to request inbound doorbell irq");
1076 goto out;
1077 }
1078
1079 /* Configure doorbells for snooping, 512 entries, and enable */
1080 out_be32(&priv->msg_regs->dmr, 0x00108161);
1081
1082 out:
1083 return rc;
1084}
1085
1086static void port_error_handler(struct rio_mport *port, int offset)
1087{ 268{
1088 /*XXX: Error recovery is not implemented, we just clear errors */ 269 /*XXX: Error recovery is not implemented, we just clear errors */
1089 out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), 0); 270 out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), 0);
@@ -1098,263 +279,6 @@ static void port_error_handler(struct rio_mport *port, int offset)
1098 out_be32((u32 *)(rio_regs_win + RIO_PORT2_ESCSR), ESCSR_CLEAR); 279 out_be32((u32 *)(rio_regs_win + RIO_PORT2_ESCSR), ESCSR_CLEAR);
1099 } 280 }
1100} 281}
1101
1102static void msg_unit_error_handler(struct rio_mport *port)
1103{
1104 struct rio_priv *priv = port->priv;
1105
1106 /*XXX: Error recovery is not implemented, we just clear errors */
1107 out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), 0);
1108
1109 out_be32((u32 *)(rio_regs_win + RIO_IM0SR), IMSR_CLEAR);
1110 out_be32((u32 *)(rio_regs_win + RIO_IM1SR), IMSR_CLEAR);
1111 out_be32((u32 *)(rio_regs_win + RIO_OM0SR), OMSR_CLEAR);
1112 out_be32((u32 *)(rio_regs_win + RIO_OM1SR), OMSR_CLEAR);
1113
1114 out_be32(&priv->msg_regs->odsr, ODSR_CLEAR);
1115 out_be32(&priv->msg_regs->dsr, IDSR_CLEAR);
1116
1117 out_be32(&priv->msg_regs->pwsr, IPWSR_CLEAR);
1118}
1119
1120/**
1121 * fsl_rio_port_write_handler - MPC85xx port write interrupt handler
1122 * @irq: Linux interrupt number
1123 * @dev_instance: Pointer to interrupt-specific data
1124 *
1125 * Handles port write interrupts. Parses a list of registered
1126 * port write event handlers and executes a matching event handler.
1127 */
1128static irqreturn_t
1129fsl_rio_port_write_handler(int irq, void *dev_instance)
1130{
1131 u32 ipwmr, ipwsr;
1132 struct rio_mport *port = (struct rio_mport *)dev_instance;
1133 struct rio_priv *priv = port->priv;
1134 u32 epwisr, tmp;
1135
1136 epwisr = in_be32(priv->regs_win + RIO_EPWISR);
1137 if (!(epwisr & RIO_EPWISR_PW))
1138 goto pw_done;
1139
1140 ipwmr = in_be32(&priv->msg_regs->pwmr);
1141 ipwsr = in_be32(&priv->msg_regs->pwsr);
1142
1143#ifdef DEBUG_PW
1144 pr_debug("PW Int->IPWMR: 0x%08x IPWSR: 0x%08x (", ipwmr, ipwsr);
1145 if (ipwsr & RIO_IPWSR_QF)
1146 pr_debug(" QF");
1147 if (ipwsr & RIO_IPWSR_TE)
1148 pr_debug(" TE");
1149 if (ipwsr & RIO_IPWSR_QFI)
1150 pr_debug(" QFI");
1151 if (ipwsr & RIO_IPWSR_PWD)
1152 pr_debug(" PWD");
1153 if (ipwsr & RIO_IPWSR_PWB)
1154 pr_debug(" PWB");
1155 pr_debug(" )\n");
1156#endif
1157 /* Schedule deferred processing if PW was received */
1158 if (ipwsr & RIO_IPWSR_QFI) {
1159 /* Save PW message (if there is room in FIFO),
1160 * otherwise discard it.
1161 */
1162 if (kfifo_avail(&priv->pw_fifo) >= RIO_PW_MSG_SIZE) {
1163 priv->port_write_msg.msg_count++;
1164 kfifo_in(&priv->pw_fifo, priv->port_write_msg.virt,
1165 RIO_PW_MSG_SIZE);
1166 } else {
1167 priv->port_write_msg.discard_count++;
1168 pr_debug("RIO: ISR Discarded Port-Write Msg(s) (%d)\n",
1169 priv->port_write_msg.discard_count);
1170 }
1171 /* Clear interrupt and issue Clear Queue command. This allows
1172 * another port-write to be received.
1173 */
1174 out_be32(&priv->msg_regs->pwsr, RIO_IPWSR_QFI);
1175 out_be32(&priv->msg_regs->pwmr, ipwmr | RIO_IPWMR_CQ);
1176
1177 schedule_work(&priv->pw_work);
1178 }
1179
1180 if ((ipwmr & RIO_IPWMR_EIE) && (ipwsr & RIO_IPWSR_TE)) {
1181 priv->port_write_msg.err_count++;
1182 pr_debug("RIO: Port-Write Transaction Err (%d)\n",
1183 priv->port_write_msg.err_count);
1184 /* Clear Transaction Error: port-write controller should be
1185 * disabled when clearing this error
1186 */
1187 out_be32(&priv->msg_regs->pwmr, ipwmr & ~RIO_IPWMR_PWE);
1188 out_be32(&priv->msg_regs->pwsr, RIO_IPWSR_TE);
1189 out_be32(&priv->msg_regs->pwmr, ipwmr);
1190 }
1191
1192 if (ipwsr & RIO_IPWSR_PWD) {
1193 priv->port_write_msg.discard_count++;
1194 pr_debug("RIO: Port Discarded Port-Write Msg(s) (%d)\n",
1195 priv->port_write_msg.discard_count);
1196 out_be32(&priv->msg_regs->pwsr, RIO_IPWSR_PWD);
1197 }
1198
1199pw_done:
1200 if (epwisr & RIO_EPWISR_PINT1) {
1201 tmp = in_be32(priv->regs_win + RIO_LTLEDCSR);
1202 pr_debug("RIO_LTLEDCSR = 0x%x\n", tmp);
1203 port_error_handler(port, 0);
1204 }
1205
1206 if (epwisr & RIO_EPWISR_PINT2) {
1207 tmp = in_be32(priv->regs_win + RIO_LTLEDCSR);
1208 pr_debug("RIO_LTLEDCSR = 0x%x\n", tmp);
1209 port_error_handler(port, 1);
1210 }
1211
1212 if (epwisr & RIO_EPWISR_MU) {
1213 tmp = in_be32(priv->regs_win + RIO_LTLEDCSR);
1214 pr_debug("RIO_LTLEDCSR = 0x%x\n", tmp);
1215 msg_unit_error_handler(port);
1216 }
1217
1218 return IRQ_HANDLED;
1219}
1220
1221static void fsl_pw_dpc(struct work_struct *work)
1222{
1223 struct rio_priv *priv = container_of(work, struct rio_priv, pw_work);
1224 unsigned long flags;
1225 u32 msg_buffer[RIO_PW_MSG_SIZE/sizeof(u32)];
1226
1227 /*
1228 * Process port-write messages
1229 */
1230 spin_lock_irqsave(&priv->pw_fifo_lock, flags);
1231 while (kfifo_out(&priv->pw_fifo, (unsigned char *)msg_buffer,
1232 RIO_PW_MSG_SIZE)) {
1233 /* Process one message */
1234 spin_unlock_irqrestore(&priv->pw_fifo_lock, flags);
1235#ifdef DEBUG_PW
1236 {
1237 u32 i;
1238 pr_debug("%s : Port-Write Message:", __func__);
1239 for (i = 0; i < RIO_PW_MSG_SIZE/sizeof(u32); i++) {
1240 if ((i%4) == 0)
1241 pr_debug("\n0x%02x: 0x%08x", i*4,
1242 msg_buffer[i]);
1243 else
1244 pr_debug(" 0x%08x", msg_buffer[i]);
1245 }
1246 pr_debug("\n");
1247 }
1248#endif
1249 /* Pass the port-write message to RIO core for processing */
1250 rio_inb_pwrite_handler((union rio_pw_msg *)msg_buffer);
1251 spin_lock_irqsave(&priv->pw_fifo_lock, flags);
1252 }
1253 spin_unlock_irqrestore(&priv->pw_fifo_lock, flags);
1254}
1255
1256/**
1257 * fsl_rio_pw_enable - enable/disable port-write interface init
1258 * @mport: Master port implementing the port write unit
1259 * @enable: 1=enable; 0=disable port-write message handling
1260 */
1261static int fsl_rio_pw_enable(struct rio_mport *mport, int enable)
1262{
1263 struct rio_priv *priv = mport->priv;
1264 u32 rval;
1265
1266 rval = in_be32(&priv->msg_regs->pwmr);
1267
1268 if (enable)
1269 rval |= RIO_IPWMR_PWE;
1270 else
1271 rval &= ~RIO_IPWMR_PWE;
1272
1273 out_be32(&priv->msg_regs->pwmr, rval);
1274
1275 return 0;
1276}
1277
1278/**
1279 * fsl_rio_port_write_init - MPC85xx port write interface init
1280 * @mport: Master port implementing the port write unit
1281 *
1282 * Initializes port write unit hardware and DMA buffer
1283 * ring. Called from fsl_rio_setup(). Returns %0 on success
1284 * or %-ENOMEM on failure.
1285 */
1286static int fsl_rio_port_write_init(struct rio_mport *mport)
1287{
1288 struct rio_priv *priv = mport->priv;
1289 int rc = 0;
1290
1291 /* Following configurations require a disabled port write controller */
1292 out_be32(&priv->msg_regs->pwmr,
1293 in_be32(&priv->msg_regs->pwmr) & ~RIO_IPWMR_PWE);
1294
1295 /* Initialize port write */
1296 priv->port_write_msg.virt = dma_alloc_coherent(priv->dev,
1297 RIO_PW_MSG_SIZE,
1298 &priv->port_write_msg.phys, GFP_KERNEL);
1299 if (!priv->port_write_msg.virt) {
1300 pr_err("RIO: unable allocate port write queue\n");
1301 return -ENOMEM;
1302 }
1303
1304 priv->port_write_msg.err_count = 0;
1305 priv->port_write_msg.discard_count = 0;
1306
1307 /* Point dequeue/enqueue pointers at first entry */
1308 out_be32(&priv->msg_regs->epwqbar, 0);
1309 out_be32(&priv->msg_regs->pwqbar, (u32) priv->port_write_msg.phys);
1310
1311 pr_debug("EIPWQBAR: 0x%08x IPWQBAR: 0x%08x\n",
1312 in_be32(&priv->msg_regs->epwqbar),
1313 in_be32(&priv->msg_regs->pwqbar));
1314
1315 /* Clear interrupt status IPWSR */
1316 out_be32(&priv->msg_regs->pwsr,
1317 (RIO_IPWSR_TE | RIO_IPWSR_QFI | RIO_IPWSR_PWD));
1318
1319 /* Configure port write contoller for snooping enable all reporting,
1320 clear queue full */
1321 out_be32(&priv->msg_regs->pwmr,
1322 RIO_IPWMR_SEN | RIO_IPWMR_QFIE | RIO_IPWMR_EIE | RIO_IPWMR_CQ);
1323
1324
1325 /* Hook up port-write handler */
1326 rc = request_irq(IRQ_RIO_PW(mport), fsl_rio_port_write_handler,
1327 IRQF_SHARED, "port-write", (void *)mport);
1328 if (rc < 0) {
1329 pr_err("MPC85xx RIO: unable to request inbound doorbell irq");
1330 goto err_out;
1331 }
1332 /* Enable Error Interrupt */
1333 out_be32((u32 *)(rio_regs_win + RIO_LTLEECSR), LTLEECSR_ENABLE_ALL);
1334
1335 INIT_WORK(&priv->pw_work, fsl_pw_dpc);
1336 spin_lock_init(&priv->pw_fifo_lock);
1337 if (kfifo_alloc(&priv->pw_fifo, RIO_PW_MSG_SIZE * 32, GFP_KERNEL)) {
1338 pr_err("FIFO allocation failed\n");
1339 rc = -ENOMEM;
1340 goto err_out_irq;
1341 }
1342
1343 pr_debug("IPWMR: 0x%08x IPWSR: 0x%08x\n",
1344 in_be32(&priv->msg_regs->pwmr),
1345 in_be32(&priv->msg_regs->pwsr));
1346
1347 return rc;
1348
1349err_out_irq:
1350 free_irq(IRQ_RIO_PW(mport), (void *)mport);
1351err_out:
1352 dma_free_coherent(priv->dev, RIO_PW_MSG_SIZE,
1353 priv->port_write_msg.virt,
1354 priv->port_write_msg.phys);
1355 return rc;
1356}
1357
1358static inline void fsl_rio_info(struct device *dev, u32 ccsr) 282static inline void fsl_rio_info(struct device *dev, u32 ccsr)
1359{ 283{
1360 const char *str; 284 const char *str;
@@ -1411,16 +335,21 @@ int fsl_rio_setup(struct platform_device *dev)
1411 struct rio_mport *port; 335 struct rio_mport *port;
1412 struct rio_priv *priv; 336 struct rio_priv *priv;
1413 int rc = 0; 337 int rc = 0;
1414 const u32 *dt_range, *cell; 338 const u32 *dt_range, *cell, *port_index;
1415 struct resource regs; 339 u32 active_ports = 0;
340 struct resource regs, rmu_regs;
341 struct device_node *np, *rmu_node;
1416 int rlen; 342 int rlen;
1417 u32 ccsr; 343 u32 ccsr;
1418 u64 law_start, law_size; 344 u64 range_start, range_size;
1419 int paw, aw, sw; 345 int paw, aw, sw;
346 u32 i;
347 static int tmp;
348 struct device_node *rmu_np[MAX_MSG_UNIT_NUM] = {NULL};
1420 349
1421 if (!dev->dev.of_node) { 350 if (!dev->dev.of_node) {
1422 dev_err(&dev->dev, "Device OF-Node is NULL"); 351 dev_err(&dev->dev, "Device OF-Node is NULL");
1423 return -EFAULT; 352 return -ENODEV;
1424 } 353 }
1425 354
1426 rc = of_address_to_resource(dev->dev.of_node, 0, &regs); 355 rc = of_address_to_resource(dev->dev.of_node, 0, &regs);
@@ -1429,37 +358,17 @@ int fsl_rio_setup(struct platform_device *dev)
1429 dev->dev.of_node->full_name); 358 dev->dev.of_node->full_name);
1430 return -EFAULT; 359 return -EFAULT;
1431 } 360 }
1432 dev_info(&dev->dev, "Of-device full name %s\n", dev->dev.of_node->full_name); 361 dev_info(&dev->dev, "Of-device full name %s\n",
362 dev->dev.of_node->full_name);
1433 dev_info(&dev->dev, "Regs: %pR\n", &regs); 363 dev_info(&dev->dev, "Regs: %pR\n", &regs);
1434 364
1435 dt_range = of_get_property(dev->dev.of_node, "ranges", &rlen); 365 rio_regs_win = ioremap(regs.start, resource_size(&regs));
1436 if (!dt_range) { 366 if (!rio_regs_win) {
1437 dev_err(&dev->dev, "Can't get %s property 'ranges'\n", 367 dev_err(&dev->dev, "Unable to map rio register window\n");
1438 dev->dev.of_node->full_name); 368 rc = -ENOMEM;
1439 return -EFAULT; 369 goto err_rio_regs;
1440 } 370 }
1441 371
1442 /* Get node address wide */
1443 cell = of_get_property(dev->dev.of_node, "#address-cells", NULL);
1444 if (cell)
1445 aw = *cell;
1446 else
1447 aw = of_n_addr_cells(dev->dev.of_node);
1448 /* Get node size wide */
1449 cell = of_get_property(dev->dev.of_node, "#size-cells", NULL);
1450 if (cell)
1451 sw = *cell;
1452 else
1453 sw = of_n_size_cells(dev->dev.of_node);
1454 /* Get parent address wide wide */
1455 paw = of_n_addr_cells(dev->dev.of_node);
1456
1457 law_start = of_read_number(dt_range + aw, paw);
1458 law_size = of_read_number(dt_range + aw + paw, sw);
1459
1460 dev_info(&dev->dev, "LAW start 0x%016llx, size 0x%016llx.\n",
1461 law_start, law_size);
1462
1463 ops = kzalloc(sizeof(struct rio_ops), GFP_KERNEL); 372 ops = kzalloc(sizeof(struct rio_ops), GFP_KERNEL);
1464 if (!ops) { 373 if (!ops) {
1465 rc = -ENOMEM; 374 rc = -ENOMEM;
@@ -1479,143 +388,257 @@ int fsl_rio_setup(struct platform_device *dev)
1479 ops->add_inb_buffer = fsl_add_inb_buffer; 388 ops->add_inb_buffer = fsl_add_inb_buffer;
1480 ops->get_inb_message = fsl_get_inb_message; 389 ops->get_inb_message = fsl_get_inb_message;
1481 390
1482 port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL); 391 rmu_node = of_parse_phandle(dev->dev.of_node, "fsl,srio-rmu-handle", 0);
1483 if (!port) { 392 if (!rmu_node)
393 goto err_rmu;
394 rc = of_address_to_resource(rmu_node, 0, &rmu_regs);
395 if (rc) {
396 dev_err(&dev->dev, "Can't get %s property 'reg'\n",
397 rmu_node->full_name);
398 goto err_rmu;
399 }
400 rmu_regs_win = ioremap(rmu_regs.start, resource_size(&rmu_regs));
401 if (!rmu_regs_win) {
402 dev_err(&dev->dev, "Unable to map rmu register window\n");
1484 rc = -ENOMEM; 403 rc = -ENOMEM;
1485 goto err_port; 404 goto err_rmu;
405 }
406 for_each_compatible_node(np, NULL, "fsl,srio-msg-unit") {
407 rmu_np[tmp] = np;
408 tmp++;
1486 } 409 }
1487 port->index = 0;
1488 410
1489 priv = kzalloc(sizeof(struct rio_priv), GFP_KERNEL); 411 /*set up doobell node*/
1490 if (!priv) { 412 np = of_find_compatible_node(NULL, NULL, "fsl,srio-dbell-unit");
1491 printk(KERN_ERR "Can't alloc memory for 'priv'\n"); 413 if (!np) {
414 rc = -ENODEV;
415 goto err_dbell;
416 }
417 dbell = kzalloc(sizeof(struct fsl_rio_dbell), GFP_KERNEL);
418 if (!(dbell)) {
419 dev_err(&dev->dev, "Can't alloc memory for 'fsl_rio_dbell'\n");
1492 rc = -ENOMEM; 420 rc = -ENOMEM;
1493 goto err_priv; 421 goto err_dbell;
1494 } 422 }
423 dbell->dev = &dev->dev;
424 dbell->bellirq = irq_of_parse_and_map(np, 1);
425 dev_info(&dev->dev, "bellirq: %d\n", dbell->bellirq);
1495 426
1496 INIT_LIST_HEAD(&port->dbells); 427 aw = of_n_addr_cells(np);
1497 port->iores.start = law_start; 428 dt_range = of_get_property(np, "reg", &rlen);
1498 port->iores.end = law_start + law_size - 1; 429 if (!dt_range) {
1499 port->iores.flags = IORESOURCE_MEM; 430 pr_err("%s: unable to find 'reg' property\n",
1500 port->iores.name = "rio_io_win"; 431 np->full_name);
1501 432 rc = -ENOMEM;
1502 if (request_resource(&iomem_resource, &port->iores) < 0) { 433 goto err_pw;
1503 dev_err(&dev->dev, "RIO: Error requesting master port region"
1504 " 0x%016llx-0x%016llx\n",
1505 (u64)port->iores.start, (u64)port->iores.end);
1506 rc = -ENOMEM;
1507 goto err_res;
1508 } 434 }
435 range_start = of_read_number(dt_range, aw);
436 dbell->dbell_regs = (struct rio_dbell_regs *)(rmu_regs_win +
437 (u32)range_start);
1509 438
1510 priv->pwirq = irq_of_parse_and_map(dev->dev.of_node, 0); 439 /*set up port write node*/
1511 priv->bellirq = irq_of_parse_and_map(dev->dev.of_node, 2); 440 np = of_find_compatible_node(NULL, NULL, "fsl,srio-port-write-unit");
1512 priv->txirq = irq_of_parse_and_map(dev->dev.of_node, 3); 441 if (!np) {
1513 priv->rxirq = irq_of_parse_and_map(dev->dev.of_node, 4); 442 rc = -ENODEV;
1514 dev_info(&dev->dev, "pwirq: %d, bellirq: %d, txirq: %d, rxirq %d\n", 443 goto err_pw;
1515 priv->pwirq, priv->bellirq, priv->txirq, priv->rxirq); 444 }
1516 445 pw = kzalloc(sizeof(struct fsl_rio_pw), GFP_KERNEL);
1517 rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff); 446 if (!(pw)) {
1518 rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0); 447 dev_err(&dev->dev, "Can't alloc memory for 'fsl_rio_pw'\n");
1519 rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0); 448 rc = -ENOMEM;
1520 strcpy(port->name, "RIO0 mport"); 449 goto err_pw;
1521 450 }
1522 priv->dev = &dev->dev; 451 pw->dev = &dev->dev;
1523 452 pw->pwirq = irq_of_parse_and_map(np, 0);
1524 port->ops = ops; 453 dev_info(&dev->dev, "pwirq: %d\n", pw->pwirq);
1525 port->priv = priv; 454 aw = of_n_addr_cells(np);
1526 port->phys_efptr = 0x100; 455 dt_range = of_get_property(np, "reg", &rlen);
1527 456 if (!dt_range) {
1528 priv->regs_win = ioremap(regs.start, resource_size(&regs)); 457 pr_err("%s: unable to find 'reg' property\n",
1529 rio_regs_win = priv->regs_win; 458 np->full_name);
1530 459 rc = -ENOMEM;
1531 /* Probe the master port phy type */ 460 goto err;
1532 ccsr = in_be32(priv->regs_win + RIO_CCSR); 461 }
1533 port->phy_type = (ccsr & 1) ? RIO_PHY_SERIAL : RIO_PHY_PARALLEL; 462 range_start = of_read_number(dt_range, aw);
1534 dev_info(&dev->dev, "RapidIO PHY type: %s\n", 463 pw->pw_regs = (struct rio_pw_regs *)(rmu_regs_win + (u32)range_start);
1535 (port->phy_type == RIO_PHY_PARALLEL) ? "parallel" : 464
1536 ((port->phy_type == RIO_PHY_SERIAL) ? "serial" : 465 /*set up ports node*/
1537 "unknown")); 466 for_each_child_of_node(dev->dev.of_node, np) {
1538 /* Checking the port training status */ 467 port_index = of_get_property(np, "cell-index", NULL);
1539 if (in_be32((priv->regs_win + RIO_ESCSR)) & 1) { 468 if (!port_index) {
1540 dev_err(&dev->dev, "Port is not ready. " 469 dev_err(&dev->dev, "Can't get %s property 'cell-index'\n",
1541 "Try to restart connection...\n"); 470 np->full_name);
1542 switch (port->phy_type) { 471 continue;
1543 case RIO_PHY_SERIAL: 472 }
473
474 dt_range = of_get_property(np, "ranges", &rlen);
475 if (!dt_range) {
476 dev_err(&dev->dev, "Can't get %s property 'ranges'\n",
477 np->full_name);
478 continue;
479 }
480
481 /* Get node address wide */
482 cell = of_get_property(np, "#address-cells", NULL);
483 if (cell)
484 aw = *cell;
485 else
486 aw = of_n_addr_cells(np);
487 /* Get node size wide */
488 cell = of_get_property(np, "#size-cells", NULL);
489 if (cell)
490 sw = *cell;
491 else
492 sw = of_n_size_cells(np);
493 /* Get parent address wide wide */
494 paw = of_n_addr_cells(np);
495 range_start = of_read_number(dt_range + aw, paw);
496 range_size = of_read_number(dt_range + aw + paw, sw);
497
498 dev_info(&dev->dev, "%s: LAW start 0x%016llx, size 0x%016llx.\n",
499 np->full_name, range_start, range_size);
500
501 port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
502 if (!port)
503 continue;
504
505 i = *port_index - 1;
506 port->index = (unsigned char)i;
507
508 priv = kzalloc(sizeof(struct rio_priv), GFP_KERNEL);
509 if (!priv) {
510 dev_err(&dev->dev, "Can't alloc memory for 'priv'\n");
511 kfree(port);
512 continue;
513 }
514
515 INIT_LIST_HEAD(&port->dbells);
516 port->iores.start = range_start;
517 port->iores.end = port->iores.start + range_size - 1;
518 port->iores.flags = IORESOURCE_MEM;
519 port->iores.name = "rio_io_win";
520
521 if (request_resource(&iomem_resource, &port->iores) < 0) {
522 dev_err(&dev->dev, "RIO: Error requesting master port region"
523 " 0x%016llx-0x%016llx\n",
524 (u64)port->iores.start, (u64)port->iores.end);
525 kfree(priv);
526 kfree(port);
527 continue;
528 }
529 sprintf(port->name, "RIO mport %d", i);
530
531 priv->dev = &dev->dev;
532 port->ops = ops;
533 port->priv = priv;
534 port->phys_efptr = 0x100;
535 priv->regs_win = rio_regs_win;
536
537 /* Probe the master port phy type */
538 ccsr = in_be32(priv->regs_win + RIO_CCSR + i*0x20);
539 port->phy_type = (ccsr & 1) ? RIO_PHY_SERIAL : RIO_PHY_PARALLEL;
540 if (port->phy_type == RIO_PHY_PARALLEL) {
541 dev_err(&dev->dev, "RIO: Parallel PHY type, unsupported port type!\n");
542 release_resource(&port->iores);
543 kfree(priv);
544 kfree(port);
545 continue;
546 }
547 dev_info(&dev->dev, "RapidIO PHY type: Serial\n");
548 /* Checking the port training status */
549 if (in_be32((priv->regs_win + RIO_ESCSR + i*0x20)) & 1) {
550 dev_err(&dev->dev, "Port %d is not ready. "
551 "Try to restart connection...\n", i);
1544 /* Disable ports */ 552 /* Disable ports */
1545 out_be32(priv->regs_win + RIO_CCSR, 0); 553 out_be32(priv->regs_win
554 + RIO_CCSR + i*0x20, 0);
1546 /* Set 1x lane */ 555 /* Set 1x lane */
1547 setbits32(priv->regs_win + RIO_CCSR, 0x02000000); 556 setbits32(priv->regs_win
557 + RIO_CCSR + i*0x20, 0x02000000);
1548 /* Enable ports */ 558 /* Enable ports */
1549 setbits32(priv->regs_win + RIO_CCSR, 0x00600000); 559 setbits32(priv->regs_win
1550 break; 560 + RIO_CCSR + i*0x20, 0x00600000);
1551 case RIO_PHY_PARALLEL: 561 msleep(100);
1552 /* Disable ports */ 562 if (in_be32((priv->regs_win
1553 out_be32(priv->regs_win + RIO_CCSR, 0x22000000); 563 + RIO_ESCSR + i*0x20)) & 1) {
1554 /* Enable ports */ 564 dev_err(&dev->dev,
1555 out_be32(priv->regs_win + RIO_CCSR, 0x44000000); 565 "Port %d restart failed.\n", i);
1556 break; 566 release_resource(&port->iores);
1557 } 567 kfree(priv);
1558 msleep(100); 568 kfree(port);
1559 if (in_be32((priv->regs_win + RIO_ESCSR)) & 1) { 569 continue;
1560 dev_err(&dev->dev, "Port restart failed.\n"); 570 }
1561 rc = -ENOLINK; 571 dev_info(&dev->dev, "Port %d restart success!\n", i);
1562 goto err;
1563 } 572 }
1564 dev_info(&dev->dev, "Port restart success!\n"); 573 fsl_rio_info(&dev->dev, ccsr);
1565 }
1566 fsl_rio_info(&dev->dev, ccsr);
1567 574
1568 port->sys_size = (in_be32((priv->regs_win + RIO_PEF_CAR)) 575 port->sys_size = (in_be32((priv->regs_win + RIO_PEF_CAR))
1569 & RIO_PEF_CTLS) >> 4; 576 & RIO_PEF_CTLS) >> 4;
1570 dev_info(&dev->dev, "RapidIO Common Transport System size: %d\n", 577 dev_info(&dev->dev, "RapidIO Common Transport System size: %d\n",
1571 port->sys_size ? 65536 : 256); 578 port->sys_size ? 65536 : 256);
579
580 if (rio_register_mport(port)) {
581 release_resource(&port->iores);
582 kfree(priv);
583 kfree(port);
584 continue;
585 }
586 if (port->host_deviceid >= 0)
587 out_be32(priv->regs_win + RIO_GCCSR, RIO_PORT_GEN_HOST |
588 RIO_PORT_GEN_MASTER | RIO_PORT_GEN_DISCOVERED);
589 else
590 out_be32(priv->regs_win + RIO_GCCSR,
591 RIO_PORT_GEN_MASTER);
592
593 priv->atmu_regs = (struct rio_atmu_regs *)(priv->regs_win
594 + ((i == 0) ? RIO_ATMU_REGS_PORT1_OFFSET :
595 RIO_ATMU_REGS_PORT2_OFFSET));
1572 596
1573 if (rio_register_mport(port)) 597 priv->maint_atmu_regs = priv->atmu_regs + 1;
598
599 /* Set to receive any dist ID for serial RapidIO controller. */
600 if (port->phy_type == RIO_PHY_SERIAL)
601 out_be32((priv->regs_win
602 + RIO_ISR_AACR + i*0x80), RIO_ISR_AACR_AA);
603
604 /* Configure maintenance transaction window */
605 out_be32(&priv->maint_atmu_regs->rowbar,
606 port->iores.start >> 12);
607 out_be32(&priv->maint_atmu_regs->rowar,
608 0x80077000 | (ilog2(RIO_MAINT_WIN_SIZE) - 1));
609
610 priv->maint_win = ioremap(port->iores.start,
611 RIO_MAINT_WIN_SIZE);
612
613 rio_law_start = range_start;
614
615 fsl_rio_setup_rmu(port, rmu_np[i]);
616
617 dbell->mport[i] = port;
618
619 active_ports++;
620 }
621
622 if (!active_ports) {
623 rc = -ENOLINK;
1574 goto err; 624 goto err;
625 }
1575 626
1576 if (port->host_deviceid >= 0) 627 fsl_rio_doorbell_init(dbell);
1577 out_be32(priv->regs_win + RIO_GCCSR, RIO_PORT_GEN_HOST | 628 fsl_rio_port_write_init(pw);
1578 RIO_PORT_GEN_MASTER | RIO_PORT_GEN_DISCOVERED);
1579 else
1580 out_be32(priv->regs_win + RIO_GCCSR, 0x00000000);
1581
1582 priv->atmu_regs = (struct rio_atmu_regs *)(priv->regs_win
1583 + RIO_ATMU_REGS_OFFSET);
1584 priv->maint_atmu_regs = priv->atmu_regs + 1;
1585 priv->dbell_atmu_regs = priv->atmu_regs + 2;
1586 priv->msg_regs = (struct rio_msg_regs *)(priv->regs_win +
1587 ((port->phy_type == RIO_PHY_SERIAL) ?
1588 RIO_S_MSG_REGS_OFFSET : RIO_P_MSG_REGS_OFFSET));
1589
1590 /* Set to receive any dist ID for serial RapidIO controller. */
1591 if (port->phy_type == RIO_PHY_SERIAL)
1592 out_be32((priv->regs_win + RIO_ISR_AACR), RIO_ISR_AACR_AA);
1593
1594 /* Configure maintenance transaction window */
1595 out_be32(&priv->maint_atmu_regs->rowbar, law_start >> 12);
1596 out_be32(&priv->maint_atmu_regs->rowar,
1597 0x80077000 | (ilog2(RIO_MAINT_WIN_SIZE) - 1));
1598
1599 priv->maint_win = ioremap(law_start, RIO_MAINT_WIN_SIZE);
1600
1601 /* Configure outbound doorbell window */
1602 out_be32(&priv->dbell_atmu_regs->rowbar,
1603 (law_start + RIO_MAINT_WIN_SIZE) >> 12);
1604 out_be32(&priv->dbell_atmu_regs->rowar, 0x8004200b); /* 4k */
1605 fsl_rio_doorbell_init(port);
1606 fsl_rio_port_write_init(port);
1607 629
1608 return 0; 630 return 0;
1609err: 631err:
1610 iounmap(priv->regs_win); 632 kfree(pw);
1611 release_resource(&port->iores); 633err_pw:
1612err_res: 634 kfree(dbell);
1613 kfree(priv); 635err_dbell:
1614err_priv: 636 iounmap(rmu_regs_win);
1615 kfree(port); 637err_rmu:
1616err_port:
1617 kfree(ops); 638 kfree(ops);
1618err_ops: 639err_ops:
640 iounmap(rio_regs_win);
641err_rio_regs:
1619 return rc; 642 return rc;
1620} 643}
1621 644
@@ -1631,7 +654,7 @@ static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev)
1631 654
1632static const struct of_device_id fsl_of_rio_rpn_ids[] = { 655static const struct of_device_id fsl_of_rio_rpn_ids[] = {
1633 { 656 {
1634 .compatible = "fsl,rapidio-delta", 657 .compatible = "fsl,srio",
1635 }, 658 },
1636 {}, 659 {},
1637}; 660};
diff --git a/arch/powerpc/sysdev/fsl_rio.h b/arch/powerpc/sysdev/fsl_rio.h
new file mode 100644
index 000000000000..ae8e27405a0d
--- /dev/null
+++ b/arch/powerpc/sysdev/fsl_rio.h
@@ -0,0 +1,135 @@
1/*
2 * Freescale MPC85xx/MPC86xx RapidIO support
3 *
4 * Copyright 2009 Sysgo AG
5 * Thomas Moll <thomas.moll@sysgo.com>
6 * - fixed maintenance access routines, check for aligned access
7 *
8 * Copyright 2009 Integrated Device Technology, Inc.
9 * Alex Bounine <alexandre.bounine@idt.com>
10 * - Added Port-Write message handling
11 * - Added Machine Check exception handling
12 *
13 * Copyright (C) 2007, 2008, 2010, 2011 Freescale Semiconductor, Inc.
14 * Zhang Wei <wei.zhang@freescale.com>
15 * Lian Minghuan-B31939 <Minghuan.Lian@freescale.com>
16 * Liu Gang <Gang.Liu@freescale.com>
17 *
18 * Copyright 2005 MontaVista Software, Inc.
19 * Matt Porter <mporter@kernel.crashing.org>
20 *
21 * This program is free software; you can redistribute it and/or modify it
22 * under the terms of the GNU General Public License as published by the
23 * Free Software Foundation; either version 2 of the License, or (at your
24 * option) any later version.
25 */
26
27#ifndef __FSL_RIO_H
28#define __FSL_RIO_H
29
30#include <linux/rio.h>
31#include <linux/rio_drv.h>
32#include <linux/kfifo.h>
33
34#define RIO_REGS_WIN(mport) (((struct rio_priv *)(mport->priv))->regs_win)
35
36#define RIO_MAINT_WIN_SIZE 0x400000
37#define RIO_LTLEDCSR 0x0608
38
39#define DOORBELL_ROWAR_EN 0x80000000
40#define DOORBELL_ROWAR_TFLOWLV 0x08000000 /* highest priority level */
41#define DOORBELL_ROWAR_PCI 0x02000000 /* PCI window */
42#define DOORBELL_ROWAR_NREAD 0x00040000 /* NREAD */
43#define DOORBELL_ROWAR_MAINTRD 0x00070000 /* maintenance read */
44#define DOORBELL_ROWAR_RES 0x00002000 /* wrtpy: reserverd */
45#define DOORBELL_ROWAR_MAINTWD 0x00007000
46#define DOORBELL_ROWAR_SIZE 0x0000000b /* window size is 4k */
47
48#define RIO_ATMU_REGS_PORT1_OFFSET 0x10c00
49#define RIO_ATMU_REGS_PORT2_OFFSET 0x10e00
50#define RIO_S_DBELL_REGS_OFFSET 0x13400
51#define RIO_S_PW_REGS_OFFSET 0x134e0
52#define RIO_ATMU_REGS_DBELL_OFFSET 0x10C40
53
54#define MAX_MSG_UNIT_NUM 2
55#define MAX_PORT_NUM 4
56
57struct rio_atmu_regs {
58 u32 rowtar;
59 u32 rowtear;
60 u32 rowbar;
61 u32 pad1;
62 u32 rowar;
63 u32 pad2[3];
64};
65
66struct rio_dbell_ring {
67 void *virt;
68 dma_addr_t phys;
69};
70
71struct rio_port_write_msg {
72 void *virt;
73 dma_addr_t phys;
74 u32 msg_count;
75 u32 err_count;
76 u32 discard_count;
77};
78
79struct fsl_rio_dbell {
80 struct rio_mport *mport[MAX_PORT_NUM];
81 struct device *dev;
82 struct rio_dbell_regs __iomem *dbell_regs;
83 struct rio_dbell_ring dbell_ring;
84 int bellirq;
85};
86
87struct fsl_rio_pw {
88 struct device *dev;
89 struct rio_pw_regs __iomem *pw_regs;
90 struct rio_port_write_msg port_write_msg;
91 int pwirq;
92 struct work_struct pw_work;
93 struct kfifo pw_fifo;
94 spinlock_t pw_fifo_lock;
95};
96
97struct rio_priv {
98 struct device *dev;
99 void __iomem *regs_win;
100 struct rio_atmu_regs __iomem *atmu_regs;
101 struct rio_atmu_regs __iomem *maint_atmu_regs;
102 void __iomem *maint_win;
103 void *rmm_handle; /* RapidIO message manager(unit) Handle */
104};
105
106extern void __iomem *rio_regs_win;
107extern void __iomem *rmu_regs_win;
108
109extern resource_size_t rio_law_start;
110
111extern struct fsl_rio_dbell *dbell;
112extern struct fsl_rio_pw *pw;
113
114extern int fsl_rio_setup_rmu(struct rio_mport *mport,
115 struct device_node *node);
116extern int fsl_rio_port_write_init(struct fsl_rio_pw *pw);
117extern int fsl_rio_pw_enable(struct rio_mport *mport, int enable);
118extern void fsl_rio_port_error_handler(int offset);
119extern int fsl_rio_doorbell_init(struct fsl_rio_dbell *dbell);
120
121extern int fsl_rio_doorbell_send(struct rio_mport *mport,
122 int index, u16 destid, u16 data);
123extern int fsl_add_outb_message(struct rio_mport *mport,
124 struct rio_dev *rdev,
125 int mbox, void *buffer, size_t len);
126extern int fsl_open_outb_mbox(struct rio_mport *mport,
127 void *dev_id, int mbox, int entries);
128extern void fsl_close_outb_mbox(struct rio_mport *mport, int mbox);
129extern int fsl_open_inb_mbox(struct rio_mport *mport,
130 void *dev_id, int mbox, int entries);
131extern void fsl_close_inb_mbox(struct rio_mport *mport, int mbox);
132extern int fsl_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf);
133extern void *fsl_get_inb_message(struct rio_mport *mport, int mbox);
134
135#endif
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c
new file mode 100644
index 000000000000..15485789e9db
--- /dev/null
+++ b/arch/powerpc/sysdev/fsl_rmu.c
@@ -0,0 +1,1104 @@
1/*
2 * Freescale MPC85xx/MPC86xx RapidIO RMU support
3 *
4 * Copyright 2009 Sysgo AG
5 * Thomas Moll <thomas.moll@sysgo.com>
6 * - fixed maintenance access routines, check for aligned access
7 *
8 * Copyright 2009 Integrated Device Technology, Inc.
9 * Alex Bounine <alexandre.bounine@idt.com>
10 * - Added Port-Write message handling
11 * - Added Machine Check exception handling
12 *
13 * Copyright (C) 2007, 2008, 2010, 2011 Freescale Semiconductor, Inc.
14 * Zhang Wei <wei.zhang@freescale.com>
15 * Lian Minghuan-B31939 <Minghuan.Lian@freescale.com>
16 * Liu Gang <Gang.Liu@freescale.com>
17 *
18 * Copyright 2005 MontaVista Software, Inc.
19 * Matt Porter <mporter@kernel.crashing.org>
20 *
21 * This program is free software; you can redistribute it and/or modify it
22 * under the terms of the GNU General Public License as published by the
23 * Free Software Foundation; either version 2 of the License, or (at your
24 * option) any later version.
25 */
26
27#include <linux/types.h>
28#include <linux/dma-mapping.h>
29#include <linux/interrupt.h>
30#include <linux/of_platform.h>
31#include <linux/slab.h>
32
33#include "fsl_rio.h"
34
35#define GET_RMM_HANDLE(mport) \
36 (((struct rio_priv *)(mport->priv))->rmm_handle)
37
38/* RapidIO definition irq, which read from OF-tree */
39#define IRQ_RIO_PW(m) (((struct fsl_rio_pw *)(m))->pwirq)
40#define IRQ_RIO_BELL(m) (((struct fsl_rio_dbell *)(m))->bellirq)
41#define IRQ_RIO_TX(m) (((struct fsl_rmu *)(GET_RMM_HANDLE(m)))->txirq)
42#define IRQ_RIO_RX(m) (((struct fsl_rmu *)(GET_RMM_HANDLE(m)))->rxirq)
43
44#define RIO_MIN_TX_RING_SIZE 2
45#define RIO_MAX_TX_RING_SIZE 2048
46#define RIO_MIN_RX_RING_SIZE 2
47#define RIO_MAX_RX_RING_SIZE 2048
48
49#define RIO_IPWMR_SEN 0x00100000
50#define RIO_IPWMR_QFIE 0x00000100
51#define RIO_IPWMR_EIE 0x00000020
52#define RIO_IPWMR_CQ 0x00000002
53#define RIO_IPWMR_PWE 0x00000001
54
55#define RIO_IPWSR_QF 0x00100000
56#define RIO_IPWSR_TE 0x00000080
57#define RIO_IPWSR_QFI 0x00000010
58#define RIO_IPWSR_PWD 0x00000008
59#define RIO_IPWSR_PWB 0x00000004
60
61#define RIO_EPWISR 0x10010
62/* EPWISR Error match value */
63#define RIO_EPWISR_PINT1 0x80000000
64#define RIO_EPWISR_PINT2 0x40000000
65#define RIO_EPWISR_MU 0x00000002
66#define RIO_EPWISR_PW 0x00000001
67
68#define IPWSR_CLEAR 0x98
69#define OMSR_CLEAR 0x1cb3
70#define IMSR_CLEAR 0x491
71#define IDSR_CLEAR 0x91
72#define ODSR_CLEAR 0x1c00
73#define LTLEECSR_ENABLE_ALL 0xFFC000FC
74#define RIO_LTLEECSR 0x060c
75
76#define RIO_IM0SR 0x64
77#define RIO_IM1SR 0x164
78#define RIO_OM0SR 0x4
79#define RIO_OM1SR 0x104
80
81#define RIO_DBELL_WIN_SIZE 0x1000
82
83#define RIO_MSG_OMR_MUI 0x00000002
84#define RIO_MSG_OSR_TE 0x00000080
85#define RIO_MSG_OSR_QOI 0x00000020
86#define RIO_MSG_OSR_QFI 0x00000010
87#define RIO_MSG_OSR_MUB 0x00000004
88#define RIO_MSG_OSR_EOMI 0x00000002
89#define RIO_MSG_OSR_QEI 0x00000001
90
91#define RIO_MSG_IMR_MI 0x00000002
92#define RIO_MSG_ISR_TE 0x00000080
93#define RIO_MSG_ISR_QFI 0x00000010
94#define RIO_MSG_ISR_DIQI 0x00000001
95
96#define RIO_MSG_DESC_SIZE 32
97#define RIO_MSG_BUFFER_SIZE 4096
98
99#define DOORBELL_DMR_DI 0x00000002
100#define DOORBELL_DSR_TE 0x00000080
101#define DOORBELL_DSR_QFI 0x00000010
102#define DOORBELL_DSR_DIQI 0x00000001
103#define DOORBELL_TID_OFFSET 0x02
104#define DOORBELL_SID_OFFSET 0x04
105#define DOORBELL_INFO_OFFSET 0x06
106
107#define DOORBELL_MESSAGE_SIZE 0x08
108#define DBELL_SID(x) (*(u16 *)(x + DOORBELL_SID_OFFSET))
109#define DBELL_TID(x) (*(u16 *)(x + DOORBELL_TID_OFFSET))
110#define DBELL_INF(x) (*(u16 *)(x + DOORBELL_INFO_OFFSET))
111
112struct rio_msg_regs {
113 u32 omr;
114 u32 osr;
115 u32 pad1;
116 u32 odqdpar;
117 u32 pad2;
118 u32 osar;
119 u32 odpr;
120 u32 odatr;
121 u32 odcr;
122 u32 pad3;
123 u32 odqepar;
124 u32 pad4[13];
125 u32 imr;
126 u32 isr;
127 u32 pad5;
128 u32 ifqdpar;
129 u32 pad6;
130 u32 ifqepar;
131};
132
133struct rio_dbell_regs {
134 u32 odmr;
135 u32 odsr;
136 u32 pad1[4];
137 u32 oddpr;
138 u32 oddatr;
139 u32 pad2[3];
140 u32 odretcr;
141 u32 pad3[12];
142 u32 dmr;
143 u32 dsr;
144 u32 pad4;
145 u32 dqdpar;
146 u32 pad5;
147 u32 dqepar;
148};
149
150struct rio_pw_regs {
151 u32 pwmr;
152 u32 pwsr;
153 u32 epwqbar;
154 u32 pwqbar;
155};
156
157
158struct rio_tx_desc {
159 u32 pad1;
160 u32 saddr;
161 u32 dport;
162 u32 dattr;
163 u32 pad2;
164 u32 pad3;
165 u32 dwcnt;
166 u32 pad4;
167};
168
169struct rio_msg_tx_ring {
170 void *virt;
171 dma_addr_t phys;
172 void *virt_buffer[RIO_MAX_TX_RING_SIZE];
173 dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
174 int tx_slot;
175 int size;
176 void *dev_id;
177};
178
179struct rio_msg_rx_ring {
180 void *virt;
181 dma_addr_t phys;
182 void *virt_buffer[RIO_MAX_RX_RING_SIZE];
183 int rx_slot;
184 int size;
185 void *dev_id;
186};
187
188struct fsl_rmu {
189 struct rio_msg_regs __iomem *msg_regs;
190 struct rio_msg_tx_ring msg_tx_ring;
191 struct rio_msg_rx_ring msg_rx_ring;
192 int txirq;
193 int rxirq;
194};
195
196/**
197 * fsl_rio_tx_handler - MPC85xx outbound message interrupt handler
198 * @irq: Linux interrupt number
199 * @dev_instance: Pointer to interrupt-specific data
200 *
201 * Handles outbound message interrupts. Executes a register outbound
202 * mailbox event handler and acks the interrupt occurrence.
203 */
204static irqreturn_t
205fsl_rio_tx_handler(int irq, void *dev_instance)
206{
207 int osr;
208 struct rio_mport *port = (struct rio_mport *)dev_instance;
209 struct fsl_rmu *rmu = GET_RMM_HANDLE(port);
210
211 osr = in_be32(&rmu->msg_regs->osr);
212
213 if (osr & RIO_MSG_OSR_TE) {
214 pr_info("RIO: outbound message transmission error\n");
215 out_be32(&rmu->msg_regs->osr, RIO_MSG_OSR_TE);
216 goto out;
217 }
218
219 if (osr & RIO_MSG_OSR_QOI) {
220 pr_info("RIO: outbound message queue overflow\n");
221 out_be32(&rmu->msg_regs->osr, RIO_MSG_OSR_QOI);
222 goto out;
223 }
224
225 if (osr & RIO_MSG_OSR_EOMI) {
226 u32 dqp = in_be32(&rmu->msg_regs->odqdpar);
227 int slot = (dqp - rmu->msg_tx_ring.phys) >> 5;
228 if (port->outb_msg[0].mcback != NULL) {
229 port->outb_msg[0].mcback(port, rmu->msg_tx_ring.dev_id,
230 -1,
231 slot);
232 }
233 /* Ack the end-of-message interrupt */
234 out_be32(&rmu->msg_regs->osr, RIO_MSG_OSR_EOMI);
235 }
236
237out:
238 return IRQ_HANDLED;
239}
240
241/**
242 * fsl_rio_rx_handler - MPC85xx inbound message interrupt handler
243 * @irq: Linux interrupt number
244 * @dev_instance: Pointer to interrupt-specific data
245 *
246 * Handles inbound message interrupts. Executes a registered inbound
247 * mailbox event handler and acks the interrupt occurrence.
248 */
249static irqreturn_t
250fsl_rio_rx_handler(int irq, void *dev_instance)
251{
252 int isr;
253 struct rio_mport *port = (struct rio_mport *)dev_instance;
254 struct fsl_rmu *rmu = GET_RMM_HANDLE(port);
255
256 isr = in_be32(&rmu->msg_regs->isr);
257
258 if (isr & RIO_MSG_ISR_TE) {
259 pr_info("RIO: inbound message reception error\n");
260 out_be32((void *)&rmu->msg_regs->isr, RIO_MSG_ISR_TE);
261 goto out;
262 }
263
264 /* XXX Need to check/dispatch until queue empty */
265 if (isr & RIO_MSG_ISR_DIQI) {
266 /*
267 * Can receive messages for any mailbox/letter to that
268 * mailbox destination. So, make the callback with an
269 * unknown/invalid mailbox number argument.
270 */
271 if (port->inb_msg[0].mcback != NULL)
272 port->inb_msg[0].mcback(port, rmu->msg_rx_ring.dev_id,
273 -1,
274 -1);
275
276 /* Ack the queueing interrupt */
277 out_be32(&rmu->msg_regs->isr, RIO_MSG_ISR_DIQI);
278 }
279
280out:
281 return IRQ_HANDLED;
282}
283
284/**
285 * fsl_rio_dbell_handler - MPC85xx doorbell interrupt handler
286 * @irq: Linux interrupt number
287 * @dev_instance: Pointer to interrupt-specific data
288 *
289 * Handles doorbell interrupts. Parses a list of registered
290 * doorbell event handlers and executes a matching event handler.
291 */
292static irqreturn_t
293fsl_rio_dbell_handler(int irq, void *dev_instance)
294{
295 int dsr;
296 struct fsl_rio_dbell *fsl_dbell = (struct fsl_rio_dbell *)dev_instance;
297 int i;
298
299 dsr = in_be32(&fsl_dbell->dbell_regs->dsr);
300
301 if (dsr & DOORBELL_DSR_TE) {
302 pr_info("RIO: doorbell reception error\n");
303 out_be32(&fsl_dbell->dbell_regs->dsr, DOORBELL_DSR_TE);
304 goto out;
305 }
306
307 if (dsr & DOORBELL_DSR_QFI) {
308 pr_info("RIO: doorbell queue full\n");
309 out_be32(&fsl_dbell->dbell_regs->dsr, DOORBELL_DSR_QFI);
310 }
311
312 /* XXX Need to check/dispatch until queue empty */
313 if (dsr & DOORBELL_DSR_DIQI) {
314 u32 dmsg =
315 (u32) fsl_dbell->dbell_ring.virt +
316 (in_be32(&fsl_dbell->dbell_regs->dqdpar) & 0xfff);
317 struct rio_dbell *dbell;
318 int found = 0;
319
320 pr_debug
321 ("RIO: processing doorbell,"
322 " sid %2.2x tid %2.2x info %4.4x\n",
323 DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
324
325 for (i = 0; i < MAX_PORT_NUM; i++) {
326 if (fsl_dbell->mport[i]) {
327 list_for_each_entry(dbell,
328 &fsl_dbell->mport[i]->dbells, node) {
329 if ((dbell->res->start
330 <= DBELL_INF(dmsg))
331 && (dbell->res->end
332 >= DBELL_INF(dmsg))) {
333 found = 1;
334 break;
335 }
336 }
337 if (found && dbell->dinb) {
338 dbell->dinb(fsl_dbell->mport[i],
339 dbell->dev_id, DBELL_SID(dmsg),
340 DBELL_TID(dmsg),
341 DBELL_INF(dmsg));
342 break;
343 }
344 }
345 }
346
347 if (!found) {
348 pr_debug
349 ("RIO: spurious doorbell,"
350 " sid %2.2x tid %2.2x info %4.4x\n",
351 DBELL_SID(dmsg), DBELL_TID(dmsg),
352 DBELL_INF(dmsg));
353 }
354 setbits32(&fsl_dbell->dbell_regs->dmr, DOORBELL_DMR_DI);
355 out_be32(&fsl_dbell->dbell_regs->dsr, DOORBELL_DSR_DIQI);
356 }
357
358out:
359 return IRQ_HANDLED;
360}
361
362void msg_unit_error_handler(void)
363{
364
365 /*XXX: Error recovery is not implemented, we just clear errors */
366 out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), 0);
367
368 out_be32((u32 *)(rmu_regs_win + RIO_IM0SR), IMSR_CLEAR);
369 out_be32((u32 *)(rmu_regs_win + RIO_IM1SR), IMSR_CLEAR);
370 out_be32((u32 *)(rmu_regs_win + RIO_OM0SR), OMSR_CLEAR);
371 out_be32((u32 *)(rmu_regs_win + RIO_OM1SR), OMSR_CLEAR);
372
373 out_be32(&dbell->dbell_regs->odsr, ODSR_CLEAR);
374 out_be32(&dbell->dbell_regs->dsr, IDSR_CLEAR);
375
376 out_be32(&pw->pw_regs->pwsr, IPWSR_CLEAR);
377}
378
379/**
380 * fsl_rio_port_write_handler - MPC85xx port write interrupt handler
381 * @irq: Linux interrupt number
382 * @dev_instance: Pointer to interrupt-specific data
383 *
384 * Handles port write interrupts. Parses a list of registered
385 * port write event handlers and executes a matching event handler.
386 */
387static irqreturn_t
388fsl_rio_port_write_handler(int irq, void *dev_instance)
389{
390 u32 ipwmr, ipwsr;
391 struct fsl_rio_pw *pw = (struct fsl_rio_pw *)dev_instance;
392 u32 epwisr, tmp;
393
394 epwisr = in_be32(rio_regs_win + RIO_EPWISR);
395 if (!(epwisr & RIO_EPWISR_PW))
396 goto pw_done;
397
398 ipwmr = in_be32(&pw->pw_regs->pwmr);
399 ipwsr = in_be32(&pw->pw_regs->pwsr);
400
401#ifdef DEBUG_PW
402 pr_debug("PW Int->IPWMR: 0x%08x IPWSR: 0x%08x (", ipwmr, ipwsr);
403 if (ipwsr & RIO_IPWSR_QF)
404 pr_debug(" QF");
405 if (ipwsr & RIO_IPWSR_TE)
406 pr_debug(" TE");
407 if (ipwsr & RIO_IPWSR_QFI)
408 pr_debug(" QFI");
409 if (ipwsr & RIO_IPWSR_PWD)
410 pr_debug(" PWD");
411 if (ipwsr & RIO_IPWSR_PWB)
412 pr_debug(" PWB");
413 pr_debug(" )\n");
414#endif
415 /* Schedule deferred processing if PW was received */
416 if (ipwsr & RIO_IPWSR_QFI) {
417 /* Save PW message (if there is room in FIFO),
418 * otherwise discard it.
419 */
420 if (kfifo_avail(&pw->pw_fifo) >= RIO_PW_MSG_SIZE) {
421 pw->port_write_msg.msg_count++;
422 kfifo_in(&pw->pw_fifo, pw->port_write_msg.virt,
423 RIO_PW_MSG_SIZE);
424 } else {
425 pw->port_write_msg.discard_count++;
426 pr_debug("RIO: ISR Discarded Port-Write Msg(s) (%d)\n",
427 pw->port_write_msg.discard_count);
428 }
429 /* Clear interrupt and issue Clear Queue command. This allows
430 * another port-write to be received.
431 */
432 out_be32(&pw->pw_regs->pwsr, RIO_IPWSR_QFI);
433 out_be32(&pw->pw_regs->pwmr, ipwmr | RIO_IPWMR_CQ);
434
435 schedule_work(&pw->pw_work);
436 }
437
438 if ((ipwmr & RIO_IPWMR_EIE) && (ipwsr & RIO_IPWSR_TE)) {
439 pw->port_write_msg.err_count++;
440 pr_debug("RIO: Port-Write Transaction Err (%d)\n",
441 pw->port_write_msg.err_count);
442 /* Clear Transaction Error: port-write controller should be
443 * disabled when clearing this error
444 */
445 out_be32(&pw->pw_regs->pwmr, ipwmr & ~RIO_IPWMR_PWE);
446 out_be32(&pw->pw_regs->pwsr, RIO_IPWSR_TE);
447 out_be32(&pw->pw_regs->pwmr, ipwmr);
448 }
449
450 if (ipwsr & RIO_IPWSR_PWD) {
451 pw->port_write_msg.discard_count++;
452 pr_debug("RIO: Port Discarded Port-Write Msg(s) (%d)\n",
453 pw->port_write_msg.discard_count);
454 out_be32(&pw->pw_regs->pwsr, RIO_IPWSR_PWD);
455 }
456
457pw_done:
458 if (epwisr & RIO_EPWISR_PINT1) {
459 tmp = in_be32(rio_regs_win + RIO_LTLEDCSR);
460 pr_debug("RIO_LTLEDCSR = 0x%x\n", tmp);
461 fsl_rio_port_error_handler(0);
462 }
463
464 if (epwisr & RIO_EPWISR_PINT2) {
465 tmp = in_be32(rio_regs_win + RIO_LTLEDCSR);
466 pr_debug("RIO_LTLEDCSR = 0x%x\n", tmp);
467 fsl_rio_port_error_handler(1);
468 }
469
470 if (epwisr & RIO_EPWISR_MU) {
471 tmp = in_be32(rio_regs_win + RIO_LTLEDCSR);
472 pr_debug("RIO_LTLEDCSR = 0x%x\n", tmp);
473 msg_unit_error_handler();
474 }
475
476 return IRQ_HANDLED;
477}
478
479static void fsl_pw_dpc(struct work_struct *work)
480{
481 struct fsl_rio_pw *pw = container_of(work, struct fsl_rio_pw, pw_work);
482 u32 msg_buffer[RIO_PW_MSG_SIZE/sizeof(u32)];
483
484 /*
485 * Process port-write messages
486 */
487 while (kfifo_out_spinlocked(&pw->pw_fifo, (unsigned char *)msg_buffer,
488 RIO_PW_MSG_SIZE, &pw->pw_fifo_lock)) {
489 /* Process one message */
490#ifdef DEBUG_PW
491 {
492 u32 i;
493 pr_debug("%s : Port-Write Message:", __func__);
494 for (i = 0; i < RIO_PW_MSG_SIZE/sizeof(u32); i++) {
495 if ((i%4) == 0)
496 pr_debug("\n0x%02x: 0x%08x", i*4,
497 msg_buffer[i]);
498 else
499 pr_debug(" 0x%08x", msg_buffer[i]);
500 }
501 pr_debug("\n");
502 }
503#endif
504 /* Pass the port-write message to RIO core for processing */
505 rio_inb_pwrite_handler((union rio_pw_msg *)msg_buffer);
506 }
507}
508
509/**
510 * fsl_rio_pw_enable - enable/disable port-write interface init
511 * @mport: Master port implementing the port write unit
512 * @enable: 1=enable; 0=disable port-write message handling
513 */
514int fsl_rio_pw_enable(struct rio_mport *mport, int enable)
515{
516 u32 rval;
517
518 rval = in_be32(&pw->pw_regs->pwmr);
519
520 if (enable)
521 rval |= RIO_IPWMR_PWE;
522 else
523 rval &= ~RIO_IPWMR_PWE;
524
525 out_be32(&pw->pw_regs->pwmr, rval);
526
527 return 0;
528}
529
530/**
531 * fsl_rio_port_write_init - MPC85xx port write interface init
532 * @mport: Master port implementing the port write unit
533 *
534 * Initializes port write unit hardware and DMA buffer
535 * ring. Called from fsl_rio_setup(). Returns %0 on success
536 * or %-ENOMEM on failure.
537 */
538
539int fsl_rio_port_write_init(struct fsl_rio_pw *pw)
540{
541 int rc = 0;
542
543 /* Following configurations require a disabled port write controller */
544 out_be32(&pw->pw_regs->pwmr,
545 in_be32(&pw->pw_regs->pwmr) & ~RIO_IPWMR_PWE);
546
547 /* Initialize port write */
548 pw->port_write_msg.virt = dma_alloc_coherent(pw->dev,
549 RIO_PW_MSG_SIZE,
550 &pw->port_write_msg.phys, GFP_KERNEL);
551 if (!pw->port_write_msg.virt) {
552 pr_err("RIO: unable allocate port write queue\n");
553 return -ENOMEM;
554 }
555
556 pw->port_write_msg.err_count = 0;
557 pw->port_write_msg.discard_count = 0;
558
559 /* Point dequeue/enqueue pointers at first entry */
560 out_be32(&pw->pw_regs->epwqbar, 0);
561 out_be32(&pw->pw_regs->pwqbar, (u32) pw->port_write_msg.phys);
562
563 pr_debug("EIPWQBAR: 0x%08x IPWQBAR: 0x%08x\n",
564 in_be32(&pw->pw_regs->epwqbar),
565 in_be32(&pw->pw_regs->pwqbar));
566
567 /* Clear interrupt status IPWSR */
568 out_be32(&pw->pw_regs->pwsr,
569 (RIO_IPWSR_TE | RIO_IPWSR_QFI | RIO_IPWSR_PWD));
570
571 /* Configure port write contoller for snooping enable all reporting,
572 clear queue full */
573 out_be32(&pw->pw_regs->pwmr,
574 RIO_IPWMR_SEN | RIO_IPWMR_QFIE | RIO_IPWMR_EIE | RIO_IPWMR_CQ);
575
576
577 /* Hook up port-write handler */
578 rc = request_irq(IRQ_RIO_PW(pw), fsl_rio_port_write_handler,
579 IRQF_SHARED, "port-write", (void *)pw);
580 if (rc < 0) {
581 pr_err("MPC85xx RIO: unable to request inbound doorbell irq");
582 goto err_out;
583 }
584 /* Enable Error Interrupt */
585 out_be32((u32 *)(rio_regs_win + RIO_LTLEECSR), LTLEECSR_ENABLE_ALL);
586
587 INIT_WORK(&pw->pw_work, fsl_pw_dpc);
588 spin_lock_init(&pw->pw_fifo_lock);
589 if (kfifo_alloc(&pw->pw_fifo, RIO_PW_MSG_SIZE * 32, GFP_KERNEL)) {
590 pr_err("FIFO allocation failed\n");
591 rc = -ENOMEM;
592 goto err_out_irq;
593 }
594
595 pr_debug("IPWMR: 0x%08x IPWSR: 0x%08x\n",
596 in_be32(&pw->pw_regs->pwmr),
597 in_be32(&pw->pw_regs->pwsr));
598
599 return rc;
600
601err_out_irq:
602 free_irq(IRQ_RIO_PW(pw), (void *)pw);
603err_out:
604 dma_free_coherent(pw->dev, RIO_PW_MSG_SIZE,
605 pw->port_write_msg.virt,
606 pw->port_write_msg.phys);
607 return rc;
608}
609
610/**
611 * fsl_rio_doorbell_send - Send a MPC85xx doorbell message
612 * @mport: RapidIO master port info
613 * @index: ID of RapidIO interface
614 * @destid: Destination ID of target device
615 * @data: 16-bit info field of RapidIO doorbell message
616 *
617 * Sends a MPC85xx doorbell message. Returns %0 on success or
618 * %-EINVAL on failure.
619 */
620int fsl_rio_doorbell_send(struct rio_mport *mport,
621 int index, u16 destid, u16 data)
622{
623 pr_debug("fsl_doorbell_send: index %d destid %4.4x data %4.4x\n",
624 index, destid, data);
625
626 /* In the serial version silicons, such as MPC8548, MPC8641,
627 * below operations is must be.
628 */
629 out_be32(&dbell->dbell_regs->odmr, 0x00000000);
630 out_be32(&dbell->dbell_regs->odretcr, 0x00000004);
631 out_be32(&dbell->dbell_regs->oddpr, destid << 16);
632 out_be32(&dbell->dbell_regs->oddatr, (index << 20) | data);
633 out_be32(&dbell->dbell_regs->odmr, 0x00000001);
634
635 return 0;
636}
637
638/**
639 * fsl_add_outb_message - Add message to the MPC85xx outbound message queue
640 * @mport: Master port with outbound message queue
641 * @rdev: Target of outbound message
642 * @mbox: Outbound mailbox
643 * @buffer: Message to add to outbound queue
644 * @len: Length of message
645 *
646 * Adds the @buffer message to the MPC85xx outbound message queue. Returns
647 * %0 on success or %-EINVAL on failure.
648 */
649int
650fsl_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
651 void *buffer, size_t len)
652{
653 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport);
654 u32 omr;
655 struct rio_tx_desc *desc = (struct rio_tx_desc *)rmu->msg_tx_ring.virt
656 + rmu->msg_tx_ring.tx_slot;
657 int ret = 0;
658
659 pr_debug("RIO: fsl_add_outb_message(): destid %4.4x mbox %d buffer " \
660 "%8.8x len %8.8x\n", rdev->destid, mbox, (int)buffer, len);
661 if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
662 ret = -EINVAL;
663 goto out;
664 }
665
666 /* Copy and clear rest of buffer */
667 memcpy(rmu->msg_tx_ring.virt_buffer[rmu->msg_tx_ring.tx_slot], buffer,
668 len);
669 if (len < (RIO_MAX_MSG_SIZE - 4))
670 memset(rmu->msg_tx_ring.virt_buffer[rmu->msg_tx_ring.tx_slot]
671 + len, 0, RIO_MAX_MSG_SIZE - len);
672
673 /* Set mbox field for message, and set destid */
674 desc->dport = (rdev->destid << 16) | (mbox & 0x3);
675
676 /* Enable EOMI interrupt and priority */
677 desc->dattr = 0x28000000 | ((mport->index) << 20);
678
679 /* Set transfer size aligned to next power of 2 (in double words) */
680 desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
681
682 /* Set snooping and source buffer address */
683 desc->saddr = 0x00000004
684 | rmu->msg_tx_ring.phys_buffer[rmu->msg_tx_ring.tx_slot];
685
686 /* Increment enqueue pointer */
687 omr = in_be32(&rmu->msg_regs->omr);
688 out_be32(&rmu->msg_regs->omr, omr | RIO_MSG_OMR_MUI);
689
690 /* Go to next descriptor */
691 if (++rmu->msg_tx_ring.tx_slot == rmu->msg_tx_ring.size)
692 rmu->msg_tx_ring.tx_slot = 0;
693
694out:
695 return ret;
696}
697
698/**
699 * fsl_open_outb_mbox - Initialize MPC85xx outbound mailbox
700 * @mport: Master port implementing the outbound message unit
701 * @dev_id: Device specific pointer to pass on event
702 * @mbox: Mailbox to open
703 * @entries: Number of entries in the outbound mailbox ring
704 *
705 * Initializes buffer ring, request the outbound message interrupt,
706 * and enables the outbound message unit. Returns %0 on success and
707 * %-EINVAL or %-ENOMEM on failure.
708 */
709int
710fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
711{
712 int i, j, rc = 0;
713 struct rio_priv *priv = mport->priv;
714 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport);
715
716 if ((entries < RIO_MIN_TX_RING_SIZE) ||
717 (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
718 rc = -EINVAL;
719 goto out;
720 }
721
722 /* Initialize shadow copy ring */
723 rmu->msg_tx_ring.dev_id = dev_id;
724 rmu->msg_tx_ring.size = entries;
725
726 for (i = 0; i < rmu->msg_tx_ring.size; i++) {
727 rmu->msg_tx_ring.virt_buffer[i] =
728 dma_alloc_coherent(priv->dev, RIO_MSG_BUFFER_SIZE,
729 &rmu->msg_tx_ring.phys_buffer[i], GFP_KERNEL);
730 if (!rmu->msg_tx_ring.virt_buffer[i]) {
731 rc = -ENOMEM;
732 for (j = 0; j < rmu->msg_tx_ring.size; j++)
733 if (rmu->msg_tx_ring.virt_buffer[j])
734 dma_free_coherent(priv->dev,
735 RIO_MSG_BUFFER_SIZE,
736 rmu->msg_tx_ring.
737 virt_buffer[j],
738 rmu->msg_tx_ring.
739 phys_buffer[j]);
740 goto out;
741 }
742 }
743
744 /* Initialize outbound message descriptor ring */
745 rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
746 rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
747 &rmu->msg_tx_ring.phys, GFP_KERNEL);
748 if (!rmu->msg_tx_ring.virt) {
749 rc = -ENOMEM;
750 goto out_dma;
751 }
752 memset(rmu->msg_tx_ring.virt, 0,
753 rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE);
754 rmu->msg_tx_ring.tx_slot = 0;
755
756 /* Point dequeue/enqueue pointers at first entry in ring */
757 out_be32(&rmu->msg_regs->odqdpar, rmu->msg_tx_ring.phys);
758 out_be32(&rmu->msg_regs->odqepar, rmu->msg_tx_ring.phys);
759
760 /* Configure for snooping */
761 out_be32(&rmu->msg_regs->osar, 0x00000004);
762
763 /* Clear interrupt status */
764 out_be32(&rmu->msg_regs->osr, 0x000000b3);
765
766 /* Hook up outbound message handler */
767 rc = request_irq(IRQ_RIO_TX(mport), fsl_rio_tx_handler, 0,
768 "msg_tx", (void *)mport);
769 if (rc < 0)
770 goto out_irq;
771
772 /*
773 * Configure outbound message unit
774 * Snooping
775 * Interrupts (all enabled, except QEIE)
776 * Chaining mode
777 * Disable
778 */
779 out_be32(&rmu->msg_regs->omr, 0x00100220);
780
781 /* Set number of entries */
782 out_be32(&rmu->msg_regs->omr,
783 in_be32(&rmu->msg_regs->omr) |
784 ((get_bitmask_order(entries) - 2) << 12));
785
786 /* Now enable the unit */
787 out_be32(&rmu->msg_regs->omr, in_be32(&rmu->msg_regs->omr) | 0x1);
788
789out:
790 return rc;
791
792out_irq:
793 dma_free_coherent(priv->dev,
794 rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
795 rmu->msg_tx_ring.virt, rmu->msg_tx_ring.phys);
796
797out_dma:
798 for (i = 0; i < rmu->msg_tx_ring.size; i++)
799 dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE,
800 rmu->msg_tx_ring.virt_buffer[i],
801 rmu->msg_tx_ring.phys_buffer[i]);
802
803 return rc;
804}
805
806/**
807 * fsl_close_outb_mbox - Shut down MPC85xx outbound mailbox
808 * @mport: Master port implementing the outbound message unit
809 * @mbox: Mailbox to close
810 *
811 * Disables the outbound message unit, free all buffers, and
812 * frees the outbound message interrupt.
813 */
814void fsl_close_outb_mbox(struct rio_mport *mport, int mbox)
815{
816 struct rio_priv *priv = mport->priv;
817 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport);
818
819 /* Disable inbound message unit */
820 out_be32(&rmu->msg_regs->omr, 0);
821
822 /* Free ring */
823 dma_free_coherent(priv->dev,
824 rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
825 rmu->msg_tx_ring.virt, rmu->msg_tx_ring.phys);
826
827 /* Free interrupt */
828 free_irq(IRQ_RIO_TX(mport), (void *)mport);
829}
830
831/**
832 * fsl_open_inb_mbox - Initialize MPC85xx inbound mailbox
833 * @mport: Master port implementing the inbound message unit
834 * @dev_id: Device specific pointer to pass on event
835 * @mbox: Mailbox to open
836 * @entries: Number of entries in the inbound mailbox ring
837 *
838 * Initializes buffer ring, request the inbound message interrupt,
839 * and enables the inbound message unit. Returns %0 on success
840 * and %-EINVAL or %-ENOMEM on failure.
841 */
842int
843fsl_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
844{
845 int i, rc = 0;
846 struct rio_priv *priv = mport->priv;
847 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport);
848
849 if ((entries < RIO_MIN_RX_RING_SIZE) ||
850 (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
851 rc = -EINVAL;
852 goto out;
853 }
854
855 /* Initialize client buffer ring */
856 rmu->msg_rx_ring.dev_id = dev_id;
857 rmu->msg_rx_ring.size = entries;
858 rmu->msg_rx_ring.rx_slot = 0;
859 for (i = 0; i < rmu->msg_rx_ring.size; i++)
860 rmu->msg_rx_ring.virt_buffer[i] = NULL;
861
862 /* Initialize inbound message ring */
863 rmu->msg_rx_ring.virt = dma_alloc_coherent(priv->dev,
864 rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE,
865 &rmu->msg_rx_ring.phys, GFP_KERNEL);
866 if (!rmu->msg_rx_ring.virt) {
867 rc = -ENOMEM;
868 goto out;
869 }
870
871 /* Point dequeue/enqueue pointers at first entry in ring */
872 out_be32(&rmu->msg_regs->ifqdpar, (u32) rmu->msg_rx_ring.phys);
873 out_be32(&rmu->msg_regs->ifqepar, (u32) rmu->msg_rx_ring.phys);
874
875 /* Clear interrupt status */
876 out_be32(&rmu->msg_regs->isr, 0x00000091);
877
878 /* Hook up inbound message handler */
879 rc = request_irq(IRQ_RIO_RX(mport), fsl_rio_rx_handler, 0,
880 "msg_rx", (void *)mport);
881 if (rc < 0) {
882 dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE,
883 rmu->msg_tx_ring.virt_buffer[i],
884 rmu->msg_tx_ring.phys_buffer[i]);
885 goto out;
886 }
887
888 /*
889 * Configure inbound message unit:
890 * Snooping
891 * 4KB max message size
892 * Unmask all interrupt sources
893 * Disable
894 */
895 out_be32(&rmu->msg_regs->imr, 0x001b0060);
896
897 /* Set number of queue entries */
898 setbits32(&rmu->msg_regs->imr, (get_bitmask_order(entries) - 2) << 12);
899
900 /* Now enable the unit */
901 setbits32(&rmu->msg_regs->imr, 0x1);
902
903out:
904 return rc;
905}
906
907/**
908 * fsl_close_inb_mbox - Shut down MPC85xx inbound mailbox
909 * @mport: Master port implementing the inbound message unit
910 * @mbox: Mailbox to close
911 *
912 * Disables the inbound message unit, free all buffers, and
913 * frees the inbound message interrupt.
914 */
915void fsl_close_inb_mbox(struct rio_mport *mport, int mbox)
916{
917 struct rio_priv *priv = mport->priv;
918 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport);
919
920 /* Disable inbound message unit */
921 out_be32(&rmu->msg_regs->imr, 0);
922
923 /* Free ring */
924 dma_free_coherent(priv->dev, rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE,
925 rmu->msg_rx_ring.virt, rmu->msg_rx_ring.phys);
926
927 /* Free interrupt */
928 free_irq(IRQ_RIO_RX(mport), (void *)mport);
929}
930
931/**
932 * fsl_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
933 * @mport: Master port implementing the inbound message unit
934 * @mbox: Inbound mailbox number
935 * @buf: Buffer to add to inbound queue
936 *
937 * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
938 * %0 on success or %-EINVAL on failure.
939 */
940int fsl_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
941{
942 int rc = 0;
943 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport);
944
945 pr_debug("RIO: fsl_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
946 rmu->msg_rx_ring.rx_slot);
947
948 if (rmu->msg_rx_ring.virt_buffer[rmu->msg_rx_ring.rx_slot]) {
949 printk(KERN_ERR
950 "RIO: error adding inbound buffer %d, buffer exists\n",
951 rmu->msg_rx_ring.rx_slot);
952 rc = -EINVAL;
953 goto out;
954 }
955
956 rmu->msg_rx_ring.virt_buffer[rmu->msg_rx_ring.rx_slot] = buf;
957 if (++rmu->msg_rx_ring.rx_slot == rmu->msg_rx_ring.size)
958 rmu->msg_rx_ring.rx_slot = 0;
959
960out:
961 return rc;
962}
963
964/**
965 * fsl_get_inb_message - Fetch inbound message from the MPC85xx message unit
966 * @mport: Master port implementing the inbound message unit
967 * @mbox: Inbound mailbox number
968 *
969 * Gets the next available inbound message from the inbound message queue.
970 * A pointer to the message is returned on success or NULL on failure.
971 */
972void *fsl_get_inb_message(struct rio_mport *mport, int mbox)
973{
974 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport);
975 u32 phys_buf, virt_buf;
976 void *buf = NULL;
977 int buf_idx;
978
979 phys_buf = in_be32(&rmu->msg_regs->ifqdpar);
980
981 /* If no more messages, then bail out */
982 if (phys_buf == in_be32(&rmu->msg_regs->ifqepar))
983 goto out2;
984
985 virt_buf = (u32) rmu->msg_rx_ring.virt + (phys_buf
986 - rmu->msg_rx_ring.phys);
987 buf_idx = (phys_buf - rmu->msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
988 buf = rmu->msg_rx_ring.virt_buffer[buf_idx];
989
990 if (!buf) {
991 printk(KERN_ERR
992 "RIO: inbound message copy failed, no buffers\n");
993 goto out1;
994 }
995
996 /* Copy max message size, caller is expected to allocate that big */
997 memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
998
999 /* Clear the available buffer */
1000 rmu->msg_rx_ring.virt_buffer[buf_idx] = NULL;
1001
1002out1:
1003 setbits32(&rmu->msg_regs->imr, RIO_MSG_IMR_MI);
1004
1005out2:
1006 return buf;
1007}
1008
1009/**
1010 * fsl_rio_doorbell_init - MPC85xx doorbell interface init
1011 * @mport: Master port implementing the inbound doorbell unit
1012 *
1013 * Initializes doorbell unit hardware and inbound DMA buffer
1014 * ring. Called from fsl_rio_setup(). Returns %0 on success
1015 * or %-ENOMEM on failure.
1016 */
1017int fsl_rio_doorbell_init(struct fsl_rio_dbell *dbell)
1018{
1019 int rc = 0;
1020
1021 /* Initialize inbound doorbells */
1022 dbell->dbell_ring.virt = dma_alloc_coherent(dbell->dev, 512 *
1023 DOORBELL_MESSAGE_SIZE, &dbell->dbell_ring.phys, GFP_KERNEL);
1024 if (!dbell->dbell_ring.virt) {
1025 printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
1026 rc = -ENOMEM;
1027 goto out;
1028 }
1029
1030 /* Point dequeue/enqueue pointers at first entry in ring */
1031 out_be32(&dbell->dbell_regs->dqdpar, (u32) dbell->dbell_ring.phys);
1032 out_be32(&dbell->dbell_regs->dqepar, (u32) dbell->dbell_ring.phys);
1033
1034 /* Clear interrupt status */
1035 out_be32(&dbell->dbell_regs->dsr, 0x00000091);
1036
1037 /* Hook up doorbell handler */
1038 rc = request_irq(IRQ_RIO_BELL(dbell), fsl_rio_dbell_handler, 0,
1039 "dbell_rx", (void *)dbell);
1040 if (rc < 0) {
1041 dma_free_coherent(dbell->dev, 512 * DOORBELL_MESSAGE_SIZE,
1042 dbell->dbell_ring.virt, dbell->dbell_ring.phys);
1043 printk(KERN_ERR
1044 "MPC85xx RIO: unable to request inbound doorbell irq");
1045 goto out;
1046 }
1047
1048 /* Configure doorbells for snooping, 512 entries, and enable */
1049 out_be32(&dbell->dbell_regs->dmr, 0x00108161);
1050
1051out:
1052 return rc;
1053}
1054
1055int fsl_rio_setup_rmu(struct rio_mport *mport, struct device_node *node)
1056{
1057 struct rio_priv *priv;
1058 struct fsl_rmu *rmu;
1059 u64 msg_start;
1060 const u32 *msg_addr;
1061 int mlen;
1062 int aw;
1063
1064 if (!mport || !mport->priv)
1065 return -EINVAL;
1066
1067 priv = mport->priv;
1068
1069 if (!node) {
1070 dev_warn(priv->dev, "Can't get %s property 'fsl,rmu'\n",
1071 priv->dev->of_node->full_name);
1072 return -EINVAL;
1073 }
1074
1075 rmu = kzalloc(sizeof(struct fsl_rmu), GFP_KERNEL);
1076 if (!rmu)
1077 return -ENOMEM;
1078
1079 aw = of_n_addr_cells(node);
1080 msg_addr = of_get_property(node, "reg", &mlen);
1081 if (!msg_addr) {
1082 pr_err("%s: unable to find 'reg' property of message-unit\n",
1083 node->full_name);
1084 kfree(rmu);
1085 return -ENOMEM;
1086 }
1087 msg_start = of_read_number(msg_addr, aw);
1088
1089 rmu->msg_regs = (struct rio_msg_regs *)
1090 (rmu_regs_win + (u32)msg_start);
1091
1092 rmu->txirq = irq_of_parse_and_map(node, 0);
1093 rmu->rxirq = irq_of_parse_and_map(node, 1);
1094 printk(KERN_INFO "%s: txirq: %d, rxirq %d\n",
1095 node->full_name, rmu->txirq, rmu->rxirq);
1096
1097 priv->rmm_handle = rmu;
1098
1099 rio_init_dbell_res(&mport->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
1100 rio_init_mbox_res(&mport->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
1101 rio_init_mbox_res(&mport->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
1102
1103 return 0;
1104}
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 8c7e8528e7c4..4e9ccb1015de 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -154,7 +154,7 @@ static inline unsigned int mpic_processor_id(struct mpic *mpic)
154{ 154{
155 unsigned int cpu = 0; 155 unsigned int cpu = 0;
156 156
157 if (mpic->flags & MPIC_PRIMARY) 157 if (!(mpic->flags & MPIC_SECONDARY))
158 cpu = hard_smp_processor_id(); 158 cpu = hard_smp_processor_id();
159 159
160 return cpu; 160 return cpu;
@@ -315,29 +315,25 @@ static void _mpic_map_mmio(struct mpic *mpic, phys_addr_t phys_addr,
315} 315}
316 316
317#ifdef CONFIG_PPC_DCR 317#ifdef CONFIG_PPC_DCR
318static void _mpic_map_dcr(struct mpic *mpic, struct device_node *node, 318static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb,
319 struct mpic_reg_bank *rb,
320 unsigned int offset, unsigned int size) 319 unsigned int offset, unsigned int size)
321{ 320{
322 const u32 *dbasep; 321 phys_addr_t phys_addr = dcr_resource_start(mpic->node, 0);
323 322 rb->dhost = dcr_map(mpic->node, phys_addr + offset, size);
324 dbasep = of_get_property(node, "dcr-reg", NULL);
325
326 rb->dhost = dcr_map(node, *dbasep + offset, size);
327 BUG_ON(!DCR_MAP_OK(rb->dhost)); 323 BUG_ON(!DCR_MAP_OK(rb->dhost));
328} 324}
329 325
330static inline void mpic_map(struct mpic *mpic, struct device_node *node, 326static inline void mpic_map(struct mpic *mpic,
331 phys_addr_t phys_addr, struct mpic_reg_bank *rb, 327 phys_addr_t phys_addr, struct mpic_reg_bank *rb,
332 unsigned int offset, unsigned int size) 328 unsigned int offset, unsigned int size)
333{ 329{
334 if (mpic->flags & MPIC_USES_DCR) 330 if (mpic->flags & MPIC_USES_DCR)
335 _mpic_map_dcr(mpic, node, rb, offset, size); 331 _mpic_map_dcr(mpic, rb, offset, size);
336 else 332 else
337 _mpic_map_mmio(mpic, phys_addr, rb, offset, size); 333 _mpic_map_mmio(mpic, phys_addr, rb, offset, size);
338} 334}
339#else /* CONFIG_PPC_DCR */ 335#else /* CONFIG_PPC_DCR */
340#define mpic_map(m,n,p,b,o,s) _mpic_map_mmio(m,p,b,o,s) 336#define mpic_map(m,p,b,o,s) _mpic_map_mmio(m,p,b,o,s)
341#endif /* !CONFIG_PPC_DCR */ 337#endif /* !CONFIG_PPC_DCR */
342 338
343 339
@@ -901,7 +897,7 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type)
901 if (vold != vnew) 897 if (vold != vnew)
902 mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI), vnew); 898 mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI), vnew);
903 899
904 return IRQ_SET_MASK_OK_NOCOPY;; 900 return IRQ_SET_MASK_OK_NOCOPY;
905} 901}
906 902
907void mpic_set_vector(unsigned int virq, unsigned int vector) 903void mpic_set_vector(unsigned int virq, unsigned int vector)
@@ -990,7 +986,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq,
990 986
991#ifdef CONFIG_SMP 987#ifdef CONFIG_SMP
992 else if (hw >= mpic->ipi_vecs[0]) { 988 else if (hw >= mpic->ipi_vecs[0]) {
993 WARN_ON(!(mpic->flags & MPIC_PRIMARY)); 989 WARN_ON(mpic->flags & MPIC_SECONDARY);
994 990
995 DBG("mpic: mapping as IPI\n"); 991 DBG("mpic: mapping as IPI\n");
996 irq_set_chip_data(virq, mpic); 992 irq_set_chip_data(virq, mpic);
@@ -1001,7 +997,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq,
1001#endif /* CONFIG_SMP */ 997#endif /* CONFIG_SMP */
1002 998
1003 if (hw >= mpic->timer_vecs[0] && hw <= mpic->timer_vecs[7]) { 999 if (hw >= mpic->timer_vecs[0] && hw <= mpic->timer_vecs[7]) {
1004 WARN_ON(!(mpic->flags & MPIC_PRIMARY)); 1000 WARN_ON(mpic->flags & MPIC_SECONDARY);
1005 1001
1006 DBG("mpic: mapping as timer\n"); 1002 DBG("mpic: mapping as timer\n");
1007 irq_set_chip_data(virq, mpic); 1003 irq_set_chip_data(virq, mpic);
@@ -1115,17 +1111,28 @@ static int mpic_host_xlate(struct irq_host *h, struct device_node *ct,
1115 return 0; 1111 return 0;
1116} 1112}
1117 1113
1114/* IRQ handler for a secondary MPIC cascaded from another IRQ controller */
1115static void mpic_cascade(unsigned int irq, struct irq_desc *desc)
1116{
1117 struct irq_chip *chip = irq_desc_get_chip(desc);
1118 struct mpic *mpic = irq_desc_get_handler_data(desc);
1119 unsigned int virq;
1120
1121 BUG_ON(!(mpic->flags & MPIC_SECONDARY));
1122
1123 virq = mpic_get_one_irq(mpic);
1124 if (virq != NO_IRQ)
1125 generic_handle_irq(virq);
1126
1127 chip->irq_eoi(&desc->irq_data);
1128}
1129
1118static struct irq_host_ops mpic_host_ops = { 1130static struct irq_host_ops mpic_host_ops = {
1119 .match = mpic_host_match, 1131 .match = mpic_host_match,
1120 .map = mpic_host_map, 1132 .map = mpic_host_map,
1121 .xlate = mpic_host_xlate, 1133 .xlate = mpic_host_xlate,
1122}; 1134};
1123 1135
1124static int mpic_reset_prohibited(struct device_node *node)
1125{
1126 return node && of_get_property(node, "pic-no-reset", NULL);
1127}
1128
1129/* 1136/*
1130 * Exported functions 1137 * Exported functions
1131 */ 1138 */
@@ -1137,27 +1144,60 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1137 unsigned int irq_count, 1144 unsigned int irq_count,
1138 const char *name) 1145 const char *name)
1139{ 1146{
1140 struct mpic *mpic; 1147 int i, psize, intvec_top;
1141 u32 greg_feature; 1148 struct mpic *mpic;
1142 const char *vers; 1149 u32 greg_feature;
1143 int i; 1150 const char *vers;
1144 int intvec_top; 1151 const u32 *psrc;
1145 u64 paddr = phys_addr; 1152
1153 /* Default MPIC search parameters */
1154 static const struct of_device_id __initconst mpic_device_id[] = {
1155 { .type = "open-pic", },
1156 { .compatible = "open-pic", },
1157 {},
1158 };
1159
1160 /*
1161 * If we were not passed a device-tree node, then perform the default
1162 * search for standardized a standardized OpenPIC.
1163 */
1164 if (node) {
1165 node = of_node_get(node);
1166 } else {
1167 node = of_find_matching_node(NULL, mpic_device_id);
1168 if (!node)
1169 return NULL;
1170 }
1171
1172 /* Pick the physical address from the device tree if unspecified */
1173 if (!phys_addr) {
1174 /* Check if it is DCR-based */
1175 if (of_get_property(node, "dcr-reg", NULL)) {
1176 flags |= MPIC_USES_DCR;
1177 } else {
1178 struct resource r;
1179 if (of_address_to_resource(node, 0, &r))
1180 goto err_of_node_put;
1181 phys_addr = r.start;
1182 }
1183 }
1146 1184
1147 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL); 1185 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL);
1148 if (mpic == NULL) 1186 if (mpic == NULL)
1149 return NULL; 1187 goto err_of_node_put;
1150 1188
1151 mpic->name = name; 1189 mpic->name = name;
1190 mpic->node = node;
1191 mpic->paddr = phys_addr;
1152 1192
1153 mpic->hc_irq = mpic_irq_chip; 1193 mpic->hc_irq = mpic_irq_chip;
1154 mpic->hc_irq.name = name; 1194 mpic->hc_irq.name = name;
1155 if (flags & MPIC_PRIMARY) 1195 if (!(flags & MPIC_SECONDARY))
1156 mpic->hc_irq.irq_set_affinity = mpic_set_affinity; 1196 mpic->hc_irq.irq_set_affinity = mpic_set_affinity;
1157#ifdef CONFIG_MPIC_U3_HT_IRQS 1197#ifdef CONFIG_MPIC_U3_HT_IRQS
1158 mpic->hc_ht_irq = mpic_irq_ht_chip; 1198 mpic->hc_ht_irq = mpic_irq_ht_chip;
1159 mpic->hc_ht_irq.name = name; 1199 mpic->hc_ht_irq.name = name;
1160 if (flags & MPIC_PRIMARY) 1200 if (!(flags & MPIC_SECONDARY))
1161 mpic->hc_ht_irq.irq_set_affinity = mpic_set_affinity; 1201 mpic->hc_ht_irq.irq_set_affinity = mpic_set_affinity;
1162#endif /* CONFIG_MPIC_U3_HT_IRQS */ 1202#endif /* CONFIG_MPIC_U3_HT_IRQS */
1163 1203
@@ -1194,28 +1234,22 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1194 mpic->spurious_vec = intvec_top; 1234 mpic->spurious_vec = intvec_top;
1195 1235
1196 /* Check for "big-endian" in device-tree */ 1236 /* Check for "big-endian" in device-tree */
1197 if (node && of_get_property(node, "big-endian", NULL) != NULL) 1237 if (of_get_property(mpic->node, "big-endian", NULL) != NULL)
1198 mpic->flags |= MPIC_BIG_ENDIAN; 1238 mpic->flags |= MPIC_BIG_ENDIAN;
1199 if (node && of_device_is_compatible(node, "fsl,mpic")) 1239 if (of_device_is_compatible(mpic->node, "fsl,mpic"))
1200 mpic->flags |= MPIC_FSL; 1240 mpic->flags |= MPIC_FSL;
1201 1241
1202 /* Look for protected sources */ 1242 /* Look for protected sources */
1203 if (node) { 1243 psrc = of_get_property(mpic->node, "protected-sources", &psize);
1204 int psize; 1244 if (psrc) {
1205 unsigned int bits, mapsize; 1245 /* Allocate a bitmap with one bit per interrupt */
1206 const u32 *psrc = 1246 unsigned int mapsize = BITS_TO_LONGS(intvec_top + 1);
1207 of_get_property(node, "protected-sources", &psize); 1247 mpic->protected = kzalloc(mapsize*sizeof(long), GFP_KERNEL);
1208 if (psrc) { 1248 BUG_ON(mpic->protected == NULL);
1209 psize /= 4; 1249 for (i = 0; i < psize/sizeof(u32); i++) {
1210 bits = intvec_top + 1; 1250 if (psrc[i] > intvec_top)
1211 mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long); 1251 continue;
1212 mpic->protected = kzalloc(mapsize, GFP_KERNEL); 1252 __set_bit(psrc[i], mpic->protected);
1213 BUG_ON(mpic->protected == NULL);
1214 for (i = 0; i < psize; i++) {
1215 if (psrc[i] > intvec_top)
1216 continue;
1217 __set_bit(psrc[i], mpic->protected);
1218 }
1219 } 1253 }
1220 } 1254 }
1221 1255
@@ -1224,42 +1258,32 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1224#endif 1258#endif
1225 1259
1226 /* default register type */ 1260 /* default register type */
1227 mpic->reg_type = (flags & MPIC_BIG_ENDIAN) ? 1261 if (flags & MPIC_BIG_ENDIAN)
1228 mpic_access_mmio_be : mpic_access_mmio_le; 1262 mpic->reg_type = mpic_access_mmio_be;
1229 1263 else
1230 /* If no physical address is passed in, a device-node is mandatory */ 1264 mpic->reg_type = mpic_access_mmio_le;
1231 BUG_ON(paddr == 0 && node == NULL);
1232 1265
1233 /* If no physical address passed in, check if it's dcr based */ 1266 /*
1234 if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) { 1267 * An MPIC with a "dcr-reg" property must be accessed that way, but
1268 * only if the kernel includes DCR support.
1269 */
1235#ifdef CONFIG_PPC_DCR 1270#ifdef CONFIG_PPC_DCR
1236 mpic->flags |= MPIC_USES_DCR; 1271 if (flags & MPIC_USES_DCR)
1237 mpic->reg_type = mpic_access_dcr; 1272 mpic->reg_type = mpic_access_dcr;
1238#else 1273#else
1239 BUG(); 1274 BUG_ON(flags & MPIC_USES_DCR);
1240#endif /* CONFIG_PPC_DCR */ 1275#endif
1241 }
1242
1243 /* If the MPIC is not DCR based, and no physical address was passed
1244 * in, try to obtain one
1245 */
1246 if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) {
1247 const u32 *reg = of_get_property(node, "reg", NULL);
1248 BUG_ON(reg == NULL);
1249 paddr = of_translate_address(node, reg);
1250 BUG_ON(paddr == OF_BAD_ADDR);
1251 }
1252 1276
1253 /* Map the global registers */ 1277 /* Map the global registers */
1254 mpic_map(mpic, node, paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000); 1278 mpic_map(mpic, mpic->paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000);
1255 mpic_map(mpic, node, paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000); 1279 mpic_map(mpic, mpic->paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000);
1256 1280
1257 /* Reset */ 1281 /* Reset */
1258 1282
1259 /* When using a device-node, reset requests are only honored if the MPIC 1283 /* When using a device-node, reset requests are only honored if the MPIC
1260 * is allowed to reset. 1284 * is allowed to reset.
1261 */ 1285 */
1262 if (mpic_reset_prohibited(node)) 1286 if (of_get_property(mpic->node, "pic-no-reset", NULL))
1263 mpic->flags |= MPIC_NO_RESET; 1287 mpic->flags |= MPIC_NO_RESET;
1264 1288
1265 if ((flags & MPIC_WANTS_RESET) && !(mpic->flags & MPIC_NO_RESET)) { 1289 if ((flags & MPIC_WANTS_RESET) && !(mpic->flags & MPIC_NO_RESET)) {
@@ -1307,7 +1331,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1307 for_each_possible_cpu(i) { 1331 for_each_possible_cpu(i) {
1308 unsigned int cpu = get_hard_smp_processor_id(i); 1332 unsigned int cpu = get_hard_smp_processor_id(i);
1309 1333
1310 mpic_map(mpic, node, paddr, &mpic->cpuregs[cpu], 1334 mpic_map(mpic, mpic->paddr, &mpic->cpuregs[cpu],
1311 MPIC_INFO(CPU_BASE) + cpu * MPIC_INFO(CPU_STRIDE), 1335 MPIC_INFO(CPU_BASE) + cpu * MPIC_INFO(CPU_STRIDE),
1312 0x1000); 1336 0x1000);
1313 } 1337 }
@@ -1315,16 +1339,21 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1315 /* Initialize main ISU if none provided */ 1339 /* Initialize main ISU if none provided */
1316 if (mpic->isu_size == 0) { 1340 if (mpic->isu_size == 0) {
1317 mpic->isu_size = mpic->num_sources; 1341 mpic->isu_size = mpic->num_sources;
1318 mpic_map(mpic, node, paddr, &mpic->isus[0], 1342 mpic_map(mpic, mpic->paddr, &mpic->isus[0],
1319 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); 1343 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size);
1320 } 1344 }
1321 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); 1345 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1);
1322 mpic->isu_mask = (1 << mpic->isu_shift) - 1; 1346 mpic->isu_mask = (1 << mpic->isu_shift) - 1;
1323 1347
1324 mpic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 1348 mpic->irqhost = irq_alloc_host(mpic->node, IRQ_HOST_MAP_LINEAR,
1325 isu_size ? isu_size : mpic->num_sources, 1349 isu_size ? isu_size : mpic->num_sources,
1326 &mpic_host_ops, 1350 &mpic_host_ops,
1327 flags & MPIC_LARGE_VECTORS ? 2048 : 256); 1351 flags & MPIC_LARGE_VECTORS ? 2048 : 256);
1352
1353 /*
1354 * FIXME: The code leaks the MPIC object and mappings here; this
1355 * is very unlikely to fail but it ought to be fixed anyways.
1356 */
1328 if (mpic->irqhost == NULL) 1357 if (mpic->irqhost == NULL)
1329 return NULL; 1358 return NULL;
1330 1359
@@ -1347,19 +1376,23 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1347 } 1376 }
1348 printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx," 1377 printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx,"
1349 " max %d CPUs\n", 1378 " max %d CPUs\n",
1350 name, vers, (unsigned long long)paddr, num_possible_cpus()); 1379 name, vers, (unsigned long long)mpic->paddr, num_possible_cpus());
1351 printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n", 1380 printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n",
1352 mpic->isu_size, mpic->isu_shift, mpic->isu_mask); 1381 mpic->isu_size, mpic->isu_shift, mpic->isu_mask);
1353 1382
1354 mpic->next = mpics; 1383 mpic->next = mpics;
1355 mpics = mpic; 1384 mpics = mpic;
1356 1385
1357 if (flags & MPIC_PRIMARY) { 1386 if (!(flags & MPIC_SECONDARY)) {
1358 mpic_primary = mpic; 1387 mpic_primary = mpic;
1359 irq_set_default_host(mpic->irqhost); 1388 irq_set_default_host(mpic->irqhost);
1360 } 1389 }
1361 1390
1362 return mpic; 1391 return mpic;
1392
1393err_of_node_put:
1394 of_node_put(node);
1395 return NULL;
1363} 1396}
1364 1397
1365void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, 1398void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
@@ -1369,7 +1402,7 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
1369 1402
1370 BUG_ON(isu_num >= MPIC_MAX_ISU); 1403 BUG_ON(isu_num >= MPIC_MAX_ISU);
1371 1404
1372 mpic_map(mpic, mpic->irqhost->of_node, 1405 mpic_map(mpic,
1373 paddr, &mpic->isus[isu_num], 0, 1406 paddr, &mpic->isus[isu_num], 0,
1374 MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); 1407 MPIC_INFO(IRQ_STRIDE) * mpic->isu_size);
1375 1408
@@ -1385,8 +1418,7 @@ void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count)
1385 1418
1386void __init mpic_init(struct mpic *mpic) 1419void __init mpic_init(struct mpic *mpic)
1387{ 1420{
1388 int i; 1421 int i, cpu;
1389 int cpu;
1390 1422
1391 BUG_ON(mpic->num_sources == 0); 1423 BUG_ON(mpic->num_sources == 0);
1392 1424
@@ -1424,7 +1456,7 @@ void __init mpic_init(struct mpic *mpic)
1424 1456
1425 /* Do the HT PIC fixups on U3 broken mpic */ 1457 /* Do the HT PIC fixups on U3 broken mpic */
1426 DBG("MPIC flags: %x\n", mpic->flags); 1458 DBG("MPIC flags: %x\n", mpic->flags);
1427 if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY)) { 1459 if ((mpic->flags & MPIC_U3_HT_IRQS) && !(mpic->flags & MPIC_SECONDARY)) {
1428 mpic_scan_ht_pics(mpic); 1460 mpic_scan_ht_pics(mpic);
1429 mpic_u3msi_init(mpic); 1461 mpic_u3msi_init(mpic);
1430 } 1462 }
@@ -1471,6 +1503,17 @@ void __init mpic_init(struct mpic *mpic)
1471 GFP_KERNEL); 1503 GFP_KERNEL);
1472 BUG_ON(mpic->save_data == NULL); 1504 BUG_ON(mpic->save_data == NULL);
1473#endif 1505#endif
1506
1507 /* Check if this MPIC is chained from a parent interrupt controller */
1508 if (mpic->flags & MPIC_SECONDARY) {
1509 int virq = irq_of_parse_and_map(mpic->node, 0);
1510 if (virq != NO_IRQ) {
1511 printk(KERN_INFO "%s: hooking up to IRQ %d\n",
1512 mpic->node->full_name, virq);
1513 irq_set_handler_data(virq, mpic);
1514 irq_set_chained_handler(virq, &mpic_cascade);
1515 }
1516 }
1474} 1517}
1475 1518
1476void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio) 1519void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
diff --git a/arch/powerpc/sysdev/ppc4xx_cpm.c b/arch/powerpc/sysdev/ppc4xx_cpm.c
index 73b86cc5ea74..82e2cfe35c62 100644
--- a/arch/powerpc/sysdev/ppc4xx_cpm.c
+++ b/arch/powerpc/sysdev/ppc4xx_cpm.c
@@ -179,12 +179,12 @@ static struct kobj_attribute cpm_idle_attr =
179 179
180static void cpm_idle_config_sysfs(void) 180static void cpm_idle_config_sysfs(void)
181{ 181{
182 struct sys_device *sys_dev; 182 struct device *dev;
183 unsigned long ret; 183 unsigned long ret;
184 184
185 sys_dev = get_cpu_sysdev(0); 185 dev = get_cpu_device(0);
186 186
187 ret = sysfs_create_file(&sys_dev->kobj, 187 ret = sysfs_create_file(&dev->kobj,
188 &cpm_idle_attr.attr); 188 &cpm_idle_attr.attr);
189 if (ret) 189 if (ret)
190 printk(KERN_WARNING 190 printk(KERN_WARNING
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 862f11b3821e..4f05f7542346 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -185,9 +185,15 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
185 out: 185 out:
186 dma_offset_set = 1; 186 dma_offset_set = 1;
187 pci_dram_offset = res->start; 187 pci_dram_offset = res->start;
188 hose->dma_window_base_cur = res->start;
189 hose->dma_window_size = resource_size(res);
188 190
189 printk(KERN_INFO "4xx PCI DMA offset set to 0x%08lx\n", 191 printk(KERN_INFO "4xx PCI DMA offset set to 0x%08lx\n",
190 pci_dram_offset); 192 pci_dram_offset);
193 printk(KERN_INFO "4xx PCI DMA window base to 0x%016llx\n",
194 (unsigned long long)hose->dma_window_base_cur);
195 printk(KERN_INFO "DMA window size 0x%016llx\n",
196 (unsigned long long)hose->dma_window_size);
191 return 0; 197 return 0;
192} 198}
193 199
@@ -647,6 +653,7 @@ static unsigned int ppc4xx_pciex_port_count;
647 653
648struct ppc4xx_pciex_hwops 654struct ppc4xx_pciex_hwops
649{ 655{
656 bool want_sdr;
650 int (*core_init)(struct device_node *np); 657 int (*core_init)(struct device_node *np);
651 int (*port_init_hw)(struct ppc4xx_pciex_port *port); 658 int (*port_init_hw)(struct ppc4xx_pciex_port *port);
652 int (*setup_utl)(struct ppc4xx_pciex_port *port); 659 int (*setup_utl)(struct ppc4xx_pciex_port *port);
@@ -916,6 +923,7 @@ static int ppc440speB_pciex_init_utl(struct ppc4xx_pciex_port *port)
916 923
917static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata = 924static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata =
918{ 925{
926 .want_sdr = true,
919 .core_init = ppc440spe_pciex_core_init, 927 .core_init = ppc440spe_pciex_core_init,
920 .port_init_hw = ppc440speA_pciex_init_port_hw, 928 .port_init_hw = ppc440speA_pciex_init_port_hw,
921 .setup_utl = ppc440speA_pciex_init_utl, 929 .setup_utl = ppc440speA_pciex_init_utl,
@@ -924,6 +932,7 @@ static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata =
924 932
925static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata = 933static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
926{ 934{
935 .want_sdr = true,
927 .core_init = ppc440spe_pciex_core_init, 936 .core_init = ppc440spe_pciex_core_init,
928 .port_init_hw = ppc440speB_pciex_init_port_hw, 937 .port_init_hw = ppc440speB_pciex_init_port_hw,
929 .setup_utl = ppc440speB_pciex_init_utl, 938 .setup_utl = ppc440speB_pciex_init_utl,
@@ -1034,6 +1043,7 @@ static int ppc460ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
1034 1043
1035static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata = 1044static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata =
1036{ 1045{
1046 .want_sdr = true,
1037 .core_init = ppc460ex_pciex_core_init, 1047 .core_init = ppc460ex_pciex_core_init,
1038 .port_init_hw = ppc460ex_pciex_init_port_hw, 1048 .port_init_hw = ppc460ex_pciex_init_port_hw,
1039 .setup_utl = ppc460ex_pciex_init_utl, 1049 .setup_utl = ppc460ex_pciex_init_utl,
@@ -1181,6 +1191,7 @@ done:
1181} 1191}
1182 1192
1183static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = { 1193static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = {
1194 .want_sdr = true,
1184 .core_init = ppc460sx_pciex_core_init, 1195 .core_init = ppc460sx_pciex_core_init,
1185 .port_init_hw = ppc460sx_pciex_init_port_hw, 1196 .port_init_hw = ppc460sx_pciex_init_port_hw,
1186 .setup_utl = ppc460sx_pciex_init_utl, 1197 .setup_utl = ppc460sx_pciex_init_utl,
@@ -1276,6 +1287,7 @@ static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
1276 1287
1277static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata = 1288static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =
1278{ 1289{
1290 .want_sdr = true,
1279 .core_init = ppc405ex_pciex_core_init, 1291 .core_init = ppc405ex_pciex_core_init,
1280 .port_init_hw = ppc405ex_pciex_init_port_hw, 1292 .port_init_hw = ppc405ex_pciex_init_port_hw,
1281 .setup_utl = ppc405ex_pciex_init_utl, 1293 .setup_utl = ppc405ex_pciex_init_utl,
@@ -1284,6 +1296,52 @@ static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =
1284 1296
1285#endif /* CONFIG_40x */ 1297#endif /* CONFIG_40x */
1286 1298
1299#ifdef CONFIG_476FPE
1300static int __init ppc_476fpe_pciex_core_init(struct device_node *np)
1301{
1302 return 4;
1303}
1304
1305static void __init ppc_476fpe_pciex_check_link(struct ppc4xx_pciex_port *port)
1306{
1307 u32 timeout_ms = 20;
1308 u32 val = 0, mask = (PECFG_TLDLP_LNKUP|PECFG_TLDLP_PRESENT);
1309 void __iomem *mbase = ioremap(port->cfg_space.start + 0x10000000,
1310 0x1000);
1311
1312 printk(KERN_INFO "PCIE%d: Checking link...\n", port->index);
1313
1314 if (mbase == NULL) {
1315 printk(KERN_WARNING "PCIE%d: failed to get cfg space\n",
1316 port->index);
1317 return;
1318 }
1319
1320 while (timeout_ms--) {
1321 val = in_le32(mbase + PECFG_TLDLP);
1322
1323 if ((val & mask) == mask)
1324 break;
1325 msleep(10);
1326 }
1327
1328 if (val & PECFG_TLDLP_PRESENT) {
1329 printk(KERN_INFO "PCIE%d: link is up !\n", port->index);
1330 port->link = 1;
1331 } else
1332 printk(KERN_WARNING "PCIE%d: Link up failed\n", port->index);
1333
1334 iounmap(mbase);
1335 return;
1336}
1337
1338static struct ppc4xx_pciex_hwops ppc_476fpe_pcie_hwops __initdata =
1339{
1340 .core_init = ppc_476fpe_pciex_core_init,
1341 .check_link = ppc_476fpe_pciex_check_link,
1342};
1343#endif /* CONFIG_476FPE */
1344
1287/* Check that the core has been initied and if not, do it */ 1345/* Check that the core has been initied and if not, do it */
1288static int __init ppc4xx_pciex_check_core_init(struct device_node *np) 1346static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
1289{ 1347{
@@ -1309,6 +1367,10 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
1309 if (of_device_is_compatible(np, "ibm,plb-pciex-405ex")) 1367 if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
1310 ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops; 1368 ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops;
1311#endif 1369#endif
1370#ifdef CONFIG_476FPE
1371 if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe"))
1372 ppc4xx_pciex_hwops = &ppc_476fpe_pcie_hwops;
1373#endif
1312 if (ppc4xx_pciex_hwops == NULL) { 1374 if (ppc4xx_pciex_hwops == NULL) {
1313 printk(KERN_WARNING "PCIE: unknown host type %s\n", 1375 printk(KERN_WARNING "PCIE: unknown host type %s\n",
1314 np->full_name); 1376 np->full_name);
@@ -1617,6 +1679,10 @@ static int __init ppc4xx_setup_one_pciex_POM(struct ppc4xx_pciex_port *port,
1617 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 1679 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,
1618 sa | DCRO_PEGPL_460SX_OMR1MSKL_UOT 1680 sa | DCRO_PEGPL_460SX_OMR1MSKL_UOT
1619 | DCRO_PEGPL_OMRxMSKL_VAL); 1681 | DCRO_PEGPL_OMRxMSKL_VAL);
1682 else if (of_device_is_compatible(port->node, "ibm,plb-pciex-476fpe"))
1683 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,
1684 sa | DCRO_PEGPL_476FPE_OMR1MSKL_UOT
1685 | DCRO_PEGPL_OMRxMSKL_VAL);
1620 else 1686 else
1621 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 1687 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,
1622 sa | DCRO_PEGPL_OMR1MSKL_UOT 1688 sa | DCRO_PEGPL_OMR1MSKL_UOT
@@ -1739,9 +1805,10 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
1739 /* Calculate window size */ 1805 /* Calculate window size */
1740 sa = (0xffffffffffffffffull << ilog2(size)); 1806 sa = (0xffffffffffffffffull << ilog2(size));
1741 if (res->flags & IORESOURCE_PREFETCH) 1807 if (res->flags & IORESOURCE_PREFETCH)
1742 sa |= 0x8; 1808 sa |= PCI_BASE_ADDRESS_MEM_PREFETCH;
1743 1809
1744 if (of_device_is_compatible(port->node, "ibm,plb-pciex-460sx")) 1810 if (of_device_is_compatible(port->node, "ibm,plb-pciex-460sx") ||
1811 of_device_is_compatible(port->node, "ibm,plb-pciex-476fpe"))
1745 sa |= PCI_BASE_ADDRESS_MEM_TYPE_64; 1812 sa |= PCI_BASE_ADDRESS_MEM_TYPE_64;
1746 1813
1747 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa)); 1814 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
@@ -1972,13 +2039,15 @@ static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
1972 } 2039 }
1973 2040
1974 port->node = of_node_get(np); 2041 port->node = of_node_get(np);
1975 pval = of_get_property(np, "sdr-base", NULL); 2042 if (ppc4xx_pciex_hwops->want_sdr) {
1976 if (pval == NULL) { 2043 pval = of_get_property(np, "sdr-base", NULL);
1977 printk(KERN_ERR "PCIE: missing sdr-base for %s\n", 2044 if (pval == NULL) {
1978 np->full_name); 2045 printk(KERN_ERR "PCIE: missing sdr-base for %s\n",
1979 return; 2046 np->full_name);
2047 return;
2048 }
2049 port->sdr_base = *pval;
1980 } 2050 }
1981 port->sdr_base = *pval;
1982 2051
1983 /* Check if device_type property is set to "pci" or "pci-endpoint". 2052 /* Check if device_type property is set to "pci" or "pci-endpoint".
1984 * Resulting from this setup this PCIe port will be configured 2053 * Resulting from this setup this PCIe port will be configured
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.h b/arch/powerpc/sysdev/ppc4xx_pci.h
index 32ce763a375a..bb4821938ab1 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.h
+++ b/arch/powerpc/sysdev/ppc4xx_pci.h
@@ -476,6 +476,13 @@
476#define DCRO_PEGPL_OMR1MSKL_UOT 0x00000002 476#define DCRO_PEGPL_OMR1MSKL_UOT 0x00000002
477#define DCRO_PEGPL_OMR3MSKL_IO 0x00000002 477#define DCRO_PEGPL_OMR3MSKL_IO 0x00000002
478 478
479/* 476FPE */
480#define PCCFG_LCPA 0x270
481#define PECFG_TLDLP 0x3F8
482#define PECFG_TLDLP_LNKUP 0x00000008
483#define PECFG_TLDLP_PRESENT 0x00000010
484#define DCRO_PEGPL_476FPE_OMR1MSKL_UOT 0x00000004
485
479/* SDR Bit Mappings */ 486/* SDR Bit Mappings */
480#define PESDRx_RCSSET_HLDPLB 0x10000000 487#define PESDRx_RCSSET_HLDPLB 0x10000000
481#define PESDRx_RCSSET_RSTGU 0x01000000 488#define PESDRx_RCSSET_RSTGU 0x01000000
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c
index e23f23cf9f5c..521e67a49dc4 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/arch/powerpc/sysdev/qe_lib/gpio.c
@@ -139,14 +139,10 @@ struct qe_pin {
139struct qe_pin *qe_pin_request(struct device_node *np, int index) 139struct qe_pin *qe_pin_request(struct device_node *np, int index)
140{ 140{
141 struct qe_pin *qe_pin; 141 struct qe_pin *qe_pin;
142 struct device_node *gpio_np;
143 struct gpio_chip *gc; 142 struct gpio_chip *gc;
144 struct of_mm_gpio_chip *mm_gc; 143 struct of_mm_gpio_chip *mm_gc;
145 struct qe_gpio_chip *qe_gc; 144 struct qe_gpio_chip *qe_gc;
146 int err; 145 int err;
147 int size;
148 const void *gpio_spec;
149 const u32 *gpio_cells;
150 unsigned long flags; 146 unsigned long flags;
151 147
152 qe_pin = kzalloc(sizeof(*qe_pin), GFP_KERNEL); 148 qe_pin = kzalloc(sizeof(*qe_pin), GFP_KERNEL);
@@ -155,45 +151,25 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)
155 return ERR_PTR(-ENOMEM); 151 return ERR_PTR(-ENOMEM);
156 } 152 }
157 153
158 err = of_parse_phandles_with_args(np, "gpios", "#gpio-cells", index, 154 err = of_get_gpio(np, index);
159 &gpio_np, &gpio_spec); 155 if (err < 0)
160 if (err) { 156 goto err0;
161 pr_debug("%s: can't parse gpios property\n", __func__); 157 gc = gpio_to_chip(err);
158 if (WARN_ON(!gc))
162 goto err0; 159 goto err0;
163 }
164 160
165 if (!of_device_is_compatible(gpio_np, "fsl,mpc8323-qe-pario-bank")) { 161 if (!of_device_is_compatible(gc->of_node, "fsl,mpc8323-qe-pario-bank")) {
166 pr_debug("%s: tried to get a non-qe pin\n", __func__); 162 pr_debug("%s: tried to get a non-qe pin\n", __func__);
167 err = -EINVAL; 163 err = -EINVAL;
168 goto err1; 164 goto err0;
169 }
170
171 gc = of_node_to_gpiochip(gpio_np);
172 if (!gc) {
173 pr_debug("%s: gpio controller %s isn't registered\n",
174 np->full_name, gpio_np->full_name);
175 err = -ENODEV;
176 goto err1;
177 }
178
179 gpio_cells = of_get_property(gpio_np, "#gpio-cells", &size);
180 if (!gpio_cells || size != sizeof(*gpio_cells) ||
181 *gpio_cells != gc->of_gpio_n_cells) {
182 pr_debug("%s: wrong #gpio-cells for %s\n",
183 np->full_name, gpio_np->full_name);
184 err = -EINVAL;
185 goto err1;
186 } 165 }
187 166
188 err = gc->of_xlate(gc, np, gpio_spec, NULL);
189 if (err < 0)
190 goto err1;
191
192 mm_gc = to_of_mm_gpio_chip(gc); 167 mm_gc = to_of_mm_gpio_chip(gc);
193 qe_gc = to_qe_gpio_chip(mm_gc); 168 qe_gc = to_qe_gpio_chip(mm_gc);
194 169
195 spin_lock_irqsave(&qe_gc->lock, flags); 170 spin_lock_irqsave(&qe_gc->lock, flags);
196 171
172 err -= gc->base;
197 if (test_and_set_bit(QE_PIN_REQUESTED, &qe_gc->pin_flags[err]) == 0) { 173 if (test_and_set_bit(QE_PIN_REQUESTED, &qe_gc->pin_flags[err]) == 0) {
198 qe_pin->controller = qe_gc; 174 qe_pin->controller = qe_gc;
199 qe_pin->num = err; 175 qe_pin->num = err;
@@ -206,8 +182,6 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)
206 182
207 if (!err) 183 if (!err)
208 return qe_pin; 184 return qe_pin;
209err1:
210 of_node_put(gpio_np);
211err0: 185err0:
212 kfree(qe_pin); 186 kfree(qe_pin);
213 pr_debug("%s failed with status %d\n", __func__, err); 187 pr_debug("%s failed with status %d\n", __func__, err);
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 3363fbc964f8..ceb09cbd2329 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -216,7 +216,7 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
216 /* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says 216 /* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says
217 that the BRG divisor must be even if you're not using divide-by-16 217 that the BRG divisor must be even if you're not using divide-by-16
218 mode. */ 218 mode. */
219 if (!div16 && (divisor & 1)) 219 if (!div16 && (divisor & 1) && (divisor > 3))
220 divisor++; 220 divisor++;
221 221
222 tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) | 222 tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 18e75ca19fe6..73034bd203c4 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -22,7 +22,6 @@
22#include <linux/stddef.h> 22#include <linux/stddef.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/signal.h> 24#include <linux/signal.h>
25#include <linux/sysdev.h>
26#include <linux/device.h> 25#include <linux/device.h>
27#include <linux/bootmem.h> 26#include <linux/bootmem.h>
28#include <linux/spinlock.h> 27#include <linux/spinlock.h>
@@ -484,13 +483,14 @@ int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high)
484 return 0; 483 return 0;
485} 484}
486 485
487static struct sysdev_class qe_ic_sysclass = { 486static struct bus_type qe_ic_subsys = {
488 .name = "qe_ic", 487 .name = "qe_ic",
488 .dev_name = "qe_ic",
489}; 489};
490 490
491static struct sys_device device_qe_ic = { 491static struct device device_qe_ic = {
492 .id = 0, 492 .id = 0,
493 .cls = &qe_ic_sysclass, 493 .bus = &qe_ic_subsys,
494}; 494};
495 495
496static int __init init_qe_ic_sysfs(void) 496static int __init init_qe_ic_sysfs(void)
@@ -499,12 +499,12 @@ static int __init init_qe_ic_sysfs(void)
499 499
500 printk(KERN_DEBUG "Registering qe_ic with sysfs...\n"); 500 printk(KERN_DEBUG "Registering qe_ic with sysfs...\n");
501 501
502 rc = sysdev_class_register(&qe_ic_sysclass); 502 rc = subsys_system_register(&qe_ic_subsys, NULL);
503 if (rc) { 503 if (rc) {
504 printk(KERN_ERR "Failed registering qe_ic sys class\n"); 504 printk(KERN_ERR "Failed registering qe_ic sys class\n");
505 return -ENODEV; 505 return -ENODEV;
506 } 506 }
507 rc = sysdev_register(&device_qe_ic); 507 rc = device_register(&device_qe_ic);
508 if (rc) { 508 if (rc) {
509 printk(KERN_ERR "Failed registering qe_ic sys device\n"); 509 printk(KERN_ERR "Failed registering qe_ic sys device\n");
510 return -ENODEV; 510 return -ENODEV;
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 3330feca7502..063c901b1265 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -18,7 +18,6 @@
18#include <linux/stddef.h> 18#include <linux/stddef.h>
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/signal.h> 20#include <linux/signal.h>
21#include <linux/sysdev.h>
22#include <linux/device.h> 21#include <linux/device.h>
23#include <linux/bootmem.h> 22#include <linux/bootmem.h>
24#include <linux/spinlock.h> 23#include <linux/spinlock.h>
diff --git a/arch/powerpc/sysdev/xics/icp-hv.c b/arch/powerpc/sysdev/xics/icp-hv.c
index 9518d367a64f..253dce98c16e 100644
--- a/arch/powerpc/sysdev/xics/icp-hv.c
+++ b/arch/powerpc/sysdev/xics/icp-hv.c
@@ -27,33 +27,50 @@ static inline unsigned int icp_hv_get_xirr(unsigned char cppr)
27{ 27{
28 unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; 28 unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
29 long rc; 29 long rc;
30 unsigned int ret = XICS_IRQ_SPURIOUS;
30 31
31 rc = plpar_hcall(H_XIRR, retbuf, cppr); 32 rc = plpar_hcall(H_XIRR, retbuf, cppr);
32 if (rc != H_SUCCESS) 33 if (rc == H_SUCCESS) {
33 panic(" bad return code xirr - rc = %lx\n", rc); 34 ret = (unsigned int)retbuf[0];
34 return (unsigned int)retbuf[0]; 35 } else {
35} 36 pr_err("%s: bad return code xirr cppr=0x%x returned %ld\n",
37 __func__, cppr, rc);
38 WARN_ON_ONCE(1);
39 }
36 40
37static inline void icp_hv_set_xirr(unsigned int value) 41 return ret;
38{
39 long rc = plpar_hcall_norets(H_EOI, value);
40 if (rc != H_SUCCESS)
41 panic("bad return code EOI - rc = %ld, value=%x\n", rc, value);
42} 42}
43 43
44static inline void icp_hv_set_cppr(u8 value) 44static inline void icp_hv_set_cppr(u8 value)
45{ 45{
46 long rc = plpar_hcall_norets(H_CPPR, value); 46 long rc = plpar_hcall_norets(H_CPPR, value);
47 if (rc != H_SUCCESS) 47 if (rc != H_SUCCESS) {
48 panic("bad return code cppr - rc = %lx\n", rc); 48 pr_err("%s: bad return code cppr cppr=0x%x returned %ld\n",
49 __func__, value, rc);
50 WARN_ON_ONCE(1);
51 }
52}
53
54static inline void icp_hv_set_xirr(unsigned int value)
55{
56 long rc = plpar_hcall_norets(H_EOI, value);
57 if (rc != H_SUCCESS) {
58 pr_err("%s: bad return code eoi xirr=0x%x returned %ld\n",
59 __func__, value, rc);
60 WARN_ON_ONCE(1);
61 icp_hv_set_cppr(value >> 24);
62 }
49} 63}
50 64
51static inline void icp_hv_set_qirr(int n_cpu , u8 value) 65static inline void icp_hv_set_qirr(int n_cpu , u8 value)
52{ 66{
53 long rc = plpar_hcall_norets(H_IPI, get_hard_smp_processor_id(n_cpu), 67 int hw_cpu = get_hard_smp_processor_id(n_cpu);
54 value); 68 long rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
55 if (rc != H_SUCCESS) 69 if (rc != H_SUCCESS) {
56 panic("bad return code qirr - rc = %lx\n", rc); 70 pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x "
71 "returned %ld\n", __func__, n_cpu, hw_cpu, value, rc);
72 WARN_ON_ONCE(1);
73 }
57} 74}
58 75
59static void icp_hv_eoi(struct irq_data *d) 76static void icp_hv_eoi(struct irq_data *d)
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c
index 63762c672a03..d72eda6a4c05 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -137,7 +137,7 @@ static void xics_request_ipi(void)
137 * IPIs are marked IRQF_PERCPU. The handler was set in map. 137 * IPIs are marked IRQF_PERCPU. The handler was set in map.
138 */ 138 */
139 BUG_ON(request_irq(ipi, icp_ops->ipi_action, 139 BUG_ON(request_irq(ipi, icp_ops->ipi_action,
140 IRQF_PERCPU, "IPI", NULL)); 140 IRQF_PERCPU | IRQF_NO_THREAD, "IPI", NULL));
141} 141}
142 142
143int __init xics_smp_probe(void) 143int __init xics_smp_probe(void)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 03a217ae3be0..cb95eea74d3d 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -228,13 +228,11 @@ Commands:\n\
228 t print backtrace\n\ 228 t print backtrace\n\
229 x exit monitor and recover\n\ 229 x exit monitor and recover\n\
230 X exit monitor and dont recover\n" 230 X exit monitor and dont recover\n"
231#ifdef CONFIG_PPC64 231#if defined(CONFIG_PPC64) && !defined(CONFIG_PPC_BOOK3E)
232" u dump segment table or SLB\n" 232" u dump segment table or SLB\n"
233#endif 233#elif defined(CONFIG_PPC_STD_MMU_32)
234#ifdef CONFIG_PPC_STD_MMU_32
235" u dump segment registers\n" 234" u dump segment registers\n"
236#endif 235#elif defined(CONFIG_44x) || defined(CONFIG_PPC_BOOK3E)
237#ifdef CONFIG_44x
238" u dump TLB\n" 236" u dump TLB\n"
239#endif 237#endif
240" ? help\n" 238" ? help\n"
@@ -340,7 +338,7 @@ int cpus_are_in_xmon(void)
340 338
341static inline int unrecoverable_excp(struct pt_regs *regs) 339static inline int unrecoverable_excp(struct pt_regs *regs)
342{ 340{
343#if defined(CONFIG_4xx) || defined(CONFIG_BOOK3E) 341#if defined(CONFIG_4xx) || defined(CONFIG_PPC_BOOK3E)
344 /* We have no MSR_RI bit on 4xx or Book3e, so we simply return false */ 342 /* We have no MSR_RI bit on 4xx or Book3e, so we simply return false */
345 return 0; 343 return 0;
346#else 344#else
@@ -885,13 +883,11 @@ cmds(struct pt_regs *excp)
885 case 'u': 883 case 'u':
886 dump_segments(); 884 dump_segments();
887 break; 885 break;
888#endif 886#elif defined(CONFIG_4xx)
889#ifdef CONFIG_4xx
890 case 'u': 887 case 'u':
891 dump_tlb_44x(); 888 dump_tlb_44x();
892 break; 889 break;
893#endif 890#elif defined(CONFIG_PPC_BOOK3E)
894#ifdef CONFIG_PPC_BOOK3E
895 case 'u': 891 case 'u':
896 dump_tlb_book3e(); 892 dump_tlb_book3e();
897 break; 893 break;
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 373679b3744a..28d183c42751 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -87,11 +87,13 @@ config S390
87 select HAVE_KERNEL_LZMA 87 select HAVE_KERNEL_LZMA
88 select HAVE_KERNEL_LZO 88 select HAVE_KERNEL_LZO
89 select HAVE_KERNEL_XZ 89 select HAVE_KERNEL_XZ
90 select HAVE_GET_USER_PAGES_FAST
91 select HAVE_ARCH_MUTEX_CPU_RELAX 90 select HAVE_ARCH_MUTEX_CPU_RELAX
92 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 91 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
93 select HAVE_RCU_TABLE_FREE if SMP 92 select HAVE_RCU_TABLE_FREE if SMP
94 select ARCH_SAVE_PAGE_KEYS if HIBERNATION 93 select ARCH_SAVE_PAGE_KEYS if HIBERNATION
94 select HAVE_MEMBLOCK
95 select HAVE_MEMBLOCK_NODE_MAP
96 select ARCH_DISCARD_MEMBLOCK
95 select ARCH_INLINE_SPIN_TRYLOCK 97 select ARCH_INLINE_SPIN_TRYLOCK
96 select ARCH_INLINE_SPIN_TRYLOCK_BH 98 select ARCH_INLINE_SPIN_TRYLOCK_BH
97 select ARCH_INLINE_SPIN_LOCK 99 select ARCH_INLINE_SPIN_LOCK
@@ -345,9 +347,6 @@ config WARN_DYNAMIC_STACK
345 347
346 Say N if you are unsure. 348 Say N if you are unsure.
347 349
348config ARCH_POPULATES_NODE_MAP
349 def_bool y
350
351comment "Kernel preemption" 350comment "Kernel preemption"
352 351
353source "kernel/Kconfig.preempt" 352source "kernel/Kconfig.preempt"
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c
index 92f1cb745d69..4de031d6b76c 100644
--- a/arch/s390/appldata/appldata_os.c
+++ b/arch/s390/appldata/appldata_os.c
@@ -115,21 +115,21 @@ static void appldata_get_os_data(void *data)
115 j = 0; 115 j = 0;
116 for_each_online_cpu(i) { 116 for_each_online_cpu(i) {
117 os_data->os_cpu[j].per_cpu_user = 117 os_data->os_cpu[j].per_cpu_user =
118 cputime_to_jiffies(kstat_cpu(i).cpustat.user); 118 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_USER]);
119 os_data->os_cpu[j].per_cpu_nice = 119 os_data->os_cpu[j].per_cpu_nice =
120 cputime_to_jiffies(kstat_cpu(i).cpustat.nice); 120 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_NICE]);
121 os_data->os_cpu[j].per_cpu_system = 121 os_data->os_cpu[j].per_cpu_system =
122 cputime_to_jiffies(kstat_cpu(i).cpustat.system); 122 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_SYSTEM]);
123 os_data->os_cpu[j].per_cpu_idle = 123 os_data->os_cpu[j].per_cpu_idle =
124 cputime_to_jiffies(kstat_cpu(i).cpustat.idle); 124 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_IDLE]);
125 os_data->os_cpu[j].per_cpu_irq = 125 os_data->os_cpu[j].per_cpu_irq =
126 cputime_to_jiffies(kstat_cpu(i).cpustat.irq); 126 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_IRQ]);
127 os_data->os_cpu[j].per_cpu_softirq = 127 os_data->os_cpu[j].per_cpu_softirq =
128 cputime_to_jiffies(kstat_cpu(i).cpustat.softirq); 128 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_SOFTIRQ]);
129 os_data->os_cpu[j].per_cpu_iowait = 129 os_data->os_cpu[j].per_cpu_iowait =
130 cputime_to_jiffies(kstat_cpu(i).cpustat.iowait); 130 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_IOWAIT]);
131 os_data->os_cpu[j].per_cpu_steal = 131 os_data->os_cpu[j].per_cpu_steal =
132 cputime_to_jiffies(kstat_cpu(i).cpustat.steal); 132 cputime_to_jiffies(kcpustat_cpu(i).cpustat[CPUTIME_STEAL]);
133 os_data->os_cpu[j].cpu_id = i; 133 os_data->os_cpu[j].cpu_id = i;
134 j++; 134 j++;
135 } 135 }
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 481f4f76f664..8a2a887478cc 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -97,7 +97,7 @@ static void hypfs_delete_tree(struct dentry *root)
97 } 97 }
98} 98}
99 99
100static struct inode *hypfs_make_inode(struct super_block *sb, int mode) 100static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode)
101{ 101{
102 struct inode *ret = new_inode(sb); 102 struct inode *ret = new_inode(sb);
103 103
@@ -107,7 +107,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, int mode)
107 ret->i_uid = hypfs_info->uid; 107 ret->i_uid = hypfs_info->uid;
108 ret->i_gid = hypfs_info->gid; 108 ret->i_gid = hypfs_info->gid;
109 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 109 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
110 if (mode & S_IFDIR) 110 if (S_ISDIR(mode))
111 set_nlink(ret, 2); 111 set_nlink(ret, 2);
112 } 112 }
113 return ret; 113 return ret;
@@ -259,9 +259,9 @@ static int hypfs_parse_options(char *options, struct super_block *sb)
259 return 0; 259 return 0;
260} 260}
261 261
262static int hypfs_show_options(struct seq_file *s, struct vfsmount *mnt) 262static int hypfs_show_options(struct seq_file *s, struct dentry *root)
263{ 263{
264 struct hypfs_sb_info *hypfs_info = mnt->mnt_sb->s_fs_info; 264 struct hypfs_sb_info *hypfs_info = root->d_sb->s_fs_info;
265 265
266 seq_printf(s, ",uid=%u", hypfs_info->uid); 266 seq_printf(s, ",uid=%u", hypfs_info->uid);
267 seq_printf(s, ",gid=%u", hypfs_info->gid); 267 seq_printf(s, ",gid=%u", hypfs_info->gid);
@@ -333,7 +333,7 @@ static void hypfs_kill_super(struct super_block *sb)
333 333
334static struct dentry *hypfs_create_file(struct super_block *sb, 334static struct dentry *hypfs_create_file(struct super_block *sb,
335 struct dentry *parent, const char *name, 335 struct dentry *parent, const char *name,
336 char *data, mode_t mode) 336 char *data, umode_t mode)
337{ 337{
338 struct dentry *dentry; 338 struct dentry *dentry;
339 struct inode *inode; 339 struct inode *inode;
@@ -350,13 +350,13 @@ static struct dentry *hypfs_create_file(struct super_block *sb,
350 dentry = ERR_PTR(-ENOMEM); 350 dentry = ERR_PTR(-ENOMEM);
351 goto fail; 351 goto fail;
352 } 352 }
353 if (mode & S_IFREG) { 353 if (S_ISREG(mode)) {
354 inode->i_fop = &hypfs_file_ops; 354 inode->i_fop = &hypfs_file_ops;
355 if (data) 355 if (data)
356 inode->i_size = strlen(data); 356 inode->i_size = strlen(data);
357 else 357 else
358 inode->i_size = 0; 358 inode->i_size = 0;
359 } else if (mode & S_IFDIR) { 359 } else if (S_ISDIR(mode)) {
360 inode->i_op = &simple_dir_inode_operations; 360 inode->i_op = &simple_dir_inode_operations;
361 inode->i_fop = &simple_dir_operations; 361 inode->i_fop = &simple_dir_operations;
362 inc_nlink(parent->d_inode); 362 inc_nlink(parent->d_inode);
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 081434878296..c23c3900c304 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -16,114 +16,100 @@
16 16
17/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */ 17/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
18 18
19typedef unsigned long long cputime_t; 19typedef unsigned long long __nocast cputime_t;
20typedef unsigned long long cputime64_t; 20typedef unsigned long long __nocast cputime64_t;
21 21
22#ifndef __s390x__ 22static inline unsigned long __div(unsigned long long n, unsigned long base)
23
24static inline unsigned int
25__div(unsigned long long n, unsigned int base)
26{ 23{
24#ifndef __s390x__
27 register_pair rp; 25 register_pair rp;
28 26
29 rp.pair = n >> 1; 27 rp.pair = n >> 1;
30 asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1)); 28 asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1));
31 return rp.subreg.odd; 29 return rp.subreg.odd;
30#else /* __s390x__ */
31 return n / base;
32#endif /* __s390x__ */
32} 33}
33 34
34#else /* __s390x__ */ 35#define cputime_one_jiffy jiffies_to_cputime(1)
36
37/*
38 * Convert cputime to jiffies and back.
39 */
40static inline unsigned long cputime_to_jiffies(const cputime_t cputime)
41{
42 return __div((__force unsigned long long) cputime, 4096000000ULL / HZ);
43}
35 44
36static inline unsigned int 45static inline cputime_t jiffies_to_cputime(const unsigned int jif)
37__div(unsigned long long n, unsigned int base)
38{ 46{
39 return n / base; 47 return (__force cputime_t)(jif * (4096000000ULL / HZ));
40} 48}
41 49
42#endif /* __s390x__ */ 50static inline u64 cputime64_to_jiffies64(cputime64_t cputime)
51{
52 unsigned long long jif = (__force unsigned long long) cputime;
53 do_div(jif, 4096000000ULL / HZ);
54 return jif;
55}
43 56
44#define cputime_zero (0ULL) 57static inline cputime64_t jiffies64_to_cputime64(const u64 jif)
45#define cputime_one_jiffy jiffies_to_cputime(1) 58{
46#define cputime_max ((~0UL >> 1) - 1) 59 return (__force cputime64_t)(jif * (4096000000ULL / HZ));
47#define cputime_add(__a, __b) ((__a) + (__b))
48#define cputime_sub(__a, __b) ((__a) - (__b))
49#define cputime_div(__a, __n) ({ \
50 unsigned long long __div = (__a); \
51 do_div(__div,__n); \
52 __div; \
53})
54#define cputime_halve(__a) ((__a) >> 1)
55#define cputime_eq(__a, __b) ((__a) == (__b))
56#define cputime_gt(__a, __b) ((__a) > (__b))
57#define cputime_ge(__a, __b) ((__a) >= (__b))
58#define cputime_lt(__a, __b) ((__a) < (__b))
59#define cputime_le(__a, __b) ((__a) <= (__b))
60#define cputime_to_jiffies(__ct) (__div((__ct), 4096000000ULL / HZ))
61#define cputime_to_scaled(__ct) (__ct)
62#define jiffies_to_cputime(__hz) ((cputime_t)(__hz) * (4096000000ULL / HZ))
63
64#define cputime64_zero (0ULL)
65#define cputime64_add(__a, __b) ((__a) + (__b))
66#define cputime_to_cputime64(__ct) (__ct)
67
68static inline u64
69cputime64_to_jiffies64(cputime64_t cputime)
70{
71 do_div(cputime, 4096000000ULL / HZ);
72 return cputime;
73} 60}
74 61
75/* 62/*
76 * Convert cputime to microseconds and back. 63 * Convert cputime to microseconds and back.
77 */ 64 */
78static inline unsigned int 65static inline unsigned int cputime_to_usecs(const cputime_t cputime)
79cputime_to_usecs(const cputime_t cputime)
80{ 66{
81 return cputime_div(cputime, 4096); 67 return (__force unsigned long long) cputime >> 12;
82} 68}
83 69
84static inline cputime_t 70static inline cputime_t usecs_to_cputime(const unsigned int m)
85usecs_to_cputime(const unsigned int m)
86{ 71{
87 return (cputime_t) m * 4096; 72 return (__force cputime_t)(m * 4096ULL);
88} 73}
89 74
75#define usecs_to_cputime64(m) usecs_to_cputime(m)
76
90/* 77/*
91 * Convert cputime to milliseconds and back. 78 * Convert cputime to milliseconds and back.
92 */ 79 */
93static inline unsigned int 80static inline unsigned int cputime_to_secs(const cputime_t cputime)
94cputime_to_secs(const cputime_t cputime)
95{ 81{
96 return __div(cputime, 2048000000) >> 1; 82 return __div((__force unsigned long long) cputime, 2048000000) >> 1;
97} 83}
98 84
99static inline cputime_t 85static inline cputime_t secs_to_cputime(const unsigned int s)
100secs_to_cputime(const unsigned int s)
101{ 86{
102 return (cputime_t) s * 4096000000ULL; 87 return (__force cputime_t)(s * 4096000000ULL);
103} 88}
104 89
105/* 90/*
106 * Convert cputime to timespec and back. 91 * Convert cputime to timespec and back.
107 */ 92 */
108static inline cputime_t 93static inline cputime_t timespec_to_cputime(const struct timespec *value)
109timespec_to_cputime(const struct timespec *value)
110{ 94{
111 return value->tv_nsec * 4096 / 1000 + (u64) value->tv_sec * 4096000000ULL; 95 unsigned long long ret = value->tv_sec * 4096000000ULL;
96 return (__force cputime_t)(ret + value->tv_nsec * 4096 / 1000);
112} 97}
113 98
114static inline void 99static inline void cputime_to_timespec(const cputime_t cputime,
115cputime_to_timespec(const cputime_t cputime, struct timespec *value) 100 struct timespec *value)
116{ 101{
102 unsigned long long __cputime = (__force unsigned long long) cputime;
117#ifndef __s390x__ 103#ifndef __s390x__
118 register_pair rp; 104 register_pair rp;
119 105
120 rp.pair = cputime >> 1; 106 rp.pair = __cputime >> 1;
121 asm ("dr %0,%1" : "+d" (rp) : "d" (2048000000UL)); 107 asm ("dr %0,%1" : "+d" (rp) : "d" (2048000000UL));
122 value->tv_nsec = rp.subreg.even * 1000 / 4096; 108 value->tv_nsec = rp.subreg.even * 1000 / 4096;
123 value->tv_sec = rp.subreg.odd; 109 value->tv_sec = rp.subreg.odd;
124#else 110#else
125 value->tv_nsec = (cputime % 4096000000ULL) * 1000 / 4096; 111 value->tv_nsec = (__cputime % 4096000000ULL) * 1000 / 4096;
126 value->tv_sec = cputime / 4096000000ULL; 112 value->tv_sec = __cputime / 4096000000ULL;
127#endif 113#endif
128} 114}
129 115
@@ -132,50 +118,52 @@ cputime_to_timespec(const cputime_t cputime, struct timespec *value)
132 * Since cputime and timeval have the same resolution (microseconds) 118 * Since cputime and timeval have the same resolution (microseconds)
133 * this is easy. 119 * this is easy.
134 */ 120 */
135static inline cputime_t 121static inline cputime_t timeval_to_cputime(const struct timeval *value)
136timeval_to_cputime(const struct timeval *value)
137{ 122{
138 return value->tv_usec * 4096 + (u64) value->tv_sec * 4096000000ULL; 123 unsigned long long ret = value->tv_sec * 4096000000ULL;
124 return (__force cputime_t)(ret + value->tv_usec * 4096ULL);
139} 125}
140 126
141static inline void 127static inline void cputime_to_timeval(const cputime_t cputime,
142cputime_to_timeval(const cputime_t cputime, struct timeval *value) 128 struct timeval *value)
143{ 129{
130 unsigned long long __cputime = (__force unsigned long long) cputime;
144#ifndef __s390x__ 131#ifndef __s390x__
145 register_pair rp; 132 register_pair rp;
146 133
147 rp.pair = cputime >> 1; 134 rp.pair = __cputime >> 1;
148 asm ("dr %0,%1" : "+d" (rp) : "d" (2048000000UL)); 135 asm ("dr %0,%1" : "+d" (rp) : "d" (2048000000UL));
149 value->tv_usec = rp.subreg.even / 4096; 136 value->tv_usec = rp.subreg.even / 4096;
150 value->tv_sec = rp.subreg.odd; 137 value->tv_sec = rp.subreg.odd;
151#else 138#else
152 value->tv_usec = (cputime % 4096000000ULL) / 4096; 139 value->tv_usec = (__cputime % 4096000000ULL) / 4096;
153 value->tv_sec = cputime / 4096000000ULL; 140 value->tv_sec = __cputime / 4096000000ULL;
154#endif 141#endif
155} 142}
156 143
157/* 144/*
158 * Convert cputime to clock and back. 145 * Convert cputime to clock and back.
159 */ 146 */
160static inline clock_t 147static inline clock_t cputime_to_clock_t(cputime_t cputime)
161cputime_to_clock_t(cputime_t cputime)
162{ 148{
163 return cputime_div(cputime, 4096000000ULL / USER_HZ); 149 unsigned long long clock = (__force unsigned long long) cputime;
150 do_div(clock, 4096000000ULL / USER_HZ);
151 return clock;
164} 152}
165 153
166static inline cputime_t 154static inline cputime_t clock_t_to_cputime(unsigned long x)
167clock_t_to_cputime(unsigned long x)
168{ 155{
169 return (cputime_t) x * (4096000000ULL / USER_HZ); 156 return (__force cputime_t)(x * (4096000000ULL / USER_HZ));
170} 157}
171 158
172/* 159/*
173 * Convert cputime64 to clock. 160 * Convert cputime64 to clock.
174 */ 161 */
175static inline clock_t 162static inline clock_t cputime64_to_clock_t(cputime64_t cputime)
176cputime64_to_clock_t(cputime64_t cputime)
177{ 163{
178 return cputime_div(cputime, 4096000000ULL / USER_HZ); 164 unsigned long long clock = (__force unsigned long long) cputime;
165 do_div(clock, 4096000000ULL / USER_HZ);
166 return clock;
179} 167}
180 168
181struct s390_idle_data { 169struct s390_idle_data {
diff --git a/arch/s390/include/asm/debug.h b/arch/s390/include/asm/debug.h
index 18124b75a7ab..9d88db1f55d0 100644
--- a/arch/s390/include/asm/debug.h
+++ b/arch/s390/include/asm/debug.h
@@ -73,7 +73,7 @@ typedef struct debug_info {
73 struct dentry* debugfs_entries[DEBUG_MAX_VIEWS]; 73 struct dentry* debugfs_entries[DEBUG_MAX_VIEWS];
74 struct debug_view* views[DEBUG_MAX_VIEWS]; 74 struct debug_view* views[DEBUG_MAX_VIEWS];
75 char name[DEBUG_MAX_NAME_LEN]; 75 char name[DEBUG_MAX_NAME_LEN];
76 mode_t mode; 76 umode_t mode;
77} debug_info_t; 77} debug_info_t;
78 78
79typedef int (debug_header_proc_t) (debug_info_t* id, 79typedef int (debug_header_proc_t) (debug_info_t* id,
@@ -124,7 +124,7 @@ debug_info_t *debug_register(const char *name, int pages, int nr_areas,
124 int buf_size); 124 int buf_size);
125 125
126debug_info_t *debug_register_mode(const char *name, int pages, int nr_areas, 126debug_info_t *debug_register_mode(const char *name, int pages, int nr_areas,
127 int buf_size, mode_t mode, uid_t uid, 127 int buf_size, umode_t mode, uid_t uid,
128 gid_t gid); 128 gid_t gid);
129 129
130void debug_unregister(debug_info_t* id); 130void debug_unregister(debug_info_t* id);
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 24e18473d926..b0c235cb6ad5 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -47,7 +47,7 @@ struct sca_block {
47#define KVM_HPAGE_MASK(x) (~(KVM_HPAGE_SIZE(x) - 1)) 47#define KVM_HPAGE_MASK(x) (~(KVM_HPAGE_SIZE(x) - 1))
48#define KVM_PAGES_PER_HPAGE(x) (KVM_HPAGE_SIZE(x) / PAGE_SIZE) 48#define KVM_PAGES_PER_HPAGE(x) (KVM_HPAGE_SIZE(x) / PAGE_SIZE)
49 49
50#define CPUSTAT_HOST 0x80000000 50#define CPUSTAT_STOPPED 0x80000000
51#define CPUSTAT_WAIT 0x10000000 51#define CPUSTAT_WAIT 0x10000000
52#define CPUSTAT_ECALL_PEND 0x08000000 52#define CPUSTAT_ECALL_PEND 0x08000000
53#define CPUSTAT_STOP_INT 0x04000000 53#define CPUSTAT_STOP_INT 0x04000000
@@ -139,6 +139,7 @@ struct kvm_vcpu_stat {
139 u32 instruction_stfl; 139 u32 instruction_stfl;
140 u32 instruction_tprot; 140 u32 instruction_tprot;
141 u32 instruction_sigp_sense; 141 u32 instruction_sigp_sense;
142 u32 instruction_sigp_sense_running;
142 u32 instruction_sigp_external_call; 143 u32 instruction_sigp_external_call;
143 u32 instruction_sigp_emergency; 144 u32 instruction_sigp_emergency;
144 u32 instruction_sigp_stop; 145 u32 instruction_sigp_stop;
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 524d23b8610c..4f289ff0b7fe 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -599,10 +599,10 @@ static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste)
599 skey = page_get_storage_key(address); 599 skey = page_get_storage_key(address);
600 bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED); 600 bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED);
601 /* Clear page changed & referenced bit in the storage key */ 601 /* Clear page changed & referenced bit in the storage key */
602 if (bits) { 602 if (bits & _PAGE_CHANGED)
603 skey ^= bits; 603 page_set_storage_key(address, skey ^ bits, 1);
604 page_set_storage_key(address, skey, 1); 604 else if (bits)
605 } 605 page_reset_referenced(address);
606 /* Transfer page changed & referenced bit to guest bits in pgste */ 606 /* Transfer page changed & referenced bit to guest bits in pgste */
607 pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */ 607 pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */
608 /* Get host changed & referenced bits from pgste */ 608 /* Get host changed & referenced bits from pgste */
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h
index fdff1e995c73..67b5c1b14b51 100644
--- a/arch/s390/include/asm/socket.h
+++ b/arch/s390/include/asm/socket.h
@@ -70,4 +70,7 @@
70 70
71#define SO_RXQ_OVFL 40 71#define SO_RXQ_OVFL 40
72 72
73#define SO_WIFI_STATUS 41
74#define SCM_WIFI_STATUS SO_WIFI_STATUS
75
73#endif /* _ASM_SOCKET_H */ 76#endif /* _ASM_SOCKET_H */
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index a23183423b14..a73038155e0d 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -102,7 +102,6 @@ static inline struct thread_info *current_thread_info(void)
102#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 102#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
103#define TIF_RESTORE_SIGMASK 19 /* restore signal mask in do_signal() */ 103#define TIF_RESTORE_SIGMASK 19 /* restore signal mask in do_signal() */
104#define TIF_SINGLE_STEP 20 /* This task is single stepped */ 104#define TIF_SINGLE_STEP 20 /* This task is single stepped */
105#define TIF_FREEZE 21 /* thread is freezing for suspend */
106 105
107#define _TIF_SYSCALL (1<<TIF_SYSCALL) 106#define _TIF_SYSCALL (1<<TIF_SYSCALL)
108#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 107#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -119,7 +118,6 @@ static inline struct thread_info *current_thread_info(void)
119#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 118#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
120#define _TIF_31BIT (1<<TIF_31BIT) 119#define _TIF_31BIT (1<<TIF_31BIT)
121#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP) 120#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
122#define _TIF_FREEZE (1<<TIF_FREEZE)
123 121
124#ifdef CONFIG_64BIT 122#ifdef CONFIG_64BIT
125#define is_32bit_task() (test_thread_flag(TIF_31BIT)) 123#define is_32bit_task() (test_thread_flag(TIF_31BIT))
diff --git a/arch/s390/include/asm/types.h b/arch/s390/include/asm/types.h
index eeb52ccf499f..05ebbcdbbf6b 100644
--- a/arch/s390/include/asm/types.h
+++ b/arch/s390/include/asm/types.h
@@ -13,8 +13,6 @@
13 13
14#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
15 15
16typedef unsigned short umode_t;
17
18/* A address type so that arithmetic can be done on it & it can be upgraded to 16/* A address type so that arithmetic can be done on it & it can be upgraded to
19 64 bit when necessary 17 64 bit when necessary
20*/ 18*/
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 5ad6bc078bfd..6848828b962e 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -74,7 +74,7 @@ static ssize_t debug_input(struct file *file, const char __user *user_buf,
74static int debug_open(struct inode *inode, struct file *file); 74static int debug_open(struct inode *inode, struct file *file);
75static int debug_close(struct inode *inode, struct file *file); 75static int debug_close(struct inode *inode, struct file *file);
76static debug_info_t *debug_info_create(const char *name, int pages_per_area, 76static debug_info_t *debug_info_create(const char *name, int pages_per_area,
77 int nr_areas, int buf_size, mode_t mode); 77 int nr_areas, int buf_size, umode_t mode);
78static void debug_info_get(debug_info_t *); 78static void debug_info_get(debug_info_t *);
79static void debug_info_put(debug_info_t *); 79static void debug_info_put(debug_info_t *);
80static int debug_prolog_level_fn(debug_info_t * id, 80static int debug_prolog_level_fn(debug_info_t * id,
@@ -330,7 +330,7 @@ debug_info_free(debug_info_t* db_info){
330 330
331static debug_info_t* 331static debug_info_t*
332debug_info_create(const char *name, int pages_per_area, int nr_areas, 332debug_info_create(const char *name, int pages_per_area, int nr_areas,
333 int buf_size, mode_t mode) 333 int buf_size, umode_t mode)
334{ 334{
335 debug_info_t* rc; 335 debug_info_t* rc;
336 336
@@ -688,7 +688,7 @@ debug_close(struct inode *inode, struct file *file)
688 */ 688 */
689 689
690debug_info_t *debug_register_mode(const char *name, int pages_per_area, 690debug_info_t *debug_register_mode(const char *name, int pages_per_area,
691 int nr_areas, int buf_size, mode_t mode, 691 int nr_areas, int buf_size, umode_t mode,
692 uid_t uid, gid_t gid) 692 uid_t uid, gid_t gid)
693{ 693{
694 debug_info_t *rc = NULL; 694 debug_info_t *rc = NULL;
@@ -1090,7 +1090,7 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
1090 int rc = 0; 1090 int rc = 0;
1091 int i; 1091 int i;
1092 unsigned long flags; 1092 unsigned long flags;
1093 mode_t mode; 1093 umode_t mode;
1094 struct dentry *pde; 1094 struct dentry *pde;
1095 1095
1096 if (!id) 1096 if (!id)
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 9451b210a1b4..3201ae447990 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -91,10 +91,12 @@ static void default_idle(void)
91void cpu_idle(void) 91void cpu_idle(void)
92{ 92{
93 for (;;) { 93 for (;;) {
94 tick_nohz_stop_sched_tick(1); 94 tick_nohz_idle_enter();
95 rcu_idle_enter();
95 while (!need_resched()) 96 while (!need_resched())
96 default_idle(); 97 default_idle();
97 tick_nohz_restart_sched_tick(); 98 rcu_idle_exit();
99 tick_nohz_idle_exit();
98 preempt_enable_no_resched(); 100 preempt_enable_no_resched();
99 schedule(); 101 schedule();
100 preempt_disable(); 102 preempt_disable();
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 450931a45b68..573bc29551ef 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -296,13 +296,6 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
296 ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)))) 296 ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA))))
297 /* Invalid psw mask. */ 297 /* Invalid psw mask. */
298 return -EINVAL; 298 return -EINVAL;
299 if (addr == (addr_t) &dummy->regs.psw.addr)
300 /*
301 * The debugger changed the instruction address,
302 * reset system call restart, see signal.c:do_signal
303 */
304 task_thread_info(child)->system_call = 0;
305
306 *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; 299 *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;
307 300
308 } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { 301 } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
@@ -614,11 +607,6 @@ static int __poke_user_compat(struct task_struct *child,
614 /* Transfer 31 bit amode bit to psw mask. */ 607 /* Transfer 31 bit amode bit to psw mask. */
615 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) | 608 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
616 (__u64)(tmp & PSW32_ADDR_AMODE); 609 (__u64)(tmp & PSW32_ADDR_AMODE);
617 /*
618 * The debugger changed the instruction address,
619 * reset system call restart, see signal.c:do_signal
620 */
621 task_thread_info(child)->system_call = 0;
622 } else { 610 } else {
623 /* gpr 0-15 */ 611 /* gpr 0-15 */
624 *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp; 612 *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;
@@ -905,6 +893,14 @@ static int s390_last_break_get(struct task_struct *target,
905 return 0; 893 return 0;
906} 894}
907 895
896static int s390_last_break_set(struct task_struct *target,
897 const struct user_regset *regset,
898 unsigned int pos, unsigned int count,
899 const void *kbuf, const void __user *ubuf)
900{
901 return 0;
902}
903
908#endif 904#endif
909 905
910static int s390_system_call_get(struct task_struct *target, 906static int s390_system_call_get(struct task_struct *target,
@@ -951,6 +947,7 @@ static const struct user_regset s390_regsets[] = {
951 .size = sizeof(long), 947 .size = sizeof(long),
952 .align = sizeof(long), 948 .align = sizeof(long),
953 .get = s390_last_break_get, 949 .get = s390_last_break_get,
950 .set = s390_last_break_set,
954 }, 951 },
955#endif 952#endif
956 [REGSET_SYSTEM_CALL] = { 953 [REGSET_SYSTEM_CALL] = {
@@ -1116,6 +1113,14 @@ static int s390_compat_last_break_get(struct task_struct *target,
1116 return 0; 1113 return 0;
1117} 1114}
1118 1115
1116static int s390_compat_last_break_set(struct task_struct *target,
1117 const struct user_regset *regset,
1118 unsigned int pos, unsigned int count,
1119 const void *kbuf, const void __user *ubuf)
1120{
1121 return 0;
1122}
1123
1119static const struct user_regset s390_compat_regsets[] = { 1124static const struct user_regset s390_compat_regsets[] = {
1120 [REGSET_GENERAL] = { 1125 [REGSET_GENERAL] = {
1121 .core_note_type = NT_PRSTATUS, 1126 .core_note_type = NT_PRSTATUS,
@@ -1139,6 +1144,7 @@ static const struct user_regset s390_compat_regsets[] = {
1139 .size = sizeof(long), 1144 .size = sizeof(long),
1140 .align = sizeof(long), 1145 .align = sizeof(long),
1141 .get = s390_compat_last_break_get, 1146 .get = s390_compat_last_break_get,
1147 .set = s390_compat_last_break_set,
1142 }, 1148 },
1143 [REGSET_SYSTEM_CALL] = { 1149 [REGSET_SYSTEM_CALL] = {
1144 .core_note_type = NT_S390_SYSTEM_CALL, 1150 .core_note_type = NT_S390_SYSTEM_CALL,
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index e58a462949b1..f11d1b037c50 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -21,6 +21,7 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/memblock.h>
24#include <linux/mm.h> 25#include <linux/mm.h>
25#include <linux/stddef.h> 26#include <linux/stddef.h>
26#include <linux/unistd.h> 27#include <linux/unistd.h>
@@ -579,7 +580,7 @@ static unsigned long __init find_crash_base(unsigned long crash_size,
579 *msg = "first memory chunk must be at least crashkernel size"; 580 *msg = "first memory chunk must be at least crashkernel size";
580 return 0; 581 return 0;
581 } 582 }
582 if (is_kdump_kernel() && (crash_size == OLDMEM_SIZE)) 583 if (OLDMEM_BASE && crash_size == OLDMEM_SIZE)
583 return OLDMEM_BASE; 584 return OLDMEM_BASE;
584 585
585 for (i = MEMORY_CHUNKS - 1; i >= 0; i--) { 586 for (i = MEMORY_CHUNKS - 1; i >= 0; i--) {
@@ -820,7 +821,8 @@ setup_memory(void)
820 end_chunk = min(end_chunk, end_pfn); 821 end_chunk = min(end_chunk, end_pfn);
821 if (start_chunk >= end_chunk) 822 if (start_chunk >= end_chunk)
822 continue; 823 continue;
823 add_active_range(0, start_chunk, end_chunk); 824 memblock_add_node(PFN_PHYS(start_chunk),
825 PFN_PHYS(end_chunk - start_chunk), 0);
824 pfn = max(start_chunk, start_pfn); 826 pfn = max(start_chunk, start_pfn);
825 for (; pfn < end_chunk; pfn++) 827 for (; pfn < end_chunk; pfn++)
826 page_set_storage_key(PFN_PHYS(pfn), 828 page_set_storage_key(PFN_PHYS(pfn),
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 05a85bc14c98..7f6f9f354545 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -460,9 +460,9 @@ void do_signal(struct pt_regs *regs)
460 regs->svc_code >> 16); 460 regs->svc_code >> 16);
461 break; 461 break;
462 } 462 }
463 /* No longer in a system call */
464 clear_thread_flag(TIF_SYSCALL);
465 } 463 }
464 /* No longer in a system call */
465 clear_thread_flag(TIF_SYSCALL);
466 466
467 if ((is_compat_task() ? 467 if ((is_compat_task() ?
468 handle_signal32(signr, &ka, &info, oldset, regs) : 468 handle_signal32(signr, &ka, &info, oldset, regs) :
@@ -486,6 +486,7 @@ void do_signal(struct pt_regs *regs)
486 } 486 }
487 487
488 /* No handlers present - check for system call restart */ 488 /* No handlers present - check for system call restart */
489 clear_thread_flag(TIF_SYSCALL);
489 if (current_thread_info()->system_call) { 490 if (current_thread_info()->system_call) {
490 regs->svc_code = current_thread_info()->system_call; 491 regs->svc_code = current_thread_info()->system_call;
491 switch (regs->gprs[2]) { 492 switch (regs->gprs[2]) {
@@ -500,9 +501,6 @@ void do_signal(struct pt_regs *regs)
500 regs->gprs[2] = regs->orig_gpr2; 501 regs->gprs[2] = regs->orig_gpr2;
501 set_thread_flag(TIF_SYSCALL); 502 set_thread_flag(TIF_SYSCALL);
502 break; 503 break;
503 default:
504 clear_thread_flag(TIF_SYSCALL);
505 break;
506 } 504 }
507 } 505 }
508 506
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 3ea872890da2..66cca03c0282 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -831,8 +831,8 @@ int setup_profiling_timer(unsigned int multiplier)
831} 831}
832 832
833#ifdef CONFIG_HOTPLUG_CPU 833#ifdef CONFIG_HOTPLUG_CPU
834static ssize_t cpu_configure_show(struct sys_device *dev, 834static ssize_t cpu_configure_show(struct device *dev,
835 struct sysdev_attribute *attr, char *buf) 835 struct device_attribute *attr, char *buf)
836{ 836{
837 ssize_t count; 837 ssize_t count;
838 838
@@ -842,8 +842,8 @@ static ssize_t cpu_configure_show(struct sys_device *dev,
842 return count; 842 return count;
843} 843}
844 844
845static ssize_t cpu_configure_store(struct sys_device *dev, 845static ssize_t cpu_configure_store(struct device *dev,
846 struct sysdev_attribute *attr, 846 struct device_attribute *attr,
847 const char *buf, size_t count) 847 const char *buf, size_t count)
848{ 848{
849 int cpu = dev->id; 849 int cpu = dev->id;
@@ -889,11 +889,11 @@ out:
889 put_online_cpus(); 889 put_online_cpus();
890 return rc ? rc : count; 890 return rc ? rc : count;
891} 891}
892static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); 892static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
893#endif /* CONFIG_HOTPLUG_CPU */ 893#endif /* CONFIG_HOTPLUG_CPU */
894 894
895static ssize_t cpu_polarization_show(struct sys_device *dev, 895static ssize_t cpu_polarization_show(struct device *dev,
896 struct sysdev_attribute *attr, char *buf) 896 struct device_attribute *attr, char *buf)
897{ 897{
898 int cpu = dev->id; 898 int cpu = dev->id;
899 ssize_t count; 899 ssize_t count;
@@ -919,22 +919,22 @@ static ssize_t cpu_polarization_show(struct sys_device *dev,
919 mutex_unlock(&smp_cpu_state_mutex); 919 mutex_unlock(&smp_cpu_state_mutex);
920 return count; 920 return count;
921} 921}
922static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL); 922static DEVICE_ATTR(polarization, 0444, cpu_polarization_show, NULL);
923 923
924static ssize_t show_cpu_address(struct sys_device *dev, 924static ssize_t show_cpu_address(struct device *dev,
925 struct sysdev_attribute *attr, char *buf) 925 struct device_attribute *attr, char *buf)
926{ 926{
927 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]); 927 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]);
928} 928}
929static SYSDEV_ATTR(address, 0444, show_cpu_address, NULL); 929static DEVICE_ATTR(address, 0444, show_cpu_address, NULL);
930 930
931 931
932static struct attribute *cpu_common_attrs[] = { 932static struct attribute *cpu_common_attrs[] = {
933#ifdef CONFIG_HOTPLUG_CPU 933#ifdef CONFIG_HOTPLUG_CPU
934 &attr_configure.attr, 934 &dev_attr_configure.attr,
935#endif 935#endif
936 &attr_address.attr, 936 &dev_attr_address.attr,
937 &attr_polarization.attr, 937 &dev_attr_polarization.attr,
938 NULL, 938 NULL,
939}; 939};
940 940
@@ -942,8 +942,8 @@ static struct attribute_group cpu_common_attr_group = {
942 .attrs = cpu_common_attrs, 942 .attrs = cpu_common_attrs,
943}; 943};
944 944
945static ssize_t show_capability(struct sys_device *dev, 945static ssize_t show_capability(struct device *dev,
946 struct sysdev_attribute *attr, char *buf) 946 struct device_attribute *attr, char *buf)
947{ 947{
948 unsigned int capability; 948 unsigned int capability;
949 int rc; 949 int rc;
@@ -953,10 +953,10 @@ static ssize_t show_capability(struct sys_device *dev,
953 return rc; 953 return rc;
954 return sprintf(buf, "%u\n", capability); 954 return sprintf(buf, "%u\n", capability);
955} 955}
956static SYSDEV_ATTR(capability, 0444, show_capability, NULL); 956static DEVICE_ATTR(capability, 0444, show_capability, NULL);
957 957
958static ssize_t show_idle_count(struct sys_device *dev, 958static ssize_t show_idle_count(struct device *dev,
959 struct sysdev_attribute *attr, char *buf) 959 struct device_attribute *attr, char *buf)
960{ 960{
961 struct s390_idle_data *idle; 961 struct s390_idle_data *idle;
962 unsigned long long idle_count; 962 unsigned long long idle_count;
@@ -976,10 +976,10 @@ repeat:
976 goto repeat; 976 goto repeat;
977 return sprintf(buf, "%llu\n", idle_count); 977 return sprintf(buf, "%llu\n", idle_count);
978} 978}
979static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); 979static DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL);
980 980
981static ssize_t show_idle_time(struct sys_device *dev, 981static ssize_t show_idle_time(struct device *dev,
982 struct sysdev_attribute *attr, char *buf) 982 struct device_attribute *attr, char *buf)
983{ 983{
984 struct s390_idle_data *idle; 984 struct s390_idle_data *idle;
985 unsigned long long now, idle_time, idle_enter; 985 unsigned long long now, idle_time, idle_enter;
@@ -1001,12 +1001,12 @@ repeat:
1001 goto repeat; 1001 goto repeat;
1002 return sprintf(buf, "%llu\n", idle_time >> 12); 1002 return sprintf(buf, "%llu\n", idle_time >> 12);
1003} 1003}
1004static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); 1004static DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL);
1005 1005
1006static struct attribute *cpu_online_attrs[] = { 1006static struct attribute *cpu_online_attrs[] = {
1007 &attr_capability.attr, 1007 &dev_attr_capability.attr,
1008 &attr_idle_count.attr, 1008 &dev_attr_idle_count.attr,
1009 &attr_idle_time_us.attr, 1009 &dev_attr_idle_time_us.attr,
1010 NULL, 1010 NULL,
1011}; 1011};
1012 1012
@@ -1019,7 +1019,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self,
1019{ 1019{
1020 unsigned int cpu = (unsigned int)(long)hcpu; 1020 unsigned int cpu = (unsigned int)(long)hcpu;
1021 struct cpu *c = &per_cpu(cpu_devices, cpu); 1021 struct cpu *c = &per_cpu(cpu_devices, cpu);
1022 struct sys_device *s = &c->sysdev; 1022 struct device *s = &c->dev;
1023 struct s390_idle_data *idle; 1023 struct s390_idle_data *idle;
1024 int err = 0; 1024 int err = 0;
1025 1025
@@ -1045,7 +1045,7 @@ static struct notifier_block __cpuinitdata smp_cpu_nb = {
1045static int __devinit smp_add_present_cpu(int cpu) 1045static int __devinit smp_add_present_cpu(int cpu)
1046{ 1046{
1047 struct cpu *c = &per_cpu(cpu_devices, cpu); 1047 struct cpu *c = &per_cpu(cpu_devices, cpu);
1048 struct sys_device *s = &c->sysdev; 1048 struct device *s = &c->dev;
1049 int rc; 1049 int rc;
1050 1050
1051 c->hotpluggable = 1; 1051 c->hotpluggable = 1;
@@ -1098,8 +1098,8 @@ out:
1098 return rc; 1098 return rc;
1099} 1099}
1100 1100
1101static ssize_t __ref rescan_store(struct sysdev_class *class, 1101static ssize_t __ref rescan_store(struct device *dev,
1102 struct sysdev_class_attribute *attr, 1102 struct device_attribute *attr,
1103 const char *buf, 1103 const char *buf,
1104 size_t count) 1104 size_t count)
1105{ 1105{
@@ -1108,11 +1108,11 @@ static ssize_t __ref rescan_store(struct sysdev_class *class,
1108 rc = smp_rescan_cpus(); 1108 rc = smp_rescan_cpus();
1109 return rc ? rc : count; 1109 return rc ? rc : count;
1110} 1110}
1111static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store); 1111static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
1112#endif /* CONFIG_HOTPLUG_CPU */ 1112#endif /* CONFIG_HOTPLUG_CPU */
1113 1113
1114static ssize_t dispatching_show(struct sysdev_class *class, 1114static ssize_t dispatching_show(struct device *dev,
1115 struct sysdev_class_attribute *attr, 1115 struct device_attribute *attr,
1116 char *buf) 1116 char *buf)
1117{ 1117{
1118 ssize_t count; 1118 ssize_t count;
@@ -1123,8 +1123,8 @@ static ssize_t dispatching_show(struct sysdev_class *class,
1123 return count; 1123 return count;
1124} 1124}
1125 1125
1126static ssize_t dispatching_store(struct sysdev_class *dev, 1126static ssize_t dispatching_store(struct device *dev,
1127 struct sysdev_class_attribute *attr, 1127 struct device_attribute *attr,
1128 const char *buf, 1128 const char *buf,
1129 size_t count) 1129 size_t count)
1130{ 1130{
@@ -1148,7 +1148,7 @@ out:
1148 put_online_cpus(); 1148 put_online_cpus();
1149 return rc ? rc : count; 1149 return rc ? rc : count;
1150} 1150}
1151static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, 1151static DEVICE_ATTR(dispatching, 0644, dispatching_show,
1152 dispatching_store); 1152 dispatching_store);
1153 1153
1154static int __init topology_init(void) 1154static int __init topology_init(void)
@@ -1159,11 +1159,11 @@ static int __init topology_init(void)
1159 register_cpu_notifier(&smp_cpu_nb); 1159 register_cpu_notifier(&smp_cpu_nb);
1160 1160
1161#ifdef CONFIG_HOTPLUG_CPU 1161#ifdef CONFIG_HOTPLUG_CPU
1162 rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_rescan); 1162 rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan);
1163 if (rc) 1163 if (rc)
1164 return rc; 1164 return rc;
1165#endif 1165#endif
1166 rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_dispatching); 1166 rc = device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching);
1167 if (rc) 1167 if (rc)
1168 return rc; 1168 return rc;
1169 for_each_present_cpu(cpu) { 1169 for_each_present_cpu(cpu) {
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index ebbfab3c6e5a..fa02f443f5f6 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -27,7 +27,7 @@
27#include <linux/cpu.h> 27#include <linux/cpu.h>
28#include <linux/stop_machine.h> 28#include <linux/stop_machine.h>
29#include <linux/time.h> 29#include <linux/time.h>
30#include <linux/sysdev.h> 30#include <linux/device.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
@@ -1116,34 +1116,35 @@ out_unlock:
1116/* 1116/*
1117 * Sysfs interface functions 1117 * Sysfs interface functions
1118 */ 1118 */
1119static struct sysdev_class etr_sysclass = { 1119static struct bus_type etr_subsys = {
1120 .name = "etr", 1120 .name = "etr",
1121 .dev_name = "etr",
1121}; 1122};
1122 1123
1123static struct sys_device etr_port0_dev = { 1124static struct device etr_port0_dev = {
1124 .id = 0, 1125 .id = 0,
1125 .cls = &etr_sysclass, 1126 .bus = &etr_subsys,
1126}; 1127};
1127 1128
1128static struct sys_device etr_port1_dev = { 1129static struct device etr_port1_dev = {
1129 .id = 1, 1130 .id = 1,
1130 .cls = &etr_sysclass, 1131 .bus = &etr_subsys,
1131}; 1132};
1132 1133
1133/* 1134/*
1134 * ETR class attributes 1135 * ETR subsys attributes
1135 */ 1136 */
1136static ssize_t etr_stepping_port_show(struct sysdev_class *class, 1137static ssize_t etr_stepping_port_show(struct device *dev,
1137 struct sysdev_class_attribute *attr, 1138 struct device_attribute *attr,
1138 char *buf) 1139 char *buf)
1139{ 1140{
1140 return sprintf(buf, "%i\n", etr_port0.esw.p); 1141 return sprintf(buf, "%i\n", etr_port0.esw.p);
1141} 1142}
1142 1143
1143static SYSDEV_CLASS_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL); 1144static DEVICE_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL);
1144 1145
1145static ssize_t etr_stepping_mode_show(struct sysdev_class *class, 1146static ssize_t etr_stepping_mode_show(struct device *dev,
1146 struct sysdev_class_attribute *attr, 1147 struct device_attribute *attr,
1147 char *buf) 1148 char *buf)
1148{ 1149{
1149 char *mode_str; 1150 char *mode_str;
@@ -1157,12 +1158,12 @@ static ssize_t etr_stepping_mode_show(struct sysdev_class *class,
1157 return sprintf(buf, "%s\n", mode_str); 1158 return sprintf(buf, "%s\n", mode_str);
1158} 1159}
1159 1160
1160static SYSDEV_CLASS_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL); 1161static DEVICE_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL);
1161 1162
1162/* 1163/*
1163 * ETR port attributes 1164 * ETR port attributes
1164 */ 1165 */
1165static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev) 1166static inline struct etr_aib *etr_aib_from_dev(struct device *dev)
1166{ 1167{
1167 if (dev == &etr_port0_dev) 1168 if (dev == &etr_port0_dev)
1168 return etr_port0_online ? &etr_port0 : NULL; 1169 return etr_port0_online ? &etr_port0 : NULL;
@@ -1170,8 +1171,8 @@ static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev)
1170 return etr_port1_online ? &etr_port1 : NULL; 1171 return etr_port1_online ? &etr_port1 : NULL;
1171} 1172}
1172 1173
1173static ssize_t etr_online_show(struct sys_device *dev, 1174static ssize_t etr_online_show(struct device *dev,
1174 struct sysdev_attribute *attr, 1175 struct device_attribute *attr,
1175 char *buf) 1176 char *buf)
1176{ 1177{
1177 unsigned int online; 1178 unsigned int online;
@@ -1180,8 +1181,8 @@ static ssize_t etr_online_show(struct sys_device *dev,
1180 return sprintf(buf, "%i\n", online); 1181 return sprintf(buf, "%i\n", online);
1181} 1182}
1182 1183
1183static ssize_t etr_online_store(struct sys_device *dev, 1184static ssize_t etr_online_store(struct device *dev,
1184 struct sysdev_attribute *attr, 1185 struct device_attribute *attr,
1185 const char *buf, size_t count) 1186 const char *buf, size_t count)
1186{ 1187{
1187 unsigned int value; 1188 unsigned int value;
@@ -1218,20 +1219,20 @@ out:
1218 return count; 1219 return count;
1219} 1220}
1220 1221
1221static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store); 1222static DEVICE_ATTR(online, 0600, etr_online_show, etr_online_store);
1222 1223
1223static ssize_t etr_stepping_control_show(struct sys_device *dev, 1224static ssize_t etr_stepping_control_show(struct device *dev,
1224 struct sysdev_attribute *attr, 1225 struct device_attribute *attr,
1225 char *buf) 1226 char *buf)
1226{ 1227{
1227 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ? 1228 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ?
1228 etr_eacr.e0 : etr_eacr.e1); 1229 etr_eacr.e0 : etr_eacr.e1);
1229} 1230}
1230 1231
1231static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL); 1232static DEVICE_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL);
1232 1233
1233static ssize_t etr_mode_code_show(struct sys_device *dev, 1234static ssize_t etr_mode_code_show(struct device *dev,
1234 struct sysdev_attribute *attr, char *buf) 1235 struct device_attribute *attr, char *buf)
1235{ 1236{
1236 if (!etr_port0_online && !etr_port1_online) 1237 if (!etr_port0_online && !etr_port1_online)
1237 /* Status word is not uptodate if both ports are offline. */ 1238 /* Status word is not uptodate if both ports are offline. */
@@ -1240,10 +1241,10 @@ static ssize_t etr_mode_code_show(struct sys_device *dev,
1240 etr_port0.esw.psc0 : etr_port0.esw.psc1); 1241 etr_port0.esw.psc0 : etr_port0.esw.psc1);
1241} 1242}
1242 1243
1243static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL); 1244static DEVICE_ATTR(state_code, 0400, etr_mode_code_show, NULL);
1244 1245
1245static ssize_t etr_untuned_show(struct sys_device *dev, 1246static ssize_t etr_untuned_show(struct device *dev,
1246 struct sysdev_attribute *attr, char *buf) 1247 struct device_attribute *attr, char *buf)
1247{ 1248{
1248 struct etr_aib *aib = etr_aib_from_dev(dev); 1249 struct etr_aib *aib = etr_aib_from_dev(dev);
1249 1250
@@ -1252,10 +1253,10 @@ static ssize_t etr_untuned_show(struct sys_device *dev,
1252 return sprintf(buf, "%i\n", aib->edf1.u); 1253 return sprintf(buf, "%i\n", aib->edf1.u);
1253} 1254}
1254 1255
1255static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL); 1256static DEVICE_ATTR(untuned, 0400, etr_untuned_show, NULL);
1256 1257
1257static ssize_t etr_network_id_show(struct sys_device *dev, 1258static ssize_t etr_network_id_show(struct device *dev,
1258 struct sysdev_attribute *attr, char *buf) 1259 struct device_attribute *attr, char *buf)
1259{ 1260{
1260 struct etr_aib *aib = etr_aib_from_dev(dev); 1261 struct etr_aib *aib = etr_aib_from_dev(dev);
1261 1262
@@ -1264,10 +1265,10 @@ static ssize_t etr_network_id_show(struct sys_device *dev,
1264 return sprintf(buf, "%i\n", aib->edf1.net_id); 1265 return sprintf(buf, "%i\n", aib->edf1.net_id);
1265} 1266}
1266 1267
1267static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL); 1268static DEVICE_ATTR(network, 0400, etr_network_id_show, NULL);
1268 1269
1269static ssize_t etr_id_show(struct sys_device *dev, 1270static ssize_t etr_id_show(struct device *dev,
1270 struct sysdev_attribute *attr, char *buf) 1271 struct device_attribute *attr, char *buf)
1271{ 1272{
1272 struct etr_aib *aib = etr_aib_from_dev(dev); 1273 struct etr_aib *aib = etr_aib_from_dev(dev);
1273 1274
@@ -1276,10 +1277,10 @@ static ssize_t etr_id_show(struct sys_device *dev,
1276 return sprintf(buf, "%i\n", aib->edf1.etr_id); 1277 return sprintf(buf, "%i\n", aib->edf1.etr_id);
1277} 1278}
1278 1279
1279static SYSDEV_ATTR(id, 0400, etr_id_show, NULL); 1280static DEVICE_ATTR(id, 0400, etr_id_show, NULL);
1280 1281
1281static ssize_t etr_port_number_show(struct sys_device *dev, 1282static ssize_t etr_port_number_show(struct device *dev,
1282 struct sysdev_attribute *attr, char *buf) 1283 struct device_attribute *attr, char *buf)
1283{ 1284{
1284 struct etr_aib *aib = etr_aib_from_dev(dev); 1285 struct etr_aib *aib = etr_aib_from_dev(dev);
1285 1286
@@ -1288,10 +1289,10 @@ static ssize_t etr_port_number_show(struct sys_device *dev,
1288 return sprintf(buf, "%i\n", aib->edf1.etr_pn); 1289 return sprintf(buf, "%i\n", aib->edf1.etr_pn);
1289} 1290}
1290 1291
1291static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL); 1292static DEVICE_ATTR(port, 0400, etr_port_number_show, NULL);
1292 1293
1293static ssize_t etr_coupled_show(struct sys_device *dev, 1294static ssize_t etr_coupled_show(struct device *dev,
1294 struct sysdev_attribute *attr, char *buf) 1295 struct device_attribute *attr, char *buf)
1295{ 1296{
1296 struct etr_aib *aib = etr_aib_from_dev(dev); 1297 struct etr_aib *aib = etr_aib_from_dev(dev);
1297 1298
@@ -1300,10 +1301,10 @@ static ssize_t etr_coupled_show(struct sys_device *dev,
1300 return sprintf(buf, "%i\n", aib->edf3.c); 1301 return sprintf(buf, "%i\n", aib->edf3.c);
1301} 1302}
1302 1303
1303static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL); 1304static DEVICE_ATTR(coupled, 0400, etr_coupled_show, NULL);
1304 1305
1305static ssize_t etr_local_time_show(struct sys_device *dev, 1306static ssize_t etr_local_time_show(struct device *dev,
1306 struct sysdev_attribute *attr, char *buf) 1307 struct device_attribute *attr, char *buf)
1307{ 1308{
1308 struct etr_aib *aib = etr_aib_from_dev(dev); 1309 struct etr_aib *aib = etr_aib_from_dev(dev);
1309 1310
@@ -1312,10 +1313,10 @@ static ssize_t etr_local_time_show(struct sys_device *dev,
1312 return sprintf(buf, "%i\n", aib->edf3.blto); 1313 return sprintf(buf, "%i\n", aib->edf3.blto);
1313} 1314}
1314 1315
1315static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL); 1316static DEVICE_ATTR(local_time, 0400, etr_local_time_show, NULL);
1316 1317
1317static ssize_t etr_utc_offset_show(struct sys_device *dev, 1318static ssize_t etr_utc_offset_show(struct device *dev,
1318 struct sysdev_attribute *attr, char *buf) 1319 struct device_attribute *attr, char *buf)
1319{ 1320{
1320 struct etr_aib *aib = etr_aib_from_dev(dev); 1321 struct etr_aib *aib = etr_aib_from_dev(dev);
1321 1322
@@ -1324,64 +1325,64 @@ static ssize_t etr_utc_offset_show(struct sys_device *dev,
1324 return sprintf(buf, "%i\n", aib->edf3.buo); 1325 return sprintf(buf, "%i\n", aib->edf3.buo);
1325} 1326}
1326 1327
1327static SYSDEV_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL); 1328static DEVICE_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL);
1328 1329
1329static struct sysdev_attribute *etr_port_attributes[] = { 1330static struct device_attribute *etr_port_attributes[] = {
1330 &attr_online, 1331 &dev_attr_online,
1331 &attr_stepping_control, 1332 &dev_attr_stepping_control,
1332 &attr_state_code, 1333 &dev_attr_state_code,
1333 &attr_untuned, 1334 &dev_attr_untuned,
1334 &attr_network, 1335 &dev_attr_network,
1335 &attr_id, 1336 &dev_attr_id,
1336 &attr_port, 1337 &dev_attr_port,
1337 &attr_coupled, 1338 &dev_attr_coupled,
1338 &attr_local_time, 1339 &dev_attr_local_time,
1339 &attr_utc_offset, 1340 &dev_attr_utc_offset,
1340 NULL 1341 NULL
1341}; 1342};
1342 1343
1343static int __init etr_register_port(struct sys_device *dev) 1344static int __init etr_register_port(struct device *dev)
1344{ 1345{
1345 struct sysdev_attribute **attr; 1346 struct device_attribute **attr;
1346 int rc; 1347 int rc;
1347 1348
1348 rc = sysdev_register(dev); 1349 rc = device_register(dev);
1349 if (rc) 1350 if (rc)
1350 goto out; 1351 goto out;
1351 for (attr = etr_port_attributes; *attr; attr++) { 1352 for (attr = etr_port_attributes; *attr; attr++) {
1352 rc = sysdev_create_file(dev, *attr); 1353 rc = device_create_file(dev, *attr);
1353 if (rc) 1354 if (rc)
1354 goto out_unreg; 1355 goto out_unreg;
1355 } 1356 }
1356 return 0; 1357 return 0;
1357out_unreg: 1358out_unreg:
1358 for (; attr >= etr_port_attributes; attr--) 1359 for (; attr >= etr_port_attributes; attr--)
1359 sysdev_remove_file(dev, *attr); 1360 device_remove_file(dev, *attr);
1360 sysdev_unregister(dev); 1361 device_unregister(dev);
1361out: 1362out:
1362 return rc; 1363 return rc;
1363} 1364}
1364 1365
1365static void __init etr_unregister_port(struct sys_device *dev) 1366static void __init etr_unregister_port(struct device *dev)
1366{ 1367{
1367 struct sysdev_attribute **attr; 1368 struct device_attribute **attr;
1368 1369
1369 for (attr = etr_port_attributes; *attr; attr++) 1370 for (attr = etr_port_attributes; *attr; attr++)
1370 sysdev_remove_file(dev, *attr); 1371 device_remove_file(dev, *attr);
1371 sysdev_unregister(dev); 1372 device_unregister(dev);
1372} 1373}
1373 1374
1374static int __init etr_init_sysfs(void) 1375static int __init etr_init_sysfs(void)
1375{ 1376{
1376 int rc; 1377 int rc;
1377 1378
1378 rc = sysdev_class_register(&etr_sysclass); 1379 rc = subsys_system_register(&etr_subsys, NULL);
1379 if (rc) 1380 if (rc)
1380 goto out; 1381 goto out;
1381 rc = sysdev_class_create_file(&etr_sysclass, &attr_stepping_port); 1382 rc = device_create_file(etr_subsys.dev_root, &dev_attr_stepping_port);
1382 if (rc) 1383 if (rc)
1383 goto out_unreg_class; 1384 goto out_unreg_subsys;
1384 rc = sysdev_class_create_file(&etr_sysclass, &attr_stepping_mode); 1385 rc = device_create_file(etr_subsys.dev_root, &dev_attr_stepping_mode);
1385 if (rc) 1386 if (rc)
1386 goto out_remove_stepping_port; 1387 goto out_remove_stepping_port;
1387 rc = etr_register_port(&etr_port0_dev); 1388 rc = etr_register_port(&etr_port0_dev);
@@ -1395,11 +1396,11 @@ static int __init etr_init_sysfs(void)
1395out_remove_port0: 1396out_remove_port0:
1396 etr_unregister_port(&etr_port0_dev); 1397 etr_unregister_port(&etr_port0_dev);
1397out_remove_stepping_mode: 1398out_remove_stepping_mode:
1398 sysdev_class_remove_file(&etr_sysclass, &attr_stepping_mode); 1399 device_remove_file(etr_subsys.dev_root, &dev_attr_stepping_mode);
1399out_remove_stepping_port: 1400out_remove_stepping_port:
1400 sysdev_class_remove_file(&etr_sysclass, &attr_stepping_port); 1401 device_remove_file(etr_subsys.dev_root, &dev_attr_stepping_port);
1401out_unreg_class: 1402out_unreg_subsys:
1402 sysdev_class_unregister(&etr_sysclass); 1403 bus_unregister(&etr_subsys);
1403out: 1404out:
1404 return rc; 1405 return rc;
1405} 1406}
@@ -1599,14 +1600,15 @@ out_unlock:
1599} 1600}
1600 1601
1601/* 1602/*
1602 * STP class sysfs interface functions 1603 * STP subsys sysfs interface functions
1603 */ 1604 */
1604static struct sysdev_class stp_sysclass = { 1605static struct bus_type stp_subsys = {
1605 .name = "stp", 1606 .name = "stp",
1607 .dev_name = "stp",
1606}; 1608};
1607 1609
1608static ssize_t stp_ctn_id_show(struct sysdev_class *class, 1610static ssize_t stp_ctn_id_show(struct device *dev,
1609 struct sysdev_class_attribute *attr, 1611 struct device_attribute *attr,
1610 char *buf) 1612 char *buf)
1611{ 1613{
1612 if (!stp_online) 1614 if (!stp_online)
@@ -1615,10 +1617,10 @@ static ssize_t stp_ctn_id_show(struct sysdev_class *class,
1615 *(unsigned long long *) stp_info.ctnid); 1617 *(unsigned long long *) stp_info.ctnid);
1616} 1618}
1617 1619
1618static SYSDEV_CLASS_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL); 1620static DEVICE_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL);
1619 1621
1620static ssize_t stp_ctn_type_show(struct sysdev_class *class, 1622static ssize_t stp_ctn_type_show(struct device *dev,
1621 struct sysdev_class_attribute *attr, 1623 struct device_attribute *attr,
1622 char *buf) 1624 char *buf)
1623{ 1625{
1624 if (!stp_online) 1626 if (!stp_online)
@@ -1626,10 +1628,10 @@ static ssize_t stp_ctn_type_show(struct sysdev_class *class,
1626 return sprintf(buf, "%i\n", stp_info.ctn); 1628 return sprintf(buf, "%i\n", stp_info.ctn);
1627} 1629}
1628 1630
1629static SYSDEV_CLASS_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL); 1631static DEVICE_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL);
1630 1632
1631static ssize_t stp_dst_offset_show(struct sysdev_class *class, 1633static ssize_t stp_dst_offset_show(struct device *dev,
1632 struct sysdev_class_attribute *attr, 1634 struct device_attribute *attr,
1633 char *buf) 1635 char *buf)
1634{ 1636{
1635 if (!stp_online || !(stp_info.vbits & 0x2000)) 1637 if (!stp_online || !(stp_info.vbits & 0x2000))
@@ -1637,10 +1639,10 @@ static ssize_t stp_dst_offset_show(struct sysdev_class *class,
1637 return sprintf(buf, "%i\n", (int)(s16) stp_info.dsto); 1639 return sprintf(buf, "%i\n", (int)(s16) stp_info.dsto);
1638} 1640}
1639 1641
1640static SYSDEV_CLASS_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL); 1642static DEVICE_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL);
1641 1643
1642static ssize_t stp_leap_seconds_show(struct sysdev_class *class, 1644static ssize_t stp_leap_seconds_show(struct device *dev,
1643 struct sysdev_class_attribute *attr, 1645 struct device_attribute *attr,
1644 char *buf) 1646 char *buf)
1645{ 1647{
1646 if (!stp_online || !(stp_info.vbits & 0x8000)) 1648 if (!stp_online || !(stp_info.vbits & 0x8000))
@@ -1648,10 +1650,10 @@ static ssize_t stp_leap_seconds_show(struct sysdev_class *class,
1648 return sprintf(buf, "%i\n", (int)(s16) stp_info.leaps); 1650 return sprintf(buf, "%i\n", (int)(s16) stp_info.leaps);
1649} 1651}
1650 1652
1651static SYSDEV_CLASS_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL); 1653static DEVICE_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL);
1652 1654
1653static ssize_t stp_stratum_show(struct sysdev_class *class, 1655static ssize_t stp_stratum_show(struct device *dev,
1654 struct sysdev_class_attribute *attr, 1656 struct device_attribute *attr,
1655 char *buf) 1657 char *buf)
1656{ 1658{
1657 if (!stp_online) 1659 if (!stp_online)
@@ -1659,10 +1661,10 @@ static ssize_t stp_stratum_show(struct sysdev_class *class,
1659 return sprintf(buf, "%i\n", (int)(s16) stp_info.stratum); 1661 return sprintf(buf, "%i\n", (int)(s16) stp_info.stratum);
1660} 1662}
1661 1663
1662static SYSDEV_CLASS_ATTR(stratum, 0400, stp_stratum_show, NULL); 1664static DEVICE_ATTR(stratum, 0400, stp_stratum_show, NULL);
1663 1665
1664static ssize_t stp_time_offset_show(struct sysdev_class *class, 1666static ssize_t stp_time_offset_show(struct device *dev,
1665 struct sysdev_class_attribute *attr, 1667 struct device_attribute *attr,
1666 char *buf) 1668 char *buf)
1667{ 1669{
1668 if (!stp_online || !(stp_info.vbits & 0x0800)) 1670 if (!stp_online || !(stp_info.vbits & 0x0800))
@@ -1670,10 +1672,10 @@ static ssize_t stp_time_offset_show(struct sysdev_class *class,
1670 return sprintf(buf, "%i\n", (int) stp_info.tto); 1672 return sprintf(buf, "%i\n", (int) stp_info.tto);
1671} 1673}
1672 1674
1673static SYSDEV_CLASS_ATTR(time_offset, 0400, stp_time_offset_show, NULL); 1675static DEVICE_ATTR(time_offset, 0400, stp_time_offset_show, NULL);
1674 1676
1675static ssize_t stp_time_zone_offset_show(struct sysdev_class *class, 1677static ssize_t stp_time_zone_offset_show(struct device *dev,
1676 struct sysdev_class_attribute *attr, 1678 struct device_attribute *attr,
1677 char *buf) 1679 char *buf)
1678{ 1680{
1679 if (!stp_online || !(stp_info.vbits & 0x4000)) 1681 if (!stp_online || !(stp_info.vbits & 0x4000))
@@ -1681,11 +1683,11 @@ static ssize_t stp_time_zone_offset_show(struct sysdev_class *class,
1681 return sprintf(buf, "%i\n", (int)(s16) stp_info.tzo); 1683 return sprintf(buf, "%i\n", (int)(s16) stp_info.tzo);
1682} 1684}
1683 1685
1684static SYSDEV_CLASS_ATTR(time_zone_offset, 0400, 1686static DEVICE_ATTR(time_zone_offset, 0400,
1685 stp_time_zone_offset_show, NULL); 1687 stp_time_zone_offset_show, NULL);
1686 1688
1687static ssize_t stp_timing_mode_show(struct sysdev_class *class, 1689static ssize_t stp_timing_mode_show(struct device *dev,
1688 struct sysdev_class_attribute *attr, 1690 struct device_attribute *attr,
1689 char *buf) 1691 char *buf)
1690{ 1692{
1691 if (!stp_online) 1693 if (!stp_online)
@@ -1693,10 +1695,10 @@ static ssize_t stp_timing_mode_show(struct sysdev_class *class,
1693 return sprintf(buf, "%i\n", stp_info.tmd); 1695 return sprintf(buf, "%i\n", stp_info.tmd);
1694} 1696}
1695 1697
1696static SYSDEV_CLASS_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL); 1698static DEVICE_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL);
1697 1699
1698static ssize_t stp_timing_state_show(struct sysdev_class *class, 1700static ssize_t stp_timing_state_show(struct device *dev,
1699 struct sysdev_class_attribute *attr, 1701 struct device_attribute *attr,
1700 char *buf) 1702 char *buf)
1701{ 1703{
1702 if (!stp_online) 1704 if (!stp_online)
@@ -1704,17 +1706,17 @@ static ssize_t stp_timing_state_show(struct sysdev_class *class,
1704 return sprintf(buf, "%i\n", stp_info.tst); 1706 return sprintf(buf, "%i\n", stp_info.tst);
1705} 1707}
1706 1708
1707static SYSDEV_CLASS_ATTR(timing_state, 0400, stp_timing_state_show, NULL); 1709static DEVICE_ATTR(timing_state, 0400, stp_timing_state_show, NULL);
1708 1710
1709static ssize_t stp_online_show(struct sysdev_class *class, 1711static ssize_t stp_online_show(struct device *dev,
1710 struct sysdev_class_attribute *attr, 1712 struct device_attribute *attr,
1711 char *buf) 1713 char *buf)
1712{ 1714{
1713 return sprintf(buf, "%i\n", stp_online); 1715 return sprintf(buf, "%i\n", stp_online);
1714} 1716}
1715 1717
1716static ssize_t stp_online_store(struct sysdev_class *class, 1718static ssize_t stp_online_store(struct device *dev,
1717 struct sysdev_class_attribute *attr, 1719 struct device_attribute *attr,
1718 const char *buf, size_t count) 1720 const char *buf, size_t count)
1719{ 1721{
1720 unsigned int value; 1722 unsigned int value;
@@ -1736,47 +1738,47 @@ static ssize_t stp_online_store(struct sysdev_class *class,
1736} 1738}
1737 1739
1738/* 1740/*
1739 * Can't use SYSDEV_CLASS_ATTR because the attribute should be named 1741 * Can't use DEVICE_ATTR because the attribute should be named
1740 * stp/online but attr_online already exists in this file .. 1742 * stp/online but dev_attr_online already exists in this file ..
1741 */ 1743 */
1742static struct sysdev_class_attribute attr_stp_online = { 1744static struct device_attribute dev_attr_stp_online = {
1743 .attr = { .name = "online", .mode = 0600 }, 1745 .attr = { .name = "online", .mode = 0600 },
1744 .show = stp_online_show, 1746 .show = stp_online_show,
1745 .store = stp_online_store, 1747 .store = stp_online_store,
1746}; 1748};
1747 1749
1748static struct sysdev_class_attribute *stp_attributes[] = { 1750static struct device_attribute *stp_attributes[] = {
1749 &attr_ctn_id, 1751 &dev_attr_ctn_id,
1750 &attr_ctn_type, 1752 &dev_attr_ctn_type,
1751 &attr_dst_offset, 1753 &dev_attr_dst_offset,
1752 &attr_leap_seconds, 1754 &dev_attr_leap_seconds,
1753 &attr_stp_online, 1755 &dev_attr_stp_online,
1754 &attr_stratum, 1756 &dev_attr_stratum,
1755 &attr_time_offset, 1757 &dev_attr_time_offset,
1756 &attr_time_zone_offset, 1758 &dev_attr_time_zone_offset,
1757 &attr_timing_mode, 1759 &dev_attr_timing_mode,
1758 &attr_timing_state, 1760 &dev_attr_timing_state,
1759 NULL 1761 NULL
1760}; 1762};
1761 1763
1762static int __init stp_init_sysfs(void) 1764static int __init stp_init_sysfs(void)
1763{ 1765{
1764 struct sysdev_class_attribute **attr; 1766 struct device_attribute **attr;
1765 int rc; 1767 int rc;
1766 1768
1767 rc = sysdev_class_register(&stp_sysclass); 1769 rc = subsys_system_register(&stp_subsys, NULL);
1768 if (rc) 1770 if (rc)
1769 goto out; 1771 goto out;
1770 for (attr = stp_attributes; *attr; attr++) { 1772 for (attr = stp_attributes; *attr; attr++) {
1771 rc = sysdev_class_create_file(&stp_sysclass, *attr); 1773 rc = device_create_file(stp_subsys.dev_root, *attr);
1772 if (rc) 1774 if (rc)
1773 goto out_unreg; 1775 goto out_unreg;
1774 } 1776 }
1775 return 0; 1777 return 0;
1776out_unreg: 1778out_unreg:
1777 for (; attr >= stp_attributes; attr--) 1779 for (; attr >= stp_attributes; attr--)
1778 sysdev_class_remove_file(&stp_sysclass, *attr); 1780 device_remove_file(stp_subsys.dev_root, *attr);
1779 sysdev_class_unregister(&stp_sysclass); 1781 bus_unregister(&stp_subsys);
1780out: 1782out:
1781 return rc; 1783 return rc;
1782} 1784}
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index fdb5b8cb260f..6e0e29b29a7b 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -261,7 +261,7 @@ void store_topology(struct sysinfo_15_1_x *info)
261int arch_update_cpu_topology(void) 261int arch_update_cpu_topology(void)
262{ 262{
263 struct sysinfo_15_1_x *info = tl_info; 263 struct sysinfo_15_1_x *info = tl_info;
264 struct sys_device *sysdev; 264 struct device *dev;
265 int cpu; 265 int cpu;
266 266
267 if (!MACHINE_HAS_TOPOLOGY) { 267 if (!MACHINE_HAS_TOPOLOGY) {
@@ -273,8 +273,8 @@ int arch_update_cpu_topology(void)
273 tl_to_cores(info); 273 tl_to_cores(info);
274 update_cpu_core_map(); 274 update_cpu_core_map();
275 for_each_online_cpu(cpu) { 275 for_each_online_cpu(cpu) {
276 sysdev = get_cpu_sysdev(cpu); 276 dev = get_cpu_device(cpu);
277 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); 277 kobject_uevent(&dev->kobj, KOBJ_CHANGE);
278 } 278 }
279 return 1; 279 return 1;
280} 280}
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index 87cedd61be04..8943e82cd4d9 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -70,7 +70,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
70 return -EOPNOTSUPP; 70 return -EOPNOTSUPP;
71 } 71 }
72 72
73 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags); 73 atomic_set_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
74 vcpu->run->s390_reset_flags |= KVM_S390_RESET_SUBSYSTEM; 74 vcpu->run->s390_reset_flags |= KVM_S390_RESET_SUBSYSTEM;
75 vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL; 75 vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL;
76 vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT; 76 vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT;
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index c7c51898984e..02434543eabb 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -132,7 +132,6 @@ static int handle_stop(struct kvm_vcpu *vcpu)
132 int rc = 0; 132 int rc = 0;
133 133
134 vcpu->stat.exit_stop_request++; 134 vcpu->stat.exit_stop_request++;
135 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
136 spin_lock_bh(&vcpu->arch.local_int.lock); 135 spin_lock_bh(&vcpu->arch.local_int.lock);
137 if (vcpu->arch.local_int.action_bits & ACTION_STORE_ON_STOP) { 136 if (vcpu->arch.local_int.action_bits & ACTION_STORE_ON_STOP) {
138 vcpu->arch.local_int.action_bits &= ~ACTION_STORE_ON_STOP; 137 vcpu->arch.local_int.action_bits &= ~ACTION_STORE_ON_STOP;
@@ -149,6 +148,8 @@ static int handle_stop(struct kvm_vcpu *vcpu)
149 } 148 }
150 149
151 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) { 150 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) {
151 atomic_set_mask(CPUSTAT_STOPPED,
152 &vcpu->arch.sie_block->cpuflags);
152 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP; 153 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP;
153 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped"); 154 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped");
154 rc = -EOPNOTSUPP; 155 rc = -EOPNOTSUPP;
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 87c16705b381..278ee009ce65 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -252,6 +252,7 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
252 offsetof(struct _lowcore, restart_psw), sizeof(psw_t)); 252 offsetof(struct _lowcore, restart_psw), sizeof(psw_t));
253 if (rc == -EFAULT) 253 if (rc == -EFAULT)
254 exception = 1; 254 exception = 1;
255 atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
255 break; 256 break;
256 257
257 case KVM_S390_PROGRAM_INT: 258 case KVM_S390_PROGRAM_INT:
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0bd3bea1e4cd..d1c445732451 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -65,6 +65,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
65 { "instruction_stfl", VCPU_STAT(instruction_stfl) }, 65 { "instruction_stfl", VCPU_STAT(instruction_stfl) },
66 { "instruction_tprot", VCPU_STAT(instruction_tprot) }, 66 { "instruction_tprot", VCPU_STAT(instruction_tprot) },
67 { "instruction_sigp_sense", VCPU_STAT(instruction_sigp_sense) }, 67 { "instruction_sigp_sense", VCPU_STAT(instruction_sigp_sense) },
68 { "instruction_sigp_sense_running", VCPU_STAT(instruction_sigp_sense_running) },
68 { "instruction_sigp_external_call", VCPU_STAT(instruction_sigp_external_call) }, 69 { "instruction_sigp_external_call", VCPU_STAT(instruction_sigp_external_call) },
69 { "instruction_sigp_emergency", VCPU_STAT(instruction_sigp_emergency) }, 70 { "instruction_sigp_emergency", VCPU_STAT(instruction_sigp_emergency) },
70 { "instruction_sigp_stop", VCPU_STAT(instruction_sigp_stop) }, 71 { "instruction_sigp_stop", VCPU_STAT(instruction_sigp_stop) },
@@ -127,6 +128,7 @@ int kvm_dev_ioctl_check_extension(long ext)
127 switch (ext) { 128 switch (ext) {
128 case KVM_CAP_S390_PSW: 129 case KVM_CAP_S390_PSW:
129 case KVM_CAP_S390_GMAP: 130 case KVM_CAP_S390_GMAP:
131 case KVM_CAP_SYNC_MMU:
130 r = 1; 132 r = 1;
131 break; 133 break;
132 default: 134 default:
@@ -270,10 +272,12 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
270 restore_fp_regs(&vcpu->arch.guest_fpregs); 272 restore_fp_regs(&vcpu->arch.guest_fpregs);
271 restore_access_regs(vcpu->arch.guest_acrs); 273 restore_access_regs(vcpu->arch.guest_acrs);
272 gmap_enable(vcpu->arch.gmap); 274 gmap_enable(vcpu->arch.gmap);
275 atomic_set_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
273} 276}
274 277
275void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) 278void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
276{ 279{
280 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
277 gmap_disable(vcpu->arch.gmap); 281 gmap_disable(vcpu->arch.gmap);
278 save_fp_regs(&vcpu->arch.guest_fpregs); 282 save_fp_regs(&vcpu->arch.guest_fpregs);
279 save_access_regs(vcpu->arch.guest_acrs); 283 save_access_regs(vcpu->arch.guest_acrs);
@@ -301,7 +305,9 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
301 305
302int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) 306int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
303{ 307{
304 atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH | CPUSTAT_SM); 308 atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH |
309 CPUSTAT_SM |
310 CPUSTAT_STOPPED);
305 vcpu->arch.sie_block->ecb = 6; 311 vcpu->arch.sie_block->ecb = 6;
306 vcpu->arch.sie_block->eca = 0xC1002001U; 312 vcpu->arch.sie_block->eca = 0xC1002001U;
307 vcpu->arch.sie_block->fac = (int) (long) facilities; 313 vcpu->arch.sie_block->fac = (int) (long) facilities;
@@ -428,7 +434,7 @@ static int kvm_arch_vcpu_ioctl_set_initial_psw(struct kvm_vcpu *vcpu, psw_t psw)
428{ 434{
429 int rc = 0; 435 int rc = 0;
430 436
431 if (atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_RUNNING) 437 if (!(atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_STOPPED))
432 rc = -EBUSY; 438 rc = -EBUSY;
433 else { 439 else {
434 vcpu->run->psw_mask = psw.mask; 440 vcpu->run->psw_mask = psw.mask;
@@ -501,7 +507,7 @@ rerun_vcpu:
501 if (vcpu->sigset_active) 507 if (vcpu->sigset_active)
502 sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); 508 sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
503 509
504 atomic_set_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags); 510 atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
505 511
506 BUG_ON(vcpu->kvm->arch.float_int.local_int[vcpu->vcpu_id] == NULL); 512 BUG_ON(vcpu->kvm->arch.float_int.local_int[vcpu->vcpu_id] == NULL);
507 513
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 391626361084..d02638959922 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -336,6 +336,7 @@ static int handle_tprot(struct kvm_vcpu *vcpu)
336 u64 address1 = disp1 + base1 ? vcpu->arch.guest_gprs[base1] : 0; 336 u64 address1 = disp1 + base1 ? vcpu->arch.guest_gprs[base1] : 0;
337 u64 address2 = disp2 + base2 ? vcpu->arch.guest_gprs[base2] : 0; 337 u64 address2 = disp2 + base2 ? vcpu->arch.guest_gprs[base2] : 0;
338 struct vm_area_struct *vma; 338 struct vm_area_struct *vma;
339 unsigned long user_address;
339 340
340 vcpu->stat.instruction_tprot++; 341 vcpu->stat.instruction_tprot++;
341 342
@@ -349,9 +350,14 @@ static int handle_tprot(struct kvm_vcpu *vcpu)
349 return -EOPNOTSUPP; 350 return -EOPNOTSUPP;
350 351
351 352
353 /* we must resolve the address without holding the mmap semaphore.
354 * This is ok since the userspace hypervisor is not supposed to change
355 * the mapping while the guest queries the memory. Otherwise the guest
356 * might crash or get wrong info anyway. */
357 user_address = (unsigned long) __guestaddr_to_user(vcpu, address1);
358
352 down_read(&current->mm->mmap_sem); 359 down_read(&current->mm->mmap_sem);
353 vma = find_vma(current->mm, 360 vma = find_vma(current->mm, user_address);
354 (unsigned long) __guestaddr_to_user(vcpu, address1));
355 if (!vma) { 361 if (!vma) {
356 up_read(&current->mm->mmap_sem); 362 up_read(&current->mm->mmap_sem);
357 return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 363 return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index f815118835f3..0a7941d74bc6 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -31,9 +31,11 @@
31#define SIGP_SET_PREFIX 0x0d 31#define SIGP_SET_PREFIX 0x0d
32#define SIGP_STORE_STATUS_ADDR 0x0e 32#define SIGP_STORE_STATUS_ADDR 0x0e
33#define SIGP_SET_ARCH 0x12 33#define SIGP_SET_ARCH 0x12
34#define SIGP_SENSE_RUNNING 0x15
34 35
35/* cpu status bits */ 36/* cpu status bits */
36#define SIGP_STAT_EQUIPMENT_CHECK 0x80000000UL 37#define SIGP_STAT_EQUIPMENT_CHECK 0x80000000UL
38#define SIGP_STAT_NOT_RUNNING 0x00000400UL
37#define SIGP_STAT_INCORRECT_STATE 0x00000200UL 39#define SIGP_STAT_INCORRECT_STATE 0x00000200UL
38#define SIGP_STAT_INVALID_PARAMETER 0x00000100UL 40#define SIGP_STAT_INVALID_PARAMETER 0x00000100UL
39#define SIGP_STAT_EXT_CALL_PENDING 0x00000080UL 41#define SIGP_STAT_EXT_CALL_PENDING 0x00000080UL
@@ -57,8 +59,8 @@ static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr,
57 spin_lock(&fi->lock); 59 spin_lock(&fi->lock);
58 if (fi->local_int[cpu_addr] == NULL) 60 if (fi->local_int[cpu_addr] == NULL)
59 rc = 3; /* not operational */ 61 rc = 3; /* not operational */
60 else if (atomic_read(fi->local_int[cpu_addr]->cpuflags) 62 else if (!(atomic_read(fi->local_int[cpu_addr]->cpuflags)
61 & CPUSTAT_RUNNING) { 63 & CPUSTAT_STOPPED)) {
62 *reg &= 0xffffffff00000000UL; 64 *reg &= 0xffffffff00000000UL;
63 rc = 1; /* status stored */ 65 rc = 1; /* status stored */
64 } else { 66 } else {
@@ -251,7 +253,7 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
251 253
252 spin_lock_bh(&li->lock); 254 spin_lock_bh(&li->lock);
253 /* cpu must be in stopped state */ 255 /* cpu must be in stopped state */
254 if (atomic_read(li->cpuflags) & CPUSTAT_RUNNING) { 256 if (!(atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) {
255 rc = 1; /* incorrect state */ 257 rc = 1; /* incorrect state */
256 *reg &= SIGP_STAT_INCORRECT_STATE; 258 *reg &= SIGP_STAT_INCORRECT_STATE;
257 kfree(inti); 259 kfree(inti);
@@ -275,6 +277,38 @@ out_fi:
275 return rc; 277 return rc;
276} 278}
277 279
280static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr,
281 unsigned long *reg)
282{
283 int rc;
284 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
285
286 if (cpu_addr >= KVM_MAX_VCPUS)
287 return 3; /* not operational */
288
289 spin_lock(&fi->lock);
290 if (fi->local_int[cpu_addr] == NULL)
291 rc = 3; /* not operational */
292 else {
293 if (atomic_read(fi->local_int[cpu_addr]->cpuflags)
294 & CPUSTAT_RUNNING) {
295 /* running */
296 rc = 1;
297 } else {
298 /* not running */
299 *reg &= 0xffffffff00000000UL;
300 *reg |= SIGP_STAT_NOT_RUNNING;
301 rc = 0;
302 }
303 }
304 spin_unlock(&fi->lock);
305
306 VCPU_EVENT(vcpu, 4, "sensed running status of cpu %x rc %x", cpu_addr,
307 rc);
308
309 return rc;
310}
311
278int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu) 312int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
279{ 313{
280 int r1 = (vcpu->arch.sie_block->ipa & 0x00f0) >> 4; 314 int r1 = (vcpu->arch.sie_block->ipa & 0x00f0) >> 4;
@@ -331,6 +365,11 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
331 rc = __sigp_set_prefix(vcpu, cpu_addr, parameter, 365 rc = __sigp_set_prefix(vcpu, cpu_addr, parameter,
332 &vcpu->arch.guest_gprs[r1]); 366 &vcpu->arch.guest_gprs[r1]);
333 break; 367 break;
368 case SIGP_SENSE_RUNNING:
369 vcpu->stat.instruction_sigp_sense_running++;
370 rc = __sigp_sense_running(vcpu, cpu_addr,
371 &vcpu->arch.guest_gprs[r1]);
372 break;
334 case SIGP_RESTART: 373 case SIGP_RESTART:
335 vcpu->stat.instruction_sigp_restart++; 374 vcpu->stat.instruction_sigp_restart++;
336 /* user space must know about restart */ 375 /* user space must know about restart */
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index f43c0e4282af..9daee91e6c3f 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -22,6 +22,7 @@
22#include <asm/irq.h> 22#include <asm/irq.h>
23 23
24#include "hwsampler.h" 24#include "hwsampler.h"
25#include "op_counter.h"
25 26
26#define MAX_NUM_SDB 511 27#define MAX_NUM_SDB 511
27#define MIN_NUM_SDB 1 28#define MIN_NUM_SDB 1
@@ -896,6 +897,8 @@ static void add_samples_to_oprofile(unsigned int cpu, unsigned long *sdbt,
896 if (sample_data_ptr->P == 1) { 897 if (sample_data_ptr->P == 1) {
897 /* userspace sample */ 898 /* userspace sample */
898 unsigned int pid = sample_data_ptr->prim_asn; 899 unsigned int pid = sample_data_ptr->prim_asn;
900 if (!counter_config.user)
901 goto skip_sample;
899 rcu_read_lock(); 902 rcu_read_lock();
900 tsk = pid_task(find_vpid(pid), PIDTYPE_PID); 903 tsk = pid_task(find_vpid(pid), PIDTYPE_PID);
901 if (tsk) 904 if (tsk)
@@ -903,6 +906,8 @@ static void add_samples_to_oprofile(unsigned int cpu, unsigned long *sdbt,
903 rcu_read_unlock(); 906 rcu_read_unlock();
904 } else { 907 } else {
905 /* kernelspace sample */ 908 /* kernelspace sample */
909 if (!counter_config.kernel)
910 goto skip_sample;
906 regs = task_pt_regs(current); 911 regs = task_pt_regs(current);
907 } 912 }
908 913
@@ -910,7 +915,7 @@ static void add_samples_to_oprofile(unsigned int cpu, unsigned long *sdbt,
910 oprofile_add_ext_hw_sample(sample_data_ptr->ia, regs, 0, 915 oprofile_add_ext_hw_sample(sample_data_ptr->ia, regs, 0,
911 !sample_data_ptr->P, tsk); 916 !sample_data_ptr->P, tsk);
912 mutex_unlock(&hws_sem); 917 mutex_unlock(&hws_sem);
913 918 skip_sample:
914 sample_data_ptr++; 919 sample_data_ptr++;
915 } 920 }
916} 921}
diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c
index 6efc18b5e60a..2297be406c61 100644
--- a/arch/s390/oprofile/init.c
+++ b/arch/s390/oprofile/init.c
@@ -2,10 +2,11 @@
2 * arch/s390/oprofile/init.c 2 * arch/s390/oprofile/init.c
3 * 3 *
4 * S390 Version 4 * S390 Version
5 * Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Copyright (C) 2002-2011 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Thomas Spatzier (tspat@de.ibm.com) 6 * Author(s): Thomas Spatzier (tspat@de.ibm.com)
7 * Author(s): Mahesh Salgaonkar (mahesh@linux.vnet.ibm.com) 7 * Author(s): Mahesh Salgaonkar (mahesh@linux.vnet.ibm.com)
8 * Author(s): Heinz Graalfs (graalfs@linux.vnet.ibm.com) 8 * Author(s): Heinz Graalfs (graalfs@linux.vnet.ibm.com)
9 * Author(s): Andreas Krebbel (krebbel@linux.vnet.ibm.com)
9 * 10 *
10 * @remark Copyright 2002-2011 OProfile authors 11 * @remark Copyright 2002-2011 OProfile authors
11 */ 12 */
@@ -14,6 +15,8 @@
14#include <linux/init.h> 15#include <linux/init.h>
15#include <linux/errno.h> 16#include <linux/errno.h>
16#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/module.h>
19#include <asm/processor.h>
17 20
18#include "../../../drivers/oprofile/oprof.h" 21#include "../../../drivers/oprofile/oprof.h"
19 22
@@ -22,6 +25,7 @@ extern void s390_backtrace(struct pt_regs * const regs, unsigned int depth);
22#ifdef CONFIG_64BIT 25#ifdef CONFIG_64BIT
23 26
24#include "hwsampler.h" 27#include "hwsampler.h"
28#include "op_counter.h"
25 29
26#define DEFAULT_INTERVAL 4127518 30#define DEFAULT_INTERVAL 4127518
27 31
@@ -35,16 +39,41 @@ static unsigned long oprofile_max_interval;
35static unsigned long oprofile_sdbt_blocks = DEFAULT_SDBT_BLOCKS; 39static unsigned long oprofile_sdbt_blocks = DEFAULT_SDBT_BLOCKS;
36static unsigned long oprofile_sdb_blocks = DEFAULT_SDB_BLOCKS; 40static unsigned long oprofile_sdb_blocks = DEFAULT_SDB_BLOCKS;
37 41
38static int hwsampler_file; 42static int hwsampler_enabled;
39static int hwsampler_running; /* start_mutex must be held to change */ 43static int hwsampler_running; /* start_mutex must be held to change */
44static int hwsampler_available;
40 45
41static struct oprofile_operations timer_ops; 46static struct oprofile_operations timer_ops;
42 47
48struct op_counter_config counter_config;
49
50enum __force_cpu_type {
51 reserved = 0, /* do not force */
52 timer,
53};
54static int force_cpu_type;
55
56static int set_cpu_type(const char *str, struct kernel_param *kp)
57{
58 if (!strcmp(str, "timer")) {
59 force_cpu_type = timer;
60 printk(KERN_INFO "oprofile: forcing timer to be returned "
61 "as cpu type\n");
62 } else {
63 force_cpu_type = 0;
64 }
65
66 return 0;
67}
68module_param_call(cpu_type, set_cpu_type, NULL, NULL, 0);
69MODULE_PARM_DESC(cpu_type, "Force legacy basic mode sampling"
70 "(report cpu_type \"timer\"");
71
43static int oprofile_hwsampler_start(void) 72static int oprofile_hwsampler_start(void)
44{ 73{
45 int retval; 74 int retval;
46 75
47 hwsampler_running = hwsampler_file; 76 hwsampler_running = hwsampler_enabled;
48 77
49 if (!hwsampler_running) 78 if (!hwsampler_running)
50 return timer_ops.start(); 79 return timer_ops.start();
@@ -72,10 +101,16 @@ static void oprofile_hwsampler_stop(void)
72 return; 101 return;
73} 102}
74 103
104/*
105 * File ops used for:
106 * /dev/oprofile/0/enabled
107 * /dev/oprofile/hwsampling/hwsampler (cpu_type = timer)
108 */
109
75static ssize_t hwsampler_read(struct file *file, char __user *buf, 110static ssize_t hwsampler_read(struct file *file, char __user *buf,
76 size_t count, loff_t *offset) 111 size_t count, loff_t *offset)
77{ 112{
78 return oprofilefs_ulong_to_user(hwsampler_file, buf, count, offset); 113 return oprofilefs_ulong_to_user(hwsampler_enabled, buf, count, offset);
79} 114}
80 115
81static ssize_t hwsampler_write(struct file *file, char const __user *buf, 116static ssize_t hwsampler_write(struct file *file, char const __user *buf,
@@ -88,9 +123,12 @@ static ssize_t hwsampler_write(struct file *file, char const __user *buf,
88 return -EINVAL; 123 return -EINVAL;
89 124
90 retval = oprofilefs_ulong_from_user(&val, buf, count); 125 retval = oprofilefs_ulong_from_user(&val, buf, count);
91 if (retval) 126 if (retval <= 0)
92 return retval; 127 return retval;
93 128
129 if (val != 0 && val != 1)
130 return -EINVAL;
131
94 if (oprofile_started) 132 if (oprofile_started)
95 /* 133 /*
96 * save to do without locking as we set 134 * save to do without locking as we set
@@ -99,7 +137,7 @@ static ssize_t hwsampler_write(struct file *file, char const __user *buf,
99 */ 137 */
100 return -EBUSY; 138 return -EBUSY;
101 139
102 hwsampler_file = val; 140 hwsampler_enabled = val;
103 141
104 return count; 142 return count;
105} 143}
@@ -109,38 +147,311 @@ static const struct file_operations hwsampler_fops = {
109 .write = hwsampler_write, 147 .write = hwsampler_write,
110}; 148};
111 149
150/*
151 * File ops used for:
152 * /dev/oprofile/0/count
153 * /dev/oprofile/hwsampling/hw_interval (cpu_type = timer)
154 *
155 * Make sure that the value is within the hardware range.
156 */
157
158static ssize_t hw_interval_read(struct file *file, char __user *buf,
159 size_t count, loff_t *offset)
160{
161 return oprofilefs_ulong_to_user(oprofile_hw_interval, buf,
162 count, offset);
163}
164
165static ssize_t hw_interval_write(struct file *file, char const __user *buf,
166 size_t count, loff_t *offset)
167{
168 unsigned long val;
169 int retval;
170
171 if (*offset)
172 return -EINVAL;
173 retval = oprofilefs_ulong_from_user(&val, buf, count);
174 if (retval)
175 return retval;
176 if (val < oprofile_min_interval)
177 oprofile_hw_interval = oprofile_min_interval;
178 else if (val > oprofile_max_interval)
179 oprofile_hw_interval = oprofile_max_interval;
180 else
181 oprofile_hw_interval = val;
182
183 return count;
184}
185
186static const struct file_operations hw_interval_fops = {
187 .read = hw_interval_read,
188 .write = hw_interval_write,
189};
190
191/*
192 * File ops used for:
193 * /dev/oprofile/0/event
194 * Only a single event with number 0 is supported with this counter.
195 *
196 * /dev/oprofile/0/unit_mask
197 * This is a dummy file needed by the user space tools.
198 * No value other than 0 is accepted or returned.
199 */
200
201static ssize_t hwsampler_zero_read(struct file *file, char __user *buf,
202 size_t count, loff_t *offset)
203{
204 return oprofilefs_ulong_to_user(0, buf, count, offset);
205}
206
207static ssize_t hwsampler_zero_write(struct file *file, char const __user *buf,
208 size_t count, loff_t *offset)
209{
210 unsigned long val;
211 int retval;
212
213 if (*offset)
214 return -EINVAL;
215
216 retval = oprofilefs_ulong_from_user(&val, buf, count);
217 if (retval)
218 return retval;
219 if (val != 0)
220 return -EINVAL;
221 return count;
222}
223
224static const struct file_operations zero_fops = {
225 .read = hwsampler_zero_read,
226 .write = hwsampler_zero_write,
227};
228
229/* /dev/oprofile/0/kernel file ops. */
230
231static ssize_t hwsampler_kernel_read(struct file *file, char __user *buf,
232 size_t count, loff_t *offset)
233{
234 return oprofilefs_ulong_to_user(counter_config.kernel,
235 buf, count, offset);
236}
237
238static ssize_t hwsampler_kernel_write(struct file *file, char const __user *buf,
239 size_t count, loff_t *offset)
240{
241 unsigned long val;
242 int retval;
243
244 if (*offset)
245 return -EINVAL;
246
247 retval = oprofilefs_ulong_from_user(&val, buf, count);
248 if (retval)
249 return retval;
250
251 if (val != 0 && val != 1)
252 return -EINVAL;
253
254 counter_config.kernel = val;
255
256 return count;
257}
258
259static const struct file_operations kernel_fops = {
260 .read = hwsampler_kernel_read,
261 .write = hwsampler_kernel_write,
262};
263
264/* /dev/oprofile/0/user file ops. */
265
266static ssize_t hwsampler_user_read(struct file *file, char __user *buf,
267 size_t count, loff_t *offset)
268{
269 return oprofilefs_ulong_to_user(counter_config.user,
270 buf, count, offset);
271}
272
273static ssize_t hwsampler_user_write(struct file *file, char const __user *buf,
274 size_t count, loff_t *offset)
275{
276 unsigned long val;
277 int retval;
278
279 if (*offset)
280 return -EINVAL;
281
282 retval = oprofilefs_ulong_from_user(&val, buf, count);
283 if (retval)
284 return retval;
285
286 if (val != 0 && val != 1)
287 return -EINVAL;
288
289 counter_config.user = val;
290
291 return count;
292}
293
294static const struct file_operations user_fops = {
295 .read = hwsampler_user_read,
296 .write = hwsampler_user_write,
297};
298
299
300/*
301 * File ops used for: /dev/oprofile/timer/enabled
302 * The value always has to be the inverted value of hwsampler_enabled. So
303 * no separate variable is created. That way we do not need locking.
304 */
305
306static ssize_t timer_enabled_read(struct file *file, char __user *buf,
307 size_t count, loff_t *offset)
308{
309 return oprofilefs_ulong_to_user(!hwsampler_enabled, buf, count, offset);
310}
311
312static ssize_t timer_enabled_write(struct file *file, char const __user *buf,
313 size_t count, loff_t *offset)
314{
315 unsigned long val;
316 int retval;
317
318 if (*offset)
319 return -EINVAL;
320
321 retval = oprofilefs_ulong_from_user(&val, buf, count);
322 if (retval)
323 return retval;
324
325 if (val != 0 && val != 1)
326 return -EINVAL;
327
328 /* Timer cannot be disabled without having hardware sampling. */
329 if (val == 0 && !hwsampler_available)
330 return -EINVAL;
331
332 if (oprofile_started)
333 /*
334 * save to do without locking as we set
335 * hwsampler_running in start() when start_mutex is
336 * held
337 */
338 return -EBUSY;
339
340 hwsampler_enabled = !val;
341
342 return count;
343}
344
345static const struct file_operations timer_enabled_fops = {
346 .read = timer_enabled_read,
347 .write = timer_enabled_write,
348};
349
350
112static int oprofile_create_hwsampling_files(struct super_block *sb, 351static int oprofile_create_hwsampling_files(struct super_block *sb,
113 struct dentry *root) 352 struct dentry *root)
114{ 353{
115 struct dentry *hw_dir; 354 struct dentry *dir;
355
356 dir = oprofilefs_mkdir(sb, root, "timer");
357 if (!dir)
358 return -EINVAL;
359
360 oprofilefs_create_file(sb, dir, "enabled", &timer_enabled_fops);
361
362 if (!hwsampler_available)
363 return 0;
116 364
117 /* reinitialize default values */ 365 /* reinitialize default values */
118 hwsampler_file = 1; 366 hwsampler_enabled = 1;
367 counter_config.kernel = 1;
368 counter_config.user = 1;
119 369
120 hw_dir = oprofilefs_mkdir(sb, root, "hwsampling"); 370 if (!force_cpu_type) {
121 if (!hw_dir) 371 /*
122 return -EINVAL; 372 * Create the counter file system. A single virtual
373 * counter is created which can be used to
374 * enable/disable hardware sampling dynamically from
375 * user space. The user space will configure a single
376 * counter with a single event. The value of 'event'
377 * and 'unit_mask' are not evaluated by the kernel code
378 * and can only be set to 0.
379 */
380
381 dir = oprofilefs_mkdir(sb, root, "0");
382 if (!dir)
383 return -EINVAL;
123 384
124 oprofilefs_create_file(sb, hw_dir, "hwsampler", &hwsampler_fops); 385 oprofilefs_create_file(sb, dir, "enabled", &hwsampler_fops);
125 oprofilefs_create_ulong(sb, hw_dir, "hw_interval", 386 oprofilefs_create_file(sb, dir, "event", &zero_fops);
126 &oprofile_hw_interval); 387 oprofilefs_create_file(sb, dir, "count", &hw_interval_fops);
127 oprofilefs_create_ro_ulong(sb, hw_dir, "hw_min_interval", 388 oprofilefs_create_file(sb, dir, "unit_mask", &zero_fops);
128 &oprofile_min_interval); 389 oprofilefs_create_file(sb, dir, "kernel", &kernel_fops);
129 oprofilefs_create_ro_ulong(sb, hw_dir, "hw_max_interval", 390 oprofilefs_create_file(sb, dir, "user", &user_fops);
130 &oprofile_max_interval); 391 oprofilefs_create_ulong(sb, dir, "hw_sdbt_blocks",
131 oprofilefs_create_ulong(sb, hw_dir, "hw_sdbt_blocks", 392 &oprofile_sdbt_blocks);
132 &oprofile_sdbt_blocks);
133 393
394 } else {
395 /*
396 * Hardware sampling can be used but the cpu_type is
397 * forced to timer in order to deal with legacy user
398 * space tools. The /dev/oprofile/hwsampling fs is
399 * provided in that case.
400 */
401 dir = oprofilefs_mkdir(sb, root, "hwsampling");
402 if (!dir)
403 return -EINVAL;
404
405 oprofilefs_create_file(sb, dir, "hwsampler",
406 &hwsampler_fops);
407 oprofilefs_create_file(sb, dir, "hw_interval",
408 &hw_interval_fops);
409 oprofilefs_create_ro_ulong(sb, dir, "hw_min_interval",
410 &oprofile_min_interval);
411 oprofilefs_create_ro_ulong(sb, dir, "hw_max_interval",
412 &oprofile_max_interval);
413 oprofilefs_create_ulong(sb, dir, "hw_sdbt_blocks",
414 &oprofile_sdbt_blocks);
415 }
134 return 0; 416 return 0;
135} 417}
136 418
137static int oprofile_hwsampler_init(struct oprofile_operations *ops) 419static int oprofile_hwsampler_init(struct oprofile_operations *ops)
138{ 420{
421 /*
422 * Initialize the timer mode infrastructure as well in order
423 * to be able to switch back dynamically. oprofile_timer_init
424 * is not supposed to fail.
425 */
426 if (oprofile_timer_init(ops))
427 BUG();
428
429 memcpy(&timer_ops, ops, sizeof(timer_ops));
430 ops->create_files = oprofile_create_hwsampling_files;
431
432 /*
433 * If the user space tools do not support newer cpu types,
434 * the force_cpu_type module parameter
435 * can be used to always return \"timer\" as cpu type.
436 */
437 if (force_cpu_type != timer) {
438 struct cpuid id;
439
440 get_cpu_id (&id);
441
442 switch (id.machine) {
443 case 0x2097: case 0x2098: ops->cpu_type = "s390/z10"; break;
444 case 0x2817: case 0x2818: ops->cpu_type = "s390/z196"; break;
445 default: return -ENODEV;
446 }
447 }
448
139 if (hwsampler_setup()) 449 if (hwsampler_setup())
140 return -ENODEV; 450 return -ENODEV;
141 451
142 /* 452 /*
143 * create hwsampler files only if hwsampler_setup() succeeds. 453 * Query the range for the sampling interval from the
454 * hardware.
144 */ 455 */
145 oprofile_min_interval = hwsampler_query_min_interval(); 456 oprofile_min_interval = hwsampler_query_min_interval();
146 if (oprofile_min_interval == 0) 457 if (oprofile_min_interval == 0)
@@ -155,23 +466,17 @@ static int oprofile_hwsampler_init(struct oprofile_operations *ops)
155 if (oprofile_hw_interval > oprofile_max_interval) 466 if (oprofile_hw_interval > oprofile_max_interval)
156 oprofile_hw_interval = oprofile_max_interval; 467 oprofile_hw_interval = oprofile_max_interval;
157 468
158 if (oprofile_timer_init(ops)) 469 printk(KERN_INFO "oprofile: System z hardware sampling "
159 return -ENODEV; 470 "facility found.\n");
160
161 printk(KERN_INFO "oprofile: using hardware sampling\n");
162
163 memcpy(&timer_ops, ops, sizeof(timer_ops));
164 471
165 ops->start = oprofile_hwsampler_start; 472 ops->start = oprofile_hwsampler_start;
166 ops->stop = oprofile_hwsampler_stop; 473 ops->stop = oprofile_hwsampler_stop;
167 ops->create_files = oprofile_create_hwsampling_files;
168 474
169 return 0; 475 return 0;
170} 476}
171 477
172static void oprofile_hwsampler_exit(void) 478static void oprofile_hwsampler_exit(void)
173{ 479{
174 oprofile_timer_exit();
175 hwsampler_shutdown(); 480 hwsampler_shutdown();
176} 481}
177 482
@@ -182,7 +487,15 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
182 ops->backtrace = s390_backtrace; 487 ops->backtrace = s390_backtrace;
183 488
184#ifdef CONFIG_64BIT 489#ifdef CONFIG_64BIT
185 return oprofile_hwsampler_init(ops); 490
491 /*
492 * -ENODEV is not reported to the caller. The module itself
493 * will use the timer mode sampling as fallback and this is
494 * always available.
495 */
496 hwsampler_available = oprofile_hwsampler_init(ops) == 0;
497
498 return 0;
186#else 499#else
187 return -ENODEV; 500 return -ENODEV;
188#endif 501#endif
diff --git a/arch/s390/oprofile/op_counter.h b/arch/s390/oprofile/op_counter.h
new file mode 100644
index 000000000000..1a8d3ca09014
--- /dev/null
+++ b/arch/s390/oprofile/op_counter.h
@@ -0,0 +1,23 @@
1/**
2 * arch/s390/oprofile/op_counter.h
3 *
4 * Copyright (C) 2011 IBM Deutschland Entwicklung GmbH, IBM Corporation
5 * Author(s): Andreas Krebbel (krebbel@linux.vnet.ibm.com)
6 *
7 * @remark Copyright 2011 OProfile authors
8 */
9
10#ifndef OP_COUNTER_H
11#define OP_COUNTER_H
12
13struct op_counter_config {
14 /* `enabled' maps to the hwsampler_file variable. */
15 /* `count' maps to the oprofile_hw_interval variable. */
16 /* `event' and `unit_mask' are unused. */
17 unsigned long kernel;
18 unsigned long user;
19};
20
21extern struct op_counter_config counter_config;
22
23#endif /* OP_COUNTER_H */
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index df169e84db4e..8b0c9464aa9d 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -4,6 +4,9 @@ config SCORE
4 def_bool y 4 def_bool y
5 select HAVE_GENERIC_HARDIRQS 5 select HAVE_GENERIC_HARDIRQS
6 select GENERIC_IRQ_SHOW 6 select GENERIC_IRQ_SHOW
7 select HAVE_MEMBLOCK
8 select HAVE_MEMBLOCK_NODE_MAP
9 select ARCH_DISCARD_MEMBLOCK
7 10
8choice 11choice
9 prompt "System type" 12 prompt "System type"
@@ -60,9 +63,6 @@ config 32BIT
60config ARCH_FLATMEM_ENABLE 63config ARCH_FLATMEM_ENABLE
61 def_bool y 64 def_bool y
62 65
63config ARCH_POPULATES_NODE_MAP
64 def_bool y
65
66source "mm/Kconfig" 66source "mm/Kconfig"
67 67
68config MEMORY_START 68config MEMORY_START
diff --git a/arch/score/kernel/setup.c b/arch/score/kernel/setup.c
index 6f898c057878..b48459afefdd 100644
--- a/arch/score/kernel/setup.c
+++ b/arch/score/kernel/setup.c
@@ -26,6 +26,7 @@
26#include <linux/bootmem.h> 26#include <linux/bootmem.h>
27#include <linux/initrd.h> 27#include <linux/initrd.h>
28#include <linux/ioport.h> 28#include <linux/ioport.h>
29#include <linux/memblock.h>
29#include <linux/mm.h> 30#include <linux/mm.h>
30#include <linux/seq_file.h> 31#include <linux/seq_file.h>
31#include <linux/screen_info.h> 32#include <linux/screen_info.h>
@@ -54,7 +55,8 @@ static void __init bootmem_init(void)
54 /* Initialize the boot-time allocator with low memory only. */ 55 /* Initialize the boot-time allocator with low memory only. */
55 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, 56 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn,
56 min_low_pfn, max_low_pfn); 57 min_low_pfn, max_low_pfn);
57 add_active_range(0, min_low_pfn, max_low_pfn); 58 memblock_add_node(PFN_PHYS(min_low_pfn),
59 PFN_PHYS(max_low_pfn - min_low_pfn), 0);
58 60
59 free_bootmem(PFN_PHYS(start_pfn), 61 free_bootmem(PFN_PHYS(start_pfn),
60 (max_low_pfn - start_pfn) << PAGE_SHIFT); 62 (max_low_pfn - start_pfn) << PAGE_SHIFT);
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 5629e2099130..47a2f1c2cb0d 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -4,6 +4,7 @@ config SUPERH
4 select CLKDEV_LOOKUP 4 select CLKDEV_LOOKUP
5 select HAVE_IDE if HAS_IOPORT 5 select HAVE_IDE if HAS_IOPORT
6 select HAVE_MEMBLOCK 6 select HAVE_MEMBLOCK
7 select HAVE_MEMBLOCK_NODE_MAP
7 select HAVE_OPROFILE 8 select HAVE_OPROFILE
8 select HAVE_GENERIC_DMA_COHERENT 9 select HAVE_GENERIC_DMA_COHERENT
9 select HAVE_ARCH_TRACEHOOK 10 select HAVE_ARCH_TRACEHOOK
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index ec8c84c14b17..895e337c79b6 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -50,9 +50,9 @@ static struct platform_device heartbeat_device = {
50#define GBECONT 0xffc10100 50#define GBECONT 0xffc10100
51#define GBECONT_RMII1 BIT(17) 51#define GBECONT_RMII1 BIT(17)
52#define GBECONT_RMII0 BIT(16) 52#define GBECONT_RMII0 BIT(16)
53static void sh7757_eth_set_mdio_gate(unsigned long addr) 53static void sh7757_eth_set_mdio_gate(void *addr)
54{ 54{
55 if ((addr & 0x00000fff) < 0x0800) 55 if (((unsigned long)addr & 0x00000fff) < 0x0800)
56 writel(readl(GBECONT) | GBECONT_RMII0, GBECONT); 56 writel(readl(GBECONT) | GBECONT_RMII0, GBECONT);
57 else 57 else
58 writel(readl(GBECONT) | GBECONT_RMII1, GBECONT); 58 writel(readl(GBECONT) | GBECONT_RMII1, GBECONT);
@@ -116,9 +116,9 @@ static struct platform_device sh7757_eth1_device = {
116 }, 116 },
117}; 117};
118 118
119static void sh7757_eth_giga_set_mdio_gate(unsigned long addr) 119static void sh7757_eth_giga_set_mdio_gate(void *addr)
120{ 120{
121 if ((addr & 0x00000fff) < 0x0800) { 121 if (((unsigned long)addr & 0x00000fff) < 0x0800) {
122 gpio_set_value(GPIO_PTT4, 1); 122 gpio_set_value(GPIO_PTT4, 1);
123 writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT); 123 writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT);
124 } else { 124 } else {
@@ -210,8 +210,12 @@ static struct resource sh_mmcif_resources[] = {
210}; 210};
211 211
212static struct sh_mmcif_dma sh7757lcr_mmcif_dma = { 212static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
213 .chan_priv_tx = SHDMA_SLAVE_MMCIF_TX, 213 .chan_priv_tx = {
214 .chan_priv_rx = SHDMA_SLAVE_MMCIF_RX, 214 .slave_id = SHDMA_SLAVE_MMCIF_TX,
215 },
216 .chan_priv_rx = {
217 .slave_id = SHDMA_SLAVE_MMCIF_RX,
218 }
215}; 219};
216 220
217static struct sh_mmcif_plat_data sh_mmcif_plat = { 221static struct sh_mmcif_plat_data sh_mmcif_plat = {
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 83cc704770d7..b1cb2715ad6e 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -12,18 +12,19 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/stat.h> 14#include <linux/stat.h>
15#include <linux/sysdev.h> 15#include <linux/device.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <asm/dma.h> 19#include <asm/dma.h>
20 20
21static struct sysdev_class dma_sysclass = { 21static struct bus_type dma_subsys = {
22 .name = "dma", 22 .name = "dma",
23 .dev_name = "dma",
23}; 24};
24 25
25static ssize_t dma_show_devices(struct sys_device *dev, 26static ssize_t dma_show_devices(struct device *dev,
26 struct sysdev_attribute *attr, char *buf) 27 struct device_attribute *attr, char *buf)
27{ 28{
28 ssize_t len = 0; 29 ssize_t len = 0;
29 int i; 30 int i;
@@ -43,29 +44,29 @@ static ssize_t dma_show_devices(struct sys_device *dev,
43 return len; 44 return len;
44} 45}
45 46
46static SYSDEV_ATTR(devices, S_IRUGO, dma_show_devices, NULL); 47static DEVICE_ATTR(devices, S_IRUGO, dma_show_devices, NULL);
47 48
48static int __init dma_sysclass_init(void) 49static int __init dma_subsys_init(void)
49{ 50{
50 int ret; 51 int ret;
51 52
52 ret = sysdev_class_register(&dma_sysclass); 53 ret = subsys_system_register(&dma_subsys, NULL);
53 if (unlikely(ret)) 54 if (unlikely(ret))
54 return ret; 55 return ret;
55 56
56 return sysfs_create_file(&dma_sysclass.kset.kobj, &attr_devices.attr); 57 return device_create_file(dma_subsys.dev_root, &dev_attr_devices.attr);
57} 58}
58postcore_initcall(dma_sysclass_init); 59postcore_initcall(dma_subsys_init);
59 60
60static ssize_t dma_show_dev_id(struct sys_device *dev, 61static ssize_t dma_show_dev_id(struct device *dev,
61 struct sysdev_attribute *attr, char *buf) 62 struct device_attribute *attr, char *buf)
62{ 63{
63 struct dma_channel *channel = to_dma_channel(dev); 64 struct dma_channel *channel = to_dma_channel(dev);
64 return sprintf(buf, "%s\n", channel->dev_id); 65 return sprintf(buf, "%s\n", channel->dev_id);
65} 66}
66 67
67static ssize_t dma_store_dev_id(struct sys_device *dev, 68static ssize_t dma_store_dev_id(struct device *dev,
68 struct sysdev_attribute *attr, 69 struct device_attribute *attr,
69 const char *buf, size_t count) 70 const char *buf, size_t count)
70{ 71{
71 struct dma_channel *channel = to_dma_channel(dev); 72 struct dma_channel *channel = to_dma_channel(dev);
@@ -73,10 +74,10 @@ static ssize_t dma_store_dev_id(struct sys_device *dev,
73 return count; 74 return count;
74} 75}
75 76
76static SYSDEV_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id); 77static DEVICE_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id);
77 78
78static ssize_t dma_store_config(struct sys_device *dev, 79static ssize_t dma_store_config(struct device *dev,
79 struct sysdev_attribute *attr, 80 struct device_attribute *attr,
80 const char *buf, size_t count) 81 const char *buf, size_t count)
81{ 82{
82 struct dma_channel *channel = to_dma_channel(dev); 83 struct dma_channel *channel = to_dma_channel(dev);
@@ -88,17 +89,17 @@ static ssize_t dma_store_config(struct sys_device *dev,
88 return count; 89 return count;
89} 90}
90 91
91static SYSDEV_ATTR(config, S_IWUSR, NULL, dma_store_config); 92static DEVICE_ATTR(config, S_IWUSR, NULL, dma_store_config);
92 93
93static ssize_t dma_show_mode(struct sys_device *dev, 94static ssize_t dma_show_mode(struct device *dev,
94 struct sysdev_attribute *attr, char *buf) 95 struct device_attribute *attr, char *buf)
95{ 96{
96 struct dma_channel *channel = to_dma_channel(dev); 97 struct dma_channel *channel = to_dma_channel(dev);
97 return sprintf(buf, "0x%08x\n", channel->mode); 98 return sprintf(buf, "0x%08x\n", channel->mode);
98} 99}
99 100
100static ssize_t dma_store_mode(struct sys_device *dev, 101static ssize_t dma_store_mode(struct device *dev,
101 struct sysdev_attribute *attr, 102 struct device_attribute *attr,
102 const char *buf, size_t count) 103 const char *buf, size_t count)
103{ 104{
104 struct dma_channel *channel = to_dma_channel(dev); 105 struct dma_channel *channel = to_dma_channel(dev);
@@ -106,38 +107,38 @@ static ssize_t dma_store_mode(struct sys_device *dev,
106 return count; 107 return count;
107} 108}
108 109
109static SYSDEV_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode); 110static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode);
110 111
111#define dma_ro_attr(field, fmt) \ 112#define dma_ro_attr(field, fmt) \
112static ssize_t dma_show_##field(struct sys_device *dev, \ 113static ssize_t dma_show_##field(struct device *dev, \
113 struct sysdev_attribute *attr, char *buf)\ 114 struct device_attribute *attr, char *buf)\
114{ \ 115{ \
115 struct dma_channel *channel = to_dma_channel(dev); \ 116 struct dma_channel *channel = to_dma_channel(dev); \
116 return sprintf(buf, fmt, channel->field); \ 117 return sprintf(buf, fmt, channel->field); \
117} \ 118} \
118static SYSDEV_ATTR(field, S_IRUGO, dma_show_##field, NULL); 119static DEVICE_ATTR(field, S_IRUGO, dma_show_##field, NULL);
119 120
120dma_ro_attr(count, "0x%08x\n"); 121dma_ro_attr(count, "0x%08x\n");
121dma_ro_attr(flags, "0x%08lx\n"); 122dma_ro_attr(flags, "0x%08lx\n");
122 123
123int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info) 124int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info)
124{ 125{
125 struct sys_device *dev = &chan->dev; 126 struct device *dev = &chan->dev;
126 char name[16]; 127 char name[16];
127 int ret; 128 int ret;
128 129
129 dev->id = chan->vchan; 130 dev->id = chan->vchan;
130 dev->cls = &dma_sysclass; 131 dev->bus = &dma_subsys;
131 132
132 ret = sysdev_register(dev); 133 ret = device_register(dev);
133 if (ret) 134 if (ret)
134 return ret; 135 return ret;
135 136
136 ret |= sysdev_create_file(dev, &attr_dev_id); 137 ret |= device_create_file(dev, &dev_attr_dev_id);
137 ret |= sysdev_create_file(dev, &attr_count); 138 ret |= device_create_file(dev, &dev_attr_count);
138 ret |= sysdev_create_file(dev, &attr_mode); 139 ret |= device_create_file(dev, &dev_attr_mode);
139 ret |= sysdev_create_file(dev, &attr_flags); 140 ret |= device_create_file(dev, &dev_attr_flags);
140 ret |= sysdev_create_file(dev, &attr_config); 141 ret |= device_create_file(dev, &dev_attr_config);
141 142
142 if (unlikely(ret)) { 143 if (unlikely(ret)) {
143 dev_err(&info->pdev->dev, "Failed creating attrs\n"); 144 dev_err(&info->pdev->dev, "Failed creating attrs\n");
@@ -150,17 +151,17 @@ int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info)
150 151
151void dma_remove_sysfs_files(struct dma_channel *chan, struct dma_info *info) 152void dma_remove_sysfs_files(struct dma_channel *chan, struct dma_info *info)
152{ 153{
153 struct sys_device *dev = &chan->dev; 154 struct device *dev = &chan->dev;
154 char name[16]; 155 char name[16];
155 156
156 sysdev_remove_file(dev, &attr_dev_id); 157 device_remove_file(dev, &dev_attr_dev_id);
157 sysdev_remove_file(dev, &attr_count); 158 device_remove_file(dev, &dev_attr_count);
158 sysdev_remove_file(dev, &attr_mode); 159 device_remove_file(dev, &dev_attr_mode);
159 sysdev_remove_file(dev, &attr_flags); 160 device_remove_file(dev, &dev_attr_flags);
160 sysdev_remove_file(dev, &attr_config); 161 device_remove_file(dev, &dev_attr_config);
161 162
162 snprintf(name, sizeof(name), "dma%d", chan->chan); 163 snprintf(name, sizeof(name), "dma%d", chan->chan);
163 sysfs_remove_link(&info->pdev->dev.kobj, name); 164 sysfs_remove_link(&info->pdev->dev.kobj, name);
164 165
165 sysdev_unregister(dev); 166 device_unregister(dev);
166} 167}
diff --git a/arch/sh/include/asm/dma.h b/arch/sh/include/asm/dma.h
index 07373a074090..6aa2080c0065 100644
--- a/arch/sh/include/asm/dma.h
+++ b/arch/sh/include/asm/dma.h
@@ -14,7 +14,7 @@
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/wait.h> 15#include <linux/wait.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <cpu/dma.h> 18#include <cpu/dma.h>
19#include <asm-generic/dma.h> 19#include <asm-generic/dma.h>
20 20
@@ -91,7 +91,7 @@ struct dma_channel {
91 91
92 wait_queue_head_t wait_queue; 92 wait_queue_head_t wait_queue;
93 93
94 struct sys_device dev; 94 struct device dev;
95 void *priv_data; 95 void *priv_data;
96}; 96};
97 97
diff --git a/arch/sh/include/asm/memblock.h b/arch/sh/include/asm/memblock.h
deleted file mode 100644
index e87063fad2ea..000000000000
--- a/arch/sh/include/asm/memblock.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __ASM_SH_MEMBLOCK_H
2#define __ASM_SH_MEMBLOCK_H
3
4#endif /* __ASM_SH_MEMBLOCK_H */
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index ea2d5089de1e..20ee40af16e9 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -122,7 +122,6 @@ extern void init_thread_xstate(void);
122#define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */ 122#define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */
123#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 123#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
124#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 124#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
125#define TIF_FREEZE 19 /* Freezing for suspend */
126 125
127#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 126#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
128#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 127#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -133,7 +132,6 @@ extern void init_thread_xstate(void);
133#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 132#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
134#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) 133#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
135#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 134#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
136#define _TIF_FREEZE (1 << TIF_FREEZE)
137 135
138/* 136/*
139 * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within 2 bytes, or we 137 * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within 2 bytes, or we
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index f0907995b4c9..a8140f0bbf6c 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/cpu.h> 14#include <linux/cpu.h>
15#include <linux/bitmap.h> 15#include <linux/bitmap.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
@@ -337,9 +337,9 @@ static struct kobj_type ktype_percpu_entry = {
337 .default_attrs = sq_sysfs_attrs, 337 .default_attrs = sq_sysfs_attrs,
338}; 338};
339 339
340static int __devinit sq_sysdev_add(struct sys_device *sysdev) 340static int __devinit sq_dev_add(struct device *dev)
341{ 341{
342 unsigned int cpu = sysdev->id; 342 unsigned int cpu = dev->id;
343 struct kobject *kobj; 343 struct kobject *kobj;
344 int error; 344 int error;
345 345
@@ -348,25 +348,27 @@ static int __devinit sq_sysdev_add(struct sys_device *sysdev)
348 return -ENOMEM; 348 return -ENOMEM;
349 349
350 kobj = sq_kobject[cpu]; 350 kobj = sq_kobject[cpu];
351 error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj, 351 error = kobject_init_and_add(kobj, &ktype_percpu_entry, &dev->kobj,
352 "%s", "sq"); 352 "%s", "sq");
353 if (!error) 353 if (!error)
354 kobject_uevent(kobj, KOBJ_ADD); 354 kobject_uevent(kobj, KOBJ_ADD);
355 return error; 355 return error;
356} 356}
357 357
358static int __devexit sq_sysdev_remove(struct sys_device *sysdev) 358static int __devexit sq_dev_remove(struct device *dev)
359{ 359{
360 unsigned int cpu = sysdev->id; 360 unsigned int cpu = dev->id;
361 struct kobject *kobj = sq_kobject[cpu]; 361 struct kobject *kobj = sq_kobject[cpu];
362 362
363 kobject_put(kobj); 363 kobject_put(kobj);
364 return 0; 364 return 0;
365} 365}
366 366
367static struct sysdev_driver sq_sysdev_driver = { 367static struct subsys_interface sq_interface = {
368 .add = sq_sysdev_add, 368 .name = "sq"
369 .remove = __devexit_p(sq_sysdev_remove), 369 .subsys = &cpu_subsys,
370 .add_dev = sq_dev_add,
371 .remove_dev = __devexit_p(sq_dev_remove),
370}; 372};
371 373
372static int __init sq_api_init(void) 374static int __init sq_api_init(void)
@@ -386,7 +388,7 @@ static int __init sq_api_init(void)
386 if (unlikely(!sq_bitmap)) 388 if (unlikely(!sq_bitmap))
387 goto out; 389 goto out;
388 390
389 ret = sysdev_driver_register(&cpu_sysdev_class, &sq_sysdev_driver); 391 ret = subsys_interface_register(&sq_interface);
390 if (unlikely(ret != 0)) 392 if (unlikely(ret != 0))
391 goto out; 393 goto out;
392 394
@@ -401,7 +403,7 @@ out:
401 403
402static void __exit sq_api_exit(void) 404static void __exit sq_api_exit(void)
403{ 405{
404 sysdev_driver_unregister(&cpu_sysdev_class, &sq_sysdev_driver); 406 subsys_interface_unregister(&sq_interface);
405 kfree(sq_bitmap); 407 kfree(sq_bitmap);
406 kmem_cache_destroy(sq_cache); 408 kmem_cache_destroy(sq_cache);
407} 409}
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index db4ecd731a00..406508d4ce74 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -89,7 +89,8 @@ void cpu_idle(void)
89 89
90 /* endless idle loop with no priority at all */ 90 /* endless idle loop with no priority at all */
91 while (1) { 91 while (1) {
92 tick_nohz_stop_sched_tick(1); 92 tick_nohz_idle_enter();
93 rcu_idle_enter();
93 94
94 while (!need_resched()) { 95 while (!need_resched()) {
95 check_pgt_cache(); 96 check_pgt_cache();
@@ -111,7 +112,8 @@ void cpu_idle(void)
111 start_critical_timings(); 112 start_critical_timings();
112 } 113 }
113 114
114 tick_nohz_restart_sched_tick(); 115 rcu_idle_exit();
116 tick_nohz_idle_exit();
115 preempt_enable_no_resched(); 117 preempt_enable_no_resched();
116 schedule(); 118 schedule();
117 preempt_disable(); 119 preempt_disable();
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index c5a33f007f88..9fea49f6e667 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -157,9 +157,6 @@ void __init reserve_crashkernel(void)
157 unsigned long long crash_size, crash_base; 157 unsigned long long crash_size, crash_base;
158 int ret; 158 int ret;
159 159
160 /* this is necessary because of memblock_phys_mem_size() */
161 memblock_analyze();
162
163 ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), 160 ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
164 &crash_size, &crash_base); 161 &crash_size, &crash_base);
165 if (ret == 0 && crash_size > 0) { 162 if (ret == 0 && crash_size > 0) {
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 1a0e946679a4..7b57bf1dc855 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -230,7 +230,8 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
230 pmb_bolt_mapping((unsigned long)__va(start), start, end - start, 230 pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
231 PAGE_KERNEL); 231 PAGE_KERNEL);
232 232
233 add_active_range(nid, start_pfn, end_pfn); 233 memblock_set_node(PFN_PHYS(start_pfn),
234 PFN_PHYS(end_pfn - start_pfn), nid);
234} 235}
235 236
236void __init __weak plat_early_device_setup(void) 237void __init __weak plat_early_device_setup(void)
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index c3e61b366493..cb8f9920f4dd 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -143,9 +143,6 @@ config MAX_ACTIVE_REGIONS
143 CPU_SUBTYPE_SH7785) 143 CPU_SUBTYPE_SH7785)
144 default "1" 144 default "1"
145 145
146config ARCH_POPULATES_NODE_MAP
147 def_bool y
148
149config ARCH_SELECT_MEMORY_MODEL 146config ARCH_SELECT_MEMORY_MODEL
150 def_bool y 147 def_bool y
151 148
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 939ca0f356f6..82cc576fab15 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -324,7 +324,6 @@ void __init paging_init(void)
324 unsigned long vaddr, end; 324 unsigned long vaddr, end;
325 int nid; 325 int nid;
326 326
327 memblock_init();
328 sh_mv.mv_mem_init(); 327 sh_mv.mv_mem_init();
329 328
330 early_reserve_mem(); 329 early_reserve_mem();
@@ -337,7 +336,7 @@ void __init paging_init(void)
337 sh_mv.mv_mem_reserve(); 336 sh_mv.mv_mem_reserve();
338 337
339 memblock_enforce_memory_limit(memory_limit); 338 memblock_enforce_memory_limit(memory_limit);
340 memblock_analyze(); 339 memblock_allow_resize();
341 340
342 memblock_dump_all(); 341 memblock_dump_all();
343 342
diff --git a/arch/sh/oprofile/common.c b/arch/sh/oprofile/common.c
index b4c2d2b946dd..e4dd5d5a1115 100644
--- a/arch/sh/oprofile/common.c
+++ b/arch/sh/oprofile/common.c
@@ -49,7 +49,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
49 return oprofile_perf_init(ops); 49 return oprofile_perf_init(ops);
50} 50}
51 51
52void __exit oprofile_arch_exit(void) 52void oprofile_arch_exit(void)
53{ 53{
54 oprofile_perf_exit(); 54 oprofile_perf_exit();
55 kfree(sh_pmu_op_name); 55 kfree(sh_pmu_op_name);
@@ -60,5 +60,5 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
60 ops->backtrace = sh_backtrace; 60 ops->backtrace = sh_backtrace;
61 return -ENODEV; 61 return -ENODEV;
62} 62}
63void __exit oprofile_arch_exit(void) {} 63void oprofile_arch_exit(void) {}
64#endif /* CONFIG_HW_PERF_EVENTS */ 64#endif /* CONFIG_HW_PERF_EVENTS */
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index f92602e86607..70ae9d81870e 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -43,6 +43,7 @@ config SPARC64
43 select HAVE_KPROBES 43 select HAVE_KPROBES
44 select HAVE_RCU_TABLE_FREE if SMP 44 select HAVE_RCU_TABLE_FREE if SMP
45 select HAVE_MEMBLOCK 45 select HAVE_MEMBLOCK
46 select HAVE_MEMBLOCK_NODE_MAP
46 select HAVE_SYSCALL_WRAPPERS 47 select HAVE_SYSCALL_WRAPPERS
47 select HAVE_DYNAMIC_FTRACE 48 select HAVE_DYNAMIC_FTRACE
48 select HAVE_FTRACE_MCOUNT_RECORD 49 select HAVE_FTRACE_MCOUNT_RECORD
@@ -352,9 +353,6 @@ config NODES_SPAN_OTHER_NODES
352 def_bool y 353 def_bool y
353 depends on NEED_MULTIPLE_NODES 354 depends on NEED_MULTIPLE_NODES
354 355
355config ARCH_POPULATES_NODE_MAP
356 def_bool y if SPARC64
357
358config ARCH_SELECT_MEMORY_MODEL 356config ARCH_SELECT_MEMORY_MODEL
359 def_bool y if SPARC64 357 def_bool y if SPARC64
360 358
diff --git a/arch/sparc/include/asm/memblock.h b/arch/sparc/include/asm/memblock.h
deleted file mode 100644
index c67b047ef85e..000000000000
--- a/arch/sparc/include/asm/memblock.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _SPARC64_MEMBLOCK_H
2#define _SPARC64_MEMBLOCK_H
3
4#include <asm/oplib.h>
5
6#define MEMBLOCK_DBG(fmt...) prom_printf(fmt)
7
8#endif /* !(_SPARC64_MEMBLOCK_H) */
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index 5b31a8e89823..a790cc657476 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -431,10 +431,6 @@ extern unsigned long *sparc_valid_addr_bitmap;
431#define kern_addr_valid(addr) \ 431#define kern_addr_valid(addr) \
432 (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap)) 432 (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
433 433
434extern int io_remap_pfn_range(struct vm_area_struct *vma,
435 unsigned long from, unsigned long pfn,
436 unsigned long size, pgprot_t prot);
437
438/* 434/*
439 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in 435 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
440 * its high 4 bits. These macros/functions put it there or get it from there. 436 * its high 4 bits. These macros/functions put it there or get it from there.
@@ -443,6 +439,22 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma,
443#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) 439#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4))
444#define GET_PFN(pfn) (pfn & 0x0fffffffUL) 440#define GET_PFN(pfn) (pfn & 0x0fffffffUL)
445 441
442extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
443 unsigned long, pgprot_t);
444
445static inline int io_remap_pfn_range(struct vm_area_struct *vma,
446 unsigned long from, unsigned long pfn,
447 unsigned long size, pgprot_t prot)
448{
449 unsigned long long offset, space, phys_base;
450
451 offset = ((unsigned long long) GET_PFN(pfn)) << PAGE_SHIFT;
452 space = GET_IOSPACE(pfn);
453 phys_base = offset | (space << 32ULL);
454
455 return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
456}
457
446#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 458#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
447#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ 459#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
448({ \ 460({ \
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index adf89329af59..38ebb2c60137 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -757,10 +757,6 @@ static inline bool kern_addr_valid(unsigned long addr)
757 757
758extern int page_in_phys_avail(unsigned long paddr); 758extern int page_in_phys_avail(unsigned long paddr);
759 759
760extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
761 unsigned long pfn,
762 unsigned long size, pgprot_t prot);
763
764/* 760/*
765 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in 761 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
766 * its high 4 bits. These macros/functions put it there or get it from there. 762 * its high 4 bits. These macros/functions put it there or get it from there.
@@ -769,6 +765,22 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
769#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) 765#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4))
770#define GET_PFN(pfn) (pfn & 0x0fffffffffffffffUL) 766#define GET_PFN(pfn) (pfn & 0x0fffffffffffffffUL)
771 767
768extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
769 unsigned long, pgprot_t);
770
771static inline int io_remap_pfn_range(struct vm_area_struct *vma,
772 unsigned long from, unsigned long pfn,
773 unsigned long size, pgprot_t prot)
774{
775 unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
776 int space = GET_IOSPACE(pfn);
777 unsigned long phys_base;
778
779 phys_base = offset | (((unsigned long) space) << 32UL);
780
781 return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
782}
783
772#include <asm-generic/pgtable.h> 784#include <asm-generic/pgtable.h>
773 785
774/* We provide our own get_unmapped_area to cope with VA holes and 786/* We provide our own get_unmapped_area to cope with VA holes and
diff --git a/arch/sparc/include/asm/posix_types.h b/arch/sparc/include/asm/posix_types.h
index 98d6ebb922fb..dbfc1a34b3a2 100644
--- a/arch/sparc/include/asm/posix_types.h
+++ b/arch/sparc/include/asm/posix_types.h
@@ -20,7 +20,6 @@ typedef unsigned int __kernel_uid_t;
20typedef unsigned int __kernel_gid_t; 20typedef unsigned int __kernel_gid_t;
21typedef unsigned long __kernel_ino_t; 21typedef unsigned long __kernel_ino_t;
22typedef unsigned int __kernel_mode_t; 22typedef unsigned int __kernel_mode_t;
23typedef unsigned short __kernel_umode_t;
24typedef unsigned int __kernel_nlink_t; 23typedef unsigned int __kernel_nlink_t;
25typedef int __kernel_daddr_t; 24typedef int __kernel_daddr_t;
26typedef long __kernel_off_t; 25typedef long __kernel_off_t;
@@ -55,7 +54,6 @@ typedef unsigned short __kernel_uid_t;
55typedef unsigned short __kernel_gid_t; 54typedef unsigned short __kernel_gid_t;
56typedef unsigned long __kernel_ino_t; 55typedef unsigned long __kernel_ino_t;
57typedef unsigned short __kernel_mode_t; 56typedef unsigned short __kernel_mode_t;
58typedef unsigned short __kernel_umode_t;
59typedef short __kernel_nlink_t; 57typedef short __kernel_nlink_t;
60typedef long __kernel_daddr_t; 58typedef long __kernel_daddr_t;
61typedef long __kernel_off_t; 59typedef long __kernel_off_t;
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h
index 9d3fefcff2f5..8af1b64168b3 100644
--- a/arch/sparc/include/asm/socket.h
+++ b/arch/sparc/include/asm/socket.h
@@ -58,6 +58,9 @@
58 58
59#define SO_RXQ_OVFL 0x0024 59#define SO_RXQ_OVFL 0x0024
60 60
61#define SO_WIFI_STATUS 0x0025
62#define SCM_WIFI_STATUS SO_WIFI_STATUS
63
61/* Security levels - as per NRL IPv6 - don't actually do anything */ 64/* Security levels - as per NRL IPv6 - don't actually do anything */
62#define SO_SECURITY_AUTHENTICATION 0x5001 65#define SO_SECURITY_AUTHENTICATION 0x5001
63#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 66#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index fa5753233410..5cc5888ad5a3 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -133,7 +133,6 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *)
133#define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling 133#define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
134 * TIF_NEED_RESCHED */ 134 * TIF_NEED_RESCHED */
135#define TIF_MEMDIE 10 /* is terminating due to OOM killer */ 135#define TIF_MEMDIE 10 /* is terminating due to OOM killer */
136#define TIF_FREEZE 11 /* is freezing for suspend */
137 136
138/* as above, but as bit values */ 137/* as above, but as bit values */
139#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 138#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -147,7 +146,6 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *)
147#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \ 146#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
148 _TIF_SIGPENDING | \ 147 _TIF_SIGPENDING | \
149 _TIF_RESTORE_SIGMASK) 148 _TIF_RESTORE_SIGMASK)
150#define _TIF_FREEZE (1<<TIF_FREEZE)
151 149
152#endif /* __KERNEL__ */ 150#endif /* __KERNEL__ */
153 151
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index 60d86be1a533..01d057fe6a3f 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -225,7 +225,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
225/* flag bit 12 is available */ 225/* flag bit 12 is available */
226#define TIF_MEMDIE 13 /* is terminating due to OOM killer */ 226#define TIF_MEMDIE 13 /* is terminating due to OOM killer */
227#define TIF_POLLING_NRFLAG 14 227#define TIF_POLLING_NRFLAG 14
228#define TIF_FREEZE 15 /* is freezing for suspend */
229 228
230#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 229#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
231#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 230#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -237,7 +236,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
237#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 236#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
238#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) 237#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
239#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 238#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
240#define _TIF_FREEZE (1<<TIF_FREEZE)
241 239
242#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \ 240#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
243 _TIF_DO_NOTIFY_RESUME_MASK | \ 241 _TIF_DO_NOTIFY_RESUME_MASK | \
diff --git a/arch/sparc/include/asm/types.h b/arch/sparc/include/asm/types.h
index 91e5a034f987..383d156cde9c 100644
--- a/arch/sparc/include/asm/types.h
+++ b/arch/sparc/include/asm/types.h
@@ -12,12 +12,6 @@
12 12
13#include <asm-generic/int-ll64.h> 13#include <asm-generic/int-ll64.h>
14 14
15#ifndef __ASSEMBLY__
16
17typedef unsigned short umode_t;
18
19#endif /* __ASSEMBLY__ */
20
21#endif /* defined(__sparc__) */ 15#endif /* defined(__sparc__) */
22 16
23#endif /* defined(_SPARC_TYPES_H) */ 17#endif /* defined(_SPARC_TYPES_H) */
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
index 7429b47c3aca..381edcd5bc29 100644
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -1181,13 +1181,11 @@ static int __devinit ds_probe(struct vio_dev *vdev,
1181 1181
1182 dp->rcv_buf_len = 4096; 1182 dp->rcv_buf_len = 4096;
1183 1183
1184 dp->ds_states = kzalloc(sizeof(ds_states_template), 1184 dp->ds_states = kmemdup(ds_states_template,
1185 GFP_KERNEL); 1185 sizeof(ds_states_template), GFP_KERNEL);
1186 if (!dp->ds_states) 1186 if (!dp->ds_states)
1187 goto out_free_rcv_buf; 1187 goto out_free_rcv_buf;
1188 1188
1189 memcpy(dp->ds_states, ds_states_template,
1190 sizeof(ds_states_template));
1191 dp->num_ds_states = ARRAY_SIZE(ds_states_template); 1189 dp->num_ds_states = ARRAY_SIZE(ds_states_template);
1192 1190
1193 for (i = 0; i < dp->num_ds_states; i++) 1191 for (i = 0; i < dp->num_ds_states; i++)
diff --git a/arch/sparc/kernel/entry.h b/arch/sparc/kernel/entry.h
index e27f8ea8656e..0c218e4c0881 100644
--- a/arch/sparc/kernel/entry.h
+++ b/arch/sparc/kernel/entry.h
@@ -42,6 +42,9 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
42extern void fpload(unsigned long *fpregs, unsigned long *fsr); 42extern void fpload(unsigned long *fpregs, unsigned long *fsr);
43 43
44#else /* CONFIG_SPARC32 */ 44#else /* CONFIG_SPARC32 */
45
46#include <asm/trap_block.h>
47
45struct popc_3insn_patch_entry { 48struct popc_3insn_patch_entry {
46 unsigned int addr; 49 unsigned int addr;
47 unsigned int insns[3]; 50 unsigned int insns[3];
@@ -57,6 +60,10 @@ extern struct popc_6insn_patch_entry __popc_6insn_patch,
57 __popc_6insn_patch_end; 60 __popc_6insn_patch_end;
58 61
59extern void __init per_cpu_patch(void); 62extern void __init per_cpu_patch(void);
63extern void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *,
64 struct sun4v_1insn_patch_entry *);
65extern void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *,
66 struct sun4v_2insn_patch_entry *);
60extern void __init sun4v_patch(void); 67extern void __init sun4v_patch(void);
61extern void __init boot_cpu_id_too_large(int cpu); 68extern void __init boot_cpu_id_too_large(int cpu);
62extern unsigned int dcache_parity_tl1_occurred; 69extern unsigned int dcache_parity_tl1_occurred;
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index da0c6c70ccb2..e5519870c3d9 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -17,6 +17,8 @@
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/spitfire.h> 18#include <asm/spitfire.h>
19 19
20#include "entry.h"
21
20#ifdef CONFIG_SPARC64 22#ifdef CONFIG_SPARC64
21 23
22#include <linux/jump_label.h> 24#include <linux/jump_label.h>
@@ -203,6 +205,29 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
203} 205}
204 206
205#ifdef CONFIG_SPARC64 207#ifdef CONFIG_SPARC64
208static void do_patch_sections(const Elf_Ehdr *hdr,
209 const Elf_Shdr *sechdrs)
210{
211 const Elf_Shdr *s, *sun4v_1insn = NULL, *sun4v_2insn = NULL;
212 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
213
214 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
215 if (!strcmp(".sun4v_1insn_patch", secstrings + s->sh_name))
216 sun4v_1insn = s;
217 if (!strcmp(".sun4v_2insn_patch", secstrings + s->sh_name))
218 sun4v_2insn = s;
219 }
220
221 if (sun4v_1insn && tlb_type == hypervisor) {
222 void *p = (void *) sun4v_1insn->sh_addr;
223 sun4v_patch_1insn_range(p, p + sun4v_1insn->sh_size);
224 }
225 if (sun4v_2insn && tlb_type == hypervisor) {
226 void *p = (void *) sun4v_2insn->sh_addr;
227 sun4v_patch_2insn_range(p, p + sun4v_2insn->sh_size);
228 }
229}
230
206int module_finalize(const Elf_Ehdr *hdr, 231int module_finalize(const Elf_Ehdr *hdr,
207 const Elf_Shdr *sechdrs, 232 const Elf_Shdr *sechdrs,
208 struct module *me) 233 struct module *me)
@@ -210,6 +235,8 @@ int module_finalize(const Elf_Ehdr *hdr,
210 /* make jump label nops */ 235 /* make jump label nops */
211 jump_label_apply_nops(me); 236 jump_label_apply_nops(me);
212 237
238 do_patch_sections(hdr, sechdrs);
239
213 /* Cheetah's I-cache is fully coherent. */ 240 /* Cheetah's I-cache is fully coherent. */
214 if (tlb_type == spitfire) { 241 if (tlb_type == spitfire) {
215 unsigned long va; 242 unsigned long va;
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index b272cda35a01..af5755d20fbe 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -849,10 +849,10 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm,
849 if (!irq) 849 if (!irq)
850 return -ENOMEM; 850 return -ENOMEM;
851 851
852 if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE))
853 return -EINVAL;
854 if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID)) 852 if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID))
855 return -EINVAL; 853 return -EINVAL;
854 if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE))
855 return -EINVAL;
856 856
857 return irq; 857 return irq;
858} 858}
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index 3739a06a76cb..39d8b05201a2 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -95,12 +95,14 @@ void cpu_idle(void)
95 set_thread_flag(TIF_POLLING_NRFLAG); 95 set_thread_flag(TIF_POLLING_NRFLAG);
96 96
97 while(1) { 97 while(1) {
98 tick_nohz_stop_sched_tick(1); 98 tick_nohz_idle_enter();
99 rcu_idle_enter();
99 100
100 while (!need_resched() && !cpu_is_offline(cpu)) 101 while (!need_resched() && !cpu_is_offline(cpu))
101 sparc64_yield(cpu); 102 sparc64_yield(cpu);
102 103
103 tick_nohz_restart_sched_tick(); 104 rcu_idle_exit();
105 tick_nohz_idle_exit();
104 106
105 preempt_enable_no_resched(); 107 preempt_enable_no_resched();
106 108
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index 46614807a57f..741df916c124 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -58,12 +58,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
58 void *new_val; 58 void *new_val;
59 int err; 59 int err;
60 60
61 new_val = kmalloc(len, GFP_KERNEL); 61 new_val = kmemdup(val, len, GFP_KERNEL);
62 if (!new_val) 62 if (!new_val)
63 return -ENOMEM; 63 return -ENOMEM;
64 64
65 memcpy(new_val, val, len);
66
67 err = -ENODEV; 65 err = -ENODEV;
68 66
69 mutex_lock(&of_set_property_mutex); 67 mutex_lock(&of_set_property_mutex);
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index fe1e3fc31bc5..ffb883ddd0f0 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -84,7 +84,7 @@ static void prom_sync_me(void)
84 84
85 prom_printf("PROM SYNC COMMAND...\n"); 85 prom_printf("PROM SYNC COMMAND...\n");
86 show_free_areas(0); 86 show_free_areas(0);
87 if(current->pid != 0) { 87 if (!is_idle_task(current)) {
88 local_irq_enable(); 88 local_irq_enable();
89 sys_sync(); 89 sys_sync();
90 local_irq_disable(); 90 local_irq_disable();
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index c965595aa7e9..a854a1c240ff 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -234,40 +234,50 @@ void __init per_cpu_patch(void)
234 } 234 }
235} 235}
236 236
237void __init sun4v_patch(void) 237void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *start,
238 struct sun4v_1insn_patch_entry *end)
238{ 239{
239 extern void sun4v_hvapi_init(void); 240 while (start < end) {
240 struct sun4v_1insn_patch_entry *p1; 241 unsigned long addr = start->addr;
241 struct sun4v_2insn_patch_entry *p2;
242
243 if (tlb_type != hypervisor)
244 return;
245 242
246 p1 = &__sun4v_1insn_patch; 243 *(unsigned int *) (addr + 0) = start->insn;
247 while (p1 < &__sun4v_1insn_patch_end) {
248 unsigned long addr = p1->addr;
249
250 *(unsigned int *) (addr + 0) = p1->insn;
251 wmb(); 244 wmb();
252 __asm__ __volatile__("flush %0" : : "r" (addr + 0)); 245 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
253 246
254 p1++; 247 start++;
255 } 248 }
249}
256 250
257 p2 = &__sun4v_2insn_patch; 251void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *start,
258 while (p2 < &__sun4v_2insn_patch_end) { 252 struct sun4v_2insn_patch_entry *end)
259 unsigned long addr = p2->addr; 253{
254 while (start < end) {
255 unsigned long addr = start->addr;
260 256
261 *(unsigned int *) (addr + 0) = p2->insns[0]; 257 *(unsigned int *) (addr + 0) = start->insns[0];
262 wmb(); 258 wmb();
263 __asm__ __volatile__("flush %0" : : "r" (addr + 0)); 259 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
264 260
265 *(unsigned int *) (addr + 4) = p2->insns[1]; 261 *(unsigned int *) (addr + 4) = start->insns[1];
266 wmb(); 262 wmb();
267 __asm__ __volatile__("flush %0" : : "r" (addr + 4)); 263 __asm__ __volatile__("flush %0" : : "r" (addr + 4));
268 264
269 p2++; 265 start++;
270 } 266 }
267}
268
269void __init sun4v_patch(void)
270{
271 extern void sun4v_hvapi_init(void);
272
273 if (tlb_type != hypervisor)
274 return;
275
276 sun4v_patch_1insn_range(&__sun4v_1insn_patch,
277 &__sun4v_1insn_patch_end);
278
279 sun4v_patch_2insn_range(&__sun4v_2insn_patch,
280 &__sun4v_2insn_patch_end);
271 281
272 sun4v_hvapi_init(); 282 sun4v_hvapi_init();
273} 283}
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
index 2caa556db86d..023b8860dc97 100644
--- a/arch/sparc/kernel/signal32.c
+++ b/arch/sparc/kernel/signal32.c
@@ -822,21 +822,23 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs
822 * want to handle. Thus you cannot kill init even with a SIGKILL even by 822 * want to handle. Thus you cannot kill init even with a SIGKILL even by
823 * mistake. 823 * mistake.
824 */ 824 */
825void do_signal32(sigset_t *oldset, struct pt_regs * regs, 825void do_signal32(sigset_t *oldset, struct pt_regs * regs)
826 int restart_syscall, unsigned long orig_i0)
827{ 826{
828 struct k_sigaction ka; 827 struct k_sigaction ka;
828 unsigned long orig_i0;
829 int restart_syscall;
829 siginfo_t info; 830 siginfo_t info;
830 int signr; 831 int signr;
831 832
832 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 833 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
833 834
834 /* If the debugger messes with the program counter, it clears 835 restart_syscall = 0;
835 * the "in syscall" bit, directing us to not perform a syscall 836 orig_i0 = 0;
836 * restart. 837 if (pt_regs_is_syscall(regs) &&
837 */ 838 (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) {
838 if (restart_syscall && !pt_regs_is_syscall(regs)) 839 restart_syscall = 1;
839 restart_syscall = 0; 840 orig_i0 = regs->u_regs[UREG_G6];
841 }
840 842
841 if (signr > 0) { 843 if (signr > 0) {
842 if (restart_syscall) 844 if (restart_syscall)
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
index 8ce247ac04cc..d54c6e53aba0 100644
--- a/arch/sparc/kernel/signal_32.c
+++ b/arch/sparc/kernel/signal_32.c
@@ -519,10 +519,26 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
519 siginfo_t info; 519 siginfo_t info;
520 int signr; 520 int signr;
521 521
522 /* It's a lot of work and synchronization to add a new ptrace
523 * register for GDB to save and restore in order to get
524 * orig_i0 correct for syscall restarts when debugging.
525 *
526 * Although it should be the case that most of the global
527 * registers are volatile across a system call, glibc already
528 * depends upon that fact that we preserve them. So we can't
529 * just use any global register to save away the orig_i0 value.
530 *
531 * In particular %g2, %g3, %g4, and %g5 are all assumed to be
532 * preserved across a system call trap by various pieces of
533 * code in glibc.
534 *
535 * %g7 is used as the "thread register". %g6 is not used in
536 * any fixed manner. %g6 is used as a scratch register and
537 * a compiler temporary, but it's value is never used across
538 * a system call. Therefore %g6 is usable for orig_i0 storage.
539 */
522 if (pt_regs_is_syscall(regs) && (regs->psr & PSR_C)) 540 if (pt_regs_is_syscall(regs) && (regs->psr & PSR_C))
523 restart_syscall = 1; 541 regs->u_regs[UREG_G6] = orig_i0;
524 else
525 restart_syscall = 0;
526 542
527 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 543 if (test_thread_flag(TIF_RESTORE_SIGMASK))
528 oldset = &current->saved_sigmask; 544 oldset = &current->saved_sigmask;
@@ -535,8 +551,12 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
535 * the software "in syscall" bit, directing us to not perform 551 * the software "in syscall" bit, directing us to not perform
536 * a syscall restart. 552 * a syscall restart.
537 */ 553 */
538 if (restart_syscall && !pt_regs_is_syscall(regs)) 554 restart_syscall = 0;
539 restart_syscall = 0; 555 if (pt_regs_is_syscall(regs) && (regs->psr & PSR_C)) {
556 restart_syscall = 1;
557 orig_i0 = regs->u_regs[UREG_G6];
558 }
559
540 560
541 if (signr > 0) { 561 if (signr > 0) {
542 if (restart_syscall) 562 if (restart_syscall)
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index a2b81598d905..f0836cd0e2f2 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -529,11 +529,27 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
529 siginfo_t info; 529 siginfo_t info;
530 int signr; 530 int signr;
531 531
532 /* It's a lot of work and synchronization to add a new ptrace
533 * register for GDB to save and restore in order to get
534 * orig_i0 correct for syscall restarts when debugging.
535 *
536 * Although it should be the case that most of the global
537 * registers are volatile across a system call, glibc already
538 * depends upon that fact that we preserve them. So we can't
539 * just use any global register to save away the orig_i0 value.
540 *
541 * In particular %g2, %g3, %g4, and %g5 are all assumed to be
542 * preserved across a system call trap by various pieces of
543 * code in glibc.
544 *
545 * %g7 is used as the "thread register". %g6 is not used in
546 * any fixed manner. %g6 is used as a scratch register and
547 * a compiler temporary, but it's value is never used across
548 * a system call. Therefore %g6 is usable for orig_i0 storage.
549 */
532 if (pt_regs_is_syscall(regs) && 550 if (pt_regs_is_syscall(regs) &&
533 (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) { 551 (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY)))
534 restart_syscall = 1; 552 regs->u_regs[UREG_G6] = orig_i0;
535 } else
536 restart_syscall = 0;
537 553
538 if (current_thread_info()->status & TS_RESTORE_SIGMASK) 554 if (current_thread_info()->status & TS_RESTORE_SIGMASK)
539 oldset = &current->saved_sigmask; 555 oldset = &current->saved_sigmask;
@@ -542,22 +558,20 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
542 558
543#ifdef CONFIG_COMPAT 559#ifdef CONFIG_COMPAT
544 if (test_thread_flag(TIF_32BIT)) { 560 if (test_thread_flag(TIF_32BIT)) {
545 extern void do_signal32(sigset_t *, struct pt_regs *, 561 extern void do_signal32(sigset_t *, struct pt_regs *);
546 int restart_syscall, 562 do_signal32(oldset, regs);
547 unsigned long orig_i0);
548 do_signal32(oldset, regs, restart_syscall, orig_i0);
549 return; 563 return;
550 } 564 }
551#endif 565#endif
552 566
553 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 567 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
554 568
555 /* If the debugger messes with the program counter, it clears 569 restart_syscall = 0;
556 * the software "in syscall" bit, directing us to not perform 570 if (pt_regs_is_syscall(regs) &&
557 * a syscall restart. 571 (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) {
558 */ 572 restart_syscall = 1;
559 if (restart_syscall && !pt_regs_is_syscall(regs)) 573 orig_i0 = regs->u_regs[UREG_G6];
560 restart_syscall = 0; 574 }
561 575
562 if (signr > 0) { 576 if (signr > 0) {
563 if (restart_syscall) 577 if (restart_syscall)
diff --git a/arch/sparc/kernel/sigutil_64.c b/arch/sparc/kernel/sigutil_64.c
index e7dc508c38eb..b19570d41a39 100644
--- a/arch/sparc/kernel/sigutil_64.c
+++ b/arch/sparc/kernel/sigutil_64.c
@@ -2,6 +2,7 @@
2#include <linux/types.h> 2#include <linux/types.h>
3#include <linux/thread_info.h> 3#include <linux/thread_info.h>
4#include <linux/uaccess.h> 4#include <linux/uaccess.h>
5#include <linux/errno.h>
5 6
6#include <asm/sigcontext.h> 7#include <asm/sigcontext.h>
7#include <asm/fpumacro.h> 8#include <asm/fpumacro.h>
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 75607724d290..3b1bd7c50164 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -840,7 +840,7 @@ static void tsb_sync(void *info)
840 struct trap_per_cpu *tp = &trap_block[raw_smp_processor_id()]; 840 struct trap_per_cpu *tp = &trap_block[raw_smp_processor_id()];
841 struct mm_struct *mm = info; 841 struct mm_struct *mm = info;
842 842
843 /* It is not valid to test "currrent->active_mm == mm" here. 843 /* It is not valid to test "current->active_mm == mm" here.
844 * 844 *
845 * The value of "current" is not changed atomically with 845 * The value of "current" is not changed atomically with
846 * switch_mm(). But that's OK, we just need to check the 846 * switch_mm(). But that's OK, we just need to check the
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 441521ad8a3f..232df9949530 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -368,11 +368,11 @@ static unsigned long mmap_rnd(void)
368 if (current->flags & PF_RANDOMIZE) { 368 if (current->flags & PF_RANDOMIZE) {
369 unsigned long val = get_random_int(); 369 unsigned long val = get_random_int();
370 if (test_thread_flag(TIF_32BIT)) 370 if (test_thread_flag(TIF_32BIT))
371 rnd = (val % (1UL << (22UL-PAGE_SHIFT))); 371 rnd = (val % (1UL << (23UL-PAGE_SHIFT)));
372 else 372 else
373 rnd = (val % (1UL << (29UL-PAGE_SHIFT))); 373 rnd = (val % (1UL << (30UL-PAGE_SHIFT)));
374 } 374 }
375 return (rnd << PAGE_SHIFT) * 2; 375 return rnd << PAGE_SHIFT;
376} 376}
377 377
378void arch_pick_mmap_layout(struct mm_struct *mm) 378void arch_pick_mmap_layout(struct mm_struct *mm)
diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c
index 7408201d7efb..654e8aad3bbe 100644
--- a/arch/sparc/kernel/sysfs.c
+++ b/arch/sparc/kernel/sysfs.c
@@ -3,7 +3,7 @@
3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net> 3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
4 */ 4 */
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/sysdev.h> 6#include <linux/device.h>
7#include <linux/cpu.h> 7#include <linux/cpu.h>
8#include <linux/smp.h> 8#include <linux/smp.h>
9#include <linux/percpu.h> 9#include <linux/percpu.h>
@@ -16,13 +16,13 @@
16static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64))); 16static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64)));
17 17
18#define SHOW_MMUSTAT_ULONG(NAME) \ 18#define SHOW_MMUSTAT_ULONG(NAME) \
19static ssize_t show_##NAME(struct sys_device *dev, \ 19static ssize_t show_##NAME(struct device *dev, \
20 struct sysdev_attribute *attr, char *buf) \ 20 struct device_attribute *attr, char *buf) \
21{ \ 21{ \
22 struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \ 22 struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \
23 return sprintf(buf, "%lu\n", p->NAME); \ 23 return sprintf(buf, "%lu\n", p->NAME); \
24} \ 24} \
25static SYSDEV_ATTR(NAME, 0444, show_##NAME, NULL) 25static DEVICE_ATTR(NAME, 0444, show_##NAME, NULL)
26 26
27SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte); 27SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte);
28SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte); 28SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte);
@@ -58,38 +58,38 @@ SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_256mb_tte);
58SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte); 58SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte);
59 59
60static struct attribute *mmu_stat_attrs[] = { 60static struct attribute *mmu_stat_attrs[] = {
61 &attr_immu_tsb_hits_ctx0_8k_tte.attr, 61 &dev_attr_immu_tsb_hits_ctx0_8k_tte.attr,
62 &attr_immu_tsb_ticks_ctx0_8k_tte.attr, 62 &dev_attr_immu_tsb_ticks_ctx0_8k_tte.attr,
63 &attr_immu_tsb_hits_ctx0_64k_tte.attr, 63 &dev_attr_immu_tsb_hits_ctx0_64k_tte.attr,
64 &attr_immu_tsb_ticks_ctx0_64k_tte.attr, 64 &dev_attr_immu_tsb_ticks_ctx0_64k_tte.attr,
65 &attr_immu_tsb_hits_ctx0_4mb_tte.attr, 65 &dev_attr_immu_tsb_hits_ctx0_4mb_tte.attr,
66 &attr_immu_tsb_ticks_ctx0_4mb_tte.attr, 66 &dev_attr_immu_tsb_ticks_ctx0_4mb_tte.attr,
67 &attr_immu_tsb_hits_ctx0_256mb_tte.attr, 67 &dev_attr_immu_tsb_hits_ctx0_256mb_tte.attr,
68 &attr_immu_tsb_ticks_ctx0_256mb_tte.attr, 68 &dev_attr_immu_tsb_ticks_ctx0_256mb_tte.attr,
69 &attr_immu_tsb_hits_ctxnon0_8k_tte.attr, 69 &dev_attr_immu_tsb_hits_ctxnon0_8k_tte.attr,
70 &attr_immu_tsb_ticks_ctxnon0_8k_tte.attr, 70 &dev_attr_immu_tsb_ticks_ctxnon0_8k_tte.attr,
71 &attr_immu_tsb_hits_ctxnon0_64k_tte.attr, 71 &dev_attr_immu_tsb_hits_ctxnon0_64k_tte.attr,
72 &attr_immu_tsb_ticks_ctxnon0_64k_tte.attr, 72 &dev_attr_immu_tsb_ticks_ctxnon0_64k_tte.attr,
73 &attr_immu_tsb_hits_ctxnon0_4mb_tte.attr, 73 &dev_attr_immu_tsb_hits_ctxnon0_4mb_tte.attr,
74 &attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr, 74 &dev_attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr,
75 &attr_immu_tsb_hits_ctxnon0_256mb_tte.attr, 75 &dev_attr_immu_tsb_hits_ctxnon0_256mb_tte.attr,
76 &attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr, 76 &dev_attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr,
77 &attr_dmmu_tsb_hits_ctx0_8k_tte.attr, 77 &dev_attr_dmmu_tsb_hits_ctx0_8k_tte.attr,
78 &attr_dmmu_tsb_ticks_ctx0_8k_tte.attr, 78 &dev_attr_dmmu_tsb_ticks_ctx0_8k_tte.attr,
79 &attr_dmmu_tsb_hits_ctx0_64k_tte.attr, 79 &dev_attr_dmmu_tsb_hits_ctx0_64k_tte.attr,
80 &attr_dmmu_tsb_ticks_ctx0_64k_tte.attr, 80 &dev_attr_dmmu_tsb_ticks_ctx0_64k_tte.attr,
81 &attr_dmmu_tsb_hits_ctx0_4mb_tte.attr, 81 &dev_attr_dmmu_tsb_hits_ctx0_4mb_tte.attr,
82 &attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr, 82 &dev_attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr,
83 &attr_dmmu_tsb_hits_ctx0_256mb_tte.attr, 83 &dev_attr_dmmu_tsb_hits_ctx0_256mb_tte.attr,
84 &attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr, 84 &dev_attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr,
85 &attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr, 85 &dev_attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr,
86 &attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr, 86 &dev_attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr,
87 &attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr, 87 &dev_attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr,
88 &attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr, 88 &dev_attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr,
89 &attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr, 89 &dev_attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr,
90 &attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr, 90 &dev_attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr,
91 &attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr, 91 &dev_attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr,
92 &attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr, 92 &dev_attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr,
93 NULL, 93 NULL,
94}; 94};
95 95
@@ -139,15 +139,15 @@ static unsigned long write_mmustat_enable(unsigned long val)
139 return sun4v_mmustat_conf(ra, &orig_ra); 139 return sun4v_mmustat_conf(ra, &orig_ra);
140} 140}
141 141
142static ssize_t show_mmustat_enable(struct sys_device *s, 142static ssize_t show_mmustat_enable(struct device *s,
143 struct sysdev_attribute *attr, char *buf) 143 struct device_attribute *attr, char *buf)
144{ 144{
145 unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0); 145 unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0);
146 return sprintf(buf, "%lx\n", val); 146 return sprintf(buf, "%lx\n", val);
147} 147}
148 148
149static ssize_t store_mmustat_enable(struct sys_device *s, 149static ssize_t store_mmustat_enable(struct device *s,
150 struct sysdev_attribute *attr, const char *buf, 150 struct device_attribute *attr, const char *buf,
151 size_t count) 151 size_t count)
152{ 152{
153 unsigned long val, err; 153 unsigned long val, err;
@@ -163,39 +163,39 @@ static ssize_t store_mmustat_enable(struct sys_device *s,
163 return count; 163 return count;
164} 164}
165 165
166static SYSDEV_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable); 166static DEVICE_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable);
167 167
168static int mmu_stats_supported; 168static int mmu_stats_supported;
169 169
170static int register_mmu_stats(struct sys_device *s) 170static int register_mmu_stats(struct device *s)
171{ 171{
172 if (!mmu_stats_supported) 172 if (!mmu_stats_supported)
173 return 0; 173 return 0;
174 sysdev_create_file(s, &attr_mmustat_enable); 174 device_create_file(s, &dev_attr_mmustat_enable);
175 return sysfs_create_group(&s->kobj, &mmu_stat_group); 175 return sysfs_create_group(&s->kobj, &mmu_stat_group);
176} 176}
177 177
178#ifdef CONFIG_HOTPLUG_CPU 178#ifdef CONFIG_HOTPLUG_CPU
179static void unregister_mmu_stats(struct sys_device *s) 179static void unregister_mmu_stats(struct device *s)
180{ 180{
181 if (!mmu_stats_supported) 181 if (!mmu_stats_supported)
182 return; 182 return;
183 sysfs_remove_group(&s->kobj, &mmu_stat_group); 183 sysfs_remove_group(&s->kobj, &mmu_stat_group);
184 sysdev_remove_file(s, &attr_mmustat_enable); 184 device_remove_file(s, &dev_attr_mmustat_enable);
185} 185}
186#endif 186#endif
187 187
188#define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \ 188#define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \
189static ssize_t show_##NAME(struct sys_device *dev, \ 189static ssize_t show_##NAME(struct device *dev, \
190 struct sysdev_attribute *attr, char *buf) \ 190 struct device_attribute *attr, char *buf) \
191{ \ 191{ \
192 cpuinfo_sparc *c = &cpu_data(dev->id); \ 192 cpuinfo_sparc *c = &cpu_data(dev->id); \
193 return sprintf(buf, "%lu\n", c->MEMBER); \ 193 return sprintf(buf, "%lu\n", c->MEMBER); \
194} 194}
195 195
196#define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \ 196#define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \
197static ssize_t show_##NAME(struct sys_device *dev, \ 197static ssize_t show_##NAME(struct device *dev, \
198 struct sysdev_attribute *attr, char *buf) \ 198 struct device_attribute *attr, char *buf) \
199{ \ 199{ \
200 cpuinfo_sparc *c = &cpu_data(dev->id); \ 200 cpuinfo_sparc *c = &cpu_data(dev->id); \
201 return sprintf(buf, "%u\n", c->MEMBER); \ 201 return sprintf(buf, "%u\n", c->MEMBER); \
@@ -209,14 +209,14 @@ SHOW_CPUDATA_UINT_NAME(l1_icache_line_size, icache_line_size);
209SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size); 209SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size);
210SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size); 210SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size);
211 211
212static struct sysdev_attribute cpu_core_attrs[] = { 212static struct device_attribute cpu_core_attrs[] = {
213 _SYSDEV_ATTR(clock_tick, 0444, show_clock_tick, NULL), 213 __ATTR(clock_tick, 0444, show_clock_tick, NULL),
214 _SYSDEV_ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL), 214 __ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL),
215 _SYSDEV_ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL), 215 __ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL),
216 _SYSDEV_ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL), 216 __ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL),
217 _SYSDEV_ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL), 217 __ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL),
218 _SYSDEV_ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL), 218 __ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL),
219 _SYSDEV_ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL), 219 __ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL),
220}; 220};
221 221
222static DEFINE_PER_CPU(struct cpu, cpu_devices); 222static DEFINE_PER_CPU(struct cpu, cpu_devices);
@@ -224,11 +224,11 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
224static void register_cpu_online(unsigned int cpu) 224static void register_cpu_online(unsigned int cpu)
225{ 225{
226 struct cpu *c = &per_cpu(cpu_devices, cpu); 226 struct cpu *c = &per_cpu(cpu_devices, cpu);
227 struct sys_device *s = &c->sysdev; 227 struct device *s = &c->dev;
228 int i; 228 int i;
229 229
230 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) 230 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++)
231 sysdev_create_file(s, &cpu_core_attrs[i]); 231 device_create_file(s, &cpu_core_attrs[i]);
232 232
233 register_mmu_stats(s); 233 register_mmu_stats(s);
234} 234}
@@ -237,12 +237,12 @@ static void register_cpu_online(unsigned int cpu)
237static void unregister_cpu_online(unsigned int cpu) 237static void unregister_cpu_online(unsigned int cpu)
238{ 238{
239 struct cpu *c = &per_cpu(cpu_devices, cpu); 239 struct cpu *c = &per_cpu(cpu_devices, cpu);
240 struct sys_device *s = &c->sysdev; 240 struct device *s = &c->dev;
241 int i; 241 int i;
242 242
243 unregister_mmu_stats(s); 243 unregister_mmu_stats(s);
244 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) 244 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++)
245 sysdev_remove_file(s, &cpu_core_attrs[i]); 245 device_remove_file(s, &cpu_core_attrs[i]);
246} 246}
247#endif 247#endif
248 248
diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile
index e3cda21b5ee9..301421c11291 100644
--- a/arch/sparc/mm/Makefile
+++ b/arch/sparc/mm/Makefile
@@ -8,7 +8,6 @@ obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o gup.o
8obj-y += fault_$(BITS).o 8obj-y += fault_$(BITS).o
9obj-y += init_$(BITS).o 9obj-y += init_$(BITS).o
10obj-$(CONFIG_SPARC32) += loadmmu.o 10obj-$(CONFIG_SPARC32) += loadmmu.o
11obj-y += generic_$(BITS).o
12obj-$(CONFIG_SPARC32) += extable.o btfixup.o srmmu.o iommu.o io-unit.o 11obj-$(CONFIG_SPARC32) += extable.o btfixup.o srmmu.o iommu.o io-unit.o
13obj-$(CONFIG_SPARC32) += hypersparc.o viking.o tsunami.o swift.o 12obj-$(CONFIG_SPARC32) += hypersparc.o viking.o tsunami.o swift.o
14obj-$(CONFIG_SPARC_LEON)+= leon_mm.o 13obj-$(CONFIG_SPARC_LEON)+= leon_mm.o
diff --git a/arch/sparc/mm/btfixup.c b/arch/sparc/mm/btfixup.c
index 5175ac2f4820..8a7f81743c12 100644
--- a/arch/sparc/mm/btfixup.c
+++ b/arch/sparc/mm/btfixup.c
@@ -302,8 +302,7 @@ void __init btfixup(void)
302 case 'i': /* INT */ 302 case 'i': /* INT */
303 if ((insn & 0xc1c00000) == 0x01000000) /* %HI */ 303 if ((insn & 0xc1c00000) == 0x01000000) /* %HI */
304 set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10)); 304 set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10));
305 else if ((insn & 0x80002000) == 0x80002000 && 305 else if ((insn & 0x80002000) == 0x80002000) /* %LO */
306 (insn & 0x01800000) != 0x01800000) /* %LO */
307 set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff)); 306 set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff));
308 else { 307 else {
309 prom_printf(insn_i, p, addr, insn); 308 prom_printf(insn_i, p, addr, insn);
diff --git a/arch/sparc/mm/generic_32.c b/arch/sparc/mm/generic_32.c
deleted file mode 100644
index 6ca39a60a196..000000000000
--- a/arch/sparc/mm/generic_32.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * generic.c: Generic Sparc mm routines that are not dependent upon
3 * MMU type but are Sparc specific.
4 *
5 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#include <linux/kernel.h>
9#include <linux/mm.h>
10#include <linux/swap.h>
11#include <linux/pagemap.h>
12#include <linux/export.h>
13
14#include <asm/pgalloc.h>
15#include <asm/pgtable.h>
16#include <asm/page.h>
17#include <asm/cacheflush.h>
18#include <asm/tlbflush.h>
19
20/* Remap IO memory, the same way as remap_pfn_range(), but use
21 * the obio memory space.
22 *
23 * They use a pgprot that sets PAGE_IO and does not check the
24 * mem_map table as this is independent of normal memory.
25 */
26static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, unsigned long address, unsigned long size,
27 unsigned long offset, pgprot_t prot, int space)
28{
29 unsigned long end;
30
31 address &= ~PMD_MASK;
32 end = address + size;
33 if (end > PMD_SIZE)
34 end = PMD_SIZE;
35 do {
36 set_pte_at(mm, address, pte, mk_pte_io(offset, prot, space));
37 address += PAGE_SIZE;
38 offset += PAGE_SIZE;
39 pte++;
40 } while (address < end);
41}
42
43static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned long address, unsigned long size,
44 unsigned long offset, pgprot_t prot, int space)
45{
46 unsigned long end;
47
48 address &= ~PGDIR_MASK;
49 end = address + size;
50 if (end > PGDIR_SIZE)
51 end = PGDIR_SIZE;
52 offset -= address;
53 do {
54 pte_t *pte = pte_alloc_map(mm, NULL, pmd, address);
55 if (!pte)
56 return -ENOMEM;
57 io_remap_pte_range(mm, pte, address, end - address, address + offset, prot, space);
58 address = (address + PMD_SIZE) & PMD_MASK;
59 pmd++;
60 } while (address < end);
61 return 0;
62}
63
64int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
65 unsigned long pfn, unsigned long size, pgprot_t prot)
66{
67 int error = 0;
68 pgd_t * dir;
69 unsigned long beg = from;
70 unsigned long end = from + size;
71 struct mm_struct *mm = vma->vm_mm;
72 int space = GET_IOSPACE(pfn);
73 unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
74
75 /* See comment in mm/memory.c remap_pfn_range */
76 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
77 vma->vm_pgoff = (offset >> PAGE_SHIFT) |
78 ((unsigned long)space << 28UL);
79
80 offset -= from;
81 dir = pgd_offset(mm, from);
82 flush_cache_range(vma, beg, end);
83
84 while (from < end) {
85 pmd_t *pmd = pmd_alloc(mm, dir, from);
86 error = -ENOMEM;
87 if (!pmd)
88 break;
89 error = io_remap_pmd_range(mm, pmd, from, end - from, offset + from, prot, space);
90 if (error)
91 break;
92 from = (from + PGDIR_SIZE) & PGDIR_MASK;
93 dir++;
94 }
95
96 flush_tlb_range(vma, beg, end);
97 return error;
98}
99EXPORT_SYMBOL(io_remap_pfn_range);
diff --git a/arch/sparc/mm/generic_64.c b/arch/sparc/mm/generic_64.c
deleted file mode 100644
index 9b357ddae39d..000000000000
--- a/arch/sparc/mm/generic_64.c
+++ /dev/null
@@ -1,165 +0,0 @@
1/*
2 * generic.c: Generic Sparc mm routines that are not dependent upon
3 * MMU type but are Sparc specific.
4 *
5 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#include <linux/kernel.h>
9#include <linux/mm.h>
10#include <linux/swap.h>
11#include <linux/export.h>
12#include <linux/pagemap.h>
13
14#include <asm/pgalloc.h>
15#include <asm/pgtable.h>
16#include <asm/page.h>
17#include <asm/tlbflush.h>
18
19/* Remap IO memory, the same way as remap_pfn_range(), but use
20 * the obio memory space.
21 *
22 * They use a pgprot that sets PAGE_IO and does not check the
23 * mem_map table as this is independent of normal memory.
24 */
25static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte,
26 unsigned long address,
27 unsigned long size,
28 unsigned long offset, pgprot_t prot,
29 int space)
30{
31 unsigned long end;
32
33 /* clear hack bit that was used as a write_combine side-effect flag */
34 offset &= ~0x1UL;
35 address &= ~PMD_MASK;
36 end = address + size;
37 if (end > PMD_SIZE)
38 end = PMD_SIZE;
39 do {
40 pte_t entry;
41 unsigned long curend = address + PAGE_SIZE;
42
43 entry = mk_pte_io(offset, prot, space, PAGE_SIZE);
44 if (!(address & 0xffff)) {
45 if (PAGE_SIZE < (4 * 1024 * 1024) &&
46 !(address & 0x3fffff) &&
47 !(offset & 0x3ffffe) &&
48 end >= address + 0x400000) {
49 entry = mk_pte_io(offset, prot, space,
50 4 * 1024 * 1024);
51 curend = address + 0x400000;
52 offset += 0x400000;
53 } else if (PAGE_SIZE < (512 * 1024) &&
54 !(address & 0x7ffff) &&
55 !(offset & 0x7fffe) &&
56 end >= address + 0x80000) {
57 entry = mk_pte_io(offset, prot, space,
58 512 * 1024 * 1024);
59 curend = address + 0x80000;
60 offset += 0x80000;
61 } else if (PAGE_SIZE < (64 * 1024) &&
62 !(offset & 0xfffe) &&
63 end >= address + 0x10000) {
64 entry = mk_pte_io(offset, prot, space,
65 64 * 1024);
66 curend = address + 0x10000;
67 offset += 0x10000;
68 } else
69 offset += PAGE_SIZE;
70 } else
71 offset += PAGE_SIZE;
72
73 if (pte_write(entry))
74 entry = pte_mkdirty(entry);
75 do {
76 BUG_ON(!pte_none(*pte));
77 set_pte_at(mm, address, pte, entry);
78 address += PAGE_SIZE;
79 pte_val(entry) += PAGE_SIZE;
80 pte++;
81 } while (address < curend);
82 } while (address < end);
83}
84
85static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned long address, unsigned long size,
86 unsigned long offset, pgprot_t prot, int space)
87{
88 unsigned long end;
89
90 address &= ~PGDIR_MASK;
91 end = address + size;
92 if (end > PGDIR_SIZE)
93 end = PGDIR_SIZE;
94 offset -= address;
95 do {
96 pte_t *pte = pte_alloc_map(mm, NULL, pmd, address);
97 if (!pte)
98 return -ENOMEM;
99 io_remap_pte_range(mm, pte, address, end - address, address + offset, prot, space);
100 pte_unmap(pte);
101 address = (address + PMD_SIZE) & PMD_MASK;
102 pmd++;
103 } while (address < end);
104 return 0;
105}
106
107static inline int io_remap_pud_range(struct mm_struct *mm, pud_t * pud, unsigned long address, unsigned long size,
108 unsigned long offset, pgprot_t prot, int space)
109{
110 unsigned long end;
111
112 address &= ~PUD_MASK;
113 end = address + size;
114 if (end > PUD_SIZE)
115 end = PUD_SIZE;
116 offset -= address;
117 do {
118 pmd_t *pmd = pmd_alloc(mm, pud, address);
119 if (!pud)
120 return -ENOMEM;
121 io_remap_pmd_range(mm, pmd, address, end - address, address + offset, prot, space);
122 address = (address + PUD_SIZE) & PUD_MASK;
123 pud++;
124 } while (address < end);
125 return 0;
126}
127
128int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
129 unsigned long pfn, unsigned long size, pgprot_t prot)
130{
131 int error = 0;
132 pgd_t * dir;
133 unsigned long beg = from;
134 unsigned long end = from + size;
135 struct mm_struct *mm = vma->vm_mm;
136 int space = GET_IOSPACE(pfn);
137 unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
138 unsigned long phys_base;
139
140 phys_base = offset | (((unsigned long) space) << 32UL);
141
142 /* See comment in mm/memory.c remap_pfn_range */
143 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
144 vma->vm_pgoff = phys_base >> PAGE_SHIFT;
145
146 offset -= from;
147 dir = pgd_offset(mm, from);
148 flush_cache_range(vma, beg, end);
149
150 while (from < end) {
151 pud_t *pud = pud_alloc(mm, dir, from);
152 error = -ENOMEM;
153 if (!pud)
154 break;
155 error = io_remap_pud_range(mm, pud, from, end - from, offset + from, prot, space);
156 if (error)
157 break;
158 from = (from + PGDIR_SIZE) & PGDIR_MASK;
159 dir++;
160 }
161
162 flush_tlb_range(vma, beg, end);
163 return error;
164}
165EXPORT_SYMBOL(io_remap_pfn_range);
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 8e073d802139..b3f5e7dfea51 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -790,7 +790,7 @@ static int find_node(unsigned long addr)
790 return -1; 790 return -1;
791} 791}
792 792
793u64 memblock_nid_range(u64 start, u64 end, int *nid) 793static u64 memblock_nid_range(u64 start, u64 end, int *nid)
794{ 794{
795 *nid = find_node(start); 795 *nid = find_node(start);
796 start += PAGE_SIZE; 796 start += PAGE_SIZE;
@@ -808,7 +808,7 @@ u64 memblock_nid_range(u64 start, u64 end, int *nid)
808 return start; 808 return start;
809} 809}
810#else 810#else
811u64 memblock_nid_range(u64 start, u64 end, int *nid) 811static u64 memblock_nid_range(u64 start, u64 end, int *nid)
812{ 812{
813 *nid = 0; 813 *nid = 0;
814 return end; 814 return end;
@@ -816,7 +816,7 @@ u64 memblock_nid_range(u64 start, u64 end, int *nid)
816#endif 816#endif
817 817
818/* This must be invoked after performing all of the necessary 818/* This must be invoked after performing all of the necessary
819 * add_active_range() calls for 'nid'. We need to be able to get 819 * memblock_set_node() calls for 'nid'. We need to be able to get
820 * correct data from get_pfn_range_for_nid(). 820 * correct data from get_pfn_range_for_nid().
821 */ 821 */
822static void __init allocate_node_data(int nid) 822static void __init allocate_node_data(int nid)
@@ -987,14 +987,11 @@ static void __init add_node_ranges(void)
987 987
988 this_end = memblock_nid_range(start, end, &nid); 988 this_end = memblock_nid_range(start, end, &nid);
989 989
990 numadbg("Adding active range nid[%d] " 990 numadbg("Setting memblock NUMA node nid[%d] "
991 "start[%lx] end[%lx]\n", 991 "start[%lx] end[%lx]\n",
992 nid, start, this_end); 992 nid, start, this_end);
993 993
994 add_active_range(nid, 994 memblock_set_node(start, this_end - start, nid);
995 start >> PAGE_SHIFT,
996 this_end >> PAGE_SHIFT);
997
998 start = this_end; 995 start = this_end;
999 } 996 }
1000 } 997 }
@@ -1282,7 +1279,6 @@ static void __init bootmem_init_nonnuma(void)
1282{ 1279{
1283 unsigned long top_of_ram = memblock_end_of_DRAM(); 1280 unsigned long top_of_ram = memblock_end_of_DRAM();
1284 unsigned long total_ram = memblock_phys_mem_size(); 1281 unsigned long total_ram = memblock_phys_mem_size();
1285 struct memblock_region *reg;
1286 1282
1287 numadbg("bootmem_init_nonnuma()\n"); 1283 numadbg("bootmem_init_nonnuma()\n");
1288 1284
@@ -1292,20 +1288,8 @@ static void __init bootmem_init_nonnuma(void)
1292 (top_of_ram - total_ram) >> 20); 1288 (top_of_ram - total_ram) >> 20);
1293 1289
1294 init_node_masks_nonnuma(); 1290 init_node_masks_nonnuma();
1295 1291 memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
1296 for_each_memblock(memory, reg) {
1297 unsigned long start_pfn, end_pfn;
1298
1299 if (!reg->size)
1300 continue;
1301
1302 start_pfn = memblock_region_memory_base_pfn(reg);
1303 end_pfn = memblock_region_memory_end_pfn(reg);
1304 add_active_range(0, start_pfn, end_pfn);
1305 }
1306
1307 allocate_node_data(0); 1292 allocate_node_data(0);
1308
1309 node_set_online(0); 1293 node_set_online(0);
1310} 1294}
1311 1295
@@ -1769,8 +1753,6 @@ void __init paging_init(void)
1769 sun4v_ktsb_init(); 1753 sun4v_ktsb_init();
1770 } 1754 }
1771 1755
1772 memblock_init();
1773
1774 /* Find available physical memory... 1756 /* Find available physical memory...
1775 * 1757 *
1776 * Read it twice in order to work around a bug in openfirmware. 1758 * Read it twice in order to work around a bug in openfirmware.
@@ -1796,7 +1778,7 @@ void __init paging_init(void)
1796 1778
1797 memblock_enforce_memory_limit(cmdline_memory_size); 1779 memblock_enforce_memory_limit(cmdline_memory_size);
1798 1780
1799 memblock_analyze(); 1781 memblock_allow_resize();
1800 memblock_dump_all(); 1782 memblock_dump_all();
1801 1783
1802 set_bit(0, mmu_context_bmap); 1784 set_bit(0, mmu_context_bmap);
diff --git a/arch/tile/include/asm/irq.h b/arch/tile/include/asm/irq.h
index 94e9a511de84..f80f8ceabc67 100644
--- a/arch/tile/include/asm/irq.h
+++ b/arch/tile/include/asm/irq.h
@@ -74,16 +74,6 @@ enum {
74 */ 74 */
75void tile_irq_activate(unsigned int irq, int tile_irq_type); 75void tile_irq_activate(unsigned int irq, int tile_irq_type);
76 76
77/*
78 * For onboard, non-PCI (e.g. TILE_IRQ_PERCPU) devices, drivers know
79 * how to use enable/disable_percpu_irq() to manage interrupts on each
80 * core. We can't use the generic enable/disable_irq() because they
81 * use a single reference count per irq, rather than per cpu per irq.
82 */
83void enable_percpu_irq(unsigned int irq);
84void disable_percpu_irq(unsigned int irq);
85
86
87void setup_irq_regs(void); 77void setup_irq_regs(void);
88 78
89#endif /* _ASM_TILE_IRQ_H */ 79#endif /* _ASM_TILE_IRQ_H */
diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c
index aa0134db2dd6..02e628065012 100644
--- a/arch/tile/kernel/irq.c
+++ b/arch/tile/kernel/irq.c
@@ -152,14 +152,13 @@ void tile_dev_intr(struct pt_regs *regs, int intnum)
152 * Remove an irq from the disabled mask. If we're in an interrupt 152 * Remove an irq from the disabled mask. If we're in an interrupt
153 * context, defer enabling the HW interrupt until we leave. 153 * context, defer enabling the HW interrupt until we leave.
154 */ 154 */
155void enable_percpu_irq(unsigned int irq) 155static void tile_irq_chip_enable(struct irq_data *d)
156{ 156{
157 get_cpu_var(irq_disable_mask) &= ~(1UL << irq); 157 get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq);
158 if (__get_cpu_var(irq_depth) == 0) 158 if (__get_cpu_var(irq_depth) == 0)
159 unmask_irqs(1UL << irq); 159 unmask_irqs(1UL << d->irq);
160 put_cpu_var(irq_disable_mask); 160 put_cpu_var(irq_disable_mask);
161} 161}
162EXPORT_SYMBOL(enable_percpu_irq);
163 162
164/* 163/*
165 * Add an irq to the disabled mask. We disable the HW interrupt 164 * Add an irq to the disabled mask. We disable the HW interrupt
@@ -167,13 +166,12 @@ EXPORT_SYMBOL(enable_percpu_irq);
167 * in an interrupt context, the return path is careful to avoid 166 * in an interrupt context, the return path is careful to avoid
168 * unmasking a newly disabled interrupt. 167 * unmasking a newly disabled interrupt.
169 */ 168 */
170void disable_percpu_irq(unsigned int irq) 169static void tile_irq_chip_disable(struct irq_data *d)
171{ 170{
172 get_cpu_var(irq_disable_mask) |= (1UL << irq); 171 get_cpu_var(irq_disable_mask) |= (1UL << d->irq);
173 mask_irqs(1UL << irq); 172 mask_irqs(1UL << d->irq);
174 put_cpu_var(irq_disable_mask); 173 put_cpu_var(irq_disable_mask);
175} 174}
176EXPORT_SYMBOL(disable_percpu_irq);
177 175
178/* Mask an interrupt. */ 176/* Mask an interrupt. */
179static void tile_irq_chip_mask(struct irq_data *d) 177static void tile_irq_chip_mask(struct irq_data *d)
@@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d)
209 207
210static struct irq_chip tile_irq_chip = { 208static struct irq_chip tile_irq_chip = {
211 .name = "tile_irq_chip", 209 .name = "tile_irq_chip",
210 .irq_enable = tile_irq_chip_enable,
211 .irq_disable = tile_irq_chip_disable,
212 .irq_ack = tile_irq_chip_ack, 212 .irq_ack = tile_irq_chip_ack,
213 .irq_eoi = tile_irq_chip_eoi, 213 .irq_eoi = tile_irq_chip_eoi,
214 .irq_mask = tile_irq_chip_mask, 214 .irq_mask = tile_irq_chip_mask,
diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c
index 658f2ce426a4..b3ed19f8779c 100644
--- a/arch/tile/kernel/pci-dma.c
+++ b/arch/tile/kernel/pci-dma.c
@@ -15,6 +15,7 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/dma-mapping.h> 16#include <linux/dma-mapping.h>
17#include <linux/vmalloc.h> 17#include <linux/vmalloc.h>
18#include <linux/export.h>
18#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
19#include <asm/homecache.h> 20#include <asm/homecache.h>
20 21
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index 2a8014cb1ff5..9d610d3fb11e 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -24,6 +24,7 @@
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/uaccess.h> 26#include <linux/uaccess.h>
27#include <linux/export.h>
27 28
28#include <asm/processor.h> 29#include <asm/processor.h>
29#include <asm/sections.h> 30#include <asm/sections.h>
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index 9c45d8bbdf57..4c1ac6e5347a 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -85,7 +85,8 @@ void cpu_idle(void)
85 85
86 /* endless idle loop with no priority at all */ 86 /* endless idle loop with no priority at all */
87 while (1) { 87 while (1) {
88 tick_nohz_stop_sched_tick(1); 88 tick_nohz_idle_enter();
89 rcu_idle_enter();
89 while (!need_resched()) { 90 while (!need_resched()) {
90 if (cpu_is_offline(cpu)) 91 if (cpu_is_offline(cpu))
91 BUG(); /* no HOTPLUG_CPU */ 92 BUG(); /* no HOTPLUG_CPU */
@@ -105,7 +106,8 @@ void cpu_idle(void)
105 local_irq_enable(); 106 local_irq_enable();
106 current_thread_info()->status |= TS_POLLING; 107 current_thread_info()->status |= TS_POLLING;
107 } 108 }
108 tick_nohz_restart_sched_tick(); 109 rcu_idle_exit();
110 tick_nohz_idle_exit();
109 preempt_enable_no_resched(); 111 preempt_enable_no_resched();
110 schedule(); 112 schedule();
111 preempt_disable(); 113 preempt_disable();
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
index b671a86f4515..f862b005eb73 100644
--- a/arch/tile/kernel/sysfs.c
+++ b/arch/tile/kernel/sysfs.c
@@ -14,10 +14,11 @@
14 * /sys entry support. 14 * /sys entry support.
15 */ 15 */
16 16
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/cpu.h> 18#include <linux/cpu.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/stat.h>
21#include <hv/hypervisor.h> 22#include <hv/hypervisor.h>
22 23
23/* Return a string queried from the hypervisor, truncated to page size. */ 24/* Return a string queried from the hypervisor, truncated to page size. */
@@ -31,55 +32,55 @@ static ssize_t get_hv_confstr(char *page, int query)
31 return n; 32 return n;
32} 33}
33 34
34static ssize_t chip_width_show(struct sysdev_class *dev, 35static ssize_t chip_width_show(struct device *dev,
35 struct sysdev_class_attribute *attr, 36 struct device_attribute *attr,
36 char *page) 37 char *page)
37{ 38{
38 return sprintf(page, "%u\n", smp_width); 39 return sprintf(page, "%u\n", smp_width);
39} 40}
40static SYSDEV_CLASS_ATTR(chip_width, 0444, chip_width_show, NULL); 41static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL);
41 42
42static ssize_t chip_height_show(struct sysdev_class *dev, 43static ssize_t chip_height_show(struct device *dev,
43 struct sysdev_class_attribute *attr, 44 struct device_attribute *attr,
44 char *page) 45 char *page)
45{ 46{
46 return sprintf(page, "%u\n", smp_height); 47 return sprintf(page, "%u\n", smp_height);
47} 48}
48static SYSDEV_CLASS_ATTR(chip_height, 0444, chip_height_show, NULL); 49static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL);
49 50
50static ssize_t chip_serial_show(struct sysdev_class *dev, 51static ssize_t chip_serial_show(struct device *dev,
51 struct sysdev_class_attribute *attr, 52 struct device_attribute *attr,
52 char *page) 53 char *page)
53{ 54{
54 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM); 55 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM);
55} 56}
56static SYSDEV_CLASS_ATTR(chip_serial, 0444, chip_serial_show, NULL); 57static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL);
57 58
58static ssize_t chip_revision_show(struct sysdev_class *dev, 59static ssize_t chip_revision_show(struct device *dev,
59 struct sysdev_class_attribute *attr, 60 struct device_attribute *attr,
60 char *page) 61 char *page)
61{ 62{
62 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV); 63 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV);
63} 64}
64static SYSDEV_CLASS_ATTR(chip_revision, 0444, chip_revision_show, NULL); 65static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL);
65 66
66 67
67static ssize_t type_show(struct sysdev_class *dev, 68static ssize_t type_show(struct device *dev,
68 struct sysdev_class_attribute *attr, 69 struct device_attribute *attr,
69 char *page) 70 char *page)
70{ 71{
71 return sprintf(page, "tilera\n"); 72 return sprintf(page, "tilera\n");
72} 73}
73static SYSDEV_CLASS_ATTR(type, 0444, type_show, NULL); 74static DEVICE_ATTR(type, 0444, type_show, NULL);
74 75
75#define HV_CONF_ATTR(name, conf) \ 76#define HV_CONF_ATTR(name, conf) \
76 static ssize_t name ## _show(struct sysdev_class *dev, \ 77 static ssize_t name ## _show(struct device *dev, \
77 struct sysdev_class_attribute *attr, \ 78 struct device_attribute *attr, \
78 char *page) \ 79 char *page) \
79 { \ 80 { \
80 return get_hv_confstr(page, conf); \ 81 return get_hv_confstr(page, conf); \
81 } \ 82 } \
82 static SYSDEV_CLASS_ATTR(name, 0444, name ## _show, NULL); 83 static DEVICE_ATTR(name, 0444, name ## _show, NULL);
83 84
84HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) 85HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER)
85HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) 86HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER)
@@ -95,15 +96,15 @@ HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC)
95HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) 96HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL)
96 97
97static struct attribute *board_attrs[] = { 98static struct attribute *board_attrs[] = {
98 &attr_board_part.attr, 99 &dev_attr_board_part.attr,
99 &attr_board_serial.attr, 100 &dev_attr_board_serial.attr,
100 &attr_board_revision.attr, 101 &dev_attr_board_revision.attr,
101 &attr_board_description.attr, 102 &dev_attr_board_description.attr,
102 &attr_mezz_part.attr, 103 &dev_attr_mezz_part.attr,
103 &attr_mezz_serial.attr, 104 &dev_attr_mezz_serial.attr,
104 &attr_mezz_revision.attr, 105 &dev_attr_mezz_revision.attr,
105 &attr_mezz_description.attr, 106 &dev_attr_mezz_description.attr,
106 &attr_switch_control.attr, 107 &dev_attr_switch_control.attr,
107 NULL 108 NULL
108}; 109};
109 110
@@ -150,12 +151,11 @@ hvconfig_bin_read(struct file *filp, struct kobject *kobj,
150 151
151static int __init create_sysfs_entries(void) 152static int __init create_sysfs_entries(void)
152{ 153{
153 struct sysdev_class *cls = &cpu_sysdev_class;
154 int err = 0; 154 int err = 0;
155 155
156#define create_cpu_attr(name) \ 156#define create_cpu_attr(name) \
157 if (!err) \ 157 if (!err) \
158 err = sysfs_create_file(&cls->kset.kobj, &attr_##name.attr); 158 err = device_create_file(cpu_subsys.dev_root, &dev_attr_##name);
159 create_cpu_attr(chip_width); 159 create_cpu_attr(chip_width);
160 create_cpu_attr(chip_height); 160 create_cpu_attr(chip_height);
161 create_cpu_attr(chip_serial); 161 create_cpu_attr(chip_serial);
@@ -163,7 +163,7 @@ static int __init create_sysfs_entries(void)
163 163
164#define create_hv_attr(name) \ 164#define create_hv_attr(name) \
165 if (!err) \ 165 if (!err) \
166 err = sysfs_create_file(hypervisor_kobj, &attr_##name.attr); 166 err = sysfs_create_file(hypervisor_kobj, &dev_attr_##name);
167 create_hv_attr(type); 167 create_hv_attr(type);
168 create_hv_attr(version); 168 create_hv_attr(version);
169 create_hv_attr(config_version); 169 create_hv_attr(config_version);
diff --git a/arch/tile/lib/exports.c b/arch/tile/lib/exports.c
index a87d2a859ba9..2a81d32de0da 100644
--- a/arch/tile/lib/exports.c
+++ b/arch/tile/lib/exports.c
@@ -39,6 +39,9 @@ EXPORT_SYMBOL(finv_user_asm);
39EXPORT_SYMBOL(current_text_addr); 39EXPORT_SYMBOL(current_text_addr);
40EXPORT_SYMBOL(dump_stack); 40EXPORT_SYMBOL(dump_stack);
41 41
42/* arch/tile/kernel/head.S */
43EXPORT_SYMBOL(empty_zero_page);
44
42/* arch/tile/lib/, various memcpy files */ 45/* arch/tile/lib/, various memcpy files */
43EXPORT_SYMBOL(memcpy); 46EXPORT_SYMBOL(memcpy);
44EXPORT_SYMBOL(__copy_to_user_inatomic); 47EXPORT_SYMBOL(__copy_to_user_inatomic);
diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c
index 25b7b90fd620..c1eaaa1fcc20 100644
--- a/arch/tile/mm/fault.c
+++ b/arch/tile/mm/fault.c
@@ -54,7 +54,7 @@ static noinline void force_sig_info_fault(const char *type, int si_signo,
54 if (unlikely(tsk->pid < 2)) { 54 if (unlikely(tsk->pid < 2)) {
55 panic("Signal %d (code %d) at %#lx sent to %s!", 55 panic("Signal %d (code %d) at %#lx sent to %s!",
56 si_signo, si_code & 0xffff, address, 56 si_signo, si_code & 0xffff, address,
57 tsk->pid ? "init" : "the idle task"); 57 is_idle_task(tsk) ? "the idle task" : "init");
58 } 58 }
59 59
60 info.si_signo = si_signo; 60 info.si_signo = si_signo;
@@ -515,7 +515,7 @@ no_context:
515 515
516 if (unlikely(tsk->pid < 2)) { 516 if (unlikely(tsk->pid < 2)) {
517 panic("Kernel page fault running %s!", 517 panic("Kernel page fault running %s!",
518 tsk->pid ? "init" : "the idle task"); 518 is_idle_task(tsk) ? "the idle task" : "init");
519 } 519 }
520 520
521 /* 521 /*
diff --git a/arch/tile/mm/homecache.c b/arch/tile/mm/homecache.c
index cbe6f4f9eca3..1cc6ae477c98 100644
--- a/arch/tile/mm/homecache.c
+++ b/arch/tile/mm/homecache.c
@@ -449,9 +449,12 @@ void homecache_free_pages(unsigned long addr, unsigned int order)
449 VM_BUG_ON(!virt_addr_valid((void *)addr)); 449 VM_BUG_ON(!virt_addr_valid((void *)addr));
450 page = virt_to_page((void *)addr); 450 page = virt_to_page((void *)addr);
451 if (put_page_testzero(page)) { 451 if (put_page_testzero(page)) {
452 int pages = (1 << order);
453 homecache_change_page_home(page, order, initial_page_home()); 452 homecache_change_page_home(page, order, initial_page_home());
454 while (pages--) 453 if (order == 0) {
455 __free_page(page++); 454 free_hot_cold_page(page, 0);
455 } else {
456 init_page_count(page);
457 __free_pages(page, order);
458 }
456 } 459 }
457} 460}
diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index 5bd1bad33fab..200c4ab1240c 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -71,7 +71,6 @@ static inline struct thread_info *current_thread_info(void)
71#define TIF_MEMDIE 5 /* is terminating due to OOM killer */ 71#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
72#define TIF_SYSCALL_AUDIT 6 72#define TIF_SYSCALL_AUDIT 6
73#define TIF_RESTORE_SIGMASK 7 73#define TIF_RESTORE_SIGMASK 7
74#define TIF_FREEZE 16 /* is freezing for suspend */
75 74
76#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 75#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
77#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 76#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -80,6 +79,5 @@ static inline struct thread_info *current_thread_info(void)
80#define _TIF_MEMDIE (1 << TIF_MEMDIE) 79#define _TIF_MEMDIE (1 << TIF_MEMDIE)
81#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 80#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
82#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 81#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
83#define _TIF_FREEZE (1 << TIF_FREEZE)
84 82
85#endif 83#endif
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index c5338351aecd..69f24905abdc 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -246,10 +246,12 @@ void default_idle(void)
246 if (need_resched()) 246 if (need_resched())
247 schedule(); 247 schedule();
248 248
249 tick_nohz_stop_sched_tick(1); 249 tick_nohz_idle_enter();
250 rcu_idle_enter();
250 nsecs = disable_timer(); 251 nsecs = disable_timer();
251 idle_sleep(nsecs); 252 idle_sleep(nsecs);
252 tick_nohz_restart_sched_tick(); 253 rcu_idle_exit();
254 tick_nohz_idle_exit();
253 } 255 }
254} 256}
255 257
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index a08d9fab81f2..82a6e22f1f35 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -75,8 +75,6 @@ static struct clocksource itimer_clocksource = {
75 .rating = 300, 75 .rating = 300,
76 .read = itimer_read, 76 .read = itimer_read,
77 .mask = CLOCKSOURCE_MASK(64), 77 .mask = CLOCKSOURCE_MASK(64),
78 .mult = 1000,
79 .shift = 0,
80 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 78 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
81}; 79};
82 80
@@ -94,9 +92,9 @@ static void __init setup_itimer(void)
94 clockevent_delta2ns(60 * HZ, &itimer_clockevent); 92 clockevent_delta2ns(60 * HZ, &itimer_clockevent);
95 itimer_clockevent.min_delta_ns = 93 itimer_clockevent.min_delta_ns =
96 clockevent_delta2ns(1, &itimer_clockevent); 94 clockevent_delta2ns(1, &itimer_clockevent);
97 err = clocksource_register(&itimer_clocksource); 95 err = clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
98 if (err) { 96 if (err) {
99 printk(KERN_ERR "clocksource_register returned %d\n", err); 97 printk(KERN_ERR "clocksource_register_hz returned %d\n", err);
100 return; 98 return;
101 } 99 }
102 clockevents_register_device(&itimer_clockevent); 100 clockevents_register_device(&itimer_clockevent);
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index e57dcce9bfda..942ed6174f1d 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -237,13 +237,13 @@ menu "PKUnity NetBook-0916 Features"
237 237
238config I2C_BATTERY_BQ27200 238config I2C_BATTERY_BQ27200
239 tristate "I2C Battery BQ27200 Support" 239 tristate "I2C Battery BQ27200 Support"
240 select PUV3_I2C 240 select I2C_PUV3
241 select POWER_SUPPLY 241 select POWER_SUPPLY
242 select BATTERY_BQ27x00 242 select BATTERY_BQ27x00
243 243
244config I2C_EEPROM_AT24 244config I2C_EEPROM_AT24
245 tristate "I2C EEPROMs AT24 support" 245 tristate "I2C EEPROMs AT24 support"
246 select PUV3_I2C 246 select I2C_PUV3
247 select MISC_DEVICES 247 select MISC_DEVICES
248 select EEPROM_AT24 248 select EEPROM_AT24
249 249
diff --git a/arch/unicore32/Kconfig.debug b/arch/unicore32/Kconfig.debug
index ae2ec334c3c6..1a3626239843 100644
--- a/arch/unicore32/Kconfig.debug
+++ b/arch/unicore32/Kconfig.debug
@@ -44,18 +44,4 @@ config DEBUG_OCD
44 Say Y here if you want the debug print routines to direct their 44 Say Y here if you want the debug print routines to direct their
45 output to the UniCore On-Chip-Debugger channel using CP #1. 45 output to the UniCore On-Chip-Debugger channel using CP #1.
46 46
47config DEBUG_OCD_BREAKPOINT
48 bool "Breakpoint support via On-Chip-Debugger"
49 depends on DEBUG_OCD
50
51config DEBUG_UART
52 int "Kernel low-level debugging messages via serial port"
53 depends on DEBUG_LL
54 range 0 1
55 default "0"
56 help
57 Choice for UART for kernel low-level using PKUnity UARTS,
58 should be between zero and one. The port must have been
59 initialised by the boot-loader before use.
60
61endmenu 47endmenu
diff --git a/arch/unicore32/boot/compressed/Makefile b/arch/unicore32/boot/compressed/Makefile
index b0954a2d23cf..950a9afa38f8 100644
--- a/arch/unicore32/boot/compressed/Makefile
+++ b/arch/unicore32/boot/compressed/Makefile
@@ -10,8 +10,8 @@
10# Copyright (C) 2001~2010 GUAN Xue-tao 10# Copyright (C) 2001~2010 GUAN Xue-tao
11# 11#
12 12
13EXTRA_CFLAGS := -fpic -fno-builtin 13ccflags-y := -fpic -fno-builtin
14EXTRA_AFLAGS := -Wa,-march=all 14asflags-y := -Wa,-march=all
15 15
16OBJS := misc.o 16OBJS := misc.o
17 17
diff --git a/arch/unicore32/include/asm/bitops.h b/arch/unicore32/include/asm/bitops.h
index 1628a6328994..401f597bc38c 100644
--- a/arch/unicore32/include/asm/bitops.h
+++ b/arch/unicore32/include/asm/bitops.h
@@ -13,12 +13,6 @@
13#ifndef __UNICORE_BITOPS_H__ 13#ifndef __UNICORE_BITOPS_H__
14#define __UNICORE_BITOPS_H__ 14#define __UNICORE_BITOPS_H__
15 15
16#define find_next_bit __uc32_find_next_bit
17#define find_next_zero_bit __uc32_find_next_zero_bit
18
19#define find_first_bit __uc32_find_first_bit
20#define find_first_zero_bit __uc32_find_first_zero_bit
21
22#define _ASM_GENERIC_BITOPS_FLS_H_ 16#define _ASM_GENERIC_BITOPS_FLS_H_
23#define _ASM_GENERIC_BITOPS___FLS_H_ 17#define _ASM_GENERIC_BITOPS___FLS_H_
24#define _ASM_GENERIC_BITOPS_FFS_H_ 18#define _ASM_GENERIC_BITOPS_FFS_H_
@@ -44,4 +38,10 @@ static inline int fls(int x)
44 38
45#include <asm-generic/bitops.h> 39#include <asm-generic/bitops.h>
46 40
41/* following definitions: to avoid using codes in lib/find_*.c */
42#define find_next_bit find_next_bit
43#define find_next_zero_bit find_next_zero_bit
44#define find_first_bit find_first_bit
45#define find_first_zero_bit find_first_zero_bit
46
47#endif /* __UNICORE_BITOPS_H__ */ 47#endif /* __UNICORE_BITOPS_H__ */
diff --git a/arch/unicore32/include/asm/processor.h b/arch/unicore32/include/asm/processor.h
index e11cb0786578..f0d780a51f9b 100644
--- a/arch/unicore32/include/asm/processor.h
+++ b/arch/unicore32/include/asm/processor.h
@@ -53,7 +53,6 @@ struct thread_struct {
53#define start_thread(regs, pc, sp) \ 53#define start_thread(regs, pc, sp) \
54({ \ 54({ \
55 unsigned long *stack = (unsigned long *)sp; \ 55 unsigned long *stack = (unsigned long *)sp; \
56 set_fs(USER_DS); \
57 memset(regs->uregs, 0, sizeof(regs->uregs)); \ 56 memset(regs->uregs, 0, sizeof(regs->uregs)); \
58 regs->UCreg_asr = USER_MODE; \ 57 regs->UCreg_asr = USER_MODE; \
59 regs->UCreg_pc = pc & ~1; /* pc */ \ 58 regs->UCreg_pc = pc & ~1; /* pc */ \
diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h
index c270e9e04861..89f7557583b8 100644
--- a/arch/unicore32/include/asm/thread_info.h
+++ b/arch/unicore32/include/asm/thread_info.h
@@ -135,14 +135,12 @@ static inline struct thread_info *current_thread_info(void)
135#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ 135#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
136#define TIF_SYSCALL_TRACE 8 136#define TIF_SYSCALL_TRACE 8
137#define TIF_MEMDIE 18 137#define TIF_MEMDIE 18
138#define TIF_FREEZE 19
139#define TIF_RESTORE_SIGMASK 20 138#define TIF_RESTORE_SIGMASK 20
140 139
141#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 140#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
142#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 141#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
143#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 142#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
144#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 143#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
145#define _TIF_FREEZE (1 << TIF_FREEZE)
146#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 144#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
147 145
148/* 146/*
diff --git a/arch/unicore32/kernel/ksyms.c b/arch/unicore32/kernel/ksyms.c
index a8970809428a..d98bd812cae1 100644
--- a/arch/unicore32/kernel/ksyms.c
+++ b/arch/unicore32/kernel/ksyms.c
@@ -24,8 +24,8 @@
24 24
25#include "ksyms.h" 25#include "ksyms.h"
26 26
27EXPORT_SYMBOL(__uc32_find_next_zero_bit); 27EXPORT_SYMBOL(find_next_zero_bit);
28EXPORT_SYMBOL(__uc32_find_next_bit); 28EXPORT_SYMBOL(find_next_bit);
29 29
30EXPORT_SYMBOL(__backtrace); 30EXPORT_SYMBOL(__backtrace);
31 31
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c
index ba401df971ed..52edc2b62873 100644
--- a/arch/unicore32/kernel/process.c
+++ b/arch/unicore32/kernel/process.c
@@ -55,7 +55,8 @@ void cpu_idle(void)
55{ 55{
56 /* endless idle loop with no priority at all */ 56 /* endless idle loop with no priority at all */
57 while (1) { 57 while (1) {
58 tick_nohz_stop_sched_tick(1); 58 tick_nohz_idle_enter();
59 rcu_idle_enter();
59 while (!need_resched()) { 60 while (!need_resched()) {
60 local_irq_disable(); 61 local_irq_disable();
61 stop_critical_timings(); 62 stop_critical_timings();
@@ -63,7 +64,8 @@ void cpu_idle(void)
63 local_irq_enable(); 64 local_irq_enable();
64 start_critical_timings(); 65 start_critical_timings();
65 } 66 }
66 tick_nohz_restart_sched_tick(); 67 rcu_idle_exit();
68 tick_nohz_idle_exit();
67 preempt_enable_no_resched(); 69 preempt_enable_no_resched();
68 schedule(); 70 schedule();
69 preempt_disable(); 71 preempt_disable();
diff --git a/arch/unicore32/kernel/puv3-core.c b/arch/unicore32/kernel/puv3-core.c
index 1a505a787765..254adeecc61a 100644
--- a/arch/unicore32/kernel/puv3-core.c
+++ b/arch/unicore32/kernel/puv3-core.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/sysdev.h>
17#include <linux/amba/bus.h> 16#include <linux/amba/bus.h>
18#include <linux/platform_device.h> 17#include <linux/platform_device.h>
19#include <linux/io.h> 18#include <linux/io.h>
diff --git a/arch/unicore32/kernel/puv3-nb0916.c b/arch/unicore32/kernel/puv3-nb0916.c
index e731c561ed4e..37b12a06b499 100644
--- a/arch/unicore32/kernel/puv3-nb0916.c
+++ b/arch/unicore32/kernel/puv3-nb0916.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/sysdev.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
18#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
19#include <linux/io.h> 18#include <linux/io.h>
diff --git a/arch/unicore32/kernel/setup.c b/arch/unicore32/kernel/setup.c
index 471b6bca8da4..673d7a89d8ff 100644
--- a/arch/unicore32/kernel/setup.c
+++ b/arch/unicore32/kernel/setup.c
@@ -37,6 +37,7 @@
37#include <asm/cacheflush.h> 37#include <asm/cacheflush.h>
38#include <asm/tlbflush.h> 38#include <asm/tlbflush.h>
39#include <asm/traps.h> 39#include <asm/traps.h>
40#include <asm/memblock.h>
40 41
41#include "setup.h" 42#include "setup.h"
42 43
diff --git a/arch/unicore32/lib/findbit.S b/arch/unicore32/lib/findbit.S
index c360ce905d8b..c77746247d36 100644
--- a/arch/unicore32/lib/findbit.S
+++ b/arch/unicore32/lib/findbit.S
@@ -17,7 +17,7 @@
17 * Purpose : Find a 'zero' bit 17 * Purpose : Find a 'zero' bit
18 * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit); 18 * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
19 */ 19 */
20__uc32_find_first_zero_bit: 20ENTRY(find_first_zero_bit)
21 cxor.a r1, #0 21 cxor.a r1, #0
22 beq 3f 22 beq 3f
23 mov r2, #0 23 mov r2, #0
@@ -29,13 +29,14 @@ __uc32_find_first_zero_bit:
29 bub 1b 29 bub 1b
303: mov r0, r1 @ no free bits 303: mov r0, r1 @ no free bits
31 mov pc, lr 31 mov pc, lr
32ENDPROC(find_first_zero_bit)
32 33
33/* 34/*
34 * Purpose : Find next 'zero' bit 35 * Purpose : Find next 'zero' bit
35 * Prototype: int find_next_zero_bit 36 * Prototype: int find_next_zero_bit
36 * (void *addr, unsigned int maxbit, int offset) 37 * (void *addr, unsigned int maxbit, int offset)
37 */ 38 */
38ENTRY(__uc32_find_next_zero_bit) 39ENTRY(find_next_zero_bit)
39 cxor.a r1, #0 40 cxor.a r1, #0
40 beq 3b 41 beq 3b
41 and.a ip, r2, #7 42 and.a ip, r2, #7
@@ -47,14 +48,14 @@ ENTRY(__uc32_find_next_zero_bit)
47 or r2, r2, #7 @ if zero, then no bits here 48 or r2, r2, #7 @ if zero, then no bits here
48 add r2, r2, #1 @ align bit pointer 49 add r2, r2, #1 @ align bit pointer
49 b 2b @ loop for next bit 50 b 2b @ loop for next bit
50ENDPROC(__uc32_find_next_zero_bit) 51ENDPROC(find_next_zero_bit)
51 52
52/* 53/*
53 * Purpose : Find a 'one' bit 54 * Purpose : Find a 'one' bit
54 * Prototype: int find_first_bit 55 * Prototype: int find_first_bit
55 * (const unsigned long *addr, unsigned int maxbit); 56 * (const unsigned long *addr, unsigned int maxbit);
56 */ 57 */
57__uc32_find_first_bit: 58ENTRY(find_first_bit)
58 cxor.a r1, #0 59 cxor.a r1, #0
59 beq 3f 60 beq 3f
60 mov r2, #0 61 mov r2, #0
@@ -66,13 +67,14 @@ __uc32_find_first_bit:
66 bub 1b 67 bub 1b
673: mov r0, r1 @ no free bits 683: mov r0, r1 @ no free bits
68 mov pc, lr 69 mov pc, lr
70ENDPROC(find_first_bit)
69 71
70/* 72/*
71 * Purpose : Find next 'one' bit 73 * Purpose : Find next 'one' bit
72 * Prototype: int find_next_zero_bit 74 * Prototype: int find_next_zero_bit
73 * (void *addr, unsigned int maxbit, int offset) 75 * (void *addr, unsigned int maxbit, int offset)
74 */ 76 */
75ENTRY(__uc32_find_next_bit) 77ENTRY(find_next_bit)
76 cxor.a r1, #0 78 cxor.a r1, #0
77 beq 3b 79 beq 3b
78 and.a ip, r2, #7 80 and.a ip, r2, #7
@@ -83,7 +85,7 @@ ENTRY(__uc32_find_next_bit)
83 or r2, r2, #7 @ if zero, then no bits here 85 or r2, r2, #7 @ if zero, then no bits here
84 add r2, r2, #1 @ align bit pointer 86 add r2, r2, #1 @ align bit pointer
85 b 2b @ loop for next bit 87 b 2b @ loop for next bit
86ENDPROC(__uc32_find_next_bit) 88ENDPROC(find_next_bit)
87 89
88/* 90/*
89 * One or more bits in the LSB of r3 are assumed to be set. 91 * One or more bits in the LSB of r3 are assumed to be set.
diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c
index 3b379cddbc64..de186bde8975 100644
--- a/arch/unicore32/mm/init.c
+++ b/arch/unicore32/mm/init.c
@@ -26,6 +26,7 @@
26#include <asm/setup.h> 26#include <asm/setup.h>
27#include <asm/sizes.h> 27#include <asm/sizes.h>
28#include <asm/tlb.h> 28#include <asm/tlb.h>
29#include <asm/memblock.h>
29#include <mach/map.h> 30#include <mach/map.h>
30 31
31#include "mm.h" 32#include "mm.h"
@@ -245,7 +246,6 @@ void __init uc32_memblock_init(struct meminfo *mi)
245 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), 246 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]),
246 meminfo_cmp, NULL); 247 meminfo_cmp, NULL);
247 248
248 memblock_init();
249 for (i = 0; i < mi->nr_banks; i++) 249 for (i = 0; i < mi->nr_banks; i++)
250 memblock_add(mi->bank[i].start, mi->bank[i].size); 250 memblock_add(mi->bank[i].start, mi->bank[i].size);
251 251
@@ -264,7 +264,7 @@ void __init uc32_memblock_init(struct meminfo *mi)
264 264
265 uc32_mm_memblock_reserve(); 265 uc32_mm_memblock_reserve();
266 266
267 memblock_analyze(); 267 memblock_allow_resize();
268 memblock_dump_all(); 268 memblock_dump_all();
269} 269}
270 270
diff --git a/arch/unicore32/mm/mmu.c b/arch/unicore32/mm/mmu.c
index 3e5c3e5a0b45..43c20b40e444 100644
--- a/arch/unicore32/mm/mmu.c
+++ b/arch/unicore32/mm/mmu.c
@@ -25,6 +25,7 @@
25#include <asm/setup.h> 25#include <asm/setup.h>
26#include <asm/sizes.h> 26#include <asm/sizes.h>
27#include <asm/tlb.h> 27#include <asm/tlb.h>
28#include <asm/memblock.h>
28 29
29#include <mach/map.h> 30#include <mach/map.h>
30 31
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cb9a1044a771..1d2a69dd36d8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -26,6 +26,8 @@ config X86
26 select HAVE_IOREMAP_PROT 26 select HAVE_IOREMAP_PROT
27 select HAVE_KPROBES 27 select HAVE_KPROBES
28 select HAVE_MEMBLOCK 28 select HAVE_MEMBLOCK
29 select HAVE_MEMBLOCK_NODE_MAP
30 select ARCH_DISCARD_MEMBLOCK
29 select ARCH_WANT_OPTIONAL_GPIOLIB 31 select ARCH_WANT_OPTIONAL_GPIOLIB
30 select ARCH_WANT_FRAME_POINTERS 32 select ARCH_WANT_FRAME_POINTERS
31 select HAVE_DMA_ATTRS 33 select HAVE_DMA_ATTRS
@@ -204,9 +206,6 @@ config ZONE_DMA32
204 bool 206 bool
205 default X86_64 207 default X86_64
206 208
207config ARCH_POPULATES_NODE_MAP
208 def_bool y
209
210config AUDIT_ARCH 209config AUDIT_ARCH
211 bool 210 bool
212 default X86_64 211 default X86_64
@@ -343,6 +342,7 @@ config X86_EXTENDED_PLATFORM
343 342
344 If you enable this option then you'll be able to select support 343 If you enable this option then you'll be able to select support
345 for the following (non-PC) 64 bit x86 platforms: 344 for the following (non-PC) 64 bit x86 platforms:
345 Numascale NumaChip
346 ScaleMP vSMP 346 ScaleMP vSMP
347 SGI Ultraviolet 347 SGI Ultraviolet
348 348
@@ -351,6 +351,18 @@ config X86_EXTENDED_PLATFORM
351endif 351endif
352# This is an alphabetically sorted list of 64 bit extended platforms 352# This is an alphabetically sorted list of 64 bit extended platforms
353# Please maintain the alphabetic order if and when there are additions 353# Please maintain the alphabetic order if and when there are additions
354config X86_NUMACHIP
355 bool "Numascale NumaChip"
356 depends on X86_64
357 depends on X86_EXTENDED_PLATFORM
358 depends on NUMA
359 depends on SMP
360 depends on X86_X2APIC
361 depends on !EDAC_AMD64
362 ---help---
363 Adds support for Numascale NumaChip large-SMP systems. Needed to
364 enable more than ~168 cores.
365 If you don't have one of these, you should say N here.
354 366
355config X86_VSMP 367config X86_VSMP
356 bool "ScaleMP vSMP" 368 bool "ScaleMP vSMP"
@@ -390,7 +402,7 @@ config X86_INTEL_CE
390 This option compiles in support for the CE4100 SOC for settop 402 This option compiles in support for the CE4100 SOC for settop
391 boxes and media devices. 403 boxes and media devices.
392 404
393config X86_INTEL_MID 405config X86_WANT_INTEL_MID
394 bool "Intel MID platform support" 406 bool "Intel MID platform support"
395 depends on X86_32 407 depends on X86_32
396 depends on X86_EXTENDED_PLATFORM 408 depends on X86_EXTENDED_PLATFORM
@@ -399,7 +411,10 @@ config X86_INTEL_MID
399 systems which do not have the PCI legacy interfaces (Moorestown, 411 systems which do not have the PCI legacy interfaces (Moorestown,
400 Medfield). If you are building for a PC class system say N here. 412 Medfield). If you are building for a PC class system say N here.
401 413
402if X86_INTEL_MID 414if X86_WANT_INTEL_MID
415
416config X86_INTEL_MID
417 bool
403 418
404config X86_MRST 419config X86_MRST
405 bool "Moorestown MID platform" 420 bool "Moorestown MID platform"
@@ -411,6 +426,7 @@ config X86_MRST
411 select SPI 426 select SPI
412 select INTEL_SCU_IPC 427 select INTEL_SCU_IPC
413 select X86_PLATFORM_DEVICES 428 select X86_PLATFORM_DEVICES
429 select X86_INTEL_MID
414 ---help--- 430 ---help---
415 Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin 431 Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin
416 Internet Device(MID) platform. Moorestown consists of two chips: 432 Internet Device(MID) platform. Moorestown consists of two chips:
@@ -1726,7 +1742,7 @@ source "drivers/sfi/Kconfig"
1726 1742
1727config X86_APM_BOOT 1743config X86_APM_BOOT
1728 def_bool y 1744 def_bool y
1729 depends on APM || APM_MODULE 1745 depends on APM
1730 1746
1731menuconfig APM 1747menuconfig APM
1732 tristate "APM (Advanced Power Management) BIOS support" 1748 tristate "APM (Advanced Power Management) BIOS support"
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index a6253ec1b284..3e274564f6bf 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -134,7 +134,7 @@ ENTRY(ia32_sysenter_target)
134 CFI_REL_OFFSET rsp,0 134 CFI_REL_OFFSET rsp,0
135 pushfq_cfi 135 pushfq_cfi
136 /*CFI_REL_OFFSET rflags,0*/ 136 /*CFI_REL_OFFSET rflags,0*/
137 movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d 137 movl TI_sysenter_return+THREAD_INFO(%rsp,3*8-KERNEL_STACK_OFFSET),%r10d
138 CFI_REGISTER rip,r10 138 CFI_REGISTER rip,r10
139 pushq_cfi $__USER32_CS 139 pushq_cfi $__USER32_CS
140 /*CFI_REL_OFFSET cs,0*/ 140 /*CFI_REL_OFFSET cs,0*/
@@ -150,9 +150,8 @@ ENTRY(ia32_sysenter_target)
150 .section __ex_table,"a" 150 .section __ex_table,"a"
151 .quad 1b,ia32_badarg 151 .quad 1b,ia32_badarg
152 .previous 152 .previous
153 GET_THREAD_INFO(%r10) 153 orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
154 orl $TS_COMPAT,TI_status(%r10) 154 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
155 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
156 CFI_REMEMBER_STATE 155 CFI_REMEMBER_STATE
157 jnz sysenter_tracesys 156 jnz sysenter_tracesys
158 cmpq $(IA32_NR_syscalls-1),%rax 157 cmpq $(IA32_NR_syscalls-1),%rax
@@ -162,13 +161,12 @@ sysenter_do_call:
162sysenter_dispatch: 161sysenter_dispatch:
163 call *ia32_sys_call_table(,%rax,8) 162 call *ia32_sys_call_table(,%rax,8)
164 movq %rax,RAX-ARGOFFSET(%rsp) 163 movq %rax,RAX-ARGOFFSET(%rsp)
165 GET_THREAD_INFO(%r10)
166 DISABLE_INTERRUPTS(CLBR_NONE) 164 DISABLE_INTERRUPTS(CLBR_NONE)
167 TRACE_IRQS_OFF 165 TRACE_IRQS_OFF
168 testl $_TIF_ALLWORK_MASK,TI_flags(%r10) 166 testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
169 jnz sysexit_audit 167 jnz sysexit_audit
170sysexit_from_sys_call: 168sysexit_from_sys_call:
171 andl $~TS_COMPAT,TI_status(%r10) 169 andl $~TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
172 /* clear IF, that popfq doesn't enable interrupts early */ 170 /* clear IF, that popfq doesn't enable interrupts early */
173 andl $~0x200,EFLAGS-R11(%rsp) 171 andl $~0x200,EFLAGS-R11(%rsp)
174 movl RIP-R11(%rsp),%edx /* User %eip */ 172 movl RIP-R11(%rsp),%edx /* User %eip */
@@ -205,7 +203,7 @@ sysexit_from_sys_call:
205 .endm 203 .endm
206 204
207 .macro auditsys_exit exit 205 .macro auditsys_exit exit
208 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) 206 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
209 jnz ia32_ret_from_sys_call 207 jnz ia32_ret_from_sys_call
210 TRACE_IRQS_ON 208 TRACE_IRQS_ON
211 sti 209 sti
@@ -215,12 +213,11 @@ sysexit_from_sys_call:
215 movzbl %al,%edi /* zero-extend that into %edi */ 213 movzbl %al,%edi /* zero-extend that into %edi */
216 inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */ 214 inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */
217 call audit_syscall_exit 215 call audit_syscall_exit
218 GET_THREAD_INFO(%r10)
219 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */ 216 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
220 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi 217 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
221 cli 218 cli
222 TRACE_IRQS_OFF 219 TRACE_IRQS_OFF
223 testl %edi,TI_flags(%r10) 220 testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
224 jz \exit 221 jz \exit
225 CLEAR_RREGS -ARGOFFSET 222 CLEAR_RREGS -ARGOFFSET
226 jmp int_with_check 223 jmp int_with_check
@@ -238,7 +235,7 @@ sysexit_audit:
238 235
239sysenter_tracesys: 236sysenter_tracesys:
240#ifdef CONFIG_AUDITSYSCALL 237#ifdef CONFIG_AUDITSYSCALL
241 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) 238 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
242 jz sysenter_auditsys 239 jz sysenter_auditsys
243#endif 240#endif
244 SAVE_REST 241 SAVE_REST
@@ -309,9 +306,8 @@ ENTRY(ia32_cstar_target)
309 .section __ex_table,"a" 306 .section __ex_table,"a"
310 .quad 1b,ia32_badarg 307 .quad 1b,ia32_badarg
311 .previous 308 .previous
312 GET_THREAD_INFO(%r10) 309 orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
313 orl $TS_COMPAT,TI_status(%r10) 310 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
314 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
315 CFI_REMEMBER_STATE 311 CFI_REMEMBER_STATE
316 jnz cstar_tracesys 312 jnz cstar_tracesys
317 cmpq $IA32_NR_syscalls-1,%rax 313 cmpq $IA32_NR_syscalls-1,%rax
@@ -321,13 +317,12 @@ cstar_do_call:
321cstar_dispatch: 317cstar_dispatch:
322 call *ia32_sys_call_table(,%rax,8) 318 call *ia32_sys_call_table(,%rax,8)
323 movq %rax,RAX-ARGOFFSET(%rsp) 319 movq %rax,RAX-ARGOFFSET(%rsp)
324 GET_THREAD_INFO(%r10)
325 DISABLE_INTERRUPTS(CLBR_NONE) 320 DISABLE_INTERRUPTS(CLBR_NONE)
326 TRACE_IRQS_OFF 321 TRACE_IRQS_OFF
327 testl $_TIF_ALLWORK_MASK,TI_flags(%r10) 322 testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
328 jnz sysretl_audit 323 jnz sysretl_audit
329sysretl_from_sys_call: 324sysretl_from_sys_call:
330 andl $~TS_COMPAT,TI_status(%r10) 325 andl $~TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
331 RESTORE_ARGS 0,-ARG_SKIP,0,0,0 326 RESTORE_ARGS 0,-ARG_SKIP,0,0,0
332 movl RIP-ARGOFFSET(%rsp),%ecx 327 movl RIP-ARGOFFSET(%rsp),%ecx
333 CFI_REGISTER rip,rcx 328 CFI_REGISTER rip,rcx
@@ -355,7 +350,7 @@ sysretl_audit:
355 350
356cstar_tracesys: 351cstar_tracesys:
357#ifdef CONFIG_AUDITSYSCALL 352#ifdef CONFIG_AUDITSYSCALL
358 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) 353 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
359 jz cstar_auditsys 354 jz cstar_auditsys
360#endif 355#endif
361 xchgl %r9d,%ebp 356 xchgl %r9d,%ebp
@@ -420,9 +415,8 @@ ENTRY(ia32_syscall)
420 /* note the registers are not zero extended to the sf. 415 /* note the registers are not zero extended to the sf.
421 this could be a problem. */ 416 this could be a problem. */
422 SAVE_ARGS 0,1,0 417 SAVE_ARGS 0,1,0
423 GET_THREAD_INFO(%r10) 418 orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
424 orl $TS_COMPAT,TI_status(%r10) 419 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
425 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
426 jnz ia32_tracesys 420 jnz ia32_tracesys
427 cmpq $(IA32_NR_syscalls-1),%rax 421 cmpq $(IA32_NR_syscalls-1),%rax
428 ja ia32_badsys 422 ja ia32_badsys
@@ -459,8 +453,8 @@ quiet_ni_syscall:
459 CFI_ENDPROC 453 CFI_ENDPROC
460 454
461 .macro PTREGSCALL label, func, arg 455 .macro PTREGSCALL label, func, arg
462 .globl \label 456 ALIGN
463\label: 457GLOBAL(\label)
464 leaq \func(%rip),%rax 458 leaq \func(%rip),%rax
465 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */ 459 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
466 jmp ia32_ptregs_common 460 jmp ia32_ptregs_common
@@ -477,7 +471,8 @@ quiet_ni_syscall:
477 PTREGSCALL stub32_vfork, sys_vfork, %rdi 471 PTREGSCALL stub32_vfork, sys_vfork, %rdi
478 PTREGSCALL stub32_iopl, sys_iopl, %rsi 472 PTREGSCALL stub32_iopl, sys_iopl, %rsi
479 473
480ENTRY(ia32_ptregs_common) 474 ALIGN
475ia32_ptregs_common:
481 popq %r11 476 popq %r11
482 CFI_ENDPROC 477 CFI_ENDPROC
483 CFI_STARTPROC32 simple 478 CFI_STARTPROC32 simple
diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h
index 091508b533b4..952bd0100c5c 100644
--- a/arch/x86/include/asm/alternative-asm.h
+++ b/arch/x86/include/asm/alternative-asm.h
@@ -4,10 +4,10 @@
4 4
5#ifdef CONFIG_SMP 5#ifdef CONFIG_SMP
6 .macro LOCK_PREFIX 6 .macro LOCK_PREFIX
71: lock 7672: lock
8 .section .smp_locks,"a" 8 .section .smp_locks,"a"
9 .balign 4 9 .balign 4
10 .long 1b - . 10 .long 672b - .
11 .previous 11 .previous
12 .endm 12 .endm
13#else 13#else
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 9b7273cb2193..3ab9bdd87e79 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -49,6 +49,7 @@ extern unsigned int apic_verbosity;
49extern int local_apic_timer_c2_ok; 49extern int local_apic_timer_c2_ok;
50 50
51extern int disable_apic; 51extern int disable_apic;
52extern unsigned int lapic_timer_frequency;
52 53
53#ifdef CONFIG_SMP 54#ifdef CONFIG_SMP
54extern void __inquire_remote_apic(int apicid); 55extern void __inquire_remote_apic(int apicid);
@@ -175,6 +176,7 @@ static inline u64 native_x2apic_icr_read(void)
175} 176}
176 177
177extern int x2apic_phys; 178extern int x2apic_phys;
179extern int x2apic_preenabled;
178extern void check_x2apic(void); 180extern void check_x2apic(void);
179extern void enable_x2apic(void); 181extern void enable_x2apic(void);
180extern void x2apic_icr_write(u32 low, u32 id); 182extern void x2apic_icr_write(u32 low, u32 id);
@@ -197,6 +199,9 @@ static inline void x2apic_force_phys(void)
197 x2apic_phys = 1; 199 x2apic_phys = 1;
198} 200}
199#else 201#else
202static inline void disable_x2apic(void)
203{
204}
200static inline void check_x2apic(void) 205static inline void check_x2apic(void)
201{ 206{
202} 207}
@@ -211,6 +216,7 @@ static inline void x2apic_force_phys(void)
211{ 216{
212} 217}
213 218
219#define nox2apic 0
214#define x2apic_preenabled 0 220#define x2apic_preenabled 0
215#define x2apic_supported() 0 221#define x2apic_supported() 0
216#endif 222#endif
@@ -409,6 +415,7 @@ extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip);
409#endif 415#endif
410 416
411#ifdef CONFIG_X86_LOCAL_APIC 417#ifdef CONFIG_X86_LOCAL_APIC
418
412static inline u32 apic_read(u32 reg) 419static inline u32 apic_read(u32 reg)
413{ 420{
414 return apic->read(reg); 421 return apic->read(reg);
diff --git a/arch/x86/include/asm/apic_flat_64.h b/arch/x86/include/asm/apic_flat_64.h
new file mode 100644
index 000000000000..a2d312796440
--- /dev/null
+++ b/arch/x86/include/asm/apic_flat_64.h
@@ -0,0 +1,7 @@
1#ifndef _ASM_X86_APIC_FLAT_64_H
2#define _ASM_X86_APIC_FLAT_64_H
3
4extern void flat_init_apic_ldr(void);
5
6#endif
7
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h
index 3925d8007864..134bba00df09 100644
--- a/arch/x86/include/asm/apicdef.h
+++ b/arch/x86/include/asm/apicdef.h
@@ -144,6 +144,7 @@
144 144
145#define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) 145#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))
146#define APIC_BASE_MSR 0x800 146#define APIC_BASE_MSR 0x800
147#define XAPIC_ENABLE (1UL << 11)
147#define X2APIC_ENABLE (1UL << 10) 148#define X2APIC_ENABLE (1UL << 10)
148 149
149#ifdef CONFIG_X86_32 150#ifdef CONFIG_X86_32
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 1775d6e5920e..b97596e2b68c 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -380,6 +380,8 @@ static inline unsigned long __fls(unsigned long word)
380 return word; 380 return word;
381} 381}
382 382
383#undef ADDR
384
383#ifdef __KERNEL__ 385#ifdef __KERNEL__
384/** 386/**
385 * ffs - find first set bit in word 387 * ffs - find first set bit in word
@@ -395,10 +397,25 @@ static inline unsigned long __fls(unsigned long word)
395static inline int ffs(int x) 397static inline int ffs(int x)
396{ 398{
397 int r; 399 int r;
398#ifdef CONFIG_X86_CMOV 400
401#ifdef CONFIG_X86_64
402 /*
403 * AMD64 says BSFL won't clobber the dest reg if x==0; Intel64 says the
404 * dest reg is undefined if x==0, but their CPU architect says its
405 * value is written to set it to the same as before, except that the
406 * top 32 bits will be cleared.
407 *
408 * We cannot do this on 32 bits because at the very least some
409 * 486 CPUs did not behave this way.
410 */
411 long tmp = -1;
412 asm("bsfl %1,%0"
413 : "=r" (r)
414 : "rm" (x), "0" (tmp));
415#elif defined(CONFIG_X86_CMOV)
399 asm("bsfl %1,%0\n\t" 416 asm("bsfl %1,%0\n\t"
400 "cmovzl %2,%0" 417 "cmovzl %2,%0"
401 : "=r" (r) : "rm" (x), "r" (-1)); 418 : "=&r" (r) : "rm" (x), "r" (-1));
402#else 419#else
403 asm("bsfl %1,%0\n\t" 420 asm("bsfl %1,%0\n\t"
404 "jnz 1f\n\t" 421 "jnz 1f\n\t"
@@ -422,7 +439,22 @@ static inline int ffs(int x)
422static inline int fls(int x) 439static inline int fls(int x)
423{ 440{
424 int r; 441 int r;
425#ifdef CONFIG_X86_CMOV 442
443#ifdef CONFIG_X86_64
444 /*
445 * AMD64 says BSRL won't clobber the dest reg if x==0; Intel64 says the
446 * dest reg is undefined if x==0, but their CPU architect says its
447 * value is written to set it to the same as before, except that the
448 * top 32 bits will be cleared.
449 *
450 * We cannot do this on 32 bits because at the very least some
451 * 486 CPUs did not behave this way.
452 */
453 long tmp = -1;
454 asm("bsrl %1,%0"
455 : "=r" (r)
456 : "rm" (x), "0" (tmp));
457#elif defined(CONFIG_X86_CMOV)
426 asm("bsrl %1,%0\n\t" 458 asm("bsrl %1,%0\n\t"
427 "cmovzl %2,%0" 459 "cmovzl %2,%0"
428 : "=&r" (r) : "rm" (x), "rm" (-1)); 460 : "=&r" (r) : "rm" (x), "rm" (-1));
@@ -434,11 +466,35 @@ static inline int fls(int x)
434#endif 466#endif
435 return r + 1; 467 return r + 1;
436} 468}
437#endif /* __KERNEL__ */
438
439#undef ADDR
440 469
441#ifdef __KERNEL__ 470/**
471 * fls64 - find last set bit in a 64-bit word
472 * @x: the word to search
473 *
474 * This is defined in a similar way as the libc and compiler builtin
475 * ffsll, but returns the position of the most significant set bit.
476 *
477 * fls64(value) returns 0 if value is 0 or the position of the last
478 * set bit if value is nonzero. The last (most significant) bit is
479 * at position 64.
480 */
481#ifdef CONFIG_X86_64
482static __always_inline int fls64(__u64 x)
483{
484 long bitpos = -1;
485 /*
486 * AMD64 says BSRQ won't clobber the dest reg if x==0; Intel64 says the
487 * dest reg is undefined if x==0, but their CPU architect says its
488 * value is written to set it to the same as before.
489 */
490 asm("bsrq %1,%0"
491 : "+r" (bitpos)
492 : "rm" (x));
493 return bitpos + 1;
494}
495#else
496#include <asm-generic/bitops/fls64.h>
497#endif
442 498
443#include <asm-generic/bitops/find.h> 499#include <asm-generic/bitops/find.h>
444 500
@@ -450,12 +506,6 @@ static inline int fls(int x)
450 506
451#include <asm-generic/bitops/const_hweight.h> 507#include <asm-generic/bitops/const_hweight.h>
452 508
453#endif /* __KERNEL__ */
454
455#include <asm-generic/bitops/fls64.h>
456
457#ifdef __KERNEL__
458
459#include <asm-generic/bitops/le.h> 509#include <asm-generic/bitops/le.h>
460 510
461#include <asm-generic/bitops/ext2-atomic-setbit.h> 511#include <asm-generic/bitops/ext2-atomic-setbit.h>
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index 5d3acdf5a7a6..0c9fa2745f13 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -14,6 +14,8 @@ extern void __cmpxchg_wrong_size(void)
14 __compiletime_error("Bad argument size for cmpxchg"); 14 __compiletime_error("Bad argument size for cmpxchg");
15extern void __xadd_wrong_size(void) 15extern void __xadd_wrong_size(void)
16 __compiletime_error("Bad argument size for xadd"); 16 __compiletime_error("Bad argument size for xadd");
17extern void __add_wrong_size(void)
18 __compiletime_error("Bad argument size for add");
17 19
18/* 20/*
19 * Constants for operation sizes. On 32-bit, the 64-bit size it set to 21 * Constants for operation sizes. On 32-bit, the 64-bit size it set to
@@ -31,60 +33,47 @@ extern void __xadd_wrong_size(void)
31#define __X86_CASE_Q -1 /* sizeof will never return -1 */ 33#define __X86_CASE_Q -1 /* sizeof will never return -1 */
32#endif 34#endif
33 35
36/*
37 * An exchange-type operation, which takes a value and a pointer, and
38 * returns a the old value.
39 */
40#define __xchg_op(ptr, arg, op, lock) \
41 ({ \
42 __typeof__ (*(ptr)) __ret = (arg); \
43 switch (sizeof(*(ptr))) { \
44 case __X86_CASE_B: \
45 asm volatile (lock #op "b %b0, %1\n" \
46 : "+r" (__ret), "+m" (*(ptr)) \
47 : : "memory", "cc"); \
48 break; \
49 case __X86_CASE_W: \
50 asm volatile (lock #op "w %w0, %1\n" \
51 : "+r" (__ret), "+m" (*(ptr)) \
52 : : "memory", "cc"); \
53 break; \
54 case __X86_CASE_L: \
55 asm volatile (lock #op "l %0, %1\n" \
56 : "+r" (__ret), "+m" (*(ptr)) \
57 : : "memory", "cc"); \
58 break; \
59 case __X86_CASE_Q: \
60 asm volatile (lock #op "q %q0, %1\n" \
61 : "+r" (__ret), "+m" (*(ptr)) \
62 : : "memory", "cc"); \
63 break; \
64 default: \
65 __ ## op ## _wrong_size(); \
66 } \
67 __ret; \
68 })
69
34/* 70/*
35 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway. 71 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway.
36 * Since this is generally used to protect other memory information, we 72 * Since this is generally used to protect other memory information, we
37 * use "asm volatile" and "memory" clobbers to prevent gcc from moving 73 * use "asm volatile" and "memory" clobbers to prevent gcc from moving
38 * information around. 74 * information around.
39 */ 75 */
40#define __xchg(x, ptr, size) \ 76#define xchg(ptr, v) __xchg_op((ptr), (v), xchg, "")
41({ \
42 __typeof(*(ptr)) __x = (x); \
43 switch (size) { \
44 case __X86_CASE_B: \
45 { \
46 volatile u8 *__ptr = (volatile u8 *)(ptr); \
47 asm volatile("xchgb %0,%1" \
48 : "=q" (__x), "+m" (*__ptr) \
49 : "0" (__x) \
50 : "memory"); \
51 break; \
52 } \
53 case __X86_CASE_W: \
54 { \
55 volatile u16 *__ptr = (volatile u16 *)(ptr); \
56 asm volatile("xchgw %0,%1" \
57 : "=r" (__x), "+m" (*__ptr) \
58 : "0" (__x) \
59 : "memory"); \
60 break; \
61 } \
62 case __X86_CASE_L: \
63 { \
64 volatile u32 *__ptr = (volatile u32 *)(ptr); \
65 asm volatile("xchgl %0,%1" \
66 : "=r" (__x), "+m" (*__ptr) \
67 : "0" (__x) \
68 : "memory"); \
69 break; \
70 } \
71 case __X86_CASE_Q: \
72 { \
73 volatile u64 *__ptr = (volatile u64 *)(ptr); \
74 asm volatile("xchgq %0,%1" \
75 : "=r" (__x), "+m" (*__ptr) \
76 : "0" (__x) \
77 : "memory"); \
78 break; \
79 } \
80 default: \
81 __xchg_wrong_size(); \
82 } \
83 __x; \
84})
85
86#define xchg(ptr, v) \
87 __xchg((v), (ptr), sizeof(*ptr))
88 77
89/* 78/*
90 * Atomic compare and exchange. Compare OLD with MEM, if identical, 79 * Atomic compare and exchange. Compare OLD with MEM, if identical,
@@ -165,46 +154,80 @@ extern void __xadd_wrong_size(void)
165 __cmpxchg_local((ptr), (old), (new), sizeof(*ptr)) 154 __cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
166#endif 155#endif
167 156
168#define __xadd(ptr, inc, lock) \ 157/*
158 * xadd() adds "inc" to "*ptr" and atomically returns the previous
159 * value of "*ptr".
160 *
161 * xadd() is locked when multiple CPUs are online
162 * xadd_sync() is always locked
163 * xadd_local() is never locked
164 */
165#define __xadd(ptr, inc, lock) __xchg_op((ptr), (inc), xadd, lock)
166#define xadd(ptr, inc) __xadd((ptr), (inc), LOCK_PREFIX)
167#define xadd_sync(ptr, inc) __xadd((ptr), (inc), "lock; ")
168#define xadd_local(ptr, inc) __xadd((ptr), (inc), "")
169
170#define __add(ptr, inc, lock) \
169 ({ \ 171 ({ \
170 __typeof__ (*(ptr)) __ret = (inc); \ 172 __typeof__ (*(ptr)) __ret = (inc); \
171 switch (sizeof(*(ptr))) { \ 173 switch (sizeof(*(ptr))) { \
172 case __X86_CASE_B: \ 174 case __X86_CASE_B: \
173 asm volatile (lock "xaddb %b0, %1\n" \ 175 asm volatile (lock "addb %b1, %0\n" \
174 : "+r" (__ret), "+m" (*(ptr)) \ 176 : "+m" (*(ptr)) : "ri" (inc) \
175 : : "memory", "cc"); \ 177 : "memory", "cc"); \
176 break; \ 178 break; \
177 case __X86_CASE_W: \ 179 case __X86_CASE_W: \
178 asm volatile (lock "xaddw %w0, %1\n" \ 180 asm volatile (lock "addw %w1, %0\n" \
179 : "+r" (__ret), "+m" (*(ptr)) \ 181 : "+m" (*(ptr)) : "ri" (inc) \
180 : : "memory", "cc"); \ 182 : "memory", "cc"); \
181 break; \ 183 break; \
182 case __X86_CASE_L: \ 184 case __X86_CASE_L: \
183 asm volatile (lock "xaddl %0, %1\n" \ 185 asm volatile (lock "addl %1, %0\n" \
184 : "+r" (__ret), "+m" (*(ptr)) \ 186 : "+m" (*(ptr)) : "ri" (inc) \
185 : : "memory", "cc"); \ 187 : "memory", "cc"); \
186 break; \ 188 break; \
187 case __X86_CASE_Q: \ 189 case __X86_CASE_Q: \
188 asm volatile (lock "xaddq %q0, %1\n" \ 190 asm volatile (lock "addq %1, %0\n" \
189 : "+r" (__ret), "+m" (*(ptr)) \ 191 : "+m" (*(ptr)) : "ri" (inc) \
190 : : "memory", "cc"); \ 192 : "memory", "cc"); \
191 break; \ 193 break; \
192 default: \ 194 default: \
193 __xadd_wrong_size(); \ 195 __add_wrong_size(); \
194 } \ 196 } \
195 __ret; \ 197 __ret; \
196 }) 198 })
197 199
198/* 200/*
199 * xadd() adds "inc" to "*ptr" and atomically returns the previous 201 * add_*() adds "inc" to "*ptr"
200 * value of "*ptr".
201 * 202 *
202 * xadd() is locked when multiple CPUs are online 203 * __add() takes a lock prefix
203 * xadd_sync() is always locked 204 * add_smp() is locked when multiple CPUs are online
204 * xadd_local() is never locked 205 * add_sync() is always locked
205 */ 206 */
206#define xadd(ptr, inc) __xadd((ptr), (inc), LOCK_PREFIX) 207#define add_smp(ptr, inc) __add((ptr), (inc), LOCK_PREFIX)
207#define xadd_sync(ptr, inc) __xadd((ptr), (inc), "lock; ") 208#define add_sync(ptr, inc) __add((ptr), (inc), "lock; ")
208#define xadd_local(ptr, inc) __xadd((ptr), (inc), "") 209
210#define __cmpxchg_double(pfx, p1, p2, o1, o2, n1, n2) \
211({ \
212 bool __ret; \
213 __typeof__(*(p1)) __old1 = (o1), __new1 = (n1); \
214 __typeof__(*(p2)) __old2 = (o2), __new2 = (n2); \
215 BUILD_BUG_ON(sizeof(*(p1)) != sizeof(long)); \
216 BUILD_BUG_ON(sizeof(*(p2)) != sizeof(long)); \
217 VM_BUG_ON((unsigned long)(p1) % (2 * sizeof(long))); \
218 VM_BUG_ON((unsigned long)((p1) + 1) != (unsigned long)(p2)); \
219 asm volatile(pfx "cmpxchg%c4b %2; sete %0" \
220 : "=a" (__ret), "+d" (__old2), \
221 "+m" (*(p1)), "+m" (*(p2)) \
222 : "i" (2 * sizeof(long)), "a" (__old1), \
223 "b" (__new1), "c" (__new2)); \
224 __ret; \
225})
226
227#define cmpxchg_double(p1, p2, o1, o2, n1, n2) \
228 __cmpxchg_double(LOCK_PREFIX, p1, p2, o1, o2, n1, n2)
229
230#define cmpxchg_double_local(p1, p2, o1, o2, n1, n2) \
231 __cmpxchg_double(, p1, p2, o1, o2, n1, n2)
209 232
210#endif /* ASM_X86_CMPXCHG_H */ 233#endif /* ASM_X86_CMPXCHG_H */
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index fbebb07dd80b..53f4b219336b 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -166,52 +166,6 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
166 166
167#endif 167#endif
168 168
169#define cmpxchg8b(ptr, o1, o2, n1, n2) \
170({ \
171 char __ret; \
172 __typeof__(o2) __dummy; \
173 __typeof__(*(ptr)) __old1 = (o1); \
174 __typeof__(o2) __old2 = (o2); \
175 __typeof__(*(ptr)) __new1 = (n1); \
176 __typeof__(o2) __new2 = (n2); \
177 asm volatile(LOCK_PREFIX "cmpxchg8b %2; setz %1" \
178 : "=d"(__dummy), "=a" (__ret), "+m" (*ptr)\
179 : "a" (__old1), "d"(__old2), \
180 "b" (__new1), "c" (__new2) \
181 : "memory"); \
182 __ret; })
183
184
185#define cmpxchg8b_local(ptr, o1, o2, n1, n2) \
186({ \
187 char __ret; \
188 __typeof__(o2) __dummy; \
189 __typeof__(*(ptr)) __old1 = (o1); \
190 __typeof__(o2) __old2 = (o2); \
191 __typeof__(*(ptr)) __new1 = (n1); \
192 __typeof__(o2) __new2 = (n2); \
193 asm volatile("cmpxchg8b %2; setz %1" \
194 : "=d"(__dummy), "=a"(__ret), "+m" (*ptr)\
195 : "a" (__old), "d"(__old2), \
196 "b" (__new1), "c" (__new2), \
197 : "memory"); \
198 __ret; })
199
200
201#define cmpxchg_double(ptr, o1, o2, n1, n2) \
202({ \
203 BUILD_BUG_ON(sizeof(*(ptr)) != 4); \
204 VM_BUG_ON((unsigned long)(ptr) % 8); \
205 cmpxchg8b((ptr), (o1), (o2), (n1), (n2)); \
206})
207
208#define cmpxchg_double_local(ptr, o1, o2, n1, n2) \
209({ \
210 BUILD_BUG_ON(sizeof(*(ptr)) != 4); \
211 VM_BUG_ON((unsigned long)(ptr) % 8); \
212 cmpxchg16b_local((ptr), (o1), (o2), (n1), (n2)); \
213})
214
215#define system_has_cmpxchg_double() cpu_has_cx8 169#define system_has_cmpxchg_double() cpu_has_cx8
216 170
217#endif /* _ASM_X86_CMPXCHG_32_H */ 171#endif /* _ASM_X86_CMPXCHG_32_H */
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index 285da02c38fa..614be87f1a9b 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -20,49 +20,6 @@ static inline void set_64bit(volatile u64 *ptr, u64 val)
20 cmpxchg_local((ptr), (o), (n)); \ 20 cmpxchg_local((ptr), (o), (n)); \
21}) 21})
22 22
23#define cmpxchg16b(ptr, o1, o2, n1, n2) \
24({ \
25 char __ret; \
26 __typeof__(o2) __junk; \
27 __typeof__(*(ptr)) __old1 = (o1); \
28 __typeof__(o2) __old2 = (o2); \
29 __typeof__(*(ptr)) __new1 = (n1); \
30 __typeof__(o2) __new2 = (n2); \
31 asm volatile(LOCK_PREFIX "cmpxchg16b %2;setz %1" \
32 : "=d"(__junk), "=a"(__ret), "+m" (*ptr) \
33 : "b"(__new1), "c"(__new2), \
34 "a"(__old1), "d"(__old2)); \
35 __ret; })
36
37
38#define cmpxchg16b_local(ptr, o1, o2, n1, n2) \
39({ \
40 char __ret; \
41 __typeof__(o2) __junk; \
42 __typeof__(*(ptr)) __old1 = (o1); \
43 __typeof__(o2) __old2 = (o2); \
44 __typeof__(*(ptr)) __new1 = (n1); \
45 __typeof__(o2) __new2 = (n2); \
46 asm volatile("cmpxchg16b %2;setz %1" \
47 : "=d"(__junk), "=a"(__ret), "+m" (*ptr) \
48 : "b"(__new1), "c"(__new2), \
49 "a"(__old1), "d"(__old2)); \
50 __ret; })
51
52#define cmpxchg_double(ptr, o1, o2, n1, n2) \
53({ \
54 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
55 VM_BUG_ON((unsigned long)(ptr) % 16); \
56 cmpxchg16b((ptr), (o1), (o2), (n1), (n2)); \
57})
58
59#define cmpxchg_double_local(ptr, o1, o2, n1, n2) \
60({ \
61 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
62 VM_BUG_ON((unsigned long)(ptr) % 16); \
63 cmpxchg16b_local((ptr), (o1), (o2), (n1), (n2)); \
64})
65
66#define system_has_cmpxchg_double() cpu_has_cx16 23#define system_has_cmpxchg_double() cpu_has_cx16
67 24
68#endif /* _ASM_X86_CMPXCHG_64_H */ 25#endif /* _ASM_X86_CMPXCHG_64_H */
diff --git a/arch/x86/include/asm/div64.h b/arch/x86/include/asm/div64.h
index 9a2d644c08ef..ced283ac79df 100644
--- a/arch/x86/include/asm/div64.h
+++ b/arch/x86/include/asm/div64.h
@@ -4,6 +4,7 @@
4#ifdef CONFIG_X86_32 4#ifdef CONFIG_X86_32
5 5
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/log2.h>
7 8
8/* 9/*
9 * do_div() is NOT a C function. It wants to return 10 * do_div() is NOT a C function. It wants to return
@@ -21,15 +22,20 @@
21({ \ 22({ \
22 unsigned long __upper, __low, __high, __mod, __base; \ 23 unsigned long __upper, __low, __high, __mod, __base; \
23 __base = (base); \ 24 __base = (base); \
24 asm("":"=a" (__low), "=d" (__high) : "A" (n)); \ 25 if (__builtin_constant_p(__base) && is_power_of_2(__base)) { \
25 __upper = __high; \ 26 __mod = n & (__base - 1); \
26 if (__high) { \ 27 n >>= ilog2(__base); \
27 __upper = __high % (__base); \ 28 } else { \
28 __high = __high / (__base); \ 29 asm("" : "=a" (__low), "=d" (__high) : "A" (n));\
30 __upper = __high; \
31 if (__high) { \
32 __upper = __high % (__base); \
33 __high = __high / (__base); \
34 } \
35 asm("divl %2" : "=a" (__low), "=d" (__mod) \
36 : "rm" (__base), "0" (__low), "1" (__upper)); \
37 asm("" : "=A" (n) : "a" (__low), "d" (__high)); \
29 } \ 38 } \
30 asm("divl %2":"=a" (__low), "=d" (__mod) \
31 : "rm" (__base), "0" (__low), "1" (__upper)); \
32 asm("":"=A" (n) : "a" (__low), "d" (__high)); \
33 __mod; \ 39 __mod; \
34}) 40})
35 41
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 908b96957d88..37782566af24 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -117,7 +117,7 @@ static inline void early_memtest(unsigned long start, unsigned long end)
117 117
118extern unsigned long e820_end_of_ram_pfn(void); 118extern unsigned long e820_end_of_ram_pfn(void);
119extern unsigned long e820_end_of_low_ram_pfn(void); 119extern unsigned long e820_end_of_low_ram_pfn(void);
120extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align); 120extern u64 early_reserve_e820(u64 sizet, u64 align);
121 121
122void memblock_x86_fill(void); 122void memblock_x86_fill(void);
123void memblock_find_dma_reserve(void); 123void memblock_find_dma_reserve(void);
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index 55e4de613f0e..da0b3ca815b7 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -11,6 +11,7 @@ typedef struct {
11#ifdef CONFIG_X86_LOCAL_APIC 11#ifdef CONFIG_X86_LOCAL_APIC
12 unsigned int apic_timer_irqs; /* arch dependent */ 12 unsigned int apic_timer_irqs; /* arch dependent */
13 unsigned int irq_spurious_count; 13 unsigned int irq_spurious_count;
14 unsigned int icr_read_retry_count;
14#endif 15#endif
15 unsigned int x86_platform_ipis; /* arch dependent */ 16 unsigned int x86_platform_ipis; /* arch dependent */
16 unsigned int apic_perf_irqs; 17 unsigned int apic_perf_irqs;
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index c9e09ea05644..6919e936345b 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -218,7 +218,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
218#ifdef CONFIG_SMP 218#ifdef CONFIG_SMP
219#define safe_address (__per_cpu_offset[0]) 219#define safe_address (__per_cpu_offset[0])
220#else 220#else
221#define safe_address (kstat_cpu(0).cpustat.user) 221#define safe_address (__get_cpu_var(kernel_cpustat).cpustat[CPUTIME_USER])
222#endif 222#endif
223 223
224/* 224/*
diff --git a/arch/x86/include/asm/insn.h b/arch/x86/include/asm/insn.h
index 88c765e16410..74df3f1eddfd 100644
--- a/arch/x86/include/asm/insn.h
+++ b/arch/x86/include/asm/insn.h
@@ -137,6 +137,13 @@ static inline int insn_is_avx(struct insn *insn)
137 return (insn->vex_prefix.value != 0); 137 return (insn->vex_prefix.value != 0);
138} 138}
139 139
140/* Ensure this instruction is decoded completely */
141static inline int insn_complete(struct insn *insn)
142{
143 return insn->opcode.got && insn->modrm.got && insn->sib.got &&
144 insn->displacement.got && insn->immediate.got;
145}
146
140static inline insn_byte_t insn_vex_m_bits(struct insn *insn) 147static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
141{ 148{
142 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */ 149 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */
diff --git a/arch/x86/include/asm/intel_scu_ipc.h b/arch/x86/include/asm/intel_scu_ipc.h
index 4420993acc47..925b605eb5c6 100644
--- a/arch/x86/include/asm/intel_scu_ipc.h
+++ b/arch/x86/include/asm/intel_scu_ipc.h
@@ -3,11 +3,15 @@
3 3
4#include <linux/notifier.h> 4#include <linux/notifier.h>
5 5
6#define IPCMSG_VRTC 0xFA /* Set vRTC device */ 6#define IPCMSG_WARM_RESET 0xF0
7 7#define IPCMSG_COLD_RESET 0xF1
8/* Command id associated with message IPCMSG_VRTC */ 8#define IPCMSG_SOFT_RESET 0xF2
9#define IPC_CMD_VRTC_SETTIME 1 /* Set time */ 9#define IPCMSG_COLD_BOOT 0xF3
10#define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */ 10
11#define IPCMSG_VRTC 0xFA /* Set vRTC device */
12 /* Command id associated with message IPCMSG_VRTC */
13 #define IPC_CMD_VRTC_SETTIME 1 /* Set time */
14 #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */
11 15
12/* Read single register */ 16/* Read single register */
13int intel_scu_ipc_ioread8(u16 addr, u8 *data); 17int intel_scu_ipc_ioread8(u16 addr, u8 *data);
diff --git a/arch/x86/include/asm/mach_timer.h b/arch/x86/include/asm/mach_timer.h
index 853728519ae9..88d0c3c74c13 100644
--- a/arch/x86/include/asm/mach_timer.h
+++ b/arch/x86/include/asm/mach_timer.h
@@ -15,7 +15,7 @@
15 15
16#define CALIBRATE_TIME_MSEC 30 /* 30 msecs */ 16#define CALIBRATE_TIME_MSEC 30 /* 30 msecs */
17#define CALIBRATE_LATCH \ 17#define CALIBRATE_LATCH \
18 ((CLOCK_TICK_RATE * CALIBRATE_TIME_MSEC + 1000/2)/1000) 18 ((PIT_TICK_RATE * CALIBRATE_TIME_MSEC + 1000/2)/1000)
19 19
20static inline void mach_prepare_counter(void) 20static inline void mach_prepare_counter(void)
21{ 21{
diff --git a/arch/x86/include/asm/mach_traps.h b/arch/x86/include/asm/mach_traps.h
index 72a8b52e7dfd..a01e7ec7d237 100644
--- a/arch/x86/include/asm/mach_traps.h
+++ b/arch/x86/include/asm/mach_traps.h
@@ -17,7 +17,7 @@
17#define NMI_REASON_CLEAR_IOCHK 0x08 17#define NMI_REASON_CLEAR_IOCHK 0x08
18#define NMI_REASON_CLEAR_MASK 0x0f 18#define NMI_REASON_CLEAR_MASK 0x0f
19 19
20static inline unsigned char get_nmi_reason(void) 20static inline unsigned char default_get_nmi_reason(void)
21{ 21{
22 return inb(NMI_REASON_PORT); 22 return inb(NMI_REASON_PORT);
23} 23}
diff --git a/arch/x86/include/asm/mc146818rtc.h b/arch/x86/include/asm/mc146818rtc.h
index 01fdf5674e24..0e8e85bb7c51 100644
--- a/arch/x86/include/asm/mc146818rtc.h
+++ b/arch/x86/include/asm/mc146818rtc.h
@@ -81,8 +81,8 @@ static inline unsigned char current_lock_cmos_reg(void)
81#else 81#else
82#define lock_cmos_prefix(reg) do {} while (0) 82#define lock_cmos_prefix(reg) do {} while (0)
83#define lock_cmos_suffix(reg) do {} while (0) 83#define lock_cmos_suffix(reg) do {} while (0)
84#define lock_cmos(reg) 84#define lock_cmos(reg) do { } while (0)
85#define unlock_cmos() 85#define unlock_cmos() do { } while (0)
86#define do_i_have_lock_cmos() 0 86#define do_i_have_lock_cmos() 0
87#define current_lock_cmos_reg() 0 87#define current_lock_cmos_reg() 0
88#endif 88#endif
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index c9321f34e55b..f35ce43c1a77 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -50,10 +50,11 @@
50#define MCJ_CTX_MASK 3 50#define MCJ_CTX_MASK 3
51#define MCJ_CTX(flags) ((flags) & MCJ_CTX_MASK) 51#define MCJ_CTX(flags) ((flags) & MCJ_CTX_MASK)
52#define MCJ_CTX_RANDOM 0 /* inject context: random */ 52#define MCJ_CTX_RANDOM 0 /* inject context: random */
53#define MCJ_CTX_PROCESS 1 /* inject context: process */ 53#define MCJ_CTX_PROCESS 0x1 /* inject context: process */
54#define MCJ_CTX_IRQ 2 /* inject context: IRQ */ 54#define MCJ_CTX_IRQ 0x2 /* inject context: IRQ */
55#define MCJ_NMI_BROADCAST 4 /* do NMI broadcasting */ 55#define MCJ_NMI_BROADCAST 0x4 /* do NMI broadcasting */
56#define MCJ_EXCEPTION 8 /* raise as exception */ 56#define MCJ_EXCEPTION 0x8 /* raise as exception */
57#define MCJ_IRQ_BRAODCAST 0x10 /* do IRQ broadcasting */
57 58
58/* Fields are zero when not available */ 59/* Fields are zero when not available */
59struct mce { 60struct mce {
@@ -120,7 +121,8 @@ struct mce_log {
120 121
121#ifdef __KERNEL__ 122#ifdef __KERNEL__
122 123
123extern struct atomic_notifier_head x86_mce_decoder_chain; 124extern void mce_register_decode_chain(struct notifier_block *nb);
125extern void mce_unregister_decode_chain(struct notifier_block *nb);
124 126
125#include <linux/percpu.h> 127#include <linux/percpu.h>
126#include <linux/init.h> 128#include <linux/init.h>
@@ -149,7 +151,7 @@ static inline void enable_p5_mce(void) {}
149 151
150void mce_setup(struct mce *m); 152void mce_setup(struct mce *m);
151void mce_log(struct mce *m); 153void mce_log(struct mce *m);
152DECLARE_PER_CPU(struct sys_device, mce_sysdev); 154DECLARE_PER_CPU(struct device, mce_device);
153 155
154/* 156/*
155 * Maximum banks number. 157 * Maximum banks number.
@@ -201,7 +203,10 @@ int mce_notify_irq(void);
201void mce_notify_process(void); 203void mce_notify_process(void);
202 204
203DECLARE_PER_CPU(struct mce, injectm); 205DECLARE_PER_CPU(struct mce, injectm);
204extern struct file_operations mce_chrdev_ops; 206
207extern void register_mce_write_callback(ssize_t (*)(struct file *filp,
208 const char __user *ubuf,
209 size_t usize, loff_t *off));
205 210
206/* 211/*
207 * Exception handler 212 * Exception handler
diff --git a/arch/x86/include/asm/memblock.h b/arch/x86/include/asm/memblock.h
deleted file mode 100644
index 0cd3800f33b9..000000000000
--- a/arch/x86/include/asm/memblock.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _X86_MEMBLOCK_H
2#define _X86_MEMBLOCK_H
3
4#define ARCH_DISCARD_MEMBLOCK
5
6u64 memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align);
7
8void memblock_x86_reserve_range(u64 start, u64 end, char *name);
9void memblock_x86_free_range(u64 start, u64 end);
10struct range;
11int __get_free_all_memory_range(struct range **range, int nodeid,
12 unsigned long start_pfn, unsigned long end_pfn);
13int get_free_all_memory_range(struct range **rangep, int nodeid);
14
15void memblock_x86_register_active_regions(int nid, unsigned long start_pfn,
16 unsigned long last_pfn);
17u64 memblock_x86_hole_size(u64 start, u64 end);
18u64 memblock_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size, u64 align);
19u64 memblock_x86_free_memory_in_range(u64 addr, u64 limit);
20u64 memblock_x86_memory_in_range(u64 addr, u64 limit);
21bool memblock_x86_check_reserved_size(u64 *addrp, u64 *sizep, u64 align);
22
23#endif
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 24215072d0e1..4ebe157bf73d 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -48,6 +48,7 @@ static inline struct microcode_ops * __init init_intel_microcode(void)
48 48
49#ifdef CONFIG_MICROCODE_AMD 49#ifdef CONFIG_MICROCODE_AMD
50extern struct microcode_ops * __init init_amd_microcode(void); 50extern struct microcode_ops * __init init_amd_microcode(void);
51extern void __exit exit_amd_microcode(void);
51 52
52static inline void get_ucode_data(void *to, const u8 *from, size_t n) 53static inline void get_ucode_data(void *to, const u8 *from, size_t n)
53{ 54{
@@ -59,6 +60,7 @@ static inline struct microcode_ops * __init init_amd_microcode(void)
59{ 60{
60 return NULL; 61 return NULL;
61} 62}
63static inline void __exit exit_amd_microcode(void) {}
62#endif 64#endif
63 65
64#endif /* _ASM_X86_MICROCODE_H */ 66#endif /* _ASM_X86_MICROCODE_H */
diff --git a/arch/x86/include/asm/mrst.h b/arch/x86/include/asm/mrst.h
index 719f00b28ff5..93f79094c224 100644
--- a/arch/x86/include/asm/mrst.h
+++ b/arch/x86/include/asm/mrst.h
@@ -31,11 +31,20 @@ enum mrst_cpu_type {
31}; 31};
32 32
33extern enum mrst_cpu_type __mrst_cpu_chip; 33extern enum mrst_cpu_type __mrst_cpu_chip;
34
35#ifdef CONFIG_X86_INTEL_MID
36
34static inline enum mrst_cpu_type mrst_identify_cpu(void) 37static inline enum mrst_cpu_type mrst_identify_cpu(void)
35{ 38{
36 return __mrst_cpu_chip; 39 return __mrst_cpu_chip;
37} 40}
38 41
42#else /* !CONFIG_X86_INTEL_MID */
43
44#define mrst_identify_cpu() (0)
45
46#endif /* !CONFIG_X86_INTEL_MID */
47
39enum mrst_timer_options { 48enum mrst_timer_options {
40 MRST_TIMER_DEFAULT, 49 MRST_TIMER_DEFAULT,
41 MRST_TIMER_APBT_ONLY, 50 MRST_TIMER_APBT_ONLY,
@@ -44,6 +53,13 @@ enum mrst_timer_options {
44 53
45extern enum mrst_timer_options mrst_timer_options; 54extern enum mrst_timer_options mrst_timer_options;
46 55
56/*
57 * Penwell uses spread spectrum clock, so the freq number is not exactly
58 * the same as reported by MSR based on SDM.
59 */
60#define PENWELL_FSB_FREQ_83SKU 83200
61#define PENWELL_FSB_FREQ_100SKU 99840
62
47#define SFI_MTMR_MAX_NUM 8 63#define SFI_MTMR_MAX_NUM 8
48#define SFI_MRTC_MAX 8 64#define SFI_MRTC_MAX 8
49 65
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 084ef95274cd..95203d40ffdd 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -169,7 +169,14 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high)
169 return native_write_msr_safe(msr, low, high); 169 return native_write_msr_safe(msr, low, high);
170} 170}
171 171
172/* rdmsr with exception handling */ 172/*
173 * rdmsr with exception handling.
174 *
175 * Please note that the exception handling works only after we've
176 * switched to the "smart" #GP handler in trap_init() which knows about
177 * exception tables - using this macro earlier than that causes machine
178 * hangs on boxes which do not implement the @msr in the first argument.
179 */
173#define rdmsr_safe(msr, p1, p2) \ 180#define rdmsr_safe(msr, p1, p2) \
174({ \ 181({ \
175 int __err; \ 182 int __err; \
diff --git a/arch/x86/include/asm/numachip/numachip_csr.h b/arch/x86/include/asm/numachip/numachip_csr.h
new file mode 100644
index 000000000000..660f843df928
--- /dev/null
+++ b/arch/x86/include/asm/numachip/numachip_csr.h
@@ -0,0 +1,167 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Numascale NumaConnect-Specific Header file
7 *
8 * Copyright (C) 2011 Numascale AS. All rights reserved.
9 *
10 * Send feedback to <support@numascale.com>
11 *
12 */
13
14#ifndef _ASM_X86_NUMACHIP_NUMACHIP_CSR_H
15#define _ASM_X86_NUMACHIP_NUMACHIP_CSR_H
16
17#include <linux/numa.h>
18#include <linux/percpu.h>
19#include <linux/io.h>
20#include <linux/swab.h>
21#include <asm/types.h>
22#include <asm/processor.h>
23
24#define CSR_NODE_SHIFT 16
25#define CSR_NODE_BITS(p) (((unsigned long)(p)) << CSR_NODE_SHIFT)
26#define CSR_NODE_MASK 0x0fff /* 4K nodes */
27
28/* 32K CSR space, b15 indicates geo/non-geo */
29#define CSR_OFFSET_MASK 0x7fffUL
30
31/* Global CSR space covers all 4K possible nodes with 64K CSR space per node */
32#define NUMACHIP_GCSR_BASE 0x3fff00000000ULL
33#define NUMACHIP_GCSR_LIM 0x3fff0fffffffULL
34#define NUMACHIP_GCSR_SIZE (NUMACHIP_GCSR_LIM - NUMACHIP_GCSR_BASE + 1)
35
36/*
37 * Local CSR space starts in global CSR space with "nodeid" = 0xfff0, however
38 * when using the direct mapping on x86_64, both start and size needs to be
39 * aligned with PMD_SIZE which is 2M
40 */
41#define NUMACHIP_LCSR_BASE 0x3ffffe000000ULL
42#define NUMACHIP_LCSR_LIM 0x3fffffffffffULL
43#define NUMACHIP_LCSR_SIZE (NUMACHIP_LCSR_LIM - NUMACHIP_LCSR_BASE + 1)
44
45static inline void *gcsr_address(int node, unsigned long offset)
46{
47 return __va(NUMACHIP_GCSR_BASE | (1UL << 15) |
48 CSR_NODE_BITS(node & CSR_NODE_MASK) | (offset & CSR_OFFSET_MASK));
49}
50
51static inline void *lcsr_address(unsigned long offset)
52{
53 return __va(NUMACHIP_LCSR_BASE | (1UL << 15) |
54 CSR_NODE_BITS(0xfff0) | (offset & CSR_OFFSET_MASK));
55}
56
57static inline unsigned int read_gcsr(int node, unsigned long offset)
58{
59 return swab32(readl(gcsr_address(node, offset)));
60}
61
62static inline void write_gcsr(int node, unsigned long offset, unsigned int val)
63{
64 writel(swab32(val), gcsr_address(node, offset));
65}
66
67static inline unsigned int read_lcsr(unsigned long offset)
68{
69 return swab32(readl(lcsr_address(offset)));
70}
71
72static inline void write_lcsr(unsigned long offset, unsigned int val)
73{
74 writel(swab32(val), lcsr_address(offset));
75}
76
77/* ========================================================================= */
78/* CSR_G0_STATE_CLEAR */
79/* ========================================================================= */
80
81#define CSR_G0_STATE_CLEAR (0x000 + (0 << 12))
82union numachip_csr_g0_state_clear {
83 unsigned int v;
84 struct numachip_csr_g0_state_clear_s {
85 unsigned int _state:2;
86 unsigned int _rsvd_2_6:5;
87 unsigned int _lost:1;
88 unsigned int _rsvd_8_31:24;
89 } s;
90};
91
92/* ========================================================================= */
93/* CSR_G0_NODE_IDS */
94/* ========================================================================= */
95
96#define CSR_G0_NODE_IDS (0x008 + (0 << 12))
97union numachip_csr_g0_node_ids {
98 unsigned int v;
99 struct numachip_csr_g0_node_ids_s {
100 unsigned int _initialid:16;
101 unsigned int _nodeid:12;
102 unsigned int _rsvd_28_31:4;
103 } s;
104};
105
106/* ========================================================================= */
107/* CSR_G3_EXT_IRQ_GEN */
108/* ========================================================================= */
109
110#define CSR_G3_EXT_IRQ_GEN (0x030 + (3 << 12))
111union numachip_csr_g3_ext_irq_gen {
112 unsigned int v;
113 struct numachip_csr_g3_ext_irq_gen_s {
114 unsigned int _vector:8;
115 unsigned int _msgtype:3;
116 unsigned int _index:5;
117 unsigned int _destination_apic_id:16;
118 } s;
119};
120
121/* ========================================================================= */
122/* CSR_G3_EXT_IRQ_STATUS */
123/* ========================================================================= */
124
125#define CSR_G3_EXT_IRQ_STATUS (0x034 + (3 << 12))
126union numachip_csr_g3_ext_irq_status {
127 unsigned int v;
128 struct numachip_csr_g3_ext_irq_status_s {
129 unsigned int _result:32;
130 } s;
131};
132
133/* ========================================================================= */
134/* CSR_G3_EXT_IRQ_DEST */
135/* ========================================================================= */
136
137#define CSR_G3_EXT_IRQ_DEST (0x038 + (3 << 12))
138union numachip_csr_g3_ext_irq_dest {
139 unsigned int v;
140 struct numachip_csr_g3_ext_irq_dest_s {
141 unsigned int _irq:8;
142 unsigned int _rsvd_8_31:24;
143 } s;
144};
145
146/* ========================================================================= */
147/* CSR_G3_NC_ATT_MAP_SELECT */
148/* ========================================================================= */
149
150#define CSR_G3_NC_ATT_MAP_SELECT (0x7fc + (3 << 12))
151union numachip_csr_g3_nc_att_map_select {
152 unsigned int v;
153 struct numachip_csr_g3_nc_att_map_select_s {
154 unsigned int _upper_address_bits:4;
155 unsigned int _select_ram:4;
156 unsigned int _rsvd_8_31:24;
157 } s;
158};
159
160/* ========================================================================= */
161/* CSR_G3_NC_ATT_MAP_SELECT_0-255 */
162/* ========================================================================= */
163
164#define CSR_G3_NC_ATT_MAP_SELECT_0 (0x800 + (3 << 12))
165
166#endif /* _ASM_X86_NUMACHIP_NUMACHIP_CSR_H */
167
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 3470c9d0ebba..529bf07e8067 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -451,23 +451,20 @@ do { \
451#endif /* !CONFIG_M386 */ 451#endif /* !CONFIG_M386 */
452 452
453#ifdef CONFIG_X86_CMPXCHG64 453#ifdef CONFIG_X86_CMPXCHG64
454#define percpu_cmpxchg8b_double(pcp1, o1, o2, n1, n2) \ 454#define percpu_cmpxchg8b_double(pcp1, pcp2, o1, o2, n1, n2) \
455({ \ 455({ \
456 char __ret; \ 456 bool __ret; \
457 typeof(o1) __o1 = o1; \ 457 typeof(pcp1) __o1 = (o1), __n1 = (n1); \
458 typeof(o1) __n1 = n1; \ 458 typeof(pcp2) __o2 = (o2), __n2 = (n2); \
459 typeof(o2) __o2 = o2; \
460 typeof(o2) __n2 = n2; \
461 typeof(o2) __dummy = n2; \
462 asm volatile("cmpxchg8b "__percpu_arg(1)"\n\tsetz %0\n\t" \ 459 asm volatile("cmpxchg8b "__percpu_arg(1)"\n\tsetz %0\n\t" \
463 : "=a"(__ret), "=m" (pcp1), "=d"(__dummy) \ 460 : "=a" (__ret), "+m" (pcp1), "+m" (pcp2), "+d" (__o2) \
464 : "b"(__n1), "c"(__n2), "a"(__o1), "d"(__o2)); \ 461 : "b" (__n1), "c" (__n2), "a" (__o1)); \
465 __ret; \ 462 __ret; \
466}) 463})
467 464
468#define __this_cpu_cmpxchg_double_4(pcp1, pcp2, o1, o2, n1, n2) percpu_cmpxchg8b_double(pcp1, o1, o2, n1, n2) 465#define __this_cpu_cmpxchg_double_4 percpu_cmpxchg8b_double
469#define this_cpu_cmpxchg_double_4(pcp1, pcp2, o1, o2, n1, n2) percpu_cmpxchg8b_double(pcp1, o1, o2, n1, n2) 466#define this_cpu_cmpxchg_double_4 percpu_cmpxchg8b_double
470#define irqsafe_cpu_cmpxchg_double_4(pcp1, pcp2, o1, o2, n1, n2) percpu_cmpxchg8b_double(pcp1, o1, o2, n1, n2) 467#define irqsafe_cpu_cmpxchg_double_4 percpu_cmpxchg8b_double
471#endif /* CONFIG_X86_CMPXCHG64 */ 468#endif /* CONFIG_X86_CMPXCHG64 */
472 469
473/* 470/*
@@ -508,31 +505,23 @@ do { \
508 * it in software. The address used in the cmpxchg16 instruction must be 505 * it in software. The address used in the cmpxchg16 instruction must be
509 * aligned to a 16 byte boundary. 506 * aligned to a 16 byte boundary.
510 */ 507 */
511#ifdef CONFIG_SMP 508#define percpu_cmpxchg16b_double(pcp1, pcp2, o1, o2, n1, n2) \
512#define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP3
513#else
514#define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP2
515#endif
516#define percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) \
517({ \ 509({ \
518 char __ret; \ 510 bool __ret; \
519 typeof(o1) __o1 = o1; \ 511 typeof(pcp1) __o1 = (o1), __n1 = (n1); \
520 typeof(o1) __n1 = n1; \ 512 typeof(pcp2) __o2 = (o2), __n2 = (n2); \
521 typeof(o2) __o2 = o2; \ 513 alternative_io("leaq %P1,%%rsi\n\tcall this_cpu_cmpxchg16b_emu\n\t", \
522 typeof(o2) __n2 = n2; \ 514 "cmpxchg16b " __percpu_arg(1) "\n\tsetz %0\n\t", \
523 typeof(o2) __dummy; \
524 alternative_io(CMPXCHG16B_EMU_CALL, \
525 "cmpxchg16b " __percpu_prefix "(%%rsi)\n\tsetz %0\n\t", \
526 X86_FEATURE_CX16, \ 515 X86_FEATURE_CX16, \
527 ASM_OUTPUT2("=a"(__ret), "=d"(__dummy)), \ 516 ASM_OUTPUT2("=a" (__ret), "+m" (pcp1), \
528 "S" (&pcp1), "b"(__n1), "c"(__n2), \ 517 "+m" (pcp2), "+d" (__o2)), \
529 "a"(__o1), "d"(__o2) : "memory"); \ 518 "b" (__n1), "c" (__n2), "a" (__o1) : "rsi"); \
530 __ret; \ 519 __ret; \
531}) 520})
532 521
533#define __this_cpu_cmpxchg_double_8(pcp1, pcp2, o1, o2, n1, n2) percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) 522#define __this_cpu_cmpxchg_double_8 percpu_cmpxchg16b_double
534#define this_cpu_cmpxchg_double_8(pcp1, pcp2, o1, o2, n1, n2) percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) 523#define this_cpu_cmpxchg_double_8 percpu_cmpxchg16b_double
535#define irqsafe_cpu_cmpxchg_double_8(pcp1, pcp2, o1, o2, n1, n2) percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) 524#define irqsafe_cpu_cmpxchg_double_8 percpu_cmpxchg16b_double
536 525
537#endif 526#endif
538 527
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index f61c62f7d5d8..096c975e099f 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -57,6 +57,7 @@
57 (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) 57 (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
58 58
59#define ARCH_PERFMON_BRANCH_MISSES_RETIRED 6 59#define ARCH_PERFMON_BRANCH_MISSES_RETIRED 6
60#define ARCH_PERFMON_EVENTS_COUNT 7
60 61
61/* 62/*
62 * Intel "Architectural Performance Monitoring" CPUID 63 * Intel "Architectural Performance Monitoring" CPUID
@@ -72,6 +73,19 @@ union cpuid10_eax {
72 unsigned int full; 73 unsigned int full;
73}; 74};
74 75
76union cpuid10_ebx {
77 struct {
78 unsigned int no_unhalted_core_cycles:1;
79 unsigned int no_instructions_retired:1;
80 unsigned int no_unhalted_reference_cycles:1;
81 unsigned int no_llc_reference:1;
82 unsigned int no_llc_misses:1;
83 unsigned int no_branch_instruction_retired:1;
84 unsigned int no_branch_misses_retired:1;
85 } split;
86 unsigned int full;
87};
88
75union cpuid10_edx { 89union cpuid10_edx {
76 struct { 90 struct {
77 unsigned int num_counters_fixed:5; 91 unsigned int num_counters_fixed:5;
@@ -81,6 +95,15 @@ union cpuid10_edx {
81 unsigned int full; 95 unsigned int full;
82}; 96};
83 97
98struct x86_pmu_capability {
99 int version;
100 int num_counters_gp;
101 int num_counters_fixed;
102 int bit_width_gp;
103 int bit_width_fixed;
104 unsigned int events_mask;
105 int events_mask_len;
106};
84 107
85/* 108/*
86 * Fixed-purpose performance events: 109 * Fixed-purpose performance events:
@@ -89,23 +112,24 @@ union cpuid10_edx {
89/* 112/*
90 * All 3 fixed-mode PMCs are configured via this single MSR: 113 * All 3 fixed-mode PMCs are configured via this single MSR:
91 */ 114 */
92#define MSR_ARCH_PERFMON_FIXED_CTR_CTRL 0x38d 115#define MSR_ARCH_PERFMON_FIXED_CTR_CTRL 0x38d
93 116
94/* 117/*
95 * The counts are available in three separate MSRs: 118 * The counts are available in three separate MSRs:
96 */ 119 */
97 120
98/* Instr_Retired.Any: */ 121/* Instr_Retired.Any: */
99#define MSR_ARCH_PERFMON_FIXED_CTR0 0x309 122#define MSR_ARCH_PERFMON_FIXED_CTR0 0x309
100#define X86_PMC_IDX_FIXED_INSTRUCTIONS (X86_PMC_IDX_FIXED + 0) 123#define X86_PMC_IDX_FIXED_INSTRUCTIONS (X86_PMC_IDX_FIXED + 0)
101 124
102/* CPU_CLK_Unhalted.Core: */ 125/* CPU_CLK_Unhalted.Core: */
103#define MSR_ARCH_PERFMON_FIXED_CTR1 0x30a 126#define MSR_ARCH_PERFMON_FIXED_CTR1 0x30a
104#define X86_PMC_IDX_FIXED_CPU_CYCLES (X86_PMC_IDX_FIXED + 1) 127#define X86_PMC_IDX_FIXED_CPU_CYCLES (X86_PMC_IDX_FIXED + 1)
105 128
106/* CPU_CLK_Unhalted.Ref: */ 129/* CPU_CLK_Unhalted.Ref: */
107#define MSR_ARCH_PERFMON_FIXED_CTR2 0x30b 130#define MSR_ARCH_PERFMON_FIXED_CTR2 0x30b
108#define X86_PMC_IDX_FIXED_BUS_CYCLES (X86_PMC_IDX_FIXED + 2) 131#define X86_PMC_IDX_FIXED_REF_CYCLES (X86_PMC_IDX_FIXED + 2)
132#define X86_PMC_MSK_FIXED_REF_CYCLES (1ULL << X86_PMC_IDX_FIXED_REF_CYCLES)
109 133
110/* 134/*
111 * We model BTS tracing as another fixed-mode PMC. 135 * We model BTS tracing as another fixed-mode PMC.
@@ -202,6 +226,7 @@ struct perf_guest_switch_msr {
202}; 226};
203 227
204extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr); 228extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr);
229extern void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap);
205#else 230#else
206static inline perf_guest_switch_msr *perf_guest_get_msrs(int *nr) 231static inline perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
207{ 232{
@@ -209,6 +234,11 @@ static inline perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
209 return NULL; 234 return NULL;
210} 235}
211 236
237static inline void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
238{
239 memset(cap, 0, sizeof(*cap));
240}
241
212static inline void perf_events_lapic_init(void) { } 242static inline void perf_events_lapic_init(void) { }
213#endif 243#endif
214 244
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 18601c86fab1..49afb3f41eb6 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -703,7 +703,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm,
703 pte_update(mm, addr, ptep); 703 pte_update(mm, addr, ptep);
704} 704}
705 705
706#define flush_tlb_fix_spurious_fault(vma, address) 706#define flush_tlb_fix_spurious_fault(vma, address) do { } while (0)
707 707
708#define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot)) 708#define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot))
709 709
diff --git a/arch/x86/include/asm/processor-flags.h b/arch/x86/include/asm/processor-flags.h
index 2dddb317bb39..f8ab3eaad128 100644
--- a/arch/x86/include/asm/processor-flags.h
+++ b/arch/x86/include/asm/processor-flags.h
@@ -6,6 +6,7 @@
6 * EFLAGS bits 6 * EFLAGS bits
7 */ 7 */
8#define X86_EFLAGS_CF 0x00000001 /* Carry Flag */ 8#define X86_EFLAGS_CF 0x00000001 /* Carry Flag */
9#define X86_EFLAGS_BIT1 0x00000002 /* Bit 1 - always on */
9#define X86_EFLAGS_PF 0x00000004 /* Parity Flag */ 10#define X86_EFLAGS_PF 0x00000004 /* Parity Flag */
10#define X86_EFLAGS_AF 0x00000010 /* Auxiliary carry Flag */ 11#define X86_EFLAGS_AF 0x00000010 /* Auxiliary carry Flag */
11#define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */ 12#define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index b650435ffb53..aa9088c26931 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -99,7 +99,6 @@ struct cpuinfo_x86 {
99 u16 apicid; 99 u16 apicid;
100 u16 initial_apicid; 100 u16 initial_apicid;
101 u16 x86_clflush_size; 101 u16 x86_clflush_size;
102#ifdef CONFIG_SMP
103 /* number of cores as seen by the OS: */ 102 /* number of cores as seen by the OS: */
104 u16 booted_cores; 103 u16 booted_cores;
105 /* Physical processor id: */ 104 /* Physical processor id: */
@@ -110,7 +109,6 @@ struct cpuinfo_x86 {
110 u8 compute_unit_id; 109 u8 compute_unit_id;
111 /* Index into per_cpu list: */ 110 /* Index into per_cpu list: */
112 u16 cpu_index; 111 u16 cpu_index;
113#endif
114 u32 microcode; 112 u32 microcode;
115} __attribute__((__aligned__(SMP_CACHE_BYTES))); 113} __attribute__((__aligned__(SMP_CACHE_BYTES)));
116 114
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index 972c260919a3..a82c2bf504b6 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -79,23 +79,10 @@ static __always_inline int __ticket_spin_trylock(arch_spinlock_t *lock)
79 return cmpxchg(&lock->head_tail, old.head_tail, new.head_tail) == old.head_tail; 79 return cmpxchg(&lock->head_tail, old.head_tail, new.head_tail) == old.head_tail;
80} 80}
81 81
82#if (NR_CPUS < 256)
83static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock) 82static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock)
84{ 83{
85 asm volatile(UNLOCK_LOCK_PREFIX "incb %0" 84 __add(&lock->tickets.head, 1, UNLOCK_LOCK_PREFIX);
86 : "+m" (lock->head_tail)
87 :
88 : "memory", "cc");
89} 85}
90#else
91static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock)
92{
93 asm volatile(UNLOCK_LOCK_PREFIX "incw %0"
94 : "+m" (lock->head_tail)
95 :
96 : "memory", "cc");
97}
98#endif
99 86
100static inline int __ticket_spin_is_locked(arch_spinlock_t *lock) 87static inline int __ticket_spin_is_locked(arch_spinlock_t *lock)
101{ 88{
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index c2ff2a1d845e..2d2f01ce6dcb 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -401,6 +401,7 @@ extern unsigned long arch_align_stack(unsigned long sp);
401extern void free_init_pages(char *what, unsigned long begin, unsigned long end); 401extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
402 402
403void default_idle(void); 403void default_idle(void);
404bool set_pm_idle_to_default(void);
404 405
405void stop_this_cpu(void *dummy); 406void stop_this_cpu(void *dummy);
406 407
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index a1fe5c127b52..74047159d0ab 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -40,7 +40,8 @@ struct thread_info {
40 */ 40 */
41 __u8 supervisor_stack[0]; 41 __u8 supervisor_stack[0];
42#endif 42#endif
43 int uaccess_err; 43 int sig_on_uaccess_error:1;
44 int uaccess_err:1; /* uaccess failed */
44}; 45};
45 46
46#define INIT_THREAD_INFO(tsk) \ 47#define INIT_THREAD_INFO(tsk) \
@@ -90,7 +91,6 @@ struct thread_info {
90#define TIF_MEMDIE 20 /* is terminating due to OOM killer */ 91#define TIF_MEMDIE 20 /* is terminating due to OOM killer */
91#define TIF_DEBUG 21 /* uses debug registers */ 92#define TIF_DEBUG 21 /* uses debug registers */
92#define TIF_IO_BITMAP 22 /* uses I/O bitmap */ 93#define TIF_IO_BITMAP 22 /* uses I/O bitmap */
93#define TIF_FREEZE 23 /* is freezing for suspend */
94#define TIF_FORCED_TF 24 /* true if TF in eflags artificially */ 94#define TIF_FORCED_TF 24 /* true if TF in eflags artificially */
95#define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */ 95#define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */
96#define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */ 96#define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */
@@ -112,7 +112,6 @@ struct thread_info {
112#define _TIF_FORK (1 << TIF_FORK) 112#define _TIF_FORK (1 << TIF_FORK)
113#define _TIF_DEBUG (1 << TIF_DEBUG) 113#define _TIF_DEBUG (1 << TIF_DEBUG)
114#define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) 114#define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP)
115#define _TIF_FREEZE (1 << TIF_FREEZE)
116#define _TIF_FORCED_TF (1 << TIF_FORCED_TF) 115#define _TIF_FORCED_TF (1 << TIF_FORCED_TF)
117#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) 116#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
118#define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES) 117#define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES)
@@ -231,6 +230,12 @@ static inline struct thread_info *current_thread_info(void)
231 movq PER_CPU_VAR(kernel_stack),reg ; \ 230 movq PER_CPU_VAR(kernel_stack),reg ; \
232 subq $(THREAD_SIZE-KERNEL_STACK_OFFSET),reg 231 subq $(THREAD_SIZE-KERNEL_STACK_OFFSET),reg
233 232
233/*
234 * Same if PER_CPU_VAR(kernel_stack) is, perhaps with some offset, already in
235 * a certain register (to be used in assembler memory operands).
236 */
237#define THREAD_INFO(reg, off) KERNEL_STACK_OFFSET+(off)-THREAD_SIZE(reg)
238
234#endif 239#endif
235 240
236#endif /* !X86_32 */ 241#endif /* !X86_32 */
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index fa7b9176b76c..431793e5d484 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -32,6 +32,22 @@ extern int no_timer_check;
32 * (mathieu.desnoyers@polymtl.ca) 32 * (mathieu.desnoyers@polymtl.ca)
33 * 33 *
34 * -johnstul@us.ibm.com "math is hard, lets go shopping!" 34 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
35 *
36 * In:
37 *
38 * ns = cycles * cyc2ns_scale / SC
39 *
40 * Although we may still have enough bits to store the value of ns,
41 * in some cases, we may not have enough bits to store cycles * cyc2ns_scale,
42 * leading to an incorrect result.
43 *
44 * To avoid this, we can decompose 'cycles' into quotient and remainder
45 * of division by SC. Then,
46 *
47 * ns = (quot * SC + rem) * cyc2ns_scale / SC
48 * = quot * cyc2ns_scale + (rem * cyc2ns_scale) / SC
49 *
50 * - sqazi@google.com
35 */ 51 */
36 52
37DECLARE_PER_CPU(unsigned long, cyc2ns); 53DECLARE_PER_CPU(unsigned long, cyc2ns);
@@ -41,9 +57,14 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset);
41 57
42static inline unsigned long long __cycles_2_ns(unsigned long long cyc) 58static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
43{ 59{
60 unsigned long long quot;
61 unsigned long long rem;
44 int cpu = smp_processor_id(); 62 int cpu = smp_processor_id();
45 unsigned long long ns = per_cpu(cyc2ns_offset, cpu); 63 unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
46 ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_SCALE_FACTOR; 64 quot = (cyc >> CYC2NS_SCALE_FACTOR);
65 rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
66 ns += quot * per_cpu(cyc2ns, cpu) +
67 ((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
47 return ns; 68 return ns;
48} 69}
49 70
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index c00692476e9f..800f77c60051 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -130,10 +130,8 @@ extern void setup_node_to_cpumask_map(void);
130 .balance_interval = 1, \ 130 .balance_interval = 1, \
131} 131}
132 132
133#ifdef CONFIG_X86_64
134extern int __node_distance(int, int); 133extern int __node_distance(int, int);
135#define node_distance(a, b) __node_distance(a, b) 134#define node_distance(a, b) __node_distance(a, b)
136#endif
137 135
138#else /* !CONFIG_NUMA */ 136#else /* !CONFIG_NUMA */
139 137
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index 83e2efd181e2..15d99153a96d 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -51,6 +51,8 @@ extern int unsynchronized_tsc(void);
51extern int check_tsc_unstable(void); 51extern int check_tsc_unstable(void);
52extern unsigned long native_calibrate_tsc(void); 52extern unsigned long native_calibrate_tsc(void);
53 53
54extern int tsc_clocksource_reliable;
55
54/* 56/*
55 * Boot-time check whether the TSCs are synchronized across 57 * Boot-time check whether the TSCs are synchronized across
56 * all CPUs/cores: 58 * all CPUs/cores:
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 36361bf6fdd1..8be5f54d9360 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -462,7 +462,7 @@ struct __large_struct { unsigned long buf[100]; };
462 barrier(); 462 barrier();
463 463
464#define uaccess_catch(err) \ 464#define uaccess_catch(err) \
465 (err) |= current_thread_info()->uaccess_err; \ 465 (err) |= (current_thread_info()->uaccess_err ? -EFAULT : 0); \
466 current_thread_info()->uaccess_err = prev_err; \ 466 current_thread_info()->uaccess_err = prev_err; \
467} while (0) 467} while (0)
468 468
diff --git a/arch/x86/include/asm/uv/uv_mmrs.h b/arch/x86/include/asm/uv/uv_mmrs.h
index 10474fb1185d..cf1d73643f60 100644
--- a/arch/x86/include/asm/uv/uv_mmrs.h
+++ b/arch/x86/include/asm/uv/uv_mmrs.h
@@ -57,6 +57,7 @@
57 57
58#define UV1_HUB_PART_NUMBER 0x88a5 58#define UV1_HUB_PART_NUMBER 0x88a5
59#define UV2_HUB_PART_NUMBER 0x8eb8 59#define UV2_HUB_PART_NUMBER 0x8eb8
60#define UV2_HUB_PART_NUMBER_X 0x1111
60 61
61/* Compat: if this #define is present, UV headers support UV2 */ 62/* Compat: if this #define is present, UV headers support UV2 */
62#define UV2_HUB_IS_SUPPORTED 1 63#define UV2_HUB_IS_SUPPORTED 1
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index d3d859035af9..1ac860a09849 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -7,6 +7,7 @@
7struct mpc_bus; 7struct mpc_bus;
8struct mpc_cpu; 8struct mpc_cpu;
9struct mpc_table; 9struct mpc_table;
10struct cpuinfo_x86;
10 11
11/** 12/**
12 * struct x86_init_mpparse - platform specific mpparse ops 13 * struct x86_init_mpparse - platform specific mpparse ops
@@ -147,11 +148,13 @@ struct x86_init_ops {
147 */ 148 */
148struct x86_cpuinit_ops { 149struct x86_cpuinit_ops {
149 void (*setup_percpu_clockev)(void); 150 void (*setup_percpu_clockev)(void);
151 void (*fixup_cpu_id)(struct cpuinfo_x86 *c, int node);
150}; 152};
151 153
152/** 154/**
153 * struct x86_platform_ops - platform specific runtime functions 155 * struct x86_platform_ops - platform specific runtime functions
154 * @calibrate_tsc: calibrate TSC 156 * @calibrate_tsc: calibrate TSC
157 * @wallclock_init: init the wallclock device
155 * @get_wallclock: get time from HW clock like RTC etc. 158 * @get_wallclock: get time from HW clock like RTC etc.
156 * @set_wallclock: set time back to HW clock 159 * @set_wallclock: set time back to HW clock
157 * @is_untracked_pat_range exclude from PAT logic 160 * @is_untracked_pat_range exclude from PAT logic
@@ -160,11 +163,13 @@ struct x86_cpuinit_ops {
160 */ 163 */
161struct x86_platform_ops { 164struct x86_platform_ops {
162 unsigned long (*calibrate_tsc)(void); 165 unsigned long (*calibrate_tsc)(void);
166 void (*wallclock_init)(void);
163 unsigned long (*get_wallclock)(void); 167 unsigned long (*get_wallclock)(void);
164 int (*set_wallclock)(unsigned long nowtime); 168 int (*set_wallclock)(unsigned long nowtime);
165 void (*iommu_shutdown)(void); 169 void (*iommu_shutdown)(void);
166 bool (*is_untracked_pat_range)(u64 start, u64 end); 170 bool (*is_untracked_pat_range)(u64 start, u64 end);
167 void (*nmi_init)(void); 171 void (*nmi_init)(void);
172 unsigned char (*get_nmi_reason)(void);
168 int (*i8042_detect)(void); 173 int (*i8042_detect)(void);
169}; 174};
170 175
@@ -183,5 +188,6 @@ extern struct x86_msi_ops x86_msi;
183 188
184extern void x86_init_noop(void); 189extern void x86_init_noop(void);
185extern void x86_init_uint_noop(unsigned int unused); 190extern void x86_init_uint_noop(unsigned int unused);
191extern void x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node);
186 192
187#endif 193#endif
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4558f0d0822d..ce664f33ea8e 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -219,6 +219,8 @@ static int __init
219acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) 219acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
220{ 220{
221 struct acpi_madt_local_x2apic *processor = NULL; 221 struct acpi_madt_local_x2apic *processor = NULL;
222 int apic_id;
223 u8 enabled;
222 224
223 processor = (struct acpi_madt_local_x2apic *)header; 225 processor = (struct acpi_madt_local_x2apic *)header;
224 226
@@ -227,6 +229,8 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
227 229
228 acpi_table_print_madt_entry(header); 230 acpi_table_print_madt_entry(header);
229 231
232 apic_id = processor->local_apic_id;
233 enabled = processor->lapic_flags & ACPI_MADT_ENABLED;
230#ifdef CONFIG_X86_X2APIC 234#ifdef CONFIG_X86_X2APIC
231 /* 235 /*
232 * We need to register disabled CPU as well to permit 236 * We need to register disabled CPU as well to permit
@@ -235,8 +239,10 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
235 * to not preallocating memory for all NR_CPUS 239 * to not preallocating memory for all NR_CPUS
236 * when we use CPU hotplug. 240 * when we use CPU hotplug.
237 */ 241 */
238 acpi_register_lapic(processor->local_apic_id, /* APIC ID */ 242 if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled)
239 processor->lapic_flags & ACPI_MADT_ENABLED); 243 printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
244 else
245 acpi_register_lapic(apic_id, enabled);
240#else 246#else
241 printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); 247 printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
242#endif 248#endif
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index c63822816249..1f84794f0759 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -738,5 +738,5 @@ void __kprobes text_poke_smp_batch(struct text_poke_param *params, int n)
738 738
739 atomic_set(&stop_machine_first, 1); 739 atomic_set(&stop_machine_first, 1);
740 wrote_text = 0; 740 wrote_text = 0;
741 __stop_machine(stop_machine_text_poke, (void *)&tpp, NULL); 741 __stop_machine(stop_machine_text_poke, (void *)&tpp, cpu_online_mask);
742} 742}
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 4c39baa8facc..013c1810ce72 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -123,16 +123,14 @@ int amd_get_subcaches(int cpu)
123{ 123{
124 struct pci_dev *link = node_to_amd_nb(amd_get_nb_id(cpu))->link; 124 struct pci_dev *link = node_to_amd_nb(amd_get_nb_id(cpu))->link;
125 unsigned int mask; 125 unsigned int mask;
126 int cuid = 0; 126 int cuid;
127 127
128 if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) 128 if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING))
129 return 0; 129 return 0;
130 130
131 pci_read_config_dword(link, 0x1d4, &mask); 131 pci_read_config_dword(link, 0x1d4, &mask);
132 132
133#ifdef CONFIG_SMP
134 cuid = cpu_data(cpu).compute_unit_id; 133 cuid = cpu_data(cpu).compute_unit_id;
135#endif
136 return (mask >> (4 * cuid)) & 0xf; 134 return (mask >> (4 * cuid)) & 0xf;
137} 135}
138 136
@@ -141,7 +139,7 @@ int amd_set_subcaches(int cpu, int mask)
141 static unsigned int reset, ban; 139 static unsigned int reset, ban;
142 struct amd_northbridge *nb = node_to_amd_nb(amd_get_nb_id(cpu)); 140 struct amd_northbridge *nb = node_to_amd_nb(amd_get_nb_id(cpu));
143 unsigned int reg; 141 unsigned int reg;
144 int cuid = 0; 142 int cuid;
145 143
146 if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING) || mask > 0xf) 144 if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING) || mask > 0xf)
147 return -EINVAL; 145 return -EINVAL;
@@ -159,9 +157,7 @@ int amd_set_subcaches(int cpu, int mask)
159 pci_write_config_dword(nb->misc, 0x1b8, reg & ~0x180000); 157 pci_write_config_dword(nb->misc, 0x1b8, reg & ~0x180000);
160 } 158 }
161 159
162#ifdef CONFIG_SMP
163 cuid = cpu_data(cpu).compute_unit_id; 160 cuid = cpu_data(cpu).compute_unit_id;
164#endif
165 mask <<= 4 * cuid; 161 mask <<= 4 * cuid;
166 mask |= (0xf ^ (1 << cuid)) << 26; 162 mask |= (0xf ^ (1 << cuid)) << 26;
167 163
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 3d2661ca6542..6e76c191a835 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -88,13 +88,13 @@ static u32 __init allocate_aperture(void)
88 */ 88 */
89 addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR, 89 addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR,
90 aper_size, aper_size); 90 aper_size, aper_size);
91 if (addr == MEMBLOCK_ERROR || addr + aper_size > GART_MAX_ADDR) { 91 if (!addr || addr + aper_size > GART_MAX_ADDR) {
92 printk(KERN_ERR 92 printk(KERN_ERR
93 "Cannot allocate aperture memory hole (%lx,%uK)\n", 93 "Cannot allocate aperture memory hole (%lx,%uK)\n",
94 addr, aper_size>>10); 94 addr, aper_size>>10);
95 return 0; 95 return 0;
96 } 96 }
97 memblock_x86_reserve_range(addr, addr + aper_size, "aperture64"); 97 memblock_reserve(addr, aper_size);
98 /* 98 /*
99 * Kmemleak should not scan this block as it may not be mapped via the 99 * Kmemleak should not scan this block as it may not be mapped via the
100 * kernel direct mapping. 100 * kernel direct mapping.
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile
index 767fd04f2843..0ae0323b1f9c 100644
--- a/arch/x86/kernel/apic/Makefile
+++ b/arch/x86/kernel/apic/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_SMP) += ipi.o
10 10
11ifeq ($(CONFIG_X86_64),y) 11ifeq ($(CONFIG_X86_64),y)
12# APIC probe will depend on the listing order here 12# APIC probe will depend on the listing order here
13obj-$(CONFIG_X86_NUMACHIP) += apic_numachip.o
13obj-$(CONFIG_X86_UV) += x2apic_uv_x.o 14obj-$(CONFIG_X86_UV) += x2apic_uv_x.o
14obj-$(CONFIG_X86_X2APIC) += x2apic_phys.o 15obj-$(CONFIG_X86_X2APIC) += x2apic_phys.o
15obj-$(CONFIG_X86_X2APIC) += x2apic_cluster.o 16obj-$(CONFIG_X86_X2APIC) += x2apic_cluster.o
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index a2fd72e0ab35..2eec05b6d1b8 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -146,16 +146,26 @@ __setup("apicpmtimer", setup_apicpmtimer);
146int x2apic_mode; 146int x2apic_mode;
147#ifdef CONFIG_X86_X2APIC 147#ifdef CONFIG_X86_X2APIC
148/* x2apic enabled before OS handover */ 148/* x2apic enabled before OS handover */
149static int x2apic_preenabled; 149int x2apic_preenabled;
150static int x2apic_disabled;
151static int nox2apic;
150static __init int setup_nox2apic(char *str) 152static __init int setup_nox2apic(char *str)
151{ 153{
152 if (x2apic_enabled()) { 154 if (x2apic_enabled()) {
153 pr_warning("Bios already enabled x2apic, " 155 int apicid = native_apic_msr_read(APIC_ID);
154 "can't enforce nox2apic"); 156
155 return 0; 157 if (apicid >= 255) {
156 } 158 pr_warning("Apicid: %08x, cannot enforce nox2apic\n",
159 apicid);
160 return 0;
161 }
162
163 pr_warning("x2apic already enabled. will disable it\n");
164 } else
165 setup_clear_cpu_cap(X86_FEATURE_X2APIC);
166
167 nox2apic = 1;
157 168
158 setup_clear_cpu_cap(X86_FEATURE_X2APIC);
159 return 0; 169 return 0;
160} 170}
161early_param("nox2apic", setup_nox2apic); 171early_param("nox2apic", setup_nox2apic);
@@ -186,7 +196,7 @@ static struct resource lapic_resource = {
186 .flags = IORESOURCE_MEM | IORESOURCE_BUSY, 196 .flags = IORESOURCE_MEM | IORESOURCE_BUSY,
187}; 197};
188 198
189static unsigned int calibration_result; 199unsigned int lapic_timer_frequency = 0;
190 200
191static void apic_pm_activate(void); 201static void apic_pm_activate(void);
192 202
@@ -250,6 +260,7 @@ u32 native_safe_apic_wait_icr_idle(void)
250 send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; 260 send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
251 if (!send_status) 261 if (!send_status)
252 break; 262 break;
263 inc_irq_stat(icr_read_retry_count);
253 udelay(100); 264 udelay(100);
254 } while (timeout++ < 1000); 265 } while (timeout++ < 1000);
255 266
@@ -454,7 +465,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
454 switch (mode) { 465 switch (mode) {
455 case CLOCK_EVT_MODE_PERIODIC: 466 case CLOCK_EVT_MODE_PERIODIC:
456 case CLOCK_EVT_MODE_ONESHOT: 467 case CLOCK_EVT_MODE_ONESHOT:
457 __setup_APIC_LVTT(calibration_result, 468 __setup_APIC_LVTT(lapic_timer_frequency,
458 mode != CLOCK_EVT_MODE_PERIODIC, 1); 469 mode != CLOCK_EVT_MODE_PERIODIC, 1);
459 break; 470 break;
460 case CLOCK_EVT_MODE_UNUSED: 471 case CLOCK_EVT_MODE_UNUSED:
@@ -638,6 +649,25 @@ static int __init calibrate_APIC_clock(void)
638 long delta, deltatsc; 649 long delta, deltatsc;
639 int pm_referenced = 0; 650 int pm_referenced = 0;
640 651
652 /**
653 * check if lapic timer has already been calibrated by platform
654 * specific routine, such as tsc calibration code. if so, we just fill
655 * in the clockevent structure and return.
656 */
657
658 if (lapic_timer_frequency) {
659 apic_printk(APIC_VERBOSE, "lapic timer already calibrated %d\n",
660 lapic_timer_frequency);
661 lapic_clockevent.mult = div_sc(lapic_timer_frequency/APIC_DIVISOR,
662 TICK_NSEC, lapic_clockevent.shift);
663 lapic_clockevent.max_delta_ns =
664 clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
665 lapic_clockevent.min_delta_ns =
666 clockevent_delta2ns(0xF, &lapic_clockevent);
667 lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY;
668 return 0;
669 }
670
641 local_irq_disable(); 671 local_irq_disable();
642 672
643 /* Replace the global interrupt handler */ 673 /* Replace the global interrupt handler */
@@ -679,12 +709,12 @@ static int __init calibrate_APIC_clock(void)
679 lapic_clockevent.min_delta_ns = 709 lapic_clockevent.min_delta_ns =
680 clockevent_delta2ns(0xF, &lapic_clockevent); 710 clockevent_delta2ns(0xF, &lapic_clockevent);
681 711
682 calibration_result = (delta * APIC_DIVISOR) / LAPIC_CAL_LOOPS; 712 lapic_timer_frequency = (delta * APIC_DIVISOR) / LAPIC_CAL_LOOPS;
683 713
684 apic_printk(APIC_VERBOSE, "..... delta %ld\n", delta); 714 apic_printk(APIC_VERBOSE, "..... delta %ld\n", delta);
685 apic_printk(APIC_VERBOSE, "..... mult: %u\n", lapic_clockevent.mult); 715 apic_printk(APIC_VERBOSE, "..... mult: %u\n", lapic_clockevent.mult);
686 apic_printk(APIC_VERBOSE, "..... calibration result: %u\n", 716 apic_printk(APIC_VERBOSE, "..... calibration result: %u\n",
687 calibration_result); 717 lapic_timer_frequency);
688 718
689 if (cpu_has_tsc) { 719 if (cpu_has_tsc) {
690 apic_printk(APIC_VERBOSE, "..... CPU clock speed is " 720 apic_printk(APIC_VERBOSE, "..... CPU clock speed is "
@@ -695,13 +725,13 @@ static int __init calibrate_APIC_clock(void)
695 725
696 apic_printk(APIC_VERBOSE, "..... host bus clock speed is " 726 apic_printk(APIC_VERBOSE, "..... host bus clock speed is "
697 "%u.%04u MHz.\n", 727 "%u.%04u MHz.\n",
698 calibration_result / (1000000 / HZ), 728 lapic_timer_frequency / (1000000 / HZ),
699 calibration_result % (1000000 / HZ)); 729 lapic_timer_frequency % (1000000 / HZ));
700 730
701 /* 731 /*
702 * Do a sanity check on the APIC calibration result 732 * Do a sanity check on the APIC calibration result
703 */ 733 */
704 if (calibration_result < (1000000 / HZ)) { 734 if (lapic_timer_frequency < (1000000 / HZ)) {
705 local_irq_enable(); 735 local_irq_enable();
706 pr_warning("APIC frequency too slow, disabling apic timer\n"); 736 pr_warning("APIC frequency too slow, disabling apic timer\n");
707 return -1; 737 return -1;
@@ -857,8 +887,8 @@ void __irq_entry smp_apic_timer_interrupt(struct pt_regs *regs)
857 * Besides, if we don't timer interrupts ignore the global 887 * Besides, if we don't timer interrupts ignore the global
858 * interrupt lock, which is the WrongThing (tm) to do. 888 * interrupt lock, which is the WrongThing (tm) to do.
859 */ 889 */
860 exit_idle();
861 irq_enter(); 890 irq_enter();
891 exit_idle();
862 local_apic_timer_interrupt(); 892 local_apic_timer_interrupt();
863 irq_exit(); 893 irq_exit();
864 894
@@ -1412,6 +1442,45 @@ void __init bsp_end_local_APIC_setup(void)
1412} 1442}
1413 1443
1414#ifdef CONFIG_X86_X2APIC 1444#ifdef CONFIG_X86_X2APIC
1445/*
1446 * Need to disable xapic and x2apic at the same time and then enable xapic mode
1447 */
1448static inline void __disable_x2apic(u64 msr)
1449{
1450 wrmsrl(MSR_IA32_APICBASE,
1451 msr & ~(X2APIC_ENABLE | XAPIC_ENABLE));
1452 wrmsrl(MSR_IA32_APICBASE, msr & ~X2APIC_ENABLE);
1453}
1454
1455static __init void disable_x2apic(void)
1456{
1457 u64 msr;
1458
1459 if (!cpu_has_x2apic)
1460 return;
1461
1462 rdmsrl(MSR_IA32_APICBASE, msr);
1463 if (msr & X2APIC_ENABLE) {
1464 u32 x2apic_id = read_apic_id();
1465
1466 if (x2apic_id >= 255)
1467 panic("Cannot disable x2apic, id: %08x\n", x2apic_id);
1468
1469 pr_info("Disabling x2apic\n");
1470 __disable_x2apic(msr);
1471
1472 if (nox2apic) {
1473 clear_cpu_cap(&cpu_data(0), X86_FEATURE_X2APIC);
1474 setup_clear_cpu_cap(X86_FEATURE_X2APIC);
1475 }
1476
1477 x2apic_disabled = 1;
1478 x2apic_mode = 0;
1479
1480 register_lapic_address(mp_lapic_addr);
1481 }
1482}
1483
1415void check_x2apic(void) 1484void check_x2apic(void)
1416{ 1485{
1417 if (x2apic_enabled()) { 1486 if (x2apic_enabled()) {
@@ -1422,15 +1491,20 @@ void check_x2apic(void)
1422 1491
1423void enable_x2apic(void) 1492void enable_x2apic(void)
1424{ 1493{
1425 int msr, msr2; 1494 u64 msr;
1495
1496 rdmsrl(MSR_IA32_APICBASE, msr);
1497 if (x2apic_disabled) {
1498 __disable_x2apic(msr);
1499 return;
1500 }
1426 1501
1427 if (!x2apic_mode) 1502 if (!x2apic_mode)
1428 return; 1503 return;
1429 1504
1430 rdmsr(MSR_IA32_APICBASE, msr, msr2);
1431 if (!(msr & X2APIC_ENABLE)) { 1505 if (!(msr & X2APIC_ENABLE)) {
1432 printk_once(KERN_INFO "Enabling x2apic\n"); 1506 printk_once(KERN_INFO "Enabling x2apic\n");
1433 wrmsr(MSR_IA32_APICBASE, msr | X2APIC_ENABLE, msr2); 1507 wrmsrl(MSR_IA32_APICBASE, msr | X2APIC_ENABLE);
1434 } 1508 }
1435} 1509}
1436#endif /* CONFIG_X86_X2APIC */ 1510#endif /* CONFIG_X86_X2APIC */
@@ -1467,25 +1541,34 @@ void __init enable_IR_x2apic(void)
1467 ret = save_ioapic_entries(); 1541 ret = save_ioapic_entries();
1468 if (ret) { 1542 if (ret) {
1469 pr_info("Saving IO-APIC state failed: %d\n", ret); 1543 pr_info("Saving IO-APIC state failed: %d\n", ret);
1470 goto out; 1544 return;
1471 } 1545 }
1472 1546
1473 local_irq_save(flags); 1547 local_irq_save(flags);
1474 legacy_pic->mask_all(); 1548 legacy_pic->mask_all();
1475 mask_ioapic_entries(); 1549 mask_ioapic_entries();
1476 1550
1551 if (x2apic_preenabled && nox2apic)
1552 disable_x2apic();
1553
1477 if (dmar_table_init_ret) 1554 if (dmar_table_init_ret)
1478 ret = -1; 1555 ret = -1;
1479 else 1556 else
1480 ret = enable_IR(); 1557 ret = enable_IR();
1481 1558
1559 if (!x2apic_supported())
1560 goto skip_x2apic;
1561
1482 if (ret < 0) { 1562 if (ret < 0) {
1483 /* IR is required if there is APIC ID > 255 even when running 1563 /* IR is required if there is APIC ID > 255 even when running
1484 * under KVM 1564 * under KVM
1485 */ 1565 */
1486 if (max_physical_apicid > 255 || 1566 if (max_physical_apicid > 255 ||
1487 !hypervisor_x2apic_available()) 1567 !hypervisor_x2apic_available()) {
1488 goto nox2apic; 1568 if (x2apic_preenabled)
1569 disable_x2apic();
1570 goto skip_x2apic;
1571 }
1489 /* 1572 /*
1490 * without IR all CPUs can be addressed by IOAPIC/MSI 1573 * without IR all CPUs can be addressed by IOAPIC/MSI
1491 * only in physical mode 1574 * only in physical mode
@@ -1493,8 +1576,10 @@ void __init enable_IR_x2apic(void)
1493 x2apic_force_phys(); 1576 x2apic_force_phys();
1494 } 1577 }
1495 1578
1496 if (ret == IRQ_REMAP_XAPIC_MODE) 1579 if (ret == IRQ_REMAP_XAPIC_MODE) {
1497 goto nox2apic; 1580 pr_info("x2apic not enabled, IRQ remapping is in xapic mode\n");
1581 goto skip_x2apic;
1582 }
1498 1583
1499 x2apic_enabled = 1; 1584 x2apic_enabled = 1;
1500 1585
@@ -1504,22 +1589,11 @@ void __init enable_IR_x2apic(void)
1504 pr_info("Enabled x2apic\n"); 1589 pr_info("Enabled x2apic\n");
1505 } 1590 }
1506 1591
1507nox2apic: 1592skip_x2apic:
1508 if (ret < 0) /* IR enabling failed */ 1593 if (ret < 0) /* IR enabling failed */
1509 restore_ioapic_entries(); 1594 restore_ioapic_entries();
1510 legacy_pic->restore_mask(); 1595 legacy_pic->restore_mask();
1511 local_irq_restore(flags); 1596 local_irq_restore(flags);
1512
1513out:
1514 if (x2apic_enabled || !x2apic_supported())
1515 return;
1516
1517 if (x2apic_preenabled)
1518 panic("x2apic: enabled by BIOS but kernel init failed.");
1519 else if (ret == IRQ_REMAP_XAPIC_MODE)
1520 pr_info("x2apic not enabled, IRQ remapping is in xapic mode\n");
1521 else if (ret < 0)
1522 pr_info("x2apic not enabled, IRQ remapping init failed\n");
1523} 1597}
1524 1598
1525#ifdef CONFIG_X86_64 1599#ifdef CONFIG_X86_64
@@ -1790,8 +1864,8 @@ void smp_spurious_interrupt(struct pt_regs *regs)
1790{ 1864{
1791 u32 v; 1865 u32 v;
1792 1866
1793 exit_idle();
1794 irq_enter(); 1867 irq_enter();
1868 exit_idle();
1795 /* 1869 /*
1796 * Check if this really is a spurious interrupt and ACK it 1870 * Check if this really is a spurious interrupt and ACK it
1797 * if it is a vectored one. Just in case... 1871 * if it is a vectored one. Just in case...
@@ -1827,8 +1901,8 @@ void smp_error_interrupt(struct pt_regs *regs)
1827 "Illegal register address", /* APIC Error Bit 7 */ 1901 "Illegal register address", /* APIC Error Bit 7 */
1828 }; 1902 };
1829 1903
1830 exit_idle();
1831 irq_enter(); 1904 irq_enter();
1905 exit_idle();
1832 /* First tickle the hardware, only then report what went on. -- REW */ 1906 /* First tickle the hardware, only then report what went on. -- REW */
1833 v0 = apic_read(APIC_ESR); 1907 v0 = apic_read(APIC_ESR);
1834 apic_write(APIC_ESR, 0); 1908 apic_write(APIC_ESR, 0);
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index f7a41e4cae47..8c3cdded6f2b 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -62,7 +62,7 @@ static void flat_vector_allocation_domain(int cpu, struct cpumask *retmask)
62 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel 62 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
63 * document number 292116). So here it goes... 63 * document number 292116). So here it goes...
64 */ 64 */
65static void flat_init_apic_ldr(void) 65void flat_init_apic_ldr(void)
66{ 66{
67 unsigned long val; 67 unsigned long val;
68 unsigned long num, id; 68 unsigned long num, id;
@@ -171,9 +171,14 @@ static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
171 return initial_apic_id >> index_msb; 171 return initial_apic_id >> index_msb;
172} 172}
173 173
174static int flat_probe(void)
175{
176 return 1;
177}
178
174static struct apic apic_flat = { 179static struct apic apic_flat = {
175 .name = "flat", 180 .name = "flat",
176 .probe = NULL, 181 .probe = flat_probe,
177 .acpi_madt_oem_check = flat_acpi_madt_oem_check, 182 .acpi_madt_oem_check = flat_acpi_madt_oem_check,
178 .apic_id_registered = flat_apic_id_registered, 183 .apic_id_registered = flat_apic_id_registered,
179 184
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
new file mode 100644
index 000000000000..09d3d8c1cd99
--- /dev/null
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -0,0 +1,294 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Numascale NumaConnect-Specific APIC Code
7 *
8 * Copyright (C) 2011 Numascale AS. All rights reserved.
9 *
10 * Send feedback to <support@numascale.com>
11 *
12 */
13
14#include <linux/errno.h>
15#include <linux/threads.h>
16#include <linux/cpumask.h>
17#include <linux/string.h>
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/ctype.h>
21#include <linux/init.h>
22#include <linux/hardirq.h>
23#include <linux/delay.h>
24
25#include <asm/numachip/numachip_csr.h>
26#include <asm/smp.h>
27#include <asm/apic.h>
28#include <asm/ipi.h>
29#include <asm/apic_flat_64.h>
30
31static int numachip_system __read_mostly;
32
33static struct apic apic_numachip __read_mostly;
34
35static unsigned int get_apic_id(unsigned long x)
36{
37 unsigned long value;
38 unsigned int id;
39
40 rdmsrl(MSR_FAM10H_NODE_ID, value);
41 id = ((x >> 24) & 0xffU) | ((value << 2) & 0x3f00U);
42
43 return id;
44}
45
46static unsigned long set_apic_id(unsigned int id)
47{
48 unsigned long x;
49
50 x = ((id & 0xffU) << 24);
51 return x;
52}
53
54static unsigned int read_xapic_id(void)
55{
56 return get_apic_id(apic_read(APIC_ID));
57}
58
59static int numachip_apic_id_registered(void)
60{
61 return physid_isset(read_xapic_id(), phys_cpu_present_map);
62}
63
64static int numachip_phys_pkg_id(int initial_apic_id, int index_msb)
65{
66 return initial_apic_id >> index_msb;
67}
68
69static const struct cpumask *numachip_target_cpus(void)
70{
71 return cpu_online_mask;
72}
73
74static void numachip_vector_allocation_domain(int cpu, struct cpumask *retmask)
75{
76 cpumask_clear(retmask);
77 cpumask_set_cpu(cpu, retmask);
78}
79
80static int __cpuinit numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip)
81{
82 union numachip_csr_g3_ext_irq_gen int_gen;
83
84 int_gen.s._destination_apic_id = phys_apicid;
85 int_gen.s._vector = 0;
86 int_gen.s._msgtype = APIC_DM_INIT >> 8;
87 int_gen.s._index = 0;
88
89 write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v);
90
91 int_gen.s._msgtype = APIC_DM_STARTUP >> 8;
92 int_gen.s._vector = start_rip >> 12;
93
94 write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v);
95
96 atomic_set(&init_deasserted, 1);
97 return 0;
98}
99
100static void numachip_send_IPI_one(int cpu, int vector)
101{
102 union numachip_csr_g3_ext_irq_gen int_gen;
103 int apicid = per_cpu(x86_cpu_to_apicid, cpu);
104
105 int_gen.s._destination_apic_id = apicid;
106 int_gen.s._vector = vector;
107 int_gen.s._msgtype = (vector == NMI_VECTOR ? APIC_DM_NMI : APIC_DM_FIXED) >> 8;
108 int_gen.s._index = 0;
109
110 write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v);
111}
112
113static void numachip_send_IPI_mask(const struct cpumask *mask, int vector)
114{
115 unsigned int cpu;
116
117 for_each_cpu(cpu, mask)
118 numachip_send_IPI_one(cpu, vector);
119}
120
121static void numachip_send_IPI_mask_allbutself(const struct cpumask *mask,
122 int vector)
123{
124 unsigned int this_cpu = smp_processor_id();
125 unsigned int cpu;
126
127 for_each_cpu(cpu, mask) {
128 if (cpu != this_cpu)
129 numachip_send_IPI_one(cpu, vector);
130 }
131}
132
133static void numachip_send_IPI_allbutself(int vector)
134{
135 unsigned int this_cpu = smp_processor_id();
136 unsigned int cpu;
137
138 for_each_online_cpu(cpu) {
139 if (cpu != this_cpu)
140 numachip_send_IPI_one(cpu, vector);
141 }
142}
143
144static void numachip_send_IPI_all(int vector)
145{
146 numachip_send_IPI_mask(cpu_online_mask, vector);
147}
148
149static void numachip_send_IPI_self(int vector)
150{
151 __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
152}
153
154static unsigned int numachip_cpu_mask_to_apicid(const struct cpumask *cpumask)
155{
156 int cpu;
157
158 /*
159 * We're using fixed IRQ delivery, can only return one phys APIC ID.
160 * May as well be the first.
161 */
162 cpu = cpumask_first(cpumask);
163 if (likely((unsigned)cpu < nr_cpu_ids))
164 return per_cpu(x86_cpu_to_apicid, cpu);
165
166 return BAD_APICID;
167}
168
169static unsigned int
170numachip_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
171 const struct cpumask *andmask)
172{
173 int cpu;
174
175 /*
176 * We're using fixed IRQ delivery, can only return one phys APIC ID.
177 * May as well be the first.
178 */
179 for_each_cpu_and(cpu, cpumask, andmask) {
180 if (cpumask_test_cpu(cpu, cpu_online_mask))
181 break;
182 }
183 return per_cpu(x86_cpu_to_apicid, cpu);
184}
185
186static int __init numachip_probe(void)
187{
188 return apic == &apic_numachip;
189}
190
191static void __init map_csrs(void)
192{
193 printk(KERN_INFO "NumaChip: Mapping local CSR space (%016llx - %016llx)\n",
194 NUMACHIP_LCSR_BASE, NUMACHIP_LCSR_BASE + NUMACHIP_LCSR_SIZE - 1);
195 init_extra_mapping_uc(NUMACHIP_LCSR_BASE, NUMACHIP_LCSR_SIZE);
196
197 printk(KERN_INFO "NumaChip: Mapping global CSR space (%016llx - %016llx)\n",
198 NUMACHIP_GCSR_BASE, NUMACHIP_GCSR_BASE + NUMACHIP_GCSR_SIZE - 1);
199 init_extra_mapping_uc(NUMACHIP_GCSR_BASE, NUMACHIP_GCSR_SIZE);
200}
201
202static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
203{
204 c->phys_proc_id = node;
205 per_cpu(cpu_llc_id, smp_processor_id()) = node;
206}
207
208static int __init numachip_system_init(void)
209{
210 unsigned int val;
211
212 if (!numachip_system)
213 return 0;
214
215 x86_cpuinit.fixup_cpu_id = fixup_cpu_id;
216
217 map_csrs();
218
219 val = read_lcsr(CSR_G0_NODE_IDS);
220 printk(KERN_INFO "NumaChip: Local NodeID = %08x\n", val);
221
222 return 0;
223}
224early_initcall(numachip_system_init);
225
226static int numachip_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
227{
228 if (!strncmp(oem_id, "NUMASC", 6)) {
229 numachip_system = 1;
230 return 1;
231 }
232
233 return 0;
234}
235
236static struct apic apic_numachip __refconst = {
237
238 .name = "NumaConnect system",
239 .probe = numachip_probe,
240 .acpi_madt_oem_check = numachip_acpi_madt_oem_check,
241 .apic_id_registered = numachip_apic_id_registered,
242
243 .irq_delivery_mode = dest_Fixed,
244 .irq_dest_mode = 0, /* physical */
245
246 .target_cpus = numachip_target_cpus,
247 .disable_esr = 0,
248 .dest_logical = 0,
249 .check_apicid_used = NULL,
250 .check_apicid_present = NULL,
251
252 .vector_allocation_domain = numachip_vector_allocation_domain,
253 .init_apic_ldr = flat_init_apic_ldr,
254
255 .ioapic_phys_id_map = NULL,
256 .setup_apic_routing = NULL,
257 .multi_timer_check = NULL,
258 .cpu_present_to_apicid = default_cpu_present_to_apicid,
259 .apicid_to_cpu_present = NULL,
260 .setup_portio_remap = NULL,
261 .check_phys_apicid_present = default_check_phys_apicid_present,
262 .enable_apic_mode = NULL,
263 .phys_pkg_id = numachip_phys_pkg_id,
264 .mps_oem_check = NULL,
265
266 .get_apic_id = get_apic_id,
267 .set_apic_id = set_apic_id,
268 .apic_id_mask = 0xffU << 24,
269
270 .cpu_mask_to_apicid = numachip_cpu_mask_to_apicid,
271 .cpu_mask_to_apicid_and = numachip_cpu_mask_to_apicid_and,
272
273 .send_IPI_mask = numachip_send_IPI_mask,
274 .send_IPI_mask_allbutself = numachip_send_IPI_mask_allbutself,
275 .send_IPI_allbutself = numachip_send_IPI_allbutself,
276 .send_IPI_all = numachip_send_IPI_all,
277 .send_IPI_self = numachip_send_IPI_self,
278
279 .wakeup_secondary_cpu = numachip_wakeup_secondary,
280 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
281 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
282 .wait_for_init_deassert = NULL,
283 .smp_callin_clear_local_apic = NULL,
284 .inquire_remote_apic = NULL, /* REMRD not supported */
285
286 .read = native_apic_mem_read,
287 .write = native_apic_mem_write,
288 .icr_read = native_apic_icr_read,
289 .icr_write = native_apic_icr_write,
290 .wait_icr_idle = native_apic_wait_icr_idle,
291 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
292};
293apic_driver(apic_numachip);
294
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 3c31fa98af6d..fb072754bc1d 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -193,10 +193,8 @@ int __init arch_early_irq_init(void)
193 struct irq_cfg *cfg; 193 struct irq_cfg *cfg;
194 int count, node, i; 194 int count, node, i;
195 195
196 if (!legacy_pic->nr_legacy_irqs) { 196 if (!legacy_pic->nr_legacy_irqs)
197 nr_irqs_gsi = 0;
198 io_apic_irqs = ~0UL; 197 io_apic_irqs = ~0UL;
199 }
200 198
201 for (i = 0; i < nr_ioapics; i++) { 199 for (i = 0; i < nr_ioapics; i++) {
202 ioapics[i].saved_registers = 200 ioapics[i].saved_registers =
@@ -1696,6 +1694,7 @@ __apicdebuginit(void) print_IO_APICs(void)
1696 int ioapic_idx; 1694 int ioapic_idx;
1697 struct irq_cfg *cfg; 1695 struct irq_cfg *cfg;
1698 unsigned int irq; 1696 unsigned int irq;
1697 struct irq_chip *chip;
1699 1698
1700 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1699 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
1701 for (ioapic_idx = 0; ioapic_idx < nr_ioapics; ioapic_idx++) 1700 for (ioapic_idx = 0; ioapic_idx < nr_ioapics; ioapic_idx++)
@@ -1716,6 +1715,10 @@ __apicdebuginit(void) print_IO_APICs(void)
1716 for_each_active_irq(irq) { 1715 for_each_active_irq(irq) {
1717 struct irq_pin_list *entry; 1716 struct irq_pin_list *entry;
1718 1717
1718 chip = irq_get_chip(irq);
1719 if (chip != &ioapic_chip)
1720 continue;
1721
1719 cfg = irq_get_chip_data(irq); 1722 cfg = irq_get_chip_data(irq);
1720 if (!cfg) 1723 if (!cfg)
1721 continue; 1724 continue;
@@ -2418,8 +2421,8 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2418 unsigned vector, me; 2421 unsigned vector, me;
2419 2422
2420 ack_APIC_irq(); 2423 ack_APIC_irq();
2421 exit_idle();
2422 irq_enter(); 2424 irq_enter();
2425 exit_idle();
2423 2426
2424 me = smp_processor_id(); 2427 me = smp_processor_id();
2425 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) { 2428 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
@@ -2945,6 +2948,10 @@ static inline void __init check_timer(void)
2945 } 2948 }
2946 local_irq_disable(); 2949 local_irq_disable();
2947 apic_printk(APIC_QUIET, KERN_INFO "..... failed :(.\n"); 2950 apic_printk(APIC_QUIET, KERN_INFO "..... failed :(.\n");
2951 if (x2apic_preenabled)
2952 apic_printk(APIC_QUIET, KERN_INFO
2953 "Perhaps problem with the pre-enabled x2apic mode\n"
2954 "Try booting with x2apic and interrupt-remapping disabled in the bios.\n");
2948 panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a " 2955 panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a "
2949 "report. Then try booting with the 'noapic' option.\n"); 2956 "report. Then try booting with the 'noapic' option.\n");
2950out: 2957out:
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 62ae3001ae02..9d59bbacd4e3 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -93,6 +93,8 @@ static int __init early_get_pnodeid(void)
93 93
94 if (node_id.s.part_number == UV2_HUB_PART_NUMBER) 94 if (node_id.s.part_number == UV2_HUB_PART_NUMBER)
95 uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; 95 uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1;
96 if (node_id.s.part_number == UV2_HUB_PART_NUMBER_X)
97 uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1;
96 98
97 uv_hub_info->hub_revision = uv_min_hub_revision_id; 99 uv_hub_info->hub_revision = uv_min_hub_revision_id;
98 pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1); 100 pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1);
diff --git a/arch/x86/kernel/check.c b/arch/x86/kernel/check.c
index 452932d34730..5da1269e8ddc 100644
--- a/arch/x86/kernel/check.c
+++ b/arch/x86/kernel/check.c
@@ -62,7 +62,8 @@ early_param("memory_corruption_check_size", set_corruption_check_size);
62 62
63void __init setup_bios_corruption_check(void) 63void __init setup_bios_corruption_check(void)
64{ 64{
65 u64 addr = PAGE_SIZE; /* assume first page is reserved anyway */ 65 phys_addr_t start, end;
66 u64 i;
66 67
67 if (memory_corruption_check == -1) { 68 if (memory_corruption_check == -1) {
68 memory_corruption_check = 69 memory_corruption_check =
@@ -82,28 +83,23 @@ void __init setup_bios_corruption_check(void)
82 83
83 corruption_check_size = round_up(corruption_check_size, PAGE_SIZE); 84 corruption_check_size = round_up(corruption_check_size, PAGE_SIZE);
84 85
85 while (addr < corruption_check_size && num_scan_areas < MAX_SCAN_AREAS) { 86 for_each_free_mem_range(i, MAX_NUMNODES, &start, &end, NULL) {
86 u64 size; 87 start = clamp_t(phys_addr_t, round_up(start, PAGE_SIZE),
87 addr = memblock_x86_find_in_range_size(addr, &size, PAGE_SIZE); 88 PAGE_SIZE, corruption_check_size);
89 end = clamp_t(phys_addr_t, round_down(end, PAGE_SIZE),
90 PAGE_SIZE, corruption_check_size);
91 if (start >= end)
92 continue;
88 93
89 if (addr == MEMBLOCK_ERROR) 94 memblock_reserve(start, end - start);
90 break; 95 scan_areas[num_scan_areas].addr = start;
91 96 scan_areas[num_scan_areas].size = end - start;
92 if (addr >= corruption_check_size)
93 break;
94
95 if ((addr + size) > corruption_check_size)
96 size = corruption_check_size - addr;
97
98 memblock_x86_reserve_range(addr, addr + size, "SCAN RAM");
99 scan_areas[num_scan_areas].addr = addr;
100 scan_areas[num_scan_areas].size = size;
101 num_scan_areas++;
102 97
103 /* Assume we've already mapped this early memory */ 98 /* Assume we've already mapped this early memory */
104 memset(__va(addr), 0, size); 99 memset(__va(start), 0, end - start);
105 100
106 addr += size; 101 if (++num_scan_areas >= MAX_SCAN_AREAS)
102 break;
107 } 103 }
108 104
109 if (num_scan_areas) 105 if (num_scan_areas)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index c7e46cb35327..f4773f4aae35 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -148,7 +148,6 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)
148 148
149static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c) 149static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
150{ 150{
151#ifdef CONFIG_SMP
152 /* calling is from identify_secondary_cpu() ? */ 151 /* calling is from identify_secondary_cpu() ? */
153 if (!c->cpu_index) 152 if (!c->cpu_index)
154 return; 153 return;
@@ -192,7 +191,6 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
192 191
193valid_k7: 192valid_k7:
194 ; 193 ;
195#endif
196} 194}
197 195
198static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c) 196static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)
@@ -353,6 +351,13 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
353 if (node == NUMA_NO_NODE) 351 if (node == NUMA_NO_NODE)
354 node = per_cpu(cpu_llc_id, cpu); 352 node = per_cpu(cpu_llc_id, cpu);
355 353
354 /*
355 * If core numbers are inconsistent, it's likely a multi-fabric platform,
356 * so invoke platform-specific handler
357 */
358 if (c->phys_proc_id != node)
359 x86_cpuinit.fixup_cpu_id(c, node);
360
356 if (!node_online(node)) { 361 if (!node_online(node)) {
357 /* 362 /*
358 * Two possibilities here: 363 * Two possibilities here:
@@ -442,8 +447,6 @@ static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c)
442 447
443static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) 448static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
444{ 449{
445 u32 dummy;
446
447 early_init_amd_mc(c); 450 early_init_amd_mc(c);
448 451
449 /* 452 /*
@@ -473,12 +476,12 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
473 set_cpu_cap(c, X86_FEATURE_EXTD_APICID); 476 set_cpu_cap(c, X86_FEATURE_EXTD_APICID);
474 } 477 }
475#endif 478#endif
476
477 rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
478} 479}
479 480
480static void __cpuinit init_amd(struct cpuinfo_x86 *c) 481static void __cpuinit init_amd(struct cpuinfo_x86 *c)
481{ 482{
483 u32 dummy;
484
482#ifdef CONFIG_SMP 485#ifdef CONFIG_SMP
483 unsigned long long value; 486 unsigned long long value;
484 487
@@ -657,6 +660,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
657 checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask); 660 checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask);
658 } 661 }
659 } 662 }
663
664 rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
660} 665}
661 666
662#ifdef CONFIG_X86_32 667#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index e58d978e0758..159103c0b1f4 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -278,7 +278,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
278 } 278 }
279#ifdef CONFIG_X86_32 279#ifdef CONFIG_X86_32
280 /* Cyrix III family needs CX8 & PGE explicitly enabled. */ 280 /* Cyrix III family needs CX8 & PGE explicitly enabled. */
281 if (c->x86_model >= 6 && c->x86_model <= 9) { 281 if (c->x86_model >= 6 && c->x86_model <= 13) {
282 rdmsr(MSR_VIA_FCR, lo, hi); 282 rdmsr(MSR_VIA_FCR, lo, hi);
283 lo |= (1<<1 | 1<<7); 283 lo |= (1<<1 | 1<<7);
284 wrmsr(MSR_VIA_FCR, lo, hi); 284 wrmsr(MSR_VIA_FCR, lo, hi);
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index aa003b13a831..850f2963a420 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -676,9 +676,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
676 if (this_cpu->c_early_init) 676 if (this_cpu->c_early_init)
677 this_cpu->c_early_init(c); 677 this_cpu->c_early_init(c);
678 678
679#ifdef CONFIG_SMP
680 c->cpu_index = 0; 679 c->cpu_index = 0;
681#endif
682 filter_cpuid_features(c, false); 680 filter_cpuid_features(c, false);
683 681
684 setup_smep(c); 682 setup_smep(c);
@@ -764,10 +762,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
764 c->apicid = c->initial_apicid; 762 c->apicid = c->initial_apicid;
765# endif 763# endif
766#endif 764#endif
767
768#ifdef CONFIG_X86_HT
769 c->phys_proc_id = c->initial_apicid; 765 c->phys_proc_id = c->initial_apicid;
770#endif
771 } 766 }
772 767
773 setup_smep(c); 768 setup_smep(c);
@@ -1141,6 +1136,15 @@ static void dbg_restore_debug_regs(void)
1141#endif /* ! CONFIG_KGDB */ 1136#endif /* ! CONFIG_KGDB */
1142 1137
1143/* 1138/*
1139 * Prints an error where the NUMA and configured core-number mismatch and the
1140 * platform didn't override this to fix it up
1141 */
1142void __cpuinit x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node)
1143{
1144 pr_err("NUMA core number %d differs from configured core number %d\n", node, c->phys_proc_id);
1145}
1146
1147/*
1144 * cpu_init() initializes state that is per-CPU. Some data is already 1148 * cpu_init() initializes state that is per-CPU. Some data is already
1145 * initialized (naturally) in the bootstrap process, such as the GDT 1149 * initialized (naturally) in the bootstrap process, such as the GDT
1146 * and IDT. We reload them nevertheless, this function acts as a 1150 * and IDT. We reload them nevertheless, this function acts as a
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 1b22dcc51af4..8bacc7826fb3 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -1,5 +1,4 @@
1#ifndef ARCH_X86_CPU_H 1#ifndef ARCH_X86_CPU_H
2
3#define ARCH_X86_CPU_H 2#define ARCH_X86_CPU_H
4 3
5struct cpu_model_info { 4struct cpu_model_info {
@@ -35,6 +34,4 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[],
35 34
36extern void get_cpu_cap(struct cpuinfo_x86 *c); 35extern void get_cpu_cap(struct cpuinfo_x86 *c);
37extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); 36extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
38extern void get_cpu_cap(struct cpuinfo_x86 *c); 37#endif /* ARCH_X86_CPU_H */
39
40#endif
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 523131213f08..3e6ff6cbf42a 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -181,7 +181,6 @@ static void __cpuinit trap_init_f00f_bug(void)
181 181
182static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c) 182static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c)
183{ 183{
184#ifdef CONFIG_SMP
185 /* calling is from identify_secondary_cpu() ? */ 184 /* calling is from identify_secondary_cpu() ? */
186 if (!c->cpu_index) 185 if (!c->cpu_index)
187 return; 186 return;
@@ -198,7 +197,6 @@ static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c)
198 WARN_ONCE(1, "WARNING: SMP operation may be unreliable" 197 WARN_ONCE(1, "WARNING: SMP operation may be unreliable"
199 "with B stepping processors.\n"); 198 "with B stepping processors.\n");
200 } 199 }
201#endif
202} 200}
203 201
204static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c) 202static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index a3b0811693c9..6b45e5e7a901 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -844,8 +844,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
844 844
845#include <linux/kobject.h> 845#include <linux/kobject.h>
846#include <linux/sysfs.h> 846#include <linux/sysfs.h>
847 847#include <linux/cpu.h>
848extern struct sysdev_class cpu_sysdev_class; /* from drivers/base/cpu.c */
849 848
850/* pointer to kobject for cpuX/cache */ 849/* pointer to kobject for cpuX/cache */
851static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); 850static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject);
@@ -1073,9 +1072,9 @@ err_out:
1073static DECLARE_BITMAP(cache_dev_map, NR_CPUS); 1072static DECLARE_BITMAP(cache_dev_map, NR_CPUS);
1074 1073
1075/* Add/Remove cache interface for CPU device */ 1074/* Add/Remove cache interface for CPU device */
1076static int __cpuinit cache_add_dev(struct sys_device * sys_dev) 1075static int __cpuinit cache_add_dev(struct device *dev)
1077{ 1076{
1078 unsigned int cpu = sys_dev->id; 1077 unsigned int cpu = dev->id;
1079 unsigned long i, j; 1078 unsigned long i, j;
1080 struct _index_kobject *this_object; 1079 struct _index_kobject *this_object;
1081 struct _cpuid4_info *this_leaf; 1080 struct _cpuid4_info *this_leaf;
@@ -1087,7 +1086,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
1087 1086
1088 retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu), 1087 retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu),
1089 &ktype_percpu_entry, 1088 &ktype_percpu_entry,
1090 &sys_dev->kobj, "%s", "cache"); 1089 &dev->kobj, "%s", "cache");
1091 if (retval < 0) { 1090 if (retval < 0) {
1092 cpuid4_cache_sysfs_exit(cpu); 1091 cpuid4_cache_sysfs_exit(cpu);
1093 return retval; 1092 return retval;
@@ -1124,9 +1123,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
1124 return 0; 1123 return 0;
1125} 1124}
1126 1125
1127static void __cpuinit cache_remove_dev(struct sys_device * sys_dev) 1126static void __cpuinit cache_remove_dev(struct device *dev)
1128{ 1127{
1129 unsigned int cpu = sys_dev->id; 1128 unsigned int cpu = dev->id;
1130 unsigned long i; 1129 unsigned long i;
1131 1130
1132 if (per_cpu(ici_cpuid4_info, cpu) == NULL) 1131 if (per_cpu(ici_cpuid4_info, cpu) == NULL)
@@ -1145,17 +1144,17 @@ static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb,
1145 unsigned long action, void *hcpu) 1144 unsigned long action, void *hcpu)
1146{ 1145{
1147 unsigned int cpu = (unsigned long)hcpu; 1146 unsigned int cpu = (unsigned long)hcpu;
1148 struct sys_device *sys_dev; 1147 struct device *dev;
1149 1148
1150 sys_dev = get_cpu_sysdev(cpu); 1149 dev = get_cpu_device(cpu);
1151 switch (action) { 1150 switch (action) {
1152 case CPU_ONLINE: 1151 case CPU_ONLINE:
1153 case CPU_ONLINE_FROZEN: 1152 case CPU_ONLINE_FROZEN:
1154 cache_add_dev(sys_dev); 1153 cache_add_dev(dev);
1155 break; 1154 break;
1156 case CPU_DEAD: 1155 case CPU_DEAD:
1157 case CPU_DEAD_FROZEN: 1156 case CPU_DEAD_FROZEN:
1158 cache_remove_dev(sys_dev); 1157 cache_remove_dev(dev);
1159 break; 1158 break;
1160 } 1159 }
1161 return NOTIFY_OK; 1160 return NOTIFY_OK;
@@ -1174,9 +1173,9 @@ static int __cpuinit cache_sysfs_init(void)
1174 1173
1175 for_each_online_cpu(i) { 1174 for_each_online_cpu(i) {
1176 int err; 1175 int err;
1177 struct sys_device *sys_dev = get_cpu_sysdev(i); 1176 struct device *dev = get_cpu_device(i);
1178 1177
1179 err = cache_add_dev(sys_dev); 1178 err = cache_add_dev(dev);
1180 if (err) 1179 if (err)
1181 return err; 1180 return err;
1182 } 1181 }
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index 6199232161cf..fc4beb393577 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -17,6 +17,7 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/fs.h> 19#include <linux/fs.h>
20#include <linux/preempt.h>
20#include <linux/smp.h> 21#include <linux/smp.h>
21#include <linux/notifier.h> 22#include <linux/notifier.h>
22#include <linux/kdebug.h> 23#include <linux/kdebug.h>
@@ -92,6 +93,18 @@ static int mce_raise_notify(unsigned int cmd, struct pt_regs *regs)
92 return NMI_HANDLED; 93 return NMI_HANDLED;
93} 94}
94 95
96static void mce_irq_ipi(void *info)
97{
98 int cpu = smp_processor_id();
99 struct mce *m = &__get_cpu_var(injectm);
100
101 if (cpumask_test_cpu(cpu, mce_inject_cpumask) &&
102 m->inject_flags & MCJ_EXCEPTION) {
103 cpumask_clear_cpu(cpu, mce_inject_cpumask);
104 raise_exception(m, NULL);
105 }
106}
107
95/* Inject mce on current CPU */ 108/* Inject mce on current CPU */
96static int raise_local(void) 109static int raise_local(void)
97{ 110{
@@ -139,9 +152,10 @@ static void raise_mce(struct mce *m)
139 return; 152 return;
140 153
141#ifdef CONFIG_X86_LOCAL_APIC 154#ifdef CONFIG_X86_LOCAL_APIC
142 if (m->inject_flags & MCJ_NMI_BROADCAST) { 155 if (m->inject_flags & (MCJ_IRQ_BRAODCAST | MCJ_NMI_BROADCAST)) {
143 unsigned long start; 156 unsigned long start;
144 int cpu; 157 int cpu;
158
145 get_online_cpus(); 159 get_online_cpus();
146 cpumask_copy(mce_inject_cpumask, cpu_online_mask); 160 cpumask_copy(mce_inject_cpumask, cpu_online_mask);
147 cpumask_clear_cpu(get_cpu(), mce_inject_cpumask); 161 cpumask_clear_cpu(get_cpu(), mce_inject_cpumask);
@@ -151,13 +165,25 @@ static void raise_mce(struct mce *m)
151 MCJ_CTX(mcpu->inject_flags) != MCJ_CTX_RANDOM) 165 MCJ_CTX(mcpu->inject_flags) != MCJ_CTX_RANDOM)
152 cpumask_clear_cpu(cpu, mce_inject_cpumask); 166 cpumask_clear_cpu(cpu, mce_inject_cpumask);
153 } 167 }
154 if (!cpumask_empty(mce_inject_cpumask)) 168 if (!cpumask_empty(mce_inject_cpumask)) {
155 apic->send_IPI_mask(mce_inject_cpumask, NMI_VECTOR); 169 if (m->inject_flags & MCJ_IRQ_BRAODCAST) {
170 /*
171 * don't wait because mce_irq_ipi is necessary
172 * to be sync with following raise_local
173 */
174 preempt_disable();
175 smp_call_function_many(mce_inject_cpumask,
176 mce_irq_ipi, NULL, 0);
177 preempt_enable();
178 } else if (m->inject_flags & MCJ_NMI_BROADCAST)
179 apic->send_IPI_mask(mce_inject_cpumask,
180 NMI_VECTOR);
181 }
156 start = jiffies; 182 start = jiffies;
157 while (!cpumask_empty(mce_inject_cpumask)) { 183 while (!cpumask_empty(mce_inject_cpumask)) {
158 if (!time_before(jiffies, start + 2*HZ)) { 184 if (!time_before(jiffies, start + 2*HZ)) {
159 printk(KERN_ERR 185 printk(KERN_ERR
160 "Timeout waiting for mce inject NMI %lx\n", 186 "Timeout waiting for mce inject %lx\n",
161 *cpumask_bits(mce_inject_cpumask)); 187 *cpumask_bits(mce_inject_cpumask));
162 break; 188 break;
163 } 189 }
@@ -208,7 +234,7 @@ static int inject_init(void)
208 if (!alloc_cpumask_var(&mce_inject_cpumask, GFP_KERNEL)) 234 if (!alloc_cpumask_var(&mce_inject_cpumask, GFP_KERNEL))
209 return -ENOMEM; 235 return -ENOMEM;
210 printk(KERN_INFO "Machine check injector initialized\n"); 236 printk(KERN_INFO "Machine check injector initialized\n");
211 mce_chrdev_ops.write = mce_write; 237 register_mce_write_callback(mce_write);
212 register_nmi_handler(NMI_LOCAL, mce_raise_notify, 0, 238 register_nmi_handler(NMI_LOCAL, mce_raise_notify, 0,
213 "mce_notify"); 239 "mce_notify");
214 return 0; 240 return 0;
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
index fefcc69ee8b5..ed44c8a65858 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-internal.h
+++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
@@ -1,4 +1,4 @@
1#include <linux/sysdev.h> 1#include <linux/device.h>
2#include <asm/mce.h> 2#include <asm/mce.h>
3 3
4enum severity_level { 4enum severity_level {
@@ -17,7 +17,7 @@ enum severity_level {
17struct mce_bank { 17struct mce_bank {
18 u64 ctl; /* subevents to enable */ 18 u64 ctl; /* subevents to enable */
19 unsigned char init; /* initialise bank? */ 19 unsigned char init; /* initialise bank? */
20 struct sysdev_attribute attr; /* sysdev attribute */ 20 struct device_attribute attr; /* device attribute */
21 char attrname[ATTR_LEN]; /* attribute name */ 21 char attrname[ATTR_LEN]; /* attribute name */
22}; 22};
23 23
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 362056aefeb4..f22a9f7f6390 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -19,7 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/percpu.h> 20#include <linux/percpu.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/syscore_ops.h> 23#include <linux/syscore_ops.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/ctype.h> 25#include <linux/ctype.h>
@@ -95,13 +95,6 @@ static DECLARE_WAIT_QUEUE_HEAD(mce_chrdev_wait);
95static DEFINE_PER_CPU(struct mce, mces_seen); 95static DEFINE_PER_CPU(struct mce, mces_seen);
96static int cpu_missing; 96static int cpu_missing;
97 97
98/*
99 * CPU/chipset specific EDAC code can register a notifier call here to print
100 * MCE errors in a human-readable form.
101 */
102ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain);
103EXPORT_SYMBOL_GPL(x86_mce_decoder_chain);
104
105/* MCA banks polled by the period polling timer for corrected events */ 98/* MCA banks polled by the period polling timer for corrected events */
106DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = { 99DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
107 [0 ... BITS_TO_LONGS(MAX_NR_BANKS)-1] = ~0UL 100 [0 ... BITS_TO_LONGS(MAX_NR_BANKS)-1] = ~0UL
@@ -109,6 +102,12 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
109 102
110static DEFINE_PER_CPU(struct work_struct, mce_work); 103static DEFINE_PER_CPU(struct work_struct, mce_work);
111 104
105/*
106 * CPU/chipset specific EDAC code can register a notifier call here to print
107 * MCE errors in a human-readable form.
108 */
109ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain);
110
112/* Do initial initialization of a struct mce */ 111/* Do initial initialization of a struct mce */
113void mce_setup(struct mce *m) 112void mce_setup(struct mce *m)
114{ 113{
@@ -119,9 +118,7 @@ void mce_setup(struct mce *m)
119 m->time = get_seconds(); 118 m->time = get_seconds();
120 m->cpuvendor = boot_cpu_data.x86_vendor; 119 m->cpuvendor = boot_cpu_data.x86_vendor;
121 m->cpuid = cpuid_eax(1); 120 m->cpuid = cpuid_eax(1);
122#ifdef CONFIG_SMP
123 m->socketid = cpu_data(m->extcpu).phys_proc_id; 121 m->socketid = cpu_data(m->extcpu).phys_proc_id;
124#endif
125 m->apicid = cpu_data(m->extcpu).initial_apicid; 122 m->apicid = cpu_data(m->extcpu).initial_apicid;
126 rdmsrl(MSR_IA32_MCG_CAP, m->mcgcap); 123 rdmsrl(MSR_IA32_MCG_CAP, m->mcgcap);
127} 124}
@@ -190,6 +187,57 @@ void mce_log(struct mce *mce)
190 set_bit(0, &mce_need_notify); 187 set_bit(0, &mce_need_notify);
191} 188}
192 189
190static void drain_mcelog_buffer(void)
191{
192 unsigned int next, i, prev = 0;
193
194 next = rcu_dereference_check_mce(mcelog.next);
195
196 do {
197 struct mce *m;
198
199 /* drain what was logged during boot */
200 for (i = prev; i < next; i++) {
201 unsigned long start = jiffies;
202 unsigned retries = 1;
203
204 m = &mcelog.entry[i];
205
206 while (!m->finished) {
207 if (time_after_eq(jiffies, start + 2*retries))
208 retries++;
209
210 cpu_relax();
211
212 if (!m->finished && retries >= 4) {
213 pr_err("MCE: skipping error being logged currently!\n");
214 break;
215 }
216 }
217 smp_rmb();
218 atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m);
219 }
220
221 memset(mcelog.entry + prev, 0, (next - prev) * sizeof(*m));
222 prev = next;
223 next = cmpxchg(&mcelog.next, prev, 0);
224 } while (next != prev);
225}
226
227
228void mce_register_decode_chain(struct notifier_block *nb)
229{
230 atomic_notifier_chain_register(&x86_mce_decoder_chain, nb);
231 drain_mcelog_buffer();
232}
233EXPORT_SYMBOL_GPL(mce_register_decode_chain);
234
235void mce_unregister_decode_chain(struct notifier_block *nb)
236{
237 atomic_notifier_chain_unregister(&x86_mce_decoder_chain, nb);
238}
239EXPORT_SYMBOL_GPL(mce_unregister_decode_chain);
240
193static void print_mce(struct mce *m) 241static void print_mce(struct mce *m)
194{ 242{
195 int ret = 0; 243 int ret = 0;
@@ -1634,16 +1682,35 @@ static long mce_chrdev_ioctl(struct file *f, unsigned int cmd,
1634 } 1682 }
1635} 1683}
1636 1684
1637/* Modified in mce-inject.c, so not static or const */ 1685static ssize_t (*mce_write)(struct file *filp, const char __user *ubuf,
1638struct file_operations mce_chrdev_ops = { 1686 size_t usize, loff_t *off);
1687
1688void register_mce_write_callback(ssize_t (*fn)(struct file *filp,
1689 const char __user *ubuf,
1690 size_t usize, loff_t *off))
1691{
1692 mce_write = fn;
1693}
1694EXPORT_SYMBOL_GPL(register_mce_write_callback);
1695
1696ssize_t mce_chrdev_write(struct file *filp, const char __user *ubuf,
1697 size_t usize, loff_t *off)
1698{
1699 if (mce_write)
1700 return mce_write(filp, ubuf, usize, off);
1701 else
1702 return -EINVAL;
1703}
1704
1705static const struct file_operations mce_chrdev_ops = {
1639 .open = mce_chrdev_open, 1706 .open = mce_chrdev_open,
1640 .release = mce_chrdev_release, 1707 .release = mce_chrdev_release,
1641 .read = mce_chrdev_read, 1708 .read = mce_chrdev_read,
1709 .write = mce_chrdev_write,
1642 .poll = mce_chrdev_poll, 1710 .poll = mce_chrdev_poll,
1643 .unlocked_ioctl = mce_chrdev_ioctl, 1711 .unlocked_ioctl = mce_chrdev_ioctl,
1644 .llseek = no_llseek, 1712 .llseek = no_llseek,
1645}; 1713};
1646EXPORT_SYMBOL_GPL(mce_chrdev_ops);
1647 1714
1648static struct miscdevice mce_chrdev_device = { 1715static struct miscdevice mce_chrdev_device = {
1649 MISC_MCELOG_MINOR, 1716 MISC_MCELOG_MINOR,
@@ -1751,7 +1818,7 @@ static struct syscore_ops mce_syscore_ops = {
1751}; 1818};
1752 1819
1753/* 1820/*
1754 * mce_sysdev: Sysfs support 1821 * mce_device: Sysfs support
1755 */ 1822 */
1756 1823
1757static void mce_cpu_restart(void *data) 1824static void mce_cpu_restart(void *data)
@@ -1787,27 +1854,28 @@ static void mce_enable_ce(void *all)
1787 __mcheck_cpu_init_timer(); 1854 __mcheck_cpu_init_timer();
1788} 1855}
1789 1856
1790static struct sysdev_class mce_sysdev_class = { 1857static struct bus_type mce_subsys = {
1791 .name = "machinecheck", 1858 .name = "machinecheck",
1859 .dev_name = "machinecheck",
1792}; 1860};
1793 1861
1794DEFINE_PER_CPU(struct sys_device, mce_sysdev); 1862DEFINE_PER_CPU(struct device, mce_device);
1795 1863
1796__cpuinitdata 1864__cpuinitdata
1797void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); 1865void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
1798 1866
1799static inline struct mce_bank *attr_to_bank(struct sysdev_attribute *attr) 1867static inline struct mce_bank *attr_to_bank(struct device_attribute *attr)
1800{ 1868{
1801 return container_of(attr, struct mce_bank, attr); 1869 return container_of(attr, struct mce_bank, attr);
1802} 1870}
1803 1871
1804static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr, 1872static ssize_t show_bank(struct device *s, struct device_attribute *attr,
1805 char *buf) 1873 char *buf)
1806{ 1874{
1807 return sprintf(buf, "%llx\n", attr_to_bank(attr)->ctl); 1875 return sprintf(buf, "%llx\n", attr_to_bank(attr)->ctl);
1808} 1876}
1809 1877
1810static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr, 1878static ssize_t set_bank(struct device *s, struct device_attribute *attr,
1811 const char *buf, size_t size) 1879 const char *buf, size_t size)
1812{ 1880{
1813 u64 new; 1881 u64 new;
@@ -1822,14 +1890,14 @@ static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
1822} 1890}
1823 1891
1824static ssize_t 1892static ssize_t
1825show_trigger(struct sys_device *s, struct sysdev_attribute *attr, char *buf) 1893show_trigger(struct device *s, struct device_attribute *attr, char *buf)
1826{ 1894{
1827 strcpy(buf, mce_helper); 1895 strcpy(buf, mce_helper);
1828 strcat(buf, "\n"); 1896 strcat(buf, "\n");
1829 return strlen(mce_helper) + 1; 1897 return strlen(mce_helper) + 1;
1830} 1898}
1831 1899
1832static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr, 1900static ssize_t set_trigger(struct device *s, struct device_attribute *attr,
1833 const char *buf, size_t siz) 1901 const char *buf, size_t siz)
1834{ 1902{
1835 char *p; 1903 char *p;
@@ -1844,8 +1912,8 @@ static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
1844 return strlen(mce_helper) + !!p; 1912 return strlen(mce_helper) + !!p;
1845} 1913}
1846 1914
1847static ssize_t set_ignore_ce(struct sys_device *s, 1915static ssize_t set_ignore_ce(struct device *s,
1848 struct sysdev_attribute *attr, 1916 struct device_attribute *attr,
1849 const char *buf, size_t size) 1917 const char *buf, size_t size)
1850{ 1918{
1851 u64 new; 1919 u64 new;
@@ -1868,8 +1936,8 @@ static ssize_t set_ignore_ce(struct sys_device *s,
1868 return size; 1936 return size;
1869} 1937}
1870 1938
1871static ssize_t set_cmci_disabled(struct sys_device *s, 1939static ssize_t set_cmci_disabled(struct device *s,
1872 struct sysdev_attribute *attr, 1940 struct device_attribute *attr,
1873 const char *buf, size_t size) 1941 const char *buf, size_t size)
1874{ 1942{
1875 u64 new; 1943 u64 new;
@@ -1891,108 +1959,107 @@ static ssize_t set_cmci_disabled(struct sys_device *s,
1891 return size; 1959 return size;
1892} 1960}
1893 1961
1894static ssize_t store_int_with_restart(struct sys_device *s, 1962static ssize_t store_int_with_restart(struct device *s,
1895 struct sysdev_attribute *attr, 1963 struct device_attribute *attr,
1896 const char *buf, size_t size) 1964 const char *buf, size_t size)
1897{ 1965{
1898 ssize_t ret = sysdev_store_int(s, attr, buf, size); 1966 ssize_t ret = device_store_int(s, attr, buf, size);
1899 mce_restart(); 1967 mce_restart();
1900 return ret; 1968 return ret;
1901} 1969}
1902 1970
1903static SYSDEV_ATTR(trigger, 0644, show_trigger, set_trigger); 1971static DEVICE_ATTR(trigger, 0644, show_trigger, set_trigger);
1904static SYSDEV_INT_ATTR(tolerant, 0644, tolerant); 1972static DEVICE_INT_ATTR(tolerant, 0644, tolerant);
1905static SYSDEV_INT_ATTR(monarch_timeout, 0644, monarch_timeout); 1973static DEVICE_INT_ATTR(monarch_timeout, 0644, monarch_timeout);
1906static SYSDEV_INT_ATTR(dont_log_ce, 0644, mce_dont_log_ce); 1974static DEVICE_INT_ATTR(dont_log_ce, 0644, mce_dont_log_ce);
1907 1975
1908static struct sysdev_ext_attribute attr_check_interval = { 1976static struct dev_ext_attribute dev_attr_check_interval = {
1909 _SYSDEV_ATTR(check_interval, 0644, sysdev_show_int, 1977 __ATTR(check_interval, 0644, device_show_int, store_int_with_restart),
1910 store_int_with_restart),
1911 &check_interval 1978 &check_interval
1912}; 1979};
1913 1980
1914static struct sysdev_ext_attribute attr_ignore_ce = { 1981static struct dev_ext_attribute dev_attr_ignore_ce = {
1915 _SYSDEV_ATTR(ignore_ce, 0644, sysdev_show_int, set_ignore_ce), 1982 __ATTR(ignore_ce, 0644, device_show_int, set_ignore_ce),
1916 &mce_ignore_ce 1983 &mce_ignore_ce
1917}; 1984};
1918 1985
1919static struct sysdev_ext_attribute attr_cmci_disabled = { 1986static struct dev_ext_attribute dev_attr_cmci_disabled = {
1920 _SYSDEV_ATTR(cmci_disabled, 0644, sysdev_show_int, set_cmci_disabled), 1987 __ATTR(cmci_disabled, 0644, device_show_int, set_cmci_disabled),
1921 &mce_cmci_disabled 1988 &mce_cmci_disabled
1922}; 1989};
1923 1990
1924static struct sysdev_attribute *mce_sysdev_attrs[] = { 1991static struct device_attribute *mce_device_attrs[] = {
1925 &attr_tolerant.attr, 1992 &dev_attr_tolerant.attr,
1926 &attr_check_interval.attr, 1993 &dev_attr_check_interval.attr,
1927 &attr_trigger, 1994 &dev_attr_trigger,
1928 &attr_monarch_timeout.attr, 1995 &dev_attr_monarch_timeout.attr,
1929 &attr_dont_log_ce.attr, 1996 &dev_attr_dont_log_ce.attr,
1930 &attr_ignore_ce.attr, 1997 &dev_attr_ignore_ce.attr,
1931 &attr_cmci_disabled.attr, 1998 &dev_attr_cmci_disabled.attr,
1932 NULL 1999 NULL
1933}; 2000};
1934 2001
1935static cpumask_var_t mce_sysdev_initialized; 2002static cpumask_var_t mce_device_initialized;
1936 2003
1937/* Per cpu sysdev init. All of the cpus still share the same ctrl bank: */ 2004/* Per cpu device init. All of the cpus still share the same ctrl bank: */
1938static __cpuinit int mce_sysdev_create(unsigned int cpu) 2005static __cpuinit int mce_device_create(unsigned int cpu)
1939{ 2006{
1940 struct sys_device *sysdev = &per_cpu(mce_sysdev, cpu); 2007 struct device *dev = &per_cpu(mce_device, cpu);
1941 int err; 2008 int err;
1942 int i, j; 2009 int i, j;
1943 2010
1944 if (!mce_available(&boot_cpu_data)) 2011 if (!mce_available(&boot_cpu_data))
1945 return -EIO; 2012 return -EIO;
1946 2013
1947 memset(&sysdev->kobj, 0, sizeof(struct kobject)); 2014 memset(&dev->kobj, 0, sizeof(struct kobject));
1948 sysdev->id = cpu; 2015 dev->id = cpu;
1949 sysdev->cls = &mce_sysdev_class; 2016 dev->bus = &mce_subsys;
1950 2017
1951 err = sysdev_register(sysdev); 2018 err = device_register(dev);
1952 if (err) 2019 if (err)
1953 return err; 2020 return err;
1954 2021
1955 for (i = 0; mce_sysdev_attrs[i]; i++) { 2022 for (i = 0; mce_device_attrs[i]; i++) {
1956 err = sysdev_create_file(sysdev, mce_sysdev_attrs[i]); 2023 err = device_create_file(dev, mce_device_attrs[i]);
1957 if (err) 2024 if (err)
1958 goto error; 2025 goto error;
1959 } 2026 }
1960 for (j = 0; j < banks; j++) { 2027 for (j = 0; j < banks; j++) {
1961 err = sysdev_create_file(sysdev, &mce_banks[j].attr); 2028 err = device_create_file(dev, &mce_banks[j].attr);
1962 if (err) 2029 if (err)
1963 goto error2; 2030 goto error2;
1964 } 2031 }
1965 cpumask_set_cpu(cpu, mce_sysdev_initialized); 2032 cpumask_set_cpu(cpu, mce_device_initialized);
1966 2033
1967 return 0; 2034 return 0;
1968error2: 2035error2:
1969 while (--j >= 0) 2036 while (--j >= 0)
1970 sysdev_remove_file(sysdev, &mce_banks[j].attr); 2037 device_remove_file(dev, &mce_banks[j].attr);
1971error: 2038error:
1972 while (--i >= 0) 2039 while (--i >= 0)
1973 sysdev_remove_file(sysdev, mce_sysdev_attrs[i]); 2040 device_remove_file(dev, mce_device_attrs[i]);
1974 2041
1975 sysdev_unregister(sysdev); 2042 device_unregister(dev);
1976 2043
1977 return err; 2044 return err;
1978} 2045}
1979 2046
1980static __cpuinit void mce_sysdev_remove(unsigned int cpu) 2047static __cpuinit void mce_device_remove(unsigned int cpu)
1981{ 2048{
1982 struct sys_device *sysdev = &per_cpu(mce_sysdev, cpu); 2049 struct device *dev = &per_cpu(mce_device, cpu);
1983 int i; 2050 int i;
1984 2051
1985 if (!cpumask_test_cpu(cpu, mce_sysdev_initialized)) 2052 if (!cpumask_test_cpu(cpu, mce_device_initialized))
1986 return; 2053 return;
1987 2054
1988 for (i = 0; mce_sysdev_attrs[i]; i++) 2055 for (i = 0; mce_device_attrs[i]; i++)
1989 sysdev_remove_file(sysdev, mce_sysdev_attrs[i]); 2056 device_remove_file(dev, mce_device_attrs[i]);
1990 2057
1991 for (i = 0; i < banks; i++) 2058 for (i = 0; i < banks; i++)
1992 sysdev_remove_file(sysdev, &mce_banks[i].attr); 2059 device_remove_file(dev, &mce_banks[i].attr);
1993 2060
1994 sysdev_unregister(sysdev); 2061 device_unregister(dev);
1995 cpumask_clear_cpu(cpu, mce_sysdev_initialized); 2062 cpumask_clear_cpu(cpu, mce_device_initialized);
1996} 2063}
1997 2064
1998/* Make sure there are no machine checks on offlined CPUs. */ 2065/* Make sure there are no machine checks on offlined CPUs. */
@@ -2042,7 +2109,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
2042 switch (action) { 2109 switch (action) {
2043 case CPU_ONLINE: 2110 case CPU_ONLINE:
2044 case CPU_ONLINE_FROZEN: 2111 case CPU_ONLINE_FROZEN:
2045 mce_sysdev_create(cpu); 2112 mce_device_create(cpu);
2046 if (threshold_cpu_callback) 2113 if (threshold_cpu_callback)
2047 threshold_cpu_callback(action, cpu); 2114 threshold_cpu_callback(action, cpu);
2048 break; 2115 break;
@@ -2050,7 +2117,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
2050 case CPU_DEAD_FROZEN: 2117 case CPU_DEAD_FROZEN:
2051 if (threshold_cpu_callback) 2118 if (threshold_cpu_callback)
2052 threshold_cpu_callback(action, cpu); 2119 threshold_cpu_callback(action, cpu);
2053 mce_sysdev_remove(cpu); 2120 mce_device_remove(cpu);
2054 break; 2121 break;
2055 case CPU_DOWN_PREPARE: 2122 case CPU_DOWN_PREPARE:
2056 case CPU_DOWN_PREPARE_FROZEN: 2123 case CPU_DOWN_PREPARE_FROZEN:
@@ -2084,7 +2151,7 @@ static __init void mce_init_banks(void)
2084 2151
2085 for (i = 0; i < banks; i++) { 2152 for (i = 0; i < banks; i++) {
2086 struct mce_bank *b = &mce_banks[i]; 2153 struct mce_bank *b = &mce_banks[i];
2087 struct sysdev_attribute *a = &b->attr; 2154 struct device_attribute *a = &b->attr;
2088 2155
2089 sysfs_attr_init(&a->attr); 2156 sysfs_attr_init(&a->attr);
2090 a->attr.name = b->attrname; 2157 a->attr.name = b->attrname;
@@ -2104,16 +2171,16 @@ static __init int mcheck_init_device(void)
2104 if (!mce_available(&boot_cpu_data)) 2171 if (!mce_available(&boot_cpu_data))
2105 return -EIO; 2172 return -EIO;
2106 2173
2107 zalloc_cpumask_var(&mce_sysdev_initialized, GFP_KERNEL); 2174 zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL);
2108 2175
2109 mce_init_banks(); 2176 mce_init_banks();
2110 2177
2111 err = sysdev_class_register(&mce_sysdev_class); 2178 err = subsys_system_register(&mce_subsys, NULL);
2112 if (err) 2179 if (err)
2113 return err; 2180 return err;
2114 2181
2115 for_each_online_cpu(i) { 2182 for_each_online_cpu(i) {
2116 err = mce_sysdev_create(i); 2183 err = mce_device_create(i);
2117 if (err) 2184 if (err)
2118 return err; 2185 return err;
2119 } 2186 }
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index f5474218cffe..ba0b94a7e204 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -17,7 +17,6 @@
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/kobject.h> 18#include <linux/kobject.h>
19#include <linux/percpu.h> 19#include <linux/percpu.h>
20#include <linux/sysdev.h>
21#include <linux/errno.h> 20#include <linux/errno.h>
22#include <linux/sched.h> 21#include <linux/sched.h>
23#include <linux/sysfs.h> 22#include <linux/sysfs.h>
@@ -64,11 +63,9 @@ struct threshold_bank {
64}; 63};
65static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks); 64static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks);
66 65
67#ifdef CONFIG_SMP
68static unsigned char shared_bank[NR_BANKS] = { 66static unsigned char shared_bank[NR_BANKS] = {
69 0, 0, 0, 0, 1 67 0, 0, 0, 0, 1
70}; 68};
71#endif
72 69
73static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */ 70static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */
74 71
@@ -202,10 +199,9 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
202 199
203 if (!block) 200 if (!block)
204 per_cpu(bank_map, cpu) |= (1 << bank); 201 per_cpu(bank_map, cpu) |= (1 << bank);
205#ifdef CONFIG_SMP
206 if (shared_bank[bank] && c->cpu_core_id) 202 if (shared_bank[bank] && c->cpu_core_id)
207 break; 203 break;
208#endif 204
209 offset = setup_APIC_mce(offset, 205 offset = setup_APIC_mce(offset,
210 (high & MASK_LVTOFF_HI) >> 20); 206 (high & MASK_LVTOFF_HI) >> 20);
211 207
@@ -531,7 +527,6 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
531 527
532 sprintf(name, "threshold_bank%i", bank); 528 sprintf(name, "threshold_bank%i", bank);
533 529
534#ifdef CONFIG_SMP
535 if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */ 530 if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */
536 i = cpumask_first(cpu_llc_shared_mask(cpu)); 531 i = cpumask_first(cpu_llc_shared_mask(cpu));
537 532
@@ -548,7 +543,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
548 if (!b) 543 if (!b)
549 goto out; 544 goto out;
550 545
551 err = sysfs_create_link(&per_cpu(mce_sysdev, cpu).kobj, 546 err = sysfs_create_link(&per_cpu(mce_device, cpu).kobj,
552 b->kobj, name); 547 b->kobj, name);
553 if (err) 548 if (err)
554 goto out; 549 goto out;
@@ -558,7 +553,6 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
558 553
559 goto out; 554 goto out;
560 } 555 }
561#endif
562 556
563 b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL); 557 b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL);
564 if (!b) { 558 if (!b) {
@@ -571,7 +565,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
571 goto out; 565 goto out;
572 } 566 }
573 567
574 b->kobj = kobject_create_and_add(name, &per_cpu(mce_sysdev, cpu).kobj); 568 b->kobj = kobject_create_and_add(name, &per_cpu(mce_device, cpu).kobj);
575 if (!b->kobj) 569 if (!b->kobj)
576 goto out_free; 570 goto out_free;
577 571
@@ -591,7 +585,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
591 if (i == cpu) 585 if (i == cpu)
592 continue; 586 continue;
593 587
594 err = sysfs_create_link(&per_cpu(mce_sysdev, i).kobj, 588 err = sysfs_create_link(&per_cpu(mce_device, i).kobj,
595 b->kobj, name); 589 b->kobj, name);
596 if (err) 590 if (err)
597 goto out; 591 goto out;
@@ -669,7 +663,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
669#ifdef CONFIG_SMP 663#ifdef CONFIG_SMP
670 /* sibling symlink */ 664 /* sibling symlink */
671 if (shared_bank[bank] && b->blocks->cpu != cpu) { 665 if (shared_bank[bank] && b->blocks->cpu != cpu) {
672 sysfs_remove_link(&per_cpu(mce_sysdev, cpu).kobj, name); 666 sysfs_remove_link(&per_cpu(mce_device, cpu).kobj, name);
673 per_cpu(threshold_banks, cpu)[bank] = NULL; 667 per_cpu(threshold_banks, cpu)[bank] = NULL;
674 668
675 return; 669 return;
@@ -681,7 +675,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
681 if (i == cpu) 675 if (i == cpu)
682 continue; 676 continue;
683 677
684 sysfs_remove_link(&per_cpu(mce_sysdev, i).kobj, name); 678 sysfs_remove_link(&per_cpu(mce_device, i).kobj, name);
685 per_cpu(threshold_banks, i)[bank] = NULL; 679 per_cpu(threshold_banks, i)[bank] = NULL;
686 } 680 }
687 681
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 787e06c84ea6..67bb17a37a0a 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -19,7 +19,6 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/percpu.h> 20#include <linux/percpu.h>
21#include <linux/export.h> 21#include <linux/export.h>
22#include <linux/sysdev.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/init.h> 23#include <linux/init.h>
25#include <linux/smp.h> 24#include <linux/smp.h>
@@ -69,16 +68,16 @@ static atomic_t therm_throt_en = ATOMIC_INIT(0);
69static u32 lvtthmr_init __read_mostly; 68static u32 lvtthmr_init __read_mostly;
70 69
71#ifdef CONFIG_SYSFS 70#ifdef CONFIG_SYSFS
72#define define_therm_throt_sysdev_one_ro(_name) \ 71#define define_therm_throt_device_one_ro(_name) \
73 static SYSDEV_ATTR(_name, 0444, \ 72 static DEVICE_ATTR(_name, 0444, \
74 therm_throt_sysdev_show_##_name, \ 73 therm_throt_device_show_##_name, \
75 NULL) \ 74 NULL) \
76 75
77#define define_therm_throt_sysdev_show_func(event, name) \ 76#define define_therm_throt_device_show_func(event, name) \
78 \ 77 \
79static ssize_t therm_throt_sysdev_show_##event##_##name( \ 78static ssize_t therm_throt_device_show_##event##_##name( \
80 struct sys_device *dev, \ 79 struct device *dev, \
81 struct sysdev_attribute *attr, \ 80 struct device_attribute *attr, \
82 char *buf) \ 81 char *buf) \
83{ \ 82{ \
84 unsigned int cpu = dev->id; \ 83 unsigned int cpu = dev->id; \
@@ -95,20 +94,20 @@ static ssize_t therm_throt_sysdev_show_##event##_##name( \
95 return ret; \ 94 return ret; \
96} 95}
97 96
98define_therm_throt_sysdev_show_func(core_throttle, count); 97define_therm_throt_device_show_func(core_throttle, count);
99define_therm_throt_sysdev_one_ro(core_throttle_count); 98define_therm_throt_device_one_ro(core_throttle_count);
100 99
101define_therm_throt_sysdev_show_func(core_power_limit, count); 100define_therm_throt_device_show_func(core_power_limit, count);
102define_therm_throt_sysdev_one_ro(core_power_limit_count); 101define_therm_throt_device_one_ro(core_power_limit_count);
103 102
104define_therm_throt_sysdev_show_func(package_throttle, count); 103define_therm_throt_device_show_func(package_throttle, count);
105define_therm_throt_sysdev_one_ro(package_throttle_count); 104define_therm_throt_device_one_ro(package_throttle_count);
106 105
107define_therm_throt_sysdev_show_func(package_power_limit, count); 106define_therm_throt_device_show_func(package_power_limit, count);
108define_therm_throt_sysdev_one_ro(package_power_limit_count); 107define_therm_throt_device_one_ro(package_power_limit_count);
109 108
110static struct attribute *thermal_throttle_attrs[] = { 109static struct attribute *thermal_throttle_attrs[] = {
111 &attr_core_throttle_count.attr, 110 &dev_attr_core_throttle_count.attr,
112 NULL 111 NULL
113}; 112};
114 113
@@ -223,36 +222,36 @@ static int thresh_event_valid(int event)
223 222
224#ifdef CONFIG_SYSFS 223#ifdef CONFIG_SYSFS
225/* Add/Remove thermal_throttle interface for CPU device: */ 224/* Add/Remove thermal_throttle interface for CPU device: */
226static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev, 225static __cpuinit int thermal_throttle_add_dev(struct device *dev,
227 unsigned int cpu) 226 unsigned int cpu)
228{ 227{
229 int err; 228 int err;
230 struct cpuinfo_x86 *c = &cpu_data(cpu); 229 struct cpuinfo_x86 *c = &cpu_data(cpu);
231 230
232 err = sysfs_create_group(&sys_dev->kobj, &thermal_attr_group); 231 err = sysfs_create_group(&dev->kobj, &thermal_attr_group);
233 if (err) 232 if (err)
234 return err; 233 return err;
235 234
236 if (cpu_has(c, X86_FEATURE_PLN)) 235 if (cpu_has(c, X86_FEATURE_PLN))
237 err = sysfs_add_file_to_group(&sys_dev->kobj, 236 err = sysfs_add_file_to_group(&dev->kobj,
238 &attr_core_power_limit_count.attr, 237 &dev_attr_core_power_limit_count.attr,
239 thermal_attr_group.name); 238 thermal_attr_group.name);
240 if (cpu_has(c, X86_FEATURE_PTS)) { 239 if (cpu_has(c, X86_FEATURE_PTS)) {
241 err = sysfs_add_file_to_group(&sys_dev->kobj, 240 err = sysfs_add_file_to_group(&dev->kobj,
242 &attr_package_throttle_count.attr, 241 &dev_attr_package_throttle_count.attr,
243 thermal_attr_group.name); 242 thermal_attr_group.name);
244 if (cpu_has(c, X86_FEATURE_PLN)) 243 if (cpu_has(c, X86_FEATURE_PLN))
245 err = sysfs_add_file_to_group(&sys_dev->kobj, 244 err = sysfs_add_file_to_group(&dev->kobj,
246 &attr_package_power_limit_count.attr, 245 &dev_attr_package_power_limit_count.attr,
247 thermal_attr_group.name); 246 thermal_attr_group.name);
248 } 247 }
249 248
250 return err; 249 return err;
251} 250}
252 251
253static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev) 252static __cpuinit void thermal_throttle_remove_dev(struct device *dev)
254{ 253{
255 sysfs_remove_group(&sys_dev->kobj, &thermal_attr_group); 254 sysfs_remove_group(&dev->kobj, &thermal_attr_group);
256} 255}
257 256
258/* Mutex protecting device creation against CPU hotplug: */ 257/* Mutex protecting device creation against CPU hotplug: */
@@ -265,16 +264,16 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb,
265 void *hcpu) 264 void *hcpu)
266{ 265{
267 unsigned int cpu = (unsigned long)hcpu; 266 unsigned int cpu = (unsigned long)hcpu;
268 struct sys_device *sys_dev; 267 struct device *dev;
269 int err = 0; 268 int err = 0;
270 269
271 sys_dev = get_cpu_sysdev(cpu); 270 dev = get_cpu_device(cpu);
272 271
273 switch (action) { 272 switch (action) {
274 case CPU_UP_PREPARE: 273 case CPU_UP_PREPARE:
275 case CPU_UP_PREPARE_FROZEN: 274 case CPU_UP_PREPARE_FROZEN:
276 mutex_lock(&therm_cpu_lock); 275 mutex_lock(&therm_cpu_lock);
277 err = thermal_throttle_add_dev(sys_dev, cpu); 276 err = thermal_throttle_add_dev(dev, cpu);
278 mutex_unlock(&therm_cpu_lock); 277 mutex_unlock(&therm_cpu_lock);
279 WARN_ON(err); 278 WARN_ON(err);
280 break; 279 break;
@@ -283,7 +282,7 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb,
283 case CPU_DEAD: 282 case CPU_DEAD:
284 case CPU_DEAD_FROZEN: 283 case CPU_DEAD_FROZEN:
285 mutex_lock(&therm_cpu_lock); 284 mutex_lock(&therm_cpu_lock);
286 thermal_throttle_remove_dev(sys_dev); 285 thermal_throttle_remove_dev(dev);
287 mutex_unlock(&therm_cpu_lock); 286 mutex_unlock(&therm_cpu_lock);
288 break; 287 break;
289 } 288 }
@@ -310,7 +309,7 @@ static __init int thermal_throttle_init_device(void)
310#endif 309#endif
311 /* connect live CPUs to sysfs */ 310 /* connect live CPUs to sysfs */
312 for_each_online_cpu(cpu) { 311 for_each_online_cpu(cpu) {
313 err = thermal_throttle_add_dev(get_cpu_sysdev(cpu), cpu); 312 err = thermal_throttle_add_dev(get_cpu_device(cpu), cpu);
314 WARN_ON(err); 313 WARN_ON(err);
315 } 314 }
316#ifdef CONFIG_HOTPLUG_CPU 315#ifdef CONFIG_HOTPLUG_CPU
@@ -323,17 +322,6 @@ device_initcall(thermal_throttle_init_device);
323 322
324#endif /* CONFIG_SYSFS */ 323#endif /* CONFIG_SYSFS */
325 324
326/*
327 * Set up the most two significant bit to notify mce log that this thermal
328 * event type.
329 * This is a temp solution. May be changed in the future with mce log
330 * infrasture.
331 */
332#define CORE_THROTTLED (0)
333#define CORE_POWER_LIMIT ((__u64)1 << 62)
334#define PACKAGE_THROTTLED ((__u64)2 << 62)
335#define PACKAGE_POWER_LIMIT ((__u64)3 << 62)
336
337static void notify_thresholds(__u64 msr_val) 325static void notify_thresholds(__u64 msr_val)
338{ 326{
339 /* check whether the interrupt handler is defined; 327 /* check whether the interrupt handler is defined;
@@ -363,27 +351,23 @@ static void intel_thermal_interrupt(void)
363 if (therm_throt_process(msr_val & THERM_STATUS_PROCHOT, 351 if (therm_throt_process(msr_val & THERM_STATUS_PROCHOT,
364 THERMAL_THROTTLING_EVENT, 352 THERMAL_THROTTLING_EVENT,
365 CORE_LEVEL) != 0) 353 CORE_LEVEL) != 0)
366 mce_log_therm_throt_event(CORE_THROTTLED | msr_val); 354 mce_log_therm_throt_event(msr_val);
367 355
368 if (this_cpu_has(X86_FEATURE_PLN)) 356 if (this_cpu_has(X86_FEATURE_PLN))
369 if (therm_throt_process(msr_val & THERM_STATUS_POWER_LIMIT, 357 therm_throt_process(msr_val & THERM_STATUS_POWER_LIMIT,
370 POWER_LIMIT_EVENT, 358 POWER_LIMIT_EVENT,
371 CORE_LEVEL) != 0) 359 CORE_LEVEL);
372 mce_log_therm_throt_event(CORE_POWER_LIMIT | msr_val);
373 360
374 if (this_cpu_has(X86_FEATURE_PTS)) { 361 if (this_cpu_has(X86_FEATURE_PTS)) {
375 rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val); 362 rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val);
376 if (therm_throt_process(msr_val & PACKAGE_THERM_STATUS_PROCHOT, 363 therm_throt_process(msr_val & PACKAGE_THERM_STATUS_PROCHOT,
377 THERMAL_THROTTLING_EVENT, 364 THERMAL_THROTTLING_EVENT,
378 PACKAGE_LEVEL) != 0) 365 PACKAGE_LEVEL);
379 mce_log_therm_throt_event(PACKAGE_THROTTLED | msr_val);
380 if (this_cpu_has(X86_FEATURE_PLN)) 366 if (this_cpu_has(X86_FEATURE_PLN))
381 if (therm_throt_process(msr_val & 367 therm_throt_process(msr_val &
382 PACKAGE_THERM_STATUS_POWER_LIMIT, 368 PACKAGE_THERM_STATUS_POWER_LIMIT,
383 POWER_LIMIT_EVENT, 369 POWER_LIMIT_EVENT,
384 PACKAGE_LEVEL) != 0) 370 PACKAGE_LEVEL);
385 mce_log_therm_throt_event(PACKAGE_POWER_LIMIT
386 | msr_val);
387 } 371 }
388} 372}
389 373
@@ -397,8 +381,8 @@ static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt;
397 381
398asmlinkage void smp_thermal_interrupt(struct pt_regs *regs) 382asmlinkage void smp_thermal_interrupt(struct pt_regs *regs)
399{ 383{
400 exit_idle();
401 irq_enter(); 384 irq_enter();
385 exit_idle();
402 inc_irq_stat(irq_thermal_count); 386 inc_irq_stat(irq_thermal_count);
403 smp_thermal_vector(); 387 smp_thermal_vector();
404 irq_exit(); 388 irq_exit();
diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c
index d746df2909c9..aa578cadb940 100644
--- a/arch/x86/kernel/cpu/mcheck/threshold.c
+++ b/arch/x86/kernel/cpu/mcheck/threshold.c
@@ -19,8 +19,8 @@ void (*mce_threshold_vector)(void) = default_threshold_interrupt;
19 19
20asmlinkage void smp_threshold_interrupt(void) 20asmlinkage void smp_threshold_interrupt(void)
21{ 21{
22 exit_idle();
23 irq_enter(); 22 irq_enter();
23 exit_idle();
24 inc_irq_stat(irq_threshold_count); 24 inc_irq_stat(irq_threshold_count);
25 mce_threshold_vector(); 25 mce_threshold_vector();
26 irq_exit(); 26 irq_exit();
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index a71efcdbb092..97b26356e9ee 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -547,6 +547,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
547 547
548 if (tmp != mask_lo) { 548 if (tmp != mask_lo) {
549 printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n"); 549 printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");
550 add_taint(TAINT_FIRMWARE_WORKAROUND);
550 mask_lo = tmp; 551 mask_lo = tmp;
551 } 552 }
552 } 553 }
@@ -693,6 +694,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock)
693 694
694 /* Disable MTRRs, and set the default type to uncached */ 695 /* Disable MTRRs, and set the default type to uncached */
695 mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi); 696 mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi);
697 wbinvd();
696} 698}
697 699
698static void post_set(void) __releases(set_atomicity_lock) 700static void post_set(void) __releases(set_atomicity_lock)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 640891014b2a..5adce1040b11 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -312,12 +312,8 @@ int x86_setup_perfctr(struct perf_event *event)
312 return -EOPNOTSUPP; 312 return -EOPNOTSUPP;
313 } 313 }
314 314
315 /*
316 * Do not allow config1 (extended registers) to propagate,
317 * there's no sane user-space generalization yet:
318 */
319 if (attr->type == PERF_TYPE_RAW) 315 if (attr->type == PERF_TYPE_RAW)
320 return 0; 316 return x86_pmu_extra_regs(event->attr.config, event);
321 317
322 if (attr->type == PERF_TYPE_HW_CACHE) 318 if (attr->type == PERF_TYPE_HW_CACHE)
323 return set_ext_hw_attr(hwc, event); 319 return set_ext_hw_attr(hwc, event);
@@ -488,18 +484,195 @@ static inline int is_x86_event(struct perf_event *event)
488 return event->pmu == &pmu; 484 return event->pmu == &pmu;
489} 485}
490 486
487/*
488 * Event scheduler state:
489 *
490 * Assign events iterating over all events and counters, beginning
491 * with events with least weights first. Keep the current iterator
492 * state in struct sched_state.
493 */
494struct sched_state {
495 int weight;
496 int event; /* event index */
497 int counter; /* counter index */
498 int unassigned; /* number of events to be assigned left */
499 unsigned long used[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
500};
501
502/* Total max is X86_PMC_IDX_MAX, but we are O(n!) limited */
503#define SCHED_STATES_MAX 2
504
505struct perf_sched {
506 int max_weight;
507 int max_events;
508 struct event_constraint **constraints;
509 struct sched_state state;
510 int saved_states;
511 struct sched_state saved[SCHED_STATES_MAX];
512};
513
514/*
515 * Initialize interator that runs through all events and counters.
516 */
517static void perf_sched_init(struct perf_sched *sched, struct event_constraint **c,
518 int num, int wmin, int wmax)
519{
520 int idx;
521
522 memset(sched, 0, sizeof(*sched));
523 sched->max_events = num;
524 sched->max_weight = wmax;
525 sched->constraints = c;
526
527 for (idx = 0; idx < num; idx++) {
528 if (c[idx]->weight == wmin)
529 break;
530 }
531
532 sched->state.event = idx; /* start with min weight */
533 sched->state.weight = wmin;
534 sched->state.unassigned = num;
535}
536
537static void perf_sched_save_state(struct perf_sched *sched)
538{
539 if (WARN_ON_ONCE(sched->saved_states >= SCHED_STATES_MAX))
540 return;
541
542 sched->saved[sched->saved_states] = sched->state;
543 sched->saved_states++;
544}
545
546static bool perf_sched_restore_state(struct perf_sched *sched)
547{
548 if (!sched->saved_states)
549 return false;
550
551 sched->saved_states--;
552 sched->state = sched->saved[sched->saved_states];
553
554 /* continue with next counter: */
555 clear_bit(sched->state.counter++, sched->state.used);
556
557 return true;
558}
559
560/*
561 * Select a counter for the current event to schedule. Return true on
562 * success.
563 */
564static bool __perf_sched_find_counter(struct perf_sched *sched)
565{
566 struct event_constraint *c;
567 int idx;
568
569 if (!sched->state.unassigned)
570 return false;
571
572 if (sched->state.event >= sched->max_events)
573 return false;
574
575 c = sched->constraints[sched->state.event];
576
577 /* Prefer fixed purpose counters */
578 if (x86_pmu.num_counters_fixed) {
579 idx = X86_PMC_IDX_FIXED;
580 for_each_set_bit_cont(idx, c->idxmsk, X86_PMC_IDX_MAX) {
581 if (!__test_and_set_bit(idx, sched->state.used))
582 goto done;
583 }
584 }
585 /* Grab the first unused counter starting with idx */
586 idx = sched->state.counter;
587 for_each_set_bit_cont(idx, c->idxmsk, X86_PMC_IDX_FIXED) {
588 if (!__test_and_set_bit(idx, sched->state.used))
589 goto done;
590 }
591
592 return false;
593
594done:
595 sched->state.counter = idx;
596
597 if (c->overlap)
598 perf_sched_save_state(sched);
599
600 return true;
601}
602
603static bool perf_sched_find_counter(struct perf_sched *sched)
604{
605 while (!__perf_sched_find_counter(sched)) {
606 if (!perf_sched_restore_state(sched))
607 return false;
608 }
609
610 return true;
611}
612
613/*
614 * Go through all unassigned events and find the next one to schedule.
615 * Take events with the least weight first. Return true on success.
616 */
617static bool perf_sched_next_event(struct perf_sched *sched)
618{
619 struct event_constraint *c;
620
621 if (!sched->state.unassigned || !--sched->state.unassigned)
622 return false;
623
624 do {
625 /* next event */
626 sched->state.event++;
627 if (sched->state.event >= sched->max_events) {
628 /* next weight */
629 sched->state.event = 0;
630 sched->state.weight++;
631 if (sched->state.weight > sched->max_weight)
632 return false;
633 }
634 c = sched->constraints[sched->state.event];
635 } while (c->weight != sched->state.weight);
636
637 sched->state.counter = 0; /* start with first counter */
638
639 return true;
640}
641
642/*
643 * Assign a counter for each event.
644 */
645static int perf_assign_events(struct event_constraint **constraints, int n,
646 int wmin, int wmax, int *assign)
647{
648 struct perf_sched sched;
649
650 perf_sched_init(&sched, constraints, n, wmin, wmax);
651
652 do {
653 if (!perf_sched_find_counter(&sched))
654 break; /* failed */
655 if (assign)
656 assign[sched.state.event] = sched.state.counter;
657 } while (perf_sched_next_event(&sched));
658
659 return sched.state.unassigned;
660}
661
491int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign) 662int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
492{ 663{
493 struct event_constraint *c, *constraints[X86_PMC_IDX_MAX]; 664 struct event_constraint *c, *constraints[X86_PMC_IDX_MAX];
494 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; 665 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
495 int i, j, w, wmax, num = 0; 666 int i, wmin, wmax, num = 0;
496 struct hw_perf_event *hwc; 667 struct hw_perf_event *hwc;
497 668
498 bitmap_zero(used_mask, X86_PMC_IDX_MAX); 669 bitmap_zero(used_mask, X86_PMC_IDX_MAX);
499 670
500 for (i = 0; i < n; i++) { 671 for (i = 0, wmin = X86_PMC_IDX_MAX, wmax = 0; i < n; i++) {
501 c = x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]); 672 c = x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]);
502 constraints[i] = c; 673 constraints[i] = c;
674 wmin = min(wmin, c->weight);
675 wmax = max(wmax, c->weight);
503 } 676 }
504 677
505 /* 678 /*
@@ -525,59 +698,11 @@ int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
525 if (assign) 698 if (assign)
526 assign[i] = hwc->idx; 699 assign[i] = hwc->idx;
527 } 700 }
528 if (i == n)
529 goto done;
530
531 /*
532 * begin slow path
533 */
534
535 bitmap_zero(used_mask, X86_PMC_IDX_MAX);
536
537 /*
538 * weight = number of possible counters
539 *
540 * 1 = most constrained, only works on one counter
541 * wmax = least constrained, works on any counter
542 *
543 * assign events to counters starting with most
544 * constrained events.
545 */
546 wmax = x86_pmu.num_counters;
547
548 /*
549 * when fixed event counters are present,
550 * wmax is incremented by 1 to account
551 * for one more choice
552 */
553 if (x86_pmu.num_counters_fixed)
554 wmax++;
555
556 for (w = 1, num = n; num && w <= wmax; w++) {
557 /* for each event */
558 for (i = 0; num && i < n; i++) {
559 c = constraints[i];
560 hwc = &cpuc->event_list[i]->hw;
561
562 if (c->weight != w)
563 continue;
564 701
565 for_each_set_bit(j, c->idxmsk, X86_PMC_IDX_MAX) { 702 /* slow path */
566 if (!test_bit(j, used_mask)) 703 if (i != n)
567 break; 704 num = perf_assign_events(constraints, n, wmin, wmax, assign);
568 }
569
570 if (j == X86_PMC_IDX_MAX)
571 break;
572 705
573 __set_bit(j, used_mask);
574
575 if (assign)
576 assign[i] = j;
577 num--;
578 }
579 }
580done:
581 /* 706 /*
582 * scheduling failed or is just a simulation, 707 * scheduling failed or is just a simulation,
583 * free resources if necessary 708 * free resources if necessary
@@ -588,7 +713,7 @@ done:
588 x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]); 713 x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]);
589 } 714 }
590 } 715 }
591 return num ? -ENOSPC : 0; 716 return num ? -EINVAL : 0;
592} 717}
593 718
594/* 719/*
@@ -607,7 +732,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader,
607 732
608 if (is_x86_event(leader)) { 733 if (is_x86_event(leader)) {
609 if (n >= max_count) 734 if (n >= max_count)
610 return -ENOSPC; 735 return -EINVAL;
611 cpuc->event_list[n] = leader; 736 cpuc->event_list[n] = leader;
612 n++; 737 n++;
613 } 738 }
@@ -620,7 +745,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader,
620 continue; 745 continue;
621 746
622 if (n >= max_count) 747 if (n >= max_count)
623 return -ENOSPC; 748 return -EINVAL;
624 749
625 cpuc->event_list[n] = event; 750 cpuc->event_list[n] = event;
626 n++; 751 n++;
@@ -1123,6 +1248,7 @@ static void __init pmu_check_apic(void)
1123 1248
1124static int __init init_hw_perf_events(void) 1249static int __init init_hw_perf_events(void)
1125{ 1250{
1251 struct x86_pmu_quirk *quirk;
1126 struct event_constraint *c; 1252 struct event_constraint *c;
1127 int err; 1253 int err;
1128 1254
@@ -1151,8 +1277,8 @@ static int __init init_hw_perf_events(void)
1151 1277
1152 pr_cont("%s PMU driver.\n", x86_pmu.name); 1278 pr_cont("%s PMU driver.\n", x86_pmu.name);
1153 1279
1154 if (x86_pmu.quirks) 1280 for (quirk = x86_pmu.quirks; quirk; quirk = quirk->next)
1155 x86_pmu.quirks(); 1281 quirk->func();
1156 1282
1157 if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) { 1283 if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) {
1158 WARN(1, KERN_ERR "hw perf events %d > max(%d), clipping!", 1284 WARN(1, KERN_ERR "hw perf events %d > max(%d), clipping!",
@@ -1175,12 +1301,18 @@ static int __init init_hw_perf_events(void)
1175 1301
1176 unconstrained = (struct event_constraint) 1302 unconstrained = (struct event_constraint)
1177 __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_counters) - 1, 1303 __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_counters) - 1,
1178 0, x86_pmu.num_counters); 1304 0, x86_pmu.num_counters, 0);
1179 1305
1180 if (x86_pmu.event_constraints) { 1306 if (x86_pmu.event_constraints) {
1307 /*
1308 * event on fixed counter2 (REF_CYCLES) only works on this
1309 * counter, so do not extend mask to generic counters
1310 */
1181 for_each_event_constraint(c, x86_pmu.event_constraints) { 1311 for_each_event_constraint(c, x86_pmu.event_constraints) {
1182 if (c->cmask != X86_RAW_EVENT_MASK) 1312 if (c->cmask != X86_RAW_EVENT_MASK
1313 || c->idxmsk64 == X86_PMC_MSK_FIXED_REF_CYCLES) {
1183 continue; 1314 continue;
1315 }
1184 1316
1185 c->idxmsk64 |= (1ULL << x86_pmu.num_counters) - 1; 1317 c->idxmsk64 |= (1ULL << x86_pmu.num_counters) - 1;
1186 c->weight += x86_pmu.num_counters; 1318 c->weight += x86_pmu.num_counters;
@@ -1316,7 +1448,7 @@ static int validate_event(struct perf_event *event)
1316 c = x86_pmu.get_event_constraints(fake_cpuc, event); 1448 c = x86_pmu.get_event_constraints(fake_cpuc, event);
1317 1449
1318 if (!c || !c->weight) 1450 if (!c || !c->weight)
1319 ret = -ENOSPC; 1451 ret = -EINVAL;
1320 1452
1321 if (x86_pmu.put_event_constraints) 1453 if (x86_pmu.put_event_constraints)
1322 x86_pmu.put_event_constraints(fake_cpuc, event); 1454 x86_pmu.put_event_constraints(fake_cpuc, event);
@@ -1341,7 +1473,7 @@ static int validate_group(struct perf_event *event)
1341{ 1473{
1342 struct perf_event *leader = event->group_leader; 1474 struct perf_event *leader = event->group_leader;
1343 struct cpu_hw_events *fake_cpuc; 1475 struct cpu_hw_events *fake_cpuc;
1344 int ret = -ENOSPC, n; 1476 int ret = -EINVAL, n;
1345 1477
1346 fake_cpuc = allocate_fake_cpuc(); 1478 fake_cpuc = allocate_fake_cpuc();
1347 if (IS_ERR(fake_cpuc)) 1479 if (IS_ERR(fake_cpuc))
@@ -1570,3 +1702,15 @@ unsigned long perf_misc_flags(struct pt_regs *regs)
1570 1702
1571 return misc; 1703 return misc;
1572} 1704}
1705
1706void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
1707{
1708 cap->version = x86_pmu.version;
1709 cap->num_counters_gp = x86_pmu.num_counters;
1710 cap->num_counters_fixed = x86_pmu.num_counters_fixed;
1711 cap->bit_width_gp = x86_pmu.cntval_bits;
1712 cap->bit_width_fixed = x86_pmu.cntval_bits;
1713 cap->events_mask = (unsigned int)x86_pmu.events_maskl;
1714 cap->events_mask_len = x86_pmu.events_mask_len;
1715}
1716EXPORT_SYMBOL_GPL(perf_get_x86_pmu_capability);
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index b9698d40ac4b..8944062f46e2 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -45,6 +45,7 @@ struct event_constraint {
45 u64 code; 45 u64 code;
46 u64 cmask; 46 u64 cmask;
47 int weight; 47 int weight;
48 int overlap;
48}; 49};
49 50
50struct amd_nb { 51struct amd_nb {
@@ -151,15 +152,40 @@ struct cpu_hw_events {
151 void *kfree_on_online; 152 void *kfree_on_online;
152}; 153};
153 154
154#define __EVENT_CONSTRAINT(c, n, m, w) {\ 155#define __EVENT_CONSTRAINT(c, n, m, w, o) {\
155 { .idxmsk64 = (n) }, \ 156 { .idxmsk64 = (n) }, \
156 .code = (c), \ 157 .code = (c), \
157 .cmask = (m), \ 158 .cmask = (m), \
158 .weight = (w), \ 159 .weight = (w), \
160 .overlap = (o), \
159} 161}
160 162
161#define EVENT_CONSTRAINT(c, n, m) \ 163#define EVENT_CONSTRAINT(c, n, m) \
162 __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n)) 164 __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n), 0)
165
166/*
167 * The overlap flag marks event constraints with overlapping counter
168 * masks. This is the case if the counter mask of such an event is not
169 * a subset of any other counter mask of a constraint with an equal or
170 * higher weight, e.g.:
171 *
172 * c_overlaps = EVENT_CONSTRAINT_OVERLAP(0, 0x09, 0);
173 * c_another1 = EVENT_CONSTRAINT(0, 0x07, 0);
174 * c_another2 = EVENT_CONSTRAINT(0, 0x38, 0);
175 *
176 * The event scheduler may not select the correct counter in the first
177 * cycle because it needs to know which subsequent events will be
178 * scheduled. It may fail to schedule the events then. So we set the
179 * overlap flag for such constraints to give the scheduler a hint which
180 * events to select for counter rescheduling.
181 *
182 * Care must be taken as the rescheduling algorithm is O(n!) which
183 * will increase scheduling cycles for an over-commited system
184 * dramatically. The number of such EVENT_CONSTRAINT_OVERLAP() macros
185 * and its counter masks must be kept at a minimum.
186 */
187#define EVENT_CONSTRAINT_OVERLAP(c, n, m) \
188 __EVENT_CONSTRAINT(c, n, m, HWEIGHT(n), 1)
163 189
164/* 190/*
165 * Constraint on the Event code. 191 * Constraint on the Event code.
@@ -235,6 +261,11 @@ union perf_capabilities {
235 u64 capabilities; 261 u64 capabilities;
236}; 262};
237 263
264struct x86_pmu_quirk {
265 struct x86_pmu_quirk *next;
266 void (*func)(void);
267};
268
238/* 269/*
239 * struct x86_pmu - generic x86 pmu 270 * struct x86_pmu - generic x86 pmu
240 */ 271 */
@@ -259,6 +290,11 @@ struct x86_pmu {
259 int num_counters_fixed; 290 int num_counters_fixed;
260 int cntval_bits; 291 int cntval_bits;
261 u64 cntval_mask; 292 u64 cntval_mask;
293 union {
294 unsigned long events_maskl;
295 unsigned long events_mask[BITS_TO_LONGS(ARCH_PERFMON_EVENTS_COUNT)];
296 };
297 int events_mask_len;
262 int apic; 298 int apic;
263 u64 max_period; 299 u64 max_period;
264 struct event_constraint * 300 struct event_constraint *
@@ -268,7 +304,7 @@ struct x86_pmu {
268 void (*put_event_constraints)(struct cpu_hw_events *cpuc, 304 void (*put_event_constraints)(struct cpu_hw_events *cpuc,
269 struct perf_event *event); 305 struct perf_event *event);
270 struct event_constraint *event_constraints; 306 struct event_constraint *event_constraints;
271 void (*quirks)(void); 307 struct x86_pmu_quirk *quirks;
272 int perfctr_second_write; 308 int perfctr_second_write;
273 309
274 int (*cpu_prepare)(int cpu); 310 int (*cpu_prepare)(int cpu);
@@ -309,6 +345,15 @@ struct x86_pmu {
309 struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr); 345 struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr);
310}; 346};
311 347
348#define x86_add_quirk(func_) \
349do { \
350 static struct x86_pmu_quirk __quirk __initdata = { \
351 .func = func_, \
352 }; \
353 __quirk.next = x86_pmu.quirks; \
354 x86_pmu.quirks = &__quirk; \
355} while (0)
356
312#define ERF_NO_HT_SHARING 1 357#define ERF_NO_HT_SHARING 1
313#define ERF_HAS_RSP_1 2 358#define ERF_HAS_RSP_1 2
314 359
diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c
index aeefd45697a2..0397b23be8e9 100644
--- a/arch/x86/kernel/cpu/perf_event_amd.c
+++ b/arch/x86/kernel/cpu/perf_event_amd.c
@@ -492,7 +492,7 @@ static __initconst const struct x86_pmu amd_pmu = {
492static struct event_constraint amd_f15_PMC0 = EVENT_CONSTRAINT(0, 0x01, 0); 492static struct event_constraint amd_f15_PMC0 = EVENT_CONSTRAINT(0, 0x01, 0);
493static struct event_constraint amd_f15_PMC20 = EVENT_CONSTRAINT(0, 0x07, 0); 493static struct event_constraint amd_f15_PMC20 = EVENT_CONSTRAINT(0, 0x07, 0);
494static struct event_constraint amd_f15_PMC3 = EVENT_CONSTRAINT(0, 0x08, 0); 494static struct event_constraint amd_f15_PMC3 = EVENT_CONSTRAINT(0, 0x08, 0);
495static struct event_constraint amd_f15_PMC30 = EVENT_CONSTRAINT(0, 0x09, 0); 495static struct event_constraint amd_f15_PMC30 = EVENT_CONSTRAINT_OVERLAP(0, 0x09, 0);
496static struct event_constraint amd_f15_PMC50 = EVENT_CONSTRAINT(0, 0x3F, 0); 496static struct event_constraint amd_f15_PMC50 = EVENT_CONSTRAINT(0, 0x3F, 0);
497static struct event_constraint amd_f15_PMC53 = EVENT_CONSTRAINT(0, 0x38, 0); 497static struct event_constraint amd_f15_PMC53 = EVENT_CONSTRAINT(0, 0x38, 0);
498 498
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
index ab6343d21825..3b8a2d30d14e 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
@@ -199,8 +199,7 @@ static int force_ibs_eilvt_setup(void)
199 goto out; 199 goto out;
200 } 200 }
201 201
202 pr_err(FW_BUG "using offset %d for IBS interrupts\n", offset); 202 pr_info("IBS: LVT offset %d assigned\n", offset);
203 pr_err(FW_BUG "workaround enabled for IBS LVT offset\n");
204 203
205 return 0; 204 return 0;
206out: 205out:
@@ -265,19 +264,23 @@ perf_ibs_cpu_notifier(struct notifier_block *self, unsigned long action, void *h
265static __init int amd_ibs_init(void) 264static __init int amd_ibs_init(void)
266{ 265{
267 u32 caps; 266 u32 caps;
268 int ret; 267 int ret = -EINVAL;
269 268
270 caps = __get_ibs_caps(); 269 caps = __get_ibs_caps();
271 if (!caps) 270 if (!caps)
272 return -ENODEV; /* ibs not supported by the cpu */ 271 return -ENODEV; /* ibs not supported by the cpu */
273 272
274 if (!ibs_eilvt_valid()) { 273 /*
275 ret = force_ibs_eilvt_setup(); 274 * Force LVT offset assignment for family 10h: The offsets are
276 if (ret) { 275 * not assigned by the BIOS for this family, so the OS is
277 pr_err("Failed to setup IBS, %d\n", ret); 276 * responsible for doing it. If the OS assignment fails, fall
278 return ret; 277 * back to BIOS settings and try to setup this.
279 } 278 */
280 } 279 if (boot_cpu_data.x86 == 0x10)
280 force_ibs_eilvt_setup();
281
282 if (!ibs_eilvt_valid())
283 goto out;
281 284
282 get_online_cpus(); 285 get_online_cpus();
283 ibs_caps = caps; 286 ibs_caps = caps;
@@ -287,7 +290,11 @@ static __init int amd_ibs_init(void)
287 smp_call_function(setup_APIC_ibs, NULL, 1); 290 smp_call_function(setup_APIC_ibs, NULL, 1);
288 put_online_cpus(); 291 put_online_cpus();
289 292
290 return perf_event_ibs_init(); 293 ret = perf_event_ibs_init();
294out:
295 if (ret)
296 pr_err("Failed to setup IBS, %d\n", ret);
297 return ret;
291} 298}
292 299
293/* Since we need the pci subsystem to init ibs we can't do this earlier: */ 300/* Since we need the pci subsystem to init ibs we can't do this earlier: */
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index 2be5ebe99872..3bd37bdf1b8e 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -28,6 +28,7 @@ static u64 intel_perfmon_event_map[PERF_COUNT_HW_MAX] __read_mostly =
28 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4, 28 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
29 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5, 29 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
30 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c, 30 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c,
31 [PERF_COUNT_HW_REF_CPU_CYCLES] = 0x0300, /* pseudo-encoding */
31}; 32};
32 33
33static struct event_constraint intel_core_event_constraints[] __read_mostly = 34static struct event_constraint intel_core_event_constraints[] __read_mostly =
@@ -45,12 +46,7 @@ static struct event_constraint intel_core2_event_constraints[] __read_mostly =
45{ 46{
46 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ 47 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
47 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ 48 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
48 /* 49 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
49 * Core2 has Fixed Counter 2 listed as CPU_CLK_UNHALTED.REF and event
50 * 0x013c as CPU_CLK_UNHALTED.BUS and specifies there is a fixed
51 * ratio between these counters.
52 */
53 /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
54 INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */ 50 INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
55 INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */ 51 INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
56 INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */ 52 INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
@@ -68,7 +64,7 @@ static struct event_constraint intel_nehalem_event_constraints[] __read_mostly =
68{ 64{
69 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ 65 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
70 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ 66 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
71 /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */ 67 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
72 INTEL_EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */ 68 INTEL_EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */
73 INTEL_EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */ 69 INTEL_EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */
74 INTEL_EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */ 70 INTEL_EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */
@@ -90,7 +86,7 @@ static struct event_constraint intel_westmere_event_constraints[] __read_mostly
90{ 86{
91 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ 87 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
92 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ 88 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
93 /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */ 89 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
94 INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */ 90 INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
95 INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */ 91 INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */
96 INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */ 92 INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */
@@ -102,7 +98,7 @@ static struct event_constraint intel_snb_event_constraints[] __read_mostly =
102{ 98{
103 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ 99 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
104 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ 100 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
105 /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */ 101 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
106 INTEL_EVENT_CONSTRAINT(0x48, 0x4), /* L1D_PEND_MISS.PENDING */ 102 INTEL_EVENT_CONSTRAINT(0x48, 0x4), /* L1D_PEND_MISS.PENDING */
107 INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PREC_DIST */ 103 INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PREC_DIST */
108 INTEL_EVENT_CONSTRAINT(0xcd, 0x8), /* MEM_TRANS_RETIRED.LOAD_LATENCY */ 104 INTEL_EVENT_CONSTRAINT(0xcd, 0x8), /* MEM_TRANS_RETIRED.LOAD_LATENCY */
@@ -125,7 +121,7 @@ static struct event_constraint intel_gen_event_constraints[] __read_mostly =
125{ 121{
126 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ 122 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
127 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ 123 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
128 /* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */ 124 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
129 EVENT_CONSTRAINT_END 125 EVENT_CONSTRAINT_END
130}; 126};
131 127
@@ -1169,7 +1165,7 @@ again:
1169 */ 1165 */
1170 c = &unconstrained; 1166 c = &unconstrained;
1171 } else if (intel_try_alt_er(event, orig_idx)) { 1167 } else if (intel_try_alt_er(event, orig_idx)) {
1172 raw_spin_unlock(&era->lock); 1168 raw_spin_unlock_irqrestore(&era->lock, flags);
1173 goto again; 1169 goto again;
1174 } 1170 }
1175 raw_spin_unlock_irqrestore(&era->lock, flags); 1171 raw_spin_unlock_irqrestore(&era->lock, flags);
@@ -1519,7 +1515,7 @@ static __initconst const struct x86_pmu intel_pmu = {
1519 .guest_get_msrs = intel_guest_get_msrs, 1515 .guest_get_msrs = intel_guest_get_msrs,
1520}; 1516};
1521 1517
1522static void intel_clovertown_quirks(void) 1518static __init void intel_clovertown_quirk(void)
1523{ 1519{
1524 /* 1520 /*
1525 * PEBS is unreliable due to: 1521 * PEBS is unreliable due to:
@@ -1545,12 +1541,60 @@ static void intel_clovertown_quirks(void)
1545 x86_pmu.pebs_constraints = NULL; 1541 x86_pmu.pebs_constraints = NULL;
1546} 1542}
1547 1543
1544static __init void intel_sandybridge_quirk(void)
1545{
1546 printk(KERN_WARNING "PEBS disabled due to CPU errata.\n");
1547 x86_pmu.pebs = 0;
1548 x86_pmu.pebs_constraints = NULL;
1549}
1550
1551static const struct { int id; char *name; } intel_arch_events_map[] __initconst = {
1552 { PERF_COUNT_HW_CPU_CYCLES, "cpu cycles" },
1553 { PERF_COUNT_HW_INSTRUCTIONS, "instructions" },
1554 { PERF_COUNT_HW_BUS_CYCLES, "bus cycles" },
1555 { PERF_COUNT_HW_CACHE_REFERENCES, "cache references" },
1556 { PERF_COUNT_HW_CACHE_MISSES, "cache misses" },
1557 { PERF_COUNT_HW_BRANCH_INSTRUCTIONS, "branch instructions" },
1558 { PERF_COUNT_HW_BRANCH_MISSES, "branch misses" },
1559};
1560
1561static __init void intel_arch_events_quirk(void)
1562{
1563 int bit;
1564
1565 /* disable event that reported as not presend by cpuid */
1566 for_each_set_bit(bit, x86_pmu.events_mask, ARRAY_SIZE(intel_arch_events_map)) {
1567 intel_perfmon_event_map[intel_arch_events_map[bit].id] = 0;
1568 printk(KERN_WARNING "CPUID marked event: \'%s\' unavailable\n",
1569 intel_arch_events_map[bit].name);
1570 }
1571}
1572
1573static __init void intel_nehalem_quirk(void)
1574{
1575 union cpuid10_ebx ebx;
1576
1577 ebx.full = x86_pmu.events_maskl;
1578 if (ebx.split.no_branch_misses_retired) {
1579 /*
1580 * Erratum AAJ80 detected, we work it around by using
1581 * the BR_MISP_EXEC.ANY event. This will over-count
1582 * branch-misses, but it's still much better than the
1583 * architectural event which is often completely bogus:
1584 */
1585 intel_perfmon_event_map[PERF_COUNT_HW_BRANCH_MISSES] = 0x7f89;
1586 ebx.split.no_branch_misses_retired = 0;
1587 x86_pmu.events_maskl = ebx.full;
1588 printk(KERN_INFO "CPU erratum AAJ80 worked around\n");
1589 }
1590}
1591
1548__init int intel_pmu_init(void) 1592__init int intel_pmu_init(void)
1549{ 1593{
1550 union cpuid10_edx edx; 1594 union cpuid10_edx edx;
1551 union cpuid10_eax eax; 1595 union cpuid10_eax eax;
1596 union cpuid10_ebx ebx;
1552 unsigned int unused; 1597 unsigned int unused;
1553 unsigned int ebx;
1554 int version; 1598 int version;
1555 1599
1556 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) { 1600 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) {
@@ -1567,8 +1611,8 @@ __init int intel_pmu_init(void)
1567 * Check whether the Architectural PerfMon supports 1611 * Check whether the Architectural PerfMon supports
1568 * Branch Misses Retired hw_event or not. 1612 * Branch Misses Retired hw_event or not.
1569 */ 1613 */
1570 cpuid(10, &eax.full, &ebx, &unused, &edx.full); 1614 cpuid(10, &eax.full, &ebx.full, &unused, &edx.full);
1571 if (eax.split.mask_length <= ARCH_PERFMON_BRANCH_MISSES_RETIRED) 1615 if (eax.split.mask_length < ARCH_PERFMON_EVENTS_COUNT)
1572 return -ENODEV; 1616 return -ENODEV;
1573 1617
1574 version = eax.split.version_id; 1618 version = eax.split.version_id;
@@ -1582,6 +1626,9 @@ __init int intel_pmu_init(void)
1582 x86_pmu.cntval_bits = eax.split.bit_width; 1626 x86_pmu.cntval_bits = eax.split.bit_width;
1583 x86_pmu.cntval_mask = (1ULL << eax.split.bit_width) - 1; 1627 x86_pmu.cntval_mask = (1ULL << eax.split.bit_width) - 1;
1584 1628
1629 x86_pmu.events_maskl = ebx.full;
1630 x86_pmu.events_mask_len = eax.split.mask_length;
1631
1585 /* 1632 /*
1586 * Quirk: v2 perfmon does not report fixed-purpose events, so 1633 * Quirk: v2 perfmon does not report fixed-purpose events, so
1587 * assume at least 3 events: 1634 * assume at least 3 events:
@@ -1601,6 +1648,8 @@ __init int intel_pmu_init(void)
1601 1648
1602 intel_ds_init(); 1649 intel_ds_init();
1603 1650
1651 x86_add_quirk(intel_arch_events_quirk); /* Install first, so it runs last */
1652
1604 /* 1653 /*
1605 * Install the hw-cache-events table: 1654 * Install the hw-cache-events table:
1606 */ 1655 */
@@ -1610,7 +1659,7 @@ __init int intel_pmu_init(void)
1610 break; 1659 break;
1611 1660
1612 case 15: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */ 1661 case 15: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */
1613 x86_pmu.quirks = intel_clovertown_quirks; 1662 x86_add_quirk(intel_clovertown_quirk);
1614 case 22: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */ 1663 case 22: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */
1615 case 23: /* current 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" */ 1664 case 23: /* current 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" */
1616 case 29: /* six-core 45 nm xeon "Dunnington" */ 1665 case 29: /* six-core 45 nm xeon "Dunnington" */
@@ -1644,17 +1693,8 @@ __init int intel_pmu_init(void)
1644 /* UOPS_EXECUTED.CORE_ACTIVE_CYCLES,c=1,i=1 */ 1693 /* UOPS_EXECUTED.CORE_ACTIVE_CYCLES,c=1,i=1 */
1645 intel_perfmon_event_map[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x1803fb1; 1694 intel_perfmon_event_map[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x1803fb1;
1646 1695
1647 if (ebx & 0x40) { 1696 x86_add_quirk(intel_nehalem_quirk);
1648 /*
1649 * Erratum AAJ80 detected, we work it around by using
1650 * the BR_MISP_EXEC.ANY event. This will over-count
1651 * branch-misses, but it's still much better than the
1652 * architectural event which is often completely bogus:
1653 */
1654 intel_perfmon_event_map[PERF_COUNT_HW_BRANCH_MISSES] = 0x7f89;
1655 1697
1656 pr_cont("erratum AAJ80 worked around, ");
1657 }
1658 pr_cont("Nehalem events, "); 1698 pr_cont("Nehalem events, ");
1659 break; 1699 break;
1660 1700
@@ -1694,6 +1734,7 @@ __init int intel_pmu_init(void)
1694 break; 1734 break;
1695 1735
1696 case 42: /* SandyBridge */ 1736 case 42: /* SandyBridge */
1737 x86_add_quirk(intel_sandybridge_quirk);
1697 case 45: /* SandyBridge, "Romely-EP" */ 1738 case 45: /* SandyBridge, "Romely-EP" */
1698 memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, 1739 memcpy(hw_cache_event_ids, snb_hw_cache_event_ids,
1699 sizeof(hw_cache_event_ids)); 1740 sizeof(hw_cache_event_ids));
@@ -1730,5 +1771,6 @@ __init int intel_pmu_init(void)
1730 break; 1771 break;
1731 } 1772 }
1732 } 1773 }
1774
1733 return 0; 1775 return 0;
1734} 1776}
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index c0d238f49db8..73da6b64f5b7 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -493,6 +493,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
493 unsigned long from = cpuc->lbr_entries[0].from; 493 unsigned long from = cpuc->lbr_entries[0].from;
494 unsigned long old_to, to = cpuc->lbr_entries[0].to; 494 unsigned long old_to, to = cpuc->lbr_entries[0].to;
495 unsigned long ip = regs->ip; 495 unsigned long ip = regs->ip;
496 int is_64bit = 0;
496 497
497 /* 498 /*
498 * We don't need to fixup if the PEBS assist is fault like 499 * We don't need to fixup if the PEBS assist is fault like
@@ -544,7 +545,10 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
544 } else 545 } else
545 kaddr = (void *)to; 546 kaddr = (void *)to;
546 547
547 kernel_insn_init(&insn, kaddr); 548#ifdef CONFIG_X86_64
549 is_64bit = kernel_ip(to) || !test_thread_flag(TIF_IA32);
550#endif
551 insn_init(&insn, kaddr, is_64bit);
548 insn_get_length(&insn); 552 insn_get_length(&insn);
549 to += insn.length; 553 to += insn.length;
550 } while (to < ip); 554 } while (to < ip);
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c
index 492bf1358a7c..ef484d9d0a25 100644
--- a/arch/x86/kernel/cpu/perf_event_p4.c
+++ b/arch/x86/kernel/cpu/perf_event_p4.c
@@ -1268,7 +1268,7 @@ reserve:
1268 } 1268 }
1269 1269
1270done: 1270done:
1271 return num ? -ENOSPC : 0; 1271 return num ? -EINVAL : 0;
1272} 1272}
1273 1273
1274static __initconst const struct x86_pmu p4_pmu = { 1274static __initconst const struct x86_pmu p4_pmu = {
diff --git a/arch/x86/kernel/cpu/powerflags.c b/arch/x86/kernel/cpu/powerflags.c
index 5abbea297e0c..7b3fe56b1c21 100644
--- a/arch/x86/kernel/cpu/powerflags.c
+++ b/arch/x86/kernel/cpu/powerflags.c
@@ -16,5 +16,6 @@ const char *const x86_power_flags[32] = {
16 "100mhzsteps", 16 "100mhzsteps",
17 "hwpstate", 17 "hwpstate",
18 "", /* tsc invariant mapped to constant_tsc */ 18 "", /* tsc invariant mapped to constant_tsc */
19 /* nothing */ 19 "cpb", /* core performance boost */
20 "eff_freq_ro", /* Readonly aperf/mperf */
20}; 21};
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 14b23140e81f..8022c6681485 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -64,12 +64,10 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
64static int show_cpuinfo(struct seq_file *m, void *v) 64static int show_cpuinfo(struct seq_file *m, void *v)
65{ 65{
66 struct cpuinfo_x86 *c = v; 66 struct cpuinfo_x86 *c = v;
67 unsigned int cpu = 0; 67 unsigned int cpu;
68 int i; 68 int i;
69 69
70#ifdef CONFIG_SMP
71 cpu = c->cpu_index; 70 cpu = c->cpu_index;
72#endif
73 seq_printf(m, "processor\t: %u\n" 71 seq_printf(m, "processor\t: %u\n"
74 "vendor_id\t: %s\n" 72 "vendor_id\t: %s\n"
75 "cpu family\t: %d\n" 73 "cpu family\t: %d\n"
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 212a6a42527c..a524353d93f2 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -177,7 +177,7 @@ static struct notifier_block __refdata cpuid_class_cpu_notifier =
177 .notifier_call = cpuid_class_cpu_callback, 177 .notifier_call = cpuid_class_cpu_callback,
178}; 178};
179 179
180static char *cpuid_devnode(struct device *dev, mode_t *mode) 180static char *cpuid_devnode(struct device *dev, umode_t *mode)
181{ 181{
182 return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt)); 182 return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt));
183} 183}
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 3b97a80ce329..c99f9ed013d5 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -116,16 +116,16 @@ void show_registers(struct pt_regs *regs)
116 for (i = 0; i < code_len; i++, ip++) { 116 for (i = 0; i < code_len; i++, ip++) {
117 if (ip < (u8 *)PAGE_OFFSET || 117 if (ip < (u8 *)PAGE_OFFSET ||
118 probe_kernel_address(ip, c)) { 118 probe_kernel_address(ip, c)) {
119 printk(" Bad EIP value."); 119 printk(KERN_CONT " Bad EIP value.");
120 break; 120 break;
121 } 121 }
122 if (ip == (u8 *)regs->ip) 122 if (ip == (u8 *)regs->ip)
123 printk("<%02x> ", c); 123 printk(KERN_CONT "<%02x> ", c);
124 else 124 else
125 printk("%02x ", c); 125 printk(KERN_CONT "%02x ", c);
126 } 126 }
127 } 127 }
128 printk("\n"); 128 printk(KERN_CONT "\n");
129} 129}
130 130
131int is_valid_bugaddr(unsigned long ip) 131int is_valid_bugaddr(unsigned long ip)
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 19853ad8afc5..6d728d9284bd 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -284,16 +284,16 @@ void show_registers(struct pt_regs *regs)
284 for (i = 0; i < code_len; i++, ip++) { 284 for (i = 0; i < code_len; i++, ip++) {
285 if (ip < (u8 *)PAGE_OFFSET || 285 if (ip < (u8 *)PAGE_OFFSET ||
286 probe_kernel_address(ip, c)) { 286 probe_kernel_address(ip, c)) {
287 printk(" Bad RIP value."); 287 printk(KERN_CONT " Bad RIP value.");
288 break; 288 break;
289 } 289 }
290 if (ip == (u8 *)regs->ip) 290 if (ip == (u8 *)regs->ip)
291 printk("<%02x> ", c); 291 printk(KERN_CONT "<%02x> ", c);
292 else 292 else
293 printk("%02x ", c); 293 printk(KERN_CONT "%02x ", c);
294 } 294 }
295 } 295 }
296 printk("\n"); 296 printk(KERN_CONT "\n");
297} 297}
298 298
299int is_valid_bugaddr(unsigned long ip) 299int is_valid_bugaddr(unsigned long ip)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 303a0e48f076..8071e2f3d6eb 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -738,35 +738,17 @@ core_initcall(e820_mark_nvs_memory);
738/* 738/*
739 * pre allocated 4k and reserved it in memblock and e820_saved 739 * pre allocated 4k and reserved it in memblock and e820_saved
740 */ 740 */
741u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align) 741u64 __init early_reserve_e820(u64 size, u64 align)
742{ 742{
743 u64 size = 0;
744 u64 addr; 743 u64 addr;
745 u64 start;
746 744
747 for (start = startt; ; start += size) { 745 addr = __memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
748 start = memblock_x86_find_in_range_size(start, &size, align); 746 if (addr) {
749 if (start == MEMBLOCK_ERROR) 747 e820_update_range_saved(addr, size, E820_RAM, E820_RESERVED);
750 return 0; 748 printk(KERN_INFO "update e820_saved for early_reserve_e820\n");
751 if (size >= sizet) 749 update_e820_saved();
752 break;
753 } 750 }
754 751
755#ifdef CONFIG_X86_32
756 if (start >= MAXMEM)
757 return 0;
758 if (start + size > MAXMEM)
759 size = MAXMEM - start;
760#endif
761
762 addr = round_down(start + size - sizet, align);
763 if (addr < start)
764 return 0;
765 memblock_x86_reserve_range(addr, addr + sizet, "new next");
766 e820_update_range_saved(addr, sizet, E820_RAM, E820_RESERVED);
767 printk(KERN_INFO "update e820_saved for early_reserve_e820\n");
768 update_e820_saved();
769
770 return addr; 752 return addr;
771} 753}
772 754
@@ -1090,7 +1072,7 @@ void __init memblock_x86_fill(void)
1090 * We are safe to enable resizing, beause memblock_x86_fill() 1072 * We are safe to enable resizing, beause memblock_x86_fill()
1091 * is rather later for x86 1073 * is rather later for x86
1092 */ 1074 */
1093 memblock_can_resize = 1; 1075 memblock_allow_resize();
1094 1076
1095 for (i = 0; i < e820.nr_map; i++) { 1077 for (i = 0; i < e820.nr_map; i++) {
1096 struct e820entry *ei = &e820.map[i]; 1078 struct e820entry *ei = &e820.map[i];
@@ -1105,22 +1087,36 @@ void __init memblock_x86_fill(void)
1105 memblock_add(ei->addr, ei->size); 1087 memblock_add(ei->addr, ei->size);
1106 } 1088 }
1107 1089
1108 memblock_analyze();
1109 memblock_dump_all(); 1090 memblock_dump_all();
1110} 1091}
1111 1092
1112void __init memblock_find_dma_reserve(void) 1093void __init memblock_find_dma_reserve(void)
1113{ 1094{
1114#ifdef CONFIG_X86_64 1095#ifdef CONFIG_X86_64
1115 u64 free_size_pfn; 1096 u64 nr_pages = 0, nr_free_pages = 0;
1116 u64 mem_size_pfn; 1097 unsigned long start_pfn, end_pfn;
1098 phys_addr_t start, end;
1099 int i;
1100 u64 u;
1101
1117 /* 1102 /*
1118 * need to find out used area below MAX_DMA_PFN 1103 * need to find out used area below MAX_DMA_PFN
1119 * need to use memblock to get free size in [0, MAX_DMA_PFN] 1104 * need to use memblock to get free size in [0, MAX_DMA_PFN]
1120 * at first, and assume boot_mem will not take below MAX_DMA_PFN 1105 * at first, and assume boot_mem will not take below MAX_DMA_PFN
1121 */ 1106 */
1122 mem_size_pfn = memblock_x86_memory_in_range(0, MAX_DMA_PFN << PAGE_SHIFT) >> PAGE_SHIFT; 1107 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) {
1123 free_size_pfn = memblock_x86_free_memory_in_range(0, MAX_DMA_PFN << PAGE_SHIFT) >> PAGE_SHIFT; 1108 start_pfn = min_t(unsigned long, start_pfn, MAX_DMA_PFN);
1124 set_dma_reserve(mem_size_pfn - free_size_pfn); 1109 end_pfn = min_t(unsigned long, end_pfn, MAX_DMA_PFN);
1110 nr_pages += end_pfn - start_pfn;
1111 }
1112
1113 for_each_free_mem_range(u, MAX_NUMNODES, &start, &end, NULL) {
1114 start_pfn = min_t(unsigned long, PFN_UP(start), MAX_DMA_PFN);
1115 end_pfn = min_t(unsigned long, PFN_DOWN(end), MAX_DMA_PFN);
1116 if (start_pfn < end_pfn)
1117 nr_free_pages += end_pfn - start_pfn;
1118 }
1119
1120 set_dma_reserve(nr_pages - nr_free_pages);
1125#endif 1121#endif
1126} 1122}
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index f3f6f5344001..22d0e21b4dd7 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -625,6 +625,8 @@ work_notifysig: # deal with pending signals and
625 movl %esp, %eax 625 movl %esp, %eax
626 jne work_notifysig_v86 # returning to kernel-space or 626 jne work_notifysig_v86 # returning to kernel-space or
627 # vm86-space 627 # vm86-space
628 TRACE_IRQS_ON
629 ENABLE_INTERRUPTS(CLBR_NONE)
628 xorl %edx, %edx 630 xorl %edx, %edx
629 call do_notify_resume 631 call do_notify_resume
630 jmp resume_userspace_sig 632 jmp resume_userspace_sig
@@ -638,6 +640,8 @@ work_notifysig_v86:
638#else 640#else
639 movl %esp, %eax 641 movl %esp, %eax
640#endif 642#endif
643 TRACE_IRQS_ON
644 ENABLE_INTERRUPTS(CLBR_NONE)
641 xorl %edx, %edx 645 xorl %edx, %edx
642 call do_notify_resume 646 call do_notify_resume
643 jmp resume_userspace_sig 647 jmp resume_userspace_sig
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index faf8d5e74b0b..a20e1cb9dc87 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -221,7 +221,7 @@ ENDPROC(native_usergs_sysret64)
221 /*CFI_REL_OFFSET ss,0*/ 221 /*CFI_REL_OFFSET ss,0*/
222 pushq_cfi %rax /* rsp */ 222 pushq_cfi %rax /* rsp */
223 CFI_REL_OFFSET rsp,0 223 CFI_REL_OFFSET rsp,0
224 pushq_cfi $X86_EFLAGS_IF /* eflags - interrupts on */ 224 pushq_cfi $(X86_EFLAGS_IF|X86_EFLAGS_BIT1) /* eflags - interrupts on */
225 /*CFI_REL_OFFSET rflags,0*/ 225 /*CFI_REL_OFFSET rflags,0*/
226 pushq_cfi $__KERNEL_CS /* cs */ 226 pushq_cfi $__KERNEL_CS /* cs */
227 /*CFI_REL_OFFSET cs,0*/ 227 /*CFI_REL_OFFSET cs,0*/
@@ -411,7 +411,7 @@ ENTRY(ret_from_fork)
411 RESTORE_REST 411 RESTORE_REST
412 412
413 testl $3, CS-ARGOFFSET(%rsp) # from kernel_thread? 413 testl $3, CS-ARGOFFSET(%rsp) # from kernel_thread?
414 je int_ret_from_sys_call 414 jz retint_restore_args
415 415
416 testl $_TIF_IA32, TI_flags(%rcx) # 32-bit compat task needs IRET 416 testl $_TIF_IA32, TI_flags(%rcx) # 32-bit compat task needs IRET
417 jnz int_ret_from_sys_call 417 jnz int_ret_from_sys_call
@@ -465,7 +465,7 @@ ENTRY(system_call)
465 * after the swapgs, so that it can do the swapgs 465 * after the swapgs, so that it can do the swapgs
466 * for the guest and jump here on syscall. 466 * for the guest and jump here on syscall.
467 */ 467 */
468ENTRY(system_call_after_swapgs) 468GLOBAL(system_call_after_swapgs)
469 469
470 movq %rsp,PER_CPU_VAR(old_rsp) 470 movq %rsp,PER_CPU_VAR(old_rsp)
471 movq PER_CPU_VAR(kernel_stack),%rsp 471 movq PER_CPU_VAR(kernel_stack),%rsp
@@ -478,8 +478,7 @@ ENTRY(system_call_after_swapgs)
478 movq %rax,ORIG_RAX-ARGOFFSET(%rsp) 478 movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
479 movq %rcx,RIP-ARGOFFSET(%rsp) 479 movq %rcx,RIP-ARGOFFSET(%rsp)
480 CFI_REL_OFFSET rip,RIP-ARGOFFSET 480 CFI_REL_OFFSET rip,RIP-ARGOFFSET
481 GET_THREAD_INFO(%rcx) 481 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
482 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%rcx)
483 jnz tracesys 482 jnz tracesys
484system_call_fastpath: 483system_call_fastpath:
485 cmpq $__NR_syscall_max,%rax 484 cmpq $__NR_syscall_max,%rax
@@ -496,10 +495,9 @@ ret_from_sys_call:
496 /* edi: flagmask */ 495 /* edi: flagmask */
497sysret_check: 496sysret_check:
498 LOCKDEP_SYS_EXIT 497 LOCKDEP_SYS_EXIT
499 GET_THREAD_INFO(%rcx)
500 DISABLE_INTERRUPTS(CLBR_NONE) 498 DISABLE_INTERRUPTS(CLBR_NONE)
501 TRACE_IRQS_OFF 499 TRACE_IRQS_OFF
502 movl TI_flags(%rcx),%edx 500 movl TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET),%edx
503 andl %edi,%edx 501 andl %edi,%edx
504 jnz sysret_careful 502 jnz sysret_careful
505 CFI_REMEMBER_STATE 503 CFI_REMEMBER_STATE
@@ -583,7 +581,7 @@ sysret_audit:
583 /* Do syscall tracing */ 581 /* Do syscall tracing */
584tracesys: 582tracesys:
585#ifdef CONFIG_AUDITSYSCALL 583#ifdef CONFIG_AUDITSYSCALL
586 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%rcx) 584 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
587 jz auditsys 585 jz auditsys
588#endif 586#endif
589 SAVE_REST 587 SAVE_REST
@@ -612,8 +610,6 @@ tracesys:
612GLOBAL(int_ret_from_sys_call) 610GLOBAL(int_ret_from_sys_call)
613 DISABLE_INTERRUPTS(CLBR_NONE) 611 DISABLE_INTERRUPTS(CLBR_NONE)
614 TRACE_IRQS_OFF 612 TRACE_IRQS_OFF
615 testl $3,CS-ARGOFFSET(%rsp)
616 je retint_restore_args
617 movl $_TIF_ALLWORK_MASK,%edi 613 movl $_TIF_ALLWORK_MASK,%edi
618 /* edi: mask to check */ 614 /* edi: mask to check */
619GLOBAL(int_with_check) 615GLOBAL(int_with_check)
@@ -953,6 +949,7 @@ END(common_interrupt)
953ENTRY(\sym) 949ENTRY(\sym)
954 INTR_FRAME 950 INTR_FRAME
955 pushq_cfi $~(\num) 951 pushq_cfi $~(\num)
952.Lcommon_\sym:
956 interrupt \do_sym 953 interrupt \do_sym
957 jmp ret_from_intr 954 jmp ret_from_intr
958 CFI_ENDPROC 955 CFI_ENDPROC
@@ -976,13 +973,21 @@ apicinterrupt X86_PLATFORM_IPI_VECTOR \
976 x86_platform_ipi smp_x86_platform_ipi 973 x86_platform_ipi smp_x86_platform_ipi
977 974
978#ifdef CONFIG_SMP 975#ifdef CONFIG_SMP
979.irp idx,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \ 976 ALIGN
977 INTR_FRAME
978.irp idx,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
980 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 979 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
981.if NUM_INVALIDATE_TLB_VECTORS > \idx 980.if NUM_INVALIDATE_TLB_VECTORS > \idx
982apicinterrupt (INVALIDATE_TLB_VECTOR_START)+\idx \ 981ENTRY(invalidate_interrupt\idx)
983 invalidate_interrupt\idx smp_invalidate_interrupt 982 pushq_cfi $~(INVALIDATE_TLB_VECTOR_START+\idx)
983 jmp .Lcommon_invalidate_interrupt0
984 CFI_ADJUST_CFA_OFFSET -8
985END(invalidate_interrupt\idx)
984.endif 986.endif
985.endr 987.endr
988 CFI_ENDPROC
989apicinterrupt INVALIDATE_TLB_VECTOR_START, \
990 invalidate_interrupt0, smp_invalidate_interrupt
986#endif 991#endif
987 992
988apicinterrupt THRESHOLD_APIC_VECTOR \ 993apicinterrupt THRESHOLD_APIC_VECTOR \
diff --git a/arch/x86/kernel/head.c b/arch/x86/kernel/head.c
index af0699ba48cf..48d9d4ea1020 100644
--- a/arch/x86/kernel/head.c
+++ b/arch/x86/kernel/head.c
@@ -52,5 +52,5 @@ void __init reserve_ebda_region(void)
52 lowmem = 0x9f000; 52 lowmem = 0x9f000;
53 53
54 /* reserve all memory between lowmem and the 1MB mark */ 54 /* reserve all memory between lowmem and the 1MB mark */
55 memblock_x86_reserve_range(lowmem, 0x100000, "* BIOS reserved"); 55 memblock_reserve(lowmem, 0x100000 - lowmem);
56} 56}
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c
index 3bb08509a7a1..51ff18616d50 100644
--- a/arch/x86/kernel/head32.c
+++ b/arch/x86/kernel/head32.c
@@ -31,9 +31,8 @@ static void __init i386_default_early_setup(void)
31 31
32void __init i386_start_kernel(void) 32void __init i386_start_kernel(void)
33{ 33{
34 memblock_init(); 34 memblock_reserve(__pa_symbol(&_text),
35 35 __pa_symbol(&__bss_stop) - __pa_symbol(&_text));
36 memblock_x86_reserve_range(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");
37 36
38#ifdef CONFIG_BLK_DEV_INITRD 37#ifdef CONFIG_BLK_DEV_INITRD
39 /* Reserve INITRD */ 38 /* Reserve INITRD */
@@ -42,7 +41,7 @@ void __init i386_start_kernel(void)
42 u64 ramdisk_image = boot_params.hdr.ramdisk_image; 41 u64 ramdisk_image = boot_params.hdr.ramdisk_image;
43 u64 ramdisk_size = boot_params.hdr.ramdisk_size; 42 u64 ramdisk_size = boot_params.hdr.ramdisk_size;
44 u64 ramdisk_end = PAGE_ALIGN(ramdisk_image + ramdisk_size); 43 u64 ramdisk_end = PAGE_ALIGN(ramdisk_image + ramdisk_size);
45 memblock_x86_reserve_range(ramdisk_image, ramdisk_end, "RAMDISK"); 44 memblock_reserve(ramdisk_image, ramdisk_end - ramdisk_image);
46 } 45 }
47#endif 46#endif
48 47
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 5655c2272adb..3a3b779f41d3 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -98,9 +98,8 @@ void __init x86_64_start_reservations(char *real_mode_data)
98{ 98{
99 copy_bootdata(__va(real_mode_data)); 99 copy_bootdata(__va(real_mode_data));
100 100
101 memblock_init(); 101 memblock_reserve(__pa_symbol(&_text),
102 102 __pa_symbol(&__bss_stop) - __pa_symbol(&_text));
103 memblock_x86_reserve_range(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");
104 103
105#ifdef CONFIG_BLK_DEV_INITRD 104#ifdef CONFIG_BLK_DEV_INITRD
106 /* Reserve INITRD */ 105 /* Reserve INITRD */
@@ -109,7 +108,7 @@ void __init x86_64_start_reservations(char *real_mode_data)
109 unsigned long ramdisk_image = boot_params.hdr.ramdisk_image; 108 unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
110 unsigned long ramdisk_size = boot_params.hdr.ramdisk_size; 109 unsigned long ramdisk_size = boot_params.hdr.ramdisk_size;
111 unsigned long ramdisk_end = PAGE_ALIGN(ramdisk_image + ramdisk_size); 110 unsigned long ramdisk_end = PAGE_ALIGN(ramdisk_image + ramdisk_size);
112 memblock_x86_reserve_range(ramdisk_image, ramdisk_end, "RAMDISK"); 111 memblock_reserve(ramdisk_image, ramdisk_end - ramdisk_image);
113 } 112 }
114#endif 113#endif
115 114
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index b946a9eac7d9..ad0de0c2714e 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -2,7 +2,6 @@
2#include <linux/clockchips.h> 2#include <linux/clockchips.h>
3#include <linux/interrupt.h> 3#include <linux/interrupt.h>
4#include <linux/export.h> 4#include <linux/export.h>
5#include <linux/sysdev.h>
6#include <linux/delay.h> 5#include <linux/delay.h>
7#include <linux/errno.h> 6#include <linux/errno.h>
8#include <linux/i8253.h> 7#include <linux/i8253.h>
@@ -32,8 +31,6 @@
32#define HPET_MIN_CYCLES 128 31#define HPET_MIN_CYCLES 128
33#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1)) 32#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1))
34 33
35#define EVT_TO_HPET_DEV(evt) container_of(evt, struct hpet_dev, evt)
36
37/* 34/*
38 * HPET address is set in acpi/boot.c, when an ACPI entry exists 35 * HPET address is set in acpi/boot.c, when an ACPI entry exists
39 */ 36 */
@@ -55,6 +52,11 @@ struct hpet_dev {
55 char name[10]; 52 char name[10];
56}; 53};
57 54
55inline struct hpet_dev *EVT_TO_HPET_DEV(struct clock_event_device *evtdev)
56{
57 return container_of(evtdev, struct hpet_dev, evt);
58}
59
58inline unsigned int hpet_readl(unsigned int a) 60inline unsigned int hpet_readl(unsigned int a)
59{ 61{
60 return readl(hpet_virt_address + a); 62 return readl(hpet_virt_address + a);
@@ -1049,6 +1051,14 @@ int hpet_rtc_timer_init(void)
1049} 1051}
1050EXPORT_SYMBOL_GPL(hpet_rtc_timer_init); 1052EXPORT_SYMBOL_GPL(hpet_rtc_timer_init);
1051 1053
1054static void hpet_disable_rtc_channel(void)
1055{
1056 unsigned long cfg;
1057 cfg = hpet_readl(HPET_T1_CFG);
1058 cfg &= ~HPET_TN_ENABLE;
1059 hpet_writel(cfg, HPET_T1_CFG);
1060}
1061
1052/* 1062/*
1053 * The functions below are called from rtc driver. 1063 * The functions below are called from rtc driver.
1054 * Return 0 if HPET is not being used. 1064 * Return 0 if HPET is not being used.
@@ -1060,6 +1070,9 @@ int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
1060 return 0; 1070 return 0;
1061 1071
1062 hpet_rtc_flags &= ~bit_mask; 1072 hpet_rtc_flags &= ~bit_mask;
1073 if (unlikely(!hpet_rtc_flags))
1074 hpet_disable_rtc_channel();
1075
1063 return 1; 1076 return 1;
1064} 1077}
1065EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit); 1078EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit);
@@ -1125,15 +1138,11 @@ EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq);
1125 1138
1126static void hpet_rtc_timer_reinit(void) 1139static void hpet_rtc_timer_reinit(void)
1127{ 1140{
1128 unsigned int cfg, delta; 1141 unsigned int delta;
1129 int lost_ints = -1; 1142 int lost_ints = -1;
1130 1143
1131 if (unlikely(!hpet_rtc_flags)) { 1144 if (unlikely(!hpet_rtc_flags))
1132 cfg = hpet_readl(HPET_T1_CFG); 1145 hpet_disable_rtc_channel();
1133 cfg &= ~HPET_TN_ENABLE;
1134 hpet_writel(cfg, HPET_T1_CFG);
1135 return;
1136 }
1137 1146
1138 if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit) 1147 if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit)
1139 delta = hpet_default_delta; 1148 delta = hpet_default_delta;
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 429e0c92924e..7943e0c21bde 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -74,6 +74,10 @@ int arch_show_interrupts(struct seq_file *p, int prec)
74 for_each_online_cpu(j) 74 for_each_online_cpu(j)
75 seq_printf(p, "%10u ", irq_stats(j)->apic_irq_work_irqs); 75 seq_printf(p, "%10u ", irq_stats(j)->apic_irq_work_irqs);
76 seq_printf(p, " IRQ work interrupts\n"); 76 seq_printf(p, " IRQ work interrupts\n");
77 seq_printf(p, "%*s: ", prec, "RTR");
78 for_each_online_cpu(j)
79 seq_printf(p, "%10u ", irq_stats(j)->icr_read_retry_count);
80 seq_printf(p, " APIC ICR read retries\n");
77#endif 81#endif
78 if (x86_platform_ipi_callback) { 82 if (x86_platform_ipi_callback) {
79 seq_printf(p, "%*s: ", prec, "PLT"); 83 seq_printf(p, "%*s: ", prec, "PLT");
@@ -136,6 +140,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
136 sum += irq_stats(cpu)->irq_spurious_count; 140 sum += irq_stats(cpu)->irq_spurious_count;
137 sum += irq_stats(cpu)->apic_perf_irqs; 141 sum += irq_stats(cpu)->apic_perf_irqs;
138 sum += irq_stats(cpu)->apic_irq_work_irqs; 142 sum += irq_stats(cpu)->apic_irq_work_irqs;
143 sum += irq_stats(cpu)->icr_read_retry_count;
139#endif 144#endif
140 if (x86_platform_ipi_callback) 145 if (x86_platform_ipi_callback)
141 sum += irq_stats(cpu)->x86_platform_ipis; 146 sum += irq_stats(cpu)->x86_platform_ipis;
@@ -181,8 +186,8 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
181 unsigned vector = ~regs->orig_ax; 186 unsigned vector = ~regs->orig_ax;
182 unsigned irq; 187 unsigned irq;
183 188
184 exit_idle();
185 irq_enter(); 189 irq_enter();
190 exit_idle();
186 191
187 irq = __this_cpu_read(vector_irq[vector]); 192 irq = __this_cpu_read(vector_irq[vector]);
188 193
@@ -209,10 +214,10 @@ void smp_x86_platform_ipi(struct pt_regs *regs)
209 214
210 ack_APIC_irq(); 215 ack_APIC_irq();
211 216
212 exit_idle();
213
214 irq_enter(); 217 irq_enter();
215 218
219 exit_idle();
220
216 inc_irq_stat(x86_platform_ipis); 221 inc_irq_stat(x86_platform_ipis);
217 222
218 if (x86_platform_ipi_callback) 223 if (x86_platform_ipi_callback)
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index acf8fbf8fbda..69bca468c47a 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -38,6 +38,9 @@ static inline void stack_overflow_check(struct pt_regs *regs)
38#ifdef CONFIG_DEBUG_STACKOVERFLOW 38#ifdef CONFIG_DEBUG_STACKOVERFLOW
39 u64 curbase = (u64)task_stack_page(current); 39 u64 curbase = (u64)task_stack_page(current);
40 40
41 if (user_mode_vm(regs))
42 return;
43
41 WARN_ONCE(regs->sp >= curbase && 44 WARN_ONCE(regs->sp >= curbase &&
42 regs->sp <= curbase + THREAD_SIZE && 45 regs->sp <= curbase + THREAD_SIZE &&
43 regs->sp < curbase + sizeof(struct thread_info) + 46 regs->sp < curbase + sizeof(struct thread_info) +
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index b3300e6bacef..313fb5cddbce 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -9,7 +9,7 @@
9#include <linux/kprobes.h> 9#include <linux/kprobes.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/kernel_stat.h> 11#include <linux/kernel_stat.h>
12#include <linux/sysdev.h> 12#include <linux/device.h>
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14#include <linux/acpi.h> 14#include <linux/acpi.h>
15#include <linux/io.h> 15#include <linux/io.h>
diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c
index ea9d5f2f13ef..2889b3d43882 100644
--- a/arch/x86/kernel/jump_label.c
+++ b/arch/x86/kernel/jump_label.c
@@ -50,7 +50,7 @@ void arch_jump_label_transform(struct jump_entry *entry,
50 put_online_cpus(); 50 put_online_cpus();
51} 51}
52 52
53void arch_jump_label_transform_static(struct jump_entry *entry, 53__init_or_module void arch_jump_label_transform_static(struct jump_entry *entry,
54 enum jump_label_type type) 54 enum jump_label_type type)
55{ 55{
56 __jump_label_transform(entry, type, text_poke_early); 56 __jump_label_transform(entry, type, text_poke_early);
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index c1a0188e29ae..44842d756b29 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -74,9 +74,10 @@ static cycle_t kvm_clock_read(void)
74 struct pvclock_vcpu_time_info *src; 74 struct pvclock_vcpu_time_info *src;
75 cycle_t ret; 75 cycle_t ret;
76 76
77 src = &get_cpu_var(hv_clock); 77 preempt_disable_notrace();
78 src = &__get_cpu_var(hv_clock);
78 ret = pvclock_clocksource_read(src); 79 ret = pvclock_clocksource_read(src);
79 put_cpu_var(hv_clock); 80 preempt_enable_notrace();
80 return ret; 81 return ret;
81} 82}
82 83
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index d494799aafcd..fe86493f3ed1 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -1,14 +1,18 @@
1/* 1/*
2 * AMD CPU Microcode Update Driver for Linux 2 * AMD CPU Microcode Update Driver for Linux
3 * Copyright (C) 2008 Advanced Micro Devices Inc. 3 * Copyright (C) 2008-2011 Advanced Micro Devices Inc.
4 * 4 *
5 * Author: Peter Oruba <peter.oruba@amd.com> 5 * Author: Peter Oruba <peter.oruba@amd.com>
6 * 6 *
7 * Based on work by: 7 * Based on work by:
8 * Tigran Aivazian <tigran@aivazian.fsnet.co.uk> 8 * Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
9 * 9 *
10 * This driver allows to upgrade microcode on AMD 10 * Maintainers:
11 * family 0x10 and 0x11 processors. 11 * Andreas Herrmann <andreas.herrmann3@amd.com>
12 * Borislav Petkov <borislav.petkov@amd.com>
13 *
14 * This driver allows to upgrade microcode on F10h AMD
15 * CPUs and later.
12 * 16 *
13 * Licensed under the terms of the GNU General Public 17 * Licensed under the terms of the GNU General Public
14 * License version 2. See file COPYING for details. 18 * License version 2. See file COPYING for details.
@@ -71,6 +75,9 @@ struct microcode_amd {
71 75
72static struct equiv_cpu_entry *equiv_cpu_table; 76static struct equiv_cpu_entry *equiv_cpu_table;
73 77
78/* page-sized ucode patch buffer */
79void *patch;
80
74static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig) 81static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
75{ 82{
76 struct cpuinfo_x86 *c = &cpu_data(cpu); 83 struct cpuinfo_x86 *c = &cpu_data(cpu);
@@ -86,27 +93,76 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
86 return 0; 93 return 0;
87} 94}
88 95
89static int get_matching_microcode(int cpu, struct microcode_header_amd *mc_hdr, 96static unsigned int verify_ucode_size(int cpu, u32 patch_size,
90 int rev) 97 unsigned int size)
91{ 98{
92 unsigned int current_cpu_id; 99 struct cpuinfo_x86 *c = &cpu_data(cpu);
93 u16 equiv_cpu_id = 0; 100 u32 max_size;
94 unsigned int i = 0; 101
102#define F1XH_MPB_MAX_SIZE 2048
103#define F14H_MPB_MAX_SIZE 1824
104#define F15H_MPB_MAX_SIZE 4096
105
106 switch (c->x86) {
107 case 0x14:
108 max_size = F14H_MPB_MAX_SIZE;
109 break;
110 case 0x15:
111 max_size = F15H_MPB_MAX_SIZE;
112 break;
113 default:
114 max_size = F1XH_MPB_MAX_SIZE;
115 break;
116 }
117
118 if (patch_size > min_t(u32, size, max_size)) {
119 pr_err("patch size mismatch\n");
120 return 0;
121 }
122
123 return patch_size;
124}
125
126static u16 find_equiv_id(void)
127{
128 unsigned int current_cpu_id, i = 0;
95 129
96 BUG_ON(equiv_cpu_table == NULL); 130 BUG_ON(equiv_cpu_table == NULL);
131
97 current_cpu_id = cpuid_eax(0x00000001); 132 current_cpu_id = cpuid_eax(0x00000001);
98 133
99 while (equiv_cpu_table[i].installed_cpu != 0) { 134 while (equiv_cpu_table[i].installed_cpu != 0) {
100 if (current_cpu_id == equiv_cpu_table[i].installed_cpu) { 135 if (current_cpu_id == equiv_cpu_table[i].installed_cpu)
101 equiv_cpu_id = equiv_cpu_table[i].equiv_cpu; 136 return equiv_cpu_table[i].equiv_cpu;
102 break; 137
103 }
104 i++; 138 i++;
105 } 139 }
140 return 0;
141}
106 142
143/*
144 * we signal a good patch is found by returning its size > 0
145 */
146static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
147 unsigned int leftover_size, int rev,
148 unsigned int *current_size)
149{
150 struct microcode_header_amd *mc_hdr;
151 unsigned int actual_size;
152 u16 equiv_cpu_id;
153
154 /* size of the current patch we're staring at */
155 *current_size = *(u32 *)(ucode_ptr + 4) + SECTION_HDR_SIZE;
156
157 equiv_cpu_id = find_equiv_id();
107 if (!equiv_cpu_id) 158 if (!equiv_cpu_id)
108 return 0; 159 return 0;
109 160
161 /*
162 * let's look at the patch header itself now
163 */
164 mc_hdr = (struct microcode_header_amd *)(ucode_ptr + SECTION_HDR_SIZE);
165
110 if (mc_hdr->processor_rev_id != equiv_cpu_id) 166 if (mc_hdr->processor_rev_id != equiv_cpu_id)
111 return 0; 167 return 0;
112 168
@@ -120,7 +176,20 @@ static int get_matching_microcode(int cpu, struct microcode_header_amd *mc_hdr,
120 if (mc_hdr->patch_id <= rev) 176 if (mc_hdr->patch_id <= rev)
121 return 0; 177 return 0;
122 178
123 return 1; 179 /*
180 * now that the header looks sane, verify its size
181 */
182 actual_size = verify_ucode_size(cpu, *current_size, leftover_size);
183 if (!actual_size)
184 return 0;
185
186 /* clear the patch buffer */
187 memset(patch, 0, PAGE_SIZE);
188
189 /* all looks ok, get the binary patch */
190 get_ucode_data(patch, ucode_ptr + SECTION_HDR_SIZE, actual_size);
191
192 return actual_size;
124} 193}
125 194
126static int apply_microcode_amd(int cpu) 195static int apply_microcode_amd(int cpu)
@@ -155,63 +224,6 @@ static int apply_microcode_amd(int cpu)
155 return 0; 224 return 0;
156} 225}
157 226
158static unsigned int verify_ucode_size(int cpu, const u8 *buf, unsigned int size)
159{
160 struct cpuinfo_x86 *c = &cpu_data(cpu);
161 u32 max_size, actual_size;
162
163#define F1XH_MPB_MAX_SIZE 2048
164#define F14H_MPB_MAX_SIZE 1824
165#define F15H_MPB_MAX_SIZE 4096
166
167 switch (c->x86) {
168 case 0x14:
169 max_size = F14H_MPB_MAX_SIZE;
170 break;
171 case 0x15:
172 max_size = F15H_MPB_MAX_SIZE;
173 break;
174 default:
175 max_size = F1XH_MPB_MAX_SIZE;
176 break;
177 }
178
179 actual_size = *(u32 *)(buf + 4);
180
181 if (actual_size + SECTION_HDR_SIZE > size || actual_size > max_size) {
182 pr_err("section size mismatch\n");
183 return 0;
184 }
185
186 return actual_size;
187}
188
189static struct microcode_header_amd *
190get_next_ucode(int cpu, const u8 *buf, unsigned int size, unsigned int *mc_size)
191{
192 struct microcode_header_amd *mc = NULL;
193 unsigned int actual_size = 0;
194
195 if (*(u32 *)buf != UCODE_UCODE_TYPE) {
196 pr_err("invalid type field in container file section header\n");
197 goto out;
198 }
199
200 actual_size = verify_ucode_size(cpu, buf, size);
201 if (!actual_size)
202 goto out;
203
204 mc = vzalloc(actual_size);
205 if (!mc)
206 goto out;
207
208 get_ucode_data(mc, buf + SECTION_HDR_SIZE, actual_size);
209 *mc_size = actual_size + SECTION_HDR_SIZE;
210
211out:
212 return mc;
213}
214
215static int install_equiv_cpu_table(const u8 *buf) 227static int install_equiv_cpu_table(const u8 *buf)
216{ 228{
217 unsigned int *ibuf = (unsigned int *)buf; 229 unsigned int *ibuf = (unsigned int *)buf;
@@ -247,36 +259,38 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
247{ 259{
248 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 260 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
249 struct microcode_header_amd *mc_hdr = NULL; 261 struct microcode_header_amd *mc_hdr = NULL;
250 unsigned int mc_size, leftover; 262 unsigned int mc_size, leftover, current_size = 0;
251 int offset; 263 int offset;
252 const u8 *ucode_ptr = data; 264 const u8 *ucode_ptr = data;
253 void *new_mc = NULL; 265 void *new_mc = NULL;
254 unsigned int new_rev = uci->cpu_sig.rev; 266 unsigned int new_rev = uci->cpu_sig.rev;
255 enum ucode_state state = UCODE_OK; 267 enum ucode_state state = UCODE_ERROR;
256 268
257 offset = install_equiv_cpu_table(ucode_ptr); 269 offset = install_equiv_cpu_table(ucode_ptr);
258 if (offset < 0) { 270 if (offset < 0) {
259 pr_err("failed to create equivalent cpu table\n"); 271 pr_err("failed to create equivalent cpu table\n");
260 return UCODE_ERROR; 272 goto out;
261 } 273 }
262
263 ucode_ptr += offset; 274 ucode_ptr += offset;
264 leftover = size - offset; 275 leftover = size - offset;
265 276
266 while (leftover) { 277 if (*(u32 *)ucode_ptr != UCODE_UCODE_TYPE) {
267 mc_hdr = get_next_ucode(cpu, ucode_ptr, leftover, &mc_size); 278 pr_err("invalid type field in container file section header\n");
268 if (!mc_hdr) 279 goto free_table;
269 break; 280 }
270 281
271 if (get_matching_microcode(cpu, mc_hdr, new_rev)) { 282 while (leftover) {
272 vfree(new_mc); 283 mc_size = get_matching_microcode(cpu, ucode_ptr, leftover,
284 new_rev, &current_size);
285 if (mc_size) {
286 mc_hdr = patch;
287 new_mc = patch;
273 new_rev = mc_hdr->patch_id; 288 new_rev = mc_hdr->patch_id;
274 new_mc = mc_hdr; 289 goto out_ok;
275 } else 290 }
276 vfree(mc_hdr);
277 291
278 ucode_ptr += mc_size; 292 ucode_ptr += current_size;
279 leftover -= mc_size; 293 leftover -= current_size;
280 } 294 }
281 295
282 if (!new_mc) { 296 if (!new_mc) {
@@ -284,19 +298,16 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
284 goto free_table; 298 goto free_table;
285 } 299 }
286 300
287 if (!leftover) { 301out_ok:
288 vfree(uci->mc); 302 uci->mc = new_mc;
289 uci->mc = new_mc; 303 state = UCODE_OK;
290 pr_debug("CPU%d update ucode (0x%08x -> 0x%08x)\n", 304 pr_debug("CPU%d update ucode (0x%08x -> 0x%08x)\n",
291 cpu, uci->cpu_sig.rev, new_rev); 305 cpu, uci->cpu_sig.rev, new_rev);
292 } else {
293 vfree(new_mc);
294 state = UCODE_ERROR;
295 }
296 306
297free_table: 307free_table:
298 free_equiv_cpu_table(); 308 free_equiv_cpu_table();
299 309
310out:
300 return state; 311 return state;
301} 312}
302 313
@@ -337,7 +348,6 @@ static void microcode_fini_cpu_amd(int cpu)
337{ 348{
338 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 349 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
339 350
340 vfree(uci->mc);
341 uci->mc = NULL; 351 uci->mc = NULL;
342} 352}
343 353
@@ -351,5 +361,14 @@ static struct microcode_ops microcode_amd_ops = {
351 361
352struct microcode_ops * __init init_amd_microcode(void) 362struct microcode_ops * __init init_amd_microcode(void)
353{ 363{
364 patch = (void *)get_zeroed_page(GFP_KERNEL);
365 if (!patch)
366 return NULL;
367
354 return &microcode_amd_ops; 368 return &microcode_amd_ops;
355} 369}
370
371void __exit exit_amd_microcode(void)
372{
373 free_page((unsigned long)patch);
374}
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index f2d2a664e797..fda91c307104 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -256,7 +256,7 @@ static int __init microcode_dev_init(void)
256 return 0; 256 return 0;
257} 257}
258 258
259static void microcode_dev_exit(void) 259static void __exit microcode_dev_exit(void)
260{ 260{
261 misc_deregister(&microcode_dev); 261 misc_deregister(&microcode_dev);
262} 262}
@@ -292,8 +292,8 @@ static int reload_for_cpu(int cpu)
292 return err; 292 return err;
293} 293}
294 294
295static ssize_t reload_store(struct sys_device *dev, 295static ssize_t reload_store(struct device *dev,
296 struct sysdev_attribute *attr, 296 struct device_attribute *attr,
297 const char *buf, size_t size) 297 const char *buf, size_t size)
298{ 298{
299 unsigned long val; 299 unsigned long val;
@@ -318,30 +318,30 @@ static ssize_t reload_store(struct sys_device *dev,
318 return ret; 318 return ret;
319} 319}
320 320
321static ssize_t version_show(struct sys_device *dev, 321static ssize_t version_show(struct device *dev,
322 struct sysdev_attribute *attr, char *buf) 322 struct device_attribute *attr, char *buf)
323{ 323{
324 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; 324 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
325 325
326 return sprintf(buf, "0x%x\n", uci->cpu_sig.rev); 326 return sprintf(buf, "0x%x\n", uci->cpu_sig.rev);
327} 327}
328 328
329static ssize_t pf_show(struct sys_device *dev, 329static ssize_t pf_show(struct device *dev,
330 struct sysdev_attribute *attr, char *buf) 330 struct device_attribute *attr, char *buf)
331{ 331{
332 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; 332 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
333 333
334 return sprintf(buf, "0x%x\n", uci->cpu_sig.pf); 334 return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
335} 335}
336 336
337static SYSDEV_ATTR(reload, 0200, NULL, reload_store); 337static DEVICE_ATTR(reload, 0200, NULL, reload_store);
338static SYSDEV_ATTR(version, 0400, version_show, NULL); 338static DEVICE_ATTR(version, 0400, version_show, NULL);
339static SYSDEV_ATTR(processor_flags, 0400, pf_show, NULL); 339static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL);
340 340
341static struct attribute *mc_default_attrs[] = { 341static struct attribute *mc_default_attrs[] = {
342 &attr_reload.attr, 342 &dev_attr_reload.attr,
343 &attr_version.attr, 343 &dev_attr_version.attr,
344 &attr_processor_flags.attr, 344 &dev_attr_processor_flags.attr,
345 NULL 345 NULL
346}; 346};
347 347
@@ -405,43 +405,45 @@ static enum ucode_state microcode_update_cpu(int cpu)
405 return ustate; 405 return ustate;
406} 406}
407 407
408static int mc_sysdev_add(struct sys_device *sys_dev) 408static int mc_device_add(struct device *dev, struct subsys_interface *sif)
409{ 409{
410 int err, cpu = sys_dev->id; 410 int err, cpu = dev->id;
411 411
412 if (!cpu_online(cpu)) 412 if (!cpu_online(cpu))
413 return 0; 413 return 0;
414 414
415 pr_debug("CPU%d added\n", cpu); 415 pr_debug("CPU%d added\n", cpu);
416 416
417 err = sysfs_create_group(&sys_dev->kobj, &mc_attr_group); 417 err = sysfs_create_group(&dev->kobj, &mc_attr_group);
418 if (err) 418 if (err)
419 return err; 419 return err;
420 420
421 if (microcode_init_cpu(cpu) == UCODE_ERROR) { 421 if (microcode_init_cpu(cpu) == UCODE_ERROR) {
422 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); 422 sysfs_remove_group(&dev->kobj, &mc_attr_group);
423 return -EINVAL; 423 return -EINVAL;
424 } 424 }
425 425
426 return err; 426 return err;
427} 427}
428 428
429static int mc_sysdev_remove(struct sys_device *sys_dev) 429static int mc_device_remove(struct device *dev, struct subsys_interface *sif)
430{ 430{
431 int cpu = sys_dev->id; 431 int cpu = dev->id;
432 432
433 if (!cpu_online(cpu)) 433 if (!cpu_online(cpu))
434 return 0; 434 return 0;
435 435
436 pr_debug("CPU%d removed\n", cpu); 436 pr_debug("CPU%d removed\n", cpu);
437 microcode_fini_cpu(cpu); 437 microcode_fini_cpu(cpu);
438 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); 438 sysfs_remove_group(&dev->kobj, &mc_attr_group);
439 return 0; 439 return 0;
440} 440}
441 441
442static struct sysdev_driver mc_sysdev_driver = { 442static struct subsys_interface mc_cpu_interface = {
443 .add = mc_sysdev_add, 443 .name = "microcode",
444 .remove = mc_sysdev_remove, 444 .subsys = &cpu_subsys,
445 .add_dev = mc_device_add,
446 .remove_dev = mc_device_remove,
445}; 447};
446 448
447/** 449/**
@@ -464,9 +466,9 @@ static __cpuinit int
464mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) 466mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
465{ 467{
466 unsigned int cpu = (unsigned long)hcpu; 468 unsigned int cpu = (unsigned long)hcpu;
467 struct sys_device *sys_dev; 469 struct device *dev;
468 470
469 sys_dev = get_cpu_sysdev(cpu); 471 dev = get_cpu_device(cpu);
470 switch (action) { 472 switch (action) {
471 case CPU_ONLINE: 473 case CPU_ONLINE:
472 case CPU_ONLINE_FROZEN: 474 case CPU_ONLINE_FROZEN:
@@ -474,13 +476,13 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
474 case CPU_DOWN_FAILED: 476 case CPU_DOWN_FAILED:
475 case CPU_DOWN_FAILED_FROZEN: 477 case CPU_DOWN_FAILED_FROZEN:
476 pr_debug("CPU%d added\n", cpu); 478 pr_debug("CPU%d added\n", cpu);
477 if (sysfs_create_group(&sys_dev->kobj, &mc_attr_group)) 479 if (sysfs_create_group(&dev->kobj, &mc_attr_group))
478 pr_err("Failed to create group for CPU%d\n", cpu); 480 pr_err("Failed to create group for CPU%d\n", cpu);
479 break; 481 break;
480 case CPU_DOWN_PREPARE: 482 case CPU_DOWN_PREPARE:
481 case CPU_DOWN_PREPARE_FROZEN: 483 case CPU_DOWN_PREPARE_FROZEN:
482 /* Suspend is in progress, only remove the interface */ 484 /* Suspend is in progress, only remove the interface */
483 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); 485 sysfs_remove_group(&dev->kobj, &mc_attr_group);
484 pr_debug("CPU%d removed\n", cpu); 486 pr_debug("CPU%d removed\n", cpu);
485 break; 487 break;
486 488
@@ -519,27 +521,23 @@ static int __init microcode_init(void)
519 521
520 microcode_pdev = platform_device_register_simple("microcode", -1, 522 microcode_pdev = platform_device_register_simple("microcode", -1,
521 NULL, 0); 523 NULL, 0);
522 if (IS_ERR(microcode_pdev)) { 524 if (IS_ERR(microcode_pdev))
523 microcode_dev_exit();
524 return PTR_ERR(microcode_pdev); 525 return PTR_ERR(microcode_pdev);
525 }
526 526
527 get_online_cpus(); 527 get_online_cpus();
528 mutex_lock(&microcode_mutex); 528 mutex_lock(&microcode_mutex);
529 529
530 error = sysdev_driver_register(&cpu_sysdev_class, &mc_sysdev_driver); 530 error = subsys_interface_register(&mc_cpu_interface);
531 531
532 mutex_unlock(&microcode_mutex); 532 mutex_unlock(&microcode_mutex);
533 put_online_cpus(); 533 put_online_cpus();
534 534
535 if (error) { 535 if (error)
536 platform_device_unregister(microcode_pdev); 536 goto out_pdev;
537 return error;
538 }
539 537
540 error = microcode_dev_init(); 538 error = microcode_dev_init();
541 if (error) 539 if (error)
542 return error; 540 goto out_driver;
543 541
544 register_syscore_ops(&mc_syscore_ops); 542 register_syscore_ops(&mc_syscore_ops);
545 register_hotcpu_notifier(&mc_cpu_notifier); 543 register_hotcpu_notifier(&mc_cpu_notifier);
@@ -548,11 +546,27 @@ static int __init microcode_init(void)
548 " <tigran@aivazian.fsnet.co.uk>, Peter Oruba\n"); 546 " <tigran@aivazian.fsnet.co.uk>, Peter Oruba\n");
549 547
550 return 0; 548 return 0;
549
550out_driver:
551 get_online_cpus();
552 mutex_lock(&microcode_mutex);
553
554 subsys_interface_unregister(&mc_cpu_interface);
555
556 mutex_unlock(&microcode_mutex);
557 put_online_cpus();
558
559out_pdev:
560 platform_device_unregister(microcode_pdev);
561 return error;
562
551} 563}
552module_init(microcode_init); 564module_init(microcode_init);
553 565
554static void __exit microcode_exit(void) 566static void __exit microcode_exit(void)
555{ 567{
568 struct cpuinfo_x86 *c = &cpu_data(0);
569
556 microcode_dev_exit(); 570 microcode_dev_exit();
557 571
558 unregister_hotcpu_notifier(&mc_cpu_notifier); 572 unregister_hotcpu_notifier(&mc_cpu_notifier);
@@ -561,7 +575,7 @@ static void __exit microcode_exit(void)
561 get_online_cpus(); 575 get_online_cpus();
562 mutex_lock(&microcode_mutex); 576 mutex_lock(&microcode_mutex);
563 577
564 sysdev_driver_unregister(&cpu_sysdev_class, &mc_sysdev_driver); 578 subsys_interface_unregister(&mc_cpu_interface);
565 579
566 mutex_unlock(&microcode_mutex); 580 mutex_unlock(&microcode_mutex);
567 put_online_cpus(); 581 put_online_cpus();
@@ -570,6 +584,9 @@ static void __exit microcode_exit(void)
570 584
571 microcode_ops = NULL; 585 microcode_ops = NULL;
572 586
587 if (c->x86_vendor == X86_VENDOR_AMD)
588 exit_amd_microcode();
589
573 pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n"); 590 pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n");
574} 591}
575module_exit(microcode_exit); 592module_exit(microcode_exit);
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 9103b89c145a..ca470e4c92dc 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mpc_bus *m)
95 } 95 }
96#endif 96#endif
97 97
98 set_bit(m->busid, mp_bus_not_pci);
98 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { 99 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) {
99 set_bit(m->busid, mp_bus_not_pci);
100#if defined(CONFIG_EISA) || defined(CONFIG_MCA) 100#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
101 mp_bus_id_to_type[m->busid] = MP_BUS_ISA; 101 mp_bus_id_to_type[m->busid] = MP_BUS_ISA;
102#endif 102#endif
@@ -564,9 +564,7 @@ void __init default_get_smp_config(unsigned int early)
564 564
565static void __init smp_reserve_memory(struct mpf_intel *mpf) 565static void __init smp_reserve_memory(struct mpf_intel *mpf)
566{ 566{
567 unsigned long size = get_mpc_size(mpf->physptr); 567 memblock_reserve(mpf->physptr, get_mpc_size(mpf->physptr));
568
569 memblock_x86_reserve_range(mpf->physptr, mpf->physptr+size, "* MP-table mpc");
570} 568}
571 569
572static int __init smp_scan_config(unsigned long base, unsigned long length) 570static int __init smp_scan_config(unsigned long base, unsigned long length)
@@ -595,7 +593,7 @@ static int __init smp_scan_config(unsigned long base, unsigned long length)
595 mpf, (u64)virt_to_phys(mpf)); 593 mpf, (u64)virt_to_phys(mpf));
596 594
597 mem = virt_to_phys(mpf); 595 mem = virt_to_phys(mpf);
598 memblock_x86_reserve_range(mem, mem + sizeof(*mpf), "* MP-table mpf"); 596 memblock_reserve(mem, sizeof(*mpf));
599 if (mpf->physptr) 597 if (mpf->physptr)
600 smp_reserve_memory(mpf); 598 smp_reserve_memory(mpf);
601 599
@@ -836,10 +834,8 @@ early_param("alloc_mptable", parse_alloc_mptable_opt);
836 834
837void __init early_reserve_e820_mpc_new(void) 835void __init early_reserve_e820_mpc_new(void)
838{ 836{
839 if (enable_update_mptable && alloc_mptable) { 837 if (enable_update_mptable && alloc_mptable)
840 u64 startt = 0; 838 mpc_new_phys = early_reserve_e820(mpc_new_length, 4);
841 mpc_new_phys = early_reserve_e820(startt, mpc_new_length, 4);
842 }
843} 839}
844 840
845static int __init update_mp_table(void) 841static int __init update_mp_table(void)
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 12fcbe2c143e..96356762a51d 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -236,7 +236,7 @@ static struct notifier_block __refdata msr_class_cpu_notifier = {
236 .notifier_call = msr_class_cpu_callback, 236 .notifier_call = msr_class_cpu_callback,
237}; 237};
238 238
239static char *msr_devnode(struct device *dev, mode_t *mode) 239static char *msr_devnode(struct device *dev, umode_t *mode)
240{ 240{
241 return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt)); 241 return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt));
242} 242}
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index b9c8628974af..e88f37b58ddd 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -29,6 +29,7 @@
29#include <asm/traps.h> 29#include <asm/traps.h>
30#include <asm/mach_traps.h> 30#include <asm/mach_traps.h>
31#include <asm/nmi.h> 31#include <asm/nmi.h>
32#include <asm/x86_init.h>
32 33
33#define NMI_MAX_NAMELEN 16 34#define NMI_MAX_NAMELEN 16
34struct nmiaction { 35struct nmiaction {
@@ -348,7 +349,7 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
348 349
349 /* Non-CPU-specific NMI: NMI sources can be processed on any CPU */ 350 /* Non-CPU-specific NMI: NMI sources can be processed on any CPU */
350 raw_spin_lock(&nmi_reason_lock); 351 raw_spin_lock(&nmi_reason_lock);
351 reason = get_nmi_reason(); 352 reason = x86_platform.get_nmi_reason();
352 353
353 if (reason & NMI_REASON_MASK) { 354 if (reason & NMI_REASON_MASK) {
354 if (reason & NMI_REASON_SERR) 355 if (reason & NMI_REASON_SERR)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index b9b3b1a51643..15763af7bfe3 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -293,7 +293,7 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
293 regs.orig_ax = -1; 293 regs.orig_ax = -1;
294 regs.ip = (unsigned long) kernel_thread_helper; 294 regs.ip = (unsigned long) kernel_thread_helper;
295 regs.cs = __KERNEL_CS | get_kernel_rpl(); 295 regs.cs = __KERNEL_CS | get_kernel_rpl();
296 regs.flags = X86_EFLAGS_IF | 0x2; 296 regs.flags = X86_EFLAGS_IF | X86_EFLAGS_BIT1;
297 297
298 /* Ok, create the new process.. */ 298 /* Ok, create the new process.. */
299 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 299 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
@@ -403,6 +403,14 @@ void default_idle(void)
403EXPORT_SYMBOL(default_idle); 403EXPORT_SYMBOL(default_idle);
404#endif 404#endif
405 405
406bool set_pm_idle_to_default(void)
407{
408 bool ret = !!pm_idle;
409
410 pm_idle = default_idle;
411
412 return ret;
413}
406void stop_this_cpu(void *dummy) 414void stop_this_cpu(void *dummy)
407{ 415{
408 local_irq_disable(); 416 local_irq_disable();
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 795b79f984c2..485204f58cda 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -99,7 +99,8 @@ void cpu_idle(void)
99 99
100 /* endless idle loop with no priority at all */ 100 /* endless idle loop with no priority at all */
101 while (1) { 101 while (1) {
102 tick_nohz_stop_sched_tick(1); 102 tick_nohz_idle_enter();
103 rcu_idle_enter();
103 while (!need_resched()) { 104 while (!need_resched()) {
104 105
105 check_pgt_cache(); 106 check_pgt_cache();
@@ -116,7 +117,8 @@ void cpu_idle(void)
116 pm_idle(); 117 pm_idle();
117 start_critical_timings(); 118 start_critical_timings();
118 } 119 }
119 tick_nohz_restart_sched_tick(); 120 rcu_idle_exit();
121 tick_nohz_idle_exit();
120 preempt_enable_no_resched(); 122 preempt_enable_no_resched();
121 schedule(); 123 schedule();
122 preempt_disable(); 124 preempt_disable();
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 3bd7e6eebf31..9b9fe4a85c87 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -122,7 +122,7 @@ void cpu_idle(void)
122 122
123 /* endless idle loop with no priority at all */ 123 /* endless idle loop with no priority at all */
124 while (1) { 124 while (1) {
125 tick_nohz_stop_sched_tick(1); 125 tick_nohz_idle_enter();
126 while (!need_resched()) { 126 while (!need_resched()) {
127 127
128 rmb(); 128 rmb();
@@ -139,8 +139,14 @@ void cpu_idle(void)
139 enter_idle(); 139 enter_idle();
140 /* Don't trace irqs off for idle */ 140 /* Don't trace irqs off for idle */
141 stop_critical_timings(); 141 stop_critical_timings();
142
143 /* enter_idle() needs rcu for notifiers */
144 rcu_idle_enter();
145
142 if (cpuidle_idle_call()) 146 if (cpuidle_idle_call())
143 pm_idle(); 147 pm_idle();
148
149 rcu_idle_exit();
144 start_critical_timings(); 150 start_critical_timings();
145 151
146 /* In many cases the interrupt that ended idle 152 /* In many cases the interrupt that ended idle
@@ -149,7 +155,7 @@ void cpu_idle(void)
149 __exit_idle(); 155 __exit_idle();
150 } 156 }
151 157
152 tick_nohz_restart_sched_tick(); 158 tick_nohz_idle_exit();
153 preempt_enable_no_resched(); 159 preempt_enable_no_resched();
154 schedule(); 160 schedule();
155 preempt_disable(); 161 preempt_disable();
@@ -293,13 +299,12 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
293 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); 299 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
294 300
295 if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) { 301 if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) {
296 p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); 302 p->thread.io_bitmap_ptr = kmemdup(me->thread.io_bitmap_ptr,
303 IO_BITMAP_BYTES, GFP_KERNEL);
297 if (!p->thread.io_bitmap_ptr) { 304 if (!p->thread.io_bitmap_ptr) {
298 p->thread.io_bitmap_max = 0; 305 p->thread.io_bitmap_max = 0;
299 return -ENOMEM; 306 return -ENOMEM;
300 } 307 }
301 memcpy(p->thread.io_bitmap_ptr, me->thread.io_bitmap_ptr,
302 IO_BITMAP_BYTES);
303 set_tsk_thread_flag(p, TIF_IO_BITMAP); 308 set_tsk_thread_flag(p, TIF_IO_BITMAP);
304 } 309 }
305 310
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 82528799c5de..89a04c7b5bb6 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -749,7 +749,8 @@ put:
749/* 749/*
750 * Handle PTRACE_POKEUSR calls for the debug register area. 750 * Handle PTRACE_POKEUSR calls for the debug register area.
751 */ 751 */
752int ptrace_set_debugreg(struct task_struct *tsk, int n, unsigned long val) 752static int ptrace_set_debugreg(struct task_struct *tsk, int n,
753 unsigned long val)
753{ 754{
754 struct thread_struct *thread = &(tsk->thread); 755 struct thread_struct *thread = &(tsk->thread);
755 int rc = 0; 756 int rc = 0;
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index b78643d0f9a5..03920a15a632 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -553,4 +553,17 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC,
553 quirk_amd_nb_node); 553 quirk_amd_nb_node);
554DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK, 554DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK,
555 quirk_amd_nb_node); 555 quirk_amd_nb_node);
556DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F0,
557 quirk_amd_nb_node);
558DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F1,
559 quirk_amd_nb_node);
560DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F2,
561 quirk_amd_nb_node);
562DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F3,
563 quirk_amd_nb_node);
564DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4,
565 quirk_amd_nb_node);
566DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F5,
567 quirk_amd_nb_node);
568
556#endif 569#endif
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index e334be1182b9..37a458b521a6 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -124,7 +124,7 @@ __setup("reboot=", reboot_setup);
124 */ 124 */
125 125
126/* 126/*
127 * Some machines require the "reboot=b" commandline option, 127 * Some machines require the "reboot=b" or "reboot=k" commandline options,
128 * this quirk makes that automatic. 128 * this quirk makes that automatic.
129 */ 129 */
130static int __init set_bios_reboot(const struct dmi_system_id *d) 130static int __init set_bios_reboot(const struct dmi_system_id *d)
@@ -136,6 +136,15 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
136 return 0; 136 return 0;
137} 137}
138 138
139static int __init set_kbd_reboot(const struct dmi_system_id *d)
140{
141 if (reboot_type != BOOT_KBD) {
142 reboot_type = BOOT_KBD;
143 printk(KERN_INFO "%s series board detected. Selecting KBD-method for reboot.\n", d->ident);
144 }
145 return 0;
146}
147
139static struct dmi_system_id __initdata reboot_dmi_table[] = { 148static struct dmi_system_id __initdata reboot_dmi_table[] = {
140 { /* Handle problems with rebooting on Dell E520's */ 149 { /* Handle problems with rebooting on Dell E520's */
141 .callback = set_bios_reboot, 150 .callback = set_bios_reboot,
@@ -295,7 +304,7 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
295 }, 304 },
296 }, 305 },
297 { /* Handle reboot issue on Acer Aspire one */ 306 { /* Handle reboot issue on Acer Aspire one */
298 .callback = set_bios_reboot, 307 .callback = set_kbd_reboot,
299 .ident = "Acer Aspire One A110", 308 .ident = "Acer Aspire One A110",
300 .matches = { 309 .matches = {
301 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 310 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
@@ -443,6 +452,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
443 DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), 452 DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
444 }, 453 },
445 }, 454 },
455 { /* Handle problems with rebooting on the OptiPlex 990. */
456 .callback = set_pci_reboot,
457 .ident = "Dell OptiPlex 990",
458 .matches = {
459 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
460 DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
461 },
462 },
446 { } 463 { }
447}; 464};
448 465
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c
index 348ce016a835..af6db6ec5b2a 100644
--- a/arch/x86/kernel/rtc.c
+++ b/arch/x86/kernel/rtc.c
@@ -12,6 +12,7 @@
12#include <asm/vsyscall.h> 12#include <asm/vsyscall.h>
13#include <asm/x86_init.h> 13#include <asm/x86_init.h>
14#include <asm/time.h> 14#include <asm/time.h>
15#include <asm/mrst.h>
15 16
16#ifdef CONFIG_X86_32 17#ifdef CONFIG_X86_32
17/* 18/*
@@ -242,6 +243,10 @@ static __init int add_rtc_cmos(void)
242 if (of_have_populated_dt()) 243 if (of_have_populated_dt())
243 return 0; 244 return 0;
244 245
246 /* Intel MID platforms don't have ioport rtc */
247 if (mrst_identify_cpu())
248 return -ENODEV;
249
245 platform_device_register(&rtc_device); 250 platform_device_register(&rtc_device);
246 dev_info(&rtc_device.dev, 251 dev_info(&rtc_device.dev,
247 "registered platform RTC device (no PNP device found)\n"); 252 "registered platform RTC device (no PNP device found)\n");
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index afaf38447ef5..d05444ac2aea 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -306,7 +306,8 @@ static void __init cleanup_highmap(void)
306static void __init reserve_brk(void) 306static void __init reserve_brk(void)
307{ 307{
308 if (_brk_end > _brk_start) 308 if (_brk_end > _brk_start)
309 memblock_x86_reserve_range(__pa(_brk_start), __pa(_brk_end), "BRK"); 309 memblock_reserve(__pa(_brk_start),
310 __pa(_brk_end) - __pa(_brk_start));
310 311
311 /* Mark brk area as locked down and no longer taking any 312 /* Mark brk area as locked down and no longer taking any
312 new allocations */ 313 new allocations */
@@ -331,13 +332,13 @@ static void __init relocate_initrd(void)
331 ramdisk_here = memblock_find_in_range(0, end_of_lowmem, area_size, 332 ramdisk_here = memblock_find_in_range(0, end_of_lowmem, area_size,
332 PAGE_SIZE); 333 PAGE_SIZE);
333 334
334 if (ramdisk_here == MEMBLOCK_ERROR) 335 if (!ramdisk_here)
335 panic("Cannot find place for new RAMDISK of size %lld\n", 336 panic("Cannot find place for new RAMDISK of size %lld\n",
336 ramdisk_size); 337 ramdisk_size);
337 338
338 /* Note: this includes all the lowmem currently occupied by 339 /* Note: this includes all the lowmem currently occupied by
339 the initrd, we rely on that fact to keep the data intact. */ 340 the initrd, we rely on that fact to keep the data intact. */
340 memblock_x86_reserve_range(ramdisk_here, ramdisk_here + area_size, "NEW RAMDISK"); 341 memblock_reserve(ramdisk_here, area_size);
341 initrd_start = ramdisk_here + PAGE_OFFSET; 342 initrd_start = ramdisk_here + PAGE_OFFSET;
342 initrd_end = initrd_start + ramdisk_size; 343 initrd_end = initrd_start + ramdisk_size;
343 printk(KERN_INFO "Allocated new RAMDISK: %08llx - %08llx\n", 344 printk(KERN_INFO "Allocated new RAMDISK: %08llx - %08llx\n",
@@ -393,7 +394,7 @@ static void __init reserve_initrd(void)
393 initrd_start = 0; 394 initrd_start = 0;
394 395
395 if (ramdisk_size >= (end_of_lowmem>>1)) { 396 if (ramdisk_size >= (end_of_lowmem>>1)) {
396 memblock_x86_free_range(ramdisk_image, ramdisk_end); 397 memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
397 printk(KERN_ERR "initrd too large to handle, " 398 printk(KERN_ERR "initrd too large to handle, "
398 "disabling initrd\n"); 399 "disabling initrd\n");
399 return; 400 return;
@@ -416,7 +417,7 @@ static void __init reserve_initrd(void)
416 417
417 relocate_initrd(); 418 relocate_initrd();
418 419
419 memblock_x86_free_range(ramdisk_image, ramdisk_end); 420 memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
420} 421}
421#else 422#else
422static void __init reserve_initrd(void) 423static void __init reserve_initrd(void)
@@ -490,15 +491,13 @@ static void __init memblock_x86_reserve_range_setup_data(void)
490{ 491{
491 struct setup_data *data; 492 struct setup_data *data;
492 u64 pa_data; 493 u64 pa_data;
493 char buf[32];
494 494
495 if (boot_params.hdr.version < 0x0209) 495 if (boot_params.hdr.version < 0x0209)
496 return; 496 return;
497 pa_data = boot_params.hdr.setup_data; 497 pa_data = boot_params.hdr.setup_data;
498 while (pa_data) { 498 while (pa_data) {
499 data = early_memremap(pa_data, sizeof(*data)); 499 data = early_memremap(pa_data, sizeof(*data));
500 sprintf(buf, "setup data %x", data->type); 500 memblock_reserve(pa_data, sizeof(*data) + data->len);
501 memblock_x86_reserve_range(pa_data, pa_data+sizeof(*data)+data->len, buf);
502 pa_data = data->next; 501 pa_data = data->next;
503 early_iounmap(data, sizeof(*data)); 502 early_iounmap(data, sizeof(*data));
504 } 503 }
@@ -554,7 +553,7 @@ static void __init reserve_crashkernel(void)
554 crash_base = memblock_find_in_range(alignment, 553 crash_base = memblock_find_in_range(alignment,
555 CRASH_KERNEL_ADDR_MAX, crash_size, alignment); 554 CRASH_KERNEL_ADDR_MAX, crash_size, alignment);
556 555
557 if (crash_base == MEMBLOCK_ERROR) { 556 if (!crash_base) {
558 pr_info("crashkernel reservation failed - No suitable area found.\n"); 557 pr_info("crashkernel reservation failed - No suitable area found.\n");
559 return; 558 return;
560 } 559 }
@@ -568,7 +567,7 @@ static void __init reserve_crashkernel(void)
568 return; 567 return;
569 } 568 }
570 } 569 }
571 memblock_x86_reserve_range(crash_base, crash_base + crash_size, "CRASH KERNEL"); 570 memblock_reserve(crash_base, crash_size);
572 571
573 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " 572 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
574 "for crashkernel (System RAM: %ldMB)\n", 573 "for crashkernel (System RAM: %ldMB)\n",
@@ -626,7 +625,7 @@ static __init void reserve_ibft_region(void)
626 addr = find_ibft_region(&size); 625 addr = find_ibft_region(&size);
627 626
628 if (size) 627 if (size)
629 memblock_x86_reserve_range(addr, addr + size, "* ibft"); 628 memblock_reserve(addr, size);
630} 629}
631 630
632static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10; 631static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10;
@@ -1045,6 +1044,8 @@ void __init setup_arch(char **cmdline_p)
1045 1044
1046 x86_init.timers.wallclock_init(); 1045 x86_init.timers.wallclock_init();
1047 1046
1047 x86_platform.wallclock_init();
1048
1048 mcheck_init(); 1049 mcheck_init();
1049 1050
1050 arch_init_ideal_nops(); 1051 arch_init_ideal_nops();
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 9f548cb4a958..e38e21754eea 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -840,7 +840,8 @@ int __cpuinit native_cpu_up(unsigned int cpu)
840 pr_debug("++++++++++++++++++++=_---CPU UP %u\n", cpu); 840 pr_debug("++++++++++++++++++++=_---CPU UP %u\n", cpu);
841 841
842 if (apicid == BAD_APICID || apicid == boot_cpu_physical_apicid || 842 if (apicid == BAD_APICID || apicid == boot_cpu_physical_apicid ||
843 !physid_isset(apicid, phys_cpu_present_map)) { 843 !physid_isset(apicid, phys_cpu_present_map) ||
844 (!x2apic_mode && apicid >= 255)) {
844 printk(KERN_ERR "%s: bad cpu %d\n", __func__, cpu); 845 printk(KERN_ERR "%s: bad cpu %d\n", __func__, cpu);
845 return -EINVAL; 846 return -EINVAL;
846 } 847 }
diff --git a/arch/x86/kernel/trampoline.c b/arch/x86/kernel/trampoline.c
index a91ae7709b49..a73b61055ad6 100644
--- a/arch/x86/kernel/trampoline.c
+++ b/arch/x86/kernel/trampoline.c
@@ -14,11 +14,11 @@ void __init setup_trampolines(void)
14 14
15 /* Has to be in very low memory so we can execute real-mode AP code. */ 15 /* Has to be in very low memory so we can execute real-mode AP code. */
16 mem = memblock_find_in_range(0, 1<<20, size, PAGE_SIZE); 16 mem = memblock_find_in_range(0, 1<<20, size, PAGE_SIZE);
17 if (mem == MEMBLOCK_ERROR) 17 if (!mem)
18 panic("Cannot allocate trampoline\n"); 18 panic("Cannot allocate trampoline\n");
19 19
20 x86_trampoline_base = __va(mem); 20 x86_trampoline_base = __va(mem);
21 memblock_x86_reserve_range(mem, mem + size, "TRAMPOLINE"); 21 memblock_reserve(mem, size);
22 22
23 printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n", 23 printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n",
24 x86_trampoline_base, (unsigned long long)mem, size); 24 x86_trampoline_base, (unsigned long long)mem, size);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a8e3eb83466c..fa1191fb679d 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -306,15 +306,10 @@ dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code)
306 == NOTIFY_STOP) 306 == NOTIFY_STOP)
307 return; 307 return;
308#endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */ 308#endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */
309#ifdef CONFIG_KPROBES 309
310 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) 310 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
311 == NOTIFY_STOP) 311 == NOTIFY_STOP)
312 return; 312 return;
313#else
314 if (notify_die(DIE_TRAP, "int3", regs, error_code, 3, SIGTRAP)
315 == NOTIFY_STOP)
316 return;
317#endif
318 313
319 preempt_conditional_sti(regs); 314 preempt_conditional_sti(regs);
320 do_trap(3, SIGTRAP, "int3", regs, error_code, NULL); 315 do_trap(3, SIGTRAP, "int3", regs, error_code, NULL);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index db483369f10b..2c9cf0fd78f5 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -35,7 +35,7 @@ static int __read_mostly tsc_unstable;
35 erroneous rdtsc usage on !cpu_has_tsc processors */ 35 erroneous rdtsc usage on !cpu_has_tsc processors */
36static int __read_mostly tsc_disabled = -1; 36static int __read_mostly tsc_disabled = -1;
37 37
38static int tsc_clocksource_reliable; 38int tsc_clocksource_reliable;
39/* 39/*
40 * Scheduler clock - returns current time in nanosec units. 40 * Scheduler clock - returns current time in nanosec units.
41 */ 41 */
@@ -178,11 +178,11 @@ static unsigned long calc_pmtimer_ref(u64 deltatsc, u64 pm1, u64 pm2)
178} 178}
179 179
180#define CAL_MS 10 180#define CAL_MS 10
181#define CAL_LATCH (CLOCK_TICK_RATE / (1000 / CAL_MS)) 181#define CAL_LATCH (PIT_TICK_RATE / (1000 / CAL_MS))
182#define CAL_PIT_LOOPS 1000 182#define CAL_PIT_LOOPS 1000
183 183
184#define CAL2_MS 50 184#define CAL2_MS 50
185#define CAL2_LATCH (CLOCK_TICK_RATE / (1000 / CAL2_MS)) 185#define CAL2_LATCH (PIT_TICK_RATE / (1000 / CAL2_MS))
186#define CAL2_PIT_LOOPS 5000 186#define CAL2_PIT_LOOPS 5000
187 187
188 188
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index 0aa5fed8b9e6..9eba29b46cb7 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -113,7 +113,7 @@ void __cpuinit check_tsc_sync_source(int cpu)
113 if (unsynchronized_tsc()) 113 if (unsynchronized_tsc())
114 return; 114 return;
115 115
116 if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) { 116 if (tsc_clocksource_reliable) {
117 if (cpu == (nr_cpu_ids-1) || system_state != SYSTEM_BOOTING) 117 if (cpu == (nr_cpu_ids-1) || system_state != SYSTEM_BOOTING)
118 pr_info( 118 pr_info(
119 "Skipped synchronization checks as TSC is reliable.\n"); 119 "Skipped synchronization checks as TSC is reliable.\n");
@@ -172,7 +172,7 @@ void __cpuinit check_tsc_sync_target(void)
172{ 172{
173 int cpus = 2; 173 int cpus = 2;
174 174
175 if (unsynchronized_tsc() || boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) 175 if (unsynchronized_tsc() || tsc_clocksource_reliable)
176 return; 176 return;
177 177
178 /* 178 /*
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index e4d4a22e8b94..b07ba9393564 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -57,7 +57,7 @@ DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data) =
57 .lock = __SEQLOCK_UNLOCKED(__vsyscall_gtod_data.lock), 57 .lock = __SEQLOCK_UNLOCKED(__vsyscall_gtod_data.lock),
58}; 58};
59 59
60static enum { EMULATE, NATIVE, NONE } vsyscall_mode = NATIVE; 60static enum { EMULATE, NATIVE, NONE } vsyscall_mode = EMULATE;
61 61
62static int __init vsyscall_setup(char *str) 62static int __init vsyscall_setup(char *str)
63{ 63{
@@ -140,11 +140,40 @@ static int addr_to_vsyscall_nr(unsigned long addr)
140 return nr; 140 return nr;
141} 141}
142 142
143static bool write_ok_or_segv(unsigned long ptr, size_t size)
144{
145 /*
146 * XXX: if access_ok, get_user, and put_user handled
147 * sig_on_uaccess_error, this could go away.
148 */
149
150 if (!access_ok(VERIFY_WRITE, (void __user *)ptr, size)) {
151 siginfo_t info;
152 struct thread_struct *thread = &current->thread;
153
154 thread->error_code = 6; /* user fault, no page, write */
155 thread->cr2 = ptr;
156 thread->trap_no = 14;
157
158 memset(&info, 0, sizeof(info));
159 info.si_signo = SIGSEGV;
160 info.si_errno = 0;
161 info.si_code = SEGV_MAPERR;
162 info.si_addr = (void __user *)ptr;
163
164 force_sig_info(SIGSEGV, &info, current);
165 return false;
166 } else {
167 return true;
168 }
169}
170
143bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) 171bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
144{ 172{
145 struct task_struct *tsk; 173 struct task_struct *tsk;
146 unsigned long caller; 174 unsigned long caller;
147 int vsyscall_nr; 175 int vsyscall_nr;
176 int prev_sig_on_uaccess_error;
148 long ret; 177 long ret;
149 178
150 /* 179 /*
@@ -180,35 +209,65 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
180 if (seccomp_mode(&tsk->seccomp)) 209 if (seccomp_mode(&tsk->seccomp))
181 do_exit(SIGKILL); 210 do_exit(SIGKILL);
182 211
212 /*
213 * With a real vsyscall, page faults cause SIGSEGV. We want to
214 * preserve that behavior to make writing exploits harder.
215 */
216 prev_sig_on_uaccess_error = current_thread_info()->sig_on_uaccess_error;
217 current_thread_info()->sig_on_uaccess_error = 1;
218
219 /*
220 * 0 is a valid user pointer (in the access_ok sense) on 32-bit and
221 * 64-bit, so we don't need to special-case it here. For all the
222 * vsyscalls, 0 means "don't write anything" not "write it at
223 * address 0".
224 */
225 ret = -EFAULT;
183 switch (vsyscall_nr) { 226 switch (vsyscall_nr) {
184 case 0: 227 case 0:
228 if (!write_ok_or_segv(regs->di, sizeof(struct timeval)) ||
229 !write_ok_or_segv(regs->si, sizeof(struct timezone)))
230 break;
231
185 ret = sys_gettimeofday( 232 ret = sys_gettimeofday(
186 (struct timeval __user *)regs->di, 233 (struct timeval __user *)regs->di,
187 (struct timezone __user *)regs->si); 234 (struct timezone __user *)regs->si);
188 break; 235 break;
189 236
190 case 1: 237 case 1:
238 if (!write_ok_or_segv(regs->di, sizeof(time_t)))
239 break;
240
191 ret = sys_time((time_t __user *)regs->di); 241 ret = sys_time((time_t __user *)regs->di);
192 break; 242 break;
193 243
194 case 2: 244 case 2:
245 if (!write_ok_or_segv(regs->di, sizeof(unsigned)) ||
246 !write_ok_or_segv(regs->si, sizeof(unsigned)))
247 break;
248
195 ret = sys_getcpu((unsigned __user *)regs->di, 249 ret = sys_getcpu((unsigned __user *)regs->di,
196 (unsigned __user *)regs->si, 250 (unsigned __user *)regs->si,
197 0); 251 0);
198 break; 252 break;
199 } 253 }
200 254
255 current_thread_info()->sig_on_uaccess_error = prev_sig_on_uaccess_error;
256
201 if (ret == -EFAULT) { 257 if (ret == -EFAULT) {
202 /* 258 /* Bad news -- userspace fed a bad pointer to a vsyscall. */
203 * Bad news -- userspace fed a bad pointer to a vsyscall.
204 *
205 * With a real vsyscall, that would have caused SIGSEGV.
206 * To make writing reliable exploits using the emulated
207 * vsyscalls harder, generate SIGSEGV here as well.
208 */
209 warn_bad_vsyscall(KERN_INFO, regs, 259 warn_bad_vsyscall(KERN_INFO, regs,
210 "vsyscall fault (exploit attempt?)"); 260 "vsyscall fault (exploit attempt?)");
211 goto sigsegv; 261
262 /*
263 * If we failed to generate a signal for any reason,
264 * generate one here. (This should be impossible.)
265 */
266 if (WARN_ON_ONCE(!sigismember(&tsk->pending.signal, SIGBUS) &&
267 !sigismember(&tsk->pending.signal, SIGSEGV)))
268 goto sigsegv;
269
270 return true; /* Don't emulate the ret. */
212 } 271 }
213 272
214 regs->ax = ret; 273 regs->ax = ret;
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 6f164bd5e14d..91f83e21b989 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -21,12 +21,14 @@
21#include <asm/pat.h> 21#include <asm/pat.h>
22#include <asm/tsc.h> 22#include <asm/tsc.h>
23#include <asm/iommu.h> 23#include <asm/iommu.h>
24#include <asm/mach_traps.h>
24 25
25void __cpuinit x86_init_noop(void) { } 26void __cpuinit x86_init_noop(void) { }
26void __init x86_init_uint_noop(unsigned int unused) { } 27void __init x86_init_uint_noop(unsigned int unused) { }
27void __init x86_init_pgd_noop(pgd_t *unused) { } 28void __init x86_init_pgd_noop(pgd_t *unused) { }
28int __init iommu_init_noop(void) { return 0; } 29int __init iommu_init_noop(void) { return 0; }
29void iommu_shutdown_noop(void) { } 30void iommu_shutdown_noop(void) { }
31void wallclock_init_noop(void) { }
30 32
31/* 33/*
32 * The platform setup functions are preset with the default functions 34 * The platform setup functions are preset with the default functions
@@ -90,6 +92,7 @@ struct x86_init_ops x86_init __initdata = {
90 92
91struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { 93struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
92 .setup_percpu_clockev = setup_secondary_APIC_clock, 94 .setup_percpu_clockev = setup_secondary_APIC_clock,
95 .fixup_cpu_id = x86_default_fixup_cpu_id,
93}; 96};
94 97
95static void default_nmi_init(void) { }; 98static void default_nmi_init(void) { };
@@ -97,11 +100,13 @@ static int default_i8042_detect(void) { return 1; };
97 100
98struct x86_platform_ops x86_platform = { 101struct x86_platform_ops x86_platform = {
99 .calibrate_tsc = native_calibrate_tsc, 102 .calibrate_tsc = native_calibrate_tsc,
103 .wallclock_init = wallclock_init_noop,
100 .get_wallclock = mach_get_cmos_time, 104 .get_wallclock = mach_get_cmos_time,
101 .set_wallclock = mach_set_rtc_mmss, 105 .set_wallclock = mach_set_rtc_mmss,
102 .iommu_shutdown = iommu_shutdown_noop, 106 .iommu_shutdown = iommu_shutdown_noop,
103 .is_untracked_pat_range = is_ISA_range, 107 .is_untracked_pat_range = is_ISA_range,
104 .nmi_init = default_nmi_init, 108 .nmi_init = default_nmi_init,
109 .get_nmi_reason = default_get_nmi_reason,
105 .i8042_detect = default_i8042_detect 110 .i8042_detect = default_i8042_detect
106}; 111};
107 112
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 76e3f1cd0369..405f2620392f 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -338,11 +338,15 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
338 return HRTIMER_NORESTART; 338 return HRTIMER_NORESTART;
339} 339}
340 340
341static void create_pit_timer(struct kvm_kpit_state *ps, u32 val, int is_period) 341static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)
342{ 342{
343 struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state;
343 struct kvm_timer *pt = &ps->pit_timer; 344 struct kvm_timer *pt = &ps->pit_timer;
344 s64 interval; 345 s64 interval;
345 346
347 if (!irqchip_in_kernel(kvm))
348 return;
349
346 interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ); 350 interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ);
347 351
348 pr_debug("create pit timer, interval is %llu nsec\n", interval); 352 pr_debug("create pit timer, interval is %llu nsec\n", interval);
@@ -394,13 +398,13 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val)
394 /* FIXME: enhance mode 4 precision */ 398 /* FIXME: enhance mode 4 precision */
395 case 4: 399 case 4:
396 if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)) { 400 if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)) {
397 create_pit_timer(ps, val, 0); 401 create_pit_timer(kvm, val, 0);
398 } 402 }
399 break; 403 break;
400 case 2: 404 case 2:
401 case 3: 405 case 3:
402 if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)){ 406 if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)){
403 create_pit_timer(ps, val, 1); 407 create_pit_timer(kvm, val, 1);
404 } 408 }
405 break; 409 break;
406 default: 410 default:
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a0d6bd9ad442..579a0b51696a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -39,6 +39,7 @@
39#include <asm/mce.h> 39#include <asm/mce.h>
40#include <asm/i387.h> 40#include <asm/i387.h>
41#include <asm/xcr.h> 41#include <asm/xcr.h>
42#include <asm/perf_event.h>
42 43
43#include "trace.h" 44#include "trace.h"
44 45
@@ -118,7 +119,7 @@ module_param(ple_gap, int, S_IRUGO);
118static int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW; 119static int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW;
119module_param(ple_window, int, S_IRUGO); 120module_param(ple_window, int, S_IRUGO);
120 121
121#define NR_AUTOLOAD_MSRS 1 122#define NR_AUTOLOAD_MSRS 8
122#define VMCS02_POOL_SIZE 1 123#define VMCS02_POOL_SIZE 1
123 124
124struct vmcs { 125struct vmcs {
@@ -622,6 +623,7 @@ static unsigned long *vmx_msr_bitmap_legacy;
622static unsigned long *vmx_msr_bitmap_longmode; 623static unsigned long *vmx_msr_bitmap_longmode;
623 624
624static bool cpu_has_load_ia32_efer; 625static bool cpu_has_load_ia32_efer;
626static bool cpu_has_load_perf_global_ctrl;
625 627
626static DECLARE_BITMAP(vmx_vpid_bitmap, VMX_NR_VPIDS); 628static DECLARE_BITMAP(vmx_vpid_bitmap, VMX_NR_VPIDS);
627static DEFINE_SPINLOCK(vmx_vpid_lock); 629static DEFINE_SPINLOCK(vmx_vpid_lock);
@@ -1191,15 +1193,34 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu)
1191 vmcs_write32(EXCEPTION_BITMAP, eb); 1193 vmcs_write32(EXCEPTION_BITMAP, eb);
1192} 1194}
1193 1195
1196static void clear_atomic_switch_msr_special(unsigned long entry,
1197 unsigned long exit)
1198{
1199 vmcs_clear_bits(VM_ENTRY_CONTROLS, entry);
1200 vmcs_clear_bits(VM_EXIT_CONTROLS, exit);
1201}
1202
1194static void clear_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr) 1203static void clear_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr)
1195{ 1204{
1196 unsigned i; 1205 unsigned i;
1197 struct msr_autoload *m = &vmx->msr_autoload; 1206 struct msr_autoload *m = &vmx->msr_autoload;
1198 1207
1199 if (msr == MSR_EFER && cpu_has_load_ia32_efer) { 1208 switch (msr) {
1200 vmcs_clear_bits(VM_ENTRY_CONTROLS, VM_ENTRY_LOAD_IA32_EFER); 1209 case MSR_EFER:
1201 vmcs_clear_bits(VM_EXIT_CONTROLS, VM_EXIT_LOAD_IA32_EFER); 1210 if (cpu_has_load_ia32_efer) {
1202 return; 1211 clear_atomic_switch_msr_special(VM_ENTRY_LOAD_IA32_EFER,
1212 VM_EXIT_LOAD_IA32_EFER);
1213 return;
1214 }
1215 break;
1216 case MSR_CORE_PERF_GLOBAL_CTRL:
1217 if (cpu_has_load_perf_global_ctrl) {
1218 clear_atomic_switch_msr_special(
1219 VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL,
1220 VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL);
1221 return;
1222 }
1223 break;
1203 } 1224 }
1204 1225
1205 for (i = 0; i < m->nr; ++i) 1226 for (i = 0; i < m->nr; ++i)
@@ -1215,25 +1236,55 @@ static void clear_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr)
1215 vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, m->nr); 1236 vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, m->nr);
1216} 1237}
1217 1238
1239static void add_atomic_switch_msr_special(unsigned long entry,
1240 unsigned long exit, unsigned long guest_val_vmcs,
1241 unsigned long host_val_vmcs, u64 guest_val, u64 host_val)
1242{
1243 vmcs_write64(guest_val_vmcs, guest_val);
1244 vmcs_write64(host_val_vmcs, host_val);
1245 vmcs_set_bits(VM_ENTRY_CONTROLS, entry);
1246 vmcs_set_bits(VM_EXIT_CONTROLS, exit);
1247}
1248
1218static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr, 1249static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,
1219 u64 guest_val, u64 host_val) 1250 u64 guest_val, u64 host_val)
1220{ 1251{
1221 unsigned i; 1252 unsigned i;
1222 struct msr_autoload *m = &vmx->msr_autoload; 1253 struct msr_autoload *m = &vmx->msr_autoload;
1223 1254
1224 if (msr == MSR_EFER && cpu_has_load_ia32_efer) { 1255 switch (msr) {
1225 vmcs_write64(GUEST_IA32_EFER, guest_val); 1256 case MSR_EFER:
1226 vmcs_write64(HOST_IA32_EFER, host_val); 1257 if (cpu_has_load_ia32_efer) {
1227 vmcs_set_bits(VM_ENTRY_CONTROLS, VM_ENTRY_LOAD_IA32_EFER); 1258 add_atomic_switch_msr_special(VM_ENTRY_LOAD_IA32_EFER,
1228 vmcs_set_bits(VM_EXIT_CONTROLS, VM_EXIT_LOAD_IA32_EFER); 1259 VM_EXIT_LOAD_IA32_EFER,
1229 return; 1260 GUEST_IA32_EFER,
1261 HOST_IA32_EFER,
1262 guest_val, host_val);
1263 return;
1264 }
1265 break;
1266 case MSR_CORE_PERF_GLOBAL_CTRL:
1267 if (cpu_has_load_perf_global_ctrl) {
1268 add_atomic_switch_msr_special(
1269 VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL,
1270 VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL,
1271 GUEST_IA32_PERF_GLOBAL_CTRL,
1272 HOST_IA32_PERF_GLOBAL_CTRL,
1273 guest_val, host_val);
1274 return;
1275 }
1276 break;
1230 } 1277 }
1231 1278
1232 for (i = 0; i < m->nr; ++i) 1279 for (i = 0; i < m->nr; ++i)
1233 if (m->guest[i].index == msr) 1280 if (m->guest[i].index == msr)
1234 break; 1281 break;
1235 1282
1236 if (i == m->nr) { 1283 if (i == NR_AUTOLOAD_MSRS) {
1284 printk_once(KERN_WARNING"Not enough mst switch entries. "
1285 "Can't add msr %x\n", msr);
1286 return;
1287 } else if (i == m->nr) {
1237 ++m->nr; 1288 ++m->nr;
1238 vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, m->nr); 1289 vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, m->nr);
1239 vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, m->nr); 1290 vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, m->nr);
@@ -2455,6 +2506,42 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
2455 && allow_1_setting(MSR_IA32_VMX_EXIT_CTLS, 2506 && allow_1_setting(MSR_IA32_VMX_EXIT_CTLS,
2456 VM_EXIT_LOAD_IA32_EFER); 2507 VM_EXIT_LOAD_IA32_EFER);
2457 2508
2509 cpu_has_load_perf_global_ctrl =
2510 allow_1_setting(MSR_IA32_VMX_ENTRY_CTLS,
2511 VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL)
2512 && allow_1_setting(MSR_IA32_VMX_EXIT_CTLS,
2513 VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL);
2514
2515 /*
2516 * Some cpus support VM_ENTRY_(LOAD|SAVE)_IA32_PERF_GLOBAL_CTRL
2517 * but due to arrata below it can't be used. Workaround is to use
2518 * msr load mechanism to switch IA32_PERF_GLOBAL_CTRL.
2519 *
2520 * VM Exit May Incorrectly Clear IA32_PERF_GLOBAL_CTRL [34:32]
2521 *
2522 * AAK155 (model 26)
2523 * AAP115 (model 30)
2524 * AAT100 (model 37)
2525 * BC86,AAY89,BD102 (model 44)
2526 * BA97 (model 46)
2527 *
2528 */
2529 if (cpu_has_load_perf_global_ctrl && boot_cpu_data.x86 == 0x6) {
2530 switch (boot_cpu_data.x86_model) {
2531 case 26:
2532 case 30:
2533 case 37:
2534 case 44:
2535 case 46:
2536 cpu_has_load_perf_global_ctrl = false;
2537 printk_once(KERN_WARNING"kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL "
2538 "does not work properly. Using workaround\n");
2539 break;
2540 default:
2541 break;
2542 }
2543 }
2544
2458 return 0; 2545 return 0;
2459} 2546}
2460 2547
@@ -5968,6 +6055,24 @@ static void vmx_cancel_injection(struct kvm_vcpu *vcpu)
5968 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); 6055 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0);
5969} 6056}
5970 6057
6058static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx)
6059{
6060 int i, nr_msrs;
6061 struct perf_guest_switch_msr *msrs;
6062
6063 msrs = perf_guest_get_msrs(&nr_msrs);
6064
6065 if (!msrs)
6066 return;
6067
6068 for (i = 0; i < nr_msrs; i++)
6069 if (msrs[i].host == msrs[i].guest)
6070 clear_atomic_switch_msr(vmx, msrs[i].msr);
6071 else
6072 add_atomic_switch_msr(vmx, msrs[i].msr, msrs[i].guest,
6073 msrs[i].host);
6074}
6075
5971#ifdef CONFIG_X86_64 6076#ifdef CONFIG_X86_64
5972#define R "r" 6077#define R "r"
5973#define Q "q" 6078#define Q "q"
@@ -6017,6 +6122,8 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
6017 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) 6122 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
6018 vmx_set_interrupt_shadow(vcpu, 0); 6123 vmx_set_interrupt_shadow(vcpu, 0);
6019 6124
6125 atomic_switch_perf_msrs(vmx);
6126
6020 vmx->__launched = vmx->loaded_vmcs->launched; 6127 vmx->__launched = vmx->loaded_vmcs->launched;
6021 asm( 6128 asm(
6022 /* Store host registers */ 6129 /* Store host registers */
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c38efd7b792e..4c938da2ba00 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -602,7 +602,6 @@ static void update_cpuid(struct kvm_vcpu *vcpu)
602{ 602{
603 struct kvm_cpuid_entry2 *best; 603 struct kvm_cpuid_entry2 *best;
604 struct kvm_lapic *apic = vcpu->arch.apic; 604 struct kvm_lapic *apic = vcpu->arch.apic;
605 u32 timer_mode_mask;
606 605
607 best = kvm_find_cpuid_entry(vcpu, 1, 0); 606 best = kvm_find_cpuid_entry(vcpu, 1, 0);
608 if (!best) 607 if (!best)
@@ -615,15 +614,12 @@ static void update_cpuid(struct kvm_vcpu *vcpu)
615 best->ecx |= bit(X86_FEATURE_OSXSAVE); 614 best->ecx |= bit(X86_FEATURE_OSXSAVE);
616 } 615 }
617 616
618 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && 617 if (apic) {
619 best->function == 0x1) { 618 if (best->ecx & bit(X86_FEATURE_TSC_DEADLINE_TIMER))
620 best->ecx |= bit(X86_FEATURE_TSC_DEADLINE_TIMER); 619 apic->lapic_timer.timer_mode_mask = 3 << 17;
621 timer_mode_mask = 3 << 17; 620 else
622 } else 621 apic->lapic_timer.timer_mode_mask = 1 << 17;
623 timer_mode_mask = 1 << 17; 622 }
624
625 if (apic)
626 apic->lapic_timer.timer_mode_mask = timer_mode_mask;
627} 623}
628 624
629int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) 625int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
@@ -2135,6 +2131,9 @@ int kvm_dev_ioctl_check_extension(long ext)
2135 case KVM_CAP_TSC_CONTROL: 2131 case KVM_CAP_TSC_CONTROL:
2136 r = kvm_has_tsc_control; 2132 r = kvm_has_tsc_control;
2137 break; 2133 break;
2134 case KVM_CAP_TSC_DEADLINE_TIMER:
2135 r = boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER);
2136 break;
2138 default: 2137 default:
2139 r = 0; 2138 r = 0;
2140 break; 2139 break;
diff --git a/arch/x86/lib/inat.c b/arch/x86/lib/inat.c
index 46fc4ee09fc4..88ad5fbda6e1 100644
--- a/arch/x86/lib/inat.c
+++ b/arch/x86/lib/inat.c
@@ -82,9 +82,16 @@ insn_attr_t inat_get_avx_attribute(insn_byte_t opcode, insn_byte_t vex_m,
82 const insn_attr_t *table; 82 const insn_attr_t *table;
83 if (vex_m > X86_VEX_M_MAX || vex_p > INAT_LSTPFX_MAX) 83 if (vex_m > X86_VEX_M_MAX || vex_p > INAT_LSTPFX_MAX)
84 return 0; 84 return 0;
85 table = inat_avx_tables[vex_m][vex_p]; 85 /* At first, this checks the master table */
86 table = inat_avx_tables[vex_m][0];
86 if (!table) 87 if (!table)
87 return 0; 88 return 0;
89 if (!inat_is_group(table[opcode]) && vex_p) {
90 /* If this is not a group, get attribute directly */
91 table = inat_avx_tables[vex_m][vex_p];
92 if (!table)
93 return 0;
94 }
88 return table[opcode]; 95 return table[opcode];
89} 96}
90 97
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index 374562ed6704..5a1f9f3e3fbb 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -202,7 +202,7 @@ void insn_get_opcode(struct insn *insn)
202 m = insn_vex_m_bits(insn); 202 m = insn_vex_m_bits(insn);
203 p = insn_vex_p_bits(insn); 203 p = insn_vex_p_bits(insn);
204 insn->attr = inat_get_avx_attribute(op, m, p); 204 insn->attr = inat_get_avx_attribute(op, m, p);
205 if (!inat_accept_vex(insn->attr)) 205 if (!inat_accept_vex(insn->attr) && !inat_is_group(insn->attr))
206 insn->attr = 0; /* This instruction is bad */ 206 insn->attr = 0; /* This instruction is bad */
207 goto end; /* VEX has only 1 byte for opcode */ 207 goto end; /* VEX has only 1 byte for opcode */
208 } 208 }
@@ -249,6 +249,8 @@ void insn_get_modrm(struct insn *insn)
249 pfx = insn_last_prefix(insn); 249 pfx = insn_last_prefix(insn);
250 insn->attr = inat_get_group_attribute(mod, pfx, 250 insn->attr = inat_get_group_attribute(mod, pfx,
251 insn->attr); 251 insn->attr);
252 if (insn_is_avx(insn) && !inat_accept_vex(insn->attr))
253 insn->attr = 0; /* This is bad */
252 } 254 }
253 } 255 }
254 256
diff --git a/arch/x86/lib/string_32.c b/arch/x86/lib/string_32.c
index 82004d2bf05e..bd59090825db 100644
--- a/arch/x86/lib/string_32.c
+++ b/arch/x86/lib/string_32.c
@@ -164,15 +164,13 @@ EXPORT_SYMBOL(strchr);
164size_t strlen(const char *s) 164size_t strlen(const char *s)
165{ 165{
166 int d0; 166 int d0;
167 int res; 167 size_t res;
168 asm volatile("repne\n\t" 168 asm volatile("repne\n\t"
169 "scasb\n\t" 169 "scasb"
170 "notl %0\n\t"
171 "decl %0"
172 : "=c" (res), "=&D" (d0) 170 : "=c" (res), "=&D" (d0)
173 : "1" (s), "a" (0), "0" (0xffffffffu) 171 : "1" (s), "a" (0), "0" (0xffffffffu)
174 : "memory"); 172 : "memory");
175 return res; 173 return ~res - 1;
176} 174}
177EXPORT_SYMBOL(strlen); 175EXPORT_SYMBOL(strlen);
178#endif 176#endif
diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt
index a793da5e560e..5b83c51c12e0 100644
--- a/arch/x86/lib/x86-opcode-map.txt
+++ b/arch/x86/lib/x86-opcode-map.txt
@@ -1,5 +1,11 @@
1# x86 Opcode Maps 1# x86 Opcode Maps
2# 2#
3# This is (mostly) based on following documentations.
4# - Intel(R) 64 and IA-32 Architectures Software Developer's Manual Vol.2
5# (#325383-040US, October 2011)
6# - Intel(R) Advanced Vector Extensions Programming Reference
7# (#319433-011,JUNE 2011).
8#
3#<Opcode maps> 9#<Opcode maps>
4# Table: table-name 10# Table: table-name
5# Referrer: escaped-name 11# Referrer: escaped-name
@@ -15,10 +21,13 @@
15# EndTable 21# EndTable
16# 22#
17# AVX Superscripts 23# AVX Superscripts
18# (VEX): this opcode can accept VEX prefix. 24# (v): this opcode requires VEX prefix.
19# (oVEX): this opcode requires VEX prefix. 25# (v1): this opcode only supports 128bit VEX.
20# (o128): this opcode only supports 128bit VEX. 26#
21# (o256): this opcode only supports 256bit VEX. 27# Last Prefix Superscripts
28# - (66): the last prefix is 0x66
29# - (F3): the last prefix is 0xF3
30# - (F2): the last prefix is 0xF2
22# 31#
23 32
24Table: one byte opcode 33Table: one byte opcode
@@ -199,8 +208,8 @@ a0: MOV AL,Ob
199a1: MOV rAX,Ov 208a1: MOV rAX,Ov
200a2: MOV Ob,AL 209a2: MOV Ob,AL
201a3: MOV Ov,rAX 210a3: MOV Ov,rAX
202a4: MOVS/B Xb,Yb 211a4: MOVS/B Yb,Xb
203a5: MOVS/W/D/Q Xv,Yv 212a5: MOVS/W/D/Q Yv,Xv
204a6: CMPS/B Xb,Yb 213a6: CMPS/B Xb,Yb
205a7: CMPS/W/D Xv,Yv 214a7: CMPS/W/D Xv,Yv
206a8: TEST AL,Ib 215a8: TEST AL,Ib
@@ -233,8 +242,8 @@ c0: Grp2 Eb,Ib (1A)
233c1: Grp2 Ev,Ib (1A) 242c1: Grp2 Ev,Ib (1A)
234c2: RETN Iw (f64) 243c2: RETN Iw (f64)
235c3: RETN 244c3: RETN
236c4: LES Gz,Mp (i64) | 3bytes-VEX (Prefix) 245c4: LES Gz,Mp (i64) | VEX+2byte (Prefix)
237c5: LDS Gz,Mp (i64) | 2bytes-VEX (Prefix) 246c5: LDS Gz,Mp (i64) | VEX+1byte (Prefix)
238c6: Grp11 Eb,Ib (1A) 247c6: Grp11 Eb,Ib (1A)
239c7: Grp11 Ev,Iz (1A) 248c7: Grp11 Ev,Iz (1A)
240c8: ENTER Iw,Ib 249c8: ENTER Iw,Ib
@@ -320,14 +329,19 @@ AVXcode: 1
320# 3DNow! uses the last imm byte as opcode extension. 329# 3DNow! uses the last imm byte as opcode extension.
3210f: 3DNow! Pq,Qq,Ib 3300f: 3DNow! Pq,Qq,Ib
322# 0x0f 0x10-0x1f 331# 0x0f 0x10-0x1f
32310: movups Vps,Wps (VEX) | movss Vss,Wss (F3),(VEX),(o128) | movupd Vpd,Wpd (66),(VEX) | movsd Vsd,Wsd (F2),(VEX),(o128) 332# NOTE: According to Intel SDM opcode map, vmovups and vmovupd has no operands
32411: movups Wps,Vps (VEX) | movss Wss,Vss (F3),(VEX),(o128) | movupd Wpd,Vpd (66),(VEX) | movsd Wsd,Vsd (F2),(VEX),(o128) 333# but it actually has operands. And also, vmovss and vmovsd only accept 128bit.
32512: movlps Vq,Mq (VEX),(o128) | movlpd Vq,Mq (66),(VEX),(o128) | movhlps Vq,Uq (VEX),(o128) | movddup Vq,Wq (F2),(VEX) | movsldup Vq,Wq (F3),(VEX) 334# MOVSS/MOVSD has too many forms(3) on SDM. This map just shows a typical form.
32613: mpvlps Mq,Vq (VEX),(o128) | movlpd Mq,Vq (66),(VEX),(o128) 335# Many AVX instructions lack v1 superscript, according to Intel AVX-Prgramming
32714: unpcklps Vps,Wq (VEX) | unpcklpd Vpd,Wq (66),(VEX) 336# Reference A.1
32815: unpckhps Vps,Wq (VEX) | unpckhpd Vpd,Wq (66),(VEX) 33710: vmovups Vps,Wps | vmovupd Vpd,Wpd (66) | vmovss Vx,Hx,Wss (F3),(v1) | vmovsd Vx,Hx,Wsd (F2),(v1)
32916: movhps Vq,Mq (VEX),(o128) | movhpd Vq,Mq (66),(VEX),(o128) | movlsps Vq,Uq (VEX),(o128) | movshdup Vq,Wq (F3),(VEX) 33811: vmovups Wps,Vps | vmovupd Wpd,Vpd (66) | vmovss Wss,Hx,Vss (F3),(v1) | vmovsd Wsd,Hx,Vsd (F2),(v1)
33017: movhps Mq,Vq (VEX),(o128) | movhpd Mq,Vq (66),(VEX),(o128) 33912: vmovlps Vq,Hq,Mq (v1) | vmovhlps Vq,Hq,Uq (v1) | vmovlpd Vq,Hq,Mq (66),(v1) | vmovsldup Vx,Wx (F3) | vmovddup Vx,Wx (F2)
34013: vmovlps Mq,Vq (v1) | vmovlpd Mq,Vq (66),(v1)
34114: vunpcklps Vx,Hx,Wx | vunpcklpd Vx,Hx,Wx (66)
34215: vunpckhps Vx,Hx,Wx | vunpckhpd Vx,Hx,Wx (66)
34316: vmovhps Vdq,Hq,Mq (v1) | vmovlhps Vdq,Hq,Uq (v1) | vmovhpd Vdq,Hq,Mq (66),(v1) | vmovshdup Vx,Wx (F3)
34417: vmovhps Mq,Vq (v1) | vmovhpd Mq,Vq (66),(v1)
33118: Grp16 (1A) 34518: Grp16 (1A)
33219: 34619:
3331a: 3471a:
@@ -345,14 +359,14 @@ AVXcode: 1
34525: 35925:
34626: 36026:
34727: 36127:
34828: movaps Vps,Wps (VEX) | movapd Vpd,Wpd (66),(VEX) 36228: vmovaps Vps,Wps | vmovapd Vpd,Wpd (66)
34929: movaps Wps,Vps (VEX) | movapd Wpd,Vpd (66),(VEX) 36329: vmovaps Wps,Vps | vmovapd Wpd,Vpd (66)
3502a: cvtpi2ps Vps,Qpi | cvtsi2ss Vss,Ed/q (F3),(VEX),(o128) | cvtpi2pd Vpd,Qpi (66) | cvtsi2sd Vsd,Ed/q (F2),(VEX),(o128) 3642a: cvtpi2ps Vps,Qpi | cvtpi2pd Vpd,Qpi (66) | vcvtsi2ss Vss,Hss,Ey (F3),(v1) | vcvtsi2sd Vsd,Hsd,Ey (F2),(v1)
3512b: movntps Mps,Vps (VEX) | movntpd Mpd,Vpd (66),(VEX) 3652b: vmovntps Mps,Vps | vmovntpd Mpd,Vpd (66)
3522c: cvttps2pi Ppi,Wps | cvttss2si Gd/q,Wss (F3),(VEX),(o128) | cvttpd2pi Ppi,Wpd (66) | cvttsd2si Gd/q,Wsd (F2),(VEX),(o128) 3662c: cvttps2pi Ppi,Wps | cvttpd2pi Ppi,Wpd (66) | vcvttss2si Gy,Wss (F3),(v1) | vcvttsd2si Gy,Wsd (F2),(v1)
3532d: cvtps2pi Ppi,Wps | cvtss2si Gd/q,Wss (F3),(VEX),(o128) | cvtpd2pi Qpi,Wpd (66) | cvtsd2si Gd/q,Wsd (F2),(VEX),(o128) 3672d: cvtps2pi Ppi,Wps | cvtpd2pi Qpi,Wpd (66) | vcvtss2si Gy,Wss (F3),(v1) | vcvtsd2si Gy,Wsd (F2),(v1)
3542e: ucomiss Vss,Wss (VEX),(o128) | ucomisd Vsd,Wsd (66),(VEX),(o128) 3682e: vucomiss Vss,Wss (v1) | vucomisd Vsd,Wsd (66),(v1)
3552f: comiss Vss,Wss (VEX),(o128) | comisd Vsd,Wsd (66),(VEX),(o128) 3692f: vcomiss Vss,Wss (v1) | vcomisd Vsd,Wsd (66),(v1)
356# 0x0f 0x30-0x3f 370# 0x0f 0x30-0x3f
35730: WRMSR 37130: WRMSR
35831: RDTSC 37231: RDTSC
@@ -388,65 +402,66 @@ AVXcode: 1
3884e: CMOVLE/NG Gv,Ev 4024e: CMOVLE/NG Gv,Ev
3894f: CMOVNLE/G Gv,Ev 4034f: CMOVNLE/G Gv,Ev
390# 0x0f 0x50-0x5f 404# 0x0f 0x50-0x5f
39150: movmskps Gd/q,Ups (VEX) | movmskpd Gd/q,Upd (66),(VEX) 40550: vmovmskps Gy,Ups | vmovmskpd Gy,Upd (66)
39251: sqrtps Vps,Wps (VEX) | sqrtss Vss,Wss (F3),(VEX),(o128) | sqrtpd Vpd,Wpd (66),(VEX) | sqrtsd Vsd,Wsd (F2),(VEX),(o128) 40651: vsqrtps Vps,Wps | vsqrtpd Vpd,Wpd (66) | vsqrtss Vss,Hss,Wss (F3),(v1) | vsqrtsd Vsd,Hsd,Wsd (F2),(v1)
39352: rsqrtps Vps,Wps (VEX) | rsqrtss Vss,Wss (F3),(VEX),(o128) 40752: vrsqrtps Vps,Wps | vrsqrtss Vss,Hss,Wss (F3),(v1)
39453: rcpps Vps,Wps (VEX) | rcpss Vss,Wss (F3),(VEX),(o128) 40853: vrcpps Vps,Wps | vrcpss Vss,Hss,Wss (F3),(v1)
39554: andps Vps,Wps (VEX) | andpd Vpd,Wpd (66),(VEX) 40954: vandps Vps,Hps,Wps | vandpd Vpd,Hpd,Wpd (66)
39655: andnps Vps,Wps (VEX) | andnpd Vpd,Wpd (66),(VEX) 41055: vandnps Vps,Hps,Wps | vandnpd Vpd,Hpd,Wpd (66)
39756: orps Vps,Wps (VEX) | orpd Vpd,Wpd (66),(VEX) 41156: vorps Vps,Hps,Wps | vorpd Vpd,Hpd,Wpd (66)
39857: xorps Vps,Wps (VEX) | xorpd Vpd,Wpd (66),(VEX) 41257: vxorps Vps,Hps,Wps | vxorpd Vpd,Hpd,Wpd (66)
39958: addps Vps,Wps (VEX) | addss Vss,Wss (F3),(VEX),(o128) | addpd Vpd,Wpd (66),(VEX) | addsd Vsd,Wsd (F2),(VEX),(o128) 41358: vaddps Vps,Hps,Wps | vaddpd Vpd,Hpd,Wpd (66) | vaddss Vss,Hss,Wss (F3),(v1) | vaddsd Vsd,Hsd,Wsd (F2),(v1)
40059: mulps Vps,Wps (VEX) | mulss Vss,Wss (F3),(VEX),(o128) | mulpd Vpd,Wpd (66),(VEX) | mulsd Vsd,Wsd (F2),(VEX),(o128) 41459: vmulps Vps,Hps,Wps | vmulpd Vpd,Hpd,Wpd (66) | vmulss Vss,Hss,Wss (F3),(v1) | vmulsd Vsd,Hsd,Wsd (F2),(v1)
4015a: cvtps2pd Vpd,Wps (VEX) | cvtss2sd Vsd,Wss (F3),(VEX),(o128) | cvtpd2ps Vps,Wpd (66),(VEX) | cvtsd2ss Vsd,Wsd (F2),(VEX),(o128) 4155a: vcvtps2pd Vpd,Wps | vcvtpd2ps Vps,Wpd (66) | vcvtss2sd Vsd,Hx,Wss (F3),(v1) | vcvtsd2ss Vss,Hx,Wsd (F2),(v1)
4025b: cvtdq2ps Vps,Wdq (VEX) | cvtps2dq Vdq,Wps (66),(VEX) | cvttps2dq Vdq,Wps (F3),(VEX) 4165b: vcvtdq2ps Vps,Wdq | vcvtps2dq Vdq,Wps (66) | vcvttps2dq Vdq,Wps (F3)
4035c: subps Vps,Wps (VEX) | subss Vss,Wss (F3),(VEX),(o128) | subpd Vpd,Wpd (66),(VEX) | subsd Vsd,Wsd (F2),(VEX),(o128) 4175c: vsubps Vps,Hps,Wps | vsubpd Vpd,Hpd,Wpd (66) | vsubss Vss,Hss,Wss (F3),(v1) | vsubsd Vsd,Hsd,Wsd (F2),(v1)
4045d: minps Vps,Wps (VEX) | minss Vss,Wss (F3),(VEX),(o128) | minpd Vpd,Wpd (66),(VEX) | minsd Vsd,Wsd (F2),(VEX),(o128) 4185d: vminps Vps,Hps,Wps | vminpd Vpd,Hpd,Wpd (66) | vminss Vss,Hss,Wss (F3),(v1) | vminsd Vsd,Hsd,Wsd (F2),(v1)
4055e: divps Vps,Wps (VEX) | divss Vss,Wss (F3),(VEX),(o128) | divpd Vpd,Wpd (66),(VEX) | divsd Vsd,Wsd (F2),(VEX),(o128) 4195e: vdivps Vps,Hps,Wps | vdivpd Vpd,Hpd,Wpd (66) | vdivss Vss,Hss,Wss (F3),(v1) | vdivsd Vsd,Hsd,Wsd (F2),(v1)
4065f: maxps Vps,Wps (VEX) | maxss Vss,Wss (F3),(VEX),(o128) | maxpd Vpd,Wpd (66),(VEX) | maxsd Vsd,Wsd (F2),(VEX),(o128) 4205f: vmaxps Vps,Hps,Wps | vmaxpd Vpd,Hpd,Wpd (66) | vmaxss Vss,Hss,Wss (F3),(v1) | vmaxsd Vsd,Hsd,Wsd (F2),(v1)
407# 0x0f 0x60-0x6f 421# 0x0f 0x60-0x6f
40860: punpcklbw Pq,Qd | punpcklbw Vdq,Wdq (66),(VEX),(o128) 42260: punpcklbw Pq,Qd | vpunpcklbw Vx,Hx,Wx (66),(v1)
40961: punpcklwd Pq,Qd | punpcklwd Vdq,Wdq (66),(VEX),(o128) 42361: punpcklwd Pq,Qd | vpunpcklwd Vx,Hx,Wx (66),(v1)
41062: punpckldq Pq,Qd | punpckldq Vdq,Wdq (66),(VEX),(o128) 42462: punpckldq Pq,Qd | vpunpckldq Vx,Hx,Wx (66),(v1)
41163: packsswb Pq,Qq | packsswb Vdq,Wdq (66),(VEX),(o128) 42563: packsswb Pq,Qq | vpacksswb Vx,Hx,Wx (66),(v1)
41264: pcmpgtb Pq,Qq | pcmpgtb Vdq,Wdq (66),(VEX),(o128) 42664: pcmpgtb Pq,Qq | vpcmpgtb Vx,Hx,Wx (66),(v1)
41365: pcmpgtw Pq,Qq | pcmpgtw Vdq,Wdq (66),(VEX),(o128) 42765: pcmpgtw Pq,Qq | vpcmpgtw Vx,Hx,Wx (66),(v1)
41466: pcmpgtd Pq,Qq | pcmpgtd Vdq,Wdq (66),(VEX),(o128) 42866: pcmpgtd Pq,Qq | vpcmpgtd Vx,Hx,Wx (66),(v1)
41567: packuswb Pq,Qq | packuswb Vdq,Wdq (66),(VEX),(o128) 42967: packuswb Pq,Qq | vpackuswb Vx,Hx,Wx (66),(v1)
41668: punpckhbw Pq,Qd | punpckhbw Vdq,Wdq (66),(VEX),(o128) 43068: punpckhbw Pq,Qd | vpunpckhbw Vx,Hx,Wx (66),(v1)
41769: punpckhwd Pq,Qd | punpckhwd Vdq,Wdq (66),(VEX),(o128) 43169: punpckhwd Pq,Qd | vpunpckhwd Vx,Hx,Wx (66),(v1)
4186a: punpckhdq Pq,Qd | punpckhdq Vdq,Wdq (66),(VEX),(o128) 4326a: punpckhdq Pq,Qd | vpunpckhdq Vx,Hx,Wx (66),(v1)
4196b: packssdw Pq,Qd | packssdw Vdq,Wdq (66),(VEX),(o128) 4336b: packssdw Pq,Qd | vpackssdw Vx,Hx,Wx (66),(v1)
4206c: punpcklqdq Vdq,Wdq (66),(VEX),(o128) 4346c: vpunpcklqdq Vx,Hx,Wx (66),(v1)
4216d: punpckhqdq Vdq,Wdq (66),(VEX),(o128) 4356d: vpunpckhqdq Vx,Hx,Wx (66),(v1)
4226e: movd/q/ Pd,Ed/q | movd/q Vdq,Ed/q (66),(VEX),(o128) 4366e: movd/q Pd,Ey | vmovd/q Vy,Ey (66),(v1)
4236f: movq Pq,Qq | movdqa Vdq,Wdq (66),(VEX) | movdqu Vdq,Wdq (F3),(VEX) 4376f: movq Pq,Qq | vmovdqa Vx,Wx (66) | vmovdqu Vx,Wx (F3)
424# 0x0f 0x70-0x7f 438# 0x0f 0x70-0x7f
42570: pshufw Pq,Qq,Ib | pshufd Vdq,Wdq,Ib (66),(VEX),(o128) | pshufhw Vdq,Wdq,Ib (F3),(VEX),(o128) | pshuflw VdqWdq,Ib (F2),(VEX),(o128) 43970: pshufw Pq,Qq,Ib | vpshufd Vx,Wx,Ib (66),(v1) | vpshufhw Vx,Wx,Ib (F3),(v1) | vpshuflw Vx,Wx,Ib (F2),(v1)
42671: Grp12 (1A) 44071: Grp12 (1A)
42772: Grp13 (1A) 44172: Grp13 (1A)
42873: Grp14 (1A) 44273: Grp14 (1A)
42974: pcmpeqb Pq,Qq | pcmpeqb Vdq,Wdq (66),(VEX),(o128) 44374: pcmpeqb Pq,Qq | vpcmpeqb Vx,Hx,Wx (66),(v1)
43075: pcmpeqw Pq,Qq | pcmpeqw Vdq,Wdq (66),(VEX),(o128) 44475: pcmpeqw Pq,Qq | vpcmpeqw Vx,Hx,Wx (66),(v1)
43176: pcmpeqd Pq,Qq | pcmpeqd Vdq,Wdq (66),(VEX),(o128) 44576: pcmpeqd Pq,Qq | vpcmpeqd Vx,Hx,Wx (66),(v1)
43277: emms/vzeroupper/vzeroall (VEX) 446# Note: Remove (v), because vzeroall and vzeroupper becomes emms without VEX.
43378: VMREAD Ed/q,Gd/q 44777: emms | vzeroupper | vzeroall
43479: VMWRITE Gd/q,Ed/q 44878: VMREAD Ey,Gy
44979: VMWRITE Gy,Ey
4357a: 4507a:
4367b: 4517b:
4377c: haddps Vps,Wps (F2),(VEX) | haddpd Vpd,Wpd (66),(VEX) 4527c: vhaddpd Vpd,Hpd,Wpd (66) | vhaddps Vps,Hps,Wps (F2)
4387d: hsubps Vps,Wps (F2),(VEX) | hsubpd Vpd,Wpd (66),(VEX) 4537d: vhsubpd Vpd,Hpd,Wpd (66) | vhsubps Vps,Hps,Wps (F2)
4397e: movd/q Ed/q,Pd | movd/q Ed/q,Vdq (66),(VEX),(o128) | movq Vq,Wq (F3),(VEX),(o128) 4547e: movd/q Ey,Pd | vmovd/q Ey,Vy (66),(v1) | vmovq Vq,Wq (F3),(v1)
4407f: movq Qq,Pq | movdqa Wdq,Vdq (66),(VEX) | movdqu Wdq,Vdq (F3),(VEX) 4557f: movq Qq,Pq | vmovdqa Wx,Vx (66) | vmovdqu Wx,Vx (F3)
441# 0x0f 0x80-0x8f 456# 0x0f 0x80-0x8f
44280: JO Jz (f64) 45780: JO Jz (f64)
44381: JNO Jz (f64) 45881: JNO Jz (f64)
44482: JB/JNAE/JC Jz (f64) 45982: JB/JC/JNAE Jz (f64)
44583: JNB/JAE/JNC Jz (f64) 46083: JAE/JNB/JNC Jz (f64)
44684: JZ/JE Jz (f64) 46184: JE/JZ Jz (f64)
44785: JNZ/JNE Jz (f64) 46285: JNE/JNZ Jz (f64)
44886: JBE/JNA Jz (f64) 46386: JBE/JNA Jz (f64)
44987: JNBE/JA Jz (f64) 46487: JA/JNBE Jz (f64)
45088: JS Jz (f64) 46588: JS Jz (f64)
45189: JNS Jz (f64) 46689: JNS Jz (f64)
4528a: JP/JPE Jz (f64) 4678a: JP/JPE Jz (f64)
@@ -502,18 +517,18 @@ b8: JMPE | POPCNT Gv,Ev (F3)
502b9: Grp10 (1A) 517b9: Grp10 (1A)
503ba: Grp8 Ev,Ib (1A) 518ba: Grp8 Ev,Ib (1A)
504bb: BTC Ev,Gv 519bb: BTC Ev,Gv
505bc: BSF Gv,Ev 520bc: BSF Gv,Ev | TZCNT Gv,Ev (F3)
506bd: BSR Gv,Ev 521bd: BSR Gv,Ev | LZCNT Gv,Ev (F3)
507be: MOVSX Gv,Eb 522be: MOVSX Gv,Eb
508bf: MOVSX Gv,Ew 523bf: MOVSX Gv,Ew
509# 0x0f 0xc0-0xcf 524# 0x0f 0xc0-0xcf
510c0: XADD Eb,Gb 525c0: XADD Eb,Gb
511c1: XADD Ev,Gv 526c1: XADD Ev,Gv
512c2: cmpps Vps,Wps,Ib (VEX) | cmpss Vss,Wss,Ib (F3),(VEX),(o128) | cmppd Vpd,Wpd,Ib (66),(VEX) | cmpsd Vsd,Wsd,Ib (F2),(VEX) 527c2: vcmpps Vps,Hps,Wps,Ib | vcmppd Vpd,Hpd,Wpd,Ib (66) | vcmpss Vss,Hss,Wss,Ib (F3),(v1) | vcmpsd Vsd,Hsd,Wsd,Ib (F2),(v1)
513c3: movnti Md/q,Gd/q 528c3: movnti My,Gy
514c4: pinsrw Pq,Rd/q/Mw,Ib | pinsrw Vdq,Rd/q/Mw,Ib (66),(VEX),(o128) 529c4: pinsrw Pq,Ry/Mw,Ib | vpinsrw Vdq,Hdq,Ry/Mw,Ib (66),(v1)
515c5: pextrw Gd,Nq,Ib | pextrw Gd,Udq,Ib (66),(VEX),(o128) 530c5: pextrw Gd,Nq,Ib | vpextrw Gd,Udq,Ib (66),(v1)
516c6: shufps Vps,Wps,Ib (VEX) | shufpd Vpd,Wpd,Ib (66),(VEX) 531c6: vshufps Vps,Hps,Wps,Ib | vshufpd Vpd,Hpd,Wpd,Ib (66)
517c7: Grp9 (1A) 532c7: Grp9 (1A)
518c8: BSWAP RAX/EAX/R8/R8D 533c8: BSWAP RAX/EAX/R8/R8D
519c9: BSWAP RCX/ECX/R9/R9D 534c9: BSWAP RCX/ECX/R9/R9D
@@ -524,55 +539,55 @@ cd: BSWAP RBP/EBP/R13/R13D
524ce: BSWAP RSI/ESI/R14/R14D 539ce: BSWAP RSI/ESI/R14/R14D
525cf: BSWAP RDI/EDI/R15/R15D 540cf: BSWAP RDI/EDI/R15/R15D
526# 0x0f 0xd0-0xdf 541# 0x0f 0xd0-0xdf
527d0: addsubps Vps,Wps (F2),(VEX) | addsubpd Vpd,Wpd (66),(VEX) 542d0: vaddsubpd Vpd,Hpd,Wpd (66) | vaddsubps Vps,Hps,Wps (F2)
528d1: psrlw Pq,Qq | psrlw Vdq,Wdq (66),(VEX),(o128) 543d1: psrlw Pq,Qq | vpsrlw Vx,Hx,Wx (66),(v1)
529d2: psrld Pq,Qq | psrld Vdq,Wdq (66),(VEX),(o128) 544d2: psrld Pq,Qq | vpsrld Vx,Hx,Wx (66),(v1)
530d3: psrlq Pq,Qq | psrlq Vdq,Wdq (66),(VEX),(o128) 545d3: psrlq Pq,Qq | vpsrlq Vx,Hx,Wx (66),(v1)
531d4: paddq Pq,Qq | paddq Vdq,Wdq (66),(VEX),(o128) 546d4: paddq Pq,Qq | vpaddq Vx,Hx,Wx (66),(v1)
532d5: pmullw Pq,Qq | pmullw Vdq,Wdq (66),(VEX),(o128) 547d5: pmullw Pq,Qq | vpmullw Vx,Hx,Wx (66),(v1)
533d6: movq Wq,Vq (66),(VEX),(o128) | movq2dq Vdq,Nq (F3) | movdq2q Pq,Uq (F2) 548d6: vmovq Wq,Vq (66),(v1) | movq2dq Vdq,Nq (F3) | movdq2q Pq,Uq (F2)
534d7: pmovmskb Gd,Nq | pmovmskb Gd,Udq (66),(VEX),(o128) 549d7: pmovmskb Gd,Nq | vpmovmskb Gd,Ux (66),(v1)
535d8: psubusb Pq,Qq | psubusb Vdq,Wdq (66),(VEX),(o128) 550d8: psubusb Pq,Qq | vpsubusb Vx,Hx,Wx (66),(v1)
536d9: psubusw Pq,Qq | psubusw Vdq,Wdq (66),(VEX),(o128) 551d9: psubusw Pq,Qq | vpsubusw Vx,Hx,Wx (66),(v1)
537da: pminub Pq,Qq | pminub Vdq,Wdq (66),(VEX),(o128) 552da: pminub Pq,Qq | vpminub Vx,Hx,Wx (66),(v1)
538db: pand Pq,Qq | pand Vdq,Wdq (66),(VEX),(o128) 553db: pand Pq,Qq | vpand Vx,Hx,Wx (66),(v1)
539dc: paddusb Pq,Qq | paddusb Vdq,Wdq (66),(VEX),(o128) 554dc: paddusb Pq,Qq | vpaddusb Vx,Hx,Wx (66),(v1)
540dd: paddusw Pq,Qq | paddusw Vdq,Wdq (66),(VEX),(o128) 555dd: paddusw Pq,Qq | vpaddusw Vx,Hx,Wx (66),(v1)
541de: pmaxub Pq,Qq | pmaxub Vdq,Wdq (66),(VEX),(o128) 556de: pmaxub Pq,Qq | vpmaxub Vx,Hx,Wx (66),(v1)
542df: pandn Pq,Qq | pandn Vdq,Wdq (66),(VEX),(o128) 557df: pandn Pq,Qq | vpandn Vx,Hx,Wx (66),(v1)
543# 0x0f 0xe0-0xef 558# 0x0f 0xe0-0xef
544e0: pavgb Pq,Qq | pavgb Vdq,Wdq (66),(VEX),(o128) 559e0: pavgb Pq,Qq | vpavgb Vx,Hx,Wx (66),(v1)
545e1: psraw Pq,Qq | psraw Vdq,Wdq (66),(VEX),(o128) 560e1: psraw Pq,Qq | vpsraw Vx,Hx,Wx (66),(v1)
546e2: psrad Pq,Qq | psrad Vdq,Wdq (66),(VEX),(o128) 561e2: psrad Pq,Qq | vpsrad Vx,Hx,Wx (66),(v1)
547e3: pavgw Pq,Qq | pavgw Vdq,Wdq (66),(VEX),(o128) 562e3: pavgw Pq,Qq | vpavgw Vx,Hx,Wx (66),(v1)
548e4: pmulhuw Pq,Qq | pmulhuw Vdq,Wdq (66),(VEX),(o128) 563e4: pmulhuw Pq,Qq | vpmulhuw Vx,Hx,Wx (66),(v1)
549e5: pmulhw Pq,Qq | pmulhw Vdq,Wdq (66),(VEX),(o128) 564e5: pmulhw Pq,Qq | vpmulhw Vx,Hx,Wx (66),(v1)
550e6: cvtpd2dq Vdq,Wpd (F2),(VEX) | cvttpd2dq Vdq,Wpd (66),(VEX) | cvtdq2pd Vpd,Wdq (F3),(VEX) 565e6: vcvttpd2dq Vx,Wpd (66) | vcvtdq2pd Vx,Wdq (F3) | vcvtpd2dq Vx,Wpd (F2)
551e7: movntq Mq,Pq | movntdq Mdq,Vdq (66),(VEX) 566e7: movntq Mq,Pq | vmovntdq Mx,Vx (66)
552e8: psubsb Pq,Qq | psubsb Vdq,Wdq (66),(VEX),(o128) 567e8: psubsb Pq,Qq | vpsubsb Vx,Hx,Wx (66),(v1)
553e9: psubsw Pq,Qq | psubsw Vdq,Wdq (66),(VEX),(o128) 568e9: psubsw Pq,Qq | vpsubsw Vx,Hx,Wx (66),(v1)
554ea: pminsw Pq,Qq | pminsw Vdq,Wdq (66),(VEX),(o128) 569ea: pminsw Pq,Qq | vpminsw Vx,Hx,Wx (66),(v1)
555eb: por Pq,Qq | por Vdq,Wdq (66),(VEX),(o128) 570eb: por Pq,Qq | vpor Vx,Hx,Wx (66),(v1)
556ec: paddsb Pq,Qq | paddsb Vdq,Wdq (66),(VEX),(o128) 571ec: paddsb Pq,Qq | vpaddsb Vx,Hx,Wx (66),(v1)
557ed: paddsw Pq,Qq | paddsw Vdq,Wdq (66),(VEX),(o128) 572ed: paddsw Pq,Qq | vpaddsw Vx,Hx,Wx (66),(v1)
558ee: pmaxsw Pq,Qq | pmaxsw Vdq,Wdq (66),(VEX),(o128) 573ee: pmaxsw Pq,Qq | vpmaxsw Vx,Hx,Wx (66),(v1)
559ef: pxor Pq,Qq | pxor Vdq,Wdq (66),(VEX),(o128) 574ef: pxor Pq,Qq | vpxor Vx,Hx,Wx (66),(v1)
560# 0x0f 0xf0-0xff 575# 0x0f 0xf0-0xff
561f0: lddqu Vdq,Mdq (F2),(VEX) 576f0: vlddqu Vx,Mx (F2)
562f1: psllw Pq,Qq | psllw Vdq,Wdq (66),(VEX),(o128) 577f1: psllw Pq,Qq | vpsllw Vx,Hx,Wx (66),(v1)
563f2: pslld Pq,Qq | pslld Vdq,Wdq (66),(VEX),(o128) 578f2: pslld Pq,Qq | vpslld Vx,Hx,Wx (66),(v1)
564f3: psllq Pq,Qq | psllq Vdq,Wdq (66),(VEX),(o128) 579f3: psllq Pq,Qq | vpsllq Vx,Hx,Wx (66),(v1)
565f4: pmuludq Pq,Qq | pmuludq Vdq,Wdq (66),(VEX),(o128) 580f4: pmuludq Pq,Qq | vpmuludq Vx,Hx,Wx (66),(v1)
566f5: pmaddwd Pq,Qq | pmaddwd Vdq,Wdq (66),(VEX),(o128) 581f5: pmaddwd Pq,Qq | vpmaddwd Vx,Hx,Wx (66),(v1)
567f6: psadbw Pq,Qq | psadbw Vdq,Wdq (66),(VEX),(o128) 582f6: psadbw Pq,Qq | vpsadbw Vx,Hx,Wx (66),(v1)
568f7: maskmovq Pq,Nq | maskmovdqu Vdq,Udq (66),(VEX),(o128) 583f7: maskmovq Pq,Nq | vmaskmovdqu Vx,Ux (66),(v1)
569f8: psubb Pq,Qq | psubb Vdq,Wdq (66),(VEX),(o128) 584f8: psubb Pq,Qq | vpsubb Vx,Hx,Wx (66),(v1)
570f9: psubw Pq,Qq | psubw Vdq,Wdq (66),(VEX),(o128) 585f9: psubw Pq,Qq | vpsubw Vx,Hx,Wx (66),(v1)
571fa: psubd Pq,Qq | psubd Vdq,Wdq (66),(VEX),(o128) 586fa: psubd Pq,Qq | vpsubd Vx,Hx,Wx (66),(v1)
572fb: psubq Pq,Qq | psubq Vdq,Wdq (66),(VEX),(o128) 587fb: psubq Pq,Qq | vpsubq Vx,Hx,Wx (66),(v1)
573fc: paddb Pq,Qq | paddb Vdq,Wdq (66),(VEX),(o128) 588fc: paddb Pq,Qq | vpaddb Vx,Hx,Wx (66),(v1)
574fd: paddw Pq,Qq | paddw Vdq,Wdq (66),(VEX),(o128) 589fd: paddw Pq,Qq | vpaddw Vx,Hx,Wx (66),(v1)
575fe: paddd Pq,Qq | paddd Vdq,Wdq (66),(VEX),(o128) 590fe: paddd Pq,Qq | vpaddd Vx,Hx,Wx (66),(v1)
576ff: 591ff:
577EndTable 592EndTable
578 593
@@ -580,155 +595,193 @@ Table: 3-byte opcode 1 (0x0f 0x38)
580Referrer: 3-byte escape 1 595Referrer: 3-byte escape 1
581AVXcode: 2 596AVXcode: 2
582# 0x0f 0x38 0x00-0x0f 597# 0x0f 0x38 0x00-0x0f
58300: pshufb Pq,Qq | pshufb Vdq,Wdq (66),(VEX),(o128) 59800: pshufb Pq,Qq | vpshufb Vx,Hx,Wx (66),(v1)
58401: phaddw Pq,Qq | phaddw Vdq,Wdq (66),(VEX),(o128) 59901: phaddw Pq,Qq | vphaddw Vx,Hx,Wx (66),(v1)
58502: phaddd Pq,Qq | phaddd Vdq,Wdq (66),(VEX),(o128) 60002: phaddd Pq,Qq | vphaddd Vx,Hx,Wx (66),(v1)
58603: phaddsw Pq,Qq | phaddsw Vdq,Wdq (66),(VEX),(o128) 60103: phaddsw Pq,Qq | vphaddsw Vx,Hx,Wx (66),(v1)
58704: pmaddubsw Pq,Qq | pmaddubsw Vdq,Wdq (66),(VEX),(o128) 60204: pmaddubsw Pq,Qq | vpmaddubsw Vx,Hx,Wx (66),(v1)
58805: phsubw Pq,Qq | phsubw Vdq,Wdq (66),(VEX),(o128) 60305: phsubw Pq,Qq | vphsubw Vx,Hx,Wx (66),(v1)
58906: phsubd Pq,Qq | phsubd Vdq,Wdq (66),(VEX),(o128) 60406: phsubd Pq,Qq | vphsubd Vx,Hx,Wx (66),(v1)
59007: phsubsw Pq,Qq | phsubsw Vdq,Wdq (66),(VEX),(o128) 60507: phsubsw Pq,Qq | vphsubsw Vx,Hx,Wx (66),(v1)
59108: psignb Pq,Qq | psignb Vdq,Wdq (66),(VEX),(o128) 60608: psignb Pq,Qq | vpsignb Vx,Hx,Wx (66),(v1)
59209: psignw Pq,Qq | psignw Vdq,Wdq (66),(VEX),(o128) 60709: psignw Pq,Qq | vpsignw Vx,Hx,Wx (66),(v1)
5930a: psignd Pq,Qq | psignd Vdq,Wdq (66),(VEX),(o128) 6080a: psignd Pq,Qq | vpsignd Vx,Hx,Wx (66),(v1)
5940b: pmulhrsw Pq,Qq | pmulhrsw Vdq,Wdq (66),(VEX),(o128) 6090b: pmulhrsw Pq,Qq | vpmulhrsw Vx,Hx,Wx (66),(v1)
5950c: Vpermilps /r (66),(oVEX) 6100c: vpermilps Vx,Hx,Wx (66),(v)
5960d: Vpermilpd /r (66),(oVEX) 6110d: vpermilpd Vx,Hx,Wx (66),(v)
5970e: vtestps /r (66),(oVEX) 6120e: vtestps Vx,Wx (66),(v)
5980f: vtestpd /r (66),(oVEX) 6130f: vtestpd Vx,Wx (66),(v)
599# 0x0f 0x38 0x10-0x1f 614# 0x0f 0x38 0x10-0x1f
60010: pblendvb Vdq,Wdq (66) 61510: pblendvb Vdq,Wdq (66)
60111: 61611:
60212: 61712:
60313: 61813: vcvtph2ps Vx,Wx,Ib (66),(v)
60414: blendvps Vdq,Wdq (66) 61914: blendvps Vdq,Wdq (66)
60515: blendvpd Vdq,Wdq (66) 62015: blendvpd Vdq,Wdq (66)
60616: 62116: vpermps Vqq,Hqq,Wqq (66),(v)
60717: ptest Vdq,Wdq (66),(VEX) 62217: vptest Vx,Wx (66)
60818: vbroadcastss /r (66),(oVEX) 62318: vbroadcastss Vx,Wd (66),(v)
60919: vbroadcastsd /r (66),(oVEX),(o256) 62419: vbroadcastsd Vqq,Wq (66),(v)
6101a: vbroadcastf128 /r (66),(oVEX),(o256) 6251a: vbroadcastf128 Vqq,Mdq (66),(v)
6111b: 6261b:
6121c: pabsb Pq,Qq | pabsb Vdq,Wdq (66),(VEX),(o128) 6271c: pabsb Pq,Qq | vpabsb Vx,Wx (66),(v1)
6131d: pabsw Pq,Qq | pabsw Vdq,Wdq (66),(VEX),(o128) 6281d: pabsw Pq,Qq | vpabsw Vx,Wx (66),(v1)
6141e: pabsd Pq,Qq | pabsd Vdq,Wdq (66),(VEX),(o128) 6291e: pabsd Pq,Qq | vpabsd Vx,Wx (66),(v1)
6151f: 6301f:
616# 0x0f 0x38 0x20-0x2f 631# 0x0f 0x38 0x20-0x2f
61720: pmovsxbw Vdq,Udq/Mq (66),(VEX),(o128) 63220: vpmovsxbw Vx,Ux/Mq (66),(v1)
61821: pmovsxbd Vdq,Udq/Md (66),(VEX),(o128) 63321: vpmovsxbd Vx,Ux/Md (66),(v1)
61922: pmovsxbq Vdq,Udq/Mw (66),(VEX),(o128) 63422: vpmovsxbq Vx,Ux/Mw (66),(v1)
62023: pmovsxwd Vdq,Udq/Mq (66),(VEX),(o128) 63523: vpmovsxwd Vx,Ux/Mq (66),(v1)
62124: pmovsxwq Vdq,Udq/Md (66),(VEX),(o128) 63624: vpmovsxwq Vx,Ux/Md (66),(v1)
62225: pmovsxdq Vdq,Udq/Mq (66),(VEX),(o128) 63725: vpmovsxdq Vx,Ux/Mq (66),(v1)
62326: 63826:
62427: 63927:
62528: pmuldq Vdq,Wdq (66),(VEX),(o128) 64028: vpmuldq Vx,Hx,Wx (66),(v1)
62629: pcmpeqq Vdq,Wdq (66),(VEX),(o128) 64129: vpcmpeqq Vx,Hx,Wx (66),(v1)
6272a: movntdqa Vdq,Mdq (66),(VEX),(o128) 6422a: vmovntdqa Vx,Mx (66),(v1)
6282b: packusdw Vdq,Wdq (66),(VEX),(o128) 6432b: vpackusdw Vx,Hx,Wx (66),(v1)
6292c: vmaskmovps(ld) /r (66),(oVEX) 6442c: vmaskmovps Vx,Hx,Mx (66),(v)
6302d: vmaskmovpd(ld) /r (66),(oVEX) 6452d: vmaskmovpd Vx,Hx,Mx (66),(v)
6312e: vmaskmovps(st) /r (66),(oVEX) 6462e: vmaskmovps Mx,Hx,Vx (66),(v)
6322f: vmaskmovpd(st) /r (66),(oVEX) 6472f: vmaskmovpd Mx,Hx,Vx (66),(v)
633# 0x0f 0x38 0x30-0x3f 648# 0x0f 0x38 0x30-0x3f
63430: pmovzxbw Vdq,Udq/Mq (66),(VEX),(o128) 64930: vpmovzxbw Vx,Ux/Mq (66),(v1)
63531: pmovzxbd Vdq,Udq/Md (66),(VEX),(o128) 65031: vpmovzxbd Vx,Ux/Md (66),(v1)
63632: pmovzxbq Vdq,Udq/Mw (66),(VEX),(o128) 65132: vpmovzxbq Vx,Ux/Mw (66),(v1)
63733: pmovzxwd Vdq,Udq/Mq (66),(VEX),(o128) 65233: vpmovzxwd Vx,Ux/Mq (66),(v1)
63834: pmovzxwq Vdq,Udq/Md (66),(VEX),(o128) 65334: vpmovzxwq Vx,Ux/Md (66),(v1)
63935: pmovzxdq Vdq,Udq/Mq (66),(VEX),(o128) 65435: vpmovzxdq Vx,Ux/Mq (66),(v1)
64036: 65536: vpermd Vqq,Hqq,Wqq (66),(v)
64137: pcmpgtq Vdq,Wdq (66),(VEX),(o128) 65637: vpcmpgtq Vx,Hx,Wx (66),(v1)
64238: pminsb Vdq,Wdq (66),(VEX),(o128) 65738: vpminsb Vx,Hx,Wx (66),(v1)
64339: pminsd Vdq,Wdq (66),(VEX),(o128) 65839: vpminsd Vx,Hx,Wx (66),(v1)
6443a: pminuw Vdq,Wdq (66),(VEX),(o128) 6593a: vpminuw Vx,Hx,Wx (66),(v1)
6453b: pminud Vdq,Wdq (66),(VEX),(o128) 6603b: vpminud Vx,Hx,Wx (66),(v1)
6463c: pmaxsb Vdq,Wdq (66),(VEX),(o128) 6613c: vpmaxsb Vx,Hx,Wx (66),(v1)
6473d: pmaxsd Vdq,Wdq (66),(VEX),(o128) 6623d: vpmaxsd Vx,Hx,Wx (66),(v1)
6483e: pmaxuw Vdq,Wdq (66),(VEX),(o128) 6633e: vpmaxuw Vx,Hx,Wx (66),(v1)
6493f: pmaxud Vdq,Wdq (66),(VEX),(o128) 6643f: vpmaxud Vx,Hx,Wx (66),(v1)
650# 0x0f 0x38 0x40-0x8f 665# 0x0f 0x38 0x40-0x8f
65140: pmulld Vdq,Wdq (66),(VEX),(o128) 66640: vpmulld Vx,Hx,Wx (66),(v1)
65241: phminposuw Vdq,Wdq (66),(VEX),(o128) 66741: vphminposuw Vdq,Wdq (66),(v1)
65380: INVEPT Gd/q,Mdq (66) 66842:
65481: INVPID Gd/q,Mdq (66) 66943:
67044:
67145: vpsrlvd/q Vx,Hx,Wx (66),(v)
67246: vpsravd Vx,Hx,Wx (66),(v)
67347: vpsllvd/q Vx,Hx,Wx (66),(v)
674# Skip 0x48-0x57
67558: vpbroadcastd Vx,Wx (66),(v)
67659: vpbroadcastq Vx,Wx (66),(v)
6775a: vbroadcasti128 Vqq,Mdq (66),(v)
678# Skip 0x5b-0x77
67978: vpbroadcastb Vx,Wx (66),(v)
68079: vpbroadcastw Vx,Wx (66),(v)
681# Skip 0x7a-0x7f
68280: INVEPT Gy,Mdq (66)
68381: INVPID Gy,Mdq (66)
68482: INVPCID Gy,Mdq (66)
6858c: vpmaskmovd/q Vx,Hx,Mx (66),(v)
6868e: vpmaskmovd/q Mx,Vx,Hx (66),(v)
655# 0x0f 0x38 0x90-0xbf (FMA) 687# 0x0f 0x38 0x90-0xbf (FMA)
65696: vfmaddsub132pd/ps /r (66),(VEX) 68890: vgatherdd/q Vx,Hx,Wx (66),(v)
65797: vfmsubadd132pd/ps /r (66),(VEX) 68991: vgatherqd/q Vx,Hx,Wx (66),(v)
65898: vfmadd132pd/ps /r (66),(VEX) 69092: vgatherdps/d Vx,Hx,Wx (66),(v)
65999: vfmadd132sd/ss /r (66),(VEX),(o128) 69193: vgatherqps/d Vx,Hx,Wx (66),(v)
6609a: vfmsub132pd/ps /r (66),(VEX) 69294:
6619b: vfmsub132sd/ss /r (66),(VEX),(o128) 69395:
6629c: vfnmadd132pd/ps /r (66),(VEX) 69496: vfmaddsub132ps/d Vx,Hx,Wx (66),(v)
6639d: vfnmadd132sd/ss /r (66),(VEX),(o128) 69597: vfmsubadd132ps/d Vx,Hx,Wx (66),(v)
6649e: vfnmsub132pd/ps /r (66),(VEX) 69698: vfmadd132ps/d Vx,Hx,Wx (66),(v)
6659f: vfnmsub132sd/ss /r (66),(VEX),(o128) 69799: vfmadd132ss/d Vx,Hx,Wx (66),(v),(v1)
666a6: vfmaddsub213pd/ps /r (66),(VEX) 6989a: vfmsub132ps/d Vx,Hx,Wx (66),(v)
667a7: vfmsubadd213pd/ps /r (66),(VEX) 6999b: vfmsub132ss/d Vx,Hx,Wx (66),(v),(v1)
668a8: vfmadd213pd/ps /r (66),(VEX) 7009c: vfnmadd132ps/d Vx,Hx,Wx (66),(v)
669a9: vfmadd213sd/ss /r (66),(VEX),(o128) 7019d: vfnmadd132ss/d Vx,Hx,Wx (66),(v),(v1)
670aa: vfmsub213pd/ps /r (66),(VEX) 7029e: vfnmsub132ps/d Vx,Hx,Wx (66),(v)
671ab: vfmsub213sd/ss /r (66),(VEX),(o128) 7039f: vfnmsub132ss/d Vx,Hx,Wx (66),(v),(v1)
672ac: vfnmadd213pd/ps /r (66),(VEX) 704a6: vfmaddsub213ps/d Vx,Hx,Wx (66),(v)
673ad: vfnmadd213sd/ss /r (66),(VEX),(o128) 705a7: vfmsubadd213ps/d Vx,Hx,Wx (66),(v)
674ae: vfnmsub213pd/ps /r (66),(VEX) 706a8: vfmadd213ps/d Vx,Hx,Wx (66),(v)
675af: vfnmsub213sd/ss /r (66),(VEX),(o128) 707a9: vfmadd213ss/d Vx,Hx,Wx (66),(v),(v1)
676b6: vfmaddsub231pd/ps /r (66),(VEX) 708aa: vfmsub213ps/d Vx,Hx,Wx (66),(v)
677b7: vfmsubadd231pd/ps /r (66),(VEX) 709ab: vfmsub213ss/d Vx,Hx,Wx (66),(v),(v1)
678b8: vfmadd231pd/ps /r (66),(VEX) 710ac: vfnmadd213ps/d Vx,Hx,Wx (66),(v)
679b9: vfmadd231sd/ss /r (66),(VEX),(o128) 711ad: vfnmadd213ss/d Vx,Hx,Wx (66),(v),(v1)
680ba: vfmsub231pd/ps /r (66),(VEX) 712ae: vfnmsub213ps/d Vx,Hx,Wx (66),(v)
681bb: vfmsub231sd/ss /r (66),(VEX),(o128) 713af: vfnmsub213ss/d Vx,Hx,Wx (66),(v),(v1)
682bc: vfnmadd231pd/ps /r (66),(VEX) 714b6: vfmaddsub231ps/d Vx,Hx,Wx (66),(v)
683bd: vfnmadd231sd/ss /r (66),(VEX),(o128) 715b7: vfmsubadd231ps/d Vx,Hx,Wx (66),(v)
684be: vfnmsub231pd/ps /r (66),(VEX) 716b8: vfmadd231ps/d Vx,Hx,Wx (66),(v)
685bf: vfnmsub231sd/ss /r (66),(VEX),(o128) 717b9: vfmadd231ss/d Vx,Hx,Wx (66),(v),(v1)
718ba: vfmsub231ps/d Vx,Hx,Wx (66),(v)
719bb: vfmsub231ss/d Vx,Hx,Wx (66),(v),(v1)
720bc: vfnmadd231ps/d Vx,Hx,Wx (66),(v)
721bd: vfnmadd231ss/d Vx,Hx,Wx (66),(v),(v1)
722be: vfnmsub231ps/d Vx,Hx,Wx (66),(v)
723bf: vfnmsub231ss/d Vx,Hx,Wx (66),(v),(v1)
686# 0x0f 0x38 0xc0-0xff 724# 0x0f 0x38 0xc0-0xff
687db: aesimc Vdq,Wdq (66),(VEX),(o128) 725db: VAESIMC Vdq,Wdq (66),(v1)
688dc: aesenc Vdq,Wdq (66),(VEX),(o128) 726dc: VAESENC Vdq,Hdq,Wdq (66),(v1)
689dd: aesenclast Vdq,Wdq (66),(VEX),(o128) 727dd: VAESENCLAST Vdq,Hdq,Wdq (66),(v1)
690de: aesdec Vdq,Wdq (66),(VEX),(o128) 728de: VAESDEC Vdq,Hdq,Wdq (66),(v1)
691df: aesdeclast Vdq,Wdq (66),(VEX),(o128) 729df: VAESDECLAST Vdq,Hdq,Wdq (66),(v1)
692f0: MOVBE Gv,Mv | CRC32 Gd,Eb (F2) 730f0: MOVBE Gy,My | MOVBE Gw,Mw (66) | CRC32 Gd,Eb (F2)
693f1: MOVBE Mv,Gv | CRC32 Gd,Ev (F2) 731f1: MOVBE My,Gy | MOVBE Mw,Gw (66) | CRC32 Gd,Ey (F2)
732f3: ANDN Gy,By,Ey (v)
733f4: Grp17 (1A)
734f5: BZHI Gy,Ey,By (v) | PEXT Gy,By,Ey (F3),(v) | PDEP Gy,By,Ey (F2),(v)
735f6: MULX By,Gy,rDX,Ey (F2),(v)
736f7: BEXTR Gy,Ey,By (v) | SHLX Gy,Ey,By (66),(v) | SARX Gy,Ey,By (F3),(v) | SHRX Gy,Ey,By (F2),(v)
694EndTable 737EndTable
695 738
696Table: 3-byte opcode 2 (0x0f 0x3a) 739Table: 3-byte opcode 2 (0x0f 0x3a)
697Referrer: 3-byte escape 2 740Referrer: 3-byte escape 2
698AVXcode: 3 741AVXcode: 3
699# 0x0f 0x3a 0x00-0xff 742# 0x0f 0x3a 0x00-0xff
70004: vpermilps /r,Ib (66),(oVEX) 74300: vpermq Vqq,Wqq,Ib (66),(v)
70105: vpermilpd /r,Ib (66),(oVEX) 74401: vpermpd Vqq,Wqq,Ib (66),(v)
70206: vperm2f128 /r,Ib (66),(oVEX),(o256) 74502: vpblendd Vx,Hx,Wx,Ib (66),(v)
70308: roundps Vdq,Wdq,Ib (66),(VEX) 74603:
70409: roundpd Vdq,Wdq,Ib (66),(VEX) 74704: vpermilps Vx,Wx,Ib (66),(v)
7050a: roundss Vss,Wss,Ib (66),(VEX),(o128) 74805: vpermilpd Vx,Wx,Ib (66),(v)
7060b: roundsd Vsd,Wsd,Ib (66),(VEX),(o128) 74906: vperm2f128 Vqq,Hqq,Wqq,Ib (66),(v)
7070c: blendps Vdq,Wdq,Ib (66),(VEX) 75007:
7080d: blendpd Vdq,Wdq,Ib (66),(VEX) 75108: vroundps Vx,Wx,Ib (66)
7090e: pblendw Vdq,Wdq,Ib (66),(VEX),(o128) 75209: vroundpd Vx,Wx,Ib (66)
7100f: palignr Pq,Qq,Ib | palignr Vdq,Wdq,Ib (66),(VEX),(o128) 7530a: vroundss Vss,Wss,Ib (66),(v1)
71114: pextrb Rd/Mb,Vdq,Ib (66),(VEX),(o128) 7540b: vroundsd Vsd,Wsd,Ib (66),(v1)
71215: pextrw Rd/Mw,Vdq,Ib (66),(VEX),(o128) 7550c: vblendps Vx,Hx,Wx,Ib (66)
71316: pextrd/pextrq Ed/q,Vdq,Ib (66),(VEX),(o128) 7560d: vblendpd Vx,Hx,Wx,Ib (66)
71417: extractps Ed,Vdq,Ib (66),(VEX),(o128) 7570e: vpblendw Vx,Hx,Wx,Ib (66),(v1)
71518: vinsertf128 /r,Ib (66),(oVEX),(o256) 7580f: palignr Pq,Qq,Ib | vpalignr Vx,Hx,Wx,Ib (66),(v1)
71619: vextractf128 /r,Ib (66),(oVEX),(o256) 75914: vpextrb Rd/Mb,Vdq,Ib (66),(v1)
71720: pinsrb Vdq,Rd/q/Mb,Ib (66),(VEX),(o128) 76015: vpextrw Rd/Mw,Vdq,Ib (66),(v1)
71821: insertps Vdq,Udq/Md,Ib (66),(VEX),(o128) 76116: vpextrd/q Ey,Vdq,Ib (66),(v1)
71922: pinsrd/pinsrq Vdq,Ed/q,Ib (66),(VEX),(o128) 76217: vextractps Ed,Vdq,Ib (66),(v1)
72040: dpps Vdq,Wdq,Ib (66),(VEX) 76318: vinsertf128 Vqq,Hqq,Wqq,Ib (66),(v)
72141: dppd Vdq,Wdq,Ib (66),(VEX),(o128) 76419: vextractf128 Wdq,Vqq,Ib (66),(v)
72242: mpsadbw Vdq,Wdq,Ib (66),(VEX),(o128) 7651d: vcvtps2ph Wx,Vx,Ib (66),(v)
72344: pclmulq Vdq,Wdq,Ib (66),(VEX),(o128) 76620: vpinsrb Vdq,Hdq,Ry/Mb,Ib (66),(v1)
7244a: vblendvps /r,Ib (66),(oVEX) 76721: vinsertps Vdq,Hdq,Udq/Md,Ib (66),(v1)
7254b: vblendvpd /r,Ib (66),(oVEX) 76822: vpinsrd/q Vdq,Hdq,Ey,Ib (66),(v1)
7264c: vpblendvb /r,Ib (66),(oVEX),(o128) 76938: vinserti128 Vqq,Hqq,Wqq,Ib (66),(v)
72760: pcmpestrm Vdq,Wdq,Ib (66),(VEX),(o128) 77039: vextracti128 Wdq,Vqq,Ib (66),(v)
72861: pcmpestri Vdq,Wdq,Ib (66),(VEX),(o128) 77140: vdpps Vx,Hx,Wx,Ib (66)
72962: pcmpistrm Vdq,Wdq,Ib (66),(VEX),(o128) 77241: vdppd Vdq,Hdq,Wdq,Ib (66),(v1)
73063: pcmpistri Vdq,Wdq,Ib (66),(VEX),(o128) 77342: vmpsadbw Vx,Hx,Wx,Ib (66),(v1)
731df: aeskeygenassist Vdq,Wdq,Ib (66),(VEX),(o128) 77444: vpclmulqdq Vdq,Hdq,Wdq,Ib (66),(v1)
77546: vperm2i128 Vqq,Hqq,Wqq,Ib (66),(v)
7764a: vblendvps Vx,Hx,Wx,Lx (66),(v)
7774b: vblendvpd Vx,Hx,Wx,Lx (66),(v)
7784c: vpblendvb Vx,Hx,Wx,Lx (66),(v1)
77960: vpcmpestrm Vdq,Wdq,Ib (66),(v1)
78061: vpcmpestri Vdq,Wdq,Ib (66),(v1)
78162: vpcmpistrm Vdq,Wdq,Ib (66),(v1)
78263: vpcmpistri Vdq,Wdq,Ib (66),(v1)
783df: VAESKEYGEN Vdq,Wdq,Ib (66),(v1)
784f0: RORX Gy,Ey,Ib (F2),(v)
732EndTable 785EndTable
733 786
734GrpTable: Grp1 787GrpTable: Grp1
@@ -790,7 +843,7 @@ GrpTable: Grp5
7902: CALLN Ev (f64) 8432: CALLN Ev (f64)
7913: CALLF Ep 8443: CALLF Ep
7924: JMPN Ev (f64) 8454: JMPN Ev (f64)
7935: JMPF Ep 8465: JMPF Mp
7946: PUSH Ev (d64) 8476: PUSH Ev (d64)
7957: 8487:
796EndTable 849EndTable
@@ -807,7 +860,7 @@ EndTable
807GrpTable: Grp7 860GrpTable: Grp7
8080: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B) 8610: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B)
8091: SIDT Ms | MONITOR (000),(11B) | MWAIT (001) 8621: SIDT Ms | MONITOR (000),(11B) | MWAIT (001)
8102: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) 8632: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B)
8113: LIDT Ms 8643: LIDT Ms
8124: SMSW Mw/Rv 8654: SMSW Mw/Rv
8135: 8665:
@@ -824,44 +877,45 @@ EndTable
824 877
825GrpTable: Grp9 878GrpTable: Grp9
8261: CMPXCHG8B/16B Mq/Mdq 8791: CMPXCHG8B/16B Mq/Mdq
8276: VMPTRLD Mq | VMCLEAR Mq (66) | VMXON Mq (F3) 8806: VMPTRLD Mq | VMCLEAR Mq (66) | VMXON Mq (F3) | RDRAND Rv (11B)
8287: VMPTRST Mq 8817: VMPTRST Mq | VMPTRST Mq (F3)
829EndTable 882EndTable
830 883
831GrpTable: Grp10 884GrpTable: Grp10
832EndTable 885EndTable
833 886
834GrpTable: Grp11 887GrpTable: Grp11
888# Note: the operands are given by group opcode
8350: MOV 8890: MOV
836EndTable 890EndTable
837 891
838GrpTable: Grp12 892GrpTable: Grp12
8392: psrlw Nq,Ib (11B) | psrlw Udq,Ib (66),(11B),(VEX),(o128) 8932: psrlw Nq,Ib (11B) | vpsrlw Hx,Ux,Ib (66),(11B),(v1)
8404: psraw Nq,Ib (11B) | psraw Udq,Ib (66),(11B),(VEX),(o128) 8944: psraw Nq,Ib (11B) | vpsraw Hx,Ux,Ib (66),(11B),(v1)
8416: psllw Nq,Ib (11B) | psllw Udq,Ib (66),(11B),(VEX),(o128) 8956: psllw Nq,Ib (11B) | vpsllw Hx,Ux,Ib (66),(11B),(v1)
842EndTable 896EndTable
843 897
844GrpTable: Grp13 898GrpTable: Grp13
8452: psrld Nq,Ib (11B) | psrld Udq,Ib (66),(11B),(VEX),(o128) 8992: psrld Nq,Ib (11B) | vpsrld Hx,Ux,Ib (66),(11B),(v1)
8464: psrad Nq,Ib (11B) | psrad Udq,Ib (66),(11B),(VEX),(o128) 9004: psrad Nq,Ib (11B) | vpsrad Hx,Ux,Ib (66),(11B),(v1)
8476: pslld Nq,Ib (11B) | pslld Udq,Ib (66),(11B),(VEX),(o128) 9016: pslld Nq,Ib (11B) | vpslld Hx,Ux,Ib (66),(11B),(v1)
848EndTable 902EndTable
849 903
850GrpTable: Grp14 904GrpTable: Grp14
8512: psrlq Nq,Ib (11B) | psrlq Udq,Ib (66),(11B),(VEX),(o128) 9052: psrlq Nq,Ib (11B) | vpsrlq Hx,Ux,Ib (66),(11B),(v1)
8523: psrldq Udq,Ib (66),(11B),(VEX),(o128) 9063: vpsrldq Hx,Ux,Ib (66),(11B),(v1)
8536: psllq Nq,Ib (11B) | psllq Udq,Ib (66),(11B),(VEX),(o128) 9076: psllq Nq,Ib (11B) | vpsllq Hx,Ux,Ib (66),(11B),(v1)
8547: pslldq Udq,Ib (66),(11B),(VEX),(o128) 9087: vpslldq Hx,Ux,Ib (66),(11B),(v1)
855EndTable 909EndTable
856 910
857GrpTable: Grp15 911GrpTable: Grp15
8580: fxsave 9120: fxsave | RDFSBASE Ry (F3),(11B)
8591: fxstor 9131: fxstor | RDGSBASE Ry (F3),(11B)
8602: ldmxcsr (VEX) 9142: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B)
8613: stmxcsr (VEX) 9153: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B)
8624: XSAVE 9164: XSAVE
8635: XRSTOR | lfence (11B) 9175: XRSTOR | lfence (11B)
8646: mfence (11B) 9186: XSAVEOPT | mfence (11B)
8657: clflush | sfence (11B) 9197: clflush | sfence (11B)
866EndTable 920EndTable
867 921
@@ -872,6 +926,12 @@ GrpTable: Grp16
8723: prefetch T2 9263: prefetch T2
873EndTable 927EndTable
874 928
929GrpTable: Grp17
9301: BLSR By,Ey (v)
9312: BLSMSK By,Ey (v)
9323: BLSI By,Ey (v)
933EndTable
934
875# AMD's Prefetch Group 935# AMD's Prefetch Group
876GrpTable: GrpP 936GrpTable: GrpP
8770: PREFETCH 9370: PREFETCH
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index 3d11327c9ab4..23d8e5fecf76 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -27,6 +27,4 @@ obj-$(CONFIG_AMD_NUMA) += amdtopology.o
27obj-$(CONFIG_ACPI_NUMA) += srat.o 27obj-$(CONFIG_ACPI_NUMA) += srat.o
28obj-$(CONFIG_NUMA_EMU) += numa_emulation.o 28obj-$(CONFIG_NUMA_EMU) += numa_emulation.o
29 29
30obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o
31
32obj-$(CONFIG_MEMTEST) += memtest.o 30obj-$(CONFIG_MEMTEST) += memtest.o
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index d0474ad2a6e5..1fb85dbe390a 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -25,7 +25,7 @@ int fixup_exception(struct pt_regs *regs)
25 if (fixup) { 25 if (fixup) {
26 /* If fixup is less than 16, it means uaccess error */ 26 /* If fixup is less than 16, it means uaccess error */
27 if (fixup->fixup < 16) { 27 if (fixup->fixup < 16) {
28 current_thread_info()->uaccess_err = -EFAULT; 28 current_thread_info()->uaccess_err = 1;
29 regs->ip += fixup->fixup; 29 regs->ip += fixup->fixup;
30 return 1; 30 return 1;
31 } 31 }
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 5db0490deb07..9d74824a708d 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -626,7 +626,7 @@ pgtable_bad(struct pt_regs *regs, unsigned long error_code,
626 626
627static noinline void 627static noinline void
628no_context(struct pt_regs *regs, unsigned long error_code, 628no_context(struct pt_regs *regs, unsigned long error_code,
629 unsigned long address) 629 unsigned long address, int signal, int si_code)
630{ 630{
631 struct task_struct *tsk = current; 631 struct task_struct *tsk = current;
632 unsigned long *stackend; 632 unsigned long *stackend;
@@ -634,8 +634,17 @@ no_context(struct pt_regs *regs, unsigned long error_code,
634 int sig; 634 int sig;
635 635
636 /* Are we prepared to handle this kernel fault? */ 636 /* Are we prepared to handle this kernel fault? */
637 if (fixup_exception(regs)) 637 if (fixup_exception(regs)) {
638 if (current_thread_info()->sig_on_uaccess_error && signal) {
639 tsk->thread.trap_no = 14;
640 tsk->thread.error_code = error_code | PF_USER;
641 tsk->thread.cr2 = address;
642
643 /* XXX: hwpoison faults will set the wrong code. */
644 force_sig_info_fault(signal, si_code, address, tsk, 0);
645 }
638 return; 646 return;
647 }
639 648
640 /* 649 /*
641 * 32-bit: 650 * 32-bit:
@@ -755,7 +764,7 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
755 if (is_f00f_bug(regs, address)) 764 if (is_f00f_bug(regs, address))
756 return; 765 return;
757 766
758 no_context(regs, error_code, address); 767 no_context(regs, error_code, address, SIGSEGV, si_code);
759} 768}
760 769
761static noinline void 770static noinline void
@@ -819,7 +828,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
819 828
820 /* Kernel mode? Handle exceptions or die: */ 829 /* Kernel mode? Handle exceptions or die: */
821 if (!(error_code & PF_USER)) { 830 if (!(error_code & PF_USER)) {
822 no_context(regs, error_code, address); 831 no_context(regs, error_code, address, SIGBUS, BUS_ADRERR);
823 return; 832 return;
824 } 833 }
825 834
@@ -854,7 +863,7 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
854 if (!(fault & VM_FAULT_RETRY)) 863 if (!(fault & VM_FAULT_RETRY))
855 up_read(&current->mm->mmap_sem); 864 up_read(&current->mm->mmap_sem);
856 if (!(error_code & PF_USER)) 865 if (!(error_code & PF_USER))
857 no_context(regs, error_code, address); 866 no_context(regs, error_code, address, 0, 0);
858 return 1; 867 return 1;
859 } 868 }
860 if (!(fault & VM_FAULT_ERROR)) 869 if (!(fault & VM_FAULT_ERROR))
@@ -864,7 +873,8 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
864 /* Kernel mode? Handle exceptions or die: */ 873 /* Kernel mode? Handle exceptions or die: */
865 if (!(error_code & PF_USER)) { 874 if (!(error_code & PF_USER)) {
866 up_read(&current->mm->mmap_sem); 875 up_read(&current->mm->mmap_sem);
867 no_context(regs, error_code, address); 876 no_context(regs, error_code, address,
877 SIGSEGV, SEGV_MAPERR);
868 return 1; 878 return 1;
869 } 879 }
870 880
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
index ea305856151c..dd74e46828c0 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
@@ -201,6 +201,8 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr,
201 do { 201 do {
202 VM_BUG_ON(compound_head(page) != head); 202 VM_BUG_ON(compound_head(page) != head);
203 pages[*nr] = page; 203 pages[*nr] = page;
204 if (PageTail(page))
205 get_huge_page_tail(page);
204 (*nr)++; 206 (*nr)++;
205 page++; 207 page++;
206 refs++; 208 refs++;
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index b49962662101..f4f29b19fac5 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -45,6 +45,7 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
45 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 45 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
46 BUG_ON(!pte_none(*(kmap_pte-idx))); 46 BUG_ON(!pte_none(*(kmap_pte-idx)));
47 set_pte(kmap_pte-idx, mk_pte(page, prot)); 47 set_pte(kmap_pte-idx, mk_pte(page, prot));
48 arch_flush_lazy_mmu_mode();
48 49
49 return (void *)vaddr; 50 return (void *)vaddr;
50} 51}
@@ -88,6 +89,7 @@ void __kunmap_atomic(void *kvaddr)
88 */ 89 */
89 kpte_clear_flush(kmap_pte-idx, vaddr); 90 kpte_clear_flush(kmap_pte-idx, vaddr);
90 kmap_atomic_idx_pop(); 91 kmap_atomic_idx_pop();
92 arch_flush_lazy_mmu_mode();
91 } 93 }
92#ifdef CONFIG_DEBUG_HIGHMEM 94#ifdef CONFIG_DEBUG_HIGHMEM
93 else { 95 else {
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 87488b93a65c..a298914058f9 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -67,7 +67,7 @@ static void __init find_early_table_space(unsigned long end, int use_pse,
67 good_end = max_pfn_mapped << PAGE_SHIFT; 67 good_end = max_pfn_mapped << PAGE_SHIFT;
68 68
69 base = memblock_find_in_range(start, good_end, tables, PAGE_SIZE); 69 base = memblock_find_in_range(start, good_end, tables, PAGE_SIZE);
70 if (base == MEMBLOCK_ERROR) 70 if (!base)
71 panic("Cannot find space for the kernel page tables"); 71 panic("Cannot find space for the kernel page tables");
72 72
73 pgt_buf_start = base >> PAGE_SHIFT; 73 pgt_buf_start = base >> PAGE_SHIFT;
@@ -80,7 +80,7 @@ static void __init find_early_table_space(unsigned long end, int use_pse,
80 80
81void __init native_pagetable_reserve(u64 start, u64 end) 81void __init native_pagetable_reserve(u64 start, u64 end)
82{ 82{
83 memblock_x86_reserve_range(start, end, "PGTABLE"); 83 memblock_reserve(start, end - start);
84} 84}
85 85
86struct map_range { 86struct map_range {
@@ -279,8 +279,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
279 * pgt_buf_end) and free the other ones (pgt_buf_end - pgt_buf_top) 279 * pgt_buf_end) and free the other ones (pgt_buf_end - pgt_buf_top)
280 * so that they can be reused for other purposes. 280 * so that they can be reused for other purposes.
281 * 281 *
282 * On native it just means calling memblock_x86_reserve_range, on Xen it 282 * On native it just means calling memblock_reserve, on Xen it also
283 * also means marking RW the pagetable pages that we allocated before 283 * means marking RW the pagetable pages that we allocated before
284 * but that haven't been used. 284 * but that haven't been used.
285 * 285 *
286 * In fact on xen we mark RO the whole range pgt_buf_start - 286 * In fact on xen we mark RO the whole range pgt_buf_start -
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 29f7c6d98179..0c1da394a634 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -427,23 +427,17 @@ static void __init add_one_highpage_init(struct page *page)
427void __init add_highpages_with_active_regions(int nid, 427void __init add_highpages_with_active_regions(int nid,
428 unsigned long start_pfn, unsigned long end_pfn) 428 unsigned long start_pfn, unsigned long end_pfn)
429{ 429{
430 struct range *range; 430 phys_addr_t start, end;
431 int nr_range; 431 u64 i;
432 int i; 432
433 433 for_each_free_mem_range(i, nid, &start, &end, NULL) {
434 nr_range = __get_free_all_memory_range(&range, nid, start_pfn, end_pfn); 434 unsigned long pfn = clamp_t(unsigned long, PFN_UP(start),
435 435 start_pfn, end_pfn);
436 for (i = 0; i < nr_range; i++) { 436 unsigned long e_pfn = clamp_t(unsigned long, PFN_DOWN(end),
437 struct page *page; 437 start_pfn, end_pfn);
438 int node_pfn; 438 for ( ; pfn < e_pfn; pfn++)
439 439 if (pfn_valid(pfn))
440 for (node_pfn = range[i].start; node_pfn < range[i].end; 440 add_one_highpage_init(pfn_to_page(pfn));
441 node_pfn++) {
442 if (!pfn_valid(node_pfn))
443 continue;
444 page = pfn_to_page(node_pfn);
445 add_one_highpage_init(page);
446 }
447 } 441 }
448} 442}
449#else 443#else
@@ -650,18 +644,18 @@ void __init initmem_init(void)
650 highstart_pfn = highend_pfn = max_pfn; 644 highstart_pfn = highend_pfn = max_pfn;
651 if (max_pfn > max_low_pfn) 645 if (max_pfn > max_low_pfn)
652 highstart_pfn = max_low_pfn; 646 highstart_pfn = max_low_pfn;
653 memblock_x86_register_active_regions(0, 0, highend_pfn);
654 sparse_memory_present_with_active_regions(0);
655 printk(KERN_NOTICE "%ldMB HIGHMEM available.\n", 647 printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
656 pages_to_mb(highend_pfn - highstart_pfn)); 648 pages_to_mb(highend_pfn - highstart_pfn));
657 num_physpages = highend_pfn; 649 num_physpages = highend_pfn;
658 high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1; 650 high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
659#else 651#else
660 memblock_x86_register_active_regions(0, 0, max_low_pfn);
661 sparse_memory_present_with_active_regions(0);
662 num_physpages = max_low_pfn; 652 num_physpages = max_low_pfn;
663 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1; 653 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
664#endif 654#endif
655
656 memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
657 sparse_memory_present_with_active_regions(0);
658
665#ifdef CONFIG_FLATMEM 659#ifdef CONFIG_FLATMEM
666 max_mapnr = num_physpages; 660 max_mapnr = num_physpages;
667#endif 661#endif
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index bbaaa005bf0e..a8a56ce3a962 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -608,7 +608,7 @@ kernel_physical_mapping_init(unsigned long start,
608#ifndef CONFIG_NUMA 608#ifndef CONFIG_NUMA
609void __init initmem_init(void) 609void __init initmem_init(void)
610{ 610{
611 memblock_x86_register_active_regions(0, 0, max_pfn); 611 memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0);
612} 612}
613#endif 613#endif
614 614
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c
deleted file mode 100644
index 992da5ec5a64..000000000000
--- a/arch/x86/mm/memblock.c
+++ /dev/null
@@ -1,348 +0,0 @@
1#include <linux/kernel.h>
2#include <linux/types.h>
3#include <linux/init.h>
4#include <linux/bitops.h>
5#include <linux/memblock.h>
6#include <linux/bootmem.h>
7#include <linux/mm.h>
8#include <linux/range.h>
9
10/* Check for already reserved areas */
11bool __init memblock_x86_check_reserved_size(u64 *addrp, u64 *sizep, u64 align)
12{
13 struct memblock_region *r;
14 u64 addr = *addrp, last;
15 u64 size = *sizep;
16 bool changed = false;
17
18again:
19 last = addr + size;
20 for_each_memblock(reserved, r) {
21 if (last > r->base && addr < r->base) {
22 size = r->base - addr;
23 changed = true;
24 goto again;
25 }
26 if (last > (r->base + r->size) && addr < (r->base + r->size)) {
27 addr = round_up(r->base + r->size, align);
28 size = last - addr;
29 changed = true;
30 goto again;
31 }
32 if (last <= (r->base + r->size) && addr >= r->base) {
33 *sizep = 0;
34 return false;
35 }
36 }
37 if (changed) {
38 *addrp = addr;
39 *sizep = size;
40 }
41 return changed;
42}
43
44/*
45 * Find next free range after start, and size is returned in *sizep
46 */
47u64 __init memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align)
48{
49 struct memblock_region *r;
50
51 for_each_memblock(memory, r) {
52 u64 ei_start = r->base;
53 u64 ei_last = ei_start + r->size;
54 u64 addr;
55
56 addr = round_up(ei_start, align);
57 if (addr < start)
58 addr = round_up(start, align);
59 if (addr >= ei_last)
60 continue;
61 *sizep = ei_last - addr;
62 while (memblock_x86_check_reserved_size(&addr, sizep, align))
63 ;
64
65 if (*sizep)
66 return addr;
67 }
68
69 return MEMBLOCK_ERROR;
70}
71
72static __init struct range *find_range_array(int count)
73{
74 u64 end, size, mem;
75 struct range *range;
76
77 size = sizeof(struct range) * count;
78 end = memblock.current_limit;
79
80 mem = memblock_find_in_range(0, end, size, sizeof(struct range));
81 if (mem == MEMBLOCK_ERROR)
82 panic("can not find more space for range array");
83
84 /*
85 * This range is tempoaray, so don't reserve it, it will not be
86 * overlapped because We will not alloccate new buffer before
87 * We discard this one
88 */
89 range = __va(mem);
90 memset(range, 0, size);
91
92 return range;
93}
94
95static void __init memblock_x86_subtract_reserved(struct range *range, int az)
96{
97 u64 final_start, final_end;
98 struct memblock_region *r;
99
100 /* Take out region array itself at first*/
101 memblock_free_reserved_regions();
102
103 memblock_dbg("Subtract (%ld early reservations)\n", memblock.reserved.cnt);
104
105 for_each_memblock(reserved, r) {
106 memblock_dbg(" [%010llx-%010llx]\n", (u64)r->base, (u64)r->base + r->size - 1);
107 final_start = PFN_DOWN(r->base);
108 final_end = PFN_UP(r->base + r->size);
109 if (final_start >= final_end)
110 continue;
111 subtract_range(range, az, final_start, final_end);
112 }
113
114 /* Put region array back ? */
115 memblock_reserve_reserved_regions();
116}
117
118struct count_data {
119 int nr;
120};
121
122static int __init count_work_fn(unsigned long start_pfn,
123 unsigned long end_pfn, void *datax)
124{
125 struct count_data *data = datax;
126
127 data->nr++;
128
129 return 0;
130}
131
132static int __init count_early_node_map(int nodeid)
133{
134 struct count_data data;
135
136 data.nr = 0;
137 work_with_active_regions(nodeid, count_work_fn, &data);
138
139 return data.nr;
140}
141
142int __init __get_free_all_memory_range(struct range **rangep, int nodeid,
143 unsigned long start_pfn, unsigned long end_pfn)
144{
145 int count;
146 struct range *range;
147 int nr_range;
148
149 count = (memblock.reserved.cnt + count_early_node_map(nodeid)) * 2;
150
151 range = find_range_array(count);
152 nr_range = 0;
153
154 /*
155 * Use early_node_map[] and memblock.reserved.region to get range array
156 * at first
157 */
158 nr_range = add_from_early_node_map(range, count, nr_range, nodeid);
159 subtract_range(range, count, 0, start_pfn);
160 subtract_range(range, count, end_pfn, -1ULL);
161
162 memblock_x86_subtract_reserved(range, count);
163 nr_range = clean_sort_range(range, count);
164
165 *rangep = range;
166 return nr_range;
167}
168
169int __init get_free_all_memory_range(struct range **rangep, int nodeid)
170{
171 unsigned long end_pfn = -1UL;
172
173#ifdef CONFIG_X86_32
174 end_pfn = max_low_pfn;
175#endif
176 return __get_free_all_memory_range(rangep, nodeid, 0, end_pfn);
177}
178
179static u64 __init __memblock_x86_memory_in_range(u64 addr, u64 limit, bool get_free)
180{
181 int i, count;
182 struct range *range;
183 int nr_range;
184 u64 final_start, final_end;
185 u64 free_size;
186 struct memblock_region *r;
187
188 count = (memblock.reserved.cnt + memblock.memory.cnt) * 2;
189
190 range = find_range_array(count);
191 nr_range = 0;
192
193 addr = PFN_UP(addr);
194 limit = PFN_DOWN(limit);
195
196 for_each_memblock(memory, r) {
197 final_start = PFN_UP(r->base);
198 final_end = PFN_DOWN(r->base + r->size);
199 if (final_start >= final_end)
200 continue;
201 if (final_start >= limit || final_end <= addr)
202 continue;
203
204 nr_range = add_range(range, count, nr_range, final_start, final_end);
205 }
206 subtract_range(range, count, 0, addr);
207 subtract_range(range, count, limit, -1ULL);
208
209 /* Subtract memblock.reserved.region in range ? */
210 if (!get_free)
211 goto sort_and_count_them;
212 for_each_memblock(reserved, r) {
213 final_start = PFN_DOWN(r->base);
214 final_end = PFN_UP(r->base + r->size);
215 if (final_start >= final_end)
216 continue;
217 if (final_start >= limit || final_end <= addr)
218 continue;
219
220 subtract_range(range, count, final_start, final_end);
221 }
222
223sort_and_count_them:
224 nr_range = clean_sort_range(range, count);
225
226 free_size = 0;
227 for (i = 0; i < nr_range; i++)
228 free_size += range[i].end - range[i].start;
229
230 return free_size << PAGE_SHIFT;
231}
232
233u64 __init memblock_x86_free_memory_in_range(u64 addr, u64 limit)
234{
235 return __memblock_x86_memory_in_range(addr, limit, true);
236}
237
238u64 __init memblock_x86_memory_in_range(u64 addr, u64 limit)
239{
240 return __memblock_x86_memory_in_range(addr, limit, false);
241}
242
243void __init memblock_x86_reserve_range(u64 start, u64 end, char *name)
244{
245 if (start == end)
246 return;
247
248 if (WARN_ONCE(start > end, "memblock_x86_reserve_range: wrong range [%#llx, %#llx)\n", start, end))
249 return;
250
251 memblock_dbg(" memblock_x86_reserve_range: [%#010llx-%#010llx] %16s\n", start, end - 1, name);
252
253 memblock_reserve(start, end - start);
254}
255
256void __init memblock_x86_free_range(u64 start, u64 end)
257{
258 if (start == end)
259 return;
260
261 if (WARN_ONCE(start > end, "memblock_x86_free_range: wrong range [%#llx, %#llx)\n", start, end))
262 return;
263
264 memblock_dbg(" memblock_x86_free_range: [%#010llx-%#010llx]\n", start, end - 1);
265
266 memblock_free(start, end - start);
267}
268
269/*
270 * Need to call this function after memblock_x86_register_active_regions,
271 * so early_node_map[] is filled already.
272 */
273u64 __init memblock_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size, u64 align)
274{
275 u64 addr;
276 addr = find_memory_core_early(nid, size, align, start, end);
277 if (addr != MEMBLOCK_ERROR)
278 return addr;
279
280 /* Fallback, should already have start end within node range */
281 return memblock_find_in_range(start, end, size, align);
282}
283
284/*
285 * Finds an active region in the address range from start_pfn to last_pfn and
286 * returns its range in ei_startpfn and ei_endpfn for the memblock entry.
287 */
288static int __init memblock_x86_find_active_region(const struct memblock_region *ei,
289 unsigned long start_pfn,
290 unsigned long last_pfn,
291 unsigned long *ei_startpfn,
292 unsigned long *ei_endpfn)
293{
294 u64 align = PAGE_SIZE;
295
296 *ei_startpfn = round_up(ei->base, align) >> PAGE_SHIFT;
297 *ei_endpfn = round_down(ei->base + ei->size, align) >> PAGE_SHIFT;
298
299 /* Skip map entries smaller than a page */
300 if (*ei_startpfn >= *ei_endpfn)
301 return 0;
302
303 /* Skip if map is outside the node */
304 if (*ei_endpfn <= start_pfn || *ei_startpfn >= last_pfn)
305 return 0;
306
307 /* Check for overlaps */
308 if (*ei_startpfn < start_pfn)
309 *ei_startpfn = start_pfn;
310 if (*ei_endpfn > last_pfn)
311 *ei_endpfn = last_pfn;
312
313 return 1;
314}
315
316/* Walk the memblock.memory map and register active regions within a node */
317void __init memblock_x86_register_active_regions(int nid, unsigned long start_pfn,
318 unsigned long last_pfn)
319{
320 unsigned long ei_startpfn;
321 unsigned long ei_endpfn;
322 struct memblock_region *r;
323
324 for_each_memblock(memory, r)
325 if (memblock_x86_find_active_region(r, start_pfn, last_pfn,
326 &ei_startpfn, &ei_endpfn))
327 add_active_range(nid, ei_startpfn, ei_endpfn);
328}
329
330/*
331 * Find the hole size (in bytes) in the memory range.
332 * @start: starting address of the memory range to scan
333 * @end: ending address of the memory range to scan
334 */
335u64 __init memblock_x86_hole_size(u64 start, u64 end)
336{
337 unsigned long start_pfn = start >> PAGE_SHIFT;
338 unsigned long last_pfn = end >> PAGE_SHIFT;
339 unsigned long ei_startpfn, ei_endpfn, ram = 0;
340 struct memblock_region *r;
341
342 for_each_memblock(memory, r)
343 if (memblock_x86_find_active_region(r, start_pfn, last_pfn,
344 &ei_startpfn, &ei_endpfn))
345 ram += ei_endpfn - ei_startpfn;
346
347 return end - start - ((u64)ram << PAGE_SHIFT);
348}
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index 92faf3a1c53e..c80b9fb95734 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -34,7 +34,7 @@ static void __init reserve_bad_mem(u64 pattern, u64 start_bad, u64 end_bad)
34 (unsigned long long) pattern, 34 (unsigned long long) pattern,
35 (unsigned long long) start_bad, 35 (unsigned long long) start_bad,
36 (unsigned long long) end_bad); 36 (unsigned long long) end_bad);
37 memblock_x86_reserve_range(start_bad, end_bad, "BAD RAM"); 37 memblock_reserve(start_bad, end_bad - start_bad);
38} 38}
39 39
40static void __init memtest(u64 pattern, u64 start_phys, u64 size) 40static void __init memtest(u64 pattern, u64 start_phys, u64 size)
@@ -70,24 +70,19 @@ static void __init memtest(u64 pattern, u64 start_phys, u64 size)
70 70
71static void __init do_one_pass(u64 pattern, u64 start, u64 end) 71static void __init do_one_pass(u64 pattern, u64 start, u64 end)
72{ 72{
73 u64 size = 0; 73 u64 i;
74 74 phys_addr_t this_start, this_end;
75 while (start < end) { 75
76 start = memblock_x86_find_in_range_size(start, &size, 1); 76 for_each_free_mem_range(i, MAX_NUMNODES, &this_start, &this_end, NULL) {
77 77 this_start = clamp_t(phys_addr_t, this_start, start, end);
78 /* done ? */ 78 this_end = clamp_t(phys_addr_t, this_end, start, end);
79 if (start >= end) 79 if (this_start < this_end) {
80 break; 80 printk(KERN_INFO " %010llx - %010llx pattern %016llx\n",
81 if (start + size > end) 81 (unsigned long long)this_start,
82 size = end - start; 82 (unsigned long long)this_end,
83 83 (unsigned long long)cpu_to_be64(pattern));
84 printk(KERN_INFO " %010llx - %010llx pattern %016llx\n", 84 memtest(pattern, this_start, this_end - this_start);
85 (unsigned long long) start, 85 }
86 (unsigned long long) start + size,
87 (unsigned long long) cpu_to_be64(pattern));
88 memtest(pattern, start, size);
89
90 start += size;
91 } 86 }
92} 87}
93 88
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index fbeaaf416610..496f494593bf 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -192,8 +192,6 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
192/* Initialize NODE_DATA for a node on the local memory */ 192/* Initialize NODE_DATA for a node on the local memory */
193static void __init setup_node_data(int nid, u64 start, u64 end) 193static void __init setup_node_data(int nid, u64 start, u64 end)
194{ 194{
195 const u64 nd_low = PFN_PHYS(MAX_DMA_PFN);
196 const u64 nd_high = PFN_PHYS(max_pfn_mapped);
197 const size_t nd_size = roundup(sizeof(pg_data_t), PAGE_SIZE); 195 const size_t nd_size = roundup(sizeof(pg_data_t), PAGE_SIZE);
198 bool remapped = false; 196 bool remapped = false;
199 u64 nd_pa; 197 u64 nd_pa;
@@ -224,17 +222,12 @@ static void __init setup_node_data(int nid, u64 start, u64 end)
224 nd_pa = __pa(nd); 222 nd_pa = __pa(nd);
225 remapped = true; 223 remapped = true;
226 } else { 224 } else {
227 nd_pa = memblock_x86_find_in_range_node(nid, nd_low, nd_high, 225 nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
228 nd_size, SMP_CACHE_BYTES); 226 if (!nd_pa) {
229 if (nd_pa == MEMBLOCK_ERROR)
230 nd_pa = memblock_find_in_range(nd_low, nd_high,
231 nd_size, SMP_CACHE_BYTES);
232 if (nd_pa == MEMBLOCK_ERROR) {
233 pr_err("Cannot find %zu bytes in node %d\n", 227 pr_err("Cannot find %zu bytes in node %d\n",
234 nd_size, nid); 228 nd_size, nid);
235 return; 229 return;
236 } 230 }
237 memblock_x86_reserve_range(nd_pa, nd_pa + nd_size, "NODE_DATA");
238 nd = __va(nd_pa); 231 nd = __va(nd_pa);
239 } 232 }
240 233
@@ -371,8 +364,7 @@ void __init numa_reset_distance(void)
371 364
372 /* numa_distance could be 1LU marking allocation failure, test cnt */ 365 /* numa_distance could be 1LU marking allocation failure, test cnt */
373 if (numa_distance_cnt) 366 if (numa_distance_cnt)
374 memblock_x86_free_range(__pa(numa_distance), 367 memblock_free(__pa(numa_distance), size);
375 __pa(numa_distance) + size);
376 numa_distance_cnt = 0; 368 numa_distance_cnt = 0;
377 numa_distance = NULL; /* enable table creation */ 369 numa_distance = NULL; /* enable table creation */
378} 370}
@@ -395,13 +387,13 @@ static int __init numa_alloc_distance(void)
395 387
396 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped), 388 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
397 size, PAGE_SIZE); 389 size, PAGE_SIZE);
398 if (phys == MEMBLOCK_ERROR) { 390 if (!phys) {
399 pr_warning("NUMA: Warning: can't allocate distance table!\n"); 391 pr_warning("NUMA: Warning: can't allocate distance table!\n");
400 /* don't retry until explicitly reset */ 392 /* don't retry until explicitly reset */
401 numa_distance = (void *)1LU; 393 numa_distance = (void *)1LU;
402 return -ENOMEM; 394 return -ENOMEM;
403 } 395 }
404 memblock_x86_reserve_range(phys, phys + size, "NUMA DIST"); 396 memblock_reserve(phys, size);
405 397
406 numa_distance = __va(phys); 398 numa_distance = __va(phys);
407 numa_distance_cnt = cnt; 399 numa_distance_cnt = cnt;
@@ -482,8 +474,8 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi)
482 numaram = 0; 474 numaram = 0;
483 } 475 }
484 476
485 e820ram = max_pfn - (memblock_x86_hole_size(0, 477 e820ram = max_pfn - absent_pages_in_range(0, max_pfn);
486 PFN_PHYS(max_pfn)) >> PAGE_SHIFT); 478
487 /* We seem to lose 3 pages somewhere. Allow 1M of slack. */ 479 /* We seem to lose 3 pages somewhere. Allow 1M of slack. */
488 if ((s64)(e820ram - numaram) >= (1 << (20 - PAGE_SHIFT))) { 480 if ((s64)(e820ram - numaram) >= (1 << (20 - PAGE_SHIFT))) {
489 printk(KERN_ERR "NUMA: nodes only cover %LuMB of your %LuMB e820 RAM. Not used.\n", 481 printk(KERN_ERR "NUMA: nodes only cover %LuMB of your %LuMB e820 RAM. Not used.\n",
@@ -505,13 +497,10 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
505 if (WARN_ON(nodes_empty(node_possible_map))) 497 if (WARN_ON(nodes_empty(node_possible_map)))
506 return -EINVAL; 498 return -EINVAL;
507 499
508 for (i = 0; i < mi->nr_blks; i++) 500 for (i = 0; i < mi->nr_blks; i++) {
509 memblock_x86_register_active_regions(mi->blk[i].nid, 501 struct numa_memblk *mb = &mi->blk[i];
510 mi->blk[i].start >> PAGE_SHIFT, 502 memblock_set_node(mb->start, mb->end - mb->start, mb->nid);
511 mi->blk[i].end >> PAGE_SHIFT); 503 }
512
513 /* for out of order entries */
514 sort_node_map();
515 504
516 /* 505 /*
517 * If sections array is gonna be used for pfn -> nid mapping, check 506 * If sections array is gonna be used for pfn -> nid mapping, check
@@ -545,6 +534,8 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
545 setup_node_data(nid, start, end); 534 setup_node_data(nid, start, end);
546 } 535 }
547 536
537 /* Dump memblock with node info and return. */
538 memblock_dump_all();
548 return 0; 539 return 0;
549} 540}
550 541
@@ -582,7 +573,7 @@ static int __init numa_init(int (*init_func)(void))
582 nodes_clear(node_possible_map); 573 nodes_clear(node_possible_map);
583 nodes_clear(node_online_map); 574 nodes_clear(node_online_map);
584 memset(&numa_meminfo, 0, sizeof(numa_meminfo)); 575 memset(&numa_meminfo, 0, sizeof(numa_meminfo));
585 remove_all_active_ranges(); 576 WARN_ON(memblock_set_node(0, ULLONG_MAX, MAX_NUMNODES));
586 numa_reset_distance(); 577 numa_reset_distance();
587 578
588 ret = init_func(); 579 ret = init_func();
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index 3adebe7e536a..534255a36b6b 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -199,23 +199,23 @@ void __init init_alloc_remap(int nid, u64 start, u64 end)
199 199
200 /* allocate node memory and the lowmem remap area */ 200 /* allocate node memory and the lowmem remap area */
201 node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES); 201 node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES);
202 if (node_pa == MEMBLOCK_ERROR) { 202 if (!node_pa) {
203 pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n", 203 pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n",
204 size, nid); 204 size, nid);
205 return; 205 return;
206 } 206 }
207 memblock_x86_reserve_range(node_pa, node_pa + size, "KVA RAM"); 207 memblock_reserve(node_pa, size);
208 208
209 remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT, 209 remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT,
210 max_low_pfn << PAGE_SHIFT, 210 max_low_pfn << PAGE_SHIFT,
211 size, LARGE_PAGE_BYTES); 211 size, LARGE_PAGE_BYTES);
212 if (remap_pa == MEMBLOCK_ERROR) { 212 if (!remap_pa) {
213 pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n", 213 pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n",
214 size, nid); 214 size, nid);
215 memblock_x86_free_range(node_pa, node_pa + size); 215 memblock_free(node_pa, size);
216 return; 216 return;
217 } 217 }
218 memblock_x86_reserve_range(remap_pa, remap_pa + size, "KVA PG"); 218 memblock_reserve(remap_pa, size);
219 remap_va = phys_to_virt(remap_pa); 219 remap_va = phys_to_virt(remap_pa);
220 220
221 /* perform actual remap */ 221 /* perform actual remap */
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index dd27f401f0a0..92e27119ee1a 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -19,7 +19,7 @@ unsigned long __init numa_free_all_bootmem(void)
19 for_each_online_node(i) 19 for_each_online_node(i)
20 pages += free_all_bootmem_node(NODE_DATA(i)); 20 pages += free_all_bootmem_node(NODE_DATA(i));
21 21
22 pages += free_all_memory_core_early(MAX_NUMNODES); 22 pages += free_low_memory_core_early(MAX_NUMNODES);
23 23
24 return pages; 24 return pages;
25} 25}
diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c
index d0ed086b6247..46db56845f18 100644
--- a/arch/x86/mm/numa_emulation.c
+++ b/arch/x86/mm/numa_emulation.c
@@ -28,6 +28,16 @@ static int __init emu_find_memblk_by_nid(int nid, const struct numa_meminfo *mi)
28 return -ENOENT; 28 return -ENOENT;
29} 29}
30 30
31static u64 mem_hole_size(u64 start, u64 end)
32{
33 unsigned long start_pfn = PFN_UP(start);
34 unsigned long end_pfn = PFN_DOWN(end);
35
36 if (start_pfn < end_pfn)
37 return PFN_PHYS(absent_pages_in_range(start_pfn, end_pfn));
38 return 0;
39}
40
31/* 41/*
32 * Sets up nid to range from @start to @end. The return value is -errno if 42 * Sets up nid to range from @start to @end. The return value is -errno if
33 * something went wrong, 0 otherwise. 43 * something went wrong, 0 otherwise.
@@ -89,7 +99,7 @@ static int __init split_nodes_interleave(struct numa_meminfo *ei,
89 * Calculate target node size. x86_32 freaks on __udivdi3() so do 99 * Calculate target node size. x86_32 freaks on __udivdi3() so do
90 * the division in ulong number of pages and convert back. 100 * the division in ulong number of pages and convert back.
91 */ 101 */
92 size = max_addr - addr - memblock_x86_hole_size(addr, max_addr); 102 size = max_addr - addr - mem_hole_size(addr, max_addr);
93 size = PFN_PHYS((unsigned long)(size >> PAGE_SHIFT) / nr_nodes); 103 size = PFN_PHYS((unsigned long)(size >> PAGE_SHIFT) / nr_nodes);
94 104
95 /* 105 /*
@@ -135,8 +145,7 @@ static int __init split_nodes_interleave(struct numa_meminfo *ei,
135 * Continue to add memory to this fake node if its 145 * Continue to add memory to this fake node if its
136 * non-reserved memory is less than the per-node size. 146 * non-reserved memory is less than the per-node size.
137 */ 147 */
138 while (end - start - 148 while (end - start - mem_hole_size(start, end) < size) {
139 memblock_x86_hole_size(start, end) < size) {
140 end += FAKE_NODE_MIN_SIZE; 149 end += FAKE_NODE_MIN_SIZE;
141 if (end > limit) { 150 if (end > limit) {
142 end = limit; 151 end = limit;
@@ -150,7 +159,7 @@ static int __init split_nodes_interleave(struct numa_meminfo *ei,
150 * this one must extend to the boundary. 159 * this one must extend to the boundary.
151 */ 160 */
152 if (end < dma32_end && dma32_end - end - 161 if (end < dma32_end && dma32_end - end -
153 memblock_x86_hole_size(end, dma32_end) < FAKE_NODE_MIN_SIZE) 162 mem_hole_size(end, dma32_end) < FAKE_NODE_MIN_SIZE)
154 end = dma32_end; 163 end = dma32_end;
155 164
156 /* 165 /*
@@ -158,8 +167,7 @@ static int __init split_nodes_interleave(struct numa_meminfo *ei,
158 * next node, this one must extend to the end of the 167 * next node, this one must extend to the end of the
159 * physical node. 168 * physical node.
160 */ 169 */
161 if (limit - end - 170 if (limit - end - mem_hole_size(end, limit) < size)
162 memblock_x86_hole_size(end, limit) < size)
163 end = limit; 171 end = limit;
164 172
165 ret = emu_setup_memblk(ei, pi, nid++ % nr_nodes, 173 ret = emu_setup_memblk(ei, pi, nid++ % nr_nodes,
@@ -180,7 +188,7 @@ static u64 __init find_end_of_node(u64 start, u64 max_addr, u64 size)
180{ 188{
181 u64 end = start + size; 189 u64 end = start + size;
182 190
183 while (end - start - memblock_x86_hole_size(start, end) < size) { 191 while (end - start - mem_hole_size(start, end) < size) {
184 end += FAKE_NODE_MIN_SIZE; 192 end += FAKE_NODE_MIN_SIZE;
185 if (end > max_addr) { 193 if (end > max_addr) {
186 end = max_addr; 194 end = max_addr;
@@ -211,8 +219,7 @@ static int __init split_nodes_size_interleave(struct numa_meminfo *ei,
211 * creates a uniform distribution of node sizes across the entire 219 * creates a uniform distribution of node sizes across the entire
212 * machine (but not necessarily over physical nodes). 220 * machine (but not necessarily over physical nodes).
213 */ 221 */
214 min_size = (max_addr - addr - memblock_x86_hole_size(addr, max_addr)) / 222 min_size = (max_addr - addr - mem_hole_size(addr, max_addr)) / MAX_NUMNODES;
215 MAX_NUMNODES;
216 min_size = max(min_size, FAKE_NODE_MIN_SIZE); 223 min_size = max(min_size, FAKE_NODE_MIN_SIZE);
217 if ((min_size & FAKE_NODE_MIN_HASH_MASK) < min_size) 224 if ((min_size & FAKE_NODE_MIN_HASH_MASK) < min_size)
218 min_size = (min_size + FAKE_NODE_MIN_SIZE) & 225 min_size = (min_size + FAKE_NODE_MIN_SIZE) &
@@ -252,7 +259,7 @@ static int __init split_nodes_size_interleave(struct numa_meminfo *ei,
252 * this one must extend to the boundary. 259 * this one must extend to the boundary.
253 */ 260 */
254 if (end < dma32_end && dma32_end - end - 261 if (end < dma32_end && dma32_end - end -
255 memblock_x86_hole_size(end, dma32_end) < FAKE_NODE_MIN_SIZE) 262 mem_hole_size(end, dma32_end) < FAKE_NODE_MIN_SIZE)
256 end = dma32_end; 263 end = dma32_end;
257 264
258 /* 265 /*
@@ -260,8 +267,7 @@ static int __init split_nodes_size_interleave(struct numa_meminfo *ei,
260 * next node, this one must extend to the end of the 267 * next node, this one must extend to the end of the
261 * physical node. 268 * physical node.
262 */ 269 */
263 if (limit - end - 270 if (limit - end - mem_hole_size(end, limit) < size)
264 memblock_x86_hole_size(end, limit) < size)
265 end = limit; 271 end = limit;
266 272
267 ret = emu_setup_memblk(ei, pi, nid++ % MAX_NUMNODES, 273 ret = emu_setup_memblk(ei, pi, nid++ % MAX_NUMNODES,
@@ -351,11 +357,11 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
351 357
352 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped), 358 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
353 phys_size, PAGE_SIZE); 359 phys_size, PAGE_SIZE);
354 if (phys == MEMBLOCK_ERROR) { 360 if (!phys) {
355 pr_warning("NUMA: Warning: can't allocate copy of distance table, disabling emulation\n"); 361 pr_warning("NUMA: Warning: can't allocate copy of distance table, disabling emulation\n");
356 goto no_emu; 362 goto no_emu;
357 } 363 }
358 memblock_x86_reserve_range(phys, phys + phys_size, "TMP NUMA DIST"); 364 memblock_reserve(phys, phys_size);
359 phys_dist = __va(phys); 365 phys_dist = __va(phys);
360 366
361 for (i = 0; i < numa_dist_cnt; i++) 367 for (i = 0; i < numa_dist_cnt; i++)
@@ -424,7 +430,7 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
424 430
425 /* free the copied physical distance table */ 431 /* free the copied physical distance table */
426 if (phys_dist) 432 if (phys_dist)
427 memblock_x86_free_range(__pa(phys_dist), __pa(phys_dist) + phys_size); 433 memblock_free(__pa(phys_dist), phys_size);
428 return; 434 return;
429 435
430no_emu: 436no_emu:
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index f9e526742fa1..eda2acbb6e81 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -998,7 +998,7 @@ out_err:
998} 998}
999EXPORT_SYMBOL(set_memory_uc); 999EXPORT_SYMBOL(set_memory_uc);
1000 1000
1001int _set_memory_array(unsigned long *addr, int addrinarray, 1001static int _set_memory_array(unsigned long *addr, int addrinarray,
1002 unsigned long new_type) 1002 unsigned long new_type)
1003{ 1003{
1004 int i, j; 1004 int i, j;
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
index 81dbfdeb080d..fd61b3fb7341 100644
--- a/arch/x86/mm/srat.c
+++ b/arch/x86/mm/srat.c
@@ -69,6 +69,12 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
69 if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0) 69 if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
70 return; 70 return;
71 pxm = pa->proximity_domain; 71 pxm = pa->proximity_domain;
72 apic_id = pa->apic_id;
73 if (!cpu_has_x2apic && (apic_id >= 0xff)) {
74 printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n",
75 pxm, apic_id);
76 return;
77 }
72 node = setup_node(pxm); 78 node = setup_node(pxm);
73 if (node < 0) { 79 if (node < 0) {
74 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); 80 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
@@ -76,7 +82,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
76 return; 82 return;
77 } 83 }
78 84
79 apic_id = pa->apic_id;
80 if (apic_id >= MAX_LOCAL_APIC) { 85 if (apic_id >= MAX_LOCAL_APIC) {
81 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node); 86 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node);
82 return; 87 return;
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index bfab3fa10edc..7b65f752c5f8 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -568,8 +568,8 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
568 break; 568 break;
569 } 569 }
570 if (filter[i].jt != 0) { 570 if (filter[i].jt != 0) {
571 if (filter[i].jf) 571 if (filter[i].jf && f_offset)
572 t_offset += is_near(f_offset) ? 2 : 6; 572 t_offset += is_near(f_offset) ? 2 : 5;
573 EMIT_COND_JMP(t_op, t_offset); 573 EMIT_COND_JMP(t_op, t_offset);
574 if (filter[i].jf) 574 if (filter[i].jf)
575 EMIT_JMP(f_offset); 575 EMIT_JMP(f_offset);
diff --git a/arch/x86/oprofile/Makefile b/arch/x86/oprofile/Makefile
index 446902b2a6b6..1599f568f0e2 100644
--- a/arch/x86/oprofile/Makefile
+++ b/arch/x86/oprofile/Makefile
@@ -4,9 +4,8 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
4 oprof.o cpu_buffer.o buffer_sync.o \ 4 oprof.o cpu_buffer.o buffer_sync.o \
5 event_buffer.o oprofile_files.o \ 5 event_buffer.o oprofile_files.o \
6 oprofilefs.o oprofile_stats.o \ 6 oprofilefs.o oprofile_stats.o \
7 timer_int.o ) 7 timer_int.o nmi_timer_int.o )
8 8
9oprofile-y := $(DRIVER_OBJS) init.o backtrace.o 9oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
10oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_amd.o \ 10oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_amd.o \
11 op_model_ppro.o op_model_p4.o 11 op_model_ppro.o op_model_p4.o
12oprofile-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o
diff --git a/arch/x86/oprofile/init.c b/arch/x86/oprofile/init.c
index cdfe4c54deca..9e138d00ad36 100644
--- a/arch/x86/oprofile/init.c
+++ b/arch/x86/oprofile/init.c
@@ -16,34 +16,23 @@
16 * with the NMI mode driver. 16 * with the NMI mode driver.
17 */ 17 */
18 18
19#ifdef CONFIG_X86_LOCAL_APIC
19extern int op_nmi_init(struct oprofile_operations *ops); 20extern int op_nmi_init(struct oprofile_operations *ops);
20extern int op_nmi_timer_init(struct oprofile_operations *ops);
21extern void op_nmi_exit(void); 21extern void op_nmi_exit(void);
22extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); 22#else
23static int op_nmi_init(struct oprofile_operations *ops) { return -ENODEV; }
24static void op_nmi_exit(void) { }
25#endif
23 26
27extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth);
24 28
25int __init oprofile_arch_init(struct oprofile_operations *ops) 29int __init oprofile_arch_init(struct oprofile_operations *ops)
26{ 30{
27 int ret;
28
29 ret = -ENODEV;
30
31#ifdef CONFIG_X86_LOCAL_APIC
32 ret = op_nmi_init(ops);
33#endif
34#ifdef CONFIG_X86_IO_APIC
35 if (ret < 0)
36 ret = op_nmi_timer_init(ops);
37#endif
38 ops->backtrace = x86_backtrace; 31 ops->backtrace = x86_backtrace;
39 32 return op_nmi_init(ops);
40 return ret;
41} 33}
42 34
43
44void oprofile_arch_exit(void) 35void oprofile_arch_exit(void)
45{ 36{
46#ifdef CONFIG_X86_LOCAL_APIC
47 op_nmi_exit(); 37 op_nmi_exit();
48#endif
49} 38}
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 75f9528e0372..26b8a8514ee5 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -595,24 +595,36 @@ static int __init p4_init(char **cpu_type)
595 return 0; 595 return 0;
596} 596}
597 597
598static int force_arch_perfmon; 598enum __force_cpu_type {
599static int force_cpu_type(const char *str, struct kernel_param *kp) 599 reserved = 0, /* do not force */
600 timer,
601 arch_perfmon,
602};
603
604static int force_cpu_type;
605
606static int set_cpu_type(const char *str, struct kernel_param *kp)
600{ 607{
601 if (!strcmp(str, "arch_perfmon")) { 608 if (!strcmp(str, "timer")) {
602 force_arch_perfmon = 1; 609 force_cpu_type = timer;
610 printk(KERN_INFO "oprofile: forcing NMI timer mode\n");
611 } else if (!strcmp(str, "arch_perfmon")) {
612 force_cpu_type = arch_perfmon;
603 printk(KERN_INFO "oprofile: forcing architectural perfmon\n"); 613 printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
614 } else {
615 force_cpu_type = 0;
604 } 616 }
605 617
606 return 0; 618 return 0;
607} 619}
608module_param_call(cpu_type, force_cpu_type, NULL, NULL, 0); 620module_param_call(cpu_type, set_cpu_type, NULL, NULL, 0);
609 621
610static int __init ppro_init(char **cpu_type) 622static int __init ppro_init(char **cpu_type)
611{ 623{
612 __u8 cpu_model = boot_cpu_data.x86_model; 624 __u8 cpu_model = boot_cpu_data.x86_model;
613 struct op_x86_model_spec *spec = &op_ppro_spec; /* default */ 625 struct op_x86_model_spec *spec = &op_ppro_spec; /* default */
614 626
615 if (force_arch_perfmon && cpu_has_arch_perfmon) 627 if (force_cpu_type == arch_perfmon && cpu_has_arch_perfmon)
616 return 0; 628 return 0;
617 629
618 /* 630 /*
@@ -679,6 +691,9 @@ int __init op_nmi_init(struct oprofile_operations *ops)
679 if (!cpu_has_apic) 691 if (!cpu_has_apic)
680 return -ENODEV; 692 return -ENODEV;
681 693
694 if (force_cpu_type == timer)
695 return -ENODEV;
696
682 switch (vendor) { 697 switch (vendor) {
683 case X86_VENDOR_AMD: 698 case X86_VENDOR_AMD:
684 /* Needs to be at least an Athlon (or hammer in 32bit mode) */ 699 /* Needs to be at least an Athlon (or hammer in 32bit mode) */
diff --git a/arch/x86/oprofile/nmi_timer_int.c b/arch/x86/oprofile/nmi_timer_int.c
deleted file mode 100644
index 7f8052cd6620..000000000000
--- a/arch/x86/oprofile/nmi_timer_int.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/**
2 * @file nmi_timer_int.c
3 *
4 * @remark Copyright 2003 OProfile authors
5 * @remark Read the file COPYING
6 *
7 * @author Zwane Mwaikambo <zwane@linuxpower.ca>
8 */
9
10#include <linux/init.h>
11#include <linux/smp.h>
12#include <linux/errno.h>
13#include <linux/oprofile.h>
14#include <linux/rcupdate.h>
15#include <linux/kdebug.h>
16
17#include <asm/nmi.h>
18#include <asm/apic.h>
19#include <asm/ptrace.h>
20
21static int profile_timer_exceptions_notify(unsigned int val, struct pt_regs *regs)
22{
23 oprofile_add_sample(regs, 0);
24 return NMI_HANDLED;
25}
26
27static int timer_start(void)
28{
29 if (register_nmi_handler(NMI_LOCAL, profile_timer_exceptions_notify,
30 0, "oprofile-timer"))
31 return 1;
32 return 0;
33}
34
35
36static void timer_stop(void)
37{
38 unregister_nmi_handler(NMI_LOCAL, "oprofile-timer");
39 synchronize_sched(); /* Allow already-started NMIs to complete. */
40}
41
42
43int __init op_nmi_timer_init(struct oprofile_operations *ops)
44{
45 ops->start = timer_start;
46 ops->stop = timer_stop;
47 ops->cpu_type = "timer";
48 printk(KERN_INFO "oprofile: using NMI timer interrupt.\n");
49 return 0;
50}
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index db0e9a51e611..da8fe0535ff4 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -44,7 +44,7 @@ static inline void set_bios_x(void)
44 pcibios_enabled = 1; 44 pcibios_enabled = 1;
45 set_memory_x(PAGE_OFFSET + BIOS_BEGIN, (BIOS_END - BIOS_BEGIN) >> PAGE_SHIFT); 45 set_memory_x(PAGE_OFFSET + BIOS_BEGIN, (BIOS_END - BIOS_BEGIN) >> PAGE_SHIFT);
46 if (__supported_pte_mask & _PAGE_NX) 46 if (__supported_pte_mask & _PAGE_NX)
47 printk(KERN_INFO "PCI : PCI BIOS aera is rw and x. Use pci=nobios if you want it NX.\n"); 47 printk(KERN_INFO "PCI : PCI BIOS area is rw and x. Use pci=nobios if you want it NX.\n");
48} 48}
49 49
50/* 50/*
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 37718f0f053d..4cf9bd0a1653 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -238,7 +238,8 @@ static efi_status_t __init phys_efi_get_time(efi_time_t *tm,
238 238
239 spin_lock_irqsave(&rtc_lock, flags); 239 spin_lock_irqsave(&rtc_lock, flags);
240 efi_call_phys_prelog(); 240 efi_call_phys_prelog();
241 status = efi_call_phys2(efi_phys.get_time, tm, tc); 241 status = efi_call_phys2(efi_phys.get_time, virt_to_phys(tm),
242 virt_to_phys(tc));
242 efi_call_phys_epilog(); 243 efi_call_phys_epilog();
243 spin_unlock_irqrestore(&rtc_lock, flags); 244 spin_unlock_irqrestore(&rtc_lock, flags);
244 return status; 245 return status;
@@ -352,8 +353,7 @@ void __init efi_memblock_x86_reserve_range(void)
352 boot_params.efi_info.efi_memdesc_size; 353 boot_params.efi_info.efi_memdesc_size;
353 memmap.desc_version = boot_params.efi_info.efi_memdesc_version; 354 memmap.desc_version = boot_params.efi_info.efi_memdesc_version;
354 memmap.desc_size = boot_params.efi_info.efi_memdesc_size; 355 memmap.desc_size = boot_params.efi_info.efi_memdesc_size;
355 memblock_x86_reserve_range(pmap, pmap + memmap.nr_map * memmap.desc_size, 356 memblock_reserve(pmap, memmap.nr_map * memmap.desc_size);
356 "EFI memmap");
357} 357}
358 358
359#if EFI_DEBUG 359#if EFI_DEBUG
@@ -397,16 +397,14 @@ void __init efi_reserve_boot_services(void)
397 if ((start+size >= virt_to_phys(_text) 397 if ((start+size >= virt_to_phys(_text)
398 && start <= virt_to_phys(_end)) || 398 && start <= virt_to_phys(_end)) ||
399 !e820_all_mapped(start, start+size, E820_RAM) || 399 !e820_all_mapped(start, start+size, E820_RAM) ||
400 memblock_x86_check_reserved_size(&start, &size, 400 memblock_is_region_reserved(start, size)) {
401 1<<EFI_PAGE_SHIFT)) {
402 /* Could not reserve, skip it */ 401 /* Could not reserve, skip it */
403 md->num_pages = 0; 402 md->num_pages = 0;
404 memblock_dbg(PFX "Could not reserve boot range " 403 memblock_dbg(PFX "Could not reserve boot range "
405 "[0x%010llx-0x%010llx]\n", 404 "[0x%010llx-0x%010llx]\n",
406 start, start+size-1); 405 start, start+size-1);
407 } else 406 } else
408 memblock_x86_reserve_range(start, start+size, 407 memblock_reserve(start, size);
409 "EFI Boot");
410 } 408 }
411} 409}
412 410
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c
index e36bf714cb77..40e446941dd7 100644
--- a/arch/x86/platform/efi/efi_32.c
+++ b/arch/x86/platform/efi/efi_32.c
@@ -39,43 +39,14 @@
39 */ 39 */
40 40
41static unsigned long efi_rt_eflags; 41static unsigned long efi_rt_eflags;
42static pgd_t efi_bak_pg_dir_pointer[2];
43 42
44void efi_call_phys_prelog(void) 43void efi_call_phys_prelog(void)
45{ 44{
46 unsigned long cr4;
47 unsigned long temp;
48 struct desc_ptr gdt_descr; 45 struct desc_ptr gdt_descr;
49 46
50 local_irq_save(efi_rt_eflags); 47 local_irq_save(efi_rt_eflags);
51 48
52 /* 49 load_cr3(initial_page_table);
53 * If I don't have PAE, I should just duplicate two entries in page
54 * directory. If I have PAE, I just need to duplicate one entry in
55 * page directory.
56 */
57 cr4 = read_cr4_safe();
58
59 if (cr4 & X86_CR4_PAE) {
60 efi_bak_pg_dir_pointer[0].pgd =
61 swapper_pg_dir[pgd_index(0)].pgd;
62 swapper_pg_dir[0].pgd =
63 swapper_pg_dir[pgd_index(PAGE_OFFSET)].pgd;
64 } else {
65 efi_bak_pg_dir_pointer[0].pgd =
66 swapper_pg_dir[pgd_index(0)].pgd;
67 efi_bak_pg_dir_pointer[1].pgd =
68 swapper_pg_dir[pgd_index(0x400000)].pgd;
69 swapper_pg_dir[pgd_index(0)].pgd =
70 swapper_pg_dir[pgd_index(PAGE_OFFSET)].pgd;
71 temp = PAGE_OFFSET + 0x400000;
72 swapper_pg_dir[pgd_index(0x400000)].pgd =
73 swapper_pg_dir[pgd_index(temp)].pgd;
74 }
75
76 /*
77 * After the lock is released, the original page table is restored.
78 */
79 __flush_tlb_all(); 50 __flush_tlb_all();
80 51
81 gdt_descr.address = __pa(get_cpu_gdt_table(0)); 52 gdt_descr.address = __pa(get_cpu_gdt_table(0));
@@ -85,28 +56,13 @@ void efi_call_phys_prelog(void)
85 56
86void efi_call_phys_epilog(void) 57void efi_call_phys_epilog(void)
87{ 58{
88 unsigned long cr4;
89 struct desc_ptr gdt_descr; 59 struct desc_ptr gdt_descr;
90 60
91 gdt_descr.address = (unsigned long)get_cpu_gdt_table(0); 61 gdt_descr.address = (unsigned long)get_cpu_gdt_table(0);
92 gdt_descr.size = GDT_SIZE - 1; 62 gdt_descr.size = GDT_SIZE - 1;
93 load_gdt(&gdt_descr); 63 load_gdt(&gdt_descr);
94 64
95 cr4 = read_cr4_safe(); 65 load_cr3(swapper_pg_dir);
96
97 if (cr4 & X86_CR4_PAE) {
98 swapper_pg_dir[pgd_index(0)].pgd =
99 efi_bak_pg_dir_pointer[0].pgd;
100 } else {
101 swapper_pg_dir[pgd_index(0)].pgd =
102 efi_bak_pg_dir_pointer[0].pgd;
103 swapper_pg_dir[pgd_index(0x400000)].pgd =
104 efi_bak_pg_dir_pointer[1].pgd;
105 }
106
107 /*
108 * After the lock is released, the original page table is restored.
109 */
110 __flush_tlb_all(); 66 __flush_tlb_all();
111 67
112 local_irq_restore(efi_rt_eflags); 68 local_irq_restore(efi_rt_eflags);
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index 541020df0da6..ad4ec1cb097e 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -76,6 +76,20 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX];
76EXPORT_SYMBOL_GPL(sfi_mrtc_array); 76EXPORT_SYMBOL_GPL(sfi_mrtc_array);
77int sfi_mrtc_num; 77int sfi_mrtc_num;
78 78
79static void mrst_power_off(void)
80{
81 if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT)
82 intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1);
83}
84
85static void mrst_reboot(void)
86{
87 if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT)
88 intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0);
89 else
90 intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0);
91}
92
79/* parse all the mtimer info to a static mtimer array */ 93/* parse all the mtimer info to a static mtimer array */
80static int __init sfi_parse_mtmr(struct sfi_table_header *table) 94static int __init sfi_parse_mtmr(struct sfi_table_header *table)
81{ 95{
@@ -187,11 +201,34 @@ int __init sfi_parse_mrtc(struct sfi_table_header *table)
187static unsigned long __init mrst_calibrate_tsc(void) 201static unsigned long __init mrst_calibrate_tsc(void)
188{ 202{
189 unsigned long flags, fast_calibrate; 203 unsigned long flags, fast_calibrate;
190 204 if (__mrst_cpu_chip == MRST_CPU_CHIP_PENWELL) {
191 local_irq_save(flags); 205 u32 lo, hi, ratio, fsb;
192 fast_calibrate = apbt_quick_calibrate(); 206
193 local_irq_restore(flags); 207 rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
194 208 pr_debug("IA32 perf status is 0x%x, 0x%0x\n", lo, hi);
209 ratio = (hi >> 8) & 0x1f;
210 pr_debug("ratio is %d\n", ratio);
211 if (!ratio) {
212 pr_err("read a zero ratio, should be incorrect!\n");
213 pr_err("force tsc ratio to 16 ...\n");
214 ratio = 16;
215 }
216 rdmsr(MSR_FSB_FREQ, lo, hi);
217 if ((lo & 0x7) == 0x7)
218 fsb = PENWELL_FSB_FREQ_83SKU;
219 else
220 fsb = PENWELL_FSB_FREQ_100SKU;
221 fast_calibrate = ratio * fsb;
222 pr_debug("read penwell tsc %lu khz\n", fast_calibrate);
223 lapic_timer_frequency = fsb * 1000 / HZ;
224 /* mark tsc clocksource as reliable */
225 set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE);
226 } else {
227 local_irq_save(flags);
228 fast_calibrate = apbt_quick_calibrate();
229 local_irq_restore(flags);
230 }
231
195 if (fast_calibrate) 232 if (fast_calibrate)
196 return fast_calibrate; 233 return fast_calibrate;
197 234
@@ -242,15 +279,15 @@ static int mrst_i8042_detect(void)
242 return 0; 279 return 0;
243} 280}
244 281
245/* Reboot and power off are handled by the SCU on a MID device */ 282/*
246static void mrst_power_off(void) 283 * Moorestown does not have external NMI source nor port 0x61 to report
247{ 284 * NMI status. The possible NMI sources are from pmu as a result of NMI
248 intel_scu_ipc_simple_command(0xf1, 1); 285 * watchdog or lock debug. Reading io port 0x61 results in 0xff which
249} 286 * misled NMI handler.
250 287 */
251static void mrst_reboot(void) 288static unsigned char mrst_get_nmi_reason(void)
252{ 289{
253 intel_scu_ipc_simple_command(0xf1, 0); 290 return 0;
254} 291}
255 292
256/* 293/*
@@ -274,6 +311,8 @@ void __init x86_mrst_early_setup(void)
274 x86_platform.calibrate_tsc = mrst_calibrate_tsc; 311 x86_platform.calibrate_tsc = mrst_calibrate_tsc;
275 x86_platform.i8042_detect = mrst_i8042_detect; 312 x86_platform.i8042_detect = mrst_i8042_detect;
276 x86_init.timers.wallclock_init = mrst_rtc_init; 313 x86_init.timers.wallclock_init = mrst_rtc_init;
314 x86_platform.get_nmi_reason = mrst_get_nmi_reason;
315
277 x86_init.pci.init = pci_mrst_init; 316 x86_init.pci.init = pci_mrst_init;
278 x86_init.pci.fixup_irqs = x86_init_noop; 317 x86_init.pci.fixup_irqs = x86_init_noop;
279 318
@@ -448,6 +487,46 @@ static void __init *max7315_platform_data(void *info)
448 return max7315; 487 return max7315;
449} 488}
450 489
490static void *tca6416_platform_data(void *info)
491{
492 static struct pca953x_platform_data tca6416;
493 struct i2c_board_info *i2c_info = info;
494 int gpio_base, intr;
495 char base_pin_name[SFI_NAME_LEN + 1];
496 char intr_pin_name[SFI_NAME_LEN + 1];
497
498 strcpy(i2c_info->type, "tca6416");
499 strcpy(base_pin_name, "tca6416_base");
500 strcpy(intr_pin_name, "tca6416_int");
501
502 gpio_base = get_gpio_by_name(base_pin_name);
503 intr = get_gpio_by_name(intr_pin_name);
504
505 if (gpio_base == -1)
506 return NULL;
507 tca6416.gpio_base = gpio_base;
508 if (intr != -1) {
509 i2c_info->irq = intr + MRST_IRQ_OFFSET;
510 tca6416.irq_base = gpio_base + MRST_IRQ_OFFSET;
511 } else {
512 i2c_info->irq = -1;
513 tca6416.irq_base = -1;
514 }
515 return &tca6416;
516}
517
518static void *mpu3050_platform_data(void *info)
519{
520 struct i2c_board_info *i2c_info = info;
521 int intr = get_gpio_by_name("mpu3050_int");
522
523 if (intr == -1)
524 return NULL;
525
526 i2c_info->irq = intr + MRST_IRQ_OFFSET;
527 return NULL;
528}
529
451static void __init *emc1403_platform_data(void *info) 530static void __init *emc1403_platform_data(void *info)
452{ 531{
453 static short intr2nd_pdata; 532 static short intr2nd_pdata;
@@ -610,12 +689,15 @@ static void *msic_ocd_platform_data(void *info)
610static const struct devs_id __initconst device_ids[] = { 689static const struct devs_id __initconst device_ids[] = {
611 {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, 690 {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data},
612 {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, 691 {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data},
692 {"pmic_gpio", SFI_DEV_TYPE_IPC, 1, &pmic_gpio_platform_data},
613 {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, 693 {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data},
614 {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, 694 {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
615 {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, 695 {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
696 {"tca6416", SFI_DEV_TYPE_I2C, 1, &tca6416_platform_data},
616 {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, 697 {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data},
617 {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, 698 {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data},
618 {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, 699 {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data},
700 {"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data},
619 701
620 /* MSIC subdevices */ 702 /* MSIC subdevices */
621 {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, 703 {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data},
diff --git a/arch/x86/platform/uv/uv_sysfs.c b/arch/x86/platform/uv/uv_sysfs.c
index 309c70fb7759..5d4ba301e776 100644
--- a/arch/x86/platform/uv/uv_sysfs.c
+++ b/arch/x86/platform/uv/uv_sysfs.c
@@ -19,7 +19,7 @@
19 * Copyright (c) Russ Anderson 19 * Copyright (c) Russ Anderson
20 */ 20 */
21 21
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <asm/uv/bios.h> 23#include <asm/uv/bios.h>
24#include <asm/uv/uv.h> 24#include <asm/uv/uv.h>
25 25
diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
index f82082677337..d511aa97533a 100644
--- a/arch/x86/tools/Makefile
+++ b/arch/x86/tools/Makefile
@@ -18,14 +18,21 @@ chkobjdump = $(srctree)/arch/x86/tools/chkobjdump.awk
18quiet_cmd_posttest = TEST $@ 18quiet_cmd_posttest = TEST $@
19 cmd_posttest = ($(OBJDUMP) -v | $(AWK) -f $(chkobjdump)) || $(OBJDUMP) -d -j .text $(objtree)/vmlinux | $(AWK) -f $(distill_awk) | $(obj)/test_get_len $(posttest_64bit) $(posttest_verbose) 19 cmd_posttest = ($(OBJDUMP) -v | $(AWK) -f $(chkobjdump)) || $(OBJDUMP) -d -j .text $(objtree)/vmlinux | $(AWK) -f $(distill_awk) | $(obj)/test_get_len $(posttest_64bit) $(posttest_verbose)
20 20
21posttest: $(obj)/test_get_len vmlinux 21quiet_cmd_sanitytest = TEST $@
22 cmd_sanitytest = $(obj)/insn_sanity $(posttest_64bit) -m 1000000
23
24posttest: $(obj)/test_get_len vmlinux $(obj)/insn_sanity
22 $(call cmd,posttest) 25 $(call cmd,posttest)
26 $(call cmd,sanitytest)
23 27
24hostprogs-y := test_get_len 28hostprogs-y += test_get_len insn_sanity
25 29
26# -I needed for generated C source and C source which in the kernel tree. 30# -I needed for generated C source and C source which in the kernel tree.
27HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/ 31HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
28 32
33HOSTCFLAGS_insn_sanity.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
34
29# Dependencies are also needed. 35# Dependencies are also needed.
30$(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c 36$(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
31 37
38$(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index eaf11f52fc0b..5f6a5b6c3a15 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -47,7 +47,7 @@ BEGIN {
47 sep_expr = "^\\|$" 47 sep_expr = "^\\|$"
48 group_expr = "^Grp[0-9A-Za-z]+" 48 group_expr = "^Grp[0-9A-Za-z]+"
49 49
50 imm_expr = "^[IJAO][a-z]" 50 imm_expr = "^[IJAOL][a-z]"
51 imm_flag["Ib"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)" 51 imm_flag["Ib"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)"
52 imm_flag["Jb"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)" 52 imm_flag["Jb"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)"
53 imm_flag["Iw"] = "INAT_MAKE_IMM(INAT_IMM_WORD)" 53 imm_flag["Iw"] = "INAT_MAKE_IMM(INAT_IMM_WORD)"
@@ -59,6 +59,7 @@ BEGIN {
59 imm_flag["Iv"] = "INAT_MAKE_IMM(INAT_IMM_VWORD)" 59 imm_flag["Iv"] = "INAT_MAKE_IMM(INAT_IMM_VWORD)"
60 imm_flag["Ob"] = "INAT_MOFFSET" 60 imm_flag["Ob"] = "INAT_MOFFSET"
61 imm_flag["Ov"] = "INAT_MOFFSET" 61 imm_flag["Ov"] = "INAT_MOFFSET"
62 imm_flag["Lx"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)"
62 63
63 modrm_expr = "^([CDEGMNPQRSUVW/][a-z]+|NTA|T[012])" 64 modrm_expr = "^([CDEGMNPQRSUVW/][a-z]+|NTA|T[012])"
64 force64_expr = "\\([df]64\\)" 65 force64_expr = "\\([df]64\\)"
@@ -70,8 +71,12 @@ BEGIN {
70 lprefix3_expr = "\\(F2\\)" 71 lprefix3_expr = "\\(F2\\)"
71 max_lprefix = 4 72 max_lprefix = 4
72 73
73 vexok_expr = "\\(VEX\\)" 74 # All opcodes starting with lower-case 'v' or with (v1) superscript
74 vexonly_expr = "\\(oVEX\\)" 75 # accepts VEX prefix
76 vexok_opcode_expr = "^v.*"
77 vexok_expr = "\\(v1\\)"
78 # All opcodes with (v) superscript supports *only* VEX prefix
79 vexonly_expr = "\\(v\\)"
75 80
76 prefix_expr = "\\(Prefix\\)" 81 prefix_expr = "\\(Prefix\\)"
77 prefix_num["Operand-Size"] = "INAT_PFX_OPNDSZ" 82 prefix_num["Operand-Size"] = "INAT_PFX_OPNDSZ"
@@ -85,8 +90,8 @@ BEGIN {
85 prefix_num["SEG=GS"] = "INAT_PFX_GS" 90 prefix_num["SEG=GS"] = "INAT_PFX_GS"
86 prefix_num["SEG=SS"] = "INAT_PFX_SS" 91 prefix_num["SEG=SS"] = "INAT_PFX_SS"
87 prefix_num["Address-Size"] = "INAT_PFX_ADDRSZ" 92 prefix_num["Address-Size"] = "INAT_PFX_ADDRSZ"
88 prefix_num["2bytes-VEX"] = "INAT_PFX_VEX2" 93 prefix_num["VEX+1byte"] = "INAT_PFX_VEX2"
89 prefix_num["3bytes-VEX"] = "INAT_PFX_VEX3" 94 prefix_num["VEX+2byte"] = "INAT_PFX_VEX3"
90 95
91 clear_vars() 96 clear_vars()
92} 97}
@@ -310,12 +315,10 @@ function convert_operands(count,opnd, i,j,imm,mod)
310 if (match(opcode, fpu_expr)) 315 if (match(opcode, fpu_expr))
311 flags = add_flags(flags, "INAT_MODRM") 316 flags = add_flags(flags, "INAT_MODRM")
312 317
313 # check VEX only code 318 # check VEX codes
314 if (match(ext, vexonly_expr)) 319 if (match(ext, vexonly_expr))
315 flags = add_flags(flags, "INAT_VEXOK | INAT_VEXONLY") 320 flags = add_flags(flags, "INAT_VEXOK | INAT_VEXONLY")
316 321 else if (match(ext, vexok_expr) || match(opcode, vexok_opcode_expr))
317 # check VEX only code
318 if (match(ext, vexok_expr))
319 flags = add_flags(flags, "INAT_VEXOK") 322 flags = add_flags(flags, "INAT_VEXOK")
320 323
321 # check prefixes 324 # check prefixes
diff --git a/arch/x86/tools/insn_sanity.c b/arch/x86/tools/insn_sanity.c
new file mode 100644
index 000000000000..cc2f8c131286
--- /dev/null
+++ b/arch/x86/tools/insn_sanity.c
@@ -0,0 +1,275 @@
1/*
2 * x86 decoder sanity test - based on test_get_insn.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright (C) IBM Corporation, 2009
19 * Copyright (C) Hitachi, Ltd., 2011
20 */
21
22#include <stdlib.h>
23#include <stdio.h>
24#include <string.h>
25#include <assert.h>
26#include <unistd.h>
27#include <sys/types.h>
28#include <sys/stat.h>
29#include <fcntl.h>
30
31#define unlikely(cond) (cond)
32#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
33
34#include <asm/insn.h>
35#include <inat.c>
36#include <insn.c>
37
38/*
39 * Test of instruction analysis against tampering.
40 * Feed random binary to instruction decoder and ensure not to
41 * access out-of-instruction-buffer.
42 */
43
44#define DEFAULT_MAX_ITER 10000
45#define INSN_NOP 0x90
46
47static const char *prog; /* Program name */
48static int verbose; /* Verbosity */
49static int x86_64; /* x86-64 bit mode flag */
50static unsigned int seed; /* Random seed */
51static unsigned long iter_start; /* Start of iteration number */
52static unsigned long iter_end = DEFAULT_MAX_ITER; /* End of iteration number */
53static FILE *input_file; /* Input file name */
54
55static void usage(const char *err)
56{
57 if (err)
58 fprintf(stderr, "Error: %s\n\n", err);
59 fprintf(stderr, "Usage: %s [-y|-n|-v] [-s seed[,no]] [-m max] [-i input]\n", prog);
60 fprintf(stderr, "\t-y 64bit mode\n");
61 fprintf(stderr, "\t-n 32bit mode\n");
62 fprintf(stderr, "\t-v Verbosity(-vv dumps any decoded result)\n");
63 fprintf(stderr, "\t-s Give a random seed (and iteration number)\n");
64 fprintf(stderr, "\t-m Give a maximum iteration number\n");
65 fprintf(stderr, "\t-i Give an input file with decoded binary\n");
66 exit(1);
67}
68
69static void dump_field(FILE *fp, const char *name, const char *indent,
70 struct insn_field *field)
71{
72 fprintf(fp, "%s.%s = {\n", indent, name);
73 fprintf(fp, "%s\t.value = %d, bytes[] = {%x, %x, %x, %x},\n",
74 indent, field->value, field->bytes[0], field->bytes[1],
75 field->bytes[2], field->bytes[3]);
76 fprintf(fp, "%s\t.got = %d, .nbytes = %d},\n", indent,
77 field->got, field->nbytes);
78}
79
80static void dump_insn(FILE *fp, struct insn *insn)
81{
82 fprintf(fp, "Instruction = {\n");
83 dump_field(fp, "prefixes", "\t", &insn->prefixes);
84 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix);
85 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix);
86 dump_field(fp, "opcode", "\t", &insn->opcode);
87 dump_field(fp, "modrm", "\t", &insn->modrm);
88 dump_field(fp, "sib", "\t", &insn->sib);
89 dump_field(fp, "displacement", "\t", &insn->displacement);
90 dump_field(fp, "immediate1", "\t", &insn->immediate1);
91 dump_field(fp, "immediate2", "\t", &insn->immediate2);
92 fprintf(fp, "\t.attr = %x, .opnd_bytes = %d, .addr_bytes = %d,\n",
93 insn->attr, insn->opnd_bytes, insn->addr_bytes);
94 fprintf(fp, "\t.length = %d, .x86_64 = %d, .kaddr = %p}\n",
95 insn->length, insn->x86_64, insn->kaddr);
96}
97
98static void dump_stream(FILE *fp, const char *msg, unsigned long nr_iter,
99 unsigned char *insn_buf, struct insn *insn)
100{
101 int i;
102
103 fprintf(fp, "%s:\n", msg);
104
105 dump_insn(fp, insn);
106
107 fprintf(fp, "You can reproduce this with below command(s);\n");
108
109 /* Input a decoded instruction sequence directly */
110 fprintf(fp, " $ echo ");
111 for (i = 0; i < MAX_INSN_SIZE; i++)
112 fprintf(fp, " %02x", insn_buf[i]);
113 fprintf(fp, " | %s -i -\n", prog);
114
115 if (!input_file) {
116 fprintf(fp, "Or \n");
117 /* Give a seed and iteration number */
118 fprintf(fp, " $ %s -s 0x%x,%lu\n", prog, seed, nr_iter);
119 }
120}
121
122static void init_random_seed(void)
123{
124 int fd;
125
126 fd = open("/dev/urandom", O_RDONLY);
127 if (fd < 0)
128 goto fail;
129
130 if (read(fd, &seed, sizeof(seed)) != sizeof(seed))
131 goto fail;
132
133 close(fd);
134 return;
135fail:
136 usage("Failed to open /dev/urandom");
137}
138
139/* Read given instruction sequence from the input file */
140static int read_next_insn(unsigned char *insn_buf)
141{
142 char buf[256] = "", *tmp;
143 int i;
144
145 tmp = fgets(buf, ARRAY_SIZE(buf), input_file);
146 if (tmp == NULL || feof(input_file))
147 return 0;
148
149 for (i = 0; i < MAX_INSN_SIZE; i++) {
150 insn_buf[i] = (unsigned char)strtoul(tmp, &tmp, 16);
151 if (*tmp != ' ')
152 break;
153 }
154
155 return i;
156}
157
158static int generate_insn(unsigned char *insn_buf)
159{
160 int i;
161
162 if (input_file)
163 return read_next_insn(insn_buf);
164
165 /* Fills buffer with random binary up to MAX_INSN_SIZE */
166 for (i = 0; i < MAX_INSN_SIZE - 1; i += 2)
167 *(unsigned short *)(&insn_buf[i]) = random() & 0xffff;
168
169 while (i < MAX_INSN_SIZE)
170 insn_buf[i++] = random() & 0xff;
171
172 return i;
173}
174
175static void parse_args(int argc, char **argv)
176{
177 int c;
178 char *tmp = NULL;
179 int set_seed = 0;
180
181 prog = argv[0];
182 while ((c = getopt(argc, argv, "ynvs:m:i:")) != -1) {
183 switch (c) {
184 case 'y':
185 x86_64 = 1;
186 break;
187 case 'n':
188 x86_64 = 0;
189 break;
190 case 'v':
191 verbose++;
192 break;
193 case 'i':
194 if (strcmp("-", optarg) == 0)
195 input_file = stdin;
196 else
197 input_file = fopen(optarg, "r");
198 if (!input_file)
199 usage("Failed to open input file");
200 break;
201 case 's':
202 seed = (unsigned int)strtoul(optarg, &tmp, 0);
203 if (*tmp == ',') {
204 optarg = tmp + 1;
205 iter_start = strtoul(optarg, &tmp, 0);
206 }
207 if (*tmp != '\0' || tmp == optarg)
208 usage("Failed to parse seed");
209 set_seed = 1;
210 break;
211 case 'm':
212 iter_end = strtoul(optarg, &tmp, 0);
213 if (*tmp != '\0' || tmp == optarg)
214 usage("Failed to parse max_iter");
215 break;
216 default:
217 usage(NULL);
218 }
219 }
220
221 /* Check errors */
222 if (iter_end < iter_start)
223 usage("Max iteration number must be bigger than iter-num");
224
225 if (set_seed && input_file)
226 usage("Don't use input file (-i) with random seed (-s)");
227
228 /* Initialize random seed */
229 if (!input_file) {
230 if (!set_seed) /* No seed is given */
231 init_random_seed();
232 srand(seed);
233 }
234}
235
236int main(int argc, char **argv)
237{
238 struct insn insn;
239 int insns = 0;
240 int errors = 0;
241 unsigned long i;
242 unsigned char insn_buf[MAX_INSN_SIZE * 2];
243
244 parse_args(argc, argv);
245
246 /* Prepare stop bytes with NOPs */
247 memset(insn_buf + MAX_INSN_SIZE, INSN_NOP, MAX_INSN_SIZE);
248
249 for (i = 0; i < iter_end; i++) {
250 if (generate_insn(insn_buf) <= 0)
251 break;
252
253 if (i < iter_start) /* Skip to given iteration number */
254 continue;
255
256 /* Decode an instruction */
257 insn_init(&insn, insn_buf, x86_64);
258 insn_get_length(&insn);
259
260 if (insn.next_byte <= insn.kaddr ||
261 insn.kaddr + MAX_INSN_SIZE < insn.next_byte) {
262 /* Access out-of-range memory */
263 dump_stream(stderr, "Error: Found an access violation", i, insn_buf, &insn);
264 errors++;
265 } else if (verbose && !insn_complete(&insn))
266 dump_stream(stdout, "Info: Found an undecodable input", i, insn_buf, &insn);
267 else if (verbose >= 2)
268 dump_insn(stdout, &insn);
269 insns++;
270 }
271
272 fprintf(stdout, "%s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n", (errors) ? "Failure" : "Success", insns, (input_file) ? "given" : "random", errors, seed);
273
274 return errors ? 1 : 0;
275}
diff --git a/arch/x86/um/asm/processor.h b/arch/x86/um/asm/processor.h
index 118c143a9cb4..2c32df6fe231 100644
--- a/arch/x86/um/asm/processor.h
+++ b/arch/x86/um/asm/processor.h
@@ -11,7 +11,7 @@
11#endif 11#endif
12 12
13#define KSTK_EIP(tsk) KSTK_REG(tsk, HOST_IP) 13#define KSTK_EIP(tsk) KSTK_REG(tsk, HOST_IP)
14#define KSTK_ESP(tsk) KSTK_REG(tsk, HOST_IP) 14#define KSTK_ESP(tsk) KSTK_REG(tsk, HOST_SP)
15#define KSTK_EBP(tsk) KSTK_REG(tsk, HOST_BP) 15#define KSTK_EBP(tsk) KSTK_REG(tsk, HOST_BP)
16 16
17#define ARCH_IS_STACKGROW(address) \ 17#define ARCH_IS_STACKGROW(address) \
diff --git a/arch/x86/xen/debugfs.c b/arch/x86/xen/debugfs.c
index 7c0fedd98ea0..ef1db1900d86 100644
--- a/arch/x86/xen/debugfs.c
+++ b/arch/x86/xen/debugfs.c
@@ -109,7 +109,7 @@ static const struct file_operations u32_array_fops = {
109 .llseek = no_llseek, 109 .llseek = no_llseek,
110}; 110};
111 111
112struct dentry *xen_debugfs_create_u32_array(const char *name, mode_t mode, 112struct dentry *xen_debugfs_create_u32_array(const char *name, umode_t mode,
113 struct dentry *parent, 113 struct dentry *parent,
114 u32 *array, unsigned elements) 114 u32 *array, unsigned elements)
115{ 115{
diff --git a/arch/x86/xen/debugfs.h b/arch/x86/xen/debugfs.h
index e28132084832..78d25499be5b 100644
--- a/arch/x86/xen/debugfs.h
+++ b/arch/x86/xen/debugfs.h
@@ -3,7 +3,7 @@
3 3
4struct dentry * __init xen_init_debugfs(void); 4struct dentry * __init xen_init_debugfs(void);
5 5
6struct dentry *xen_debugfs_create_u32_array(const char *name, mode_t mode, 6struct dentry *xen_debugfs_create_u32_array(const char *name, umode_t mode,
7 struct dentry *parent, 7 struct dentry *parent,
8 u32 *array, unsigned elements); 8 u32 *array, unsigned elements);
9 9
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index da8afd576a6b..12eb07bfb267 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1215,8 +1215,6 @@ asmlinkage void __init xen_start_kernel(void)
1215 local_irq_disable(); 1215 local_irq_disable();
1216 early_boot_irqs_disabled = true; 1216 early_boot_irqs_disabled = true;
1217 1217
1218 memblock_init();
1219
1220 xen_raw_console_write("mapping kernel into physical memory\n"); 1218 xen_raw_console_write("mapping kernel into physical memory\n");
1221 pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages); 1219 pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages);
1222 xen_ident_map_ISA(); 1220 xen_ident_map_ISA();
@@ -1356,7 +1354,7 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
1356 int cpu = (long)hcpu; 1354 int cpu = (long)hcpu;
1357 switch (action) { 1355 switch (action) {
1358 case CPU_UP_PREPARE: 1356 case CPU_UP_PREPARE:
1359 per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; 1357 xen_vcpu_setup(cpu);
1360 if (xen_have_vector_callback) 1358 if (xen_have_vector_callback)
1361 xen_init_lock_cpu(cpu); 1359 xen_init_lock_cpu(cpu);
1362 break; 1360 break;
@@ -1386,7 +1384,6 @@ static void __init xen_hvm_guest_init(void)
1386 xen_hvm_smp_init(); 1384 xen_hvm_smp_init();
1387 register_cpu_notifier(&xen_hvm_cpu_notifier); 1385 register_cpu_notifier(&xen_hvm_cpu_notifier);
1388 xen_unplug_emulated_devices(); 1386 xen_unplug_emulated_devices();
1389 have_vcpu_info_placement = 0;
1390 x86_init.irqs.intr_init = xen_init_IRQ; 1387 x86_init.irqs.intr_init = xen_init_IRQ;
1391 xen_hvm_init_time_ops(); 1388 xen_hvm_init_time_ops();
1392 xen_hvm_init_mmu_ops(); 1389 xen_hvm_init_mmu_ops();
diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c
index 6bbfd7ac5e81..5a40d24ba331 100644
--- a/arch/x86/xen/grant-table.c
+++ b/arch/x86/xen/grant-table.c
@@ -71,7 +71,7 @@ int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes,
71 71
72 if (shared == NULL) { 72 if (shared == NULL) {
73 struct vm_struct *area = 73 struct vm_struct *area =
74 alloc_vm_area(PAGE_SIZE * max_nr_gframes); 74 alloc_vm_area(PAGE_SIZE * max_nr_gframes, NULL);
75 BUG_ON(area == NULL); 75 BUG_ON(area == NULL);
76 shared = area->addr; 76 shared = area->addr;
77 *__shared = shared; 77 *__shared = shared;
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 87f6673b1207..f4bf8aa574f4 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1774,10 +1774,8 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
1774 __xen_write_cr3(true, __pa(pgd)); 1774 __xen_write_cr3(true, __pa(pgd));
1775 xen_mc_issue(PARAVIRT_LAZY_CPU); 1775 xen_mc_issue(PARAVIRT_LAZY_CPU);
1776 1776
1777 memblock_x86_reserve_range(__pa(xen_start_info->pt_base), 1777 memblock_reserve(__pa(xen_start_info->pt_base),
1778 __pa(xen_start_info->pt_base + 1778 xen_start_info->nr_pt_frames * PAGE_SIZE);
1779 xen_start_info->nr_pt_frames * PAGE_SIZE),
1780 "XEN PAGETABLES");
1781 1779
1782 return pgd; 1780 return pgd;
1783} 1781}
@@ -1853,10 +1851,8 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
1853 PFN_DOWN(__pa(initial_page_table))); 1851 PFN_DOWN(__pa(initial_page_table)));
1854 xen_write_cr3(__pa(initial_page_table)); 1852 xen_write_cr3(__pa(initial_page_table));
1855 1853
1856 memblock_x86_reserve_range(__pa(xen_start_info->pt_base), 1854 memblock_reserve(__pa(xen_start_info->pt_base),
1857 __pa(xen_start_info->pt_base + 1855 xen_start_info->nr_pt_frames * PAGE_SIZE));
1858 xen_start_info->nr_pt_frames * PAGE_SIZE),
1859 "XEN PAGETABLES");
1860 1856
1861 return initial_page_table; 1857 return initial_page_table;
1862} 1858}
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 38d0af4fefec..e03c63692176 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -75,7 +75,7 @@ static void __init xen_add_extra_mem(u64 start, u64 size)
75 if (i == XEN_EXTRA_MEM_MAX_REGIONS) 75 if (i == XEN_EXTRA_MEM_MAX_REGIONS)
76 printk(KERN_WARNING "Warning: not enough extra memory regions\n"); 76 printk(KERN_WARNING "Warning: not enough extra memory regions\n");
77 77
78 memblock_x86_reserve_range(start, start + size, "XEN EXTRA"); 78 memblock_reserve(start, size);
79 79
80 xen_max_p2m_pfn = PFN_DOWN(start + size); 80 xen_max_p2m_pfn = PFN_DOWN(start + size);
81 81
@@ -173,9 +173,21 @@ static unsigned long __init xen_get_max_pages(void)
173 domid_t domid = DOMID_SELF; 173 domid_t domid = DOMID_SELF;
174 int ret; 174 int ret;
175 175
176 ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); 176 /*
177 if (ret > 0) 177 * For the initial domain we use the maximum reservation as
178 max_pages = ret; 178 * the maximum page.
179 *
180 * For guest domains the current maximum reservation reflects
181 * the current maximum rather than the static maximum. In this
182 * case the e820 map provided to us will cover the static
183 * maximum region.
184 */
185 if (xen_initial_domain()) {
186 ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
187 if (ret > 0)
188 max_pages = ret;
189 }
190
179 return min(max_pages, MAX_DOMAIN_PAGES); 191 return min(max_pages, MAX_DOMAIN_PAGES);
180} 192}
181 193
@@ -299,9 +311,8 @@ char * __init xen_memory_setup(void)
299 * - xen_start_info 311 * - xen_start_info
300 * See comment above "struct start_info" in <xen/interface/xen.h> 312 * See comment above "struct start_info" in <xen/interface/xen.h>
301 */ 313 */
302 memblock_x86_reserve_range(__pa(xen_start_info->mfn_list), 314 memblock_reserve(__pa(xen_start_info->mfn_list),
303 __pa(xen_start_info->pt_base), 315 xen_start_info->pt_base - xen_start_info->mfn_list);
304 "XEN START INFO");
305 316
306 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); 317 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
307 318
@@ -410,6 +421,6 @@ void __init xen_arch_setup(void)
410#endif 421#endif
411 disable_cpuidle(); 422 disable_cpuidle();
412 boot_option_idle_override = IDLE_HALT; 423 boot_option_idle_override = IDLE_HALT;
413 424 WARN_ON(set_pm_idle_to_default());
414 fiddle_vdso(); 425 fiddle_vdso();
415} 426}
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
index cbdf2ffaacff..bb06968be227 100644
--- a/arch/xtensa/include/asm/socket.h
+++ b/arch/xtensa/include/asm/socket.h
@@ -73,4 +73,7 @@
73 73
74#define SO_RXQ_OVFL 40 74#define SO_RXQ_OVFL 40
75 75
76#define SO_WIFI_STATUS 41
77#define SCM_WIFI_STATUS SO_WIFI_STATUS
78
76#endif /* _XTENSA_SOCKET_H */ 79#endif /* _XTENSA_SOCKET_H */
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
index 7be8accb0b0c..6abbedd09d85 100644
--- a/arch/xtensa/include/asm/thread_info.h
+++ b/arch/xtensa/include/asm/thread_info.h
@@ -132,7 +132,6 @@ static inline struct thread_info *current_thread_info(void)
132#define TIF_MEMDIE 5 /* is terminating due to OOM killer */ 132#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
133#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ 133#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
134#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 134#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
135#define TIF_FREEZE 17 /* is freezing for suspend */
136 135
137#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 136#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
138#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 137#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
@@ -141,7 +140,6 @@ static inline struct thread_info *current_thread_info(void)
141#define _TIF_IRET (1<<TIF_IRET) 140#define _TIF_IRET (1<<TIF_IRET)
142#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 141#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
143#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 142#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
144#define _TIF_FREEZE (1<<TIF_FREEZE)
145 143
146#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 144#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
147#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 145#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
diff --git a/arch/xtensa/include/asm/types.h b/arch/xtensa/include/asm/types.h
index b1c981e39b52..6d4db7e8ffac 100644
--- a/arch/xtensa/include/asm/types.h
+++ b/arch/xtensa/include/asm/types.h
@@ -23,8 +23,6 @@
23 23
24#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
25 25
26typedef unsigned short umode_t;
27
28/* 26/*
29 * These aren't exported outside the kernel to avoid name space clashes 27 * These aren't exported outside the kernel to avoid name space clashes
30 */ 28 */
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index f3e5eb43f71c..ac62f9cf1e10 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -41,14 +41,6 @@ static struct clocksource ccount_clocksource = {
41 .rating = 200, 41 .rating = 200,
42 .read = ccount_read, 42 .read = ccount_read,
43 .mask = CLOCKSOURCE_MASK(32), 43 .mask = CLOCKSOURCE_MASK(32),
44 /*
45 * With a shift of 22 the lower limit of the cpu clock is
46 * 1MHz, where NSEC_PER_CCOUNT is 1000 or a bit less than
47 * 2^10: Since we have 32 bits and the multiplicator can
48 * already take up as much as 10 bits, this leaves us with
49 * remaining upper 22 bits.
50 */
51 .shift = 22,
52}; 44};
53 45
54static irqreturn_t timer_interrupt(int irq, void *dev_id); 46static irqreturn_t timer_interrupt(int irq, void *dev_id);
@@ -66,10 +58,7 @@ void __init time_init(void)
66 printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ), 58 printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ),
67 (int)(ccount_per_jiffy/(10000/HZ))%100); 59 (int)(ccount_per_jiffy/(10000/HZ))%100);
68#endif 60#endif
69 ccount_clocksource.mult = 61 clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ);
70 clocksource_hz2mult(CCOUNT_PER_JIFFY * HZ,
71 ccount_clocksource.shift);
72 clocksource_register(&ccount_clocksource);
73 62
74 /* Initialize the linux timer interrupt. */ 63 /* Initialize the linux timer interrupt. */
75 64