aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/Kconfig77
-rw-r--r--arch/alpha/include/asm/machvec.h22
-rw-r--r--arch/alpha/include/asm/pal.h71
-rw-r--r--arch/alpha/include/asm/rtc.h11
-rw-r--r--arch/alpha/include/asm/string.h24
-rw-r--r--arch/alpha/include/asm/thread_info.h2
-rw-r--r--arch/alpha/include/uapi/asm/pal.h1
-rw-r--r--arch/alpha/kernel/Makefile1
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c1
-rw-r--r--arch/alpha/kernel/irq_alpha.c16
-rw-r--r--arch/alpha/kernel/machvec_impl.h5
-rw-r--r--arch/alpha/kernel/perf_event.c15
-rw-r--r--arch/alpha/kernel/process.c17
-rw-r--r--arch/alpha/kernel/proto.h6
-rw-r--r--arch/alpha/kernel/rtc.c323
-rw-r--r--arch/alpha/kernel/setup.c23
-rw-r--r--arch/alpha/kernel/smp.c33
-rw-r--r--arch/alpha/kernel/sys_jensen.c2
-rw-r--r--arch/alpha/kernel/sys_marvel.c55
-rw-r--r--arch/alpha/kernel/time.c405
-rw-r--r--arch/alpha/kernel/traps.c15
-rw-r--r--arch/alpha/lib/csum_partial_copy.c10
-rw-r--r--arch/alpha/lib/ev6-memset.S12
-rw-r--r--arch/alpha/lib/memset.S11
-rw-r--r--arch/arc/Kconfig1
-rw-r--r--arch/arc/boot/dts/abilis_tb100.dtsi172
-rw-r--r--arch/arc/boot/dts/abilis_tb100_dvk.dts24
-rw-r--r--arch/arc/boot/dts/abilis_tb101.dtsi178
-rw-r--r--arch/arc/boot/dts/abilis_tb101_dvk.dts24
-rw-r--r--arch/arc/boot/dts/abilis_tb10x.dtsi3
-rw-r--r--arch/arc/boot/dts/angel4.dts4
-rw-r--r--arch/arc/configs/fpga_noramfs_defconfig64
-rw-r--r--arch/arc/include/asm/perf_event.h204
-rw-r--r--arch/arc/include/asm/thread_info.h2
-rw-r--r--arch/arc/include/uapi/asm/unistd.h5
-rw-r--r--arch/arc/kernel/Makefile1
-rw-r--r--arch/arc/kernel/kprobes.c2
-rw-r--r--arch/arc/kernel/perf_event.c326
-rw-r--r--arch/arc/plat-tb10x/Kconfig2
-rw-r--r--arch/arm/Kconfig12
-rw-r--r--arch/arm/boot/dts/am335x-base0033.dts79
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts2
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts10
-rw-r--r--arch/arm/boot/dts/am335x-igep0033.dtsi29
-rw-r--r--arch/arm/boot/dts/am3517-evm.dts6
-rw-r--r--arch/arm/boot/dts/am3517.dtsi63
-rw-r--r--arch/arm/boot/dts/armada-370-db.dts28
-rw-r--r--arch/arm/boot/dts/armada-370-xp.dtsi2
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78230.dtsi24
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78260.dtsi109
-rw-r--r--arch/arm/boot/dts/at91sam9x5_usart3.dtsi4
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi4
-rw-r--r--arch/arm/boot/dts/cros5250-common.dtsi12
-rw-r--r--arch/arm/boot/dts/ecx-2000.dts6
-rw-r--r--arch/arm/boot/dts/ecx-common.dtsi6
-rw-r--r--arch/arm/boot/dts/highbank.dts6
-rw-r--r--arch/arm/boot/dts/imx51.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl.dtsi2
-rw-r--r--arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi4
-rw-r--r--arch/arm/boot/dts/omap-zoom-common.dtsi2
-rw-r--r--arch/arm/boot/dts/omap2.dtsi96
-rw-r--r--arch/arm/boot/dts/omap2420.dtsi23
-rw-r--r--arch/arm/boot/dts/omap2430.dtsi49
-rw-r--r--arch/arm/boot/dts/omap3-beagle-xm.dts7
-rw-r--r--arch/arm/boot/dts/omap3-beagle.dts21
-rw-r--r--arch/arm/boot/dts/omap3-igep.dtsi85
-rw-r--r--arch/arm/boot/dts/omap3-igep0020.dts50
-rw-r--r--arch/arm/boot/dts/omap3-igep0030.dts4
-rw-r--r--arch/arm/boot/dts/omap3-n900.dts25
-rw-r--r--arch/arm/boot/dts/omap3-n950-n9.dtsi2
-rw-r--r--arch/arm/boot/dts/omap3.dtsi42
-rw-r--r--arch/arm/boot/dts/omap34xx-hs.dtsi16
-rw-r--r--arch/arm/boot/dts/omap36xx-hs.dtsi16
-rw-r--r--arch/arm/boot/dts/omap4-panda-common.dtsi20
-rw-r--r--arch/arm/boot/dts/omap4-sdp.dts12
-rw-r--r--arch/arm/boot/dts/socfpga.dtsi7
-rw-r--r--arch/arm/boot/dts/sun6i-a31.dtsi27
-rw-r--r--arch/arm/boot/dts/sun7i-a20.dtsi42
-rw-r--r--arch/arm/boot/dts/twl4030.dtsi6
-rw-r--r--arch/arm/common/edma.c4
-rw-r--r--arch/arm/configs/multi_v7_defconfig3
-rw-r--r--arch/arm/configs/omap2plus_defconfig1
-rw-r--r--arch/arm/configs/prima2_defconfig1
-rw-r--r--arch/arm/configs/sunxi_defconfig7
-rw-r--r--arch/arm/configs/u8500_defconfig3
-rw-r--r--arch/arm/configs/vt8500_v6_v7_defconfig90
-rw-r--r--arch/arm/include/asm/hardware/iop3xx-adma.h30
-rw-r--r--arch/arm/include/asm/hardware/iop_adma.h4
-rw-r--r--arch/arm/include/asm/memory.h40
-rw-r--r--arch/arm/include/asm/pgtable.h2
-rw-r--r--arch/arm/include/asm/thread_info.h6
-rw-r--r--arch/arm/kernel/head-nommu.S4
-rw-r--r--arch/arm/kernel/head.S9
-rw-r--r--arch/arm/kernel/machine_kexec.c17
-rw-r--r--arch/arm/kernel/process.c7
-rw-r--r--arch/arm/kernel/relocate_kernel.S8
-rw-r--r--arch/arm/kernel/setup.c3
-rw-r--r--arch/arm/kernel/sigreturn_codes.S40
-rw-r--r--arch/arm/kernel/stacktrace.c2
-rw-r--r--arch/arm/kernel/traps.c5
-rw-r--r--arch/arm/kvm/mmu.c34
-rw-r--r--arch/arm/lib/bitops.h2
-rw-r--r--arch/arm/lib/delay-loop.S1
-rw-r--r--arch/arm/mach-at91/Makefile2
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c7
-rw-r--r--arch/arm/mach-at91/at91sam9260.c2
-rw-r--r--arch/arm/mach-at91/at91sam9261.c2
-rw-r--r--arch/arm/mach-at91/at91sam9263.c3
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c3
-rw-r--r--arch/arm/mach-at91/at91sam9n12.c6
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c3
-rw-r--r--arch/arm/mach-at91/at91sam9x5.c6
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c2
-rw-r--r--arch/arm/mach-at91/generic.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9n12.h5
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9x5.h5
-rw-r--r--arch/arm/mach-at91/include/mach/sama5d3.h5
-rw-r--r--arch/arm/mach-at91/pm.h4
-rw-r--r--arch/arm/mach-at91/sama5d3.c12
-rw-r--r--arch/arm/mach-at91/sysirq_mask.c71
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c2
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c2
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c4
-rw-r--r--arch/arm/mach-davinci/dm355.c3
-rw-r--r--arch/arm/mach-davinci/dm365.c3
-rw-r--r--arch/arm/mach-davinci/dm644x.c3
-rw-r--r--arch/arm/mach-davinci/dm646x.c6
-rw-r--r--arch/arm/mach-footbridge/common.c3
-rw-r--r--arch/arm/mach-footbridge/dc21285.c2
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c22
-rw-r--r--arch/arm/mach-highbank/Kconfig2
-rw-r--r--arch/arm/mach-highbank/highbank.c23
-rw-r--r--arch/arm/mach-imx/Makefile4
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c7
-rw-r--r--arch/arm/mach-imx/clk-pllv3.c51
-rw-r--r--arch/arm/mach-imx/common.h5
-rw-r--r--arch/arm/mach-imx/mach-pca100.c2
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c2
-rw-r--r--arch/arm/mach-imx/mach-pcm038.c2
-rw-r--r--arch/arm/mach-imx/mach-pcm043.c2
-rw-r--r--arch/arm/mach-imx/mach-vpr200.c2
-rw-r--r--arch/arm/mach-imx/src.c15
-rw-r--r--arch/arm/mach-imx/system.c12
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c3
-rw-r--r--arch/arm/mach-iop13xx/include/mach/adma.h26
-rw-r--r--arch/arm/mach-kirkwood/lacie_v2-common.c2
-rw-r--r--arch/arm/mach-omap1/board-osk.c2
-rw-r--r--arch/arm/mach-omap2/Makefile8
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c2
-rw-r--r--arch/arm/mach-omap2/board-generic.c18
-rw-r--r--arch/arm/mach-omap2/board-h4.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c2
-rw-r--r--arch/arm/mach-omap2/cclock3xxx_data.c58
-rw-r--r--arch/arm/mach-omap2/cclock44xx_data.c3
-rw-r--r--arch/arm/mach-omap2/common.h1
-rw-r--r--arch/arm/mach-omap2/display.c78
-rw-r--r--arch/arm/mach-omap2/dss-common.c2
-rw-r--r--arch/arm/mach-omap2/gpmc-smsc911x.c2
-rw-r--r--arch/arm/mach-omap2/gpmc.c58
-rw-r--r--arch/arm/mach-omap2/omap-secure.h7
-rw-r--r--arch/arm/mach-omap2/omap4-common.c57
-rw-r--r--arch/arm/mach-omap2/omap_device.c37
-rw-r--r--arch/arm/mach-omap2/omap_device.h1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c143
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c13
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c12
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_54xx_data.c13
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c1
-rw-r--r--arch/arm/mach-omap2/pm34xx.c2
-rw-r--r--arch/arm/mach-omap2/powerdomain.c3
-rw-r--r--arch/arm/mach-omap2/prm44xx_54xx.h3
-rw-r--r--arch/arm/mach-pxa/cm-x300.c1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c1
-rw-r--r--arch/arm/mach-pxa/ezx.c1
-rw-r--r--arch/arm/mach-pxa/hx4700.c1
-rw-r--r--arch/arm/mach-pxa/lpd270.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.c1
-rw-r--r--arch/arm/mach-pxa/palm27x.c1
-rw-r--r--arch/arm/mach-pxa/palmtc.c35
-rw-r--r--arch/arm/mach-pxa/palmte2.c1
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c1
-rw-r--r--arch/arm/mach-pxa/raumfeld.c1
-rw-r--r--arch/arm/mach-pxa/reset.c8
-rw-r--r--arch/arm/mach-pxa/stargate2.c2
-rw-r--r--arch/arm/mach-pxa/tavorevb.c2
-rw-r--r--arch/arm/mach-pxa/tosa.c102
-rw-r--r--arch/arm/mach-pxa/viper.c1
-rw-r--r--arch/arm/mach-pxa/z2.c2
-rw-r--r--arch/arm/mach-pxa/zylonite.c1
-rw-r--r--arch/arm/mach-s3c24xx/mach-h1940.c1
-rw-r--r--arch/arm/mach-s3c24xx/mach-mini2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx1950.c1
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c1
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c1
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c1
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c1
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c1
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c1
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c1
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c1
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c1
-rw-r--r--arch/arm/mach-socfpga/Kconfig1
-rw-r--r--arch/arm/mach-sti/Kconfig6
-rw-r--r--arch/arm/mach-tegra/fuse.c12
-rw-r--r--arch/arm/mach-tegra/tegra.c2
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c4
-rw-r--r--arch/arm/mach-vexpress/spc.c40
-rw-r--r--arch/arm/mach-vexpress/spc.h1
-rw-r--r--arch/arm/mach-vexpress/tc2_pm.c66
-rw-r--r--arch/arm/mm/dma-mapping.c88
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/arm/mm/mmap.c2
-rw-r--r--arch/arm/mm/mmu.c4
-rw-r--r--arch/arm/mm/nommu.c1
-rw-r--r--arch/arm/mm/pgd.c3
-rw-r--r--arch/arm/mm/proc-v7.S17
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h5
-rw-r--r--arch/arm/plat-samsung/dev-backlight.c5
-rw-r--r--arch/arm/xen/p2m.c5
-rw-r--r--arch/arm64/Kconfig3
-rw-r--r--arch/arm64/boot/dts/foundation-v8.dts2
-rw-r--r--arch/arm64/include/asm/io.h2
-rw-r--r--arch/arm64/include/asm/irqflags.h3
-rw-r--r--arch/arm64/include/asm/pgtable-hwdef.h2
-rw-r--r--arch/arm64/include/asm/pgtable.h33
-rw-r--r--arch/arm64/include/asm/thread_info.h6
-rw-r--r--arch/arm64/kernel/debug-monitors.c20
-rw-r--r--arch/arm64/kernel/entry.S29
-rw-r--r--arch/arm64/kernel/head.S3
-rw-r--r--arch/arm64/kernel/ptrace.c40
-rw-r--r--arch/arm64/kernel/setup.c5
-rw-r--r--arch/arm64/kernel/smp.c1
-rw-r--r--arch/arm64/mm/proc.S2
-rw-r--r--arch/avr32/boards/favr-32/setup.c4
-rw-r--r--arch/avr32/boot/u-boot/head.S35
-rw-r--r--arch/avr32/configs/atngw100_defconfig1
-rw-r--r--arch/avr32/configs/atngw100_evklcd100_defconfig1
-rw-r--r--arch/avr32/configs/atngw100_evklcd101_defconfig1
-rw-r--r--arch/avr32/configs/atngw100_mrmt_defconfig1
-rw-r--r--arch/avr32/configs/atngw100mkii_defconfig1
-rw-r--r--arch/avr32/configs/atngw100mkii_evklcd100_defconfig1
-rw-r--r--arch/avr32/configs/atngw100mkii_evklcd101_defconfig1
-rw-r--r--arch/avr32/configs/atstk1002_defconfig1
-rw-r--r--arch/avr32/configs/atstk1003_defconfig1
-rw-r--r--arch/avr32/configs/atstk1004_defconfig1
-rw-r--r--arch/avr32/configs/atstk1006_defconfig1
-rw-r--r--arch/avr32/configs/favr-32_defconfig1
-rw-r--r--arch/avr32/configs/hammerhead_defconfig1
-rw-r--r--arch/avr32/configs/merisc_defconfig1
-rw-r--r--arch/avr32/configs/mimc200_defconfig1
-rw-r--r--arch/avr32/include/asm/kprobes.h14
-rw-r--r--arch/avr32/include/asm/thread_info.h2
-rw-r--r--arch/avr32/include/uapi/asm/Kbuild24
-rw-r--r--arch/avr32/include/uapi/asm/auxvec.h6
-rw-r--r--arch/avr32/include/uapi/asm/bitsperlong.h1
-rw-r--r--arch/avr32/include/uapi/asm/byteorder.h6
-rw-r--r--arch/avr32/include/uapi/asm/cachectl.h6
-rw-r--r--arch/avr32/include/uapi/asm/errno.h6
-rw-r--r--arch/avr32/include/uapi/asm/fcntl.h6
-rw-r--r--arch/avr32/include/uapi/asm/ioctl.h6
-rw-r--r--arch/avr32/include/uapi/asm/ioctls.h6
-rw-r--r--arch/avr32/include/uapi/asm/ipcbuf.h1
-rw-r--r--arch/avr32/include/uapi/asm/kvm_para.h1
-rw-r--r--arch/avr32/include/uapi/asm/mman.h1
-rw-r--r--arch/avr32/include/uapi/asm/msgbuf.h6
-rw-r--r--arch/avr32/include/uapi/asm/poll.h1
-rw-r--r--arch/avr32/include/uapi/asm/posix_types.h6
-rw-r--r--arch/avr32/include/uapi/asm/resource.h6
-rw-r--r--arch/avr32/include/uapi/asm/sembuf.h6
-rw-r--r--arch/avr32/include/uapi/asm/setup.h1
-rw-r--r--arch/avr32/include/uapi/asm/shmbuf.h6
-rw-r--r--arch/avr32/include/uapi/asm/sigcontext.h6
-rw-r--r--arch/avr32/include/uapi/asm/siginfo.h6
-rw-r--r--arch/avr32/include/uapi/asm/signal.h1
-rw-r--r--arch/avr32/include/uapi/asm/socket.h6
-rw-r--r--arch/avr32/include/uapi/asm/sockios.h6
-rw-r--r--arch/avr32/include/uapi/asm/stat.h6
-rw-r--r--arch/avr32/include/uapi/asm/statfs.h6
-rw-r--r--arch/avr32/include/uapi/asm/swab.h6
-rw-r--r--arch/avr32/include/uapi/asm/termbits.h6
-rw-r--r--arch/avr32/include/uapi/asm/termios.h1
-rw-r--r--arch/avr32/include/uapi/asm/types.h5
-rw-r--r--arch/avr32/include/uapi/asm/unistd.h1
-rw-r--r--arch/avr32/kernel/entry-avr32b.S3
-rw-r--r--arch/avr32/kernel/head.S20
-rw-r--r--arch/avr32/kernel/time.c2
-rw-r--r--arch/avr32/mach-at32ap/pm.c2
-rw-r--r--arch/blackfin/configs/BF609-EZKIT_defconfig2
-rw-r--r--arch/blackfin/include/asm/hardirq.h3
-rw-r--r--arch/blackfin/include/asm/irq.h3
-rw-r--r--arch/blackfin/include/asm/irq_handler.h6
-rw-r--r--arch/blackfin/include/asm/thread_info.h2
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c159
-rw-r--r--arch/blackfin/mach-bf548/Kconfig34
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c538
-rw-r--r--arch/blackfin/mach-bf548/include/mach/gpio.h8
-rw-r--r--arch/blackfin/mach-bf548/include/mach/irq.h2
-rw-r--r--arch/blackfin/mach-bf609/Kconfig42
-rw-r--r--arch/blackfin/mach-bf609/boards/ezkit.c472
-rw-r--r--arch/blackfin/mach-bf609/include/mach/gpio.h8
-rw-r--r--arch/blackfin/mach-bf609/include/mach/irq.h2
-rw-r--r--arch/blackfin/mach-bf609/include/mach/portmux.h4
-rw-r--r--arch/blackfin/mach-common/ints-priority.c421
-rw-r--r--arch/blackfin/mach-common/pm.c22
-rw-r--r--arch/blackfin/mach-common/smp.c12
-rw-r--r--arch/c6x/Kconfig7
-rw-r--r--arch/c6x/include/asm/thread_info.h2
-rw-r--r--arch/cris/include/asm/hardirq.h12
-rw-r--r--arch/cris/include/asm/thread_info.h2
-rw-r--r--arch/frv/include/asm/thread_info.h2
-rw-r--r--arch/hexagon/include/asm/thread_info.h4
-rw-r--r--arch/ia64/Kconfig1
-rw-r--r--arch/ia64/hp/common/sba_iommu.c2
-rw-r--r--arch/ia64/include/asm/pci.h2
-rw-r--r--arch/ia64/include/asm/thread_info.h3
-rw-r--r--arch/ia64/kernel/entry.S15
-rw-r--r--arch/ia64/kernel/kprobes.c2
-rw-r--r--arch/ia64/kernel/perfmon.c8
-rw-r--r--arch/ia64/pci/pci.c6
-rw-r--r--arch/ia64/sn/kernel/io_acpi_init.c4
-rw-r--r--arch/m32r/include/asm/hardirq.h16
-rw-r--r--arch/m32r/include/asm/mmu_context.h2
-rw-r--r--arch/m32r/include/asm/thread_info.h2
-rw-r--r--arch/m32r/kernel/entry.S8
-rw-r--r--arch/m68k/Kconfig1
-rw-r--r--arch/m68k/include/asm/hardirq.h11
-rw-r--r--arch/m68k/include/asm/thread_info.h2
-rw-r--r--arch/m68k/kernel/entry.S40
-rw-r--r--arch/m68k/kernel/ints.c6
-rw-r--r--arch/m68k/platform/68000/entry.S33
-rw-r--r--arch/m68k/platform/68360/entry.S24
-rw-r--r--arch/metag/include/asm/thread_info.h2
-rw-r--r--arch/microblaze/Kconfig1
-rw-r--r--arch/microblaze/include/asm/thread_info.h2
-rw-r--r--arch/mips/Kconfig1
-rw-r--r--arch/mips/configs/db1235_defconfig1
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pip.h4
-rw-r--r--arch/mips/include/asm/thread_info.h2
-rw-r--r--arch/mn10300/include/asm/mmu_context.h2
-rw-r--r--arch/mn10300/include/asm/thread_info.h2
-rw-r--r--arch/openrisc/Makefile2
-rw-r--r--arch/openrisc/configs/or1ksim_defconfig10
-rw-r--r--arch/openrisc/include/asm/Kbuild1
-rw-r--r--arch/openrisc/kernel/module.c6
-rw-r--r--arch/openrisc/kernel/setup.c25
-rw-r--r--arch/openrisc/kernel/vmlinux.h2
-rw-r--r--arch/parisc/Kconfig1
-rw-r--r--arch/parisc/configs/c3000_defconfig2
-rw-r--r--arch/parisc/configs/c8000_defconfig36
-rw-r--r--arch/parisc/configs/generic-64bit_defconfig39
-rw-r--r--arch/parisc/include/asm/serial.h2
-rw-r--r--arch/parisc/include/asm/socket.h11
-rw-r--r--arch/parisc/include/asm/thread_info.h3
-rw-r--r--arch/parisc/include/asm/uaccess.h46
-rw-r--r--arch/parisc/include/uapi/asm/socket.h11
-rw-r--r--arch/parisc/kernel/hardware.c7
-rw-r--r--arch/parisc/kernel/head.S6
-rw-r--r--arch/parisc/kernel/sys_parisc.c25
-rw-r--r--arch/parisc/kernel/unwind.c9
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S138
-rw-r--r--arch/parisc/lib/memcpy.c6
-rw-r--r--arch/parisc/mm/fault.c22
-rw-r--r--arch/parisc/mm/init.c19
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/Makefile8
-rw-r--r--arch/powerpc/boot/dts/fsl/b4si-post.dtsi4
-rw-r--r--arch/powerpc/boot/dts/fsl/elo3-dma-0.dtsi82
-rw-r--r--arch/powerpc/boot/dts/fsl/elo3-dma-1.dtsi82
-rw-r--r--arch/powerpc/boot/dts/fsl/t4240si-post.dtsi4
-rw-r--r--arch/powerpc/boot/dts/mpc5121.dtsi1
-rw-r--r--arch/powerpc/boot/dts/xcalibur1501.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/util.S14
-rw-r--r--arch/powerpc/configs/52xx/cm5200_defconfig3
-rw-r--r--arch/powerpc/configs/52xx/lite5200b_defconfig3
-rw-r--r--arch/powerpc/configs/52xx/motionpro_defconfig3
-rw-r--r--arch/powerpc/configs/52xx/pcm030_defconfig3
-rw-r--r--arch/powerpc/configs/52xx/tqm5200_defconfig3
-rw-r--r--arch/powerpc/configs/mpc5200_defconfig3
-rw-r--r--arch/powerpc/configs/pasemi_defconfig7
-rw-r--r--arch/powerpc/configs/pseries_le_defconfig352
-rw-r--r--arch/powerpc/include/asm/elf.h4
-rw-r--r--arch/powerpc/include/asm/hvcall.h2
-rw-r--r--arch/powerpc/include/asm/pgalloc-32.h6
-rw-r--r--arch/powerpc/include/asm/pgalloc-64.h7
-rw-r--r--arch/powerpc/include/asm/plpar_wrappers.h26
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h2
-rw-r--r--arch/powerpc/include/asm/reg.h7
-rw-r--r--arch/powerpc/include/asm/smp.h2
-rw-r--r--arch/powerpc/include/asm/thread_info.h11
-rw-r--r--arch/powerpc/include/asm/timex.h8
-rw-r--r--arch/powerpc/kernel/eeh.c9
-rw-r--r--arch/powerpc/kernel/eeh_event.c9
-rw-r--r--arch/powerpc/kernel/kprobes.c2
-rw-r--r--arch/powerpc/kernel/machine_kexec.c14
-rw-r--r--arch/powerpc/kernel/misc_64.S5
-rw-r--r--arch/powerpc/kernel/nvram_64.c2
-rw-r--r--arch/powerpc/kernel/process.c71
-rw-r--r--arch/powerpc/kernel/prom.c20
-rw-r--r--arch/powerpc/kernel/signal_32.c6
-rw-r--r--arch/powerpc/kernel/signal_64.c31
-rw-r--r--arch/powerpc/kernel/smp.c16
-rw-r--r--arch/powerpc/kernel/time.c4
-rw-r--r--arch/powerpc/kernel/vdso32/gettimeofday.S6
-rw-r--r--arch/powerpc/kernel/vdso64/sigtramp.S16
-rw-r--r--arch/powerpc/kernel/vio.c2
-rw-r--r--arch/powerpc/mm/gup.c5
-rw-r--r--arch/powerpc/mm/hugetlbpage-book3e.c3
-rw-r--r--arch/powerpc/mm/slice.c2
-rw-r--r--arch/powerpc/mm/tlb_nohash.c2
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype25
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c1
-rw-r--r--arch/powerpc/platforms/powernv/rng.c1
-rw-r--r--arch/powerpc/platforms/pseries/eeh_pseries.c21
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c17
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c2
-rw-r--r--arch/powerpc/platforms/pseries/rng.c1
-rw-r--r--arch/powerpc/platforms/pseries/setup.c42
-rw-r--r--arch/powerpc/platforms/wsp/chroma.c1
-rw-r--r--arch/powerpc/platforms/wsp/h8.c1
-rw-r--r--arch/powerpc/platforms/wsp/ics.c2
-rw-r--r--arch/powerpc/platforms/wsp/opb_pic.c2
-rw-r--r--arch/powerpc/platforms/wsp/psr2.c1
-rw-r--r--arch/powerpc/platforms/wsp/scom_wsp.c1
-rw-r--r--arch/powerpc/platforms/wsp/wsp.c1
-rw-r--r--arch/powerpc/sysdev/ppc4xx_ocm.c2
-rw-r--r--arch/s390/Kconfig8
-rw-r--r--arch/s390/boot/Makefile4
-rw-r--r--arch/s390/crypto/aes_s390.c50
-rw-r--r--arch/s390/include/asm/ctl_reg.h2
-rw-r--r--arch/s390/include/asm/eadm.h13
-rw-r--r--arch/s390/include/asm/hardirq.h2
-rw-r--r--arch/s390/include/asm/page.h38
-rw-r--r--arch/s390/include/asm/pci.h6
-rw-r--r--arch/s390/include/asm/sclp.h6
-rw-r--r--arch/s390/include/asm/setup.h3
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/vdso.h5
-rw-r--r--arch/s390/kernel/asm-offsets.c4
-rw-r--r--arch/s390/kernel/compat_signal.c2
-rw-r--r--arch/s390/kernel/crash_dump.c22
-rw-r--r--arch/s390/kernel/early.c2
-rw-r--r--arch/s390/kernel/kprobes.c2
-rw-r--r--arch/s390/kernel/pgm_check.S2
-rw-r--r--arch/s390/kernel/setup.c7
-rw-r--r--arch/s390/kernel/signal.c2
-rw-r--r--arch/s390/kernel/time.c46
-rw-r--r--arch/s390/kernel/vdso.c2
-rw-r--r--arch/s390/kernel/vdso32/clock_gettime.S31
-rw-r--r--arch/s390/kernel/vdso32/gettimeofday.S9
-rw-r--r--arch/s390/kernel/vdso64/clock_getres.S4
-rw-r--r--arch/s390/kernel/vdso64/clock_gettime.S24
-rw-r--r--arch/s390/kernel/vdso64/gettimeofday.S9
-rw-r--r--arch/s390/lib/uaccess_pt.c3
-rw-r--r--arch/s390/pci/pci.c202
-rw-r--r--arch/s390/pci/pci_clp.c8
-rw-r--r--arch/s390/pci/pci_event.c79
-rw-r--r--arch/score/include/asm/thread_info.h2
-rw-r--r--arch/sh/Kconfig1
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c1
-rw-r--r--arch/sh/include/asm/mmu_context.h2
-rw-r--r--arch/sh/include/asm/thread_info.h2
-rw-r--r--arch/sh/kernel/entry-common.S6
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/sparc/include/asm/hardirq_32.h1
-rw-r--r--arch/sparc/include/asm/hardirq_64.h2
-rw-r--r--arch/sparc/include/asm/mmu_64.h1
-rw-r--r--arch/sparc/include/asm/page_64.h49
-rw-r--r--arch/sparc/include/asm/pgtable_64.h209
-rw-r--r--arch/sparc/include/asm/sparsemem.h6
-rw-r--r--arch/sparc/include/asm/thread_info_32.h2
-rw-r--r--arch/sparc/include/asm/thread_info_64.h5
-rw-r--r--arch/sparc/include/asm/tlbflush_64.h1
-rw-r--r--arch/sparc/include/asm/tsb.h105
-rw-r--r--arch/sparc/kernel/entry.h1
-rw-r--r--arch/sparc/kernel/kgdb_64.c5
-rw-r--r--arch/sparc/kernel/kprobes.c9
-rw-r--r--arch/sparc/kernel/ktlb.S30
-rw-r--r--arch/sparc/kernel/pci.c4
-rw-r--r--arch/sparc/kernel/process_64.c2
-rw-r--r--arch/sparc/kernel/ptrace_64.c10
-rw-r--r--arch/sparc/kernel/rtrap_64.S14
-rw-r--r--arch/sparc/kernel/signal_64.c13
-rw-r--r--arch/sparc/kernel/smp_64.c9
-rw-r--r--arch/sparc/kernel/sun4v_tlb_miss.S2
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c6
-rw-r--r--arch/sparc/kernel/syscalls.S8
-rw-r--r--arch/sparc/kernel/traps_64.c85
-rw-r--r--arch/sparc/kernel/tsb.S2
-rw-r--r--arch/sparc/kernel/unaligned_64.c16
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S5
-rw-r--r--arch/sparc/lib/clear_page.S4
-rw-r--r--arch/sparc/lib/copy_page.S4
-rw-r--r--arch/sparc/mm/fault_64.c14
-rw-r--r--arch/sparc/mm/gup.c9
-rw-r--r--arch/sparc/mm/hugetlbpage.c2
-rw-r--r--arch/sparc/mm/init_64.c282
-rw-r--r--arch/sparc/mm/init_64.h4
-rw-r--r--arch/sparc/mm/tlb.c13
-rw-r--r--arch/sparc/mm/tsb.c13
-rw-r--r--arch/sparc/mm/ultra.S12
-rw-r--r--arch/tile/include/asm/hardirq.h2
-rw-r--r--arch/tile/include/asm/thread_info.h2
-rw-r--r--arch/um/Kconfig.char4
-rw-r--r--arch/um/Kconfig.common5
-rw-r--r--arch/um/Makefile20
-rw-r--r--arch/um/configs/i386_defconfig76
-rw-r--r--arch/um/configs/x86_64_defconfig75
-rw-r--r--arch/um/defconfig899
-rw-r--r--arch/um/drivers/mconsole_kern.c6
-rw-r--r--arch/um/include/asm/processor-generic.h2
-rw-r--r--arch/um/include/asm/thread_info.h2
-rw-r--r--arch/um/include/shared/as-layout.h3
-rw-r--r--arch/um/include/shared/os.h1
-rw-r--r--arch/um/kernel/process.c15
-rw-r--r--arch/um/kernel/sysrq.c102
-rw-r--r--arch/um/kernel/trap.c14
-rw-r--r--arch/um/kernel/um_arch.c2
-rw-r--r--arch/um/os-Linux/signal.c8
-rw-r--r--arch/unicore32/Kconfig1
-rw-r--r--arch/unicore32/include/asm/thread_info.h6
-rw-r--r--arch/unicore32/kernel/puv3-nb0916.c1
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/Makefile8
-rw-r--r--arch/x86/boot/Makefile6
-rw-r--r--arch/x86/boot/compressed/Makefile1
-rw-r--r--arch/x86/crypto/Makefile3
-rw-r--r--arch/x86/crypto/ablk_helper.c149
-rw-r--r--arch/x86/crypto/aesni-intel_glue.c2
-rw-r--r--arch/x86/crypto/camellia_aesni_avx2_glue.c2
-rw-r--r--arch/x86/crypto/camellia_aesni_avx_glue.c2
-rw-r--r--arch/x86/crypto/cast5_avx_glue.c2
-rw-r--r--arch/x86/crypto/cast6_avx_glue.c2
-rw-r--r--arch/x86/crypto/serpent_avx2_glue.c2
-rw-r--r--arch/x86/crypto/serpent_avx_glue.c2
-rw-r--r--arch/x86/crypto/serpent_sse2_glue.c2
-rw-r--r--arch/x86/crypto/sha256_ssse3_glue.c4
-rw-r--r--arch/x86/crypto/twofish_avx_glue.c2
-rw-r--r--arch/x86/include/asm/atomic.h4
-rw-r--r--arch/x86/include/asm/atomic64_64.h4
-rw-r--r--arch/x86/include/asm/bitops.h6
-rw-r--r--arch/x86/include/asm/crypto/ablk_helper.h31
-rw-r--r--arch/x86/include/asm/local.h4
-rw-r--r--arch/x86/include/asm/pci.h2
-rw-r--r--arch/x86/include/asm/rmwcc.h8
-rw-r--r--arch/x86/include/asm/simd.h11
-rw-r--r--arch/x86/include/asm/thread_info.h2
-rw-r--r--arch/x86/include/asm/trace/irq_vectors.h11
-rw-r--r--arch/x86/include/uapi/asm/msr-index.h2
-rw-r--r--arch/x86/kernel/apic/apic.c1
-rw-r--r--arch/x86/kernel/cpu/amd.c2
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c2
-rw-r--r--arch/x86/kernel/cpu/scattered.c2
-rw-r--r--arch/x86/kernel/early-quirks.c16
-rw-r--r--arch/x86/kernel/ftrace.c14
-rw-r--r--arch/x86/kernel/reboot.c11
-rw-r--r--arch/x86/kvm/lapic.c35
-rw-r--r--arch/x86/kvm/lapic.h4
-rw-r--r--arch/x86/kvm/mmu_audit.c2
-rw-r--r--arch/x86/kvm/x86.c40
-rw-r--r--arch/x86/mm/pgtable.c6
-rw-r--r--arch/x86/pci/acpi.c4
-rw-r--r--arch/x86/platform/efi/early_printk.c2
-rw-r--r--arch/x86/platform/efi/efi.c7
-rw-r--r--arch/x86/platform/uv/tlb_uv.c5
-rw-r--r--arch/x86/realmode/rm/Makefile3
-rw-r--r--arch/x86/um/Kconfig5
-rw-r--r--arch/x86/um/asm/processor_32.h5
-rw-r--r--arch/x86/um/asm/processor_64.h5
-rw-r--r--arch/x86/um/sysrq_32.c66
-rw-r--r--arch/x86/um/sysrq_64.c8
-rw-r--r--arch/x86/um/vdso/.gitignore2
-rw-r--r--arch/xtensa/include/asm/thread_info.h2
584 files changed, 7008 insertions, 4944 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 8d2a4833acda..d39dc9b95a2c 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -1,6 +1,7 @@
1config ALPHA 1config ALPHA
2 bool 2 bool
3 default y 3 default y
4 select ARCH_MIGHT_HAVE_PC_PARPORT
4 select HAVE_AOUT 5 select HAVE_AOUT
5 select HAVE_IDE 6 select HAVE_IDE
6 select HAVE_OPROFILE 7 select HAVE_OPROFILE
@@ -15,8 +16,8 @@ config ALPHA
15 select ARCH_WANT_IPC_PARSE_VERSION 16 select ARCH_WANT_IPC_PARSE_VERSION
16 select ARCH_HAVE_NMI_SAFE_CMPXCHG 17 select ARCH_HAVE_NMI_SAFE_CMPXCHG
17 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 18 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
19 select GENERIC_CLOCKEVENTS
18 select GENERIC_SMP_IDLE_THREAD 20 select GENERIC_SMP_IDLE_THREAD
19 select GENERIC_CMOS_UPDATE
20 select GENERIC_STRNCPY_FROM_USER 21 select GENERIC_STRNCPY_FROM_USER
21 select GENERIC_STRNLEN_USER 22 select GENERIC_STRNLEN_USER
22 select HAVE_MOD_ARCH_SPECIFIC 23 select HAVE_MOD_ARCH_SPECIFIC
@@ -487,6 +488,20 @@ config VGA_HOSE
487 which always have multiple hoses, and whose consoles support it. 488 which always have multiple hoses, and whose consoles support it.
488 489
489 490
491config ALPHA_QEMU
492 bool "Run under QEMU emulation"
493 depends on !ALPHA_GENERIC
494 ---help---
495 Assume the presence of special features supported by QEMU PALcode
496 that reduce the overhead of system emulation.
497
498 Generic kernels will auto-detect QEMU. But when building a
499 system-specific kernel, the assumption is that we want to
500 elimiate as many runtime tests as possible.
501
502 If unsure, say N.
503
504
490config ALPHA_SRM 505config ALPHA_SRM
491 bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME 506 bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME
492 depends on TTY 507 depends on TTY
@@ -571,6 +586,30 @@ config NUMA
571 Access). This option is for configuring high-end multiprocessor 586 Access). This option is for configuring high-end multiprocessor
572 server machines. If in doubt, say N. 587 server machines. If in doubt, say N.
573 588
589config ALPHA_WTINT
590 bool "Use WTINT" if ALPHA_SRM || ALPHA_GENERIC
591 default y if ALPHA_QEMU
592 default n if ALPHA_EV5 || ALPHA_EV56 || (ALPHA_EV4 && !ALPHA_LCA)
593 default n if !ALPHA_SRM && !ALPHA_GENERIC
594 default y if SMP
595 ---help---
596 The Wait for Interrupt (WTINT) PALcall attempts to place the CPU
597 to sleep until the next interrupt. This may reduce the power
598 consumed, and the heat produced by the computer. However, it has
599 the side effect of making the cycle counter unreliable as a timing
600 device across the sleep.
601
602 For emulation under QEMU, definitely say Y here, as we have other
603 mechanisms for measuring time than the cycle counter.
604
605 For EV4 (but not LCA), EV5 and EV56 systems, or for systems running
606 MILO, sleep mode is not supported so you might as well say N here.
607
608 For SMP systems we cannot use the cycle counter for timing anyway,
609 so you might as well say Y here.
610
611 If unsure, say N.
612
574config NODES_SHIFT 613config NODES_SHIFT
575 int 614 int
576 default "7" 615 default "7"
@@ -612,9 +651,41 @@ config VERBOSE_MCHECK_ON
612 651
613 Take the default (1) unless you want more control or more info. 652 Take the default (1) unless you want more control or more info.
614 653
654choice
655 prompt "Timer interrupt frequency (HZ)?"
656 default HZ_128 if ALPHA_QEMU
657 default HZ_1200 if ALPHA_RAWHIDE
658 default HZ_1024
659 ---help---
660 The frequency at which timer interrupts occur. A high frequency
661 minimizes latency, whereas a low frequency minimizes overhead of
662 process accounting. The later effect is especially significant
663 when being run under QEMU.
664
665 Note that some Alpha hardware cannot change the interrupt frequency
666 of the timer. If unsure, say 1024 (or 1200 for Rawhide).
667
668 config HZ_32
669 bool "32 Hz"
670 config HZ_64
671 bool "64 Hz"
672 config HZ_128
673 bool "128 Hz"
674 config HZ_256
675 bool "256 Hz"
676 config HZ_1024
677 bool "1024 Hz"
678 config HZ_1200
679 bool "1200 Hz"
680endchoice
681
615config HZ 682config HZ
616 int 683 int
617 default 1200 if ALPHA_RAWHIDE 684 default 32 if HZ_32
685 default 64 if HZ_64
686 default 128 if HZ_128
687 default 256 if HZ_256
688 default 1200 if HZ_1200
618 default 1024 689 default 1024
619 690
620source "drivers/pci/Kconfig" 691source "drivers/pci/Kconfig"
diff --git a/arch/alpha/include/asm/machvec.h b/arch/alpha/include/asm/machvec.h
index 72dbf2359270..75cb3641ed2f 100644
--- a/arch/alpha/include/asm/machvec.h
+++ b/arch/alpha/include/asm/machvec.h
@@ -33,6 +33,7 @@ struct alpha_machine_vector
33 33
34 int nr_irqs; 34 int nr_irqs;
35 int rtc_port; 35 int rtc_port;
36 int rtc_boot_cpu_only;
36 unsigned int max_asn; 37 unsigned int max_asn;
37 unsigned long max_isa_dma_address; 38 unsigned long max_isa_dma_address;
38 unsigned long irq_probe_mask; 39 unsigned long irq_probe_mask;
@@ -95,9 +96,6 @@ struct alpha_machine_vector
95 96
96 struct _alpha_agp_info *(*agp_info)(void); 97 struct _alpha_agp_info *(*agp_info)(void);
97 98
98 unsigned int (*rtc_get_time)(struct rtc_time *);
99 int (*rtc_set_time)(struct rtc_time *);
100
101 const char *vector_name; 99 const char *vector_name;
102 100
103 /* NUMA information */ 101 /* NUMA information */
@@ -126,13 +124,19 @@ extern struct alpha_machine_vector alpha_mv;
126 124
127#ifdef CONFIG_ALPHA_GENERIC 125#ifdef CONFIG_ALPHA_GENERIC
128extern int alpha_using_srm; 126extern int alpha_using_srm;
127extern int alpha_using_qemu;
129#else 128#else
130#ifdef CONFIG_ALPHA_SRM 129# ifdef CONFIG_ALPHA_SRM
131#define alpha_using_srm 1 130# define alpha_using_srm 1
132#else 131# else
133#define alpha_using_srm 0 132# define alpha_using_srm 0
134#endif 133# endif
134# ifdef CONFIG_ALPHA_QEMU
135# define alpha_using_qemu 1
136# else
137# define alpha_using_qemu 0
138# endif
135#endif /* GENERIC */ 139#endif /* GENERIC */
136 140
137#endif 141#endif /* __KERNEL__ */
138#endif /* __ALPHA_MACHVEC_H */ 142#endif /* __ALPHA_MACHVEC_H */
diff --git a/arch/alpha/include/asm/pal.h b/arch/alpha/include/asm/pal.h
index 6fcd2b5b08f0..5422a47646fc 100644
--- a/arch/alpha/include/asm/pal.h
+++ b/arch/alpha/include/asm/pal.h
@@ -89,6 +89,7 @@ __CALL_PAL_W1(wrmces, unsigned long);
89__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long); 89__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long);
90__CALL_PAL_W1(wrusp, unsigned long); 90__CALL_PAL_W1(wrusp, unsigned long);
91__CALL_PAL_W1(wrvptptr, unsigned long); 91__CALL_PAL_W1(wrvptptr, unsigned long);
92__CALL_PAL_RW1(wtint, unsigned long, unsigned long);
92 93
93/* 94/*
94 * TB routines.. 95 * TB routines..
@@ -111,5 +112,75 @@ __CALL_PAL_W1(wrvptptr, unsigned long);
111#define tbiap() __tbi(-1, /* no second argument */) 112#define tbiap() __tbi(-1, /* no second argument */)
112#define tbia() __tbi(-2, /* no second argument */) 113#define tbia() __tbi(-2, /* no second argument */)
113 114
115/*
116 * QEMU Cserv routines..
117 */
118
119static inline unsigned long
120qemu_get_walltime(void)
121{
122 register unsigned long v0 __asm__("$0");
123 register unsigned long a0 __asm__("$16") = 3;
124
125 asm("call_pal %2 # cserve get_time"
126 : "=r"(v0), "+r"(a0)
127 : "i"(PAL_cserve)
128 : "$17", "$18", "$19", "$20", "$21");
129
130 return v0;
131}
132
133static inline unsigned long
134qemu_get_alarm(void)
135{
136 register unsigned long v0 __asm__("$0");
137 register unsigned long a0 __asm__("$16") = 4;
138
139 asm("call_pal %2 # cserve get_alarm"
140 : "=r"(v0), "+r"(a0)
141 : "i"(PAL_cserve)
142 : "$17", "$18", "$19", "$20", "$21");
143
144 return v0;
145}
146
147static inline void
148qemu_set_alarm_rel(unsigned long expire)
149{
150 register unsigned long a0 __asm__("$16") = 5;
151 register unsigned long a1 __asm__("$17") = expire;
152
153 asm volatile("call_pal %2 # cserve set_alarm_rel"
154 : "+r"(a0), "+r"(a1)
155 : "i"(PAL_cserve)
156 : "$0", "$18", "$19", "$20", "$21");
157}
158
159static inline void
160qemu_set_alarm_abs(unsigned long expire)
161{
162 register unsigned long a0 __asm__("$16") = 6;
163 register unsigned long a1 __asm__("$17") = expire;
164
165 asm volatile("call_pal %2 # cserve set_alarm_abs"
166 : "+r"(a0), "+r"(a1)
167 : "i"(PAL_cserve)
168 : "$0", "$18", "$19", "$20", "$21");
169}
170
171static inline unsigned long
172qemu_get_vmtime(void)
173{
174 register unsigned long v0 __asm__("$0");
175 register unsigned long a0 __asm__("$16") = 7;
176
177 asm("call_pal %2 # cserve get_time"
178 : "=r"(v0), "+r"(a0)
179 : "i"(PAL_cserve)
180 : "$17", "$18", "$19", "$20", "$21");
181
182 return v0;
183}
184
114#endif /* !__ASSEMBLY__ */ 185#endif /* !__ASSEMBLY__ */
115#endif /* __ALPHA_PAL_H */ 186#endif /* __ALPHA_PAL_H */
diff --git a/arch/alpha/include/asm/rtc.h b/arch/alpha/include/asm/rtc.h
index d70408d36677..f71c3b0ed360 100644
--- a/arch/alpha/include/asm/rtc.h
+++ b/arch/alpha/include/asm/rtc.h
@@ -1,12 +1 @@
1#ifndef _ALPHA_RTC_H
2#define _ALPHA_RTC_H
3
4#if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP) \
5 || defined(CONFIG_ALPHA_GENERIC)
6# define get_rtc_time alpha_mv.rtc_get_time
7# define set_rtc_time alpha_mv.rtc_set_time
8#endif
9
10#include <asm-generic/rtc.h> #include <asm-generic/rtc.h>
11
12#endif
diff --git a/arch/alpha/include/asm/string.h b/arch/alpha/include/asm/string.h
index b02b8a282940..c2911f591704 100644
--- a/arch/alpha/include/asm/string.h
+++ b/arch/alpha/include/asm/string.h
@@ -22,15 +22,27 @@ extern void * __memcpy(void *, const void *, size_t);
22 22
23#define __HAVE_ARCH_MEMSET 23#define __HAVE_ARCH_MEMSET
24extern void * __constant_c_memset(void *, unsigned long, size_t); 24extern void * __constant_c_memset(void *, unsigned long, size_t);
25extern void * ___memset(void *, int, size_t);
25extern void * __memset(void *, int, size_t); 26extern void * __memset(void *, int, size_t);
26extern void * memset(void *, int, size_t); 27extern void * memset(void *, int, size_t);
27 28
28#define memset(s, c, n) \ 29/* For gcc 3.x, we cannot have the inline function named "memset" because
29(__builtin_constant_p(c) \ 30 the __builtin_memset will attempt to resolve to the inline as well,
30 ? (__builtin_constant_p(n) && (c) == 0 \ 31 leading to a "sorry" about unimplemented recursive inlining. */
31 ? __builtin_memset((s),0,(n)) \ 32extern inline void *__memset(void *s, int c, size_t n)
32 : __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \ 33{
33 : __memset((s),(c),(n))) 34 if (__builtin_constant_p(c)) {
35 if (__builtin_constant_p(n)) {
36 return __builtin_memset(s, c, n);
37 } else {
38 unsigned long c8 = (c & 0xff) * 0x0101010101010101UL;
39 return __constant_c_memset(s, c8, n);
40 }
41 }
42 return ___memset(s, c, n);
43}
44
45#define memset __memset
34 46
35#define __HAVE_ARCH_STRCPY 47#define __HAVE_ARCH_STRCPY
36extern char * strcpy(char *,const char *); 48extern char * strcpy(char *,const char *);
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index 52cd2a4a3ff4..453597b91f3a 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -58,8 +58,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
58#define THREAD_SIZE_ORDER 1 58#define THREAD_SIZE_ORDER 1
59#define THREAD_SIZE (2*PAGE_SIZE) 59#define THREAD_SIZE (2*PAGE_SIZE)
60 60
61#define PREEMPT_ACTIVE 0x40000000
62
63/* 61/*
64 * Thread information flags: 62 * Thread information flags:
65 * - these are process state flags and used from assembly 63 * - these are process state flags and used from assembly
diff --git a/arch/alpha/include/uapi/asm/pal.h b/arch/alpha/include/uapi/asm/pal.h
index 3c0ce08e5f59..dfc8140b9088 100644
--- a/arch/alpha/include/uapi/asm/pal.h
+++ b/arch/alpha/include/uapi/asm/pal.h
@@ -46,6 +46,7 @@
46#define PAL_rdusp 58 46#define PAL_rdusp 58
47#define PAL_whami 60 47#define PAL_whami 60
48#define PAL_retsys 61 48#define PAL_retsys 61
49#define PAL_wtint 62
49#define PAL_rti 63 50#define PAL_rti 63
50 51
51 52
diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
index 84ec46b38f7d..0d54650e78fc 100644
--- a/arch/alpha/kernel/Makefile
+++ b/arch/alpha/kernel/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_PCI) += pci.o pci_iommu.o pci-sysfs.o
16obj-$(CONFIG_SRM_ENV) += srm_env.o 16obj-$(CONFIG_SRM_ENV) += srm_env.o
17obj-$(CONFIG_MODULES) += module.o 17obj-$(CONFIG_MODULES) += module.o
18obj-$(CONFIG_PERF_EVENTS) += perf_event.o 18obj-$(CONFIG_PERF_EVENTS) += perf_event.o
19obj-$(CONFIG_RTC_DRV_ALPHA) += rtc.o
19 20
20ifdef CONFIG_ALPHA_GENERIC 21ifdef CONFIG_ALPHA_GENERIC
21 22
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index 89566b346c0f..f4c7ab6f43b0 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -40,6 +40,7 @@ EXPORT_SYMBOL(strrchr);
40EXPORT_SYMBOL(memmove); 40EXPORT_SYMBOL(memmove);
41EXPORT_SYMBOL(__memcpy); 41EXPORT_SYMBOL(__memcpy);
42EXPORT_SYMBOL(__memset); 42EXPORT_SYMBOL(__memset);
43EXPORT_SYMBOL(___memset);
43EXPORT_SYMBOL(__memsetw); 44EXPORT_SYMBOL(__memsetw);
44EXPORT_SYMBOL(__constant_c_memset); 45EXPORT_SYMBOL(__constant_c_memset);
45EXPORT_SYMBOL(copy_page); 46EXPORT_SYMBOL(copy_page);
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 28e4429596f3..1c8625cb0e25 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -66,21 +66,7 @@ do_entInt(unsigned long type, unsigned long vector,
66 break; 66 break;
67 case 1: 67 case 1:
68 old_regs = set_irq_regs(regs); 68 old_regs = set_irq_regs(regs);
69#ifdef CONFIG_SMP
70 {
71 long cpu;
72
73 smp_percpu_timer_interrupt(regs);
74 cpu = smp_processor_id();
75 if (cpu != boot_cpuid) {
76 kstat_incr_irqs_this_cpu(RTC_IRQ, irq_to_desc(RTC_IRQ));
77 } else {
78 handle_irq(RTC_IRQ);
79 }
80 }
81#else
82 handle_irq(RTC_IRQ); 69 handle_irq(RTC_IRQ);
83#endif
84 set_irq_regs(old_regs); 70 set_irq_regs(old_regs);
85 return; 71 return;
86 case 2: 72 case 2:
@@ -228,7 +214,7 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
228 */ 214 */
229 215
230struct irqaction timer_irqaction = { 216struct irqaction timer_irqaction = {
231 .handler = timer_interrupt, 217 .handler = rtc_timer_interrupt,
232 .name = "timer", 218 .name = "timer",
233}; 219};
234 220
diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h
index 7fa62488bd16..f54bdf658cd0 100644
--- a/arch/alpha/kernel/machvec_impl.h
+++ b/arch/alpha/kernel/machvec_impl.h
@@ -43,10 +43,7 @@
43#define CAT1(x,y) x##y 43#define CAT1(x,y) x##y
44#define CAT(x,y) CAT1(x,y) 44#define CAT(x,y) CAT1(x,y)
45 45
46#define DO_DEFAULT_RTC \ 46#define DO_DEFAULT_RTC .rtc_port = 0x70
47 .rtc_port = 0x70, \
48 .rtc_get_time = common_get_rtc_time, \
49 .rtc_set_time = common_set_rtc_time
50 47
51#define DO_EV4_MMU \ 48#define DO_EV4_MMU \
52 .max_asn = EV4_MAX_ASN, \ 49 .max_asn = EV4_MAX_ASN, \
diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c
index d821b17047e0..c52e7f0ee5f6 100644
--- a/arch/alpha/kernel/perf_event.c
+++ b/arch/alpha/kernel/perf_event.c
@@ -83,6 +83,8 @@ struct alpha_pmu_t {
83 long pmc_left[3]; 83 long pmc_left[3];
84 /* Subroutine for allocation of PMCs. Enforces constraints. */ 84 /* Subroutine for allocation of PMCs. Enforces constraints. */
85 int (*check_constraints)(struct perf_event **, unsigned long *, int); 85 int (*check_constraints)(struct perf_event **, unsigned long *, int);
86 /* Subroutine for checking validity of a raw event for this PMU. */
87 int (*raw_event_valid)(u64 config);
86}; 88};
87 89
88/* 90/*
@@ -203,6 +205,12 @@ success:
203} 205}
204 206
205 207
208static int ev67_raw_event_valid(u64 config)
209{
210 return config >= EV67_CYCLES && config < EV67_LAST_ET;
211};
212
213
206static const struct alpha_pmu_t ev67_pmu = { 214static const struct alpha_pmu_t ev67_pmu = {
207 .event_map = ev67_perfmon_event_map, 215 .event_map = ev67_perfmon_event_map,
208 .max_events = ARRAY_SIZE(ev67_perfmon_event_map), 216 .max_events = ARRAY_SIZE(ev67_perfmon_event_map),
@@ -211,7 +219,8 @@ static const struct alpha_pmu_t ev67_pmu = {
211 .pmc_count_mask = {EV67_PCTR_0_COUNT_MASK, EV67_PCTR_1_COUNT_MASK, 0}, 219 .pmc_count_mask = {EV67_PCTR_0_COUNT_MASK, EV67_PCTR_1_COUNT_MASK, 0},
212 .pmc_max_period = {(1UL<<20) - 1, (1UL<<20) - 1, 0}, 220 .pmc_max_period = {(1UL<<20) - 1, (1UL<<20) - 1, 0},
213 .pmc_left = {16, 4, 0}, 221 .pmc_left = {16, 4, 0},
214 .check_constraints = ev67_check_constraints 222 .check_constraints = ev67_check_constraints,
223 .raw_event_valid = ev67_raw_event_valid,
215}; 224};
216 225
217 226
@@ -609,7 +618,9 @@ static int __hw_perf_event_init(struct perf_event *event)
609 } else if (attr->type == PERF_TYPE_HW_CACHE) { 618 } else if (attr->type == PERF_TYPE_HW_CACHE) {
610 return -EOPNOTSUPP; 619 return -EOPNOTSUPP;
611 } else if (attr->type == PERF_TYPE_RAW) { 620 } else if (attr->type == PERF_TYPE_RAW) {
612 ev = attr->config & 0xff; 621 if (!alpha_pmu->raw_event_valid(attr->config))
622 return -EINVAL;
623 ev = attr->config;
613 } else { 624 } else {
614 return -EOPNOTSUPP; 625 return -EOPNOTSUPP;
615 } 626 }
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index f2360a74e5d5..1941a07b5811 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -46,6 +46,23 @@
46void (*pm_power_off)(void) = machine_power_off; 46void (*pm_power_off)(void) = machine_power_off;
47EXPORT_SYMBOL(pm_power_off); 47EXPORT_SYMBOL(pm_power_off);
48 48
49#ifdef CONFIG_ALPHA_WTINT
50/*
51 * Sleep the CPU.
52 * EV6, LCA45 and QEMU know how to power down, skipping N timer interrupts.
53 */
54void arch_cpu_idle(void)
55{
56 wtint(0);
57 local_irq_enable();
58}
59
60void arch_cpu_idle_dead(void)
61{
62 wtint(INT_MAX);
63}
64#endif /* ALPHA_WTINT */
65
49struct halt_info { 66struct halt_info {
50 int mode; 67 int mode;
51 char *restart_cmd; 68 char *restart_cmd;
diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h
index d3e52d3fd592..da2d6ec9c370 100644
--- a/arch/alpha/kernel/proto.h
+++ b/arch/alpha/kernel/proto.h
@@ -135,17 +135,15 @@ extern void unregister_srm_console(void);
135/* smp.c */ 135/* smp.c */
136extern void setup_smp(void); 136extern void setup_smp(void);
137extern void handle_ipi(struct pt_regs *); 137extern void handle_ipi(struct pt_regs *);
138extern void smp_percpu_timer_interrupt(struct pt_regs *);
139 138
140/* bios32.c */ 139/* bios32.c */
141/* extern void reset_for_srm(void); */ 140/* extern void reset_for_srm(void); */
142 141
143/* time.c */ 142/* time.c */
144extern irqreturn_t timer_interrupt(int irq, void *dev); 143extern irqreturn_t rtc_timer_interrupt(int irq, void *dev);
144extern void init_clockevent(void);
145extern void common_init_rtc(void); 145extern void common_init_rtc(void);
146extern unsigned long est_cycle_freq; 146extern unsigned long est_cycle_freq;
147extern unsigned int common_get_rtc_time(struct rtc_time *time);
148extern int common_set_rtc_time(struct rtc_time *time);
149 147
150/* smc37c93x.c */ 148/* smc37c93x.c */
151extern void SMC93x_Init(void); 149extern void SMC93x_Init(void);
diff --git a/arch/alpha/kernel/rtc.c b/arch/alpha/kernel/rtc.c
new file mode 100644
index 000000000000..c8d284d8521f
--- /dev/null
+++ b/arch/alpha/kernel/rtc.c
@@ -0,0 +1,323 @@
1/*
2 * linux/arch/alpha/kernel/rtc.c
3 *
4 * Copyright (C) 1991, 1992, 1995, 1999, 2000 Linus Torvalds
5 *
6 * This file contains date handling.
7 */
8#include <linux/errno.h>
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/param.h>
12#include <linux/string.h>
13#include <linux/mc146818rtc.h>
14#include <linux/bcd.h>
15#include <linux/rtc.h>
16#include <linux/platform_device.h>
17
18#include <asm/rtc.h>
19
20#include "proto.h"
21
22
23/*
24 * Support for the RTC device.
25 *
26 * We don't want to use the rtc-cmos driver, because we don't want to support
27 * alarms, as that would be indistinguishable from timer interrupts.
28 *
29 * Further, generic code is really, really tied to a 1900 epoch. This is
30 * true in __get_rtc_time as well as the users of struct rtc_time e.g.
31 * rtc_tm_to_time. Thankfully all of the other epochs in use are later
32 * than 1900, and so it's easy to adjust.
33 */
34
35static unsigned long rtc_epoch;
36
37static int __init
38specifiy_epoch(char *str)
39{
40 unsigned long epoch = simple_strtoul(str, NULL, 0);
41 if (epoch < 1900)
42 printk("Ignoring invalid user specified epoch %lu\n", epoch);
43 else
44 rtc_epoch = epoch;
45 return 1;
46}
47__setup("epoch=", specifiy_epoch);
48
49static void __init
50init_rtc_epoch(void)
51{
52 int epoch, year, ctrl;
53
54 if (rtc_epoch != 0) {
55 /* The epoch was specified on the command-line. */
56 return;
57 }
58
59 /* Detect the epoch in use on this computer. */
60 ctrl = CMOS_READ(RTC_CONTROL);
61 year = CMOS_READ(RTC_YEAR);
62 if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
63 year = bcd2bin(year);
64
65 /* PC-like is standard; used for year >= 70 */
66 epoch = 1900;
67 if (year < 20) {
68 epoch = 2000;
69 } else if (year >= 20 && year < 48) {
70 /* NT epoch */
71 epoch = 1980;
72 } else if (year >= 48 && year < 70) {
73 /* Digital UNIX epoch */
74 epoch = 1952;
75 }
76 rtc_epoch = epoch;
77
78 printk(KERN_INFO "Using epoch %d for rtc year %d\n", epoch, year);
79}
80
81static int
82alpha_rtc_read_time(struct device *dev, struct rtc_time *tm)
83{
84 __get_rtc_time(tm);
85
86 /* Adjust for non-default epochs. It's easier to depend on the
87 generic __get_rtc_time and adjust the epoch here than create
88 a copy of __get_rtc_time with the edits we need. */
89 if (rtc_epoch != 1900) {
90 int year = tm->tm_year;
91 /* Undo the century adjustment made in __get_rtc_time. */
92 if (year >= 100)
93 year -= 100;
94 year += rtc_epoch - 1900;
95 /* Redo the century adjustment with the epoch in place. */
96 if (year <= 69)
97 year += 100;
98 tm->tm_year = year;
99 }
100
101 return rtc_valid_tm(tm);
102}
103
104static int
105alpha_rtc_set_time(struct device *dev, struct rtc_time *tm)
106{
107 struct rtc_time xtm;
108
109 if (rtc_epoch != 1900) {
110 xtm = *tm;
111 xtm.tm_year -= rtc_epoch - 1900;
112 tm = &xtm;
113 }
114
115 return __set_rtc_time(tm);
116}
117
118static int
119alpha_rtc_set_mmss(struct device *dev, unsigned long nowtime)
120{
121 int retval = 0;
122 int real_seconds, real_minutes, cmos_minutes;
123 unsigned char save_control, save_freq_select;
124
125 /* Note: This code only updates minutes and seconds. Comments
126 indicate this was to avoid messing with unknown time zones,
127 and with the epoch nonsense described above. In order for
128 this to work, the existing clock cannot be off by more than
129 15 minutes.
130
131 ??? This choice is may be out of date. The x86 port does
132 not have problems with timezones, and the epoch processing has
133 now been fixed in alpha_set_rtc_time.
134
135 In either case, one can always force a full rtc update with
136 the userland hwclock program, so surely 15 minute accuracy
137 is no real burden. */
138
139 /* In order to set the CMOS clock precisely, we have to be called
140 500 ms after the second nowtime has started, because when
141 nowtime is written into the registers of the CMOS clock, it will
142 jump to the next second precisely 500 ms later. Check the Motorola
143 MC146818A or Dallas DS12887 data sheet for details. */
144
145 /* irq are locally disabled here */
146 spin_lock(&rtc_lock);
147 /* Tell the clock it's being set */
148 save_control = CMOS_READ(RTC_CONTROL);
149 CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
150
151 /* Stop and reset prescaler */
152 save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
153 CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
154
155 cmos_minutes = CMOS_READ(RTC_MINUTES);
156 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
157 cmos_minutes = bcd2bin(cmos_minutes);
158
159 real_seconds = nowtime % 60;
160 real_minutes = nowtime / 60;
161 if (((abs(real_minutes - cmos_minutes) + 15) / 30) & 1) {
162 /* correct for half hour time zone */
163 real_minutes += 30;
164 }
165 real_minutes %= 60;
166
167 if (abs(real_minutes - cmos_minutes) < 30) {
168 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
169 real_seconds = bin2bcd(real_seconds);
170 real_minutes = bin2bcd(real_minutes);
171 }
172 CMOS_WRITE(real_seconds,RTC_SECONDS);
173 CMOS_WRITE(real_minutes,RTC_MINUTES);
174 } else {
175 printk_once(KERN_NOTICE
176 "set_rtc_mmss: can't update from %d to %d\n",
177 cmos_minutes, real_minutes);
178 retval = -1;
179 }
180
181 /* The following flags have to be released exactly in this order,
182 * otherwise the DS12887 (popular MC146818A clone with integrated
183 * battery and quartz) will not reset the oscillator and will not
184 * update precisely 500 ms later. You won't find this mentioned in
185 * the Dallas Semiconductor data sheets, but who believes data
186 * sheets anyway ... -- Markus Kuhn
187 */
188 CMOS_WRITE(save_control, RTC_CONTROL);
189 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
190 spin_unlock(&rtc_lock);
191
192 return retval;
193}
194
195static int
196alpha_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
197{
198 switch (cmd) {
199 case RTC_EPOCH_READ:
200 return put_user(rtc_epoch, (unsigned long __user *)arg);
201 case RTC_EPOCH_SET:
202 if (arg < 1900)
203 return -EINVAL;
204 rtc_epoch = arg;
205 return 0;
206 default:
207 return -ENOIOCTLCMD;
208 }
209}
210
211static const struct rtc_class_ops alpha_rtc_ops = {
212 .read_time = alpha_rtc_read_time,
213 .set_time = alpha_rtc_set_time,
214 .set_mmss = alpha_rtc_set_mmss,
215 .ioctl = alpha_rtc_ioctl,
216};
217
218/*
219 * Similarly, except do the actual CMOS access on the boot cpu only.
220 * This requires marshalling the data across an interprocessor call.
221 */
222
223#if defined(CONFIG_SMP) && \
224 (defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_MARVEL))
225# define HAVE_REMOTE_RTC 1
226
227union remote_data {
228 struct rtc_time *tm;
229 unsigned long now;
230 long retval;
231};
232
233static void
234do_remote_read(void *data)
235{
236 union remote_data *x = data;
237 x->retval = alpha_rtc_read_time(NULL, x->tm);
238}
239
240static int
241remote_read_time(struct device *dev, struct rtc_time *tm)
242{
243 union remote_data x;
244 if (smp_processor_id() != boot_cpuid) {
245 x.tm = tm;
246 smp_call_function_single(boot_cpuid, do_remote_read, &x, 1);
247 return x.retval;
248 }
249 return alpha_rtc_read_time(NULL, tm);
250}
251
252static void
253do_remote_set(void *data)
254{
255 union remote_data *x = data;
256 x->retval = alpha_rtc_set_time(NULL, x->tm);
257}
258
259static int
260remote_set_time(struct device *dev, struct rtc_time *tm)
261{
262 union remote_data x;
263 if (smp_processor_id() != boot_cpuid) {
264 x.tm = tm;
265 smp_call_function_single(boot_cpuid, do_remote_set, &x, 1);
266 return x.retval;
267 }
268 return alpha_rtc_set_time(NULL, tm);
269}
270
271static void
272do_remote_mmss(void *data)
273{
274 union remote_data *x = data;
275 x->retval = alpha_rtc_set_mmss(NULL, x->now);
276}
277
278static int
279remote_set_mmss(struct device *dev, unsigned long now)
280{
281 union remote_data x;
282 if (smp_processor_id() != boot_cpuid) {
283 x.now = now;
284 smp_call_function_single(boot_cpuid, do_remote_mmss, &x, 1);
285 return x.retval;
286 }
287 return alpha_rtc_set_mmss(NULL, now);
288}
289
290static const struct rtc_class_ops remote_rtc_ops = {
291 .read_time = remote_read_time,
292 .set_time = remote_set_time,
293 .set_mmss = remote_set_mmss,
294 .ioctl = alpha_rtc_ioctl,
295};
296#endif
297
298static int __init
299alpha_rtc_init(void)
300{
301 const struct rtc_class_ops *ops;
302 struct platform_device *pdev;
303 struct rtc_device *rtc;
304 const char *name;
305
306 init_rtc_epoch();
307 name = "rtc-alpha";
308 ops = &alpha_rtc_ops;
309
310#ifdef HAVE_REMOTE_RTC
311 if (alpha_mv.rtc_boot_cpu_only)
312 ops = &remote_rtc_ops;
313#endif
314
315 pdev = platform_device_register_simple(name, -1, NULL, 0);
316 rtc = devm_rtc_device_register(&pdev->dev, name, ops, THIS_MODULE);
317 if (IS_ERR(rtc))
318 return PTR_ERR(rtc);
319
320 platform_set_drvdata(pdev, rtc);
321 return 0;
322}
323device_initcall(alpha_rtc_init);
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 9e3107cc5ebb..b20af76f12c1 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -115,10 +115,17 @@ unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE;
115 115
116#ifdef CONFIG_ALPHA_GENERIC 116#ifdef CONFIG_ALPHA_GENERIC
117struct alpha_machine_vector alpha_mv; 117struct alpha_machine_vector alpha_mv;
118#endif
119
120#ifndef alpha_using_srm
118int alpha_using_srm; 121int alpha_using_srm;
119EXPORT_SYMBOL(alpha_using_srm); 122EXPORT_SYMBOL(alpha_using_srm);
120#endif 123#endif
121 124
125#ifndef alpha_using_qemu
126int alpha_using_qemu;
127#endif
128
122static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long, 129static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long,
123 unsigned long); 130 unsigned long);
124static struct alpha_machine_vector *get_sysvec_byname(const char *); 131static struct alpha_machine_vector *get_sysvec_byname(const char *);
@@ -529,11 +536,15 @@ setup_arch(char **cmdline_p)
529 atomic_notifier_chain_register(&panic_notifier_list, 536 atomic_notifier_chain_register(&panic_notifier_list,
530 &alpha_panic_block); 537 &alpha_panic_block);
531 538
532#ifdef CONFIG_ALPHA_GENERIC 539#ifndef alpha_using_srm
533 /* Assume that we've booted from SRM if we haven't booted from MILO. 540 /* Assume that we've booted from SRM if we haven't booted from MILO.
534 Detect the later by looking for "MILO" in the system serial nr. */ 541 Detect the later by looking for "MILO" in the system serial nr. */
535 alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0; 542 alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0;
536#endif 543#endif
544#ifndef alpha_using_qemu
545 /* Similarly, look for QEMU. */
546 alpha_using_qemu = strstr((const char *)hwrpb->ssn, "QEMU") != 0;
547#endif
537 548
538 /* If we are using SRM, we want to allow callbacks 549 /* If we are using SRM, we want to allow callbacks
539 as early as possible, so do this NOW, and then 550 as early as possible, so do this NOW, and then
@@ -1207,6 +1218,7 @@ show_cpuinfo(struct seq_file *f, void *slot)
1207 char *systype_name; 1218 char *systype_name;
1208 char *sysvariation_name; 1219 char *sysvariation_name;
1209 int nr_processors; 1220 int nr_processors;
1221 unsigned long timer_freq;
1210 1222
1211 cpu_index = (unsigned) (cpu->type - 1); 1223 cpu_index = (unsigned) (cpu->type - 1);
1212 cpu_name = "Unknown"; 1224 cpu_name = "Unknown";
@@ -1218,6 +1230,12 @@ show_cpuinfo(struct seq_file *f, void *slot)
1218 1230
1219 nr_processors = get_nr_processors(cpu, hwrpb->nr_processors); 1231 nr_processors = get_nr_processors(cpu, hwrpb->nr_processors);
1220 1232
1233#if CONFIG_HZ == 1024 || CONFIG_HZ == 1200
1234 timer_freq = (100UL * hwrpb->intr_freq) / 4096;
1235#else
1236 timer_freq = 100UL * CONFIG_HZ;
1237#endif
1238
1221 seq_printf(f, "cpu\t\t\t: Alpha\n" 1239 seq_printf(f, "cpu\t\t\t: Alpha\n"
1222 "cpu model\t\t: %s\n" 1240 "cpu model\t\t: %s\n"
1223 "cpu variation\t\t: %ld\n" 1241 "cpu variation\t\t: %ld\n"
@@ -1243,8 +1261,7 @@ show_cpuinfo(struct seq_file *f, void *slot)
1243 (char*)hwrpb->ssn, 1261 (char*)hwrpb->ssn,
1244 est_cycle_freq ? : hwrpb->cycle_freq, 1262 est_cycle_freq ? : hwrpb->cycle_freq,
1245 est_cycle_freq ? "est." : "", 1263 est_cycle_freq ? "est." : "",
1246 hwrpb->intr_freq / 4096, 1264 timer_freq / 100, timer_freq % 100,
1247 (100 * hwrpb->intr_freq / 4096) % 100,
1248 hwrpb->pagesize, 1265 hwrpb->pagesize,
1249 hwrpb->pa_bits, 1266 hwrpb->pa_bits,
1250 hwrpb->max_asn, 1267 hwrpb->max_asn,
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 9dbbcb3b9146..99ac36d5de4e 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -138,9 +138,11 @@ smp_callin(void)
138 138
139 /* Get our local ticker going. */ 139 /* Get our local ticker going. */
140 smp_setup_percpu_timer(cpuid); 140 smp_setup_percpu_timer(cpuid);
141 init_clockevent();
141 142
142 /* Call platform-specific callin, if specified */ 143 /* Call platform-specific callin, if specified */
143 if (alpha_mv.smp_callin) alpha_mv.smp_callin(); 144 if (alpha_mv.smp_callin)
145 alpha_mv.smp_callin();
144 146
145 /* All kernel threads share the same mm context. */ 147 /* All kernel threads share the same mm context. */
146 atomic_inc(&init_mm.mm_count); 148 atomic_inc(&init_mm.mm_count);
@@ -498,35 +500,6 @@ smp_cpus_done(unsigned int max_cpus)
498 ((bogosum + 2500) / (5000/HZ)) % 100); 500 ((bogosum + 2500) / (5000/HZ)) % 100);
499} 501}
500 502
501
502void
503smp_percpu_timer_interrupt(struct pt_regs *regs)
504{
505 struct pt_regs *old_regs;
506 int cpu = smp_processor_id();
507 unsigned long user = user_mode(regs);
508 struct cpuinfo_alpha *data = &cpu_data[cpu];
509
510 old_regs = set_irq_regs(regs);
511
512 /* Record kernel PC. */
513 profile_tick(CPU_PROFILING);
514
515 if (!--data->prof_counter) {
516 /* We need to make like a normal interrupt -- otherwise
517 timer interrupts ignore the global interrupt lock,
518 which would be a Bad Thing. */
519 irq_enter();
520
521 update_process_times(user);
522
523 data->prof_counter = data->prof_multiplier;
524
525 irq_exit();
526 }
527 set_irq_regs(old_regs);
528}
529
530int 503int
531setup_profiling_timer(unsigned int multiplier) 504setup_profiling_timer(unsigned int multiplier)
532{ 505{
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c
index 5a0af11b3a61..608f2a7fa0a3 100644
--- a/arch/alpha/kernel/sys_jensen.c
+++ b/arch/alpha/kernel/sys_jensen.c
@@ -224,8 +224,6 @@ struct alpha_machine_vector jensen_mv __initmv = {
224 .machine_check = jensen_machine_check, 224 .machine_check = jensen_machine_check,
225 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, 225 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS,
226 .rtc_port = 0x170, 226 .rtc_port = 0x170,
227 .rtc_get_time = common_get_rtc_time,
228 .rtc_set_time = common_set_rtc_time,
229 227
230 .nr_irqs = 16, 228 .nr_irqs = 16,
231 .device_interrupt = jensen_device_interrupt, 229 .device_interrupt = jensen_device_interrupt,
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index c92e389ff219..f21d61fab678 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -22,7 +22,6 @@
22#include <asm/hwrpb.h> 22#include <asm/hwrpb.h>
23#include <asm/tlbflush.h> 23#include <asm/tlbflush.h>
24#include <asm/vga.h> 24#include <asm/vga.h>
25#include <asm/rtc.h>
26 25
27#include "proto.h" 26#include "proto.h"
28#include "err_impl.h" 27#include "err_impl.h"
@@ -400,57 +399,6 @@ marvel_init_rtc(void)
400 init_rtc_irq(); 399 init_rtc_irq();
401} 400}
402 401
403struct marvel_rtc_time {
404 struct rtc_time *time;
405 int retval;
406};
407
408#ifdef CONFIG_SMP
409static void
410smp_get_rtc_time(void *data)
411{
412 struct marvel_rtc_time *mrt = data;
413 mrt->retval = __get_rtc_time(mrt->time);
414}
415
416static void
417smp_set_rtc_time(void *data)
418{
419 struct marvel_rtc_time *mrt = data;
420 mrt->retval = __set_rtc_time(mrt->time);
421}
422#endif
423
424static unsigned int
425marvel_get_rtc_time(struct rtc_time *time)
426{
427#ifdef CONFIG_SMP
428 struct marvel_rtc_time mrt;
429
430 if (smp_processor_id() != boot_cpuid) {
431 mrt.time = time;
432 smp_call_function_single(boot_cpuid, smp_get_rtc_time, &mrt, 1);
433 return mrt.retval;
434 }
435#endif
436 return __get_rtc_time(time);
437}
438
439static int
440marvel_set_rtc_time(struct rtc_time *time)
441{
442#ifdef CONFIG_SMP
443 struct marvel_rtc_time mrt;
444
445 if (smp_processor_id() != boot_cpuid) {
446 mrt.time = time;
447 smp_call_function_single(boot_cpuid, smp_set_rtc_time, &mrt, 1);
448 return mrt.retval;
449 }
450#endif
451 return __set_rtc_time(time);
452}
453
454static void 402static void
455marvel_smp_callin(void) 403marvel_smp_callin(void)
456{ 404{
@@ -492,8 +440,7 @@ struct alpha_machine_vector marvel_ev7_mv __initmv = {
492 .vector_name = "MARVEL/EV7", 440 .vector_name = "MARVEL/EV7",
493 DO_EV7_MMU, 441 DO_EV7_MMU,
494 .rtc_port = 0x70, 442 .rtc_port = 0x70,
495 .rtc_get_time = marvel_get_rtc_time, 443 .rtc_boot_cpu_only = 1,
496 .rtc_set_time = marvel_set_rtc_time,
497 DO_MARVEL_IO, 444 DO_MARVEL_IO,
498 .machine_check = marvel_machine_check, 445 .machine_check = marvel_machine_check,
499 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, 446 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS,
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index ea3395036556..ee39cee8064c 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -3,13 +3,7 @@
3 * 3 *
4 * Copyright (C) 1991, 1992, 1995, 1999, 2000 Linus Torvalds 4 * Copyright (C) 1991, 1992, 1995, 1999, 2000 Linus Torvalds
5 * 5 *
6 * This file contains the PC-specific time handling details: 6 * This file contains the clocksource time handling.
7 * reading the RTC at bootup, etc..
8 * 1994-07-02 Alan Modra
9 * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
10 * 1995-03-26 Markus Kuhn
11 * fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
12 * precision CMOS clock update
13 * 1997-09-10 Updated NTP code according to technical memorandum Jan '96 7 * 1997-09-10 Updated NTP code according to technical memorandum Jan '96
14 * "A Kernel Model for Precision Timekeeping" by Dave Mills 8 * "A Kernel Model for Precision Timekeeping" by Dave Mills
15 * 1997-01-09 Adrian Sun 9 * 1997-01-09 Adrian Sun
@@ -21,9 +15,6 @@
21 * 1999-04-16 Thorsten Kranzkowski (dl8bcu@gmx.net) 15 * 1999-04-16 Thorsten Kranzkowski (dl8bcu@gmx.net)
22 * fixed algorithm in do_gettimeofday() for calculating the precise time 16 * fixed algorithm in do_gettimeofday() for calculating the precise time
23 * from processor cycle counter (now taking lost_ticks into account) 17 * from processor cycle counter (now taking lost_ticks into account)
24 * 2000-08-13 Jan-Benedict Glaw <jbglaw@lug-owl.de>
25 * Fixed time_init to be aware of epoches != 1900. This prevents
26 * booting up in 2048 for me;) Code is stolen from rtc.c.
27 * 2003-06-03 R. Scott Bailey <scott.bailey@eds.com> 18 * 2003-06-03 R. Scott Bailey <scott.bailey@eds.com>
28 * Tighten sanity in time_init from 1% (10,000 PPM) to 250 PPM 19 * Tighten sanity in time_init from 1% (10,000 PPM) to 250 PPM
29 */ 20 */
@@ -46,40 +37,19 @@
46#include <asm/uaccess.h> 37#include <asm/uaccess.h>
47#include <asm/io.h> 38#include <asm/io.h>
48#include <asm/hwrpb.h> 39#include <asm/hwrpb.h>
49#include <asm/rtc.h>
50 40
51#include <linux/mc146818rtc.h> 41#include <linux/mc146818rtc.h>
52#include <linux/time.h> 42#include <linux/time.h>
53#include <linux/timex.h> 43#include <linux/timex.h>
54#include <linux/clocksource.h> 44#include <linux/clocksource.h>
45#include <linux/clockchips.h>
55 46
56#include "proto.h" 47#include "proto.h"
57#include "irq_impl.h" 48#include "irq_impl.h"
58 49
59static int set_rtc_mmss(unsigned long);
60
61DEFINE_SPINLOCK(rtc_lock); 50DEFINE_SPINLOCK(rtc_lock);
62EXPORT_SYMBOL(rtc_lock); 51EXPORT_SYMBOL(rtc_lock);
63 52
64#define TICK_SIZE (tick_nsec / 1000)
65
66/*
67 * Shift amount by which scaled_ticks_per_cycle is scaled. Shifting
68 * by 48 gives us 16 bits for HZ while keeping the accuracy good even
69 * for large CPU clock rates.
70 */
71#define FIX_SHIFT 48
72
73/* lump static variables together for more efficient access: */
74static struct {
75 /* cycle counter last time it got invoked */
76 __u32 last_time;
77 /* ticks/cycle * 2^48 */
78 unsigned long scaled_ticks_per_cycle;
79 /* partial unused tick */
80 unsigned long partial_tick;
81} state;
82
83unsigned long est_cycle_freq; 53unsigned long est_cycle_freq;
84 54
85#ifdef CONFIG_IRQ_WORK 55#ifdef CONFIG_IRQ_WORK
@@ -108,109 +78,156 @@ static inline __u32 rpcc(void)
108 return __builtin_alpha_rpcc(); 78 return __builtin_alpha_rpcc();
109} 79}
110 80
111int update_persistent_clock(struct timespec now)
112{
113 return set_rtc_mmss(now.tv_sec);
114}
115 81
116void read_persistent_clock(struct timespec *ts) 82
83/*
84 * The RTC as a clock_event_device primitive.
85 */
86
87static DEFINE_PER_CPU(struct clock_event_device, cpu_ce);
88
89irqreturn_t
90rtc_timer_interrupt(int irq, void *dev)
117{ 91{
118 unsigned int year, mon, day, hour, min, sec, epoch; 92 int cpu = smp_processor_id();
119 93 struct clock_event_device *ce = &per_cpu(cpu_ce, cpu);
120 sec = CMOS_READ(RTC_SECONDS);
121 min = CMOS_READ(RTC_MINUTES);
122 hour = CMOS_READ(RTC_HOURS);
123 day = CMOS_READ(RTC_DAY_OF_MONTH);
124 mon = CMOS_READ(RTC_MONTH);
125 year = CMOS_READ(RTC_YEAR);
126
127 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
128 sec = bcd2bin(sec);
129 min = bcd2bin(min);
130 hour = bcd2bin(hour);
131 day = bcd2bin(day);
132 mon = bcd2bin(mon);
133 year = bcd2bin(year);
134 }
135 94
136 /* PC-like is standard; used for year >= 70 */ 95 /* Don't run the hook for UNUSED or SHUTDOWN. */
137 epoch = 1900; 96 if (likely(ce->mode == CLOCK_EVT_MODE_PERIODIC))
138 if (year < 20) 97 ce->event_handler(ce);
139 epoch = 2000;
140 else if (year >= 20 && year < 48)
141 /* NT epoch */
142 epoch = 1980;
143 else if (year >= 48 && year < 70)
144 /* Digital UNIX epoch */
145 epoch = 1952;
146 98
147 printk(KERN_INFO "Using epoch = %d\n", epoch); 99 if (test_irq_work_pending()) {
100 clear_irq_work_pending();
101 irq_work_run();
102 }
148 103
149 if ((year += epoch) < 1970) 104 return IRQ_HANDLED;
150 year += 100; 105}
151 106
152 ts->tv_sec = mktime(year, mon, day, hour, min, sec); 107static void
153 ts->tv_nsec = 0; 108rtc_ce_set_mode(enum clock_event_mode mode, struct clock_event_device *ce)
109{
110 /* The mode member of CE is updated in generic code.
111 Since we only support periodic events, nothing to do. */
112}
113
114static int
115rtc_ce_set_next_event(unsigned long evt, struct clock_event_device *ce)
116{
117 /* This hook is for oneshot mode, which we don't support. */
118 return -EINVAL;
154} 119}
155 120
121static void __init
122init_rtc_clockevent(void)
123{
124 int cpu = smp_processor_id();
125 struct clock_event_device *ce = &per_cpu(cpu_ce, cpu);
126
127 *ce = (struct clock_event_device){
128 .name = "rtc",
129 .features = CLOCK_EVT_FEAT_PERIODIC,
130 .rating = 100,
131 .cpumask = cpumask_of(cpu),
132 .set_mode = rtc_ce_set_mode,
133 .set_next_event = rtc_ce_set_next_event,
134 };
156 135
136 clockevents_config_and_register(ce, CONFIG_HZ, 0, 0);
137}
157 138
139
158/* 140/*
159 * timer_interrupt() needs to keep up the real-time clock, 141 * The QEMU clock as a clocksource primitive.
160 * as well as call the "xtime_update()" routine every clocktick
161 */ 142 */
162irqreturn_t timer_interrupt(int irq, void *dev) 143
144static cycle_t
145qemu_cs_read(struct clocksource *cs)
163{ 146{
164 unsigned long delta; 147 return qemu_get_vmtime();
165 __u32 now; 148}
166 long nticks;
167 149
168#ifndef CONFIG_SMP 150static struct clocksource qemu_cs = {
169 /* Not SMP, do kernel PC profiling here. */ 151 .name = "qemu",
170 profile_tick(CPU_PROFILING); 152 .rating = 400,
171#endif 153 .read = qemu_cs_read,
154 .mask = CLOCKSOURCE_MASK(64),
155 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
156 .max_idle_ns = LONG_MAX
157};
172 158
173 /*
174 * Calculate how many ticks have passed since the last update,
175 * including any previous partial leftover. Save any resulting
176 * fraction for the next pass.
177 */
178 now = rpcc();
179 delta = now - state.last_time;
180 state.last_time = now;
181 delta = delta * state.scaled_ticks_per_cycle + state.partial_tick;
182 state.partial_tick = delta & ((1UL << FIX_SHIFT) - 1);
183 nticks = delta >> FIX_SHIFT;
184 159
185 if (nticks) 160/*
186 xtime_update(nticks); 161 * The QEMU alarm as a clock_event_device primitive.
162 */
187 163
188 if (test_irq_work_pending()) { 164static void
189 clear_irq_work_pending(); 165qemu_ce_set_mode(enum clock_event_mode mode, struct clock_event_device *ce)
190 irq_work_run(); 166{
191 } 167 /* The mode member of CE is updated for us in generic code.
168 Just make sure that the event is disabled. */
169 qemu_set_alarm_abs(0);
170}
192 171
193#ifndef CONFIG_SMP 172static int
194 while (nticks--) 173qemu_ce_set_next_event(unsigned long evt, struct clock_event_device *ce)
195 update_process_times(user_mode(get_irq_regs())); 174{
196#endif 175 qemu_set_alarm_rel(evt);
176 return 0;
177}
197 178
179static irqreturn_t
180qemu_timer_interrupt(int irq, void *dev)
181{
182 int cpu = smp_processor_id();
183 struct clock_event_device *ce = &per_cpu(cpu_ce, cpu);
184
185 ce->event_handler(ce);
198 return IRQ_HANDLED; 186 return IRQ_HANDLED;
199} 187}
200 188
189static void __init
190init_qemu_clockevent(void)
191{
192 int cpu = smp_processor_id();
193 struct clock_event_device *ce = &per_cpu(cpu_ce, cpu);
194
195 *ce = (struct clock_event_device){
196 .name = "qemu",
197 .features = CLOCK_EVT_FEAT_ONESHOT,
198 .rating = 400,
199 .cpumask = cpumask_of(cpu),
200 .set_mode = qemu_ce_set_mode,
201 .set_next_event = qemu_ce_set_next_event,
202 };
203
204 clockevents_config_and_register(ce, NSEC_PER_SEC, 1000, LONG_MAX);
205}
206
207
201void __init 208void __init
202common_init_rtc(void) 209common_init_rtc(void)
203{ 210{
204 unsigned char x; 211 unsigned char x, sel = 0;
205 212
206 /* Reset periodic interrupt frequency. */ 213 /* Reset periodic interrupt frequency. */
207 x = CMOS_READ(RTC_FREQ_SELECT) & 0x3f; 214#if CONFIG_HZ == 1024 || CONFIG_HZ == 1200
208 /* Test includes known working values on various platforms 215 x = CMOS_READ(RTC_FREQ_SELECT) & 0x3f;
209 where 0x26 is wrong; we refuse to change those. */ 216 /* Test includes known working values on various platforms
210 if (x != 0x26 && x != 0x25 && x != 0x19 && x != 0x06) { 217 where 0x26 is wrong; we refuse to change those. */
211 printk("Setting RTC_FREQ to 1024 Hz (%x)\n", x); 218 if (x != 0x26 && x != 0x25 && x != 0x19 && x != 0x06) {
212 CMOS_WRITE(0x26, RTC_FREQ_SELECT); 219 sel = RTC_REF_CLCK_32KHZ + 6;
213 } 220 }
221#elif CONFIG_HZ == 256 || CONFIG_HZ == 128 || CONFIG_HZ == 64 || CONFIG_HZ == 32
222 sel = RTC_REF_CLCK_32KHZ + __builtin_ffs(32768 / CONFIG_HZ);
223#else
224# error "Unknown HZ from arch/alpha/Kconfig"
225#endif
226 if (sel) {
227 printk(KERN_INFO "Setting RTC_FREQ to %d Hz (%x)\n",
228 CONFIG_HZ, sel);
229 CMOS_WRITE(sel, RTC_FREQ_SELECT);
230 }
214 231
215 /* Turn on periodic interrupts. */ 232 /* Turn on periodic interrupts. */
216 x = CMOS_READ(RTC_CONTROL); 233 x = CMOS_READ(RTC_CONTROL);
@@ -233,16 +250,37 @@ common_init_rtc(void)
233 init_rtc_irq(); 250 init_rtc_irq();
234} 251}
235 252
236unsigned int common_get_rtc_time(struct rtc_time *time) 253
237{ 254#ifndef CONFIG_ALPHA_WTINT
238 return __get_rtc_time(time); 255/*
239} 256 * The RPCC as a clocksource primitive.
257 *
258 * While we have free-running timecounters running on all CPUs, and we make
259 * a half-hearted attempt in init_rtc_rpcc_info to sync the timecounter
260 * with the wall clock, that initialization isn't kept up-to-date across
261 * different time counters in SMP mode. Therefore we can only use this
262 * method when there's only one CPU enabled.
263 *
264 * When using the WTINT PALcall, the RPCC may shift to a lower frequency,
265 * or stop altogether, while waiting for the interrupt. Therefore we cannot
266 * use this method when WTINT is in use.
267 */
240 268
241int common_set_rtc_time(struct rtc_time *time) 269static cycle_t read_rpcc(struct clocksource *cs)
242{ 270{
243 return __set_rtc_time(time); 271 return rpcc();
244} 272}
245 273
274static struct clocksource clocksource_rpcc = {
275 .name = "rpcc",
276 .rating = 300,
277 .read = read_rpcc,
278 .mask = CLOCKSOURCE_MASK(32),
279 .flags = CLOCK_SOURCE_IS_CONTINUOUS
280};
281#endif /* ALPHA_WTINT */
282
283
246/* Validate a computed cycle counter result against the known bounds for 284/* Validate a computed cycle counter result against the known bounds for
247 the given processor core. There's too much brokenness in the way of 285 the given processor core. There's too much brokenness in the way of
248 timing hardware for any one method to work everywhere. :-( 286 timing hardware for any one method to work everywhere. :-(
@@ -353,33 +391,6 @@ rpcc_after_update_in_progress(void)
353 return rpcc(); 391 return rpcc();
354} 392}
355 393
356#ifndef CONFIG_SMP
357/* Until and unless we figure out how to get cpu cycle counters
358 in sync and keep them there, we can't use the rpcc. */
359static cycle_t read_rpcc(struct clocksource *cs)
360{
361 cycle_t ret = (cycle_t)rpcc();
362 return ret;
363}
364
365static struct clocksource clocksource_rpcc = {
366 .name = "rpcc",
367 .rating = 300,
368 .read = read_rpcc,
369 .mask = CLOCKSOURCE_MASK(32),
370 .flags = CLOCK_SOURCE_IS_CONTINUOUS
371};
372
373static inline void register_rpcc_clocksource(long cycle_freq)
374{
375 clocksource_register_hz(&clocksource_rpcc, cycle_freq);
376}
377#else /* !CONFIG_SMP */
378static inline void register_rpcc_clocksource(long cycle_freq)
379{
380}
381#endif /* !CONFIG_SMP */
382
383void __init 394void __init
384time_init(void) 395time_init(void)
385{ 396{
@@ -387,6 +398,15 @@ time_init(void)
387 unsigned long cycle_freq, tolerance; 398 unsigned long cycle_freq, tolerance;
388 long diff; 399 long diff;
389 400
401 if (alpha_using_qemu) {
402 clocksource_register_hz(&qemu_cs, NSEC_PER_SEC);
403 init_qemu_clockevent();
404
405 timer_irqaction.handler = qemu_timer_interrupt;
406 init_rtc_irq();
407 return;
408 }
409
390 /* Calibrate CPU clock -- attempt #1. */ 410 /* Calibrate CPU clock -- attempt #1. */
391 if (!est_cycle_freq) 411 if (!est_cycle_freq)
392 est_cycle_freq = validate_cc_value(calibrate_cc_with_pit()); 412 est_cycle_freq = validate_cc_value(calibrate_cc_with_pit());
@@ -421,100 +441,25 @@ time_init(void)
421 "and unable to estimate a proper value!\n"); 441 "and unable to estimate a proper value!\n");
422 } 442 }
423 443
424 /* From John Bowman <bowman@math.ualberta.ca>: allow the values 444 /* See above for restrictions on using clocksource_rpcc. */
425 to settle, as the Update-In-Progress bit going low isn't good 445#ifndef CONFIG_ALPHA_WTINT
426 enough on some hardware. 2ms is our guess; we haven't found 446 if (hwrpb->nr_processors == 1)
427 bogomips yet, but this is close on a 500Mhz box. */ 447 clocksource_register_hz(&clocksource_rpcc, cycle_freq);
428 __delay(1000000); 448#endif
429
430
431 if (HZ > (1<<16)) {
432 extern void __you_loose (void);
433 __you_loose();
434 }
435
436 register_rpcc_clocksource(cycle_freq);
437
438 state.last_time = cc1;
439 state.scaled_ticks_per_cycle
440 = ((unsigned long) HZ << FIX_SHIFT) / cycle_freq;
441 state.partial_tick = 0L;
442 449
443 /* Startup the timer source. */ 450 /* Startup the timer source. */
444 alpha_mv.init_rtc(); 451 alpha_mv.init_rtc();
452 init_rtc_clockevent();
445} 453}
446 454
447/* 455/* Initialize the clock_event_device for secondary cpus. */
448 * In order to set the CMOS clock precisely, set_rtc_mmss has to be 456#ifdef CONFIG_SMP
449 * called 500 ms after the second nowtime has started, because when 457void __init
450 * nowtime is written into the registers of the CMOS clock, it will 458init_clockevent(void)
451 * jump to the next second precisely 500 ms later. Check the Motorola
452 * MC146818A or Dallas DS12887 data sheet for details.
453 *
454 * BUG: This routine does not handle hour overflow properly; it just
455 * sets the minutes. Usually you won't notice until after reboot!
456 */
457
458
459static int
460set_rtc_mmss(unsigned long nowtime)
461{ 459{
462 int retval = 0; 460 if (alpha_using_qemu)
463 int real_seconds, real_minutes, cmos_minutes; 461 init_qemu_clockevent();
464 unsigned char save_control, save_freq_select; 462 else
465 463 init_rtc_clockevent();
466 /* irq are locally disabled here */
467 spin_lock(&rtc_lock);
468 /* Tell the clock it's being set */
469 save_control = CMOS_READ(RTC_CONTROL);
470 CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
471
472 /* Stop and reset prescaler */
473 save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
474 CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
475
476 cmos_minutes = CMOS_READ(RTC_MINUTES);
477 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
478 cmos_minutes = bcd2bin(cmos_minutes);
479
480 /*
481 * since we're only adjusting minutes and seconds,
482 * don't interfere with hour overflow. This avoids
483 * messing with unknown time zones but requires your
484 * RTC not to be off by more than 15 minutes
485 */
486 real_seconds = nowtime % 60;
487 real_minutes = nowtime / 60;
488 if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) {
489 /* correct for half hour time zone */
490 real_minutes += 30;
491 }
492 real_minutes %= 60;
493
494 if (abs(real_minutes - cmos_minutes) < 30) {
495 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
496 real_seconds = bin2bcd(real_seconds);
497 real_minutes = bin2bcd(real_minutes);
498 }
499 CMOS_WRITE(real_seconds,RTC_SECONDS);
500 CMOS_WRITE(real_minutes,RTC_MINUTES);
501 } else {
502 printk_once(KERN_NOTICE
503 "set_rtc_mmss: can't update from %d to %d\n",
504 cmos_minutes, real_minutes);
505 retval = -1;
506 }
507
508 /* The following flags have to be released exactly in this order,
509 * otherwise the DS12887 (popular MC146818A clone with integrated
510 * battery and quartz) will not reset the oscillator and will not
511 * update precisely 500 ms later. You won't find this mentioned in
512 * the Dallas Semiconductor data sheets, but who believes data
513 * sheets anyway ... -- Markus Kuhn
514 */
515 CMOS_WRITE(save_control, RTC_CONTROL);
516 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
517 spin_unlock(&rtc_lock);
518
519 return retval;
520} 464}
465#endif
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index bd0665cdc840..9c4c189eb22f 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -241,6 +241,21 @@ do_entIF(unsigned long type, struct pt_regs *regs)
241 (const char *)(data[1] | (long)data[2] << 32), 241 (const char *)(data[1] | (long)data[2] << 32),
242 data[0]); 242 data[0]);
243 } 243 }
244#ifdef CONFIG_ALPHA_WTINT
245 if (type == 4) {
246 /* If CALL_PAL WTINT is totally unsupported by the
247 PALcode, e.g. MILO, "emulate" it by overwriting
248 the insn. */
249 unsigned int *pinsn
250 = (unsigned int *) regs->pc - 1;
251 if (*pinsn == PAL_wtint) {
252 *pinsn = 0x47e01400; /* mov 0,$0 */
253 imb();
254 regs->r0 = 0;
255 return;
256 }
257 }
258#endif /* ALPHA_WTINT */
244 die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"), 259 die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"),
245 regs, type, NULL); 260 regs, type, NULL);
246 } 261 }
diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c
index ffb19b7da999..ff3c10721caf 100644
--- a/arch/alpha/lib/csum_partial_copy.c
+++ b/arch/alpha/lib/csum_partial_copy.c
@@ -130,7 +130,7 @@ csum_partial_cfu_aligned(const unsigned long __user *src, unsigned long *dst,
130 *dst = word | tmp; 130 *dst = word | tmp;
131 checksum += carry; 131 checksum += carry;
132 } 132 }
133 if (err) *errp = err; 133 if (err && errp) *errp = err;
134 return checksum; 134 return checksum;
135} 135}
136 136
@@ -185,7 +185,7 @@ csum_partial_cfu_dest_aligned(const unsigned long __user *src,
185 *dst = word | tmp; 185 *dst = word | tmp;
186 checksum += carry; 186 checksum += carry;
187 } 187 }
188 if (err) *errp = err; 188 if (err && errp) *errp = err;
189 return checksum; 189 return checksum;
190} 190}
191 191
@@ -242,7 +242,7 @@ csum_partial_cfu_src_aligned(const unsigned long __user *src,
242 stq_u(partial_dest | second_dest, dst); 242 stq_u(partial_dest | second_dest, dst);
243out: 243out:
244 checksum += carry; 244 checksum += carry;
245 if (err) *errp = err; 245 if (err && errp) *errp = err;
246 return checksum; 246 return checksum;
247} 247}
248 248
@@ -325,7 +325,7 @@ csum_partial_cfu_unaligned(const unsigned long __user * src,
325 stq_u(partial_dest | word | second_dest, dst); 325 stq_u(partial_dest | word | second_dest, dst);
326 checksum += carry; 326 checksum += carry;
327 } 327 }
328 if (err) *errp = err; 328 if (err && errp) *errp = err;
329 return checksum; 329 return checksum;
330} 330}
331 331
@@ -339,7 +339,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
339 339
340 if (len) { 340 if (len) {
341 if (!access_ok(VERIFY_READ, src, len)) { 341 if (!access_ok(VERIFY_READ, src, len)) {
342 *errp = -EFAULT; 342 if (errp) *errp = -EFAULT;
343 memset(dst, 0, len); 343 memset(dst, 0, len);
344 return sum; 344 return sum;
345 } 345 }
diff --git a/arch/alpha/lib/ev6-memset.S b/arch/alpha/lib/ev6-memset.S
index d8b94e1c7fca..356bb2fdd705 100644
--- a/arch/alpha/lib/ev6-memset.S
+++ b/arch/alpha/lib/ev6-memset.S
@@ -30,14 +30,15 @@
30 .set noat 30 .set noat
31 .set noreorder 31 .set noreorder
32.text 32.text
33 .globl memset
33 .globl __memset 34 .globl __memset
35 .globl ___memset
34 .globl __memsetw 36 .globl __memsetw
35 .globl __constant_c_memset 37 .globl __constant_c_memset
36 .globl memset
37 38
38 .ent __memset 39 .ent ___memset
39.align 5 40.align 5
40__memset: 41___memset:
41 .frame $30,0,$26,0 42 .frame $30,0,$26,0
42 .prologue 0 43 .prologue 0
43 44
@@ -227,7 +228,7 @@ end_b:
227 nop 228 nop
228 nop 229 nop
229 ret $31,($26),1 # L0 : 230 ret $31,($26),1 # L0 :
230 .end __memset 231 .end ___memset
231 232
232 /* 233 /*
233 * This is the original body of code, prior to replication and 234 * This is the original body of code, prior to replication and
@@ -594,4 +595,5 @@ end_w:
594 595
595 .end __memsetw 596 .end __memsetw
596 597
597memset = __memset 598memset = ___memset
599__memset = ___memset
diff --git a/arch/alpha/lib/memset.S b/arch/alpha/lib/memset.S
index 311b8cfc6914..76ccc6d1f364 100644
--- a/arch/alpha/lib/memset.S
+++ b/arch/alpha/lib/memset.S
@@ -19,11 +19,13 @@
19.text 19.text
20 .globl memset 20 .globl memset
21 .globl __memset 21 .globl __memset
22 .globl ___memset
22 .globl __memsetw 23 .globl __memsetw
23 .globl __constant_c_memset 24 .globl __constant_c_memset
24 .ent __memset 25
26 .ent ___memset
25.align 5 27.align 5
26__memset: 28___memset:
27 .frame $30,0,$26,0 29 .frame $30,0,$26,0
28 .prologue 0 30 .prologue 0
29 31
@@ -103,7 +105,7 @@ within_one_quad:
103 105
104end: 106end:
105 ret $31,($26),1 /* E1 */ 107 ret $31,($26),1 /* E1 */
106 .end __memset 108 .end ___memset
107 109
108 .align 5 110 .align 5
109 .ent __memsetw 111 .ent __memsetw
@@ -121,4 +123,5 @@ __memsetw:
121 123
122 .end __memsetw 124 .end __memsetw
123 125
124memset = __memset 126memset = ___memset
127__memset = ___memset
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 2ee0c9bfd032..9063ae6553cc 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -8,6 +8,7 @@
8 8
9config ARC 9config ARC
10 def_bool y 10 def_bool y
11 select BUILDTIME_EXTABLE_SORT
11 select CLONE_BACKWARDS 12 select CLONE_BACKWARDS
12 # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev 13 # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev
13 select DEVTMPFS if !INITRAMFS_SOURCE="" 14 select DEVTMPFS if !INITRAMFS_SOURCE=""
diff --git a/arch/arc/boot/dts/abilis_tb100.dtsi b/arch/arc/boot/dts/abilis_tb100.dtsi
index d9f8249aa66e..3942634f805a 100644
--- a/arch/arc/boot/dts/abilis_tb100.dtsi
+++ b/arch/arc/boot/dts/abilis_tb100.dtsi
@@ -43,124 +43,124 @@
43 iomux: iomux@FF10601c { 43 iomux: iomux@FF10601c {
44 /* Port 1 */ 44 /* Port 1 */
45 pctl_tsin_s0: pctl-tsin-s0 { /* Serial TS-in 0 */ 45 pctl_tsin_s0: pctl-tsin-s0 { /* Serial TS-in 0 */
46 pingrp = "mis0_pins"; 46 abilis,function = "mis0";
47 }; 47 };
48 pctl_tsin_s1: pctl-tsin-s1 { /* Serial TS-in 1 */ 48 pctl_tsin_s1: pctl-tsin-s1 { /* Serial TS-in 1 */
49 pingrp = "mis1_pins"; 49 abilis,function = "mis1";
50 }; 50 };
51 pctl_gpio_a: pctl-gpio-a { /* GPIO bank A */ 51 pctl_gpio_a: pctl-gpio-a { /* GPIO bank A */
52 pingrp = "gpioa_pins"; 52 abilis,function = "gpioa";
53 }; 53 };
54 pctl_tsin_p1: pctl-tsin-p1 { /* Parallel TS-in 1 */ 54 pctl_tsin_p1: pctl-tsin-p1 { /* Parallel TS-in 1 */
55 pingrp = "mip1_pins"; 55 abilis,function = "mip1";
56 }; 56 };
57 /* Port 2 */ 57 /* Port 2 */
58 pctl_tsin_s2: pctl-tsin-s2 { /* Serial TS-in 2 */ 58 pctl_tsin_s2: pctl-tsin-s2 { /* Serial TS-in 2 */
59 pingrp = "mis2_pins"; 59 abilis,function = "mis2";
60 }; 60 };
61 pctl_tsin_s3: pctl-tsin-s3 { /* Serial TS-in 3 */ 61 pctl_tsin_s3: pctl-tsin-s3 { /* Serial TS-in 3 */
62 pingrp = "mis3_pins"; 62 abilis,function = "mis3";
63 }; 63 };
64 pctl_gpio_c: pctl-gpio-c { /* GPIO bank C */ 64 pctl_gpio_c: pctl-gpio-c { /* GPIO bank C */
65 pingrp = "gpioc_pins"; 65 abilis,function = "gpioc";
66 }; 66 };
67 pctl_tsin_p3: pctl-tsin-p3 { /* Parallel TS-in 3 */ 67 pctl_tsin_p3: pctl-tsin-p3 { /* Parallel TS-in 3 */
68 pingrp = "mip3_pins"; 68 abilis,function = "mip3";
69 }; 69 };
70 /* Port 3 */ 70 /* Port 3 */
71 pctl_tsin_s4: pctl-tsin-s4 { /* Serial TS-in 4 */ 71 pctl_tsin_s4: pctl-tsin-s4 { /* Serial TS-in 4 */
72 pingrp = "mis4_pins"; 72 abilis,function = "mis4";
73 }; 73 };
74 pctl_tsin_s5: pctl-tsin-s5 { /* Serial TS-in 5 */ 74 pctl_tsin_s5: pctl-tsin-s5 { /* Serial TS-in 5 */
75 pingrp = "mis5_pins"; 75 abilis,function = "mis5";
76 }; 76 };
77 pctl_gpio_e: pctl-gpio-e { /* GPIO bank E */ 77 pctl_gpio_e: pctl-gpio-e { /* GPIO bank E */
78 pingrp = "gpioe_pins"; 78 abilis,function = "gpioe";
79 }; 79 };
80 pctl_tsin_p5: pctl-tsin-p5 { /* Parallel TS-in 5 */ 80 pctl_tsin_p5: pctl-tsin-p5 { /* Parallel TS-in 5 */
81 pingrp = "mip5_pins"; 81 abilis,function = "mip5";
82 }; 82 };
83 /* Port 4 */ 83 /* Port 4 */
84 pctl_tsin_s6: pctl-tsin-s6 { /* Serial TS-in 6 */ 84 pctl_tsin_s6: pctl-tsin-s6 { /* Serial TS-in 6 */
85 pingrp = "mis6_pins"; 85 abilis,function = "mis6";
86 }; 86 };
87 pctl_tsin_s7: pctl-tsin-s7 { /* Serial TS-in 7 */ 87 pctl_tsin_s7: pctl-tsin-s7 { /* Serial TS-in 7 */
88 pingrp = "mis7_pins"; 88 abilis,function = "mis7";
89 }; 89 };
90 pctl_gpio_g: pctl-gpio-g { /* GPIO bank G */ 90 pctl_gpio_g: pctl-gpio-g { /* GPIO bank G */
91 pingrp = "gpiog_pins"; 91 abilis,function = "gpiog";
92 }; 92 };
93 pctl_tsin_p7: pctl-tsin-p7 { /* Parallel TS-in 7 */ 93 pctl_tsin_p7: pctl-tsin-p7 { /* Parallel TS-in 7 */
94 pingrp = "mip7_pins"; 94 abilis,function = "mip7";
95 }; 95 };
96 /* Port 5 */ 96 /* Port 5 */
97 pctl_gpio_j: pctl-gpio-j { /* GPIO bank J */ 97 pctl_gpio_j: pctl-gpio-j { /* GPIO bank J */
98 pingrp = "gpioj_pins"; 98 abilis,function = "gpioj";
99 }; 99 };
100 pctl_gpio_k: pctl-gpio-k { /* GPIO bank K */ 100 pctl_gpio_k: pctl-gpio-k { /* GPIO bank K */
101 pingrp = "gpiok_pins"; 101 abilis,function = "gpiok";
102 }; 102 };
103 pctl_ciplus: pctl-ciplus { /* CI+ interface */ 103 pctl_ciplus: pctl-ciplus { /* CI+ interface */
104 pingrp = "ciplus_pins"; 104 abilis,function = "ciplus";
105 }; 105 };
106 pctl_mcard: pctl-mcard { /* M-Card interface */ 106 pctl_mcard: pctl-mcard { /* M-Card interface */
107 pingrp = "mcard_pins"; 107 abilis,function = "mcard";
108 }; 108 };
109 /* Port 6 */ 109 /* Port 6 */
110 pctl_tsout_p: pctl-tsout-p { /* Parallel TS-out */ 110 pctl_tsout_p: pctl-tsout-p { /* Parallel TS-out */
111 pingrp = "mop_pins"; 111 abilis,function = "mop";
112 }; 112 };
113 pctl_tsout_s0: pctl-tsout-s0 { /* Serial TS-out 0 */ 113 pctl_tsout_s0: pctl-tsout-s0 { /* Serial TS-out 0 */
114 pingrp = "mos0_pins"; 114 abilis,function = "mos0";
115 }; 115 };
116 pctl_tsout_s1: pctl-tsout-s1 { /* Serial TS-out 1 */ 116 pctl_tsout_s1: pctl-tsout-s1 { /* Serial TS-out 1 */
117 pingrp = "mos1_pins"; 117 abilis,function = "mos1";
118 }; 118 };
119 pctl_tsout_s2: pctl-tsout-s2 { /* Serial TS-out 2 */ 119 pctl_tsout_s2: pctl-tsout-s2 { /* Serial TS-out 2 */
120 pingrp = "mos2_pins"; 120 abilis,function = "mos2";
121 }; 121 };
122 pctl_tsout_s3: pctl-tsout-s3 { /* Serial TS-out 3 */ 122 pctl_tsout_s3: pctl-tsout-s3 { /* Serial TS-out 3 */
123 pingrp = "mos3_pins"; 123 abilis,function = "mos3";
124 }; 124 };
125 /* Port 7 */ 125 /* Port 7 */
126 pctl_uart0: pctl-uart0 { /* UART 0 */ 126 pctl_uart0: pctl-uart0 { /* UART 0 */
127 pingrp = "uart0_pins"; 127 abilis,function = "uart0";
128 }; 128 };
129 pctl_uart1: pctl-uart1 { /* UART 1 */ 129 pctl_uart1: pctl-uart1 { /* UART 1 */
130 pingrp = "uart1_pins"; 130 abilis,function = "uart1";
131 }; 131 };
132 pctl_gpio_l: pctl-gpio-l { /* GPIO bank L */ 132 pctl_gpio_l: pctl-gpio-l { /* GPIO bank L */
133 pingrp = "gpiol_pins"; 133 abilis,function = "gpiol";
134 }; 134 };
135 pctl_gpio_m: pctl-gpio-m { /* GPIO bank M */ 135 pctl_gpio_m: pctl-gpio-m { /* GPIO bank M */
136 pingrp = "gpiom_pins"; 136 abilis,function = "gpiom";
137 }; 137 };
138 /* Port 8 */ 138 /* Port 8 */
139 pctl_spi3: pctl-spi3 { 139 pctl_spi3: pctl-spi3 {
140 pingrp = "spi3_pins"; 140 abilis,function = "spi3";
141 }; 141 };
142 /* Port 9 */ 142 /* Port 9 */
143 pctl_spi1: pctl-spi1 { 143 pctl_spi1: pctl-spi1 {
144 pingrp = "spi1_pins"; 144 abilis,function = "spi1";
145 }; 145 };
146 pctl_gpio_n: pctl-gpio-n { 146 pctl_gpio_n: pctl-gpio-n {
147 pingrp = "gpion_pins"; 147 abilis,function = "gpion";
148 }; 148 };
149 /* Unmuxed GPIOs */ 149 /* Unmuxed GPIOs */
150 pctl_gpio_b: pctl-gpio-b { 150 pctl_gpio_b: pctl-gpio-b {
151 pingrp = "gpiob_pins"; 151 abilis,function = "gpiob";
152 }; 152 };
153 pctl_gpio_d: pctl-gpio-d { 153 pctl_gpio_d: pctl-gpio-d {
154 pingrp = "gpiod_pins"; 154 abilis,function = "gpiod";
155 }; 155 };
156 pctl_gpio_f: pctl-gpio-f { 156 pctl_gpio_f: pctl-gpio-f {
157 pingrp = "gpiof_pins"; 157 abilis,function = "gpiof";
158 }; 158 };
159 pctl_gpio_h: pctl-gpio-h { 159 pctl_gpio_h: pctl-gpio-h {
160 pingrp = "gpioh_pins"; 160 abilis,function = "gpioh";
161 }; 161 };
162 pctl_gpio_i: pctl-gpio-i { 162 pctl_gpio_i: pctl-gpio-i {
163 pingrp = "gpioi_pins"; 163 abilis,function = "gpioi";
164 }; 164 };
165 }; 165 };
166 166
@@ -172,9 +172,10 @@
172 interrupts = <27 2>; 172 interrupts = <27 2>;
173 reg = <0xFF140000 0x1000>; 173 reg = <0xFF140000 0x1000>;
174 gpio-controller; 174 gpio-controller;
175 #gpio-cells = <1>; 175 #gpio-cells = <2>;
176 gpio-base = <0>; 176 abilis,ngpio = <3>;
177 gpio-pins = <&pctl_gpio_a>; 177 gpio-ranges = <&iomux 0 0 0>;
178 gpio-ranges-group-names = "gpioa";
178 }; 179 };
179 gpiob: gpio@FF141000 { 180 gpiob: gpio@FF141000 {
180 compatible = "abilis,tb10x-gpio"; 181 compatible = "abilis,tb10x-gpio";
@@ -184,9 +185,10 @@
184 interrupts = <27 2>; 185 interrupts = <27 2>;
185 reg = <0xFF141000 0x1000>; 186 reg = <0xFF141000 0x1000>;
186 gpio-controller; 187 gpio-controller;
187 #gpio-cells = <1>; 188 #gpio-cells = <2>;
188 gpio-base = <3>; 189 abilis,ngpio = <2>;
189 gpio-pins = <&pctl_gpio_b>; 190 gpio-ranges = <&iomux 0 0 0>;
191 gpio-ranges-group-names = "gpiob";
190 }; 192 };
191 gpioc: gpio@FF142000 { 193 gpioc: gpio@FF142000 {
192 compatible = "abilis,tb10x-gpio"; 194 compatible = "abilis,tb10x-gpio";
@@ -196,9 +198,10 @@
196 interrupts = <27 2>; 198 interrupts = <27 2>;
197 reg = <0xFF142000 0x1000>; 199 reg = <0xFF142000 0x1000>;
198 gpio-controller; 200 gpio-controller;
199 #gpio-cells = <1>; 201 #gpio-cells = <2>;
200 gpio-base = <5>; 202 abilis,ngpio = <3>;
201 gpio-pins = <&pctl_gpio_c>; 203 gpio-ranges = <&iomux 0 0 0>;
204 gpio-ranges-group-names = "gpioc";
202 }; 205 };
203 gpiod: gpio@FF143000 { 206 gpiod: gpio@FF143000 {
204 compatible = "abilis,tb10x-gpio"; 207 compatible = "abilis,tb10x-gpio";
@@ -208,9 +211,10 @@
208 interrupts = <27 2>; 211 interrupts = <27 2>;
209 reg = <0xFF143000 0x1000>; 212 reg = <0xFF143000 0x1000>;
210 gpio-controller; 213 gpio-controller;
211 #gpio-cells = <1>; 214 #gpio-cells = <2>;
212 gpio-base = <8>; 215 abilis,ngpio = <2>;
213 gpio-pins = <&pctl_gpio_d>; 216 gpio-ranges = <&iomux 0 0 0>;
217 gpio-ranges-group-names = "gpiod";
214 }; 218 };
215 gpioe: gpio@FF144000 { 219 gpioe: gpio@FF144000 {
216 compatible = "abilis,tb10x-gpio"; 220 compatible = "abilis,tb10x-gpio";
@@ -220,9 +224,10 @@
220 interrupts = <27 2>; 224 interrupts = <27 2>;
221 reg = <0xFF144000 0x1000>; 225 reg = <0xFF144000 0x1000>;
222 gpio-controller; 226 gpio-controller;
223 #gpio-cells = <1>; 227 #gpio-cells = <2>;
224 gpio-base = <10>; 228 abilis,ngpio = <3>;
225 gpio-pins = <&pctl_gpio_e>; 229 gpio-ranges = <&iomux 0 0 0>;
230 gpio-ranges-group-names = "gpioe";
226 }; 231 };
227 gpiof: gpio@FF145000 { 232 gpiof: gpio@FF145000 {
228 compatible = "abilis,tb10x-gpio"; 233 compatible = "abilis,tb10x-gpio";
@@ -232,9 +237,10 @@
232 interrupts = <27 2>; 237 interrupts = <27 2>;
233 reg = <0xFF145000 0x1000>; 238 reg = <0xFF145000 0x1000>;
234 gpio-controller; 239 gpio-controller;
235 #gpio-cells = <1>; 240 #gpio-cells = <2>;
236 gpio-base = <13>; 241 abilis,ngpio = <2>;
237 gpio-pins = <&pctl_gpio_f>; 242 gpio-ranges = <&iomux 0 0 0>;
243 gpio-ranges-group-names = "gpiof";
238 }; 244 };
239 gpiog: gpio@FF146000 { 245 gpiog: gpio@FF146000 {
240 compatible = "abilis,tb10x-gpio"; 246 compatible = "abilis,tb10x-gpio";
@@ -244,9 +250,10 @@
244 interrupts = <27 2>; 250 interrupts = <27 2>;
245 reg = <0xFF146000 0x1000>; 251 reg = <0xFF146000 0x1000>;
246 gpio-controller; 252 gpio-controller;
247 #gpio-cells = <1>; 253 #gpio-cells = <2>;
248 gpio-base = <15>; 254 abilis,ngpio = <3>;
249 gpio-pins = <&pctl_gpio_g>; 255 gpio-ranges = <&iomux 0 0 0>;
256 gpio-ranges-group-names = "gpiog";
250 }; 257 };
251 gpioh: gpio@FF147000 { 258 gpioh: gpio@FF147000 {
252 compatible = "abilis,tb10x-gpio"; 259 compatible = "abilis,tb10x-gpio";
@@ -256,9 +263,10 @@
256 interrupts = <27 2>; 263 interrupts = <27 2>;
257 reg = <0xFF147000 0x1000>; 264 reg = <0xFF147000 0x1000>;
258 gpio-controller; 265 gpio-controller;
259 #gpio-cells = <1>; 266 #gpio-cells = <2>;
260 gpio-base = <18>; 267 abilis,ngpio = <2>;
261 gpio-pins = <&pctl_gpio_h>; 268 gpio-ranges = <&iomux 0 0 0>;
269 gpio-ranges-group-names = "gpioh";
262 }; 270 };
263 gpioi: gpio@FF148000 { 271 gpioi: gpio@FF148000 {
264 compatible = "abilis,tb10x-gpio"; 272 compatible = "abilis,tb10x-gpio";
@@ -268,9 +276,10 @@
268 interrupts = <27 2>; 276 interrupts = <27 2>;
269 reg = <0xFF148000 0x1000>; 277 reg = <0xFF148000 0x1000>;
270 gpio-controller; 278 gpio-controller;
271 #gpio-cells = <1>; 279 #gpio-cells = <2>;
272 gpio-base = <20>; 280 abilis,ngpio = <12>;
273 gpio-pins = <&pctl_gpio_i>; 281 gpio-ranges = <&iomux 0 0 0>;
282 gpio-ranges-group-names = "gpioi";
274 }; 283 };
275 gpioj: gpio@FF149000 { 284 gpioj: gpio@FF149000 {
276 compatible = "abilis,tb10x-gpio"; 285 compatible = "abilis,tb10x-gpio";
@@ -280,9 +289,10 @@
280 interrupts = <27 2>; 289 interrupts = <27 2>;
281 reg = <0xFF149000 0x1000>; 290 reg = <0xFF149000 0x1000>;
282 gpio-controller; 291 gpio-controller;
283 #gpio-cells = <1>; 292 #gpio-cells = <2>;
284 gpio-base = <32>; 293 abilis,ngpio = <32>;
285 gpio-pins = <&pctl_gpio_j>; 294 gpio-ranges = <&iomux 0 0 0>;
295 gpio-ranges-group-names = "gpioj";
286 }; 296 };
287 gpiok: gpio@FF14a000 { 297 gpiok: gpio@FF14a000 {
288 compatible = "abilis,tb10x-gpio"; 298 compatible = "abilis,tb10x-gpio";
@@ -292,9 +302,10 @@
292 interrupts = <27 2>; 302 interrupts = <27 2>;
293 reg = <0xFF14A000 0x1000>; 303 reg = <0xFF14A000 0x1000>;
294 gpio-controller; 304 gpio-controller;
295 #gpio-cells = <1>; 305 #gpio-cells = <2>;
296 gpio-base = <64>; 306 abilis,ngpio = <22>;
297 gpio-pins = <&pctl_gpio_k>; 307 gpio-ranges = <&iomux 0 0 0>;
308 gpio-ranges-group-names = "gpiok";
298 }; 309 };
299 gpiol: gpio@FF14b000 { 310 gpiol: gpio@FF14b000 {
300 compatible = "abilis,tb10x-gpio"; 311 compatible = "abilis,tb10x-gpio";
@@ -304,9 +315,10 @@
304 interrupts = <27 2>; 315 interrupts = <27 2>;
305 reg = <0xFF14B000 0x1000>; 316 reg = <0xFF14B000 0x1000>;
306 gpio-controller; 317 gpio-controller;
307 #gpio-cells = <1>; 318 #gpio-cells = <2>;
308 gpio-base = <86>; 319 abilis,ngpio = <4>;
309 gpio-pins = <&pctl_gpio_l>; 320 gpio-ranges = <&iomux 0 0 0>;
321 gpio-ranges-group-names = "gpiol";
310 }; 322 };
311 gpiom: gpio@FF14c000 { 323 gpiom: gpio@FF14c000 {
312 compatible = "abilis,tb10x-gpio"; 324 compatible = "abilis,tb10x-gpio";
@@ -316,9 +328,10 @@
316 interrupts = <27 2>; 328 interrupts = <27 2>;
317 reg = <0xFF14C000 0x1000>; 329 reg = <0xFF14C000 0x1000>;
318 gpio-controller; 330 gpio-controller;
319 #gpio-cells = <1>; 331 #gpio-cells = <2>;
320 gpio-base = <90>; 332 abilis,ngpio = <4>;
321 gpio-pins = <&pctl_gpio_m>; 333 gpio-ranges = <&iomux 0 0 0>;
334 gpio-ranges-group-names = "gpiom";
322 }; 335 };
323 gpion: gpio@FF14d000 { 336 gpion: gpio@FF14d000 {
324 compatible = "abilis,tb10x-gpio"; 337 compatible = "abilis,tb10x-gpio";
@@ -328,9 +341,10 @@
328 interrupts = <27 2>; 341 interrupts = <27 2>;
329 reg = <0xFF14D000 0x1000>; 342 reg = <0xFF14D000 0x1000>;
330 gpio-controller; 343 gpio-controller;
331 #gpio-cells = <1>; 344 #gpio-cells = <2>;
332 gpio-base = <94>; 345 abilis,ngpio = <5>;
333 gpio-pins = <&pctl_gpio_n>; 346 gpio-ranges = <&iomux 0 0 0>;
347 gpio-ranges-group-names = "gpion";
334 }; 348 };
335 }; 349 };
336}; 350};
diff --git a/arch/arc/boot/dts/abilis_tb100_dvk.dts b/arch/arc/boot/dts/abilis_tb100_dvk.dts
index ebc313a9f5b2..3dd6ed941464 100644
--- a/arch/arc/boot/dts/abilis_tb100_dvk.dts
+++ b/arch/arc/boot/dts/abilis_tb100_dvk.dts
@@ -64,62 +64,62 @@
64 compatible = "gpio-leds"; 64 compatible = "gpio-leds";
65 power { 65 power {
66 label = "Power"; 66 label = "Power";
67 gpios = <&gpioi 0>; 67 gpios = <&gpioi 0 0>;
68 linux,default-trigger = "default-on"; 68 linux,default-trigger = "default-on";
69 }; 69 };
70 heartbeat { 70 heartbeat {
71 label = "Heartbeat"; 71 label = "Heartbeat";
72 gpios = <&gpioi 1>; 72 gpios = <&gpioi 1 0>;
73 linux,default-trigger = "heartbeat"; 73 linux,default-trigger = "heartbeat";
74 }; 74 };
75 led2 { 75 led2 {
76 label = "LED2"; 76 label = "LED2";
77 gpios = <&gpioi 2>; 77 gpios = <&gpioi 2 0>;
78 default-state = "off"; 78 default-state = "off";
79 }; 79 };
80 led3 { 80 led3 {
81 label = "LED3"; 81 label = "LED3";
82 gpios = <&gpioi 3>; 82 gpios = <&gpioi 3 0>;
83 default-state = "off"; 83 default-state = "off";
84 }; 84 };
85 led4 { 85 led4 {
86 label = "LED4"; 86 label = "LED4";
87 gpios = <&gpioi 4>; 87 gpios = <&gpioi 4 0>;
88 default-state = "off"; 88 default-state = "off";
89 }; 89 };
90 led5 { 90 led5 {
91 label = "LED5"; 91 label = "LED5";
92 gpios = <&gpioi 5>; 92 gpios = <&gpioi 5 0>;
93 default-state = "off"; 93 default-state = "off";
94 }; 94 };
95 led6 { 95 led6 {
96 label = "LED6"; 96 label = "LED6";
97 gpios = <&gpioi 6>; 97 gpios = <&gpioi 6 0>;
98 default-state = "off"; 98 default-state = "off";
99 }; 99 };
100 led7 { 100 led7 {
101 label = "LED7"; 101 label = "LED7";
102 gpios = <&gpioi 7>; 102 gpios = <&gpioi 7 0>;
103 default-state = "off"; 103 default-state = "off";
104 }; 104 };
105 led8 { 105 led8 {
106 label = "LED8"; 106 label = "LED8";
107 gpios = <&gpioi 8>; 107 gpios = <&gpioi 8 0>;
108 default-state = "off"; 108 default-state = "off";
109 }; 109 };
110 led9 { 110 led9 {
111 label = "LED9"; 111 label = "LED9";
112 gpios = <&gpioi 9>; 112 gpios = <&gpioi 9 0>;
113 default-state = "off"; 113 default-state = "off";
114 }; 114 };
115 led10 { 115 led10 {
116 label = "LED10"; 116 label = "LED10";
117 gpios = <&gpioi 10>; 117 gpios = <&gpioi 10 0>;
118 default-state = "off"; 118 default-state = "off";
119 }; 119 };
120 led11 { 120 led11 {
121 label = "LED11"; 121 label = "LED11";
122 gpios = <&gpioi 11>; 122 gpios = <&gpioi 11 0>;
123 default-state = "off"; 123 default-state = "off";
124 }; 124 };
125 }; 125 };
diff --git a/arch/arc/boot/dts/abilis_tb101.dtsi b/arch/arc/boot/dts/abilis_tb101.dtsi
index da8ca7941e67..b0467229a5c4 100644
--- a/arch/arc/boot/dts/abilis_tb101.dtsi
+++ b/arch/arc/boot/dts/abilis_tb101.dtsi
@@ -43,133 +43,133 @@
43 iomux: iomux@FF10601c { 43 iomux: iomux@FF10601c {
44 /* Port 1 */ 44 /* Port 1 */
45 pctl_tsin_s0: pctl-tsin-s0 { /* Serial TS-in 0 */ 45 pctl_tsin_s0: pctl-tsin-s0 { /* Serial TS-in 0 */
46 pingrp = "mis0_pins"; 46 abilis,function = "mis0";
47 }; 47 };
48 pctl_tsin_s1: pctl-tsin-s1 { /* Serial TS-in 1 */ 48 pctl_tsin_s1: pctl-tsin-s1 { /* Serial TS-in 1 */
49 pingrp = "mis1_pins"; 49 abilis,function = "mis1";
50 }; 50 };
51 pctl_gpio_a: pctl-gpio-a { /* GPIO bank A */ 51 pctl_gpio_a: pctl-gpio-a { /* GPIO bank A */
52 pingrp = "gpioa_pins"; 52 abilis,function = "gpioa";
53 }; 53 };
54 pctl_tsin_p1: pctl-tsin-p1 { /* Parallel TS-in 1 */ 54 pctl_tsin_p1: pctl-tsin-p1 { /* Parallel TS-in 1 */
55 pingrp = "mip1_pins"; 55 abilis,function = "mip1";
56 }; 56 };
57 /* Port 2 */ 57 /* Port 2 */
58 pctl_tsin_s2: pctl-tsin-s2 { /* Serial TS-in 2 */ 58 pctl_tsin_s2: pctl-tsin-s2 { /* Serial TS-in 2 */
59 pingrp = "mis2_pins"; 59 abilis,function = "mis2";
60 }; 60 };
61 pctl_tsin_s3: pctl-tsin-s3 { /* Serial TS-in 3 */ 61 pctl_tsin_s3: pctl-tsin-s3 { /* Serial TS-in 3 */
62 pingrp = "mis3_pins"; 62 abilis,function = "mis3";
63 }; 63 };
64 pctl_gpio_c: pctl-gpio-c { /* GPIO bank C */ 64 pctl_gpio_c: pctl-gpio-c { /* GPIO bank C */
65 pingrp = "gpioc_pins"; 65 abilis,function = "gpioc";
66 }; 66 };
67 pctl_tsin_p3: pctl-tsin-p3 { /* Parallel TS-in 3 */ 67 pctl_tsin_p3: pctl-tsin-p3 { /* Parallel TS-in 3 */
68 pingrp = "mip3_pins"; 68 abilis,function = "mip3";
69 }; 69 };
70 /* Port 3 */ 70 /* Port 3 */
71 pctl_tsin_s4: pctl-tsin-s4 { /* Serial TS-in 4 */ 71 pctl_tsin_s4: pctl-tsin-s4 { /* Serial TS-in 4 */
72 pingrp = "mis4_pins"; 72 abilis,function = "mis4";
73 }; 73 };
74 pctl_tsin_s5: pctl-tsin-s5 { /* Serial TS-in 5 */ 74 pctl_tsin_s5: pctl-tsin-s5 { /* Serial TS-in 5 */
75 pingrp = "mis5_pins"; 75 abilis,function = "mis5";
76 }; 76 };
77 pctl_gpio_e: pctl-gpio-e { /* GPIO bank E */ 77 pctl_gpio_e: pctl-gpio-e { /* GPIO bank E */
78 pingrp = "gpioe_pins"; 78 abilis,function = "gpioe";
79 }; 79 };
80 pctl_tsin_p5: pctl-tsin-p5 { /* Parallel TS-in 5 */ 80 pctl_tsin_p5: pctl-tsin-p5 { /* Parallel TS-in 5 */
81 pingrp = "mip5_pins"; 81 abilis,function = "mip5";
82 }; 82 };
83 /* Port 4 */ 83 /* Port 4 */
84 pctl_tsin_s6: pctl-tsin-s6 { /* Serial TS-in 6 */ 84 pctl_tsin_s6: pctl-tsin-s6 { /* Serial TS-in 6 */
85 pingrp = "mis6_pins"; 85 abilis,function = "mis6";
86 }; 86 };
87 pctl_tsin_s7: pctl-tsin-s7 { /* Serial TS-in 7 */ 87 pctl_tsin_s7: pctl-tsin-s7 { /* Serial TS-in 7 */
88 pingrp = "mis7_pins"; 88 abilis,function = "mis7";
89 }; 89 };
90 pctl_gpio_g: pctl-gpio-g { /* GPIO bank G */ 90 pctl_gpio_g: pctl-gpio-g { /* GPIO bank G */
91 pingrp = "gpiog_pins"; 91 abilis,function = "gpiog";
92 }; 92 };
93 pctl_tsin_p7: pctl-tsin-p7 { /* Parallel TS-in 7 */ 93 pctl_tsin_p7: pctl-tsin-p7 { /* Parallel TS-in 7 */
94 pingrp = "mip7_pins"; 94 abilis,function = "mip7";
95 }; 95 };
96 /* Port 5 */ 96 /* Port 5 */
97 pctl_gpio_j: pctl-gpio-j { /* GPIO bank J */ 97 pctl_gpio_j: pctl-gpio-j { /* GPIO bank J */
98 pingrp = "gpioj_pins"; 98 abilis,function = "gpioj";
99 }; 99 };
100 pctl_gpio_k: pctl-gpio-k { /* GPIO bank K */ 100 pctl_gpio_k: pctl-gpio-k { /* GPIO bank K */
101 pingrp = "gpiok_pins"; 101 abilis,function = "gpiok";
102 }; 102 };
103 pctl_ciplus: pctl-ciplus { /* CI+ interface */ 103 pctl_ciplus: pctl-ciplus { /* CI+ interface */
104 pingrp = "ciplus_pins"; 104 abilis,function = "ciplus";
105 }; 105 };
106 pctl_mcard: pctl-mcard { /* M-Card interface */ 106 pctl_mcard: pctl-mcard { /* M-Card interface */
107 pingrp = "mcard_pins"; 107 abilis,function = "mcard";
108 }; 108 };
109 pctl_stc0: pctl-stc0 { /* Smart card I/F 0 */ 109 pctl_stc0: pctl-stc0 { /* Smart card I/F 0 */
110 pingrp = "stc0_pins"; 110 abilis,function = "stc0";
111 }; 111 };
112 pctl_stc1: pctl-stc1 { /* Smart card I/F 1 */ 112 pctl_stc1: pctl-stc1 { /* Smart card I/F 1 */
113 pingrp = "stc1_pins"; 113 abilis,function = "stc1";
114 }; 114 };
115 /* Port 6 */ 115 /* Port 6 */
116 pctl_tsout_p: pctl-tsout-p { /* Parallel TS-out */ 116 pctl_tsout_p: pctl-tsout-p { /* Parallel TS-out */
117 pingrp = "mop_pins"; 117 abilis,function = "mop";
118 }; 118 };
119 pctl_tsout_s0: pctl-tsout-s0 { /* Serial TS-out 0 */ 119 pctl_tsout_s0: pctl-tsout-s0 { /* Serial TS-out 0 */
120 pingrp = "mos0_pins"; 120 abilis,function = "mos0";
121 }; 121 };
122 pctl_tsout_s1: pctl-tsout-s1 { /* Serial TS-out 1 */ 122 pctl_tsout_s1: pctl-tsout-s1 { /* Serial TS-out 1 */
123 pingrp = "mos1_pins"; 123 abilis,function = "mos1";
124 }; 124 };
125 pctl_tsout_s2: pctl-tsout-s2 { /* Serial TS-out 2 */ 125 pctl_tsout_s2: pctl-tsout-s2 { /* Serial TS-out 2 */
126 pingrp = "mos2_pins"; 126 abilis,function = "mos2";
127 }; 127 };
128 pctl_tsout_s3: pctl-tsout-s3 { /* Serial TS-out 3 */ 128 pctl_tsout_s3: pctl-tsout-s3 { /* Serial TS-out 3 */
129 pingrp = "mos3_pins"; 129 abilis,function = "mos3";
130 }; 130 };
131 /* Port 7 */ 131 /* Port 7 */
132 pctl_uart0: pctl-uart0 { /* UART 0 */ 132 pctl_uart0: pctl-uart0 { /* UART 0 */
133 pingrp = "uart0_pins"; 133 abilis,function = "uart0";
134 }; 134 };
135 pctl_uart1: pctl-uart1 { /* UART 1 */ 135 pctl_uart1: pctl-uart1 { /* UART 1 */
136 pingrp = "uart1_pins"; 136 abilis,function = "uart1";
137 }; 137 };
138 pctl_gpio_l: pctl-gpio-l { /* GPIO bank L */ 138 pctl_gpio_l: pctl-gpio-l { /* GPIO bank L */
139 pingrp = "gpiol_pins"; 139 abilis,function = "gpiol";
140 }; 140 };
141 pctl_gpio_m: pctl-gpio-m { /* GPIO bank M */ 141 pctl_gpio_m: pctl-gpio-m { /* GPIO bank M */
142 pingrp = "gpiom_pins"; 142 abilis,function = "gpiom";
143 }; 143 };
144 /* Port 8 */ 144 /* Port 8 */
145 pctl_spi3: pctl-spi3 { 145 pctl_spi3: pctl-spi3 {
146 pingrp = "spi3_pins"; 146 abilis,function = "spi3";
147 }; 147 };
148 pctl_jtag: pctl-jtag { 148 pctl_jtag: pctl-jtag {
149 pingrp = "jtag_pins"; 149 abilis,function = "jtag";
150 }; 150 };
151 /* Port 9 */ 151 /* Port 9 */
152 pctl_spi1: pctl-spi1 { 152 pctl_spi1: pctl-spi1 {
153 pingrp = "spi1_pins"; 153 abilis,function = "spi1";
154 }; 154 };
155 pctl_gpio_n: pctl-gpio-n { 155 pctl_gpio_n: pctl-gpio-n {
156 pingrp = "gpion_pins"; 156 abilis,function = "gpion";
157 }; 157 };
158 /* Unmuxed GPIOs */ 158 /* Unmuxed GPIOs */
159 pctl_gpio_b: pctl-gpio-b { 159 pctl_gpio_b: pctl-gpio-b {
160 pingrp = "gpiob_pins"; 160 abilis,function = "gpiob";
161 }; 161 };
162 pctl_gpio_d: pctl-gpio-d { 162 pctl_gpio_d: pctl-gpio-d {
163 pingrp = "gpiod_pins"; 163 abilis,function = "gpiod";
164 }; 164 };
165 pctl_gpio_f: pctl-gpio-f { 165 pctl_gpio_f: pctl-gpio-f {
166 pingrp = "gpiof_pins"; 166 abilis,function = "gpiof";
167 }; 167 };
168 pctl_gpio_h: pctl-gpio-h { 168 pctl_gpio_h: pctl-gpio-h {
169 pingrp = "gpioh_pins"; 169 abilis,function = "gpioh";
170 }; 170 };
171 pctl_gpio_i: pctl-gpio-i { 171 pctl_gpio_i: pctl-gpio-i {
172 pingrp = "gpioi_pins"; 172 abilis,function = "gpioi";
173 }; 173 };
174 }; 174 };
175 175
@@ -181,9 +181,10 @@
181 interrupts = <27 2>; 181 interrupts = <27 2>;
182 reg = <0xFF140000 0x1000>; 182 reg = <0xFF140000 0x1000>;
183 gpio-controller; 183 gpio-controller;
184 #gpio-cells = <1>; 184 #gpio-cells = <2>;
185 gpio-base = <0>; 185 abilis,ngpio = <3>;
186 gpio-pins = <&pctl_gpio_a>; 186 gpio-ranges = <&iomux 0 0 0>;
187 gpio-ranges-group-names = "gpioa";
187 }; 188 };
188 gpiob: gpio@FF141000 { 189 gpiob: gpio@FF141000 {
189 compatible = "abilis,tb10x-gpio"; 190 compatible = "abilis,tb10x-gpio";
@@ -193,9 +194,10 @@
193 interrupts = <27 2>; 194 interrupts = <27 2>;
194 reg = <0xFF141000 0x1000>; 195 reg = <0xFF141000 0x1000>;
195 gpio-controller; 196 gpio-controller;
196 #gpio-cells = <1>; 197 #gpio-cells = <2>;
197 gpio-base = <3>; 198 abilis,ngpio = <2>;
198 gpio-pins = <&pctl_gpio_b>; 199 gpio-ranges = <&iomux 0 0 0>;
200 gpio-ranges-group-names = "gpiob";
199 }; 201 };
200 gpioc: gpio@FF142000 { 202 gpioc: gpio@FF142000 {
201 compatible = "abilis,tb10x-gpio"; 203 compatible = "abilis,tb10x-gpio";
@@ -205,9 +207,10 @@
205 interrupts = <27 2>; 207 interrupts = <27 2>;
206 reg = <0xFF142000 0x1000>; 208 reg = <0xFF142000 0x1000>;
207 gpio-controller; 209 gpio-controller;
208 #gpio-cells = <1>; 210 #gpio-cells = <2>;
209 gpio-base = <5>; 211 abilis,ngpio = <3>;
210 gpio-pins = <&pctl_gpio_c>; 212 gpio-ranges = <&iomux 0 0 0>;
213 gpio-ranges-group-names = "gpioc";
211 }; 214 };
212 gpiod: gpio@FF143000 { 215 gpiod: gpio@FF143000 {
213 compatible = "abilis,tb10x-gpio"; 216 compatible = "abilis,tb10x-gpio";
@@ -217,9 +220,10 @@
217 interrupts = <27 2>; 220 interrupts = <27 2>;
218 reg = <0xFF143000 0x1000>; 221 reg = <0xFF143000 0x1000>;
219 gpio-controller; 222 gpio-controller;
220 #gpio-cells = <1>; 223 #gpio-cells = <2>;
221 gpio-base = <8>; 224 abilis,ngpio = <2>;
222 gpio-pins = <&pctl_gpio_d>; 225 gpio-ranges = <&iomux 0 0 0>;
226 gpio-ranges-group-names = "gpiod";
223 }; 227 };
224 gpioe: gpio@FF144000 { 228 gpioe: gpio@FF144000 {
225 compatible = "abilis,tb10x-gpio"; 229 compatible = "abilis,tb10x-gpio";
@@ -229,9 +233,10 @@
229 interrupts = <27 2>; 233 interrupts = <27 2>;
230 reg = <0xFF144000 0x1000>; 234 reg = <0xFF144000 0x1000>;
231 gpio-controller; 235 gpio-controller;
232 #gpio-cells = <1>; 236 #gpio-cells = <2>;
233 gpio-base = <10>; 237 abilis,ngpio = <3>;
234 gpio-pins = <&pctl_gpio_e>; 238 gpio-ranges = <&iomux 0 0 0>;
239 gpio-ranges-group-names = "gpioe";
235 }; 240 };
236 gpiof: gpio@FF145000 { 241 gpiof: gpio@FF145000 {
237 compatible = "abilis,tb10x-gpio"; 242 compatible = "abilis,tb10x-gpio";
@@ -241,9 +246,10 @@
241 interrupts = <27 2>; 246 interrupts = <27 2>;
242 reg = <0xFF145000 0x1000>; 247 reg = <0xFF145000 0x1000>;
243 gpio-controller; 248 gpio-controller;
244 #gpio-cells = <1>; 249 #gpio-cells = <2>;
245 gpio-base = <13>; 250 abilis,ngpio = <2>;
246 gpio-pins = <&pctl_gpio_f>; 251 gpio-ranges = <&iomux 0 0 0>;
252 gpio-ranges-group-names = "gpiof";
247 }; 253 };
248 gpiog: gpio@FF146000 { 254 gpiog: gpio@FF146000 {
249 compatible = "abilis,tb10x-gpio"; 255 compatible = "abilis,tb10x-gpio";
@@ -253,9 +259,10 @@
253 interrupts = <27 2>; 259 interrupts = <27 2>;
254 reg = <0xFF146000 0x1000>; 260 reg = <0xFF146000 0x1000>;
255 gpio-controller; 261 gpio-controller;
256 #gpio-cells = <1>; 262 #gpio-cells = <2>;
257 gpio-base = <15>; 263 abilis,ngpio = <3>;
258 gpio-pins = <&pctl_gpio_g>; 264 gpio-ranges = <&iomux 0 0 0>;
265 gpio-ranges-group-names = "gpiog";
259 }; 266 };
260 gpioh: gpio@FF147000 { 267 gpioh: gpio@FF147000 {
261 compatible = "abilis,tb10x-gpio"; 268 compatible = "abilis,tb10x-gpio";
@@ -265,9 +272,10 @@
265 interrupts = <27 2>; 272 interrupts = <27 2>;
266 reg = <0xFF147000 0x1000>; 273 reg = <0xFF147000 0x1000>;
267 gpio-controller; 274 gpio-controller;
268 #gpio-cells = <1>; 275 #gpio-cells = <2>;
269 gpio-base = <18>; 276 abilis,ngpio = <2>;
270 gpio-pins = <&pctl_gpio_h>; 277 gpio-ranges = <&iomux 0 0 0>;
278 gpio-ranges-group-names = "gpioh";
271 }; 279 };
272 gpioi: gpio@FF148000 { 280 gpioi: gpio@FF148000 {
273 compatible = "abilis,tb10x-gpio"; 281 compatible = "abilis,tb10x-gpio";
@@ -277,9 +285,10 @@
277 interrupts = <27 2>; 285 interrupts = <27 2>;
278 reg = <0xFF148000 0x1000>; 286 reg = <0xFF148000 0x1000>;
279 gpio-controller; 287 gpio-controller;
280 #gpio-cells = <1>; 288 #gpio-cells = <2>;
281 gpio-base = <20>; 289 abilis,ngpio = <12>;
282 gpio-pins = <&pctl_gpio_i>; 290 gpio-ranges = <&iomux 0 0 0>;
291 gpio-ranges-group-names = "gpioi";
283 }; 292 };
284 gpioj: gpio@FF149000 { 293 gpioj: gpio@FF149000 {
285 compatible = "abilis,tb10x-gpio"; 294 compatible = "abilis,tb10x-gpio";
@@ -289,9 +298,10 @@
289 interrupts = <27 2>; 298 interrupts = <27 2>;
290 reg = <0xFF149000 0x1000>; 299 reg = <0xFF149000 0x1000>;
291 gpio-controller; 300 gpio-controller;
292 #gpio-cells = <1>; 301 #gpio-cells = <2>;
293 gpio-base = <32>; 302 abilis,ngpio = <32>;
294 gpio-pins = <&pctl_gpio_j>; 303 gpio-ranges = <&iomux 0 0 0>;
304 gpio-ranges-group-names = "gpioj";
295 }; 305 };
296 gpiok: gpio@FF14a000 { 306 gpiok: gpio@FF14a000 {
297 compatible = "abilis,tb10x-gpio"; 307 compatible = "abilis,tb10x-gpio";
@@ -301,9 +311,10 @@
301 interrupts = <27 2>; 311 interrupts = <27 2>;
302 reg = <0xFF14A000 0x1000>; 312 reg = <0xFF14A000 0x1000>;
303 gpio-controller; 313 gpio-controller;
304 #gpio-cells = <1>; 314 #gpio-cells = <2>;
305 gpio-base = <64>; 315 abilis,ngpio = <22>;
306 gpio-pins = <&pctl_gpio_k>; 316 gpio-ranges = <&iomux 0 0 0>;
317 gpio-ranges-group-names = "gpiok";
307 }; 318 };
308 gpiol: gpio@FF14b000 { 319 gpiol: gpio@FF14b000 {
309 compatible = "abilis,tb10x-gpio"; 320 compatible = "abilis,tb10x-gpio";
@@ -313,9 +324,10 @@
313 interrupts = <27 2>; 324 interrupts = <27 2>;
314 reg = <0xFF14B000 0x1000>; 325 reg = <0xFF14B000 0x1000>;
315 gpio-controller; 326 gpio-controller;
316 #gpio-cells = <1>; 327 #gpio-cells = <2>;
317 gpio-base = <86>; 328 abilis,ngpio = <4>;
318 gpio-pins = <&pctl_gpio_l>; 329 gpio-ranges = <&iomux 0 0 0>;
330 gpio-ranges-group-names = "gpiol";
319 }; 331 };
320 gpiom: gpio@FF14c000 { 332 gpiom: gpio@FF14c000 {
321 compatible = "abilis,tb10x-gpio"; 333 compatible = "abilis,tb10x-gpio";
@@ -325,9 +337,10 @@
325 interrupts = <27 2>; 337 interrupts = <27 2>;
326 reg = <0xFF14C000 0x1000>; 338 reg = <0xFF14C000 0x1000>;
327 gpio-controller; 339 gpio-controller;
328 #gpio-cells = <1>; 340 #gpio-cells = <2>;
329 gpio-base = <90>; 341 abilis,ngpio = <4>;
330 gpio-pins = <&pctl_gpio_m>; 342 gpio-ranges = <&iomux 0 0 0>;
343 gpio-ranges-group-names = "gpiom";
331 }; 344 };
332 gpion: gpio@FF14d000 { 345 gpion: gpio@FF14d000 {
333 compatible = "abilis,tb10x-gpio"; 346 compatible = "abilis,tb10x-gpio";
@@ -337,9 +350,10 @@
337 interrupts = <27 2>; 350 interrupts = <27 2>;
338 reg = <0xFF14D000 0x1000>; 351 reg = <0xFF14D000 0x1000>;
339 gpio-controller; 352 gpio-controller;
340 #gpio-cells = <1>; 353 #gpio-cells = <2>;
341 gpio-base = <94>; 354 abilis,ngpio = <5>;
342 gpio-pins = <&pctl_gpio_n>; 355 gpio-ranges = <&iomux 0 0 0>;
356 gpio-ranges-group-names = "gpion";
343 }; 357 };
344 }; 358 };
345}; 359};
diff --git a/arch/arc/boot/dts/abilis_tb101_dvk.dts b/arch/arc/boot/dts/abilis_tb101_dvk.dts
index b204657993aa..1cf51c280f28 100644
--- a/arch/arc/boot/dts/abilis_tb101_dvk.dts
+++ b/arch/arc/boot/dts/abilis_tb101_dvk.dts
@@ -64,62 +64,62 @@
64 compatible = "gpio-leds"; 64 compatible = "gpio-leds";
65 power { 65 power {
66 label = "Power"; 66 label = "Power";
67 gpios = <&gpioi 0>; 67 gpios = <&gpioi 0 0>;
68 linux,default-trigger = "default-on"; 68 linux,default-trigger = "default-on";
69 }; 69 };
70 heartbeat { 70 heartbeat {
71 label = "Heartbeat"; 71 label = "Heartbeat";
72 gpios = <&gpioi 1>; 72 gpios = <&gpioi 1 0>;
73 linux,default-trigger = "heartbeat"; 73 linux,default-trigger = "heartbeat";
74 }; 74 };
75 led2 { 75 led2 {
76 label = "LED2"; 76 label = "LED2";
77 gpios = <&gpioi 2>; 77 gpios = <&gpioi 2 0>;
78 default-state = "off"; 78 default-state = "off";
79 }; 79 };
80 led3 { 80 led3 {
81 label = "LED3"; 81 label = "LED3";
82 gpios = <&gpioi 3>; 82 gpios = <&gpioi 3 0>;
83 default-state = "off"; 83 default-state = "off";
84 }; 84 };
85 led4 { 85 led4 {
86 label = "LED4"; 86 label = "LED4";
87 gpios = <&gpioi 4>; 87 gpios = <&gpioi 4 0>;
88 default-state = "off"; 88 default-state = "off";
89 }; 89 };
90 led5 { 90 led5 {
91 label = "LED5"; 91 label = "LED5";
92 gpios = <&gpioi 5>; 92 gpios = <&gpioi 5 0>;
93 default-state = "off"; 93 default-state = "off";
94 }; 94 };
95 led6 { 95 led6 {
96 label = "LED6"; 96 label = "LED6";
97 gpios = <&gpioi 6>; 97 gpios = <&gpioi 6 0>;
98 default-state = "off"; 98 default-state = "off";
99 }; 99 };
100 led7 { 100 led7 {
101 label = "LED7"; 101 label = "LED7";
102 gpios = <&gpioi 7>; 102 gpios = <&gpioi 7 0>;
103 default-state = "off"; 103 default-state = "off";
104 }; 104 };
105 led8 { 105 led8 {
106 label = "LED8"; 106 label = "LED8";
107 gpios = <&gpioi 8>; 107 gpios = <&gpioi 8 0>;
108 default-state = "off"; 108 default-state = "off";
109 }; 109 };
110 led9 { 110 led9 {
111 label = "LED9"; 111 label = "LED9";
112 gpios = <&gpioi 9>; 112 gpios = <&gpioi 9 0>;
113 default-state = "off"; 113 default-state = "off";
114 }; 114 };
115 led10 { 115 led10 {
116 label = "LED10"; 116 label = "LED10";
117 gpios = <&gpioi 10>; 117 gpios = <&gpioi 10 0>;
118 default-state = "off"; 118 default-state = "off";
119 }; 119 };
120 led11 { 120 led11 {
121 label = "LED11"; 121 label = "LED11";
122 gpios = <&gpioi 11>; 122 gpios = <&gpioi 11 0>;
123 default-state = "off"; 123 default-state = "off";
124 }; 124 };
125 }; 125 };
diff --git a/arch/arc/boot/dts/abilis_tb10x.dtsi b/arch/arc/boot/dts/abilis_tb10x.dtsi
index edf56f4749e1..a098d7c05e96 100644
--- a/arch/arc/boot/dts/abilis_tb10x.dtsi
+++ b/arch/arc/boot/dts/abilis_tb10x.dtsi
@@ -62,9 +62,8 @@
62 }; 62 };
63 63
64 iomux: iomux@FF10601c { 64 iomux: iomux@FF10601c {
65 #address-cells = <1>;
66 #size-cells = <1>;
67 compatible = "abilis,tb10x-iomux"; 65 compatible = "abilis,tb10x-iomux";
66 #gpio-range-cells = <3>;
68 reg = <0xFF10601c 0x4>; 67 reg = <0xFF10601c 0x4>;
69 }; 68 };
70 69
diff --git a/arch/arc/boot/dts/angel4.dts b/arch/arc/boot/dts/angel4.dts
index 4fb2d6f655bd..bcf662d21a57 100644
--- a/arch/arc/boot/dts/angel4.dts
+++ b/arch/arc/boot/dts/angel4.dts
@@ -67,5 +67,9 @@
67 reg = <1>; 67 reg = <1>;
68 }; 68 };
69 }; 69 };
70
71 arcpmu0: pmu {
72 compatible = "snps,arc700-pmu";
73 };
70 }; 74 };
71}; 75};
diff --git a/arch/arc/configs/fpga_noramfs_defconfig b/arch/arc/configs/fpga_noramfs_defconfig
new file mode 100644
index 000000000000..5276a52f6a2f
--- /dev/null
+++ b/arch/arc/configs/fpga_noramfs_defconfig
@@ -0,0 +1,64 @@
1CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_DEFAULT_HOSTNAME="ARCLinux"
4# CONFIG_SWAP is not set
5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_IKCONFIG=y
7CONFIG_IKCONFIG_PROC=y
8CONFIG_NAMESPACES=y
9# CONFIG_UTS_NS is not set
10# CONFIG_PID_NS is not set
11CONFIG_BLK_DEV_INITRD=y
12CONFIG_KALLSYMS_ALL=y
13CONFIG_EMBEDDED=y
14# CONFIG_SLUB_DEBUG is not set
15# CONFIG_COMPAT_BRK is not set
16CONFIG_KPROBES=y
17CONFIG_MODULES=y
18# CONFIG_LBDAF is not set
19# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set
21# CONFIG_IOSCHED_CFQ is not set
22CONFIG_ARC_PLAT_FPGA_LEGACY=y
23CONFIG_ARC_BOARD_ML509=y
24# CONFIG_ARC_HAS_RTSC is not set
25CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
26CONFIG_PREEMPT=y
27# CONFIG_COMPACTION is not set
28# CONFIG_CROSS_MEMORY_ATTACH is not set
29CONFIG_NET=y
30CONFIG_PACKET=y
31CONFIG_UNIX=y
32CONFIG_UNIX_DIAG=y
33CONFIG_NET_KEY=y
34CONFIG_INET=y
35# CONFIG_IPV6 is not set
36# CONFIG_STANDALONE is not set
37# CONFIG_PREVENT_FIRMWARE_BUILD is not set
38# CONFIG_FIRMWARE_IN_KERNEL is not set
39# CONFIG_BLK_DEV is not set
40CONFIG_NETDEVICES=y
41CONFIG_ARC_EMAC=y
42CONFIG_LXT_PHY=y
43# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
44# CONFIG_INPUT_KEYBOARD is not set
45# CONFIG_INPUT_MOUSE is not set
46# CONFIG_SERIO is not set
47# CONFIG_LEGACY_PTYS is not set
48# CONFIG_DEVKMEM is not set
49CONFIG_SERIAL_ARC=y
50CONFIG_SERIAL_ARC_CONSOLE=y
51# CONFIG_HW_RANDOM is not set
52# CONFIG_HWMON is not set
53# CONFIG_VGA_CONSOLE is not set
54# CONFIG_HID is not set
55# CONFIG_USB_SUPPORT is not set
56# CONFIG_IOMMU_SUPPORT is not set
57CONFIG_EXT2_FS=y
58CONFIG_EXT2_FS_XATTR=y
59CONFIG_TMPFS=y
60# CONFIG_MISC_FILESYSTEMS is not set
61CONFIG_NFS_FS=y
62# CONFIG_ENABLE_WARN_DEPRECATED is not set
63# CONFIG_ENABLE_MUST_CHECK is not set
64CONFIG_XZ_DEC=y
diff --git a/arch/arc/include/asm/perf_event.h b/arch/arc/include/asm/perf_event.h
index 115ad96480e6..cbf755e32a03 100644
--- a/arch/arc/include/asm/perf_event.h
+++ b/arch/arc/include/asm/perf_event.h
@@ -1,5 +1,7 @@
1/* 1/*
2 * Copyright (C) 2011-2012 Synopsys, Inc. (www.synopsys.com) 2 * Linux performance counter support for ARC
3 *
4 * Copyright (C) 2011-2013 Synopsys, Inc. (www.synopsys.com)
3 * 5 *
4 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -10,4 +12,204 @@
10#ifndef __ASM_PERF_EVENT_H 12#ifndef __ASM_PERF_EVENT_H
11#define __ASM_PERF_EVENT_H 13#define __ASM_PERF_EVENT_H
12 14
15/* real maximum varies per CPU, this is the maximum supported by the driver */
16#define ARC_PMU_MAX_HWEVENTS 64
17
18#define ARC_REG_CC_BUILD 0xF6
19#define ARC_REG_CC_INDEX 0x240
20#define ARC_REG_CC_NAME0 0x241
21#define ARC_REG_CC_NAME1 0x242
22
23#define ARC_REG_PCT_BUILD 0xF5
24#define ARC_REG_PCT_COUNTL 0x250
25#define ARC_REG_PCT_COUNTH 0x251
26#define ARC_REG_PCT_SNAPL 0x252
27#define ARC_REG_PCT_SNAPH 0x253
28#define ARC_REG_PCT_CONFIG 0x254
29#define ARC_REG_PCT_CONTROL 0x255
30#define ARC_REG_PCT_INDEX 0x256
31
32#define ARC_REG_PCT_CONTROL_CC (1 << 16) /* clear counts */
33#define ARC_REG_PCT_CONTROL_SN (1 << 17) /* snapshot */
34
35struct arc_reg_pct_build {
36#ifdef CONFIG_CPU_BIG_ENDIAN
37 unsigned int m:8, c:8, r:6, s:2, v:8;
38#else
39 unsigned int v:8, s:2, r:6, c:8, m:8;
40#endif
41};
42
43struct arc_reg_cc_build {
44#ifdef CONFIG_CPU_BIG_ENDIAN
45 unsigned int c:16, r:8, v:8;
46#else
47 unsigned int v:8, r:8, c:16;
48#endif
49};
50
51#define PERF_COUNT_ARC_DCLM (PERF_COUNT_HW_MAX + 0)
52#define PERF_COUNT_ARC_DCSM (PERF_COUNT_HW_MAX + 1)
53#define PERF_COUNT_ARC_ICM (PERF_COUNT_HW_MAX + 2)
54#define PERF_COUNT_ARC_BPOK (PERF_COUNT_HW_MAX + 3)
55#define PERF_COUNT_ARC_EDTLB (PERF_COUNT_HW_MAX + 4)
56#define PERF_COUNT_ARC_EITLB (PERF_COUNT_HW_MAX + 5)
57#define PERF_COUNT_ARC_HW_MAX (PERF_COUNT_HW_MAX + 6)
58
59/*
60 * The "generalized" performance events seem to really be a copy
61 * of the available events on x86 processors; the mapping to ARC
62 * events is not always possible 1-to-1. Fortunately, there doesn't
63 * seem to be an exact definition for these events, so we can cheat
64 * a bit where necessary.
65 *
66 * In particular, the following PERF events may behave a bit differently
67 * compared to other architectures:
68 *
69 * PERF_COUNT_HW_CPU_CYCLES
70 * Cycles not in halted state
71 *
72 * PERF_COUNT_HW_REF_CPU_CYCLES
73 * Reference cycles not in halted state, same as PERF_COUNT_HW_CPU_CYCLES
74 * for now as we don't do Dynamic Voltage/Frequency Scaling (yet)
75 *
76 * PERF_COUNT_HW_BUS_CYCLES
77 * Unclear what this means, Intel uses 0x013c, which according to
78 * their datasheet means "unhalted reference cycles". It sounds similar
79 * to PERF_COUNT_HW_REF_CPU_CYCLES, and we use the same counter for it.
80 *
81 * PERF_COUNT_HW_STALLED_CYCLES_BACKEND
82 * PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
83 * The ARC 700 can either measure stalls per pipeline stage, or all stalls
84 * combined; for now we assign all stalls to STALLED_CYCLES_BACKEND
85 * and all pipeline flushes (e.g. caused by mispredicts, etc.) to
86 * STALLED_CYCLES_FRONTEND.
87 *
88 * We could start multiple performance counters and combine everything
89 * afterwards, but that makes it complicated.
90 *
91 * Note that I$ cache misses aren't counted by either of the two!
92 */
93
94static const char * const arc_pmu_ev_hw_map[] = {
95 [PERF_COUNT_HW_CPU_CYCLES] = "crun",
96 [PERF_COUNT_HW_REF_CPU_CYCLES] = "crun",
97 [PERF_COUNT_HW_BUS_CYCLES] = "crun",
98 [PERF_COUNT_HW_INSTRUCTIONS] = "iall",
99 [PERF_COUNT_HW_BRANCH_MISSES] = "bpfail",
100 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmp",
101 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = "bflush",
102 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = "bstall",
103 [PERF_COUNT_ARC_DCLM] = "dclm",
104 [PERF_COUNT_ARC_DCSM] = "dcsm",
105 [PERF_COUNT_ARC_ICM] = "icm",
106 [PERF_COUNT_ARC_BPOK] = "bpok",
107 [PERF_COUNT_ARC_EDTLB] = "edtlb",
108 [PERF_COUNT_ARC_EITLB] = "eitlb",
109};
110
111#define C(_x) PERF_COUNT_HW_CACHE_##_x
112#define CACHE_OP_UNSUPPORTED 0xffff
113
114static const unsigned arc_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
115 [C(L1D)] = {
116 [C(OP_READ)] = {
117 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
118 [C(RESULT_MISS)] = PERF_COUNT_ARC_DCLM,
119 },
120 [C(OP_WRITE)] = {
121 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
122 [C(RESULT_MISS)] = PERF_COUNT_ARC_DCSM,
123 },
124 [C(OP_PREFETCH)] = {
125 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
126 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
127 },
128 },
129 [C(L1I)] = {
130 [C(OP_READ)] = {
131 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
132 [C(RESULT_MISS)] = PERF_COUNT_ARC_ICM,
133 },
134 [C(OP_WRITE)] = {
135 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
136 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
137 },
138 [C(OP_PREFETCH)] = {
139 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
140 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
141 },
142 },
143 [C(LL)] = {
144 [C(OP_READ)] = {
145 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
146 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
147 },
148 [C(OP_WRITE)] = {
149 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
150 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
151 },
152 [C(OP_PREFETCH)] = {
153 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
154 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
155 },
156 },
157 [C(DTLB)] = {
158 [C(OP_READ)] = {
159 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
160 [C(RESULT_MISS)] = PERF_COUNT_ARC_EDTLB,
161 },
162 [C(OP_WRITE)] = {
163 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
164 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
165 },
166 [C(OP_PREFETCH)] = {
167 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
168 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
169 },
170 },
171 [C(ITLB)] = {
172 [C(OP_READ)] = {
173 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
174 [C(RESULT_MISS)] = PERF_COUNT_ARC_EITLB,
175 },
176 [C(OP_WRITE)] = {
177 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
178 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
179 },
180 [C(OP_PREFETCH)] = {
181 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
182 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
183 },
184 },
185 [C(BPU)] = {
186 [C(OP_READ)] = {
187 [C(RESULT_ACCESS)] = PERF_COUNT_HW_BRANCH_INSTRUCTIONS,
188 [C(RESULT_MISS)] = PERF_COUNT_HW_BRANCH_MISSES,
189 },
190 [C(OP_WRITE)] = {
191 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
192 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
193 },
194 [C(OP_PREFETCH)] = {
195 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
196 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
197 },
198 },
199 [C(NODE)] = {
200 [C(OP_READ)] = {
201 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
202 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
203 },
204 [C(OP_WRITE)] = {
205 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
206 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
207 },
208 [C(OP_PREFETCH)] = {
209 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
210 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
211 },
212 },
213};
214
13#endif /* __ASM_PERF_EVENT_H */ 215#endif /* __ASM_PERF_EVENT_H */
diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h
index 2d50a4cdd7f3..45be21672011 100644
--- a/arch/arc/include/asm/thread_info.h
+++ b/arch/arc/include/asm/thread_info.h
@@ -80,8 +80,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
80 80
81#endif /* !__ASSEMBLY__ */ 81#endif /* !__ASSEMBLY__ */
82 82
83#define PREEMPT_ACTIVE 0x10000000
84
85/* 83/*
86 * thread information flags 84 * thread information flags
87 * - these are process state flags that various assembly files may need to 85 * - these are process state flags that various assembly files may need to
diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h
index 6f30484f34b7..68125dd766c6 100644
--- a/arch/arc/include/uapi/asm/unistd.h
+++ b/arch/arc/include/uapi/asm/unistd.h
@@ -8,6 +8,9 @@
8 8
9/******** no-legacy-syscalls-ABI *******/ 9/******** no-legacy-syscalls-ABI *******/
10 10
11#ifndef _UAPI_ASM_ARC_UNISTD_H
12#define _UAPI_ASM_ARC_UNISTD_H
13
11#define __ARCH_WANT_SYS_EXECVE 14#define __ARCH_WANT_SYS_EXECVE
12#define __ARCH_WANT_SYS_CLONE 15#define __ARCH_WANT_SYS_CLONE
13#define __ARCH_WANT_SYS_VFORK 16#define __ARCH_WANT_SYS_VFORK
@@ -32,3 +35,5 @@ __SYSCALL(__NR_arc_gettls, sys_arc_gettls)
32/* Generic syscall (fs/filesystems.c - lost in asm-generic/unistd.h */ 35/* Generic syscall (fs/filesystems.c - lost in asm-generic/unistd.h */
33#define __NR_sysfs (__NR_arch_specific_syscall + 3) 36#define __NR_sysfs (__NR_arch_specific_syscall + 3)
34__SYSCALL(__NR_sysfs, sys_sysfs) 37__SYSCALL(__NR_sysfs, sys_sysfs)
38
39#endif
diff --git a/arch/arc/kernel/Makefile b/arch/arc/kernel/Makefile
index c242ef07ba70..8004b4fa6461 100644
--- a/arch/arc/kernel/Makefile
+++ b/arch/arc/kernel/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_KPROBES) += kprobes.o
19obj-$(CONFIG_ARC_MISALIGN_ACCESS) += unaligned.o 19obj-$(CONFIG_ARC_MISALIGN_ACCESS) += unaligned.o
20obj-$(CONFIG_KGDB) += kgdb.o 20obj-$(CONFIG_KGDB) += kgdb.o
21obj-$(CONFIG_ARC_METAWARE_HLINK) += arc_hostlink.o 21obj-$(CONFIG_ARC_METAWARE_HLINK) += arc_hostlink.o
22obj-$(CONFIG_PERF_EVENTS) += perf_event.o
22 23
23obj-$(CONFIG_ARC_FPU_SAVE_RESTORE) += fpu.o 24obj-$(CONFIG_ARC_FPU_SAVE_RESTORE) += fpu.o
24CFLAGS_fpu.o += -mdpfp 25CFLAGS_fpu.o += -mdpfp
diff --git a/arch/arc/kernel/kprobes.c b/arch/arc/kernel/kprobes.c
index eb1c2ee5eaf0..42b05046fad9 100644
--- a/arch/arc/kernel/kprobes.c
+++ b/arch/arc/kernel/kprobes.c
@@ -327,7 +327,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned long trapnr)
327 */ 327 */
328 328
329 /* We increment the nmissed count for accounting, 329 /* We increment the nmissed count for accounting,
330 * we can also use npre/npostfault count for accouting 330 * we can also use npre/npostfault count for accounting
331 * these specific fault cases. 331 * these specific fault cases.
332 */ 332 */
333 kprobes_inc_nmissed_count(cur); 333 kprobes_inc_nmissed_count(cur);
diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c
new file mode 100644
index 000000000000..63177e4cb66d
--- /dev/null
+++ b/arch/arc/kernel/perf_event.c
@@ -0,0 +1,326 @@
1/*
2 * Linux performance counter support for ARC700 series
3 *
4 * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
5 *
6 * This code is inspired by the perf support of various other architectures.
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/errno.h>
14#include <linux/module.h>
15#include <linux/of.h>
16#include <linux/perf_event.h>
17#include <linux/platform_device.h>
18#include <asm/arcregs.h>
19
20struct arc_pmu {
21 struct pmu pmu;
22 int counter_size; /* in bits */
23 int n_counters;
24 unsigned long used_mask[BITS_TO_LONGS(ARC_PMU_MAX_HWEVENTS)];
25 int ev_hw_idx[PERF_COUNT_ARC_HW_MAX];
26};
27
28/* read counter #idx; note that counter# != event# on ARC! */
29static uint64_t arc_pmu_read_counter(int idx)
30{
31 uint32_t tmp;
32 uint64_t result;
33
34 /*
35 * ARC supports making 'snapshots' of the counters, so we don't
36 * need to care about counters wrapping to 0 underneath our feet
37 */
38 write_aux_reg(ARC_REG_PCT_INDEX, idx);
39 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
40 write_aux_reg(ARC_REG_PCT_CONTROL, tmp | ARC_REG_PCT_CONTROL_SN);
41 result = (uint64_t) (read_aux_reg(ARC_REG_PCT_SNAPH)) << 32;
42 result |= read_aux_reg(ARC_REG_PCT_SNAPL);
43
44 return result;
45}
46
47static void arc_perf_event_update(struct perf_event *event,
48 struct hw_perf_event *hwc, int idx)
49{
50 struct arc_pmu *arc_pmu = container_of(event->pmu, struct arc_pmu, pmu);
51 uint64_t prev_raw_count, new_raw_count;
52 int64_t delta;
53
54 do {
55 prev_raw_count = local64_read(&hwc->prev_count);
56 new_raw_count = arc_pmu_read_counter(idx);
57 } while (local64_cmpxchg(&hwc->prev_count, prev_raw_count,
58 new_raw_count) != prev_raw_count);
59
60 delta = (new_raw_count - prev_raw_count) &
61 ((1ULL << arc_pmu->counter_size) - 1ULL);
62
63 local64_add(delta, &event->count);
64 local64_sub(delta, &hwc->period_left);
65}
66
67static void arc_pmu_read(struct perf_event *event)
68{
69 arc_perf_event_update(event, &event->hw, event->hw.idx);
70}
71
72static int arc_pmu_cache_event(u64 config)
73{
74 unsigned int cache_type, cache_op, cache_result;
75 int ret;
76
77 cache_type = (config >> 0) & 0xff;
78 cache_op = (config >> 8) & 0xff;
79 cache_result = (config >> 16) & 0xff;
80 if (cache_type >= PERF_COUNT_HW_CACHE_MAX)
81 return -EINVAL;
82 if (cache_op >= PERF_COUNT_HW_CACHE_OP_MAX)
83 return -EINVAL;
84 if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
85 return -EINVAL;
86
87 ret = arc_pmu_cache_map[cache_type][cache_op][cache_result];
88
89 if (ret == CACHE_OP_UNSUPPORTED)
90 return -ENOENT;
91
92 return ret;
93}
94
95/* initializes hw_perf_event structure if event is supported */
96static int arc_pmu_event_init(struct perf_event *event)
97{
98 struct arc_pmu *arc_pmu = container_of(event->pmu, struct arc_pmu, pmu);
99 struct hw_perf_event *hwc = &event->hw;
100 int ret;
101
102 /* ARC 700 PMU does not support sampling events */
103 if (is_sampling_event(event))
104 return -ENOENT;
105
106 switch (event->attr.type) {
107 case PERF_TYPE_HARDWARE:
108 if (event->attr.config >= PERF_COUNT_HW_MAX)
109 return -ENOENT;
110 if (arc_pmu->ev_hw_idx[event->attr.config] < 0)
111 return -ENOENT;
112 hwc->config = arc_pmu->ev_hw_idx[event->attr.config];
113 pr_debug("initializing event %d with cfg %d\n",
114 (int) event->attr.config, (int) hwc->config);
115 return 0;
116 case PERF_TYPE_HW_CACHE:
117 ret = arc_pmu_cache_event(event->attr.config);
118 if (ret < 0)
119 return ret;
120 hwc->config = arc_pmu->ev_hw_idx[ret];
121 return 0;
122 default:
123 return -ENOENT;
124 }
125}
126
127/* starts all counters */
128static void arc_pmu_enable(struct pmu *pmu)
129{
130 uint32_t tmp;
131 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
132 write_aux_reg(ARC_REG_PCT_CONTROL, (tmp & 0xffff0000) | 0x1);
133}
134
135/* stops all counters */
136static void arc_pmu_disable(struct pmu *pmu)
137{
138 uint32_t tmp;
139 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
140 write_aux_reg(ARC_REG_PCT_CONTROL, (tmp & 0xffff0000) | 0x0);
141}
142
143/*
144 * Assigns hardware counter to hardware condition.
145 * Note that there is no separate start/stop mechanism;
146 * stopping is achieved by assigning the 'never' condition
147 */
148static void arc_pmu_start(struct perf_event *event, int flags)
149{
150 struct hw_perf_event *hwc = &event->hw;
151 int idx = hwc->idx;
152
153 if (WARN_ON_ONCE(idx == -1))
154 return;
155
156 if (flags & PERF_EF_RELOAD)
157 WARN_ON_ONCE(!(event->hw.state & PERF_HES_UPTODATE));
158
159 event->hw.state = 0;
160
161 /* enable ARC pmu here */
162 write_aux_reg(ARC_REG_PCT_INDEX, idx);
163 write_aux_reg(ARC_REG_PCT_CONFIG, hwc->config);
164}
165
166static void arc_pmu_stop(struct perf_event *event, int flags)
167{
168 struct hw_perf_event *hwc = &event->hw;
169 int idx = hwc->idx;
170
171 if (!(event->hw.state & PERF_HES_STOPPED)) {
172 /* stop ARC pmu here */
173 write_aux_reg(ARC_REG_PCT_INDEX, idx);
174
175 /* condition code #0 is always "never" */
176 write_aux_reg(ARC_REG_PCT_CONFIG, 0);
177
178 event->hw.state |= PERF_HES_STOPPED;
179 }
180
181 if ((flags & PERF_EF_UPDATE) &&
182 !(event->hw.state & PERF_HES_UPTODATE)) {
183 arc_perf_event_update(event, &event->hw, idx);
184 event->hw.state |= PERF_HES_UPTODATE;
185 }
186}
187
188static void arc_pmu_del(struct perf_event *event, int flags)
189{
190 struct arc_pmu *arc_pmu = container_of(event->pmu, struct arc_pmu, pmu);
191
192 arc_pmu_stop(event, PERF_EF_UPDATE);
193 __clear_bit(event->hw.idx, arc_pmu->used_mask);
194
195 perf_event_update_userpage(event);
196}
197
198/* allocate hardware counter and optionally start counting */
199static int arc_pmu_add(struct perf_event *event, int flags)
200{
201 struct arc_pmu *arc_pmu = container_of(event->pmu, struct arc_pmu, pmu);
202 struct hw_perf_event *hwc = &event->hw;
203 int idx = hwc->idx;
204
205 if (__test_and_set_bit(idx, arc_pmu->used_mask)) {
206 idx = find_first_zero_bit(arc_pmu->used_mask,
207 arc_pmu->n_counters);
208 if (idx == arc_pmu->n_counters)
209 return -EAGAIN;
210
211 __set_bit(idx, arc_pmu->used_mask);
212 hwc->idx = idx;
213 }
214
215 write_aux_reg(ARC_REG_PCT_INDEX, idx);
216 write_aux_reg(ARC_REG_PCT_CONFIG, 0);
217 write_aux_reg(ARC_REG_PCT_COUNTL, 0);
218 write_aux_reg(ARC_REG_PCT_COUNTH, 0);
219 local64_set(&hwc->prev_count, 0);
220
221 hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
222 if (flags & PERF_EF_START)
223 arc_pmu_start(event, PERF_EF_RELOAD);
224
225 perf_event_update_userpage(event);
226
227 return 0;
228}
229
230static int arc_pmu_device_probe(struct platform_device *pdev)
231{
232 struct arc_pmu *arc_pmu;
233 struct arc_reg_pct_build pct_bcr;
234 struct arc_reg_cc_build cc_bcr;
235 int i, j, ret;
236
237 union cc_name {
238 struct {
239 uint32_t word0, word1;
240 char sentinel;
241 } indiv;
242 char str[9];
243 } cc_name;
244
245
246 READ_BCR(ARC_REG_PCT_BUILD, pct_bcr);
247 if (!pct_bcr.v) {
248 pr_err("This core does not have performance counters!\n");
249 return -ENODEV;
250 }
251
252 arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu),
253 GFP_KERNEL);
254 if (!arc_pmu)
255 return -ENOMEM;
256
257 arc_pmu->n_counters = pct_bcr.c;
258 BUG_ON(arc_pmu->n_counters > ARC_PMU_MAX_HWEVENTS);
259
260 arc_pmu->counter_size = 32 + (pct_bcr.s << 4);
261 pr_info("ARC PMU found with %d counters of size %d bits\n",
262 arc_pmu->n_counters, arc_pmu->counter_size);
263
264 READ_BCR(ARC_REG_CC_BUILD, cc_bcr);
265
266 if (!cc_bcr.v)
267 pr_err("Strange! Performance counters exist, but no countable conditions?\n");
268
269 pr_info("ARC PMU has %d countable conditions\n", cc_bcr.c);
270
271 cc_name.str[8] = 0;
272 for (i = 0; i < PERF_COUNT_HW_MAX; i++)
273 arc_pmu->ev_hw_idx[i] = -1;
274
275 for (j = 0; j < cc_bcr.c; j++) {
276 write_aux_reg(ARC_REG_CC_INDEX, j);
277 cc_name.indiv.word0 = read_aux_reg(ARC_REG_CC_NAME0);
278 cc_name.indiv.word1 = read_aux_reg(ARC_REG_CC_NAME1);
279 for (i = 0; i < ARRAY_SIZE(arc_pmu_ev_hw_map); i++) {
280 if (arc_pmu_ev_hw_map[i] &&
281 !strcmp(arc_pmu_ev_hw_map[i], cc_name.str) &&
282 strlen(arc_pmu_ev_hw_map[i])) {
283 pr_debug("mapping %d to idx %d with name %s\n",
284 i, j, cc_name.str);
285 arc_pmu->ev_hw_idx[i] = j;
286 }
287 }
288 }
289
290 arc_pmu->pmu = (struct pmu) {
291 .pmu_enable = arc_pmu_enable,
292 .pmu_disable = arc_pmu_disable,
293 .event_init = arc_pmu_event_init,
294 .add = arc_pmu_add,
295 .del = arc_pmu_del,
296 .start = arc_pmu_start,
297 .stop = arc_pmu_stop,
298 .read = arc_pmu_read,
299 };
300
301 ret = perf_pmu_register(&arc_pmu->pmu, pdev->name, PERF_TYPE_RAW);
302
303 return ret;
304}
305
306#ifdef CONFIG_OF
307static const struct of_device_id arc_pmu_match[] = {
308 { .compatible = "snps,arc700-pmu" },
309 {},
310};
311MODULE_DEVICE_TABLE(of, arc_pmu_match);
312#endif
313
314static struct platform_driver arc_pmu_driver = {
315 .driver = {
316 .name = "arc700-pmu",
317 .of_match_table = of_match_ptr(arc_pmu_match),
318 },
319 .probe = arc_pmu_device_probe,
320};
321
322module_platform_driver(arc_pmu_driver);
323
324MODULE_LICENSE("GPL");
325MODULE_AUTHOR("Mischa Jonker <mjonker@synopsys.com>");
326MODULE_DESCRIPTION("ARC PMU driver");
diff --git a/arch/arc/plat-tb10x/Kconfig b/arch/arc/plat-tb10x/Kconfig
index 1ab386bb5da8..6994c188dc88 100644
--- a/arch/arc/plat-tb10x/Kconfig
+++ b/arch/arc/plat-tb10x/Kconfig
@@ -20,8 +20,10 @@ menuconfig ARC_PLAT_TB10X
20 bool "Abilis TB10x" 20 bool "Abilis TB10x"
21 select COMMON_CLK 21 select COMMON_CLK
22 select PINCTRL 22 select PINCTRL
23 select PINCTRL_TB10X
23 select PINMUX 24 select PINMUX
24 select ARCH_REQUIRE_GPIOLIB 25 select ARCH_REQUIRE_GPIOLIB
26 select GPIO_TB10X
25 select TB10X_IRQC 27 select TB10X_IRQC
26 help 28 help
27 Support for platforms based on the TB10x home media gateway SOC by 29 Support for platforms based on the TB10x home media gateway SOC by
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e089e622be79..c1f1a7eee953 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -5,6 +5,7 @@ config ARM
5 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 5 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
6 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST 6 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
7 select ARCH_HAVE_CUSTOM_GPIO_H 7 select ARCH_HAVE_CUSTOM_GPIO_H
8 select ARCH_MIGHT_HAVE_PC_PARPORT
8 select ARCH_USE_CMPXCHG_LOCKREF 9 select ARCH_USE_CMPXCHG_LOCKREF
9 select ARCH_WANT_IPC_PARSE_VERSION 10 select ARCH_WANT_IPC_PARSE_VERSION
10 select BUILDTIME_EXTABLE_SORT if MMU 11 select BUILDTIME_EXTABLE_SORT if MMU
@@ -24,7 +25,7 @@ config ARM
24 select HARDIRQS_SW_RESEND 25 select HARDIRQS_SW_RESEND
25 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL 26 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
26 select HAVE_ARCH_KGDB 27 select HAVE_ARCH_KGDB
27 select HAVE_ARCH_SECCOMP_FILTER 28 select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
28 select HAVE_ARCH_TRACEHOOK 29 select HAVE_ARCH_TRACEHOOK
29 select HAVE_BPF_JIT 30 select HAVE_BPF_JIT
30 select HAVE_CONTEXT_TRACKING 31 select HAVE_CONTEXT_TRACKING
@@ -1495,6 +1496,7 @@ config HAVE_ARM_ARCH_TIMER
1495 bool "Architected timer support" 1496 bool "Architected timer support"
1496 depends on CPU_V7 1497 depends on CPU_V7
1497 select ARM_ARCH_TIMER 1498 select ARM_ARCH_TIMER
1499 select GENERIC_CLOCKEVENTS
1498 help 1500 help
1499 This option enables support for the ARM architected timer 1501 This option enables support for the ARM architected timer
1500 1502
@@ -1718,7 +1720,6 @@ config AEABI
1718config OABI_COMPAT 1720config OABI_COMPAT
1719 bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)" 1721 bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
1720 depends on AEABI && !THUMB2_KERNEL 1722 depends on AEABI && !THUMB2_KERNEL
1721 default y
1722 help 1723 help
1723 This option preserves the old syscall interface along with the 1724 This option preserves the old syscall interface along with the
1724 new (ARM EABI) one. It also provides a compatibility layer to 1725 new (ARM EABI) one. It also provides a compatibility layer to
@@ -1726,11 +1727,16 @@ config OABI_COMPAT
1726 in memory differs between the legacy ABI and the new ARM EABI 1727 in memory differs between the legacy ABI and the new ARM EABI
1727 (only for non "thumb" binaries). This option adds a tiny 1728 (only for non "thumb" binaries). This option adds a tiny
1728 overhead to all syscalls and produces a slightly larger kernel. 1729 overhead to all syscalls and produces a slightly larger kernel.
1730
1731 The seccomp filter system will not be available when this is
1732 selected, since there is no way yet to sensibly distinguish
1733 between calling conventions during filtering.
1734
1729 If you know you'll be using only pure EABI user space then you 1735 If you know you'll be using only pure EABI user space then you
1730 can say N here. If this option is not selected and you attempt 1736 can say N here. If this option is not selected and you attempt
1731 to execute a legacy ABI binary then the result will be 1737 to execute a legacy ABI binary then the result will be
1732 UNPREDICTABLE (in fact it can be predicted that it won't work 1738 UNPREDICTABLE (in fact it can be predicted that it won't work
1733 at all). If in doubt say Y. 1739 at all). If in doubt say N.
1734 1740
1735config ARCH_HAS_HOLES_MEMORYMODEL 1741config ARCH_HAS_HOLES_MEMORYMODEL
1736 bool 1742 bool
diff --git a/arch/arm/boot/dts/am335x-base0033.dts b/arch/arm/boot/dts/am335x-base0033.dts
index b4f95c2bbf74..72a9b3fc4251 100644
--- a/arch/arm/boot/dts/am335x-base0033.dts
+++ b/arch/arm/boot/dts/am335x-base0033.dts
@@ -13,4 +13,83 @@
13/ { 13/ {
14 model = "IGEP COM AM335x on AQUILA Expansion"; 14 model = "IGEP COM AM335x on AQUILA Expansion";
15 compatible = "isee,am335x-base0033", "isee,am335x-igep0033", "ti,am33xx"; 15 compatible = "isee,am335x-base0033", "isee,am335x-igep0033", "ti,am33xx";
16
17 hdmi {
18 compatible = "ti,tilcdc,slave";
19 i2c = <&i2c0>;
20 pinctrl-names = "default", "off";
21 pinctrl-0 = <&nxp_hdmi_pins>;
22 pinctrl-1 = <&nxp_hdmi_off_pins>;
23 status = "okay";
24 };
25
26 leds_base {
27 pinctrl-names = "default";
28 pinctrl-0 = <&leds_base_pins>;
29
30 compatible = "gpio-leds";
31
32 led@0 {
33 label = "base:red:user";
34 gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>; /* gpio1_21 */
35 default-state = "off";
36 };
37
38 led@1 {
39 label = "base:green:user";
40 gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; /* gpio2_0 */
41 default-state = "off";
42 };
43 };
44};
45
46&am33xx_pinmux {
47 nxp_hdmi_pins: pinmux_nxp_hdmi_pins {
48 pinctrl-single,pins = <
49 0x1b0 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */
50 0xa0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data0 */
51 0xa4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data1 */
52 0xa8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data2 */
53 0xac (PIN_OUTPUT | MUX_MODE0) /* lcd_data3 */
54 0xb0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data4 */
55 0xb4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data5 */
56 0xb8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data6 */
57 0xbc (PIN_OUTPUT | MUX_MODE0) /* lcd_data7 */
58 0xc0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data8 */
59 0xc4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data9 */
60 0xc8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data10 */
61 0xcc (PIN_OUTPUT | MUX_MODE0) /* lcd_data11 */
62 0xd0 (PIN_OUTPUT | MUX_MODE0) /* lcd_data12 */
63 0xd4 (PIN_OUTPUT | MUX_MODE0) /* lcd_data13 */
64 0xd8 (PIN_OUTPUT | MUX_MODE0) /* lcd_data14 */
65 0xdc (PIN_OUTPUT | MUX_MODE0) /* lcd_data15 */
66 0xe0 (PIN_OUTPUT | MUX_MODE0) /* lcd_vsync */
67 0xe4 (PIN_OUTPUT | MUX_MODE0) /* lcd_hsync */
68 0xe8 (PIN_OUTPUT | MUX_MODE0) /* lcd_pclk */
69 0xec (PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en */
70 >;
71 };
72 nxp_hdmi_off_pins: pinmux_nxp_hdmi_off_pins {
73 pinctrl-single,pins = <
74 0x1b0 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */
75 >;
76 };
77
78 leds_base_pins: pinmux_leds_base_pins {
79 pinctrl-single,pins = <
80 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */
81 0x88 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn3.gpio2_0 */
82 >;
83 };
84};
85
86&lcdc {
87 status = "okay";
88};
89
90&i2c0 {
91 eeprom: eeprom@50 {
92 compatible = "at,24c256";
93 reg = <0x50>;
94 };
16}; 95};
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 987429436171..7e6c64ed966d 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -630,7 +630,7 @@
630 tsc { 630 tsc {
631 ti,wires = <4>; 631 ti,wires = <4>;
632 ti,x-plate-resistance = <200>; 632 ti,x-plate-resistance = <200>;
633 ti,coordiante-readouts = <5>; 633 ti,coordinate-readouts = <5>;
634 ti,wire-config = <0x00 0x11 0x22 0x33>; 634 ti,wire-config = <0x00 0x11 0x22 0x33>;
635 }; 635 };
636 636
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 03febf85fd2f..4718ec4a4dbf 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -485,3 +485,13 @@
485 tx-num-evt = <1>; 485 tx-num-evt = <1>;
486 rx-num-evt = <1>; 486 rx-num-evt = <1>;
487}; 487};
488
489&tscadc {
490 status = "okay";
491 tsc {
492 ti,wires = <4>;
493 ti,x-plate-resistance = <200>;
494 ti,coordinate-readouts = <5>;
495 ti,wire-config = <0x00 0x11 0x22 0x33>;
496 };
497};
diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi b/arch/arm/boot/dts/am335x-igep0033.dtsi
index 619624479311..7063311a58d9 100644
--- a/arch/arm/boot/dts/am335x-igep0033.dtsi
+++ b/arch/arm/boot/dts/am335x-igep0033.dtsi
@@ -199,6 +199,35 @@
199 pinctrl-0 = <&uart0_pins>; 199 pinctrl-0 = <&uart0_pins>;
200}; 200};
201 201
202&usb {
203 status = "okay";
204
205 control@44e10000 {
206 status = "okay";
207 };
208
209 usb-phy@47401300 {
210 status = "okay";
211 };
212
213 usb-phy@47401b00 {
214 status = "okay";
215 };
216
217 usb@47401000 {
218 status = "okay";
219 };
220
221 usb@47401800 {
222 status = "okay";
223 dr_mode = "host";
224 };
225
226 dma-controller@07402000 {
227 status = "okay";
228 };
229};
230
202#include "tps65910.dtsi" 231#include "tps65910.dtsi"
203 232
204&tps { 233&tps {
diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
index e99dfaf70052..03fcbf0a88a8 100644
--- a/arch/arm/boot/dts/am3517-evm.dts
+++ b/arch/arm/boot/dts/am3517-evm.dts
@@ -7,11 +7,11 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10#include "omap34xx.dtsi" 10#include "am3517.dtsi"
11 11
12/ { 12/ {
13 model = "TI AM3517 EVM (AM3517/05)"; 13 model = "TI AM3517 EVM (AM3517/05 TMDSEVM3517)";
14 compatible = "ti,am3517-evm", "ti,omap3"; 14 compatible = "ti,am3517-evm", "ti,am3517", "ti,omap3";
15 15
16 memory { 16 memory {
17 device_type = "memory"; 17 device_type = "memory";
diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
new file mode 100644
index 000000000000..2fbe02faa8b1
--- /dev/null
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -0,0 +1,63 @@
1/*
2 * Device Tree Source for am3517 SoC
3 *
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#include "omap3.dtsi"
12
13/ {
14 aliases {
15 serial3 = &uart4;
16 };
17
18 ocp {
19 am35x_otg_hs: am35x_otg_hs@5c040000 {
20 compatible = "ti,omap3-musb";
21 ti,hwmods = "am35x_otg_hs";
22 status = "disabled";
23 reg = <0x5c040000 0x1000>;
24 interrupts = <71>;
25 interrupt-names = "mc";
26 };
27
28 davinci_emac: ethernet@0x5c000000 {
29 compatible = "ti,am3517-emac";
30 ti,hwmods = "davinci_emac";
31 status = "disabled";
32 reg = <0x5c000000 0x30000>;
33 interrupts = <67 68 69 70>;
34 ti,davinci-ctrl-reg-offset = <0x10000>;
35 ti,davinci-ctrl-mod-reg-offset = <0>;
36 ti,davinci-ctrl-ram-offset = <0x20000>;
37 ti,davinci-ctrl-ram-size = <0x2000>;
38 ti,davinci-rmii-en = /bits/ 8 <1>;
39 local-mac-address = [ 00 00 00 00 00 00 ];
40 };
41
42 davinci_mdio: ethernet@0x5c030000 {
43 compatible = "ti,davinci_mdio";
44 ti,hwmods = "davinci_mdio";
45 status = "disabled";
46 reg = <0x5c030000 0x1000>;
47 bus_freq = <1000000>;
48 #address-cells = <1>;
49 #size-cells = <0>;
50 };
51
52 uart4: serial@4809e000 {
53 compatible = "ti,omap3-uart";
54 ti,hwmods = "uart4";
55 status = "disabled";
56 reg = <0x4809e000 0x400>;
57 interrupts = <84>;
58 dmas = <&sdma 55 &sdma 54>;
59 dma-names = "tx", "rx";
60 clock-frequency = <48000000>;
61 };
62 };
63};
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index 90ce29dbe119..08a56bcfc724 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -99,22 +99,22 @@
99 spi-max-frequency = <50000000>; 99 spi-max-frequency = <50000000>;
100 }; 100 };
101 }; 101 };
102 };
102 103
103 pcie-controller { 104 pcie-controller {
105 status = "okay";
106 /*
107 * The two PCIe units are accessible through
108 * both standard PCIe slots and mini-PCIe
109 * slots on the board.
110 */
111 pcie@1,0 {
112 /* Port 0, Lane 0 */
113 status = "okay";
114 };
115 pcie@2,0 {
116 /* Port 1, Lane 0 */
104 status = "okay"; 117 status = "okay";
105 /*
106 * The two PCIe units are accessible through
107 * both standard PCIe slots and mini-PCIe
108 * slots on the board.
109 */
110 pcie@1,0 {
111 /* Port 0, Lane 0 */
112 status = "okay";
113 };
114 pcie@2,0 {
115 /* Port 1, Lane 0 */
116 status = "okay";
117 };
118 }; 118 };
119 }; 119 };
120 }; 120 };
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 00d6a798c705..7f10f627ae5b 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -118,7 +118,7 @@
118 118
119 coherency-fabric@20200 { 119 coherency-fabric@20200 {
120 compatible = "marvell,coherency-fabric"; 120 compatible = "marvell,coherency-fabric";
121 reg = <0x20200 0xb0>, <0x21810 0x1c>; 121 reg = <0x20200 0xb0>, <0x21010 0x1c>;
122 }; 122 };
123 123
124 serial@12000 { 124 serial@12000 {
diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
index 3f5e6121c730..98335fb34b7a 100644
--- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
@@ -47,7 +47,7 @@
47 /* 47 /*
48 * MV78230 has 2 PCIe units Gen2.0: One unit can be 48 * MV78230 has 2 PCIe units Gen2.0: One unit can be
49 * configured as x4 or quad x1 lanes. One unit is 49 * configured as x4 or quad x1 lanes. One unit is
50 * x4/x1. 50 * x1 only.
51 */ 51 */
52 pcie-controller { 52 pcie-controller {
53 compatible = "marvell,armada-xp-pcie"; 53 compatible = "marvell,armada-xp-pcie";
@@ -62,10 +62,10 @@
62 62
63 ranges = 63 ranges =
64 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */ 64 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
65 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */
66 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */ 65 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */
67 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */ 66 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */
68 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */ 67 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */
68 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */
69 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */ 69 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
70 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */ 70 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
71 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */ 71 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
@@ -74,8 +74,8 @@
74 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */ 74 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */
75 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */ 75 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
76 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */ 76 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */
77 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */ 77 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
78 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */>; 78 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */>;
79 79
80 pcie@1,0 { 80 pcie@1,0 {
81 device_type = "pci"; 81 device_type = "pci";
@@ -145,20 +145,20 @@
145 status = "disabled"; 145 status = "disabled";
146 }; 146 };
147 147
148 pcie@9,0 { 148 pcie@5,0 {
149 device_type = "pci"; 149 device_type = "pci";
150 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; 150 assigned-addresses = <0x82000800 0 0x80000 0 0x2000>;
151 reg = <0x4800 0 0 0 0>; 151 reg = <0x2800 0 0 0 0>;
152 #address-cells = <3>; 152 #address-cells = <3>;
153 #size-cells = <2>; 153 #size-cells = <2>;
154 #interrupt-cells = <1>; 154 #interrupt-cells = <1>;
155 ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 155 ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0
156 0x81000000 0 0 0x81000000 0x9 0 1 0>; 156 0x81000000 0 0 0x81000000 0x5 0 1 0>;
157 interrupt-map-mask = <0 0 0 0>; 157 interrupt-map-mask = <0 0 0 0>;
158 interrupt-map = <0 0 0 0 &mpic 99>; 158 interrupt-map = <0 0 0 0 &mpic 62>;
159 marvell,pcie-port = <2>; 159 marvell,pcie-port = <1>;
160 marvell,pcie-lane = <0>; 160 marvell,pcie-lane = <0>;
161 clocks = <&gateclk 26>; 161 clocks = <&gateclk 9>;
162 status = "disabled"; 162 status = "disabled";
163 }; 163 };
164 }; 164 };
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
index 3e9fd1353f89..66609684d41b 100644
--- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
@@ -48,7 +48,7 @@
48 /* 48 /*
49 * MV78260 has 3 PCIe units Gen2.0: Two units can be 49 * MV78260 has 3 PCIe units Gen2.0: Two units can be
50 * configured as x4 or quad x1 lanes. One unit is 50 * configured as x4 or quad x1 lanes. One unit is
51 * x4/x1. 51 * x4 only.
52 */ 52 */
53 pcie-controller { 53 pcie-controller {
54 compatible = "marvell,armada-xp-pcie"; 54 compatible = "marvell,armada-xp-pcie";
@@ -68,7 +68,9 @@
68 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */ 68 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */
69 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */ 69 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */
70 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */ 70 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */
71 0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000 /* Port 3.0 registers */ 71 0x82000000 0 0x84000 MBUS_ID(0xf0, 0x01) 0x84000 0 0x00002000 /* Port 1.1 registers */
72 0x82000000 0 0x88000 MBUS_ID(0xf0, 0x01) 0x88000 0 0x00002000 /* Port 1.2 registers */
73 0x82000000 0 0x8c000 MBUS_ID(0xf0, 0x01) 0x8c000 0 0x00002000 /* Port 1.3 registers */
72 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */ 74 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
73 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */ 75 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
74 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */ 76 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
@@ -77,10 +79,18 @@
77 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */ 79 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */
78 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */ 80 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
79 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */ 81 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */
80 0x82000000 0x9 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */ 82
81 0x81000000 0x9 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */ 83 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
82 0x82000000 0xa 0 MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */ 84 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */
83 0x81000000 0xa 0 MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO */>; 85 0x82000000 0x6 0 MBUS_ID(0x08, 0xd8) 0 1 0 /* Port 1.1 MEM */
86 0x81000000 0x6 0 MBUS_ID(0x08, 0xd0) 0 1 0 /* Port 1.1 IO */
87 0x82000000 0x7 0 MBUS_ID(0x08, 0xb8) 0 1 0 /* Port 1.2 MEM */
88 0x81000000 0x7 0 MBUS_ID(0x08, 0xb0) 0 1 0 /* Port 1.2 IO */
89 0x82000000 0x8 0 MBUS_ID(0x08, 0x78) 0 1 0 /* Port 1.3 MEM */
90 0x81000000 0x8 0 MBUS_ID(0x08, 0x70) 0 1 0 /* Port 1.3 IO */
91
92 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */
93 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */>;
84 94
85 pcie@1,0 { 95 pcie@1,0 {
86 device_type = "pci"; 96 device_type = "pci";
@@ -106,8 +116,8 @@
106 #address-cells = <3>; 116 #address-cells = <3>;
107 #size-cells = <2>; 117 #size-cells = <2>;
108 #interrupt-cells = <1>; 118 #interrupt-cells = <1>;
109 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 119 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
110 0x81000000 0 0 0x81000000 0x2 0 1 0>; 120 0x81000000 0 0 0x81000000 0x2 0 1 0>;
111 interrupt-map-mask = <0 0 0 0>; 121 interrupt-map-mask = <0 0 0 0>;
112 interrupt-map = <0 0 0 0 &mpic 59>; 122 interrupt-map = <0 0 0 0 &mpic 59>;
113 marvell,pcie-port = <0>; 123 marvell,pcie-port = <0>;
@@ -150,37 +160,88 @@
150 status = "disabled"; 160 status = "disabled";
151 }; 161 };
152 162
153 pcie@9,0 { 163 pcie@5,0 {
154 device_type = "pci"; 164 device_type = "pci";
155 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; 165 assigned-addresses = <0x82000800 0 0x80000 0 0x2000>;
156 reg = <0x4800 0 0 0 0>; 166 reg = <0x2800 0 0 0 0>;
157 #address-cells = <3>; 167 #address-cells = <3>;
158 #size-cells = <2>; 168 #size-cells = <2>;
159 #interrupt-cells = <1>; 169 #interrupt-cells = <1>;
160 ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 170 ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0
161 0x81000000 0 0 0x81000000 0x9 0 1 0>; 171 0x81000000 0 0 0x81000000 0x5 0 1 0>;
162 interrupt-map-mask = <0 0 0 0>; 172 interrupt-map-mask = <0 0 0 0>;
163 interrupt-map = <0 0 0 0 &mpic 99>; 173 interrupt-map = <0 0 0 0 &mpic 62>;
164 marvell,pcie-port = <2>; 174 marvell,pcie-port = <1>;
165 marvell,pcie-lane = <0>; 175 marvell,pcie-lane = <0>;
166 clocks = <&gateclk 26>; 176 clocks = <&gateclk 9>;
167 status = "disabled"; 177 status = "disabled";
168 }; 178 };
169 179
170 pcie@10,0 { 180 pcie@6,0 {
171 device_type = "pci"; 181 device_type = "pci";
172 assigned-addresses = <0x82000800 0 0x82000 0 0x2000>; 182 assigned-addresses = <0x82000800 0 0x84000 0 0x2000>;
173 reg = <0x5000 0 0 0 0>; 183 reg = <0x3000 0 0 0 0>;
174 #address-cells = <3>; 184 #address-cells = <3>;
175 #size-cells = <2>; 185 #size-cells = <2>;
176 #interrupt-cells = <1>; 186 #interrupt-cells = <1>;
177 ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0 187 ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0
178 0x81000000 0 0 0x81000000 0xa 0 1 0>; 188 0x81000000 0 0 0x81000000 0x6 0 1 0>;
179 interrupt-map-mask = <0 0 0 0>; 189 interrupt-map-mask = <0 0 0 0>;
180 interrupt-map = <0 0 0 0 &mpic 103>; 190 interrupt-map = <0 0 0 0 &mpic 63>;
181 marvell,pcie-port = <3>; 191 marvell,pcie-port = <1>;
192 marvell,pcie-lane = <1>;
193 clocks = <&gateclk 10>;
194 status = "disabled";
195 };
196
197 pcie@7,0 {
198 device_type = "pci";
199 assigned-addresses = <0x82000800 0 0x88000 0 0x2000>;
200 reg = <0x3800 0 0 0 0>;
201 #address-cells = <3>;
202 #size-cells = <2>;
203 #interrupt-cells = <1>;
204 ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0
205 0x81000000 0 0 0x81000000 0x7 0 1 0>;
206 interrupt-map-mask = <0 0 0 0>;
207 interrupt-map = <0 0 0 0 &mpic 64>;
208 marvell,pcie-port = <1>;
209 marvell,pcie-lane = <2>;
210 clocks = <&gateclk 11>;
211 status = "disabled";
212 };
213
214 pcie@8,0 {
215 device_type = "pci";
216 assigned-addresses = <0x82000800 0 0x8c000 0 0x2000>;
217 reg = <0x4000 0 0 0 0>;
218 #address-cells = <3>;
219 #size-cells = <2>;
220 #interrupt-cells = <1>;
221 ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0
222 0x81000000 0 0 0x81000000 0x8 0 1 0>;
223 interrupt-map-mask = <0 0 0 0>;
224 interrupt-map = <0 0 0 0 &mpic 65>;
225 marvell,pcie-port = <1>;
226 marvell,pcie-lane = <3>;
227 clocks = <&gateclk 12>;
228 status = "disabled";
229 };
230
231 pcie@9,0 {
232 device_type = "pci";
233 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
234 reg = <0x4800 0 0 0 0>;
235 #address-cells = <3>;
236 #size-cells = <2>;
237 #interrupt-cells = <1>;
238 ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
239 0x81000000 0 0 0x81000000 0x9 0 1 0>;
240 interrupt-map-mask = <0 0 0 0>;
241 interrupt-map = <0 0 0 0 &mpic 99>;
242 marvell,pcie-port = <2>;
182 marvell,pcie-lane = <0>; 243 marvell,pcie-lane = <0>;
183 clocks = <&gateclk 27>; 244 clocks = <&gateclk 26>;
184 status = "disabled"; 245 status = "disabled";
185 }; 246 };
186 }; 247 };
diff --git a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
index 2347e9563cef..6801106fa1f8 100644
--- a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
@@ -11,6 +11,10 @@
11#include <dt-bindings/interrupt-controller/irq.h> 11#include <dt-bindings/interrupt-controller/irq.h>
12 12
13/ { 13/ {
14 aliases {
15 serial4 = &usart3;
16 };
17
14 ahb { 18 ahb {
15 apb { 19 apb {
16 pinctrl@fffff400 { 20 pinctrl@fffff400 {
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index 1e12aeff403b..aa537ed13f0a 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -85,6 +85,8 @@
85 reg = <0x7e205000 0x1000>; 85 reg = <0x7e205000 0x1000>;
86 interrupts = <2 21>; 86 interrupts = <2 21>;
87 clocks = <&clk_i2c>; 87 clocks = <&clk_i2c>;
88 #address-cells = <1>;
89 #size-cells = <0>;
88 status = "disabled"; 90 status = "disabled";
89 }; 91 };
90 92
@@ -93,6 +95,8 @@
93 reg = <0x7e804000 0x1000>; 95 reg = <0x7e804000 0x1000>;
94 interrupts = <2 21>; 96 interrupts = <2 21>;
95 clocks = <&clk_i2c>; 97 clocks = <&clk_i2c>;
98 #address-cells = <1>;
99 #size-cells = <0>;
96 status = "disabled"; 100 status = "disabled";
97 }; 101 };
98 102
diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi
index dc259e8b8a73..9b186ac06c8b 100644
--- a/arch/arm/boot/dts/cros5250-common.dtsi
+++ b/arch/arm/boot/dts/cros5250-common.dtsi
@@ -27,6 +27,13 @@
27 i2c2_bus: i2c2-bus { 27 i2c2_bus: i2c2-bus {
28 samsung,pin-pud = <0>; 28 samsung,pin-pud = <0>;
29 }; 29 };
30
31 max77686_irq: max77686-irq {
32 samsung,pins = "gpx3-2";
33 samsung,pin-function = <0>;
34 samsung,pin-pud = <0>;
35 samsung,pin-drv = <0>;
36 };
30 }; 37 };
31 38
32 i2c@12C60000 { 39 i2c@12C60000 {
@@ -35,6 +42,11 @@
35 42
36 max77686@09 { 43 max77686@09 {
37 compatible = "maxim,max77686"; 44 compatible = "maxim,max77686";
45 interrupt-parent = <&gpx3>;
46 interrupts = <2 0>;
47 pinctrl-names = "default";
48 pinctrl-0 = <&max77686_irq>;
49 wakeup-source;
38 reg = <0x09>; 50 reg = <0x09>;
39 51
40 voltage-regulators { 52 voltage-regulators {
diff --git a/arch/arm/boot/dts/ecx-2000.dts b/arch/arm/boot/dts/ecx-2000.dts
index 139b40cc3a23..2ccbb57fbfa8 100644
--- a/arch/arm/boot/dts/ecx-2000.dts
+++ b/arch/arm/boot/dts/ecx-2000.dts
@@ -85,6 +85,12 @@
85 <1 10 0xf08>; 85 <1 10 0xf08>;
86 }; 86 };
87 87
88 memory-controller@fff00000 {
89 compatible = "calxeda,ecx-2000-ddr-ctrl";
90 reg = <0xfff00000 0x1000>;
91 interrupts = <0 91 4>;
92 };
93
88 intc: interrupt-controller@fff11000 { 94 intc: interrupt-controller@fff11000 {
89 compatible = "arm,cortex-a15-gic"; 95 compatible = "arm,cortex-a15-gic";
90 #interrupt-cells = <3>; 96 #interrupt-cells = <3>;
diff --git a/arch/arm/boot/dts/ecx-common.dtsi b/arch/arm/boot/dts/ecx-common.dtsi
index bc22557d7a6a..b90045a8f8e3 100644
--- a/arch/arm/boot/dts/ecx-common.dtsi
+++ b/arch/arm/boot/dts/ecx-common.dtsi
@@ -53,12 +53,6 @@
53 status = "disabled"; 53 status = "disabled";
54 }; 54 };
55 55
56 memory-controller@fff00000 {
57 compatible = "calxeda,hb-ddr-ctrl";
58 reg = <0xfff00000 0x1000>;
59 interrupts = <0 91 4>;
60 };
61
62 ipc@fff20000 { 56 ipc@fff20000 {
63 compatible = "arm,pl320", "arm,primecell"; 57 compatible = "arm,pl320", "arm,primecell";
64 reg = <0xfff20000 0x1000>; 58 reg = <0xfff20000 0x1000>;
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts
index 6aad34ad9517..ed14aeac0566 100644
--- a/arch/arm/boot/dts/highbank.dts
+++ b/arch/arm/boot/dts/highbank.dts
@@ -86,6 +86,12 @@
86 soc { 86 soc {
87 ranges = <0x00000000 0x00000000 0xffffffff>; 87 ranges = <0x00000000 0x00000000 0xffffffff>;
88 88
89 memory-controller@fff00000 {
90 compatible = "calxeda,hb-ddr-ctrl";
91 reg = <0xfff00000 0x1000>;
92 interrupts = <0 91 4>;
93 };
94
89 timer@fff10600 { 95 timer@fff10600 {
90 compatible = "arm,cortex-a9-twd-timer"; 96 compatible = "arm,cortex-a9-twd-timer";
91 reg = <0xfff10600 0x20>; 97 reg = <0xfff10600 0x20>;
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index f4dcff3a9969..4bcdd3ad15e5 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -190,7 +190,7 @@
190 190
191 usbphy0: usbphy@0 { 191 usbphy0: usbphy@0 {
192 compatible = "usb-nop-xceiv"; 192 compatible = "usb-nop-xceiv";
193 clocks = <&clks 124>; 193 clocks = <&clks 75>;
194 clock-names = "main_clk"; 194 clock-names = "main_clk";
195 status = "okay"; 195 status = "okay";
196 }; 196 };
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 59154dc15fe4..fb28b2ecb1db 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -161,7 +161,7 @@
161 clocks = <&clks 197>, <&clks 3>, 161 clocks = <&clks 197>, <&clks 3>,
162 <&clks 197>, <&clks 107>, 162 <&clks 197>, <&clks 107>,
163 <&clks 0>, <&clks 118>, 163 <&clks 0>, <&clks 118>,
164 <&clks 62>, <&clks 139>, 164 <&clks 0>, <&clks 139>,
165 <&clks 0>; 165 <&clks 0>;
166 clock-names = "core", "rxtx0", 166 clock-names = "core", "rxtx0",
167 "rxtx1", "rxtx2", 167 "rxtx1", "rxtx2",
diff --git a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
index 9c18adf788f7..f577b7df9a29 100644
--- a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
+++ b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
@@ -44,8 +44,8 @@
44 gpmc,wr-access-ns = <186>; 44 gpmc,wr-access-ns = <186>;
45 gpmc,cycle2cycle-samecsen; 45 gpmc,cycle2cycle-samecsen;
46 gpmc,cycle2cycle-diffcsen; 46 gpmc,cycle2cycle-diffcsen;
47 vmmc-supply = <&vddvario>; 47 vddvario-supply = <&vddvario>;
48 vmmc_aux-supply = <&vdd33a>; 48 vdd33a-supply = <&vdd33a>;
49 reg-io-width = <4>; 49 reg-io-width = <4>;
50 smsc,save-mac-address; 50 smsc,save-mac-address;
51 }; 51 };
diff --git a/arch/arm/boot/dts/omap-zoom-common.dtsi b/arch/arm/boot/dts/omap-zoom-common.dtsi
index b0ee342598f0..68221fab978d 100644
--- a/arch/arm/boot/dts/omap-zoom-common.dtsi
+++ b/arch/arm/boot/dts/omap-zoom-common.dtsi
@@ -13,7 +13,7 @@
13 * they probably share the same GPIO IRQ 13 * they probably share the same GPIO IRQ
14 * REVISIT: Add timing support from slls644g.pdf 14 * REVISIT: Add timing support from slls644g.pdf
15 */ 15 */
16 8250@3,0 { 16 uart@3,0 {
17 compatible = "ns16550a"; 17 compatible = "ns16550a";
18 reg = <3 0 0x100>; 18 reg = <3 0 0x100>;
19 bank-width = <2>; 19 bank-width = <2>;
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index a2bfcde858a6..d0c5b37e248c 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <dt-bindings/gpio/gpio.h> 11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/interrupt-controller/irq.h>
12#include <dt-bindings/pinctrl/omap.h> 13#include <dt-bindings/pinctrl/omap.h>
13 14
14#include "skeleton.dtsi" 15#include "skeleton.dtsi"
@@ -21,6 +22,8 @@
21 serial0 = &uart1; 22 serial0 = &uart1;
22 serial1 = &uart2; 23 serial1 = &uart2;
23 serial2 = &uart3; 24 serial2 = &uart3;
25 i2c0 = &i2c1;
26 i2c1 = &i2c2;
24 }; 27 };
25 28
26 cpus { 29 cpus {
@@ -53,6 +56,28 @@
53 ranges; 56 ranges;
54 ti,hwmods = "l3_main"; 57 ti,hwmods = "l3_main";
55 58
59 aes: aes@480a6000 {
60 compatible = "ti,omap2-aes";
61 ti,hwmods = "aes";
62 reg = <0x480a6000 0x50>;
63 dmas = <&sdma 9 &sdma 10>;
64 dma-names = "tx", "rx";
65 };
66
67 hdq1w: 1w@480b2000 {
68 compatible = "ti,omap2420-1w";
69 ti,hwmods = "hdq1w";
70 reg = <0x480b2000 0x1000>;
71 interrupts = <58>;
72 };
73
74 mailbox: mailbox@48094000 {
75 compatible = "ti,omap2-mailbox";
76 ti,hwmods = "mailbox";
77 reg = <0x48094000 0x200>;
78 interrupts = <26>;
79 };
80
56 intc: interrupt-controller@1 { 81 intc: interrupt-controller@1 {
57 compatible = "ti,omap2-intc"; 82 compatible = "ti,omap2-intc";
58 interrupt-controller; 83 interrupt-controller;
@@ -63,6 +88,7 @@
63 88
64 sdma: dma-controller@48056000 { 89 sdma: dma-controller@48056000 {
65 compatible = "ti,omap2430-sdma", "ti,omap2420-sdma"; 90 compatible = "ti,omap2430-sdma", "ti,omap2420-sdma";
91 ti,hwmods = "dma";
66 reg = <0x48056000 0x1000>; 92 reg = <0x48056000 0x1000>;
67 interrupts = <12>, 93 interrupts = <12>,
68 <13>, 94 <13>,
@@ -73,21 +99,91 @@
73 #dma-requests = <64>; 99 #dma-requests = <64>;
74 }; 100 };
75 101
102 i2c1: i2c@48070000 {
103 compatible = "ti,omap2-i2c";
104 ti,hwmods = "i2c1";
105 reg = <0x48070000 0x80>;
106 #address-cells = <1>;
107 #size-cells = <0>;
108 interrupts = <56>;
109 dmas = <&sdma 27 &sdma 28>;
110 dma-names = "tx", "rx";
111 };
112
113 i2c2: i2c@48072000 {
114 compatible = "ti,omap2-i2c";
115 ti,hwmods = "i2c2";
116 reg = <0x48072000 0x80>;
117 #address-cells = <1>;
118 #size-cells = <0>;
119 interrupts = <57>;
120 dmas = <&sdma 29 &sdma 30>;
121 dma-names = "tx", "rx";
122 };
123
124 mcspi1: mcspi@48098000 {
125 compatible = "ti,omap2-mcspi";
126 ti,hwmods = "mcspi1";
127 reg = <0x48098000 0x100>;
128 interrupts = <65>;
129 dmas = <&sdma 35 &sdma 36 &sdma 37 &sdma 38
130 &sdma 39 &sdma 40 &sdma 41 &sdma 42>;
131 dma-names = "tx0", "rx0", "tx1", "rx1",
132 "tx2", "rx2", "tx3", "rx3";
133 };
134
135 mcspi2: mcspi@4809a000 {
136 compatible = "ti,omap2-mcspi";
137 ti,hwmods = "mcspi2";
138 reg = <0x4809a000 0x100>;
139 interrupts = <66>;
140 dmas = <&sdma 43 &sdma 44 &sdma 45 &sdma 46>;
141 dma-names = "tx0", "rx0", "tx1", "rx1";
142 };
143
144 rng: rng@480a0000 {
145 compatible = "ti,omap2-rng";
146 ti,hwmods = "rng";
147 reg = <0x480a0000 0x50>;
148 interrupts = <36>;
149 };
150
151 sham: sham@480a4000 {
152 compatible = "ti,omap2-sham";
153 ti,hwmods = "sham";
154 reg = <0x480a4000 0x64>;
155 interrupts = <51>;
156 dmas = <&sdma 13>;
157 dma-names = "rx";
158 };
159
76 uart1: serial@4806a000 { 160 uart1: serial@4806a000 {
77 compatible = "ti,omap2-uart"; 161 compatible = "ti,omap2-uart";
78 ti,hwmods = "uart1"; 162 ti,hwmods = "uart1";
163 reg = <0x4806a000 0x2000>;
164 interrupts = <72>;
165 dmas = <&sdma 49 &sdma 50>;
166 dma-names = "tx", "rx";
79 clock-frequency = <48000000>; 167 clock-frequency = <48000000>;
80 }; 168 };
81 169
82 uart2: serial@4806c000 { 170 uart2: serial@4806c000 {
83 compatible = "ti,omap2-uart"; 171 compatible = "ti,omap2-uart";
84 ti,hwmods = "uart2"; 172 ti,hwmods = "uart2";
173 reg = <0x4806c000 0x400>;
174 interrupts = <73>;
175 dmas = <&sdma 51 &sdma 52>;
176 dma-names = "tx", "rx";
85 clock-frequency = <48000000>; 177 clock-frequency = <48000000>;
86 }; 178 };
87 179
88 uart3: serial@4806e000 { 180 uart3: serial@4806e000 {
89 compatible = "ti,omap2-uart"; 181 compatible = "ti,omap2-uart";
90 ti,hwmods = "uart3"; 182 ti,hwmods = "uart3";
183 reg = <0x4806e000 0x400>;
184 interrupts = <74>;
185 dmas = <&sdma 53 &sdma 54>;
186 dma-names = "tx", "rx";
91 clock-frequency = <48000000>; 187 clock-frequency = <48000000>;
92 }; 188 };
93 189
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
index c8f9c55169ea..60c605de22dd 100644
--- a/arch/arm/boot/dts/omap2420.dtsi
+++ b/arch/arm/boot/dts/omap2420.dtsi
@@ -114,6 +114,15 @@
114 dma-names = "tx", "rx"; 114 dma-names = "tx", "rx";
115 }; 115 };
116 116
117 msdi1: mmc@4809c000 {
118 compatible = "ti,omap2420-mmc";
119 ti,hwmods = "msdi1";
120 reg = <0x4809c000 0x80>;
121 interrupts = <83>;
122 dmas = <&sdma 61 &sdma 62>;
123 dma-names = "tx", "rx";
124 };
125
117 timer1: timer@48028000 { 126 timer1: timer@48028000 {
118 compatible = "ti,omap2420-timer"; 127 compatible = "ti,omap2420-timer";
119 reg = <0x48028000 0x400>; 128 reg = <0x48028000 0x400>;
@@ -121,5 +130,19 @@
121 ti,hwmods = "timer1"; 130 ti,hwmods = "timer1";
122 ti,timer-alwon; 131 ti,timer-alwon;
123 }; 132 };
133
134 wd_timer2: wdt@48022000 {
135 compatible = "ti,omap2-wdt";
136 ti,hwmods = "wd_timer2";
137 reg = <0x48022000 0x80>;
138 };
124 }; 139 };
125}; 140};
141
142&i2c1 {
143 compatible = "ti,omap2420-i2c";
144};
145
146&i2c2 {
147 compatible = "ti,omap2420-i2c";
148};
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
index c535a5a2b27f..d624345666f5 100644
--- a/arch/arm/boot/dts/omap2430.dtsi
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -175,6 +175,25 @@
175 dma-names = "tx", "rx"; 175 dma-names = "tx", "rx";
176 }; 176 };
177 177
178 mmc1: mmc@4809c000 {
179 compatible = "ti,omap2-hsmmc";
180 reg = <0x4809c000 0x200>;
181 interrupts = <83>;
182 ti,hwmods = "mmc1";
183 ti,dual-volt;
184 dmas = <&sdma 61>, <&sdma 62>;
185 dma-names = "tx", "rx";
186 };
187
188 mmc2: mmc@480b4000 {
189 compatible = "ti,omap2-hsmmc";
190 reg = <0x480b4000 0x200>;
191 interrupts = <86>;
192 ti,hwmods = "mmc2";
193 dmas = <&sdma 47>, <&sdma 48>;
194 dma-names = "tx", "rx";
195 };
196
178 timer1: timer@49018000 { 197 timer1: timer@49018000 {
179 compatible = "ti,omap2420-timer"; 198 compatible = "ti,omap2420-timer";
180 reg = <0x49018000 0x400>; 199 reg = <0x49018000 0x400>;
@@ -182,5 +201,35 @@
182 ti,hwmods = "timer1"; 201 ti,hwmods = "timer1";
183 ti,timer-alwon; 202 ti,timer-alwon;
184 }; 203 };
204
205 mcspi3: mcspi@480b8000 {
206 compatible = "ti,omap2-mcspi";
207 ti,hwmods = "mcspi3";
208 reg = <0x480b8000 0x100>;
209 interrupts = <91>;
210 dmas = <&sdma 15 &sdma 16 &sdma 23 &sdma 24>;
211 dma-names = "tx0", "rx0", "tx1", "rx1";
212 };
213
214 usb_otg_hs: usb_otg_hs@480ac000 {
215 compatible = "ti,omap2-musb";
216 ti,hwmods = "usb_otg_hs";
217 reg = <0x480ac000 0x1000>;
218 interrupts = <93>;
219 };
220
221 wd_timer2: wdt@49016000 {
222 compatible = "ti,omap2-wdt";
223 ti,hwmods = "wd_timer2";
224 reg = <0x49016000 0x80>;
225 };
185 }; 226 };
186}; 227};
228
229&i2c1 {
230 compatible = "ti,omap2430-i2c";
231};
232
233&i2c2 {
234 compatible = "ti,omap2430-i2c";
235};
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 31a632f7effb..df33a50bc070 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -215,3 +215,10 @@
215&usbhsehci { 215&usbhsehci {
216 phys = <0 &hsusb2_phy>; 216 phys = <0 &hsusb2_phy>;
217}; 217};
218
219&vaux2 {
220 regulator-name = "usb_1v8";
221 regulator-min-microvolt = <1800000>;
222 regulator-max-microvolt = <1800000>;
223 regulator-always-on;
224};
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
index fa532aaacc68..3ba4a625ea5b 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -61,6 +61,14 @@
61 vcc-supply = <&hsusb2_power>; 61 vcc-supply = <&hsusb2_power>;
62 }; 62 };
63 63
64 sound {
65 compatible = "ti,omap-twl4030";
66 ti,model = "omap3beagle";
67
68 ti,mcbsp = <&mcbsp2>;
69 ti,codec = <&twl_audio>;
70 };
71
64 gpio_keys { 72 gpio_keys {
65 compatible = "gpio-keys"; 73 compatible = "gpio-keys";
66 74
@@ -120,6 +128,12 @@
120 reg = <0x48>; 128 reg = <0x48>;
121 interrupts = <7>; /* SYS_NIRQ cascaded to intc */ 129 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
122 interrupt-parent = <&intc>; 130 interrupt-parent = <&intc>;
131
132 twl_audio: audio {
133 compatible = "ti,twl4030-audio";
134 codec {
135 };
136 };
123 }; 137 };
124}; 138};
125 139
@@ -178,3 +192,10 @@
178 mode = <3>; 192 mode = <3>;
179 power = <50>; 193 power = <50>;
180}; 194};
195
196&vaux2 {
197 regulator-name = "vdd_ehci";
198 regulator-min-microvolt = <1800000>;
199 regulator-max-microvolt = <1800000>;
200 regulator-always-on;
201};
diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi
index ba1e58b7b7e3..165aaf7591ba 100644
--- a/arch/arm/boot/dts/omap3-igep.dtsi
+++ b/arch/arm/boot/dts/omap3-igep.dtsi
@@ -1,5 +1,5 @@
1/* 1/*
2 * Device Tree Source for IGEP Technology devices 2 * Common device tree for IGEP boards based on AM/DM37x
3 * 3 *
4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> 4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> 5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
@@ -10,7 +10,7 @@
10 */ 10 */
11/dts-v1/; 11/dts-v1/;
12 12
13#include "omap34xx.dtsi" 13#include "omap36xx.dtsi"
14 14
15/ { 15/ {
16 memory { 16 memory {
@@ -24,6 +24,25 @@
24 ti,mcbsp = <&mcbsp2>; 24 ti,mcbsp = <&mcbsp2>;
25 ti,codec = <&twl_audio>; 25 ti,codec = <&twl_audio>;
26 }; 26 };
27
28 vdd33: regulator-vdd33 {
29 compatible = "regulator-fixed";
30 regulator-name = "vdd33";
31 regulator-always-on;
32 };
33
34 lbee1usjyc_vmmc: lbee1usjyc_vmmc {
35 pinctrl-names = "default";
36 pinctrl-0 = <&lbee1usjyc_pins>;
37 compatible = "regulator-fixed";
38 regulator-name = "regulator-lbee1usjyc";
39 regulator-min-microvolt = <3300000>;
40 regulator-max-microvolt = <3300000>;
41 gpio = <&gpio5 10 GPIO_ACTIVE_HIGH>; /* gpio_138 WIFI_PDN */
42 startup-delay-us = <10000>;
43 enable-active-high;
44 vin-supply = <&vdd33>;
45 };
27}; 46};
28 47
29&omap3_pmx_core { 48&omap3_pmx_core {
@@ -48,6 +67,15 @@
48 >; 67 >;
49 }; 68 };
50 69
70 /* WiFi/BT combo */
71 lbee1usjyc_pins: pinmux_lbee1usjyc_pins {
72 pinctrl-single,pins = <
73 0x136 (PIN_OUTPUT | MUX_MODE4) /* sdmmc2_dat5.gpio_137 */
74 0x138 (PIN_OUTPUT | MUX_MODE4) /* sdmmc2_dat6.gpio_138 */
75 0x13a (PIN_OUTPUT | MUX_MODE4) /* sdmmc2_dat7.gpio_139 */
76 >;
77 };
78
51 mcbsp2_pins: pinmux_mcbsp2_pins { 79 mcbsp2_pins: pinmux_mcbsp2_pins {
52 pinctrl-single,pins = < 80 pinctrl-single,pins = <
53 0x10c (PIN_INPUT | MUX_MODE0) /* mcbsp2_fsx.mcbsp2_fsx */ 81 0x10c (PIN_INPUT | MUX_MODE0) /* mcbsp2_fsx.mcbsp2_fsx */
@@ -65,10 +93,17 @@
65 0x11a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */ 93 0x11a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
66 0x11c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */ 94 0x11c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
67 0x11e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */ 95 0x11e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
68 0x120 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat4.sdmmc1_dat4 */ 96 >;
69 0x122 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat5.sdmmc1_dat5 */ 97 };
70 0x124 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat6.sdmmc1_dat6 */ 98
71 0x126 (PIN_INPUT | MUX_MODE0) /* sdmmc1_dat7.sdmmc1_dat7 */ 99 mmc2_pins: pinmux_mmc2_pins {
100 pinctrl-single,pins = <
101 0x128 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */
102 0x12a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */
103 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */
104 0x12e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */
105 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */
106 0x132 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */
72 >; 107 >;
73 }; 108 };
74 109
@@ -78,10 +113,33 @@
78 >; 113 >;
79 }; 114 };
80 115
116 i2c1_pins: pinmux_i2c1_pins {
117 pinctrl-single,pins = <
118 0x18a (PIN_INPUT | MUX_MODE0) /* i2c1_scl.i2c1_scl */
119 0x18c (PIN_INPUT | MUX_MODE0) /* i2c1_sda.i2c1_sda */
120 >;
121 };
122
123 i2c2_pins: pinmux_i2c2_pins {
124 pinctrl-single,pins = <
125 0x18e (PIN_INPUT | MUX_MODE0) /* i2c2_scl.i2c2_scl */
126 0x190 (PIN_INPUT | MUX_MODE0) /* i2c2_sda.i2c2_sda */
127 >;
128 };
129
130 i2c3_pins: pinmux_i2c3_pins {
131 pinctrl-single,pins = <
132 0x192 (PIN_INPUT | MUX_MODE0) /* i2c3_scl.i2c3_scl */
133 0x194 (PIN_INPUT | MUX_MODE0) /* i2c3_sda.i2c3_sda */
134 >;
135 };
136
81 leds_pins: pinmux_leds_pins { }; 137 leds_pins: pinmux_leds_pins { };
82}; 138};
83 139
84&i2c1 { 140&i2c1 {
141 pinctrl-names = "default";
142 pinctrl-0 = <&i2c1_pins>;
85 clock-frequency = <2600000>; 143 clock-frequency = <2600000>;
86 144
87 twl: twl@48 { 145 twl: twl@48 {
@@ -101,9 +159,16 @@
101#include "twl4030_omap3.dtsi" 159#include "twl4030_omap3.dtsi"
102 160
103&i2c2 { 161&i2c2 {
162 pinctrl-names = "default";
163 pinctrl-0 = <&i2c2_pins>;
104 clock-frequency = <400000>; 164 clock-frequency = <400000>;
105}; 165};
106 166
167&i2c3 {
168 pinctrl-names = "default";
169 pinctrl-0 = <&i2c3_pins>;
170};
171
107&mcbsp2 { 172&mcbsp2 {
108 pinctrl-names = "default"; 173 pinctrl-names = "default";
109 pinctrl-0 = <&mcbsp2_pins>; 174 pinctrl-0 = <&mcbsp2_pins>;
@@ -114,11 +179,15 @@
114 pinctrl-0 = <&mmc1_pins>; 179 pinctrl-0 = <&mmc1_pins>;
115 vmmc-supply = <&vmmc1>; 180 vmmc-supply = <&vmmc1>;
116 vmmc_aux-supply = <&vsim>; 181 vmmc_aux-supply = <&vsim>;
117 bus-width = <8>; 182 bus-width = <4>;
118}; 183};
119 184
120&mmc2 { 185&mmc2 {
121 status = "disabled"; 186 pinctrl-names = "default";
187 pinctrl-0 = <&mmc2_pins>;
188 vmmc-supply = <&lbee1usjyc_vmmc>;
189 bus-width = <4>;
190 non-removable;
122}; 191};
123 192
124&mmc3 { 193&mmc3 {
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts
index d5cc79267250..1c7e74d2d2bc 100644
--- a/arch/arm/boot/dts/omap3-igep0020.dts
+++ b/arch/arm/boot/dts/omap3-igep0020.dts
@@ -1,5 +1,5 @@
1/* 1/*
2 * Device Tree Source for IGEPv2 board 2 * Device Tree Source for IGEPv2 Rev. (TI OMAP AM/DM37x)
3 * 3 *
4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> 4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> 5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
@@ -13,7 +13,7 @@
13#include "omap-gpmc-smsc911x.dtsi" 13#include "omap-gpmc-smsc911x.dtsi"
14 14
15/ { 15/ {
16 model = "IGEPv2"; 16 model = "IGEPv2 (TI OMAP AM/DM37x)";
17 compatible = "isee,omap3-igep0020", "ti,omap3"; 17 compatible = "isee,omap3-igep0020", "ti,omap3";
18 18
19 leds { 19 leds {
@@ -67,6 +67,8 @@
67 pinctrl-names = "default"; 67 pinctrl-names = "default";
68 pinctrl-0 = < 68 pinctrl-0 = <
69 &hsusbb1_pins 69 &hsusbb1_pins
70 &tfp410_pins
71 &dss_pins
70 >; 72 >;
71 73
72 hsusbb1_pins: pinmux_hsusbb1_pins { 74 hsusbb1_pins: pinmux_hsusbb1_pins {
@@ -85,6 +87,45 @@
85 0x5ba (PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d7.hsusb1_data3 */ 87 0x5ba (PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d7.hsusb1_data3 */
86 >; 88 >;
87 }; 89 };
90
91 tfp410_pins: tfp410_dvi_pins {
92 pinctrl-single,pins = <
93 0x196 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
94 >;
95 };
96
97 dss_pins: pinmux_dss_dvi_pins {
98 pinctrl-single,pins = <
99 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
100 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
101 0x0a8 (PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
102 0x0aa (PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */
103 0x0ac (PIN_OUTPUT | MUX_MODE0) /* dss_data0.dss_data0 */
104 0x0ae (PIN_OUTPUT | MUX_MODE0) /* dss_data1.dss_data1 */
105 0x0b0 (PIN_OUTPUT | MUX_MODE0) /* dss_data2.dss_data2 */
106 0x0b2 (PIN_OUTPUT | MUX_MODE0) /* dss_data3.dss_data3 */
107 0x0b4 (PIN_OUTPUT | MUX_MODE0) /* dss_data4.dss_data4 */
108 0x0b6 (PIN_OUTPUT | MUX_MODE0) /* dss_data5.dss_data5 */
109 0x0b8 (PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
110 0x0ba (PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
111 0x0bc (PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
112 0x0be (PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
113 0x0c0 (PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
114 0x0c2 (PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
115 0x0c4 (PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
116 0x0c6 (PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
117 0x0c8 (PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
118 0x0ca (PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
119 0x0cc (PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */
120 0x0ce (PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */
121 0x0d0 (PIN_OUTPUT | MUX_MODE0) /* dss_data18.dss_data18 */
122 0x0d2 (PIN_OUTPUT | MUX_MODE0) /* dss_data19.dss_data19 */
123 0x0d4 (PIN_OUTPUT | MUX_MODE0) /* dss_data20.dss_data20 */
124 0x0d6 (PIN_OUTPUT | MUX_MODE0) /* dss_data21.dss_data21 */
125 0x0d8 (PIN_OUTPUT | MUX_MODE0) /* dss_data22.dss_data22 */
126 0x0da (PIN_OUTPUT | MUX_MODE0) /* dss_data23.dss_data23 */
127 >;
128 };
88}; 129};
89 130
90&leds_pins { 131&leds_pins {
@@ -174,3 +215,8 @@
174&usbhsehci { 215&usbhsehci {
175 phys = <&hsusb1_phy>; 216 phys = <&hsusb1_phy>;
176}; 217};
218
219&vpll2 {
220 /* Needed for DSS */
221 regulator-name = "vdds_dsi";
222};
diff --git a/arch/arm/boot/dts/omap3-igep0030.dts b/arch/arm/boot/dts/omap3-igep0030.dts
index 525e6d9b0978..02a23f8a3384 100644
--- a/arch/arm/boot/dts/omap3-igep0030.dts
+++ b/arch/arm/boot/dts/omap3-igep0030.dts
@@ -1,5 +1,5 @@
1/* 1/*
2 * Device Tree Source for IGEP COM Module 2 * Device Tree Source for IGEP COM MODULE (TI OMAP AM/DM37x)
3 * 3 *
4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk> 4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com> 5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
@@ -12,7 +12,7 @@
12#include "omap3-igep.dtsi" 12#include "omap3-igep.dtsi"
13 13
14/ { 14/ {
15 model = "IGEP COM Module"; 15 model = "IGEP COM MODULE (TI OMAP AM/DM37x)";
16 compatible = "isee,omap3-igep0030", "ti,omap3"; 16 compatible = "isee,omap3-igep0030", "ti,omap3";
17 17
18 leds { 18 leds {
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index c4f20bfe4cce..6fc85f963530 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -9,7 +9,7 @@
9 9
10/dts-v1/; 10/dts-v1/;
11 11
12#include "omap34xx.dtsi" 12#include "omap34xx-hs.dtsi"
13 13
14/ { 14/ {
15 model = "Nokia N900"; 15 model = "Nokia N900";
@@ -125,6 +125,21 @@
125 >; 125 >;
126 }; 126 };
127 127
128 mmc2_pins: pinmux_mmc2_pins {
129 pinctrl-single,pins = <
130 0x128 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk */
131 0x12a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd */
132 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0 */
133 0x12e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1 */
134 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2 */
135 0x132 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3 */
136 0x134 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat4 */
137 0x136 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat5 */
138 0x138 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat6 */
139 0x13a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat7 */
140 >;
141 };
142
128 display_pins: pinmux_display_pins { 143 display_pins: pinmux_display_pins {
129 pinctrl-single,pins = < 144 pinctrl-single,pins = <
130 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */ 145 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */
@@ -358,8 +373,14 @@
358 cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */ 373 cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
359}; 374};
360 375
376/* most boards use vaux3, only some old versions use vmmc2 instead */
361&mmc2 { 377&mmc2 {
362 status = "disabled"; 378 pinctrl-names = "default";
379 pinctrl-0 = <&mmc2_pins>;
380 vmmc-supply = <&vaux3>;
381 vmmc_aux-supply = <&vsim>;
382 bus-width = <8>;
383 non-removable;
363}; 384};
364 385
365&mmc3 { 386&mmc3 {
diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index 94eb77d3b9dd..5c26c184f2c1 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -8,7 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include "omap36xx.dtsi" 11#include "omap36xx-hs.dtsi"
12 12
13/ { 13/ {
14 cpus { 14 cpus {
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index f3a0c26ed0c2..daabf99d402a 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -82,6 +82,13 @@
82 ranges; 82 ranges;
83 ti,hwmods = "l3_main"; 83 ti,hwmods = "l3_main";
84 84
85 aes: aes@480c5000 {
86 compatible = "ti,omap3-aes";
87 ti,hwmods = "aes";
88 reg = <0x480c5000 0x50>;
89 interrupts = <0>;
90 };
91
85 counter32k: counter@48320000 { 92 counter32k: counter@48320000 {
86 compatible = "ti,omap-counter32k"; 93 compatible = "ti,omap-counter32k";
87 reg = <0x48320000 0x20>; 94 reg = <0x48320000 0x20>;
@@ -260,6 +267,13 @@
260 ti,hwmods = "i2c3"; 267 ti,hwmods = "i2c3";
261 }; 268 };
262 269
270 mailbox: mailbox@48094000 {
271 compatible = "ti,omap3-mailbox";
272 ti,hwmods = "mailbox";
273 reg = <0x48094000 0x200>;
274 interrupts = <26>;
275 };
276
263 mcspi1: spi@48098000 { 277 mcspi1: spi@48098000 {
264 compatible = "ti,omap2-mcspi"; 278 compatible = "ti,omap2-mcspi";
265 reg = <0x48098000 0x100>; 279 reg = <0x48098000 0x100>;
@@ -357,6 +371,13 @@
357 dma-names = "tx", "rx"; 371 dma-names = "tx", "rx";
358 }; 372 };
359 373
374 mmu_isp: mmu@480bd400 {
375 compatible = "ti,omap3-mmu-isp";
376 ti,hwmods = "mmu_isp";
377 reg = <0x480bd400 0x80>;
378 interrupts = <8>;
379 };
380
360 wdt2: wdt@48314000 { 381 wdt2: wdt@48314000 {
361 compatible = "ti,omap3-wdt"; 382 compatible = "ti,omap3-wdt";
362 reg = <0x48314000 0x80>; 383 reg = <0x48314000 0x80>;
@@ -442,6 +463,27 @@
442 dma-names = "tx", "rx"; 463 dma-names = "tx", "rx";
443 }; 464 };
444 465
466 sham: sham@480c3000 {
467 compatible = "ti,omap3-sham";
468 ti,hwmods = "sham";
469 reg = <0x480c3000 0x64>;
470 interrupts = <49>;
471 };
472
473 smartreflex_core: smartreflex@480cb000 {
474 compatible = "ti,omap3-smartreflex-core";
475 ti,hwmods = "smartreflex_core";
476 reg = <0x480cb000 0x400>;
477 interrupts = <19>;
478 };
479
480 smartreflex_mpu_iva: smartreflex@480c9000 {
481 compatible = "ti,omap3-smartreflex-iva";
482 ti,hwmods = "smartreflex_mpu_iva";
483 reg = <0x480c9000 0x400>;
484 interrupts = <18>;
485 };
486
445 timer1: timer@48318000 { 487 timer1: timer@48318000 {
446 compatible = "ti,omap3430-timer"; 488 compatible = "ti,omap3430-timer";
447 reg = <0x48318000 0x400>; 489 reg = <0x48318000 0x400>;
diff --git a/arch/arm/boot/dts/omap34xx-hs.dtsi b/arch/arm/boot/dts/omap34xx-hs.dtsi
new file mode 100644
index 000000000000..1ff626489546
--- /dev/null
+++ b/arch/arm/boot/dts/omap34xx-hs.dtsi
@@ -0,0 +1,16 @@
1/* Disabled modules for secure omaps */
2
3#include "omap34xx.dtsi"
4
5/* Secure omaps have some devices inaccessible depending on the firmware */
6&aes {
7 status = "disabled";
8};
9
10&sham {
11 status = "disabled";
12};
13
14&timer12 {
15 status = "disabled";
16};
diff --git a/arch/arm/boot/dts/omap36xx-hs.dtsi b/arch/arm/boot/dts/omap36xx-hs.dtsi
new file mode 100644
index 000000000000..2c7febb0e016
--- /dev/null
+++ b/arch/arm/boot/dts/omap36xx-hs.dtsi
@@ -0,0 +1,16 @@
1/* Disabled modules for secure omaps */
2
3#include "omap36xx.dtsi"
4
5/* Secure omaps have some devices inaccessible depending on the firmware */
6&aes {
7 status = "disabled";
8};
9
10&sham {
11 status = "disabled";
12};
13
14&timer12 {
15 status = "disabled";
16};
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 298e85020e1b..88c6a05cab41 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -246,15 +246,6 @@
246 0xf0 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_sda */ 246 0xf0 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_sda */
247 >; 247 >;
248 }; 248 };
249};
250
251&omap4_pmx_wkup {
252 led_wkgpio_pins: pinmux_leds_wkpins {
253 pinctrl-single,pins = <
254 0x1a (PIN_OUTPUT | MUX_MODE3) /* gpio_wk7 */
255 0x1c (PIN_OUTPUT | MUX_MODE3) /* gpio_wk8 */
256 >;
257 };
258 249
259 /* 250 /*
260 * wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP 251 * wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP
@@ -274,7 +265,7 @@
274 pinctrl-single,pins = < 265 pinctrl-single,pins = <
275 0x38 (PIN_INPUT | MUX_MODE3) /* gpmc_ncs2.gpio_52 */ 266 0x38 (PIN_INPUT | MUX_MODE3) /* gpmc_ncs2.gpio_52 */
276 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */ 267 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */
277 0x108 (PIN_OUTPUT | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */ 268 0x108 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */
278 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */ 269 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */
279 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */ 270 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */
280 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */ 271 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */
@@ -284,6 +275,15 @@
284 }; 275 };
285}; 276};
286 277
278&omap4_pmx_wkup {
279 led_wkgpio_pins: pinmux_leds_wkpins {
280 pinctrl-single,pins = <
281 0x1a (PIN_OUTPUT | MUX_MODE3) /* gpio_wk7 */
282 0x1c (PIN_OUTPUT | MUX_MODE3) /* gpio_wk8 */
283 >;
284 };
285};
286
287&i2c1 { 287&i2c1 {
288 pinctrl-names = "default"; 288 pinctrl-names = "default";
289 pinctrl-0 = <&i2c1_pins>; 289 pinctrl-0 = <&i2c1_pins>;
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 5fc3f43c5a81..dbc81fb6ef03 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -300,12 +300,12 @@
300 wl12xx_pins: pinmux_wl12xx_pins { 300 wl12xx_pins: pinmux_wl12xx_pins {
301 pinctrl-single,pins = < 301 pinctrl-single,pins = <
302 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */ 302 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */
303 0x108 (PIN_OUTPUT | MUX_MODE3) /* sdmmc5_clk.sdmmc5_clk */ 303 0x108 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */
304 0x10a (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_cmd.sdmmc5_cmd */ 304 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */
305 0x10c (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat0.sdmmc5_dat0 */ 305 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */
306 0x10e (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat1.sdmmc5_dat1 */ 306 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */
307 0x110 (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat2.sdmmc5_dat2 */ 307 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat2.sdmmc5_dat2 */
308 0x112 (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat3.sdmmc5_dat3 */ 308 0x112 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat3.sdmmc5_dat3 */
309 >; 309 >;
310 }; 310 };
311}; 311};
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
index 6d09b8d42fdd..f936476c2753 100644
--- a/arch/arm/boot/dts/socfpga.dtsi
+++ b/arch/arm/boot/dts/socfpga.dtsi
@@ -245,14 +245,14 @@
245 245
246 mpu_periph_clk: mpu_periph_clk { 246 mpu_periph_clk: mpu_periph_clk {
247 #clock-cells = <0>; 247 #clock-cells = <0>;
248 compatible = "altr,socfpga-gate-clk"; 248 compatible = "altr,socfpga-perip-clk";
249 clocks = <&mpuclk>; 249 clocks = <&mpuclk>;
250 fixed-divider = <4>; 250 fixed-divider = <4>;
251 }; 251 };
252 252
253 mpu_l2_ram_clk: mpu_l2_ram_clk { 253 mpu_l2_ram_clk: mpu_l2_ram_clk {
254 #clock-cells = <0>; 254 #clock-cells = <0>;
255 compatible = "altr,socfpga-gate-clk"; 255 compatible = "altr,socfpga-perip-clk";
256 clocks = <&mpuclk>; 256 clocks = <&mpuclk>;
257 fixed-divider = <2>; 257 fixed-divider = <2>;
258 }; 258 };
@@ -266,8 +266,9 @@
266 266
267 l3_main_clk: l3_main_clk { 267 l3_main_clk: l3_main_clk {
268 #clock-cells = <0>; 268 #clock-cells = <0>;
269 compatible = "altr,socfpga-gate-clk"; 269 compatible = "altr,socfpga-perip-clk";
270 clocks = <&mainclk>; 270 clocks = <&mainclk>;
271 fixed-divider = <1>;
271 }; 272 };
272 273
273 l3_mp_clk: l3_mp_clk { 274 l3_mp_clk: l3_mp_clk {
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index c1751a64889a..7f5878c2784a 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -193,7 +193,10 @@
193 pio: pinctrl@01c20800 { 193 pio: pinctrl@01c20800 {
194 compatible = "allwinner,sun6i-a31-pinctrl"; 194 compatible = "allwinner,sun6i-a31-pinctrl";
195 reg = <0x01c20800 0x400>; 195 reg = <0x01c20800 0x400>;
196 interrupts = <0 11 1>, <0 15 1>, <0 16 1>, <0 17 1>; 196 interrupts = <0 11 4>,
197 <0 15 4>,
198 <0 16 4>,
199 <0 17 4>;
197 clocks = <&apb1_gates 5>; 200 clocks = <&apb1_gates 5>;
198 gpio-controller; 201 gpio-controller;
199 interrupt-controller; 202 interrupt-controller;
@@ -212,11 +215,11 @@
212 timer@01c20c00 { 215 timer@01c20c00 {
213 compatible = "allwinner,sun4i-timer"; 216 compatible = "allwinner,sun4i-timer";
214 reg = <0x01c20c00 0xa0>; 217 reg = <0x01c20c00 0xa0>;
215 interrupts = <0 18 1>, 218 interrupts = <0 18 4>,
216 <0 19 1>, 219 <0 19 4>,
217 <0 20 1>, 220 <0 20 4>,
218 <0 21 1>, 221 <0 21 4>,
219 <0 22 1>; 222 <0 22 4>;
220 clocks = <&osc24M>; 223 clocks = <&osc24M>;
221 }; 224 };
222 225
@@ -228,7 +231,7 @@
228 uart0: serial@01c28000 { 231 uart0: serial@01c28000 {
229 compatible = "snps,dw-apb-uart"; 232 compatible = "snps,dw-apb-uart";
230 reg = <0x01c28000 0x400>; 233 reg = <0x01c28000 0x400>;
231 interrupts = <0 0 1>; 234 interrupts = <0 0 4>;
232 reg-shift = <2>; 235 reg-shift = <2>;
233 reg-io-width = <4>; 236 reg-io-width = <4>;
234 clocks = <&apb2_gates 16>; 237 clocks = <&apb2_gates 16>;
@@ -238,7 +241,7 @@
238 uart1: serial@01c28400 { 241 uart1: serial@01c28400 {
239 compatible = "snps,dw-apb-uart"; 242 compatible = "snps,dw-apb-uart";
240 reg = <0x01c28400 0x400>; 243 reg = <0x01c28400 0x400>;
241 interrupts = <0 1 1>; 244 interrupts = <0 1 4>;
242 reg-shift = <2>; 245 reg-shift = <2>;
243 reg-io-width = <4>; 246 reg-io-width = <4>;
244 clocks = <&apb2_gates 17>; 247 clocks = <&apb2_gates 17>;
@@ -248,7 +251,7 @@
248 uart2: serial@01c28800 { 251 uart2: serial@01c28800 {
249 compatible = "snps,dw-apb-uart"; 252 compatible = "snps,dw-apb-uart";
250 reg = <0x01c28800 0x400>; 253 reg = <0x01c28800 0x400>;
251 interrupts = <0 2 1>; 254 interrupts = <0 2 4>;
252 reg-shift = <2>; 255 reg-shift = <2>;
253 reg-io-width = <4>; 256 reg-io-width = <4>;
254 clocks = <&apb2_gates 18>; 257 clocks = <&apb2_gates 18>;
@@ -258,7 +261,7 @@
258 uart3: serial@01c28c00 { 261 uart3: serial@01c28c00 {
259 compatible = "snps,dw-apb-uart"; 262 compatible = "snps,dw-apb-uart";
260 reg = <0x01c28c00 0x400>; 263 reg = <0x01c28c00 0x400>;
261 interrupts = <0 3 1>; 264 interrupts = <0 3 4>;
262 reg-shift = <2>; 265 reg-shift = <2>;
263 reg-io-width = <4>; 266 reg-io-width = <4>;
264 clocks = <&apb2_gates 19>; 267 clocks = <&apb2_gates 19>;
@@ -268,7 +271,7 @@
268 uart4: serial@01c29000 { 271 uart4: serial@01c29000 {
269 compatible = "snps,dw-apb-uart"; 272 compatible = "snps,dw-apb-uart";
270 reg = <0x01c29000 0x400>; 273 reg = <0x01c29000 0x400>;
271 interrupts = <0 4 1>; 274 interrupts = <0 4 4>;
272 reg-shift = <2>; 275 reg-shift = <2>;
273 reg-io-width = <4>; 276 reg-io-width = <4>;
274 clocks = <&apb2_gates 20>; 277 clocks = <&apb2_gates 20>;
@@ -278,7 +281,7 @@
278 uart5: serial@01c29400 { 281 uart5: serial@01c29400 {
279 compatible = "snps,dw-apb-uart"; 282 compatible = "snps,dw-apb-uart";
280 reg = <0x01c29400 0x400>; 283 reg = <0x01c29400 0x400>;
281 interrupts = <0 5 1>; 284 interrupts = <0 5 4>;
282 reg-shift = <2>; 285 reg-shift = <2>;
283 reg-io-width = <4>; 286 reg-io-width = <4>;
284 clocks = <&apb2_gates 21>; 287 clocks = <&apb2_gates 21>;
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index e46cfedde74c..367611a0730b 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -170,7 +170,7 @@
170 emac: ethernet@01c0b000 { 170 emac: ethernet@01c0b000 {
171 compatible = "allwinner,sun4i-emac"; 171 compatible = "allwinner,sun4i-emac";
172 reg = <0x01c0b000 0x1000>; 172 reg = <0x01c0b000 0x1000>;
173 interrupts = <0 55 1>; 173 interrupts = <0 55 4>;
174 clocks = <&ahb_gates 17>; 174 clocks = <&ahb_gates 17>;
175 status = "disabled"; 175 status = "disabled";
176 }; 176 };
@@ -186,7 +186,7 @@
186 pio: pinctrl@01c20800 { 186 pio: pinctrl@01c20800 {
187 compatible = "allwinner,sun7i-a20-pinctrl"; 187 compatible = "allwinner,sun7i-a20-pinctrl";
188 reg = <0x01c20800 0x400>; 188 reg = <0x01c20800 0x400>;
189 interrupts = <0 28 1>; 189 interrupts = <0 28 4>;
190 clocks = <&apb0_gates 5>; 190 clocks = <&apb0_gates 5>;
191 gpio-controller; 191 gpio-controller;
192 interrupt-controller; 192 interrupt-controller;
@@ -251,12 +251,12 @@
251 timer@01c20c00 { 251 timer@01c20c00 {
252 compatible = "allwinner,sun4i-timer"; 252 compatible = "allwinner,sun4i-timer";
253 reg = <0x01c20c00 0x90>; 253 reg = <0x01c20c00 0x90>;
254 interrupts = <0 22 1>, 254 interrupts = <0 22 4>,
255 <0 23 1>, 255 <0 23 4>,
256 <0 24 1>, 256 <0 24 4>,
257 <0 25 1>, 257 <0 25 4>,
258 <0 67 1>, 258 <0 67 4>,
259 <0 68 1>; 259 <0 68 4>;
260 clocks = <&osc24M>; 260 clocks = <&osc24M>;
261 }; 261 };
262 262
@@ -273,7 +273,7 @@
273 uart0: serial@01c28000 { 273 uart0: serial@01c28000 {
274 compatible = "snps,dw-apb-uart"; 274 compatible = "snps,dw-apb-uart";
275 reg = <0x01c28000 0x400>; 275 reg = <0x01c28000 0x400>;
276 interrupts = <0 1 1>; 276 interrupts = <0 1 4>;
277 reg-shift = <2>; 277 reg-shift = <2>;
278 reg-io-width = <4>; 278 reg-io-width = <4>;
279 clocks = <&apb1_gates 16>; 279 clocks = <&apb1_gates 16>;
@@ -283,7 +283,7 @@
283 uart1: serial@01c28400 { 283 uart1: serial@01c28400 {
284 compatible = "snps,dw-apb-uart"; 284 compatible = "snps,dw-apb-uart";
285 reg = <0x01c28400 0x400>; 285 reg = <0x01c28400 0x400>;
286 interrupts = <0 2 1>; 286 interrupts = <0 2 4>;
287 reg-shift = <2>; 287 reg-shift = <2>;
288 reg-io-width = <4>; 288 reg-io-width = <4>;
289 clocks = <&apb1_gates 17>; 289 clocks = <&apb1_gates 17>;
@@ -293,7 +293,7 @@
293 uart2: serial@01c28800 { 293 uart2: serial@01c28800 {
294 compatible = "snps,dw-apb-uart"; 294 compatible = "snps,dw-apb-uart";
295 reg = <0x01c28800 0x400>; 295 reg = <0x01c28800 0x400>;
296 interrupts = <0 3 1>; 296 interrupts = <0 3 4>;
297 reg-shift = <2>; 297 reg-shift = <2>;
298 reg-io-width = <4>; 298 reg-io-width = <4>;
299 clocks = <&apb1_gates 18>; 299 clocks = <&apb1_gates 18>;
@@ -303,7 +303,7 @@
303 uart3: serial@01c28c00 { 303 uart3: serial@01c28c00 {
304 compatible = "snps,dw-apb-uart"; 304 compatible = "snps,dw-apb-uart";
305 reg = <0x01c28c00 0x400>; 305 reg = <0x01c28c00 0x400>;
306 interrupts = <0 4 1>; 306 interrupts = <0 4 4>;
307 reg-shift = <2>; 307 reg-shift = <2>;
308 reg-io-width = <4>; 308 reg-io-width = <4>;
309 clocks = <&apb1_gates 19>; 309 clocks = <&apb1_gates 19>;
@@ -313,7 +313,7 @@
313 uart4: serial@01c29000 { 313 uart4: serial@01c29000 {
314 compatible = "snps,dw-apb-uart"; 314 compatible = "snps,dw-apb-uart";
315 reg = <0x01c29000 0x400>; 315 reg = <0x01c29000 0x400>;
316 interrupts = <0 17 1>; 316 interrupts = <0 17 4>;
317 reg-shift = <2>; 317 reg-shift = <2>;
318 reg-io-width = <4>; 318 reg-io-width = <4>;
319 clocks = <&apb1_gates 20>; 319 clocks = <&apb1_gates 20>;
@@ -323,7 +323,7 @@
323 uart5: serial@01c29400 { 323 uart5: serial@01c29400 {
324 compatible = "snps,dw-apb-uart"; 324 compatible = "snps,dw-apb-uart";
325 reg = <0x01c29400 0x400>; 325 reg = <0x01c29400 0x400>;
326 interrupts = <0 18 1>; 326 interrupts = <0 18 4>;
327 reg-shift = <2>; 327 reg-shift = <2>;
328 reg-io-width = <4>; 328 reg-io-width = <4>;
329 clocks = <&apb1_gates 21>; 329 clocks = <&apb1_gates 21>;
@@ -333,7 +333,7 @@
333 uart6: serial@01c29800 { 333 uart6: serial@01c29800 {
334 compatible = "snps,dw-apb-uart"; 334 compatible = "snps,dw-apb-uart";
335 reg = <0x01c29800 0x400>; 335 reg = <0x01c29800 0x400>;
336 interrupts = <0 19 1>; 336 interrupts = <0 19 4>;
337 reg-shift = <2>; 337 reg-shift = <2>;
338 reg-io-width = <4>; 338 reg-io-width = <4>;
339 clocks = <&apb1_gates 22>; 339 clocks = <&apb1_gates 22>;
@@ -343,7 +343,7 @@
343 uart7: serial@01c29c00 { 343 uart7: serial@01c29c00 {
344 compatible = "snps,dw-apb-uart"; 344 compatible = "snps,dw-apb-uart";
345 reg = <0x01c29c00 0x400>; 345 reg = <0x01c29c00 0x400>;
346 interrupts = <0 20 1>; 346 interrupts = <0 20 4>;
347 reg-shift = <2>; 347 reg-shift = <2>;
348 reg-io-width = <4>; 348 reg-io-width = <4>;
349 clocks = <&apb1_gates 23>; 349 clocks = <&apb1_gates 23>;
@@ -353,7 +353,7 @@
353 i2c0: i2c@01c2ac00 { 353 i2c0: i2c@01c2ac00 {
354 compatible = "allwinner,sun4i-i2c"; 354 compatible = "allwinner,sun4i-i2c";
355 reg = <0x01c2ac00 0x400>; 355 reg = <0x01c2ac00 0x400>;
356 interrupts = <0 7 1>; 356 interrupts = <0 7 4>;
357 clocks = <&apb1_gates 0>; 357 clocks = <&apb1_gates 0>;
358 clock-frequency = <100000>; 358 clock-frequency = <100000>;
359 status = "disabled"; 359 status = "disabled";
@@ -362,7 +362,7 @@
362 i2c1: i2c@01c2b000 { 362 i2c1: i2c@01c2b000 {
363 compatible = "allwinner,sun4i-i2c"; 363 compatible = "allwinner,sun4i-i2c";
364 reg = <0x01c2b000 0x400>; 364 reg = <0x01c2b000 0x400>;
365 interrupts = <0 8 1>; 365 interrupts = <0 8 4>;
366 clocks = <&apb1_gates 1>; 366 clocks = <&apb1_gates 1>;
367 clock-frequency = <100000>; 367 clock-frequency = <100000>;
368 status = "disabled"; 368 status = "disabled";
@@ -371,7 +371,7 @@
371 i2c2: i2c@01c2b400 { 371 i2c2: i2c@01c2b400 {
372 compatible = "allwinner,sun4i-i2c"; 372 compatible = "allwinner,sun4i-i2c";
373 reg = <0x01c2b400 0x400>; 373 reg = <0x01c2b400 0x400>;
374 interrupts = <0 9 1>; 374 interrupts = <0 9 4>;
375 clocks = <&apb1_gates 2>; 375 clocks = <&apb1_gates 2>;
376 clock-frequency = <100000>; 376 clock-frequency = <100000>;
377 status = "disabled"; 377 status = "disabled";
@@ -380,7 +380,7 @@
380 i2c3: i2c@01c2b800 { 380 i2c3: i2c@01c2b800 {
381 compatible = "allwinner,sun4i-i2c"; 381 compatible = "allwinner,sun4i-i2c";
382 reg = <0x01c2b800 0x400>; 382 reg = <0x01c2b800 0x400>;
383 interrupts = <0 88 1>; 383 interrupts = <0 88 4>;
384 clocks = <&apb1_gates 3>; 384 clocks = <&apb1_gates 3>;
385 clock-frequency = <100000>; 385 clock-frequency = <100000>;
386 status = "disabled"; 386 status = "disabled";
@@ -389,7 +389,7 @@
389 i2c4: i2c@01c2bc00 { 389 i2c4: i2c@01c2bc00 {
390 compatible = "allwinner,sun4i-i2c"; 390 compatible = "allwinner,sun4i-i2c";
391 reg = <0x01c2bc00 0x400>; 391 reg = <0x01c2bc00 0x400>;
392 interrupts = <0 89 1>; 392 interrupts = <0 89 4>;
393 clocks = <&apb1_gates 15>; 393 clocks = <&apb1_gates 15>;
394 clock-frequency = <100000>; 394 clock-frequency = <100000>;
395 status = "disabled"; 395 status = "disabled";
diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
index fb1b2ec8eaa9..4217096ee677 100644
--- a/arch/arm/boot/dts/twl4030.dtsi
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -19,6 +19,12 @@
19 interrupts = <11>; 19 interrupts = <11>;
20 }; 20 };
21 21
22 charger: bci {
23 compatible = "ti,twl4030-bci";
24 interrupts = <9>, <2>;
25 bci3v1-supply = <&vusb3v1>;
26 };
27
22 watchdog { 28 watchdog {
23 compatible = "ti,twl4030-wdt"; 29 compatible = "ti,twl4030-wdt";
24 }; 30 };
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index 8e1a0245907f..41bca32409fc 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -404,7 +404,7 @@ static irqreturn_t dma_irq_handler(int irq, void *data)
404 BIT(slot)); 404 BIT(slot));
405 if (edma_cc[ctlr]->intr_data[channel].callback) 405 if (edma_cc[ctlr]->intr_data[channel].callback)
406 edma_cc[ctlr]->intr_data[channel].callback( 406 edma_cc[ctlr]->intr_data[channel].callback(
407 channel, DMA_COMPLETE, 407 channel, EDMA_DMA_COMPLETE,
408 edma_cc[ctlr]->intr_data[channel].data); 408 edma_cc[ctlr]->intr_data[channel].data);
409 } 409 }
410 } while (sh_ipr); 410 } while (sh_ipr);
@@ -459,7 +459,7 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
459 callback) { 459 callback) {
460 edma_cc[ctlr]->intr_data[k]. 460 edma_cc[ctlr]->intr_data[k].
461 callback(k, 461 callback(k,
462 DMA_CC_ERROR, 462 EDMA_DMA_CC_ERROR,
463 edma_cc[ctlr]->intr_data 463 edma_cc[ctlr]->intr_data
464 [k].data); 464 [k].data);
465 } 465 }
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 4a5903e04827..c1df4e9db140 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -69,6 +69,7 @@ CONFIG_KS8851=y
69CONFIG_SMSC911X=y 69CONFIG_SMSC911X=y
70CONFIG_STMMAC_ETH=y 70CONFIG_STMMAC_ETH=y
71CONFIG_MDIO_SUN4I=y 71CONFIG_MDIO_SUN4I=y
72CONFIG_TI_CPSW=y
72CONFIG_KEYBOARD_SPEAR=y 73CONFIG_KEYBOARD_SPEAR=y
73CONFIG_SERIO_AMBAKMI=y 74CONFIG_SERIO_AMBAKMI=y
74CONFIG_SERIAL_8250=y 75CONFIG_SERIAL_8250=y
@@ -133,12 +134,14 @@ CONFIG_USB_GPIO_VBUS=y
133CONFIG_USB_ISP1301=y 134CONFIG_USB_ISP1301=y
134CONFIG_USB_MXS_PHY=y 135CONFIG_USB_MXS_PHY=y
135CONFIG_MMC=y 136CONFIG_MMC=y
137CONFIG_MMC_BLOCK_MINORS=16
136CONFIG_MMC_ARMMMCI=y 138CONFIG_MMC_ARMMMCI=y
137CONFIG_MMC_SDHCI=y 139CONFIG_MMC_SDHCI=y
138CONFIG_MMC_SDHCI_PLTFM=y 140CONFIG_MMC_SDHCI_PLTFM=y
139CONFIG_MMC_SDHCI_ESDHC_IMX=y 141CONFIG_MMC_SDHCI_ESDHC_IMX=y
140CONFIG_MMC_SDHCI_TEGRA=y 142CONFIG_MMC_SDHCI_TEGRA=y
141CONFIG_MMC_SDHCI_SPEAR=y 143CONFIG_MMC_SDHCI_SPEAR=y
144CONFIG_MMC_SDHCI_BCM_KONA=y
142CONFIG_MMC_OMAP=y 145CONFIG_MMC_OMAP=y
143CONFIG_MMC_OMAP_HS=y 146CONFIG_MMC_OMAP_HS=y
144CONFIG_EDAC=y 147CONFIG_EDAC=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 98a50c309b90..bfa80a11e8c7 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -173,6 +173,7 @@ CONFIG_MFD_PALMAS=y
173CONFIG_MFD_TPS65217=y 173CONFIG_MFD_TPS65217=y
174CONFIG_MFD_TPS65910=y 174CONFIG_MFD_TPS65910=y
175CONFIG_TWL6040_CORE=y 175CONFIG_TWL6040_CORE=y
176CONFIG_REGULATOR_FIXED_VOLTAGE=y
176CONFIG_REGULATOR_PALMAS=y 177CONFIG_REGULATOR_PALMAS=y
177CONFIG_REGULATOR_TPS65023=y 178CONFIG_REGULATOR_TPS65023=y
178CONFIG_REGULATOR_TPS6507X=y 179CONFIG_REGULATOR_TPS6507X=y
diff --git a/arch/arm/configs/prima2_defconfig b/arch/arm/configs/prima2_defconfig
index 002a1ceadceb..23591dba47a0 100644
--- a/arch/arm/configs/prima2_defconfig
+++ b/arch/arm/configs/prima2_defconfig
@@ -39,6 +39,7 @@ CONFIG_SPI=y
39CONFIG_SPI_SIRF=y 39CONFIG_SPI_SIRF=y
40CONFIG_SPI_SPIDEV=y 40CONFIG_SPI_SPIDEV=y
41# CONFIG_HWMON is not set 41# CONFIG_HWMON is not set
42CONFIG_WATCHDOG=y
42CONFIG_USB_GADGET=y 43CONFIG_USB_GADGET=y
43CONFIG_USB_MASS_STORAGE=m 44CONFIG_USB_MASS_STORAGE=m
44CONFIG_MMC=y 45CONFIG_MMC=y
diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig
index d57a85badb5e..3e2259b60236 100644
--- a/arch/arm/configs/sunxi_defconfig
+++ b/arch/arm/configs/sunxi_defconfig
@@ -12,6 +12,9 @@ CONFIG_NET=y
12CONFIG_PACKET=y 12CONFIG_PACKET=y
13CONFIG_UNIX=y 13CONFIG_UNIX=y
14CONFIG_INET=y 14CONFIG_INET=y
15CONFIG_IP_PNP=y
16CONFIG_IP_PNP_DHCP=y
17CONFIG_IP_PNP_BOOTP=y
15# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 18# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
16# CONFIG_INET_XFRM_MODE_TUNNEL is not set 19# CONFIG_INET_XFRM_MODE_TUNNEL is not set
17# CONFIG_INET_XFRM_MODE_BEET is not set 20# CONFIG_INET_XFRM_MODE_BEET is not set
@@ -58,4 +61,8 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y
58CONFIG_LEDS_TRIGGER_DEFAULT_ON=y 61CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
59CONFIG_COMMON_CLK_DEBUG=y 62CONFIG_COMMON_CLK_DEBUG=y
60# CONFIG_IOMMU_SUPPORT is not set 63# CONFIG_IOMMU_SUPPORT is not set
64CONFIG_TMPFS=y
65CONFIG_NFS_FS=y
66CONFIG_ROOT_NFS=y
61CONFIG_NLS=y 67CONFIG_NLS=y
68CONFIG_PRINTK_TIME=y
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index ac632cc38f24..c6ebc184bf68 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -22,6 +22,7 @@ CONFIG_CMDLINE="root=/dev/ram0 console=ttyAMA2,115200n8"
22CONFIG_CPU_FREQ=y 22CONFIG_CPU_FREQ=y
23CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 23CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
24CONFIG_CPU_IDLE=y 24CONFIG_CPU_IDLE=y
25CONFIG_ARM_U8500_CPUIDLE=y
25CONFIG_VFP=y 26CONFIG_VFP=y
26CONFIG_NEON=y 27CONFIG_NEON=y
27CONFIG_PM_RUNTIME=y 28CONFIG_PM_RUNTIME=y
@@ -109,6 +110,8 @@ CONFIG_EXT2_FS_SECURITY=y
109CONFIG_EXT3_FS=y 110CONFIG_EXT3_FS=y
110CONFIG_EXT4_FS=y 111CONFIG_EXT4_FS=y
111CONFIG_VFAT_FS=y 112CONFIG_VFAT_FS=y
113CONFIG_DEVTMPFS=y
114CONFIG_DEVTMPFS_MOUNT=y
112CONFIG_TMPFS=y 115CONFIG_TMPFS=y
113CONFIG_TMPFS_POSIX_ACL=y 116CONFIG_TMPFS_POSIX_ACL=y
114# CONFIG_MISC_FILESYSTEMS is not set 117# CONFIG_MISC_FILESYSTEMS is not set
diff --git a/arch/arm/configs/vt8500_v6_v7_defconfig b/arch/arm/configs/vt8500_v6_v7_defconfig
new file mode 100644
index 000000000000..f0520176acd0
--- /dev/null
+++ b/arch/arm/configs/vt8500_v6_v7_defconfig
@@ -0,0 +1,90 @@
1CONFIG_IRQ_DOMAIN_DEBUG=y
2CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_ARCH_MULTI_V6=y
6CONFIG_ARCH_WM8750=y
7CONFIG_ARCH_WM8850=y
8CONFIG_ARM_ERRATA_720789=y
9CONFIG_ARM_ERRATA_754322=y
10CONFIG_ARM_ERRATA_775420=y
11CONFIG_HAVE_ARM_ARCH_TIMER=y
12CONFIG_AEABI=y
13CONFIG_HIGHMEM=y
14CONFIG_HIGHPTE=y
15CONFIG_ARM_APPENDED_DTB=y
16CONFIG_ARM_ATAG_DTB_COMPAT=y
17CONFIG_VFP=y
18CONFIG_NEON=y
19CONFIG_PM_RUNTIME=y
20CONFIG_NET=y
21CONFIG_UNIX=y
22CONFIG_INET=y
23CONFIG_IP_PNP=y
24CONFIG_IP_PNP_DHCP=y
25CONFIG_DEVTMPFS=y
26CONFIG_DEVTMPFS_MOUNT=y
27CONFIG_PROC_DEVICETREE=y
28CONFIG_EEPROM_93CX6=y
29CONFIG_SCSI=y
30CONFIG_BLK_DEV_SD=y
31CONFIG_NETDEVICES=y
32# CONFIG_NET_CADENCE is not set
33# CONFIG_NET_VENDOR_BROADCOM is not set
34# CONFIG_NET_VENDOR_CIRRUS is not set
35# CONFIG_NET_VENDOR_FARADAY is not set
36# CONFIG_NET_VENDOR_INTEL is not set
37# CONFIG_NET_VENDOR_MARVELL is not set
38# CONFIG_NET_VENDOR_MICREL is not set
39# CONFIG_NET_VENDOR_NATSEMI is not set
40# CONFIG_NET_VENDOR_SEEQ is not set
41# CONFIG_NET_VENDOR_SMSC is not set
42# CONFIG_NET_VENDOR_STMICRO is not set
43CONFIG_VIA_VELOCITY=y
44# CONFIG_NET_VENDOR_WIZNET is not set
45CONFIG_PHYLIB=y
46CONFIG_INPUT_MATRIXKMAP=y
47CONFIG_SERIAL_VT8500=y
48CONFIG_SERIAL_VT8500_CONSOLE=y
49CONFIG_I2C=y
50CONFIG_I2C_WMT=y
51CONFIG_PINCTRL_SINGLE=y
52CONFIG_PINCTRL_WM8750=y
53CONFIG_GPIO_GENERIC_PLATFORM=y
54CONFIG_POWER_SUPPLY=y
55CONFIG_POWER_RESET=y
56CONFIG_MFD_SYSCON=y
57CONFIG_REGULATOR=y
58CONFIG_REGULATOR_FIXED_VOLTAGE=y
59CONFIG_REGULATOR_GPIO=y
60CONFIG_USB=y
61CONFIG_USB_EHCI_HCD=y
62CONFIG_USB_EHCI_HCD_PLATFORM=y
63CONFIG_USB_UHCI_HCD=y
64CONFIG_USB_STORAGE=y
65CONFIG_NOP_USB_XCEIV=y
66CONFIG_USB_GPIO_VBUS=y
67CONFIG_USB_ULPI=y
68CONFIG_MMC=y
69CONFIG_MMC_DEBUG=y
70CONFIG_NEW_LEDS=y
71CONFIG_LEDS_CLASS=y
72CONFIG_LEDS_TRIGGERS=y
73CONFIG_RTC_CLASS=y
74CONFIG_RTC_DRV_VT8500=y
75CONFIG_DMADEVICES=y
76CONFIG_COMMON_CLK_DEBUG=y
77# CONFIG_IOMMU_SUPPORT is not set
78CONFIG_PWM=y
79CONFIG_PWM_VT8500=y
80CONFIG_RESET_CONTROLLER=y
81CONFIG_GENERIC_PHY=y
82CONFIG_EXT4_FS=y
83CONFIG_TMPFS=y
84CONFIG_NFS_FS=y
85CONFIG_NFS_V3_ACL=y
86CONFIG_NFS_V4=y
87CONFIG_ROOT_NFS=y
88CONFIG_PRINTK_TIME=y
89CONFIG_DEBUG_KERNEL=y
90CONFIG_LOCKUP_DETECTOR=y
diff --git a/arch/arm/include/asm/hardware/iop3xx-adma.h b/arch/arm/include/asm/hardware/iop3xx-adma.h
index 9b28f1243bdc..240b29ef17db 100644
--- a/arch/arm/include/asm/hardware/iop3xx-adma.h
+++ b/arch/arm/include/asm/hardware/iop3xx-adma.h
@@ -393,36 +393,6 @@ static inline int iop_chan_zero_sum_slot_count(size_t len, int src_cnt,
393 return slot_cnt; 393 return slot_cnt;
394} 394}
395 395
396static inline int iop_desc_is_pq(struct iop_adma_desc_slot *desc)
397{
398 return 0;
399}
400
401static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
402 struct iop_adma_chan *chan)
403{
404 union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
405
406 switch (chan->device->id) {
407 case DMA0_ID:
408 case DMA1_ID:
409 return hw_desc.dma->dest_addr;
410 case AAU_ID:
411 return hw_desc.aau->dest_addr;
412 default:
413 BUG();
414 }
415 return 0;
416}
417
418
419static inline u32 iop_desc_get_qdest_addr(struct iop_adma_desc_slot *desc,
420 struct iop_adma_chan *chan)
421{
422 BUG();
423 return 0;
424}
425
426static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc, 396static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
427 struct iop_adma_chan *chan) 397 struct iop_adma_chan *chan)
428{ 398{
diff --git a/arch/arm/include/asm/hardware/iop_adma.h b/arch/arm/include/asm/hardware/iop_adma.h
index 122f86d8c991..250760e08103 100644
--- a/arch/arm/include/asm/hardware/iop_adma.h
+++ b/arch/arm/include/asm/hardware/iop_adma.h
@@ -82,8 +82,6 @@ struct iop_adma_chan {
82 * @slot_cnt: total slots used in an transaction (group of operations) 82 * @slot_cnt: total slots used in an transaction (group of operations)
83 * @slots_per_op: number of slots per operation 83 * @slots_per_op: number of slots per operation
84 * @idx: pool index 84 * @idx: pool index
85 * @unmap_src_cnt: number of xor sources
86 * @unmap_len: transaction bytecount
87 * @tx_list: list of descriptors that are associated with one operation 85 * @tx_list: list of descriptors that are associated with one operation
88 * @async_tx: support for the async_tx api 86 * @async_tx: support for the async_tx api
89 * @group_list: list of slots that make up a multi-descriptor transaction 87 * @group_list: list of slots that make up a multi-descriptor transaction
@@ -99,8 +97,6 @@ struct iop_adma_desc_slot {
99 u16 slot_cnt; 97 u16 slot_cnt;
100 u16 slots_per_op; 98 u16 slots_per_op;
101 u16 idx; 99 u16 idx;
102 u16 unmap_src_cnt;
103 size_t unmap_len;
104 struct list_head tx_list; 100 struct list_head tx_list;
105 struct dma_async_tx_descriptor async_tx; 101 struct dma_async_tx_descriptor async_tx;
106 union { 102 union {
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 4dd21457ef9d..6976b03e5213 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -100,23 +100,19 @@
100#define TASK_UNMAPPED_BASE UL(0x00000000) 100#define TASK_UNMAPPED_BASE UL(0x00000000)
101#endif 101#endif
102 102
103#ifndef PHYS_OFFSET
104#define PHYS_OFFSET UL(CONFIG_DRAM_BASE)
105#endif
106
107#ifndef END_MEM 103#ifndef END_MEM
108#define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE) 104#define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
109#endif 105#endif
110 106
111#ifndef PAGE_OFFSET 107#ifndef PAGE_OFFSET
112#define PAGE_OFFSET (PHYS_OFFSET) 108#define PAGE_OFFSET PLAT_PHYS_OFFSET
113#endif 109#endif
114 110
115/* 111/*
116 * The module can be at any place in ram in nommu mode. 112 * The module can be at any place in ram in nommu mode.
117 */ 113 */
118#define MODULES_END (END_MEM) 114#define MODULES_END (END_MEM)
119#define MODULES_VADDR (PHYS_OFFSET) 115#define MODULES_VADDR PAGE_OFFSET
120 116
121#define XIP_VIRT_ADDR(physaddr) (physaddr) 117#define XIP_VIRT_ADDR(physaddr) (physaddr)
122 118
@@ -157,6 +153,16 @@
157#endif 153#endif
158#define ARCH_PGD_MASK ((1 << ARCH_PGD_SHIFT) - 1) 154#define ARCH_PGD_MASK ((1 << ARCH_PGD_SHIFT) - 1)
159 155
156/*
157 * PLAT_PHYS_OFFSET is the offset (from zero) of the start of physical
158 * memory. This is used for XIP and NoMMU kernels, or by kernels which
159 * have their own mach/memory.h. Assembly code must always use
160 * PLAT_PHYS_OFFSET and not PHYS_OFFSET.
161 */
162#ifndef PLAT_PHYS_OFFSET
163#define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
164#endif
165
160#ifndef __ASSEMBLY__ 166#ifndef __ASSEMBLY__
161 167
162/* 168/*
@@ -226,12 +232,21 @@ static inline phys_addr_t __virt_to_phys(unsigned long x)
226static inline unsigned long __phys_to_virt(phys_addr_t x) 232static inline unsigned long __phys_to_virt(phys_addr_t x)
227{ 233{
228 unsigned long t; 234 unsigned long t;
229 __pv_stub(x, t, "sub", __PV_BITS_31_24); 235
236 /*
237 * 'unsigned long' cast discard upper word when
238 * phys_addr_t is 64 bit, and makes sure that inline
239 * assembler expression receives 32 bit argument
240 * in place where 'r' 32 bit operand is expected.
241 */
242 __pv_stub((unsigned long) x, t, "sub", __PV_BITS_31_24);
230 return t; 243 return t;
231} 244}
232 245
233#else 246#else
234 247
248#define PHYS_OFFSET PLAT_PHYS_OFFSET
249
235static inline phys_addr_t __virt_to_phys(unsigned long x) 250static inline phys_addr_t __virt_to_phys(unsigned long x)
236{ 251{
237 return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET; 252 return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET;
@@ -244,17 +259,6 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
244 259
245#endif 260#endif
246#endif 261#endif
247#endif /* __ASSEMBLY__ */
248
249#ifndef PHYS_OFFSET
250#ifdef PLAT_PHYS_OFFSET
251#define PHYS_OFFSET PLAT_PHYS_OFFSET
252#else
253#define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
254#endif
255#endif
256
257#ifndef __ASSEMBLY__
258 262
259/* 263/*
260 * PFNs are used to describe any physical page; this means 264 * PFNs are used to describe any physical page; this means
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index be956dbf6bae..1571d126e9dd 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -61,7 +61,7 @@ extern void __pgd_error(const char *file, int line, pgd_t);
61 * mapping to be mapped at. This is particularly important for 61 * mapping to be mapped at. This is particularly important for
62 * non-high vector CPUs. 62 * non-high vector CPUs.
63 */ 63 */
64#define FIRST_USER_ADDRESS PAGE_SIZE 64#define FIRST_USER_ADDRESS (PAGE_SIZE * 2)
65 65
66/* 66/*
67 * Use TASK_SIZE as the ceiling argument for free_pgtables() and 67 * Use TASK_SIZE as the ceiling argument for free_pgtables() and
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index df5e13d64f2c..71a06b293489 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -141,12 +141,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
141#endif 141#endif
142 142
143/* 143/*
144 * We use bit 30 of the preempt_count to indicate that kernel
145 * preemption is occurring. See <asm/hardirq.h>.
146 */
147#define PREEMPT_ACTIVE 0x40000000
148
149/*
150 * thread information flags: 144 * thread information flags:
151 * TIF_SYSCALL_TRACE - syscall trace active 145 * TIF_SYSCALL_TRACE - syscall trace active
152 * TIF_SYSCAL_AUDIT - syscall auditing active 146 * TIF_SYSCAL_AUDIT - syscall auditing active
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 14235ba64a90..716249cc2ee1 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -68,7 +68,7 @@ ENTRY(stext)
68 68
69#ifdef CONFIG_ARM_MPU 69#ifdef CONFIG_ARM_MPU
70 /* Calculate the size of a region covering just the kernel */ 70 /* Calculate the size of a region covering just the kernel */
71 ldr r5, =PHYS_OFFSET @ Region start: PHYS_OFFSET 71 ldr r5, =PLAT_PHYS_OFFSET @ Region start: PHYS_OFFSET
72 ldr r6, =(_end) @ Cover whole kernel 72 ldr r6, =(_end) @ Cover whole kernel
73 sub r6, r6, r5 @ Minimum size of region to map 73 sub r6, r6, r5 @ Minimum size of region to map
74 clz r6, r6 @ Region size must be 2^N... 74 clz r6, r6 @ Region size must be 2^N...
@@ -213,7 +213,7 @@ ENTRY(__setup_mpu)
213 set_region_nr r0, #MPU_RAM_REGION 213 set_region_nr r0, #MPU_RAM_REGION
214 isb 214 isb
215 /* Full access from PL0, PL1, shared for CONFIG_SMP, cacheable */ 215 /* Full access from PL0, PL1, shared for CONFIG_SMP, cacheable */
216 ldr r0, =PHYS_OFFSET @ RAM starts at PHYS_OFFSET 216 ldr r0, =PLAT_PHYS_OFFSET @ RAM starts at PHYS_OFFSET
217 ldr r5,=(MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL) 217 ldr r5,=(MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL)
218 218
219 setup_region r0, r5, r6, MPU_DATA_SIDE @ PHYS_OFFSET, shared, enabled 219 setup_region r0, r5, r6, MPU_DATA_SIDE @ PHYS_OFFSET, shared, enabled
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 7801866e626a..32f317e5828a 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -110,7 +110,7 @@ ENTRY(stext)
110 sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET) 110 sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET)
111 add r8, r8, r4 @ PHYS_OFFSET 111 add r8, r8, r4 @ PHYS_OFFSET
112#else 112#else
113 ldr r8, =PHYS_OFFSET @ always constant in this case 113 ldr r8, =PLAT_PHYS_OFFSET @ always constant in this case
114#endif 114#endif
115 115
116 /* 116 /*
@@ -508,6 +508,7 @@ __fixup_smp:
508 teq r0, #0x0 @ '0' on actual UP A9 hardware 508 teq r0, #0x0 @ '0' on actual UP A9 hardware
509 beq __fixup_smp_on_up @ So its an A9 UP 509 beq __fixup_smp_on_up @ So its an A9 UP
510 ldr r0, [r0, #4] @ read SCU Config 510 ldr r0, [r0, #4] @ read SCU Config
511ARM_BE8(rev r0, r0) @ byteswap if big endian
511 and r0, r0, #0x3 @ number of CPUs 512 and r0, r0, #0x3 @ number of CPUs
512 teq r0, #0x0 @ is 1? 513 teq r0, #0x0 @ is 1?
513 movne pc, lr 514 movne pc, lr
@@ -644,7 +645,11 @@ ARM_BE8(rev16 ip, ip)
644 bcc 1b 645 bcc 1b
645 bx lr 646 bx lr
646#else 647#else
648#ifdef CONFIG_CPU_ENDIAN_BE8
649 moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction
650#else
647 moveq r0, #0x400000 @ set bit 22, mov to mvn instruction 651 moveq r0, #0x400000 @ set bit 22, mov to mvn instruction
652#endif
648 b 2f 653 b 2f
6491: ldr ip, [r7, r3] 6541: ldr ip, [r7, r3]
650#ifdef CONFIG_CPU_ENDIAN_BE8 655#ifdef CONFIG_CPU_ENDIAN_BE8
@@ -653,7 +658,7 @@ ARM_BE8(rev16 ip, ip)
653 tst ip, #0x000f0000 @ check the rotation field 658 tst ip, #0x000f0000 @ check the rotation field
654 orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 659 orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24
655 biceq ip, ip, #0x00004000 @ clear bit 22 660 biceq ip, ip, #0x00004000 @ clear bit 22
656 orreq ip, ip, r0, lsl #24 @ mask in offset bits 7-0 661 orreq ip, ip, r0 @ mask in offset bits 7-0
657#else 662#else
658 bic ip, ip, #0x000000ff 663 bic ip, ip, #0x000000ff
659 tst ip, #0xf00 @ check the rotation field 664 tst ip, #0xf00 @ check the rotation field
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 57221e349a7c..f0d180d8b29f 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -14,11 +14,12 @@
14#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
15#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/fncpy.h>
17#include <asm/mach-types.h> 18#include <asm/mach-types.h>
18#include <asm/smp_plat.h> 19#include <asm/smp_plat.h>
19#include <asm/system_misc.h> 20#include <asm/system_misc.h>
20 21
21extern const unsigned char relocate_new_kernel[]; 22extern void relocate_new_kernel(void);
22extern const unsigned int relocate_new_kernel_size; 23extern const unsigned int relocate_new_kernel_size;
23 24
24extern unsigned long kexec_start_address; 25extern unsigned long kexec_start_address;
@@ -142,6 +143,8 @@ void machine_kexec(struct kimage *image)
142{ 143{
143 unsigned long page_list; 144 unsigned long page_list;
144 unsigned long reboot_code_buffer_phys; 145 unsigned long reboot_code_buffer_phys;
146 unsigned long reboot_entry = (unsigned long)relocate_new_kernel;
147 unsigned long reboot_entry_phys;
145 void *reboot_code_buffer; 148 void *reboot_code_buffer;
146 149
147 /* 150 /*
@@ -168,16 +171,16 @@ void machine_kexec(struct kimage *image)
168 171
169 172
170 /* copy our kernel relocation code to the control code page */ 173 /* copy our kernel relocation code to the control code page */
171 memcpy(reboot_code_buffer, 174 reboot_entry = fncpy(reboot_code_buffer,
172 relocate_new_kernel, relocate_new_kernel_size); 175 reboot_entry,
176 relocate_new_kernel_size);
177 reboot_entry_phys = (unsigned long)reboot_entry +
178 (reboot_code_buffer_phys - (unsigned long)reboot_code_buffer);
173 179
174
175 flush_icache_range((unsigned long) reboot_code_buffer,
176 (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
177 printk(KERN_INFO "Bye!\n"); 180 printk(KERN_INFO "Bye!\n");
178 181
179 if (kexec_reinit) 182 if (kexec_reinit)
180 kexec_reinit(); 183 kexec_reinit();
181 184
182 soft_restart(reboot_code_buffer_phys); 185 soft_restart(reboot_entry_phys);
183} 186}
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 94f6b05f9e24..92f7b15dd221 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -404,6 +404,7 @@ EXPORT_SYMBOL(dump_fpu);
404unsigned long get_wchan(struct task_struct *p) 404unsigned long get_wchan(struct task_struct *p)
405{ 405{
406 struct stackframe frame; 406 struct stackframe frame;
407 unsigned long stack_page;
407 int count = 0; 408 int count = 0;
408 if (!p || p == current || p->state == TASK_RUNNING) 409 if (!p || p == current || p->state == TASK_RUNNING)
409 return 0; 410 return 0;
@@ -412,9 +413,11 @@ unsigned long get_wchan(struct task_struct *p)
412 frame.sp = thread_saved_sp(p); 413 frame.sp = thread_saved_sp(p);
413 frame.lr = 0; /* recovered from the stack */ 414 frame.lr = 0; /* recovered from the stack */
414 frame.pc = thread_saved_pc(p); 415 frame.pc = thread_saved_pc(p);
416 stack_page = (unsigned long)task_stack_page(p);
415 do { 417 do {
416 int ret = unwind_frame(&frame); 418 if (frame.sp < stack_page ||
417 if (ret < 0) 419 frame.sp >= stack_page + THREAD_SIZE ||
420 unwind_frame(&frame) < 0)
418 return 0; 421 return 0;
419 if (!in_sched_functions(frame.pc)) 422 if (!in_sched_functions(frame.pc))
420 return frame.pc; 423 return frame.pc;
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
index d0cdedf4864d..95858966d84e 100644
--- a/arch/arm/kernel/relocate_kernel.S
+++ b/arch/arm/kernel/relocate_kernel.S
@@ -2,10 +2,12 @@
2 * relocate_kernel.S - put the kernel image in place to boot 2 * relocate_kernel.S - put the kernel image in place to boot
3 */ 3 */
4 4
5#include <linux/linkage.h>
5#include <asm/kexec.h> 6#include <asm/kexec.h>
6 7
7 .globl relocate_new_kernel 8 .align 3 /* not needed for this code, but keeps fncpy() happy */
8relocate_new_kernel: 9
10ENTRY(relocate_new_kernel)
9 11
10 ldr r0,kexec_indirection_page 12 ldr r0,kexec_indirection_page
11 ldr r1,kexec_start_address 13 ldr r1,kexec_start_address
@@ -79,6 +81,8 @@ kexec_mach_type:
79kexec_boot_atags: 81kexec_boot_atags:
80 .long 0x0 82 .long 0x0
81 83
84ENDPROC(relocate_new_kernel)
85
82relocate_new_kernel_end: 86relocate_new_kernel_end:
83 87
84 .globl relocate_new_kernel_size 88 .globl relocate_new_kernel_size
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 6a1b8a81b1ae..987a7f5bce5f 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -873,8 +873,6 @@ void __init setup_arch(char **cmdline_p)
873 machine_desc = mdesc; 873 machine_desc = mdesc;
874 machine_name = mdesc->name; 874 machine_name = mdesc->name;
875 875
876 setup_dma_zone(mdesc);
877
878 if (mdesc->reboot_mode != REBOOT_HARD) 876 if (mdesc->reboot_mode != REBOOT_HARD)
879 reboot_mode = mdesc->reboot_mode; 877 reboot_mode = mdesc->reboot_mode;
880 878
@@ -892,6 +890,7 @@ void __init setup_arch(char **cmdline_p)
892 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); 890 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
893 891
894 early_paging_init(mdesc, lookup_processor_type(read_cpuid_id())); 892 early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
893 setup_dma_zone(mdesc);
895 sanity_check_meminfo(); 894 sanity_check_meminfo();
896 arm_memblock_init(&meminfo, mdesc); 895 arm_memblock_init(&meminfo, mdesc);
897 896
diff --git a/arch/arm/kernel/sigreturn_codes.S b/arch/arm/kernel/sigreturn_codes.S
index 3c5d0f2170fd..b84d0cb13682 100644
--- a/arch/arm/kernel/sigreturn_codes.S
+++ b/arch/arm/kernel/sigreturn_codes.S
@@ -30,6 +30,27 @@
30 * snippets. 30 * snippets.
31 */ 31 */
32 32
33/*
34 * In CPU_THUMBONLY case kernel arm opcodes are not allowed.
35 * Note in this case codes skips those instructions but it uses .org
36 * directive to keep correct layout of sigreturn_codes array.
37 */
38#ifndef CONFIG_CPU_THUMBONLY
39#define ARM_OK(code...) code
40#else
41#define ARM_OK(code...)
42#endif
43
44 .macro arm_slot n
45 .org sigreturn_codes + 12 * (\n)
46ARM_OK( .arm )
47 .endm
48
49 .macro thumb_slot n
50 .org sigreturn_codes + 12 * (\n) + 8
51 .thumb
52 .endm
53
33#if __LINUX_ARM_ARCH__ <= 4 54#if __LINUX_ARM_ARCH__ <= 4
34 /* 55 /*
35 * Note we manually set minimally required arch that supports 56 * Note we manually set minimally required arch that supports
@@ -45,26 +66,27 @@
45 .global sigreturn_codes 66 .global sigreturn_codes
46 .type sigreturn_codes, #object 67 .type sigreturn_codes, #object
47 68
48 .arm 69 .align
49 70
50sigreturn_codes: 71sigreturn_codes:
51 72
52 /* ARM sigreturn syscall code snippet */ 73 /* ARM sigreturn syscall code snippet */
53 mov r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) 74 arm_slot 0
54 swi #(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE) 75ARM_OK( mov r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) )
76ARM_OK( swi #(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE) )
55 77
56 /* Thumb sigreturn syscall code snippet */ 78 /* Thumb sigreturn syscall code snippet */
57 .thumb 79 thumb_slot 0
58 movs r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) 80 movs r7, #(__NR_sigreturn - __NR_SYSCALL_BASE)
59 swi #0 81 swi #0
60 82
61 /* ARM sigreturn_rt syscall code snippet */ 83 /* ARM sigreturn_rt syscall code snippet */
62 .arm 84 arm_slot 1
63 mov r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) 85ARM_OK( mov r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) )
64 swi #(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE) 86ARM_OK( swi #(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE) )
65 87
66 /* Thumb sigreturn_rt syscall code snippet */ 88 /* Thumb sigreturn_rt syscall code snippet */
67 .thumb 89 thumb_slot 1
68 movs r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) 90 movs r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE)
69 swi #0 91 swi #0
70 92
@@ -74,7 +96,7 @@ sigreturn_codes:
74 * it is thumb case or not, so we need additional 96 * it is thumb case or not, so we need additional
75 * word after real last entry. 97 * word after real last entry.
76 */ 98 */
77 .arm 99 arm_slot 2
78 .space 4 100 .space 4
79 101
80 .size sigreturn_codes, . - sigreturn_codes 102 .size sigreturn_codes, . - sigreturn_codes
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 00f79e59985b..af4e8c8a5422 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -31,7 +31,7 @@ int notrace unwind_frame(struct stackframe *frame)
31 high = ALIGN(low, THREAD_SIZE); 31 high = ALIGN(low, THREAD_SIZE);
32 32
33 /* check current frame pointer is within bounds */ 33 /* check current frame pointer is within bounds */
34 if (fp < (low + 12) || fp + 4 >= high) 34 if (fp < low + 12 || fp > high - 4)
35 return -EINVAL; 35 return -EINVAL;
36 36
37 /* restore the registers from the stack frame */ 37 /* restore the registers from the stack frame */
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 6125f259b7b5..7940241f0576 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -509,9 +509,10 @@ static inline int
509__do_cache_op(unsigned long start, unsigned long end) 509__do_cache_op(unsigned long start, unsigned long end)
510{ 510{
511 int ret; 511 int ret;
512 unsigned long chunk = PAGE_SIZE;
513 512
514 do { 513 do {
514 unsigned long chunk = min(PAGE_SIZE, end - start);
515
515 if (signal_pending(current)) { 516 if (signal_pending(current)) {
516 struct thread_info *ti = current_thread_info(); 517 struct thread_info *ti = current_thread_info();
517 518
@@ -856,7 +857,7 @@ static void __init kuser_init(void *vectors)
856 memcpy(vectors + 0xfe0, vectors + 0xfe8, 4); 857 memcpy(vectors + 0xfe0, vectors + 0xfe8, 4);
857} 858}
858#else 859#else
859static void __init kuser_init(void *vectors) 860static inline void __init kuser_init(void *vectors)
860{ 861{
861} 862}
862#endif 863#endif
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 371958370de4..580906989db1 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -334,6 +334,17 @@ out:
334 return err; 334 return err;
335} 335}
336 336
337static phys_addr_t kvm_kaddr_to_phys(void *kaddr)
338{
339 if (!is_vmalloc_addr(kaddr)) {
340 BUG_ON(!virt_addr_valid(kaddr));
341 return __pa(kaddr);
342 } else {
343 return page_to_phys(vmalloc_to_page(kaddr)) +
344 offset_in_page(kaddr);
345 }
346}
347
337/** 348/**
338 * create_hyp_mappings - duplicate a kernel virtual address range in Hyp mode 349 * create_hyp_mappings - duplicate a kernel virtual address range in Hyp mode
339 * @from: The virtual kernel start address of the range 350 * @from: The virtual kernel start address of the range
@@ -345,16 +356,27 @@ out:
345 */ 356 */
346int create_hyp_mappings(void *from, void *to) 357int create_hyp_mappings(void *from, void *to)
347{ 358{
348 unsigned long phys_addr = virt_to_phys(from); 359 phys_addr_t phys_addr;
360 unsigned long virt_addr;
349 unsigned long start = KERN_TO_HYP((unsigned long)from); 361 unsigned long start = KERN_TO_HYP((unsigned long)from);
350 unsigned long end = KERN_TO_HYP((unsigned long)to); 362 unsigned long end = KERN_TO_HYP((unsigned long)to);
351 363
352 /* Check for a valid kernel memory mapping */ 364 start = start & PAGE_MASK;
353 if (!virt_addr_valid(from) || !virt_addr_valid(to - 1)) 365 end = PAGE_ALIGN(end);
354 return -EINVAL;
355 366
356 return __create_hyp_mappings(hyp_pgd, start, end, 367 for (virt_addr = start; virt_addr < end; virt_addr += PAGE_SIZE) {
357 __phys_to_pfn(phys_addr), PAGE_HYP); 368 int err;
369
370 phys_addr = kvm_kaddr_to_phys(from + virt_addr - start);
371 err = __create_hyp_mappings(hyp_pgd, virt_addr,
372 virt_addr + PAGE_SIZE,
373 __phys_to_pfn(phys_addr),
374 PAGE_HYP);
375 if (err)
376 return err;
377 }
378
379 return 0;
358} 380}
359 381
360/** 382/**
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index e0c68d5bb7dc..52886b89706c 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -10,7 +10,7 @@ UNWIND( .fnstart )
10 and r3, r0, #31 @ Get bit offset 10 and r3, r0, #31 @ Get bit offset
11 mov r0, r0, lsr #5 11 mov r0, r0, lsr #5
12 add r1, r1, r0, lsl #2 @ Get word offset 12 add r1, r1, r0, lsl #2 @ Get word offset
13#if __LINUX_ARM_ARCH__ >= 7 13#if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
14 .arch_extension mp 14 .arch_extension mp
15 ALT_SMP(W(pldw) [r1]) 15 ALT_SMP(W(pldw) [r1])
16 ALT_UP(W(nop)) 16 ALT_UP(W(nop))
diff --git a/arch/arm/lib/delay-loop.S b/arch/arm/lib/delay-loop.S
index 36b668d8e121..bc1033b897b4 100644
--- a/arch/arm/lib/delay-loop.S
+++ b/arch/arm/lib/delay-loop.S
@@ -40,6 +40,7 @@ ENTRY(__loop_const_udelay) @ 0 <= r0 <= 0x7fffff06
40/* 40/*
41 * loops = r0 * HZ * loops_per_jiffy / 1000000 41 * loops = r0 * HZ * loops_per_jiffy / 1000000
42 */ 42 */
43 .align 3
43 44
44@ Delay routine 45@ Delay routine
45ENTRY(__loop_delay) 46ENTRY(__loop_delay)
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index c1b737097c95..90aab2d5a07f 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y := irq.o gpio.o setup.o 5obj-y := irq.o gpio.o setup.o sysirq_mask.o
6obj-m := 6obj-m :=
7obj-n := 7obj-n :=
8obj- := 8obj- :=
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index f607deb40f4d..bc7b363a3083 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -174,7 +174,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
174static struct clock_event_device clkevt = { 174static struct clock_event_device clkevt = {
175 .name = "at91_tick", 175 .name = "at91_tick",
176 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 176 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
177 .shift = 32,
178 .rating = 150, 177 .rating = 150,
179 .set_next_event = clkevt32k_next_event, 178 .set_next_event = clkevt32k_next_event,
180 .set_mode = clkevt32k_mode, 179 .set_mode = clkevt32k_mode,
@@ -265,11 +264,9 @@ void __init at91rm9200_timer_init(void)
265 at91_st_write(AT91_ST_RTMR, 1); 264 at91_st_write(AT91_ST_RTMR, 1);
266 265
267 /* Setup timer clockevent, with minimum of two ticks (important!!) */ 266 /* Setup timer clockevent, with minimum of two ticks (important!!) */
268 clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
269 clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
270 clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
271 clkevt.cpumask = cpumask_of(0); 267 clkevt.cpumask = cpumask_of(0);
272 clockevents_register_device(&clkevt); 268 clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
269 2, AT91_ST_ALMV);
273 270
274 /* register clocksource */ 271 /* register clocksource */
275 clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); 272 clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index f8629a3fa245..d6a1fa85371d 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -351,6 +351,8 @@ static void __init at91sam9260_initialize(void)
351 arm_pm_idle = at91sam9_idle; 351 arm_pm_idle = at91sam9_idle;
352 arm_pm_restart = at91sam9_alt_restart; 352 arm_pm_restart = at91sam9_alt_restart;
353 353
354 at91_sysirq_mask_rtt(AT91SAM9260_BASE_RTT);
355
354 /* Register GPIO subsystem */ 356 /* Register GPIO subsystem */
355 at91_gpio_init(at91sam9260_gpio, 3); 357 at91_gpio_init(at91sam9260_gpio, 3);
356} 358}
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 1f3867a17a28..23ba1d8a1531 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -293,6 +293,8 @@ static void __init at91sam9261_initialize(void)
293 arm_pm_idle = at91sam9_idle; 293 arm_pm_idle = at91sam9_idle;
294 arm_pm_restart = at91sam9_alt_restart; 294 arm_pm_restart = at91sam9_alt_restart;
295 295
296 at91_sysirq_mask_rtt(AT91SAM9261_BASE_RTT);
297
296 /* Register GPIO subsystem */ 298 /* Register GPIO subsystem */
297 at91_gpio_init(at91sam9261_gpio, 3); 299 at91_gpio_init(at91sam9261_gpio, 3);
298} 300}
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 90d455d294a1..7eccb0fc57bc 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -330,6 +330,9 @@ static void __init at91sam9263_initialize(void)
330 arm_pm_idle = at91sam9_idle; 330 arm_pm_idle = at91sam9_idle;
331 arm_pm_restart = at91sam9_alt_restart; 331 arm_pm_restart = at91sam9_alt_restart;
332 332
333 at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT0);
334 at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT1);
335
333 /* Register GPIO subsystem */ 336 /* Register GPIO subsystem */
334 at91_gpio_init(at91sam9263_gpio, 5); 337 at91_gpio_init(at91sam9263_gpio, 5);
335} 338}
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index e9bf0b8f40eb..9405aa08b104 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -379,6 +379,9 @@ static void __init at91sam9g45_initialize(void)
379 arm_pm_idle = at91sam9_idle; 379 arm_pm_idle = at91sam9_idle;
380 arm_pm_restart = at91sam9g45_restart; 380 arm_pm_restart = at91sam9g45_restart;
381 381
382 at91_sysirq_mask_rtc(AT91SAM9G45_BASE_RTC);
383 at91_sysirq_mask_rtt(AT91SAM9G45_BASE_RTT);
384
382 /* Register GPIO subsystem */ 385 /* Register GPIO subsystem */
383 at91_gpio_init(at91sam9g45_gpio, 5); 386 at91_gpio_init(at91sam9g45_gpio, 5);
384} 387}
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index 2d895a297739..388ec3aec4b9 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -224,7 +224,13 @@ static void __init at91sam9n12_map_io(void)
224 at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE); 224 at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE);
225} 225}
226 226
227static void __init at91sam9n12_initialize(void)
228{
229 at91_sysirq_mask_rtc(AT91SAM9N12_BASE_RTC);
230}
231
227AT91_SOC_START(at91sam9n12) 232AT91_SOC_START(at91sam9n12)
228 .map_io = at91sam9n12_map_io, 233 .map_io = at91sam9n12_map_io,
229 .register_clocks = at91sam9n12_register_clocks, 234 .register_clocks = at91sam9n12_register_clocks,
235 .init = at91sam9n12_initialize,
230AT91_SOC_END 236AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 88995af09c04..0750ffb7e6b1 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -296,6 +296,9 @@ static void __init at91sam9rl_initialize(void)
296 arm_pm_idle = at91sam9_idle; 296 arm_pm_idle = at91sam9_idle;
297 arm_pm_restart = at91sam9_alt_restart; 297 arm_pm_restart = at91sam9_alt_restart;
298 298
299 at91_sysirq_mask_rtc(AT91SAM9RL_BASE_RTC);
300 at91_sysirq_mask_rtt(AT91SAM9RL_BASE_RTT);
301
299 /* Register GPIO subsystem */ 302 /* Register GPIO subsystem */
300 at91_gpio_init(at91sam9rl_gpio, 4); 303 at91_gpio_init(at91sam9rl_gpio, 4);
301} 304}
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 916e5a142917..e8a2e075a1b8 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -322,6 +322,11 @@ static void __init at91sam9x5_map_io(void)
322 at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE); 322 at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE);
323} 323}
324 324
325static void __init at91sam9x5_initialize(void)
326{
327 at91_sysirq_mask_rtc(AT91SAM9X5_BASE_RTC);
328}
329
325/* -------------------------------------------------------------------- 330/* --------------------------------------------------------------------
326 * Interrupt initialization 331 * Interrupt initialization
327 * -------------------------------------------------------------------- */ 332 * -------------------------------------------------------------------- */
@@ -329,4 +334,5 @@ static void __init at91sam9x5_map_io(void)
329AT91_SOC_START(at91sam9x5) 334AT91_SOC_START(at91sam9x5)
330 .map_io = at91sam9x5_map_io, 335 .map_io = at91sam9x5_map_io,
331 .register_clocks = at91sam9x5_register_clocks, 336 .register_clocks = at91sam9x5_register_clocks,
337 .init = at91sam9x5_initialize,
332AT91_SOC_END 338AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 0b153c87521d..f4f8735315da 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -28,7 +28,7 @@
28#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
29#include <linux/spi/at73c213.h> 29#include <linux/spi/at73c213.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/i2c/at24.h> 31#include <linux/platform_data/at24.h>
32#include <linux/gpio_keys.h> 32#include <linux/gpio_keys.h>
33#include <linux/input.h> 33#include <linux/input.h>
34 34
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 8b4942cbb6d9..2f931915c80c 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -27,7 +27,7 @@
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
29#include <linux/spi/ads7846.h> 29#include <linux/spi/ads7846.h>
30#include <linux/i2c/at24.h> 30#include <linux/platform_data/at24.h>
31#include <linux/fb.h> 31#include <linux/fb.h>
32#include <linux/gpio_keys.h> 32#include <linux/gpio_keys.h>
33#include <linux/input.h> 33#include <linux/input.h>
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index dc6e2f5f804d..26dee3ce9397 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -34,6 +34,8 @@ extern int __init at91_aic_of_init(struct device_node *node,
34 struct device_node *parent); 34 struct device_node *parent);
35extern int __init at91_aic5_of_init(struct device_node *node, 35extern int __init at91_aic5_of_init(struct device_node *node,
36 struct device_node *parent); 36 struct device_node *parent);
37extern void __init at91_sysirq_mask_rtc(u32 rtc_base);
38extern void __init at91_sysirq_mask_rtt(u32 rtt_base);
37 39
38 40
39 /* Timer */ 41 /* Timer */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12.h b/arch/arm/mach-at91/include/mach/at91sam9n12.h
index d374b87c0459..0151bcf6163c 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9n12.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9n12.h
@@ -49,6 +49,11 @@
49#define AT91SAM9N12_BASE_USART3 0xf8028000 49#define AT91SAM9N12_BASE_USART3 0xf8028000
50 50
51/* 51/*
52 * System Peripherals
53 */
54#define AT91SAM9N12_BASE_RTC 0xfffffeb0
55
56/*
52 * Internal Memory. 57 * Internal Memory.
53 */ 58 */
54#define AT91SAM9N12_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 59#define AT91SAM9N12_SRAM_BASE 0x00300000 /* Internal SRAM base address */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9x5.h b/arch/arm/mach-at91/include/mach/at91sam9x5.h
index c75ee19b58d3..2fc76c49e97c 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9x5.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9x5.h
@@ -55,6 +55,11 @@
55#define AT91SAM9X5_BASE_USART2 0xf8024000 55#define AT91SAM9X5_BASE_USART2 0xf8024000
56 56
57/* 57/*
58 * System Peripherals
59 */
60#define AT91SAM9X5_BASE_RTC 0xfffffeb0
61
62/*
58 * Internal Memory. 63 * Internal Memory.
59 */ 64 */
60#define AT91SAM9X5_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 65#define AT91SAM9X5_SRAM_BASE 0x00300000 /* Internal SRAM base address */
diff --git a/arch/arm/mach-at91/include/mach/sama5d3.h b/arch/arm/mach-at91/include/mach/sama5d3.h
index 31096a8aaf1d..25613d8c6dcd 100644
--- a/arch/arm/mach-at91/include/mach/sama5d3.h
+++ b/arch/arm/mach-at91/include/mach/sama5d3.h
@@ -73,6 +73,11 @@
73#define SAMA5D3_BASE_USART3 0xf8024000 73#define SAMA5D3_BASE_USART3 0xf8024000
74 74
75/* 75/*
76 * System Peripherals
77 */
78#define SAMA5D3_BASE_RTC 0xfffffeb0
79
80/*
76 * Internal Memory 81 * Internal Memory
77 */ 82 */
78#define SAMA5D3_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 83#define SAMA5D3_SRAM_BASE 0x00300000 /* Internal SRAM base address */
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
index 3ed190ce062b..c5101dcb4fb0 100644
--- a/arch/arm/mach-at91/pm.h
+++ b/arch/arm/mach-at91/pm.h
@@ -16,7 +16,11 @@
16#include <mach/at91_ramc.h> 16#include <mach/at91_ramc.h>
17#include <mach/at91rm9200_sdramc.h> 17#include <mach/at91rm9200_sdramc.h>
18 18
19#ifdef CONFIG_PM
19extern void at91_pm_set_standby(void (*at91_standby)(void)); 20extern void at91_pm_set_standby(void (*at91_standby)(void));
21#else
22static inline void at91_pm_set_standby(void (*at91_standby)(void)) { }
23#endif
20 24
21/* 25/*
22 * The AT91RM9200 goes into self-refresh mode with this command, and will 26 * The AT91RM9200 goes into self-refresh mode with this command, and will
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index 401279715ab1..a28873fe3049 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -95,19 +95,19 @@ static struct clk twi0_clk = {
95 .name = "twi0_clk", 95 .name = "twi0_clk",
96 .pid = SAMA5D3_ID_TWI0, 96 .pid = SAMA5D3_ID_TWI0,
97 .type = CLK_TYPE_PERIPHERAL, 97 .type = CLK_TYPE_PERIPHERAL,
98 .div = AT91_PMC_PCR_DIV2, 98 .div = AT91_PMC_PCR_DIV8,
99}; 99};
100static struct clk twi1_clk = { 100static struct clk twi1_clk = {
101 .name = "twi1_clk", 101 .name = "twi1_clk",
102 .pid = SAMA5D3_ID_TWI1, 102 .pid = SAMA5D3_ID_TWI1,
103 .type = CLK_TYPE_PERIPHERAL, 103 .type = CLK_TYPE_PERIPHERAL,
104 .div = AT91_PMC_PCR_DIV2, 104 .div = AT91_PMC_PCR_DIV8,
105}; 105};
106static struct clk twi2_clk = { 106static struct clk twi2_clk = {
107 .name = "twi2_clk", 107 .name = "twi2_clk",
108 .pid = SAMA5D3_ID_TWI2, 108 .pid = SAMA5D3_ID_TWI2,
109 .type = CLK_TYPE_PERIPHERAL, 109 .type = CLK_TYPE_PERIPHERAL,
110 .div = AT91_PMC_PCR_DIV2, 110 .div = AT91_PMC_PCR_DIV8,
111}; 111};
112static struct clk mmc0_clk = { 112static struct clk mmc0_clk = {
113 .name = "mci0_clk", 113 .name = "mci0_clk",
@@ -371,7 +371,13 @@ static void __init sama5d3_map_io(void)
371 at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE); 371 at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE);
372} 372}
373 373
374static void __init sama5d3_initialize(void)
375{
376 at91_sysirq_mask_rtc(SAMA5D3_BASE_RTC);
377}
378
374AT91_SOC_START(sama5d3) 379AT91_SOC_START(sama5d3)
375 .map_io = sama5d3_map_io, 380 .map_io = sama5d3_map_io,
376 .register_clocks = sama5d3_register_clocks, 381 .register_clocks = sama5d3_register_clocks,
382 .init = sama5d3_initialize,
377AT91_SOC_END 383AT91_SOC_END
diff --git a/arch/arm/mach-at91/sysirq_mask.c b/arch/arm/mach-at91/sysirq_mask.c
new file mode 100644
index 000000000000..2ba694f9626b
--- /dev/null
+++ b/arch/arm/mach-at91/sysirq_mask.c
@@ -0,0 +1,71 @@
1/*
2 * sysirq_mask.c - System-interrupt masking
3 *
4 * Copyright (C) 2013 Johan Hovold <jhovold@gmail.com>
5 *
6 * Functions to disable system interrupts from backup-powered peripherals.
7 *
8 * The RTC and RTT-peripherals are generally powered by backup power (VDDBU)
9 * and are not reset on wake-up, user, watchdog or software reset. This means
10 * that their interrupts may be enabled during early boot (e.g. after a user
11 * reset).
12 *
13 * As the RTC and RTT share the system-interrupt line with the PIT, an
14 * interrupt occurring before a handler has been installed would lead to the
15 * system interrupt being disabled and prevent the system from booting.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 */
22
23#include <linux/io.h>
24#include <mach/at91_rtt.h>
25
26#include "generic.h"
27
28#define AT91_RTC_IDR 0x24 /* Interrupt Disable Register */
29#define AT91_RTC_IMR 0x28 /* Interrupt Mask Register */
30
31void __init at91_sysirq_mask_rtc(u32 rtc_base)
32{
33 void __iomem *base;
34 u32 mask;
35
36 base = ioremap(rtc_base, 64);
37 if (!base)
38 return;
39
40 mask = readl_relaxed(base + AT91_RTC_IMR);
41 if (mask) {
42 pr_info("AT91: Disabling rtc irq\n");
43 writel_relaxed(mask, base + AT91_RTC_IDR);
44 (void)readl_relaxed(base + AT91_RTC_IMR); /* flush */
45 }
46
47 iounmap(base);
48}
49
50void __init at91_sysirq_mask_rtt(u32 rtt_base)
51{
52 void __iomem *base;
53 void __iomem *reg;
54 u32 mode;
55
56 base = ioremap(rtt_base, 16);
57 if (!base)
58 return;
59
60 reg = base + AT91_RTT_MR;
61
62 mode = readl_relaxed(reg);
63 if (mode & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)) {
64 pr_info("AT91: Disabling rtt irq\n");
65 mode &= ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
66 writel_relaxed(mode, reg);
67 (void)readl_relaxed(reg); /* flush */
68 }
69
70 iounmap(base);
71}
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 40f15f133c55..d1f45af7a530 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -17,7 +17,7 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/i2c/pcf857x.h> 19#include <linux/i2c/pcf857x.h>
20#include <linux/i2c/at24.h> 20#include <linux/platform_data/at24.h>
21#include <linux/mtd/mtd.h> 21#include <linux/mtd/mtd.h>
22#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
23#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index df16cb88a26b..e0af0eccde8f 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include <linux/i2c/at24.h> 21#include <linux/platform_data/at24.h>
22#include <linux/platform_data/pca953x.h> 22#include <linux/platform_data/pca953x.h>
23#include <linux/input.h> 23#include <linux/input.h>
24#include <linux/input/tps6507x-ts.h> 24#include <linux/input/tps6507x-ts.h>
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index f4a6c18912ea..e08a8684ead2 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -18,7 +18,7 @@
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/i2c/at24.h> 21#include <linux/platform_data/at24.h>
22#include <linux/leds.h> 22#include <linux/leds.h>
23#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 9cc32c283b8b..987605b78556 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -15,7 +15,7 @@
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/i2c.h> 16#include <linux/i2c.h>
17#include <linux/i2c/pcf857x.h> 17#include <linux/i2c/pcf857x.h>
18#include <linux/i2c/at24.h> 18#include <linux/platform_data/at24.h>
19#include <linux/mtd/mtd.h> 19#include <linux/mtd/mtd.h>
20#include <linux/mtd/nand.h> 20#include <linux/mtd/nand.h>
21#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 44b20191a9fe..13d0801fd6b1 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -22,7 +22,7 @@
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/i2c.h> 24#include <linux/i2c.h>
25#include <linux/i2c/at24.h> 25#include <linux/platform_data/at24.h>
26#include <linux/i2c/pcf857x.h> 26#include <linux/i2c/pcf857x.h>
27 27
28#include <media/tvp514x.h> 28#include <media/tvp514x.h>
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index cd0f58730c2b..7aa105b1fd0f 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -15,7 +15,7 @@
15#include <linux/mtd/partitions.h> 15#include <linux/mtd/partitions.h>
16#include <linux/regulator/machine.h> 16#include <linux/regulator/machine.h>
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/i2c/at24.h> 18#include <linux/platform_data/at24.h>
19#include <linux/etherdevice.h> 19#include <linux/etherdevice.h>
20#include <linux/spi/spi.h> 20#include <linux/spi/spi.h>
21#include <linux/spi/flash.h> 21#include <linux/spi/flash.h>
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index d84360148100..41c7c9615791 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -26,7 +26,7 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/i2c/at24.h> 29#include <linux/platform_data/at24.h>
30#include <linux/mtd/mtd.h> 30#include <linux/mtd/mtd.h>
31#include <linux/mtd/nand.h> 31#include <linux/mtd/nand.h>
32#include <linux/mtd/partitions.h> 32#include <linux/mtd/partitions.h>
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index c46eccbbd512..78829c513fdc 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -487,7 +487,7 @@ int __init da8xx_register_emac(void)
487 487
488static struct resource da830_mcasp1_resources[] = { 488static struct resource da830_mcasp1_resources[] = {
489 { 489 {
490 .name = "mcasp1", 490 .name = "mpu",
491 .start = DAVINCI_DA830_MCASP1_REG_BASE, 491 .start = DAVINCI_DA830_MCASP1_REG_BASE,
492 .end = DAVINCI_DA830_MCASP1_REG_BASE + (SZ_1K * 12) - 1, 492 .end = DAVINCI_DA830_MCASP1_REG_BASE + (SZ_1K * 12) - 1,
493 .flags = IORESOURCE_MEM, 493 .flags = IORESOURCE_MEM,
@@ -515,7 +515,7 @@ static struct platform_device da830_mcasp1_device = {
515 515
516static struct resource da850_mcasp_resources[] = { 516static struct resource da850_mcasp_resources[] = {
517 { 517 {
518 .name = "mcasp", 518 .name = "mpu",
519 .start = DAVINCI_DA8XX_MCASP0_REG_BASE, 519 .start = DAVINCI_DA8XX_MCASP0_REG_BASE,
520 .end = DAVINCI_DA8XX_MCASP0_REG_BASE + (SZ_1K * 12) - 1, 520 .end = DAVINCI_DA8XX_MCASP0_REG_BASE + (SZ_1K * 12) - 1,
521 .flags = IORESOURCE_MEM, 521 .flags = IORESOURCE_MEM,
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index ef9ff1fb6f52..6117fc644188 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -641,6 +641,7 @@ static struct platform_device dm355_edma_device = {
641 641
642static struct resource dm355_asp1_resources[] = { 642static struct resource dm355_asp1_resources[] = {
643 { 643 {
644 .name = "mpu",
644 .start = DAVINCI_ASP1_BASE, 645 .start = DAVINCI_ASP1_BASE,
645 .end = DAVINCI_ASP1_BASE + SZ_8K - 1, 646 .end = DAVINCI_ASP1_BASE + SZ_8K - 1,
646 .flags = IORESOURCE_MEM, 647 .flags = IORESOURCE_MEM,
@@ -906,7 +907,7 @@ static struct davinci_gpio_platform_data dm355_gpio_platform_data = {
906int __init dm355_gpio_register(void) 907int __init dm355_gpio_register(void)
907{ 908{
908 return davinci_gpio_register(dm355_gpio_resources, 909 return davinci_gpio_register(dm355_gpio_resources,
909 sizeof(dm355_gpio_resources), 910 ARRAY_SIZE(dm355_gpio_resources),
910 &dm355_gpio_platform_data); 911 &dm355_gpio_platform_data);
911} 912}
912/*----------------------------------------------------------------------*/ 913/*----------------------------------------------------------------------*/
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 1511a0680f9a..d7c6f85d3fc9 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -720,7 +720,7 @@ static struct davinci_gpio_platform_data dm365_gpio_platform_data = {
720int __init dm365_gpio_register(void) 720int __init dm365_gpio_register(void)
721{ 721{
722 return davinci_gpio_register(dm365_gpio_resources, 722 return davinci_gpio_register(dm365_gpio_resources,
723 sizeof(dm365_gpio_resources), 723 ARRAY_SIZE(dm365_gpio_resources),
724 &dm365_gpio_platform_data); 724 &dm365_gpio_platform_data);
725} 725}
726 726
@@ -942,6 +942,7 @@ static struct platform_device dm365_edma_device = {
942 942
943static struct resource dm365_asp_resources[] = { 943static struct resource dm365_asp_resources[] = {
944 { 944 {
945 .name = "mpu",
945 .start = DAVINCI_DM365_ASP0_BASE, 946 .start = DAVINCI_DM365_ASP0_BASE,
946 .end = DAVINCI_DM365_ASP0_BASE + SZ_8K - 1, 947 .end = DAVINCI_DM365_ASP0_BASE + SZ_8K - 1,
947 .flags = IORESOURCE_MEM, 948 .flags = IORESOURCE_MEM,
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 143a3217e8ef..3ce47997bb46 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -572,6 +572,7 @@ static struct platform_device dm644x_edma_device = {
572/* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */ 572/* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */
573static struct resource dm644x_asp_resources[] = { 573static struct resource dm644x_asp_resources[] = {
574 { 574 {
575 .name = "mpu",
575 .start = DAVINCI_ASP0_BASE, 576 .start = DAVINCI_ASP0_BASE,
576 .end = DAVINCI_ASP0_BASE + SZ_8K - 1, 577 .end = DAVINCI_ASP0_BASE + SZ_8K - 1,
577 .flags = IORESOURCE_MEM, 578 .flags = IORESOURCE_MEM,
@@ -792,7 +793,7 @@ static struct davinci_gpio_platform_data dm644_gpio_platform_data = {
792int __init dm644x_gpio_register(void) 793int __init dm644x_gpio_register(void)
793{ 794{
794 return davinci_gpio_register(dm644_gpio_resources, 795 return davinci_gpio_register(dm644_gpio_resources,
795 sizeof(dm644_gpio_resources), 796 ARRAY_SIZE(dm644_gpio_resources),
796 &dm644_gpio_platform_data); 797 &dm644_gpio_platform_data);
797} 798}
798/*----------------------------------------------------------------------*/ 799/*----------------------------------------------------------------------*/
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 2a73f299c1d0..0e81fea65e7f 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -621,7 +621,7 @@ static struct platform_device dm646x_edma_device = {
621 621
622static struct resource dm646x_mcasp0_resources[] = { 622static struct resource dm646x_mcasp0_resources[] = {
623 { 623 {
624 .name = "mcasp0", 624 .name = "mpu",
625 .start = DAVINCI_DM646X_MCASP0_REG_BASE, 625 .start = DAVINCI_DM646X_MCASP0_REG_BASE,
626 .end = DAVINCI_DM646X_MCASP0_REG_BASE + (SZ_1K << 1) - 1, 626 .end = DAVINCI_DM646X_MCASP0_REG_BASE + (SZ_1K << 1) - 1,
627 .flags = IORESOURCE_MEM, 627 .flags = IORESOURCE_MEM,
@@ -641,7 +641,7 @@ static struct resource dm646x_mcasp0_resources[] = {
641 641
642static struct resource dm646x_mcasp1_resources[] = { 642static struct resource dm646x_mcasp1_resources[] = {
643 { 643 {
644 .name = "mcasp1", 644 .name = "mpu",
645 .start = DAVINCI_DM646X_MCASP1_REG_BASE, 645 .start = DAVINCI_DM646X_MCASP1_REG_BASE,
646 .end = DAVINCI_DM646X_MCASP1_REG_BASE + (SZ_1K << 1) - 1, 646 .end = DAVINCI_DM646X_MCASP1_REG_BASE + (SZ_1K << 1) - 1,
647 .flags = IORESOURCE_MEM, 647 .flags = IORESOURCE_MEM,
@@ -769,7 +769,7 @@ static struct davinci_gpio_platform_data dm646x_gpio_platform_data = {
769int __init dm646x_gpio_register(void) 769int __init dm646x_gpio_register(void)
770{ 770{
771 return davinci_gpio_register(dm646x_gpio_resources, 771 return davinci_gpio_register(dm646x_gpio_resources,
772 sizeof(dm646x_gpio_resources), 772 ARRAY_SIZE(dm646x_gpio_resources),
773 &dm646x_gpio_platform_data); 773 &dm646x_gpio_platform_data);
774} 774}
775/*----------------------------------------------------------------------*/ 775/*----------------------------------------------------------------------*/
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index 2739ca2c1334..e0091685fd48 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <video/vga.h>
18 19
19#include <asm/pgtable.h> 20#include <asm/pgtable.h>
20#include <asm/page.h> 21#include <asm/page.h>
@@ -196,6 +197,8 @@ void __init footbridge_map_io(void)
196 iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); 197 iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc));
197 pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO)); 198 pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO));
198 } 199 }
200
201 vga_base = PCIMEM_BASE;
199} 202}
200 203
201void footbridge_restart(enum reboot_mode mode, const char *cmd) 204void footbridge_restart(enum reboot_mode mode, const char *cmd)
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index 3490a24f969e..7c2fdae9a38b 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -18,7 +18,6 @@
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <video/vga.h>
22 21
23#include <asm/irq.h> 22#include <asm/irq.h>
24#include <asm/mach/pci.h> 23#include <asm/mach/pci.h>
@@ -291,7 +290,6 @@ void __init dc21285_preinit(void)
291 int cfn_mode; 290 int cfn_mode;
292 291
293 pcibios_min_mem = 0x81000000; 292 pcibios_min_mem = 0x81000000;
294 vga_base = PCIMEM_BASE;
295 293
296 mem_size = (unsigned int)high_memory - PAGE_OFFSET; 294 mem_size = (unsigned int)high_memory - PAGE_OFFSET;
297 for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) 295 for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
index b08243500e2e..1a7235fb52ac 100644
--- a/arch/arm/mach-footbridge/ebsa285.c
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -30,21 +30,24 @@ static const struct {
30 const char *name; 30 const char *name;
31 const char *trigger; 31 const char *trigger;
32} ebsa285_leds[] = { 32} ebsa285_leds[] = {
33 { "ebsa285:amber", "heartbeat", }, 33 { "ebsa285:amber", "cpu0", },
34 { "ebsa285:green", "cpu0", }, 34 { "ebsa285:green", "heartbeat", },
35 { "ebsa285:red",}, 35 { "ebsa285:red",},
36}; 36};
37 37
38static unsigned char hw_led_state;
39
38static void ebsa285_led_set(struct led_classdev *cdev, 40static void ebsa285_led_set(struct led_classdev *cdev,
39 enum led_brightness b) 41 enum led_brightness b)
40{ 42{
41 struct ebsa285_led *led = container_of(cdev, 43 struct ebsa285_led *led = container_of(cdev,
42 struct ebsa285_led, cdev); 44 struct ebsa285_led, cdev);
43 45
44 if (b != LED_OFF) 46 if (b == LED_OFF)
45 *XBUS_LEDS |= led->mask; 47 hw_led_state |= led->mask;
46 else 48 else
47 *XBUS_LEDS &= ~led->mask; 49 hw_led_state &= ~led->mask;
50 *XBUS_LEDS = hw_led_state;
48} 51}
49 52
50static enum led_brightness ebsa285_led_get(struct led_classdev *cdev) 53static enum led_brightness ebsa285_led_get(struct led_classdev *cdev)
@@ -52,18 +55,19 @@ static enum led_brightness ebsa285_led_get(struct led_classdev *cdev)
52 struct ebsa285_led *led = container_of(cdev, 55 struct ebsa285_led *led = container_of(cdev,
53 struct ebsa285_led, cdev); 56 struct ebsa285_led, cdev);
54 57
55 return (*XBUS_LEDS & led->mask) ? LED_FULL : LED_OFF; 58 return hw_led_state & led->mask ? LED_OFF : LED_FULL;
56} 59}
57 60
58static int __init ebsa285_leds_init(void) 61static int __init ebsa285_leds_init(void)
59{ 62{
60 int i; 63 int i;
61 64
62 if (machine_is_ebsa285()) 65 if (!machine_is_ebsa285())
63 return -ENODEV; 66 return -ENODEV;
64 67
65 /* 3 LEDS All ON */ 68 /* 3 LEDS all off */
66 *XBUS_LEDS |= XBUS_LED_AMBER | XBUS_LED_GREEN | XBUS_LED_RED; 69 hw_led_state = XBUS_LED_AMBER | XBUS_LED_GREEN | XBUS_LED_RED;
70 *XBUS_LEDS = hw_led_state;
67 71
68 for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) { 72 for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) {
69 struct ebsa285_led *led; 73 struct ebsa285_led *led;
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index 08332d841440..0aded64a9ebc 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -7,7 +7,7 @@ config ARCH_HIGHBANK
7 select ARCH_SUPPORTS_BIG_ENDIAN 7 select ARCH_SUPPORTS_BIG_ENDIAN
8 select ARCH_WANT_OPTIONAL_GPIOLIB 8 select ARCH_WANT_OPTIONAL_GPIOLIB
9 select ARM_AMBA 9 select ARM_AMBA
10 select ARM_ERRATA_764369 10 select ARM_ERRATA_764369 if SMP
11 select ARM_ERRATA_775420 11 select ARM_ERRATA_775420
12 select ARM_ERRATA_798181 if SMP 12 select ARM_ERRATA_798181 if SMP
13 select ARM_GIC 13 select ARM_GIC
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index b3d7e5634b83..bd3bf66ce344 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -17,12 +17,15 @@
17#include <linux/clkdev.h> 17#include <linux/clkdev.h>
18#include <linux/clocksource.h> 18#include <linux/clocksource.h>
19#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
20#include <linux/input.h>
20#include <linux/io.h> 21#include <linux/io.h>
21#include <linux/irqchip.h> 22#include <linux/irqchip.h>
23#include <linux/mailbox.h>
22#include <linux/of.h> 24#include <linux/of.h>
23#include <linux/of_irq.h> 25#include <linux/of_irq.h>
24#include <linux/of_platform.h> 26#include <linux/of_platform.h>
25#include <linux/of_address.h> 27#include <linux/of_address.h>
28#include <linux/reboot.h>
26#include <linux/amba/bus.h> 29#include <linux/amba/bus.h>
27#include <linux/platform_device.h> 30#include <linux/platform_device.h>
28 31
@@ -130,6 +133,24 @@ static struct platform_device highbank_cpuidle_device = {
130 .name = "cpuidle-calxeda", 133 .name = "cpuidle-calxeda",
131}; 134};
132 135
136static int hb_keys_notifier(struct notifier_block *nb, unsigned long event, void *data)
137{
138 u32 key = *(u32 *)data;
139
140 if (event != 0x1000)
141 return 0;
142
143 if (key == KEY_POWER)
144 orderly_poweroff(false);
145 else if (key == 0xffff)
146 ctrl_alt_del();
147
148 return 0;
149}
150static struct notifier_block hb_keys_nb = {
151 .notifier_call = hb_keys_notifier,
152};
153
133static void __init highbank_init(void) 154static void __init highbank_init(void)
134{ 155{
135 struct device_node *np; 156 struct device_node *np;
@@ -145,6 +166,8 @@ static void __init highbank_init(void)
145 bus_register_notifier(&platform_bus_type, &highbank_platform_nb); 166 bus_register_notifier(&platform_bus_type, &highbank_platform_nb);
146 bus_register_notifier(&amba_bustype, &highbank_amba_nb); 167 bus_register_notifier(&amba_bustype, &highbank_amba_nb);
147 168
169 pl320_ipc_register_notifier(&hb_keys_nb);
170
148 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 171 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
149 172
150 if (psci_ops.cpu_suspend) 173 if (psci_ops.cpu_suspend)
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index bbe1f5bb799c..1789e2b31903 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -102,8 +102,8 @@ obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o
102 102
103ifeq ($(CONFIG_PM),y) 103ifeq ($(CONFIG_PM),y)
104obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o 104obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o
105# i.MX6SL reuses pm-imx6q.c 105# i.MX6SL reuses i.MX6Q code
106obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o 106obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o
107endif 107endif
108 108
109# i.MX5 based machines 109# i.MX5 based machines
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index d756d91fd741..04cfd0fcb0e5 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -122,13 +122,14 @@ static struct clk_div_table clk_enet_ref_table[] = {
122 { .val = 1, .div = 10, }, 122 { .val = 1, .div = 10, },
123 { .val = 2, .div = 5, }, 123 { .val = 2, .div = 5, },
124 { .val = 3, .div = 4, }, 124 { .val = 3, .div = 4, },
125 { /* sentinel */ }
125}; 126};
126 127
127static struct clk_div_table post_div_table[] = { 128static struct clk_div_table post_div_table[] = {
128 { .val = 2, .div = 1, }, 129 { .val = 2, .div = 1, },
129 { .val = 1, .div = 2, }, 130 { .val = 1, .div = 2, },
130 { .val = 0, .div = 4, }, 131 { .val = 0, .div = 4, },
131 { } 132 { /* sentinel */ }
132}; 133};
133 134
134static struct clk_div_table video_div_table[] = { 135static struct clk_div_table video_div_table[] = {
@@ -136,7 +137,7 @@ static struct clk_div_table video_div_table[] = {
136 { .val = 1, .div = 2, }, 137 { .val = 1, .div = 2, },
137 { .val = 2, .div = 1, }, 138 { .val = 2, .div = 1, },
138 { .val = 3, .div = 4, }, 139 { .val = 3, .div = 4, },
139 { } 140 { /* sentinel */ }
140}; 141};
141 142
142static void __init imx6q_clocks_init(struct device_node *ccm_node) 143static void __init imx6q_clocks_init(struct device_node *ccm_node)
@@ -298,7 +299,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
298 clk[asrc_podf] = imx_clk_divider("asrc_podf", "asrc_pred", base + 0x30, 9, 3); 299 clk[asrc_podf] = imx_clk_divider("asrc_podf", "asrc_pred", base + 0x30, 9, 3);
299 clk[spdif_pred] = imx_clk_divider("spdif_pred", "spdif_sel", base + 0x30, 25, 3); 300 clk[spdif_pred] = imx_clk_divider("spdif_pred", "spdif_sel", base + 0x30, 25, 3);
300 clk[spdif_podf] = imx_clk_divider("spdif_podf", "spdif_pred", base + 0x30, 22, 3); 301 clk[spdif_podf] = imx_clk_divider("spdif_podf", "spdif_pred", base + 0x30, 22, 3);
301 clk[can_root] = imx_clk_divider("can_root", "pll3_usb_otg", base + 0x20, 2, 6); 302 clk[can_root] = imx_clk_divider("can_root", "pll3_60m", base + 0x20, 2, 6);
302 clk[ecspi_root] = imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6); 303 clk[ecspi_root] = imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6);
303 clk[gpu2d_core_podf] = imx_clk_divider("gpu2d_core_podf", "gpu2d_core_sel", base + 0x18, 23, 3); 304 clk[gpu2d_core_podf] = imx_clk_divider("gpu2d_core_podf", "gpu2d_core_sel", base + 0x18, 23, 3);
304 clk[gpu3d_core_podf] = imx_clk_divider("gpu3d_core_podf", "gpu3d_core_sel", base + 0x18, 26, 3); 305 clk[gpu3d_core_podf] = imx_clk_divider("gpu3d_core_podf", "gpu3d_core_sel", base + 0x18, 26, 3);
diff --git a/arch/arm/mach-imx/clk-pllv3.c b/arch/arm/mach-imx/clk-pllv3.c
index f6640b6a7b31..61364050fccd 100644
--- a/arch/arm/mach-imx/clk-pllv3.c
+++ b/arch/arm/mach-imx/clk-pllv3.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/clk-provider.h> 14#include <linux/clk-provider.h>
15#include <linux/delay.h>
15#include <linux/io.h> 16#include <linux/io.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
17#include <linux/jiffies.h> 18#include <linux/jiffies.h>
@@ -45,33 +46,49 @@ struct clk_pllv3 {
45 46
46#define to_clk_pllv3(_hw) container_of(_hw, struct clk_pllv3, hw) 47#define to_clk_pllv3(_hw) container_of(_hw, struct clk_pllv3, hw)
47 48
49static int clk_pllv3_wait_lock(struct clk_pllv3 *pll)
50{
51 unsigned long timeout = jiffies + msecs_to_jiffies(10);
52 u32 val = readl_relaxed(pll->base) & BM_PLL_POWER;
53
54 /* No need to wait for lock when pll is not powered up */
55 if ((pll->powerup_set && !val) || (!pll->powerup_set && val))
56 return 0;
57
58 /* Wait for PLL to lock */
59 do {
60 if (readl_relaxed(pll->base) & BM_PLL_LOCK)
61 break;
62 if (time_after(jiffies, timeout))
63 break;
64 usleep_range(50, 500);
65 } while (1);
66
67 return readl_relaxed(pll->base) & BM_PLL_LOCK ? 0 : -ETIMEDOUT;
68}
69
48static int clk_pllv3_prepare(struct clk_hw *hw) 70static int clk_pllv3_prepare(struct clk_hw *hw)
49{ 71{
50 struct clk_pllv3 *pll = to_clk_pllv3(hw); 72 struct clk_pllv3 *pll = to_clk_pllv3(hw);
51 unsigned long timeout;
52 u32 val; 73 u32 val;
74 int ret;
53 75
54 val = readl_relaxed(pll->base); 76 val = readl_relaxed(pll->base);
55 val &= ~BM_PLL_BYPASS;
56 if (pll->powerup_set) 77 if (pll->powerup_set)
57 val |= BM_PLL_POWER; 78 val |= BM_PLL_POWER;
58 else 79 else
59 val &= ~BM_PLL_POWER; 80 val &= ~BM_PLL_POWER;
60 writel_relaxed(val, pll->base); 81 writel_relaxed(val, pll->base);
61 82
62 timeout = jiffies + msecs_to_jiffies(10); 83 ret = clk_pllv3_wait_lock(pll);
63 /* Wait for PLL to lock */ 84 if (ret)
64 do { 85 return ret;
65 if (readl_relaxed(pll->base) & BM_PLL_LOCK)
66 break;
67 if (time_after(jiffies, timeout))
68 break;
69 } while (1);
70 86
71 if (readl_relaxed(pll->base) & BM_PLL_LOCK) 87 val = readl_relaxed(pll->base);
72 return 0; 88 val &= ~BM_PLL_BYPASS;
73 else 89 writel_relaxed(val, pll->base);
74 return -ETIMEDOUT; 90
91 return 0;
75} 92}
76 93
77static void clk_pllv3_unprepare(struct clk_hw *hw) 94static void clk_pllv3_unprepare(struct clk_hw *hw)
@@ -146,7 +163,7 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
146 val |= div; 163 val |= div;
147 writel_relaxed(val, pll->base); 164 writel_relaxed(val, pll->base);
148 165
149 return 0; 166 return clk_pllv3_wait_lock(pll);
150} 167}
151 168
152static const struct clk_ops clk_pllv3_ops = { 169static const struct clk_ops clk_pllv3_ops = {
@@ -202,7 +219,7 @@ static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
202 val |= div; 219 val |= div;
203 writel_relaxed(val, pll->base); 220 writel_relaxed(val, pll->base);
204 221
205 return 0; 222 return clk_pllv3_wait_lock(pll);
206} 223}
207 224
208static const struct clk_ops clk_pllv3_sys_ops = { 225static const struct clk_ops clk_pllv3_sys_ops = {
@@ -276,7 +293,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
276 writel_relaxed(mfn, pll->base + PLL_NUM_OFFSET); 293 writel_relaxed(mfn, pll->base + PLL_NUM_OFFSET);
277 writel_relaxed(mfd, pll->base + PLL_DENOM_OFFSET); 294 writel_relaxed(mfd, pll->base + PLL_DENOM_OFFSET);
278 295
279 return 0; 296 return clk_pllv3_wait_lock(pll);
280} 297}
281 298
282static const struct clk_ops clk_pllv3_av_ops = { 299static const struct clk_ops clk_pllv3_av_ops = {
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index 7cbe22d0c6e9..24a7899e36a8 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -127,11 +127,6 @@ static inline void imx_smp_prepare(void) {}
127static inline void imx_scu_standby_enable(void) {} 127static inline void imx_scu_standby_enable(void) {}
128#endif 128#endif
129void imx_src_init(void); 129void imx_src_init(void);
130#ifdef CONFIG_HAVE_IMX_SRC
131void imx_src_prepare_restart(void);
132#else
133static inline void imx_src_prepare_restart(void) {}
134#endif
135void imx_gpc_init(void); 130void imx_gpc_init(void);
136void imx_gpc_pre_suspend(void); 131void imx_gpc_pre_suspend(void);
137void imx_gpc_post_resume(void); 132void imx_gpc_post_resume(void);
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index 19bb6441a7d4..c5f95674e9b7 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -20,7 +20,7 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/i2c/at24.h> 23#include <linux/platform_data/at24.h>
24#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/eeprom.h> 26#include <linux/spi/eeprom.h>
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 45303bd62902..639a3dfb0092 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -23,7 +23,7 @@
23#include <linux/smsc911x.h> 23#include <linux/smsc911x.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/i2c/at24.h> 26#include <linux/platform_data/at24.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
29#include <linux/irq.h> 29#include <linux/irq.h>
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index e805ac273e9c..592ddbe031ac 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include <linux/i2c/at24.h> 21#include <linux/platform_data/at24.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/mtd/plat-ram.h> 23#include <linux/mtd/plat-ram.h>
24#include <linux/mtd/physmap.h> 24#include <linux/mtd/physmap.h>
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index b726cb1c5fdd..ac504b67326b 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -24,7 +24,7 @@
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/i2c/at24.h> 27#include <linux/platform_data/at24.h>
28#include <linux/usb/otg.h> 28#include <linux/usb/otg.h>
29#include <linux/usb/ulpi.h> 29#include <linux/usb/ulpi.h>
30 30
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 0910761e8280..8825d1217d18 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -29,7 +29,7 @@
29#include <asm/mach/time.h> 29#include <asm/mach/time.h>
30 30
31#include <linux/i2c.h> 31#include <linux/i2c.h>
32#include <linux/i2c/at24.h> 32#include <linux/platform_data/at24.h>
33#include <linux/mfd/mc13xxx.h> 33#include <linux/mfd/mc13xxx.h>
34 34
35#include "common.h" 35#include "common.h"
diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c
index 4754373e7e7d..45f7f4e0a447 100644
--- a/arch/arm/mach-imx/src.c
+++ b/arch/arm/mach-imx/src.c
@@ -115,21 +115,6 @@ void imx_set_cpu_arg(int cpu, u32 arg)
115 writel_relaxed(arg, src_base + SRC_GPR1 + cpu * 8 + 4); 115 writel_relaxed(arg, src_base + SRC_GPR1 + cpu * 8 + 4);
116} 116}
117 117
118void imx_src_prepare_restart(void)
119{
120 u32 val;
121
122 /* clear enable bits of secondary cores */
123 spin_lock(&scr_lock);
124 val = readl_relaxed(src_base + SRC_SCR);
125 val &= ~(0x7 << BP_SRC_SCR_CORE1_ENABLE);
126 writel_relaxed(val, src_base + SRC_SCR);
127 spin_unlock(&scr_lock);
128
129 /* clear persistent entry register of primary core */
130 writel_relaxed(0, src_base + SRC_GPR1);
131}
132
133void __init imx_src_init(void) 118void __init imx_src_init(void)
134{ 119{
135 struct device_node *np; 120 struct device_node *np;
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index e6edcd38b282..5e3027d3692f 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -42,9 +42,6 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
42{ 42{
43 unsigned int wcr_enable; 43 unsigned int wcr_enable;
44 44
45 if (cpu_is_imx6q() || cpu_is_imx6dl())
46 imx_src_prepare_restart();
47
48 if (wdog_clk) 45 if (wdog_clk)
49 clk_enable(wdog_clk); 46 clk_enable(wdog_clk);
50 47
@@ -55,7 +52,14 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
55 52
56 /* Assert SRS signal */ 53 /* Assert SRS signal */
57 __raw_writew(wcr_enable, wdog_base); 54 __raw_writew(wcr_enable, wdog_base);
58 /* write twice to ensure the request will not get ignored */ 55 /*
56 * Due to imx6q errata ERR004346 (WDOG: WDOG SRS bit requires to be
57 * written twice), we add another two writes to ensure there must be at
58 * least two writes happen in the same one 32kHz clock period. We save
59 * the target check here, since the writes shouldn't be a huge burden
60 * for other platforms.
61 */
62 __raw_writew(wcr_enable, wdog_base);
59 __raw_writew(wcr_enable, wdog_base); 63 __raw_writew(wcr_enable, wdog_base);
60 64
61 /* wait for reset to assert... */ 65 /* wait for reset to assert... */
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 1df6e7602cad..4fc0a195de01 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -198,7 +198,8 @@ static struct mmci_platform_data mmc_data = {
198static void cp_clcd_enable(struct clcd_fb *fb) 198static void cp_clcd_enable(struct clcd_fb *fb)
199{ 199{
200 struct fb_var_screeninfo *var = &fb->fb.var; 200 struct fb_var_screeninfo *var = &fb->fb.var;
201 u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2; 201 u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2
202 | CM_CTRL_LCDEN0 | CM_CTRL_LCDEN1;
202 203
203 if (var->bits_per_pixel <= 8 || 204 if (var->bits_per_pixel <= 8 ||
204 (var->bits_per_pixel == 16 && var->green.length == 5)) 205 (var->bits_per_pixel == 16 && var->green.length == 5))
diff --git a/arch/arm/mach-iop13xx/include/mach/adma.h b/arch/arm/mach-iop13xx/include/mach/adma.h
index 6d3782d85a9f..a86fd0ed7757 100644
--- a/arch/arm/mach-iop13xx/include/mach/adma.h
+++ b/arch/arm/mach-iop13xx/include/mach/adma.h
@@ -218,20 +218,6 @@ iop_chan_xor_slot_count(size_t len, int src_cnt, int *slots_per_op)
218#define iop_chan_pq_slot_count iop_chan_xor_slot_count 218#define iop_chan_pq_slot_count iop_chan_xor_slot_count
219#define iop_chan_pq_zero_sum_slot_count iop_chan_xor_slot_count 219#define iop_chan_pq_zero_sum_slot_count iop_chan_xor_slot_count
220 220
221static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
222 struct iop_adma_chan *chan)
223{
224 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
225 return hw_desc->dest_addr;
226}
227
228static inline u32 iop_desc_get_qdest_addr(struct iop_adma_desc_slot *desc,
229 struct iop_adma_chan *chan)
230{
231 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
232 return hw_desc->q_dest_addr;
233}
234
235static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc, 221static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
236 struct iop_adma_chan *chan) 222 struct iop_adma_chan *chan)
237{ 223{
@@ -350,18 +336,6 @@ iop_desc_init_pq(struct iop_adma_desc_slot *desc, int src_cnt,
350 hw_desc->desc_ctrl = u_desc_ctrl.value; 336 hw_desc->desc_ctrl = u_desc_ctrl.value;
351} 337}
352 338
353static inline int iop_desc_is_pq(struct iop_adma_desc_slot *desc)
354{
355 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
356 union {
357 u32 value;
358 struct iop13xx_adma_desc_ctrl field;
359 } u_desc_ctrl;
360
361 u_desc_ctrl.value = hw_desc->desc_ctrl;
362 return u_desc_ctrl.field.pq_xfer_en;
363}
364
365static inline void 339static inline void
366iop_desc_init_pq_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, 340iop_desc_init_pq_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
367 unsigned long flags) 341 unsigned long flags)
diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.c b/arch/arm/mach-kirkwood/lacie_v2-common.c
index 489495976fcd..8e3e4331c380 100644
--- a/arch/arm/mach-kirkwood/lacie_v2-common.c
+++ b/arch/arm/mach-kirkwood/lacie_v2-common.c
@@ -12,7 +12,7 @@
12#include <linux/spi/flash.h> 12#include <linux/spi/flash.h>
13#include <linux/spi/spi.h> 13#include <linux/spi/spi.h>
14#include <linux/i2c.h> 14#include <linux/i2c.h>
15#include <linux/i2c/at24.h> 15#include <linux/platform_data/at24.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <asm/mach/time.h> 17#include <asm/mach/time.h>
18#include <mach/kirkwood.h> 18#include <mach/kirkwood.h>
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index a7ce69286688..d68909b095f1 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -300,7 +300,7 @@ static struct omap_lcd_config osk_lcd_config __initdata = {
300#ifdef CONFIG_OMAP_OSK_MISTRAL 300#ifdef CONFIG_OMAP_OSK_MISTRAL
301 301
302#include <linux/input.h> 302#include <linux/input.h>
303#include <linux/i2c/at24.h> 303#include <linux/platform_data/at24.h>
304#include <linux/spi/spi.h> 304#include <linux/spi/spi.h>
305#include <linux/spi/ads7846.h> 305#include <linux/spi/ads7846.h>
306 306
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index e15ac005ef17..adcef406ff0a 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -19,11 +19,11 @@ secure-common = omap-smc.o omap-secure.o
19 19
20obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) 20obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
21obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) 21obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
22obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common) 22obj-$(CONFIG_ARCH_OMAP4) += $(hwmod-common) $(secure-common)
23obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common) 23obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common)
24obj-$(CONFIG_SOC_OMAP5) += prm44xx.o $(hwmod-common) $(secure-common) 24obj-$(CONFIG_SOC_OMAP5) += $(hwmod-common) $(secure-common)
25obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common) 25obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common)
26obj-$(CONFIG_SOC_DRA7XX) += prm44xx.o $(hwmod-common) $(secure-common) 26obj-$(CONFIG_SOC_DRA7XX) += $(hwmod-common) $(secure-common)
27 27
28ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) 28ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
29obj-y += mcbsp.o 29obj-y += mcbsp.o
@@ -40,7 +40,7 @@ omap-4-5-common = omap4-common.o omap-wakeupgen.o
40obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-common) $(smp-y) sleep44xx.o 40obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-common) $(smp-y) sleep44xx.o
41obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common) $(smp-y) sleep44xx.o 41obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common) $(smp-y) sleep44xx.o
42obj-$(CONFIG_SOC_AM43XX) += $(omap-4-5-common) 42obj-$(CONFIG_SOC_AM43XX) += $(omap-4-5-common)
43obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-common) $(smp-y) 43obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-common) $(smp-y) sleep44xx.o
44 44
45plus_sec := $(call as-instr,.arch_extension sec,+sec) 45plus_sec := $(call as-instr,.arch_extension sec,+sec)
46AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) 46AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 33d159e2386e..8dd0ec858cf1 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -25,7 +25,7 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/platform_data/gpio-omap.h> 26#include <linux/platform_data/gpio-omap.h>
27 27
28#include <linux/i2c/at24.h> 28#include <linux/platform_data/at24.h>
29#include <linux/i2c/twl.h> 29#include <linux/i2c/twl.h>
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/regulator/machine.h> 31#include <linux/regulator/machine.h>
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 19f1652e94cf..8d972ff18c56 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -131,6 +131,24 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
131 .dt_compat = omap3_gp_boards_compat, 131 .dt_compat = omap3_gp_boards_compat,
132 .restart = omap3xxx_restart, 132 .restart = omap3xxx_restart,
133MACHINE_END 133MACHINE_END
134
135static const char *am3517_boards_compat[] __initdata = {
136 "ti,am3517",
137 NULL,
138};
139
140DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
141 .reserve = omap_reserve,
142 .map_io = omap3_map_io,
143 .init_early = am35xx_init_early,
144 .init_irq = omap_intc_of_init,
145 .handle_irq = omap3_intc_handle_irq,
146 .init_machine = omap_generic_init,
147 .init_late = omap3_init_late,
148 .init_time = omap3_gptimer_timer_init,
149 .dt_compat = am3517_boards_compat,
150 .restart = omap3xxx_restart,
151MACHINE_END
134#endif 152#endif
135 153
136#ifdef CONFIG_SOC_AM33XX 154#ifdef CONFIG_SOC_AM33XX
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 87e41a8b8d46..f7808349a734 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -20,7 +20,7 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/workqueue.h> 21#include <linux/workqueue.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/i2c/at24.h> 23#include <linux/platform_data/at24.h>
24#include <linux/input.h> 24#include <linux/input.h>
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/clk.h> 26#include <linux/clk.h>
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index a516c1bda141..d6ed819ff15c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -510,7 +510,7 @@ static int __init beagle_opp_init(void)
510 mpu_dev = get_cpu_device(0); 510 mpu_dev = get_cpu_device(0);
511 iva_dev = omap_device_get_by_hwmod_name("iva"); 511 iva_dev = omap_device_get_by_hwmod_name("iva");
512 512
513 if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { 513 if (!mpu_dev || IS_ERR(iva_dev)) {
514 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", 514 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
515 __func__, mpu_dev, iva_dev); 515 __func__, mpu_dev, iva_dev);
516 return -ENODEV; 516 return -ENODEV;
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index ba8342fef799..119efaf5808a 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -32,7 +32,7 @@
32#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/smsc911x.h> 34#include <linux/smsc911x.h>
35#include <linux/i2c/at24.h> 35#include <linux/platform_data/at24.h>
36#include <linux/usb/phy.h> 36#include <linux/usb/phy.h>
37 37
38#include <asm/mach-types.h> 38#include <asm/mach-types.h>
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index 03a2829beb8e..3b05aea56d1f 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -381,6 +381,42 @@ static struct clk_hw_omap dpll4_ck_hw = {
381 381
382DEFINE_STRUCT_CLK(dpll4_ck, dpll3_ck_parent_names, dpll4_ck_ops); 382DEFINE_STRUCT_CLK(dpll4_ck, dpll3_ck_parent_names, dpll4_ck_ops);
383 383
384static const struct clk_div_table dpll4_mx_ck_div_table[] = {
385 { .div = 1, .val = 1 },
386 { .div = 2, .val = 2 },
387 { .div = 3, .val = 3 },
388 { .div = 4, .val = 4 },
389 { .div = 5, .val = 5 },
390 { .div = 6, .val = 6 },
391 { .div = 7, .val = 7 },
392 { .div = 8, .val = 8 },
393 { .div = 9, .val = 9 },
394 { .div = 10, .val = 10 },
395 { .div = 11, .val = 11 },
396 { .div = 12, .val = 12 },
397 { .div = 13, .val = 13 },
398 { .div = 14, .val = 14 },
399 { .div = 15, .val = 15 },
400 { .div = 16, .val = 16 },
401 { .div = 17, .val = 17 },
402 { .div = 18, .val = 18 },
403 { .div = 19, .val = 19 },
404 { .div = 20, .val = 20 },
405 { .div = 21, .val = 21 },
406 { .div = 22, .val = 22 },
407 { .div = 23, .val = 23 },
408 { .div = 24, .val = 24 },
409 { .div = 25, .val = 25 },
410 { .div = 26, .val = 26 },
411 { .div = 27, .val = 27 },
412 { .div = 28, .val = 28 },
413 { .div = 29, .val = 29 },
414 { .div = 30, .val = 30 },
415 { .div = 31, .val = 31 },
416 { .div = 32, .val = 32 },
417 { .div = 0 },
418};
419
384DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0, 420DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0,
385 OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), 421 OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
386 OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH, 422 OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH,
@@ -524,10 +560,10 @@ static const struct clksel_rate clkout2_src_54m_rates[] = {
524 { .div = 0 } 560 { .div = 0 }
525}; 561};
526 562
527DEFINE_CLK_DIVIDER(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0, 563DEFINE_CLK_DIVIDER_TABLE(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0,
528 OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), 564 OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
529 OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH, 565 OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH,
530 CLK_DIVIDER_ONE_BASED, NULL); 566 0, dpll4_mx_ck_div_table, NULL);
531 567
532static struct clk dpll4_m3x2_ck; 568static struct clk dpll4_m3x2_ck;
533 569
@@ -847,10 +883,10 @@ static struct clk dpll3_m3x2_ck_3630 = {
847 883
848DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1); 884DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1);
849 885
850DEFINE_CLK_DIVIDER(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0, 886DEFINE_CLK_DIVIDER_TABLE(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0,
851 OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), 887 OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
852 OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH, 888 OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH,
853 CLK_DIVIDER_ONE_BASED, NULL); 889 0, dpll4_mx_ck_div_table, NULL);
854 890
855static struct clk dpll4_m4x2_ck; 891static struct clk dpll4_m4x2_ck;
856 892
@@ -869,7 +905,8 @@ static struct clk_hw_omap dpll4_m4x2_ck_hw = {
869 .clkdm_name = "dpll4_clkdm", 905 .clkdm_name = "dpll4_clkdm",
870}; 906};
871 907
872DEFINE_STRUCT_CLK(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names, dpll4_m5x2_ck_ops); 908DEFINE_STRUCT_CLK_FLAGS(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names,
909 dpll4_m5x2_ck_ops, CLK_SET_RATE_PARENT);
873 910
874static struct clk dpll4_m4x2_ck_3630 = { 911static struct clk dpll4_m4x2_ck_3630 = {
875 .name = "dpll4_m4x2_ck", 912 .name = "dpll4_m4x2_ck",
@@ -877,6 +914,7 @@ static struct clk dpll4_m4x2_ck_3630 = {
877 .parent_names = dpll4_m4x2_ck_parent_names, 914 .parent_names = dpll4_m4x2_ck_parent_names,
878 .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names), 915 .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names),
879 .ops = &dpll4_m5x2_ck_3630_ops, 916 .ops = &dpll4_m5x2_ck_3630_ops,
917 .flags = CLK_SET_RATE_PARENT,
880}; 918};
881 919
882DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0, 920DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0,
@@ -968,8 +1006,9 @@ static struct clk_hw_omap dss1_alwon_fck_3430es1_hw = {
968 .clkdm_name = "dss_clkdm", 1006 .clkdm_name = "dss_clkdm",
969}; 1007};
970 1008
971DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es1, dss1_alwon_fck_3430es1_parent_names, 1009DEFINE_STRUCT_CLK_FLAGS(dss1_alwon_fck_3430es1,
972 aes2_ick_ops); 1010 dss1_alwon_fck_3430es1_parent_names, aes2_ick_ops,
1011 CLK_SET_RATE_PARENT);
973 1012
974static struct clk dss1_alwon_fck_3430es2; 1013static struct clk dss1_alwon_fck_3430es2;
975 1014
@@ -983,8 +1022,9 @@ static struct clk_hw_omap dss1_alwon_fck_3430es2_hw = {
983 .clkdm_name = "dss_clkdm", 1022 .clkdm_name = "dss_clkdm",
984}; 1023};
985 1024
986DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es2, dss1_alwon_fck_3430es1_parent_names, 1025DEFINE_STRUCT_CLK_FLAGS(dss1_alwon_fck_3430es2,
987 aes2_ick_ops); 1026 dss1_alwon_fck_3430es1_parent_names, aes2_ick_ops,
1027 CLK_SET_RATE_PARENT);
988 1028
989static struct clk dss2_alwon_fck; 1029static struct clk dss2_alwon_fck;
990 1030
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
index b237950eb8a3..ec0dc0b1755e 100644
--- a/arch/arm/mach-omap2/cclock44xx_data.c
+++ b/arch/arm/mach-omap2/cclock44xx_data.c
@@ -830,7 +830,8 @@ DEFINE_CLK_GATE(dss_tv_clk, "extalt_clkin_ck", &extalt_clkin_ck, 0x0,
830 OMAP4430_CM_DSS_DSS_CLKCTRL, 830 OMAP4430_CM_DSS_DSS_CLKCTRL,
831 OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, 0x0, NULL); 831 OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, 0x0, NULL);
832 832
833DEFINE_CLK_GATE(dss_dss_clk, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, 0x0, 833DEFINE_CLK_GATE(dss_dss_clk, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck,
834 CLK_SET_RATE_PARENT,
834 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_DSSCLK_SHIFT, 835 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_DSSCLK_SHIFT,
835 0x0, NULL); 836 0x0, NULL);
836 837
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index f7644febee81..e30ef6797c63 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -299,7 +299,6 @@ struct omap_sdrc_params;
299extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 299extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
300 struct omap_sdrc_params *sdrc_cs1); 300 struct omap_sdrc_params *sdrc_cs1);
301struct omap2_hsmmc_info; 301struct omap2_hsmmc_info;
302extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers);
303extern void omap_reserve(void); 302extern void omap_reserve(void);
304 303
305struct omap_hwmod; 304struct omap_hwmod;
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index a4e536b11ec9..58347bb874a0 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -32,7 +32,6 @@
32 32
33#include "soc.h" 33#include "soc.h"
34#include "iomap.h" 34#include "iomap.h"
35#include "mux.h"
36#include "control.h" 35#include "control.h"
37#include "display.h" 36#include "display.h"
38#include "prm.h" 37#include "prm.h"
@@ -102,90 +101,13 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = {
102 { "dss_hdmi", "omapdss_hdmi", -1 }, 101 { "dss_hdmi", "omapdss_hdmi", -1 },
103}; 102};
104 103
105static void __init omap4_tpd12s015_mux_pads(void)
106{
107 omap_mux_init_signal("hdmi_cec",
108 OMAP_PIN_INPUT_PULLUP);
109 omap_mux_init_signal("hdmi_ddc_scl",
110 OMAP_PIN_INPUT_PULLUP);
111 omap_mux_init_signal("hdmi_ddc_sda",
112 OMAP_PIN_INPUT_PULLUP);
113}
114
115static void __init omap4_hdmi_mux_pads(enum omap_hdmi_flags flags)
116{
117 u32 reg;
118 u16 control_i2c_1;
119
120 /*
121 * CONTROL_I2C_1: HDMI_DDC_SDA_PULLUPRESX (bit 28) and
122 * HDMI_DDC_SCL_PULLUPRESX (bit 24) are set to disable
123 * internal pull up resistor.
124 */
125 if (flags & OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP) {
126 control_i2c_1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_I2C_1;
127 reg = omap4_ctrl_pad_readl(control_i2c_1);
128 reg |= (OMAP4_HDMI_DDC_SDA_PULLUPRESX_MASK |
129 OMAP4_HDMI_DDC_SCL_PULLUPRESX_MASK);
130 omap4_ctrl_pad_writel(reg, control_i2c_1);
131 }
132}
133
134static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
135{
136 u32 enable_mask, enable_shift;
137 u32 pipd_mask, pipd_shift;
138 u32 reg;
139
140 if (dsi_id == 0) {
141 enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
142 enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
143 pipd_mask = OMAP4_DSI1_PIPD_MASK;
144 pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
145 } else if (dsi_id == 1) {
146 enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
147 enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
148 pipd_mask = OMAP4_DSI2_PIPD_MASK;
149 pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
150 } else {
151 return -ENODEV;
152 }
153
154 reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
155
156 reg &= ~enable_mask;
157 reg &= ~pipd_mask;
158
159 reg |= (lanes << enable_shift) & enable_mask;
160 reg |= (lanes << pipd_shift) & pipd_mask;
161
162 omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
163
164 return 0;
165}
166
167int __init omap_hdmi_init(enum omap_hdmi_flags flags)
168{
169 if (cpu_is_omap44xx()) {
170 omap4_hdmi_mux_pads(flags);
171 omap4_tpd12s015_mux_pads();
172 }
173
174 return 0;
175}
176
177static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) 104static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
178{ 105{
179 if (cpu_is_omap44xx())
180 return omap4_dsi_mux_pads(dsi_id, lane_mask);
181
182 return 0; 106 return 0;
183} 107}
184 108
185static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) 109static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
186{ 110{
187 if (cpu_is_omap44xx())
188 omap4_dsi_mux_pads(dsi_id, 0);
189} 111}
190 112
191static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput) 113static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput)
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c
index 365bfd3d9c68..dadccc91488c 100644
--- a/arch/arm/mach-omap2/dss-common.c
+++ b/arch/arm/mach-omap2/dss-common.c
@@ -223,7 +223,7 @@ void __init omap_4430sdp_display_init_of(void)
223static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = { 223static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = {
224 .name = "dvi", 224 .name = "dvi",
225 .source = "tfp410.0", 225 .source = "tfp410.0",
226 .i2c_bus_num = 3, 226 .i2c_bus_num = 2,
227}; 227};
228 228
229static struct platform_device omap3_igep2_dvi_connector_device = { 229static struct platform_device omap3_igep2_dvi_connector_device = {
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c
index ef990118d32b..2757504a13c4 100644
--- a/arch/arm/mach-omap2/gpmc-smsc911x.c
+++ b/arch/arm/mach-omap2/gpmc-smsc911x.c
@@ -83,7 +83,7 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *gpmc_cfg)
83 pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id, 83 pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id,
84 gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources), 84 gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources),
85 &gpmc_smsc911x_config, sizeof(gpmc_smsc911x_config)); 85 &gpmc_smsc911x_config, sizeof(gpmc_smsc911x_config));
86 if (!pdev) { 86 if (IS_ERR(pdev)) {
87 pr_err("Unable to register platform device\n"); 87 pr_err("Unable to register platform device\n");
88 gpio_free(gpmc_cfg->gpio_reset); 88 gpio_free(gpmc_cfg->gpio_reset);
89 goto free2; 89 goto free2;
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 81de56251955..d24926e6340f 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1502,6 +1502,22 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
1502 } 1502 }
1503 1503
1504 /* 1504 /*
1505 * For some GPMC devices we still need to rely on the bootloader
1506 * timings because the devices can be connected via FPGA. So far
1507 * the list is smc91x on the omap2 SDP boards, and 8250 on zooms.
1508 * REVISIT: Add timing support from slls644g.pdf and from the
1509 * lan91c96 manual.
1510 */
1511 if (of_device_is_compatible(child, "ns16550a") ||
1512 of_device_is_compatible(child, "smsc,lan91c94") ||
1513 of_device_is_compatible(child, "smsc,lan91c111")) {
1514 dev_warn(&pdev->dev,
1515 "%s using bootloader timings on CS%d\n",
1516 child->name, cs);
1517 goto no_timings;
1518 }
1519
1520 /*
1505 * FIXME: gpmc_cs_request() will map the CS to an arbitary 1521 * FIXME: gpmc_cs_request() will map the CS to an arbitary
1506 * location in the gpmc address space. When booting with 1522 * location in the gpmc address space. When booting with
1507 * device-tree we want the NOR flash to be mapped to the 1523 * device-tree we want the NOR flash to be mapped to the
@@ -1529,6 +1545,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
1529 gpmc_read_timings_dt(child, &gpmc_t); 1545 gpmc_read_timings_dt(child, &gpmc_t);
1530 gpmc_cs_set_timings(cs, &gpmc_t); 1546 gpmc_cs_set_timings(cs, &gpmc_t);
1531 1547
1548no_timings:
1532 if (of_platform_device_create(child, NULL, &pdev->dev)) 1549 if (of_platform_device_create(child, NULL, &pdev->dev))
1533 return 0; 1550 return 0;
1534 1551
@@ -1541,42 +1558,6 @@ err:
1541 return ret; 1558 return ret;
1542} 1559}
1543 1560
1544/*
1545 * REVISIT: Add timing support from slls644g.pdf
1546 */
1547static int gpmc_probe_8250(struct platform_device *pdev,
1548 struct device_node *child)
1549{
1550 struct resource res;
1551 unsigned long base;
1552 int ret, cs;
1553
1554 if (of_property_read_u32(child, "reg", &cs) < 0) {
1555 dev_err(&pdev->dev, "%s has no 'reg' property\n",
1556 child->full_name);
1557 return -ENODEV;
1558 }
1559
1560 if (of_address_to_resource(child, 0, &res) < 0) {
1561 dev_err(&pdev->dev, "%s has malformed 'reg' property\n",
1562 child->full_name);
1563 return -ENODEV;
1564 }
1565
1566 ret = gpmc_cs_request(cs, resource_size(&res), &base);
1567 if (ret < 0) {
1568 dev_err(&pdev->dev, "cannot request GPMC CS %d\n", cs);
1569 return ret;
1570 }
1571
1572 if (of_platform_device_create(child, NULL, &pdev->dev))
1573 return 0;
1574
1575 dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
1576
1577 return -ENODEV;
1578}
1579
1580static int gpmc_probe_dt(struct platform_device *pdev) 1561static int gpmc_probe_dt(struct platform_device *pdev)
1581{ 1562{
1582 int ret; 1563 int ret;
@@ -1618,10 +1599,9 @@ static int gpmc_probe_dt(struct platform_device *pdev)
1618 else if (of_node_cmp(child->name, "onenand") == 0) 1599 else if (of_node_cmp(child->name, "onenand") == 0)
1619 ret = gpmc_probe_onenand_child(pdev, child); 1600 ret = gpmc_probe_onenand_child(pdev, child);
1620 else if (of_node_cmp(child->name, "ethernet") == 0 || 1601 else if (of_node_cmp(child->name, "ethernet") == 0 ||
1621 of_node_cmp(child->name, "nor") == 0) 1602 of_node_cmp(child->name, "nor") == 0 ||
1603 of_node_cmp(child->name, "uart") == 0)
1622 ret = gpmc_probe_generic_child(pdev, child); 1604 ret = gpmc_probe_generic_child(pdev, child);
1623 else if (of_node_cmp(child->name, "8250") == 0)
1624 ret = gpmc_probe_8250(pdev, child);
1625 1605
1626 if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", 1606 if (WARN(ret < 0, "%s: probing gpmc child %s failed\n",
1627 __func__, child->full_name)) 1607 __func__, child->full_name))
diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h
index 8cc7d331437d..3e97c6c8ecf1 100644
--- a/arch/arm/mach-omap2/omap-secure.h
+++ b/arch/arm/mach-omap2/omap-secure.h
@@ -76,6 +76,13 @@ static inline void omap_barrier_reserve_memblock(void)
76{ } 76{ }
77#endif 77#endif
78 78
79#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
79void set_cntfreq(void); 80void set_cntfreq(void);
81#else
82static inline void set_cntfreq(void)
83{
84}
85#endif
86
80#endif /* __ASSEMBLER__ */ 87#endif /* __ASSEMBLER__ */
81#endif /* OMAP_ARCH_OMAP_SECURE_H */ 88#endif /* OMAP_ARCH_OMAP_SECURE_H */
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 57911430324e..b39efd46abf9 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -35,7 +35,6 @@
35#include "iomap.h" 35#include "iomap.h"
36#include "common.h" 36#include "common.h"
37#include "mmc.h" 37#include "mmc.h"
38#include "hsmmc.h"
39#include "prminst44xx.h" 38#include "prminst44xx.h"
40#include "prcm_mpu44xx.h" 39#include "prcm_mpu44xx.h"
41#include "omap4-sar-layout.h" 40#include "omap4-sar-layout.h"
@@ -284,59 +283,3 @@ skip_errata_init:
284 omap_wakeupgen_init(); 283 omap_wakeupgen_init();
285 irqchip_init(); 284 irqchip_init();
286} 285}
287
288#if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
289static int omap4_twl6030_hsmmc_late_init(struct device *dev)
290{
291 int irq = 0;
292 struct platform_device *pdev = container_of(dev,
293 struct platform_device, dev);
294 struct omap_mmc_platform_data *pdata = dev->platform_data;
295
296 /* Setting MMC1 Card detect Irq */
297 if (pdev->id == 0) {
298 irq = twl6030_mmc_card_detect_config();
299 if (irq < 0) {
300 dev_err(dev, "%s: Error card detect config(%d)\n",
301 __func__, irq);
302 return irq;
303 }
304 pdata->slots[0].card_detect_irq = irq;
305 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
306 }
307 return 0;
308}
309
310static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
311{
312 struct omap_mmc_platform_data *pdata;
313
314 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
315 if (!dev) {
316 pr_err("Failed %s\n", __func__);
317 return;
318 }
319 pdata = dev->platform_data;
320 pdata->init = omap4_twl6030_hsmmc_late_init;
321}
322
323int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
324{
325 struct omap2_hsmmc_info *c;
326
327 omap_hsmmc_init(controllers);
328 for (c = controllers; c->mmc; c++) {
329 /* pdev can be null if CONFIG_MMC_OMAP_HS is not set */
330 if (!c->pdev)
331 continue;
332 omap4_twl6030_hsmmc_set_late_init(&c->pdev->dev);
333 }
334
335 return 0;
336}
337#else
338int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
339{
340 return 0;
341}
342#endif
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index b69dd9abb50a..e0a398cf28d8 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -183,6 +183,10 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
183odbfd_exit1: 183odbfd_exit1:
184 kfree(hwmods); 184 kfree(hwmods);
185odbfd_exit: 185odbfd_exit:
186 /* if data/we are at fault.. load up a fail handler */
187 if (ret)
188 pdev->dev.pm_domain = &omap_device_fail_pm_domain;
189
186 return ret; 190 return ret;
187} 191}
188 192
@@ -604,6 +608,19 @@ static int _od_runtime_resume(struct device *dev)
604 608
605 return pm_generic_runtime_resume(dev); 609 return pm_generic_runtime_resume(dev);
606} 610}
611
612static int _od_fail_runtime_suspend(struct device *dev)
613{
614 dev_warn(dev, "%s: FIXME: missing hwmod/omap_dev info\n", __func__);
615 return -ENODEV;
616}
617
618static int _od_fail_runtime_resume(struct device *dev)
619{
620 dev_warn(dev, "%s: FIXME: missing hwmod/omap_dev info\n", __func__);
621 return -ENODEV;
622}
623
607#endif 624#endif
608 625
609#ifdef CONFIG_SUSPEND 626#ifdef CONFIG_SUSPEND
@@ -621,6 +638,7 @@ static int _od_suspend_noirq(struct device *dev)
621 638
622 if (!ret && !pm_runtime_status_suspended(dev)) { 639 if (!ret && !pm_runtime_status_suspended(dev)) {
623 if (pm_generic_runtime_suspend(dev) == 0) { 640 if (pm_generic_runtime_suspend(dev) == 0) {
641 pm_runtime_set_suspended(dev);
624 omap_device_idle(pdev); 642 omap_device_idle(pdev);
625 od->flags |= OMAP_DEVICE_SUSPENDED; 643 od->flags |= OMAP_DEVICE_SUSPENDED;
626 } 644 }
@@ -634,10 +652,18 @@ static int _od_resume_noirq(struct device *dev)
634 struct platform_device *pdev = to_platform_device(dev); 652 struct platform_device *pdev = to_platform_device(dev);
635 struct omap_device *od = to_omap_device(pdev); 653 struct omap_device *od = to_omap_device(pdev);
636 654
637 if ((od->flags & OMAP_DEVICE_SUSPENDED) && 655 if (od->flags & OMAP_DEVICE_SUSPENDED) {
638 !pm_runtime_status_suspended(dev)) {
639 od->flags &= ~OMAP_DEVICE_SUSPENDED; 656 od->flags &= ~OMAP_DEVICE_SUSPENDED;
640 omap_device_enable(pdev); 657 omap_device_enable(pdev);
658 /*
659 * XXX: we run before core runtime pm has resumed itself. At
660 * this point in time, we just restore the runtime pm state and
661 * considering symmetric operations in resume, we donot expect
662 * to fail. If we failed, something changed in core runtime_pm
663 * framework OR some device driver messed things up, hence, WARN
664 */
665 WARN(pm_runtime_set_active(dev),
666 "Could not set %s runtime state active\n", dev_name(dev));
641 pm_generic_runtime_resume(dev); 667 pm_generic_runtime_resume(dev);
642 } 668 }
643 669
@@ -648,6 +674,13 @@ static int _od_resume_noirq(struct device *dev)
648#define _od_resume_noirq NULL 674#define _od_resume_noirq NULL
649#endif 675#endif
650 676
677struct dev_pm_domain omap_device_fail_pm_domain = {
678 .ops = {
679 SET_RUNTIME_PM_OPS(_od_fail_runtime_suspend,
680 _od_fail_runtime_resume, NULL)
681 }
682};
683
651struct dev_pm_domain omap_device_pm_domain = { 684struct dev_pm_domain omap_device_pm_domain = {
652 .ops = { 685 .ops = {
653 SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, 686 SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
diff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h
index 17ca1aec2710..78c02b355179 100644
--- a/arch/arm/mach-omap2/omap_device.h
+++ b/arch/arm/mach-omap2/omap_device.h
@@ -29,6 +29,7 @@
29#include "omap_hwmod.h" 29#include "omap_hwmod.h"
30 30
31extern struct dev_pm_domain omap_device_pm_domain; 31extern struct dev_pm_domain omap_device_pm_domain;
32extern struct dev_pm_domain omap_device_fail_pm_domain;
32 33
33/* omap_device._state values */ 34/* omap_device._state values */
34#define OMAP_DEVICE_STATE_UNKNOWN 0 35#define OMAP_DEVICE_STATE_UNKNOWN 0
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e3f0ecaf87dd..8a1b5e0bad40 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -399,7 +399,7 @@ static int _set_clockactivity(struct omap_hwmod *oh, u8 clockact, u32 *v)
399} 399}
400 400
401/** 401/**
402 * _set_softreset: set OCP_SYSCONFIG.CLOCKACTIVITY bits in @v 402 * _set_softreset: set OCP_SYSCONFIG.SOFTRESET bit in @v
403 * @oh: struct omap_hwmod * 403 * @oh: struct omap_hwmod *
404 * @v: pointer to register contents to modify 404 * @v: pointer to register contents to modify
405 * 405 *
@@ -427,6 +427,36 @@ static int _set_softreset(struct omap_hwmod *oh, u32 *v)
427} 427}
428 428
429/** 429/**
430 * _clear_softreset: clear OCP_SYSCONFIG.SOFTRESET bit in @v
431 * @oh: struct omap_hwmod *
432 * @v: pointer to register contents to modify
433 *
434 * Clear the SOFTRESET bit in @v for hwmod @oh. Returns -EINVAL upon
435 * error or 0 upon success.
436 */
437static int _clear_softreset(struct omap_hwmod *oh, u32 *v)
438{
439 u32 softrst_mask;
440
441 if (!oh->class->sysc ||
442 !(oh->class->sysc->sysc_flags & SYSC_HAS_SOFTRESET))
443 return -EINVAL;
444
445 if (!oh->class->sysc->sysc_fields) {
446 WARN(1,
447 "omap_hwmod: %s: sysc_fields absent for sysconfig class\n",
448 oh->name);
449 return -EINVAL;
450 }
451
452 softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);
453
454 *v &= ~softrst_mask;
455
456 return 0;
457}
458
459/**
430 * _wait_softreset_complete - wait for an OCP softreset to complete 460 * _wait_softreset_complete - wait for an OCP softreset to complete
431 * @oh: struct omap_hwmod * to wait on 461 * @oh: struct omap_hwmod * to wait on
432 * 462 *
@@ -785,6 +815,7 @@ static int _init_interface_clks(struct omap_hwmod *oh)
785 pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n", 815 pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n",
786 oh->name, os->clk); 816 oh->name, os->clk);
787 ret = -EINVAL; 817 ret = -EINVAL;
818 continue;
788 } 819 }
789 os->_clk = c; 820 os->_clk = c;
790 /* 821 /*
@@ -821,6 +852,7 @@ static int _init_opt_clks(struct omap_hwmod *oh)
821 pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n", 852 pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n",
822 oh->name, oc->clk); 853 oh->name, oc->clk);
823 ret = -EINVAL; 854 ret = -EINVAL;
855 continue;
824 } 856 }
825 oc->_clk = c; 857 oc->_clk = c;
826 /* 858 /*
@@ -1911,6 +1943,12 @@ static int _ocp_softreset(struct omap_hwmod *oh)
1911 ret = _set_softreset(oh, &v); 1943 ret = _set_softreset(oh, &v);
1912 if (ret) 1944 if (ret)
1913 goto dis_opt_clks; 1945 goto dis_opt_clks;
1946
1947 _write_sysconfig(v, oh);
1948 ret = _clear_softreset(oh, &v);
1949 if (ret)
1950 goto dis_opt_clks;
1951
1914 _write_sysconfig(v, oh); 1952 _write_sysconfig(v, oh);
1915 1953
1916 if (oh->class->sysc->srst_udelay) 1954 if (oh->class->sysc->srst_udelay)
@@ -2326,38 +2364,80 @@ static int _shutdown(struct omap_hwmod *oh)
2326 return 0; 2364 return 0;
2327} 2365}
2328 2366
2367static int of_dev_find_hwmod(struct device_node *np,
2368 struct omap_hwmod *oh)
2369{
2370 int count, i, res;
2371 const char *p;
2372
2373 count = of_property_count_strings(np, "ti,hwmods");
2374 if (count < 1)
2375 return -ENODEV;
2376
2377 for (i = 0; i < count; i++) {
2378 res = of_property_read_string_index(np, "ti,hwmods",
2379 i, &p);
2380 if (res)
2381 continue;
2382 if (!strcmp(p, oh->name)) {
2383 pr_debug("omap_hwmod: dt %s[%i] uses hwmod %s\n",
2384 np->name, i, oh->name);
2385 return i;
2386 }
2387 }
2388
2389 return -ENODEV;
2390}
2391
2329/** 2392/**
2330 * of_dev_hwmod_lookup - look up needed hwmod from dt blob 2393 * of_dev_hwmod_lookup - look up needed hwmod from dt blob
2331 * @np: struct device_node * 2394 * @np: struct device_node *
2332 * @oh: struct omap_hwmod * 2395 * @oh: struct omap_hwmod *
2396 * @index: index of the entry found
2397 * @found: struct device_node * found or NULL
2333 * 2398 *
2334 * Parse the dt blob and find out needed hwmod. Recursive function is 2399 * Parse the dt blob and find out needed hwmod. Recursive function is
2335 * implemented to take care hierarchical dt blob parsing. 2400 * implemented to take care hierarchical dt blob parsing.
2336 * Return: The device node on success or NULL on failure. 2401 * Return: Returns 0 on success, -ENODEV when not found.
2337 */ 2402 */
2338static struct device_node *of_dev_hwmod_lookup(struct device_node *np, 2403static int of_dev_hwmod_lookup(struct device_node *np,
2339 struct omap_hwmod *oh) 2404 struct omap_hwmod *oh,
2405 int *index,
2406 struct device_node **found)
2340{ 2407{
2341 struct device_node *np0 = NULL, *np1 = NULL; 2408 struct device_node *np0 = NULL;
2342 const char *p; 2409 int res;
2410
2411 res = of_dev_find_hwmod(np, oh);
2412 if (res >= 0) {
2413 *found = np;
2414 *index = res;
2415 return 0;
2416 }
2343 2417
2344 for_each_child_of_node(np, np0) { 2418 for_each_child_of_node(np, np0) {
2345 if (of_find_property(np0, "ti,hwmods", NULL)) { 2419 struct device_node *fc;
2346 p = of_get_property(np0, "ti,hwmods", NULL); 2420 int i;
2347 if (!strcmp(p, oh->name)) 2421
2348 return np0; 2422 res = of_dev_hwmod_lookup(np0, oh, &i, &fc);
2349 np1 = of_dev_hwmod_lookup(np0, oh); 2423 if (res == 0) {
2350 if (np1) 2424 *found = fc;
2351 return np1; 2425 *index = i;
2426 return 0;
2352 } 2427 }
2353 } 2428 }
2354 return NULL; 2429
2430 *found = NULL;
2431 *index = 0;
2432
2433 return -ENODEV;
2355} 2434}
2356 2435
2357/** 2436/**
2358 * _init_mpu_rt_base - populate the virtual address for a hwmod 2437 * _init_mpu_rt_base - populate the virtual address for a hwmod
2359 * @oh: struct omap_hwmod * to locate the virtual address 2438 * @oh: struct omap_hwmod * to locate the virtual address
2360 * @data: (unused, caller should pass NULL) 2439 * @data: (unused, caller should pass NULL)
2440 * @index: index of the reg entry iospace in device tree
2361 * @np: struct device_node * of the IP block's device node in the DT data 2441 * @np: struct device_node * of the IP block's device node in the DT data
2362 * 2442 *
2363 * Cache the virtual address used by the MPU to access this IP block's 2443 * Cache the virtual address used by the MPU to access this IP block's
@@ -2368,7 +2448,7 @@ static struct device_node *of_dev_hwmod_lookup(struct device_node *np,
2368 * -ENXIO on absent or invalid register target address space. 2448 * -ENXIO on absent or invalid register target address space.
2369 */ 2449 */
2370static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, 2450static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
2371 struct device_node *np) 2451 int index, struct device_node *np)
2372{ 2452{
2373 struct omap_hwmod_addr_space *mem; 2453 struct omap_hwmod_addr_space *mem;
2374 void __iomem *va_start = NULL; 2454 void __iomem *va_start = NULL;
@@ -2390,13 +2470,17 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
2390 if (!np) 2470 if (!np)
2391 return -ENXIO; 2471 return -ENXIO;
2392 2472
2393 va_start = of_iomap(np, oh->mpu_rt_idx); 2473 va_start = of_iomap(np, index + oh->mpu_rt_idx);
2394 } else { 2474 } else {
2395 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start); 2475 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
2396 } 2476 }
2397 2477
2398 if (!va_start) { 2478 if (!va_start) {
2399 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); 2479 if (mem)
2480 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name);
2481 else
2482 pr_err("omap_hwmod: %s: Missing dt reg%i for %s\n",
2483 oh->name, index, np->full_name);
2400 return -ENXIO; 2484 return -ENXIO;
2401 } 2485 }
2402 2486
@@ -2422,17 +2506,29 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
2422 */ 2506 */
2423static int __init _init(struct omap_hwmod *oh, void *data) 2507static int __init _init(struct omap_hwmod *oh, void *data)
2424{ 2508{
2425 int r; 2509 int r, index;
2426 struct device_node *np = NULL; 2510 struct device_node *np = NULL;
2427 2511
2428 if (oh->_state != _HWMOD_STATE_REGISTERED) 2512 if (oh->_state != _HWMOD_STATE_REGISTERED)
2429 return 0; 2513 return 0;
2430 2514
2431 if (of_have_populated_dt()) 2515 if (of_have_populated_dt()) {
2432 np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh); 2516 struct device_node *bus;
2517
2518 bus = of_find_node_by_name(NULL, "ocp");
2519 if (!bus)
2520 return -ENODEV;
2521
2522 r = of_dev_hwmod_lookup(bus, oh, &index, &np);
2523 if (r)
2524 pr_debug("omap_hwmod: %s missing dt data\n", oh->name);
2525 else if (np && index)
2526 pr_warn("omap_hwmod: %s using broken dt data from %s\n",
2527 oh->name, np->name);
2528 }
2433 2529
2434 if (oh->class->sysc) { 2530 if (oh->class->sysc) {
2435 r = _init_mpu_rt_base(oh, NULL, np); 2531 r = _init_mpu_rt_base(oh, NULL, index, np);
2436 if (r < 0) { 2532 if (r < 0) {
2437 WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n", 2533 WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n",
2438 oh->name); 2534 oh->name);
@@ -3169,6 +3265,11 @@ int omap_hwmod_softreset(struct omap_hwmod *oh)
3169 goto error; 3265 goto error;
3170 _write_sysconfig(v, oh); 3266 _write_sysconfig(v, oh);
3171 3267
3268 ret = _clear_softreset(oh, &v);
3269 if (ret)
3270 goto error;
3271 _write_sysconfig(v, oh);
3272
3172error: 3273error:
3173 return ret; 3274 return ret;
3174} 3275}
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 9e56fabd7fa3..d33742908f97 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1943,7 +1943,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_usb_host_hs_sysc = {
1943 .syss_offs = 0x0014, 1943 .syss_offs = 0x0014,
1944 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY | 1944 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
1945 SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP | 1945 SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
1946 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 1946 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
1947 SYSS_HAS_RESET_STATUS),
1947 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1948 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1948 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), 1949 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1949 .sysc_fields = &omap_hwmod_sysc_type1, 1950 .sysc_fields = &omap_hwmod_sysc_type1,
@@ -2021,15 +2022,7 @@ static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
2021 * hence HWMOD_SWSUP_MSTANDBY 2022 * hence HWMOD_SWSUP_MSTANDBY
2022 */ 2023 */
2023 2024
2024 /* 2025 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
2025 * During system boot; If the hwmod framework resets the module
2026 * the module will have smart idle settings; which can lead to deadlock
2027 * (above Errata Id:i660); so, dont reset the module during boot;
2028 * Use HWMOD_INIT_NO_RESET.
2029 */
2030
2031 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY |
2032 HWMOD_INIT_NO_RESET,
2033}; 2026};
2034 2027
2035/* 2028/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 1e5b12cb8246..3318cae96e7d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2937,7 +2937,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_usb_host_hs_sysc = {
2937 .sysc_offs = 0x0010, 2937 .sysc_offs = 0x0010,
2938 .syss_offs = 0x0014, 2938 .syss_offs = 0x0014,
2939 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE | 2939 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
2940 SYSC_HAS_SOFTRESET), 2940 SYSC_HAS_SOFTRESET | SYSC_HAS_RESET_STATUS),
2941 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 2941 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2942 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | 2942 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
2943 MSTANDBY_SMART | MSTANDBY_SMART_WKUP), 2943 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
@@ -3001,15 +3001,7 @@ static struct omap_hwmod omap44xx_usb_host_hs_hwmod = {
3001 * hence HWMOD_SWSUP_MSTANDBY 3001 * hence HWMOD_SWSUP_MSTANDBY
3002 */ 3002 */
3003 3003
3004 /* 3004 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
3005 * During system boot; If the hwmod framework resets the module
3006 * the module will have smart idle settings; which can lead to deadlock
3007 * (above Errata Id:i660); so, dont reset the module during boot;
3008 * Use HWMOD_INIT_NO_RESET.
3009 */
3010
3011 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY |
3012 HWMOD_INIT_NO_RESET,
3013}; 3005};
3014 3006
3015/* 3007/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index 9e08d6994a0b..e297d6231c3a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -1544,7 +1544,8 @@ static struct omap_hwmod_class_sysconfig omap54xx_usb_host_hs_sysc = {
1544 .rev_offs = 0x0000, 1544 .rev_offs = 0x0000,
1545 .sysc_offs = 0x0010, 1545 .sysc_offs = 0x0010,
1546 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS | 1546 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
1547 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), 1547 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1548 SYSC_HAS_RESET_STATUS),
1548 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1549 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1549 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | 1550 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
1550 MSTANDBY_SMART | MSTANDBY_SMART_WKUP), 1551 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
@@ -1598,15 +1599,7 @@ static struct omap_hwmod omap54xx_usb_host_hs_hwmod = {
1598 * hence HWMOD_SWSUP_MSTANDBY 1599 * hence HWMOD_SWSUP_MSTANDBY
1599 */ 1600 */
1600 1601
1601 /* 1602 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
1602 * During system boot; If the hwmod framework resets the module
1603 * the module will have smart idle settings; which can lead to deadlock
1604 * (above Errata Id:i660); so, dont reset the module during boot;
1605 * Use HWMOD_INIT_NO_RESET.
1606 */
1607
1608 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY |
1609 HWMOD_INIT_NO_RESET,
1610 .main_clk = "l3init_60m_fclk", 1603 .main_clk = "l3init_60m_fclk",
1611 .prcm = { 1604 .prcm = {
1612 .omap4 = { 1605 .omap4 = {
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 10c71450cf63..39f020c982e8 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -139,6 +139,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
139 139
140static struct pdata_init pdata_quirks[] __initdata = { 140static struct pdata_init pdata_quirks[] __initdata = {
141#ifdef CONFIG_ARCH_OMAP3 141#ifdef CONFIG_ARCH_OMAP3
142 { "nokia,omap3-n900", hsmmc2_internal_input_clk, },
142 { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, 143 { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
143 { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, 144 { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
144 { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, 145 { "isee,omap3-igep0020", omap3_igep0020_legacy_init, },
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 93b80e5da8d4..1f3770a8a728 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -120,7 +120,7 @@ static void omap3_save_secure_ram_context(void)
120 * will hang the system. 120 * will hang the system.
121 */ 121 */
122 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); 122 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
123 ret = _omap_save_secure_sram((u32 *) 123 ret = _omap_save_secure_sram((u32 *)(unsigned long)
124 __pa(omap3_secure_ram_storage)); 124 __pa(omap3_secure_ram_storage));
125 pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); 125 pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
126 /* Following is for error tracking, it should not happen */ 126 /* Following is for error tracking, it should not happen */
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index e233dfcbc186..93a2a6e4260f 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -128,7 +128,8 @@ skip_voltdm:
128 for (i = 0; i < pwrdm->banks; i++) 128 for (i = 0; i < pwrdm->banks; i++)
129 pwrdm->ret_mem_off_counter[i] = 0; 129 pwrdm->ret_mem_off_counter[i] = 0;
130 130
131 arch_pwrdm->pwrdm_wait_transition(pwrdm); 131 if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition)
132 arch_pwrdm->pwrdm_wait_transition(pwrdm);
132 pwrdm->state = pwrdm_read_pwrst(pwrdm); 133 pwrdm->state = pwrdm_read_pwrst(pwrdm);
133 pwrdm->state_counter[pwrdm->state] = 1; 134 pwrdm->state_counter[pwrdm->state] = 1;
134 135
diff --git a/arch/arm/mach-omap2/prm44xx_54xx.h b/arch/arm/mach-omap2/prm44xx_54xx.h
index a085d9cc1f5d..8d95aa543ef5 100644
--- a/arch/arm/mach-omap2/prm44xx_54xx.h
+++ b/arch/arm/mach-omap2/prm44xx_54xx.h
@@ -42,7 +42,8 @@ extern u32 omap4_prm_vcvp_read(u8 offset);
42extern void omap4_prm_vcvp_write(u32 val, u8 offset); 42extern void omap4_prm_vcvp_write(u32 val, u8 offset);
43extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); 43extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
44 44
45#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) 45#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
46 defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
46void omap44xx_prm_reconfigure_io_chain(void); 47void omap44xx_prm_reconfigure_io_chain(void);
47#else 48#else
48static inline void omap44xx_prm_reconfigure_io_chain(void) 49static inline void omap44xx_prm_reconfigure_io_chain(void)
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index f9423493ed36..584439bfa59f 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -310,6 +310,7 @@ static struct platform_pwm_backlight_data cm_x300_backlight_data = {
310 .max_brightness = 100, 310 .max_brightness = 100,
311 .dft_brightness = 100, 311 .dft_brightness = 100,
312 .pwm_period_ns = 10000, 312 .pwm_period_ns = 10000,
313 .enable_gpio = -1,
313}; 314};
314 315
315static struct platform_device cm_x300_backlight_device = { 316static struct platform_device cm_x300_backlight_device = {
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 2d4a7b4d5d78..3aa264640c9d 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -189,6 +189,7 @@ static struct platform_pwm_backlight_data income_backlight_data = {
189 .max_brightness = 0x3ff, 189 .max_brightness = 0x3ff,
190 .dft_brightness = 0x1ff, 190 .dft_brightness = 0x1ff,
191 .pwm_period_ns = 1000000, 191 .pwm_period_ns = 1000000,
192 .enable_gpio = -1,
192}; 193};
193 194
194static struct platform_device income_backlight = { 195static struct platform_device income_backlight = {
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index fe2eb8394dff..ab93441e596e 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -54,6 +54,7 @@ static struct platform_pwm_backlight_data ezx_backlight_data = {
54 .max_brightness = 1023, 54 .max_brightness = 1023,
55 .dft_brightness = 1023, 55 .dft_brightness = 1023,
56 .pwm_period_ns = 78770, 56 .pwm_period_ns = 78770,
57 .enable_gpio = -1,
57}; 58};
58 59
59static struct platform_device ezx_backlight_device = { 60static struct platform_device ezx_backlight_device = {
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 133109ec7332..a7c30eb0c8db 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -561,6 +561,7 @@ static struct platform_pwm_backlight_data backlight_data = {
561 .max_brightness = 200, 561 .max_brightness = 200,
562 .dft_brightness = 100, 562 .dft_brightness = 100,
563 .pwm_period_ns = 30923, 563 .pwm_period_ns = 30923,
564 .enable_gpio = -1,
564}; 565};
565 566
566static struct platform_device backlight = { 567static struct platform_device backlight = {
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 1255ee00f3d1..9f6ec167902a 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -269,6 +269,7 @@ static struct platform_pwm_backlight_data lpd270_backlight_data = {
269 .max_brightness = 1, 269 .max_brightness = 1,
270 .dft_brightness = 1, 270 .dft_brightness = 1,
271 .pwm_period_ns = 78770, 271 .pwm_period_ns = 78770,
272 .enable_gpio = -1,
272}; 273};
273 274
274static struct platform_device lpd270_backlight_device = { 275static struct platform_device lpd270_backlight_device = {
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index f44532fc648b..fab30d666cc7 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -378,6 +378,7 @@ static struct platform_pwm_backlight_data backlight_data = {
378 .max_brightness = 272, 378 .max_brightness = 272,
379 .dft_brightness = 100, 379 .dft_brightness = 100,
380 .pwm_period_ns = 30923, 380 .pwm_period_ns = 30923,
381 .enable_gpio = -1,
381 .init = magician_backlight_init, 382 .init = magician_backlight_init,
382 .notify = magician_backlight_notify, 383 .notify = magician_backlight_notify,
383 .exit = magician_backlight_exit, 384 .exit = magician_backlight_exit,
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index dd70343c8708..08ccc0718f31 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -338,6 +338,7 @@ static struct platform_pwm_backlight_data mainstone_backlight_data = {
338 .max_brightness = 1023, 338 .max_brightness = 1023,
339 .dft_brightness = 1023, 339 .dft_brightness = 1023,
340 .pwm_period_ns = 78770, 340 .pwm_period_ns = 78770,
341 .enable_gpio = -1,
341}; 342};
342 343
343static struct platform_device mainstone_backlight_device = { 344static struct platform_device mainstone_backlight_device = {
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index acc9d3cc0762..f70583fee59f 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -186,6 +186,7 @@ static struct platform_pwm_backlight_data mioa701_backlight_data = {
186 .max_brightness = 100, 186 .max_brightness = 100,
187 .dft_brightness = 50, 187 .dft_brightness = 50,
188 .pwm_period_ns = 4000 * 1024, /* Fl = 250kHz */ 188 .pwm_period_ns = 4000 * 1024, /* Fl = 250kHz */
189 .enable_gpio = -1,
189}; 190};
190 191
191/* 192/*
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
index 17d4c53017ca..e54a296fb81f 100644
--- a/arch/arm/mach-pxa/palm27x.c
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -322,6 +322,7 @@ static struct platform_pwm_backlight_data palm27x_backlight_data = {
322 .max_brightness = 0xfe, 322 .max_brightness = 0xfe,
323 .dft_brightness = 0x7e, 323 .dft_brightness = 0x7e,
324 .pwm_period_ns = 3500 * 1024, 324 .pwm_period_ns = 3500 * 1024,
325 .enable_gpio = -1,
325 .init = palm27x_backlight_init, 326 .init = palm27x_backlight_init,
326 .notify = palm27x_backlight_notify, 327 .notify = palm27x_backlight_notify,
327 .exit = palm27x_backlight_exit, 328 .exit = palm27x_backlight_exit,
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 100b176f7e88..7691c974ca4b 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -166,45 +166,12 @@ static inline void palmtc_keys_init(void) {}
166 * Backlight 166 * Backlight
167 ******************************************************************************/ 167 ******************************************************************************/
168#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) 168#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
169static int palmtc_backlight_init(struct device *dev)
170{
171 int ret;
172
173 ret = gpio_request(GPIO_NR_PALMTC_BL_POWER, "BL POWER");
174 if (ret)
175 goto err;
176 ret = gpio_direction_output(GPIO_NR_PALMTC_BL_POWER, 1);
177 if (ret)
178 goto err2;
179
180 return 0;
181
182err2:
183 gpio_free(GPIO_NR_PALMTC_BL_POWER);
184err:
185 return ret;
186}
187
188static int palmtc_backlight_notify(struct device *dev, int brightness)
189{
190 /* backlight is on when GPIO16 AF0 is high */
191 gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness);
192 return brightness;
193}
194
195static void palmtc_backlight_exit(struct device *dev)
196{
197 gpio_free(GPIO_NR_PALMTC_BL_POWER);
198}
199
200static struct platform_pwm_backlight_data palmtc_backlight_data = { 169static struct platform_pwm_backlight_data palmtc_backlight_data = {
201 .pwm_id = 1, 170 .pwm_id = 1,
202 .max_brightness = PALMTC_MAX_INTENSITY, 171 .max_brightness = PALMTC_MAX_INTENSITY,
203 .dft_brightness = PALMTC_MAX_INTENSITY, 172 .dft_brightness = PALMTC_MAX_INTENSITY,
204 .pwm_period_ns = PALMTC_PERIOD_NS, 173 .pwm_period_ns = PALMTC_PERIOD_NS,
205 .init = palmtc_backlight_init, 174 .enable_gpio = GPIO_NR_PALMTC_BL_POWER,
206 .notify = palmtc_backlight_notify,
207 .exit = palmtc_backlight_exit,
208}; 175};
209 176
210static struct platform_device palmtc_backlight = { 177static struct platform_device palmtc_backlight = {
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 0742721ced2d..956fd24ee6fd 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -165,6 +165,7 @@ static struct platform_pwm_backlight_data palmte2_backlight_data = {
165 .max_brightness = PALMTE2_MAX_INTENSITY, 165 .max_brightness = PALMTE2_MAX_INTENSITY,
166 .dft_brightness = PALMTE2_MAX_INTENSITY, 166 .dft_brightness = PALMTE2_MAX_INTENSITY,
167 .pwm_period_ns = PALMTE2_PERIOD_NS, 167 .pwm_period_ns = PALMTE2_PERIOD_NS,
168 .enable_gpio = -1,
168 .init = palmte2_backlight_init, 169 .init = palmte2_backlight_init,
169 .notify = palmte2_backlight_notify, 170 .notify = palmte2_backlight_notify,
170 .exit = palmte2_backlight_exit, 171 .exit = palmte2_backlight_exit,
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 3133ba82c508..9a4e470f162b 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -153,6 +153,7 @@ static struct platform_pwm_backlight_data pcm990_backlight_data = {
153 .max_brightness = 1023, 153 .max_brightness = 1023,
154 .dft_brightness = 1023, 154 .dft_brightness = 1023,
155 .pwm_period_ns = 78770, 155 .pwm_period_ns = 78770,
156 .enable_gpio = -1,
156}; 157};
157 158
158static struct platform_device pcm990_backlight_device = { 159static struct platform_device pcm990_backlight_device = {
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 969b0ba7fa70..8386dc30b3e4 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -539,6 +539,7 @@ static struct platform_pwm_backlight_data raumfeld_pwm_backlight_data = {
539 .dft_brightness = 100, 539 .dft_brightness = 100,
540 /* 10000 ns = 10 ms ^= 100 kHz */ 540 /* 10000 ns = 10 ms ^= 100 kHz */
541 .pwm_period_ns = 10000, 541 .pwm_period_ns = 10000,
542 .enable_gpio = -1,
542}; 543};
543 544
544static struct platform_device raumfeld_pwm_backlight_device = { 545static struct platform_device raumfeld_pwm_backlight_device = {
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index 0d5dd646f61f..263b15249b5b 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -13,6 +13,7 @@
13 13
14#include <mach/regs-ost.h> 14#include <mach/regs-ost.h>
15#include <mach/reset.h> 15#include <mach/reset.h>
16#include <mach/smemc.h>
16 17
17unsigned int reset_status; 18unsigned int reset_status;
18EXPORT_SYMBOL(reset_status); 19EXPORT_SYMBOL(reset_status);
@@ -81,6 +82,12 @@ static void do_hw_reset(void)
81 writel_relaxed(OSSR_M3, OSSR); 82 writel_relaxed(OSSR_M3, OSSR);
82 /* ... in 100 ms */ 83 /* ... in 100 ms */
83 writel_relaxed(readl_relaxed(OSCR) + 368640, OSMR3); 84 writel_relaxed(readl_relaxed(OSCR) + 368640, OSMR3);
85 /*
86 * SDRAM hangs on watchdog reset on Marvell PXA270 (erratum 71)
87 * we put SDRAM into self-refresh to prevent that
88 */
89 while (1)
90 writel_relaxed(MDREFR_SLFRSH, MDREFR);
84} 91}
85 92
86void pxa_restart(enum reboot_mode mode, const char *cmd) 93void pxa_restart(enum reboot_mode mode, const char *cmd)
@@ -104,4 +111,3 @@ void pxa_restart(enum reboot_mode mode, const char *cmd)
104 break; 111 break;
105 } 112 }
106} 113}
107
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 62aea3e835f3..01de542432a6 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -27,7 +27,7 @@
27 27
28#include <linux/i2c/pxa-i2c.h> 28#include <linux/i2c/pxa-i2c.h>
29#include <linux/i2c/pcf857x.h> 29#include <linux/i2c/pcf857x.h>
30#include <linux/i2c/at24.h> 30#include <linux/platform_data/at24.h>
31#include <linux/smc91x.h> 31#include <linux/smc91x.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/leds.h> 33#include <linux/leds.h>
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index 4680efe55345..a71da84e784b 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -175,6 +175,7 @@ static struct platform_pwm_backlight_data tavorevb_backlight_data[] = {
175 .max_brightness = 100, 175 .max_brightness = 100,
176 .dft_brightness = 100, 176 .dft_brightness = 100,
177 .pwm_period_ns = 100000, 177 .pwm_period_ns = 100000,
178 .enable_gpio = -1,
178 }, 179 },
179 [1] = { 180 [1] = {
180 /* secondary backlight */ 181 /* secondary backlight */
@@ -182,6 +183,7 @@ static struct platform_pwm_backlight_data tavorevb_backlight_data[] = {
182 .max_brightness = 100, 183 .max_brightness = 100,
183 .dft_brightness = 100, 184 .dft_brightness = 100,
184 .pwm_period_ns = 100000, 185 .pwm_period_ns = 100000,
186 .enable_gpio = -1,
185 }, 187 },
186}; 188};
187 189
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 0206b915a6f6..ef5557b807ed 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -425,57 +425,57 @@ static struct platform_device tosa_power_device = {
425 * Tosa Keyboard 425 * Tosa Keyboard
426 */ 426 */
427static const uint32_t tosakbd_keymap[] = { 427static const uint32_t tosakbd_keymap[] = {
428 KEY(0, 2, KEY_W), 428 KEY(0, 1, KEY_W),
429 KEY(0, 6, KEY_K), 429 KEY(0, 5, KEY_K),
430 KEY(0, 7, KEY_BACKSPACE), 430 KEY(0, 6, KEY_BACKSPACE),
431 KEY(0, 8, KEY_P), 431 KEY(0, 7, KEY_P),
432 KEY(1, 1, KEY_Q), 432 KEY(1, 0, KEY_Q),
433 KEY(1, 2, KEY_E), 433 KEY(1, 1, KEY_E),
434 KEY(1, 3, KEY_T), 434 KEY(1, 2, KEY_T),
435 KEY(1, 4, KEY_Y), 435 KEY(1, 3, KEY_Y),
436 KEY(1, 6, KEY_O), 436 KEY(1, 5, KEY_O),
437 KEY(1, 7, KEY_I), 437 KEY(1, 6, KEY_I),
438 KEY(1, 8, KEY_COMMA), 438 KEY(1, 7, KEY_COMMA),
439 KEY(2, 1, KEY_A), 439 KEY(2, 0, KEY_A),
440 KEY(2, 2, KEY_D), 440 KEY(2, 1, KEY_D),
441 KEY(2, 3, KEY_G), 441 KEY(2, 2, KEY_G),
442 KEY(2, 4, KEY_U), 442 KEY(2, 3, KEY_U),
443 KEY(2, 6, KEY_L), 443 KEY(2, 5, KEY_L),
444 KEY(2, 7, KEY_ENTER), 444 KEY(2, 6, KEY_ENTER),
445 KEY(2, 8, KEY_DOT), 445 KEY(2, 7, KEY_DOT),
446 KEY(3, 1, KEY_Z), 446 KEY(3, 0, KEY_Z),
447 KEY(3, 2, KEY_C), 447 KEY(3, 1, KEY_C),
448 KEY(3, 3, KEY_V), 448 KEY(3, 2, KEY_V),
449 KEY(3, 4, KEY_J), 449 KEY(3, 3, KEY_J),
450 KEY(3, 5, TOSA_KEY_ADDRESSBOOK), 450 KEY(3, 4, TOSA_KEY_ADDRESSBOOK),
451 KEY(3, 6, TOSA_KEY_CANCEL), 451 KEY(3, 5, TOSA_KEY_CANCEL),
452 KEY(3, 7, TOSA_KEY_CENTER), 452 KEY(3, 6, TOSA_KEY_CENTER),
453 KEY(3, 8, TOSA_KEY_OK), 453 KEY(3, 7, TOSA_KEY_OK),
454 KEY(3, 9, KEY_LEFTSHIFT), 454 KEY(3, 8, KEY_LEFTSHIFT),
455 KEY(4, 1, KEY_S), 455 KEY(4, 0, KEY_S),
456 KEY(4, 2, KEY_R), 456 KEY(4, 1, KEY_R),
457 KEY(4, 3, KEY_B), 457 KEY(4, 2, KEY_B),
458 KEY(4, 4, KEY_N), 458 KEY(4, 3, KEY_N),
459 KEY(4, 5, TOSA_KEY_CALENDAR), 459 KEY(4, 4, TOSA_KEY_CALENDAR),
460 KEY(4, 6, TOSA_KEY_HOMEPAGE), 460 KEY(4, 5, TOSA_KEY_HOMEPAGE),
461 KEY(4, 7, KEY_LEFTCTRL), 461 KEY(4, 6, KEY_LEFTCTRL),
462 KEY(4, 8, TOSA_KEY_LIGHT), 462 KEY(4, 7, TOSA_KEY_LIGHT),
463 KEY(4, 10, KEY_RIGHTSHIFT), 463 KEY(4, 9, KEY_RIGHTSHIFT),
464 KEY(5, 1, KEY_TAB), 464 KEY(5, 0, KEY_TAB),
465 KEY(5, 2, KEY_SLASH), 465 KEY(5, 1, KEY_SLASH),
466 KEY(5, 3, KEY_H), 466 KEY(5, 2, KEY_H),
467 KEY(5, 4, KEY_M), 467 KEY(5, 3, KEY_M),
468 KEY(5, 5, TOSA_KEY_MENU), 468 KEY(5, 4, TOSA_KEY_MENU),
469 KEY(5, 7, KEY_UP), 469 KEY(5, 6, KEY_UP),
470 KEY(5, 11, TOSA_KEY_FN), 470 KEY(5, 10, TOSA_KEY_FN),
471 KEY(6, 1, KEY_X), 471 KEY(6, 0, KEY_X),
472 KEY(6, 2, KEY_F), 472 KEY(6, 1, KEY_F),
473 KEY(6, 3, KEY_SPACE), 473 KEY(6, 2, KEY_SPACE),
474 KEY(6, 4, KEY_APOSTROPHE), 474 KEY(6, 3, KEY_APOSTROPHE),
475 KEY(6, 5, TOSA_KEY_MAIL), 475 KEY(6, 4, TOSA_KEY_MAIL),
476 KEY(6, 6, KEY_LEFT), 476 KEY(6, 5, KEY_LEFT),
477 KEY(6, 7, KEY_DOWN), 477 KEY(6, 6, KEY_DOWN),
478 KEY(6, 8, KEY_RIGHT), 478 KEY(6, 7, KEY_RIGHT),
479}; 479};
480 480
481static struct matrix_keymap_data tosakbd_keymap_data = { 481static struct matrix_keymap_data tosakbd_keymap_data = {
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 9c363c081d3f..29905b127ad9 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -401,6 +401,7 @@ static struct platform_pwm_backlight_data viper_backlight_data = {
401 .max_brightness = 100, 401 .max_brightness = 100,
402 .dft_brightness = 100, 402 .dft_brightness = 100,
403 .pwm_period_ns = 1000000, 403 .pwm_period_ns = 1000000,
404 .enable_gpio = -1,
404 .init = viper_backlight_init, 405 .init = viper_backlight_init,
405 .notify = viper_backlight_notify, 406 .notify = viper_backlight_notify,
406 .exit = viper_backlight_exit, 407 .exit = viper_backlight_exit,
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index 2513d8f4931f..e1a121b36cfa 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -206,6 +206,7 @@ static struct platform_pwm_backlight_data z2_backlight_data[] = {
206 .max_brightness = 1023, 206 .max_brightness = 1023,
207 .dft_brightness = 0, 207 .dft_brightness = 0,
208 .pwm_period_ns = 1260320, 208 .pwm_period_ns = 1260320,
209 .enable_gpio = -1,
209 }, 210 },
210 [1] = { 211 [1] = {
211 /* LCD Backlight */ 212 /* LCD Backlight */
@@ -213,6 +214,7 @@ static struct platform_pwm_backlight_data z2_backlight_data[] = {
213 .max_brightness = 1023, 214 .max_brightness = 1023,
214 .dft_brightness = 512, 215 .dft_brightness = 512,
215 .pwm_period_ns = 1260320, 216 .pwm_period_ns = 1260320,
217 .enable_gpio = -1,
216 }, 218 },
217}; 219};
218 220
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 36cf7cf95ec1..77daea478e88 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -125,6 +125,7 @@ static struct platform_pwm_backlight_data zylonite_backlight_data = {
125 .max_brightness = 100, 125 .max_brightness = 100,
126 .dft_brightness = 100, 126 .dft_brightness = 100,
127 .pwm_period_ns = 10000, 127 .pwm_period_ns = 10000,
128 .enable_gpio = -1,
128}; 129};
129 130
130static struct platform_device zylonite_backlight_device = { 131static struct platform_device zylonite_backlight_device = {
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index 74dd47988b41..952b6a040d1f 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -504,6 +504,7 @@ static struct platform_pwm_backlight_data backlight_data = {
504 .dft_brightness = 50, 504 .dft_brightness = 50,
505 /* tcnt = 0x31 */ 505 /* tcnt = 0x31 */
506 .pwm_period_ns = 36296, 506 .pwm_period_ns = 36296,
507 .enable_gpio = -1,
507 .init = h1940_backlight_init, 508 .init = h1940_backlight_init,
508 .notify = h1940_backlight_notify, 509 .notify = h1940_backlight_notify,
509 .exit = h1940_backlight_exit, 510 .exit = h1940_backlight_exit,
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index a83db46320bc..4a18d49a63e0 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -24,7 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/dm9000.h> 26#include <linux/dm9000.h>
27#include <linux/i2c/at24.h> 27#include <linux/platform_data/at24.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/gpio_keys.h> 29#include <linux/gpio_keys.h>
30#include <linux/i2c.h> 30#include <linux/i2c.h>
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 206b1f7546d1..034b7fe45c49 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -522,6 +522,7 @@ static struct platform_pwm_backlight_data rx1950_backlight_data = {
522 .max_brightness = 24, 522 .max_brightness = 24,
523 .dft_brightness = 4, 523 .dft_brightness = 4,
524 .pwm_period_ns = 48000, 524 .pwm_period_ns = 48000,
525 .enable_gpio = -1,
525 .init = rx1950_backlight_init, 526 .init = rx1950_backlight_init,
526 .notify = rx1950_backlight_notify, 527 .notify = rx1950_backlight_notify,
527 .exit = rx1950_backlight_exit, 528 .exit = rx1950_backlight_exit,
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index aca7d16e195d..758e31b26550 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -114,6 +114,7 @@ static struct platform_pwm_backlight_data crag6410_backlight_data = {
114 .max_brightness = 1000, 114 .max_brightness = 1000,
115 .dft_brightness = 600, 115 .dft_brightness = 600,
116 .pwm_period_ns = 100000, /* about 1kHz */ 116 .pwm_period_ns = 100000, /* about 1kHz */
117 .enable_gpio = -1,
117}; 118};
118 119
119static struct platform_device crag6410_backlight_device = { 120static struct platform_device crag6410_backlight_device = {
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index e8064044ef79..614a03a92cf7 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -114,6 +114,7 @@ static struct platform_pwm_backlight_data hmt_backlight_data = {
114 .max_brightness = 100 * 256, 114 .max_brightness = 100 * 256,
115 .dft_brightness = 40 * 256, 115 .dft_brightness = 40 * 256,
116 .pwm_period_ns = 1000000000 / (100 * 256 * 20), 116 .pwm_period_ns = 1000000000 / (100 * 256 * 20),
117 .enable_gpio = -1,
117 .init = hmt_bl_init, 118 .init = hmt_bl_init,
118 .notify = hmt_bl_notify, 119 .notify = hmt_bl_notify,
119 .exit = hmt_bl_exit, 120 .exit = hmt_bl_exit,
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index 0f47237be3b2..a6b338fd0470 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -151,6 +151,7 @@ static struct platform_pwm_backlight_data smartq_backlight_data = {
151 .max_brightness = 1000, 151 .max_brightness = 1000,
152 .dft_brightness = 600, 152 .dft_brightness = 600,
153 .pwm_period_ns = 1000000000 / (1000 * 20), 153 .pwm_period_ns = 1000000000 / (1000 * 20),
154 .enable_gpio = -1,
154 .init = smartq_bl_init, 155 .init = smartq_bl_init,
155}; 156};
156 157
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 2a7b32ca5c96..d5ea938cc9a1 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -625,6 +625,7 @@ static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {
625 625
626static struct platform_pwm_backlight_data smdk6410_bl_data = { 626static struct platform_pwm_backlight_data smdk6410_bl_data = {
627 .pwm_id = 1, 627 .pwm_id = 1,
628 .enable_gpio = -1,
628}; 629};
629 630
630static struct s3c_hsotg_plat smdk6410_hsotg_pdata; 631static struct s3c_hsotg_plat smdk6410_hsotg_pdata;
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 0b00304c1e91..9efdcc03df3b 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -223,6 +223,7 @@ static struct samsung_bl_gpio_info smdk6440_bl_gpio_info = {
223 223
224static struct platform_pwm_backlight_data smdk6440_bl_data = { 224static struct platform_pwm_backlight_data smdk6440_bl_data = {
225 .pwm_id = 1, 225 .pwm_id = 1,
226 .enable_gpio = -1,
226}; 227};
227 228
228static void __init smdk6440_map_io(void) 229static void __init smdk6440_map_io(void)
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 5949296e88fd..c3cacc067efe 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -242,6 +242,7 @@ static struct samsung_bl_gpio_info smdk6450_bl_gpio_info = {
242 242
243static struct platform_pwm_backlight_data smdk6450_bl_data = { 243static struct platform_pwm_backlight_data smdk6450_bl_data = {
244 .pwm_id = 1, 244 .pwm_id = 1,
245 .enable_gpio = -1,
245}; 246};
246 247
247static void __init smdk6450_map_io(void) 248static void __init smdk6450_map_io(void)
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 7c57a221785e..9e256b9fc930 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -216,6 +216,7 @@ static struct samsung_bl_gpio_info smdkc100_bl_gpio_info = {
216 216
217static struct platform_pwm_backlight_data smdkc100_bl_data = { 217static struct platform_pwm_backlight_data smdkc100_bl_data = {
218 .pwm_id = 0, 218 .pwm_id = 0,
219 .enable_gpio = -1,
219}; 220};
220 221
221static void __init smdkc100_map_io(void) 222static void __init smdkc100_map_io(void)
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 6d72bb992e38..f52cc15c2d85 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -279,6 +279,7 @@ static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = {
279static struct platform_pwm_backlight_data smdkv210_bl_data = { 279static struct platform_pwm_backlight_data smdkv210_bl_data = {
280 .pwm_id = 3, 280 .pwm_id = 3,
281 .pwm_period_ns = 1000, 281 .pwm_period_ns = 1000,
282 .enable_gpio = -1,
282}; 283};
283 284
284static void __init smdkv210_map_io(void) 285static void __init smdkv210_map_io(void)
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 8bc8e4c58847..958e3cbf0ac2 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -423,6 +423,7 @@ static struct platform_pwm_backlight_data pwm_backlight_data = {
423 .max_brightness = 255, 423 .max_brightness = 255,
424 .dft_brightness = 255, 424 .dft_brightness = 255,
425 .pwm_period_ns = 33333, /* 30kHz */ 425 .pwm_period_ns = 33333, /* 30kHz */
426 .enable_gpio = -1,
426}; 427};
427 428
428static struct platform_device pwm_backlight_device = { 429static struct platform_device pwm_backlight_device = {
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index 037100a1563a..aee77f06f887 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -10,6 +10,7 @@ config ARCH_SOCFPGA
10 select GENERIC_CLOCKEVENTS 10 select GENERIC_CLOCKEVENTS
11 select GPIO_PL061 if GPIOLIB 11 select GPIO_PL061 if GPIOLIB
12 select HAVE_ARM_SCU 12 select HAVE_ARM_SCU
13 select HAVE_ARM_TWD if SMP
13 select HAVE_SMP 14 select HAVE_SMP
14 select MFD_SYSCON 15 select MFD_SYSCON
15 select SPARSE_IRQ 16 select SPARSE_IRQ
diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
index 835833e3c4f8..d71654bc8d54 100644
--- a/arch/arm/mach-sti/Kconfig
+++ b/arch/arm/mach-sti/Kconfig
@@ -12,7 +12,7 @@ menuconfig ARCH_STI
12 select HAVE_ARM_SCU if SMP 12 select HAVE_ARM_SCU if SMP
13 select ARCH_REQUIRE_GPIOLIB 13 select ARCH_REQUIRE_GPIOLIB
14 select ARM_ERRATA_754322 14 select ARM_ERRATA_754322
15 select ARM_ERRATA_764369 15 select ARM_ERRATA_764369 if SMP
16 select ARM_ERRATA_775420 16 select ARM_ERRATA_775420
17 select PL310_ERRATA_753970 if CACHE_PL310 17 select PL310_ERRATA_753970 if CACHE_PL310
18 select PL310_ERRATA_769419 if CACHE_PL310 18 select PL310_ERRATA_769419 if CACHE_PL310
@@ -30,7 +30,7 @@ config SOC_STIH415
30 default y 30 default y
31 help 31 help
32 This enables support for STMicroelectronics Digital Consumer 32 This enables support for STMicroelectronics Digital Consumer
33 Electronics family StiH415 parts, primarily targetted at set-top-box 33 Electronics family StiH415 parts, primarily targeted at set-top-box
34 and other digital audio/video applications using Flattned Device 34 and other digital audio/video applications using Flattned Device
35 Trees. 35 Trees.
36 36
@@ -39,7 +39,7 @@ config SOC_STIH416
39 default y 39 default y
40 help 40 help
41 This enables support for STMicroelectronics Digital Consumer 41 This enables support for STMicroelectronics Digital Consumer
42 Electronics family StiH416 parts, primarily targetted at set-top-box 42 Electronics family StiH416 parts, primarily targeted at set-top-box
43 and other digital audio/video applications using Flattened Device 43 and other digital audio/video applications using Flattened Device
44 Trees. 44 Trees.
45 45
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index d4639c506622..3a9c1f1c219d 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -198,10 +198,12 @@ void __init tegra_init_fuse(void)
198 switch (tegra_chip_id) { 198 switch (tegra_chip_id) {
199 case TEGRA20: 199 case TEGRA20:
200 tegra20_fuse_init_randomness(); 200 tegra20_fuse_init_randomness();
201 break;
201 case TEGRA30: 202 case TEGRA30:
202 case TEGRA114: 203 case TEGRA114:
203 default: 204 default:
204 tegra30_fuse_init_randomness(); 205 tegra30_fuse_init_randomness();
206 break;
205 } 207 }
206 208
207 pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n", 209 pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n",
@@ -209,13 +211,3 @@ void __init tegra_init_fuse(void)
209 tegra_sku_id, tegra_cpu_process_id, 211 tegra_sku_id, tegra_cpu_process_id,
210 tegra_core_process_id); 212 tegra_core_process_id);
211} 213}
212
213unsigned long long tegra_chip_uid(void)
214{
215 unsigned long long lo, hi;
216
217 lo = tegra_fuse_readl(FUSE_UID_LOW);
218 hi = tegra_fuse_readl(FUSE_UID_HIGH);
219 return (hi << 32ull) | lo;
220}
221EXPORT_SYMBOL(tegra_chip_uid);
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index ce553d557c31..73368176c6e8 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -90,9 +90,9 @@ static void __init tegra_init_cache(void)
90 90
91static void __init tegra_init_early(void) 91static void __init tegra_init_early(void)
92{ 92{
93 tegra_cpu_reset_handler_init();
94 tegra_apb_io_init(); 93 tegra_apb_io_init();
95 tegra_init_fuse(); 94 tegra_init_fuse();
95 tegra_cpu_reset_handler_init();
96 tegra_init_cache(); 96 tegra_init_cache();
97 tegra_powergate_init(); 97 tegra_powergate_init();
98 tegra_hotplug_init(); 98 tegra_hotplug_init();
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 2e85c1e72535..12c7e5c03ea4 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -140,6 +140,10 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
140 /* Requires call-back bindings. */ 140 /* Requires call-back bindings. */
141 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), 141 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
142 /* Requires DMA bindings. */ 142 /* Requires DMA bindings. */
143 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
144 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
145 OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data),
146 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data),
143 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000, 147 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
144 "ux500-msp-i2s.0", &msp0_platform_data), 148 "ux500-msp-i2s.0", &msp0_platform_data),
145 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000, 149 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000,
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c
index 033d34dcbd3f..c26ef5b92ca7 100644
--- a/arch/arm/mach-vexpress/spc.c
+++ b/arch/arm/mach-vexpress/spc.c
@@ -53,6 +53,11 @@
53#define A15_BX_ADDR0 0x68 53#define A15_BX_ADDR0 0x68
54#define A7_BX_ADDR0 0x78 54#define A7_BX_ADDR0 0x78
55 55
56/* SPC CPU/cluster reset statue */
57#define STANDBYWFI_STAT 0x3c
58#define STANDBYWFI_STAT_A15_CPU_MASK(cpu) (1 << (cpu))
59#define STANDBYWFI_STAT_A7_CPU_MASK(cpu) (1 << (3 + (cpu)))
60
56/* SPC system config interface registers */ 61/* SPC system config interface registers */
57#define SYSCFG_WDATA 0x70 62#define SYSCFG_WDATA 0x70
58#define SYSCFG_RDATA 0x74 63#define SYSCFG_RDATA 0x74
@@ -213,6 +218,41 @@ void ve_spc_powerdown(u32 cluster, bool enable)
213 writel_relaxed(enable, info->baseaddr + pwdrn_reg); 218 writel_relaxed(enable, info->baseaddr + pwdrn_reg);
214} 219}
215 220
221static u32 standbywfi_cpu_mask(u32 cpu, u32 cluster)
222{
223 return cluster_is_a15(cluster) ?
224 STANDBYWFI_STAT_A15_CPU_MASK(cpu)
225 : STANDBYWFI_STAT_A7_CPU_MASK(cpu);
226}
227
228/**
229 * ve_spc_cpu_in_wfi(u32 cpu, u32 cluster)
230 *
231 * @cpu: mpidr[7:0] bitfield describing CPU affinity level within cluster
232 * @cluster: mpidr[15:8] bitfield describing cluster affinity level
233 *
234 * @return: non-zero if and only if the specified CPU is in WFI
235 *
236 * Take care when interpreting the result of this function: a CPU might
237 * be in WFI temporarily due to idle, and is not necessarily safely
238 * parked.
239 */
240int ve_spc_cpu_in_wfi(u32 cpu, u32 cluster)
241{
242 int ret;
243 u32 mask = standbywfi_cpu_mask(cpu, cluster);
244
245 if (cluster >= MAX_CLUSTERS)
246 return 1;
247
248 ret = readl_relaxed(info->baseaddr + STANDBYWFI_STAT);
249
250 pr_debug("%s: PCFGREG[0x%X] = 0x%08X, mask = 0x%X\n",
251 __func__, STANDBYWFI_STAT, ret, mask);
252
253 return ret & mask;
254}
255
216static int ve_spc_get_performance(int cluster, u32 *freq) 256static int ve_spc_get_performance(int cluster, u32 *freq)
217{ 257{
218 struct ve_spc_opp *opps = info->opps[cluster]; 258 struct ve_spc_opp *opps = info->opps[cluster];
diff --git a/arch/arm/mach-vexpress/spc.h b/arch/arm/mach-vexpress/spc.h
index dbd44c3720f9..793d065243b9 100644
--- a/arch/arm/mach-vexpress/spc.h
+++ b/arch/arm/mach-vexpress/spc.h
@@ -20,5 +20,6 @@ void ve_spc_global_wakeup_irq(bool set);
20void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set); 20void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set);
21void ve_spc_set_resume_addr(u32 cluster, u32 cpu, u32 addr); 21void ve_spc_set_resume_addr(u32 cluster, u32 cpu, u32 addr);
22void ve_spc_powerdown(u32 cluster, bool enable); 22void ve_spc_powerdown(u32 cluster, bool enable);
23int ve_spc_cpu_in_wfi(u32 cpu, u32 cluster);
23 24
24#endif 25#endif
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c
index 05a364c5077a..29e7785a54bc 100644
--- a/arch/arm/mach-vexpress/tc2_pm.c
+++ b/arch/arm/mach-vexpress/tc2_pm.c
@@ -12,6 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/delay.h>
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/io.h> 17#include <linux/io.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
@@ -32,11 +33,17 @@
32#include "spc.h" 33#include "spc.h"
33 34
34/* SCC conf registers */ 35/* SCC conf registers */
36#define RESET_CTRL 0x018
37#define RESET_A15_NCORERESET(cpu) (1 << (2 + (cpu)))
38#define RESET_A7_NCORERESET(cpu) (1 << (16 + (cpu)))
39
35#define A15_CONF 0x400 40#define A15_CONF 0x400
36#define A7_CONF 0x500 41#define A7_CONF 0x500
37#define SYS_INFO 0x700 42#define SYS_INFO 0x700
38#define SPC_BASE 0xb00 43#define SPC_BASE 0xb00
39 44
45static void __iomem *scc;
46
40/* 47/*
41 * We can't use regular spinlocks. In the switcher case, it is possible 48 * We can't use regular spinlocks. In the switcher case, it is possible
42 * for an outbound CPU to call power_down() after its inbound counterpart 49 * for an outbound CPU to call power_down() after its inbound counterpart
@@ -190,6 +197,55 @@ static void tc2_pm_power_down(void)
190 tc2_pm_down(0); 197 tc2_pm_down(0);
191} 198}
192 199
200static int tc2_core_in_reset(unsigned int cpu, unsigned int cluster)
201{
202 u32 mask = cluster ?
203 RESET_A7_NCORERESET(cpu)
204 : RESET_A15_NCORERESET(cpu);
205
206 return !(readl_relaxed(scc + RESET_CTRL) & mask);
207}
208
209#define POLL_MSEC 10
210#define TIMEOUT_MSEC 1000
211
212static int tc2_pm_power_down_finish(unsigned int cpu, unsigned int cluster)
213{
214 unsigned tries;
215
216 pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
217 BUG_ON(cluster >= TC2_CLUSTERS || cpu >= TC2_MAX_CPUS_PER_CLUSTER);
218
219 for (tries = 0; tries < TIMEOUT_MSEC / POLL_MSEC; ++tries) {
220 /*
221 * Only examine the hardware state if the target CPU has
222 * caught up at least as far as tc2_pm_down():
223 */
224 if (ACCESS_ONCE(tc2_pm_use_count[cpu][cluster]) == 0) {
225 pr_debug("%s(cpu=%u, cluster=%u): RESET_CTRL = 0x%08X\n",
226 __func__, cpu, cluster,
227 readl_relaxed(scc + RESET_CTRL));
228
229 /*
230 * We need the CPU to reach WFI, but the power
231 * controller may put the cluster in reset and
232 * power it off as soon as that happens, before
233 * we have a chance to see STANDBYWFI.
234 *
235 * So we need to check for both conditions:
236 */
237 if (tc2_core_in_reset(cpu, cluster) ||
238 ve_spc_cpu_in_wfi(cpu, cluster))
239 return 0; /* success: the CPU is halted */
240 }
241
242 /* Otherwise, wait and retry: */
243 msleep(POLL_MSEC);
244 }
245
246 return -ETIMEDOUT; /* timeout */
247}
248
193static void tc2_pm_suspend(u64 residency) 249static void tc2_pm_suspend(u64 residency)
194{ 250{
195 unsigned int mpidr, cpu, cluster; 251 unsigned int mpidr, cpu, cluster;
@@ -232,10 +288,11 @@ static void tc2_pm_powered_up(void)
232} 288}
233 289
234static const struct mcpm_platform_ops tc2_pm_power_ops = { 290static const struct mcpm_platform_ops tc2_pm_power_ops = {
235 .power_up = tc2_pm_power_up, 291 .power_up = tc2_pm_power_up,
236 .power_down = tc2_pm_power_down, 292 .power_down = tc2_pm_power_down,
237 .suspend = tc2_pm_suspend, 293 .power_down_finish = tc2_pm_power_down_finish,
238 .powered_up = tc2_pm_powered_up, 294 .suspend = tc2_pm_suspend,
295 .powered_up = tc2_pm_powered_up,
239}; 296};
240 297
241static bool __init tc2_pm_usage_count_init(void) 298static bool __init tc2_pm_usage_count_init(void)
@@ -269,7 +326,6 @@ static void __naked tc2_pm_power_up_setup(unsigned int affinity_level)
269static int __init tc2_pm_init(void) 326static int __init tc2_pm_init(void)
270{ 327{
271 int ret, irq; 328 int ret, irq;
272 void __iomem *scc;
273 u32 a15_cluster_id, a7_cluster_id, sys_info; 329 u32 a15_cluster_id, a7_cluster_id, sys_info;
274 struct device_node *np; 330 struct device_node *np;
275 331
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 79f8b39801a8..f61a5707823a 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -9,6 +9,7 @@
9 * 9 *
10 * DMA uncached mapping support. 10 * DMA uncached mapping support.
11 */ 11 */
12#include <linux/bootmem.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/mm.h> 14#include <linux/mm.h>
14#include <linux/gfp.h> 15#include <linux/gfp.h>
@@ -157,6 +158,44 @@ struct dma_map_ops arm_coherent_dma_ops = {
157}; 158};
158EXPORT_SYMBOL(arm_coherent_dma_ops); 159EXPORT_SYMBOL(arm_coherent_dma_ops);
159 160
161static int __dma_supported(struct device *dev, u64 mask, bool warn)
162{
163 unsigned long max_dma_pfn;
164
165 /*
166 * If the mask allows for more memory than we can address,
167 * and we actually have that much memory, then we must
168 * indicate that DMA to this device is not supported.
169 */
170 if (sizeof(mask) != sizeof(dma_addr_t) &&
171 mask > (dma_addr_t)~0 &&
172 dma_to_pfn(dev, ~0) < max_pfn) {
173 if (warn) {
174 dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n",
175 mask);
176 dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n");
177 }
178 return 0;
179 }
180
181 max_dma_pfn = min(max_pfn, arm_dma_pfn_limit);
182
183 /*
184 * Translate the device's DMA mask to a PFN limit. This
185 * PFN number includes the page which we can DMA to.
186 */
187 if (dma_to_pfn(dev, mask) < max_dma_pfn) {
188 if (warn)
189 dev_warn(dev, "Coherent DMA mask %#llx (pfn %#lx-%#lx) covers a smaller range of system memory than the DMA zone pfn 0x0-%#lx\n",
190 mask,
191 dma_to_pfn(dev, 0), dma_to_pfn(dev, mask) + 1,
192 max_dma_pfn + 1);
193 return 0;
194 }
195
196 return 1;
197}
198
160static u64 get_coherent_dma_mask(struct device *dev) 199static u64 get_coherent_dma_mask(struct device *dev)
161{ 200{
162 u64 mask = (u64)DMA_BIT_MASK(32); 201 u64 mask = (u64)DMA_BIT_MASK(32);
@@ -173,32 +212,8 @@ static u64 get_coherent_dma_mask(struct device *dev)
173 return 0; 212 return 0;
174 } 213 }
175 214
176 /* 215 if (!__dma_supported(dev, mask, true))
177 * If the mask allows for more memory than we can address,
178 * and we actually have that much memory, then fail the
179 * allocation.
180 */
181 if (sizeof(mask) != sizeof(dma_addr_t) &&
182 mask > (dma_addr_t)~0 &&
183 dma_to_pfn(dev, ~0) > arm_dma_pfn_limit) {
184 dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n",
185 mask);
186 dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n");
187 return 0;
188 }
189
190 /*
191 * Now check that the mask, when translated to a PFN,
192 * fits within the allowable addresses which we can
193 * allocate.
194 */
195 if (dma_to_pfn(dev, mask) < arm_dma_pfn_limit) {
196 dev_warn(dev, "Coherent DMA mask %#llx (pfn %#lx-%#lx) covers a smaller range of system memory than the DMA zone pfn 0x0-%#lx\n",
197 mask,
198 dma_to_pfn(dev, 0), dma_to_pfn(dev, mask) + 1,
199 arm_dma_pfn_limit + 1);
200 return 0; 216 return 0;
201 }
202 } 217 }
203 218
204 return mask; 219 return mask;
@@ -1027,28 +1042,7 @@ void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
1027 */ 1042 */
1028int dma_supported(struct device *dev, u64 mask) 1043int dma_supported(struct device *dev, u64 mask)
1029{ 1044{
1030 unsigned long limit; 1045 return __dma_supported(dev, mask, false);
1031
1032 /*
1033 * If the mask allows for more memory than we can address,
1034 * and we actually have that much memory, then we must
1035 * indicate that DMA to this device is not supported.
1036 */
1037 if (sizeof(mask) != sizeof(dma_addr_t) &&
1038 mask > (dma_addr_t)~0 &&
1039 dma_to_pfn(dev, ~0) > arm_dma_pfn_limit)
1040 return 0;
1041
1042 /*
1043 * Translate the device's DMA mask to a PFN limit. This
1044 * PFN number includes the page which we can DMA to.
1045 */
1046 limit = dma_to_pfn(dev, mask);
1047
1048 if (limit < arm_dma_pfn_limit)
1049 return 0;
1050
1051 return 1;
1052} 1046}
1053EXPORT_SYMBOL(dma_supported); 1047EXPORT_SYMBOL(dma_supported);
1054 1048
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 3e8f106ee5fe..1f7b19a47060 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -229,7 +229,7 @@ void __init setup_dma_zone(const struct machine_desc *mdesc)
229#ifdef CONFIG_ZONE_DMA 229#ifdef CONFIG_ZONE_DMA
230 if (mdesc->dma_zone_size) { 230 if (mdesc->dma_zone_size) {
231 arm_dma_zone_size = mdesc->dma_zone_size; 231 arm_dma_zone_size = mdesc->dma_zone_size;
232 arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; 232 arm_dma_limit = __pv_phys_offset + arm_dma_zone_size - 1;
233 } else 233 } else
234 arm_dma_limit = 0xffffffff; 234 arm_dma_limit = 0xffffffff;
235 arm_dma_pfn_limit = arm_dma_limit >> PAGE_SHIFT; 235 arm_dma_pfn_limit = arm_dma_limit >> PAGE_SHIFT;
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index d27158c38eb0..5e85ed371364 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -146,7 +146,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
146 146
147 info.flags = VM_UNMAPPED_AREA_TOPDOWN; 147 info.flags = VM_UNMAPPED_AREA_TOPDOWN;
148 info.length = len; 148 info.length = len;
149 info.low_limit = PAGE_SIZE; 149 info.low_limit = FIRST_USER_ADDRESS;
150 info.high_limit = mm->mmap_base; 150 info.high_limit = mm->mmap_base;
151 info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; 151 info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0;
152 info.align_offset = pgoff << PAGE_SHIFT; 152 info.align_offset = pgoff << PAGE_SHIFT;
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 78eeeca78f5a..580ef2de82d7 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -558,8 +558,8 @@ static void __init build_mem_type_table(void)
558 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WB; 558 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WB;
559 break; 559 break;
560 } 560 }
561 printk("Memory policy: ECC %sabled, Data cache %s\n", 561 pr_info("Memory policy: %sData cache %s\n",
562 ecc_mask ? "en" : "dis", cp->policy); 562 ecc_mask ? "ECC enabled, " : "", cp->policy);
563 563
564 for (i = 0; i < ARRAY_SIZE(mem_types); i++) { 564 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
565 struct mem_type *t = &mem_types[i]; 565 struct mem_type *t = &mem_types[i];
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 5c668b7a31f9..55764a7ef1f0 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -18,6 +18,7 @@
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/cputype.h> 19#include <asm/cputype.h>
20#include <asm/mpu.h> 20#include <asm/mpu.h>
21#include <asm/procinfo.h>
21 22
22#include "mm.h" 23#include "mm.h"
23 24
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index 0acb089d0f70..1046b373d1ae 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -87,7 +87,8 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
87 init_pud = pud_offset(init_pgd, 0); 87 init_pud = pud_offset(init_pgd, 0);
88 init_pmd = pmd_offset(init_pud, 0); 88 init_pmd = pmd_offset(init_pud, 0);
89 init_pte = pte_offset_map(init_pmd, 0); 89 init_pte = pte_offset_map(init_pmd, 0);
90 set_pte_ext(new_pte, *init_pte, 0); 90 set_pte_ext(new_pte + 0, init_pte[0], 0);
91 set_pte_ext(new_pte + 1, init_pte[1], 0);
91 pte_unmap(init_pte); 92 pte_unmap(init_pte);
92 pte_unmap(new_pte); 93 pte_unmap(new_pte);
93 } 94 }
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 60920f62fdf5..bd1781979a39 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -92,7 +92,7 @@ ENDPROC(cpu_v7_dcache_clean_area)
92 92
93/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ 93/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
94.globl cpu_v7_suspend_size 94.globl cpu_v7_suspend_size
95.equ cpu_v7_suspend_size, 4 * 8 95.equ cpu_v7_suspend_size, 4 * 9
96#ifdef CONFIG_ARM_CPU_SUSPEND 96#ifdef CONFIG_ARM_CPU_SUSPEND
97ENTRY(cpu_v7_do_suspend) 97ENTRY(cpu_v7_do_suspend)
98 stmfd sp!, {r4 - r10, lr} 98 stmfd sp!, {r4 - r10, lr}
@@ -101,13 +101,17 @@ ENTRY(cpu_v7_do_suspend)
101 stmia r0!, {r4 - r5} 101 stmia r0!, {r4 - r5}
102#ifdef CONFIG_MMU 102#ifdef CONFIG_MMU
103 mrc p15, 0, r6, c3, c0, 0 @ Domain ID 103 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
104#ifdef CONFIG_ARM_LPAE
105 mrrc p15, 1, r5, r7, c2 @ TTB 1
106#else
104 mrc p15, 0, r7, c2, c0, 1 @ TTB 1 107 mrc p15, 0, r7, c2, c0, 1 @ TTB 1
108#endif
105 mrc p15, 0, r11, c2, c0, 2 @ TTB control register 109 mrc p15, 0, r11, c2, c0, 2 @ TTB control register
106#endif 110#endif
107 mrc p15, 0, r8, c1, c0, 0 @ Control register 111 mrc p15, 0, r8, c1, c0, 0 @ Control register
108 mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register 112 mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register
109 mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control 113 mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control
110 stmia r0, {r6 - r11} 114 stmia r0, {r5 - r11}
111 ldmfd sp!, {r4 - r10, pc} 115 ldmfd sp!, {r4 - r10, pc}
112ENDPROC(cpu_v7_do_suspend) 116ENDPROC(cpu_v7_do_suspend)
113 117
@@ -118,16 +122,19 @@ ENTRY(cpu_v7_do_resume)
118 ldmia r0!, {r4 - r5} 122 ldmia r0!, {r4 - r5}
119 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID 123 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
120 mcr p15, 0, r5, c13, c0, 3 @ User r/o thread ID 124 mcr p15, 0, r5, c13, c0, 3 @ User r/o thread ID
121 ldmia r0, {r6 - r11} 125 ldmia r0, {r5 - r11}
122#ifdef CONFIG_MMU 126#ifdef CONFIG_MMU
123 mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs 127 mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs
124 mcr p15, 0, r6, c3, c0, 0 @ Domain ID 128 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
125#ifndef CONFIG_ARM_LPAE 129#ifdef CONFIG_ARM_LPAE
130 mcrr p15, 0, r1, ip, c2 @ TTB 0
131 mcrr p15, 1, r5, r7, c2 @ TTB 1
132#else
126 ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP) 133 ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP)
127 ALT_UP(orr r1, r1, #TTB_FLAGS_UP) 134 ALT_UP(orr r1, r1, #TTB_FLAGS_UP)
128#endif
129 mcr p15, 0, r1, c2, c0, 0 @ TTB 0 135 mcr p15, 0, r1, c2, c0, 0 @ TTB 0
130 mcr p15, 0, r7, c2, c0, 1 @ TTB 1 136 mcr p15, 0, r7, c2, c0, 1 @ TTB 1
137#endif
131 mcr p15, 0, r11, c2, c0, 2 @ TTB control register 138 mcr p15, 0, r11, c2, c0, 2 @ TTB control register
132 ldr r4, =PRRR @ PRRR 139 ldr r4, =PRRR @ PRRR
133 ldr r5, =NMRR @ NMRR 140 ldr r5, =NMRR @ NMRR
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index fb92abb91628..2861b155485a 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -336,8 +336,11 @@ static inline void __omap_dm_timer_enable_posted(struct omap_dm_timer *timer)
336 if (timer->posted) 336 if (timer->posted)
337 return; 337 return;
338 338
339 if (timer->errata & OMAP_TIMER_ERRATA_I103_I767) 339 if (timer->errata & OMAP_TIMER_ERRATA_I103_I767) {
340 timer->posted = OMAP_TIMER_NONPOSTED;
341 __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG, 0, 0);
340 return; 342 return;
343 }
341 344
342 __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG, 345 __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG,
343 OMAP_TIMER_CTRL_POSTED, 0); 346 OMAP_TIMER_CTRL_POSTED, 0);
diff --git a/arch/arm/plat-samsung/dev-backlight.c b/arch/arm/plat-samsung/dev-backlight.c
index d51f9565567c..be4ad0b21c08 100644
--- a/arch/arm/plat-samsung/dev-backlight.c
+++ b/arch/arm/plat-samsung/dev-backlight.c
@@ -70,6 +70,7 @@ static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = {
70 .max_brightness = 255, 70 .max_brightness = 255,
71 .dft_brightness = 255, 71 .dft_brightness = 255,
72 .pwm_period_ns = 78770, 72 .pwm_period_ns = 78770,
73 .enable_gpio = -1,
73 .init = samsung_bl_init, 74 .init = samsung_bl_init,
74 .exit = samsung_bl_exit, 75 .exit = samsung_bl_exit,
75 }, 76 },
@@ -121,6 +122,10 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
121 samsung_bl_data->lth_brightness = bl_data->lth_brightness; 122 samsung_bl_data->lth_brightness = bl_data->lth_brightness;
122 if (bl_data->pwm_period_ns) 123 if (bl_data->pwm_period_ns)
123 samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns; 124 samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns;
125 if (bl_data->enable_gpio >= 0)
126 samsung_bl_data->enable_gpio = bl_data->enable_gpio;
127 if (bl_data->enable_gpio_flags)
128 samsung_bl_data->enable_gpio_flags = bl_data->enable_gpio_flags;
124 if (bl_data->init) 129 if (bl_data->init)
125 samsung_bl_data->init = bl_data->init; 130 samsung_bl_data->init = bl_data->init;
126 if (bl_data->notify) 131 if (bl_data->notify)
diff --git a/arch/arm/xen/p2m.c b/arch/arm/xen/p2m.c
index 23732cdff551..b31ee1b275b0 100644
--- a/arch/arm/xen/p2m.c
+++ b/arch/arm/xen/p2m.c
@@ -25,8 +25,9 @@ struct xen_p2m_entry {
25 struct rb_node rbnode_phys; 25 struct rb_node rbnode_phys;
26}; 26};
27 27
28rwlock_t p2m_lock; 28static rwlock_t p2m_lock;
29struct rb_root phys_to_mach = RB_ROOT; 29struct rb_root phys_to_mach = RB_ROOT;
30EXPORT_SYMBOL_GPL(phys_to_mach);
30static struct rb_root mach_to_phys = RB_ROOT; 31static struct rb_root mach_to_phys = RB_ROOT;
31 32
32static int xen_add_phys_to_mach_entry(struct xen_p2m_entry *new) 33static int xen_add_phys_to_mach_entry(struct xen_p2m_entry *new)
@@ -200,7 +201,7 @@ bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
200} 201}
201EXPORT_SYMBOL_GPL(__set_phys_to_machine); 202EXPORT_SYMBOL_GPL(__set_phys_to_machine);
202 203
203int p2m_init(void) 204static int p2m_init(void)
204{ 205{
205 rwlock_init(&p2m_lock); 206 rwlock_init(&p2m_lock);
206 return 0; 207 return 0;
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 88c8b6c1341a..6d4dd22ee4b7 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -159,8 +159,7 @@ config NR_CPUS
159 range 2 32 159 range 2 32
160 depends on SMP 160 depends on SMP
161 # These have to remain sorted largest to smallest 161 # These have to remain sorted largest to smallest
162 default "8" if ARCH_XGENE 162 default "8"
163 default "4"
164 163
165config HOTPLUG_CPU 164config HOTPLUG_CPU
166 bool "Support for hot-pluggable CPUs" 165 bool "Support for hot-pluggable CPUs"
diff --git a/arch/arm64/boot/dts/foundation-v8.dts b/arch/arm64/boot/dts/foundation-v8.dts
index 84fcc5018284..519c4b2c0687 100644
--- a/arch/arm64/boot/dts/foundation-v8.dts
+++ b/arch/arm64/boot/dts/foundation-v8.dts
@@ -6,6 +6,8 @@
6 6
7/dts-v1/; 7/dts-v1/;
8 8
9/memreserve/ 0x80000000 0x00010000;
10
9/ { 11/ {
10 model = "Foundation-v8A"; 12 model = "Foundation-v8A";
11 compatible = "arm,foundation-aarch64", "arm,vexpress"; 13 compatible = "arm,foundation-aarch64", "arm,vexpress";
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 4cc813eddacb..572769727227 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -229,7 +229,7 @@ extern void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot
229extern void __iounmap(volatile void __iomem *addr); 229extern void __iounmap(volatile void __iomem *addr);
230extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); 230extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
231 231
232#define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY) 232#define PROT_DEFAULT (pgprot_default | PTE_DIRTY)
233#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) 233#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE))
234#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) 234#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC))
235#define PROT_NORMAL (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) 235#define PROT_NORMAL (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h
index aa11943b8502..b2fcfbc51ecc 100644
--- a/arch/arm64/include/asm/irqflags.h
+++ b/arch/arm64/include/asm/irqflags.h
@@ -56,6 +56,9 @@ static inline void arch_local_irq_disable(void)
56#define local_fiq_enable() asm("msr daifclr, #1" : : : "memory") 56#define local_fiq_enable() asm("msr daifclr, #1" : : : "memory")
57#define local_fiq_disable() asm("msr daifset, #1" : : : "memory") 57#define local_fiq_disable() asm("msr daifset, #1" : : : "memory")
58 58
59#define local_async_enable() asm("msr daifclr, #4" : : : "memory")
60#define local_async_disable() asm("msr daifset, #4" : : : "memory")
61
59/* 62/*
60 * Save the current interrupt enable state. 63 * Save the current interrupt enable state.
61 */ 64 */
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
index 755f86143320..b1d2e26c3c88 100644
--- a/arch/arm64/include/asm/pgtable-hwdef.h
+++ b/arch/arm64/include/asm/pgtable-hwdef.h
@@ -43,7 +43,7 @@
43 * Section 43 * Section
44 */ 44 */
45#define PMD_SECT_VALID (_AT(pmdval_t, 1) << 0) 45#define PMD_SECT_VALID (_AT(pmdval_t, 1) << 0)
46#define PMD_SECT_PROT_NONE (_AT(pmdval_t, 1) << 2) 46#define PMD_SECT_PROT_NONE (_AT(pmdval_t, 1) << 58)
47#define PMD_SECT_USER (_AT(pmdval_t, 1) << 6) /* AP[1] */ 47#define PMD_SECT_USER (_AT(pmdval_t, 1) << 6) /* AP[1] */
48#define PMD_SECT_RDONLY (_AT(pmdval_t, 1) << 7) /* AP[2] */ 48#define PMD_SECT_RDONLY (_AT(pmdval_t, 1) << 7) /* AP[2] */
49#define PMD_SECT_S (_AT(pmdval_t, 3) << 8) 49#define PMD_SECT_S (_AT(pmdval_t, 3) << 8)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 17bd3af0a117..7f2b60affbb4 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -25,10 +25,11 @@
25 * Software defined PTE bits definition. 25 * Software defined PTE bits definition.
26 */ 26 */
27#define PTE_VALID (_AT(pteval_t, 1) << 0) 27#define PTE_VALID (_AT(pteval_t, 1) << 0)
28#define PTE_PROT_NONE (_AT(pteval_t, 1) << 2) /* only when !PTE_VALID */ 28#define PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !pte_present() */
29#define PTE_FILE (_AT(pteval_t, 1) << 3) /* only when !pte_present() */
30#define PTE_DIRTY (_AT(pteval_t, 1) << 55) 29#define PTE_DIRTY (_AT(pteval_t, 1) << 55)
31#define PTE_SPECIAL (_AT(pteval_t, 1) << 56) 30#define PTE_SPECIAL (_AT(pteval_t, 1) << 56)
31 /* bit 57 for PMD_SECT_SPLITTING */
32#define PTE_PROT_NONE (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */
32 33
33/* 34/*
34 * VMALLOC and SPARSEMEM_VMEMMAP ranges. 35 * VMALLOC and SPARSEMEM_VMEMMAP ranges.
@@ -254,7 +255,7 @@ static inline int has_transparent_hugepage(void)
254#define pgprot_noncached(prot) \ 255#define pgprot_noncached(prot) \
255 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE)) 256 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE))
256#define pgprot_writecombine(prot) \ 257#define pgprot_writecombine(prot) \
257 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_GRE)) 258 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC))
258#define pgprot_dmacoherent(prot) \ 259#define pgprot_dmacoherent(prot) \
259 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) 260 __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC))
260#define __HAVE_PHYS_MEM_ACCESS_PROT 261#define __HAVE_PHYS_MEM_ACCESS_PROT
@@ -357,18 +358,20 @@ extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
357 358
358/* 359/*
359 * Encode and decode a swap entry: 360 * Encode and decode a swap entry:
360 * bits 0, 2: present (must both be zero) 361 * bits 0-1: present (must be zero)
361 * bit 3: PTE_FILE 362 * bit 2: PTE_FILE
362 * bits 4-8: swap type 363 * bits 3-8: swap type
363 * bits 9-63: swap offset 364 * bits 9-57: swap offset
364 */ 365 */
365#define __SWP_TYPE_SHIFT 4 366#define __SWP_TYPE_SHIFT 3
366#define __SWP_TYPE_BITS 6 367#define __SWP_TYPE_BITS 6
368#define __SWP_OFFSET_BITS 49
367#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1) 369#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1)
368#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT) 370#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
371#define __SWP_OFFSET_MASK ((1UL << __SWP_OFFSET_BITS) - 1)
369 372
370#define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK) 373#define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK)
371#define __swp_offset(x) ((x).val >> __SWP_OFFSET_SHIFT) 374#define __swp_offset(x) (((x).val >> __SWP_OFFSET_SHIFT) & __SWP_OFFSET_MASK)
372#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) }) 375#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) })
373 376
374#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 377#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
@@ -382,15 +385,15 @@ extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
382 385
383/* 386/*
384 * Encode and decode a file entry: 387 * Encode and decode a file entry:
385 * bits 0, 2: present (must both be zero) 388 * bits 0-1: present (must be zero)
386 * bit 3: PTE_FILE 389 * bit 2: PTE_FILE
387 * bits 4-63: file offset / PAGE_SIZE 390 * bits 3-57: file offset / PAGE_SIZE
388 */ 391 */
389#define pte_file(pte) (pte_val(pte) & PTE_FILE) 392#define pte_file(pte) (pte_val(pte) & PTE_FILE)
390#define pte_to_pgoff(x) (pte_val(x) >> 4) 393#define pte_to_pgoff(x) (pte_val(x) >> 3)
391#define pgoff_to_pte(x) __pte(((x) << 4) | PTE_FILE) 394#define pgoff_to_pte(x) __pte(((x) << 3) | PTE_FILE)
392 395
393#define PTE_FILE_MAX_BITS 60 396#define PTE_FILE_MAX_BITS 55
394 397
395extern int kern_addr_valid(unsigned long addr); 398extern int kern_addr_valid(unsigned long addr);
396 399
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index 23a3c4791d86..720e70b66ffd 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -89,12 +89,6 @@ static inline struct thread_info *current_thread_info(void)
89#endif 89#endif
90 90
91/* 91/*
92 * We use bit 30 of the preempt_count to indicate that kernel
93 * preemption is occurring. See <asm/hardirq.h>.
94 */
95#define PREEMPT_ACTIVE 0x40000000
96
97/*
98 * thread information flags: 92 * thread information flags:
99 * TIF_SYSCALL_TRACE - syscall trace active 93 * TIF_SYSCALL_TRACE - syscall trace active
100 * TIF_SIGPENDING - signal pending 94 * TIF_SIGPENDING - signal pending
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 6a0a9b132d7a..4ae68579031d 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -248,7 +248,8 @@ static int brk_handler(unsigned long addr, unsigned int esr,
248int aarch32_break_handler(struct pt_regs *regs) 248int aarch32_break_handler(struct pt_regs *regs)
249{ 249{
250 siginfo_t info; 250 siginfo_t info;
251 unsigned int instr; 251 u32 arm_instr;
252 u16 thumb_instr;
252 bool bp = false; 253 bool bp = false;
253 void __user *pc = (void __user *)instruction_pointer(regs); 254 void __user *pc = (void __user *)instruction_pointer(regs);
254 255
@@ -257,18 +258,21 @@ int aarch32_break_handler(struct pt_regs *regs)
257 258
258 if (compat_thumb_mode(regs)) { 259 if (compat_thumb_mode(regs)) {
259 /* get 16-bit Thumb instruction */ 260 /* get 16-bit Thumb instruction */
260 get_user(instr, (u16 __user *)pc); 261 get_user(thumb_instr, (u16 __user *)pc);
261 if (instr == AARCH32_BREAK_THUMB2_LO) { 262 thumb_instr = le16_to_cpu(thumb_instr);
263 if (thumb_instr == AARCH32_BREAK_THUMB2_LO) {
262 /* get second half of 32-bit Thumb-2 instruction */ 264 /* get second half of 32-bit Thumb-2 instruction */
263 get_user(instr, (u16 __user *)(pc + 2)); 265 get_user(thumb_instr, (u16 __user *)(pc + 2));
264 bp = instr == AARCH32_BREAK_THUMB2_HI; 266 thumb_instr = le16_to_cpu(thumb_instr);
267 bp = thumb_instr == AARCH32_BREAK_THUMB2_HI;
265 } else { 268 } else {
266 bp = instr == AARCH32_BREAK_THUMB; 269 bp = thumb_instr == AARCH32_BREAK_THUMB;
267 } 270 }
268 } else { 271 } else {
269 /* 32-bit ARM instruction */ 272 /* 32-bit ARM instruction */
270 get_user(instr, (u32 __user *)pc); 273 get_user(arm_instr, (u32 __user *)pc);
271 bp = (instr & ~0xf0000000) == AARCH32_BREAK_ARM; 274 arm_instr = le32_to_cpu(arm_instr);
275 bp = (arm_instr & ~0xf0000000) == AARCH32_BREAK_ARM;
272 } 276 }
273 277
274 if (!bp) 278 if (!bp)
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index e1166145ca29..4d2c6f3f0c41 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -309,15 +309,12 @@ el1_irq:
309#ifdef CONFIG_TRACE_IRQFLAGS 309#ifdef CONFIG_TRACE_IRQFLAGS
310 bl trace_hardirqs_off 310 bl trace_hardirqs_off
311#endif 311#endif
312#ifdef CONFIG_PREEMPT 312
313 get_thread_info tsk
314 ldr w24, [tsk, #TI_PREEMPT] // get preempt count
315 add w0, w24, #1 // increment it
316 str w0, [tsk, #TI_PREEMPT]
317#endif
318 irq_handler 313 irq_handler
314
319#ifdef CONFIG_PREEMPT 315#ifdef CONFIG_PREEMPT
320 str w24, [tsk, #TI_PREEMPT] // restore preempt count 316 get_thread_info tsk
317 ldr w24, [tsk, #TI_PREEMPT] // restore preempt count
321 cbnz w24, 1f // preempt count != 0 318 cbnz w24, 1f // preempt count != 0
322 ldr x0, [tsk, #TI_FLAGS] // get flags 319 ldr x0, [tsk, #TI_FLAGS] // get flags
323 tbz x0, #TIF_NEED_RESCHED, 1f // needs rescheduling? 320 tbz x0, #TIF_NEED_RESCHED, 1f // needs rescheduling?
@@ -507,22 +504,10 @@ el0_irq_naked:
507#ifdef CONFIG_TRACE_IRQFLAGS 504#ifdef CONFIG_TRACE_IRQFLAGS
508 bl trace_hardirqs_off 505 bl trace_hardirqs_off
509#endif 506#endif
510 get_thread_info tsk 507
511#ifdef CONFIG_PREEMPT
512 ldr w24, [tsk, #TI_PREEMPT] // get preempt count
513 add w23, w24, #1 // increment it
514 str w23, [tsk, #TI_PREEMPT]
515#endif
516 irq_handler 508 irq_handler
517#ifdef CONFIG_PREEMPT 509 get_thread_info tsk
518 ldr w0, [tsk, #TI_PREEMPT] 510
519 str w24, [tsk, #TI_PREEMPT]
520 cmp w0, w23
521 b.eq 1f
522 mov x1, #0
523 str x1, [x1] // BUG
5241:
525#endif
526#ifdef CONFIG_TRACE_IRQFLAGS 511#ifdef CONFIG_TRACE_IRQFLAGS
527 bl trace_hardirqs_on 512 bl trace_hardirqs_on
528#endif 513#endif
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 7009387348b7..c68cca5c3523 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -282,8 +282,9 @@ ENDPROC(secondary_holding_pen)
282 * be used where CPUs are brought online dynamically by the kernel. 282 * be used where CPUs are brought online dynamically by the kernel.
283 */ 283 */
284ENTRY(secondary_entry) 284ENTRY(secondary_entry)
285 bl __calc_phys_offset // x2=phys offset
286 bl el2_setup // Drop to EL1 285 bl el2_setup // Drop to EL1
286 bl __calc_phys_offset // x24=PHYS_OFFSET, x28=PHYS_OFFSET-PAGE_OFFSET
287 bl set_cpu_boot_mode_flag
287 b secondary_startup 288 b secondary_startup
288ENDPROC(secondary_entry) 289ENDPROC(secondary_entry)
289 290
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index fecdbf7de82e..6777a2192b83 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -636,28 +636,27 @@ static int compat_gpr_get(struct task_struct *target,
636 636
637 for (i = 0; i < num_regs; ++i) { 637 for (i = 0; i < num_regs; ++i) {
638 unsigned int idx = start + i; 638 unsigned int idx = start + i;
639 void *reg; 639 compat_ulong_t reg;
640 640
641 switch (idx) { 641 switch (idx) {
642 case 15: 642 case 15:
643 reg = (void *)&task_pt_regs(target)->pc; 643 reg = task_pt_regs(target)->pc;
644 break; 644 break;
645 case 16: 645 case 16:
646 reg = (void *)&task_pt_regs(target)->pstate; 646 reg = task_pt_regs(target)->pstate;
647 break; 647 break;
648 case 17: 648 case 17:
649 reg = (void *)&task_pt_regs(target)->orig_x0; 649 reg = task_pt_regs(target)->orig_x0;
650 break; 650 break;
651 default: 651 default:
652 reg = (void *)&task_pt_regs(target)->regs[idx]; 652 reg = task_pt_regs(target)->regs[idx];
653 } 653 }
654 654
655 ret = copy_to_user(ubuf, reg, sizeof(compat_ulong_t)); 655 ret = copy_to_user(ubuf, &reg, sizeof(reg));
656
657 if (ret) 656 if (ret)
658 break; 657 break;
659 else 658
660 ubuf += sizeof(compat_ulong_t); 659 ubuf += sizeof(reg);
661 } 660 }
662 661
663 return ret; 662 return ret;
@@ -685,28 +684,28 @@ static int compat_gpr_set(struct task_struct *target,
685 684
686 for (i = 0; i < num_regs; ++i) { 685 for (i = 0; i < num_regs; ++i) {
687 unsigned int idx = start + i; 686 unsigned int idx = start + i;
688 void *reg; 687 compat_ulong_t reg;
688
689 ret = copy_from_user(&reg, ubuf, sizeof(reg));
690 if (ret)
691 return ret;
692
693 ubuf += sizeof(reg);
689 694
690 switch (idx) { 695 switch (idx) {
691 case 15: 696 case 15:
692 reg = (void *)&newregs.pc; 697 newregs.pc = reg;
693 break; 698 break;
694 case 16: 699 case 16:
695 reg = (void *)&newregs.pstate; 700 newregs.pstate = reg;
696 break; 701 break;
697 case 17: 702 case 17:
698 reg = (void *)&newregs.orig_x0; 703 newregs.orig_x0 = reg;
699 break; 704 break;
700 default: 705 default:
701 reg = (void *)&newregs.regs[idx]; 706 newregs.regs[idx] = reg;
702 } 707 }
703 708
704 ret = copy_from_user(reg, ubuf, sizeof(compat_ulong_t));
705
706 if (ret)
707 goto out;
708 else
709 ubuf += sizeof(compat_ulong_t);
710 } 709 }
711 710
712 if (valid_user_regs(&newregs.user_regs)) 711 if (valid_user_regs(&newregs.user_regs))
@@ -714,7 +713,6 @@ static int compat_gpr_set(struct task_struct *target,
714 else 713 else
715 ret = -EINVAL; 714 ret = -EINVAL;
716 715
717out:
718 return ret; 716 return ret;
719} 717}
720 718
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 0bc5e4cbc017..bd9bbd0e44ed 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -205,6 +205,11 @@ u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
205 205
206void __init setup_arch(char **cmdline_p) 206void __init setup_arch(char **cmdline_p)
207{ 207{
208 /*
209 * Unmask asynchronous aborts early to catch possible system errors.
210 */
211 local_async_enable();
212
208 setup_processor(); 213 setup_processor();
209 214
210 setup_machine_fdt(__fdt_pointer); 215 setup_machine_fdt(__fdt_pointer);
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index a5aeefab03c3..a0c2ca602cf8 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -160,6 +160,7 @@ asmlinkage void secondary_start_kernel(void)
160 160
161 local_irq_enable(); 161 local_irq_enable();
162 local_fiq_enable(); 162 local_fiq_enable();
163 local_async_enable();
163 164
164 /* 165 /*
165 * OK, it's off to the idle thread for us 166 * OK, it's off to the idle thread for us
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 421b99fd635d..0f7fec52c7f8 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -111,12 +111,12 @@ ENTRY(__cpu_setup)
111 bl __flush_dcache_all 111 bl __flush_dcache_all
112 mov lr, x28 112 mov lr, x28
113 ic iallu // I+BTB cache invalidate 113 ic iallu // I+BTB cache invalidate
114 tlbi vmalle1is // invalidate I + D TLBs
114 dsb sy 115 dsb sy
115 116
116 mov x0, #3 << 20 117 mov x0, #3 << 20
117 msr cpacr_el1, x0 // Enable FP/ASIMD 118 msr cpacr_el1, x0 // Enable FP/ASIMD
118 msr mdscr_el1, xzr // Reset mdscr_el1 119 msr mdscr_el1, xzr // Reset mdscr_el1
119 tlbi vmalle1is // invalidate I + D TLBs
120 /* 120 /*
121 * Memory region attributes for LPAE: 121 * Memory region attributes for LPAE:
122 * 122 *
diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c
index 7b1f2cd85400..1f121497b517 100644
--- a/arch/avr32/boards/favr-32/setup.c
+++ b/arch/avr32/boards/favr-32/setup.c
@@ -298,8 +298,10 @@ static int __init set_abdac_rate(struct platform_device *pdev)
298 */ 298 */
299 retval = clk_round_rate(pll1, 299 retval = clk_round_rate(pll1,
300 CONFIG_BOARD_FAVR32_ABDAC_RATE * 256 * 16); 300 CONFIG_BOARD_FAVR32_ABDAC_RATE * 256 * 16);
301 if (retval < 0) 301 if (retval <= 0) {
302 retval = -EINVAL;
302 goto out_abdac; 303 goto out_abdac;
304 }
303 305
304 retval = clk_set_rate(pll1, retval); 306 retval = clk_set_rate(pll1, retval);
305 if (retval != 0) 307 if (retval != 0)
diff --git a/arch/avr32/boot/u-boot/head.S b/arch/avr32/boot/u-boot/head.S
index 4488fa27fe94..2ffc298f061b 100644
--- a/arch/avr32/boot/u-boot/head.S
+++ b/arch/avr32/boot/u-boot/head.S
@@ -8,6 +8,8 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <asm/setup.h> 10#include <asm/setup.h>
11#include <asm/thread_info.h>
12#include <asm/sysreg.h>
11 13
12 /* 14 /*
13 * The kernel is loaded where we want it to be and all caches 15 * The kernel is loaded where we want it to be and all caches
@@ -20,11 +22,6 @@
20 .section .init.text,"ax" 22 .section .init.text,"ax"
21 .global _start 23 .global _start
22_start: 24_start:
23 /* Check if the boot loader actually provided a tag table */
24 lddpc r0, magic_number
25 cp.w r12, r0
26 brne no_tag_table
27
28 /* Initialize .bss */ 25 /* Initialize .bss */
29 lddpc r2, bss_start_addr 26 lddpc r2, bss_start_addr
30 lddpc r3, end_addr 27 lddpc r3, end_addr
@@ -34,6 +31,25 @@ _start:
34 cp r2, r3 31 cp r2, r3
35 brlo 1b 32 brlo 1b
36 33
34 /* Initialize status register */
35 lddpc r0, init_sr
36 mtsr SYSREG_SR, r0
37
38 /* Set initial stack pointer */
39 lddpc sp, stack_addr
40 sub sp, -THREAD_SIZE
41
42#ifdef CONFIG_FRAME_POINTER
43 /* Mark last stack frame */
44 mov lr, 0
45 mov r7, 0
46#endif
47
48 /* Check if the boot loader actually provided a tag table */
49 lddpc r0, magic_number
50 cp.w r12, r0
51 brne no_tag_table
52
37 /* 53 /*
38 * Save the tag table address for later use. This must be done 54 * Save the tag table address for later use. This must be done
39 * _after_ .bss has been initialized... 55 * _after_ .bss has been initialized...
@@ -53,8 +69,15 @@ bss_start_addr:
53 .long __bss_start 69 .long __bss_start
54end_addr: 70end_addr:
55 .long _end 71 .long _end
72init_sr:
73 .long 0x007f0000 /* Supervisor mode, everything masked */
74stack_addr:
75 .long init_thread_union
76panic_addr:
77 .long panic
56 78
57no_tag_table: 79no_tag_table:
58 sub r12, pc, (. - 2f) 80 sub r12, pc, (. - 2f)
59 bral panic 81 /* branch to panic() which can be far away with that construct */
82 lddpc pc, panic_addr
602: .asciz "Boot loader didn't provide correct magic number\n" 832: .asciz "Boot loader didn't provide correct magic number\n"
diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig
index d5aff36ade92..4733e38e7ae6 100644
--- a/arch/avr32/configs/atngw100_defconfig
+++ b/arch/avr32/configs/atngw100_defconfig
@@ -59,7 +59,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
59# CONFIG_PREVENT_FIRMWARE_BUILD is not set 59# CONFIG_PREVENT_FIRMWARE_BUILD is not set
60# CONFIG_FW_LOADER is not set 60# CONFIG_FW_LOADER is not set
61CONFIG_MTD=y 61CONFIG_MTD=y
62CONFIG_MTD_PARTITIONS=y
63CONFIG_MTD_CMDLINE_PARTS=y 62CONFIG_MTD_CMDLINE_PARTS=y
64CONFIG_MTD_CHAR=y 63CONFIG_MTD_CHAR=y
65CONFIG_MTD_BLOCK=y 64CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atngw100_evklcd100_defconfig b/arch/avr32/configs/atngw100_evklcd100_defconfig
index 4abcf435d599..1be0ee31bd91 100644
--- a/arch/avr32/configs/atngw100_evklcd100_defconfig
+++ b/arch/avr32/configs/atngw100_evklcd100_defconfig
@@ -61,7 +61,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
61# CONFIG_PREVENT_FIRMWARE_BUILD is not set 61# CONFIG_PREVENT_FIRMWARE_BUILD is not set
62# CONFIG_FW_LOADER is not set 62# CONFIG_FW_LOADER is not set
63CONFIG_MTD=y 63CONFIG_MTD=y
64CONFIG_MTD_PARTITIONS=y
65CONFIG_MTD_CMDLINE_PARTS=y 64CONFIG_MTD_CMDLINE_PARTS=y
66CONFIG_MTD_CHAR=y 65CONFIG_MTD_CHAR=y
67CONFIG_MTD_BLOCK=y 66CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atngw100_evklcd101_defconfig b/arch/avr32/configs/atngw100_evklcd101_defconfig
index 18f3fa0470ff..796e536f7bc4 100644
--- a/arch/avr32/configs/atngw100_evklcd101_defconfig
+++ b/arch/avr32/configs/atngw100_evklcd101_defconfig
@@ -60,7 +60,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
60# CONFIG_PREVENT_FIRMWARE_BUILD is not set 60# CONFIG_PREVENT_FIRMWARE_BUILD is not set
61# CONFIG_FW_LOADER is not set 61# CONFIG_FW_LOADER is not set
62CONFIG_MTD=y 62CONFIG_MTD=y
63CONFIG_MTD_PARTITIONS=y
64CONFIG_MTD_CMDLINE_PARTS=y 63CONFIG_MTD_CMDLINE_PARTS=y
65CONFIG_MTD_CHAR=y 64CONFIG_MTD_CHAR=y
66CONFIG_MTD_BLOCK=y 65CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atngw100_mrmt_defconfig b/arch/avr32/configs/atngw100_mrmt_defconfig
index 06e389cfcd12..9a57da44eb6f 100644
--- a/arch/avr32/configs/atngw100_mrmt_defconfig
+++ b/arch/avr32/configs/atngw100_mrmt_defconfig
@@ -48,7 +48,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
48# CONFIG_PREVENT_FIRMWARE_BUILD is not set 48# CONFIG_PREVENT_FIRMWARE_BUILD is not set
49# CONFIG_FW_LOADER is not set 49# CONFIG_FW_LOADER is not set
50CONFIG_MTD=y 50CONFIG_MTD=y
51CONFIG_MTD_PARTITIONS=y
52CONFIG_MTD_CMDLINE_PARTS=y 51CONFIG_MTD_CMDLINE_PARTS=y
53CONFIG_MTD_CHAR=y 52CONFIG_MTD_CHAR=y
54CONFIG_MTD_BLOCK=y 53CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atngw100mkii_defconfig b/arch/avr32/configs/atngw100mkii_defconfig
index 2518a1368d7c..97fe1b399b06 100644
--- a/arch/avr32/configs/atngw100mkii_defconfig
+++ b/arch/avr32/configs/atngw100mkii_defconfig
@@ -59,7 +59,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
59# CONFIG_PREVENT_FIRMWARE_BUILD is not set 59# CONFIG_PREVENT_FIRMWARE_BUILD is not set
60# CONFIG_FW_LOADER is not set 60# CONFIG_FW_LOADER is not set
61CONFIG_MTD=y 61CONFIG_MTD=y
62CONFIG_MTD_PARTITIONS=y
63CONFIG_MTD_CMDLINE_PARTS=y 62CONFIG_MTD_CMDLINE_PARTS=y
64CONFIG_MTD_CHAR=y 63CONFIG_MTD_CHAR=y
65CONFIG_MTD_BLOCK=y 64CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig
index 245ef6bd0fa6..a176d24467e9 100644
--- a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig
+++ b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig
@@ -62,7 +62,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
62# CONFIG_PREVENT_FIRMWARE_BUILD is not set 62# CONFIG_PREVENT_FIRMWARE_BUILD is not set
63# CONFIG_FW_LOADER is not set 63# CONFIG_FW_LOADER is not set
64CONFIG_MTD=y 64CONFIG_MTD=y
65CONFIG_MTD_PARTITIONS=y
66CONFIG_MTD_CMDLINE_PARTS=y 65CONFIG_MTD_CMDLINE_PARTS=y
67CONFIG_MTD_CHAR=y 66CONFIG_MTD_CHAR=y
68CONFIG_MTD_BLOCK=y 67CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig
index fa6cbac6e418..d1bf6dcfc47d 100644
--- a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig
+++ b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig
@@ -61,7 +61,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
61# CONFIG_PREVENT_FIRMWARE_BUILD is not set 61# CONFIG_PREVENT_FIRMWARE_BUILD is not set
62# CONFIG_FW_LOADER is not set 62# CONFIG_FW_LOADER is not set
63CONFIG_MTD=y 63CONFIG_MTD=y
64CONFIG_MTD_PARTITIONS=y
65CONFIG_MTD_CMDLINE_PARTS=y 64CONFIG_MTD_CMDLINE_PARTS=y
66CONFIG_MTD_CHAR=y 65CONFIG_MTD_CHAR=y
67CONFIG_MTD_BLOCK=y 66CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig
index bbd5131021a5..2813dd2b9138 100644
--- a/arch/avr32/configs/atstk1002_defconfig
+++ b/arch/avr32/configs/atstk1002_defconfig
@@ -53,7 +53,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
53# CONFIG_PREVENT_FIRMWARE_BUILD is not set 53# CONFIG_PREVENT_FIRMWARE_BUILD is not set
54# CONFIG_FW_LOADER is not set 54# CONFIG_FW_LOADER is not set
55CONFIG_MTD=y 55CONFIG_MTD=y
56CONFIG_MTD_PARTITIONS=y
57CONFIG_MTD_CMDLINE_PARTS=y 56CONFIG_MTD_CMDLINE_PARTS=y
58CONFIG_MTD_CHAR=y 57CONFIG_MTD_CHAR=y
59CONFIG_MTD_BLOCK=y 58CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atstk1003_defconfig b/arch/avr32/configs/atstk1003_defconfig
index c1cd726f9012..f8ff3a3baad4 100644
--- a/arch/avr32/configs/atstk1003_defconfig
+++ b/arch/avr32/configs/atstk1003_defconfig
@@ -42,7 +42,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
42# CONFIG_PREVENT_FIRMWARE_BUILD is not set 42# CONFIG_PREVENT_FIRMWARE_BUILD is not set
43# CONFIG_FW_LOADER is not set 43# CONFIG_FW_LOADER is not set
44CONFIG_MTD=y 44CONFIG_MTD=y
45CONFIG_MTD_PARTITIONS=y
46CONFIG_MTD_CMDLINE_PARTS=y 45CONFIG_MTD_CMDLINE_PARTS=y
47CONFIG_MTD_CHAR=y 46CONFIG_MTD_CHAR=y
48CONFIG_MTD_BLOCK=y 47CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atstk1004_defconfig b/arch/avr32/configs/atstk1004_defconfig
index 754ae56b2767..992228e54e38 100644
--- a/arch/avr32/configs/atstk1004_defconfig
+++ b/arch/avr32/configs/atstk1004_defconfig
@@ -42,7 +42,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
42# CONFIG_PREVENT_FIRMWARE_BUILD is not set 42# CONFIG_PREVENT_FIRMWARE_BUILD is not set
43# CONFIG_FW_LOADER is not set 43# CONFIG_FW_LOADER is not set
44CONFIG_MTD=y 44CONFIG_MTD=y
45CONFIG_MTD_PARTITIONS=y
46CONFIG_MTD_CMDLINE_PARTS=y 45CONFIG_MTD_CMDLINE_PARTS=y
47CONFIG_MTD_CHAR=y 46CONFIG_MTD_CHAR=y
48CONFIG_MTD_BLOCK=y 47CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/atstk1006_defconfig b/arch/avr32/configs/atstk1006_defconfig
index 58589d8cc0ac..b8e698b0d1fa 100644
--- a/arch/avr32/configs/atstk1006_defconfig
+++ b/arch/avr32/configs/atstk1006_defconfig
@@ -54,7 +54,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
54# CONFIG_PREVENT_FIRMWARE_BUILD is not set 54# CONFIG_PREVENT_FIRMWARE_BUILD is not set
55# CONFIG_FW_LOADER is not set 55# CONFIG_FW_LOADER is not set
56CONFIG_MTD=y 56CONFIG_MTD=y
57CONFIG_MTD_PARTITIONS=y
58CONFIG_MTD_CMDLINE_PARTS=y 57CONFIG_MTD_CMDLINE_PARTS=y
59CONFIG_MTD_CHAR=y 58CONFIG_MTD_CHAR=y
60CONFIG_MTD_BLOCK=y 59CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/favr-32_defconfig b/arch/avr32/configs/favr-32_defconfig
index c90fbf6d35bc..07bed3f7eb5e 100644
--- a/arch/avr32/configs/favr-32_defconfig
+++ b/arch/avr32/configs/favr-32_defconfig
@@ -58,7 +58,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
58# CONFIG_PREVENT_FIRMWARE_BUILD is not set 58# CONFIG_PREVENT_FIRMWARE_BUILD is not set
59# CONFIG_FW_LOADER is not set 59# CONFIG_FW_LOADER is not set
60CONFIG_MTD=y 60CONFIG_MTD=y
61CONFIG_MTD_PARTITIONS=y
62CONFIG_MTD_CMDLINE_PARTS=y 61CONFIG_MTD_CMDLINE_PARTS=y
63CONFIG_MTD_CHAR=y 62CONFIG_MTD_CHAR=y
64CONFIG_MTD_BLOCK=y 63CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/hammerhead_defconfig b/arch/avr32/configs/hammerhead_defconfig
index ba7c31e269cb..18db853386c8 100644
--- a/arch/avr32/configs/hammerhead_defconfig
+++ b/arch/avr32/configs/hammerhead_defconfig
@@ -58,7 +58,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
58# CONFIG_PREVENT_FIRMWARE_BUILD is not set 58# CONFIG_PREVENT_FIRMWARE_BUILD is not set
59# CONFIG_FW_LOADER is not set 59# CONFIG_FW_LOADER is not set
60CONFIG_MTD=y 60CONFIG_MTD=y
61CONFIG_MTD_PARTITIONS=y
62CONFIG_MTD_CMDLINE_PARTS=y 61CONFIG_MTD_CMDLINE_PARTS=y
63CONFIG_MTD_CHAR=y 62CONFIG_MTD_CHAR=y
64CONFIG_MTD_BLOCK=y 63CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/configs/merisc_defconfig b/arch/avr32/configs/merisc_defconfig
index 65de4431108c..91df6b2986be 100644
--- a/arch/avr32/configs/merisc_defconfig
+++ b/arch/avr32/configs/merisc_defconfig
@@ -46,7 +46,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
46# CONFIG_FW_LOADER is not set 46# CONFIG_FW_LOADER is not set
47CONFIG_MTD=y 47CONFIG_MTD=y
48CONFIG_MTD_CONCAT=y 48CONFIG_MTD_CONCAT=y
49CONFIG_MTD_PARTITIONS=y
50CONFIG_MTD_CHAR=y 49CONFIG_MTD_CHAR=y
51CONFIG_MTD_BLOCK=y 50CONFIG_MTD_BLOCK=y
52CONFIG_MTD_CFI=y 51CONFIG_MTD_CFI=y
diff --git a/arch/avr32/configs/mimc200_defconfig b/arch/avr32/configs/mimc200_defconfig
index 0a8bfdc420e0..d630e089dd32 100644
--- a/arch/avr32/configs/mimc200_defconfig
+++ b/arch/avr32/configs/mimc200_defconfig
@@ -49,7 +49,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
49# CONFIG_PREVENT_FIRMWARE_BUILD is not set 49# CONFIG_PREVENT_FIRMWARE_BUILD is not set
50# CONFIG_FW_LOADER is not set 50# CONFIG_FW_LOADER is not set
51CONFIG_MTD=y 51CONFIG_MTD=y
52CONFIG_MTD_PARTITIONS=y
53CONFIG_MTD_CMDLINE_PARTS=y 52CONFIG_MTD_CMDLINE_PARTS=y
54CONFIG_MTD_CHAR=y 53CONFIG_MTD_CHAR=y
55CONFIG_MTD_BLOCK=y 54CONFIG_MTD_BLOCK=y
diff --git a/arch/avr32/include/asm/kprobes.h b/arch/avr32/include/asm/kprobes.h
index 996cb656474e..45f563ed73fd 100644
--- a/arch/avr32/include/asm/kprobes.h
+++ b/arch/avr32/include/asm/kprobes.h
@@ -16,6 +16,7 @@
16typedef u16 kprobe_opcode_t; 16typedef u16 kprobe_opcode_t;
17#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */ 17#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */
18#define MAX_INSN_SIZE 2 18#define MAX_INSN_SIZE 2
19#define MAX_STACK_SIZE 64 /* 32 would probably be OK */
19 20
20#define kretprobe_blacklist_size 0 21#define kretprobe_blacklist_size 0
21 22
@@ -26,6 +27,19 @@ struct arch_specific_insn {
26 kprobe_opcode_t insn[MAX_INSN_SIZE]; 27 kprobe_opcode_t insn[MAX_INSN_SIZE];
27}; 28};
28 29
30struct prev_kprobe {
31 struct kprobe *kp;
32 unsigned int status;
33};
34
35/* per-cpu kprobe control block */
36struct kprobe_ctlblk {
37 unsigned int kprobe_status;
38 struct prev_kprobe prev_kprobe;
39 struct pt_regs jprobe_saved_regs;
40 char jprobes_stack[MAX_STACK_SIZE];
41};
42
29extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 43extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
30extern int kprobe_exceptions_notify(struct notifier_block *self, 44extern int kprobe_exceptions_notify(struct notifier_block *self,
31 unsigned long val, void *data); 45 unsigned long val, void *data);
diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
index 6dc62e1f94c7..a978f3fe7c25 100644
--- a/arch/avr32/include/asm/thread_info.h
+++ b/arch/avr32/include/asm/thread_info.h
@@ -66,8 +66,6 @@ static inline struct thread_info *current_thread_info(void)
66 66
67#endif /* !__ASSEMBLY__ */ 67#endif /* !__ASSEMBLY__ */
68 68
69#define PREEMPT_ACTIVE 0x40000000
70
71/* 69/*
72 * Thread information flags 70 * Thread information flags
73 * - these are process state flags that various assembly files may need to access 71 * - these are process state flags that various assembly files may need to access
diff --git a/arch/avr32/include/uapi/asm/Kbuild b/arch/avr32/include/uapi/asm/Kbuild
index 3b85eaddf525..08d8a3d76ea8 100644
--- a/arch/avr32/include/uapi/asm/Kbuild
+++ b/arch/avr32/include/uapi/asm/Kbuild
@@ -2,35 +2,35 @@
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4header-y += auxvec.h 4header-y += auxvec.h
5header-y += bitsperlong.h
6header-y += byteorder.h 5header-y += byteorder.h
7header-y += cachectl.h 6header-y += cachectl.h
8header-y += errno.h
9header-y += fcntl.h
10header-y += ioctl.h
11header-y += ioctls.h
12header-y += ipcbuf.h
13header-y += kvm_para.h
14header-y += mman.h
15header-y += msgbuf.h 7header-y += msgbuf.h
16header-y += param.h 8header-y += param.h
17header-y += poll.h
18header-y += posix_types.h 9header-y += posix_types.h
19header-y += ptrace.h 10header-y += ptrace.h
20header-y += resource.h
21header-y += sembuf.h 11header-y += sembuf.h
22header-y += setup.h 12header-y += setup.h
23header-y += shmbuf.h 13header-y += shmbuf.h
24header-y += sigcontext.h 14header-y += sigcontext.h
25header-y += siginfo.h
26header-y += signal.h 15header-y += signal.h
27header-y += socket.h 16header-y += socket.h
28header-y += sockios.h 17header-y += sockios.h
29header-y += stat.h 18header-y += stat.h
30header-y += statfs.h
31header-y += swab.h 19header-y += swab.h
32header-y += termbits.h 20header-y += termbits.h
33header-y += termios.h 21header-y += termios.h
34header-y += types.h 22header-y += types.h
35header-y += unistd.h 23header-y += unistd.h
24generic-y += bitsperlong.h
25generic-y += errno.h
26generic-y += fcntl.h
27generic-y += ioctl.h
28generic-y += ioctls.h
29generic-y += ipcbuf.h
30generic-y += kvm_para.h
31generic-y += mman.h
36generic-y += param.h 32generic-y += param.h
33generic-y += poll.h
34generic-y += resource.h
35generic-y += siginfo.h
36generic-y += statfs.h
diff --git a/arch/avr32/include/uapi/asm/auxvec.h b/arch/avr32/include/uapi/asm/auxvec.h
index d5dd435bf8f4..4f02da3ffefa 100644
--- a/arch/avr32/include/uapi/asm/auxvec.h
+++ b/arch/avr32/include/uapi/asm/auxvec.h
@@ -1,4 +1,4 @@
1#ifndef __ASM_AVR32_AUXVEC_H 1#ifndef _UAPI__ASM_AVR32_AUXVEC_H
2#define __ASM_AVR32_AUXVEC_H 2#define _UAPI__ASM_AVR32_AUXVEC_H
3 3
4#endif /* __ASM_AVR32_AUXVEC_H */ 4#endif /* _UAPI__ASM_AVR32_AUXVEC_H */
diff --git a/arch/avr32/include/uapi/asm/bitsperlong.h b/arch/avr32/include/uapi/asm/bitsperlong.h
deleted file mode 100644
index 6dc0bb0c13b2..000000000000
--- a/arch/avr32/include/uapi/asm/bitsperlong.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/bitsperlong.h>
diff --git a/arch/avr32/include/uapi/asm/byteorder.h b/arch/avr32/include/uapi/asm/byteorder.h
index 50abc21619a8..71242f0d39c6 100644
--- a/arch/avr32/include/uapi/asm/byteorder.h
+++ b/arch/avr32/include/uapi/asm/byteorder.h
@@ -1,9 +1,9 @@
1/* 1/*
2 * AVR32 endian-conversion functions. 2 * AVR32 endian-conversion functions.
3 */ 3 */
4#ifndef __ASM_AVR32_BYTEORDER_H 4#ifndef _UAPI__ASM_AVR32_BYTEORDER_H
5#define __ASM_AVR32_BYTEORDER_H 5#define _UAPI__ASM_AVR32_BYTEORDER_H
6 6
7#include <linux/byteorder/big_endian.h> 7#include <linux/byteorder/big_endian.h>
8 8
9#endif /* __ASM_AVR32_BYTEORDER_H */ 9#endif /* _UAPI__ASM_AVR32_BYTEORDER_H */
diff --git a/arch/avr32/include/uapi/asm/cachectl.h b/arch/avr32/include/uapi/asm/cachectl.h
index 4faf1ce60061..573a9584dd57 100644
--- a/arch/avr32/include/uapi/asm/cachectl.h
+++ b/arch/avr32/include/uapi/asm/cachectl.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_AVR32_CACHECTL_H 1#ifndef _UAPI__ASM_AVR32_CACHECTL_H
2#define __ASM_AVR32_CACHECTL_H 2#define _UAPI__ASM_AVR32_CACHECTL_H
3 3
4/* 4/*
5 * Operations that can be performed through the cacheflush system call 5 * Operations that can be performed through the cacheflush system call
@@ -8,4 +8,4 @@
8/* Clean the data cache, then invalidate the icache */ 8/* Clean the data cache, then invalidate the icache */
9#define CACHE_IFLUSH 0 9#define CACHE_IFLUSH 0
10 10
11#endif /* __ASM_AVR32_CACHECTL_H */ 11#endif /* _UAPI__ASM_AVR32_CACHECTL_H */
diff --git a/arch/avr32/include/uapi/asm/errno.h b/arch/avr32/include/uapi/asm/errno.h
deleted file mode 100644
index 558a7249f06d..000000000000
--- a/arch/avr32/include/uapi/asm/errno.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_AVR32_ERRNO_H
2#define __ASM_AVR32_ERRNO_H
3
4#include <asm-generic/errno.h>
5
6#endif /* __ASM_AVR32_ERRNO_H */
diff --git a/arch/avr32/include/uapi/asm/fcntl.h b/arch/avr32/include/uapi/asm/fcntl.h
deleted file mode 100644
index 14c0c4402b11..000000000000
--- a/arch/avr32/include/uapi/asm/fcntl.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_AVR32_FCNTL_H
2#define __ASM_AVR32_FCNTL_H
3
4#include <asm-generic/fcntl.h>
5
6#endif /* __ASM_AVR32_FCNTL_H */
diff --git a/arch/avr32/include/uapi/asm/ioctl.h b/arch/avr32/include/uapi/asm/ioctl.h
deleted file mode 100644
index c8472c1398ef..000000000000
--- a/arch/avr32/include/uapi/asm/ioctl.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_AVR32_IOCTL_H
2#define __ASM_AVR32_IOCTL_H
3
4#include <asm-generic/ioctl.h>
5
6#endif /* __ASM_AVR32_IOCTL_H */
diff --git a/arch/avr32/include/uapi/asm/ioctls.h b/arch/avr32/include/uapi/asm/ioctls.h
deleted file mode 100644
index 909cf66feaf5..000000000000
--- a/arch/avr32/include/uapi/asm/ioctls.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_AVR32_IOCTLS_H
2#define __ASM_AVR32_IOCTLS_H
3
4#include <asm-generic/ioctls.h>
5
6#endif /* __ASM_AVR32_IOCTLS_H */
diff --git a/arch/avr32/include/uapi/asm/ipcbuf.h b/arch/avr32/include/uapi/asm/ipcbuf.h
deleted file mode 100644
index 84c7e51cb6d0..000000000000
--- a/arch/avr32/include/uapi/asm/ipcbuf.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipcbuf.h>
diff --git a/arch/avr32/include/uapi/asm/kvm_para.h b/arch/avr32/include/uapi/asm/kvm_para.h
deleted file mode 100644
index 14fab8f0b957..000000000000
--- a/arch/avr32/include/uapi/asm/kvm_para.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/kvm_para.h>
diff --git a/arch/avr32/include/uapi/asm/mman.h b/arch/avr32/include/uapi/asm/mman.h
deleted file mode 100644
index 8eebf89f5ab1..000000000000
--- a/arch/avr32/include/uapi/asm/mman.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/mman.h>
diff --git a/arch/avr32/include/uapi/asm/msgbuf.h b/arch/avr32/include/uapi/asm/msgbuf.h
index ac18bc4da7f7..9eae6effad14 100644
--- a/arch/avr32/include/uapi/asm/msgbuf.h
+++ b/arch/avr32/include/uapi/asm/msgbuf.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_AVR32_MSGBUF_H 1#ifndef _UAPI__ASM_AVR32_MSGBUF_H
2#define __ASM_AVR32_MSGBUF_H 2#define _UAPI__ASM_AVR32_MSGBUF_H
3 3
4/* 4/*
5 * The msqid64_ds structure for i386 architecture. 5 * The msqid64_ds structure for i386 architecture.
@@ -28,4 +28,4 @@ struct msqid64_ds {
28 unsigned long __unused5; 28 unsigned long __unused5;
29}; 29};
30 30
31#endif /* __ASM_AVR32_MSGBUF_H */ 31#endif /* _UAPI__ASM_AVR32_MSGBUF_H */
diff --git a/arch/avr32/include/uapi/asm/poll.h b/arch/avr32/include/uapi/asm/poll.h
deleted file mode 100644
index c98509d3149e..000000000000
--- a/arch/avr32/include/uapi/asm/poll.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/poll.h>
diff --git a/arch/avr32/include/uapi/asm/posix_types.h b/arch/avr32/include/uapi/asm/posix_types.h
index 9ba9e749b3f3..5b813a8abf09 100644
--- a/arch/avr32/include/uapi/asm/posix_types.h
+++ b/arch/avr32/include/uapi/asm/posix_types.h
@@ -5,8 +5,8 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#ifndef __ASM_AVR32_POSIX_TYPES_H 8#ifndef _UAPI__ASM_AVR32_POSIX_TYPES_H
9#define __ASM_AVR32_POSIX_TYPES_H 9#define _UAPI__ASM_AVR32_POSIX_TYPES_H
10 10
11/* 11/*
12 * This file is generally used by user-level software, so you need to 12 * This file is generally used by user-level software, so you need to
@@ -34,4 +34,4 @@ typedef unsigned short __kernel_old_dev_t;
34 34
35#include <asm-generic/posix_types.h> 35#include <asm-generic/posix_types.h>
36 36
37#endif /* __ASM_AVR32_POSIX_TYPES_H */ 37#endif /* _UAPI__ASM_AVR32_POSIX_TYPES_H */
diff --git a/arch/avr32/include/uapi/asm/resource.h b/arch/avr32/include/uapi/asm/resource.h
deleted file mode 100644
index c6dd101472b1..000000000000
--- a/arch/avr32/include/uapi/asm/resource.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_AVR32_RESOURCE_H
2#define __ASM_AVR32_RESOURCE_H
3
4#include <asm-generic/resource.h>
5
6#endif /* __ASM_AVR32_RESOURCE_H */
diff --git a/arch/avr32/include/uapi/asm/sembuf.h b/arch/avr32/include/uapi/asm/sembuf.h
index e472216e0c97..6c6f7cf1e75a 100644
--- a/arch/avr32/include/uapi/asm/sembuf.h
+++ b/arch/avr32/include/uapi/asm/sembuf.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_AVR32_SEMBUF_H 1#ifndef _UAPI__ASM_AVR32_SEMBUF_H
2#define __ASM_AVR32_SEMBUF_H 2#define _UAPI__ASM_AVR32_SEMBUF_H
3 3
4/* 4/*
5* The semid64_ds structure for AVR32 architecture. 5* The semid64_ds structure for AVR32 architecture.
@@ -22,4 +22,4 @@ struct semid64_ds {
22 unsigned long __unused4; 22 unsigned long __unused4;
23}; 23};
24 24
25#endif /* __ASM_AVR32_SEMBUF_H */ 25#endif /* _UAPI__ASM_AVR32_SEMBUF_H */
diff --git a/arch/avr32/include/uapi/asm/setup.h b/arch/avr32/include/uapi/asm/setup.h
index e58aa9356faf..a654df7dba46 100644
--- a/arch/avr32/include/uapi/asm/setup.h
+++ b/arch/avr32/include/uapi/asm/setup.h
@@ -13,5 +13,4 @@
13 13
14#define COMMAND_LINE_SIZE 256 14#define COMMAND_LINE_SIZE 256
15 15
16
17#endif /* _UAPI__ASM_AVR32_SETUP_H__ */ 16#endif /* _UAPI__ASM_AVR32_SETUP_H__ */
diff --git a/arch/avr32/include/uapi/asm/shmbuf.h b/arch/avr32/include/uapi/asm/shmbuf.h
index c62fba41739a..b94cf8b60b73 100644
--- a/arch/avr32/include/uapi/asm/shmbuf.h
+++ b/arch/avr32/include/uapi/asm/shmbuf.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_AVR32_SHMBUF_H 1#ifndef _UAPI__ASM_AVR32_SHMBUF_H
2#define __ASM_AVR32_SHMBUF_H 2#define _UAPI__ASM_AVR32_SHMBUF_H
3 3
4/* 4/*
5 * The shmid64_ds structure for i386 architecture. 5 * The shmid64_ds structure for i386 architecture.
@@ -39,4 +39,4 @@ struct shminfo64 {
39 unsigned long __unused4; 39 unsigned long __unused4;
40}; 40};
41 41
42#endif /* __ASM_AVR32_SHMBUF_H */ 42#endif /* _UAPI__ASM_AVR32_SHMBUF_H */
diff --git a/arch/avr32/include/uapi/asm/sigcontext.h b/arch/avr32/include/uapi/asm/sigcontext.h
index e04062b5f39f..27e56bf6377f 100644
--- a/arch/avr32/include/uapi/asm/sigcontext.h
+++ b/arch/avr32/include/uapi/asm/sigcontext.h
@@ -5,8 +5,8 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#ifndef __ASM_AVR32_SIGCONTEXT_H 8#ifndef _UAPI__ASM_AVR32_SIGCONTEXT_H
9#define __ASM_AVR32_SIGCONTEXT_H 9#define _UAPI__ASM_AVR32_SIGCONTEXT_H
10 10
11struct sigcontext { 11struct sigcontext {
12 unsigned long oldmask; 12 unsigned long oldmask;
@@ -31,4 +31,4 @@ struct sigcontext {
31 unsigned long r0; 31 unsigned long r0;
32}; 32};
33 33
34#endif /* __ASM_AVR32_SIGCONTEXT_H */ 34#endif /* _UAPI__ASM_AVR32_SIGCONTEXT_H */
diff --git a/arch/avr32/include/uapi/asm/siginfo.h b/arch/avr32/include/uapi/asm/siginfo.h
deleted file mode 100644
index 5ee93f40a8a8..000000000000
--- a/arch/avr32/include/uapi/asm/siginfo.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _AVR32_SIGINFO_H
2#define _AVR32_SIGINFO_H
3
4#include <asm-generic/siginfo.h>
5
6#endif
diff --git a/arch/avr32/include/uapi/asm/signal.h b/arch/avr32/include/uapi/asm/signal.h
index 1b77a93eff50..ffe8c770cafd 100644
--- a/arch/avr32/include/uapi/asm/signal.h
+++ b/arch/avr32/include/uapi/asm/signal.h
@@ -118,5 +118,4 @@ typedef struct sigaltstack {
118 size_t ss_size; 118 size_t ss_size;
119} stack_t; 119} stack_t;
120 120
121
122#endif /* _UAPI__ASM_AVR32_SIGNAL_H */ 121#endif /* _UAPI__ASM_AVR32_SIGNAL_H */
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 439936421434..cbf902e4cd9e 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_AVR32_SOCKET_H 1#ifndef _UAPI__ASM_AVR32_SOCKET_H
2#define __ASM_AVR32_SOCKET_H 2#define _UAPI__ASM_AVR32_SOCKET_H
3 3
4#include <asm/sockios.h> 4#include <asm/sockios.h>
5 5
@@ -78,4 +78,4 @@
78 78
79#define SO_MAX_PACING_RATE 47 79#define SO_MAX_PACING_RATE 47
80 80
81#endif /* __ASM_AVR32_SOCKET_H */ 81#endif /* _UAPI__ASM_AVR32_SOCKET_H */
diff --git a/arch/avr32/include/uapi/asm/sockios.h b/arch/avr32/include/uapi/asm/sockios.h
index 0802d742f97d..d04785453532 100644
--- a/arch/avr32/include/uapi/asm/sockios.h
+++ b/arch/avr32/include/uapi/asm/sockios.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_AVR32_SOCKIOS_H 1#ifndef _UAPI__ASM_AVR32_SOCKIOS_H
2#define __ASM_AVR32_SOCKIOS_H 2#define _UAPI__ASM_AVR32_SOCKIOS_H
3 3
4/* Socket-level I/O control calls. */ 4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901 5#define FIOSETOWN 0x8901
@@ -10,4 +10,4 @@
10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ 10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ 11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
12 12
13#endif /* __ASM_AVR32_SOCKIOS_H */ 13#endif /* _UAPI__ASM_AVR32_SOCKIOS_H */
diff --git a/arch/avr32/include/uapi/asm/stat.h b/arch/avr32/include/uapi/asm/stat.h
index e72881e10230..c06acef7fce7 100644
--- a/arch/avr32/include/uapi/asm/stat.h
+++ b/arch/avr32/include/uapi/asm/stat.h
@@ -5,8 +5,8 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#ifndef __ASM_AVR32_STAT_H 8#ifndef _UAPI__ASM_AVR32_STAT_H
9#define __ASM_AVR32_STAT_H 9#define _UAPI__ASM_AVR32_STAT_H
10 10
11struct __old_kernel_stat { 11struct __old_kernel_stat {
12 unsigned short st_dev; 12 unsigned short st_dev;
@@ -76,4 +76,4 @@ struct stat64 {
76 unsigned long __unused2; 76 unsigned long __unused2;
77}; 77};
78 78
79#endif /* __ASM_AVR32_STAT_H */ 79#endif /* _UAPI__ASM_AVR32_STAT_H */
diff --git a/arch/avr32/include/uapi/asm/statfs.h b/arch/avr32/include/uapi/asm/statfs.h
deleted file mode 100644
index 2961bd18c50e..000000000000
--- a/arch/avr32/include/uapi/asm/statfs.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_AVR32_STATFS_H
2#define __ASM_AVR32_STATFS_H
3
4#include <asm-generic/statfs.h>
5
6#endif /* __ASM_AVR32_STATFS_H */
diff --git a/arch/avr32/include/uapi/asm/swab.h b/arch/avr32/include/uapi/asm/swab.h
index 14cc737bbca6..1a03549e7dc5 100644
--- a/arch/avr32/include/uapi/asm/swab.h
+++ b/arch/avr32/include/uapi/asm/swab.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * AVR32 byteswapping functions. 2 * AVR32 byteswapping functions.
3 */ 3 */
4#ifndef __ASM_AVR32_SWAB_H 4#ifndef _UAPI__ASM_AVR32_SWAB_H
5#define __ASM_AVR32_SWAB_H 5#define _UAPI__ASM_AVR32_SWAB_H
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/compiler.h> 8#include <linux/compiler.h>
@@ -32,4 +32,4 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
32#define __arch_swab32 __arch_swab32 32#define __arch_swab32 __arch_swab32
33#endif 33#endif
34 34
35#endif /* __ASM_AVR32_SWAB_H */ 35#endif /* _UAPI__ASM_AVR32_SWAB_H */
diff --git a/arch/avr32/include/uapi/asm/termbits.h b/arch/avr32/include/uapi/asm/termbits.h
index 366adc5ebb10..32789ccb38f8 100644
--- a/arch/avr32/include/uapi/asm/termbits.h
+++ b/arch/avr32/include/uapi/asm/termbits.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_AVR32_TERMBITS_H 1#ifndef _UAPI__ASM_AVR32_TERMBITS_H
2#define __ASM_AVR32_TERMBITS_H 2#define _UAPI__ASM_AVR32_TERMBITS_H
3 3
4#include <linux/posix_types.h> 4#include <linux/posix_types.h>
5 5
@@ -193,4 +193,4 @@ struct ktermios {
193#define TCSADRAIN 1 193#define TCSADRAIN 1
194#define TCSAFLUSH 2 194#define TCSAFLUSH 2
195 195
196#endif /* __ASM_AVR32_TERMBITS_H */ 196#endif /* _UAPI__ASM_AVR32_TERMBITS_H */
diff --git a/arch/avr32/include/uapi/asm/termios.h b/arch/avr32/include/uapi/asm/termios.h
index b8ef8ea63352..c8a0081556c4 100644
--- a/arch/avr32/include/uapi/asm/termios.h
+++ b/arch/avr32/include/uapi/asm/termios.h
@@ -46,5 +46,4 @@ struct termio {
46 46
47/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 47/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
48 48
49
50#endif /* _UAPI__ASM_AVR32_TERMIOS_H */ 49#endif /* _UAPI__ASM_AVR32_TERMIOS_H */
diff --git a/arch/avr32/include/uapi/asm/types.h b/arch/avr32/include/uapi/asm/types.h
index bb34ad349dfc..7c986c4e99b5 100644
--- a/arch/avr32/include/uapi/asm/types.h
+++ b/arch/avr32/include/uapi/asm/types.h
@@ -5,4 +5,9 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#ifndef _UAPI__ASM_AVR32_TYPES_H
9#define _UAPI__ASM_AVR32_TYPES_H
10
8#include <asm-generic/int-ll64.h> 11#include <asm-generic/int-ll64.h>
12
13#endif /* _UAPI__ASM_AVR32_TYPES_H */
diff --git a/arch/avr32/include/uapi/asm/unistd.h b/arch/avr32/include/uapi/asm/unistd.h
index 3eaa68753adb..8822bf46ddc6 100644
--- a/arch/avr32/include/uapi/asm/unistd.h
+++ b/arch/avr32/include/uapi/asm/unistd.h
@@ -301,5 +301,4 @@
301#define __NR_eventfd 281 301#define __NR_eventfd 281
302#define __NR_setns 283 302#define __NR_setns 283
303 303
304
305#endif /* _UAPI__ASM_AVR32_UNISTD_H */ 304#endif /* _UAPI__ASM_AVR32_UNISTD_H */
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index 9899d3cc6f03..7301f4806bbe 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -401,9 +401,10 @@ handle_critical:
401 /* We should never get here... */ 401 /* We should never get here... */
402bad_return: 402bad_return:
403 sub r12, pc, (. - 1f) 403 sub r12, pc, (. - 1f)
404 bral panic 404 lddpc pc, 2f
405 .align 2 405 .align 2
4061: .asciz "Return from critical exception!" 4061: .asciz "Return from critical exception!"
4072: .long panic
407 408
408 .align 1 409 .align 1
409do_bus_error_write: 410do_bus_error_write:
diff --git a/arch/avr32/kernel/head.S b/arch/avr32/kernel/head.S
index 6163bd0acb95..59eae6dfbed2 100644
--- a/arch/avr32/kernel/head.S
+++ b/arch/avr32/kernel/head.S
@@ -10,33 +10,13 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/thread_info.h>
14#include <asm/sysreg.h>
15 13
16 .section .init.text,"ax" 14 .section .init.text,"ax"
17 .global kernel_entry 15 .global kernel_entry
18kernel_entry: 16kernel_entry:
19 /* Initialize status register */
20 lddpc r0, init_sr
21 mtsr SYSREG_SR, r0
22
23 /* Set initial stack pointer */
24 lddpc sp, stack_addr
25 sub sp, -THREAD_SIZE
26
27#ifdef CONFIG_FRAME_POINTER
28 /* Mark last stack frame */
29 mov lr, 0
30 mov r7, 0
31#endif
32
33 /* Start the show */ 17 /* Start the show */
34 lddpc pc, kernel_start_addr 18 lddpc pc, kernel_start_addr
35 19
36 .align 2 20 .align 2
37init_sr:
38 .long 0x007f0000 /* Supervisor mode, everything masked */
39stack_addr:
40 .long init_thread_union
41kernel_start_addr: 21kernel_start_addr:
42 .long start_kernel 22 .long start_kernel
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
index 12f828ad5058..d0f771be9e96 100644
--- a/arch/avr32/kernel/time.c
+++ b/arch/avr32/kernel/time.c
@@ -59,7 +59,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
59static struct irqaction timer_irqaction = { 59static struct irqaction timer_irqaction = {
60 .handler = timer_interrupt, 60 .handler = timer_interrupt,
61 /* Oprofile uses the same irq as the timer, so allow it to be shared */ 61 /* Oprofile uses the same irq as the timer, so allow it to be shared */
62 .flags = IRQF_TIMER | IRQF_DISABLED | IRQF_SHARED, 62 .flags = IRQF_TIMER | IRQF_SHARED,
63 .name = "avr32_comparator", 63 .name = "avr32_comparator",
64}; 64};
65 65
diff --git a/arch/avr32/mach-at32ap/pm.c b/arch/avr32/mach-at32ap/pm.c
index 32d680eb6f48..db190842b80c 100644
--- a/arch/avr32/mach-at32ap/pm.c
+++ b/arch/avr32/mach-at32ap/pm.c
@@ -181,7 +181,7 @@ static const struct platform_suspend_ops avr32_pm_ops = {
181 .enter = avr32_pm_enter, 181 .enter = avr32_pm_enter,
182}; 182};
183 183
184static unsigned long avr32_pm_offset(void *symbol) 184static unsigned long __init avr32_pm_offset(void *symbol)
185{ 185{
186 extern u8 pm_exception[]; 186 extern u8 pm_exception[];
187 187
diff --git a/arch/blackfin/configs/BF609-EZKIT_defconfig b/arch/blackfin/configs/BF609-EZKIT_defconfig
index 13eb73231a9a..4ca39ab6b2bf 100644
--- a/arch/blackfin/configs/BF609-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF609-EZKIT_defconfig
@@ -102,7 +102,7 @@ CONFIG_I2C_CHARDEV=y
102CONFIG_I2C_BLACKFIN_TWI=y 102CONFIG_I2C_BLACKFIN_TWI=y
103CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 103CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
104CONFIG_SPI=y 104CONFIG_SPI=y
105CONFIG_SPI_BFIN6XX=y 105CONFIG_SPI_BFIN_V3=y
106CONFIG_GPIOLIB=y 106CONFIG_GPIOLIB=y
107CONFIG_GPIO_SYSFS=y 107CONFIG_GPIO_SYSFS=y
108# CONFIG_HWMON is not set 108# CONFIG_HWMON is not set
diff --git a/arch/blackfin/include/asm/hardirq.h b/arch/blackfin/include/asm/hardirq.h
index c078dd78d998..58b54a6d5a16 100644
--- a/arch/blackfin/include/asm/hardirq.h
+++ b/arch/blackfin/include/asm/hardirq.h
@@ -12,9 +12,6 @@
12extern void ack_bad_irq(unsigned int irq); 12extern void ack_bad_irq(unsigned int irq);
13#define ack_bad_irq ack_bad_irq 13#define ack_bad_irq ack_bad_irq
14 14
15/* Define until common code gets sane defaults */
16#define HARDIRQ_BITS 9
17
18#include <asm-generic/hardirq.h> 15#include <asm-generic/hardirq.h>
19 16
20#endif 17#endif
diff --git a/arch/blackfin/include/asm/irq.h b/arch/blackfin/include/asm/irq.h
index 4ae1144a4578..2fd04f10cc26 100644
--- a/arch/blackfin/include/asm/irq.h
+++ b/arch/blackfin/include/asm/irq.h
@@ -23,8 +23,7 @@
23/* 23/*
24 * pm save bfin pint registers 24 * pm save bfin pint registers
25 */ 25 */
26struct bfin_pm_pint_save { 26struct adi_pm_pint_save {
27 u32 mask_set;
28 u32 assign; 27 u32 assign;
29 u32 edge_set; 28 u32 edge_set;
30 u32 invert_set; 29 u32 invert_set;
diff --git a/arch/blackfin/include/asm/irq_handler.h b/arch/blackfin/include/asm/irq_handler.h
index 4fbf83575db1..4b2a992794d7 100644
--- a/arch/blackfin/include/asm/irq_handler.h
+++ b/arch/blackfin/include/asm/irq_handler.h
@@ -12,11 +12,11 @@
12#include <mach/irq.h> 12#include <mach/irq.h>
13 13
14/* init functions only */ 14/* init functions only */
15extern int __init init_arch_irq(void); 15extern int init_arch_irq(void);
16extern void init_exception_vectors(void); 16extern void init_exception_vectors(void);
17extern void __init program_IAR(void); 17extern void program_IAR(void);
18#ifdef init_mach_irq 18#ifdef init_mach_irq
19extern void __init init_mach_irq(void); 19extern void init_mach_irq(void);
20#else 20#else
21# define init_mach_irq() 21# define init_mach_irq()
22#endif 22#endif
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 3894005337ba..55f473bdad36 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -88,8 +88,6 @@ static inline struct thread_info *current_thread_info(void)
88#define TI_CPU 12 88#define TI_CPU 12
89#define TI_PREEMPT 16 89#define TI_PREEMPT 16
90 90
91#define PREEMPT_ACTIVE 0x4000000
92
93/* 91/*
94 * thread information flag bit numbers 92 * thread information flag bit numbers
95 */ 93 */
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index ed978f1c5cb9..a017359c1826 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -11,11 +11,8 @@
11#include <linux/err.h> 11#include <linux/err.h>
12#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
13#include <linux/seq_file.h> 13#include <linux/seq_file.h>
14#include <asm/blackfin.h> 14#include <linux/gpio.h>
15#include <asm/gpio.h>
16#include <asm/portmux.h>
17#include <linux/irq.h> 15#include <linux/irq.h>
18#include <asm/irq_handler.h>
19 16
20#if ANOMALY_05000311 || ANOMALY_05000323 17#if ANOMALY_05000311 || ANOMALY_05000323
21enum { 18enum {
@@ -58,19 +55,6 @@ static struct gpio_port_t * const gpio_array[] = {
58 (struct gpio_port_t *) FIO0_FLAG_D, 55 (struct gpio_port_t *) FIO0_FLAG_D,
59 (struct gpio_port_t *) FIO1_FLAG_D, 56 (struct gpio_port_t *) FIO1_FLAG_D,
60 (struct gpio_port_t *) FIO2_FLAG_D, 57 (struct gpio_port_t *) FIO2_FLAG_D,
61#elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
62 (struct gpio_port_t *)PORTA_FER,
63 (struct gpio_port_t *)PORTB_FER,
64 (struct gpio_port_t *)PORTC_FER,
65 (struct gpio_port_t *)PORTD_FER,
66 (struct gpio_port_t *)PORTE_FER,
67 (struct gpio_port_t *)PORTF_FER,
68 (struct gpio_port_t *)PORTG_FER,
69# if defined(CONFIG_BF54x)
70 (struct gpio_port_t *)PORTH_FER,
71 (struct gpio_port_t *)PORTI_FER,
72 (struct gpio_port_t *)PORTJ_FER,
73# endif
74#else 58#else
75# error no gpio arrays defined 59# error no gpio arrays defined
76#endif 60#endif
@@ -169,12 +153,6 @@ DECLARE_RESERVED_MAP(gpio_irq, GPIO_BANK_NUM);
169 153
170inline int check_gpio(unsigned gpio) 154inline int check_gpio(unsigned gpio)
171{ 155{
172#if defined(CONFIG_BF54x)
173 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
174 || gpio == GPIO_PH14 || gpio == GPIO_PH15
175 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
176 return -EINVAL;
177#endif
178 if (gpio >= MAX_BLACKFIN_GPIOS) 156 if (gpio >= MAX_BLACKFIN_GPIOS)
179 return -EINVAL; 157 return -EINVAL;
180 return 0; 158 return 0;
@@ -212,12 +190,6 @@ static void port_setup(unsigned gpio, unsigned short usage)
212 else 190 else
213 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 191 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
214 SSYNC(); 192 SSYNC();
215#elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
216 if (usage == GPIO_USAGE)
217 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
218 else
219 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
220 SSYNC();
221#endif 193#endif
222} 194}
223 195
@@ -255,7 +227,7 @@ static int portmux_group_check(unsigned short per)
255 u16 ident = P_IDENT(per); 227 u16 ident = P_IDENT(per);
256 u16 function = P_FUNCT2MUX(per); 228 u16 function = P_FUNCT2MUX(per);
257 s8 offset = port_mux[ident]; 229 s8 offset = port_mux[ident];
258 u16 m, pmux, pfunc; 230 u16 m, pmux, pfunc, mask;
259 231
260 if (offset < 0) 232 if (offset < 0)
261 return 0; 233 return 0;
@@ -270,10 +242,12 @@ static int portmux_group_check(unsigned short per)
270 continue; 242 continue;
271 243
272 if (offset == 1) 244 if (offset == 1)
273 pfunc = (pmux >> offset) & 3; 245 mask = 3;
274 else 246 else
275 pfunc = (pmux >> offset) & 1; 247 mask = 1;
276 if (pfunc != function) { 248
249 pfunc = (pmux >> offset) & mask;
250 if (pfunc != (function & mask)) {
277 pr_err("pin group conflict! request pin %d func %d conflict with pin %d func %d\n", 251 pr_err("pin group conflict! request pin %d func %d conflict with pin %d func %d\n",
278 ident, function, m, pfunc); 252 ident, function, m, pfunc);
279 return -EINVAL; 253 return -EINVAL;
@@ -288,43 +262,21 @@ static void portmux_setup(unsigned short per)
288 u16 ident = P_IDENT(per); 262 u16 ident = P_IDENT(per);
289 u16 function = P_FUNCT2MUX(per); 263 u16 function = P_FUNCT2MUX(per);
290 s8 offset = port_mux[ident]; 264 s8 offset = port_mux[ident];
291 u16 pmux; 265 u16 pmux, mask;
292 266
293 if (offset == -1) 267 if (offset == -1)
294 return; 268 return;
295 269
296 pmux = bfin_read_PORT_MUX(); 270 pmux = bfin_read_PORT_MUX();
297 if (offset != 1) 271 if (offset == 1)
298 pmux &= ~(1 << offset); 272 mask = 3;
299 else 273 else
300 pmux &= ~(3 << 1); 274 mask = 1;
301 pmux |= (function << offset);
302 bfin_write_PORT_MUX(pmux);
303}
304#elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
305inline void portmux_setup(unsigned short per)
306{
307 u16 ident = P_IDENT(per);
308 u16 function = P_FUNCT2MUX(per);
309 u32 pmux;
310 275
311 pmux = gpio_array[gpio_bank(ident)]->port_mux; 276 pmux &= ~(mask << offset);
277 pmux |= ((function & mask) << offset);
312 278
313 pmux &= ~(0x3 << (2 * gpio_sub_n(ident))); 279 bfin_write_PORT_MUX(pmux);
314 pmux |= (function & 0x3) << (2 * gpio_sub_n(ident));
315
316 gpio_array[gpio_bank(ident)]->port_mux = pmux;
317}
318
319inline u16 get_portmux(unsigned short per)
320{
321 u16 ident = P_IDENT(per);
322 u32 pmux = gpio_array[gpio_bank(ident)]->port_mux;
323 return (pmux >> (2 * gpio_sub_n(ident)) & 0x3);
324}
325static int portmux_group_check(unsigned short per)
326{
327 return 0;
328} 280}
329#elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x) 281#elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
330static int portmux_group_check(unsigned short per) 282static int portmux_group_check(unsigned short per)
@@ -379,7 +331,6 @@ static int portmux_group_check(unsigned short per)
379} 331}
380#endif 332#endif
381 333
382#if !(defined(CONFIG_BF54x) || defined(CONFIG_BF60x))
383/*********************************************************** 334/***********************************************************
384* 335*
385* FUNCTIONS: Blackfin General Purpose Ports Access Functions 336* FUNCTIONS: Blackfin General Purpose Ports Access Functions
@@ -572,7 +523,7 @@ static const unsigned int sic_iwr_irqs[] = {
572************************************************************* 523*************************************************************
573* MODIFICATION HISTORY : 524* MODIFICATION HISTORY :
574**************************************************************/ 525**************************************************************/
575int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl) 526int bfin_gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl)
576{ 527{
577 unsigned long flags; 528 unsigned long flags;
578 529
@@ -591,7 +542,7 @@ int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl)
591 return 0; 542 return 0;
592} 543}
593 544
594int bfin_pm_standby_ctrl(unsigned ctrl) 545int bfin_gpio_pm_standby_ctrl(unsigned ctrl)
595{ 546{
596 u16 bank, mask, i; 547 u16 bank, mask, i;
597 548
@@ -682,53 +633,6 @@ void bfin_gpio_pm_hibernate_restore(void)
682 633
683 634
684#endif 635#endif
685#else /* CONFIG_BF54x || CONFIG_BF60x */
686#ifdef CONFIG_PM
687
688int bfin_pm_standby_ctrl(unsigned ctrl)
689{
690 return 0;
691}
692
693void bfin_gpio_pm_hibernate_suspend(void)
694{
695 int i, bank;
696
697 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
698 bank = gpio_bank(i);
699
700 gpio_bank_saved[bank].fer = gpio_array[bank]->port_fer;
701 gpio_bank_saved[bank].mux = gpio_array[bank]->port_mux;
702 gpio_bank_saved[bank].data = gpio_array[bank]->data;
703 gpio_bank_saved[bank].inen = gpio_array[bank]->inen;
704 gpio_bank_saved[bank].dir = gpio_array[bank]->dir_set;
705 }
706}
707
708void bfin_gpio_pm_hibernate_restore(void)
709{
710 int i, bank;
711
712 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
713 bank = gpio_bank(i);
714
715 gpio_array[bank]->port_mux = gpio_bank_saved[bank].mux;
716 gpio_array[bank]->port_fer = gpio_bank_saved[bank].fer;
717 gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
718 gpio_array[bank]->data_set = gpio_bank_saved[bank].data
719 & gpio_bank_saved[bank].dir;
720 gpio_array[bank]->dir_set = gpio_bank_saved[bank].dir;
721 }
722}
723#endif
724
725unsigned short get_gpio_dir(unsigned gpio)
726{
727 return (0x01 & (gpio_array[gpio_bank(gpio)]->dir_clear >> gpio_sub_n(gpio)));
728}
729EXPORT_SYMBOL(get_gpio_dir);
730
731#endif /* CONFIG_BF54x || CONFIG_BF60x */
732 636
733/*********************************************************** 637/***********************************************************
734* 638*
@@ -785,11 +689,7 @@ int peripheral_request(unsigned short per, const char *label)
785 * be requested and used by several drivers 689 * be requested and used by several drivers
786 */ 690 */
787 691
788#if defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
789 if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) {
790#else
791 if (!(per & P_MAYSHARE)) { 692 if (!(per & P_MAYSHARE)) {
792#endif
793 /* 693 /*
794 * Allow that the identical pin function can 694 * Allow that the identical pin function can
795 * be requested from the same driver twice 695 * be requested from the same driver twice
@@ -938,12 +838,9 @@ int bfin_gpio_request(unsigned gpio, const char *label)
938 if (unlikely(is_reserved(gpio_irq, gpio, 1))) { 838 if (unlikely(is_reserved(gpio_irq, gpio, 1))) {
939 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!" 839 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!"
940 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio); 840 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio);
941 } 841 } else { /* Reset POLAR setting when acquiring a gpio for the first time */
942#if !(defined(CONFIG_BF54x) || defined(CONFIG_BF60x))
943 else { /* Reset POLAR setting when acquiring a gpio for the first time */
944 set_gpio_polar(gpio, 0); 842 set_gpio_polar(gpio, 0);
945 } 843 }
946#endif
947 844
948 reserve(gpio, gpio); 845 reserve(gpio, gpio);
949 set_label(gpio, label); 846 set_label(gpio, label);
@@ -1112,11 +1009,7 @@ void bfin_gpio_irq_free(unsigned gpio)
1112 1009
1113static inline void __bfin_gpio_direction_input(unsigned gpio) 1010static inline void __bfin_gpio_direction_input(unsigned gpio)
1114{ 1011{
1115#if defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
1116 gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio);
1117#else
1118 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); 1012 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
1119#endif
1120 gpio_array[gpio_bank(gpio)]->inen |= gpio_bit(gpio); 1013 gpio_array[gpio_bank(gpio)]->inen |= gpio_bit(gpio);
1121} 1014}
1122 1015
@@ -1140,17 +1033,7 @@ EXPORT_SYMBOL(bfin_gpio_direction_input);
1140 1033
1141void bfin_gpio_irq_prepare(unsigned gpio) 1034void bfin_gpio_irq_prepare(unsigned gpio)
1142{ 1035{
1143#if defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
1144 unsigned long flags;
1145#endif
1146
1147 port_setup(gpio, GPIO_USAGE); 1036 port_setup(gpio, GPIO_USAGE);
1148
1149#if defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
1150 flags = hard_local_irq_save();
1151 __bfin_gpio_direction_input(gpio);
1152 hard_local_irq_restore(flags);
1153#endif
1154} 1037}
1155 1038
1156void bfin_gpio_set_value(unsigned gpio, int arg) 1039void bfin_gpio_set_value(unsigned gpio, int arg)
@@ -1175,11 +1058,7 @@ int bfin_gpio_direction_output(unsigned gpio, int value)
1175 1058
1176 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); 1059 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
1177 gpio_set_value(gpio, value); 1060 gpio_set_value(gpio, value);
1178#if defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
1179 gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio);
1180#else
1181 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio); 1061 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
1182#endif
1183 1062
1184 AWA_DUMMY_READ(dir); 1063 AWA_DUMMY_READ(dir);
1185 hard_local_irq_restore(flags); 1064 hard_local_irq_restore(flags);
@@ -1190,9 +1069,6 @@ EXPORT_SYMBOL(bfin_gpio_direction_output);
1190 1069
1191int bfin_gpio_get_value(unsigned gpio) 1070int bfin_gpio_get_value(unsigned gpio)
1192{ 1071{
1193#if defined(CONFIG_BF54x) || defined(CONFIG_BF60x)
1194 return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)));
1195#else
1196 unsigned long flags; 1072 unsigned long flags;
1197 1073
1198 if (unlikely(get_gpio_edge(gpio))) { 1074 if (unlikely(get_gpio_edge(gpio))) {
@@ -1205,7 +1081,6 @@ int bfin_gpio_get_value(unsigned gpio)
1205 return ret; 1081 return ret;
1206 } else 1082 } else
1207 return get_gpio_data(gpio); 1083 return get_gpio_data(gpio);
1208#endif
1209} 1084}
1210EXPORT_SYMBOL(bfin_gpio_get_value); 1085EXPORT_SYMBOL(bfin_gpio_get_value);
1211 1086
diff --git a/arch/blackfin/mach-bf548/Kconfig b/arch/blackfin/mach-bf548/Kconfig
index 94acb586832e..334ec7b12188 100644
--- a/arch/blackfin/mach-bf548/Kconfig
+++ b/arch/blackfin/mach-bf548/Kconfig
@@ -377,40 +377,6 @@ config IRQ_PINT3
377 377
378endmenu 378endmenu
379 379
380comment "Pin Interrupt to Port Assignment"
381menu "Assignment"
382
383config PINTx_REASSIGN
384 bool "Reprogram PINT Assignment"
385 default y
386 help
387 The interrupt assignment registers controls the pin-to-interrupt
388 assignment in a byte-wide manner. Each option allows you to select
389 a set of pins (High/Low Byte) of an specific Port being mapped
390 to one of the four PIN Interrupts IRQ_PINTx.
391
392 You shouldn't change any of these unless you know exactly what you're doing.
393 Please consult the Blackfin BF54x Processor Hardware Reference Manual.
394
395config PINT0_ASSIGN
396 hex "PINT0_ASSIGN"
397 depends on PINTx_REASSIGN
398 default 0x00000101
399config PINT1_ASSIGN
400 hex "PINT1_ASSIGN"
401 depends on PINTx_REASSIGN
402 default 0x01010000
403config PINT2_ASSIGN
404 hex "PINT2_ASSIGN"
405 depends on PINTx_REASSIGN
406 default 0x07000101
407config PINT3_ASSIGN
408 hex "PINT3_ASSIGN"
409 depends on PINTx_REASSIGN
410 default 0x02020303
411
412endmenu
413
414endmenu 380endmenu
415 381
416endif 382endif
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 372eb54944ef..d495000b81a0 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -17,6 +17,9 @@
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/usb/musb.h> 19#include <linux/usb/musb.h>
20#include <linux/pinctrl/machine.h>
21#include <linux/pinctrl/pinconf-generic.h>
22#include <linux/platform_data/pinctrl-adi2.h>
20#include <asm/bfin5xx_spi.h> 23#include <asm/bfin5xx_spi.h>
21#include <asm/dma.h> 24#include <asm/dma.h>
22#include <asm/gpio.h> 25#include <asm/gpio.h>
@@ -241,6 +244,13 @@ static struct resource bfin_uart0_resources[] = {
241 .end = UART0_RBR+2, 244 .end = UART0_RBR+2,
242 .flags = IORESOURCE_MEM, 245 .flags = IORESOURCE_MEM,
243 }, 246 },
247#ifdef CONFIG_EARLY_PRINTK
248 {
249 .start = PORTE_FER,
250 .end = PORTE_FER+2,
251 .flags = IORESOURCE_REG,
252 },
253#endif
244 { 254 {
245 .start = IRQ_UART0_TX, 255 .start = IRQ_UART0_TX,
246 .end = IRQ_UART0_TX, 256 .end = IRQ_UART0_TX,
@@ -289,6 +299,13 @@ static struct resource bfin_uart1_resources[] = {
289 .end = UART1_RBR+2, 299 .end = UART1_RBR+2,
290 .flags = IORESOURCE_MEM, 300 .flags = IORESOURCE_MEM,
291 }, 301 },
302#ifdef CONFIG_EARLY_PRINTK
303 {
304 .start = PORTH_FER,
305 .end = PORTH_FER+2,
306 .flags = IORESOURCE_REG,
307 },
308#endif
292 { 309 {
293 .start = IRQ_UART1_TX, 310 .start = IRQ_UART1_TX,
294 .end = IRQ_UART1_TX, 311 .end = IRQ_UART1_TX,
@@ -353,6 +370,13 @@ static struct resource bfin_uart2_resources[] = {
353 .end = UART2_RBR+2, 370 .end = UART2_RBR+2,
354 .flags = IORESOURCE_MEM, 371 .flags = IORESOURCE_MEM,
355 }, 372 },
373#ifdef CONFIG_EARLY_PRINTK
374 {
375 .start = PORTB_FER,
376 .end = PORTB_FER+2,
377 .flags = IORESOURCE_REG,
378 },
379#endif
356 { 380 {
357 .start = IRQ_UART2_TX, 381 .start = IRQ_UART2_TX,
358 .end = IRQ_UART2_TX, 382 .end = IRQ_UART2_TX,
@@ -401,6 +425,13 @@ static struct resource bfin_uart3_resources[] = {
401 .end = UART3_RBR+2, 425 .end = UART3_RBR+2,
402 .flags = IORESOURCE_MEM, 426 .flags = IORESOURCE_MEM,
403 }, 427 },
428#ifdef CONFIG_EARLY_PRINTK
429 {
430 .start = PORTB_FER,
431 .end = PORTB_FER+2,
432 .flags = IORESOURCE_REG,
433 },
434#endif
404 { 435 {
405 .start = IRQ_UART3_TX, 436 .start = IRQ_UART3_TX,
406 .end = IRQ_UART3_TX, 437 .end = IRQ_UART3_TX,
@@ -1058,6 +1089,411 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1058}; 1089};
1059#endif 1090#endif
1060 1091
1092#ifdef CONFIG_PINCTRL_ADI2
1093
1094# define ADI_PINT_DEVNAME "adi-gpio-pint"
1095# define ADI_GPIO_DEVNAME "adi-gpio"
1096# define ADI_PINCTRL_DEVNAME "pinctrl-adi2"
1097
1098static struct platform_device bfin_pinctrl_device = {
1099 .name = ADI_PINCTRL_DEVNAME,
1100 .id = 0,
1101};
1102
1103static struct resource bfin_pint0_resources[] = {
1104 {
1105 .start = PINT0_MASK_SET,
1106 .end = PINT0_LATCH + 3,
1107 .flags = IORESOURCE_MEM,
1108 },
1109 {
1110 .start = IRQ_PINT0,
1111 .end = IRQ_PINT0,
1112 .flags = IORESOURCE_IRQ,
1113 },
1114};
1115
1116static struct platform_device bfin_pint0_device = {
1117 .name = ADI_PINT_DEVNAME,
1118 .id = 0,
1119 .num_resources = ARRAY_SIZE(bfin_pint0_resources),
1120 .resource = bfin_pint0_resources,
1121};
1122
1123static struct resource bfin_pint1_resources[] = {
1124 {
1125 .start = PINT1_MASK_SET,
1126 .end = PINT1_LATCH + 3,
1127 .flags = IORESOURCE_MEM,
1128 },
1129 {
1130 .start = IRQ_PINT1,
1131 .end = IRQ_PINT1,
1132 .flags = IORESOURCE_IRQ,
1133 },
1134};
1135
1136static struct platform_device bfin_pint1_device = {
1137 .name = ADI_PINT_DEVNAME,
1138 .id = 1,
1139 .num_resources = ARRAY_SIZE(bfin_pint1_resources),
1140 .resource = bfin_pint1_resources,
1141};
1142
1143static struct resource bfin_pint2_resources[] = {
1144 {
1145 .start = PINT2_MASK_SET,
1146 .end = PINT2_LATCH + 3,
1147 .flags = IORESOURCE_MEM,
1148 },
1149 {
1150 .start = IRQ_PINT2,
1151 .end = IRQ_PINT2,
1152 .flags = IORESOURCE_IRQ,
1153 },
1154};
1155
1156static struct platform_device bfin_pint2_device = {
1157 .name = ADI_PINT_DEVNAME,
1158 .id = 2,
1159 .num_resources = ARRAY_SIZE(bfin_pint2_resources),
1160 .resource = bfin_pint2_resources,
1161};
1162
1163static struct resource bfin_pint3_resources[] = {
1164 {
1165 .start = PINT3_MASK_SET,
1166 .end = PINT3_LATCH + 3,
1167 .flags = IORESOURCE_MEM,
1168 },
1169 {
1170 .start = IRQ_PINT3,
1171 .end = IRQ_PINT3,
1172 .flags = IORESOURCE_IRQ,
1173 },
1174};
1175
1176static struct platform_device bfin_pint3_device = {
1177 .name = ADI_PINT_DEVNAME,
1178 .id = 3,
1179 .num_resources = ARRAY_SIZE(bfin_pint3_resources),
1180 .resource = bfin_pint3_resources,
1181};
1182
1183static struct resource bfin_gpa_resources[] = {
1184 {
1185 .start = PORTA_FER,
1186 .end = PORTA_MUX + 3,
1187 .flags = IORESOURCE_MEM,
1188 },
1189 { /* optional */
1190 .start = IRQ_PA0,
1191 .end = IRQ_PA0,
1192 .flags = IORESOURCE_IRQ,
1193 },
1194};
1195
1196static struct adi_pinctrl_gpio_platform_data bfin_gpa_pdata = {
1197 .port_gpio_base = GPIO_PA0, /* Optional */
1198 .port_pin_base = GPIO_PA0,
1199 .port_width = GPIO_BANKSIZE,
1200 .pint_id = 0, /* PINT0 */
1201 .pint_assign = true, /* PINT upper 16 bit */
1202 .pint_map = 0, /* mapping mask in PINT */
1203};
1204
1205static struct platform_device bfin_gpa_device = {
1206 .name = ADI_GPIO_DEVNAME,
1207 .id = 0,
1208 .num_resources = ARRAY_SIZE(bfin_gpa_resources),
1209 .resource = bfin_gpa_resources,
1210 .dev = {
1211 .platform_data = &bfin_gpa_pdata, /* Passed to driver */
1212 },
1213};
1214
1215static struct resource bfin_gpb_resources[] = {
1216 {
1217 .start = PORTB_FER,
1218 .end = PORTB_MUX + 3,
1219 .flags = IORESOURCE_MEM,
1220 },
1221 {
1222 .start = IRQ_PB0,
1223 .end = IRQ_PB0,
1224 .flags = IORESOURCE_IRQ,
1225 },
1226};
1227
1228static struct adi_pinctrl_gpio_platform_data bfin_gpb_pdata = {
1229 .port_gpio_base = GPIO_PB0,
1230 .port_pin_base = GPIO_PB0,
1231 .port_width = 15,
1232 .pint_id = 0,
1233 .pint_assign = true,
1234 .pint_map = 1,
1235};
1236
1237static struct platform_device bfin_gpb_device = {
1238 .name = ADI_GPIO_DEVNAME,
1239 .id = 1,
1240 .num_resources = ARRAY_SIZE(bfin_gpb_resources),
1241 .resource = bfin_gpb_resources,
1242 .dev = {
1243 .platform_data = &bfin_gpb_pdata, /* Passed to driver */
1244 },
1245};
1246
1247static struct resource bfin_gpc_resources[] = {
1248 {
1249 .start = PORTC_FER,
1250 .end = PORTC_MUX + 3,
1251 .flags = IORESOURCE_MEM,
1252 },
1253 {
1254 .start = IRQ_PC0,
1255 .end = IRQ_PC0,
1256 .flags = IORESOURCE_IRQ,
1257 },
1258};
1259
1260static struct adi_pinctrl_gpio_platform_data bfin_gpc_pdata = {
1261 .port_gpio_base = GPIO_PC0,
1262 .port_pin_base = GPIO_PC0,
1263 .port_width = 14,
1264 .pint_id = 2,
1265 .pint_assign = true,
1266 .pint_map = 0,
1267};
1268
1269static struct platform_device bfin_gpc_device = {
1270 .name = ADI_GPIO_DEVNAME,
1271 .id = 2,
1272 .num_resources = ARRAY_SIZE(bfin_gpc_resources),
1273 .resource = bfin_gpc_resources,
1274 .dev = {
1275 .platform_data = &bfin_gpc_pdata, /* Passed to driver */
1276 },
1277};
1278
1279static struct resource bfin_gpd_resources[] = {
1280 {
1281 .start = PORTD_FER,
1282 .end = PORTD_MUX + 3,
1283 .flags = IORESOURCE_MEM,
1284 },
1285 {
1286 .start = IRQ_PD0,
1287 .end = IRQ_PD0,
1288 .flags = IORESOURCE_IRQ,
1289 },
1290};
1291
1292static struct adi_pinctrl_gpio_platform_data bfin_gpd_pdata = {
1293 .port_gpio_base = GPIO_PD0,
1294 .port_pin_base = GPIO_PD0,
1295 .port_width = GPIO_BANKSIZE,
1296 .pint_id = 2,
1297 .pint_assign = false,
1298 .pint_map = 1,
1299};
1300
1301static struct platform_device bfin_gpd_device = {
1302 .name = ADI_GPIO_DEVNAME,
1303 .id = 3,
1304 .num_resources = ARRAY_SIZE(bfin_gpd_resources),
1305 .resource = bfin_gpd_resources,
1306 .dev = {
1307 .platform_data = &bfin_gpd_pdata, /* Passed to driver */
1308 },
1309};
1310
1311static struct resource bfin_gpe_resources[] = {
1312 {
1313 .start = PORTE_FER,
1314 .end = PORTE_MUX + 3,
1315 .flags = IORESOURCE_MEM,
1316 },
1317 {
1318 .start = IRQ_PE0,
1319 .end = IRQ_PE0,
1320 .flags = IORESOURCE_IRQ,
1321 },
1322};
1323
1324static struct adi_pinctrl_gpio_platform_data bfin_gpe_pdata = {
1325 .port_gpio_base = GPIO_PE0,
1326 .port_pin_base = GPIO_PE0,
1327 .port_width = GPIO_BANKSIZE,
1328 .pint_id = 3,
1329 .pint_assign = true,
1330 .pint_map = 2,
1331};
1332
1333static struct platform_device bfin_gpe_device = {
1334 .name = ADI_GPIO_DEVNAME,
1335 .id = 4,
1336 .num_resources = ARRAY_SIZE(bfin_gpe_resources),
1337 .resource = bfin_gpe_resources,
1338 .dev = {
1339 .platform_data = &bfin_gpe_pdata, /* Passed to driver */
1340 },
1341};
1342
1343static struct resource bfin_gpf_resources[] = {
1344 {
1345 .start = PORTF_FER,
1346 .end = PORTF_MUX + 3,
1347 .flags = IORESOURCE_MEM,
1348 },
1349 {
1350 .start = IRQ_PF0,
1351 .end = IRQ_PF0,
1352 .flags = IORESOURCE_IRQ,
1353 },
1354};
1355
1356static struct adi_pinctrl_gpio_platform_data bfin_gpf_pdata = {
1357 .port_gpio_base = GPIO_PF0,
1358 .port_pin_base = GPIO_PF0,
1359 .port_width = GPIO_BANKSIZE,
1360 .pint_id = 3,
1361 .pint_assign = false,
1362 .pint_map = 3,
1363};
1364
1365static struct platform_device bfin_gpf_device = {
1366 .name = ADI_GPIO_DEVNAME,
1367 .id = 5,
1368 .num_resources = ARRAY_SIZE(bfin_gpf_resources),
1369 .resource = bfin_gpf_resources,
1370 .dev = {
1371 .platform_data = &bfin_gpf_pdata, /* Passed to driver */
1372 },
1373};
1374
1375static struct resource bfin_gpg_resources[] = {
1376 {
1377 .start = PORTG_FER,
1378 .end = PORTG_MUX + 3,
1379 .flags = IORESOURCE_MEM,
1380 },
1381 {
1382 .start = IRQ_PG0,
1383 .end = IRQ_PG0,
1384 .flags = IORESOURCE_IRQ,
1385 },
1386};
1387
1388static struct adi_pinctrl_gpio_platform_data bfin_gpg_pdata = {
1389 .port_gpio_base = GPIO_PG0,
1390 .port_pin_base = GPIO_PG0,
1391 .port_width = GPIO_BANKSIZE,
1392 .pint_id = -1,
1393};
1394
1395static struct platform_device bfin_gpg_device = {
1396 .name = ADI_GPIO_DEVNAME,
1397 .id = 6,
1398 .num_resources = ARRAY_SIZE(bfin_gpg_resources),
1399 .resource = bfin_gpg_resources,
1400 .dev = {
1401 .platform_data = &bfin_gpg_pdata, /* Passed to driver */
1402 },
1403};
1404
1405static struct resource bfin_gph_resources[] = {
1406 {
1407 .start = PORTH_FER,
1408 .end = PORTH_MUX + 3,
1409 .flags = IORESOURCE_MEM,
1410 },
1411 {
1412 .start = IRQ_PH0,
1413 .end = IRQ_PH0,
1414 .flags = IORESOURCE_IRQ,
1415 },
1416};
1417
1418static struct adi_pinctrl_gpio_platform_data bfin_gph_pdata = {
1419 .port_gpio_base = GPIO_PH0,
1420 .port_pin_base = GPIO_PH0,
1421 .port_width = 14,
1422 .pint_id = -1,
1423};
1424
1425static struct platform_device bfin_gph_device = {
1426 .name = ADI_GPIO_DEVNAME,
1427 .id = 7,
1428 .num_resources = ARRAY_SIZE(bfin_gph_resources),
1429 .resource = bfin_gph_resources,
1430 .dev = {
1431 .platform_data = &bfin_gph_pdata, /* Passed to driver */
1432 },
1433};
1434
1435static struct resource bfin_gpi_resources[] = {
1436 {
1437 .start = PORTI_FER,
1438 .end = PORTI_MUX + 3,
1439 .flags = IORESOURCE_MEM,
1440 },
1441 {
1442 .start = IRQ_PI0,
1443 .end = IRQ_PI0,
1444 .flags = IORESOURCE_IRQ,
1445 },
1446};
1447
1448static struct adi_pinctrl_gpio_platform_data bfin_gpi_pdata = {
1449 .port_gpio_base = GPIO_PI0,
1450 .port_pin_base = GPIO_PI0,
1451 .port_width = GPIO_BANKSIZE,
1452 .pint_id = -1,
1453};
1454
1455static struct platform_device bfin_gpi_device = {
1456 .name = ADI_GPIO_DEVNAME,
1457 .id = 8,
1458 .num_resources = ARRAY_SIZE(bfin_gpi_resources),
1459 .resource = bfin_gpi_resources,
1460 .dev = {
1461 .platform_data = &bfin_gpi_pdata, /* Passed to driver */
1462 },
1463};
1464
1465static struct resource bfin_gpj_resources[] = {
1466 {
1467 .start = PORTJ_FER,
1468 .end = PORTJ_MUX + 3,
1469 .flags = IORESOURCE_MEM,
1470 },
1471 {
1472 .start = IRQ_PJ0,
1473 .end = IRQ_PJ0,
1474 .flags = IORESOURCE_IRQ,
1475 },
1476};
1477
1478static struct adi_pinctrl_gpio_platform_data bfin_gpj_pdata = {
1479 .port_gpio_base = GPIO_PJ0,
1480 .port_pin_base = GPIO_PJ0,
1481 .port_width = 14,
1482 .pint_id = -1,
1483};
1484
1485static struct platform_device bfin_gpj_device = {
1486 .name = ADI_GPIO_DEVNAME,
1487 .id = 9,
1488 .num_resources = ARRAY_SIZE(bfin_gpj_resources),
1489 .resource = bfin_gpj_resources,
1490 .dev = {
1491 .platform_data = &bfin_gpj_pdata, /* Passed to driver */
1492 },
1493};
1494
1495#endif
1496
1061static struct spi_board_info bfin_spi_board_info[] __initdata = { 1497static struct spi_board_info bfin_spi_board_info[] __initdata = {
1062#if defined(CONFIG_MTD_M25P80) \ 1498#if defined(CONFIG_MTD_M25P80) \
1063 || defined(CONFIG_MTD_M25P80_MODULE) 1499 || defined(CONFIG_MTD_M25P80_MODULE)
@@ -1066,7 +1502,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1066 .modalias = "m25p80", /* Name of spi_driver for this device */ 1502 .modalias = "m25p80", /* Name of spi_driver for this device */
1067 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 1503 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1068 .bus_num = 0, /* Framework bus number */ 1504 .bus_num = 0, /* Framework bus number */
1069 .chip_select = 1, /* SPI_SSEL1*/ 1505 .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1*/
1070 .platform_data = &bfin_spi_flash_data, 1506 .platform_data = &bfin_spi_flash_data,
1071 .controller_data = &spi_flash_chip_info, 1507 .controller_data = &spi_flash_chip_info,
1072 .mode = SPI_MODE_3, 1508 .mode = SPI_MODE_3,
@@ -1078,7 +1514,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1078 .modalias = "ad183x", 1514 .modalias = "ad183x",
1079 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1515 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1080 .bus_num = 1, 1516 .bus_num = 1,
1081 .chip_select = 4, 1517 .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */
1082 }, 1518 },
1083#endif 1519#endif
1084#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 1520#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
@@ -1088,7 +1524,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1088 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ 1524 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
1089 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 1525 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1090 .bus_num = 0, 1526 .bus_num = 0,
1091 .chip_select = 2, 1527 .chip_select = MAX_CTRL_CS + GPIO_PE5, /* SPI_SSEL2 */
1092 }, 1528 },
1093#endif 1529#endif
1094#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 1530#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
@@ -1096,7 +1532,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1096 .modalias = "spidev", 1532 .modalias = "spidev",
1097 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1533 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1098 .bus_num = 0, 1534 .bus_num = 0,
1099 .chip_select = 1, 1535 .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1 */
1100 }, 1536 },
1101#endif 1537#endif
1102#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) 1538#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
@@ -1106,7 +1542,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1106 .irq = IRQ_PC5, 1542 .irq = IRQ_PC5,
1107 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ 1543 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1108 .bus_num = 1, 1544 .bus_num = 1,
1109 .chip_select = 2, 1545 .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */
1110 .mode = SPI_MODE_3, 1546 .mode = SPI_MODE_3,
1111 }, 1547 },
1112#endif 1548#endif
@@ -1152,7 +1588,7 @@ static struct resource bfin_spi1_resource[] = {
1152 1588
1153/* SPI controller data */ 1589/* SPI controller data */
1154static struct bfin5xx_spi_master bf54x_spi_master_info0 = { 1590static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
1155 .num_chipselect = 4, 1591 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
1156 .enable_dma = 1, /* master has the ability to do dma transfer */ 1592 .enable_dma = 1, /* master has the ability to do dma transfer */
1157 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, 1593 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
1158}; 1594};
@@ -1168,7 +1604,7 @@ static struct platform_device bf54x_spi_master0 = {
1168}; 1604};
1169 1605
1170static struct bfin5xx_spi_master bf54x_spi_master_info1 = { 1606static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
1171 .num_chipselect = 4, 1607 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
1172 .enable_dma = 1, /* master has the ability to do dma transfer */ 1608 .enable_dma = 1, /* master has the ability to do dma transfer */
1173 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, 1609 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
1174}; 1610};
@@ -1508,6 +1944,23 @@ static struct platform_device bfin_ac97 = {
1508static struct platform_device *ezkit_devices[] __initdata = { 1944static struct platform_device *ezkit_devices[] __initdata = {
1509 1945
1510 &bfin_dpmc, 1946 &bfin_dpmc,
1947#if defined(CONFIG_PINCTRL_ADI2)
1948 &bfin_pinctrl_device,
1949 &bfin_pint0_device,
1950 &bfin_pint1_device,
1951 &bfin_pint2_device,
1952 &bfin_pint3_device,
1953 &bfin_gpa_device,
1954 &bfin_gpb_device,
1955 &bfin_gpc_device,
1956 &bfin_gpd_device,
1957 &bfin_gpe_device,
1958 &bfin_gpf_device,
1959 &bfin_gpg_device,
1960 &bfin_gph_device,
1961 &bfin_gpi_device,
1962 &bfin_gpj_device,
1963#endif
1511 1964
1512#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1965#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1513 &rtc_device, 1966 &rtc_device,
@@ -1644,10 +2097,66 @@ static struct platform_device *ezkit_devices[] __initdata = {
1644#endif 2097#endif
1645}; 2098};
1646 2099
2100/* Pin control settings */
2101static struct pinctrl_map __initdata bfin_pinmux_map[] = {
2102 /* per-device maps */
2103 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.0", "pinctrl-adi2.0", NULL, "uart0"),
2104 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1"),
2105#ifdef CONFIG_BFIN_UART1_CTSRTS
2106 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1_ctsrts"),
2107#endif
2108 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.2", "pinctrl-adi2.0", NULL, "uart2"),
2109 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.3", "pinctrl-adi2.0", NULL, "uart3"),
2110#ifdef CONFIG_BFIN_UART3_CTSRTS
2111 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.3", "pinctrl-adi2.0", NULL, "uart3_ctsrts"),
2112#endif
2113 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.0", "pinctrl-adi2.0", NULL, "uart0"),
2114 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"),
2115 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.2", "pinctrl-adi2.0", NULL, "uart2"),
2116 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.3", "pinctrl-adi2.0", NULL, "uart3"),
2117 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"),
2118 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi.0", "pinctrl-adi2.0", NULL, "spi0"),
2119 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi.1", "pinctrl-adi2.0", NULL, "spi1"),
2120 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"),
2121#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
2122 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"),
2123#endif
2124 PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"),
2125 PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.0", "pinctrl-adi2.0", NULL, "can0"),
2126 PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.1", "pinctrl-adi2.0", NULL, "can1"),
2127 PIN_MAP_MUX_GROUP_DEFAULT("bf54x-lq043", "pinctrl-adi2.0", NULL, "ppi0_24b"),
2128 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.0", "pinctrl-adi2.0", NULL, "sport0"),
2129 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.0", "pinctrl-adi2.0", NULL, "sport0"),
2130 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.0", "pinctrl-adi2.0", NULL, "sport0"),
2131 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.1", "pinctrl-adi2.0", NULL, "sport1"),
2132 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.1", "pinctrl-adi2.0", NULL, "sport1"),
2133 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.1", "pinctrl-adi2.0", NULL, "sport1"),
2134 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.2", "pinctrl-adi2.0", NULL, "sport2"),
2135 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"),
2136 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.2", "pinctrl-adi2.0", NULL, "sport2"),
2137 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.3", "pinctrl-adi2.0", NULL, "sport3"),
2138 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.3", "pinctrl-adi2.0", NULL, "sport3"),
2139 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.3", "pinctrl-adi2.0", NULL, "sport3"),
2140 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.0", "pinctrl-adi2.0", NULL, "sport0"),
2141 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.1", "pinctrl-adi2.0", NULL, "sport1"),
2142 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.2", "pinctrl-adi2.0", NULL, "sport2"),
2143 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.3", "pinctrl-adi2.0", NULL, "sport3"),
2144 PIN_MAP_MUX_GROUP_DEFAULT("pata-bf54x", "pinctrl-adi2.0", NULL, "atapi"),
2145#ifdef CONFIG_BF548_ATAPI_ALTERNATIVE_PORT
2146 PIN_MAP_MUX_GROUP_DEFAULT("pata-bf54x", "pinctrl-adi2.0", NULL, "atapi_alter"),
2147#endif
2148 PIN_MAP_MUX_GROUP_DEFAULT("bf5xx-nand.0", "pinctrl-adi2.0", NULL, "nfc0"),
2149 PIN_MAP_MUX_GROUP_DEFAULT("bf54x-keys", "pinctrl-adi2.0", NULL, "keys_4x4"),
2150};
2151
1647static int __init ezkit_init(void) 2152static int __init ezkit_init(void)
1648{ 2153{
1649 printk(KERN_INFO "%s(): registering device resources\n", __func__); 2154 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1650 2155
2156 /* Initialize pinmuxing */
2157 pinctrl_register_mappings(bfin_pinmux_map,
2158 ARRAY_SIZE(bfin_pinmux_map));
2159
1651 i2c_register_board_info(0, bfin_i2c_board_info0, 2160 i2c_register_board_info(0, bfin_i2c_board_info0,
1652 ARRAY_SIZE(bfin_i2c_board_info0)); 2161 ARRAY_SIZE(bfin_i2c_board_info0));
1653#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 2162#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
@@ -1679,21 +2188,6 @@ static struct platform_device *ezkit_early_devices[] __initdata = {
1679 &bfin_uart3_device, 2188 &bfin_uart3_device,
1680#endif 2189#endif
1681#endif 2190#endif
1682
1683#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1684#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1685 &bfin_sport0_uart_device,
1686#endif
1687#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1688 &bfin_sport1_uart_device,
1689#endif
1690#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1691 &bfin_sport2_uart_device,
1692#endif
1693#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1694 &bfin_sport3_uart_device,
1695#endif
1696#endif
1697}; 2191};
1698 2192
1699void __init native_machine_early_platform_add_devices(void) 2193void __init native_machine_early_platform_add_devices(void)
diff --git a/arch/blackfin/mach-bf548/include/mach/gpio.h b/arch/blackfin/mach-bf548/include/mach/gpio.h
index be9edb28f96b..006da1edcf84 100644
--- a/arch/blackfin/mach-bf548/include/mach/gpio.h
+++ b/arch/blackfin/mach-bf548/include/mach/gpio.h
@@ -194,14 +194,6 @@ struct gpio_port_t {
194 unsigned int port_mux; 194 unsigned int port_mux;
195}; 195};
196 196
197struct gpio_port_s {
198 unsigned short fer;
199 unsigned short data;
200 unsigned short dir;
201 unsigned short inen;
202 unsigned int mux;
203};
204
205#endif 197#endif
206 198
207#include <mach-common/ports-a.h> 199#include <mach-common/ports-a.h>
diff --git a/arch/blackfin/mach-bf548/include/mach/irq.h b/arch/blackfin/mach-bf548/include/mach/irq.h
index 10dc142c518d..cf7cb725cfa2 100644
--- a/arch/blackfin/mach-bf548/include/mach/irq.h
+++ b/arch/blackfin/mach-bf548/include/mach/irq.h
@@ -433,7 +433,7 @@
433#include <linux/types.h> 433#include <linux/types.h>
434 434
435/* 435/*
436 * bfin pint registers layout 436 * gpio pint registers layout
437 */ 437 */
438struct bfin_pint_regs { 438struct bfin_pint_regs {
439 u32 mask_set; 439 u32 mask_set;
diff --git a/arch/blackfin/mach-bf609/Kconfig b/arch/blackfin/mach-bf609/Kconfig
index 2bcbf94b1edf..b0fca44110b0 100644
--- a/arch/blackfin/mach-bf609/Kconfig
+++ b/arch/blackfin/mach-bf609/Kconfig
@@ -9,48 +9,6 @@ source "arch/blackfin/mach-bf609/boards/Kconfig"
9 9
10menu "BF609 Specific Configuration" 10menu "BF609 Specific Configuration"
11 11
12comment "Pin Interrupt to Port Assignment"
13menu "Assignment"
14
15config PINTx_REASSIGN
16 bool "Reprogram PINT Assignment"
17 default y
18 help
19 The interrupt assignment registers controls the pin-to-interrupt
20 assignment in a byte-wide manner. Each option allows you to select
21 a set of pins (High/Low Byte) of an specific Port being mapped
22 to one of the four PIN Interrupts IRQ_PINTx.
23
24 You shouldn't change any of these unless you know exactly what you're doing.
25 Please consult the Blackfin BF60x Processor Hardware Reference Manual.
26
27config PINT0_ASSIGN
28 hex "PINT0_ASSIGN"
29 depends on PINTx_REASSIGN
30 default 0x00000101
31config PINT1_ASSIGN
32 hex "PINT1_ASSIGN"
33 depends on PINTx_REASSIGN
34 default 0x00000101
35config PINT2_ASSIGN
36 hex "PINT2_ASSIGN"
37 depends on PINTx_REASSIGN
38 default 0x00000101
39config PINT3_ASSIGN
40 hex "PINT3_ASSIGN"
41 depends on PINTx_REASSIGN
42 default 0x00000101
43config PINT4_ASSIGN
44 hex "PINT3_ASSIGN"
45 depends on PINTx_REASSIGN
46 default 0x00000101
47config PINT5_ASSIGN
48 hex "PINT3_ASSIGN"
49 depends on PINTx_REASSIGN
50 default 0x00000101
51
52endmenu
53
54config SEC_IRQ_PRIORITY_LEVELS 12config SEC_IRQ_PRIORITY_LEVELS
55 int "SEC interrupt priority levels" 13 int "SEC interrupt priority levels"
56 default 7 14 default 7
diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c
index d56a55ad83a7..82beedd953f6 100644
--- a/arch/blackfin/mach-bf609/boards/ezkit.c
+++ b/arch/blackfin/mach-bf609/boards/ezkit.c
@@ -17,6 +17,9 @@
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/usb/musb.h> 19#include <linux/usb/musb.h>
20#include <linux/pinctrl/machine.h>
21#include <linux/pinctrl/pinconf-generic.h>
22#include <linux/platform_data/pinctrl-adi2.h>
20#include <asm/bfin_spi3.h> 23#include <asm/bfin_spi3.h>
21#include <asm/dma.h> 24#include <asm/dma.h>
22#include <asm/gpio.h> 25#include <asm/gpio.h>
@@ -106,8 +109,6 @@ static struct platform_device bfin_rotary_device = {
106#include <linux/stmmac.h> 109#include <linux/stmmac.h>
107#include <linux/phy.h> 110#include <linux/phy.h>
108 111
109static unsigned short pins[] = P_RMII0;
110
111static struct stmmac_mdio_bus_data phy_private_data = { 112static struct stmmac_mdio_bus_data phy_private_data = {
112 .phy_mask = 1, 113 .phy_mask = 1,
113}; 114};
@@ -212,6 +213,18 @@ static struct resource bfin_uart0_resources[] = {
212 .end = UART0_RXDIV+4, 213 .end = UART0_RXDIV+4,
213 .flags = IORESOURCE_MEM, 214 .flags = IORESOURCE_MEM,
214 }, 215 },
216#ifdef CONFIG_EARLY_PRINTK
217 {
218 .start = PORTD_FER,
219 .end = PORTD_FER+2,
220 .flags = IORESOURCE_REG,
221 },
222 {
223 .start = PORTD_MUX,
224 .end = PORTD_MUX+3,
225 .flags = IORESOURCE_REG,
226 },
227#endif
215 { 228 {
216 .start = IRQ_UART0_TX, 229 .start = IRQ_UART0_TX,
217 .end = IRQ_UART0_TX, 230 .end = IRQ_UART0_TX,
@@ -276,6 +289,13 @@ static struct resource bfin_uart1_resources[] = {
276 .end = UART1_RXDIV+4, 289 .end = UART1_RXDIV+4,
277 .flags = IORESOURCE_MEM, 290 .flags = IORESOURCE_MEM,
278 }, 291 },
292#ifdef CONFIG_EARLY_PRINTK
293 {
294 .start = PORTG_FER_SET,
295 .end = PORTG_FER_SET+2,
296 .flags = IORESOURCE_REG,
297 },
298#endif
279 { 299 {
280 .start = IRQ_UART1_TX, 300 .start = IRQ_UART1_TX,
281 .end = IRQ_UART1_TX, 301 .end = IRQ_UART1_TX,
@@ -674,17 +694,12 @@ static struct mtd_partition ezkit_partitions[] = {
674 }, 694 },
675}; 695};
676 696
677int bf609_nor_flash_init(struct platform_device *dev) 697int bf609_nor_flash_init(struct platform_device *pdev)
678{ 698{
679#define CONFIG_SMC_GCTL_VAL 0x00000010 699#define CONFIG_SMC_GCTL_VAL 0x00000010
680 const unsigned short pins[] = {
681 P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12,
682 P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21,
683 P_A22, P_A23, P_A24, P_A25, P_NORCK, 0,
684 };
685
686 peripheral_request_list(pins, "smc0");
687 700
701 if (!devm_pinctrl_get_select_default(&pdev->dev))
702 return -EBUSY;
688 bfin_write32(SMC_GCTL, CONFIG_SMC_GCTL_VAL); 703 bfin_write32(SMC_GCTL, CONFIG_SMC_GCTL_VAL);
689 bfin_write32(SMC_B0CTL, 0x01002011); 704 bfin_write32(SMC_B0CTL, 0x01002011);
690 bfin_write32(SMC_B0TIM, 0x08170977); 705 bfin_write32(SMC_B0TIM, 0x08170977);
@@ -692,16 +707,9 @@ int bf609_nor_flash_init(struct platform_device *dev)
692 return 0; 707 return 0;
693} 708}
694 709
695void bf609_nor_flash_exit(struct platform_device *dev) 710void bf609_nor_flash_exit(struct platform_device *pdev)
696{ 711{
697 const unsigned short pins[] = { 712 devm_pinctrl_put(pdev->dev.pins->p);
698 P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12,
699 P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21,
700 P_A22, P_A23, P_A24, P_A25, P_NORCK, 0,
701 };
702
703 peripheral_free_list(pins);
704
705 bfin_write32(SMC_GCTL, 0); 713 bfin_write32(SMC_GCTL, 0);
706} 714}
707 715
@@ -1319,6 +1327,356 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1319}; 1327};
1320#endif 1328#endif
1321 1329
1330#ifdef CONFIG_PINCTRL_ADI2
1331
1332# define ADI_PINT_DEVNAME "adi-gpio-pint"
1333# define ADI_GPIO_DEVNAME "adi-gpio"
1334# define ADI_PINCTRL_DEVNAME "pinctrl-adi2"
1335
1336static struct platform_device bfin_pinctrl_device = {
1337 .name = ADI_PINCTRL_DEVNAME,
1338 .id = 0,
1339};
1340
1341static struct resource bfin_pint0_resources[] = {
1342 {
1343 .start = PINT0_MASK_SET,
1344 .end = PINT0_LATCH + 3,
1345 .flags = IORESOURCE_MEM,
1346 },
1347 {
1348 .start = IRQ_PINT0,
1349 .end = IRQ_PINT0,
1350 .flags = IORESOURCE_IRQ,
1351 },
1352};
1353
1354static struct platform_device bfin_pint0_device = {
1355 .name = ADI_PINT_DEVNAME,
1356 .id = 0,
1357 .num_resources = ARRAY_SIZE(bfin_pint0_resources),
1358 .resource = bfin_pint0_resources,
1359};
1360
1361static struct resource bfin_pint1_resources[] = {
1362 {
1363 .start = PINT1_MASK_SET,
1364 .end = PINT1_LATCH + 3,
1365 .flags = IORESOURCE_MEM,
1366 },
1367 {
1368 .start = IRQ_PINT1,
1369 .end = IRQ_PINT1,
1370 .flags = IORESOURCE_IRQ,
1371 },
1372};
1373
1374static struct platform_device bfin_pint1_device = {
1375 .name = ADI_PINT_DEVNAME,
1376 .id = 1,
1377 .num_resources = ARRAY_SIZE(bfin_pint1_resources),
1378 .resource = bfin_pint1_resources,
1379};
1380
1381static struct resource bfin_pint2_resources[] = {
1382 {
1383 .start = PINT2_MASK_SET,
1384 .end = PINT2_LATCH + 3,
1385 .flags = IORESOURCE_MEM,
1386 },
1387 {
1388 .start = IRQ_PINT2,
1389 .end = IRQ_PINT2,
1390 .flags = IORESOURCE_IRQ,
1391 },
1392};
1393
1394static struct platform_device bfin_pint2_device = {
1395 .name = ADI_PINT_DEVNAME,
1396 .id = 2,
1397 .num_resources = ARRAY_SIZE(bfin_pint2_resources),
1398 .resource = bfin_pint2_resources,
1399};
1400
1401static struct resource bfin_pint3_resources[] = {
1402 {
1403 .start = PINT3_MASK_SET,
1404 .end = PINT3_LATCH + 3,
1405 .flags = IORESOURCE_MEM,
1406 },
1407 {
1408 .start = IRQ_PINT3,
1409 .end = IRQ_PINT3,
1410 .flags = IORESOURCE_IRQ,
1411 },
1412};
1413
1414static struct platform_device bfin_pint3_device = {
1415 .name = ADI_PINT_DEVNAME,
1416 .id = 3,
1417 .num_resources = ARRAY_SIZE(bfin_pint3_resources),
1418 .resource = bfin_pint3_resources,
1419};
1420
1421static struct resource bfin_pint4_resources[] = {
1422 {
1423 .start = PINT4_MASK_SET,
1424 .end = PINT4_LATCH + 3,
1425 .flags = IORESOURCE_MEM,
1426 },
1427 {
1428 .start = IRQ_PINT4,
1429 .end = IRQ_PINT4,
1430 .flags = IORESOURCE_IRQ,
1431 },
1432};
1433
1434static struct platform_device bfin_pint4_device = {
1435 .name = ADI_PINT_DEVNAME,
1436 .id = 4,
1437 .num_resources = ARRAY_SIZE(bfin_pint4_resources),
1438 .resource = bfin_pint4_resources,
1439};
1440
1441static struct resource bfin_pint5_resources[] = {
1442 {
1443 .start = PINT5_MASK_SET,
1444 .end = PINT5_LATCH + 3,
1445 .flags = IORESOURCE_MEM,
1446 },
1447 {
1448 .start = IRQ_PINT5,
1449 .end = IRQ_PINT5,
1450 .flags = IORESOURCE_IRQ,
1451 },
1452};
1453
1454static struct platform_device bfin_pint5_device = {
1455 .name = ADI_PINT_DEVNAME,
1456 .id = 5,
1457 .num_resources = ARRAY_SIZE(bfin_pint5_resources),
1458 .resource = bfin_pint5_resources,
1459};
1460
1461static struct resource bfin_gpa_resources[] = {
1462 {
1463 .start = PORTA_FER,
1464 .end = PORTA_MUX + 3,
1465 .flags = IORESOURCE_MEM,
1466 },
1467 { /* optional */
1468 .start = IRQ_PA0,
1469 .end = IRQ_PA0,
1470 .flags = IORESOURCE_IRQ,
1471 },
1472};
1473
1474static struct adi_pinctrl_gpio_platform_data bfin_gpa_pdata = {
1475 .port_pin_base = GPIO_PA0,
1476 .port_width = GPIO_BANKSIZE,
1477 .pint_id = 0, /* PINT0 */
1478 .pint_assign = true, /* PINT upper 16 bit */
1479 .pint_map = 0, /* mapping mask in PINT */
1480};
1481
1482static struct platform_device bfin_gpa_device = {
1483 .name = ADI_GPIO_DEVNAME,
1484 .id = 0,
1485 .num_resources = ARRAY_SIZE(bfin_gpa_resources),
1486 .resource = bfin_gpa_resources,
1487 .dev = {
1488 .platform_data = &bfin_gpa_pdata, /* Passed to driver */
1489 },
1490};
1491
1492static struct resource bfin_gpb_resources[] = {
1493 {
1494 .start = PORTB_FER,
1495 .end = PORTB_MUX + 3,
1496 .flags = IORESOURCE_MEM,
1497 },
1498 {
1499 .start = IRQ_PB0,
1500 .end = IRQ_PB0,
1501 .flags = IORESOURCE_IRQ,
1502 },
1503};
1504
1505static struct adi_pinctrl_gpio_platform_data bfin_gpb_pdata = {
1506 .port_pin_base = GPIO_PB0,
1507 .port_width = GPIO_BANKSIZE,
1508 .pint_id = 0,
1509 .pint_assign = false,
1510 .pint_map = 1,
1511};
1512
1513static struct platform_device bfin_gpb_device = {
1514 .name = ADI_GPIO_DEVNAME,
1515 .id = 1,
1516 .num_resources = ARRAY_SIZE(bfin_gpb_resources),
1517 .resource = bfin_gpb_resources,
1518 .dev = {
1519 .platform_data = &bfin_gpb_pdata, /* Passed to driver */
1520 },
1521};
1522
1523static struct resource bfin_gpc_resources[] = {
1524 {
1525 .start = PORTC_FER,
1526 .end = PORTC_MUX + 3,
1527 .flags = IORESOURCE_MEM,
1528 },
1529 {
1530 .start = IRQ_PC0,
1531 .end = IRQ_PC0,
1532 .flags = IORESOURCE_IRQ,
1533 },
1534};
1535
1536static struct adi_pinctrl_gpio_platform_data bfin_gpc_pdata = {
1537 .port_pin_base = GPIO_PC0,
1538 .port_width = GPIO_BANKSIZE,
1539 .pint_id = 1,
1540 .pint_assign = false,
1541 .pint_map = 1,
1542};
1543
1544static struct platform_device bfin_gpc_device = {
1545 .name = ADI_GPIO_DEVNAME,
1546 .id = 2,
1547 .num_resources = ARRAY_SIZE(bfin_gpc_resources),
1548 .resource = bfin_gpc_resources,
1549 .dev = {
1550 .platform_data = &bfin_gpc_pdata, /* Passed to driver */
1551 },
1552};
1553
1554static struct resource bfin_gpd_resources[] = {
1555 {
1556 .start = PORTD_FER,
1557 .end = PORTD_MUX + 3,
1558 .flags = IORESOURCE_MEM,
1559 },
1560 {
1561 .start = IRQ_PD0,
1562 .end = IRQ_PD0,
1563 .flags = IORESOURCE_IRQ,
1564 },
1565};
1566
1567static struct adi_pinctrl_gpio_platform_data bfin_gpd_pdata = {
1568 .port_pin_base = GPIO_PD0,
1569 .port_width = GPIO_BANKSIZE,
1570 .pint_id = 2,
1571 .pint_assign = false,
1572 .pint_map = 1,
1573};
1574
1575static struct platform_device bfin_gpd_device = {
1576 .name = ADI_GPIO_DEVNAME,
1577 .id = 3,
1578 .num_resources = ARRAY_SIZE(bfin_gpd_resources),
1579 .resource = bfin_gpd_resources,
1580 .dev = {
1581 .platform_data = &bfin_gpd_pdata, /* Passed to driver */
1582 },
1583};
1584
1585static struct resource bfin_gpe_resources[] = {
1586 {
1587 .start = PORTE_FER,
1588 .end = PORTE_MUX + 3,
1589 .flags = IORESOURCE_MEM,
1590 },
1591 {
1592 .start = IRQ_PE0,
1593 .end = IRQ_PE0,
1594 .flags = IORESOURCE_IRQ,
1595 },
1596};
1597
1598static struct adi_pinctrl_gpio_platform_data bfin_gpe_pdata = {
1599 .port_pin_base = GPIO_PE0,
1600 .port_width = GPIO_BANKSIZE,
1601 .pint_id = 3,
1602 .pint_assign = false,
1603 .pint_map = 1,
1604};
1605
1606static struct platform_device bfin_gpe_device = {
1607 .name = ADI_GPIO_DEVNAME,
1608 .id = 4,
1609 .num_resources = ARRAY_SIZE(bfin_gpe_resources),
1610 .resource = bfin_gpe_resources,
1611 .dev = {
1612 .platform_data = &bfin_gpe_pdata, /* Passed to driver */
1613 },
1614};
1615
1616static struct resource bfin_gpf_resources[] = {
1617 {
1618 .start = PORTF_FER,
1619 .end = PORTF_MUX + 3,
1620 .flags = IORESOURCE_MEM,
1621 },
1622 {
1623 .start = IRQ_PF0,
1624 .end = IRQ_PF0,
1625 .flags = IORESOURCE_IRQ,
1626 },
1627};
1628
1629static struct adi_pinctrl_gpio_platform_data bfin_gpf_pdata = {
1630 .port_pin_base = GPIO_PF0,
1631 .port_width = GPIO_BANKSIZE,
1632 .pint_id = 4,
1633 .pint_assign = false,
1634 .pint_map = 1,
1635};
1636
1637static struct platform_device bfin_gpf_device = {
1638 .name = ADI_GPIO_DEVNAME,
1639 .id = 5,
1640 .num_resources = ARRAY_SIZE(bfin_gpf_resources),
1641 .resource = bfin_gpf_resources,
1642 .dev = {
1643 .platform_data = &bfin_gpf_pdata, /* Passed to driver */
1644 },
1645};
1646
1647static struct resource bfin_gpg_resources[] = {
1648 {
1649 .start = PORTG_FER,
1650 .end = PORTG_MUX + 3,
1651 .flags = IORESOURCE_MEM,
1652 },
1653 {
1654 .start = IRQ_PG0,
1655 .end = IRQ_PG0,
1656 .flags = IORESOURCE_IRQ,
1657 },
1658};
1659
1660static struct adi_pinctrl_gpio_platform_data bfin_gpg_pdata = {
1661 .port_pin_base = GPIO_PG0,
1662 .port_width = GPIO_BANKSIZE,
1663 .pint_id = 5,
1664 .pint_assign = false,
1665 .pint_map = 1,
1666};
1667
1668static struct platform_device bfin_gpg_device = {
1669 .name = ADI_GPIO_DEVNAME,
1670 .id = 6,
1671 .num_resources = ARRAY_SIZE(bfin_gpg_resources),
1672 .resource = bfin_gpg_resources,
1673 .dev = {
1674 .platform_data = &bfin_gpg_pdata, /* Passed to driver */
1675 },
1676};
1677
1678#endif
1679
1322#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1680#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1323#include <linux/input.h> 1681#include <linux/input.h>
1324#include <linux/gpio_keys.h> 1682#include <linux/gpio_keys.h>
@@ -1349,7 +1707,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1349 .modalias = "m25p80", /* Name of spi_driver for this device */ 1707 .modalias = "m25p80", /* Name of spi_driver for this device */
1350 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 1708 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1351 .bus_num = 0, /* Framework bus number */ 1709 .bus_num = 0, /* Framework bus number */
1352 .chip_select = 1, /* SPI_SSEL1*/ 1710 .chip_select = MAX_CTRL_CS + GPIO_PD11, /* SPI_SSEL1*/
1353 .platform_data = &bfin_spi_flash_data, 1711 .platform_data = &bfin_spi_flash_data,
1354 .controller_data = &spi_flash_chip_info, 1712 .controller_data = &spi_flash_chip_info,
1355 .mode = SPI_MODE_3, 1713 .mode = SPI_MODE_3,
@@ -1362,7 +1720,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1362 .irq = IRQ_PD9, 1720 .irq = IRQ_PD9,
1363 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 1721 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1364 .bus_num = 0, 1722 .bus_num = 0,
1365 .chip_select = 4, 1723 .chip_select = MAX_CTRL_CS + GPIO_PC15, /* SPI_SSEL4 */
1366 }, 1724 },
1367#endif 1725#endif
1368#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 1726#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
@@ -1370,7 +1728,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1370 .modalias = "spidev", 1728 .modalias = "spidev",
1371 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1729 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1372 .bus_num = 0, 1730 .bus_num = 0,
1373 .chip_select = 1, 1731 .chip_select = MAX_CTRL_CS + GPIO_PD11, /* SPI_SSEL1*/
1374 .controller_data = &spidev_chip_info, 1732 .controller_data = &spidev_chip_info,
1375 }, 1733 },
1376#endif 1734#endif
@@ -1565,6 +1923,22 @@ static struct platform_device bfin_dpmc = {
1565static struct platform_device *ezkit_devices[] __initdata = { 1923static struct platform_device *ezkit_devices[] __initdata = {
1566 1924
1567 &bfin_dpmc, 1925 &bfin_dpmc,
1926#if defined(CONFIG_PINCTRL_ADI2)
1927 &bfin_pinctrl_device,
1928 &bfin_pint0_device,
1929 &bfin_pint1_device,
1930 &bfin_pint2_device,
1931 &bfin_pint3_device,
1932 &bfin_pint4_device,
1933 &bfin_pint5_device,
1934 &bfin_gpa_device,
1935 &bfin_gpb_device,
1936 &bfin_gpc_device,
1937 &bfin_gpd_device,
1938 &bfin_gpe_device,
1939 &bfin_gpf_device,
1940 &bfin_gpg_device,
1941#endif
1568 1942
1569#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1943#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1570 &rtc_device, 1944 &rtc_device,
@@ -1681,20 +2055,52 @@ static struct platform_device *ezkit_devices[] __initdata = {
1681 2055
1682}; 2056};
1683 2057
2058/* Pin control settings */
2059static struct pinctrl_map __initdata bfin_pinmux_map[] = {
2060 /* per-device maps */
2061 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.0", "pinctrl-adi2.0", NULL, "uart0"),
2062 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1"),
2063 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.0", "pinctrl-adi2.0", NULL, "uart0"),
2064 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"),
2065 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"),
2066 PIN_MAP_MUX_GROUP_DEFAULT("stmmaceth.0", "pinctrl-adi2.0", NULL, "eth0"),
2067 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.0", "pinctrl-adi2.0", NULL, "spi0"),
2068 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.1", "pinctrl-adi2.0", NULL, "spi1"),
2069 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"),
2070 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"),
2071 PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"),
2072 PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.0", "pinctrl-adi2.0", NULL, "can0"),
2073 PIN_MAP_MUX_GROUP_DEFAULT("physmap-flash.0", "pinctrl-adi2.0", NULL, "smc0"),
2074 PIN_MAP_MUX_GROUP_DEFAULT("bf609_nl8048.2", "pinctrl-adi2.0", NULL, "ppi2_16b"),
2075 PIN_MAP_MUX_GROUP_DEFAULT("bfin_display.0", "pinctrl-adi2.0", NULL, "ppi0_16b"),
2076#if defined(CONFIG_VIDEO_MT9M114) || defined(CONFIG_VIDEO_MT9M114_MODULE)
2077 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_8b"),
2078#elif defined(CONFIG_VIDEO_VS6624) || defined(CONFIG_VIDEO_VS6624_MODULE)
2079 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_16b"),
2080#else
2081 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_24b"),
2082#endif
2083 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.0", "pinctrl-adi2.0", NULL, "sport0"),
2084 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.0", "pinctrl-adi2.0", NULL, "sport0"),
2085 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.1", "pinctrl-adi2.0", NULL, "sport1"),
2086 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.1", "pinctrl-adi2.0", NULL, "sport1"),
2087 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.2", "pinctrl-adi2.0", NULL, "sport2"),
2088 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"),
2089};
2090
1684static int __init ezkit_init(void) 2091static int __init ezkit_init(void)
1685{ 2092{
1686 printk(KERN_INFO "%s(): registering device resources\n", __func__); 2093 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1687 2094
2095 /* Initialize pinmuxing */
2096 pinctrl_register_mappings(bfin_pinmux_map,
2097 ARRAY_SIZE(bfin_pinmux_map));
2098
1688 i2c_register_board_info(0, bfin_i2c_board_info0, 2099 i2c_register_board_info(0, bfin_i2c_board_info0,
1689 ARRAY_SIZE(bfin_i2c_board_info0)); 2100 ARRAY_SIZE(bfin_i2c_board_info0));
1690 i2c_register_board_info(1, bfin_i2c_board_info1, 2101 i2c_register_board_info(1, bfin_i2c_board_info1,
1691 ARRAY_SIZE(bfin_i2c_board_info1)); 2102 ARRAY_SIZE(bfin_i2c_board_info1));
1692 2103
1693#if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE)
1694 if (!peripheral_request_list(pins, "emac0"))
1695 printk(KERN_ERR "%s(): request emac pins failed\n", __func__);
1696#endif
1697
1698 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); 2104 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
1699 2105
1700 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 2106 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
@@ -1713,18 +2119,6 @@ static struct platform_device *ezkit_early_devices[] __initdata = {
1713 &bfin_uart1_device, 2119 &bfin_uart1_device,
1714#endif 2120#endif
1715#endif 2121#endif
1716
1717#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1718#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1719 &bfin_sport0_uart_device,
1720#endif
1721#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1722 &bfin_sport1_uart_device,
1723#endif
1724#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1725 &bfin_sport2_uart_device,
1726#endif
1727#endif
1728}; 2122};
1729 2123
1730void __init native_machine_early_platform_add_devices(void) 2124void __init native_machine_early_platform_add_devices(void)
diff --git a/arch/blackfin/mach-bf609/include/mach/gpio.h b/arch/blackfin/mach-bf609/include/mach/gpio.h
index c32c8cc8db2e..07182513e794 100644
--- a/arch/blackfin/mach-bf609/include/mach/gpio.h
+++ b/arch/blackfin/mach-bf609/include/mach/gpio.h
@@ -152,14 +152,6 @@ struct gpio_port_t {
152 unsigned long revid; 152 unsigned long revid;
153}; 153};
154 154
155struct gpio_port_s {
156 unsigned short fer;
157 unsigned short data;
158 unsigned short dir;
159 unsigned short inen;
160 unsigned int mux;
161};
162
163#endif 155#endif
164 156
165#include <mach-common/ports-a.h> 157#include <mach-common/ports-a.h>
diff --git a/arch/blackfin/mach-bf609/include/mach/irq.h b/arch/blackfin/mach-bf609/include/mach/irq.h
index fa0843d5d77a..d1cb6a86f80a 100644
--- a/arch/blackfin/mach-bf609/include/mach/irq.h
+++ b/arch/blackfin/mach-bf609/include/mach/irq.h
@@ -298,7 +298,7 @@
298extern u8 sec_int_priority[]; 298extern u8 sec_int_priority[];
299 299
300/* 300/*
301 * bfin pint registers layout 301 * gpio pint registers layout
302 */ 302 */
303struct bfin_pint_regs { 303struct bfin_pint_regs {
304 u32 mask_set; 304 u32 mask_set;
diff --git a/arch/blackfin/mach-bf609/include/mach/portmux.h b/arch/blackfin/mach-bf609/include/mach/portmux.h
index fe34191eef0b..c48bb71a55ce 100644
--- a/arch/blackfin/mach-bf609/include/mach/portmux.h
+++ b/arch/blackfin/mach-bf609/include/mach/portmux.h
@@ -19,6 +19,7 @@
19#define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PC5) | P_FUNCT(0)) 19#define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PC5) | P_FUNCT(0))
20#define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PC4) | P_FUNCT(0)) 20#define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PC4) | P_FUNCT(0))
21#define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PB14) | P_FUNCT(0)) 21#define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PB14) | P_FUNCT(0))
22#define P_MII0_PTPPPS (P_DEFINED | P_IDENT(GPIO_PB15) | P_FUNCT(0))
22 23
23#define P_RMII0 {\ 24#define P_RMII0 {\
24 P_MII0_ETxD0, \ 25 P_MII0_ETxD0, \
@@ -30,6 +31,7 @@
30 P_MII0_TxCLK, \ 31 P_MII0_TxCLK, \
31 P_MII0_PHYINT, \ 32 P_MII0_PHYINT, \
32 P_MII0_CRS, \ 33 P_MII0_CRS, \
34 P_MII0_PTPPPS, \
33 P_MII0_MDC, \ 35 P_MII0_MDC, \
34 P_MII0_MDIO, 0} 36 P_MII0_MDIO, 0}
35 37
@@ -44,6 +46,7 @@
44#define P_MII1_CRS (P_DEFINED | P_IDENT(GPIO_PE13) | P_FUNCT(0)) 46#define P_MII1_CRS (P_DEFINED | P_IDENT(GPIO_PE13) | P_FUNCT(0))
45#define P_MII1_ERxER (P_DEFINED | P_IDENT(GPIO_PE14) | P_FUNCT(0)) 47#define P_MII1_ERxER (P_DEFINED | P_IDENT(GPIO_PE14) | P_FUNCT(0))
46#define P_MII1_TxCLK (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0)) 48#define P_MII1_TxCLK (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
49#define P_MII1_PTPPPS (P_DEFINED | P_IDENT(GPIO_PC9) | P_FUNCT(0))
47 50
48#define P_RMII1 {\ 51#define P_RMII1 {\
49 P_MII1_ETxD0, \ 52 P_MII1_ETxD0, \
@@ -55,6 +58,7 @@
55 P_MII1_TxCLK, \ 58 P_MII1_TxCLK, \
56 P_MII1_PHYINT, \ 59 P_MII1_PHYINT, \
57 P_MII1_CRS, \ 60 P_MII1_CRS, \
61 P_MII1_PTPPPS, \
58 P_MII1_MDC, \ 62 P_MII1_MDC, \
59 P_MII1_MDIO, 0} 63 P_MII1_MDIO, 0}
60 64
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index d143fd8d2bc5..ca75613231c8 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -704,10 +704,9 @@ static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle)
704 __irq_set_handler_locked(irq, handle); 704 __irq_set_handler_locked(irq, handle);
705} 705}
706 706
707static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS); 707#ifdef CONFIG_GPIO_ADI
708extern void bfin_gpio_irq_prepare(unsigned gpio);
709 708
710#if !BFIN_GPIO_PINT 709static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS);
711 710
712static void bfin_gpio_ack_irq(struct irq_data *d) 711static void bfin_gpio_ack_irq(struct irq_data *d)
713{ 712{
@@ -821,15 +820,6 @@ static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type)
821 return 0; 820 return 0;
822} 821}
823 822
824#ifdef CONFIG_PM
825static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)
826{
827 return gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state);
828}
829#else
830# define bfin_gpio_set_wake NULL
831#endif
832
833static void bfin_demux_gpio_block(unsigned int irq) 823static void bfin_demux_gpio_block(unsigned int irq)
834{ 824{
835 unsigned int gpio, mask; 825 unsigned int gpio, mask;
@@ -896,279 +886,40 @@ void bfin_demux_gpio_irq(unsigned int inta_irq,
896 bfin_demux_gpio_block(irq); 886 bfin_demux_gpio_block(irq);
897} 887}
898 888
899#else
900
901#define NR_PINT_BITS 32
902#define IRQ_NOT_AVAIL 0xFF
903
904#define PINT_2_BANK(x) ((x) >> 5)
905#define PINT_2_BIT(x) ((x) & 0x1F)
906#define PINT_BIT(x) (1 << (PINT_2_BIT(x)))
907
908static unsigned char irq2pint_lut[NR_PINTS];
909static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
910
911static struct bfin_pint_regs * const pint[NR_PINT_SYS_IRQS] = {
912 (struct bfin_pint_regs *)PINT0_MASK_SET,
913 (struct bfin_pint_regs *)PINT1_MASK_SET,
914 (struct bfin_pint_regs *)PINT2_MASK_SET,
915 (struct bfin_pint_regs *)PINT3_MASK_SET,
916#ifdef CONFIG_BF60x
917 (struct bfin_pint_regs *)PINT4_MASK_SET,
918 (struct bfin_pint_regs *)PINT5_MASK_SET,
919#endif
920};
921
922inline unsigned int get_irq_base(u32 bank, u8 bmap)
923{
924 unsigned int irq_base;
925
926#ifndef CONFIG_BF60x
927 if (bank < 2) { /*PA-PB */
928 irq_base = IRQ_PA0 + bmap * 16;
929 } else { /*PC-PJ */
930 irq_base = IRQ_PC0 + bmap * 16;
931 }
932#else
933 irq_base = IRQ_PA0 + bank * 16 + bmap * 16;
934#endif
935 return irq_base;
936}
937
938 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
939void init_pint_lut(void)
940{
941 u16 bank, bit, irq_base, bit_pos;
942 u32 pint_assign;
943 u8 bmap;
944
945 memset(irq2pint_lut, IRQ_NOT_AVAIL, sizeof(irq2pint_lut));
946
947 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) {
948
949 pint_assign = pint[bank]->assign;
950
951 for (bit = 0; bit < NR_PINT_BITS; bit++) {
952
953 bmap = (pint_assign >> ((bit / 8) * 8)) & 0xFF;
954
955 irq_base = get_irq_base(bank, bmap);
956
957 irq_base += (bit % 8) + ((bit / 8) & 1 ? 8 : 0);
958 bit_pos = bit + bank * NR_PINT_BITS;
959
960 pint2irq_lut[bit_pos] = irq_base - SYS_IRQS;
961 irq2pint_lut[irq_base - SYS_IRQS] = bit_pos;
962 }
963 }
964}
965
966static void bfin_gpio_ack_irq(struct irq_data *d)
967{
968 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
969 u32 pintbit = PINT_BIT(pint_val);
970 u32 bank = PINT_2_BANK(pint_val);
971
972 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
973 if (pint[bank]->invert_set & pintbit)
974 pint[bank]->invert_clear = pintbit;
975 else
976 pint[bank]->invert_set = pintbit;
977 }
978 pint[bank]->request = pintbit;
979
980}
981
982static void bfin_gpio_mask_ack_irq(struct irq_data *d)
983{
984 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
985 u32 pintbit = PINT_BIT(pint_val);
986 u32 bank = PINT_2_BANK(pint_val);
987
988 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
989 if (pint[bank]->invert_set & pintbit)
990 pint[bank]->invert_clear = pintbit;
991 else
992 pint[bank]->invert_set = pintbit;
993 }
994
995 pint[bank]->request = pintbit;
996 pint[bank]->mask_clear = pintbit;
997}
998
999static void bfin_gpio_mask_irq(struct irq_data *d)
1000{
1001 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
1002
1003 pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val);
1004}
1005
1006static void bfin_gpio_unmask_irq(struct irq_data *d)
1007{
1008 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
1009 u32 pintbit = PINT_BIT(pint_val);
1010 u32 bank = PINT_2_BANK(pint_val);
1011
1012 pint[bank]->mask_set = pintbit;
1013}
1014
1015static unsigned int bfin_gpio_irq_startup(struct irq_data *d)
1016{
1017 unsigned int irq = d->irq;
1018 u32 gpionr = irq_to_gpio(irq);
1019 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
1020
1021 if (pint_val == IRQ_NOT_AVAIL) {
1022 printk(KERN_ERR
1023 "GPIO IRQ %d :Not in PINT Assign table "
1024 "Reconfigure Interrupt to Port Assignemt\n", irq);
1025 return -ENODEV;
1026 }
1027
1028 if (__test_and_set_bit(gpionr, gpio_enabled))
1029 bfin_gpio_irq_prepare(gpionr);
1030
1031 bfin_gpio_unmask_irq(d);
1032
1033 return 0;
1034}
1035
1036static void bfin_gpio_irq_shutdown(struct irq_data *d)
1037{
1038 u32 gpionr = irq_to_gpio(d->irq);
1039
1040 bfin_gpio_mask_irq(d);
1041 __clear_bit(gpionr, gpio_enabled);
1042 bfin_gpio_irq_free(gpionr);
1043}
1044
1045static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type)
1046{
1047 unsigned int irq = d->irq;
1048 int ret;
1049 char buf[16];
1050 u32 gpionr = irq_to_gpio(irq);
1051 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
1052 u32 pintbit = PINT_BIT(pint_val);
1053 u32 bank = PINT_2_BANK(pint_val);
1054
1055 if (pint_val == IRQ_NOT_AVAIL)
1056 return -ENODEV;
1057
1058 if (type == IRQ_TYPE_PROBE) {
1059 /* only probe unenabled GPIO interrupt lines */
1060 if (test_bit(gpionr, gpio_enabled))
1061 return 0;
1062 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
1063 }
1064
1065 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
1066 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
1067
1068 snprintf(buf, 16, "gpio-irq%d", irq);
1069 ret = bfin_gpio_irq_request(gpionr, buf);
1070 if (ret)
1071 return ret;
1072
1073 if (__test_and_set_bit(gpionr, gpio_enabled))
1074 bfin_gpio_irq_prepare(gpionr);
1075
1076 } else {
1077 __clear_bit(gpionr, gpio_enabled);
1078 return 0;
1079 }
1080
1081 if ((type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)))
1082 pint[bank]->invert_set = pintbit; /* low or falling edge denoted by one */
1083 else
1084 pint[bank]->invert_clear = pintbit; /* high or rising edge denoted by zero */
1085
1086 if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
1087 == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
1088 if (gpio_get_value(gpionr))
1089 pint[bank]->invert_set = pintbit;
1090 else
1091 pint[bank]->invert_clear = pintbit;
1092 }
1093
1094 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
1095 pint[bank]->edge_set = pintbit;
1096 bfin_set_irq_handler(irq, handle_edge_irq);
1097 } else {
1098 pint[bank]->edge_clear = pintbit;
1099 bfin_set_irq_handler(irq, handle_level_irq);
1100 }
1101
1102 return 0;
1103}
1104
1105#ifdef CONFIG_PM 889#ifdef CONFIG_PM
1106static struct bfin_pm_pint_save save_pint_reg[NR_PINT_SYS_IRQS];
1107static u32 save_pint_sec_ctl[NR_PINT_SYS_IRQS];
1108 890
1109static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 891static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)
1110{ 892{
1111 u32 pint_irq; 893 return bfin_gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state);
1112 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 894}
1113 u32 bank = PINT_2_BANK(pint_val);
1114
1115 switch (bank) {
1116 case 0:
1117 pint_irq = IRQ_PINT0;
1118 break;
1119 case 2:
1120 pint_irq = IRQ_PINT2;
1121 break;
1122 case 3:
1123 pint_irq = IRQ_PINT3;
1124 break;
1125 case 1:
1126 pint_irq = IRQ_PINT1;
1127 break;
1128#ifdef CONFIG_BF60x
1129 case 4:
1130 pint_irq = IRQ_PINT4;
1131 break;
1132 case 5:
1133 pint_irq = IRQ_PINT5;
1134 break;
1135#endif
1136 default:
1137 return -EINVAL;
1138 }
1139 895
1140#ifndef SEC_GCTL 896#else
1141 bfin_internal_set_wake(pint_irq, state);
1142#endif
1143 897
1144 return 0; 898# define bfin_gpio_set_wake NULL
1145}
1146 899
1147void bfin_pint_suspend(void) 900#endif
1148{
1149 u32 bank;
1150 901
1151 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) { 902static struct irq_chip bfin_gpio_irqchip = {
1152 save_pint_reg[bank].mask_set = pint[bank]->mask_set; 903 .name = "GPIO",
1153 save_pint_reg[bank].assign = pint[bank]->assign; 904 .irq_ack = bfin_gpio_ack_irq,
1154 save_pint_reg[bank].edge_set = pint[bank]->edge_set; 905 .irq_mask = bfin_gpio_mask_irq,
1155 save_pint_reg[bank].invert_set = pint[bank]->invert_set; 906 .irq_mask_ack = bfin_gpio_mask_ack_irq,
1156 } 907 .irq_unmask = bfin_gpio_unmask_irq,
1157} 908 .irq_disable = bfin_gpio_mask_irq,
909 .irq_enable = bfin_gpio_unmask_irq,
910 .irq_set_type = bfin_gpio_irq_type,
911 .irq_startup = bfin_gpio_irq_startup,
912 .irq_shutdown = bfin_gpio_irq_shutdown,
913 .irq_set_wake = bfin_gpio_set_wake,
914};
1158 915
1159void bfin_pint_resume(void) 916#endif
1160{
1161 u32 bank;
1162 917
1163 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) { 918#ifdef CONFIG_PM
1164 pint[bank]->mask_set = save_pint_reg[bank].mask_set;
1165 pint[bank]->assign = save_pint_reg[bank].assign;
1166 pint[bank]->edge_set = save_pint_reg[bank].edge_set;
1167 pint[bank]->invert_set = save_pint_reg[bank].invert_set;
1168 }
1169}
1170 919
1171#ifdef SEC_GCTL 920#ifdef SEC_GCTL
921static u32 save_pint_sec_ctl[NR_PINT_SYS_IRQS];
922
1172static int sec_suspend(void) 923static int sec_suspend(void)
1173{ 924{
1174 u32 bank; 925 u32 bank;
@@ -1195,92 +946,10 @@ static struct syscore_ops sec_pm_syscore_ops = {
1195 .suspend = sec_suspend, 946 .suspend = sec_suspend,
1196 .resume = sec_resume, 947 .resume = sec_resume,
1197}; 948};
1198
1199#endif
1200#else
1201# define bfin_gpio_set_wake NULL
1202#endif
1203
1204void bfin_demux_gpio_irq(unsigned int inta_irq,
1205 struct irq_desc *desc)
1206{
1207 u32 bank, pint_val;
1208 u32 request, irq;
1209 u32 level_mask;
1210 int umask = 0;
1211 struct irq_chip *chip = irq_desc_get_chip(desc);
1212
1213 if (chip->irq_mask_ack) {
1214 chip->irq_mask_ack(&desc->irq_data);
1215 } else {
1216 chip->irq_mask(&desc->irq_data);
1217 if (chip->irq_ack)
1218 chip->irq_ack(&desc->irq_data);
1219 }
1220
1221 switch (inta_irq) {
1222 case IRQ_PINT0:
1223 bank = 0;
1224 break;
1225 case IRQ_PINT2:
1226 bank = 2;
1227 break;
1228 case IRQ_PINT3:
1229 bank = 3;
1230 break;
1231 case IRQ_PINT1:
1232 bank = 1;
1233 break;
1234#ifdef CONFIG_BF60x
1235 case IRQ_PINT4:
1236 bank = 4;
1237 break;
1238 case IRQ_PINT5:
1239 bank = 5;
1240 break;
1241#endif 949#endif
1242 default:
1243 return;
1244 }
1245
1246 pint_val = bank * NR_PINT_BITS;
1247
1248 request = pint[bank]->request;
1249
1250 level_mask = pint[bank]->edge_set & request;
1251
1252 while (request) {
1253 if (request & 1) {
1254 irq = pint2irq_lut[pint_val] + SYS_IRQS;
1255 if (level_mask & PINT_BIT(pint_val)) {
1256 umask = 1;
1257 chip->irq_unmask(&desc->irq_data);
1258 }
1259 bfin_handle_irq(irq);
1260 }
1261 pint_val++;
1262 request >>= 1;
1263 }
1264 950
1265 if (!umask)
1266 chip->irq_unmask(&desc->irq_data);
1267}
1268#endif 951#endif
1269 952
1270static struct irq_chip bfin_gpio_irqchip = {
1271 .name = "GPIO",
1272 .irq_ack = bfin_gpio_ack_irq,
1273 .irq_mask = bfin_gpio_mask_irq,
1274 .irq_mask_ack = bfin_gpio_mask_ack_irq,
1275 .irq_unmask = bfin_gpio_unmask_irq,
1276 .irq_disable = bfin_gpio_mask_irq,
1277 .irq_enable = bfin_gpio_unmask_irq,
1278 .irq_set_type = bfin_gpio_irq_type,
1279 .irq_startup = bfin_gpio_irq_startup,
1280 .irq_shutdown = bfin_gpio_irq_shutdown,
1281 .irq_set_wake = bfin_gpio_set_wake,
1282};
1283
1284void init_exception_vectors(void) 953void init_exception_vectors(void)
1285{ 954{
1286 /* cannot program in software: 955 /* cannot program in software:
@@ -1331,17 +1000,6 @@ int __init init_arch_irq(void)
1331 1000
1332 local_irq_disable(); 1001 local_irq_disable();
1333 1002
1334#if BFIN_GPIO_PINT
1335# ifdef CONFIG_PINTx_REASSIGN
1336 pint[0]->assign = CONFIG_PINT0_ASSIGN;
1337 pint[1]->assign = CONFIG_PINT1_ASSIGN;
1338 pint[2]->assign = CONFIG_PINT2_ASSIGN;
1339 pint[3]->assign = CONFIG_PINT3_ASSIGN;
1340# endif
1341 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
1342 init_pint_lut();
1343#endif
1344
1345 for (irq = 0; irq <= SYS_IRQS; irq++) { 1003 for (irq = 0; irq <= SYS_IRQS; irq++) {
1346 if (irq <= IRQ_CORETMR) 1004 if (irq <= IRQ_CORETMR)
1347 irq_set_chip(irq, &bfin_core_irqchip); 1005 irq_set_chip(irq, &bfin_core_irqchip);
@@ -1349,12 +1007,8 @@ int __init init_arch_irq(void)
1349 irq_set_chip(irq, &bfin_internal_irqchip); 1007 irq_set_chip(irq, &bfin_internal_irqchip);
1350 1008
1351 switch (irq) { 1009 switch (irq) {
1352#if BFIN_GPIO_PINT 1010#if !BFIN_GPIO_PINT
1353 case IRQ_PINT0: 1011#if defined(BF537_FAMILY)
1354 case IRQ_PINT1:
1355 case IRQ_PINT2:
1356 case IRQ_PINT3:
1357#elif defined(BF537_FAMILY)
1358 case IRQ_PH_INTA_MAC_RX: 1012 case IRQ_PH_INTA_MAC_RX:
1359 case IRQ_PF_INTA_PG_INTA: 1013 case IRQ_PF_INTA_PG_INTA:
1360#elif defined(BF533_FAMILY) 1014#elif defined(BF533_FAMILY)
@@ -1372,6 +1026,7 @@ int __init init_arch_irq(void)
1372#endif 1026#endif
1373 irq_set_chained_handler(irq, bfin_demux_gpio_irq); 1027 irq_set_chained_handler(irq, bfin_demux_gpio_irq);
1374 break; 1028 break;
1029#endif
1375#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 1030#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
1376 case IRQ_MAC_ERROR: 1031 case IRQ_MAC_ERROR:
1377 irq_set_chained_handler(irq, 1032 irq_set_chained_handler(irq,
@@ -1419,10 +1074,12 @@ int __init init_arch_irq(void)
1419 handle_level_irq); 1074 handle_level_irq);
1420#endif 1075#endif
1421 /* if configured as edge, then will be changed to do_edge_IRQ */ 1076 /* if configured as edge, then will be changed to do_edge_IRQ */
1077#ifdef CONFIG_GPIO_ADI
1422 for (irq = GPIO_IRQ_BASE; 1078 for (irq = GPIO_IRQ_BASE;
1423 irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) 1079 irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++)
1424 irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, 1080 irq_set_chip_and_handler(irq, &bfin_gpio_irqchip,
1425 handle_level_irq); 1081 handle_level_irq);
1082#endif
1426 bfin_write_IMASK(0); 1083 bfin_write_IMASK(0);
1427 CSYNC(); 1084 CSYNC();
1428 ilat = bfin_read_ILAT(); 1085 ilat = bfin_read_ILAT();
@@ -1525,19 +1182,6 @@ int __init init_arch_irq(void)
1525 1182
1526 local_irq_disable(); 1183 local_irq_disable();
1527 1184
1528#if BFIN_GPIO_PINT
1529# ifdef CONFIG_PINTx_REASSIGN
1530 pint[0]->assign = CONFIG_PINT0_ASSIGN;
1531 pint[1]->assign = CONFIG_PINT1_ASSIGN;
1532 pint[2]->assign = CONFIG_PINT2_ASSIGN;
1533 pint[3]->assign = CONFIG_PINT3_ASSIGN;
1534 pint[4]->assign = CONFIG_PINT4_ASSIGN;
1535 pint[5]->assign = CONFIG_PINT5_ASSIGN;
1536# endif
1537 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
1538 init_pint_lut();
1539#endif
1540
1541 for (irq = 0; irq <= SYS_IRQS; irq++) { 1185 for (irq = 0; irq <= SYS_IRQS; irq++) {
1542 if (irq <= IRQ_CORETMR) { 1186 if (irq <= IRQ_CORETMR) {
1543 irq_set_chip_and_handler(irq, &bfin_core_irqchip, 1187 irq_set_chip_and_handler(irq, &bfin_core_irqchip,
@@ -1546,9 +1190,6 @@ int __init init_arch_irq(void)
1546 if (irq == IRQ_CORETMR) 1190 if (irq == IRQ_CORETMR)
1547 irq_set_handler(irq, handle_percpu_irq); 1191 irq_set_handler(irq, handle_percpu_irq);
1548#endif 1192#endif
1549 } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) {
1550 irq_set_chip(irq, &bfin_sec_irqchip);
1551 irq_set_chained_handler(irq, bfin_demux_gpio_irq);
1552 } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) { 1193 } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) {
1553 irq_set_chip_and_handler(irq, &bfin_sec_irqchip, 1194 irq_set_chip_and_handler(irq, &bfin_sec_irqchip,
1554 handle_percpu_irq); 1195 handle_percpu_irq);
@@ -1563,10 +1204,6 @@ int __init init_arch_irq(void)
1563 __irq_set_preflow_handler(irq, bfin_sec_preflow_handler); 1204 __irq_set_preflow_handler(irq, bfin_sec_preflow_handler);
1564 } 1205 }
1565 } 1206 }
1566 for (irq = GPIO_IRQ_BASE;
1567 irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++)
1568 irq_set_chip_and_handler(irq, &bfin_gpio_irqchip,
1569 handle_level_irq);
1570 1207
1571 bfin_write_IMASK(0); 1208 bfin_write_IMASK(0);
1572 CSYNC(); 1209 CSYNC();
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index 87bfe549ad3f..1387a94bcfd5 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -27,7 +27,7 @@ struct bfin_cpu_pm_fns *bfin_cpu_pm;
27 27
28void bfin_pm_suspend_standby_enter(void) 28void bfin_pm_suspend_standby_enter(void)
29{ 29{
30#ifndef CONFIG_BF60x 30#if !BFIN_GPIO_PINT
31 bfin_pm_standby_setup(); 31 bfin_pm_standby_setup();
32#endif 32#endif
33 33
@@ -41,7 +41,7 @@ void bfin_pm_suspend_standby_enter(void)
41# endif 41# endif
42#endif 42#endif
43 43
44#ifndef CONFIG_BF60x 44#if !BFIN_GPIO_PINT
45 bfin_pm_standby_restore(); 45 bfin_pm_standby_restore();
46#endif 46#endif
47 47
@@ -128,6 +128,7 @@ static void flushinv_all_dcache(void)
128 if ((status & 0x3) != 0x3) 128 if ((status & 0x3) != 0x3)
129 continue; 129 continue;
130 130
131
131 /* construct the address using the tag */ 132 /* construct the address using the tag */
132 addr = (status & 0xFFFFC800) | (subbank << 12) | (set << 5); 133 addr = (status & 0xFFFFC800) | (subbank << 12) | (set << 5);
133 134
@@ -140,11 +141,14 @@ static void flushinv_all_dcache(void)
140 141
141int bfin_pm_suspend_mem_enter(void) 142int bfin_pm_suspend_mem_enter(void)
142{ 143{
143 int wakeup, ret; 144 int ret;
145#ifndef CONFIG_BF60x
146 int wakeup;
147#endif
144 148
145 unsigned char *memptr = kmalloc(L1_CODE_LENGTH + L1_DATA_A_LENGTH 149 unsigned char *memptr = kmalloc(L1_CODE_LENGTH + L1_DATA_A_LENGTH
146 + L1_DATA_B_LENGTH + L1_SCRATCH_LENGTH, 150 + L1_DATA_B_LENGTH + L1_SCRATCH_LENGTH,
147 GFP_KERNEL); 151 GFP_ATOMIC);
148 152
149 if (memptr == NULL) { 153 if (memptr == NULL) {
150 panic("bf53x_suspend_l1_mem malloc failed"); 154 panic("bf53x_suspend_l1_mem malloc failed");
@@ -170,10 +174,8 @@ int bfin_pm_suspend_mem_enter(void)
170 return ret; 174 return ret;
171 } 175 }
172 176
177#ifdef CONFIG_GPIO_ADI
173 bfin_gpio_pm_hibernate_suspend(); 178 bfin_gpio_pm_hibernate_suspend();
174
175#if BFIN_GPIO_PINT
176 bfin_pint_suspend();
177#endif 179#endif
178 180
179#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK) 181#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)
@@ -194,11 +196,9 @@ int bfin_pm_suspend_mem_enter(void)
194 _enable_icplb(); 196 _enable_icplb();
195 _enable_dcplb(); 197 _enable_dcplb();
196 198
197#if BFIN_GPIO_PINT 199#ifdef CONFIG_GPIO_ADI
198 bfin_pint_resume();
199#endif
200
201 bfin_gpio_pm_hibernate_restore(); 200 bfin_gpio_pm_hibernate_restore();
201#endif
202 blackfin_dma_resume(); 202 blackfin_dma_resume();
203 203
204 kfree(memptr); 204 kfree(memptr);
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 82f301c117a5..2bbae0783819 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -146,6 +146,7 @@ static irqreturn_t ipi_handler_int1(int irq, void *dev_instance)
146 146
147 platform_clear_ipi(cpu, IRQ_SUPPLE_1); 147 platform_clear_ipi(cpu, IRQ_SUPPLE_1);
148 148
149 smp_rmb();
149 bfin_ipi_data = &__get_cpu_var(bfin_ipi); 150 bfin_ipi_data = &__get_cpu_var(bfin_ipi);
150 while ((pending = atomic_xchg(&bfin_ipi_data->bits, 0)) != 0) { 151 while ((pending = atomic_xchg(&bfin_ipi_data->bits, 0)) != 0) {
151 msg = 0; 152 msg = 0;
@@ -161,18 +162,20 @@ static irqreturn_t ipi_handler_int1(int irq, void *dev_instance)
161 case BFIN_IPI_CALL_FUNC: 162 case BFIN_IPI_CALL_FUNC:
162 generic_smp_call_function_interrupt(); 163 generic_smp_call_function_interrupt();
163 break; 164 break;
164
165 case BFIN_IPI_CALL_FUNC_SINGLE: 165 case BFIN_IPI_CALL_FUNC_SINGLE:
166 generic_smp_call_function_single_interrupt(); 166 generic_smp_call_function_single_interrupt();
167 break; 167 break;
168
169 case BFIN_IPI_CPU_STOP: 168 case BFIN_IPI_CPU_STOP:
170 ipi_cpu_stop(cpu); 169 ipi_cpu_stop(cpu);
171 break; 170 break;
171 default:
172 goto out;
172 } 173 }
173 atomic_dec(&bfin_ipi_data->count); 174 atomic_dec(&bfin_ipi_data->count);
174 } while (msg < BITS_PER_LONG); 175 } while (msg < BITS_PER_LONG);
176
175 } 177 }
178out:
176 return IRQ_HANDLED; 179 return IRQ_HANDLED;
177} 180}
178 181
@@ -198,10 +201,11 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg)
198 bfin_ipi_data = &per_cpu(bfin_ipi, cpu); 201 bfin_ipi_data = &per_cpu(bfin_ipi, cpu);
199 atomic_set_mask((1 << msg), &bfin_ipi_data->bits); 202 atomic_set_mask((1 << msg), &bfin_ipi_data->bits);
200 atomic_inc(&bfin_ipi_data->count); 203 atomic_inc(&bfin_ipi_data->count);
201 platform_send_ipi_cpu(cpu, IRQ_SUPPLE_1);
202 } 204 }
203
204 local_irq_restore(flags); 205 local_irq_restore(flags);
206 smp_wmb();
207 for_each_cpu(cpu, cpumask)
208 platform_send_ipi_cpu(cpu, IRQ_SUPPLE_1);
205} 209}
206 210
207void arch_send_call_function_single_ipi(int cpu) 211void arch_send_call_function_single_ipi(int cpu)
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index 957dd00ea561..77ea09b8bce1 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -36,9 +36,6 @@ config GENERIC_HWEIGHT
36config GENERIC_BUG 36config GENERIC_BUG
37 def_bool y 37 def_bool y
38 38
39config COMMON_CLKDEV
40 def_bool y
41
42config C6X_BIG_KERNEL 39config C6X_BIG_KERNEL
43 bool "Build a big kernel" 40 bool "Build a big kernel"
44 help 41 help
@@ -105,10 +102,6 @@ menu "Processor type and features"
105 102
106source "arch/c6x/platforms/Kconfig" 103source "arch/c6x/platforms/Kconfig"
107 104
108config TMS320C6X_CACHES_ON
109 bool "L2 cache support"
110 default y
111
112config KERNEL_RAM_BASE_ADDRESS 105config KERNEL_RAM_BASE_ADDRESS
113 hex "Virtual address of memory base" 106 hex "Virtual address of memory base"
114 default 0xe0000000 if SOC_TMS320C6455 107 default 0xe0000000 if SOC_TMS320C6455
diff --git a/arch/c6x/include/asm/thread_info.h b/arch/c6x/include/asm/thread_info.h
index 4c8dc562bd90..d4e9ef87076d 100644
--- a/arch/c6x/include/asm/thread_info.h
+++ b/arch/c6x/include/asm/thread_info.h
@@ -84,8 +84,6 @@ struct thread_info *current_thread_info(void)
84#define put_thread_info(ti) put_task_struct((ti)->task) 84#define put_thread_info(ti) put_task_struct((ti)->task)
85#endif /* __ASSEMBLY__ */ 85#endif /* __ASSEMBLY__ */
86 86
87#define PREEMPT_ACTIVE 0x10000000
88
89/* 87/*
90 * thread information flag bit numbers 88 * thread information flag bit numbers
91 * - pending work-to-be-done flags are in LSW 89 * - pending work-to-be-done flags are in LSW
diff --git a/arch/cris/include/asm/hardirq.h b/arch/cris/include/asm/hardirq.h
index 17bb12d760b2..04126f7bfab2 100644
--- a/arch/cris/include/asm/hardirq.h
+++ b/arch/cris/include/asm/hardirq.h
@@ -2,18 +2,6 @@
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4#include <asm/irq.h> 4#include <asm/irq.h>
5
6#define HARDIRQ_BITS 8
7
8/*
9 * The hardirq mask has to be large enough to have
10 * space for potentially all IRQ sources in the system
11 * nesting on a single CPU:
12 */
13#if (1 << HARDIRQ_BITS) < NR_IRQS
14# error HARDIRQ_BITS is too low!
15#endif
16
17#include <asm-generic/hardirq.h> 5#include <asm-generic/hardirq.h>
18 6
19#endif /* __ASM_HARDIRQ_H */ 7#endif /* __ASM_HARDIRQ_H */
diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h
index 07c8c40c52b3..55dede18c032 100644
--- a/arch/cris/include/asm/thread_info.h
+++ b/arch/cris/include/asm/thread_info.h
@@ -44,8 +44,6 @@ struct thread_info {
44 44
45#endif 45#endif
46 46
47#define PREEMPT_ACTIVE 0x10000000
48
49/* 47/*
50 * macros/functions for gaining access to the thread information structure 48 * macros/functions for gaining access to the thread information structure
51 */ 49 */
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index bebd7eadc772..af29e17c0181 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -52,8 +52,6 @@ struct thread_info {
52 52
53#endif 53#endif
54 54
55#define PREEMPT_ACTIVE 0x10000000
56
57/* 55/*
58 * macros/functions for gaining access to the thread information structure 56 * macros/functions for gaining access to the thread information structure
59 */ 57 */
diff --git a/arch/hexagon/include/asm/thread_info.h b/arch/hexagon/include/asm/thread_info.h
index f7c32406a711..a59dad3b3695 100644
--- a/arch/hexagon/include/asm/thread_info.h
+++ b/arch/hexagon/include/asm/thread_info.h
@@ -73,10 +73,6 @@ struct thread_info {
73 73
74#endif /* __ASSEMBLY__ */ 74#endif /* __ASSEMBLY__ */
75 75
76/* looks like "linux/hardirq.h" uses this. */
77
78#define PREEMPT_ACTIVE 0x10000000
79
80#ifndef __ASSEMBLY__ 76#ifndef __ASSEMBLY__
81 77
82#define INIT_THREAD_INFO(tsk) \ 78#define INIT_THREAD_INFO(tsk) \
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index dfe85e92ca2e..4e4119b0e691 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -6,6 +6,7 @@ menu "Processor type and features"
6 6
7config IA64 7config IA64
8 bool 8 bool
9 select ARCH_MIGHT_HAVE_PC_PARPORT
9 select PCI if (!IA64_HP_SIM) 10 select PCI if (!IA64_HP_SIM)
10 select ACPI if (!IA64_HP_SIM) 11 select ACPI if (!IA64_HP_SIM)
11 select PM if (!IA64_HP_SIM) 12 select PM if (!IA64_HP_SIM)
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index d43daf192b21..4c530a82fc46 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1992,7 +1992,7 @@ sba_connect_bus(struct pci_bus *bus)
1992 if (PCI_CONTROLLER(bus)->iommu) 1992 if (PCI_CONTROLLER(bus)->iommu)
1993 return; 1993 return;
1994 1994
1995 handle = PCI_CONTROLLER(bus)->acpi_handle; 1995 handle = acpi_device_handle(PCI_CONTROLLER(bus)->companion);
1996 if (!handle) 1996 if (!handle)
1997 return; 1997 return;
1998 1998
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index 80775f55f03f..71fbaaa495cc 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -95,7 +95,7 @@ struct iospace_resource {
95}; 95};
96 96
97struct pci_controller { 97struct pci_controller {
98 void *acpi_handle; 98 struct acpi_device *companion;
99 void *iommu; 99 void *iommu;
100 int segment; 100 int segment;
101 int node; /* nearest node with memory or -1 for global allocation */ 101 int node; /* nearest node with memory or -1 for global allocation */
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index cade13dd0299..5957cf61f898 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -11,9 +11,6 @@
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/ptrace.h> 12#include <asm/ptrace.h>
13 13
14#define PREEMPT_ACTIVE_BIT 30
15#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
16
17#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
18 15
19/* 16/*
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 7a53530f22c2..ddea607f948a 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1169,21 +1169,8 @@ skip_rbs_switch:
1169.work_pending: 1169.work_pending:
1170 tbit.z p6,p0=r31,TIF_NEED_RESCHED // is resched not needed? 1170 tbit.z p6,p0=r31,TIF_NEED_RESCHED // is resched not needed?
1171(p6) br.cond.sptk.few .notify 1171(p6) br.cond.sptk.few .notify
1172#ifdef CONFIG_PREEMPT 1172 br.call.spnt.many rp=preempt_schedule_irq
1173(pKStk) dep r21=-1,r0,PREEMPT_ACTIVE_BIT,1
1174 ;;
1175(pKStk) st4 [r20]=r21
1176#endif
1177 SSM_PSR_I(p0, p6, r2) // enable interrupts
1178 br.call.spnt.many rp=schedule
1179.ret9: cmp.eq p6,p0=r0,r0 // p6 <- 1 (re-check) 1173.ret9: cmp.eq p6,p0=r0,r0 // p6 <- 1 (re-check)
1180 RSM_PSR_I(p0, r2, r20) // disable interrupts
1181 ;;
1182#ifdef CONFIG_PREEMPT
1183(pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
1184 ;;
1185(pKStk) st4 [r20]=r0 // preempt_count() <- 0
1186#endif
1187(pLvSys)br.cond.sptk.few __paravirt_pending_syscall_end 1174(pLvSys)br.cond.sptk.few __paravirt_pending_syscall_end
1188 br.cond.sptk.many .work_processed_kernel 1175 br.cond.sptk.many .work_processed_kernel
1189 1176
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index f8280a766a78..074fde49c9e6 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -947,7 +947,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
947 case KPROBE_HIT_SSDONE: 947 case KPROBE_HIT_SSDONE:
948 /* 948 /*
949 * We increment the nmissed count for accounting, 949 * We increment the nmissed count for accounting,
950 * we can also use npre/npostfault count for accouting 950 * we can also use npre/npostfault count for accounting
951 * these specific fault cases. 951 * these specific fault cases.
952 */ 952 */
953 kprobes_inc_nmissed_count(cur); 953 kprobes_inc_nmissed_count(cur);
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 5a9ff1c3c3e9..cb592773c78b 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2166,12 +2166,6 @@ static const struct file_operations pfm_file_ops = {
2166 .flush = pfm_flush 2166 .flush = pfm_flush
2167}; 2167};
2168 2168
2169static int
2170pfmfs_delete_dentry(const struct dentry *dentry)
2171{
2172 return 1;
2173}
2174
2175static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen) 2169static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen)
2176{ 2170{
2177 return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]", 2171 return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]",
@@ -2179,7 +2173,7 @@ static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen)
2179} 2173}
2180 2174
2181static const struct dentry_operations pfmfs_dentry_operations = { 2175static const struct dentry_operations pfmfs_dentry_operations = {
2182 .d_delete = pfmfs_delete_dentry, 2176 .d_delete = always_delete_dentry,
2183 .d_dname = pfmfs_dname, 2177 .d_dname = pfmfs_dname,
2184}; 2178};
2185 2179
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 2326790b7d8b..9e4938d8ca4d 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -436,9 +436,9 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
436 if (!controller) 436 if (!controller)
437 return NULL; 437 return NULL;
438 438
439 controller->acpi_handle = device->handle; 439 controller->companion = device;
440 440
441 pxm = acpi_get_pxm(controller->acpi_handle); 441 pxm = acpi_get_pxm(device->handle);
442#ifdef CONFIG_NUMA 442#ifdef CONFIG_NUMA
443 if (pxm >= 0) 443 if (pxm >= 0)
444 controller->node = pxm_to_node(pxm); 444 controller->node = pxm_to_node(pxm);
@@ -489,7 +489,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
489{ 489{
490 struct pci_controller *controller = bridge->bus->sysdata; 490 struct pci_controller *controller = bridge->bus->sysdata;
491 491
492 ACPI_HANDLE_SET(&bridge->dev, controller->acpi_handle); 492 ACPI_COMPANION_SET(&bridge->dev, controller->companion);
493 return 0; 493 return 0;
494} 494}
495 495
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
index b1725398b5af..0640739cc20c 100644
--- a/arch/ia64/sn/kernel/io_acpi_init.c
+++ b/arch/ia64/sn/kernel/io_acpi_init.c
@@ -132,7 +132,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
132 struct acpi_resource_vendor_typed *vendor; 132 struct acpi_resource_vendor_typed *vendor;
133 133
134 134
135 handle = PCI_CONTROLLER(bus)->acpi_handle; 135 handle = acpi_device_handle(PCI_CONTROLLER(bus)->companion);
136 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, 136 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
137 &sn_uuid, &buffer); 137 &sn_uuid, &buffer);
138 if (ACPI_FAILURE(status)) { 138 if (ACPI_FAILURE(status)) {
@@ -360,7 +360,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
360 acpi_status status; 360 acpi_status status;
361 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 361 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
362 362
363 rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle; 363 rootbus_handle = acpi_device_handle(PCI_CONTROLLER(dev)->companion);
364 status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL, 364 status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
365 &segment); 365 &segment);
366 if (ACPI_SUCCESS(status)) { 366 if (ACPI_SUCCESS(status)) {
diff --git a/arch/m32r/include/asm/hardirq.h b/arch/m32r/include/asm/hardirq.h
index 4c31c0ae215e..5f2ac4f64ddf 100644
--- a/arch/m32r/include/asm/hardirq.h
+++ b/arch/m32r/include/asm/hardirq.h
@@ -3,22 +3,6 @@
3#define __ASM_HARDIRQ_H 3#define __ASM_HARDIRQ_H
4 4
5#include <asm/irq.h> 5#include <asm/irq.h>
6
7#if NR_IRQS > 256
8#define HARDIRQ_BITS 9
9#else
10#define HARDIRQ_BITS 8
11#endif
12
13/*
14 * The hardirq mask has to be large enough to have
15 * space for potentially all IRQ sources in the system
16 * nesting on a single CPU:
17 */
18#if (1 << HARDIRQ_BITS) < NR_IRQS
19# error HARDIRQ_BITS is too low!
20#endif
21
22#include <asm-generic/hardirq.h> 6#include <asm-generic/hardirq.h>
23 7
24#endif /* __ASM_HARDIRQ_H */ 8#endif /* __ASM_HARDIRQ_H */
diff --git a/arch/m32r/include/asm/mmu_context.h b/arch/m32r/include/asm/mmu_context.h
index a979a4198168..9fc78fc44445 100644
--- a/arch/m32r/include/asm/mmu_context.h
+++ b/arch/m32r/include/asm/mmu_context.h
@@ -45,7 +45,7 @@ static inline void get_new_mmu_context(struct mm_struct *mm)
45 Flush all TLB and start new cycle. */ 45 Flush all TLB and start new cycle. */
46 local_flush_tlb_all(); 46 local_flush_tlb_all();
47 /* Fix version if needed. 47 /* Fix version if needed.
48 Note that we avoid version #0 to distingush NO_CONTEXT. */ 48 Note that we avoid version #0 to distinguish NO_CONTEXT. */
49 if (!mc) 49 if (!mc)
50 mmu_context_cache = mc = MMU_CONTEXT_FIRST_VERSION; 50 mmu_context_cache = mc = MMU_CONTEXT_FIRST_VERSION;
51 } 51 }
diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
index c074f4c2e858..00171703402f 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -53,8 +53,6 @@ struct thread_info {
53 53
54#endif 54#endif
55 55
56#define PREEMPT_ACTIVE 0x10000000
57
58#define THREAD_SIZE (PAGE_SIZE << 1) 56#define THREAD_SIZE (PAGE_SIZE << 1)
59#define THREAD_SIZE_ORDER 1 57#define THREAD_SIZE_ORDER 1
60/* 58/*
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S
index 0c01543f10cd..7c3db9940ce1 100644
--- a/arch/m32r/kernel/entry.S
+++ b/arch/m32r/kernel/entry.S
@@ -182,13 +182,7 @@ need_resched:
182 ld r4, PSW(sp) ; interrupts off (exception path) ? 182 ld r4, PSW(sp) ; interrupts off (exception path) ?
183 and3 r4, r4, #0x4000 183 and3 r4, r4, #0x4000
184 beqz r4, restore_all 184 beqz r4, restore_all
185 LDIMM (r4, PREEMPT_ACTIVE) 185 bl preempt_schedule_irq
186 st r4, @(TI_PRE_COUNT, r8)
187 ENABLE_INTERRUPTS(r4)
188 bl schedule
189 ldi r4, #0
190 st r4, @(TI_PRE_COUNT, r8)
191 DISABLE_INTERRUPTS(r4)
192 bra need_resched 186 bra need_resched
193#endif 187#endif
194 188
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 311a300d48cc..75f25a8e3001 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -1,6 +1,7 @@
1config M68K 1config M68K
2 bool 2 bool
3 default y 3 default y
4 select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
4 select HAVE_IDE 5 select HAVE_IDE
5 select HAVE_AOUT if MMU 6 select HAVE_AOUT if MMU
6 select HAVE_DEBUG_BUGVERBOSE 7 select HAVE_DEBUG_BUGVERBOSE
diff --git a/arch/m68k/include/asm/hardirq.h b/arch/m68k/include/asm/hardirq.h
index db30ed276878..6c618529d9b9 100644
--- a/arch/m68k/include/asm/hardirq.h
+++ b/arch/m68k/include/asm/hardirq.h
@@ -5,17 +5,6 @@
5#include <linux/cache.h> 5#include <linux/cache.h>
6#include <asm/irq.h> 6#include <asm/irq.h>
7 7
8#define HARDIRQ_BITS 8
9
10/*
11 * The hardirq mask has to be large enough to have
12 * space for potentially all IRQ sources in the system
13 * nesting on a single CPU:
14 */
15#if (1 << HARDIRQ_BITS) < NR_IRQS
16# error HARDIRQ_BITS is too low!
17#endif
18
19#ifdef CONFIG_MMU 8#ifdef CONFIG_MMU
20 9
21static inline void ack_bad_irq(unsigned int irq) 10static inline void ack_bad_irq(unsigned int irq)
diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h
index 126131f94a2c..21a4784ca5a1 100644
--- a/arch/m68k/include/asm/thread_info.h
+++ b/arch/m68k/include/asm/thread_info.h
@@ -35,8 +35,6 @@ struct thread_info {
35}; 35};
36#endif /* __ASSEMBLY__ */ 36#endif /* __ASSEMBLY__ */
37 37
38#define PREEMPT_ACTIVE 0x4000000
39
40#define INIT_THREAD_INFO(tsk) \ 38#define INIT_THREAD_INFO(tsk) \
41{ \ 39{ \
42 .task = &tsk, \ 40 .task = &tsk, \
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index a78f5649e8de..b54ac7aba850 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -45,7 +45,7 @@
45.globl system_call, buserr, trap, resume 45.globl system_call, buserr, trap, resume
46.globl sys_call_table 46.globl sys_call_table
47.globl __sys_fork, __sys_clone, __sys_vfork 47.globl __sys_fork, __sys_clone, __sys_vfork
48.globl ret_from_interrupt, bad_interrupt 48.globl bad_interrupt
49.globl auto_irqhandler_fixup 49.globl auto_irqhandler_fixup
50.globl user_irqvec_fixup 50.globl user_irqvec_fixup
51 51
@@ -275,8 +275,6 @@ do_delayed_trace:
275ENTRY(auto_inthandler) 275ENTRY(auto_inthandler)
276 SAVE_ALL_INT 276 SAVE_ALL_INT
277 GET_CURRENT(%d0) 277 GET_CURRENT(%d0)
278 movel %d0,%a1
279 addqb #1,%a1@(TINFO_PREEMPT+1)
280 | put exception # in d0 278 | put exception # in d0
281 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 279 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
282 subw #VEC_SPUR,%d0 280 subw #VEC_SPUR,%d0
@@ -286,32 +284,13 @@ ENTRY(auto_inthandler)
286auto_irqhandler_fixup = . + 2 284auto_irqhandler_fixup = . + 2
287 jsr do_IRQ | process the IRQ 285 jsr do_IRQ | process the IRQ
288 addql #8,%sp | pop parameters off stack 286 addql #8,%sp | pop parameters off stack
289 287 jra ret_from_exception
290ret_from_interrupt:
291 movel %curptr@(TASK_STACK),%a1
292 subqb #1,%a1@(TINFO_PREEMPT+1)
293 jeq ret_from_last_interrupt
2942: RESTORE_ALL
295
296 ALIGN
297ret_from_last_interrupt:
298 moveq #(~ALLOWINT>>8)&0xff,%d0
299 andb %sp@(PT_OFF_SR),%d0
300 jne 2b
301
302 /* check if we need to do software interrupts */
303 tstl irq_stat+CPUSTAT_SOFTIRQ_PENDING
304 jeq .Lret_from_exception
305 pea ret_from_exception
306 jra do_softirq
307 288
308/* Handler for user defined interrupt vectors */ 289/* Handler for user defined interrupt vectors */
309 290
310ENTRY(user_inthandler) 291ENTRY(user_inthandler)
311 SAVE_ALL_INT 292 SAVE_ALL_INT
312 GET_CURRENT(%d0) 293 GET_CURRENT(%d0)
313 movel %d0,%a1
314 addqb #1,%a1@(TINFO_PREEMPT+1)
315 | put exception # in d0 294 | put exception # in d0
316 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 295 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
317user_irqvec_fixup = . + 2 296user_irqvec_fixup = . + 2
@@ -321,29 +300,18 @@ user_irqvec_fixup = . + 2
321 movel %d0,%sp@- | put vector # on stack 300 movel %d0,%sp@- | put vector # on stack
322 jsr do_IRQ | process the IRQ 301 jsr do_IRQ | process the IRQ
323 addql #8,%sp | pop parameters off stack 302 addql #8,%sp | pop parameters off stack
324 303 jra ret_from_exception
325 movel %curptr@(TASK_STACK),%a1
326 subqb #1,%a1@(TINFO_PREEMPT+1)
327 jeq ret_from_last_interrupt
328 RESTORE_ALL
329 304
330/* Handler for uninitialized and spurious interrupts */ 305/* Handler for uninitialized and spurious interrupts */
331 306
332ENTRY(bad_inthandler) 307ENTRY(bad_inthandler)
333 SAVE_ALL_INT 308 SAVE_ALL_INT
334 GET_CURRENT(%d0) 309 GET_CURRENT(%d0)
335 movel %d0,%a1
336 addqb #1,%a1@(TINFO_PREEMPT+1)
337 310
338 movel %sp,%sp@- 311 movel %sp,%sp@-
339 jsr handle_badint 312 jsr handle_badint
340 addql #4,%sp 313 addql #4,%sp
341 314 jra ret_from_exception
342 movel %curptr@(TASK_STACK),%a1
343 subqb #1,%a1@(TINFO_PREEMPT+1)
344 jeq ret_from_last_interrupt
345 RESTORE_ALL
346
347 315
348resume: 316resume:
349 /* 317 /*
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index 4d7da384eea0..077d3a70fed1 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -58,12 +58,6 @@ void __init init_IRQ(void)
58{ 58{
59 int i; 59 int i;
60 60
61 /* assembly irq entry code relies on this... */
62 if (HARDIRQ_MASK != 0x00ff0000) {
63 extern void hardirq_mask_is_broken(void);
64 hardirq_mask_is_broken();
65 }
66
67 for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++) 61 for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++)
68 irq_set_chip_and_handler(i, &auto_irq_chip, handle_simple_irq); 62 irq_set_chip_and_handler(i, &auto_irq_chip, handle_simple_irq);
69 63
diff --git a/arch/m68k/platform/68000/entry.S b/arch/m68k/platform/68000/entry.S
index 7f91c2fde509..23ac054c6e1a 100644
--- a/arch/m68k/platform/68000/entry.S
+++ b/arch/m68k/platform/68000/entry.S
@@ -27,7 +27,6 @@
27.globl ret_from_exception 27.globl ret_from_exception
28.globl ret_from_signal 28.globl ret_from_signal
29.globl sys_call_table 29.globl sys_call_table
30.globl ret_from_interrupt
31.globl bad_interrupt 30.globl bad_interrupt
32.globl inthandler1 31.globl inthandler1
33.globl inthandler2 32.globl inthandler2
@@ -137,7 +136,7 @@ inthandler1:
137 movel #65,%sp@- /* put vector # on stack*/ 136 movel #65,%sp@- /* put vector # on stack*/
138 jbsr process_int /* process the IRQ*/ 137 jbsr process_int /* process the IRQ*/
1393: addql #8,%sp /* pop parameters off stack*/ 1383: addql #8,%sp /* pop parameters off stack*/
140 bra ret_from_interrupt 139 bra ret_from_exception
141 140
142inthandler2: 141inthandler2:
143 SAVE_ALL_INT 142 SAVE_ALL_INT
@@ -148,7 +147,7 @@ inthandler2:
148 movel #66,%sp@- /* put vector # on stack*/ 147 movel #66,%sp@- /* put vector # on stack*/
149 jbsr process_int /* process the IRQ*/ 148 jbsr process_int /* process the IRQ*/
1503: addql #8,%sp /* pop parameters off stack*/ 1493: addql #8,%sp /* pop parameters off stack*/
151 bra ret_from_interrupt 150 bra ret_from_exception
152 151
153inthandler3: 152inthandler3:
154 SAVE_ALL_INT 153 SAVE_ALL_INT
@@ -159,7 +158,7 @@ inthandler3:
159 movel #67,%sp@- /* put vector # on stack*/ 158 movel #67,%sp@- /* put vector # on stack*/
160 jbsr process_int /* process the IRQ*/ 159 jbsr process_int /* process the IRQ*/
1613: addql #8,%sp /* pop parameters off stack*/ 1603: addql #8,%sp /* pop parameters off stack*/
162 bra ret_from_interrupt 161 bra ret_from_exception
163 162
164inthandler4: 163inthandler4:
165 SAVE_ALL_INT 164 SAVE_ALL_INT
@@ -170,7 +169,7 @@ inthandler4:
170 movel #68,%sp@- /* put vector # on stack*/ 169 movel #68,%sp@- /* put vector # on stack*/
171 jbsr process_int /* process the IRQ*/ 170 jbsr process_int /* process the IRQ*/
1723: addql #8,%sp /* pop parameters off stack*/ 1713: addql #8,%sp /* pop parameters off stack*/
173 bra ret_from_interrupt 172 bra ret_from_exception
174 173
175inthandler5: 174inthandler5:
176 SAVE_ALL_INT 175 SAVE_ALL_INT
@@ -181,7 +180,7 @@ inthandler5:
181 movel #69,%sp@- /* put vector # on stack*/ 180 movel #69,%sp@- /* put vector # on stack*/
182 jbsr process_int /* process the IRQ*/ 181 jbsr process_int /* process the IRQ*/
1833: addql #8,%sp /* pop parameters off stack*/ 1823: addql #8,%sp /* pop parameters off stack*/
184 bra ret_from_interrupt 183 bra ret_from_exception
185 184
186inthandler6: 185inthandler6:
187 SAVE_ALL_INT 186 SAVE_ALL_INT
@@ -192,7 +191,7 @@ inthandler6:
192 movel #70,%sp@- /* put vector # on stack*/ 191 movel #70,%sp@- /* put vector # on stack*/
193 jbsr process_int /* process the IRQ*/ 192 jbsr process_int /* process the IRQ*/
1943: addql #8,%sp /* pop parameters off stack*/ 1933: addql #8,%sp /* pop parameters off stack*/
195 bra ret_from_interrupt 194 bra ret_from_exception
196 195
197inthandler7: 196inthandler7:
198 SAVE_ALL_INT 197 SAVE_ALL_INT
@@ -203,7 +202,7 @@ inthandler7:
203 movel #71,%sp@- /* put vector # on stack*/ 202 movel #71,%sp@- /* put vector # on stack*/
204 jbsr process_int /* process the IRQ*/ 203 jbsr process_int /* process the IRQ*/
2053: addql #8,%sp /* pop parameters off stack*/ 2043: addql #8,%sp /* pop parameters off stack*/
206 bra ret_from_interrupt 205 bra ret_from_exception
207 206
208inthandler: 207inthandler:
209 SAVE_ALL_INT 208 SAVE_ALL_INT
@@ -214,23 +213,7 @@ inthandler:
214 movel %d0,%sp@- /* put vector # on stack*/ 213 movel %d0,%sp@- /* put vector # on stack*/
215 jbsr process_int /* process the IRQ*/ 214 jbsr process_int /* process the IRQ*/
2163: addql #8,%sp /* pop parameters off stack*/ 2153: addql #8,%sp /* pop parameters off stack*/
217 bra ret_from_interrupt 216 bra ret_from_exception
218
219ret_from_interrupt:
220 jeq 1f
2212:
222 RESTORE_ALL
2231:
224 moveb %sp@(PT_OFF_SR), %d0
225 and #7, %d0
226 jhi 2b
227
228 /* check if we need to do software interrupts */
229 jeq ret_from_exception
230
231 pea ret_from_exception
232 jra do_softirq
233
234 217
235/* 218/*
236 * Handler for uninitialized and spurious interrupts. 219 * Handler for uninitialized and spurious interrupts.
diff --git a/arch/m68k/platform/68360/entry.S b/arch/m68k/platform/68360/entry.S
index 904fd9a4af4e..447c33ef37fd 100644
--- a/arch/m68k/platform/68360/entry.S
+++ b/arch/m68k/platform/68360/entry.S
@@ -29,7 +29,6 @@
29.globl ret_from_exception 29.globl ret_from_exception
30.globl ret_from_signal 30.globl ret_from_signal
31.globl sys_call_table 31.globl sys_call_table
32.globl ret_from_interrupt
33.globl bad_interrupt 32.globl bad_interrupt
34.globl inthandler 33.globl inthandler
35 34
@@ -132,26 +131,9 @@ inthandler:
132 131
133 movel %sp,%sp@- 132 movel %sp,%sp@-
134 movel %d0,%sp@- /* put vector # on stack*/ 133 movel %d0,%sp@- /* put vector # on stack*/
135 jbsr do_IRQ /* process the IRQ*/ 134 jbsr do_IRQ /* process the IRQ */
1363: addql #8,%sp /* pop parameters off stack*/ 135 addql #8,%sp /* pop parameters off stack*/
137 bra ret_from_interrupt 136 jra ret_from_exception
138
139ret_from_interrupt:
140 jeq 1f
1412:
142 RESTORE_ALL
1431:
144 moveb %sp@(PT_OFF_SR), %d0
145 and #7, %d0
146 jhi 2b
147 /* check if we need to do software interrupts */
148
149 movel irq_stat+CPUSTAT_SOFTIRQ_PENDING,%d0
150 jeq ret_from_exception
151
152 pea ret_from_exception
153 jra do_softirq
154
155 137
156/* 138/*
157 * Handler for uninitialized and spurious interrupts. 139 * Handler for uninitialized and spurious interrupts.
diff --git a/arch/metag/include/asm/thread_info.h b/arch/metag/include/asm/thread_info.h
index 7c4a33006142..b19e9c588a16 100644
--- a/arch/metag/include/asm/thread_info.h
+++ b/arch/metag/include/asm/thread_info.h
@@ -46,8 +46,6 @@ struct thread_info {
46 46
47#endif 47#endif
48 48
49#define PREEMPT_ACTIVE 0x10000000
50
51#ifdef CONFIG_4KSTACKS 49#ifdef CONFIG_4KSTACKS
52#define THREAD_SHIFT 12 50#define THREAD_SHIFT 12
53#else 51#else
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 655e1cadf692..e23cccde9c27 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -1,5 +1,6 @@
1config MICROBLAZE 1config MICROBLAZE
2 def_bool y 2 def_bool y
3 select ARCH_MIGHT_HAVE_PC_PARPORT
3 select HAVE_MEMBLOCK 4 select HAVE_MEMBLOCK
4 select HAVE_MEMBLOCK_NODE_MAP 5 select HAVE_MEMBLOCK_NODE_MAP
5 select HAVE_FUNCTION_TRACER 6 select HAVE_FUNCTION_TRACER
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index de26ea6373de..8c9d36591a03 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -106,8 +106,6 @@ static inline struct thread_info *current_thread_info(void)
106/* thread information allocation */ 106/* thread information allocation */
107#endif /* __ASSEMBLY__ */ 107#endif /* __ASSEMBLY__ */
108 108
109#define PREEMPT_ACTIVE 0x10000000
110
111/* 109/*
112 * thread information flags 110 * thread information flags
113 * - these are process state flags that various assembly files may 111 * - these are process state flags that various assembly files may
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 867d7db11581..650de3976e7a 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1,6 +1,7 @@
1config MIPS 1config MIPS
2 bool 2 bool
3 default y 3 default y
4 select ARCH_MIGHT_HAVE_PC_PARPORT
4 select HAVE_CONTEXT_TRACKING 5 select HAVE_CONTEXT_TRACKING
5 select HAVE_GENERIC_DMA_COHERENT 6 select HAVE_GENERIC_DMA_COHERENT
6 select HAVE_IDE 7 select HAVE_IDE
diff --git a/arch/mips/configs/db1235_defconfig b/arch/mips/configs/db1235_defconfig
index e2b4ad55462f..28e49f226dc0 100644
--- a/arch/mips/configs/db1235_defconfig
+++ b/arch/mips/configs/db1235_defconfig
@@ -351,7 +351,6 @@ CONFIG_USB_OHCI_HCD=y
351CONFIG_USB_OHCI_HCD_PLATFORM=y 351CONFIG_USB_OHCI_HCD_PLATFORM=y
352CONFIG_USB_STORAGE=y 352CONFIG_USB_STORAGE=y
353CONFIG_MMC=y 353CONFIG_MMC=y
354CONFIG_MMC_CLKGATE=y
355CONFIG_MMC_AU1X=y 354CONFIG_MMC_AU1X=y
356CONFIG_NEW_LEDS=y 355CONFIG_NEW_LEDS=y
357CONFIG_LEDS_CLASS=y 356CONFIG_LEDS_CLASS=y
diff --git a/arch/mips/include/asm/octeon/cvmx-pip.h b/arch/mips/include/asm/octeon/cvmx-pip.h
index a76fe5a57a9f..df69bfd2b006 100644
--- a/arch/mips/include/asm/octeon/cvmx-pip.h
+++ b/arch/mips/include/asm/octeon/cvmx-pip.h
@@ -192,13 +192,13 @@ typedef struct {
192 /* Number of packets processed by PIP */ 192 /* Number of packets processed by PIP */
193 uint32_t packets; 193 uint32_t packets;
194 /* 194 /*
195 * Number of indentified L2 multicast packets. Does not 195 * Number of identified L2 multicast packets. Does not
196 * include broadcast packets. Only includes packets whose 196 * include broadcast packets. Only includes packets whose
197 * parse mode is SKIP_TO_L2 197 * parse mode is SKIP_TO_L2
198 */ 198 */
199 uint32_t multicast_packets; 199 uint32_t multicast_packets;
200 /* 200 /*
201 * Number of indentified L2 broadcast packets. Does not 201 * Number of identified L2 broadcast packets. Does not
202 * include multicast packets. Only includes packets whose 202 * include multicast packets. Only includes packets whose
203 * parse mode is SKIP_TO_L2 203 * parse mode is SKIP_TO_L2
204 */ 204 */
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index f9b24bfbdbae..4f58ef6d0eed 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -92,8 +92,6 @@ static inline struct thread_info *current_thread_info(void)
92 92
93#define STACK_WARN (THREAD_SIZE / 8) 93#define STACK_WARN (THREAD_SIZE / 8)
94 94
95#define PREEMPT_ACTIVE 0x10000000
96
97/* 95/*
98 * thread information flags 96 * thread information flags
99 * - these are process state flags that various assembly files may need to 97 * - these are process state flags that various assembly files may need to
diff --git a/arch/mn10300/include/asm/mmu_context.h b/arch/mn10300/include/asm/mmu_context.h
index c67c2b5365a6..75dbe696f830 100644
--- a/arch/mn10300/include/asm/mmu_context.h
+++ b/arch/mn10300/include/asm/mmu_context.h
@@ -71,7 +71,7 @@ static inline unsigned long allocate_mmu_context(struct mm_struct *mm)
71 local_flush_tlb_all(); 71 local_flush_tlb_all();
72 72
73 /* fix the TLB version if needed (we avoid version #0 so as to 73 /* fix the TLB version if needed (we avoid version #0 so as to
74 * distingush MMU_NO_CONTEXT) */ 74 * distinguish MMU_NO_CONTEXT) */
75 if (!mc) 75 if (!mc)
76 *pmc = mc = MMU_CONTEXT_FIRST_VERSION; 76 *pmc = mc = MMU_CONTEXT_FIRST_VERSION;
77 } 77 }
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index 224b4262486d..bf280eaccd36 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -16,8 +16,6 @@
16 16
17#include <asm/page.h> 17#include <asm/page.h>
18 18
19#define PREEMPT_ACTIVE 0x10000000
20
21#ifdef CONFIG_4KSTACKS 19#ifdef CONFIG_4KSTACKS
22#define THREAD_SIZE (4096) 20#define THREAD_SIZE (4096)
23#define THREAD_SIZE_ORDER (0) 21#define THREAD_SIZE_ORDER (0)
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile
index 4739b8302a58..89076a66eee2 100644
--- a/arch/openrisc/Makefile
+++ b/arch/openrisc/Makefile
@@ -24,7 +24,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S
24LDFLAGS_vmlinux := 24LDFLAGS_vmlinux :=
25LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 25LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
26 26
27KBUILD_CFLAGS += -pipe -ffixed-r10 27KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__
28 28
29ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y) 29ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y)
30 KBUILD_CFLAGS += $(call cc-option,-mhard-mul) 30 KBUILD_CFLAGS += $(call cc-option,-mhard-mul)
diff --git a/arch/openrisc/configs/or1ksim_defconfig b/arch/openrisc/configs/or1ksim_defconfig
index ea172bdfa36a..42fe5303a370 100644
--- a/arch/openrisc/configs/or1ksim_defconfig
+++ b/arch/openrisc/configs/or1ksim_defconfig
@@ -1,9 +1,9 @@
1CONFIG_CROSS_COMPILE="or32-linux-" 1CONFIG_CROSS_COMPILE="or32-linux-"
2CONFIG_NO_HZ=y
2CONFIG_LOG_BUF_SHIFT=14 3CONFIG_LOG_BUF_SHIFT=14
3CONFIG_BLK_DEV_INITRD=y 4CONFIG_BLK_DEV_INITRD=y
4# CONFIG_RD_GZIP is not set 5# CONFIG_RD_GZIP is not set
5CONFIG_EXPERT=y 6CONFIG_EXPERT=y
6# CONFIG_SYSCTL_SYSCALL is not set
7# CONFIG_KALLSYMS is not set 7# CONFIG_KALLSYMS is not set
8# CONFIG_EPOLL is not set 8# CONFIG_EPOLL is not set
9# CONFIG_TIMERFD is not set 9# CONFIG_TIMERFD is not set
@@ -15,7 +15,6 @@ CONFIG_SLOB=y
15CONFIG_MODULES=y 15CONFIG_MODULES=y
16# CONFIG_BLOCK is not set 16# CONFIG_BLOCK is not set
17CONFIG_OPENRISC_BUILTIN_DTB="or1ksim" 17CONFIG_OPENRISC_BUILTIN_DTB="or1ksim"
18CONFIG_NO_HZ=y
19CONFIG_HZ_100=y 18CONFIG_HZ_100=y
20CONFIG_NET=y 19CONFIG_NET=y
21CONFIG_PACKET=y 20CONFIG_PACKET=y
@@ -39,11 +38,8 @@ CONFIG_DEVTMPFS_MOUNT=y
39# CONFIG_FW_LOADER is not set 38# CONFIG_FW_LOADER is not set
40CONFIG_PROC_DEVICETREE=y 39CONFIG_PROC_DEVICETREE=y
41CONFIG_NETDEVICES=y 40CONFIG_NETDEVICES=y
42CONFIG_MICREL_PHY=y
43CONFIG_NET_ETHERNET=y
44CONFIG_ETHOC=y 41CONFIG_ETHOC=y
45# CONFIG_NETDEV_1000 is not set 42CONFIG_MICREL_PHY=y
46# CONFIG_NETDEV_10000 is not set
47# CONFIG_WLAN is not set 43# CONFIG_WLAN is not set
48# CONFIG_INPUT is not set 44# CONFIG_INPUT is not set
49# CONFIG_SERIO is not set 45# CONFIG_SERIO is not set
@@ -55,11 +51,9 @@ CONFIG_SERIAL_8250_CONSOLE=y
55CONFIG_SERIAL_OF_PLATFORM=y 51CONFIG_SERIAL_OF_PLATFORM=y
56# CONFIG_HW_RANDOM is not set 52# CONFIG_HW_RANDOM is not set
57# CONFIG_HWMON is not set 53# CONFIG_HWMON is not set
58# CONFIG_MFD_SUPPORT is not set
59# CONFIG_USB_SUPPORT is not set 54# CONFIG_USB_SUPPORT is not set
60# CONFIG_DNOTIFY is not set 55# CONFIG_DNOTIFY is not set
61CONFIG_TMPFS=y 56CONFIG_TMPFS=y
62CONFIG_NFS_FS=y 57CONFIG_NFS_FS=y
63CONFIG_NFS_V3=y
64# CONFIG_ENABLE_WARN_DEPRECATED is not set 58# CONFIG_ENABLE_WARN_DEPRECATED is not set
65# CONFIG_ENABLE_MUST_CHECK is not set 59# CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 78405625e799..da1951a22907 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -65,6 +65,7 @@ generic-y += trace_clock.h
65generic-y += types.h 65generic-y += types.h
66generic-y += ucontext.h 66generic-y += ucontext.h
67generic-y += user.h 67generic-y += user.h
68generic-y += vga.h
68generic-y += word-at-a-time.h 69generic-y += word-at-a-time.h
69generic-y += xor.h 70generic-y += xor.h
70generic-y += preempt.h 71generic-y += preempt.h
diff --git a/arch/openrisc/kernel/module.c b/arch/openrisc/kernel/module.c
index 10ff50f0202a..ef872ae4c878 100644
--- a/arch/openrisc/kernel/module.c
+++ b/arch/openrisc/kernel/module.c
@@ -47,12 +47,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
47 *location = value; 47 *location = value;
48 break; 48 break;
49 case R_OR32_CONST: 49 case R_OR32_CONST:
50 location = (uint16_t *)location + 1; 50 *((uint16_t *)location + 1) = value;
51 *((uint16_t *)location) = (uint16_t) (value);
52 break; 51 break;
53 case R_OR32_CONSTH: 52 case R_OR32_CONSTH:
54 location = (uint16_t *)location + 1; 53 *((uint16_t *)location + 1) = value >> 16;
55 *((uint16_t *)location) = (uint16_t) (value >> 16);
56 break; 54 break;
57 case R_OR32_JUMPTARG: 55 case R_OR32_JUMPTARG:
58 value -= (uint32_t)location; 56 value -= (uint32_t)location;
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index 09a769b69572..4fc7ccc0a2cf 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -40,6 +40,7 @@
40#include <linux/device.h> 40#include <linux/device.h>
41#include <linux/of_platform.h> 41#include <linux/of_platform.h>
42 42
43#include <asm/sections.h>
43#include <asm/segment.h> 44#include <asm/segment.h>
44#include <asm/pgtable.h> 45#include <asm/pgtable.h>
45#include <asm/types.h> 46#include <asm/types.h>
@@ -75,7 +76,7 @@ static unsigned long __init setup_memory(void)
75 76
76 ram_start_pfn = PFN_UP(memory_start); 77 ram_start_pfn = PFN_UP(memory_start);
77 /* free_ram_start_pfn is first page after kernel */ 78 /* free_ram_start_pfn is first page after kernel */
78 free_ram_start_pfn = PFN_UP(__pa(&_end)); 79 free_ram_start_pfn = PFN_UP(__pa(_end));
79 ram_end_pfn = PFN_DOWN(memblock_end_of_DRAM()); 80 ram_end_pfn = PFN_DOWN(memblock_end_of_DRAM());
80 81
81 max_pfn = ram_end_pfn; 82 max_pfn = ram_end_pfn;
@@ -207,15 +208,15 @@ void __init setup_cpuinfo(void)
207 * Falls back on built-in device tree in case null pointer is passed. 208 * Falls back on built-in device tree in case null pointer is passed.
208 */ 209 */
209 210
210void __init or32_early_setup(unsigned int fdt) 211void __init or32_early_setup(void *fdt)
211{ 212{
212 if (fdt) { 213 if (fdt)
213 early_init_devtree((void*) fdt); 214 pr_info("FDT at %p\n", fdt);
214 printk(KERN_INFO "FDT at 0x%08x\n", fdt); 215 else {
215 } else { 216 fdt = __dtb_start;
216 early_init_devtree(__dtb_start); 217 pr_info("Compiled-in FDT at %p\n", fdt);
217 printk(KERN_INFO "Compiled-in FDT at %p\n", __dtb_start);
218 } 218 }
219 early_init_devtree(fdt);
219} 220}
220 221
221static int __init openrisc_device_probe(void) 222static int __init openrisc_device_probe(void)
@@ -288,10 +289,10 @@ void __init setup_arch(char **cmdline_p)
288 setup_cpuinfo(); 289 setup_cpuinfo();
289 290
290 /* process 1's initial memory region is the kernel code/data */ 291 /* process 1's initial memory region is the kernel code/data */
291 init_mm.start_code = (unsigned long)&_stext; 292 init_mm.start_code = (unsigned long)_stext;
292 init_mm.end_code = (unsigned long)&_etext; 293 init_mm.end_code = (unsigned long)_etext;
293 init_mm.end_data = (unsigned long)&_edata; 294 init_mm.end_data = (unsigned long)_edata;
294 init_mm.brk = (unsigned long)&_end; 295 init_mm.brk = (unsigned long)_end;
295 296
296#ifdef CONFIG_BLK_DEV_INITRD 297#ifdef CONFIG_BLK_DEV_INITRD
297 initrd_start = (unsigned long)&__initrd_start; 298 initrd_start = (unsigned long)&__initrd_start;
diff --git a/arch/openrisc/kernel/vmlinux.h b/arch/openrisc/kernel/vmlinux.h
index ee842a2d3f36..70b9ce41835c 100644
--- a/arch/openrisc/kernel/vmlinux.h
+++ b/arch/openrisc/kernel/vmlinux.h
@@ -1,10 +1,8 @@
1#ifndef __OPENRISC_VMLINUX_H_ 1#ifndef __OPENRISC_VMLINUX_H_
2#define __OPENRISC_VMLINUX_H_ 2#define __OPENRISC_VMLINUX_H_
3 3
4extern char _stext, _etext, _edata, _end;
5#ifdef CONFIG_BLK_DEV_INITRD 4#ifdef CONFIG_BLK_DEV_INITRD
6extern char __initrd_start, __initrd_end; 5extern char __initrd_start, __initrd_end;
7extern char __initramfs_start;
8#endif 6#endif
9 7
10extern u32 __dtb_start[]; 8extern u32 __dtb_start[];
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index c03567a9a915..b5f1858baf33 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -1,6 +1,7 @@
1config PARISC 1config PARISC
2 def_bool y 2 def_bool y
3 select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS 3 select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
4 select ARCH_MIGHT_HAVE_PC_PARPORT
4 select HAVE_IDE 5 select HAVE_IDE
5 select HAVE_OPROFILE 6 select HAVE_OPROFILE
6 select HAVE_FUNCTION_TRACER if 64BIT 7 select HAVE_FUNCTION_TRACER if 64BIT
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index ec1b014952b6..acacd348df89 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -50,7 +50,7 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
50CONFIG_IDE=y 50CONFIG_IDE=y
51CONFIG_BLK_DEV_IDECD=y 51CONFIG_BLK_DEV_IDECD=y
52CONFIG_BLK_DEV_NS87415=y 52CONFIG_BLK_DEV_NS87415=y
53CONFIG_BLK_DEV_SIIMAGE=m 53CONFIG_PATA_SIL680=m
54CONFIG_SCSI=y 54CONFIG_SCSI=y
55CONFIG_BLK_DEV_SD=y 55CONFIG_BLK_DEV_SD=y
56CONFIG_CHR_DEV_ST=y 56CONFIG_CHR_DEV_ST=y
diff --git a/arch/parisc/configs/c8000_defconfig b/arch/parisc/configs/c8000_defconfig
index e1c8d2015c89..8249ac9d9cfc 100644
--- a/arch/parisc/configs/c8000_defconfig
+++ b/arch/parisc/configs/c8000_defconfig
@@ -20,7 +20,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
20CONFIG_MODVERSIONS=y 20CONFIG_MODVERSIONS=y
21CONFIG_BLK_DEV_INTEGRITY=y 21CONFIG_BLK_DEV_INTEGRITY=y
22CONFIG_PA8X00=y 22CONFIG_PA8X00=y
23CONFIG_MLONGCALLS=y
24CONFIG_64BIT=y 23CONFIG_64BIT=y
25CONFIG_SMP=y 24CONFIG_SMP=y
26CONFIG_PREEMPT=y 25CONFIG_PREEMPT=y
@@ -81,8 +80,6 @@ CONFIG_IDE=y
81CONFIG_BLK_DEV_IDECD=y 80CONFIG_BLK_DEV_IDECD=y
82CONFIG_BLK_DEV_PLATFORM=y 81CONFIG_BLK_DEV_PLATFORM=y
83CONFIG_BLK_DEV_GENERIC=y 82CONFIG_BLK_DEV_GENERIC=y
84CONFIG_BLK_DEV_SIIMAGE=y
85CONFIG_SCSI=y
86CONFIG_BLK_DEV_SD=y 83CONFIG_BLK_DEV_SD=y
87CONFIG_CHR_DEV_ST=m 84CONFIG_CHR_DEV_ST=m
88CONFIG_BLK_DEV_SR=m 85CONFIG_BLK_DEV_SR=m
@@ -94,6 +91,8 @@ CONFIG_SCSI_FC_ATTRS=y
94CONFIG_SCSI_SAS_LIBSAS=m 91CONFIG_SCSI_SAS_LIBSAS=m
95CONFIG_ISCSI_TCP=m 92CONFIG_ISCSI_TCP=m
96CONFIG_ISCSI_BOOT_SYSFS=m 93CONFIG_ISCSI_BOOT_SYSFS=m
94CONFIG_ATA=y
95CONFIG_PATA_SIL680=y
97CONFIG_FUSION=y 96CONFIG_FUSION=y
98CONFIG_FUSION_SPI=y 97CONFIG_FUSION_SPI=y
99CONFIG_FUSION_SAS=y 98CONFIG_FUSION_SAS=y
@@ -114,9 +113,8 @@ CONFIG_INPUT_FF_MEMLESS=m
114# CONFIG_KEYBOARD_ATKBD is not set 113# CONFIG_KEYBOARD_ATKBD is not set
115# CONFIG_KEYBOARD_HIL_OLD is not set 114# CONFIG_KEYBOARD_HIL_OLD is not set
116# CONFIG_KEYBOARD_HIL is not set 115# CONFIG_KEYBOARD_HIL is not set
117CONFIG_MOUSE_PS2=m 116# CONFIG_MOUSE_PS2 is not set
118CONFIG_INPUT_MISC=y 117CONFIG_INPUT_MISC=y
119CONFIG_INPUT_CM109=m
120CONFIG_SERIO_SERPORT=m 118CONFIG_SERIO_SERPORT=m
121CONFIG_SERIO_PARKBD=m 119CONFIG_SERIO_PARKBD=m
122CONFIG_SERIO_GSCPS2=m 120CONFIG_SERIO_GSCPS2=m
@@ -167,34 +165,6 @@ CONFIG_SND_VERBOSE_PRINTK=y
167CONFIG_SND_AD1889=m 165CONFIG_SND_AD1889=m
168# CONFIG_SND_USB is not set 166# CONFIG_SND_USB is not set
169# CONFIG_SND_GSC is not set 167# CONFIG_SND_GSC is not set
170CONFIG_HID_A4TECH=m
171CONFIG_HID_APPLE=m
172CONFIG_HID_BELKIN=m
173CONFIG_HID_CHERRY=m
174CONFIG_HID_CHICONY=m
175CONFIG_HID_CYPRESS=m
176CONFIG_HID_DRAGONRISE=m
177CONFIG_HID_EZKEY=m
178CONFIG_HID_KYE=m
179CONFIG_HID_GYRATION=m
180CONFIG_HID_TWINHAN=m
181CONFIG_HID_KENSINGTON=m
182CONFIG_HID_LOGITECH=m
183CONFIG_HID_LOGITECH_DJ=m
184CONFIG_HID_MICROSOFT=m
185CONFIG_HID_MONTEREY=m
186CONFIG_HID_NTRIG=m
187CONFIG_HID_ORTEK=m
188CONFIG_HID_PANTHERLORD=m
189CONFIG_HID_PETALYNX=m
190CONFIG_HID_SAMSUNG=m
191CONFIG_HID_SUNPLUS=m
192CONFIG_HID_GREENASIA=m
193CONFIG_HID_SMARTJOYPLUS=m
194CONFIG_HID_TOPSEED=m
195CONFIG_HID_THRUSTMASTER=m
196CONFIG_HID_ZEROPLUS=m
197CONFIG_USB_HID=m
198CONFIG_USB=y 168CONFIG_USB=y
199CONFIG_USB_OHCI_HCD=y 169CONFIG_USB_OHCI_HCD=y
200CONFIG_USB_STORAGE=y 170CONFIG_USB_STORAGE=y
diff --git a/arch/parisc/configs/generic-64bit_defconfig b/arch/parisc/configs/generic-64bit_defconfig
index 5874cebee077..28c1b5de044e 100644
--- a/arch/parisc/configs/generic-64bit_defconfig
+++ b/arch/parisc/configs/generic-64bit_defconfig
@@ -24,7 +24,6 @@ CONFIG_MODVERSIONS=y
24CONFIG_BLK_DEV_INTEGRITY=y 24CONFIG_BLK_DEV_INTEGRITY=y
25# CONFIG_IOSCHED_DEADLINE is not set 25# CONFIG_IOSCHED_DEADLINE is not set
26CONFIG_PA8X00=y 26CONFIG_PA8X00=y
27CONFIG_MLONGCALLS=y
28CONFIG_64BIT=y 27CONFIG_64BIT=y
29CONFIG_SMP=y 28CONFIG_SMP=y
30# CONFIG_COMPACTION is not set 29# CONFIG_COMPACTION is not set
@@ -68,7 +67,6 @@ CONFIG_IDE_GD=m
68CONFIG_IDE_GD_ATAPI=y 67CONFIG_IDE_GD_ATAPI=y
69CONFIG_BLK_DEV_IDECD=m 68CONFIG_BLK_DEV_IDECD=m
70CONFIG_BLK_DEV_NS87415=y 69CONFIG_BLK_DEV_NS87415=y
71CONFIG_BLK_DEV_SIIMAGE=y
72# CONFIG_SCSI_PROC_FS is not set 70# CONFIG_SCSI_PROC_FS is not set
73CONFIG_BLK_DEV_SD=y 71CONFIG_BLK_DEV_SD=y
74CONFIG_BLK_DEV_SR=y 72CONFIG_BLK_DEV_SR=y
@@ -82,6 +80,7 @@ CONFIG_SCSI_ZALON=y
82CONFIG_SCSI_QLA_ISCSI=m 80CONFIG_SCSI_QLA_ISCSI=m
83CONFIG_SCSI_DH=y 81CONFIG_SCSI_DH=y
84CONFIG_ATA=y 82CONFIG_ATA=y
83CONFIG_PATA_SIL680=y
85CONFIG_ATA_GENERIC=y 84CONFIG_ATA_GENERIC=y
86CONFIG_MD=y 85CONFIG_MD=y
87CONFIG_MD_LINEAR=m 86CONFIG_MD_LINEAR=m
@@ -162,7 +161,7 @@ CONFIG_SLIP_MODE_SLIP6=y
162CONFIG_INPUT_EVDEV=y 161CONFIG_INPUT_EVDEV=y
163# CONFIG_KEYBOARD_HIL_OLD is not set 162# CONFIG_KEYBOARD_HIL_OLD is not set
164# CONFIG_KEYBOARD_HIL is not set 163# CONFIG_KEYBOARD_HIL is not set
165# CONFIG_INPUT_MOUSE is not set 164# CONFIG_MOUSE_PS2 is not set
166CONFIG_INPUT_MISC=y 165CONFIG_INPUT_MISC=y
167CONFIG_SERIO_SERPORT=m 166CONFIG_SERIO_SERPORT=m
168# CONFIG_HP_SDC is not set 167# CONFIG_HP_SDC is not set
@@ -216,32 +215,7 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y
216CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y 215CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
217CONFIG_LOGO=y 216CONFIG_LOGO=y
218# CONFIG_LOGO_LINUX_MONO is not set 217# CONFIG_LOGO_LINUX_MONO is not set
219CONFIG_HID=m
220CONFIG_HIDRAW=y 218CONFIG_HIDRAW=y
221CONFIG_HID_DRAGONRISE=m
222CONFIG_DRAGONRISE_FF=y
223CONFIG_HID_KYE=m
224CONFIG_HID_GYRATION=m
225CONFIG_HID_TWINHAN=m
226CONFIG_LOGITECH_FF=y
227CONFIG_LOGIRUMBLEPAD2_FF=y
228CONFIG_HID_NTRIG=m
229CONFIG_HID_PANTHERLORD=m
230CONFIG_PANTHERLORD_FF=y
231CONFIG_HID_PETALYNX=m
232CONFIG_HID_SAMSUNG=m
233CONFIG_HID_SONY=m
234CONFIG_HID_SUNPLUS=m
235CONFIG_HID_GREENASIA=m
236CONFIG_GREENASIA_FF=y
237CONFIG_HID_SMARTJOYPLUS=m
238CONFIG_SMARTJOYPLUS_FF=y
239CONFIG_HID_TOPSEED=m
240CONFIG_HID_THRUSTMASTER=m
241CONFIG_THRUSTMASTER_FF=y
242CONFIG_HID_ZEROPLUS=m
243CONFIG_ZEROPLUS_FF=y
244CONFIG_USB_HID=m
245CONFIG_HID_PID=y 219CONFIG_HID_PID=y
246CONFIG_USB_HIDDEV=y 220CONFIG_USB_HIDDEV=y
247CONFIG_USB=y 221CONFIG_USB=y
@@ -251,13 +225,8 @@ CONFIG_USB_DYNAMIC_MINORS=y
251CONFIG_USB_MON=m 225CONFIG_USB_MON=m
252CONFIG_USB_WUSB_CBAF=m 226CONFIG_USB_WUSB_CBAF=m
253CONFIG_USB_XHCI_HCD=m 227CONFIG_USB_XHCI_HCD=m
254CONFIG_USB_EHCI_HCD=m 228CONFIG_USB_EHCI_HCD=y
255CONFIG_USB_OHCI_HCD=m 229CONFIG_USB_OHCI_HCD=y
256CONFIG_USB_R8A66597_HCD=m
257CONFIG_USB_ACM=m
258CONFIG_USB_PRINTER=m
259CONFIG_USB_WDM=m
260CONFIG_USB_TMC=m
261CONFIG_NEW_LEDS=y 230CONFIG_NEW_LEDS=y
262CONFIG_LEDS_CLASS=y 231CONFIG_LEDS_CLASS=y
263CONFIG_LEDS_TRIGGERS=y 232CONFIG_LEDS_TRIGGERS=y
diff --git a/arch/parisc/include/asm/serial.h b/arch/parisc/include/asm/serial.h
index d7e3cc60dbc3..77e9b67c87ee 100644
--- a/arch/parisc/include/asm/serial.h
+++ b/arch/parisc/include/asm/serial.h
@@ -6,5 +6,3 @@
6 * This is used for 16550-compatible UARTs 6 * This is used for 16550-compatible UARTs
7 */ 7 */
8#define BASE_BAUD ( 1843200 / 16 ) 8#define BASE_BAUD ( 1843200 / 16 )
9
10#define SERIAL_PORT_DFNS
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
new file mode 100644
index 000000000000..748016cb122d
--- /dev/null
+++ b/arch/parisc/include/asm/socket.h
@@ -0,0 +1,11 @@
1#ifndef _ASM_SOCKET_H
2#define _ASM_SOCKET_H
3
4#include <uapi/asm/socket.h>
5
6/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
7 * have to define SOCK_NONBLOCK to a different value here.
8 */
9#define SOCK_NONBLOCK 0x40000000
10
11#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
index bc7cf120106b..d5f97ea3a4e1 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -46,9 +46,6 @@ struct thread_info {
46#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) 46#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
47#define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) 47#define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
48 48
49#define PREEMPT_ACTIVE_BIT 28
50#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
51
52/* 49/*
53 * thread information flags 50 * thread information flags
54 */ 51 */
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 63f4dd0b49c2..4006964d8e12 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -4,14 +4,11 @@
4/* 4/*
5 * User space memory access functions 5 * User space memory access functions
6 */ 6 */
7#include <asm/processor.h>
8#include <asm/page.h> 7#include <asm/page.h>
9#include <asm/cache.h> 8#include <asm/cache.h>
10#include <asm/errno.h> 9#include <asm/errno.h>
11#include <asm-generic/uaccess-unaligned.h> 10#include <asm-generic/uaccess-unaligned.h>
12 11
13#include <linux/sched.h>
14
15#define VERIFY_READ 0 12#define VERIFY_READ 0
16#define VERIFY_WRITE 1 13#define VERIFY_WRITE 1
17 14
@@ -36,43 +33,12 @@ extern int __get_user_bad(void);
36extern int __put_kernel_bad(void); 33extern int __put_kernel_bad(void);
37extern int __put_user_bad(void); 34extern int __put_user_bad(void);
38 35
39 36static inline long access_ok(int type, const void __user * addr,
40/* 37 unsigned long size)
41 * Test whether a block of memory is a valid user space address.
42 * Returns 0 if the range is valid, nonzero otherwise.
43 */
44static inline int __range_not_ok(unsigned long addr, unsigned long size,
45 unsigned long limit)
46{ 38{
47 unsigned long __newaddr = addr + size; 39 return 1;
48 return (__newaddr < addr || __newaddr > limit || size > limit);
49} 40}
50 41
51/**
52 * access_ok: - Checks if a user space pointer is valid
53 * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that
54 * %VERIFY_WRITE is a superset of %VERIFY_READ - if it is safe
55 * to write to a block, it is always safe to read from it.
56 * @addr: User space pointer to start of block to check
57 * @size: Size of block to check
58 *
59 * Context: User context only. This function may sleep.
60 *
61 * Checks if a pointer to a block of memory in user space is valid.
62 *
63 * Returns true (nonzero) if the memory block may be valid, false (zero)
64 * if it is definitely invalid.
65 *
66 * Note that, depending on architecture, this function probably just
67 * checks that the pointer is in the user space range - after calling
68 * this function, memory access functions may still return -EFAULT.
69 */
70#define access_ok(type, addr, size) \
71( __chk_user_ptr(addr), \
72 !__range_not_ok((unsigned long) (__force void *) (addr), \
73 size, user_addr_max()) \
74)
75
76#define put_user __put_user 42#define put_user __put_user
77#define get_user __get_user 43#define get_user __get_user
78 44
@@ -253,11 +219,7 @@ extern long lstrnlen_user(const char __user *,long);
253/* 219/*
254 * Complex access routines -- macros 220 * Complex access routines -- macros
255 */ 221 */
256#ifdef CONFIG_COMPAT 222#define user_addr_max() (~0UL)
257#define user_addr_max() (TASK_SIZE)
258#else
259#define user_addr_max() (DEFAULT_TASK_SIZE)
260#endif
261 223
262#define strnlen_user lstrnlen_user 224#define strnlen_user lstrnlen_user
263#define strlen_user(str) lstrnlen_user(str, 0x7fffffffL) 225#define strlen_user(str) lstrnlen_user(str, 0x7fffffffL)
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index 7c614d01f1fa..f33113a6141e 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_SOCKET_H 1#ifndef _UAPI_ASM_SOCKET_H
2#define _ASM_SOCKET_H 2#define _UAPI_ASM_SOCKET_H
3 3
4#include <asm/sockios.h> 4#include <asm/sockios.h>
5 5
@@ -77,9 +77,4 @@
77 77
78#define SO_MAX_PACING_RATE 0x4048 78#define SO_MAX_PACING_RATE 0x4048
79 79
80/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 80#endif /* _UAPI_ASM_SOCKET_H */
81 * have to define SOCK_NONBLOCK to a different value here.
82 */
83#define SOCK_NONBLOCK 0x40000000
84
85#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c
index 06cb3992907e..608716f8496b 100644
--- a/arch/parisc/kernel/hardware.c
+++ b/arch/parisc/kernel/hardware.c
@@ -36,6 +36,9 @@
36 * HP PARISC Hardware Database 36 * HP PARISC Hardware Database
37 * Access to this database is only possible during bootup 37 * Access to this database is only possible during bootup
38 * so don't reference this table after starting the init process 38 * so don't reference this table after starting the init process
39 *
40 * NOTE: Product names which are listed here and ends with a '?'
41 * are guessed. If you know the correct name, please let us know.
39 */ 42 */
40 43
41static struct hp_hardware hp_hardware_list[] = { 44static struct hp_hardware hp_hardware_list[] = {
@@ -222,7 +225,7 @@ static struct hp_hardware hp_hardware_list[] = {
222 {HPHW_NPROC,0x5DD,0x4,0x81,"Duet W2"}, 225 {HPHW_NPROC,0x5DD,0x4,0x81,"Duet W2"},
223 {HPHW_NPROC,0x5DE,0x4,0x81,"Piccolo W+"}, 226 {HPHW_NPROC,0x5DE,0x4,0x81,"Piccolo W+"},
224 {HPHW_NPROC,0x5DF,0x4,0x81,"Cantata W2"}, 227 {HPHW_NPROC,0x5DF,0x4,0x81,"Cantata W2"},
225 {HPHW_NPROC,0x5DF,0x0,0x00,"Marcato W+? (rp5470)"}, 228 {HPHW_NPROC,0x5DF,0x0,0x00,"Marcato W+ (rp5470)?"},
226 {HPHW_NPROC,0x5E0,0x4,0x91,"Cantata DC- W2"}, 229 {HPHW_NPROC,0x5E0,0x4,0x91,"Cantata DC- W2"},
227 {HPHW_NPROC,0x5E1,0x4,0x91,"Crescendo DC- W2"}, 230 {HPHW_NPROC,0x5E1,0x4,0x91,"Crescendo DC- W2"},
228 {HPHW_NPROC,0x5E2,0x4,0x91,"Crescendo 650 W2"}, 231 {HPHW_NPROC,0x5E2,0x4,0x91,"Crescendo 650 W2"},
@@ -276,9 +279,11 @@ static struct hp_hardware hp_hardware_list[] = {
276 {HPHW_NPROC,0x888,0x4,0x91,"Storm Peak Fast DC-"}, 279 {HPHW_NPROC,0x888,0x4,0x91,"Storm Peak Fast DC-"},
277 {HPHW_NPROC,0x889,0x4,0x91,"Storm Peak Fast"}, 280 {HPHW_NPROC,0x889,0x4,0x91,"Storm Peak Fast"},
278 {HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak Slow"}, 281 {HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak Slow"},
282 {HPHW_NPROC,0x88B,0x4,0x91,"Crestone Peak Fast?"},
279 {HPHW_NPROC,0x88C,0x4,0x91,"Orca Mako+"}, 283 {HPHW_NPROC,0x88C,0x4,0x91,"Orca Mako+"},
280 {HPHW_NPROC,0x88D,0x4,0x91,"Rainier/Medel Mako+ Slow"}, 284 {HPHW_NPROC,0x88D,0x4,0x91,"Rainier/Medel Mako+ Slow"},
281 {HPHW_NPROC,0x88E,0x4,0x91,"Rainier/Medel Mako+ Fast"}, 285 {HPHW_NPROC,0x88E,0x4,0x91,"Rainier/Medel Mako+ Fast"},
286 {HPHW_NPROC,0x892,0x4,0x91,"Mt. Hamilton Slow Mako+?"},
282 {HPHW_NPROC,0x894,0x4,0x91,"Mt. Hamilton Fast Mako+"}, 287 {HPHW_NPROC,0x894,0x4,0x91,"Mt. Hamilton Fast Mako+"},
283 {HPHW_NPROC,0x895,0x4,0x91,"Storm Peak Slow Mako+"}, 288 {HPHW_NPROC,0x895,0x4,0x91,"Storm Peak Slow Mako+"},
284 {HPHW_NPROC,0x896,0x4,0x91,"Storm Peak Fast Mako+"}, 289 {HPHW_NPROC,0x896,0x4,0x91,"Storm Peak Fast Mako+"},
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index d2d58258aea6..d4dc588c0dc1 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -41,9 +41,7 @@ END(boot_args)
41 .import fault_vector_11,code /* IVA parisc 1.1 32 bit */ 41 .import fault_vector_11,code /* IVA parisc 1.1 32 bit */
42 .import $global$ /* forward declaration */ 42 .import $global$ /* forward declaration */
43#endif /*!CONFIG_64BIT*/ 43#endif /*!CONFIG_64BIT*/
44 .export _stext,data /* Kernel want it this way! */ 44ENTRY(parisc_kernel_start)
45_stext:
46ENTRY(stext)
47 .proc 45 .proc
48 .callinfo 46 .callinfo
49 47
@@ -347,7 +345,7 @@ smp_slave_stext:
347 .procend 345 .procend
348#endif /* CONFIG_SMP */ 346#endif /* CONFIG_SMP */
349 347
350ENDPROC(stext) 348ENDPROC(parisc_kernel_start)
351 349
352#ifndef CONFIG_64BIT 350#ifndef CONFIG_64BIT
353 .section .data..read_mostly 351 .section .data..read_mostly
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 5dfd248e3f1a..0d3a9d4927b5 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -61,8 +61,15 @@ static int get_offset(struct address_space *mapping)
61 return (unsigned long) mapping >> 8; 61 return (unsigned long) mapping >> 8;
62} 62}
63 63
64static unsigned long get_shared_area(struct address_space *mapping, 64static unsigned long shared_align_offset(struct file *filp, unsigned long pgoff)
65 unsigned long addr, unsigned long len, unsigned long pgoff) 65{
66 struct address_space *mapping = filp ? filp->f_mapping : NULL;
67
68 return (get_offset(mapping) + pgoff) << PAGE_SHIFT;
69}
70
71static unsigned long get_shared_area(struct file *filp, unsigned long addr,
72 unsigned long len, unsigned long pgoff)
66{ 73{
67 struct vm_unmapped_area_info info; 74 struct vm_unmapped_area_info info;
68 75
@@ -71,7 +78,7 @@ static unsigned long get_shared_area(struct address_space *mapping,
71 info.low_limit = PAGE_ALIGN(addr); 78 info.low_limit = PAGE_ALIGN(addr);
72 info.high_limit = TASK_SIZE; 79 info.high_limit = TASK_SIZE;
73 info.align_mask = PAGE_MASK & (SHMLBA - 1); 80 info.align_mask = PAGE_MASK & (SHMLBA - 1);
74 info.align_offset = (get_offset(mapping) + pgoff) << PAGE_SHIFT; 81 info.align_offset = shared_align_offset(filp, pgoff);
75 return vm_unmapped_area(&info); 82 return vm_unmapped_area(&info);
76} 83}
77 84
@@ -82,20 +89,18 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
82 return -ENOMEM; 89 return -ENOMEM;
83 if (flags & MAP_FIXED) { 90 if (flags & MAP_FIXED) {
84 if ((flags & MAP_SHARED) && 91 if ((flags & MAP_SHARED) &&
85 (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)) 92 (addr - shared_align_offset(filp, pgoff)) & (SHMLBA - 1))
86 return -EINVAL; 93 return -EINVAL;
87 return addr; 94 return addr;
88 } 95 }
89 if (!addr) 96 if (!addr)
90 addr = TASK_UNMAPPED_BASE; 97 addr = TASK_UNMAPPED_BASE;
91 98
92 if (filp) { 99 if (filp || (flags & MAP_SHARED))
93 addr = get_shared_area(filp->f_mapping, addr, len, pgoff); 100 addr = get_shared_area(filp, addr, len, pgoff);
94 } else if(flags & MAP_SHARED) { 101 else
95 addr = get_shared_area(NULL, addr, len, pgoff);
96 } else {
97 addr = get_unshared_area(addr, len); 102 addr = get_unshared_area(addr, len);
98 } 103
99 return addr; 104 return addr;
100} 105}
101 106
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index 76ed62ed785b..ddd988b267a9 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -168,7 +168,7 @@ void unwind_table_remove(struct unwind_table *table)
168} 168}
169 169
170/* Called from setup_arch to import the kernel unwind info */ 170/* Called from setup_arch to import the kernel unwind info */
171int unwind_init(void) 171int __init unwind_init(void)
172{ 172{
173 long start, stop; 173 long start, stop;
174 register unsigned long gp __asm__ ("r27"); 174 register unsigned long gp __asm__ ("r27");
@@ -233,7 +233,6 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
233 e = find_unwind_entry(info->ip); 233 e = find_unwind_entry(info->ip);
234 if (e == NULL) { 234 if (e == NULL) {
235 unsigned long sp; 235 unsigned long sp;
236 extern char _stext[], _etext[];
237 236
238 dbg("Cannot find unwind entry for 0x%lx; forced unwinding\n", info->ip); 237 dbg("Cannot find unwind entry for 0x%lx; forced unwinding\n", info->ip);
239 238
@@ -281,8 +280,7 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
281 break; 280 break;
282 info->prev_ip = tmp; 281 info->prev_ip = tmp;
283 sp = info->prev_sp; 282 sp = info->prev_sp;
284 } while (info->prev_ip < (unsigned long)_stext || 283 } while (!kernel_text_address(info->prev_ip));
285 info->prev_ip > (unsigned long)_etext);
286 284
287 info->rp = 0; 285 info->rp = 0;
288 286
@@ -435,9 +433,8 @@ unsigned long return_address(unsigned int level)
435 do { 433 do {
436 if (unwind_once(&info) < 0 || info.ip == 0) 434 if (unwind_once(&info) < 0 || info.ip == 0)
437 return 0; 435 return 0;
438 if (!__kernel_text_address(info.ip)) { 436 if (!kernel_text_address(info.ip))
439 return 0; 437 return 0;
440 }
441 } while (info.ip && level--); 438 } while (info.ip && level--);
442 439
443 return info.ip; 440 return info.ip;
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 4bb095a2f6fc..0dacc5ca555a 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -6,24 +6,19 @@
6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org> 6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org> 8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
9 * Copyright (C) 2006 Helge Deller <deller@gmx.de> 9 * Copyright (C) 2006-2013 Helge Deller <deller@gmx.de>
10 * 10 */
11 * 11
12 * This program is free software; you can redistribute it and/or modify 12/*
13 * it under the terms of the GNU General Public License as published by 13 * Put page table entries (swapper_pg_dir) as the first thing in .bss. This
14 * the Free Software Foundation; either version 2 of the License, or 14 * will ensure that it has .bss alignment (PAGE_SIZE).
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */ 15 */
16#define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \
17 *(.data..vm0.pgd) \
18 *(.data..vm0.pte)
19
26#include <asm-generic/vmlinux.lds.h> 20#include <asm-generic/vmlinux.lds.h>
21
27/* needed for the processor specific cache alignment size */ 22/* needed for the processor specific cache alignment size */
28#include <asm/cache.h> 23#include <asm/cache.h>
29#include <asm/page.h> 24#include <asm/page.h>
@@ -39,7 +34,7 @@ OUTPUT_FORMAT("elf64-hppa-linux")
39OUTPUT_ARCH(hppa:hppa2.0w) 34OUTPUT_ARCH(hppa:hppa2.0w)
40#endif 35#endif
41 36
42ENTRY(_stext) 37ENTRY(parisc_kernel_start)
43#ifndef CONFIG_64BIT 38#ifndef CONFIG_64BIT
44jiffies = jiffies_64 + 4; 39jiffies = jiffies_64 + 4;
45#else 40#else
@@ -49,11 +44,29 @@ SECTIONS
49{ 44{
50 . = KERNEL_BINARY_TEXT_START; 45 . = KERNEL_BINARY_TEXT_START;
51 46
47 __init_begin = .;
48 HEAD_TEXT_SECTION
49 INIT_TEXT_SECTION(8)
50
51 . = ALIGN(PAGE_SIZE);
52 INIT_DATA_SECTION(PAGE_SIZE)
53 /* we have to discard exit text and such at runtime, not link time */
54 .exit.text :
55 {
56 EXIT_TEXT
57 }
58 .exit.data :
59 {
60 EXIT_DATA
61 }
62 PERCPU_SECTION(8)
63 . = ALIGN(PAGE_SIZE);
64 __init_end = .;
65 /* freed after init ends here */
66
52 _text = .; /* Text and read-only data */ 67 _text = .; /* Text and read-only data */
53 .head ALIGN(16) : { 68 _stext = .;
54 HEAD_TEXT 69 .text ALIGN(PAGE_SIZE) : {
55 } = 0
56 .text ALIGN(16) : {
57 TEXT_TEXT 70 TEXT_TEXT
58 SCHED_TEXT 71 SCHED_TEXT
59 LOCK_TEXT 72 LOCK_TEXT
@@ -68,21 +81,28 @@ SECTIONS
68 *(.lock.text) /* out-of-line lock text */ 81 *(.lock.text) /* out-of-line lock text */
69 *(.gnu.warning) 82 *(.gnu.warning)
70 } 83 }
71 /* End of text section */ 84 . = ALIGN(PAGE_SIZE);
72 _etext = .; 85 _etext = .;
86 /* End of text section */
73 87
74 /* Start of data section */ 88 /* Start of data section */
75 _sdata = .; 89 _sdata = .;
76 90
77 RODATA 91 RO_DATA_SECTION(8)
78 92
79 /* writeable */ 93#ifdef CONFIG_64BIT
80 /* Make sure this is page aligned so 94 . = ALIGN(16);
81 * that we can properly leave these 95 /* Linkage tables */
82 * as writable 96 .opd : {
83 */ 97 *(.opd)
84 . = ALIGN(PAGE_SIZE); 98 } PROVIDE (__gp = .);
85 data_start = .; 99 .plt : {
100 *(.plt)
101 }
102 .dlt : {
103 *(.dlt)
104 }
105#endif
86 106
87 /* unwind info */ 107 /* unwind info */
88 .PARISC.unwind : { 108 .PARISC.unwind : {
@@ -91,7 +111,15 @@ SECTIONS
91 __stop___unwind = .; 111 __stop___unwind = .;
92 } 112 }
93 113
94 EXCEPTION_TABLE(16) 114 /* writeable */
115 /* Make sure this is page aligned so
116 * that we can properly leave these
117 * as writable
118 */
119 . = ALIGN(PAGE_SIZE);
120 data_start = .;
121
122 EXCEPTION_TABLE(8)
95 NOTES 123 NOTES
96 124
97 /* Data */ 125 /* Data */
@@ -107,54 +135,8 @@ SECTIONS
107 _edata = .; 135 _edata = .;
108 136
109 /* BSS */ 137 /* BSS */
110 __bss_start = .; 138 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 8)
111 /* page table entries need to be PAGE_SIZE aligned */
112 . = ALIGN(PAGE_SIZE);
113 .data..vmpages : {
114 *(.data..vm0.pmd)
115 *(.data..vm0.pgd)
116 *(.data..vm0.pte)
117 }
118 .bss : {
119 *(.bss)
120 *(COMMON)
121 }
122 __bss_stop = .;
123
124#ifdef CONFIG_64BIT
125 . = ALIGN(16);
126 /* Linkage tables */
127 .opd : {
128 *(.opd)
129 } PROVIDE (__gp = .);
130 .plt : {
131 *(.plt)
132 }
133 .dlt : {
134 *(.dlt)
135 }
136#endif
137 139
138 /* reserve space for interrupt stack by aligning __init* to 16k */
139 . = ALIGN(16384);
140 __init_begin = .;
141 INIT_TEXT_SECTION(16384)
142 . = ALIGN(PAGE_SIZE);
143 INIT_DATA_SECTION(16)
144 /* we have to discard exit text and such at runtime, not link time */
145 .exit.text :
146 {
147 EXIT_TEXT
148 }
149 .exit.data :
150 {
151 EXIT_DATA
152 }
153
154 PERCPU_SECTION(L1_CACHE_BYTES)
155 . = ALIGN(PAGE_SIZE);
156 __init_end = .;
157 /* freed after init ends here */
158 _end = . ; 140 _end = . ;
159 141
160 STABS_DEBUG 142 STABS_DEBUG
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c
index b5507ec06b84..413dc1769299 100644
--- a/arch/parisc/lib/memcpy.c
+++ b/arch/parisc/lib/memcpy.c
@@ -161,7 +161,7 @@ static inline void prefetch_dst(const void *addr)
161/* Copy from a not-aligned src to an aligned dst, using shifts. Handles 4 words 161/* Copy from a not-aligned src to an aligned dst, using shifts. Handles 4 words
162 * per loop. This code is derived from glibc. 162 * per loop. This code is derived from glibc.
163 */ 163 */
164static inline unsigned long copy_dstaligned(unsigned long dst, 164static noinline unsigned long copy_dstaligned(unsigned long dst,
165 unsigned long src, unsigned long len) 165 unsigned long src, unsigned long len)
166{ 166{
167 /* gcc complains that a2 and a3 may be uninitialized, but actually 167 /* gcc complains that a2 and a3 may be uninitialized, but actually
@@ -276,7 +276,7 @@ handle_store_error:
276/* Returns PA_MEMCPY_OK, PA_MEMCPY_LOAD_ERROR or PA_MEMCPY_STORE_ERROR. 276/* Returns PA_MEMCPY_OK, PA_MEMCPY_LOAD_ERROR or PA_MEMCPY_STORE_ERROR.
277 * In case of an access fault the faulty address can be read from the per_cpu 277 * In case of an access fault the faulty address can be read from the per_cpu
278 * exception data struct. */ 278 * exception data struct. */
279static unsigned long pa_memcpy_internal(void *dstp, const void *srcp, 279static noinline unsigned long pa_memcpy_internal(void *dstp, const void *srcp,
280 unsigned long len) 280 unsigned long len)
281{ 281{
282 register unsigned long src, dst, t1, t2, t3; 282 register unsigned long src, dst, t1, t2, t3;
@@ -529,7 +529,7 @@ long probe_kernel_read(void *dst, const void *src, size_t size)
529{ 529{
530 unsigned long addr = (unsigned long)src; 530 unsigned long addr = (unsigned long)src;
531 531
532 if (size < 0 || addr < PAGE_SIZE) 532 if (addr < PAGE_SIZE)
533 return -EFAULT; 533 return -EFAULT;
534 534
535 /* check for I/O space F_EXTEND(0xfff00000) access as well? */ 535 /* check for I/O space F_EXTEND(0xfff00000) access as well? */
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index 7584a5df0fa4..9d08c71a967e 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -282,16 +282,34 @@ bad_area:
282#endif 282#endif
283 switch (code) { 283 switch (code) {
284 case 15: /* Data TLB miss fault/Data page fault */ 284 case 15: /* Data TLB miss fault/Data page fault */
285 /* send SIGSEGV when outside of vma */
286 if (!vma ||
287 address < vma->vm_start || address > vma->vm_end) {
288 si.si_signo = SIGSEGV;
289 si.si_code = SEGV_MAPERR;
290 break;
291 }
292
293 /* send SIGSEGV for wrong permissions */
294 if ((vma->vm_flags & acc_type) != acc_type) {
295 si.si_signo = SIGSEGV;
296 si.si_code = SEGV_ACCERR;
297 break;
298 }
299
300 /* probably address is outside of mapped file */
301 /* fall through */
285 case 17: /* NA data TLB miss / page fault */ 302 case 17: /* NA data TLB miss / page fault */
286 case 18: /* Unaligned access - PCXS only */ 303 case 18: /* Unaligned access - PCXS only */
287 si.si_signo = SIGBUS; 304 si.si_signo = SIGBUS;
288 si.si_code = BUS_ADRERR; 305 si.si_code = (code == 18) ? BUS_ADRALN : BUS_ADRERR;
289 break; 306 break;
290 case 16: /* Non-access instruction TLB miss fault */ 307 case 16: /* Non-access instruction TLB miss fault */
291 case 26: /* PCXL: Data memory access rights trap */ 308 case 26: /* PCXL: Data memory access rights trap */
292 default: 309 default:
293 si.si_signo = SIGSEGV; 310 si.si_signo = SIGSEGV;
294 si.si_code = SEGV_MAPERR; 311 si.si_code = (code == 26) ? SEGV_ACCERR : SEGV_MAPERR;
312 break;
295 } 313 }
296 si.si_errno = 0; 314 si.si_errno = 0;
297 si.si_addr = (void __user *) address; 315 si.si_addr = (void __user *) address;
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index b0f96c0e6316..96f8168cf4ec 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -32,6 +32,7 @@
32#include <asm/sections.h> 32#include <asm/sections.h>
33 33
34extern int data_start; 34extern int data_start;
35extern void parisc_kernel_start(void); /* Kernel entry point in head.S */
35 36
36#if PT_NLEVELS == 3 37#if PT_NLEVELS == 3
37/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout 38/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout
@@ -324,8 +325,9 @@ static void __init setup_bootmem(void)
324 reserve_bootmem_node(NODE_DATA(0), 0UL, 325 reserve_bootmem_node(NODE_DATA(0), 0UL,
325 (unsigned long)(PAGE0->mem_free + 326 (unsigned long)(PAGE0->mem_free +
326 PDC_CONSOLE_IO_IODC_SIZE), BOOTMEM_DEFAULT); 327 PDC_CONSOLE_IO_IODC_SIZE), BOOTMEM_DEFAULT);
327 reserve_bootmem_node(NODE_DATA(0), __pa((unsigned long)_text), 328 reserve_bootmem_node(NODE_DATA(0), __pa(KERNEL_BINARY_TEXT_START),
328 (unsigned long)(_end - _text), BOOTMEM_DEFAULT); 329 (unsigned long)(_end - KERNEL_BINARY_TEXT_START),
330 BOOTMEM_DEFAULT);
329 reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT), 331 reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT),
330 ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT), 332 ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT),
331 BOOTMEM_DEFAULT); 333 BOOTMEM_DEFAULT);
@@ -378,6 +380,17 @@ static void __init setup_bootmem(void)
378 request_resource(&sysram_resources[0], &pdcdata_resource); 380 request_resource(&sysram_resources[0], &pdcdata_resource);
379} 381}
380 382
383static int __init parisc_text_address(unsigned long vaddr)
384{
385 static unsigned long head_ptr __initdata;
386
387 if (!head_ptr)
388 head_ptr = PAGE_MASK & (unsigned long)
389 dereference_function_descriptor(&parisc_kernel_start);
390
391 return core_kernel_text(vaddr) || vaddr == head_ptr;
392}
393
381static void __init map_pages(unsigned long start_vaddr, 394static void __init map_pages(unsigned long start_vaddr,
382 unsigned long start_paddr, unsigned long size, 395 unsigned long start_paddr, unsigned long size,
383 pgprot_t pgprot, int force) 396 pgprot_t pgprot, int force)
@@ -466,7 +479,7 @@ static void __init map_pages(unsigned long start_vaddr,
466 */ 479 */
467 if (force) 480 if (force)
468 pte = __mk_pte(address, pgprot); 481 pte = __mk_pte(address, pgprot);
469 else if (core_kernel_text(vaddr) && 482 else if (parisc_text_address(vaddr) &&
470 address != fv_addr) 483 address != fv_addr)
471 pte = __mk_pte(address, PAGE_KERNEL_EXEC); 484 pte = __mk_pte(address, PAGE_KERNEL_EXEC);
472 else 485 else
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4740b0a15fa8..b44b52c0a8f0 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -85,6 +85,7 @@ config GENERIC_HWEIGHT
85config PPC 85config PPC
86 bool 86 bool
87 default y 87 default y
88 select ARCH_MIGHT_HAVE_PC_PARPORT
88 select BINFMT_ELF 89 select BINFMT_ELF
89 select OF 90 select OF
90 select OF_EARLY_FLATTREE 91 select OF_EARLY_FLATTREE
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 607acf54a425..0f4344e6fbca 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -75,8 +75,10 @@ LDEMULATION := lppc
75GNUTARGET := powerpcle 75GNUTARGET := powerpcle
76MULTIPLEWORD := -mno-multiple 76MULTIPLEWORD := -mno-multiple
77else 77else
78ifeq ($(call cc-option-yn,-mbig-endian),y)
78override CC += -mbig-endian 79override CC += -mbig-endian
79override AS += -mbig-endian 80override AS += -mbig-endian
81endif
80override LD += -EB 82override LD += -EB
81LDEMULATION := ppc 83LDEMULATION := ppc
82GNUTARGET := powerpc 84GNUTARGET := powerpc
@@ -111,6 +113,7 @@ endif
111endif 113endif
112 114
113CFLAGS-$(CONFIG_PPC64) := -mtraceback=no -mcall-aixdesc 115CFLAGS-$(CONFIG_PPC64) := -mtraceback=no -mcall-aixdesc
116CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1)
114CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,-mminimal-toc) 117CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,-mminimal-toc)
115CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) 118CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
116CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) 119CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD)
@@ -127,7 +130,12 @@ CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5)
127CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) 130CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6)
128CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) 131CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
129 132
133# Altivec option not allowed with e500mc64 in GCC.
134ifeq ($(CONFIG_ALTIVEC),y)
135E5500_CPU := -mcpu=powerpc64
136else
130E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64) 137E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64)
138endif
131CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU) 139CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU)
132CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU)) 140CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU))
133 141
diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index 4c617bf8cdb2..4f6e48277c46 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
@@ -223,13 +223,13 @@
223 reg = <0xe2000 0x1000>; 223 reg = <0xe2000 0x1000>;
224 }; 224 };
225 225
226/include/ "qoriq-dma-0.dtsi" 226/include/ "elo3-dma-0.dtsi"
227 dma@100300 { 227 dma@100300 {
228 fsl,iommu-parent = <&pamu0>; 228 fsl,iommu-parent = <&pamu0>;
229 fsl,liodn-reg = <&guts 0x580>; /* DMA1LIODNR */ 229 fsl,liodn-reg = <&guts 0x580>; /* DMA1LIODNR */
230 }; 230 };
231 231
232/include/ "qoriq-dma-1.dtsi" 232/include/ "elo3-dma-1.dtsi"
233 dma@101300 { 233 dma@101300 {
234 fsl,iommu-parent = <&pamu0>; 234 fsl,iommu-parent = <&pamu0>;
235 fsl,liodn-reg = <&guts 0x584>; /* DMA2LIODNR */ 235 fsl,liodn-reg = <&guts 0x584>; /* DMA2LIODNR */
diff --git a/arch/powerpc/boot/dts/fsl/elo3-dma-0.dtsi b/arch/powerpc/boot/dts/fsl/elo3-dma-0.dtsi
new file mode 100644
index 000000000000..3c210e0d5201
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/elo3-dma-0.dtsi
@@ -0,0 +1,82 @@
1/*
2 * QorIQ Elo3 DMA device tree stub [ controller @ offset 0x100000 ]
3 *
4 * Copyright 2013 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,elo3-dma";
39 reg = <0x100300 0x4>,
40 <0x100600 0x4>;
41 ranges = <0x0 0x100100 0x500>;
42 dma-channel@0 {
43 compatible = "fsl,eloplus-dma-channel";
44 reg = <0x0 0x80>;
45 interrupts = <28 2 0 0>;
46 };
47 dma-channel@80 {
48 compatible = "fsl,eloplus-dma-channel";
49 reg = <0x80 0x80>;
50 interrupts = <29 2 0 0>;
51 };
52 dma-channel@100 {
53 compatible = "fsl,eloplus-dma-channel";
54 reg = <0x100 0x80>;
55 interrupts = <30 2 0 0>;
56 };
57 dma-channel@180 {
58 compatible = "fsl,eloplus-dma-channel";
59 reg = <0x180 0x80>;
60 interrupts = <31 2 0 0>;
61 };
62 dma-channel@300 {
63 compatible = "fsl,eloplus-dma-channel";
64 reg = <0x300 0x80>;
65 interrupts = <76 2 0 0>;
66 };
67 dma-channel@380 {
68 compatible = "fsl,eloplus-dma-channel";
69 reg = <0x380 0x80>;
70 interrupts = <77 2 0 0>;
71 };
72 dma-channel@400 {
73 compatible = "fsl,eloplus-dma-channel";
74 reg = <0x400 0x80>;
75 interrupts = <78 2 0 0>;
76 };
77 dma-channel@480 {
78 compatible = "fsl,eloplus-dma-channel";
79 reg = <0x480 0x80>;
80 interrupts = <79 2 0 0>;
81 };
82};
diff --git a/arch/powerpc/boot/dts/fsl/elo3-dma-1.dtsi b/arch/powerpc/boot/dts/fsl/elo3-dma-1.dtsi
new file mode 100644
index 000000000000..cccf3bb38224
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/elo3-dma-1.dtsi
@@ -0,0 +1,82 @@
1/*
2 * QorIQ Elo3 DMA device tree stub [ controller @ offset 0x101000 ]
3 *
4 * Copyright 2013 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,elo3-dma";
39 reg = <0x101300 0x4>,
40 <0x101600 0x4>;
41 ranges = <0x0 0x101100 0x500>;
42 dma-channel@0 {
43 compatible = "fsl,eloplus-dma-channel";
44 reg = <0x0 0x80>;
45 interrupts = <32 2 0 0>;
46 };
47 dma-channel@80 {
48 compatible = "fsl,eloplus-dma-channel";
49 reg = <0x80 0x80>;
50 interrupts = <33 2 0 0>;
51 };
52 dma-channel@100 {
53 compatible = "fsl,eloplus-dma-channel";
54 reg = <0x100 0x80>;
55 interrupts = <34 2 0 0>;
56 };
57 dma-channel@180 {
58 compatible = "fsl,eloplus-dma-channel";
59 reg = <0x180 0x80>;
60 interrupts = <35 2 0 0>;
61 };
62 dma-channel@300 {
63 compatible = "fsl,eloplus-dma-channel";
64 reg = <0x300 0x80>;
65 interrupts = <80 2 0 0>;
66 };
67 dma-channel@380 {
68 compatible = "fsl,eloplus-dma-channel";
69 reg = <0x380 0x80>;
70 interrupts = <81 2 0 0>;
71 };
72 dma-channel@400 {
73 compatible = "fsl,eloplus-dma-channel";
74 reg = <0x400 0x80>;
75 interrupts = <82 2 0 0>;
76 };
77 dma-channel@480 {
78 compatible = "fsl,eloplus-dma-channel";
79 reg = <0x480 0x80>;
80 interrupts = <83 2 0 0>;
81 };
82};
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index 510afa362de1..4143a9733cd0 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -387,8 +387,8 @@
387 reg = <0xea000 0x4000>; 387 reg = <0xea000 0x4000>;
388 }; 388 };
389 389
390/include/ "qoriq-dma-0.dtsi" 390/include/ "elo3-dma-0.dtsi"
391/include/ "qoriq-dma-1.dtsi" 391/include/ "elo3-dma-1.dtsi"
392 392
393/include/ "qoriq-espi-0.dtsi" 393/include/ "qoriq-espi-0.dtsi"
394 spi@110000 { 394 spi@110000 {
diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi
index bd14c00e5146..2d7cb04ac962 100644
--- a/arch/powerpc/boot/dts/mpc5121.dtsi
+++ b/arch/powerpc/boot/dts/mpc5121.dtsi
@@ -77,7 +77,6 @@
77 compatible = "fsl,mpc5121-immr"; 77 compatible = "fsl,mpc5121-immr";
78 #address-cells = <1>; 78 #address-cells = <1>;
79 #size-cells = <1>; 79 #size-cells = <1>;
80 #interrupt-cells = <2>;
81 ranges = <0x0 0x80000000 0x400000>; 80 ranges = <0x0 0x80000000 0x400000>;
82 reg = <0x80000000 0x400000>; 81 reg = <0x80000000 0x400000>;
83 bus-frequency = <66000000>; /* 66 MHz ips bus */ 82 bus-frequency = <66000000>; /* 66 MHz ips bus */
diff --git a/arch/powerpc/boot/dts/xcalibur1501.dts b/arch/powerpc/boot/dts/xcalibur1501.dts
index cc00f4ddd9a7..c409cbafb126 100644
--- a/arch/powerpc/boot/dts/xcalibur1501.dts
+++ b/arch/powerpc/boot/dts/xcalibur1501.dts
@@ -637,14 +637,14 @@
637 tlu@2f000 { 637 tlu@2f000 {
638 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 638 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
639 reg = <0x2f000 0x1000>; 639 reg = <0x2f000 0x1000>;
640 interupts = <61 2 >; 640 interrupts = <61 2>;
641 interrupt-parent = <&mpic>; 641 interrupt-parent = <&mpic>;
642 }; 642 };
643 643
644 tlu@15000 { 644 tlu@15000 {
645 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 645 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
646 reg = <0x15000 0x1000>; 646 reg = <0x15000 0x1000>;
647 interupts = <75 2>; 647 interrupts = <75 2>;
648 interrupt-parent = <&mpic>; 648 interrupt-parent = <&mpic>;
649 }; 649 };
650 }; 650 };
diff --git a/arch/powerpc/boot/dts/xpedite5301.dts b/arch/powerpc/boot/dts/xpedite5301.dts
index 53c1c6a9752f..04cb410da48b 100644
--- a/arch/powerpc/boot/dts/xpedite5301.dts
+++ b/arch/powerpc/boot/dts/xpedite5301.dts
@@ -547,14 +547,14 @@
547 tlu@2f000 { 547 tlu@2f000 {
548 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 548 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
549 reg = <0x2f000 0x1000>; 549 reg = <0x2f000 0x1000>;
550 interupts = <61 2 >; 550 interrupts = <61 2>;
551 interrupt-parent = <&mpic>; 551 interrupt-parent = <&mpic>;
552 }; 552 };
553 553
554 tlu@15000 { 554 tlu@15000 {
555 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 555 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
556 reg = <0x15000 0x1000>; 556 reg = <0x15000 0x1000>;
557 interupts = <75 2>; 557 interrupts = <75 2>;
558 interrupt-parent = <&mpic>; 558 interrupt-parent = <&mpic>;
559 }; 559 };
560 }; 560 };
diff --git a/arch/powerpc/boot/dts/xpedite5330.dts b/arch/powerpc/boot/dts/xpedite5330.dts
index 215225983150..73f8620f1ce7 100644
--- a/arch/powerpc/boot/dts/xpedite5330.dts
+++ b/arch/powerpc/boot/dts/xpedite5330.dts
@@ -583,14 +583,14 @@
583 tlu@2f000 { 583 tlu@2f000 {
584 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 584 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
585 reg = <0x2f000 0x1000>; 585 reg = <0x2f000 0x1000>;
586 interupts = <61 2 >; 586 interrupts = <61 2>;
587 interrupt-parent = <&mpic>; 587 interrupt-parent = <&mpic>;
588 }; 588 };
589 589
590 tlu@15000 { 590 tlu@15000 {
591 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 591 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
592 reg = <0x15000 0x1000>; 592 reg = <0x15000 0x1000>;
593 interupts = <75 2>; 593 interrupts = <75 2>;
594 interrupt-parent = <&mpic>; 594 interrupt-parent = <&mpic>;
595 }; 595 };
596 }; 596 };
diff --git a/arch/powerpc/boot/dts/xpedite5370.dts b/arch/powerpc/boot/dts/xpedite5370.dts
index 11dbda10d756..cd0ea2b99362 100644
--- a/arch/powerpc/boot/dts/xpedite5370.dts
+++ b/arch/powerpc/boot/dts/xpedite5370.dts
@@ -545,14 +545,14 @@
545 tlu@2f000 { 545 tlu@2f000 {
546 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 546 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
547 reg = <0x2f000 0x1000>; 547 reg = <0x2f000 0x1000>;
548 interupts = <61 2 >; 548 interrupts = <61 2>;
549 interrupt-parent = <&mpic>; 549 interrupt-parent = <&mpic>;
550 }; 550 };
551 551
552 tlu@15000 { 552 tlu@15000 {
553 compatible = "fsl,mpc8572-tlu", "fsl_tlu"; 553 compatible = "fsl,mpc8572-tlu", "fsl_tlu";
554 reg = <0x15000 0x1000>; 554 reg = <0x15000 0x1000>;
555 interupts = <75 2>; 555 interrupts = <75 2>;
556 interrupt-parent = <&mpic>; 556 interrupt-parent = <&mpic>;
557 }; 557 };
558 }; 558 };
diff --git a/arch/powerpc/boot/util.S b/arch/powerpc/boot/util.S
index 5143228e3e5f..6636b1d7821b 100644
--- a/arch/powerpc/boot/util.S
+++ b/arch/powerpc/boot/util.S
@@ -71,18 +71,32 @@ udelay:
71 add r4,r4,r5 71 add r4,r4,r5
72 addi r4,r4,-1 72 addi r4,r4,-1
73 divw r4,r4,r5 /* BUS ticks */ 73 divw r4,r4,r5 /* BUS ticks */
74#ifdef CONFIG_8xx
751: mftbu r5
76 mftb r6
77 mftbu r7
78#else
741: mfspr r5, SPRN_TBRU 791: mfspr r5, SPRN_TBRU
75 mfspr r6, SPRN_TBRL 80 mfspr r6, SPRN_TBRL
76 mfspr r7, SPRN_TBRU 81 mfspr r7, SPRN_TBRU
82#endif
77 cmpw 0,r5,r7 83 cmpw 0,r5,r7
78 bne 1b /* Get [synced] base time */ 84 bne 1b /* Get [synced] base time */
79 addc r9,r6,r4 /* Compute end time */ 85 addc r9,r6,r4 /* Compute end time */
80 addze r8,r5 86 addze r8,r5
87#ifdef CONFIG_8xx
882: mftbu r5
89#else
812: mfspr r5, SPRN_TBRU 902: mfspr r5, SPRN_TBRU
91#endif
82 cmpw 0,r5,r8 92 cmpw 0,r5,r8
83 blt 2b 93 blt 2b
84 bgt 3f 94 bgt 3f
95#ifdef CONFIG_8xx
96 mftb r6
97#else
85 mfspr r6, SPRN_TBRL 98 mfspr r6, SPRN_TBRL
99#endif
86 cmpw 0,r6,r9 100 cmpw 0,r6,r9
87 blt 2b 101 blt 2b
883: blr 1023: blr
diff --git a/arch/powerpc/configs/52xx/cm5200_defconfig b/arch/powerpc/configs/52xx/cm5200_defconfig
index 69b57daf402e..0b88c7b30bb9 100644
--- a/arch/powerpc/configs/52xx/cm5200_defconfig
+++ b/arch/powerpc/configs/52xx/cm5200_defconfig
@@ -12,7 +12,6 @@ CONFIG_EXPERT=y
12CONFIG_PPC_MPC52xx=y 12CONFIG_PPC_MPC52xx=y
13CONFIG_PPC_MPC5200_SIMPLE=y 13CONFIG_PPC_MPC5200_SIMPLE=y
14# CONFIG_PPC_PMAC is not set 14# CONFIG_PPC_PMAC is not set
15CONFIG_PPC_BESTCOMM=y
16CONFIG_SPARSE_IRQ=y 15CONFIG_SPARSE_IRQ=y
17CONFIG_PM=y 16CONFIG_PM=y
18# CONFIG_PCI is not set 17# CONFIG_PCI is not set
@@ -71,6 +70,8 @@ CONFIG_USB_DEVICEFS=y
71CONFIG_USB_OHCI_HCD=y 70CONFIG_USB_OHCI_HCD=y
72CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 71CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
73CONFIG_USB_STORAGE=y 72CONFIG_USB_STORAGE=y
73CONFIG_DMADEVICES=y
74CONFIG_PPC_BESTCOMM=y
74CONFIG_EXT2_FS=y 75CONFIG_EXT2_FS=y
75CONFIG_EXT3_FS=y 76CONFIG_EXT3_FS=y
76# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 77# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/lite5200b_defconfig b/arch/powerpc/configs/52xx/lite5200b_defconfig
index f3638ae0a627..104a332e79ab 100644
--- a/arch/powerpc/configs/52xx/lite5200b_defconfig
+++ b/arch/powerpc/configs/52xx/lite5200b_defconfig
@@ -15,7 +15,6 @@ CONFIG_PPC_MPC52xx=y
15CONFIG_PPC_MPC5200_SIMPLE=y 15CONFIG_PPC_MPC5200_SIMPLE=y
16CONFIG_PPC_LITE5200=y 16CONFIG_PPC_LITE5200=y
17# CONFIG_PPC_PMAC is not set 17# CONFIG_PPC_PMAC is not set
18CONFIG_PPC_BESTCOMM=y
19CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
20CONFIG_HIGH_RES_TIMERS=y 19CONFIG_HIGH_RES_TIMERS=y
21CONFIG_SPARSE_IRQ=y 20CONFIG_SPARSE_IRQ=y
@@ -59,6 +58,8 @@ CONFIG_I2C_CHARDEV=y
59CONFIG_I2C_MPC=y 58CONFIG_I2C_MPC=y
60# CONFIG_HWMON is not set 59# CONFIG_HWMON is not set
61CONFIG_VIDEO_OUTPUT_CONTROL=m 60CONFIG_VIDEO_OUTPUT_CONTROL=m
61CONFIG_DMADEVICES=y
62CONFIG_PPC_BESTCOMM=y
62CONFIG_EXT2_FS=y 63CONFIG_EXT2_FS=y
63CONFIG_EXT3_FS=y 64CONFIG_EXT3_FS=y
64# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 65# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/motionpro_defconfig b/arch/powerpc/configs/52xx/motionpro_defconfig
index 0c7de9620ea6..0d13ad7e4478 100644
--- a/arch/powerpc/configs/52xx/motionpro_defconfig
+++ b/arch/powerpc/configs/52xx/motionpro_defconfig
@@ -12,7 +12,6 @@ CONFIG_EXPERT=y
12CONFIG_PPC_MPC52xx=y 12CONFIG_PPC_MPC52xx=y
13CONFIG_PPC_MPC5200_SIMPLE=y 13CONFIG_PPC_MPC5200_SIMPLE=y
14# CONFIG_PPC_PMAC is not set 14# CONFIG_PPC_PMAC is not set
15CONFIG_PPC_BESTCOMM=y
16CONFIG_SPARSE_IRQ=y 15CONFIG_SPARSE_IRQ=y
17CONFIG_PM=y 16CONFIG_PM=y
18# CONFIG_PCI is not set 17# CONFIG_PCI is not set
@@ -84,6 +83,8 @@ CONFIG_LEDS_TRIGGERS=y
84CONFIG_LEDS_TRIGGER_TIMER=y 83CONFIG_LEDS_TRIGGER_TIMER=y
85CONFIG_RTC_CLASS=y 84CONFIG_RTC_CLASS=y
86CONFIG_RTC_DRV_DS1307=y 85CONFIG_RTC_DRV_DS1307=y
86CONFIG_DMADEVICES=y
87CONFIG_PPC_BESTCOMM=y
87CONFIG_EXT2_FS=y 88CONFIG_EXT2_FS=y
88CONFIG_EXT3_FS=y 89CONFIG_EXT3_FS=y
89# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 90# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/pcm030_defconfig b/arch/powerpc/configs/52xx/pcm030_defconfig
index 22e719575c60..430aa182fa1c 100644
--- a/arch/powerpc/configs/52xx/pcm030_defconfig
+++ b/arch/powerpc/configs/52xx/pcm030_defconfig
@@ -21,7 +21,6 @@ CONFIG_MODULE_UNLOAD=y
21CONFIG_PPC_MPC52xx=y 21CONFIG_PPC_MPC52xx=y
22CONFIG_PPC_MPC5200_SIMPLE=y 22CONFIG_PPC_MPC5200_SIMPLE=y
23# CONFIG_PPC_PMAC is not set 23# CONFIG_PPC_PMAC is not set
24CONFIG_PPC_BESTCOMM=y
25CONFIG_NO_HZ=y 24CONFIG_NO_HZ=y
26CONFIG_HIGH_RES_TIMERS=y 25CONFIG_HIGH_RES_TIMERS=y
27CONFIG_HZ_100=y 26CONFIG_HZ_100=y
@@ -87,6 +86,8 @@ CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
87CONFIG_USB_STORAGE=m 86CONFIG_USB_STORAGE=m
88CONFIG_RTC_CLASS=y 87CONFIG_RTC_CLASS=y
89CONFIG_RTC_DRV_PCF8563=m 88CONFIG_RTC_DRV_PCF8563=m
89CONFIG_DMADEVICES=y
90CONFIG_PPC_BESTCOMM=y
90CONFIG_EXT2_FS=m 91CONFIG_EXT2_FS=m
91CONFIG_EXT3_FS=m 92CONFIG_EXT3_FS=m
92# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 93# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/tqm5200_defconfig b/arch/powerpc/configs/52xx/tqm5200_defconfig
index 716a37be16e3..7af4c5bb7c63 100644
--- a/arch/powerpc/configs/52xx/tqm5200_defconfig
+++ b/arch/powerpc/configs/52xx/tqm5200_defconfig
@@ -17,7 +17,6 @@ CONFIG_PPC_MPC52xx=y
17CONFIG_PPC_MPC5200_SIMPLE=y 17CONFIG_PPC_MPC5200_SIMPLE=y
18CONFIG_PPC_MPC5200_BUGFIX=y 18CONFIG_PPC_MPC5200_BUGFIX=y
19# CONFIG_PPC_PMAC is not set 19# CONFIG_PPC_PMAC is not set
20CONFIG_PPC_BESTCOMM=y
21CONFIG_PM=y 20CONFIG_PM=y
22# CONFIG_PCI is not set 21# CONFIG_PCI is not set
23CONFIG_NET=y 22CONFIG_NET=y
@@ -86,6 +85,8 @@ CONFIG_USB_STORAGE=y
86CONFIG_RTC_CLASS=y 85CONFIG_RTC_CLASS=y
87CONFIG_RTC_DRV_DS1307=y 86CONFIG_RTC_DRV_DS1307=y
88CONFIG_RTC_DRV_DS1374=y 87CONFIG_RTC_DRV_DS1374=y
88CONFIG_DMADEVICES=y
89CONFIG_PPC_BESTCOMM=y
89CONFIG_EXT2_FS=y 90CONFIG_EXT2_FS=y
90CONFIG_EXT3_FS=y 91CONFIG_EXT3_FS=y
91# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 92# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/mpc5200_defconfig b/arch/powerpc/configs/mpc5200_defconfig
index 6640a35bebb7..8b682d1cf4d6 100644
--- a/arch/powerpc/configs/mpc5200_defconfig
+++ b/arch/powerpc/configs/mpc5200_defconfig
@@ -15,7 +15,6 @@ CONFIG_PPC_MEDIA5200=y
15CONFIG_PPC_MPC5200_BUGFIX=y 15CONFIG_PPC_MPC5200_BUGFIX=y
16CONFIG_PPC_MPC5200_LPBFIFO=m 16CONFIG_PPC_MPC5200_LPBFIFO=m
17# CONFIG_PPC_PMAC is not set 17# CONFIG_PPC_PMAC is not set
18CONFIG_PPC_BESTCOMM=y
19CONFIG_SIMPLE_GPIO=y 18CONFIG_SIMPLE_GPIO=y
20CONFIG_NO_HZ=y 19CONFIG_NO_HZ=y
21CONFIG_HIGH_RES_TIMERS=y 20CONFIG_HIGH_RES_TIMERS=y
@@ -125,6 +124,8 @@ CONFIG_RTC_CLASS=y
125CONFIG_RTC_DRV_DS1307=y 124CONFIG_RTC_DRV_DS1307=y
126CONFIG_RTC_DRV_DS1374=y 125CONFIG_RTC_DRV_DS1374=y
127CONFIG_RTC_DRV_PCF8563=m 126CONFIG_RTC_DRV_PCF8563=m
127CONFIG_DMADEVICES=y
128CONFIG_PPC_BESTCOMM=y
128CONFIG_EXT2_FS=y 129CONFIG_EXT2_FS=y
129CONFIG_EXT3_FS=y 130CONFIG_EXT3_FS=y
130# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 131# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index bd8a6f71944f..cec044a3ff69 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -2,7 +2,6 @@ CONFIG_PPC64=y
2CONFIG_ALTIVEC=y 2CONFIG_ALTIVEC=y
3CONFIG_SMP=y 3CONFIG_SMP=y
4CONFIG_NR_CPUS=2 4CONFIG_NR_CPUS=2
5CONFIG_EXPERIMENTAL=y
6CONFIG_SYSVIPC=y 5CONFIG_SYSVIPC=y
7CONFIG_NO_HZ=y 6CONFIG_NO_HZ=y
8CONFIG_HIGH_RES_TIMERS=y 7CONFIG_HIGH_RES_TIMERS=y
@@ -45,8 +44,9 @@ CONFIG_INET_AH=y
45CONFIG_INET_ESP=y 44CONFIG_INET_ESP=y
46# CONFIG_IPV6 is not set 45# CONFIG_IPV6 is not set
47CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 46CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
47CONFIG_DEVTMPFS=y
48CONFIG_DEVTMPFS_MOUNT=y
48CONFIG_MTD=y 49CONFIG_MTD=y
49CONFIG_MTD_CHAR=y
50CONFIG_MTD_BLOCK=y 50CONFIG_MTD_BLOCK=y
51CONFIG_MTD_SLRAM=y 51CONFIG_MTD_SLRAM=y
52CONFIG_MTD_PHRAM=y 52CONFIG_MTD_PHRAM=y
@@ -88,7 +88,6 @@ CONFIG_BLK_DEV_DM=y
88CONFIG_DM_CRYPT=y 88CONFIG_DM_CRYPT=y
89CONFIG_NETDEVICES=y 89CONFIG_NETDEVICES=y
90CONFIG_DUMMY=y 90CONFIG_DUMMY=y
91CONFIG_MII=y
92CONFIG_TIGON3=y 91CONFIG_TIGON3=y
93CONFIG_E1000=y 92CONFIG_E1000=y
94CONFIG_PASEMI_MAC=y 93CONFIG_PASEMI_MAC=y
@@ -174,8 +173,8 @@ CONFIG_NLS_CODEPAGE_437=y
174CONFIG_NLS_ISO8859_1=y 173CONFIG_NLS_ISO8859_1=y
175CONFIG_CRC_CCITT=y 174CONFIG_CRC_CCITT=y
176CONFIG_PRINTK_TIME=y 175CONFIG_PRINTK_TIME=y
177CONFIG_MAGIC_SYSRQ=y
178CONFIG_DEBUG_FS=y 176CONFIG_DEBUG_FS=y
177CONFIG_MAGIC_SYSRQ=y
179CONFIG_DEBUG_KERNEL=y 178CONFIG_DEBUG_KERNEL=y
180CONFIG_DETECT_HUNG_TASK=y 179CONFIG_DETECT_HUNG_TASK=y
181# CONFIG_SCHED_DEBUG is not set 180# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig
new file mode 100644
index 000000000000..62771e0adb7c
--- /dev/null
+++ b/arch/powerpc/configs/pseries_le_defconfig
@@ -0,0 +1,352 @@
1CONFIG_PPC64=y
2CONFIG_ALTIVEC=y
3CONFIG_VSX=y
4CONFIG_SMP=y
5CONFIG_NR_CPUS=2048
6CONFIG_CPU_LITTLE_ENDIAN=y
7CONFIG_SYSVIPC=y
8CONFIG_POSIX_MQUEUE=y
9CONFIG_AUDIT=y
10CONFIG_AUDITSYSCALL=y
11CONFIG_IRQ_DOMAIN_DEBUG=y
12CONFIG_NO_HZ=y
13CONFIG_HIGH_RES_TIMERS=y
14CONFIG_TASKSTATS=y
15CONFIG_TASK_DELAY_ACCT=y
16CONFIG_TASK_XACCT=y
17CONFIG_TASK_IO_ACCOUNTING=y
18CONFIG_IKCONFIG=y
19CONFIG_IKCONFIG_PROC=y
20CONFIG_CGROUPS=y
21CONFIG_CGROUP_FREEZER=y
22CONFIG_CGROUP_DEVICE=y
23CONFIG_CPUSETS=y
24CONFIG_CGROUP_CPUACCT=y
25CONFIG_BLK_DEV_INITRD=y
26# CONFIG_COMPAT_BRK is not set
27CONFIG_PROFILING=y
28CONFIG_OPROFILE=y
29CONFIG_KPROBES=y
30CONFIG_JUMP_LABEL=y
31CONFIG_MODULES=y
32CONFIG_MODULE_UNLOAD=y
33CONFIG_MODVERSIONS=y
34CONFIG_MODULE_SRCVERSION_ALL=y
35CONFIG_PARTITION_ADVANCED=y
36CONFIG_PPC_SPLPAR=y
37CONFIG_SCANLOG=m
38CONFIG_PPC_SMLPAR=y
39CONFIG_DTL=y
40# CONFIG_PPC_PMAC is not set
41CONFIG_RTAS_FLASH=m
42CONFIG_IBMEBUS=y
43CONFIG_HZ_100=y
44CONFIG_BINFMT_MISC=m
45CONFIG_PPC_TRANSACTIONAL_MEM=y
46CONFIG_KEXEC=y
47CONFIG_IRQ_ALL_CPUS=y
48CONFIG_MEMORY_HOTPLUG=y
49CONFIG_MEMORY_HOTREMOVE=y
50CONFIG_CMA=y
51CONFIG_PPC_64K_PAGES=y
52CONFIG_PPC_SUBPAGE_PROT=y
53CONFIG_SCHED_SMT=y
54CONFIG_HOTPLUG_PCI=y
55CONFIG_HOTPLUG_PCI_RPA=m
56CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
57CONFIG_PACKET=y
58CONFIG_UNIX=y
59CONFIG_XFRM_USER=m
60CONFIG_NET_KEY=m
61CONFIG_INET=y
62CONFIG_IP_MULTICAST=y
63CONFIG_NET_IPIP=y
64CONFIG_SYN_COOKIES=y
65CONFIG_INET_AH=m
66CONFIG_INET_ESP=m
67CONFIG_INET_IPCOMP=m
68# CONFIG_IPV6 is not set
69CONFIG_NETFILTER=y
70CONFIG_NF_CONNTRACK=m
71CONFIG_NF_CONNTRACK_EVENTS=y
72CONFIG_NF_CT_PROTO_UDPLITE=m
73CONFIG_NF_CONNTRACK_FTP=m
74CONFIG_NF_CONNTRACK_IRC=m
75CONFIG_NF_CONNTRACK_TFTP=m
76CONFIG_NF_CT_NETLINK=m
77CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
78CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
79CONFIG_NETFILTER_XT_TARGET_MARK=m
80CONFIG_NETFILTER_XT_TARGET_NFLOG=m
81CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
82CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
83CONFIG_NETFILTER_XT_MATCH_COMMENT=m
84CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
85CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
86CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
87CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
88CONFIG_NETFILTER_XT_MATCH_DCCP=m
89CONFIG_NETFILTER_XT_MATCH_DSCP=m
90CONFIG_NETFILTER_XT_MATCH_ESP=m
91CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
92CONFIG_NETFILTER_XT_MATCH_HELPER=m
93CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
94CONFIG_NETFILTER_XT_MATCH_LENGTH=m
95CONFIG_NETFILTER_XT_MATCH_LIMIT=m
96CONFIG_NETFILTER_XT_MATCH_MAC=m
97CONFIG_NETFILTER_XT_MATCH_MARK=m
98CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
99CONFIG_NETFILTER_XT_MATCH_OWNER=m
100CONFIG_NETFILTER_XT_MATCH_POLICY=m
101CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
102CONFIG_NETFILTER_XT_MATCH_QUOTA=m
103CONFIG_NETFILTER_XT_MATCH_RATEEST=m
104CONFIG_NETFILTER_XT_MATCH_REALM=m
105CONFIG_NETFILTER_XT_MATCH_RECENT=m
106CONFIG_NETFILTER_XT_MATCH_SCTP=m
107CONFIG_NETFILTER_XT_MATCH_STATE=m
108CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
109CONFIG_NETFILTER_XT_MATCH_STRING=m
110CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
111CONFIG_NETFILTER_XT_MATCH_TIME=m
112CONFIG_NETFILTER_XT_MATCH_U32=m
113CONFIG_NF_CONNTRACK_IPV4=m
114CONFIG_IP_NF_IPTABLES=m
115CONFIG_IP_NF_MATCH_AH=m
116CONFIG_IP_NF_MATCH_ECN=m
117CONFIG_IP_NF_MATCH_TTL=m
118CONFIG_IP_NF_FILTER=m
119CONFIG_IP_NF_TARGET_REJECT=m
120CONFIG_IP_NF_TARGET_ULOG=m
121CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
122CONFIG_DEVTMPFS=y
123CONFIG_DEVTMPFS_MOUNT=y
124CONFIG_PROC_DEVICETREE=y
125CONFIG_PARPORT=m
126CONFIG_PARPORT_PC=m
127CONFIG_BLK_DEV_FD=m
128CONFIG_BLK_DEV_LOOP=y
129CONFIG_BLK_DEV_NBD=m
130CONFIG_BLK_DEV_RAM=y
131CONFIG_BLK_DEV_RAM_SIZE=65536
132CONFIG_VIRTIO_BLK=m
133CONFIG_IDE=y
134CONFIG_BLK_DEV_IDECD=y
135CONFIG_BLK_DEV_GENERIC=y
136CONFIG_BLK_DEV_AMD74XX=y
137CONFIG_BLK_DEV_SD=y
138CONFIG_CHR_DEV_ST=y
139CONFIG_BLK_DEV_SR=y
140CONFIG_BLK_DEV_SR_VENDOR=y
141CONFIG_CHR_DEV_SG=y
142CONFIG_SCSI_MULTI_LUN=y
143CONFIG_SCSI_CONSTANTS=y
144CONFIG_SCSI_FC_ATTRS=y
145CONFIG_SCSI_CXGB3_ISCSI=m
146CONFIG_SCSI_CXGB4_ISCSI=m
147CONFIG_SCSI_BNX2_ISCSI=m
148CONFIG_BE2ISCSI=m
149CONFIG_SCSI_MPT2SAS=m
150CONFIG_SCSI_IBMVSCSI=y
151CONFIG_SCSI_IBMVFC=m
152CONFIG_SCSI_SYM53C8XX_2=y
153CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
154CONFIG_SCSI_IPR=y
155CONFIG_SCSI_QLA_FC=m
156CONFIG_SCSI_QLA_ISCSI=m
157CONFIG_SCSI_LPFC=m
158CONFIG_SCSI_VIRTIO=m
159CONFIG_SCSI_DH=m
160CONFIG_SCSI_DH_RDAC=m
161CONFIG_SCSI_DH_ALUA=m
162CONFIG_ATA=y
163# CONFIG_ATA_SFF is not set
164CONFIG_MD=y
165CONFIG_BLK_DEV_MD=y
166CONFIG_MD_LINEAR=y
167CONFIG_MD_RAID0=y
168CONFIG_MD_RAID1=y
169CONFIG_MD_RAID10=m
170CONFIG_MD_RAID456=m
171CONFIG_MD_MULTIPATH=m
172CONFIG_MD_FAULTY=m
173CONFIG_BLK_DEV_DM=y
174CONFIG_DM_CRYPT=m
175CONFIG_DM_SNAPSHOT=m
176CONFIG_DM_MIRROR=m
177CONFIG_DM_ZERO=m
178CONFIG_DM_MULTIPATH=m
179CONFIG_DM_MULTIPATH_QL=m
180CONFIG_DM_MULTIPATH_ST=m
181CONFIG_DM_UEVENT=y
182CONFIG_BONDING=m
183CONFIG_DUMMY=m
184CONFIG_NETCONSOLE=y
185CONFIG_NETPOLL_TRAP=y
186CONFIG_TUN=m
187CONFIG_VIRTIO_NET=m
188CONFIG_VORTEX=y
189CONFIG_ACENIC=m
190CONFIG_ACENIC_OMIT_TIGON_I=y
191CONFIG_PCNET32=y
192CONFIG_TIGON3=y
193CONFIG_CHELSIO_T1=m
194CONFIG_BE2NET=m
195CONFIG_S2IO=m
196CONFIG_IBMVETH=y
197CONFIG_EHEA=y
198CONFIG_E100=y
199CONFIG_E1000=y
200CONFIG_E1000E=y
201CONFIG_IXGB=m
202CONFIG_IXGBE=m
203CONFIG_MLX4_EN=m
204CONFIG_MYRI10GE=m
205CONFIG_QLGE=m
206CONFIG_NETXEN_NIC=m
207CONFIG_PPP=m
208CONFIG_PPP_BSDCOMP=m
209CONFIG_PPP_DEFLATE=m
210CONFIG_PPPOE=m
211CONFIG_PPP_ASYNC=m
212CONFIG_PPP_SYNC_TTY=m
213# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
214CONFIG_INPUT_EVDEV=m
215CONFIG_INPUT_MISC=y
216CONFIG_INPUT_PCSPKR=m
217# CONFIG_SERIO_SERPORT is not set
218CONFIG_SERIAL_8250=y
219CONFIG_SERIAL_8250_CONSOLE=y
220CONFIG_SERIAL_ICOM=m
221CONFIG_SERIAL_JSM=m
222CONFIG_HVC_CONSOLE=y
223CONFIG_HVC_RTAS=y
224CONFIG_HVCS=m
225CONFIG_VIRTIO_CONSOLE=m
226CONFIG_IBM_BSR=m
227CONFIG_GEN_RTC=y
228CONFIG_RAW_DRIVER=y
229CONFIG_MAX_RAW_DEVS=1024
230CONFIG_FB=y
231CONFIG_FIRMWARE_EDID=y
232CONFIG_FB_OF=y
233CONFIG_FB_MATROX=y
234CONFIG_FB_MATROX_MILLENIUM=y
235CONFIG_FB_MATROX_MYSTIQUE=y
236CONFIG_FB_MATROX_G=y
237CONFIG_FB_RADEON=y
238CONFIG_FB_IBM_GXT4500=y
239CONFIG_LCD_PLATFORM=m
240# CONFIG_VGA_CONSOLE is not set
241CONFIG_FRAMEBUFFER_CONSOLE=y
242CONFIG_LOGO=y
243CONFIG_HID_GYRATION=y
244CONFIG_HID_PANTHERLORD=y
245CONFIG_HID_PETALYNX=y
246CONFIG_HID_SAMSUNG=y
247CONFIG_HID_SUNPLUS=y
248CONFIG_USB_HIDDEV=y
249CONFIG_USB=y
250CONFIG_USB_MON=m
251CONFIG_USB_EHCI_HCD=y
252# CONFIG_USB_EHCI_HCD_PPC_OF is not set
253CONFIG_USB_OHCI_HCD=y
254CONFIG_USB_STORAGE=m
255CONFIG_INFINIBAND=m
256CONFIG_INFINIBAND_USER_MAD=m
257CONFIG_INFINIBAND_USER_ACCESS=m
258CONFIG_INFINIBAND_MTHCA=m
259CONFIG_INFINIBAND_EHCA=m
260CONFIG_INFINIBAND_CXGB3=m
261CONFIG_INFINIBAND_CXGB4=m
262CONFIG_MLX4_INFINIBAND=m
263CONFIG_INFINIBAND_IPOIB=m
264CONFIG_INFINIBAND_IPOIB_CM=y
265CONFIG_INFINIBAND_SRP=m
266CONFIG_INFINIBAND_ISER=m
267CONFIG_VIRTIO_PCI=m
268CONFIG_VIRTIO_BALLOON=m
269CONFIG_EXT2_FS=y
270CONFIG_EXT2_FS_XATTR=y
271CONFIG_EXT2_FS_POSIX_ACL=y
272CONFIG_EXT2_FS_SECURITY=y
273CONFIG_EXT2_FS_XIP=y
274CONFIG_EXT3_FS=y
275CONFIG_EXT3_FS_POSIX_ACL=y
276CONFIG_EXT3_FS_SECURITY=y
277CONFIG_EXT4_FS=y
278CONFIG_EXT4_FS_POSIX_ACL=y
279CONFIG_EXT4_FS_SECURITY=y
280CONFIG_REISERFS_FS=y
281CONFIG_REISERFS_FS_XATTR=y
282CONFIG_REISERFS_FS_POSIX_ACL=y
283CONFIG_REISERFS_FS_SECURITY=y
284CONFIG_JFS_FS=m
285CONFIG_JFS_POSIX_ACL=y
286CONFIG_JFS_SECURITY=y
287CONFIG_XFS_FS=m
288CONFIG_XFS_POSIX_ACL=y
289CONFIG_BTRFS_FS=m
290CONFIG_BTRFS_FS_POSIX_ACL=y
291CONFIG_NILFS2_FS=m
292CONFIG_AUTOFS4_FS=m
293CONFIG_FUSE_FS=m
294CONFIG_ISO9660_FS=y
295CONFIG_UDF_FS=m
296CONFIG_MSDOS_FS=y
297CONFIG_VFAT_FS=y
298CONFIG_PROC_KCORE=y
299CONFIG_TMPFS=y
300CONFIG_TMPFS_POSIX_ACL=y
301CONFIG_HUGETLBFS=y
302CONFIG_CRAMFS=m
303CONFIG_SQUASHFS=m
304CONFIG_SQUASHFS_XATTR=y
305CONFIG_SQUASHFS_LZO=y
306CONFIG_SQUASHFS_XZ=y
307CONFIG_PSTORE=y
308CONFIG_NFS_FS=y
309CONFIG_NFS_V3_ACL=y
310CONFIG_NFS_V4=y
311CONFIG_NFSD=m
312CONFIG_NFSD_V3_ACL=y
313CONFIG_NFSD_V4=y
314CONFIG_CIFS=m
315CONFIG_CIFS_XATTR=y
316CONFIG_CIFS_POSIX=y
317CONFIG_NLS_DEFAULT="utf8"
318CONFIG_NLS_CODEPAGE_437=y
319CONFIG_NLS_ASCII=y
320CONFIG_NLS_ISO8859_1=y
321CONFIG_NLS_UTF8=y
322CONFIG_CRC_T10DIF=y
323CONFIG_MAGIC_SYSRQ=y
324CONFIG_DEBUG_KERNEL=y
325CONFIG_DEBUG_STACK_USAGE=y
326CONFIG_DEBUG_STACKOVERFLOW=y
327CONFIG_LOCKUP_DETECTOR=y
328CONFIG_LATENCYTOP=y
329CONFIG_SCHED_TRACER=y
330CONFIG_BLK_DEV_IO_TRACE=y
331CONFIG_CODE_PATCHING_SELFTEST=y
332CONFIG_FTR_FIXUP_SELFTEST=y
333CONFIG_MSI_BITMAP_SELFTEST=y
334CONFIG_XMON=y
335CONFIG_CRYPTO_TEST=m
336CONFIG_CRYPTO_PCBC=m
337CONFIG_CRYPTO_HMAC=y
338CONFIG_CRYPTO_MICHAEL_MIC=m
339CONFIG_CRYPTO_TGR192=m
340CONFIG_CRYPTO_WP512=m
341CONFIG_CRYPTO_ANUBIS=m
342CONFIG_CRYPTO_BLOWFISH=m
343CONFIG_CRYPTO_CAST6=m
344CONFIG_CRYPTO_KHAZAD=m
345CONFIG_CRYPTO_SALSA20=m
346CONFIG_CRYPTO_SERPENT=m
347CONFIG_CRYPTO_TEA=m
348CONFIG_CRYPTO_TWOFISH=m
349CONFIG_CRYPTO_LZO=m
350# CONFIG_CRYPTO_ANSI_CPRNG is not set
351CONFIG_CRYPTO_DEV_NX=y
352CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index cc0655a702a7..935b5e7a1436 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -31,6 +31,8 @@
31extern unsigned long randomize_et_dyn(unsigned long base); 31extern unsigned long randomize_et_dyn(unsigned long base);
32#define ELF_ET_DYN_BASE (randomize_et_dyn(0x20000000)) 32#define ELF_ET_DYN_BASE (randomize_et_dyn(0x20000000))
33 33
34#define ELF_CORE_EFLAGS (is_elf2_task() ? 2 : 0)
35
34/* 36/*
35 * Our registers are always unsigned longs, whether we're a 32 bit 37 * Our registers are always unsigned longs, whether we're a 32 bit
36 * process or 64 bit, on either a 64 bit or 32 bit kernel. 38 * process or 64 bit, on either a 64 bit or 32 bit kernel.
@@ -86,6 +88,8 @@ typedef elf_vrregset_t elf_fpxregset_t;
86#ifdef __powerpc64__ 88#ifdef __powerpc64__
87# define SET_PERSONALITY(ex) \ 89# define SET_PERSONALITY(ex) \
88do { \ 90do { \
91 if (((ex).e_flags & 0x3) == 2) \
92 set_thread_flag(TIF_ELF2ABI); \
89 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ 93 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
90 set_thread_flag(TIF_32BIT); \ 94 set_thread_flag(TIF_32BIT); \
91 else \ 95 else \
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index 0c7f2bfcf134..d8b600b3f058 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -403,6 +403,8 @@ static inline unsigned long cmo_get_page_size(void)
403extern long pSeries_enable_reloc_on_exc(void); 403extern long pSeries_enable_reloc_on_exc(void);
404extern long pSeries_disable_reloc_on_exc(void); 404extern long pSeries_disable_reloc_on_exc(void);
405 405
406extern long pseries_big_endian_exceptions(void);
407
406#else 408#else
407 409
408#define pSeries_enable_reloc_on_exc() do {} while (0) 410#define pSeries_enable_reloc_on_exc() do {} while (0)
diff --git a/arch/powerpc/include/asm/pgalloc-32.h b/arch/powerpc/include/asm/pgalloc-32.h
index 27b2386f738a..842846c1b711 100644
--- a/arch/powerpc/include/asm/pgalloc-32.h
+++ b/arch/powerpc/include/asm/pgalloc-32.h
@@ -84,10 +84,8 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb,
84static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, 84static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
85 unsigned long address) 85 unsigned long address)
86{ 86{
87 struct page *page = page_address(table);
88
89 tlb_flush_pgtable(tlb, address); 87 tlb_flush_pgtable(tlb, address);
90 pgtable_page_dtor(page); 88 pgtable_page_dtor(table);
91 pgtable_free_tlb(tlb, page, 0); 89 pgtable_free_tlb(tlb, page_address(table), 0);
92} 90}
93#endif /* _ASM_POWERPC_PGALLOC_32_H */ 91#endif /* _ASM_POWERPC_PGALLOC_32_H */
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
index 16cb92d215d2..4b0be20fcbfd 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
@@ -16,6 +16,7 @@ struct vmemmap_backing {
16 unsigned long phys; 16 unsigned long phys;
17 unsigned long virt_addr; 17 unsigned long virt_addr;
18}; 18};
19extern struct vmemmap_backing *vmemmap_list;
19 20
20/* 21/*
21 * Functions that deal with pagetables that could be at any level of 22 * Functions that deal with pagetables that could be at any level of
@@ -147,11 +148,9 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb,
147static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, 148static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
148 unsigned long address) 149 unsigned long address)
149{ 150{
150 struct page *page = page_address(table);
151
152 tlb_flush_pgtable(tlb, address); 151 tlb_flush_pgtable(tlb, address);
153 pgtable_page_dtor(page); 152 pgtable_page_dtor(table);
154 pgtable_free_tlb(tlb, page, 0); 153 pgtable_free_tlb(tlb, page_address(table), 0);
155} 154}
156 155
157#else /* if CONFIG_PPC_64K_PAGES */ 156#else /* if CONFIG_PPC_64K_PAGES */
diff --git a/arch/powerpc/include/asm/plpar_wrappers.h b/arch/powerpc/include/asm/plpar_wrappers.h
index a63b045e707c..12c32c5f533d 100644
--- a/arch/powerpc/include/asm/plpar_wrappers.h
+++ b/arch/powerpc/include/asm/plpar_wrappers.h
@@ -287,6 +287,32 @@ static inline long disable_reloc_on_exceptions(void) {
287 return plpar_set_mode(0, 3, 0, 0); 287 return plpar_set_mode(0, 3, 0, 0);
288} 288}
289 289
290/*
291 * Take exceptions in big endian mode on this partition
292 *
293 * Note: this call has a partition wide scope and can take a while to complete.
294 * If it returns H_LONG_BUSY_* it should be retried periodically until it
295 * returns H_SUCCESS.
296 */
297static inline long enable_big_endian_exceptions(void)
298{
299 /* mflags = 0: big endian exceptions */
300 return plpar_set_mode(0, 4, 0, 0);
301}
302
303/*
304 * Take exceptions in little endian mode on this partition
305 *
306 * Note: this call has a partition wide scope and can take a while to complete.
307 * If it returns H_LONG_BUSY_* it should be retried periodically until it
308 * returns H_SUCCESS.
309 */
310static inline long enable_little_endian_exceptions(void)
311{
312 /* mflags = 1: little endian exceptions */
313 return plpar_set_mode(1, 4, 0, 0);
314}
315
290static inline long plapr_set_ciabr(unsigned long ciabr) 316static inline long plapr_set_ciabr(unsigned long ciabr)
291{ 317{
292 return plpar_set_mode(0, 1, ciabr, 0); 318 return plpar_set_mode(0, 1, ciabr, 0);
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 3c1acc31a092..f595b98079ee 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -366,6 +366,8 @@ BEGIN_FTR_SECTION_NESTED(96); \
366 cmpwi dest,0; \ 366 cmpwi dest,0; \
367 beq- 90b; \ 367 beq- 90b; \
368END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96) 368END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
369#elif defined(CONFIG_8xx)
370#define MFTB(dest) mftb dest
369#else 371#else
370#define MFTB(dest) mfspr dest, SPRN_TBRL 372#define MFTB(dest) mfspr dest, SPRN_TBRL
371#endif 373#endif
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 5c45787d551e..fa8388ed94c5 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1174,12 +1174,19 @@
1174 1174
1175#else /* __powerpc64__ */ 1175#else /* __powerpc64__ */
1176 1176
1177#if defined(CONFIG_8xx)
1178#define mftbl() ({unsigned long rval; \
1179 asm volatile("mftbl %0" : "=r" (rval)); rval;})
1180#define mftbu() ({unsigned long rval; \
1181 asm volatile("mftbu %0" : "=r" (rval)); rval;})
1182#else
1177#define mftbl() ({unsigned long rval; \ 1183#define mftbl() ({unsigned long rval; \
1178 asm volatile("mfspr %0, %1" : "=r" (rval) : \ 1184 asm volatile("mfspr %0, %1" : "=r" (rval) : \
1179 "i" (SPRN_TBRL)); rval;}) 1185 "i" (SPRN_TBRL)); rval;})
1180#define mftbu() ({unsigned long rval; \ 1186#define mftbu() ({unsigned long rval; \
1181 asm volatile("mfspr %0, %1" : "=r" (rval) : \ 1187 asm volatile("mfspr %0, %1" : "=r" (rval) : \
1182 "i" (SPRN_TBRU)); rval;}) 1188 "i" (SPRN_TBRU)); rval;})
1189#endif
1183#endif /* !__powerpc64__ */ 1190#endif /* !__powerpc64__ */
1184 1191
1185#define mttbl(v) asm volatile("mttbl %0":: "r"(v)) 1192#define mttbl(v) asm volatile("mttbl %0":: "r"(v))
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 98da78e0c2c0..084e0807db98 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -33,6 +33,7 @@ extern int boot_cpuid;
33extern int spinning_secondaries; 33extern int spinning_secondaries;
34 34
35extern void cpu_die(void); 35extern void cpu_die(void);
36extern int cpu_to_chip_id(int cpu);
36 37
37#ifdef CONFIG_SMP 38#ifdef CONFIG_SMP
38 39
@@ -112,7 +113,6 @@ static inline struct cpumask *cpu_core_mask(int cpu)
112} 113}
113 114
114extern int cpu_to_core_id(int cpu); 115extern int cpu_to_core_id(int cpu);
115extern int cpu_to_chip_id(int cpu);
116 116
117/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. 117/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
118 * 118 *
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index ba7b1973866e..9854c564ac52 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -82,8 +82,6 @@ static inline struct thread_info *current_thread_info(void)
82 82
83#endif /* __ASSEMBLY__ */ 83#endif /* __ASSEMBLY__ */
84 84
85#define PREEMPT_ACTIVE 0x10000000
86
87/* 85/*
88 * thread information flag bit numbers 86 * thread information flag bit numbers
89 */ 87 */
@@ -107,6 +105,9 @@ static inline struct thread_info *current_thread_info(void)
107#define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation 105#define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation
108 for stack store? */ 106 for stack store? */
109#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ 107#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
108#if defined(CONFIG_PPC64)
109#define TIF_ELF2ABI 18 /* function descriptors must die! */
110#endif
110 111
111/* as above, but as bit values */ 112/* as above, but as bit values */
112#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 113#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -185,6 +186,12 @@ static inline bool test_thread_local_flags(unsigned int flags)
185#define is_32bit_task() (1) 186#define is_32bit_task() (1)
186#endif 187#endif
187 188
189#if defined(CONFIG_PPC64)
190#define is_elf2_task() (test_thread_flag(TIF_ELF2ABI))
191#else
192#define is_elf2_task() (0)
193#endif
194
188#endif /* !__ASSEMBLY__ */ 195#endif /* !__ASSEMBLY__ */
189 196
190#endif /* __KERNEL__ */ 197#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/timex.h b/arch/powerpc/include/asm/timex.h
index 18908caa1f3b..2cf846edb3fc 100644
--- a/arch/powerpc/include/asm/timex.h
+++ b/arch/powerpc/include/asm/timex.h
@@ -29,7 +29,11 @@ static inline cycles_t get_cycles(void)
29 ret = 0; 29 ret = 0;
30 30
31 __asm__ __volatile__( 31 __asm__ __volatile__(
32#ifdef CONFIG_8xx
33 "97: mftb %0\n"
34#else
32 "97: mfspr %0, %2\n" 35 "97: mfspr %0, %2\n"
36#endif
33 "99:\n" 37 "99:\n"
34 ".section __ftr_fixup,\"a\"\n" 38 ".section __ftr_fixup,\"a\"\n"
35 ".align 2\n" 39 ".align 2\n"
@@ -41,7 +45,11 @@ static inline cycles_t get_cycles(void)
41 " .long 0\n" 45 " .long 0\n"
42 " .long 0\n" 46 " .long 0\n"
43 ".previous" 47 ".previous"
48#ifdef CONFIG_8xx
49 : "=r" (ret) : "i" (CPU_FTR_601));
50#else
44 : "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL)); 51 : "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL));
52#endif
45 return ret; 53 return ret;
46#endif 54#endif
47} 55}
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 671302065347..4bd687d5e7aa 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -686,6 +686,15 @@ void eeh_save_bars(struct eeh_dev *edev)
686 686
687 for (i = 0; i < 16; i++) 687 for (i = 0; i < 16; i++)
688 eeh_ops->read_config(dn, i * 4, 4, &edev->config_space[i]); 688 eeh_ops->read_config(dn, i * 4, 4, &edev->config_space[i]);
689
690 /*
691 * For PCI bridges including root port, we need enable bus
692 * master explicitly. Otherwise, it can't fetch IODA table
693 * entries correctly. So we cache the bit in advance so that
694 * we can restore it after reset, either PHB range or PE range.
695 */
696 if (edev->mode & EEH_DEV_BRIDGE)
697 edev->config_space[1] |= PCI_COMMAND_MASTER;
689} 698}
690 699
691/** 700/**
diff --git a/arch/powerpc/kernel/eeh_event.c b/arch/powerpc/kernel/eeh_event.c
index d27c5afc90ae..72d748b56c86 100644
--- a/arch/powerpc/kernel/eeh_event.c
+++ b/arch/powerpc/kernel/eeh_event.c
@@ -74,8 +74,13 @@ static int eeh_event_handler(void * dummy)
74 pe = event->pe; 74 pe = event->pe;
75 if (pe) { 75 if (pe) {
76 eeh_pe_state_mark(pe, EEH_PE_RECOVERING); 76 eeh_pe_state_mark(pe, EEH_PE_RECOVERING);
77 pr_info("EEH: Detected PCI bus error on PHB#%d-PE#%x\n", 77 if (pe->type & EEH_PE_PHB)
78 pe->phb->global_number, pe->addr); 78 pr_info("EEH: Detected error on PHB#%d\n",
79 pe->phb->global_number);
80 else
81 pr_info("EEH: Detected PCI bus error on "
82 "PHB#%d-PE#%x\n",
83 pe->phb->global_number, pe->addr);
79 eeh_handle_event(pe); 84 eeh_handle_event(pe);
80 eeh_pe_state_clear(pe, EEH_PE_RECOVERING); 85 eeh_pe_state_clear(pe, EEH_PE_RECOVERING);
81 } else { 86 } else {
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 2156ea90eb54..90fab64d911d 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -429,7 +429,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
429 case KPROBE_HIT_SSDONE: 429 case KPROBE_HIT_SSDONE:
430 /* 430 /*
431 * We increment the nmissed count for accounting, 431 * We increment the nmissed count for accounting,
432 * we can also use npre/npostfault count for accouting 432 * we can also use npre/npostfault count for accounting
433 * these specific fault cases. 433 * these specific fault cases.
434 */ 434 */
435 kprobes_inc_nmissed_count(cur); 435 kprobes_inc_nmissed_count(cur);
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index e1ec57e87b3b..75d4f7340da8 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -18,6 +18,7 @@
18#include <linux/ftrace.h> 18#include <linux/ftrace.h>
19 19
20#include <asm/machdep.h> 20#include <asm/machdep.h>
21#include <asm/pgalloc.h>
21#include <asm/prom.h> 22#include <asm/prom.h>
22#include <asm/sections.h> 23#include <asm/sections.h>
23 24
@@ -75,6 +76,17 @@ void arch_crash_save_vmcoreinfo(void)
75#ifndef CONFIG_NEED_MULTIPLE_NODES 76#ifndef CONFIG_NEED_MULTIPLE_NODES
76 VMCOREINFO_SYMBOL(contig_page_data); 77 VMCOREINFO_SYMBOL(contig_page_data);
77#endif 78#endif
79#if defined(CONFIG_PPC64) && defined(CONFIG_SPARSEMEM_VMEMMAP)
80 VMCOREINFO_SYMBOL(vmemmap_list);
81 VMCOREINFO_SYMBOL(mmu_vmemmap_psize);
82 VMCOREINFO_SYMBOL(mmu_psize_defs);
83 VMCOREINFO_STRUCT_SIZE(vmemmap_backing);
84 VMCOREINFO_OFFSET(vmemmap_backing, list);
85 VMCOREINFO_OFFSET(vmemmap_backing, phys);
86 VMCOREINFO_OFFSET(vmemmap_backing, virt_addr);
87 VMCOREINFO_STRUCT_SIZE(mmu_psize_def);
88 VMCOREINFO_OFFSET(mmu_psize_def, shift);
89#endif
78} 90}
79 91
80/* 92/*
@@ -136,7 +148,7 @@ void __init reserve_crashkernel(void)
136 * a small SLB (128MB) since the crash kernel needs to place 148 * a small SLB (128MB) since the crash kernel needs to place
137 * itself and some stacks to be in the first segment. 149 * itself and some stacks to be in the first segment.
138 */ 150 */
139 crashk_res.start = min(0x80000000ULL, (ppc64_rma_size / 2)); 151 crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2));
140#else 152#else
141 crashk_res.start = KDUMP_KERNELBASE; 153 crashk_res.start = KDUMP_KERNELBASE;
142#endif 154#endif
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index e59caf874d05..64bf8db12b15 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -246,8 +246,8 @@ _GLOBAL(__bswapdi2)
246 or r3,r7,r9 246 or r3,r7,r9
247 blr 247 blr
248 248
249#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
250 249
250#ifdef CONFIG_PPC_EARLY_DEBUG_BOOTX
251_GLOBAL(rmci_on) 251_GLOBAL(rmci_on)
252 sync 252 sync
253 isync 253 isync
@@ -277,6 +277,9 @@ _GLOBAL(rmci_off)
277 isync 277 isync
278 sync 278 sync
279 blr 279 blr
280#endif /* CONFIG_PPC_EARLY_DEBUG_BOOTX */
281
282#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
280 283
281/* 284/*
282 * Do an IO access in real mode 285 * Do an IO access in real mode
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index fd82c289ab1c..28b898e68185 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -210,7 +210,7 @@ static void __init nvram_print_partitions(char * label)
210 printk(KERN_WARNING "--------%s---------\n", label); 210 printk(KERN_WARNING "--------%s---------\n", label);
211 printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n"); 211 printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n");
212 list_for_each_entry(tmp_part, &nvram_partitions, partition) { 212 list_for_each_entry(tmp_part, &nvram_partitions, partition) {
213 printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%12s\n", 213 printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%12.12s\n",
214 tmp_part->index, tmp_part->header.signature, 214 tmp_part->index, tmp_part->header.signature,
215 tmp_part->header.checksum, tmp_part->header.length, 215 tmp_part->header.checksum, tmp_part->header.length,
216 tmp_part->header.name); 216 tmp_part->header.name);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 83530af028b8..4a96556fd2d4 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -858,17 +858,21 @@ void show_regs(struct pt_regs * regs)
858 printk("MSR: "REG" ", regs->msr); 858 printk("MSR: "REG" ", regs->msr);
859 printbits(regs->msr, msr_bits); 859 printbits(regs->msr, msr_bits);
860 printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer); 860 printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
861#ifdef CONFIG_PPC64
862 printk("SOFTE: %ld\n", regs->softe);
863#endif
864 trap = TRAP(regs); 861 trap = TRAP(regs);
865 if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR)) 862 if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
866 printk("CFAR: "REG"\n", regs->orig_gpr3); 863 printk("CFAR: "REG" ", regs->orig_gpr3);
867 if (trap == 0x300 || trap == 0x600) 864 if (trap == 0x200 || trap == 0x300 || trap == 0x600)
868#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 865#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
869 printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr); 866 printk("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr);
870#else 867#else
871 printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr); 868 printk("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
869#endif
870#ifdef CONFIG_PPC64
871 printk("SOFTE: %ld ", regs->softe);
872#endif
873#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
874 if (MSR_TM_ACTIVE(regs->msr))
875 printk("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch);
872#endif 876#endif
873 877
874 for (i = 0; i < 32; i++) { 878 for (i = 0; i < 32; i++) {
@@ -887,9 +891,6 @@ void show_regs(struct pt_regs * regs)
887 printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip); 891 printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
888 printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link); 892 printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
889#endif 893#endif
890#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
891 printk("PACATMSCRATCH [%llx]\n", get_paca()->tm_scratch);
892#endif
893 show_stack(current, (unsigned long *) regs->gpr[1]); 894 show_stack(current, (unsigned long *) regs->gpr[1]);
894 if (!user_mode(regs)) 895 if (!user_mode(regs))
895 show_instructions(regs); 896 show_instructions(regs);
@@ -1086,25 +1087,45 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
1086 regs->msr = MSR_USER; 1087 regs->msr = MSR_USER;
1087#else 1088#else
1088 if (!is_32bit_task()) { 1089 if (!is_32bit_task()) {
1089 unsigned long entry, toc; 1090 unsigned long entry;
1090 1091
1091 /* start is a relocated pointer to the function descriptor for 1092 if (is_elf2_task()) {
1092 * the elf _start routine. The first entry in the function 1093 /* Look ma, no function descriptors! */
1093 * descriptor is the entry address of _start and the second 1094 entry = start;
1094 * entry is the TOC value we need to use.
1095 */
1096 __get_user(entry, (unsigned long __user *)start);
1097 __get_user(toc, (unsigned long __user *)start+1);
1098 1095
1099 /* Check whether the e_entry function descriptor entries 1096 /*
1100 * need to be relocated before we can use them. 1097 * Ulrich says:
1101 */ 1098 * The latest iteration of the ABI requires that when
1102 if (load_addr != 0) { 1099 * calling a function (at its global entry point),
1103 entry += load_addr; 1100 * the caller must ensure r12 holds the entry point
1104 toc += load_addr; 1101 * address (so that the function can quickly
1102 * establish addressability).
1103 */
1104 regs->gpr[12] = start;
1105 /* Make sure that's restored on entry to userspace. */
1106 set_thread_flag(TIF_RESTOREALL);
1107 } else {
1108 unsigned long toc;
1109
1110 /* start is a relocated pointer to the function
1111 * descriptor for the elf _start routine. The first
1112 * entry in the function descriptor is the entry
1113 * address of _start and the second entry is the TOC
1114 * value we need to use.
1115 */
1116 __get_user(entry, (unsigned long __user *)start);
1117 __get_user(toc, (unsigned long __user *)start+1);
1118
1119 /* Check whether the e_entry function descriptor entries
1120 * need to be relocated before we can use them.
1121 */
1122 if (load_addr != 0) {
1123 entry += load_addr;
1124 toc += load_addr;
1125 }
1126 regs->gpr[2] = toc;
1105 } 1127 }
1106 regs->nip = entry; 1128 regs->nip = entry;
1107 regs->gpr[2] = toc;
1108 regs->msr = MSR_USER64; 1129 regs->msr = MSR_USER64;
1109 } else { 1130 } else {
1110 regs->nip = start; 1131 regs->nip = start;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index f3a47098fb8e..fa0ad8aafbcc 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -777,6 +777,26 @@ int of_get_ibm_chip_id(struct device_node *np)
777 return -1; 777 return -1;
778} 778}
779 779
780/**
781 * cpu_to_chip_id - Return the cpus chip-id
782 * @cpu: The logical cpu number.
783 *
784 * Return the value of the ibm,chip-id property corresponding to the given
785 * logical cpu number. If the chip-id can not be found, returns -1.
786 */
787int cpu_to_chip_id(int cpu)
788{
789 struct device_node *np;
790
791 np = of_get_cpu_node(cpu, NULL);
792 if (!np)
793 return -1;
794
795 of_node_put(np);
796 return of_get_ibm_chip_id(np);
797}
798EXPORT_SYMBOL(cpu_to_chip_id);
799
780#ifdef CONFIG_PPC_PSERIES 800#ifdef CONFIG_PPC_PSERIES
781/* 801/*
782 * Fix up the uninitialized fields in a new device node: 802 * Fix up the uninitialized fields in a new device node:
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 749778e0a69d..68027bfa5f8e 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -445,6 +445,12 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
445#endif /* CONFIG_ALTIVEC */ 445#endif /* CONFIG_ALTIVEC */
446 if (copy_fpr_to_user(&frame->mc_fregs, current)) 446 if (copy_fpr_to_user(&frame->mc_fregs, current))
447 return 1; 447 return 1;
448
449 /*
450 * Clear the MSR VSX bit to indicate there is no valid state attached
451 * to this context, except in the specific case below where we set it.
452 */
453 msr &= ~MSR_VSX;
448#ifdef CONFIG_VSX 454#ifdef CONFIG_VSX
449 /* 455 /*
450 * Copy VSR 0-31 upper half from thread_struct to local 456 * Copy VSR 0-31 upper half from thread_struct to local
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index b3c615764c9b..42991045349f 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -122,6 +122,12 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
122 flush_fp_to_thread(current); 122 flush_fp_to_thread(current);
123 /* copy fpr regs and fpscr */ 123 /* copy fpr regs and fpscr */
124 err |= copy_fpr_to_user(&sc->fp_regs, current); 124 err |= copy_fpr_to_user(&sc->fp_regs, current);
125
126 /*
127 * Clear the MSR VSX bit to indicate there is no valid state attached
128 * to this context, except in the specific case below where we set it.
129 */
130 msr &= ~MSR_VSX;
125#ifdef CONFIG_VSX 131#ifdef CONFIG_VSX
126 /* 132 /*
127 * Copy VSX low doubleword to local buffer for formatting, 133 * Copy VSX low doubleword to local buffer for formatting,
@@ -701,12 +707,6 @@ badframe:
701int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info, 707int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
702 sigset_t *set, struct pt_regs *regs) 708 sigset_t *set, struct pt_regs *regs)
703{ 709{
704 /* Handler is *really* a pointer to the function descriptor for
705 * the signal routine. The first entry in the function
706 * descriptor is the entry address of signal and the second
707 * entry is the TOC value we need to use.
708 */
709 func_descr_t __user *funct_desc_ptr;
710 struct rt_sigframe __user *frame; 710 struct rt_sigframe __user *frame;
711 unsigned long newsp = 0; 711 unsigned long newsp = 0;
712 long err = 0; 712 long err = 0;
@@ -766,19 +766,32 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
766 goto badframe; 766 goto badframe;
767 regs->link = (unsigned long) &frame->tramp[0]; 767 regs->link = (unsigned long) &frame->tramp[0];
768 } 768 }
769 funct_desc_ptr = (func_descr_t __user *) ka->sa.sa_handler;
770 769
771 /* Allocate a dummy caller frame for the signal handler. */ 770 /* Allocate a dummy caller frame for the signal handler. */
772 newsp = ((unsigned long)frame) - __SIGNAL_FRAMESIZE; 771 newsp = ((unsigned long)frame) - __SIGNAL_FRAMESIZE;
773 err |= put_user(regs->gpr[1], (unsigned long __user *)newsp); 772 err |= put_user(regs->gpr[1], (unsigned long __user *)newsp);
774 773
775 /* Set up "regs" so we "return" to the signal handler. */ 774 /* Set up "regs" so we "return" to the signal handler. */
776 err |= get_user(regs->nip, &funct_desc_ptr->entry); 775 if (is_elf2_task()) {
776 regs->nip = (unsigned long) ka->sa.sa_handler;
777 regs->gpr[12] = regs->nip;
778 } else {
779 /* Handler is *really* a pointer to the function descriptor for
780 * the signal routine. The first entry in the function
781 * descriptor is the entry address of signal and the second
782 * entry is the TOC value we need to use.
783 */
784 func_descr_t __user *funct_desc_ptr =
785 (func_descr_t __user *) ka->sa.sa_handler;
786
787 err |= get_user(regs->nip, &funct_desc_ptr->entry);
788 err |= get_user(regs->gpr[2], &funct_desc_ptr->toc);
789 }
790
777 /* enter the signal handler in native-endian mode */ 791 /* enter the signal handler in native-endian mode */
778 regs->msr &= ~MSR_LE; 792 regs->msr &= ~MSR_LE;
779 regs->msr |= (MSR_KERNEL & MSR_LE); 793 regs->msr |= (MSR_KERNEL & MSR_LE);
780 regs->gpr[1] = newsp; 794 regs->gpr[1] = newsp;
781 err |= get_user(regs->gpr[2], &funct_desc_ptr->toc);
782 regs->gpr[3] = signr; 795 regs->gpr[3] = signr;
783 regs->result = 0; 796 regs->result = 0;
784 if (ka->sa.sa_flags & SA_SIGINFO) { 797 if (ka->sa.sa_flags & SA_SIGINFO) {
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 930cd8af3503..a3b64f3bf9a2 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -597,22 +597,6 @@ out:
597 return id; 597 return id;
598} 598}
599 599
600/* Return the value of the chip-id property corresponding
601 * to the given logical cpu.
602 */
603int cpu_to_chip_id(int cpu)
604{
605 struct device_node *np;
606
607 np = of_get_cpu_node(cpu, NULL);
608 if (!np)
609 return -1;
610
611 of_node_put(np);
612 return of_get_ibm_chip_id(np);
613}
614EXPORT_SYMBOL(cpu_to_chip_id);
615
616/* Helper routines for cpu to core mapping */ 600/* Helper routines for cpu to core mapping */
617int cpu_core_index_of_thread(int cpu) 601int cpu_core_index_of_thread(int cpu)
618{ 602{
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 192b051df97e..b3b144121cc9 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -213,8 +213,6 @@ static u64 scan_dispatch_log(u64 stop_tb)
213 if (i == be64_to_cpu(vpa->dtl_idx)) 213 if (i == be64_to_cpu(vpa->dtl_idx))
214 return 0; 214 return 0;
215 while (i < be64_to_cpu(vpa->dtl_idx)) { 215 while (i < be64_to_cpu(vpa->dtl_idx)) {
216 if (dtl_consumer)
217 dtl_consumer(dtl, i);
218 dtb = be64_to_cpu(dtl->timebase); 216 dtb = be64_to_cpu(dtl->timebase);
219 tb_delta = be32_to_cpu(dtl->enqueue_to_dispatch_time) + 217 tb_delta = be32_to_cpu(dtl->enqueue_to_dispatch_time) +
220 be32_to_cpu(dtl->ready_to_enqueue_time); 218 be32_to_cpu(dtl->ready_to_enqueue_time);
@@ -227,6 +225,8 @@ static u64 scan_dispatch_log(u64 stop_tb)
227 } 225 }
228 if (dtb > stop_tb) 226 if (dtb > stop_tb)
229 break; 227 break;
228 if (dtl_consumer)
229 dtl_consumer(dtl, i);
230 stolen += tb_delta; 230 stolen += tb_delta;
231 ++i; 231 ++i;
232 ++dtl; 232 ++dtl;
diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S
index 6b1f2a6d5517..6b2b69616e77 100644
--- a/arch/powerpc/kernel/vdso32/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso32/gettimeofday.S
@@ -232,9 +232,15 @@ __do_get_tspec:
232 lwz r6,(CFG_TB_ORIG_STAMP+4)(r9) 232 lwz r6,(CFG_TB_ORIG_STAMP+4)(r9)
233 233
234 /* Get a stable TB value */ 234 /* Get a stable TB value */
235#ifdef CONFIG_8xx
2362: mftbu r3
237 mftbl r4
238 mftbu r0
239#else
2352: mfspr r3, SPRN_TBRU 2402: mfspr r3, SPRN_TBRU
236 mfspr r4, SPRN_TBRL 241 mfspr r4, SPRN_TBRL
237 mfspr r0, SPRN_TBRU 242 mfspr r0, SPRN_TBRU
243#endif
238 cmplw cr0,r3,r0 244 cmplw cr0,r3,r0
239 bne- 2b 245 bne- 2b
240 246
diff --git a/arch/powerpc/kernel/vdso64/sigtramp.S b/arch/powerpc/kernel/vdso64/sigtramp.S
index 45ea281e9a21..542c6f422e4d 100644
--- a/arch/powerpc/kernel/vdso64/sigtramp.S
+++ b/arch/powerpc/kernel/vdso64/sigtramp.S
@@ -142,6 +142,13 @@ V_FUNCTION_END(__kernel_sigtramp_rt64)
142/* Size of CR reg in DWARF unwind info. */ 142/* Size of CR reg in DWARF unwind info. */
143#define CRSIZE 4 143#define CRSIZE 4
144 144
145/* Offset of CR reg within a full word. */
146#ifdef __LITTLE_ENDIAN__
147#define CROFF 0
148#else
149#define CROFF (RSIZE - CRSIZE)
150#endif
151
145/* This is the offset of the VMX reg pointer. */ 152/* This is the offset of the VMX reg pointer. */
146#define VREGS 48*RSIZE+33*8 153#define VREGS 48*RSIZE+33*8
147 154
@@ -181,7 +188,14 @@ V_FUNCTION_END(__kernel_sigtramp_rt64)
181 rsave (31, 31*RSIZE); \ 188 rsave (31, 31*RSIZE); \
182 rsave (67, 32*RSIZE); /* ap, used as temp for nip */ \ 189 rsave (67, 32*RSIZE); /* ap, used as temp for nip */ \
183 rsave (65, 36*RSIZE); /* lr */ \ 190 rsave (65, 36*RSIZE); /* lr */ \
184 rsave (70, 38*RSIZE + (RSIZE - CRSIZE)) /* cr */ 191 rsave (68, 38*RSIZE + CROFF); /* cr fields */ \
192 rsave (69, 38*RSIZE + CROFF); \
193 rsave (70, 38*RSIZE + CROFF); \
194 rsave (71, 38*RSIZE + CROFF); \
195 rsave (72, 38*RSIZE + CROFF); \
196 rsave (73, 38*RSIZE + CROFF); \
197 rsave (74, 38*RSIZE + CROFF); \
198 rsave (75, 38*RSIZE + CROFF)
185 199
186/* Describe where the FP regs are saved. */ 200/* Describe where the FP regs are saved. */
187#define EH_FRAME_FP \ 201#define EH_FRAME_FP \
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index e7d0c88f621a..76a64821f4a2 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1419,7 +1419,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
1419 1419
1420 /* needed to ensure proper operation of coherent allocations 1420 /* needed to ensure proper operation of coherent allocations
1421 * later, in case driver doesn't set it explicitly */ 1421 * later, in case driver doesn't set it explicitly */
1422 dma_set_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64)); 1422 dma_coerce_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64));
1423 } 1423 }
1424 1424
1425 /* register with generic device framework */ 1425 /* register with generic device framework */
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c
index 6936547018b8..c5f734e20b0f 100644
--- a/arch/powerpc/mm/gup.c
+++ b/arch/powerpc/mm/gup.c
@@ -123,6 +123,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
123 struct mm_struct *mm = current->mm; 123 struct mm_struct *mm = current->mm;
124 unsigned long addr, len, end; 124 unsigned long addr, len, end;
125 unsigned long next; 125 unsigned long next;
126 unsigned long flags;
126 pgd_t *pgdp; 127 pgd_t *pgdp;
127 int nr = 0; 128 int nr = 0;
128 129
@@ -156,7 +157,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
156 * So long as we atomically load page table pointers versus teardown, 157 * So long as we atomically load page table pointers versus teardown,
157 * we can follow the address down to the the page and take a ref on it. 158 * we can follow the address down to the the page and take a ref on it.
158 */ 159 */
159 local_irq_disable(); 160 local_irq_save(flags);
160 161
161 pgdp = pgd_offset(mm, addr); 162 pgdp = pgd_offset(mm, addr);
162 do { 163 do {
@@ -179,7 +180,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
179 break; 180 break;
180 } while (pgdp++, addr = next, addr != end); 181 } while (pgdp++, addr = next, addr != end);
181 182
182 local_irq_enable(); 183 local_irq_restore(flags);
183 184
184 return nr; 185 return nr;
185} 186}
diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c
index 3bc700655fc8..74551b5e41e5 100644
--- a/arch/powerpc/mm/hugetlbpage-book3e.c
+++ b/arch/powerpc/mm/hugetlbpage-book3e.c
@@ -117,6 +117,5 @@ void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
117 struct hstate *hstate = hstate_file(vma->vm_file); 117 struct hstate *hstate = hstate_file(vma->vm_file);
118 unsigned long tsize = huge_page_shift(hstate) - 10; 118 unsigned long tsize = huge_page_shift(hstate) - 10;
119 119
120 __flush_tlb_page(vma ? vma->vm_mm : NULL, vmaddr, tsize, 0); 120 __flush_tlb_page(vma->vm_mm, vmaddr, tsize, 0);
121
122} 121}
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 3e99c149271a..7ce9cf3b6988 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -258,7 +258,7 @@ static bool slice_scan_available(unsigned long addr,
258 slice = GET_HIGH_SLICE_INDEX(addr); 258 slice = GET_HIGH_SLICE_INDEX(addr);
259 *boundary_addr = (slice + end) ? 259 *boundary_addr = (slice + end) ?
260 ((slice + end) << SLICE_HIGH_SHIFT) : SLICE_LOW_TOP; 260 ((slice + end) << SLICE_HIGH_SHIFT) : SLICE_LOW_TOP;
261 return !!(available.high_slices & (1u << slice)); 261 return !!(available.high_slices & (1ul << slice));
262 } 262 }
263} 263}
264 264
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index 41cd68dee681..358d74303138 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -305,7 +305,7 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
305void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) 305void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
306{ 306{
307#ifdef CONFIG_HUGETLB_PAGE 307#ifdef CONFIG_HUGETLB_PAGE
308 if (is_vm_hugetlb_page(vma)) 308 if (vma && is_vm_hugetlb_page(vma))
309 flush_hugetlb_page(vma, vmaddr); 309 flush_hugetlb_page(vma, vmaddr);
310#endif 310#endif
311 311
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index c2a566fb8bb8..bca2465a9c34 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -403,3 +403,28 @@ config PPC_DOORBELL
403 default n 403 default n
404 404
405endmenu 405endmenu
406
407choice
408 prompt "Endianness selection"
409 default CPU_BIG_ENDIAN
410 help
411 This option selects whether a big endian or little endian kernel will
412 be built.
413
414config CPU_BIG_ENDIAN
415 bool "Build big endian kernel"
416 help
417 Build a big endian kernel.
418
419 If unsure, select this option.
420
421config CPU_LITTLE_ENDIAN
422 bool "Build little endian kernel"
423 help
424 Build a little endian kernel.
425
426 Note that if cross compiling a little endian kernel,
427 CROSS_COMPILE must point to a toolchain capable of targeting
428 little endian powerpc.
429
430endchoice
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 084cdfa40682..2c6d173842b2 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -720,6 +720,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
720 tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE; 720 tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
721 } 721 }
722 iommu_init_table(tbl, phb->hose->node); 722 iommu_init_table(tbl, phb->hose->node);
723 iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
723 724
724 if (pe->pdev) 725 if (pe->pdev)
725 set_iommu_table_base(&pe->pdev->dev, tbl); 726 set_iommu_table_base(&pe->pdev->dev, tbl);
diff --git a/arch/powerpc/platforms/powernv/rng.c b/arch/powerpc/platforms/powernv/rng.c
index 8844628915dc..1cb160dc1609 100644
--- a/arch/powerpc/platforms/powernv/rng.c
+++ b/arch/powerpc/platforms/powernv/rng.c
@@ -19,6 +19,7 @@
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/prom.h> 20#include <asm/prom.h>
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/smp.h>
22 23
23 24
24struct powernv_rng { 25struct powernv_rng {
diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
index 7fbc25b1813f..ccb633e077b1 100644
--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
@@ -189,8 +189,9 @@ static void *pseries_eeh_of_probe(struct device_node *dn, void *flag)
189 struct eeh_dev *edev; 189 struct eeh_dev *edev;
190 struct eeh_pe pe; 190 struct eeh_pe pe;
191 struct pci_dn *pdn = PCI_DN(dn); 191 struct pci_dn *pdn = PCI_DN(dn);
192 const u32 *class_code, *vendor_id, *device_id; 192 const __be32 *classp, *vendorp, *devicep;
193 const u32 *regs; 193 u32 class_code;
194 const __be32 *regs;
194 u32 pcie_flags; 195 u32 pcie_flags;
195 int enable = 0; 196 int enable = 0;
196 int ret; 197 int ret;
@@ -201,22 +202,24 @@ static void *pseries_eeh_of_probe(struct device_node *dn, void *flag)
201 return NULL; 202 return NULL;
202 203
203 /* Retrieve class/vendor/device IDs */ 204 /* Retrieve class/vendor/device IDs */
204 class_code = of_get_property(dn, "class-code", NULL); 205 classp = of_get_property(dn, "class-code", NULL);
205 vendor_id = of_get_property(dn, "vendor-id", NULL); 206 vendorp = of_get_property(dn, "vendor-id", NULL);
206 device_id = of_get_property(dn, "device-id", NULL); 207 devicep = of_get_property(dn, "device-id", NULL);
207 208
208 /* Skip for bad OF node or PCI-ISA bridge */ 209 /* Skip for bad OF node or PCI-ISA bridge */
209 if (!class_code || !vendor_id || !device_id) 210 if (!classp || !vendorp || !devicep)
210 return NULL; 211 return NULL;
211 if (dn->type && !strcmp(dn->type, "isa")) 212 if (dn->type && !strcmp(dn->type, "isa"))
212 return NULL; 213 return NULL;
213 214
215 class_code = of_read_number(classp, 1);
216
214 /* 217 /*
215 * Update class code and mode of eeh device. We need 218 * Update class code and mode of eeh device. We need
216 * correctly reflects that current device is root port 219 * correctly reflects that current device is root port
217 * or PCIe switch downstream port. 220 * or PCIe switch downstream port.
218 */ 221 */
219 edev->class_code = *class_code; 222 edev->class_code = class_code;
220 edev->pcie_cap = pseries_eeh_find_cap(dn, PCI_CAP_ID_EXP); 223 edev->pcie_cap = pseries_eeh_find_cap(dn, PCI_CAP_ID_EXP);
221 edev->mode &= 0xFFFFFF00; 224 edev->mode &= 0xFFFFFF00;
222 if ((edev->class_code >> 8) == PCI_CLASS_BRIDGE_PCI) { 225 if ((edev->class_code >> 8) == PCI_CLASS_BRIDGE_PCI) {
@@ -243,12 +246,12 @@ static void *pseries_eeh_of_probe(struct device_node *dn, void *flag)
243 /* Initialize the fake PE */ 246 /* Initialize the fake PE */
244 memset(&pe, 0, sizeof(struct eeh_pe)); 247 memset(&pe, 0, sizeof(struct eeh_pe));
245 pe.phb = edev->phb; 248 pe.phb = edev->phb;
246 pe.config_addr = regs[0]; 249 pe.config_addr = of_read_number(regs, 1);
247 250
248 /* Enable EEH on the device */ 251 /* Enable EEH on the device */
249 ret = eeh_ops->set_option(&pe, EEH_OPT_ENABLE); 252 ret = eeh_ops->set_option(&pe, EEH_OPT_ENABLE);
250 if (!ret) { 253 if (!ret) {
251 edev->config_addr = regs[0]; 254 edev->config_addr = of_read_number(regs, 1);
252 /* Retrieve PE address */ 255 /* Retrieve PE address */
253 edev->pe_config_addr = eeh_ops->get_pe_addr(&pe); 256 edev->pe_config_addr = eeh_ops->get_pe_addr(&pe);
254 pe.addr = edev->pe_config_addr; 257 pe.addr = edev->pe_config_addr;
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 356bc75ca74f..4fca3def9db9 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -245,6 +245,23 @@ static void pSeries_lpar_hptab_clear(void)
245 &(ptes[j].pteh), &(ptes[j].ptel)); 245 &(ptes[j].pteh), &(ptes[j].ptel));
246 } 246 }
247 } 247 }
248
249#ifdef __LITTLE_ENDIAN__
250 /* Reset exceptions to big endian */
251 if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
252 long rc;
253
254 rc = pseries_big_endian_exceptions();
255 /*
256 * At this point it is unlikely panic() will get anything
257 * out to the user, but at least this will stop us from
258 * continuing on further and creating an even more
259 * difficult to debug situation.
260 */
261 if (rc)
262 panic("Could not enable big endian exceptions");
263 }
264#endif
248} 265}
249 266
250/* 267/*
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 057fc894be51..7bfaf58d4664 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -31,7 +31,7 @@
31#define NVRW_CNT 0x20 31#define NVRW_CNT 0x20
32 32
33/* 33/*
34 * Set oops header version to distingush between old and new format header. 34 * Set oops header version to distinguish between old and new format header.
35 * lnx,oops-log partition max size is 4000, header version > 4000 will 35 * lnx,oops-log partition max size is 4000, header version > 4000 will
36 * help in identifying new header. 36 * help in identifying new header.
37 */ 37 */
diff --git a/arch/powerpc/platforms/pseries/rng.c b/arch/powerpc/platforms/pseries/rng.c
index a702f1c08242..72a102758d4e 100644
--- a/arch/powerpc/platforms/pseries/rng.c
+++ b/arch/powerpc/platforms/pseries/rng.c
@@ -13,6 +13,7 @@
13#include <linux/of.h> 13#include <linux/of.h>
14#include <asm/archrandom.h> 14#include <asm/archrandom.h>
15#include <asm/machdep.h> 15#include <asm/machdep.h>
16#include <asm/plpar_wrappers.h>
16 17
17 18
18static int pseries_get_random_long(unsigned long *v) 19static int pseries_get_random_long(unsigned long *v)
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 1f97e2b87a62..c1f190858701 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -442,6 +442,32 @@ static void pSeries_machine_kexec(struct kimage *image)
442} 442}
443#endif 443#endif
444 444
445#ifdef __LITTLE_ENDIAN__
446long pseries_big_endian_exceptions(void)
447{
448 long rc;
449
450 while (1) {
451 rc = enable_big_endian_exceptions();
452 if (!H_IS_LONG_BUSY(rc))
453 return rc;
454 mdelay(get_longbusy_msecs(rc));
455 }
456}
457
458static long pseries_little_endian_exceptions(void)
459{
460 long rc;
461
462 while (1) {
463 rc = enable_little_endian_exceptions();
464 if (!H_IS_LONG_BUSY(rc))
465 return rc;
466 mdelay(get_longbusy_msecs(rc));
467 }
468}
469#endif
470
445static void __init pSeries_setup_arch(void) 471static void __init pSeries_setup_arch(void)
446{ 472{
447 panic_timeout = 10; 473 panic_timeout = 10;
@@ -698,6 +724,22 @@ static int __init pSeries_probe(void)
698 /* Now try to figure out if we are running on LPAR */ 724 /* Now try to figure out if we are running on LPAR */
699 of_scan_flat_dt(pseries_probe_fw_features, NULL); 725 of_scan_flat_dt(pseries_probe_fw_features, NULL);
700 726
727#ifdef __LITTLE_ENDIAN__
728 if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
729 long rc;
730 /*
731 * Tell the hypervisor that we want our exceptions to
732 * be taken in little endian mode. If this fails we don't
733 * want to use BUG() because it will trigger an exception.
734 */
735 rc = pseries_little_endian_exceptions();
736 if (rc) {
737 ppc_md.progress("H_SET_MODE LE exception fail", 0);
738 panic("Could not enable little endian exceptions");
739 }
740 }
741#endif
742
701 if (firmware_has_feature(FW_FEATURE_LPAR)) 743 if (firmware_has_feature(FW_FEATURE_LPAR))
702 hpte_init_lpar(); 744 hpte_init_lpar();
703 else 745 else
diff --git a/arch/powerpc/platforms/wsp/chroma.c b/arch/powerpc/platforms/wsp/chroma.c
index 8ef53bc2e70e..aaa46b353715 100644
--- a/arch/powerpc/platforms/wsp/chroma.c
+++ b/arch/powerpc/platforms/wsp/chroma.c
@@ -15,6 +15,7 @@
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#include <linux/time.h>
18#include <linux/of_fdt.h>
18 19
19#include <asm/machdep.h> 20#include <asm/machdep.h>
20#include <asm/udbg.h> 21#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/wsp/h8.c b/arch/powerpc/platforms/wsp/h8.c
index d18e6cc19df3..a3c87f395750 100644
--- a/arch/powerpc/platforms/wsp/h8.c
+++ b/arch/powerpc/platforms/wsp/h8.c
@@ -10,6 +10,7 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/of.h> 11#include <linux/of.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/of_address.h>
13 14
14#include "wsp.h" 15#include "wsp.h"
15 16
diff --git a/arch/powerpc/platforms/wsp/ics.c b/arch/powerpc/platforms/wsp/ics.c
index 2d3b1dd9571d..9cd92e645028 100644
--- a/arch/powerpc/platforms/wsp/ics.c
+++ b/arch/powerpc/platforms/wsp/ics.c
@@ -18,6 +18,8 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/of_address.h>
22#include <linux/of_irq.h>
21 23
22#include <asm/io.h> 24#include <asm/io.h>
23#include <asm/irq.h> 25#include <asm/irq.h>
diff --git a/arch/powerpc/platforms/wsp/opb_pic.c b/arch/powerpc/platforms/wsp/opb_pic.c
index cb565bf93650..3f6729807938 100644
--- a/arch/powerpc/platforms/wsp/opb_pic.c
+++ b/arch/powerpc/platforms/wsp/opb_pic.c
@@ -15,6 +15,8 @@
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/time.h> 17#include <linux/time.h>
18#include <linux/of_address.h>
19#include <linux/of_irq.h>
18 20
19#include <asm/reg_a2.h> 21#include <asm/reg_a2.h>
20#include <asm/irq.h> 22#include <asm/irq.h>
diff --git a/arch/powerpc/platforms/wsp/psr2.c b/arch/powerpc/platforms/wsp/psr2.c
index 508ec8282b96..a87b414c766a 100644
--- a/arch/powerpc/platforms/wsp/psr2.c
+++ b/arch/powerpc/platforms/wsp/psr2.c
@@ -15,6 +15,7 @@
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#include <linux/time.h>
18#include <linux/of_fdt.h>
18 19
19#include <asm/machdep.h> 20#include <asm/machdep.h>
20#include <asm/udbg.h> 21#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/wsp/scom_wsp.c b/arch/powerpc/platforms/wsp/scom_wsp.c
index 8928507affea..6538b4de34fc 100644
--- a/arch/powerpc/platforms/wsp/scom_wsp.c
+++ b/arch/powerpc/platforms/wsp/scom_wsp.c
@@ -14,6 +14,7 @@
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/of_address.h>
17 18
18#include <asm/cputhreads.h> 19#include <asm/cputhreads.h>
19#include <asm/reg_a2.h> 20#include <asm/reg_a2.h>
diff --git a/arch/powerpc/platforms/wsp/wsp.c b/arch/powerpc/platforms/wsp/wsp.c
index ddb6efe88914..58cd1f00e1ef 100644
--- a/arch/powerpc/platforms/wsp/wsp.c
+++ b/arch/powerpc/platforms/wsp/wsp.c
@@ -13,6 +13,7 @@
13#include <linux/smp.h> 13#include <linux/smp.h>
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/time.h> 15#include <linux/time.h>
16#include <linux/of_address.h>
16 17
17#include <asm/scom.h> 18#include <asm/scom.h>
18 19
diff --git a/arch/powerpc/sysdev/ppc4xx_ocm.c b/arch/powerpc/sysdev/ppc4xx_ocm.c
index b7c43453236d..85d9e37f5ccb 100644
--- a/arch/powerpc/sysdev/ppc4xx_ocm.c
+++ b/arch/powerpc/sysdev/ppc4xx_ocm.c
@@ -339,7 +339,7 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,
339 if (IS_ERR_VALUE(offset)) 339 if (IS_ERR_VALUE(offset))
340 continue; 340 continue;
341 341
342 ocm_blk = kzalloc(sizeof(struct ocm_block *), GFP_KERNEL); 342 ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL);
343 if (!ocm_blk) { 343 if (!ocm_blk) {
344 printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block"); 344 printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block");
345 rh_free(ocm_reg->rh, offset); 345 rh_free(ocm_reg->rh, offset);
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 314fced4fc14..1e1a03d2d19f 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -101,7 +101,7 @@ config S390
101 select GENERIC_CPU_DEVICES if !SMP 101 select GENERIC_CPU_DEVICES if !SMP
102 select GENERIC_FIND_FIRST_BIT 102 select GENERIC_FIND_FIRST_BIT
103 select GENERIC_SMP_IDLE_THREAD 103 select GENERIC_SMP_IDLE_THREAD
104 select GENERIC_TIME_VSYSCALL_OLD 104 select GENERIC_TIME_VSYSCALL
105 select HAVE_ALIGNED_STRUCT_PAGE if SLUB 105 select HAVE_ALIGNED_STRUCT_PAGE if SLUB
106 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 106 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
107 select HAVE_ARCH_SECCOMP_FILTER 107 select HAVE_ARCH_SECCOMP_FILTER
@@ -347,14 +347,14 @@ config SMP
347 Even if you don't know what to do here, say Y. 347 Even if you don't know what to do here, say Y.
348 348
349config NR_CPUS 349config NR_CPUS
350 int "Maximum number of CPUs (2-64)" 350 int "Maximum number of CPUs (2-256)"
351 range 2 64 351 range 2 256
352 depends on SMP 352 depends on SMP
353 default "32" if !64BIT 353 default "32" if !64BIT
354 default "64" if 64BIT 354 default "64" if 64BIT
355 help 355 help
356 This allows you to specify the maximum number of CPUs which this 356 This allows you to specify the maximum number of CPUs which this
357 kernel will support. The maximum supported value is 64 and the 357 kernel will support. The maximum supported value is 256 and the
358 minimum value which makes sense is 2. 358 minimum value which makes sense is 2.
359 359
360 This is purely to save memory - each supported CPU adds 360 This is purely to save memory - each supported CPU adds
diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
index f2737a005afc..9a42ecec5647 100644
--- a/arch/s390/boot/Makefile
+++ b/arch/s390/boot/Makefile
@@ -21,6 +21,6 @@ $(obj)/bzImage: $(obj)/compressed/vmlinux FORCE
21$(obj)/compressed/vmlinux: FORCE 21$(obj)/compressed/vmlinux: FORCE
22 $(Q)$(MAKE) $(build)=$(obj)/compressed $@ 22 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
23 23
24install: $(CONFIGURE) $(obj)/image 24install: $(CONFIGURE) $(obj)/bzImage
25 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/image \ 25 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
26 System.map "$(INSTALL_PATH)" 26 System.map "$(INSTALL_PATH)"
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 46cae138ece2..b3feabd39f31 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -35,7 +35,6 @@ static u8 *ctrblk;
35static char keylen_flag; 35static char keylen_flag;
36 36
37struct s390_aes_ctx { 37struct s390_aes_ctx {
38 u8 iv[AES_BLOCK_SIZE];
39 u8 key[AES_MAX_KEY_SIZE]; 38 u8 key[AES_MAX_KEY_SIZE];
40 long enc; 39 long enc;
41 long dec; 40 long dec;
@@ -56,8 +55,7 @@ struct pcc_param {
56 55
57struct s390_xts_ctx { 56struct s390_xts_ctx {
58 u8 key[32]; 57 u8 key[32];
59 u8 xts_param[16]; 58 u8 pcc_key[32];
60 struct pcc_param pcc;
61 long enc; 59 long enc;
62 long dec; 60 long dec;
63 int key_len; 61 int key_len;
@@ -441,30 +439,36 @@ static int cbc_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
441 return aes_set_key(tfm, in_key, key_len); 439 return aes_set_key(tfm, in_key, key_len);
442} 440}
443 441
444static int cbc_aes_crypt(struct blkcipher_desc *desc, long func, void *param, 442static int cbc_aes_crypt(struct blkcipher_desc *desc, long func,
445 struct blkcipher_walk *walk) 443 struct blkcipher_walk *walk)
446{ 444{
445 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm);
447 int ret = blkcipher_walk_virt(desc, walk); 446 int ret = blkcipher_walk_virt(desc, walk);
448 unsigned int nbytes = walk->nbytes; 447 unsigned int nbytes = walk->nbytes;
448 struct {
449 u8 iv[AES_BLOCK_SIZE];
450 u8 key[AES_MAX_KEY_SIZE];
451 } param;
449 452
450 if (!nbytes) 453 if (!nbytes)
451 goto out; 454 goto out;
452 455
453 memcpy(param, walk->iv, AES_BLOCK_SIZE); 456 memcpy(param.iv, walk->iv, AES_BLOCK_SIZE);
457 memcpy(param.key, sctx->key, sctx->key_len);
454 do { 458 do {
455 /* only use complete blocks */ 459 /* only use complete blocks */
456 unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1); 460 unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1);
457 u8 *out = walk->dst.virt.addr; 461 u8 *out = walk->dst.virt.addr;
458 u8 *in = walk->src.virt.addr; 462 u8 *in = walk->src.virt.addr;
459 463
460 ret = crypt_s390_kmc(func, param, out, in, n); 464 ret = crypt_s390_kmc(func, &param, out, in, n);
461 if (ret < 0 || ret != n) 465 if (ret < 0 || ret != n)
462 return -EIO; 466 return -EIO;
463 467
464 nbytes &= AES_BLOCK_SIZE - 1; 468 nbytes &= AES_BLOCK_SIZE - 1;
465 ret = blkcipher_walk_done(desc, walk, nbytes); 469 ret = blkcipher_walk_done(desc, walk, nbytes);
466 } while ((nbytes = walk->nbytes)); 470 } while ((nbytes = walk->nbytes));
467 memcpy(walk->iv, param, AES_BLOCK_SIZE); 471 memcpy(walk->iv, param.iv, AES_BLOCK_SIZE);
468 472
469out: 473out:
470 return ret; 474 return ret;
@@ -481,7 +485,7 @@ static int cbc_aes_encrypt(struct blkcipher_desc *desc,
481 return fallback_blk_enc(desc, dst, src, nbytes); 485 return fallback_blk_enc(desc, dst, src, nbytes);
482 486
483 blkcipher_walk_init(&walk, dst, src, nbytes); 487 blkcipher_walk_init(&walk, dst, src, nbytes);
484 return cbc_aes_crypt(desc, sctx->enc, sctx->iv, &walk); 488 return cbc_aes_crypt(desc, sctx->enc, &walk);
485} 489}
486 490
487static int cbc_aes_decrypt(struct blkcipher_desc *desc, 491static int cbc_aes_decrypt(struct blkcipher_desc *desc,
@@ -495,7 +499,7 @@ static int cbc_aes_decrypt(struct blkcipher_desc *desc,
495 return fallback_blk_dec(desc, dst, src, nbytes); 499 return fallback_blk_dec(desc, dst, src, nbytes);
496 500
497 blkcipher_walk_init(&walk, dst, src, nbytes); 501 blkcipher_walk_init(&walk, dst, src, nbytes);
498 return cbc_aes_crypt(desc, sctx->dec, sctx->iv, &walk); 502 return cbc_aes_crypt(desc, sctx->dec, &walk);
499} 503}
500 504
501static struct crypto_alg cbc_aes_alg = { 505static struct crypto_alg cbc_aes_alg = {
@@ -586,7 +590,7 @@ static int xts_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
586 xts_ctx->enc = KM_XTS_128_ENCRYPT; 590 xts_ctx->enc = KM_XTS_128_ENCRYPT;
587 xts_ctx->dec = KM_XTS_128_DECRYPT; 591 xts_ctx->dec = KM_XTS_128_DECRYPT;
588 memcpy(xts_ctx->key + 16, in_key, 16); 592 memcpy(xts_ctx->key + 16, in_key, 16);
589 memcpy(xts_ctx->pcc.key + 16, in_key + 16, 16); 593 memcpy(xts_ctx->pcc_key + 16, in_key + 16, 16);
590 break; 594 break;
591 case 48: 595 case 48:
592 xts_ctx->enc = 0; 596 xts_ctx->enc = 0;
@@ -597,7 +601,7 @@ static int xts_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
597 xts_ctx->enc = KM_XTS_256_ENCRYPT; 601 xts_ctx->enc = KM_XTS_256_ENCRYPT;
598 xts_ctx->dec = KM_XTS_256_DECRYPT; 602 xts_ctx->dec = KM_XTS_256_DECRYPT;
599 memcpy(xts_ctx->key, in_key, 32); 603 memcpy(xts_ctx->key, in_key, 32);
600 memcpy(xts_ctx->pcc.key, in_key + 32, 32); 604 memcpy(xts_ctx->pcc_key, in_key + 32, 32);
601 break; 605 break;
602 default: 606 default:
603 *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; 607 *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
@@ -616,29 +620,33 @@ static int xts_aes_crypt(struct blkcipher_desc *desc, long func,
616 unsigned int nbytes = walk->nbytes; 620 unsigned int nbytes = walk->nbytes;
617 unsigned int n; 621 unsigned int n;
618 u8 *in, *out; 622 u8 *in, *out;
619 void *param; 623 struct pcc_param pcc_param;
624 struct {
625 u8 key[32];
626 u8 init[16];
627 } xts_param;
620 628
621 if (!nbytes) 629 if (!nbytes)
622 goto out; 630 goto out;
623 631
624 memset(xts_ctx->pcc.block, 0, sizeof(xts_ctx->pcc.block)); 632 memset(pcc_param.block, 0, sizeof(pcc_param.block));
625 memset(xts_ctx->pcc.bit, 0, sizeof(xts_ctx->pcc.bit)); 633 memset(pcc_param.bit, 0, sizeof(pcc_param.bit));
626 memset(xts_ctx->pcc.xts, 0, sizeof(xts_ctx->pcc.xts)); 634 memset(pcc_param.xts, 0, sizeof(pcc_param.xts));
627 memcpy(xts_ctx->pcc.tweak, walk->iv, sizeof(xts_ctx->pcc.tweak)); 635 memcpy(pcc_param.tweak, walk->iv, sizeof(pcc_param.tweak));
628 param = xts_ctx->pcc.key + offset; 636 memcpy(pcc_param.key, xts_ctx->pcc_key, 32);
629 ret = crypt_s390_pcc(func, param); 637 ret = crypt_s390_pcc(func, &pcc_param.key[offset]);
630 if (ret < 0) 638 if (ret < 0)
631 return -EIO; 639 return -EIO;
632 640
633 memcpy(xts_ctx->xts_param, xts_ctx->pcc.xts, 16); 641 memcpy(xts_param.key, xts_ctx->key, 32);
634 param = xts_ctx->key + offset; 642 memcpy(xts_param.init, pcc_param.xts, 16);
635 do { 643 do {
636 /* only use complete blocks */ 644 /* only use complete blocks */
637 n = nbytes & ~(AES_BLOCK_SIZE - 1); 645 n = nbytes & ~(AES_BLOCK_SIZE - 1);
638 out = walk->dst.virt.addr; 646 out = walk->dst.virt.addr;
639 in = walk->src.virt.addr; 647 in = walk->src.virt.addr;
640 648
641 ret = crypt_s390_km(func, param, out, in, n); 649 ret = crypt_s390_km(func, &xts_param.key[offset], out, in, n);
642 if (ret < 0 || ret != n) 650 if (ret < 0 || ret != n)
643 return -EIO; 651 return -EIO;
644 652
diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ctl_reg.h
index 9b69c0befdca..4e63f1a13600 100644
--- a/arch/s390/include/asm/ctl_reg.h
+++ b/arch/s390/include/asm/ctl_reg.h
@@ -7,6 +7,8 @@
7#ifndef __ASM_CTL_REG_H 7#ifndef __ASM_CTL_REG_H
8#define __ASM_CTL_REG_H 8#define __ASM_CTL_REG_H
9 9
10#include <linux/bug.h>
11
10#ifdef CONFIG_64BIT 12#ifdef CONFIG_64BIT
11# define __CTL_LOAD "lctlg" 13# define __CTL_LOAD "lctlg"
12# define __CTL_STORE "stctg" 14# define __CTL_STORE "stctg"
diff --git a/arch/s390/include/asm/eadm.h b/arch/s390/include/asm/eadm.h
index dc9200ca32ed..67026300c88e 100644
--- a/arch/s390/include/asm/eadm.h
+++ b/arch/s390/include/asm/eadm.h
@@ -111,18 +111,7 @@ struct scm_driver {
111int scm_driver_register(struct scm_driver *scmdrv); 111int scm_driver_register(struct scm_driver *scmdrv);
112void scm_driver_unregister(struct scm_driver *scmdrv); 112void scm_driver_unregister(struct scm_driver *scmdrv);
113 113
114int scm_start_aob(struct aob *aob); 114int eadm_start_aob(struct aob *aob);
115void scm_irq_handler(struct aob *aob, int error); 115void scm_irq_handler(struct aob *aob, int error);
116 116
117struct eadm_ops {
118 int (*eadm_start) (struct aob *aob);
119 struct module *owner;
120};
121
122int scm_get_ref(void);
123void scm_put_ref(void);
124
125void register_eadm_ops(struct eadm_ops *ops);
126void unregister_eadm_ops(struct eadm_ops *ops);
127
128#endif /* _ASM_S390_EADM_H */ 117#endif /* _ASM_S390_EADM_H */
diff --git a/arch/s390/include/asm/hardirq.h b/arch/s390/include/asm/hardirq.h
index a908d2941c5d..b7eabaaeffbd 100644
--- a/arch/s390/include/asm/hardirq.h
+++ b/arch/s390/include/asm/hardirq.h
@@ -18,8 +18,6 @@
18#define __ARCH_HAS_DO_SOFTIRQ 18#define __ARCH_HAS_DO_SOFTIRQ
19#define __ARCH_IRQ_EXIT_IRQS_DISABLED 19#define __ARCH_IRQ_EXIT_IRQS_DISABLED
20 20
21#define HARDIRQ_BITS 8
22
23static inline void ack_bad_irq(unsigned int irq) 21static inline void ack_bad_irq(unsigned int irq)
24{ 22{
25 printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); 23 printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 316c8503a3b4..114258eeaacd 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -48,33 +48,21 @@ static inline void clear_page(void *page)
48 : "memory", "cc"); 48 : "memory", "cc");
49} 49}
50 50
51/*
52 * copy_page uses the mvcl instruction with 0xb0 padding byte in order to
53 * bypass caches when copying a page. Especially when copying huge pages
54 * this keeps L1 and L2 data caches alive.
55 */
51static inline void copy_page(void *to, void *from) 56static inline void copy_page(void *to, void *from)
52{ 57{
53 if (MACHINE_HAS_MVPG) { 58 register void *reg2 asm ("2") = to;
54 register unsigned long reg0 asm ("0") = 0; 59 register unsigned long reg3 asm ("3") = 0x1000;
55 asm volatile( 60 register void *reg4 asm ("4") = from;
56 " mvpg %0,%1" 61 register unsigned long reg5 asm ("5") = 0xb0001000;
57 : : "a" (to), "a" (from), "d" (reg0) 62 asm volatile(
58 : "memory", "cc"); 63 " mvcl 2,4"
59 } else 64 : "+d" (reg2), "+d" (reg3), "+d" (reg4), "+d" (reg5)
60 asm volatile( 65 : : "memory", "cc");
61 " mvc 0(256,%0),0(%1)\n"
62 " mvc 256(256,%0),256(%1)\n"
63 " mvc 512(256,%0),512(%1)\n"
64 " mvc 768(256,%0),768(%1)\n"
65 " mvc 1024(256,%0),1024(%1)\n"
66 " mvc 1280(256,%0),1280(%1)\n"
67 " mvc 1536(256,%0),1536(%1)\n"
68 " mvc 1792(256,%0),1792(%1)\n"
69 " mvc 2048(256,%0),2048(%1)\n"
70 " mvc 2304(256,%0),2304(%1)\n"
71 " mvc 2560(256,%0),2560(%1)\n"
72 " mvc 2816(256,%0),2816(%1)\n"
73 " mvc 3072(256,%0),3072(%1)\n"
74 " mvc 3328(256,%0),3328(%1)\n"
75 " mvc 3584(256,%0),3584(%1)\n"
76 " mvc 3840(256,%0),3840(%1)\n"
77 : : "a" (to), "a" (from) : "memory");
78} 66}
79 67
80#define clear_user_page(page, vaddr, pg) clear_page(page) 68#define clear_user_page(page, vaddr, pg) clear_page(page)
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
index 1cc185da9d38..c129ab2ac731 100644
--- a/arch/s390/include/asm/pci.h
+++ b/arch/s390/include/asm/pci.h
@@ -63,9 +63,10 @@ enum zpci_state {
63}; 63};
64 64
65struct zpci_bar_struct { 65struct zpci_bar_struct {
66 struct resource *res; /* bus resource */
66 u32 val; /* bar start & 3 flag bits */ 67 u32 val; /* bar start & 3 flag bits */
67 u8 size; /* order 2 exponent */
68 u16 map_idx; /* index into bar mapping array */ 68 u16 map_idx; /* index into bar mapping array */
69 u8 size; /* order 2 exponent */
69}; 70};
70 71
71/* Private data per function */ 72/* Private data per function */
@@ -97,6 +98,7 @@ struct zpci_dev {
97 unsigned long iommu_pages; 98 unsigned long iommu_pages;
98 unsigned int next_bit; 99 unsigned int next_bit;
99 100
101 char res_name[16];
100 struct zpci_bar_struct bars[PCI_BAR_COUNT]; 102 struct zpci_bar_struct bars[PCI_BAR_COUNT];
101 103
102 u64 start_dma; /* Start of available DMA addresses */ 104 u64 start_dma; /* Start of available DMA addresses */
@@ -122,12 +124,10 @@ static inline bool zdev_enabled(struct zpci_dev *zdev)
122 Prototypes 124 Prototypes
123----------------------------------------------------------------------------- */ 125----------------------------------------------------------------------------- */
124/* Base stuff */ 126/* Base stuff */
125struct zpci_dev *zpci_alloc_device(void);
126int zpci_create_device(struct zpci_dev *); 127int zpci_create_device(struct zpci_dev *);
127int zpci_enable_device(struct zpci_dev *); 128int zpci_enable_device(struct zpci_dev *);
128int zpci_disable_device(struct zpci_dev *); 129int zpci_disable_device(struct zpci_dev *);
129void zpci_stop_device(struct zpci_dev *); 130void zpci_stop_device(struct zpci_dev *);
130void zpci_free_device(struct zpci_dev *);
131int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64); 131int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64);
132int zpci_unregister_ioat(struct zpci_dev *, u8); 132int zpci_unregister_ioat(struct zpci_dev *, u8);
133 133
diff --git a/arch/s390/include/asm/sclp.h b/arch/s390/include/asm/sclp.h
index 7dc7f9c63b65..2f390956c7c1 100644
--- a/arch/s390/include/asm/sclp.h
+++ b/arch/s390/include/asm/sclp.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <asm/chpid.h> 10#include <asm/chpid.h>
11#include <asm/cpu.h>
11 12
12#define SCLP_CHP_INFO_MASK_SIZE 32 13#define SCLP_CHP_INFO_MASK_SIZE 32
13 14
@@ -37,13 +38,12 @@ struct sclp_cpu_info {
37 unsigned int standby; 38 unsigned int standby;
38 unsigned int combined; 39 unsigned int combined;
39 int has_cpu_type; 40 int has_cpu_type;
40 struct sclp_cpu_entry cpu[255]; 41 struct sclp_cpu_entry cpu[MAX_CPU_ADDRESS + 1];
41}; 42};
42 43
43int sclp_get_cpu_info(struct sclp_cpu_info *info); 44int sclp_get_cpu_info(struct sclp_cpu_info *info);
44int sclp_cpu_configure(u8 cpu); 45int sclp_cpu_configure(u8 cpu);
45int sclp_cpu_deconfigure(u8 cpu); 46int sclp_cpu_deconfigure(u8 cpu);
46void sclp_facilities_detect(void);
47unsigned long long sclp_get_rnmax(void); 47unsigned long long sclp_get_rnmax(void);
48unsigned long long sclp_get_rzm(void); 48unsigned long long sclp_get_rzm(void);
49int sclp_sdias_blk_count(void); 49int sclp_sdias_blk_count(void);
@@ -57,5 +57,7 @@ bool sclp_has_vt220(void);
57int sclp_pci_configure(u32 fid); 57int sclp_pci_configure(u32 fid);
58int sclp_pci_deconfigure(u32 fid); 58int sclp_pci_deconfigure(u32 fid);
59int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode); 59int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode);
60unsigned long sclp_get_hsa_size(void);
61void sclp_early_detect(void);
60 62
61#endif /* _ASM_S390_SCLP_H */ 63#endif /* _ASM_S390_SCLP_H */
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index df802ee14af6..94cfbe442f12 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -107,9 +107,6 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr,
107#define MACHINE_HAS_RRBM (S390_lowcore.machine_flags & MACHINE_FLAG_RRBM) 107#define MACHINE_HAS_RRBM (S390_lowcore.machine_flags & MACHINE_FLAG_RRBM)
108#endif /* CONFIG_64BIT */ 108#endif /* CONFIG_64BIT */
109 109
110#define ZFCPDUMP_HSA_SIZE (32UL<<20)
111#define ZFCPDUMP_HSA_SIZE_MAX (64UL<<20)
112
113/* 110/*
114 * Console mode. Override with conmode= 111 * Console mode. Override with conmode=
115 */ 112 */
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index eb5f64d26d06..10e0fcd3633d 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -111,6 +111,4 @@ static inline struct thread_info *current_thread_info(void)
111#define is_32bit_task() (1) 111#define is_32bit_task() (1)
112#endif 112#endif
113 113
114#define PREEMPT_ACTIVE 0x4000000
115
116#endif /* _ASM_THREAD_INFO_H */ 114#endif /* _ASM_THREAD_INFO_H */
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h
index a73eb2e1e918..bc9746a7d47c 100644
--- a/arch/s390/include/asm/vdso.h
+++ b/arch/s390/include/asm/vdso.h
@@ -26,8 +26,9 @@ struct vdso_data {
26 __u64 wtom_clock_nsec; /* 0x28 */ 26 __u64 wtom_clock_nsec; /* 0x28 */
27 __u32 tz_minuteswest; /* Minutes west of Greenwich 0x30 */ 27 __u32 tz_minuteswest; /* Minutes west of Greenwich 0x30 */
28 __u32 tz_dsttime; /* Type of dst correction 0x34 */ 28 __u32 tz_dsttime; /* Type of dst correction 0x34 */
29 __u32 ectg_available; 29 __u32 ectg_available; /* ECTG instruction present 0x38 */
30 __u32 ntp_mult; /* NTP adjusted multiplier 0x3C */ 30 __u32 tk_mult; /* Mult. used for xtime_nsec 0x3c */
31 __u32 tk_shift; /* Shift used for xtime_nsec 0x40 */
31}; 32};
32 33
33struct vdso_per_cpu_data { 34struct vdso_per_cpu_data {
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index 2416138ebd3e..e4c99a183651 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -65,12 +65,14 @@ int main(void)
65 DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); 65 DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
66 DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest)); 66 DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest));
67 DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available)); 67 DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available));
68 DEFINE(__VDSO_NTP_MULT, offsetof(struct vdso_data, ntp_mult)); 68 DEFINE(__VDSO_TK_MULT, offsetof(struct vdso_data, tk_mult));
69 DEFINE(__VDSO_TK_SHIFT, offsetof(struct vdso_data, tk_shift));
69 DEFINE(__VDSO_ECTG_BASE, offsetof(struct vdso_per_cpu_data, ectg_timer_base)); 70 DEFINE(__VDSO_ECTG_BASE, offsetof(struct vdso_per_cpu_data, ectg_timer_base));
70 DEFINE(__VDSO_ECTG_USER, offsetof(struct vdso_per_cpu_data, ectg_user_time)); 71 DEFINE(__VDSO_ECTG_USER, offsetof(struct vdso_per_cpu_data, ectg_user_time));
71 /* constants used by the vdso */ 72 /* constants used by the vdso */
72 DEFINE(__CLOCK_REALTIME, CLOCK_REALTIME); 73 DEFINE(__CLOCK_REALTIME, CLOCK_REALTIME);
73 DEFINE(__CLOCK_MONOTONIC, CLOCK_MONOTONIC); 74 DEFINE(__CLOCK_MONOTONIC, CLOCK_MONOTONIC);
75 DEFINE(__CLOCK_THREAD_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID);
74 DEFINE(__CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC); 76 DEFINE(__CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC);
75 BLANK(); 77 BLANK();
76 /* idle data offsets */ 78 /* idle data offsets */
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 6e2442978409..95e7ba0fbb7e 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -194,7 +194,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
194 return -EINVAL; 194 return -EINVAL;
195 195
196 /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ 196 /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */
197 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | 197 regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) |
198 (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_USER) << 32 | 198 (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_USER) << 32 |
199 (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_RI) << 32 | 199 (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_RI) << 32 |
200 (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_AMODE); 200 (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_AMODE);
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
index f45b2ab0cb81..d7658c4b2ed5 100644
--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -95,7 +95,7 @@ static void *elfcorehdr_newmem;
95/* 95/*
96 * Copy one page from zfcpdump "oldmem" 96 * Copy one page from zfcpdump "oldmem"
97 * 97 *
98 * For pages below ZFCPDUMP_HSA_SIZE memory from the HSA is copied. Otherwise 98 * For pages below HSA size memory from the HSA is copied. Otherwise
99 * real memory copy is used. 99 * real memory copy is used.
100 */ 100 */
101static ssize_t copy_oldmem_page_zfcpdump(char *buf, size_t csize, 101static ssize_t copy_oldmem_page_zfcpdump(char *buf, size_t csize,
@@ -103,7 +103,7 @@ static ssize_t copy_oldmem_page_zfcpdump(char *buf, size_t csize,
103{ 103{
104 int rc; 104 int rc;
105 105
106 if (src < ZFCPDUMP_HSA_SIZE) { 106 if (src < sclp_get_hsa_size()) {
107 rc = memcpy_hsa(buf, src, csize, userbuf); 107 rc = memcpy_hsa(buf, src, csize, userbuf);
108 } else { 108 } else {
109 if (userbuf) 109 if (userbuf)
@@ -188,18 +188,19 @@ static int remap_oldmem_pfn_range_kdump(struct vm_area_struct *vma,
188/* 188/*
189 * Remap "oldmem" for zfcpdump 189 * Remap "oldmem" for zfcpdump
190 * 190 *
191 * We only map available memory above ZFCPDUMP_HSA_SIZE. Memory below 191 * We only map available memory above HSA size. Memory below HSA size
192 * ZFCPDUMP_HSA_SIZE is read on demand using the copy_oldmem_page() function. 192 * is read on demand using the copy_oldmem_page() function.
193 */ 193 */
194static int remap_oldmem_pfn_range_zfcpdump(struct vm_area_struct *vma, 194static int remap_oldmem_pfn_range_zfcpdump(struct vm_area_struct *vma,
195 unsigned long from, 195 unsigned long from,
196 unsigned long pfn, 196 unsigned long pfn,
197 unsigned long size, pgprot_t prot) 197 unsigned long size, pgprot_t prot)
198{ 198{
199 unsigned long hsa_end = sclp_get_hsa_size();
199 unsigned long size_hsa; 200 unsigned long size_hsa;
200 201
201 if (pfn < ZFCPDUMP_HSA_SIZE >> PAGE_SHIFT) { 202 if (pfn < hsa_end >> PAGE_SHIFT) {
202 size_hsa = min(size, ZFCPDUMP_HSA_SIZE - (pfn << PAGE_SHIFT)); 203 size_hsa = min(size, hsa_end - (pfn << PAGE_SHIFT));
203 if (size == size_hsa) 204 if (size == size_hsa)
204 return 0; 205 return 0;
205 size -= size_hsa; 206 size -= size_hsa;
@@ -238,9 +239,9 @@ int copy_from_oldmem(void *dest, void *src, size_t count)
238 return rc; 239 return rc;
239 } 240 }
240 } else { 241 } else {
241 if ((unsigned long) src < ZFCPDUMP_HSA_SIZE) { 242 unsigned long hsa_end = sclp_get_hsa_size();
242 copied = min(count, 243 if ((unsigned long) src < hsa_end) {
243 ZFCPDUMP_HSA_SIZE - (unsigned long) src); 244 copied = min(count, hsa_end - (unsigned long) src);
244 rc = memcpy_hsa(dest, (unsigned long) src, copied, 0); 245 rc = memcpy_hsa(dest, (unsigned long) src, copied, 0);
245 if (rc) 246 if (rc)
246 return rc; 247 return rc;
@@ -580,6 +581,9 @@ int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size)
580 /* If elfcorehdr= has been passed via cmdline, we use that one */ 581 /* If elfcorehdr= has been passed via cmdline, we use that one */
581 if (elfcorehdr_addr != ELFCORE_ADDR_MAX) 582 if (elfcorehdr_addr != ELFCORE_ADDR_MAX)
582 return 0; 583 return 0;
584 /* If we cannot get HSA size for zfcpdump return error */
585 if (ipl_info.type == IPL_TYPE_FCP_DUMP && !sclp_get_hsa_size())
586 return -ENODEV;
583 mem_chunk_cnt = get_mem_chunk_cnt(); 587 mem_chunk_cnt = get_mem_chunk_cnt();
584 588
585 alloc_size = 0x1000 + get_cpu_cnt() * 0x300 + 589 alloc_size = 0x1000 + get_cpu_cnt() * 0x300 +
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 96543ac400a7..fca20b5fe79e 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -483,7 +483,7 @@ void __init startup_init(void)
483 detect_diag44(); 483 detect_diag44();
484 detect_machine_facilities(); 484 detect_machine_facilities();
485 setup_topology(); 485 setup_topology();
486 sclp_facilities_detect(); 486 sclp_early_detect();
487#ifdef CONFIG_DYNAMIC_FTRACE 487#ifdef CONFIG_DYNAMIC_FTRACE
488 S390_lowcore.ftrace_func = (unsigned long)ftrace_caller; 488 S390_lowcore.ftrace_func = (unsigned long)ftrace_caller;
489#endif 489#endif
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 59a9c35c4598..bc71a7b95af5 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -680,7 +680,7 @@ static int __kprobes kprobe_trap_handler(struct pt_regs *regs, int trapnr)
680 case KPROBE_HIT_SSDONE: 680 case KPROBE_HIT_SSDONE:
681 /* 681 /*
682 * We increment the nmissed count for accounting, 682 * We increment the nmissed count for accounting,
683 * we can also use npre/npostfault count for accouting 683 * we can also use npre/npostfault count for accounting
684 * these specific fault cases. 684 * these specific fault cases.
685 */ 685 */
686 kprobes_inc_nmissed_count(p); 686 kprobes_inc_nmissed_count(p);
diff --git a/arch/s390/kernel/pgm_check.S b/arch/s390/kernel/pgm_check.S
index 4a460c44e17e..813ec7260878 100644
--- a/arch/s390/kernel/pgm_check.S
+++ b/arch/s390/kernel/pgm_check.S
@@ -78,7 +78,7 @@ PGM_CHECK_DEFAULT /* 34 */
78PGM_CHECK_DEFAULT /* 35 */ 78PGM_CHECK_DEFAULT /* 35 */
79PGM_CHECK_DEFAULT /* 36 */ 79PGM_CHECK_DEFAULT /* 36 */
80PGM_CHECK_DEFAULT /* 37 */ 80PGM_CHECK_DEFAULT /* 37 */
81PGM_CHECK_DEFAULT /* 38 */ 81PGM_CHECK_64BIT(do_dat_exception) /* 38 */
82PGM_CHECK_64BIT(do_dat_exception) /* 39 */ 82PGM_CHECK_64BIT(do_dat_exception) /* 39 */
83PGM_CHECK_64BIT(do_dat_exception) /* 3a */ 83PGM_CHECK_64BIT(do_dat_exception) /* 3a */
84PGM_CHECK_64BIT(do_dat_exception) /* 3b */ 84PGM_CHECK_64BIT(do_dat_exception) /* 3b */
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index ffe1c53264a7..4444875266ee 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -471,8 +471,9 @@ static void __init setup_memory_end(void)
471 471
472 472
473#ifdef CONFIG_ZFCPDUMP 473#ifdef CONFIG_ZFCPDUMP
474 if (ipl_info.type == IPL_TYPE_FCP_DUMP && !OLDMEM_BASE) { 474 if (ipl_info.type == IPL_TYPE_FCP_DUMP &&
475 memory_end = ZFCPDUMP_HSA_SIZE; 475 !OLDMEM_BASE && sclp_get_hsa_size()) {
476 memory_end = sclp_get_hsa_size();
476 memory_end_set = 1; 477 memory_end_set = 1;
477 } 478 }
478#endif 479#endif
@@ -586,7 +587,7 @@ static unsigned long __init find_crash_base(unsigned long crash_size,
586 crash_base = (chunk->addr + chunk->size) - crash_size; 587 crash_base = (chunk->addr + chunk->size) - crash_size;
587 if (crash_base < crash_size) 588 if (crash_base < crash_size)
588 continue; 589 continue;
589 if (crash_base < ZFCPDUMP_HSA_SIZE_MAX) 590 if (crash_base < sclp_get_hsa_size())
590 continue; 591 continue;
591 if (crash_base < (unsigned long) INITRD_START + INITRD_SIZE) 592 if (crash_base < (unsigned long) INITRD_START + INITRD_SIZE)
592 continue; 593 continue;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index fb535874a246..d8fd508ccd1e 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -94,7 +94,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
94 return -EINVAL; 94 return -EINVAL;
95 95
96 /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ 96 /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */
97 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | 97 regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) |
98 (user_sregs.regs.psw.mask & (PSW_MASK_USER | PSW_MASK_RI)); 98 (user_sregs.regs.psw.mask & (PSW_MASK_USER | PSW_MASK_RI));
99 /* Check for invalid user address space control. */ 99 /* Check for invalid user address space control. */
100 if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_HOME) 100 if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_HOME)
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 064c3082ab33..dd95f1631621 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -108,20 +108,10 @@ static void fixup_clock_comparator(unsigned long long delta)
108 set_clock_comparator(S390_lowcore.clock_comparator); 108 set_clock_comparator(S390_lowcore.clock_comparator);
109} 109}
110 110
111static int s390_next_ktime(ktime_t expires, 111static int s390_next_event(unsigned long delta,
112 struct clock_event_device *evt) 112 struct clock_event_device *evt)
113{ 113{
114 struct timespec ts; 114 S390_lowcore.clock_comparator = get_tod_clock() + delta;
115 u64 nsecs;
116
117 ts.tv_sec = ts.tv_nsec = 0;
118 monotonic_to_bootbased(&ts);
119 nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires));
120 do_div(nsecs, 125);
121 S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9);
122 /* Program the maximum value if we have an overflow (== year 2042) */
123 if (unlikely(S390_lowcore.clock_comparator < sched_clock_base_cc))
124 S390_lowcore.clock_comparator = -1ULL;
125 set_clock_comparator(S390_lowcore.clock_comparator); 115 set_clock_comparator(S390_lowcore.clock_comparator);
126 return 0; 116 return 0;
127} 117}
@@ -146,15 +136,14 @@ void init_cpu_timer(void)
146 cpu = smp_processor_id(); 136 cpu = smp_processor_id();
147 cd = &per_cpu(comparators, cpu); 137 cd = &per_cpu(comparators, cpu);
148 cd->name = "comparator"; 138 cd->name = "comparator";
149 cd->features = CLOCK_EVT_FEAT_ONESHOT | 139 cd->features = CLOCK_EVT_FEAT_ONESHOT;
150 CLOCK_EVT_FEAT_KTIME;
151 cd->mult = 16777; 140 cd->mult = 16777;
152 cd->shift = 12; 141 cd->shift = 12;
153 cd->min_delta_ns = 1; 142 cd->min_delta_ns = 1;
154 cd->max_delta_ns = LONG_MAX; 143 cd->max_delta_ns = LONG_MAX;
155 cd->rating = 400; 144 cd->rating = 400;
156 cd->cpumask = cpumask_of(cpu); 145 cd->cpumask = cpumask_of(cpu);
157 cd->set_next_ktime = s390_next_ktime; 146 cd->set_next_event = s390_next_event;
158 cd->set_mode = s390_set_mode; 147 cd->set_mode = s390_set_mode;
159 148
160 clockevents_register_device(cd); 149 clockevents_register_device(cd);
@@ -221,21 +210,30 @@ struct clocksource * __init clocksource_default_clock(void)
221 return &clocksource_tod; 210 return &clocksource_tod;
222} 211}
223 212
224void update_vsyscall_old(struct timespec *wall_time, struct timespec *wtm, 213void update_vsyscall(struct timekeeper *tk)
225 struct clocksource *clock, u32 mult)
226{ 214{
227 if (clock != &clocksource_tod) 215 u64 nsecps;
216
217 if (tk->clock != &clocksource_tod)
228 return; 218 return;
229 219
230 /* Make userspace gettimeofday spin until we're done. */ 220 /* Make userspace gettimeofday spin until we're done. */
231 ++vdso_data->tb_update_count; 221 ++vdso_data->tb_update_count;
232 smp_wmb(); 222 smp_wmb();
233 vdso_data->xtime_tod_stamp = clock->cycle_last; 223 vdso_data->xtime_tod_stamp = tk->clock->cycle_last;
234 vdso_data->xtime_clock_sec = wall_time->tv_sec; 224 vdso_data->xtime_clock_sec = tk->xtime_sec;
235 vdso_data->xtime_clock_nsec = wall_time->tv_nsec; 225 vdso_data->xtime_clock_nsec = tk->xtime_nsec;
236 vdso_data->wtom_clock_sec = wtm->tv_sec; 226 vdso_data->wtom_clock_sec =
237 vdso_data->wtom_clock_nsec = wtm->tv_nsec; 227 tk->xtime_sec + tk->wall_to_monotonic.tv_sec;
238 vdso_data->ntp_mult = mult; 228 vdso_data->wtom_clock_nsec = tk->xtime_nsec +
229 + (tk->wall_to_monotonic.tv_nsec << tk->shift);
230 nsecps = (u64) NSEC_PER_SEC << tk->shift;
231 while (vdso_data->wtom_clock_nsec >= nsecps) {
232 vdso_data->wtom_clock_nsec -= nsecps;
233 vdso_data->wtom_clock_sec++;
234 }
235 vdso_data->tk_mult = tk->mult;
236 vdso_data->tk_shift = tk->shift;
239 smp_wmb(); 237 smp_wmb();
240 ++vdso_data->tb_update_count; 238 ++vdso_data->tb_update_count;
241} 239}
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index a84476f2a9bb..613649096783 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -125,7 +125,7 @@ int vdso_alloc_per_cpu(struct _lowcore *lowcore)
125 psal[i] = 0x80000000; 125 psal[i] = 0x80000000;
126 126
127 lowcore->paste[4] = (u32)(addr_t) psal; 127 lowcore->paste[4] = (u32)(addr_t) psal;
128 psal[0] = 0x20000000; 128 psal[0] = 0x02000000;
129 psal[2] = (u32)(addr_t) aste; 129 psal[2] = (u32)(addr_t) aste;
130 *(unsigned long *) (aste + 2) = segment_table + 130 *(unsigned long *) (aste + 2) = segment_table +
131 _ASCE_TABLE_LENGTH + _ASCE_USER_BITS + _ASCE_TYPE_SEGMENT; 131 _ASCE_TABLE_LENGTH + _ASCE_USER_BITS + _ASCE_TYPE_SEGMENT;
diff --git a/arch/s390/kernel/vdso32/clock_gettime.S b/arch/s390/kernel/vdso32/clock_gettime.S
index b2224e0b974c..65fc3979c2f1 100644
--- a/arch/s390/kernel/vdso32/clock_gettime.S
+++ b/arch/s390/kernel/vdso32/clock_gettime.S
@@ -38,25 +38,21 @@ __kernel_clock_gettime:
38 sl %r1,__VDSO_XTIME_STAMP+4(%r5) 38 sl %r1,__VDSO_XTIME_STAMP+4(%r5)
39 brc 3,2f 39 brc 3,2f
40 ahi %r0,-1 40 ahi %r0,-1
412: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ 412: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */
42 lr %r2,%r0 42 lr %r2,%r0
43 l %r0,__VDSO_NTP_MULT(%r5) 43 l %r0,__VDSO_TK_MULT(%r5)
44 ltr %r1,%r1 44 ltr %r1,%r1
45 mr %r0,%r0 45 mr %r0,%r0
46 jnm 3f 46 jnm 3f
47 a %r0,__VDSO_NTP_MULT(%r5) 47 a %r0,__VDSO_TK_MULT(%r5)
483: alr %r0,%r2 483: alr %r0,%r2
49 srdl %r0,12 49 al %r0,__VDSO_WTOM_NSEC(%r5)
50 al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */
51 al %r1,__VDSO_XTIME_NSEC+4(%r5)
52 brc 12,4f
53 ahi %r0,1
544: l %r2,__VDSO_XTIME_SEC+4(%r5)
55 al %r0,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic */
56 al %r1,__VDSO_WTOM_NSEC+4(%r5) 50 al %r1,__VDSO_WTOM_NSEC+4(%r5)
57 brc 12,5f 51 brc 12,5f
58 ahi %r0,1 52 ahi %r0,1
595: al %r2,__VDSO_WTOM_SEC+4(%r5) 535: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
54 srdl %r0,0(%r2) /* >> tk->shift */
55 l %r2,__VDSO_WTOM_SEC+4(%r5)
60 cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ 56 cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */
61 jne 1b 57 jne 1b
62 basr %r5,0 58 basr %r5,0
@@ -86,20 +82,21 @@ __kernel_clock_gettime:
86 sl %r1,__VDSO_XTIME_STAMP+4(%r5) 82 sl %r1,__VDSO_XTIME_STAMP+4(%r5)
87 brc 3,12f 83 brc 3,12f
88 ahi %r0,-1 84 ahi %r0,-1
8912: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ 8512: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */
90 lr %r2,%r0 86 lr %r2,%r0
91 l %r0,__VDSO_NTP_MULT(%r5) 87 l %r0,__VDSO_TK_MULT(%r5)
92 ltr %r1,%r1 88 ltr %r1,%r1
93 mr %r0,%r0 89 mr %r0,%r0
94 jnm 13f 90 jnm 13f
95 a %r0,__VDSO_NTP_MULT(%r5) 91 a %r0,__VDSO_TK_MULT(%r5)
9613: alr %r0,%r2 9213: alr %r0,%r2
97 srdl %r0,12 93 al %r0,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */
98 al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */
99 al %r1,__VDSO_XTIME_NSEC+4(%r5) 94 al %r1,__VDSO_XTIME_NSEC+4(%r5)
100 brc 12,14f 95 brc 12,14f
101 ahi %r0,1 96 ahi %r0,1
10214: l %r2,__VDSO_XTIME_SEC+4(%r5) 9714: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
98 srdl %r0,0(%r2) /* >> tk->shift */
99 l %r2,__VDSO_XTIME_SEC+4(%r5)
103 cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ 100 cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */
104 jne 11b 101 jne 11b
105 basr %r5,0 102 basr %r5,0
diff --git a/arch/s390/kernel/vdso32/gettimeofday.S b/arch/s390/kernel/vdso32/gettimeofday.S
index 2d3633175e3b..fd621a950f7c 100644
--- a/arch/s390/kernel/vdso32/gettimeofday.S
+++ b/arch/s390/kernel/vdso32/gettimeofday.S
@@ -35,15 +35,14 @@ __kernel_gettimeofday:
35 sl %r1,__VDSO_XTIME_STAMP+4(%r5) 35 sl %r1,__VDSO_XTIME_STAMP+4(%r5)
36 brc 3,3f 36 brc 3,3f
37 ahi %r0,-1 37 ahi %r0,-1
383: ms %r0,__VDSO_NTP_MULT(%r5) /* cyc2ns(clock,cycle_delta) */ 383: ms %r0,__VDSO_TK_MULT(%r5) /* * tk->mult */
39 st %r0,24(%r15) 39 st %r0,24(%r15)
40 l %r0,__VDSO_NTP_MULT(%r5) 40 l %r0,__VDSO_TK_MULT(%r5)
41 ltr %r1,%r1 41 ltr %r1,%r1
42 mr %r0,%r0 42 mr %r0,%r0
43 jnm 4f 43 jnm 4f
44 a %r0,__VDSO_NTP_MULT(%r5) 44 a %r0,__VDSO_TK_MULT(%r5)
454: al %r0,24(%r15) 454: al %r0,24(%r15)
46 srdl %r0,12
47 al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */ 46 al %r0,__VDSO_XTIME_NSEC(%r5) /* + xtime */
48 al %r1,__VDSO_XTIME_NSEC+4(%r5) 47 al %r1,__VDSO_XTIME_NSEC+4(%r5)
49 brc 12,5f 48 brc 12,5f
@@ -51,6 +50,8 @@ __kernel_gettimeofday:
515: mvc 24(4,%r15),__VDSO_XTIME_SEC+4(%r5) 505: mvc 24(4,%r15),__VDSO_XTIME_SEC+4(%r5)
52 cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ 51 cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */
53 jne 1b 52 jne 1b
53 l %r4,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
54 srdl %r0,0(%r4) /* >> tk->shift */
54 l %r4,24(%r15) /* get tv_sec from stack */ 55 l %r4,24(%r15) /* get tv_sec from stack */
55 basr %r5,0 56 basr %r5,0
566: ltr %r0,%r0 576: ltr %r0,%r0
diff --git a/arch/s390/kernel/vdso64/clock_getres.S b/arch/s390/kernel/vdso64/clock_getres.S
index 176e1f75f9aa..34deba7c7ed1 100644
--- a/arch/s390/kernel/vdso64/clock_getres.S
+++ b/arch/s390/kernel/vdso64/clock_getres.S
@@ -23,7 +23,9 @@ __kernel_clock_getres:
23 je 0f 23 je 0f
24 cghi %r2,__CLOCK_MONOTONIC 24 cghi %r2,__CLOCK_MONOTONIC
25 je 0f 25 je 0f
26 cghi %r2,-2 /* CLOCK_THREAD_CPUTIME_ID for this thread */ 26 cghi %r2,__CLOCK_THREAD_CPUTIME_ID
27 je 0f
28 cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
27 jne 2f 29 jne 2f
28 larl %r5,_vdso_data 30 larl %r5,_vdso_data
29 icm %r0,15,__LC_ECTG_OK(%r5) 31 icm %r0,15,__LC_ECTG_OK(%r5)
diff --git a/arch/s390/kernel/vdso64/clock_gettime.S b/arch/s390/kernel/vdso64/clock_gettime.S
index d46c95ed5f19..91940ed33a4a 100644
--- a/arch/s390/kernel/vdso64/clock_gettime.S
+++ b/arch/s390/kernel/vdso64/clock_gettime.S
@@ -22,7 +22,9 @@ __kernel_clock_gettime:
22 larl %r5,_vdso_data 22 larl %r5,_vdso_data
23 cghi %r2,__CLOCK_REALTIME 23 cghi %r2,__CLOCK_REALTIME
24 je 4f 24 je 4f
25 cghi %r2,-2 /* CLOCK_THREAD_CPUTIME_ID for this thread */ 25 cghi %r2,__CLOCK_THREAD_CPUTIME_ID
26 je 9f
27 cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
26 je 9f 28 je 9f
27 cghi %r2,__CLOCK_MONOTONIC 29 cghi %r2,__CLOCK_MONOTONIC
28 jne 12f 30 jne 12f
@@ -34,14 +36,13 @@ __kernel_clock_gettime:
34 tmll %r4,0x0001 /* pending update ? loop */ 36 tmll %r4,0x0001 /* pending update ? loop */
35 jnz 0b 37 jnz 0b
36 stck 48(%r15) /* Store TOD clock */ 38 stck 48(%r15) /* Store TOD clock */
39 lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
40 lg %r0,__VDSO_WTOM_SEC(%r5)
37 lg %r1,48(%r15) 41 lg %r1,48(%r15)
38 sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ 42 sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */
39 msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ 43 msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */
40 srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ 44 alg %r1,__VDSO_WTOM_NSEC(%r5)
41 alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime */ 45 srlg %r1,%r1,0(%r2) /* >> tk->shift */
42 lg %r0,__VDSO_XTIME_SEC(%r5)
43 alg %r1,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic */
44 alg %r0,__VDSO_WTOM_SEC(%r5)
45 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ 46 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */
46 jne 0b 47 jne 0b
47 larl %r5,13f 48 larl %r5,13f
@@ -62,12 +63,13 @@ __kernel_clock_gettime:
62 tmll %r4,0x0001 /* pending update ? loop */ 63 tmll %r4,0x0001 /* pending update ? loop */
63 jnz 5b 64 jnz 5b
64 stck 48(%r15) /* Store TOD clock */ 65 stck 48(%r15) /* Store TOD clock */
66 lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
65 lg %r1,48(%r15) 67 lg %r1,48(%r15)
66 sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ 68 sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */
67 msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ 69 msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */
68 srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ 70 alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */
69 alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime */ 71 srlg %r1,%r1,0(%r2) /* >> tk->shift */
70 lg %r0,__VDSO_XTIME_SEC(%r5) 72 lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */
71 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ 73 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */
72 jne 5b 74 jne 5b
73 larl %r5,13f 75 larl %r5,13f
diff --git a/arch/s390/kernel/vdso64/gettimeofday.S b/arch/s390/kernel/vdso64/gettimeofday.S
index 36ee674722ec..d0860d1d0ccc 100644
--- a/arch/s390/kernel/vdso64/gettimeofday.S
+++ b/arch/s390/kernel/vdso64/gettimeofday.S
@@ -31,12 +31,13 @@ __kernel_gettimeofday:
31 stck 48(%r15) /* Store TOD clock */ 31 stck 48(%r15) /* Store TOD clock */
32 lg %r1,48(%r15) 32 lg %r1,48(%r15)
33 sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ 33 sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */
34 msgf %r1,__VDSO_NTP_MULT(%r5) /* * NTP adjustment */ 34 msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */
35 srlg %r1,%r1,12 /* cyc2ns(clock,cycle_delta) */ 35 alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */
36 alg %r1,__VDSO_XTIME_NSEC(%r5) /* + xtime.tv_nsec */ 36 lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */
37 lg %r0,__VDSO_XTIME_SEC(%r5) /* xtime.tv_sec */
38 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ 37 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */
39 jne 0b 38 jne 0b
39 lgf %r5,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
40 srlg %r1,%r1,0(%r5) /* >> tk->shift */
40 larl %r5,5f 41 larl %r5,5f
412: clg %r1,0(%r5) 422: clg %r1,0(%r5)
42 jl 3f 43 jl 3f
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index 97e03caf7825..dbdab3e7a1a6 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -78,11 +78,14 @@ static size_t copy_in_kernel(size_t count, void __user *to,
78 * contains the (negative) exception code. 78 * contains the (negative) exception code.
79 */ 79 */
80#ifdef CONFIG_64BIT 80#ifdef CONFIG_64BIT
81
81static unsigned long follow_table(struct mm_struct *mm, 82static unsigned long follow_table(struct mm_struct *mm,
82 unsigned long address, int write) 83 unsigned long address, int write)
83{ 84{
84 unsigned long *table = (unsigned long *)__pa(mm->pgd); 85 unsigned long *table = (unsigned long *)__pa(mm->pgd);
85 86
87 if (unlikely(address > mm->context.asce_limit - 1))
88 return -0x38UL;
86 switch (mm->context.asce_bits & _ASCE_TYPE_MASK) { 89 switch (mm->context.asce_bits & _ASCE_TYPE_MASK) {
87 case _ASCE_TYPE_REGION1: 90 case _ASCE_TYPE_REGION1:
88 table = table + ((address >> 53) & 0x7ff); 91 table = table + ((address >> 53) & 0x7ff);
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 0c9a17780e4b..bf7c73d71eef 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -530,20 +530,6 @@ static void zpci_unmap_resources(struct zpci_dev *zdev)
530 } 530 }
531} 531}
532 532
533struct zpci_dev *zpci_alloc_device(void)
534{
535 struct zpci_dev *zdev;
536
537 /* Alloc memory for our private pci device data */
538 zdev = kzalloc(sizeof(*zdev), GFP_KERNEL);
539 return zdev ? : ERR_PTR(-ENOMEM);
540}
541
542void zpci_free_device(struct zpci_dev *zdev)
543{
544 kfree(zdev);
545}
546
547int pcibios_add_platform_entries(struct pci_dev *pdev) 533int pcibios_add_platform_entries(struct pci_dev *pdev)
548{ 534{
549 return zpci_sysfs_add_device(&pdev->dev); 535 return zpci_sysfs_add_device(&pdev->dev);
@@ -579,37 +565,6 @@ static void zpci_irq_exit(void)
579 unregister_adapter_interrupt(&zpci_airq); 565 unregister_adapter_interrupt(&zpci_airq);
580} 566}
581 567
582static struct resource *zpci_alloc_bus_resource(unsigned long start, unsigned long size,
583 unsigned long flags, int domain)
584{
585 struct resource *r;
586 char *name;
587 int rc;
588
589 r = kzalloc(sizeof(*r), GFP_KERNEL);
590 if (!r)
591 return ERR_PTR(-ENOMEM);
592 r->start = start;
593 r->end = r->start + size - 1;
594 r->flags = flags;
595 r->parent = &iomem_resource;
596 name = kmalloc(18, GFP_KERNEL);
597 if (!name) {
598 kfree(r);
599 return ERR_PTR(-ENOMEM);
600 }
601 sprintf(name, "PCI Bus: %04x:%02x", domain, ZPCI_BUS_NR);
602 r->name = name;
603
604 rc = request_resource(&iomem_resource, r);
605 if (rc) {
606 kfree(r->name);
607 kfree(r);
608 return ERR_PTR(-ENOMEM);
609 }
610 return r;
611}
612
613static int zpci_alloc_iomap(struct zpci_dev *zdev) 568static int zpci_alloc_iomap(struct zpci_dev *zdev)
614{ 569{
615 int entry; 570 int entry;
@@ -633,6 +588,82 @@ static void zpci_free_iomap(struct zpci_dev *zdev, int entry)
633 spin_unlock(&zpci_iomap_lock); 588 spin_unlock(&zpci_iomap_lock);
634} 589}
635 590
591static struct resource *__alloc_res(struct zpci_dev *zdev, unsigned long start,
592 unsigned long size, unsigned long flags)
593{
594 struct resource *r;
595
596 r = kzalloc(sizeof(*r), GFP_KERNEL);
597 if (!r)
598 return NULL;
599
600 r->start = start;
601 r->end = r->start + size - 1;
602 r->flags = flags;
603 r->name = zdev->res_name;
604
605 if (request_resource(&iomem_resource, r)) {
606 kfree(r);
607 return NULL;
608 }
609 return r;
610}
611
612static int zpci_setup_bus_resources(struct zpci_dev *zdev,
613 struct list_head *resources)
614{
615 unsigned long addr, size, flags;
616 struct resource *res;
617 int i, entry;
618
619 snprintf(zdev->res_name, sizeof(zdev->res_name),
620 "PCI Bus %04x:%02x", zdev->domain, ZPCI_BUS_NR);
621
622 for (i = 0; i < PCI_BAR_COUNT; i++) {
623 if (!zdev->bars[i].size)
624 continue;
625 entry = zpci_alloc_iomap(zdev);
626 if (entry < 0)
627 return entry;
628 zdev->bars[i].map_idx = entry;
629
630 /* only MMIO is supported */
631 flags = IORESOURCE_MEM;
632 if (zdev->bars[i].val & 8)
633 flags |= IORESOURCE_PREFETCH;
634 if (zdev->bars[i].val & 4)
635 flags |= IORESOURCE_MEM_64;
636
637 addr = ZPCI_IOMAP_ADDR_BASE + ((u64) entry << 48);
638
639 size = 1UL << zdev->bars[i].size;
640
641 res = __alloc_res(zdev, addr, size, flags);
642 if (!res) {
643 zpci_free_iomap(zdev, entry);
644 return -ENOMEM;
645 }
646 zdev->bars[i].res = res;
647 pci_add_resource(resources, res);
648 }
649
650 return 0;
651}
652
653static void zpci_cleanup_bus_resources(struct zpci_dev *zdev)
654{
655 int i;
656
657 for (i = 0; i < PCI_BAR_COUNT; i++) {
658 if (!zdev->bars[i].size)
659 continue;
660
661 zpci_free_iomap(zdev, zdev->bars[i].map_idx);
662 release_resource(zdev->bars[i].res);
663 kfree(zdev->bars[i].res);
664 }
665}
666
636int pcibios_add_device(struct pci_dev *pdev) 667int pcibios_add_device(struct pci_dev *pdev)
637{ 668{
638 struct zpci_dev *zdev = get_zdev(pdev); 669 struct zpci_dev *zdev = get_zdev(pdev);
@@ -729,52 +760,6 @@ struct dev_pm_ops pcibios_pm_ops = {
729}; 760};
730#endif /* CONFIG_HIBERNATE_CALLBACKS */ 761#endif /* CONFIG_HIBERNATE_CALLBACKS */
731 762
732static int zpci_scan_bus(struct zpci_dev *zdev)
733{
734 struct resource *res;
735 LIST_HEAD(resources);
736 int i;
737
738 /* allocate mapping entry for each used bar */
739 for (i = 0; i < PCI_BAR_COUNT; i++) {
740 unsigned long addr, size, flags;
741 int entry;
742
743 if (!zdev->bars[i].size)
744 continue;
745 entry = zpci_alloc_iomap(zdev);
746 if (entry < 0)
747 return entry;
748 zdev->bars[i].map_idx = entry;
749
750 /* only MMIO is supported */
751 flags = IORESOURCE_MEM;
752 if (zdev->bars[i].val & 8)
753 flags |= IORESOURCE_PREFETCH;
754 if (zdev->bars[i].val & 4)
755 flags |= IORESOURCE_MEM_64;
756
757 addr = ZPCI_IOMAP_ADDR_BASE + ((u64) entry << 48);
758
759 size = 1UL << zdev->bars[i].size;
760
761 res = zpci_alloc_bus_resource(addr, size, flags, zdev->domain);
762 if (IS_ERR(res)) {
763 zpci_free_iomap(zdev, entry);
764 return PTR_ERR(res);
765 }
766 pci_add_resource(&resources, res);
767 }
768
769 zdev->bus = pci_scan_root_bus(NULL, ZPCI_BUS_NR, &pci_root_ops,
770 zdev, &resources);
771 if (!zdev->bus)
772 return -EIO;
773
774 zdev->bus->max_bus_speed = zdev->max_bus_speed;
775 return 0;
776}
777
778static int zpci_alloc_domain(struct zpci_dev *zdev) 763static int zpci_alloc_domain(struct zpci_dev *zdev)
779{ 764{
780 spin_lock(&zpci_domain_lock); 765 spin_lock(&zpci_domain_lock);
@@ -795,6 +780,41 @@ static void zpci_free_domain(struct zpci_dev *zdev)
795 spin_unlock(&zpci_domain_lock); 780 spin_unlock(&zpci_domain_lock);
796} 781}
797 782
783void pcibios_remove_bus(struct pci_bus *bus)
784{
785 struct zpci_dev *zdev = get_zdev_by_bus(bus);
786
787 zpci_exit_slot(zdev);
788 zpci_cleanup_bus_resources(zdev);
789 zpci_free_domain(zdev);
790
791 spin_lock(&zpci_list_lock);
792 list_del(&zdev->entry);
793 spin_unlock(&zpci_list_lock);
794
795 kfree(zdev);
796}
797
798static int zpci_scan_bus(struct zpci_dev *zdev)
799{
800 LIST_HEAD(resources);
801 int ret;
802
803 ret = zpci_setup_bus_resources(zdev, &resources);
804 if (ret)
805 return ret;
806
807 zdev->bus = pci_scan_root_bus(NULL, ZPCI_BUS_NR, &pci_root_ops,
808 zdev, &resources);
809 if (!zdev->bus) {
810 zpci_cleanup_bus_resources(zdev);
811 return -EIO;
812 }
813
814 zdev->bus->max_bus_speed = zdev->max_bus_speed;
815 return 0;
816}
817
798int zpci_enable_device(struct zpci_dev *zdev) 818int zpci_enable_device(struct zpci_dev *zdev)
799{ 819{
800 int rc; 820 int rc;
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 84147984224a..c747394029ee 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -155,9 +155,9 @@ int clp_add_pci_device(u32 fid, u32 fh, int configured)
155 int rc; 155 int rc;
156 156
157 zpci_dbg(3, "add fid:%x, fh:%x, c:%d\n", fid, fh, configured); 157 zpci_dbg(3, "add fid:%x, fh:%x, c:%d\n", fid, fh, configured);
158 zdev = zpci_alloc_device(); 158 zdev = kzalloc(sizeof(*zdev), GFP_KERNEL);
159 if (IS_ERR(zdev)) 159 if (!zdev)
160 return PTR_ERR(zdev); 160 return -ENOMEM;
161 161
162 zdev->fh = fh; 162 zdev->fh = fh;
163 zdev->fid = fid; 163 zdev->fid = fid;
@@ -178,7 +178,7 @@ int clp_add_pci_device(u32 fid, u32 fh, int configured)
178 return 0; 178 return 0;
179 179
180error: 180error:
181 zpci_free_device(zdev); 181 kfree(zdev);
182 return rc; 182 return rc;
183} 183}
184 184
diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
index 278e671ec9ac..800f064b0da7 100644
--- a/arch/s390/pci/pci_event.c
+++ b/arch/s390/pci/pci_event.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <asm/pci_debug.h> 13#include <asm/pci_debug.h>
14#include <asm/sclp.h>
14 15
15/* Content Code Description for PCI Function Error */ 16/* Content Code Description for PCI Function Error */
16struct zpci_ccdf_err { 17struct zpci_ccdf_err {
@@ -42,10 +43,27 @@ struct zpci_ccdf_avail {
42 u16 pec; /* PCI event code */ 43 u16 pec; /* PCI event code */
43} __packed; 44} __packed;
44 45
45static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf) 46void zpci_event_error(void *data)
46{ 47{
48 struct zpci_ccdf_err *ccdf = data;
49 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
50
51 zpci_err("error CCDF:\n");
52 zpci_err_hex(ccdf, sizeof(*ccdf));
53
54 if (!zdev)
55 return;
56
57 pr_err("%s: Event 0x%x reports an error for PCI function 0x%x\n",
58 pci_name(zdev->pdev), ccdf->pec, ccdf->fid);
59}
60
61void zpci_event_availability(void *data)
62{
63 struct zpci_ccdf_avail *ccdf = data;
47 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); 64 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
48 struct pci_dev *pdev = zdev ? zdev->pdev : NULL; 65 struct pci_dev *pdev = zdev ? zdev->pdev : NULL;
66 int ret;
49 67
50 pr_info("%s: Event 0x%x reconfigured PCI function 0x%x\n", 68 pr_info("%s: Event 0x%x reconfigured PCI function 0x%x\n",
51 pdev ? pci_name(pdev) : "n/a", ccdf->pec, ccdf->fid); 69 pdev ? pci_name(pdev) : "n/a", ccdf->pec, ccdf->fid);
@@ -53,36 +71,47 @@ static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf)
53 zpci_err_hex(ccdf, sizeof(*ccdf)); 71 zpci_err_hex(ccdf, sizeof(*ccdf));
54 72
55 switch (ccdf->pec) { 73 switch (ccdf->pec) {
56 case 0x0301: 74 case 0x0301: /* Standby -> Configured */
57 zpci_enable_device(zdev); 75 if (!zdev || zdev->state == ZPCI_FN_STATE_CONFIGURED)
76 break;
77 zdev->state = ZPCI_FN_STATE_CONFIGURED;
78 ret = zpci_enable_device(zdev);
79 if (ret)
80 break;
81 pci_rescan_bus(zdev->bus);
58 break; 82 break;
59 case 0x0302: 83 case 0x0302: /* Reserved -> Standby */
60 clp_add_pci_device(ccdf->fid, ccdf->fh, 0); 84 clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
61 break; 85 break;
62 case 0x0306: 86 case 0x0303: /* Deconfiguration requested */
87 if (pdev)
88 pci_stop_and_remove_bus_device(pdev);
89
90 ret = zpci_disable_device(zdev);
91 if (ret)
92 break;
93
94 ret = sclp_pci_deconfigure(zdev->fid);
95 zpci_dbg(3, "deconf fid:%x, rc:%d\n", zdev->fid, ret);
96 if (!ret)
97 zdev->state = ZPCI_FN_STATE_STANDBY;
98
99 break;
100 case 0x0304: /* Configured -> Standby */
101 if (pdev)
102 pci_stop_and_remove_bus_device(pdev);
103
104 zpci_disable_device(zdev);
105 zdev->state = ZPCI_FN_STATE_STANDBY;
106 break;
107 case 0x0306: /* 0x308 or 0x302 for multiple devices */
63 clp_rescan_pci_devices(); 108 clp_rescan_pci_devices();
64 break; 109 break;
110 case 0x0308: /* Standby -> Reserved */
111 pci_stop_root_bus(zdev->bus);
112 pci_remove_root_bus(zdev->bus);
113 break;
65 default: 114 default:
66 break; 115 break;
67 } 116 }
68} 117}
69
70void zpci_event_error(void *data)
71{
72 struct zpci_ccdf_err *ccdf = data;
73 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
74
75 zpci_err("error CCDF:\n");
76 zpci_err_hex(ccdf, sizeof(*ccdf));
77
78 if (!zdev)
79 return;
80
81 pr_err("%s: Event 0x%x reports an error for PCI function 0x%x\n",
82 pci_name(zdev->pdev), ccdf->pec, ccdf->fid);
83}
84
85void zpci_event_availability(void *data)
86{
87 zpci_event_log_avail(data);
88}
diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h
index 1425cc034872..656b7ada9326 100644
--- a/arch/score/include/asm/thread_info.h
+++ b/arch/score/include/asm/thread_info.h
@@ -72,8 +72,6 @@ register struct thread_info *__current_thread_info __asm__("r28");
72 72
73#endif /* !__ASSEMBLY__ */ 73#endif /* !__ASSEMBLY__ */
74 74
75#define PREEMPT_ACTIVE 0x10000000
76
77/* 75/*
78 * thread information flags 76 * thread information flags
79 * - these are process state flags that various assembly files may need to 77 * - these are process state flags that various assembly files may need to
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index e78561bc30ef..9b0979f4df7a 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -1,5 +1,6 @@
1config SUPERH 1config SUPERH
2 def_bool y 2 def_bool y
3 select ARCH_MIGHT_HAVE_PC_PARPORT
3 select EXPERT 4 select EXPERT
4 select CLKDEV_LOOKUP 5 select CLKDEV_LOOKUP
5 select HAVE_IDE if HAS_IOPORT 6 select HAVE_IDE if HAS_IOPORT
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 1fa8be409771..122f737a901f 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -15,6 +15,7 @@
15#include <linux/mmc/sh_mmcif.h> 15#include <linux/mmc/sh_mmcif.h>
16#include <linux/mmc/sh_mobile_sdhi.h> 16#include <linux/mmc/sh_mobile_sdhi.h>
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/mfd/tmio.h>
18#include <linux/gpio.h> 19#include <linux/gpio.h>
19#include <linux/interrupt.h> 20#include <linux/interrupt.h>
20#include <linux/io.h> 21#include <linux/io.h>
diff --git a/arch/sh/include/asm/mmu_context.h b/arch/sh/include/asm/mmu_context.h
index 21c5088788da..b9d9489a5012 100644
--- a/arch/sh/include/asm/mmu_context.h
+++ b/arch/sh/include/asm/mmu_context.h
@@ -81,7 +81,7 @@ static inline void get_mmu_context(struct mm_struct *mm, unsigned int cpu)
81 81
82 /* 82 /*
83 * Fix version; Note that we avoid version #0 83 * Fix version; Note that we avoid version #0
84 * to distingush NO_CONTEXT. 84 * to distinguish NO_CONTEXT.
85 */ 85 */
86 if (!asid) 86 if (!asid)
87 asid = MMU_CONTEXT_FIRST_VERSION; 87 asid = MMU_CONTEXT_FIRST_VERSION;
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index 45a93669289d..ad27ffa65e2e 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -41,8 +41,6 @@ struct thread_info {
41 41
42#endif 42#endif
43 43
44#define PREEMPT_ACTIVE 0x10000000
45
46#if defined(CONFIG_4KSTACKS) 44#if defined(CONFIG_4KSTACKS)
47#define THREAD_SHIFT 12 45#define THREAD_SHIFT 12
48#else 46#else
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index 9b6e4beeb296..ca46834294b7 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -108,7 +108,7 @@ need_resched:
108 and #(0xf0>>1), r0 ! interrupts off (exception path)? 108 and #(0xf0>>1), r0 ! interrupts off (exception path)?
109 cmp/eq #(0xf0>>1), r0 109 cmp/eq #(0xf0>>1), r0
110 bt noresched 110 bt noresched
111 mov.l 3f, r0 111 mov.l 1f, r0
112 jsr @r0 ! call preempt_schedule_irq 112 jsr @r0 ! call preempt_schedule_irq
113 nop 113 nop
114 bra need_resched 114 bra need_resched
@@ -119,9 +119,7 @@ noresched:
119 nop 119 nop
120 120
121 .align 2 121 .align 2
1221: .long PREEMPT_ACTIVE 1221: .long preempt_schedule_irq
1232: .long schedule
1243: .long preempt_schedule_irq
125#endif 123#endif
126 124
127ENTRY(resume_userspace) 125ENTRY(resume_userspace)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 8591b201d9cc..d4f7a6a163dc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -12,6 +12,7 @@ config 64BIT
12config SPARC 12config SPARC
13 bool 13 bool
14 default y 14 default y
15 select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
15 select OF 16 select OF
16 select OF_PROMTREE 17 select OF_PROMTREE
17 select HAVE_IDE 18 select HAVE_IDE
@@ -63,6 +64,7 @@ config SPARC64
63 select HAVE_DYNAMIC_FTRACE 64 select HAVE_DYNAMIC_FTRACE
64 select HAVE_FTRACE_MCOUNT_RECORD 65 select HAVE_FTRACE_MCOUNT_RECORD
65 select HAVE_SYSCALL_TRACEPOINTS 66 select HAVE_SYSCALL_TRACEPOINTS
67 select HAVE_CONTEXT_TRACKING
66 select HAVE_DEBUG_KMEMLEAK 68 select HAVE_DEBUG_KMEMLEAK
67 select RTC_DRV_CMOS 69 select RTC_DRV_CMOS
68 select RTC_DRV_BQ4802 70 select RTC_DRV_BQ4802
diff --git a/arch/sparc/include/asm/hardirq_32.h b/arch/sparc/include/asm/hardirq_32.h
index 162007643cdc..ee93923b7f82 100644
--- a/arch/sparc/include/asm/hardirq_32.h
+++ b/arch/sparc/include/asm/hardirq_32.h
@@ -7,7 +7,6 @@
7#ifndef __SPARC_HARDIRQ_H 7#ifndef __SPARC_HARDIRQ_H
8#define __SPARC_HARDIRQ_H 8#define __SPARC_HARDIRQ_H
9 9
10#define HARDIRQ_BITS 8
11#include <asm-generic/hardirq.h> 10#include <asm-generic/hardirq.h>
12 11
13#endif /* __SPARC_HARDIRQ_H */ 12#endif /* __SPARC_HARDIRQ_H */
diff --git a/arch/sparc/include/asm/hardirq_64.h b/arch/sparc/include/asm/hardirq_64.h
index 7c29fd1a87aa..f478ff1ddd02 100644
--- a/arch/sparc/include/asm/hardirq_64.h
+++ b/arch/sparc/include/asm/hardirq_64.h
@@ -14,6 +14,4 @@
14 14
15void ack_bad_irq(unsigned int irq); 15void ack_bad_irq(unsigned int irq);
16 16
17#define HARDIRQ_BITS 8
18
19#endif /* !(__SPARC64_HARDIRQ_H) */ 17#endif /* !(__SPARC64_HARDIRQ_H) */
diff --git a/arch/sparc/include/asm/mmu_64.h b/arch/sparc/include/asm/mmu_64.h
index 76092c4dd277..f668797ae234 100644
--- a/arch/sparc/include/asm/mmu_64.h
+++ b/arch/sparc/include/asm/mmu_64.h
@@ -93,7 +93,6 @@ typedef struct {
93 spinlock_t lock; 93 spinlock_t lock;
94 unsigned long sparc64_ctx_val; 94 unsigned long sparc64_ctx_val;
95 unsigned long huge_pte_count; 95 unsigned long huge_pte_count;
96 struct page *pgtable_page;
97 struct tsb_config tsb_block[MM_NUM_TSBS]; 96 struct tsb_config tsb_block[MM_NUM_TSBS];
98 struct hv_tsb_descr tsb_descr[MM_NUM_TSBS]; 97 struct hv_tsb_descr tsb_descr[MM_NUM_TSBS];
99} mm_context_t; 98} mm_context_t;
diff --git a/arch/sparc/include/asm/page_64.h b/arch/sparc/include/asm/page_64.h
index e15538899f3d..aac53fcea807 100644
--- a/arch/sparc/include/asm/page_64.h
+++ b/arch/sparc/include/asm/page_64.h
@@ -15,7 +15,10 @@
15#define DCACHE_ALIASING_POSSIBLE 15#define DCACHE_ALIASING_POSSIBLE
16#endif 16#endif
17 17
18#define HPAGE_SHIFT 22 18#define HPAGE_SHIFT 23
19#define REAL_HPAGE_SHIFT 22
20
21#define REAL_HPAGE_SIZE (_AC(1,UL) << REAL_HPAGE_SHIFT)
19 22
20#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE) 23#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
21#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) 24#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
@@ -53,8 +56,8 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct pag
53/* These are used to make use of C type-checking.. */ 56/* These are used to make use of C type-checking.. */
54typedef struct { unsigned long pte; } pte_t; 57typedef struct { unsigned long pte; } pte_t;
55typedef struct { unsigned long iopte; } iopte_t; 58typedef struct { unsigned long iopte; } iopte_t;
56typedef struct { unsigned int pmd; } pmd_t; 59typedef struct { unsigned long pmd; } pmd_t;
57typedef struct { unsigned int pgd; } pgd_t; 60typedef struct { unsigned long pgd; } pgd_t;
58typedef struct { unsigned long pgprot; } pgprot_t; 61typedef struct { unsigned long pgprot; } pgprot_t;
59 62
60#define pte_val(x) ((x).pte) 63#define pte_val(x) ((x).pte)
@@ -73,8 +76,8 @@ typedef struct { unsigned long pgprot; } pgprot_t;
73/* .. while these make it easier on the compiler */ 76/* .. while these make it easier on the compiler */
74typedef unsigned long pte_t; 77typedef unsigned long pte_t;
75typedef unsigned long iopte_t; 78typedef unsigned long iopte_t;
76typedef unsigned int pmd_t; 79typedef unsigned long pmd_t;
77typedef unsigned int pgd_t; 80typedef unsigned long pgd_t;
78typedef unsigned long pgprot_t; 81typedef unsigned long pgprot_t;
79 82
80#define pte_val(x) (x) 83#define pte_val(x) (x)
@@ -93,18 +96,44 @@ typedef unsigned long pgprot_t;
93 96
94typedef pte_t *pgtable_t; 97typedef pte_t *pgtable_t;
95 98
99/* These two values define the virtual address space range in which we
100 * must forbid 64-bit user processes from making mappings. It used to
101 * represent precisely the virtual address space hole present in most
102 * early sparc64 chips including UltraSPARC-I. But now it also is
103 * further constrained by the limits of our page tables, which is
104 * 43-bits of virtual address.
105 */
106#define SPARC64_VA_HOLE_TOP _AC(0xfffffc0000000000,UL)
107#define SPARC64_VA_HOLE_BOTTOM _AC(0x0000040000000000,UL)
108
109/* The next two defines specify the actual exclusion region we
110 * enforce, wherein we use a 4GB red zone on each side of the VA hole.
111 */
112#define VA_EXCLUDE_START (SPARC64_VA_HOLE_BOTTOM - (1UL << 32UL))
113#define VA_EXCLUDE_END (SPARC64_VA_HOLE_TOP + (1UL << 32UL))
114
96#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ 115#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \
97 (_AC(0x0000000070000000,UL)) : \ 116 _AC(0x0000000070000000,UL) : \
98 (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) 117 VA_EXCLUDE_END)
99 118
100#include <asm-generic/memory_model.h> 119#include <asm-generic/memory_model.h>
101 120
121#define PAGE_OFFSET_BY_BITS(X) (-(_AC(1,UL) << (X)))
122extern unsigned long PAGE_OFFSET;
123
102#endif /* !(__ASSEMBLY__) */ 124#endif /* !(__ASSEMBLY__) */
103 125
104/* We used to stick this into a hard-coded global register (%g4) 126/* The maximum number of physical memory address bits we support, this
105 * but that does not make sense anymore. 127 * is used to size various tables used to manage kernel TLB misses and
128 * also the sparsemem code.
129 */
130#define MAX_PHYS_ADDRESS_BITS 47
131
132/* These two shift counts are used when indexing sparc64_valid_addr_bitmap
133 * and kpte_linear_bitmap.
106 */ 134 */
107#define PAGE_OFFSET _AC(0xFFFFF80000000000,UL) 135#define ILOG2_4MB 22
136#define ILOG2_256MB 28
108 137
109#ifndef __ASSEMBLY__ 138#ifndef __ASSEMBLY__
110 139
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index 36760317814f..8358dc144959 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -48,18 +48,18 @@
48/* PMD_SHIFT determines the size of the area a second-level page 48/* PMD_SHIFT determines the size of the area a second-level page
49 * table can map 49 * table can map
50 */ 50 */
51#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-4)) 51#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3))
52#define PMD_SIZE (_AC(1,UL) << PMD_SHIFT) 52#define PMD_SIZE (_AC(1,UL) << PMD_SHIFT)
53#define PMD_MASK (~(PMD_SIZE-1)) 53#define PMD_MASK (~(PMD_SIZE-1))
54#define PMD_BITS (PAGE_SHIFT - 2) 54#define PMD_BITS (PAGE_SHIFT - 3)
55 55
56/* PGDIR_SHIFT determines what a third-level page table entry can map */ 56/* PGDIR_SHIFT determines what a third-level page table entry can map */
57#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-4) + PMD_BITS) 57#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS)
58#define PGDIR_SIZE (_AC(1,UL) << PGDIR_SHIFT) 58#define PGDIR_SIZE (_AC(1,UL) << PGDIR_SHIFT)
59#define PGDIR_MASK (~(PGDIR_SIZE-1)) 59#define PGDIR_MASK (~(PGDIR_SIZE-1))
60#define PGDIR_BITS (PAGE_SHIFT - 2) 60#define PGDIR_BITS (PAGE_SHIFT - 3)
61 61
62#if (PGDIR_SHIFT + PGDIR_BITS) != 44 62#if (PGDIR_SHIFT + PGDIR_BITS) != 43
63#error Page table parameters do not cover virtual address space properly. 63#error Page table parameters do not cover virtual address space properly.
64#endif 64#endif
65 65
@@ -67,35 +67,12 @@
67#error PMD_SHIFT must equal HPAGE_SHIFT for transparent huge pages. 67#error PMD_SHIFT must equal HPAGE_SHIFT for transparent huge pages.
68#endif 68#endif
69 69
70/* PMDs point to PTE tables which are 4K aligned. */
71#define PMD_PADDR _AC(0xfffffffe,UL)
72#define PMD_PADDR_SHIFT _AC(11,UL)
73
74#define PMD_ISHUGE _AC(0x00000001,UL)
75
76/* This is the PMD layout when PMD_ISHUGE is set. With 4MB huge
77 * pages, this frees up a bunch of bits in the layout that we can
78 * use for the protection settings and software metadata.
79 */
80#define PMD_HUGE_PADDR _AC(0xfffff800,UL)
81#define PMD_HUGE_PROTBITS _AC(0x000007ff,UL)
82#define PMD_HUGE_PRESENT _AC(0x00000400,UL)
83#define PMD_HUGE_WRITE _AC(0x00000200,UL)
84#define PMD_HUGE_DIRTY _AC(0x00000100,UL)
85#define PMD_HUGE_ACCESSED _AC(0x00000080,UL)
86#define PMD_HUGE_EXEC _AC(0x00000040,UL)
87#define PMD_HUGE_SPLITTING _AC(0x00000020,UL)
88
89/* PGDs point to PMD tables which are 8K aligned. */
90#define PGD_PADDR _AC(0xfffffffc,UL)
91#define PGD_PADDR_SHIFT _AC(11,UL)
92
93#ifndef __ASSEMBLY__ 70#ifndef __ASSEMBLY__
94 71
95#include <linux/sched.h> 72#include <linux/sched.h>
96 73
97/* Entries per page directory level. */ 74/* Entries per page directory level. */
98#define PTRS_PER_PTE (1UL << (PAGE_SHIFT-4)) 75#define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3))
99#define PTRS_PER_PMD (1UL << PMD_BITS) 76#define PTRS_PER_PMD (1UL << PMD_BITS)
100#define PTRS_PER_PGD (1UL << PGDIR_BITS) 77#define PTRS_PER_PGD (1UL << PGDIR_BITS)
101 78
@@ -112,6 +89,7 @@
112#define _PAGE_VALID _AC(0x8000000000000000,UL) /* Valid TTE */ 89#define _PAGE_VALID _AC(0x8000000000000000,UL) /* Valid TTE */
113#define _PAGE_R _AC(0x8000000000000000,UL) /* Keep ref bit uptodate*/ 90#define _PAGE_R _AC(0x8000000000000000,UL) /* Keep ref bit uptodate*/
114#define _PAGE_SPECIAL _AC(0x0200000000000000,UL) /* Special page */ 91#define _PAGE_SPECIAL _AC(0x0200000000000000,UL) /* Special page */
92#define _PAGE_PMD_HUGE _AC(0x0100000000000000,UL) /* Huge page */
115 93
116/* Advertise support for _PAGE_SPECIAL */ 94/* Advertise support for _PAGE_SPECIAL */
117#define __HAVE_ARCH_PTE_SPECIAL 95#define __HAVE_ARCH_PTE_SPECIAL
@@ -125,6 +103,7 @@
125#define _PAGE_IE_4U _AC(0x0800000000000000,UL) /* Invert Endianness */ 103#define _PAGE_IE_4U _AC(0x0800000000000000,UL) /* Invert Endianness */
126#define _PAGE_SOFT2_4U _AC(0x07FC000000000000,UL) /* Software bits, set 2 */ 104#define _PAGE_SOFT2_4U _AC(0x07FC000000000000,UL) /* Software bits, set 2 */
127#define _PAGE_SPECIAL_4U _AC(0x0200000000000000,UL) /* Special page */ 105#define _PAGE_SPECIAL_4U _AC(0x0200000000000000,UL) /* Special page */
106#define _PAGE_PMD_HUGE_4U _AC(0x0100000000000000,UL) /* Huge page */
128#define _PAGE_RES1_4U _AC(0x0002000000000000,UL) /* Reserved */ 107#define _PAGE_RES1_4U _AC(0x0002000000000000,UL) /* Reserved */
129#define _PAGE_SZ32MB_4U _AC(0x0001000000000000,UL) /* (Panther) 32MB page */ 108#define _PAGE_SZ32MB_4U _AC(0x0001000000000000,UL) /* (Panther) 32MB page */
130#define _PAGE_SZ256MB_4U _AC(0x2001000000000000,UL) /* (Panther) 256MB page */ 109#define _PAGE_SZ256MB_4U _AC(0x2001000000000000,UL) /* (Panther) 256MB page */
@@ -155,6 +134,7 @@
155#define _PAGE_READ_4V _AC(0x0800000000000000,UL) /* Readable SW Bit */ 134#define _PAGE_READ_4V _AC(0x0800000000000000,UL) /* Readable SW Bit */
156#define _PAGE_WRITE_4V _AC(0x0400000000000000,UL) /* Writable SW Bit */ 135#define _PAGE_WRITE_4V _AC(0x0400000000000000,UL) /* Writable SW Bit */
157#define _PAGE_SPECIAL_4V _AC(0x0200000000000000,UL) /* Special page */ 136#define _PAGE_SPECIAL_4V _AC(0x0200000000000000,UL) /* Special page */
137#define _PAGE_PMD_HUGE_4V _AC(0x0100000000000000,UL) /* Huge page */
158#define _PAGE_PADDR_4V _AC(0x00FFFFFFFFFFE000,UL) /* paddr[55:13] */ 138#define _PAGE_PADDR_4V _AC(0x00FFFFFFFFFFE000,UL) /* paddr[55:13] */
159#define _PAGE_IE_4V _AC(0x0000000000001000,UL) /* Invert Endianness */ 139#define _PAGE_IE_4V _AC(0x0000000000001000,UL) /* Invert Endianness */
160#define _PAGE_E_4V _AC(0x0000000000000800,UL) /* side-Effect */ 140#define _PAGE_E_4V _AC(0x0000000000000800,UL) /* side-Effect */
@@ -180,6 +160,10 @@
180#define _PAGE_SZBITS_4U _PAGE_SZ8K_4U 160#define _PAGE_SZBITS_4U _PAGE_SZ8K_4U
181#define _PAGE_SZBITS_4V _PAGE_SZ8K_4V 161#define _PAGE_SZBITS_4V _PAGE_SZ8K_4V
182 162
163#if REAL_HPAGE_SHIFT != 22
164#error REAL_HPAGE_SHIFT and _PAGE_SZHUGE_foo must match up
165#endif
166
183#define _PAGE_SZHUGE_4U _PAGE_SZ4MB_4U 167#define _PAGE_SZHUGE_4U _PAGE_SZ4MB_4U
184#define _PAGE_SZHUGE_4V _PAGE_SZ4MB_4V 168#define _PAGE_SZHUGE_4V _PAGE_SZ4MB_4V
185 169
@@ -239,16 +223,13 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
239#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) 223#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
240 224
241#ifdef CONFIG_TRANSPARENT_HUGEPAGE 225#ifdef CONFIG_TRANSPARENT_HUGEPAGE
242extern pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot); 226static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
243#define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot))
244
245extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
246
247static inline pmd_t pmd_mkhuge(pmd_t pmd)
248{ 227{
249 /* Do nothing, mk_pmd() does this part. */ 228 pte_t pte = pfn_pte(page_nr, pgprot);
250 return pmd; 229
230 return __pmd(pte_val(pte));
251} 231}
232#define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot))
252#endif 233#endif
253 234
254/* This one can be done with two shifts. */ 235/* This one can be done with two shifts. */
@@ -309,14 +290,25 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t prot)
309 : "=r" (mask), "=r" (tmp) 290 : "=r" (mask), "=r" (tmp)
310 : "i" (_PAGE_PADDR_4U | _PAGE_MODIFIED_4U | _PAGE_ACCESSED_4U | 291 : "i" (_PAGE_PADDR_4U | _PAGE_MODIFIED_4U | _PAGE_ACCESSED_4U |
311 _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_E_4U | _PAGE_PRESENT_4U | 292 _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_E_4U | _PAGE_PRESENT_4U |
312 _PAGE_SPECIAL), 293 _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4U),
313 "i" (_PAGE_PADDR_4V | _PAGE_MODIFIED_4V | _PAGE_ACCESSED_4V | 294 "i" (_PAGE_PADDR_4V | _PAGE_MODIFIED_4V | _PAGE_ACCESSED_4V |
314 _PAGE_CP_4V | _PAGE_CV_4V | _PAGE_E_4V | _PAGE_PRESENT_4V | 295 _PAGE_CP_4V | _PAGE_CV_4V | _PAGE_E_4V | _PAGE_PRESENT_4V |
315 _PAGE_SPECIAL)); 296 _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4V));
316 297
317 return __pte((pte_val(pte) & mask) | (pgprot_val(prot) & ~mask)); 298 return __pte((pte_val(pte) & mask) | (pgprot_val(prot) & ~mask));
318} 299}
319 300
301#ifdef CONFIG_TRANSPARENT_HUGEPAGE
302static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
303{
304 pte_t pte = __pte(pmd_val(pmd));
305
306 pte = pte_modify(pte, newprot);
307
308 return __pmd(pte_val(pte));
309}
310#endif
311
320static inline pte_t pgoff_to_pte(unsigned long off) 312static inline pte_t pgoff_to_pte(unsigned long off)
321{ 313{
322 off <<= PAGE_SHIFT; 314 off <<= PAGE_SHIFT;
@@ -357,7 +349,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)
357 */ 349 */
358#define pgprot_noncached pgprot_noncached 350#define pgprot_noncached pgprot_noncached
359 351
360#ifdef CONFIG_HUGETLB_PAGE 352#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
361static inline pte_t pte_mkhuge(pte_t pte) 353static inline pte_t pte_mkhuge(pte_t pte)
362{ 354{
363 unsigned long mask; 355 unsigned long mask;
@@ -375,6 +367,17 @@ static inline pte_t pte_mkhuge(pte_t pte)
375 367
376 return __pte(pte_val(pte) | mask); 368 return __pte(pte_val(pte) | mask);
377} 369}
370#ifdef CONFIG_TRANSPARENT_HUGEPAGE
371static inline pmd_t pmd_mkhuge(pmd_t pmd)
372{
373 pte_t pte = __pte(pmd_val(pmd));
374
375 pte = pte_mkhuge(pte);
376 pte_val(pte) |= _PAGE_PMD_HUGE;
377
378 return __pmd(pte_val(pte));
379}
380#endif
378#endif 381#endif
379 382
380static inline pte_t pte_mkdirty(pte_t pte) 383static inline pte_t pte_mkdirty(pte_t pte)
@@ -626,91 +629,130 @@ static inline unsigned long pte_special(pte_t pte)
626 return pte_val(pte) & _PAGE_SPECIAL; 629 return pte_val(pte) & _PAGE_SPECIAL;
627} 630}
628 631
629static inline int pmd_large(pmd_t pmd) 632static inline unsigned long pmd_large(pmd_t pmd)
630{ 633{
631 return (pmd_val(pmd) & (PMD_ISHUGE | PMD_HUGE_PRESENT)) == 634 pte_t pte = __pte(pmd_val(pmd));
632 (PMD_ISHUGE | PMD_HUGE_PRESENT); 635
636 return (pte_val(pte) & _PAGE_PMD_HUGE) && pte_present(pte);
633} 637}
634 638
635#ifdef CONFIG_TRANSPARENT_HUGEPAGE 639#ifdef CONFIG_TRANSPARENT_HUGEPAGE
636static inline int pmd_young(pmd_t pmd) 640static inline unsigned long pmd_young(pmd_t pmd)
637{ 641{
638 return pmd_val(pmd) & PMD_HUGE_ACCESSED; 642 pte_t pte = __pte(pmd_val(pmd));
643
644 return pte_young(pte);
639} 645}
640 646
641static inline int pmd_write(pmd_t pmd) 647static inline unsigned long pmd_write(pmd_t pmd)
642{ 648{
643 return pmd_val(pmd) & PMD_HUGE_WRITE; 649 pte_t pte = __pte(pmd_val(pmd));
650
651 return pte_write(pte);
644} 652}
645 653
646static inline unsigned long pmd_pfn(pmd_t pmd) 654static inline unsigned long pmd_pfn(pmd_t pmd)
647{ 655{
648 unsigned long val = pmd_val(pmd) & PMD_HUGE_PADDR; 656 pte_t pte = __pte(pmd_val(pmd));
649 657
650 return val >> (PAGE_SHIFT - PMD_PADDR_SHIFT); 658 return pte_pfn(pte);
651} 659}
652 660
653static inline int pmd_trans_splitting(pmd_t pmd) 661static inline unsigned long pmd_trans_huge(pmd_t pmd)
654{ 662{
655 return (pmd_val(pmd) & (PMD_ISHUGE|PMD_HUGE_SPLITTING)) == 663 pte_t pte = __pte(pmd_val(pmd));
656 (PMD_ISHUGE|PMD_HUGE_SPLITTING); 664
665 return pte_val(pte) & _PAGE_PMD_HUGE;
657} 666}
658 667
659static inline int pmd_trans_huge(pmd_t pmd) 668static inline unsigned long pmd_trans_splitting(pmd_t pmd)
660{ 669{
661 return pmd_val(pmd) & PMD_ISHUGE; 670 pte_t pte = __pte(pmd_val(pmd));
671
672 return pmd_trans_huge(pmd) && pte_special(pte);
662} 673}
663 674
664#define has_transparent_hugepage() 1 675#define has_transparent_hugepage() 1
665 676
666static inline pmd_t pmd_mkold(pmd_t pmd) 677static inline pmd_t pmd_mkold(pmd_t pmd)
667{ 678{
668 pmd_val(pmd) &= ~PMD_HUGE_ACCESSED; 679 pte_t pte = __pte(pmd_val(pmd));
669 return pmd; 680
681 pte = pte_mkold(pte);
682
683 return __pmd(pte_val(pte));
670} 684}
671 685
672static inline pmd_t pmd_wrprotect(pmd_t pmd) 686static inline pmd_t pmd_wrprotect(pmd_t pmd)
673{ 687{
674 pmd_val(pmd) &= ~PMD_HUGE_WRITE; 688 pte_t pte = __pte(pmd_val(pmd));
675 return pmd; 689
690 pte = pte_wrprotect(pte);
691
692 return __pmd(pte_val(pte));
676} 693}
677 694
678static inline pmd_t pmd_mkdirty(pmd_t pmd) 695static inline pmd_t pmd_mkdirty(pmd_t pmd)
679{ 696{
680 pmd_val(pmd) |= PMD_HUGE_DIRTY; 697 pte_t pte = __pte(pmd_val(pmd));
681 return pmd; 698
699 pte = pte_mkdirty(pte);
700
701 return __pmd(pte_val(pte));
682} 702}
683 703
684static inline pmd_t pmd_mkyoung(pmd_t pmd) 704static inline pmd_t pmd_mkyoung(pmd_t pmd)
685{ 705{
686 pmd_val(pmd) |= PMD_HUGE_ACCESSED; 706 pte_t pte = __pte(pmd_val(pmd));
687 return pmd; 707
708 pte = pte_mkyoung(pte);
709
710 return __pmd(pte_val(pte));
688} 711}
689 712
690static inline pmd_t pmd_mkwrite(pmd_t pmd) 713static inline pmd_t pmd_mkwrite(pmd_t pmd)
691{ 714{
692 pmd_val(pmd) |= PMD_HUGE_WRITE; 715 pte_t pte = __pte(pmd_val(pmd));
693 return pmd; 716
717 pte = pte_mkwrite(pte);
718
719 return __pmd(pte_val(pte));
694} 720}
695 721
696static inline pmd_t pmd_mknotpresent(pmd_t pmd) 722static inline pmd_t pmd_mknotpresent(pmd_t pmd)
697{ 723{
698 pmd_val(pmd) &= ~PMD_HUGE_PRESENT; 724 unsigned long mask;
725
726 if (tlb_type == hypervisor)
727 mask = _PAGE_PRESENT_4V;
728 else
729 mask = _PAGE_PRESENT_4U;
730
731 pmd_val(pmd) &= ~mask;
732
699 return pmd; 733 return pmd;
700} 734}
701 735
702static inline pmd_t pmd_mksplitting(pmd_t pmd) 736static inline pmd_t pmd_mksplitting(pmd_t pmd)
703{ 737{
704 pmd_val(pmd) |= PMD_HUGE_SPLITTING; 738 pte_t pte = __pte(pmd_val(pmd));
705 return pmd; 739
740 pte = pte_mkspecial(pte);
741
742 return __pmd(pte_val(pte));
706} 743}
707 744
708extern pgprot_t pmd_pgprot(pmd_t entry); 745static inline pgprot_t pmd_pgprot(pmd_t entry)
746{
747 unsigned long val = pmd_val(entry);
748
749 return __pgprot(val);
750}
709#endif 751#endif
710 752
711static inline int pmd_present(pmd_t pmd) 753static inline int pmd_present(pmd_t pmd)
712{ 754{
713 return pmd_val(pmd) != 0U; 755 return pmd_val(pmd) != 0UL;
714} 756}
715 757
716#define pmd_none(pmd) (!pmd_val(pmd)) 758#define pmd_none(pmd) (!pmd_val(pmd))
@@ -728,33 +770,32 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
728 770
729static inline void pmd_set(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) 771static inline void pmd_set(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
730{ 772{
731 unsigned long val = __pa((unsigned long) (ptep)) >> PMD_PADDR_SHIFT; 773 unsigned long val = __pa((unsigned long) (ptep));
732 774
733 pmd_val(*pmdp) = val; 775 pmd_val(*pmdp) = val;
734} 776}
735 777
736#define pud_set(pudp, pmdp) \ 778#define pud_set(pudp, pmdp) \
737 (pud_val(*(pudp)) = (__pa((unsigned long) (pmdp)) >> PGD_PADDR_SHIFT)) 779 (pud_val(*(pudp)) = (__pa((unsigned long) (pmdp))))
738static inline unsigned long __pmd_page(pmd_t pmd) 780static inline unsigned long __pmd_page(pmd_t pmd)
739{ 781{
740 unsigned long paddr = (unsigned long) pmd_val(pmd); 782 pte_t pte = __pte(pmd_val(pmd));
741#ifdef CONFIG_TRANSPARENT_HUGEPAGE 783 unsigned long pfn;
742 if (pmd_val(pmd) & PMD_ISHUGE) 784
743 paddr &= PMD_HUGE_PADDR; 785 pfn = pte_pfn(pte);
744#endif 786
745 paddr <<= PMD_PADDR_SHIFT; 787 return ((unsigned long) __va(pfn << PAGE_SHIFT));
746 return ((unsigned long) __va(paddr));
747} 788}
748#define pmd_page(pmd) virt_to_page((void *)__pmd_page(pmd)) 789#define pmd_page(pmd) virt_to_page((void *)__pmd_page(pmd))
749#define pud_page_vaddr(pud) \ 790#define pud_page_vaddr(pud) \
750 ((unsigned long) __va((((unsigned long)pud_val(pud))<<PGD_PADDR_SHIFT))) 791 ((unsigned long) __va(pud_val(pud)))
751#define pud_page(pud) virt_to_page((void *)pud_page_vaddr(pud)) 792#define pud_page(pud) virt_to_page((void *)pud_page_vaddr(pud))
752#define pmd_bad(pmd) (0) 793#define pmd_bad(pmd) (0)
753#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0U) 794#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0UL)
754#define pud_none(pud) (!pud_val(pud)) 795#define pud_none(pud) (!pud_val(pud))
755#define pud_bad(pud) (0) 796#define pud_bad(pud) (0)
756#define pud_present(pud) (pud_val(pud) != 0U) 797#define pud_present(pud) (pud_val(pud) != 0U)
757#define pud_clear(pudp) (pud_val(*(pudp)) = 0U) 798#define pud_clear(pudp) (pud_val(*(pudp)) = 0UL)
758 799
759/* Same in both SUN4V and SUN4U. */ 800/* Same in both SUN4V and SUN4U. */
760#define pte_none(pte) (!pte_val(pte)) 801#define pte_none(pte) (!pte_val(pte))
@@ -789,7 +830,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
789 pmd_t *pmdp) 830 pmd_t *pmdp)
790{ 831{
791 pmd_t pmd = *pmdp; 832 pmd_t pmd = *pmdp;
792 set_pmd_at(mm, addr, pmdp, __pmd(0U)); 833 set_pmd_at(mm, addr, pmdp, __pmd(0UL));
793 return pmd; 834 return pmd;
794} 835}
795 836
@@ -837,8 +878,8 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
837}) 878})
838#endif 879#endif
839 880
840extern pgd_t swapper_pg_dir[2048]; 881extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
841extern pmd_t swapper_low_pmd_dir[2048]; 882extern pmd_t swapper_low_pmd_dir[PTRS_PER_PMD];
842 883
843extern void paging_init(void); 884extern void paging_init(void);
844extern unsigned long find_ecache_flush_span(unsigned long size); 885extern unsigned long find_ecache_flush_span(unsigned long size);
diff --git a/arch/sparc/include/asm/sparsemem.h b/arch/sparc/include/asm/sparsemem.h
index b99d4e4b6d28..e5e1752d5d78 100644
--- a/arch/sparc/include/asm/sparsemem.h
+++ b/arch/sparc/include/asm/sparsemem.h
@@ -3,9 +3,11 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <asm/page.h>
7
6#define SECTION_SIZE_BITS 30 8#define SECTION_SIZE_BITS 30
7#define MAX_PHYSADDR_BITS 42 9#define MAX_PHYSADDR_BITS MAX_PHYS_ADDRESS_BITS
8#define MAX_PHYSMEM_BITS 42 10#define MAX_PHYSMEM_BITS MAX_PHYS_ADDRESS_BITS
9 11
10#endif /* !(__KERNEL__) */ 12#endif /* !(__KERNEL__) */
11 13
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index dd3807599bb9..96efa7adc223 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -105,8 +105,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
105#define TI_W_SAVED 0x250 105#define TI_W_SAVED 0x250
106/* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */ 106/* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */
107 107
108#define PREEMPT_ACTIVE 0x4000000
109
110/* 108/*
111 * thread information flag bit numbers 109 * thread information flag bit numbers
112 */ 110 */
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index d5e504251079..a5f01ac6d0f1 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -111,8 +111,6 @@ struct thread_info {
111#define THREAD_SHIFT PAGE_SHIFT 111#define THREAD_SHIFT PAGE_SHIFT
112#endif /* PAGE_SHIFT == 13 */ 112#endif /* PAGE_SHIFT == 13 */
113 113
114#define PREEMPT_ACTIVE 0x10000000
115
116/* 114/*
117 * macros/functions for gaining access to the thread information structure 115 * macros/functions for gaining access to the thread information structure
118 */ 116 */
@@ -192,7 +190,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
192#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ 190#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */
193/* flag bit 6 is available */ 191/* flag bit 6 is available */
194#define TIF_32BIT 7 /* 32-bit binary */ 192#define TIF_32BIT 7 /* 32-bit binary */
195/* flag bit 8 is available */ 193#define TIF_NOHZ 8 /* in adaptive nohz mode */
196#define TIF_SECCOMP 9 /* secure computing */ 194#define TIF_SECCOMP 9 /* secure computing */
197#define TIF_SYSCALL_AUDIT 10 /* syscall auditing active */ 195#define TIF_SYSCALL_AUDIT 10 /* syscall auditing active */
198#define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint instrumentation */ 196#define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint instrumentation */
@@ -210,6 +208,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
210#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 208#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
211#define _TIF_UNALIGNED (1<<TIF_UNALIGNED) 209#define _TIF_UNALIGNED (1<<TIF_UNALIGNED)
212#define _TIF_32BIT (1<<TIF_32BIT) 210#define _TIF_32BIT (1<<TIF_32BIT)
211#define _TIF_NOHZ (1<<TIF_NOHZ)
213#define _TIF_SECCOMP (1<<TIF_SECCOMP) 212#define _TIF_SECCOMP (1<<TIF_SECCOMP)
214#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 213#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
215#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) 214#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
diff --git a/arch/sparc/include/asm/tlbflush_64.h b/arch/sparc/include/asm/tlbflush_64.h
index f0d6a9700f4c..3c3c89f52643 100644
--- a/arch/sparc/include/asm/tlbflush_64.h
+++ b/arch/sparc/include/asm/tlbflush_64.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC64_TLBFLUSH_H 1#ifndef _SPARC64_TLBFLUSH_H
2#define _SPARC64_TLBFLUSH_H 2#define _SPARC64_TLBFLUSH_H
3 3
4#include <linux/mm.h>
5#include <asm/mmu_context.h> 4#include <asm/mmu_context.h>
6 5
7/* TSB flush operations. */ 6/* TSB flush operations. */
diff --git a/arch/sparc/include/asm/tsb.h b/arch/sparc/include/asm/tsb.h
index e696432b950d..2230f80d9fe3 100644
--- a/arch/sparc/include/asm/tsb.h
+++ b/arch/sparc/include/asm/tsb.h
@@ -142,98 +142,39 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;
142 or REG1, %lo(swapper_pg_dir), REG1; \ 142 or REG1, %lo(swapper_pg_dir), REG1; \
143 sllx VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \ 143 sllx VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \
144 srlx REG2, 64 - PAGE_SHIFT, REG2; \ 144 srlx REG2, 64 - PAGE_SHIFT, REG2; \
145 andn REG2, 0x3, REG2; \ 145 andn REG2, 0x7, REG2; \
146 lduw [REG1 + REG2], REG1; \ 146 ldx [REG1 + REG2], REG1; \
147 brz,pn REG1, FAIL_LABEL; \ 147 brz,pn REG1, FAIL_LABEL; \
148 sllx VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \ 148 sllx VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \
149 srlx REG2, 64 - PAGE_SHIFT, REG2; \ 149 srlx REG2, 64 - PAGE_SHIFT, REG2; \
150 sllx REG1, PGD_PADDR_SHIFT, REG1; \ 150 andn REG2, 0x7, REG2; \
151 andn REG2, 0x3, REG2; \ 151 ldxa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
152 lduwa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
153 brz,pn REG1, FAIL_LABEL; \ 152 brz,pn REG1, FAIL_LABEL; \
154 sllx VADDR, 64 - PMD_SHIFT, REG2; \ 153 sllx VADDR, 64 - PMD_SHIFT, REG2; \
155 srlx REG2, 64 - (PAGE_SHIFT - 1), REG2; \ 154 srlx REG2, 64 - PAGE_SHIFT, REG2; \
156 sllx REG1, PMD_PADDR_SHIFT, REG1; \
157 andn REG2, 0x7, REG2; \ 155 andn REG2, 0x7, REG2; \
158 add REG1, REG2, REG1; 156 add REG1, REG2, REG1;
159 157
160 /* These macros exists only to make the PMD translator below
161 * easier to read. It hides the ELF section switch for the
162 * sun4v code patching.
163 */
164#define OR_PTE_BIT_1INSN(REG, NAME) \
165661: or REG, _PAGE_##NAME##_4U, REG; \
166 .section .sun4v_1insn_patch, "ax"; \
167 .word 661b; \
168 or REG, _PAGE_##NAME##_4V, REG; \
169 .previous;
170
171#define OR_PTE_BIT_2INSN(REG, TMP, NAME) \
172661: sethi %hi(_PAGE_##NAME##_4U), TMP; \
173 or REG, TMP, REG; \
174 .section .sun4v_2insn_patch, "ax"; \
175 .word 661b; \
176 mov -1, TMP; \
177 or REG, _PAGE_##NAME##_4V, REG; \
178 .previous;
179
180 /* Load into REG the PTE value for VALID, CACHE, and SZHUGE. */
181#define BUILD_PTE_VALID_SZHUGE_CACHE(REG) \
182661: sethi %uhi(_PAGE_VALID|_PAGE_SZHUGE_4U), REG; \
183 .section .sun4v_1insn_patch, "ax"; \
184 .word 661b; \
185 sethi %uhi(_PAGE_VALID), REG; \
186 .previous; \
187 sllx REG, 32, REG; \
188661: or REG, _PAGE_CP_4U|_PAGE_CV_4U, REG; \
189 .section .sun4v_1insn_patch, "ax"; \
190 .word 661b; \
191 or REG, _PAGE_CP_4V|_PAGE_CV_4V|_PAGE_SZHUGE_4V, REG; \
192 .previous;
193
194 /* PMD has been loaded into REG1, interpret the value, seeing 158 /* PMD has been loaded into REG1, interpret the value, seeing
195 * if it is a HUGE PMD or a normal one. If it is not valid 159 * if it is a HUGE PMD or a normal one. If it is not valid
196 * then jump to FAIL_LABEL. If it is a HUGE PMD, and it 160 * then jump to FAIL_LABEL. If it is a HUGE PMD, and it
197 * translates to a valid PTE, branch to PTE_LABEL. 161 * translates to a valid PTE, branch to PTE_LABEL.
198 * 162 *
199 * We translate the PMD by hand, one bit at a time, 163 * We have to propagate the 4MB bit of the virtual address
200 * constructing the huge PTE. 164 * because we are fabricating 8MB pages using 4MB hw pages.
201 *
202 * So we construct the PTE in REG2 as follows:
203 *
204 * 1) Extract the PMD PFN from REG1 and place it into REG2.
205 *
206 * 2) Translate PMD protection bits in REG1 into REG2, one bit
207 * at a time using andcc tests on REG1 and OR's into REG2.
208 *
209 * Only two bits to be concerned with here, EXEC and WRITE.
210 * Now REG1 is freed up and we can use it as a temporary.
211 *
212 * 3) Construct the VALID, CACHE, and page size PTE bits in
213 * REG1, OR with REG2 to form final PTE.
214 */ 165 */
215#ifdef CONFIG_TRANSPARENT_HUGEPAGE 166#ifdef CONFIG_TRANSPARENT_HUGEPAGE
216#define USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, PTE_LABEL) \ 167#define USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, PTE_LABEL) \
217 brz,pn REG1, FAIL_LABEL; \ 168 brz,pn REG1, FAIL_LABEL; \
218 andcc REG1, PMD_ISHUGE, %g0; \ 169 sethi %uhi(_PAGE_PMD_HUGE), REG2; \
219 be,pt %xcc, 700f; \ 170 sllx REG2, 32, REG2; \
220 and REG1, PMD_HUGE_PRESENT|PMD_HUGE_ACCESSED, REG2; \ 171 andcc REG1, REG2, %g0; \
221 cmp REG2, PMD_HUGE_PRESENT|PMD_HUGE_ACCESSED; \ 172 be,pt %xcc, 700f; \
222 bne,pn %xcc, FAIL_LABEL; \ 173 sethi %hi(4 * 1024 * 1024), REG2; \
223 andn REG1, PMD_HUGE_PROTBITS, REG2; \ 174 andn REG1, REG2, REG1; \
224 sllx REG2, PMD_PADDR_SHIFT, REG2; \ 175 and VADDR, REG2, REG2; \
225 /* REG2 now holds PFN << PAGE_SHIFT */ \ 176 brlz,pt REG1, PTE_LABEL; \
226 andcc REG1, PMD_HUGE_WRITE, %g0; \ 177 or REG1, REG2, REG1; \
227 bne,a,pt %xcc, 1f; \
228 OR_PTE_BIT_1INSN(REG2, W); \
2291: andcc REG1, PMD_HUGE_EXEC, %g0; \
230 be,pt %xcc, 1f; \
231 nop; \
232 OR_PTE_BIT_2INSN(REG2, REG1, EXEC); \
233 /* REG1 can now be clobbered, build final PTE */ \
2341: BUILD_PTE_VALID_SZHUGE_CACHE(REG1); \
235 ba,pt %xcc, PTE_LABEL; \
236 or REG1, REG2, REG1; \
237700: 178700:
238#else 179#else
239#define USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, PTE_LABEL) \ 180#define USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, PTE_LABEL) \
@@ -253,18 +194,16 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;
253#define USER_PGTABLE_WALK_TL1(VADDR, PHYS_PGD, REG1, REG2, FAIL_LABEL) \ 194#define USER_PGTABLE_WALK_TL1(VADDR, PHYS_PGD, REG1, REG2, FAIL_LABEL) \
254 sllx VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \ 195 sllx VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \
255 srlx REG2, 64 - PAGE_SHIFT, REG2; \ 196 srlx REG2, 64 - PAGE_SHIFT, REG2; \
256 andn REG2, 0x3, REG2; \ 197 andn REG2, 0x7, REG2; \
257 lduwa [PHYS_PGD + REG2] ASI_PHYS_USE_EC, REG1; \ 198 ldxa [PHYS_PGD + REG2] ASI_PHYS_USE_EC, REG1; \
258 brz,pn REG1, FAIL_LABEL; \ 199 brz,pn REG1, FAIL_LABEL; \
259 sllx VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \ 200 sllx VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \
260 srlx REG2, 64 - PAGE_SHIFT, REG2; \ 201 srlx REG2, 64 - PAGE_SHIFT, REG2; \
261 sllx REG1, PGD_PADDR_SHIFT, REG1; \ 202 andn REG2, 0x7, REG2; \
262 andn REG2, 0x3, REG2; \ 203 ldxa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
263 lduwa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
264 USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, 800f) \ 204 USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, 800f) \
265 sllx VADDR, 64 - PMD_SHIFT, REG2; \ 205 sllx VADDR, 64 - PMD_SHIFT, REG2; \
266 srlx REG2, 64 - (PAGE_SHIFT - 1), REG2; \ 206 srlx REG2, 64 - PAGE_SHIFT, REG2; \
267 sllx REG1, PMD_PADDR_SHIFT, REG1; \
268 andn REG2, 0x7, REG2; \ 207 andn REG2, 0x7, REG2; \
269 add REG1, REG2, REG1; \ 208 add REG1, REG2, REG1; \
270 ldxa [REG1] ASI_PHYS_USE_EC, REG1; \ 209 ldxa [REG1] ASI_PHYS_USE_EC, REG1; \
diff --git a/arch/sparc/kernel/entry.h b/arch/sparc/kernel/entry.h
index 9c179fbfb219..140966fbd303 100644
--- a/arch/sparc/kernel/entry.h
+++ b/arch/sparc/kernel/entry.h
@@ -88,7 +88,6 @@ extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
88 88
89extern void bad_trap_tl1(struct pt_regs *regs, long lvl); 89extern void bad_trap_tl1(struct pt_regs *regs, long lvl);
90 90
91extern void do_fpe_common(struct pt_regs *regs);
92extern void do_fpieee(struct pt_regs *regs); 91extern void do_fpieee(struct pt_regs *regs);
93extern void do_fpother(struct pt_regs *regs); 92extern void do_fpother(struct pt_regs *regs);
94extern void do_tof(struct pt_regs *regs); 93extern void do_tof(struct pt_regs *regs);
diff --git a/arch/sparc/kernel/kgdb_64.c b/arch/sparc/kernel/kgdb_64.c
index 53c0a82e6030..60b19f50c80a 100644
--- a/arch/sparc/kernel/kgdb_64.c
+++ b/arch/sparc/kernel/kgdb_64.c
@@ -159,11 +159,12 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
159 159
160asmlinkage void kgdb_trap(unsigned long trap_level, struct pt_regs *regs) 160asmlinkage void kgdb_trap(unsigned long trap_level, struct pt_regs *regs)
161{ 161{
162 enum ctx_state prev_state = exception_enter();
162 unsigned long flags; 163 unsigned long flags;
163 164
164 if (user_mode(regs)) { 165 if (user_mode(regs)) {
165 bad_trap(regs, trap_level); 166 bad_trap(regs, trap_level);
166 return; 167 goto out;
167 } 168 }
168 169
169 flushw_all(); 170 flushw_all();
@@ -171,6 +172,8 @@ asmlinkage void kgdb_trap(unsigned long trap_level, struct pt_regs *regs)
171 local_irq_save(flags); 172 local_irq_save(flags);
172 kgdb_handle_exception(0x172, SIGTRAP, 0, regs); 173 kgdb_handle_exception(0x172, SIGTRAP, 0, regs);
173 local_irq_restore(flags); 174 local_irq_restore(flags);
175out:
176 exception_exit(prev_state);
174} 177}
175 178
176int kgdb_arch_init(void) 179int kgdb_arch_init(void)
diff --git a/arch/sparc/kernel/kprobes.c b/arch/sparc/kernel/kprobes.c
index e72212148d2a..1b0973503197 100644
--- a/arch/sparc/kernel/kprobes.c
+++ b/arch/sparc/kernel/kprobes.c
@@ -8,6 +8,7 @@
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/kdebug.h> 9#include <linux/kdebug.h>
10#include <linux/slab.h> 10#include <linux/slab.h>
11#include <linux/context_tracking.h>
11#include <asm/signal.h> 12#include <asm/signal.h>
12#include <asm/cacheflush.h> 13#include <asm/cacheflush.h>
13#include <asm/uaccess.h> 14#include <asm/uaccess.h>
@@ -349,7 +350,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
349 case KPROBE_HIT_SSDONE: 350 case KPROBE_HIT_SSDONE:
350 /* 351 /*
351 * We increment the nmissed count for accounting, 352 * We increment the nmissed count for accounting,
352 * we can also use npre/npostfault count for accouting 353 * we can also use npre/npostfault count for accounting
353 * these specific fault cases. 354 * these specific fault cases.
354 */ 355 */
355 kprobes_inc_nmissed_count(cur); 356 kprobes_inc_nmissed_count(cur);
@@ -418,12 +419,14 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
418asmlinkage void __kprobes kprobe_trap(unsigned long trap_level, 419asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
419 struct pt_regs *regs) 420 struct pt_regs *regs)
420{ 421{
422 enum ctx_state prev_state = exception_enter();
423
421 BUG_ON(trap_level != 0x170 && trap_level != 0x171); 424 BUG_ON(trap_level != 0x170 && trap_level != 0x171);
422 425
423 if (user_mode(regs)) { 426 if (user_mode(regs)) {
424 local_irq_enable(); 427 local_irq_enable();
425 bad_trap(regs, trap_level); 428 bad_trap(regs, trap_level);
426 return; 429 goto out;
427 } 430 }
428 431
429 /* trap_level == 0x170 --> ta 0x70 432 /* trap_level == 0x170 --> ta 0x70
@@ -433,6 +436,8 @@ asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
433 (trap_level == 0x170) ? "debug" : "debug_2", 436 (trap_level == 0x170) ? "debug" : "debug_2",
434 regs, 0, trap_level, SIGTRAP) != NOTIFY_STOP) 437 regs, 0, trap_level, SIGTRAP) != NOTIFY_STOP)
435 bad_trap(regs, trap_level); 438 bad_trap(regs, trap_level);
439out:
440 exception_exit(prev_state);
436} 441}
437 442
438/* Jprobes support. */ 443/* Jprobes support. */
diff --git a/arch/sparc/kernel/ktlb.S b/arch/sparc/kernel/ktlb.S
index fde5a419cf27..542e96ac4d39 100644
--- a/arch/sparc/kernel/ktlb.S
+++ b/arch/sparc/kernel/ktlb.S
@@ -153,12 +153,19 @@ kvmap_dtlb_tsb4m_miss:
153 /* Clear the PAGE_OFFSET top virtual bits, shift 153 /* Clear the PAGE_OFFSET top virtual bits, shift
154 * down to get PFN, and make sure PFN is in range. 154 * down to get PFN, and make sure PFN is in range.
155 */ 155 */
156 sllx %g4, 21, %g5 156661: sllx %g4, 0, %g5
157 .section .page_offset_shift_patch, "ax"
158 .word 661b
159 .previous
157 160
158 /* Check to see if we know about valid memory at the 4MB 161 /* Check to see if we know about valid memory at the 4MB
159 * chunk this physical address will reside within. 162 * chunk this physical address will reside within.
160 */ 163 */
161 srlx %g5, 21 + 41, %g2 164661: srlx %g5, MAX_PHYS_ADDRESS_BITS, %g2
165 .section .page_offset_shift_patch, "ax"
166 .word 661b
167 .previous
168
162 brnz,pn %g2, kvmap_dtlb_longpath 169 brnz,pn %g2, kvmap_dtlb_longpath
163 nop 170 nop
164 171
@@ -176,7 +183,11 @@ valid_addr_bitmap_patch:
176 or %g7, %lo(sparc64_valid_addr_bitmap), %g7 183 or %g7, %lo(sparc64_valid_addr_bitmap), %g7
177 .previous 184 .previous
178 185
179 srlx %g5, 21 + 22, %g2 186661: srlx %g5, ILOG2_4MB, %g2
187 .section .page_offset_shift_patch, "ax"
188 .word 661b
189 .previous
190
180 srlx %g2, 6, %g5 191 srlx %g2, 6, %g5
181 and %g2, 63, %g2 192 and %g2, 63, %g2
182 sllx %g5, 3, %g5 193 sllx %g5, 3, %g5
@@ -189,9 +200,18 @@ valid_addr_bitmap_patch:
1892: sethi %hi(kpte_linear_bitmap), %g2 2002: sethi %hi(kpte_linear_bitmap), %g2
190 201
191 /* Get the 256MB physical address index. */ 202 /* Get the 256MB physical address index. */
192 sllx %g4, 21, %g5 203661: sllx %g4, 0, %g5
204 .section .page_offset_shift_patch, "ax"
205 .word 661b
206 .previous
207
193 or %g2, %lo(kpte_linear_bitmap), %g2 208 or %g2, %lo(kpte_linear_bitmap), %g2
194 srlx %g5, 21 + 28, %g5 209
210661: srlx %g5, ILOG2_256MB, %g5
211 .section .page_offset_shift_patch, "ax"
212 .word 661b
213 .previous
214
195 and %g5, (32 - 1), %g7 215 and %g5, (32 - 1), %g7
196 216
197 /* Divide by 32 to get the offset into the bitmask. */ 217 /* Divide by 32 to get the offset into the bitmask. */
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index bc4d3f5d2e5d..cb021453de2a 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -398,8 +398,8 @@ static void apb_fake_ranges(struct pci_dev *dev,
398 apb_calc_first_last(map, &first, &last); 398 apb_calc_first_last(map, &first, &last);
399 res = bus->resource[1]; 399 res = bus->resource[1];
400 res->flags = IORESOURCE_MEM; 400 res->flags = IORESOURCE_MEM;
401 region.start = (first << 21); 401 region.start = (first << 29);
402 region.end = (last << 21) + ((1 << 21) - 1); 402 region.end = (last << 29) + ((1 << 29) - 1);
403 pcibios_bus_to_resource(dev, res, &region); 403 pcibios_bus_to_resource(dev, res, &region);
404} 404}
405 405
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index baebab215492..32a280ec38c1 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -31,6 +31,7 @@
31#include <linux/elfcore.h> 31#include <linux/elfcore.h>
32#include <linux/sysrq.h> 32#include <linux/sysrq.h>
33#include <linux/nmi.h> 33#include <linux/nmi.h>
34#include <linux/context_tracking.h>
34 35
35#include <asm/uaccess.h> 36#include <asm/uaccess.h>
36#include <asm/page.h> 37#include <asm/page.h>
@@ -557,6 +558,7 @@ void fault_in_user_windows(void)
557 558
558barf: 559barf:
559 set_thread_wsaved(window + 1); 560 set_thread_wsaved(window + 1);
561 user_exit();
560 do_exit(SIGILL); 562 do_exit(SIGILL);
561} 563}
562 564
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c
index 773c1f2983ce..c13c9f25d83a 100644
--- a/arch/sparc/kernel/ptrace_64.c
+++ b/arch/sparc/kernel/ptrace_64.c
@@ -27,6 +27,7 @@
27#include <trace/syscall.h> 27#include <trace/syscall.h>
28#include <linux/compat.h> 28#include <linux/compat.h>
29#include <linux/elf.h> 29#include <linux/elf.h>
30#include <linux/context_tracking.h>
30 31
31#include <asm/asi.h> 32#include <asm/asi.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
@@ -1066,6 +1067,9 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
1066 /* do the secure computing check first */ 1067 /* do the secure computing check first */
1067 secure_computing_strict(regs->u_regs[UREG_G1]); 1068 secure_computing_strict(regs->u_regs[UREG_G1]);
1068 1069
1070 if (test_thread_flag(TIF_NOHZ))
1071 user_exit();
1072
1069 if (test_thread_flag(TIF_SYSCALL_TRACE)) 1073 if (test_thread_flag(TIF_SYSCALL_TRACE))
1070 ret = tracehook_report_syscall_entry(regs); 1074 ret = tracehook_report_syscall_entry(regs);
1071 1075
@@ -1086,6 +1090,9 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
1086 1090
1087asmlinkage void syscall_trace_leave(struct pt_regs *regs) 1091asmlinkage void syscall_trace_leave(struct pt_regs *regs)
1088{ 1092{
1093 if (test_thread_flag(TIF_NOHZ))
1094 user_exit();
1095
1089 audit_syscall_exit(regs); 1096 audit_syscall_exit(regs);
1090 1097
1091 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 1098 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
@@ -1093,4 +1100,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
1093 1100
1094 if (test_thread_flag(TIF_SYSCALL_TRACE)) 1101 if (test_thread_flag(TIF_SYSCALL_TRACE))
1095 tracehook_report_syscall_exit(regs, 0); 1102 tracehook_report_syscall_exit(regs, 0);
1103
1104 if (test_thread_flag(TIF_NOHZ))
1105 user_enter();
1096} 1106}
diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S
index afa2a9e3d0a0..39f0c662f4c8 100644
--- a/arch/sparc/kernel/rtrap_64.S
+++ b/arch/sparc/kernel/rtrap_64.S
@@ -18,10 +18,16 @@
18#define RTRAP_PSTATE_IRQOFF (PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV) 18#define RTRAP_PSTATE_IRQOFF (PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV)
19#define RTRAP_PSTATE_AG_IRQOFF (PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV|PSTATE_AG) 19#define RTRAP_PSTATE_AG_IRQOFF (PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV|PSTATE_AG)
20 20
21#ifdef CONFIG_CONTEXT_TRACKING
22# define SCHEDULE_USER schedule_user
23#else
24# define SCHEDULE_USER schedule
25#endif
26
21 .text 27 .text
22 .align 32 28 .align 32
23__handle_preemption: 29__handle_preemption:
24 call schedule 30 call SCHEDULE_USER
25 wrpr %g0, RTRAP_PSTATE, %pstate 31 wrpr %g0, RTRAP_PSTATE, %pstate
26 ba,pt %xcc, __handle_preemption_continue 32 ba,pt %xcc, __handle_preemption_continue
27 wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate 33 wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate
@@ -306,12 +312,10 @@ to_kernel:
306 nop 312 nop
307 cmp %l4, 0 313 cmp %l4, 0
308 bne,pn %xcc, kern_fpucheck 314 bne,pn %xcc, kern_fpucheck
309 sethi %hi(PREEMPT_ACTIVE), %l6 315 nop
310 stw %l6, [%g6 + TI_PRE_COUNT] 316 call preempt_schedule_irq
311 call schedule
312 nop 317 nop
313 ba,pt %xcc, rtrap 318 ba,pt %xcc, rtrap
314 stw %g0, [%g6 + TI_PRE_COUNT]
315#endif 319#endif
316kern_fpucheck: ldub [%g6 + TI_FPDEPTH], %l5 320kern_fpucheck: ldub [%g6 + TI_FPDEPTH], %l5
317 brz,pt %l5, rt_continue 321 brz,pt %l5, rt_continue
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index 35923e8abd82..cd91d010e6d3 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -23,6 +23,7 @@
23#include <linux/tty.h> 23#include <linux/tty.h>
24#include <linux/binfmts.h> 24#include <linux/binfmts.h>
25#include <linux/bitops.h> 25#include <linux/bitops.h>
26#include <linux/context_tracking.h>
26 27
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <asm/ptrace.h> 29#include <asm/ptrace.h>
@@ -43,6 +44,7 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs)
43{ 44{
44 struct ucontext __user *ucp = (struct ucontext __user *) 45 struct ucontext __user *ucp = (struct ucontext __user *)
45 regs->u_regs[UREG_I0]; 46 regs->u_regs[UREG_I0];
47 enum ctx_state prev_state = exception_enter();
46 mc_gregset_t __user *grp; 48 mc_gregset_t __user *grp;
47 unsigned long pc, npc, tstate; 49 unsigned long pc, npc, tstate;
48 unsigned long fp, i7; 50 unsigned long fp, i7;
@@ -129,16 +131,19 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs)
129 } 131 }
130 if (err) 132 if (err)
131 goto do_sigsegv; 133 goto do_sigsegv;
132 134out:
135 exception_exit(prev_state);
133 return; 136 return;
134do_sigsegv: 137do_sigsegv:
135 force_sig(SIGSEGV, current); 138 force_sig(SIGSEGV, current);
139 goto out;
136} 140}
137 141
138asmlinkage void sparc64_get_context(struct pt_regs *regs) 142asmlinkage void sparc64_get_context(struct pt_regs *regs)
139{ 143{
140 struct ucontext __user *ucp = (struct ucontext __user *) 144 struct ucontext __user *ucp = (struct ucontext __user *)
141 regs->u_regs[UREG_I0]; 145 regs->u_regs[UREG_I0];
146 enum ctx_state prev_state = exception_enter();
142 mc_gregset_t __user *grp; 147 mc_gregset_t __user *grp;
143 mcontext_t __user *mcp; 148 mcontext_t __user *mcp;
144 unsigned long fp, i7; 149 unsigned long fp, i7;
@@ -220,10 +225,12 @@ asmlinkage void sparc64_get_context(struct pt_regs *regs)
220 } 225 }
221 if (err) 226 if (err)
222 goto do_sigsegv; 227 goto do_sigsegv;
223 228out:
229 exception_exit(prev_state);
224 return; 230 return;
225do_sigsegv: 231do_sigsegv:
226 force_sig(SIGSEGV, current); 232 force_sig(SIGSEGV, current);
233 goto out;
227} 234}
228 235
229struct rt_signal_frame { 236struct rt_signal_frame {
@@ -528,11 +535,13 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
528 535
529void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long thread_info_flags) 536void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long thread_info_flags)
530{ 537{
538 user_exit();
531 if (thread_info_flags & _TIF_SIGPENDING) 539 if (thread_info_flags & _TIF_SIGPENDING)
532 do_signal(regs, orig_i0); 540 do_signal(regs, orig_i0);
533 if (thread_info_flags & _TIF_NOTIFY_RESUME) { 541 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
534 clear_thread_flag(TIF_NOTIFY_RESUME); 542 clear_thread_flag(TIF_NOTIFY_RESUME);
535 tracehook_notify_resume(regs); 543 tracehook_notify_resume(regs);
536 } 544 }
545 user_enter();
537} 546}
538 547
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index e142545244f2..b66a5338231e 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1399,8 +1399,13 @@ void __init smp_cpus_done(unsigned int max_cpus)
1399 1399
1400void smp_send_reschedule(int cpu) 1400void smp_send_reschedule(int cpu)
1401{ 1401{
1402 xcall_deliver((u64) &xcall_receive_signal, 0, 0, 1402 if (cpu == smp_processor_id()) {
1403 cpumask_of(cpu)); 1403 WARN_ON_ONCE(preemptible());
1404 set_softint(1 << PIL_SMP_RECEIVE_SIGNAL);
1405 } else {
1406 xcall_deliver((u64) &xcall_receive_signal,
1407 0, 0, cpumask_of(cpu));
1408 }
1404} 1409}
1405 1410
1406void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs) 1411void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
diff --git a/arch/sparc/kernel/sun4v_tlb_miss.S b/arch/sparc/kernel/sun4v_tlb_miss.S
index bde867fd71e8..e0c09bf85610 100644
--- a/arch/sparc/kernel/sun4v_tlb_miss.S
+++ b/arch/sparc/kernel/sun4v_tlb_miss.S
@@ -182,7 +182,7 @@ sun4v_tsb_miss_common:
182 cmp %g5, -1 182 cmp %g5, -1
183 be,pt %xcc, 80f 183 be,pt %xcc, 80f
184 nop 184 nop
185 COMPUTE_TSB_PTR(%g5, %g4, HPAGE_SHIFT, %g2, %g7) 185 COMPUTE_TSB_PTR(%g5, %g4, REAL_HPAGE_SHIFT, %g2, %g7)
186 186
187 /* That clobbered %g2, reload it. */ 187 /* That clobbered %g2, reload it. */
188 ldxa [%g0] ASI_SCRATCHPAD, %g2 188 ldxa [%g0] ASI_SCRATCHPAD, %g2
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 51561b8b15ba..beb0b5a5f21f 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -24,6 +24,7 @@
24#include <linux/personality.h> 24#include <linux/personality.h>
25#include <linux/random.h> 25#include <linux/random.h>
26#include <linux/export.h> 26#include <linux/export.h>
27#include <linux/context_tracking.h>
27 28
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/utrap.h> 30#include <asm/utrap.h>
@@ -39,9 +40,6 @@ asmlinkage unsigned long sys_getpagesize(void)
39 return PAGE_SIZE; 40 return PAGE_SIZE;
40} 41}
41 42
42#define VA_EXCLUDE_START (0x0000080000000000UL - (1UL << 32UL))
43#define VA_EXCLUDE_END (0xfffff80000000000UL + (1UL << 32UL))
44
45/* Does addr --> addr+len fall within 4GB of the VA-space hole or 43/* Does addr --> addr+len fall within 4GB of the VA-space hole or
46 * overflow past the end of the 64-bit address space? 44 * overflow past the end of the 64-bit address space?
47 */ 45 */
@@ -499,6 +497,7 @@ asmlinkage unsigned long c_sys_nis_syscall(struct pt_regs *regs)
499 497
500asmlinkage void sparc_breakpoint(struct pt_regs *regs) 498asmlinkage void sparc_breakpoint(struct pt_regs *regs)
501{ 499{
500 enum ctx_state prev_state = exception_enter();
502 siginfo_t info; 501 siginfo_t info;
503 502
504 if (test_thread_flag(TIF_32BIT)) { 503 if (test_thread_flag(TIF_32BIT)) {
@@ -517,6 +516,7 @@ asmlinkage void sparc_breakpoint(struct pt_regs *regs)
517#ifdef DEBUG_SPARC_BREAKPOINT 516#ifdef DEBUG_SPARC_BREAKPOINT
518 printk ("TRAP: Returning to space: PC=%lx nPC=%lx\n", regs->tpc, regs->tnpc); 517 printk ("TRAP: Returning to space: PC=%lx nPC=%lx\n", regs->tpc, regs->tnpc);
519#endif 518#endif
519 exception_exit(prev_state);
520} 520}
521 521
522extern void check_pending(int signum); 522extern void check_pending(int signum);
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index d950197a17e1..87729fff13b9 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -52,7 +52,7 @@ sys32_rt_sigreturn:
52#endif 52#endif
53 .align 32 53 .align 32
541: ldx [%g6 + TI_FLAGS], %l5 541: ldx [%g6 + TI_FLAGS], %l5
55 andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 55 andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0
56 be,pt %icc, rtrap 56 be,pt %icc, rtrap
57 nop 57 nop
58 call syscall_trace_leave 58 call syscall_trace_leave
@@ -184,7 +184,7 @@ linux_sparc_syscall32:
184 184
185 srl %i3, 0, %o3 ! IEU0 185 srl %i3, 0, %o3 ! IEU0
186 srl %i2, 0, %o2 ! IEU0 Group 186 srl %i2, 0, %o2 ! IEU0 Group
187 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 187 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0
188 bne,pn %icc, linux_syscall_trace32 ! CTI 188 bne,pn %icc, linux_syscall_trace32 ! CTI
189 mov %i0, %l5 ! IEU1 189 mov %i0, %l5 ! IEU1
1905: call %l7 ! CTI Group brk forced 1905: call %l7 ! CTI Group brk forced
@@ -207,7 +207,7 @@ linux_sparc_syscall:
207 207
208 mov %i3, %o3 ! IEU1 208 mov %i3, %o3 ! IEU1
209 mov %i4, %o4 ! IEU0 Group 209 mov %i4, %o4 ! IEU0 Group
210 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 210 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0
211 bne,pn %icc, linux_syscall_trace ! CTI Group 211 bne,pn %icc, linux_syscall_trace ! CTI Group
212 mov %i0, %l5 ! IEU0 212 mov %i0, %l5 ! IEU0
2132: call %l7 ! CTI Group brk forced 2132: call %l7 ! CTI Group brk forced
@@ -223,7 +223,7 @@ ret_sys_call:
223 223
224 cmp %o0, -ERESTART_RESTARTBLOCK 224 cmp %o0, -ERESTART_RESTARTBLOCK
225 bgeu,pn %xcc, 1f 225 bgeu,pn %xcc, 1f
226 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 226 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0
227 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc 227 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
228 228
2292: 2292:
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index b3f833ab90eb..4ced92f05358 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -20,6 +20,7 @@
20#include <linux/ftrace.h> 20#include <linux/ftrace.h>
21#include <linux/reboot.h> 21#include <linux/reboot.h>
22#include <linux/gfp.h> 22#include <linux/gfp.h>
23#include <linux/context_tracking.h>
23 24
24#include <asm/smp.h> 25#include <asm/smp.h>
25#include <asm/delay.h> 26#include <asm/delay.h>
@@ -186,11 +187,12 @@ EXPORT_SYMBOL_GPL(unregister_dimm_printer);
186 187
187void spitfire_insn_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar) 188void spitfire_insn_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
188{ 189{
190 enum ctx_state prev_state = exception_enter();
189 siginfo_t info; 191 siginfo_t info;
190 192
191 if (notify_die(DIE_TRAP, "instruction access exception", regs, 193 if (notify_die(DIE_TRAP, "instruction access exception", regs,
192 0, 0x8, SIGTRAP) == NOTIFY_STOP) 194 0, 0x8, SIGTRAP) == NOTIFY_STOP)
193 return; 195 goto out;
194 196
195 if (regs->tstate & TSTATE_PRIV) { 197 if (regs->tstate & TSTATE_PRIV) {
196 printk("spitfire_insn_access_exception: SFSR[%016lx] " 198 printk("spitfire_insn_access_exception: SFSR[%016lx] "
@@ -207,6 +209,8 @@ void spitfire_insn_access_exception(struct pt_regs *regs, unsigned long sfsr, un
207 info.si_addr = (void __user *)regs->tpc; 209 info.si_addr = (void __user *)regs->tpc;
208 info.si_trapno = 0; 210 info.si_trapno = 0;
209 force_sig_info(SIGSEGV, &info, current); 211 force_sig_info(SIGSEGV, &info, current);
212out:
213 exception_exit(prev_state);
210} 214}
211 215
212void spitfire_insn_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar) 216void spitfire_insn_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
@@ -260,11 +264,12 @@ void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, u
260 264
261void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar) 265void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
262{ 266{
267 enum ctx_state prev_state = exception_enter();
263 siginfo_t info; 268 siginfo_t info;
264 269
265 if (notify_die(DIE_TRAP, "data access exception", regs, 270 if (notify_die(DIE_TRAP, "data access exception", regs,
266 0, 0x30, SIGTRAP) == NOTIFY_STOP) 271 0, 0x30, SIGTRAP) == NOTIFY_STOP)
267 return; 272 goto out;
268 273
269 if (regs->tstate & TSTATE_PRIV) { 274 if (regs->tstate & TSTATE_PRIV) {
270 /* Test if this comes from uaccess places. */ 275 /* Test if this comes from uaccess places. */
@@ -280,7 +285,7 @@ void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, un
280#endif 285#endif
281 regs->tpc = entry->fixup; 286 regs->tpc = entry->fixup;
282 regs->tnpc = regs->tpc + 4; 287 regs->tnpc = regs->tpc + 4;
283 return; 288 goto out;
284 } 289 }
285 /* Shit... */ 290 /* Shit... */
286 printk("spitfire_data_access_exception: SFSR[%016lx] " 291 printk("spitfire_data_access_exception: SFSR[%016lx] "
@@ -294,6 +299,8 @@ void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, un
294 info.si_addr = (void __user *)sfar; 299 info.si_addr = (void __user *)sfar;
295 info.si_trapno = 0; 300 info.si_trapno = 0;
296 force_sig_info(SIGSEGV, &info, current); 301 force_sig_info(SIGSEGV, &info, current);
302out:
303 exception_exit(prev_state);
297} 304}
298 305
299void spitfire_data_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar) 306void spitfire_data_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
@@ -1994,6 +2001,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
1994 */ 2001 */
1995void sun4v_resum_error(struct pt_regs *regs, unsigned long offset) 2002void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
1996{ 2003{
2004 enum ctx_state prev_state = exception_enter();
1997 struct sun4v_error_entry *ent, local_copy; 2005 struct sun4v_error_entry *ent, local_copy;
1998 struct trap_per_cpu *tb; 2006 struct trap_per_cpu *tb;
1999 unsigned long paddr; 2007 unsigned long paddr;
@@ -2022,12 +2030,14 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
2022 pr_info("Shutdown request, %u seconds...\n", 2030 pr_info("Shutdown request, %u seconds...\n",
2023 local_copy.err_secs); 2031 local_copy.err_secs);
2024 orderly_poweroff(true); 2032 orderly_poweroff(true);
2025 return; 2033 goto out;
2026 } 2034 }
2027 2035
2028 sun4v_log_error(regs, &local_copy, cpu, 2036 sun4v_log_error(regs, &local_copy, cpu,
2029 KERN_ERR "RESUMABLE ERROR", 2037 KERN_ERR "RESUMABLE ERROR",
2030 &sun4v_resum_oflow_cnt); 2038 &sun4v_resum_oflow_cnt);
2039out:
2040 exception_exit(prev_state);
2031} 2041}
2032 2042
2033/* If we try to printk() we'll probably make matters worse, by trying 2043/* If we try to printk() we'll probably make matters worse, by trying
@@ -2152,7 +2162,7 @@ void hypervisor_tlbop_error_xcall(unsigned long err, unsigned long op)
2152 err, op); 2162 err, op);
2153} 2163}
2154 2164
2155void do_fpe_common(struct pt_regs *regs) 2165static void do_fpe_common(struct pt_regs *regs)
2156{ 2166{
2157 if (regs->tstate & TSTATE_PRIV) { 2167 if (regs->tstate & TSTATE_PRIV) {
2158 regs->tpc = regs->tnpc; 2168 regs->tpc = regs->tnpc;
@@ -2188,23 +2198,28 @@ void do_fpe_common(struct pt_regs *regs)
2188 2198
2189void do_fpieee(struct pt_regs *regs) 2199void do_fpieee(struct pt_regs *regs)
2190{ 2200{
2201 enum ctx_state prev_state = exception_enter();
2202
2191 if (notify_die(DIE_TRAP, "fpu exception ieee", regs, 2203 if (notify_die(DIE_TRAP, "fpu exception ieee", regs,
2192 0, 0x24, SIGFPE) == NOTIFY_STOP) 2204 0, 0x24, SIGFPE) == NOTIFY_STOP)
2193 return; 2205 goto out;
2194 2206
2195 do_fpe_common(regs); 2207 do_fpe_common(regs);
2208out:
2209 exception_exit(prev_state);
2196} 2210}
2197 2211
2198extern int do_mathemu(struct pt_regs *, struct fpustate *, bool); 2212extern int do_mathemu(struct pt_regs *, struct fpustate *, bool);
2199 2213
2200void do_fpother(struct pt_regs *regs) 2214void do_fpother(struct pt_regs *regs)
2201{ 2215{
2216 enum ctx_state prev_state = exception_enter();
2202 struct fpustate *f = FPUSTATE; 2217 struct fpustate *f = FPUSTATE;
2203 int ret = 0; 2218 int ret = 0;
2204 2219
2205 if (notify_die(DIE_TRAP, "fpu exception other", regs, 2220 if (notify_die(DIE_TRAP, "fpu exception other", regs,
2206 0, 0x25, SIGFPE) == NOTIFY_STOP) 2221 0, 0x25, SIGFPE) == NOTIFY_STOP)
2207 return; 2222 goto out;
2208 2223
2209 switch ((current_thread_info()->xfsr[0] & 0x1c000)) { 2224 switch ((current_thread_info()->xfsr[0] & 0x1c000)) {
2210 case (2 << 14): /* unfinished_FPop */ 2225 case (2 << 14): /* unfinished_FPop */
@@ -2213,17 +2228,20 @@ void do_fpother(struct pt_regs *regs)
2213 break; 2228 break;
2214 } 2229 }
2215 if (ret) 2230 if (ret)
2216 return; 2231 goto out;
2217 do_fpe_common(regs); 2232 do_fpe_common(regs);
2233out:
2234 exception_exit(prev_state);
2218} 2235}
2219 2236
2220void do_tof(struct pt_regs *regs) 2237void do_tof(struct pt_regs *regs)
2221{ 2238{
2239 enum ctx_state prev_state = exception_enter();
2222 siginfo_t info; 2240 siginfo_t info;
2223 2241
2224 if (notify_die(DIE_TRAP, "tagged arithmetic overflow", regs, 2242 if (notify_die(DIE_TRAP, "tagged arithmetic overflow", regs,
2225 0, 0x26, SIGEMT) == NOTIFY_STOP) 2243 0, 0x26, SIGEMT) == NOTIFY_STOP)
2226 return; 2244 goto out;
2227 2245
2228 if (regs->tstate & TSTATE_PRIV) 2246 if (regs->tstate & TSTATE_PRIV)
2229 die_if_kernel("Penguin overflow trap from kernel mode", regs); 2247 die_if_kernel("Penguin overflow trap from kernel mode", regs);
@@ -2237,15 +2255,18 @@ void do_tof(struct pt_regs *regs)
2237 info.si_addr = (void __user *)regs->tpc; 2255 info.si_addr = (void __user *)regs->tpc;
2238 info.si_trapno = 0; 2256 info.si_trapno = 0;
2239 force_sig_info(SIGEMT, &info, current); 2257 force_sig_info(SIGEMT, &info, current);
2258out:
2259 exception_exit(prev_state);
2240} 2260}
2241 2261
2242void do_div0(struct pt_regs *regs) 2262void do_div0(struct pt_regs *regs)
2243{ 2263{
2264 enum ctx_state prev_state = exception_enter();
2244 siginfo_t info; 2265 siginfo_t info;
2245 2266
2246 if (notify_die(DIE_TRAP, "integer division by zero", regs, 2267 if (notify_die(DIE_TRAP, "integer division by zero", regs,
2247 0, 0x28, SIGFPE) == NOTIFY_STOP) 2268 0, 0x28, SIGFPE) == NOTIFY_STOP)
2248 return; 2269 goto out;
2249 2270
2250 if (regs->tstate & TSTATE_PRIV) 2271 if (regs->tstate & TSTATE_PRIV)
2251 die_if_kernel("TL0: Kernel divide by zero.", regs); 2272 die_if_kernel("TL0: Kernel divide by zero.", regs);
@@ -2259,6 +2280,8 @@ void do_div0(struct pt_regs *regs)
2259 info.si_addr = (void __user *)regs->tpc; 2280 info.si_addr = (void __user *)regs->tpc;
2260 info.si_trapno = 0; 2281 info.si_trapno = 0;
2261 force_sig_info(SIGFPE, &info, current); 2282 force_sig_info(SIGFPE, &info, current);
2283out:
2284 exception_exit(prev_state);
2262} 2285}
2263 2286
2264static void instruction_dump(unsigned int *pc) 2287static void instruction_dump(unsigned int *pc)
@@ -2415,6 +2438,7 @@ extern int handle_ldf_stq(u32 insn, struct pt_regs *regs);
2415 2438
2416void do_illegal_instruction(struct pt_regs *regs) 2439void do_illegal_instruction(struct pt_regs *regs)
2417{ 2440{
2441 enum ctx_state prev_state = exception_enter();
2418 unsigned long pc = regs->tpc; 2442 unsigned long pc = regs->tpc;
2419 unsigned long tstate = regs->tstate; 2443 unsigned long tstate = regs->tstate;
2420 u32 insn; 2444 u32 insn;
@@ -2422,7 +2446,7 @@ void do_illegal_instruction(struct pt_regs *regs)
2422 2446
2423 if (notify_die(DIE_TRAP, "illegal instruction", regs, 2447 if (notify_die(DIE_TRAP, "illegal instruction", regs,
2424 0, 0x10, SIGILL) == NOTIFY_STOP) 2448 0, 0x10, SIGILL) == NOTIFY_STOP)
2425 return; 2449 goto out;
2426 2450
2427 if (tstate & TSTATE_PRIV) 2451 if (tstate & TSTATE_PRIV)
2428 die_if_kernel("Kernel illegal instruction", regs); 2452 die_if_kernel("Kernel illegal instruction", regs);
@@ -2431,14 +2455,14 @@ void do_illegal_instruction(struct pt_regs *regs)
2431 if (get_user(insn, (u32 __user *) pc) != -EFAULT) { 2455 if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
2432 if ((insn & 0xc1ffc000) == 0x81700000) /* POPC */ { 2456 if ((insn & 0xc1ffc000) == 0x81700000) /* POPC */ {
2433 if (handle_popc(insn, regs)) 2457 if (handle_popc(insn, regs))
2434 return; 2458 goto out;
2435 } else if ((insn & 0xc1580000) == 0xc1100000) /* LDQ/STQ */ { 2459 } else if ((insn & 0xc1580000) == 0xc1100000) /* LDQ/STQ */ {
2436 if (handle_ldf_stq(insn, regs)) 2460 if (handle_ldf_stq(insn, regs))
2437 return; 2461 goto out;
2438 } else if (tlb_type == hypervisor) { 2462 } else if (tlb_type == hypervisor) {
2439 if ((insn & VIS_OPCODE_MASK) == VIS_OPCODE_VAL) { 2463 if ((insn & VIS_OPCODE_MASK) == VIS_OPCODE_VAL) {
2440 if (!vis_emul(regs, insn)) 2464 if (!vis_emul(regs, insn))
2441 return; 2465 goto out;
2442 } else { 2466 } else {
2443 struct fpustate *f = FPUSTATE; 2467 struct fpustate *f = FPUSTATE;
2444 2468
@@ -2448,7 +2472,7 @@ void do_illegal_instruction(struct pt_regs *regs)
2448 * Trap in the %fsr to unimplemented_FPop. 2472 * Trap in the %fsr to unimplemented_FPop.
2449 */ 2473 */
2450 if (do_mathemu(regs, f, true)) 2474 if (do_mathemu(regs, f, true))
2451 return; 2475 goto out;
2452 } 2476 }
2453 } 2477 }
2454 } 2478 }
@@ -2458,21 +2482,24 @@ void do_illegal_instruction(struct pt_regs *regs)
2458 info.si_addr = (void __user *)pc; 2482 info.si_addr = (void __user *)pc;
2459 info.si_trapno = 0; 2483 info.si_trapno = 0;
2460 force_sig_info(SIGILL, &info, current); 2484 force_sig_info(SIGILL, &info, current);
2485out:
2486 exception_exit(prev_state);
2461} 2487}
2462 2488
2463extern void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 2489extern void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
2464 2490
2465void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr) 2491void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr)
2466{ 2492{
2493 enum ctx_state prev_state = exception_enter();
2467 siginfo_t info; 2494 siginfo_t info;
2468 2495
2469 if (notify_die(DIE_TRAP, "memory address unaligned", regs, 2496 if (notify_die(DIE_TRAP, "memory address unaligned", regs,
2470 0, 0x34, SIGSEGV) == NOTIFY_STOP) 2497 0, 0x34, SIGSEGV) == NOTIFY_STOP)
2471 return; 2498 goto out;
2472 2499
2473 if (regs->tstate & TSTATE_PRIV) { 2500 if (regs->tstate & TSTATE_PRIV) {
2474 kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc)); 2501 kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc));
2475 return; 2502 goto out;
2476 } 2503 }
2477 info.si_signo = SIGBUS; 2504 info.si_signo = SIGBUS;
2478 info.si_errno = 0; 2505 info.si_errno = 0;
@@ -2480,6 +2507,8 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo
2480 info.si_addr = (void __user *)sfar; 2507 info.si_addr = (void __user *)sfar;
2481 info.si_trapno = 0; 2508 info.si_trapno = 0;
2482 force_sig_info(SIGBUS, &info, current); 2509 force_sig_info(SIGBUS, &info, current);
2510out:
2511 exception_exit(prev_state);
2483} 2512}
2484 2513
2485void sun4v_do_mna(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx) 2514void sun4v_do_mna(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)
@@ -2504,11 +2533,12 @@ void sun4v_do_mna(struct pt_regs *regs, unsigned long addr, unsigned long type_c
2504 2533
2505void do_privop(struct pt_regs *regs) 2534void do_privop(struct pt_regs *regs)
2506{ 2535{
2536 enum ctx_state prev_state = exception_enter();
2507 siginfo_t info; 2537 siginfo_t info;
2508 2538
2509 if (notify_die(DIE_TRAP, "privileged operation", regs, 2539 if (notify_die(DIE_TRAP, "privileged operation", regs,
2510 0, 0x11, SIGILL) == NOTIFY_STOP) 2540 0, 0x11, SIGILL) == NOTIFY_STOP)
2511 return; 2541 goto out;
2512 2542
2513 if (test_thread_flag(TIF_32BIT)) { 2543 if (test_thread_flag(TIF_32BIT)) {
2514 regs->tpc &= 0xffffffff; 2544 regs->tpc &= 0xffffffff;
@@ -2520,6 +2550,8 @@ void do_privop(struct pt_regs *regs)
2520 info.si_addr = (void __user *)regs->tpc; 2550 info.si_addr = (void __user *)regs->tpc;
2521 info.si_trapno = 0; 2551 info.si_trapno = 0;
2522 force_sig_info(SIGILL, &info, current); 2552 force_sig_info(SIGILL, &info, current);
2553out:
2554 exception_exit(prev_state);
2523} 2555}
2524 2556
2525void do_privact(struct pt_regs *regs) 2557void do_privact(struct pt_regs *regs)
@@ -2530,99 +2562,116 @@ void do_privact(struct pt_regs *regs)
2530/* Trap level 1 stuff or other traps we should never see... */ 2562/* Trap level 1 stuff or other traps we should never see... */
2531void do_cee(struct pt_regs *regs) 2563void do_cee(struct pt_regs *regs)
2532{ 2564{
2565 exception_enter();
2533 die_if_kernel("TL0: Cache Error Exception", regs); 2566 die_if_kernel("TL0: Cache Error Exception", regs);
2534} 2567}
2535 2568
2536void do_cee_tl1(struct pt_regs *regs) 2569void do_cee_tl1(struct pt_regs *regs)
2537{ 2570{
2571 exception_enter();
2538 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2572 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2539 die_if_kernel("TL1: Cache Error Exception", regs); 2573 die_if_kernel("TL1: Cache Error Exception", regs);
2540} 2574}
2541 2575
2542void do_dae_tl1(struct pt_regs *regs) 2576void do_dae_tl1(struct pt_regs *regs)
2543{ 2577{
2578 exception_enter();
2544 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2579 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2545 die_if_kernel("TL1: Data Access Exception", regs); 2580 die_if_kernel("TL1: Data Access Exception", regs);
2546} 2581}
2547 2582
2548void do_iae_tl1(struct pt_regs *regs) 2583void do_iae_tl1(struct pt_regs *regs)
2549{ 2584{
2585 exception_enter();
2550 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2586 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2551 die_if_kernel("TL1: Instruction Access Exception", regs); 2587 die_if_kernel("TL1: Instruction Access Exception", regs);
2552} 2588}
2553 2589
2554void do_div0_tl1(struct pt_regs *regs) 2590void do_div0_tl1(struct pt_regs *regs)
2555{ 2591{
2592 exception_enter();
2556 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2593 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2557 die_if_kernel("TL1: DIV0 Exception", regs); 2594 die_if_kernel("TL1: DIV0 Exception", regs);
2558} 2595}
2559 2596
2560void do_fpdis_tl1(struct pt_regs *regs) 2597void do_fpdis_tl1(struct pt_regs *regs)
2561{ 2598{
2599 exception_enter();
2562 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2600 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2563 die_if_kernel("TL1: FPU Disabled", regs); 2601 die_if_kernel("TL1: FPU Disabled", regs);
2564} 2602}
2565 2603
2566void do_fpieee_tl1(struct pt_regs *regs) 2604void do_fpieee_tl1(struct pt_regs *regs)
2567{ 2605{
2606 exception_enter();
2568 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2607 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2569 die_if_kernel("TL1: FPU IEEE Exception", regs); 2608 die_if_kernel("TL1: FPU IEEE Exception", regs);
2570} 2609}
2571 2610
2572void do_fpother_tl1(struct pt_regs *regs) 2611void do_fpother_tl1(struct pt_regs *regs)
2573{ 2612{
2613 exception_enter();
2574 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2614 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2575 die_if_kernel("TL1: FPU Other Exception", regs); 2615 die_if_kernel("TL1: FPU Other Exception", regs);
2576} 2616}
2577 2617
2578void do_ill_tl1(struct pt_regs *regs) 2618void do_ill_tl1(struct pt_regs *regs)
2579{ 2619{
2620 exception_enter();
2580 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2621 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2581 die_if_kernel("TL1: Illegal Instruction Exception", regs); 2622 die_if_kernel("TL1: Illegal Instruction Exception", regs);
2582} 2623}
2583 2624
2584void do_irq_tl1(struct pt_regs *regs) 2625void do_irq_tl1(struct pt_regs *regs)
2585{ 2626{
2627 exception_enter();
2586 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2628 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2587 die_if_kernel("TL1: IRQ Exception", regs); 2629 die_if_kernel("TL1: IRQ Exception", regs);
2588} 2630}
2589 2631
2590void do_lddfmna_tl1(struct pt_regs *regs) 2632void do_lddfmna_tl1(struct pt_regs *regs)
2591{ 2633{
2634 exception_enter();
2592 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2635 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2593 die_if_kernel("TL1: LDDF Exception", regs); 2636 die_if_kernel("TL1: LDDF Exception", regs);
2594} 2637}
2595 2638
2596void do_stdfmna_tl1(struct pt_regs *regs) 2639void do_stdfmna_tl1(struct pt_regs *regs)
2597{ 2640{
2641 exception_enter();
2598 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2642 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2599 die_if_kernel("TL1: STDF Exception", regs); 2643 die_if_kernel("TL1: STDF Exception", regs);
2600} 2644}
2601 2645
2602void do_paw(struct pt_regs *regs) 2646void do_paw(struct pt_regs *regs)
2603{ 2647{
2648 exception_enter();
2604 die_if_kernel("TL0: Phys Watchpoint Exception", regs); 2649 die_if_kernel("TL0: Phys Watchpoint Exception", regs);
2605} 2650}
2606 2651
2607void do_paw_tl1(struct pt_regs *regs) 2652void do_paw_tl1(struct pt_regs *regs)
2608{ 2653{
2654 exception_enter();
2609 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2655 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2610 die_if_kernel("TL1: Phys Watchpoint Exception", regs); 2656 die_if_kernel("TL1: Phys Watchpoint Exception", regs);
2611} 2657}
2612 2658
2613void do_vaw(struct pt_regs *regs) 2659void do_vaw(struct pt_regs *regs)
2614{ 2660{
2661 exception_enter();
2615 die_if_kernel("TL0: Virt Watchpoint Exception", regs); 2662 die_if_kernel("TL0: Virt Watchpoint Exception", regs);
2616} 2663}
2617 2664
2618void do_vaw_tl1(struct pt_regs *regs) 2665void do_vaw_tl1(struct pt_regs *regs)
2619{ 2666{
2667 exception_enter();
2620 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2668 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2621 die_if_kernel("TL1: Virt Watchpoint Exception", regs); 2669 die_if_kernel("TL1: Virt Watchpoint Exception", regs);
2622} 2670}
2623 2671
2624void do_tof_tl1(struct pt_regs *regs) 2672void do_tof_tl1(struct pt_regs *regs)
2625{ 2673{
2674 exception_enter();
2626 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 2675 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
2627 die_if_kernel("TL1: Tag Overflow Exception", regs); 2676 die_if_kernel("TL1: Tag Overflow Exception", regs);
2628} 2677}
diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S
index a313e4a9399b..14158d40ba76 100644
--- a/arch/sparc/kernel/tsb.S
+++ b/arch/sparc/kernel/tsb.S
@@ -75,7 +75,7 @@ tsb_miss_page_table_walk:
75 mov 512, %g7 75 mov 512, %g7
76 andn %g5, 0x7, %g5 76 andn %g5, 0x7, %g5
77 sllx %g7, %g6, %g7 77 sllx %g7, %g6, %g7
78 srlx %g4, HPAGE_SHIFT, %g6 78 srlx %g4, REAL_HPAGE_SHIFT, %g6
79 sub %g7, 1, %g7 79 sub %g7, 1, %g7
80 and %g6, %g7, %g6 80 and %g6, %g7, %g6
81 sllx %g6, 4, %g6 81 sllx %g6, 4, %g6
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
index 8201c25e7669..3c1a7cb31579 100644
--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -21,9 +21,12 @@
21#include <linux/bitops.h> 21#include <linux/bitops.h>
22#include <linux/perf_event.h> 22#include <linux/perf_event.h>
23#include <linux/ratelimit.h> 23#include <linux/ratelimit.h>
24#include <linux/context_tracking.h>
24#include <asm/fpumacro.h> 25#include <asm/fpumacro.h>
25#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
26 27
28#include "entry.h"
29
27enum direction { 30enum direction {
28 load, /* ld, ldd, ldh, ldsh */ 31 load, /* ld, ldd, ldh, ldsh */
29 store, /* st, std, sth, stsh */ 32 store, /* st, std, sth, stsh */
@@ -418,9 +421,6 @@ int handle_popc(u32 insn, struct pt_regs *regs)
418 421
419extern void do_fpother(struct pt_regs *regs); 422extern void do_fpother(struct pt_regs *regs);
420extern void do_privact(struct pt_regs *regs); 423extern void do_privact(struct pt_regs *regs);
421extern void spitfire_data_access_exception(struct pt_regs *regs,
422 unsigned long sfsr,
423 unsigned long sfar);
424extern void sun4v_data_access_exception(struct pt_regs *regs, 424extern void sun4v_data_access_exception(struct pt_regs *regs,
425 unsigned long addr, 425 unsigned long addr,
426 unsigned long type_ctx); 426 unsigned long type_ctx);
@@ -578,6 +578,7 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs)
578 578
579void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr) 579void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr)
580{ 580{
581 enum ctx_state prev_state = exception_enter();
581 unsigned long pc = regs->tpc; 582 unsigned long pc = regs->tpc;
582 unsigned long tstate = regs->tstate; 583 unsigned long tstate = regs->tstate;
583 u32 insn; 584 u32 insn;
@@ -632,13 +633,16 @@ daex:
632 sun4v_data_access_exception(regs, sfar, sfsr); 633 sun4v_data_access_exception(regs, sfar, sfsr);
633 else 634 else
634 spitfire_data_access_exception(regs, sfsr, sfar); 635 spitfire_data_access_exception(regs, sfsr, sfar);
635 return; 636 goto out;
636 } 637 }
637 advance(regs); 638 advance(regs);
639out:
640 exception_exit(prev_state);
638} 641}
639 642
640void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr) 643void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr)
641{ 644{
645 enum ctx_state prev_state = exception_enter();
642 unsigned long pc = regs->tpc; 646 unsigned long pc = regs->tpc;
643 unsigned long tstate = regs->tstate; 647 unsigned long tstate = regs->tstate;
644 u32 insn; 648 u32 insn;
@@ -680,7 +684,9 @@ daex:
680 sun4v_data_access_exception(regs, sfar, sfsr); 684 sun4v_data_access_exception(regs, sfar, sfsr);
681 else 685 else
682 spitfire_data_access_exception(regs, sfsr, sfar); 686 spitfire_data_access_exception(regs, sfsr, sfar);
683 return; 687 goto out;
684 } 688 }
685 advance(regs); 689 advance(regs);
690out:
691 exception_exit(prev_state);
686} 692}
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 0bacceb19150..932ff90fd760 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -122,6 +122,11 @@ SECTIONS
122 *(.swapper_4m_tsb_phys_patch) 122 *(.swapper_4m_tsb_phys_patch)
123 __swapper_4m_tsb_phys_patch_end = .; 123 __swapper_4m_tsb_phys_patch_end = .;
124 } 124 }
125 .page_offset_shift_patch : {
126 __page_offset_shift_patch = .;
127 *(.page_offset_shift_patch)
128 __page_offset_shift_patch_end = .;
129 }
125 .popc_3insn_patch : { 130 .popc_3insn_patch : {
126 __popc_3insn_patch = .; 131 __popc_3insn_patch = .;
127 *(.popc_3insn_patch) 132 *(.popc_3insn_patch)
diff --git a/arch/sparc/lib/clear_page.S b/arch/sparc/lib/clear_page.S
index 77e531f6c2a7..46272dfc26e8 100644
--- a/arch/sparc/lib/clear_page.S
+++ b/arch/sparc/lib/clear_page.S
@@ -37,10 +37,10 @@ _clear_page: /* %o0=dest */
37 .globl clear_user_page 37 .globl clear_user_page
38clear_user_page: /* %o0=dest, %o1=vaddr */ 38clear_user_page: /* %o0=dest, %o1=vaddr */
39 lduw [%g6 + TI_PRE_COUNT], %o2 39 lduw [%g6 + TI_PRE_COUNT], %o2
40 sethi %uhi(PAGE_OFFSET), %g2 40 sethi %hi(PAGE_OFFSET), %g2
41 sethi %hi(PAGE_SIZE), %o4 41 sethi %hi(PAGE_SIZE), %o4
42 42
43 sllx %g2, 32, %g2 43 ldx [%g2 + %lo(PAGE_OFFSET)], %g2
44 sethi %hi(PAGE_KERNEL_LOCKED), %g3 44 sethi %hi(PAGE_KERNEL_LOCKED), %g3
45 45
46 ldx [%g3 + %lo(PAGE_KERNEL_LOCKED)], %g3 46 ldx [%g3 + %lo(PAGE_KERNEL_LOCKED)], %g3
diff --git a/arch/sparc/lib/copy_page.S b/arch/sparc/lib/copy_page.S
index 4d2df328e514..dd16c61f3263 100644
--- a/arch/sparc/lib/copy_page.S
+++ b/arch/sparc/lib/copy_page.S
@@ -46,10 +46,10 @@
46 .type copy_user_page,#function 46 .type copy_user_page,#function
47copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ 47copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
48 lduw [%g6 + TI_PRE_COUNT], %o4 48 lduw [%g6 + TI_PRE_COUNT], %o4
49 sethi %uhi(PAGE_OFFSET), %g2 49 sethi %hi(PAGE_OFFSET), %g2
50 sethi %hi(PAGE_SIZE), %o3 50 sethi %hi(PAGE_SIZE), %o3
51 51
52 sllx %g2, 32, %g2 52 ldx [%g2 + %lo(PAGE_OFFSET)], %g2
53 sethi %hi(PAGE_KERNEL_LOCKED), %g3 53 sethi %hi(PAGE_KERNEL_LOCKED), %g3
54 54
55 ldx [%g3 + %lo(PAGE_KERNEL_LOCKED)], %g3 55 ldx [%g3 + %lo(PAGE_KERNEL_LOCKED)], %g3
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c
index 2ebec263d685..69bb818fdd79 100644
--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -21,6 +21,7 @@
21#include <linux/kprobes.h> 21#include <linux/kprobes.h>
22#include <linux/kdebug.h> 22#include <linux/kdebug.h>
23#include <linux/percpu.h> 23#include <linux/percpu.h>
24#include <linux/context_tracking.h>
24 25
25#include <asm/page.h> 26#include <asm/page.h>
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
@@ -272,6 +273,7 @@ static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs,
272 273
273asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) 274asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
274{ 275{
276 enum ctx_state prev_state = exception_enter();
275 struct mm_struct *mm = current->mm; 277 struct mm_struct *mm = current->mm;
276 struct vm_area_struct *vma; 278 struct vm_area_struct *vma;
277 unsigned int insn = 0; 279 unsigned int insn = 0;
@@ -282,7 +284,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
282 fault_code = get_thread_fault_code(); 284 fault_code = get_thread_fault_code();
283 285
284 if (notify_page_fault(regs)) 286 if (notify_page_fault(regs))
285 return; 287 goto exit_exception;
286 288
287 si_code = SEGV_MAPERR; 289 si_code = SEGV_MAPERR;
288 address = current_thread_info()->fault_address; 290 address = current_thread_info()->fault_address;
@@ -313,7 +315,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
313 /* Valid, no problems... */ 315 /* Valid, no problems... */
314 } else { 316 } else {
315 bad_kernel_pc(regs, address); 317 bad_kernel_pc(regs, address);
316 return; 318 goto exit_exception;
317 } 319 }
318 } else 320 } else
319 flags |= FAULT_FLAG_USER; 321 flags |= FAULT_FLAG_USER;
@@ -430,7 +432,7 @@ good_area:
430 fault = handle_mm_fault(mm, vma, address, flags); 432 fault = handle_mm_fault(mm, vma, address, flags);
431 433
432 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) 434 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
433 return; 435 goto exit_exception;
434 436
435 if (unlikely(fault & VM_FAULT_ERROR)) { 437 if (unlikely(fault & VM_FAULT_ERROR)) {
436 if (fault & VM_FAULT_OOM) 438 if (fault & VM_FAULT_OOM)
@@ -482,6 +484,8 @@ good_area:
482 484
483 } 485 }
484#endif 486#endif
487exit_exception:
488 exception_exit(prev_state);
485 return; 489 return;
486 490
487 /* 491 /*
@@ -494,7 +498,7 @@ bad_area:
494 498
495handle_kernel_fault: 499handle_kernel_fault:
496 do_kernel_fault(regs, si_code, fault_code, insn, address); 500 do_kernel_fault(regs, si_code, fault_code, insn, address);
497 return; 501 goto exit_exception;
498 502
499/* 503/*
500 * We ran out of memory, or some other thing happened to us that made 504 * We ran out of memory, or some other thing happened to us that made
@@ -505,7 +509,7 @@ out_of_memory:
505 up_read(&mm->mmap_sem); 509 up_read(&mm->mmap_sem);
506 if (!(regs->tstate & TSTATE_PRIV)) { 510 if (!(regs->tstate & TSTATE_PRIV)) {
507 pagefault_out_of_memory(); 511 pagefault_out_of_memory();
508 return; 512 goto exit_exception;
509 } 513 }
510 goto handle_kernel_fault; 514 goto handle_kernel_fault;
511 515
diff --git a/arch/sparc/mm/gup.c b/arch/sparc/mm/gup.c
index 01ee23dd724d..c4d3da68b800 100644
--- a/arch/sparc/mm/gup.c
+++ b/arch/sparc/mm/gup.c
@@ -71,13 +71,12 @@ static int gup_huge_pmd(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
71 int *nr) 71 int *nr)
72{ 72{
73 struct page *head, *page, *tail; 73 struct page *head, *page, *tail;
74 u32 mask;
75 int refs; 74 int refs;
76 75
77 mask = PMD_HUGE_PRESENT; 76 if (!pmd_large(pmd))
78 if (write) 77 return 0;
79 mask |= PMD_HUGE_WRITE; 78
80 if ((pmd_val(pmd) & mask) != mask) 79 if (write && !pmd_write(pmd))
81 return 0; 80 return 0;
82 81
83 refs = 0; 82 refs = 0;
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
index 96399646570a..30963178d7e9 100644
--- a/arch/sparc/mm/hugetlbpage.c
+++ b/arch/sparc/mm/hugetlbpage.c
@@ -21,8 +21,6 @@
21/* Slightly simplified from the non-hugepage variant because by 21/* Slightly simplified from the non-hugepage variant because by
22 * definition we don't have to worry about any page coloring stuff 22 * definition we don't have to worry about any page coloring stuff
23 */ 23 */
24#define VA_EXCLUDE_START (0x0000080000000000UL - (1UL << 32UL))
25#define VA_EXCLUDE_END (0xfffff80000000000UL + (1UL << 32UL))
26 24
27static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, 25static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp,
28 unsigned long addr, 26 unsigned long addr,
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index d6de9353ee11..5322e530d09c 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -354,7 +354,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *
354 354
355#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE) 355#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
356 if (mm->context.huge_pte_count && is_hugetlb_pte(pte)) 356 if (mm->context.huge_pte_count && is_hugetlb_pte(pte))
357 __update_mmu_tsb_insert(mm, MM_TSB_HUGE, HPAGE_SHIFT, 357 __update_mmu_tsb_insert(mm, MM_TSB_HUGE, REAL_HPAGE_SHIFT,
358 address, pte_val(pte)); 358 address, pte_val(pte));
359 else 359 else
360#endif 360#endif
@@ -1557,6 +1557,96 @@ unsigned long __init find_ecache_flush_span(unsigned long size)
1557 return ~0UL; 1557 return ~0UL;
1558} 1558}
1559 1559
1560unsigned long PAGE_OFFSET;
1561EXPORT_SYMBOL(PAGE_OFFSET);
1562
1563static void __init page_offset_shift_patch_one(unsigned int *insn, unsigned long phys_bits)
1564{
1565 unsigned long final_shift;
1566 unsigned int val = *insn;
1567 unsigned int cnt;
1568
1569 /* We are patching in ilog2(max_supported_phys_address), and
1570 * we are doing so in a manner similar to a relocation addend.
1571 * That is, we are adding the shift value to whatever value
1572 * is in the shift instruction count field already.
1573 */
1574 cnt = (val & 0x3f);
1575 val &= ~0x3f;
1576
1577 /* If we are trying to shift >= 64 bits, clear the destination
1578 * register. This can happen when phys_bits ends up being equal
1579 * to MAX_PHYS_ADDRESS_BITS.
1580 */
1581 final_shift = (cnt + (64 - phys_bits));
1582 if (final_shift >= 64) {
1583 unsigned int rd = (val >> 25) & 0x1f;
1584
1585 val = 0x80100000 | (rd << 25);
1586 } else {
1587 val |= final_shift;
1588 }
1589 *insn = val;
1590
1591 __asm__ __volatile__("flush %0"
1592 : /* no outputs */
1593 : "r" (insn));
1594}
1595
1596static void __init page_offset_shift_patch(unsigned long phys_bits)
1597{
1598 extern unsigned int __page_offset_shift_patch;
1599 extern unsigned int __page_offset_shift_patch_end;
1600 unsigned int *p;
1601
1602 p = &__page_offset_shift_patch;
1603 while (p < &__page_offset_shift_patch_end) {
1604 unsigned int *insn = (unsigned int *)(unsigned long)*p;
1605
1606 page_offset_shift_patch_one(insn, phys_bits);
1607
1608 p++;
1609 }
1610}
1611
1612static void __init setup_page_offset(void)
1613{
1614 unsigned long max_phys_bits = 40;
1615
1616 if (tlb_type == cheetah || tlb_type == cheetah_plus) {
1617 max_phys_bits = 42;
1618 } else if (tlb_type == hypervisor) {
1619 switch (sun4v_chip_type) {
1620 case SUN4V_CHIP_NIAGARA1:
1621 case SUN4V_CHIP_NIAGARA2:
1622 max_phys_bits = 39;
1623 break;
1624 case SUN4V_CHIP_NIAGARA3:
1625 max_phys_bits = 43;
1626 break;
1627 case SUN4V_CHIP_NIAGARA4:
1628 case SUN4V_CHIP_NIAGARA5:
1629 case SUN4V_CHIP_SPARC64X:
1630 default:
1631 max_phys_bits = 47;
1632 break;
1633 }
1634 }
1635
1636 if (max_phys_bits > MAX_PHYS_ADDRESS_BITS) {
1637 prom_printf("MAX_PHYS_ADDRESS_BITS is too small, need %lu\n",
1638 max_phys_bits);
1639 prom_halt();
1640 }
1641
1642 PAGE_OFFSET = PAGE_OFFSET_BY_BITS(max_phys_bits);
1643
1644 pr_info("PAGE_OFFSET is 0x%016lx (max_phys_bits == %lu)\n",
1645 PAGE_OFFSET, max_phys_bits);
1646
1647 page_offset_shift_patch(max_phys_bits);
1648}
1649
1560static void __init tsb_phys_patch(void) 1650static void __init tsb_phys_patch(void)
1561{ 1651{
1562 struct tsb_ldquad_phys_patch_entry *pquad; 1652 struct tsb_ldquad_phys_patch_entry *pquad;
@@ -1722,7 +1812,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
1722#ifndef CONFIG_DEBUG_PAGEALLOC 1812#ifndef CONFIG_DEBUG_PAGEALLOC
1723 if (cpu_pgsz_mask & HV_PGSZ_MASK_256MB) { 1813 if (cpu_pgsz_mask & HV_PGSZ_MASK_256MB) {
1724 kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^ 1814 kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^
1725 0xfffff80000000000UL; 1815 PAGE_OFFSET;
1726 kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V | 1816 kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V |
1727 _PAGE_P_4V | _PAGE_W_4V); 1817 _PAGE_P_4V | _PAGE_W_4V);
1728 } else { 1818 } else {
@@ -1731,7 +1821,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
1731 1821
1732 if (cpu_pgsz_mask & HV_PGSZ_MASK_2GB) { 1822 if (cpu_pgsz_mask & HV_PGSZ_MASK_2GB) {
1733 kern_linear_pte_xor[2] = (_PAGE_VALID | _PAGE_SZ2GB_4V) ^ 1823 kern_linear_pte_xor[2] = (_PAGE_VALID | _PAGE_SZ2GB_4V) ^
1734 0xfffff80000000000UL; 1824 PAGE_OFFSET;
1735 kern_linear_pte_xor[2] |= (_PAGE_CP_4V | _PAGE_CV_4V | 1825 kern_linear_pte_xor[2] |= (_PAGE_CP_4V | _PAGE_CV_4V |
1736 _PAGE_P_4V | _PAGE_W_4V); 1826 _PAGE_P_4V | _PAGE_W_4V);
1737 } else { 1827 } else {
@@ -1740,7 +1830,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
1740 1830
1741 if (cpu_pgsz_mask & HV_PGSZ_MASK_16GB) { 1831 if (cpu_pgsz_mask & HV_PGSZ_MASK_16GB) {
1742 kern_linear_pte_xor[3] = (_PAGE_VALID | _PAGE_SZ16GB_4V) ^ 1832 kern_linear_pte_xor[3] = (_PAGE_VALID | _PAGE_SZ16GB_4V) ^
1743 0xfffff80000000000UL; 1833 PAGE_OFFSET;
1744 kern_linear_pte_xor[3] |= (_PAGE_CP_4V | _PAGE_CV_4V | 1834 kern_linear_pte_xor[3] |= (_PAGE_CP_4V | _PAGE_CV_4V |
1745 _PAGE_P_4V | _PAGE_W_4V); 1835 _PAGE_P_4V | _PAGE_W_4V);
1746 } else { 1836 } else {
@@ -1752,7 +1842,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
1752/* paging_init() sets up the page tables */ 1842/* paging_init() sets up the page tables */
1753 1843
1754static unsigned long last_valid_pfn; 1844static unsigned long last_valid_pfn;
1755pgd_t swapper_pg_dir[2048]; 1845pgd_t swapper_pg_dir[PTRS_PER_PGD];
1756 1846
1757static void sun4u_pgprot_init(void); 1847static void sun4u_pgprot_init(void);
1758static void sun4v_pgprot_init(void); 1848static void sun4v_pgprot_init(void);
@@ -1763,6 +1853,8 @@ void __init paging_init(void)
1763 unsigned long real_end, i; 1853 unsigned long real_end, i;
1764 int node; 1854 int node;
1765 1855
1856 setup_page_offset();
1857
1766 /* These build time checkes make sure that the dcache_dirty_cpu() 1858 /* These build time checkes make sure that the dcache_dirty_cpu()
1767 * page->flags usage will work. 1859 * page->flags usage will work.
1768 * 1860 *
@@ -2261,10 +2353,10 @@ static void __init sun4u_pgprot_init(void)
2261 __ACCESS_BITS_4U | _PAGE_E_4U); 2353 __ACCESS_BITS_4U | _PAGE_E_4U);
2262 2354
2263#ifdef CONFIG_DEBUG_PAGEALLOC 2355#ifdef CONFIG_DEBUG_PAGEALLOC
2264 kern_linear_pte_xor[0] = _PAGE_VALID ^ 0xfffff80000000000UL; 2356 kern_linear_pte_xor[0] = _PAGE_VALID ^ PAGE_OFFSET;
2265#else 2357#else
2266 kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^ 2358 kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^
2267 0xfffff80000000000UL; 2359 PAGE_OFFSET;
2268#endif 2360#endif
2269 kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U | 2361 kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U |
2270 _PAGE_P_4U | _PAGE_W_4U); 2362 _PAGE_P_4U | _PAGE_W_4U);
@@ -2308,10 +2400,10 @@ static void __init sun4v_pgprot_init(void)
2308 _PAGE_CACHE = _PAGE_CACHE_4V; 2400 _PAGE_CACHE = _PAGE_CACHE_4V;
2309 2401
2310#ifdef CONFIG_DEBUG_PAGEALLOC 2402#ifdef CONFIG_DEBUG_PAGEALLOC
2311 kern_linear_pte_xor[0] = _PAGE_VALID ^ 0xfffff80000000000UL; 2403 kern_linear_pte_xor[0] = _PAGE_VALID ^ PAGE_OFFSET;
2312#else 2404#else
2313 kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^ 2405 kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^
2314 0xfffff80000000000UL; 2406 PAGE_OFFSET;
2315#endif 2407#endif
2316 kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V | 2408 kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V |
2317 _PAGE_P_4V | _PAGE_W_4V); 2409 _PAGE_P_4V | _PAGE_W_4V);
@@ -2455,53 +2547,13 @@ void __flush_tlb_all(void)
2455 : : "r" (pstate)); 2547 : : "r" (pstate));
2456} 2548}
2457 2549
2458static pte_t *get_from_cache(struct mm_struct *mm)
2459{
2460 struct page *page;
2461 pte_t *ret;
2462
2463 spin_lock(&mm->page_table_lock);
2464 page = mm->context.pgtable_page;
2465 ret = NULL;
2466 if (page) {
2467 void *p = page_address(page);
2468
2469 mm->context.pgtable_page = NULL;
2470
2471 ret = (pte_t *) (p + (PAGE_SIZE / 2));
2472 }
2473 spin_unlock(&mm->page_table_lock);
2474
2475 return ret;
2476}
2477
2478static struct page *__alloc_for_cache(struct mm_struct *mm)
2479{
2480 struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK |
2481 __GFP_REPEAT | __GFP_ZERO);
2482
2483 if (page) {
2484 spin_lock(&mm->page_table_lock);
2485 if (!mm->context.pgtable_page) {
2486 atomic_set(&page->_count, 2);
2487 mm->context.pgtable_page = page;
2488 }
2489 spin_unlock(&mm->page_table_lock);
2490 }
2491 return page;
2492}
2493
2494pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 2550pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
2495 unsigned long address) 2551 unsigned long address)
2496{ 2552{
2497 struct page *page; 2553 struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK |
2498 pte_t *pte; 2554 __GFP_REPEAT | __GFP_ZERO);
2499 2555 pte_t *pte = NULL;
2500 pte = get_from_cache(mm);
2501 if (pte)
2502 return pte;
2503 2556
2504 page = __alloc_for_cache(mm);
2505 if (page) 2557 if (page)
2506 pte = (pte_t *) page_address(page); 2558 pte = (pte_t *) page_address(page);
2507 2559
@@ -2511,14 +2563,8 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
2511pgtable_t pte_alloc_one(struct mm_struct *mm, 2563pgtable_t pte_alloc_one(struct mm_struct *mm,
2512 unsigned long address) 2564 unsigned long address)
2513{ 2565{
2514 struct page *page; 2566 struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK |
2515 pte_t *pte; 2567 __GFP_REPEAT | __GFP_ZERO);
2516
2517 pte = get_from_cache(mm);
2518 if (pte)
2519 return pte;
2520
2521 page = __alloc_for_cache(mm);
2522 if (!page) 2568 if (!page)
2523 return NULL; 2569 return NULL;
2524 if (!pgtable_page_ctor(page)) { 2570 if (!pgtable_page_ctor(page)) {
@@ -2530,18 +2576,15 @@ pgtable_t pte_alloc_one(struct mm_struct *mm,
2530 2576
2531void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 2577void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
2532{ 2578{
2533 struct page *page = virt_to_page(pte); 2579 free_page((unsigned long)pte);
2534 if (put_page_testzero(page))
2535 free_hot_cold_page(page, 0);
2536} 2580}
2537 2581
2538static void __pte_free(pgtable_t pte) 2582static void __pte_free(pgtable_t pte)
2539{ 2583{
2540 struct page *page = virt_to_page(pte); 2584 struct page *page = virt_to_page(pte);
2541 if (put_page_testzero(page)) { 2585
2542 pgtable_page_dtor(page); 2586 pgtable_page_dtor(page);
2543 free_hot_cold_page(page, 0); 2587 __free_page(page);
2544 }
2545} 2588}
2546 2589
2547void pte_free(struct mm_struct *mm, pgtable_t pte) 2590void pte_free(struct mm_struct *mm, pgtable_t pte)
@@ -2558,124 +2601,27 @@ void pgtable_free(void *table, bool is_page)
2558} 2601}
2559 2602
2560#ifdef CONFIG_TRANSPARENT_HUGEPAGE 2603#ifdef CONFIG_TRANSPARENT_HUGEPAGE
2561static pmd_t pmd_set_protbits(pmd_t pmd, pgprot_t pgprot, bool for_modify)
2562{
2563 if (pgprot_val(pgprot) & _PAGE_VALID)
2564 pmd_val(pmd) |= PMD_HUGE_PRESENT;
2565 if (tlb_type == hypervisor) {
2566 if (pgprot_val(pgprot) & _PAGE_WRITE_4V)
2567 pmd_val(pmd) |= PMD_HUGE_WRITE;
2568 if (pgprot_val(pgprot) & _PAGE_EXEC_4V)
2569 pmd_val(pmd) |= PMD_HUGE_EXEC;
2570
2571 if (!for_modify) {
2572 if (pgprot_val(pgprot) & _PAGE_ACCESSED_4V)
2573 pmd_val(pmd) |= PMD_HUGE_ACCESSED;
2574 if (pgprot_val(pgprot) & _PAGE_MODIFIED_4V)
2575 pmd_val(pmd) |= PMD_HUGE_DIRTY;
2576 }
2577 } else {
2578 if (pgprot_val(pgprot) & _PAGE_WRITE_4U)
2579 pmd_val(pmd) |= PMD_HUGE_WRITE;
2580 if (pgprot_val(pgprot) & _PAGE_EXEC_4U)
2581 pmd_val(pmd) |= PMD_HUGE_EXEC;
2582
2583 if (!for_modify) {
2584 if (pgprot_val(pgprot) & _PAGE_ACCESSED_4U)
2585 pmd_val(pmd) |= PMD_HUGE_ACCESSED;
2586 if (pgprot_val(pgprot) & _PAGE_MODIFIED_4U)
2587 pmd_val(pmd) |= PMD_HUGE_DIRTY;
2588 }
2589 }
2590
2591 return pmd;
2592}
2593
2594pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
2595{
2596 pmd_t pmd;
2597
2598 pmd_val(pmd) = (page_nr << ((PAGE_SHIFT - PMD_PADDR_SHIFT)));
2599 pmd_val(pmd) |= PMD_ISHUGE;
2600 pmd = pmd_set_protbits(pmd, pgprot, false);
2601 return pmd;
2602}
2603
2604pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
2605{
2606 pmd_val(pmd) &= ~(PMD_HUGE_PRESENT |
2607 PMD_HUGE_WRITE |
2608 PMD_HUGE_EXEC);
2609 pmd = pmd_set_protbits(pmd, newprot, true);
2610 return pmd;
2611}
2612
2613pgprot_t pmd_pgprot(pmd_t entry)
2614{
2615 unsigned long pte = 0;
2616
2617 if (pmd_val(entry) & PMD_HUGE_PRESENT)
2618 pte |= _PAGE_VALID;
2619
2620 if (tlb_type == hypervisor) {
2621 if (pmd_val(entry) & PMD_HUGE_PRESENT)
2622 pte |= _PAGE_PRESENT_4V;
2623 if (pmd_val(entry) & PMD_HUGE_EXEC)
2624 pte |= _PAGE_EXEC_4V;
2625 if (pmd_val(entry) & PMD_HUGE_WRITE)
2626 pte |= _PAGE_W_4V;
2627 if (pmd_val(entry) & PMD_HUGE_ACCESSED)
2628 pte |= _PAGE_ACCESSED_4V;
2629 if (pmd_val(entry) & PMD_HUGE_DIRTY)
2630 pte |= _PAGE_MODIFIED_4V;
2631 pte |= _PAGE_CP_4V|_PAGE_CV_4V;
2632 } else {
2633 if (pmd_val(entry) & PMD_HUGE_PRESENT)
2634 pte |= _PAGE_PRESENT_4U;
2635 if (pmd_val(entry) & PMD_HUGE_EXEC)
2636 pte |= _PAGE_EXEC_4U;
2637 if (pmd_val(entry) & PMD_HUGE_WRITE)
2638 pte |= _PAGE_W_4U;
2639 if (pmd_val(entry) & PMD_HUGE_ACCESSED)
2640 pte |= _PAGE_ACCESSED_4U;
2641 if (pmd_val(entry) & PMD_HUGE_DIRTY)
2642 pte |= _PAGE_MODIFIED_4U;
2643 pte |= _PAGE_CP_4U|_PAGE_CV_4U;
2644 }
2645
2646 return __pgprot(pte);
2647}
2648
2649void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, 2604void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
2650 pmd_t *pmd) 2605 pmd_t *pmd)
2651{ 2606{
2652 unsigned long pte, flags; 2607 unsigned long pte, flags;
2653 struct mm_struct *mm; 2608 struct mm_struct *mm;
2654 pmd_t entry = *pmd; 2609 pmd_t entry = *pmd;
2655 pgprot_t prot;
2656 2610
2657 if (!pmd_large(entry) || !pmd_young(entry)) 2611 if (!pmd_large(entry) || !pmd_young(entry))
2658 return; 2612 return;
2659 2613
2660 pte = (pmd_val(entry) & ~PMD_HUGE_PROTBITS); 2614 pte = pmd_val(entry);
2661 pte <<= PMD_PADDR_SHIFT;
2662 pte |= _PAGE_VALID;
2663
2664 prot = pmd_pgprot(entry);
2665
2666 if (tlb_type == hypervisor)
2667 pgprot_val(prot) |= _PAGE_SZHUGE_4V;
2668 else
2669 pgprot_val(prot) |= _PAGE_SZHUGE_4U;
2670 2615
2671 pte |= pgprot_val(prot); 2616 /* We are fabricating 8MB pages using 4MB real hw pages. */
2617 pte |= (addr & (1UL << REAL_HPAGE_SHIFT));
2672 2618
2673 mm = vma->vm_mm; 2619 mm = vma->vm_mm;
2674 2620
2675 spin_lock_irqsave(&mm->context.lock, flags); 2621 spin_lock_irqsave(&mm->context.lock, flags);
2676 2622
2677 if (mm->context.tsb_block[MM_TSB_HUGE].tsb != NULL) 2623 if (mm->context.tsb_block[MM_TSB_HUGE].tsb != NULL)
2678 __update_mmu_tsb_insert(mm, MM_TSB_HUGE, HPAGE_SHIFT, 2624 __update_mmu_tsb_insert(mm, MM_TSB_HUGE, REAL_HPAGE_SHIFT,
2679 addr, pte); 2625 addr, pte);
2680 2626
2681 spin_unlock_irqrestore(&mm->context.lock, flags); 2627 spin_unlock_irqrestore(&mm->context.lock, flags);
diff --git a/arch/sparc/mm/init_64.h b/arch/sparc/mm/init_64.h
index 0661aa606dec..5d3782deb403 100644
--- a/arch/sparc/mm/init_64.h
+++ b/arch/sparc/mm/init_64.h
@@ -1,11 +1,13 @@
1#ifndef _SPARC64_MM_INIT_H 1#ifndef _SPARC64_MM_INIT_H
2#define _SPARC64_MM_INIT_H 2#define _SPARC64_MM_INIT_H
3 3
4#include <asm/page.h>
5
4/* Most of the symbols in this file are defined in init.c and 6/* Most of the symbols in this file are defined in init.c and
5 * marked non-static so that assembler code can get at them. 7 * marked non-static so that assembler code can get at them.
6 */ 8 */
7 9
8#define MAX_PHYS_ADDRESS (1UL << 41UL) 10#define MAX_PHYS_ADDRESS (1UL << MAX_PHYS_ADDRESS_BITS)
9#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL) 11#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL)
10#define KPTE_BITMAP_BYTES \ 12#define KPTE_BITMAP_BYTES \
11 ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 4) 13 ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 4)
diff --git a/arch/sparc/mm/tlb.c b/arch/sparc/mm/tlb.c
index 656cc46a81f5..ad3bf4b4324d 100644
--- a/arch/sparc/mm/tlb.c
+++ b/arch/sparc/mm/tlb.c
@@ -161,8 +161,8 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr,
161 if (mm == &init_mm) 161 if (mm == &init_mm)
162 return; 162 return;
163 163
164 if ((pmd_val(pmd) ^ pmd_val(orig)) & PMD_ISHUGE) { 164 if ((pmd_val(pmd) ^ pmd_val(orig)) & _PAGE_PMD_HUGE) {
165 if (pmd_val(pmd) & PMD_ISHUGE) 165 if (pmd_val(pmd) & _PAGE_PMD_HUGE)
166 mm->context.huge_pte_count++; 166 mm->context.huge_pte_count++;
167 else 167 else
168 mm->context.huge_pte_count--; 168 mm->context.huge_pte_count--;
@@ -178,13 +178,16 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr,
178 } 178 }
179 179
180 if (!pmd_none(orig)) { 180 if (!pmd_none(orig)) {
181 bool exec = ((pmd_val(orig) & PMD_HUGE_EXEC) != 0); 181 pte_t orig_pte = __pte(pmd_val(orig));
182 bool exec = pte_exec(orig_pte);
182 183
183 addr &= HPAGE_MASK; 184 addr &= HPAGE_MASK;
184 if (pmd_val(orig) & PMD_ISHUGE) 185 if (pmd_trans_huge(orig)) {
185 tlb_batch_add_one(mm, addr, exec); 186 tlb_batch_add_one(mm, addr, exec);
186 else 187 tlb_batch_add_one(mm, addr + REAL_HPAGE_SIZE, exec);
188 } else {
187 tlb_batch_pmd_scan(mm, addr, orig, exec); 189 tlb_batch_pmd_scan(mm, addr, orig, exec);
190 }
188 } 191 }
189} 192}
190 193
diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c
index 2cc3bce5ee91..3b3a360b429a 100644
--- a/arch/sparc/mm/tsb.c
+++ b/arch/sparc/mm/tsb.c
@@ -87,7 +87,7 @@ void flush_tsb_user(struct tlb_batch *tb)
87 nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries; 87 nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries;
88 if (tlb_type == cheetah_plus || tlb_type == hypervisor) 88 if (tlb_type == cheetah_plus || tlb_type == hypervisor)
89 base = __pa(base); 89 base = __pa(base);
90 __flush_tsb_one(tb, HPAGE_SHIFT, base, nentries); 90 __flush_tsb_one(tb, REAL_HPAGE_SHIFT, base, nentries);
91 } 91 }
92#endif 92#endif
93 spin_unlock_irqrestore(&mm->context.lock, flags); 93 spin_unlock_irqrestore(&mm->context.lock, flags);
@@ -111,7 +111,7 @@ void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr)
111 nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries; 111 nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries;
112 if (tlb_type == cheetah_plus || tlb_type == hypervisor) 112 if (tlb_type == cheetah_plus || tlb_type == hypervisor)
113 base = __pa(base); 113 base = __pa(base);
114 __flush_tsb_one_entry(base, vaddr, HPAGE_SHIFT, nentries); 114 __flush_tsb_one_entry(base, vaddr, REAL_HPAGE_SHIFT, nentries);
115 } 115 }
116#endif 116#endif
117 spin_unlock_irqrestore(&mm->context.lock, flags); 117 spin_unlock_irqrestore(&mm->context.lock, flags);
@@ -472,8 +472,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
472 mm->context.huge_pte_count = 0; 472 mm->context.huge_pte_count = 0;
473#endif 473#endif
474 474
475 mm->context.pgtable_page = NULL;
476
477 /* copy_mm() copies over the parent's mm_struct before calling 475 /* copy_mm() copies over the parent's mm_struct before calling
478 * us, so we need to zero out the TSB pointer or else tsb_grow() 476 * us, so we need to zero out the TSB pointer or else tsb_grow()
479 * will be confused and think there is an older TSB to free up. 477 * will be confused and think there is an older TSB to free up.
@@ -512,17 +510,10 @@ static void tsb_destroy_one(struct tsb_config *tp)
512void destroy_context(struct mm_struct *mm) 510void destroy_context(struct mm_struct *mm)
513{ 511{
514 unsigned long flags, i; 512 unsigned long flags, i;
515 struct page *page;
516 513
517 for (i = 0; i < MM_NUM_TSBS; i++) 514 for (i = 0; i < MM_NUM_TSBS; i++)
518 tsb_destroy_one(&mm->context.tsb_block[i]); 515 tsb_destroy_one(&mm->context.tsb_block[i]);
519 516
520 page = mm->context.pgtable_page;
521 if (page && put_page_testzero(page)) {
522 pgtable_page_dtor(page);
523 free_hot_cold_page(page, 0);
524 }
525
526 spin_lock_irqsave(&ctx_alloc_lock, flags); 517 spin_lock_irqsave(&ctx_alloc_lock, flags);
527 518
528 if (CTX_VALID(mm->context)) { 519 if (CTX_VALID(mm->context)) {
diff --git a/arch/sparc/mm/ultra.S b/arch/sparc/mm/ultra.S
index 432aa0cb1b38..b4f4733abc6e 100644
--- a/arch/sparc/mm/ultra.S
+++ b/arch/sparc/mm/ultra.S
@@ -153,10 +153,10 @@ __spitfire_flush_tlb_mm_slow:
153 .globl __flush_icache_page 153 .globl __flush_icache_page
154__flush_icache_page: /* %o0 = phys_page */ 154__flush_icache_page: /* %o0 = phys_page */
155 srlx %o0, PAGE_SHIFT, %o0 155 srlx %o0, PAGE_SHIFT, %o0
156 sethi %uhi(PAGE_OFFSET), %g1 156 sethi %hi(PAGE_OFFSET), %g1
157 sllx %o0, PAGE_SHIFT, %o0 157 sllx %o0, PAGE_SHIFT, %o0
158 sethi %hi(PAGE_SIZE), %g2 158 sethi %hi(PAGE_SIZE), %g2
159 sllx %g1, 32, %g1 159 ldx [%g1 + %lo(PAGE_OFFSET)], %g1
160 add %o0, %g1, %o0 160 add %o0, %g1, %o0
1611: subcc %g2, 32, %g2 1611: subcc %g2, 32, %g2
162 bne,pt %icc, 1b 162 bne,pt %icc, 1b
@@ -178,8 +178,8 @@ __flush_icache_page: /* %o0 = phys_page */
178 .align 64 178 .align 64
179 .globl __flush_dcache_page 179 .globl __flush_dcache_page
180__flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */ 180__flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */
181 sethi %uhi(PAGE_OFFSET), %g1 181 sethi %hi(PAGE_OFFSET), %g1
182 sllx %g1, 32, %g1 182 ldx [%g1 + %lo(PAGE_OFFSET)], %g1
183 sub %o0, %g1, %o0 ! physical address 183 sub %o0, %g1, %o0 ! physical address
184 srlx %o0, 11, %o0 ! make D-cache TAG 184 srlx %o0, 11, %o0 ! make D-cache TAG
185 sethi %hi(1 << 14), %o2 ! D-cache size 185 sethi %hi(1 << 14), %o2 ! D-cache size
@@ -287,8 +287,8 @@ __cheetah_flush_tlb_pending: /* 27 insns */
287 287
288#ifdef DCACHE_ALIASING_POSSIBLE 288#ifdef DCACHE_ALIASING_POSSIBLE
289__cheetah_flush_dcache_page: /* 11 insns */ 289__cheetah_flush_dcache_page: /* 11 insns */
290 sethi %uhi(PAGE_OFFSET), %g1 290 sethi %hi(PAGE_OFFSET), %g1
291 sllx %g1, 32, %g1 291 ldx [%g1 + %lo(PAGE_OFFSET)], %g1
292 sub %o0, %g1, %o0 292 sub %o0, %g1, %o0
293 sethi %hi(PAGE_SIZE), %o4 293 sethi %hi(PAGE_SIZE), %o4
2941: subcc %o4, (1 << 5), %o4 2941: subcc %o4, (1 << 5), %o4
diff --git a/arch/tile/include/asm/hardirq.h b/arch/tile/include/asm/hardirq.h
index 822390f9a154..54110af23985 100644
--- a/arch/tile/include/asm/hardirq.h
+++ b/arch/tile/include/asm/hardirq.h
@@ -42,6 +42,4 @@ DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
42 42
43#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 43#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
44 44
45#define HARDIRQ_BITS 8
46
47#endif /* _ASM_TILE_HARDIRQ_H */ 45#endif /* _ASM_TILE_HARDIRQ_H */
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h
index b8aa6df3e102..729aa107f64e 100644
--- a/arch/tile/include/asm/thread_info.h
+++ b/arch/tile/include/asm/thread_info.h
@@ -113,8 +113,6 @@ extern void _cpu_idle(void);
113 113
114#endif /* !__ASSEMBLY__ */ 114#endif /* !__ASSEMBLY__ */
115 115
116#define PREEMPT_ACTIVE 0x10000000
117
118/* 116/*
119 * Thread information flags that various assembly files may need to access. 117 * Thread information flags that various assembly files may need to access.
120 * Keep flags accessed frequently in low bits, particular since it makes 118 * Keep flags accessed frequently in low bits, particular since it makes
diff --git a/arch/um/Kconfig.char b/arch/um/Kconfig.char
index b9d7c4276682..f10738d68b2d 100644
--- a/arch/um/Kconfig.char
+++ b/arch/um/Kconfig.char
@@ -6,10 +6,6 @@ config STDERR_CONSOLE
6 help 6 help
7 console driver which dumps all printk messages to stderr. 7 console driver which dumps all printk messages to stderr.
8 8
9config STDIO_CONSOLE
10 bool
11 default y
12
13config SSL 9config SSL
14 bool "Virtual serial line" 10 bool "Virtual serial line"
15 help 11 help
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index 8ddea1f8006a..21ca44c4f6d5 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -1,8 +1,3 @@
1config DEFCONFIG_LIST
2 string
3 option defconfig_list
4 default "arch/$ARCH/defconfig"
5
6config UML 1config UML
7 bool 2 bool
8 default y 3 default y
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 133f7de2a13d..36e658a4291c 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -6,6 +6,17 @@
6# Licensed under the GPL 6# Licensed under the GPL
7# 7#
8 8
9# select defconfig based on actual architecture
10ifeq ($(SUBARCH),x86)
11 ifeq ($(shell uname -m),x86_64)
12 KBUILD_DEFCONFIG := x86_64_defconfig
13 else
14 KBUILD_DEFCONFIG := i386_defconfig
15 endif
16else
17 KBUILD_DEFCONFIG := $(SUBARCH)_defconfig
18endif
19
9ARCH_DIR := arch/um 20ARCH_DIR := arch/um
10OS := $(shell uname -s) 21OS := $(shell uname -s)
11# We require bash because the vmlinux link and loader script cpp use bash 22# We require bash because the vmlinux link and loader script cpp use bash
@@ -22,12 +33,11 @@ MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
22 33
23HEADER_ARCH := $(SUBARCH) 34HEADER_ARCH := $(SUBARCH)
24 35
25# Additional ARCH settings for x86 36ifneq ($(filter $(SUBARCH),x86 x86_64 i386),)
26ifeq ($(SUBARCH),i386) 37 HEADER_ARCH := x86
27 HEADER_ARCH := x86
28endif 38endif
29ifeq ($(SUBARCH),x86_64) 39
30 HEADER_ARCH := x86 40ifdef CONFIG_64BIT
31 KBUILD_CFLAGS += -mcmodel=large 41 KBUILD_CFLAGS += -mcmodel=large
32endif 42endif
33 43
diff --git a/arch/um/configs/i386_defconfig b/arch/um/configs/i386_defconfig
new file mode 100644
index 000000000000..a12bf68c9f3a
--- /dev/null
+++ b/arch/um/configs/i386_defconfig
@@ -0,0 +1,76 @@
1CONFIG_3_LEVEL_PGTABLES=y
2# CONFIG_COMPACTION is not set
3CONFIG_BINFMT_MISC=m
4CONFIG_HOSTFS=y
5CONFIG_MAGIC_SYSRQ=y
6CONFIG_KERNEL_STACK_ORDER=1
7CONFIG_SYSVIPC=y
8CONFIG_POSIX_MQUEUE=y
9CONFIG_NO_HZ=y
10CONFIG_HIGH_RES_TIMERS=y
11CONFIG_BSD_PROCESS_ACCT=y
12CONFIG_IKCONFIG=y
13CONFIG_IKCONFIG_PROC=y
14CONFIG_LOG_BUF_SHIFT=14
15CONFIG_CGROUPS=y
16CONFIG_CGROUP_FREEZER=y
17CONFIG_CGROUP_DEVICE=y
18CONFIG_CPUSETS=y
19CONFIG_CGROUP_CPUACCT=y
20CONFIG_RESOURCE_COUNTERS=y
21CONFIG_CGROUP_SCHED=y
22CONFIG_BLK_CGROUP=y
23# CONFIG_PID_NS is not set
24CONFIG_SYSFS_DEPRECATED=y
25CONFIG_CC_OPTIMIZE_FOR_SIZE=y
26CONFIG_SLAB=y
27CONFIG_MODULES=y
28CONFIG_MODULE_UNLOAD=y
29# CONFIG_BLK_DEV_BSG is not set
30CONFIG_IOSCHED_CFQ=m
31CONFIG_SSL=y
32CONFIG_NULL_CHAN=y
33CONFIG_PORT_CHAN=y
34CONFIG_PTY_CHAN=y
35CONFIG_TTY_CHAN=y
36CONFIG_XTERM_CHAN=y
37CONFIG_CON_CHAN="pts"
38CONFIG_SSL_CHAN="pts"
39CONFIG_UML_SOUND=m
40CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
41CONFIG_DEVTMPFS=y
42CONFIG_DEVTMPFS_MOUNT=y
43CONFIG_BLK_DEV_UBD=y
44CONFIG_BLK_DEV_LOOP=m
45CONFIG_BLK_DEV_NBD=m
46CONFIG_DUMMY=m
47CONFIG_TUN=m
48CONFIG_PPP=m
49CONFIG_SLIP=m
50CONFIG_LEGACY_PTY_COUNT=32
51# CONFIG_HW_RANDOM is not set
52CONFIG_UML_RANDOM=y
53CONFIG_NET=y
54CONFIG_PACKET=y
55CONFIG_UNIX=y
56CONFIG_INET=y
57# CONFIG_INET_LRO is not set
58# CONFIG_IPV6 is not set
59CONFIG_UML_NET=y
60CONFIG_UML_NET_ETHERTAP=y
61CONFIG_UML_NET_TUNTAP=y
62CONFIG_UML_NET_SLIP=y
63CONFIG_UML_NET_DAEMON=y
64CONFIG_UML_NET_MCAST=y
65CONFIG_UML_NET_SLIRP=y
66CONFIG_EXT4_FS=y
67CONFIG_REISERFS_FS=y
68CONFIG_QUOTA=y
69CONFIG_AUTOFS4_FS=m
70CONFIG_ISO9660_FS=m
71CONFIG_JOLIET=y
72CONFIG_PROC_KCORE=y
73CONFIG_TMPFS=y
74CONFIG_NLS=y
75CONFIG_DEBUG_INFO=y
76CONFIG_DEBUG_KERNEL=y
diff --git a/arch/um/configs/x86_64_defconfig b/arch/um/configs/x86_64_defconfig
new file mode 100644
index 000000000000..3aab117bd553
--- /dev/null
+++ b/arch/um/configs/x86_64_defconfig
@@ -0,0 +1,75 @@
1# CONFIG_COMPACTION is not set
2CONFIG_BINFMT_MISC=m
3CONFIG_HOSTFS=y
4CONFIG_MAGIC_SYSRQ=y
5CONFIG_SYSVIPC=y
6CONFIG_POSIX_MQUEUE=y
7CONFIG_NO_HZ=y
8CONFIG_HIGH_RES_TIMERS=y
9CONFIG_BSD_PROCESS_ACCT=y
10CONFIG_IKCONFIG=y
11CONFIG_IKCONFIG_PROC=y
12CONFIG_LOG_BUF_SHIFT=14
13CONFIG_CGROUPS=y
14CONFIG_CGROUP_FREEZER=y
15CONFIG_CGROUP_DEVICE=y
16CONFIG_CPUSETS=y
17CONFIG_CGROUP_CPUACCT=y
18CONFIG_RESOURCE_COUNTERS=y
19CONFIG_CGROUP_SCHED=y
20CONFIG_BLK_CGROUP=y
21# CONFIG_PID_NS is not set
22CONFIG_SYSFS_DEPRECATED=y
23CONFIG_CC_OPTIMIZE_FOR_SIZE=y
24CONFIG_SLAB=y
25CONFIG_MODULES=y
26CONFIG_MODULE_UNLOAD=y
27# CONFIG_BLK_DEV_BSG is not set
28CONFIG_IOSCHED_CFQ=m
29CONFIG_SSL=y
30CONFIG_NULL_CHAN=y
31CONFIG_PORT_CHAN=y
32CONFIG_PTY_CHAN=y
33CONFIG_TTY_CHAN=y
34CONFIG_XTERM_CHAN=y
35CONFIG_CON_CHAN="pts"
36CONFIG_SSL_CHAN="pts"
37CONFIG_UML_SOUND=m
38CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
39CONFIG_DEVTMPFS=y
40CONFIG_DEVTMPFS_MOUNT=y
41CONFIG_BLK_DEV_UBD=y
42CONFIG_BLK_DEV_LOOP=m
43CONFIG_BLK_DEV_NBD=m
44CONFIG_DUMMY=m
45CONFIG_TUN=m
46CONFIG_PPP=m
47CONFIG_SLIP=m
48CONFIG_LEGACY_PTY_COUNT=32
49# CONFIG_HW_RANDOM is not set
50CONFIG_UML_RANDOM=y
51CONFIG_NET=y
52CONFIG_PACKET=y
53CONFIG_UNIX=y
54CONFIG_INET=y
55# CONFIG_INET_LRO is not set
56# CONFIG_IPV6 is not set
57CONFIG_UML_NET=y
58CONFIG_UML_NET_ETHERTAP=y
59CONFIG_UML_NET_TUNTAP=y
60CONFIG_UML_NET_SLIP=y
61CONFIG_UML_NET_DAEMON=y
62CONFIG_UML_NET_MCAST=y
63CONFIG_UML_NET_SLIRP=y
64CONFIG_EXT4_FS=y
65CONFIG_REISERFS_FS=y
66CONFIG_QUOTA=y
67CONFIG_AUTOFS4_FS=m
68CONFIG_ISO9660_FS=m
69CONFIG_JOLIET=y
70CONFIG_PROC_KCORE=y
71CONFIG_TMPFS=y
72CONFIG_NLS=y
73CONFIG_DEBUG_INFO=y
74CONFIG_FRAME_WARN=1024
75CONFIG_DEBUG_KERNEL=y
diff --git a/arch/um/defconfig b/arch/um/defconfig
deleted file mode 100644
index 2665e6b683f5..000000000000
--- a/arch/um/defconfig
+++ /dev/null
@@ -1,899 +0,0 @@
1#
2# Automatically generated file; DO NOT EDIT.
3# User Mode Linux/i386 3.3.0 Kernel Configuration
4#
5CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig"
6CONFIG_UML=y
7CONFIG_MMU=y
8CONFIG_NO_IOMEM=y
9# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
10CONFIG_LOCKDEP_SUPPORT=y
11# CONFIG_STACKTRACE_SUPPORT is not set
12CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_GENERIC_BUG=y
14CONFIG_GENERIC_CLOCKEVENTS=y
15CONFIG_HZ=100
16
17#
18# UML-specific options
19#
20
21#
22# Host processor type and features
23#
24# CONFIG_M486 is not set
25# CONFIG_M586 is not set
26# CONFIG_M586TSC is not set
27# CONFIG_M586MMX is not set
28CONFIG_M686=y
29# CONFIG_MPENTIUMII is not set
30# CONFIG_MPENTIUMIII is not set
31# CONFIG_MPENTIUMM is not set
32# CONFIG_MPENTIUM4 is not set
33# CONFIG_MK6 is not set
34# CONFIG_MK7 is not set
35# CONFIG_MK8 is not set
36# CONFIG_MCRUSOE is not set
37# CONFIG_MEFFICEON is not set
38# CONFIG_MWINCHIPC6 is not set
39# CONFIG_MWINCHIP3D is not set
40# CONFIG_MELAN is not set
41# CONFIG_MGEODEGX1 is not set
42# CONFIG_MGEODE_LX is not set
43# CONFIG_MCYRIXIII is not set
44# CONFIG_MVIAC3_2 is not set
45# CONFIG_MVIAC7 is not set
46# CONFIG_MCORE2 is not set
47# CONFIG_MATOM is not set
48# CONFIG_X86_GENERIC is not set
49CONFIG_X86_INTERNODE_CACHE_SHIFT=5
50CONFIG_X86_CMPXCHG=y
51CONFIG_X86_L1_CACHE_SHIFT=5
52CONFIG_X86_XADD=y
53CONFIG_X86_PPRO_FENCE=y
54CONFIG_X86_WP_WORKS_OK=y
55CONFIG_X86_INVLPG=y
56CONFIG_X86_BSWAP=y
57CONFIG_X86_POPAD_OK=y
58CONFIG_X86_USE_PPRO_CHECKSUM=y
59CONFIG_X86_TSC=y
60CONFIG_X86_CMPXCHG64=y
61CONFIG_X86_CMOV=y
62CONFIG_X86_MINIMUM_CPU_FAMILY=5
63CONFIG_CPU_SUP_INTEL=y
64CONFIG_CPU_SUP_CYRIX_32=y
65CONFIG_CPU_SUP_AMD=y
66CONFIG_CPU_SUP_CENTAUR=y
67CONFIG_CPU_SUP_TRANSMETA_32=y
68CONFIG_CPU_SUP_UMC_32=y
69CONFIG_UML_X86=y
70# CONFIG_64BIT is not set
71CONFIG_X86_32=y
72# CONFIG_X86_64 is not set
73# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
74CONFIG_RWSEM_GENERIC_SPINLOCK=y
75# CONFIG_3_LEVEL_PGTABLES is not set
76CONFIG_ARCH_HAS_SC_SIGNALS=y
77CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
78CONFIG_GENERIC_HWEIGHT=y
79# CONFIG_STATIC_LINK is not set
80CONFIG_SELECT_MEMORY_MODEL=y
81CONFIG_FLATMEM_MANUAL=y
82CONFIG_FLATMEM=y
83CONFIG_FLAT_NODE_MEM_MAP=y
84CONFIG_PAGEFLAGS_EXTENDED=y
85CONFIG_SPLIT_PTLOCK_CPUS=4
86# CONFIG_COMPACTION is not set
87# CONFIG_PHYS_ADDR_T_64BIT is not set
88CONFIG_ZONE_DMA_FLAG=0
89CONFIG_VIRT_TO_BUS=y
90# CONFIG_KSM is not set
91CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
92CONFIG_NEED_PER_CPU_KM=y
93# CONFIG_CLEANCACHE is not set
94CONFIG_TICK_ONESHOT=y
95CONFIG_NO_HZ=y
96CONFIG_HIGH_RES_TIMERS=y
97CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
98CONFIG_LD_SCRIPT_DYN=y
99CONFIG_BINFMT_ELF=y
100CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
101CONFIG_HAVE_AOUT=y
102# CONFIG_BINFMT_AOUT is not set
103CONFIG_BINFMT_MISC=m
104CONFIG_HOSTFS=y
105# CONFIG_HPPFS is not set
106CONFIG_MCONSOLE=y
107CONFIG_MAGIC_SYSRQ=y
108CONFIG_KERNEL_STACK_ORDER=0
109# CONFIG_MMAPPER is not set
110CONFIG_NO_DMA=y
111
112#
113# General setup
114#
115CONFIG_EXPERIMENTAL=y
116CONFIG_BROKEN_ON_SMP=y
117CONFIG_INIT_ENV_ARG_LIMIT=128
118CONFIG_CROSS_COMPILE=""
119CONFIG_LOCALVERSION=""
120CONFIG_LOCALVERSION_AUTO=y
121CONFIG_DEFAULT_HOSTNAME="(none)"
122CONFIG_SWAP=y
123CONFIG_SYSVIPC=y
124CONFIG_SYSVIPC_SYSCTL=y
125CONFIG_POSIX_MQUEUE=y
126CONFIG_POSIX_MQUEUE_SYSCTL=y
127CONFIG_BSD_PROCESS_ACCT=y
128# CONFIG_BSD_PROCESS_ACCT_V3 is not set
129# CONFIG_FHANDLE is not set
130# CONFIG_TASKSTATS is not set
131# CONFIG_AUDIT is not set
132
133#
134# IRQ subsystem
135#
136CONFIG_GENERIC_IRQ_SHOW=y
137
138#
139# RCU Subsystem
140#
141CONFIG_TINY_RCU=y
142# CONFIG_PREEMPT_RCU is not set
143# CONFIG_RCU_TRACE is not set
144# CONFIG_TREE_RCU_TRACE is not set
145CONFIG_IKCONFIG=y
146CONFIG_IKCONFIG_PROC=y
147CONFIG_LOG_BUF_SHIFT=14
148CONFIG_CGROUPS=y
149# CONFIG_CGROUP_DEBUG is not set
150CONFIG_CGROUP_FREEZER=y
151CONFIG_CGROUP_DEVICE=y
152CONFIG_CPUSETS=y
153CONFIG_PROC_PID_CPUSET=y
154CONFIG_CGROUP_CPUACCT=y
155CONFIG_RESOURCE_COUNTERS=y
156CONFIG_CGROUP_MEMCG=y
157CONFIG_CGROUP_MEMCG_SWAP=y
158# CONFIG_CGROUP_MEMCG_SWAP_ENABLED is not set
159# CONFIG_CGROUP_MEMCG_KMEM is not set
160CONFIG_CGROUP_SCHED=y
161CONFIG_FAIR_GROUP_SCHED=y
162# CONFIG_CFS_BANDWIDTH is not set
163# CONFIG_RT_GROUP_SCHED is not set
164CONFIG_BLK_CGROUP=y
165# CONFIG_DEBUG_BLK_CGROUP is not set
166# CONFIG_CHECKPOINT_RESTORE is not set
167CONFIG_NAMESPACES=y
168CONFIG_UTS_NS=y
169CONFIG_IPC_NS=y
170# CONFIG_USER_NS is not set
171# CONFIG_PID_NS is not set
172CONFIG_NET_NS=y
173# CONFIG_SCHED_AUTOGROUP is not set
174CONFIG_MM_OWNER=y
175CONFIG_SYSFS_DEPRECATED=y
176# CONFIG_SYSFS_DEPRECATED_V2 is not set
177# CONFIG_RELAY is not set
178# CONFIG_BLK_DEV_INITRD is not set
179CONFIG_CC_OPTIMIZE_FOR_SIZE=y
180CONFIG_SYSCTL=y
181CONFIG_ANON_INODES=y
182# CONFIG_EXPERT is not set
183CONFIG_UID16=y
184# CONFIG_SYSCTL_SYSCALL is not set
185CONFIG_KALLSYMS=y
186# CONFIG_KALLSYMS_ALL is not set
187CONFIG_HOTPLUG=y
188CONFIG_PRINTK=y
189CONFIG_BUG=y
190CONFIG_ELF_CORE=y
191CONFIG_BASE_FULL=y
192CONFIG_FUTEX=y
193CONFIG_EPOLL=y
194CONFIG_SIGNALFD=y
195CONFIG_TIMERFD=y
196CONFIG_EVENTFD=y
197CONFIG_SHMEM=y
198CONFIG_AIO=y
199# CONFIG_EMBEDDED is not set
200
201#
202# Kernel Performance Events And Counters
203#
204CONFIG_VM_EVENT_COUNTERS=y
205CONFIG_COMPAT_BRK=y
206CONFIG_SLAB=y
207# CONFIG_SLUB is not set
208# CONFIG_PROFILING is not set
209
210#
211# GCOV-based kernel profiling
212#
213# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
214CONFIG_SLABINFO=y
215CONFIG_RT_MUTEXES=y
216CONFIG_BASE_SMALL=0
217CONFIG_MODULES=y
218# CONFIG_MODULE_FORCE_LOAD is not set
219CONFIG_MODULE_UNLOAD=y
220# CONFIG_MODULE_FORCE_UNLOAD is not set
221# CONFIG_MODVERSIONS is not set
222# CONFIG_MODULE_SRCVERSION_ALL is not set
223CONFIG_BLOCK=y
224CONFIG_LBDAF=y
225# CONFIG_BLK_DEV_BSG is not set
226# CONFIG_BLK_DEV_BSGLIB is not set
227# CONFIG_BLK_DEV_INTEGRITY is not set
228
229#
230# Partition Types
231#
232# CONFIG_PARTITION_ADVANCED is not set
233CONFIG_MSDOS_PARTITION=y
234
235#
236# IO Schedulers
237#
238CONFIG_IOSCHED_NOOP=y
239CONFIG_IOSCHED_DEADLINE=y
240CONFIG_IOSCHED_CFQ=m
241# CONFIG_CFQ_GROUP_IOSCHED is not set
242CONFIG_DEFAULT_DEADLINE=y
243# CONFIG_DEFAULT_CFQ is not set
244# CONFIG_DEFAULT_NOOP is not set
245CONFIG_DEFAULT_IOSCHED="deadline"
246# CONFIG_INLINE_SPIN_TRYLOCK is not set
247# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
248# CONFIG_INLINE_SPIN_LOCK is not set
249# CONFIG_INLINE_SPIN_LOCK_BH is not set
250# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
251# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
252CONFIG_INLINE_SPIN_UNLOCK=y
253# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
254CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
255# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
256# CONFIG_INLINE_READ_TRYLOCK is not set
257# CONFIG_INLINE_READ_LOCK is not set
258# CONFIG_INLINE_READ_LOCK_BH is not set
259# CONFIG_INLINE_READ_LOCK_IRQ is not set
260# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
261CONFIG_INLINE_READ_UNLOCK=y
262# CONFIG_INLINE_READ_UNLOCK_BH is not set
263CONFIG_INLINE_READ_UNLOCK_IRQ=y
264# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
265# CONFIG_INLINE_WRITE_TRYLOCK is not set
266# CONFIG_INLINE_WRITE_LOCK is not set
267# CONFIG_INLINE_WRITE_LOCK_BH is not set
268# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
269# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
270CONFIG_INLINE_WRITE_UNLOCK=y
271# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
272CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
273# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
274# CONFIG_MUTEX_SPIN_ON_OWNER is not set
275CONFIG_FREEZER=y
276
277#
278# UML Character Devices
279#
280CONFIG_STDERR_CONSOLE=y
281CONFIG_STDIO_CONSOLE=y
282CONFIG_SSL=y
283CONFIG_NULL_CHAN=y
284CONFIG_PORT_CHAN=y
285CONFIG_PTY_CHAN=y
286CONFIG_TTY_CHAN=y
287CONFIG_XTERM_CHAN=y
288# CONFIG_NOCONFIG_CHAN is not set
289CONFIG_CON_ZERO_CHAN="fd:0,fd:1"
290CONFIG_CON_CHAN="xterm"
291CONFIG_SSL_CHAN="pts"
292CONFIG_UML_SOUND=m
293CONFIG_SOUND=m
294CONFIG_SOUND_OSS_CORE=y
295CONFIG_HOSTAUDIO=m
296
297#
298# Device Drivers
299#
300
301#
302# Generic Driver Options
303#
304CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
305CONFIG_DEVTMPFS=y
306CONFIG_DEVTMPFS_MOUNT=y
307CONFIG_STANDALONE=y
308CONFIG_PREVENT_FIRMWARE_BUILD=y
309CONFIG_FW_LOADER=y
310CONFIG_FIRMWARE_IN_KERNEL=y
311CONFIG_EXTRA_FIRMWARE=""
312# CONFIG_DEBUG_DRIVER is not set
313# CONFIG_DEBUG_DEVRES is not set
314# CONFIG_SYS_HYPERVISOR is not set
315CONFIG_GENERIC_CPU_DEVICES=y
316# CONFIG_DMA_SHARED_BUFFER is not set
317# CONFIG_CONNECTOR is not set
318# CONFIG_MTD is not set
319CONFIG_BLK_DEV=y
320CONFIG_BLK_DEV_UBD=y
321# CONFIG_BLK_DEV_UBD_SYNC is not set
322CONFIG_BLK_DEV_COW_COMMON=y
323CONFIG_BLK_DEV_LOOP=m
324CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
325# CONFIG_BLK_DEV_CRYPTOLOOP is not set
326
327#
328# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
329#
330CONFIG_BLK_DEV_NBD=m
331# CONFIG_BLK_DEV_RAM is not set
332# CONFIG_ATA_OVER_ETH is not set
333# CONFIG_BLK_DEV_RBD is not set
334
335#
336# Misc devices
337#
338# CONFIG_ENCLOSURE_SERVICES is not set
339# CONFIG_C2PORT is not set
340
341#
342# EEPROM support
343#
344# CONFIG_EEPROM_93CX6 is not set
345
346#
347# Texas Instruments shared transport line discipline
348#
349
350#
351# Altera FPGA firmware download module
352#
353
354#
355# SCSI device support
356#
357CONFIG_SCSI_MOD=y
358# CONFIG_RAID_ATTRS is not set
359# CONFIG_SCSI is not set
360# CONFIG_SCSI_DMA is not set
361# CONFIG_SCSI_NETLINK is not set
362# CONFIG_MD is not set
363CONFIG_NETDEVICES=y
364CONFIG_NET_CORE=y
365# CONFIG_BONDING is not set
366CONFIG_DUMMY=m
367# CONFIG_EQUALIZER is not set
368# CONFIG_MII is not set
369# CONFIG_NET_TEAM is not set
370# CONFIG_MACVLAN is not set
371# CONFIG_NETCONSOLE is not set
372# CONFIG_NETPOLL is not set
373# CONFIG_NET_POLL_CONTROLLER is not set
374CONFIG_TUN=m
375# CONFIG_VETH is not set
376
377#
378# CAIF transport drivers
379#
380CONFIG_ETHERNET=y
381CONFIG_NET_VENDOR_CHELSIO=y
382CONFIG_NET_VENDOR_INTEL=y
383CONFIG_NET_VENDOR_I825XX=y
384CONFIG_NET_VENDOR_MARVELL=y
385CONFIG_NET_VENDOR_NATSEMI=y
386CONFIG_NET_VENDOR_8390=y
387# CONFIG_PHYLIB is not set
388CONFIG_PPP=m
389# CONFIG_PPP_BSDCOMP is not set
390# CONFIG_PPP_DEFLATE is not set
391# CONFIG_PPP_FILTER is not set
392# CONFIG_PPP_MPPE is not set
393# CONFIG_PPP_MULTILINK is not set
394# CONFIG_PPPOE is not set
395# CONFIG_PPP_ASYNC is not set
396# CONFIG_PPP_SYNC_TTY is not set
397CONFIG_SLIP=m
398CONFIG_SLHC=m
399# CONFIG_SLIP_COMPRESSED is not set
400# CONFIG_SLIP_SMART is not set
401# CONFIG_SLIP_MODE_SLIP6 is not set
402CONFIG_WLAN=y
403# CONFIG_HOSTAP is not set
404
405#
406# Enable WiMAX (Networking options) to see the WiMAX drivers
407#
408# CONFIG_WAN is not set
409
410#
411# Character devices
412#
413CONFIG_UNIX98_PTYS=y
414# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
415CONFIG_LEGACY_PTYS=y
416CONFIG_LEGACY_PTY_COUNT=32
417# CONFIG_N_GSM is not set
418# CONFIG_TRACE_SINK is not set
419CONFIG_DEVKMEM=y
420# CONFIG_HW_RANDOM is not set
421CONFIG_UML_RANDOM=y
422# CONFIG_R3964 is not set
423# CONFIG_NSC_GPIO is not set
424# CONFIG_RAW_DRIVER is not set
425
426#
427# PPS support
428#
429# CONFIG_PPS is not set
430
431#
432# PPS generators support
433#
434
435#
436# PTP clock support
437#
438
439#
440# Enable Device Drivers -> PPS to see the PTP clock options.
441#
442# CONFIG_POWER_SUPPLY is not set
443# CONFIG_THERMAL is not set
444# CONFIG_WATCHDOG is not set
445# CONFIG_REGULATOR is not set
446CONFIG_SOUND_OSS_CORE_PRECLAIM=y
447# CONFIG_MEMSTICK is not set
448# CONFIG_NEW_LEDS is not set
449# CONFIG_ACCESSIBILITY is not set
450# CONFIG_AUXDISPLAY is not set
451# CONFIG_UIO is not set
452
453#
454# Virtio drivers
455#
456# CONFIG_VIRTIO_BALLOON is not set
457
458#
459# Microsoft Hyper-V guest support
460#
461# CONFIG_STAGING is not set
462
463#
464# Hardware Spinlock drivers
465#
466CONFIG_IOMMU_SUPPORT=y
467# CONFIG_VIRT_DRIVERS is not set
468# CONFIG_PM_DEVFREQ is not set
469CONFIG_NET=y
470
471#
472# Networking options
473#
474CONFIG_PACKET=y
475CONFIG_UNIX=y
476# CONFIG_UNIX_DIAG is not set
477CONFIG_XFRM=y
478# CONFIG_XFRM_USER is not set
479# CONFIG_XFRM_SUB_POLICY is not set
480# CONFIG_XFRM_MIGRATE is not set
481# CONFIG_XFRM_STATISTICS is not set
482# CONFIG_NET_KEY is not set
483CONFIG_INET=y
484# CONFIG_IP_MULTICAST is not set
485# CONFIG_IP_ADVANCED_ROUTER is not set
486# CONFIG_IP_PNP is not set
487# CONFIG_NET_IPIP is not set
488# CONFIG_NET_IPGRE_DEMUX is not set
489# CONFIG_ARPD is not set
490# CONFIG_SYN_COOKIES is not set
491# CONFIG_INET_AH is not set
492# CONFIG_INET_ESP is not set
493# CONFIG_INET_IPCOMP is not set
494# CONFIG_INET_XFRM_TUNNEL is not set
495# CONFIG_INET_TUNNEL is not set
496CONFIG_INET_XFRM_MODE_TRANSPORT=y
497CONFIG_INET_XFRM_MODE_TUNNEL=y
498CONFIG_INET_XFRM_MODE_BEET=y
499# CONFIG_INET_LRO is not set
500CONFIG_INET_DIAG=y
501CONFIG_INET_TCP_DIAG=y
502# CONFIG_INET_UDP_DIAG is not set
503# CONFIG_TCP_CONG_ADVANCED is not set
504CONFIG_TCP_CONG_CUBIC=y
505CONFIG_DEFAULT_TCP_CONG="cubic"
506# CONFIG_TCP_MD5SIG is not set
507# CONFIG_IPV6 is not set
508# CONFIG_NETWORK_SECMARK is not set
509# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
510# CONFIG_NETFILTER is not set
511# CONFIG_IP_DCCP is not set
512# CONFIG_IP_SCTP is not set
513# CONFIG_RDS is not set
514# CONFIG_TIPC is not set
515# CONFIG_ATM is not set
516# CONFIG_L2TP is not set
517# CONFIG_BRIDGE is not set
518# CONFIG_NET_DSA is not set
519# CONFIG_VLAN_8021Q is not set
520# CONFIG_DECNET is not set
521# CONFIG_LLC2 is not set
522# CONFIG_IPX is not set
523# CONFIG_ATALK is not set
524# CONFIG_X25 is not set
525# CONFIG_LAPB is not set
526# CONFIG_ECONET is not set
527# CONFIG_WAN_ROUTER is not set
528# CONFIG_PHONET is not set
529# CONFIG_IEEE802154 is not set
530# CONFIG_NET_SCHED is not set
531# CONFIG_DCB is not set
532# CONFIG_BATMAN_ADV is not set
533# CONFIG_OPENVSWITCH is not set
534# CONFIG_NETPRIO_CGROUP is not set
535CONFIG_BQL=y
536
537#
538# Network testing
539#
540# CONFIG_NET_PKTGEN is not set
541# CONFIG_HAMRADIO is not set
542# CONFIG_CAN is not set
543# CONFIG_IRDA is not set
544# CONFIG_BT is not set
545# CONFIG_AF_RXRPC is not set
546CONFIG_WIRELESS=y
547# CONFIG_CFG80211 is not set
548# CONFIG_LIB80211 is not set
549
550#
551# CFG80211 needs to be enabled for MAC80211
552#
553# CONFIG_WIMAX is not set
554# CONFIG_RFKILL is not set
555# CONFIG_NET_9P is not set
556# CONFIG_CAIF is not set
557# CONFIG_CEPH_LIB is not set
558# CONFIG_NFC is not set
559
560#
561# UML Network Devices
562#
563CONFIG_UML_NET=y
564CONFIG_UML_NET_ETHERTAP=y
565CONFIG_UML_NET_TUNTAP=y
566CONFIG_UML_NET_SLIP=y
567CONFIG_UML_NET_DAEMON=y
568# CONFIG_UML_NET_VDE is not set
569CONFIG_UML_NET_MCAST=y
570# CONFIG_UML_NET_PCAP is not set
571CONFIG_UML_NET_SLIRP=y
572
573#
574# File systems
575#
576# CONFIG_EXT2_FS is not set
577# CONFIG_EXT3_FS is not set
578CONFIG_EXT4_FS=y
579CONFIG_EXT4_USE_FOR_EXT23=y
580CONFIG_EXT4_FS_XATTR=y
581# CONFIG_EXT4_FS_POSIX_ACL is not set
582# CONFIG_EXT4_FS_SECURITY is not set
583# CONFIG_EXT4_DEBUG is not set
584CONFIG_JBD2=y
585CONFIG_FS_MBCACHE=y
586CONFIG_REISERFS_FS=y
587# CONFIG_REISERFS_CHECK is not set
588# CONFIG_REISERFS_PROC_INFO is not set
589# CONFIG_REISERFS_FS_XATTR is not set
590# CONFIG_JFS_FS is not set
591# CONFIG_XFS_FS is not set
592# CONFIG_GFS2_FS is not set
593# CONFIG_BTRFS_FS is not set
594# CONFIG_NILFS2_FS is not set
595# CONFIG_FS_POSIX_ACL is not set
596CONFIG_FILE_LOCKING=y
597CONFIG_FSNOTIFY=y
598CONFIG_DNOTIFY=y
599CONFIG_INOTIFY_USER=y
600# CONFIG_FANOTIFY is not set
601CONFIG_QUOTA=y
602# CONFIG_QUOTA_NETLINK_INTERFACE is not set
603CONFIG_PRINT_QUOTA_WARNING=y
604# CONFIG_QUOTA_DEBUG is not set
605# CONFIG_QFMT_V1 is not set
606# CONFIG_QFMT_V2 is not set
607CONFIG_QUOTACTL=y
608CONFIG_AUTOFS4_FS=m
609# CONFIG_FUSE_FS is not set
610
611#
612# Caches
613#
614# CONFIG_FSCACHE is not set
615
616#
617# CD-ROM/DVD Filesystems
618#
619CONFIG_ISO9660_FS=m
620CONFIG_JOLIET=y
621# CONFIG_ZISOFS is not set
622# CONFIG_UDF_FS is not set
623
624#
625# DOS/FAT/NT Filesystems
626#
627# CONFIG_MSDOS_FS is not set
628# CONFIG_VFAT_FS is not set
629# CONFIG_NTFS_FS is not set
630
631#
632# Pseudo filesystems
633#
634CONFIG_PROC_FS=y
635CONFIG_PROC_KCORE=y
636CONFIG_PROC_SYSCTL=y
637CONFIG_PROC_PAGE_MONITOR=y
638CONFIG_SYSFS=y
639CONFIG_TMPFS=y
640# CONFIG_TMPFS_POSIX_ACL is not set
641# CONFIG_TMPFS_XATTR is not set
642# CONFIG_HUGETLB_PAGE is not set
643# CONFIG_CONFIGFS_FS is not set
644CONFIG_MISC_FILESYSTEMS=y
645# CONFIG_ADFS_FS is not set
646# CONFIG_AFFS_FS is not set
647# CONFIG_HFS_FS is not set
648# CONFIG_HFSPLUS_FS is not set
649# CONFIG_BEFS_FS is not set
650# CONFIG_BFS_FS is not set
651# CONFIG_EFS_FS is not set
652# CONFIG_LOGFS is not set
653# CONFIG_CRAMFS is not set
654# CONFIG_SQUASHFS is not set
655# CONFIG_VXFS_FS is not set
656# CONFIG_MINIX_FS is not set
657# CONFIG_OMFS_FS is not set
658# CONFIG_HPFS_FS is not set
659# CONFIG_QNX4FS_FS is not set
660# CONFIG_ROMFS_FS is not set
661# CONFIG_PSTORE is not set
662# CONFIG_SYSV_FS is not set
663# CONFIG_UFS_FS is not set
664CONFIG_NETWORK_FILESYSTEMS=y
665# CONFIG_NFS_FS is not set
666# CONFIG_NFSD is not set
667# CONFIG_CEPH_FS is not set
668# CONFIG_CIFS is not set
669# CONFIG_NCP_FS is not set
670# CONFIG_CODA_FS is not set
671# CONFIG_AFS_FS is not set
672CONFIG_NLS=y
673CONFIG_NLS_DEFAULT="iso8859-1"
674# CONFIG_NLS_CODEPAGE_437 is not set
675# CONFIG_NLS_CODEPAGE_737 is not set
676# CONFIG_NLS_CODEPAGE_775 is not set
677# CONFIG_NLS_CODEPAGE_850 is not set
678# CONFIG_NLS_CODEPAGE_852 is not set
679# CONFIG_NLS_CODEPAGE_855 is not set
680# CONFIG_NLS_CODEPAGE_857 is not set
681# CONFIG_NLS_CODEPAGE_860 is not set
682# CONFIG_NLS_CODEPAGE_861 is not set
683# CONFIG_NLS_CODEPAGE_862 is not set
684# CONFIG_NLS_CODEPAGE_863 is not set
685# CONFIG_NLS_CODEPAGE_864 is not set
686# CONFIG_NLS_CODEPAGE_865 is not set
687# CONFIG_NLS_CODEPAGE_866 is not set
688# CONFIG_NLS_CODEPAGE_869 is not set
689# CONFIG_NLS_CODEPAGE_936 is not set
690# CONFIG_NLS_CODEPAGE_950 is not set
691# CONFIG_NLS_CODEPAGE_932 is not set
692# CONFIG_NLS_CODEPAGE_949 is not set
693# CONFIG_NLS_CODEPAGE_874 is not set
694# CONFIG_NLS_ISO8859_8 is not set
695# CONFIG_NLS_CODEPAGE_1250 is not set
696# CONFIG_NLS_CODEPAGE_1251 is not set
697# CONFIG_NLS_ASCII is not set
698# CONFIG_NLS_ISO8859_1 is not set
699# CONFIG_NLS_ISO8859_2 is not set
700# CONFIG_NLS_ISO8859_3 is not set
701# CONFIG_NLS_ISO8859_4 is not set
702# CONFIG_NLS_ISO8859_5 is not set
703# CONFIG_NLS_ISO8859_6 is not set
704# CONFIG_NLS_ISO8859_7 is not set
705# CONFIG_NLS_ISO8859_9 is not set
706# CONFIG_NLS_ISO8859_13 is not set
707# CONFIG_NLS_ISO8859_14 is not set
708# CONFIG_NLS_ISO8859_15 is not set
709# CONFIG_NLS_KOI8_R is not set
710# CONFIG_NLS_KOI8_U is not set
711# CONFIG_NLS_UTF8 is not set
712
713#
714# Security options
715#
716# CONFIG_KEYS is not set
717# CONFIG_SECURITY_DMESG_RESTRICT is not set
718# CONFIG_SECURITY is not set
719# CONFIG_SECURITYFS is not set
720CONFIG_DEFAULT_SECURITY_DAC=y
721CONFIG_DEFAULT_SECURITY=""
722CONFIG_CRYPTO=y
723
724#
725# Crypto core or helper
726#
727# CONFIG_CRYPTO_FIPS is not set
728CONFIG_CRYPTO_ALGAPI=m
729CONFIG_CRYPTO_ALGAPI2=m
730CONFIG_CRYPTO_RNG=m
731CONFIG_CRYPTO_RNG2=m
732# CONFIG_CRYPTO_MANAGER is not set
733# CONFIG_CRYPTO_MANAGER2 is not set
734# CONFIG_CRYPTO_USER is not set
735# CONFIG_CRYPTO_GF128MUL is not set
736# CONFIG_CRYPTO_NULL is not set
737# CONFIG_CRYPTO_CRYPTD is not set
738# CONFIG_CRYPTO_AUTHENC is not set
739# CONFIG_CRYPTO_TEST is not set
740
741#
742# Authenticated Encryption with Associated Data
743#
744# CONFIG_CRYPTO_CCM is not set
745# CONFIG_CRYPTO_GCM is not set
746# CONFIG_CRYPTO_SEQIV is not set
747
748#
749# Block modes
750#
751# CONFIG_CRYPTO_CBC is not set
752# CONFIG_CRYPTO_CTR is not set
753# CONFIG_CRYPTO_CTS is not set
754# CONFIG_CRYPTO_ECB is not set
755# CONFIG_CRYPTO_LRW is not set
756# CONFIG_CRYPTO_PCBC is not set
757# CONFIG_CRYPTO_XTS is not set
758
759#
760# Hash modes
761#
762# CONFIG_CRYPTO_HMAC is not set
763# CONFIG_CRYPTO_XCBC is not set
764# CONFIG_CRYPTO_VMAC is not set
765
766#
767# Digest
768#
769# CONFIG_CRYPTO_CRC32C is not set
770# CONFIG_CRYPTO_GHASH is not set
771# CONFIG_CRYPTO_MD4 is not set
772# CONFIG_CRYPTO_MD5 is not set
773# CONFIG_CRYPTO_MICHAEL_MIC is not set
774# CONFIG_CRYPTO_RMD128 is not set
775# CONFIG_CRYPTO_RMD160 is not set
776# CONFIG_CRYPTO_RMD256 is not set
777# CONFIG_CRYPTO_RMD320 is not set
778# CONFIG_CRYPTO_SHA1 is not set
779# CONFIG_CRYPTO_SHA256 is not set
780# CONFIG_CRYPTO_SHA512 is not set
781# CONFIG_CRYPTO_TGR192 is not set
782# CONFIG_CRYPTO_WP512 is not set
783
784#
785# Ciphers
786#
787CONFIG_CRYPTO_AES=m
788# CONFIG_CRYPTO_AES_586 is not set
789# CONFIG_CRYPTO_ANUBIS is not set
790# CONFIG_CRYPTO_ARC4 is not set
791# CONFIG_CRYPTO_BLOWFISH is not set
792# CONFIG_CRYPTO_CAMELLIA is not set
793# CONFIG_CRYPTO_CAST5 is not set
794# CONFIG_CRYPTO_CAST6 is not set
795# CONFIG_CRYPTO_DES is not set
796# CONFIG_CRYPTO_FCRYPT is not set
797# CONFIG_CRYPTO_KHAZAD is not set
798# CONFIG_CRYPTO_SALSA20 is not set
799# CONFIG_CRYPTO_SALSA20_586 is not set
800# CONFIG_CRYPTO_SEED is not set
801# CONFIG_CRYPTO_SERPENT is not set
802# CONFIG_CRYPTO_TEA is not set
803# CONFIG_CRYPTO_TWOFISH is not set
804# CONFIG_CRYPTO_TWOFISH_586 is not set
805
806#
807# Compression
808#
809# CONFIG_CRYPTO_DEFLATE is not set
810# CONFIG_CRYPTO_ZLIB is not set
811# CONFIG_CRYPTO_LZO is not set
812
813#
814# Random Number Generation
815#
816CONFIG_CRYPTO_ANSI_CPRNG=m
817# CONFIG_CRYPTO_USER_API_HASH is not set
818# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
819CONFIG_CRYPTO_HW=y
820# CONFIG_BINARY_PRINTF is not set
821
822#
823# Library routines
824#
825CONFIG_BITREVERSE=y
826CONFIG_GENERIC_FIND_FIRST_BIT=y
827CONFIG_GENERIC_IO=y
828# CONFIG_CRC_CCITT is not set
829CONFIG_CRC16=y
830# CONFIG_CRC_T10DIF is not set
831# CONFIG_CRC_ITU_T is not set
832CONFIG_CRC32=y
833# CONFIG_CRC7 is not set
834# CONFIG_LIBCRC32C is not set
835# CONFIG_CRC8 is not set
836# CONFIG_XZ_DEC is not set
837# CONFIG_XZ_DEC_BCJ is not set
838CONFIG_DQL=y
839CONFIG_NLATTR=y
840# CONFIG_AVERAGE is not set
841# CONFIG_CORDIC is not set
842
843#
844# Kernel hacking
845#
846# CONFIG_PRINTK_TIME is not set
847CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
848CONFIG_ENABLE_WARN_DEPRECATED=y
849CONFIG_ENABLE_MUST_CHECK=y
850CONFIG_FRAME_WARN=1024
851# CONFIG_STRIP_ASM_SYMS is not set
852# CONFIG_UNUSED_SYMBOLS is not set
853# CONFIG_DEBUG_FS is not set
854# CONFIG_DEBUG_SECTION_MISMATCH is not set
855CONFIG_DEBUG_KERNEL=y
856# CONFIG_DEBUG_SHIRQ is not set
857# CONFIG_LOCKUP_DETECTOR is not set
858# CONFIG_HARDLOCKUP_DETECTOR is not set
859# CONFIG_DETECT_HUNG_TASK is not set
860CONFIG_SCHED_DEBUG=y
861# CONFIG_SCHEDSTATS is not set
862# CONFIG_TIMER_STATS is not set
863# CONFIG_DEBUG_OBJECTS is not set
864# CONFIG_DEBUG_SLAB is not set
865# CONFIG_DEBUG_RT_MUTEXES is not set
866# CONFIG_RT_MUTEX_TESTER is not set
867# CONFIG_DEBUG_SPINLOCK is not set
868# CONFIG_DEBUG_MUTEXES is not set
869# CONFIG_SPARSE_RCU_POINTER is not set
870# CONFIG_DEBUG_ATOMIC_SLEEP is not set
871# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
872# CONFIG_DEBUG_STACK_USAGE is not set
873# CONFIG_DEBUG_KOBJECT is not set
874CONFIG_DEBUG_BUGVERBOSE=y
875CONFIG_DEBUG_INFO=y
876# CONFIG_DEBUG_INFO_REDUCED is not set
877# CONFIG_DEBUG_VM is not set
878# CONFIG_DEBUG_WRITECOUNT is not set
879CONFIG_DEBUG_MEMORY_INIT=y
880# CONFIG_DEBUG_LIST is not set
881# CONFIG_TEST_LIST_SORT is not set
882# CONFIG_DEBUG_SG is not set
883# CONFIG_DEBUG_NOTIFIERS is not set
884# CONFIG_DEBUG_CREDENTIALS is not set
885CONFIG_FRAME_POINTER=y
886# CONFIG_BOOT_PRINTK_DELAY is not set
887# CONFIG_RCU_TORTURE_TEST is not set
888# CONFIG_BACKTRACE_SELF_TEST is not set
889# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
890# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
891# CONFIG_FAULT_INJECTION is not set
892# CONFIG_SYSCTL_SYSCALL_CHECK is not set
893# CONFIG_DEBUG_PAGEALLOC is not set
894# CONFIG_ATOMIC64_SELFTEST is not set
895# CONFIG_SAMPLES is not set
896# CONFIG_TEST_KSTRTOX is not set
897# CONFIG_GPROF is not set
898# CONFIG_GCOV is not set
899CONFIG_EARLY_PRINTK=y
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 3df3bd544492..29880c9b324e 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -645,11 +645,9 @@ void mconsole_sysrq(struct mc_request *req)
645 645
646static void stack_proc(void *arg) 646static void stack_proc(void *arg)
647{ 647{
648 struct task_struct *from = current, *to = arg; 648 struct task_struct *task = arg;
649 649
650 to->thread.saved_task = from; 650 show_stack(task, NULL);
651 rcu_user_hooks_switch(from, to);
652 switch_to(from, to, from);
653} 651}
654 652
655/* 653/*
diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h
index c03cd5a02364..d89b02bb6262 100644
--- a/arch/um/include/asm/processor-generic.h
+++ b/arch/um/include/asm/processor-generic.h
@@ -19,8 +19,8 @@ struct task_struct;
19struct mm_struct; 19struct mm_struct;
20 20
21struct thread_struct { 21struct thread_struct {
22 struct task_struct *saved_task;
23 struct pt_regs regs; 22 struct pt_regs regs;
23 struct pt_regs *segv_regs;
24 int singlestep_syscall; 24 int singlestep_syscall;
25 void *fault_addr; 25 void *fault_addr;
26 jmp_buf *fault_catcher; 26 jmp_buf *fault_catcher;
diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index 2c8eeb2df8b4..1c5b2a83046a 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void)
60 60
61#endif 61#endif
62 62
63#define PREEMPT_ACTIVE 0x10000000
64
65#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 63#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
66#define TIF_SIGPENDING 1 /* signal pending */ 64#define TIF_SIGPENDING 1 /* signal pending */
67#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 65#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h
index 694c792bab4e..41c8c774ec10 100644
--- a/arch/um/include/shared/as-layout.h
+++ b/arch/um/include/shared/as-layout.h
@@ -44,7 +44,6 @@ struct cpu_task {
44 44
45extern struct cpu_task cpu_tasks[]; 45extern struct cpu_task cpu_tasks[];
46 46
47extern unsigned long low_physmem;
48extern unsigned long high_physmem; 47extern unsigned long high_physmem;
49extern unsigned long uml_physmem; 48extern unsigned long uml_physmem;
50extern unsigned long uml_reserved; 49extern unsigned long uml_reserved;
@@ -52,8 +51,6 @@ extern unsigned long end_vm;
52extern unsigned long start_vm; 51extern unsigned long start_vm;
53extern unsigned long long highmem; 52extern unsigned long long highmem;
54 53
55extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
56extern unsigned long _unprotected_end;
57extern unsigned long brk_start; 54extern unsigned long brk_start;
58 55
59extern unsigned long host_task_size; 56extern unsigned long host_task_size;
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h
index 021104d98cb3..75298d3358e7 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
@@ -227,6 +227,7 @@ extern void block_signals(void);
227extern void unblock_signals(void); 227extern void unblock_signals(void);
228extern int get_signals(void); 228extern int get_signals(void);
229extern int set_signals(int enable); 229extern int set_signals(int enable);
230extern int os_is_signal_stack(void);
230 231
231/* util.c */ 232/* util.c */
232extern void stack_protections(unsigned long address); 233extern void stack_protections(unsigned long address);
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index bbcef522bcb1..eecc4142764c 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -82,19 +82,8 @@ void *__switch_to(struct task_struct *from, struct task_struct *to)
82 to->thread.prev_sched = from; 82 to->thread.prev_sched = from;
83 set_current(to); 83 set_current(to);
84 84
85 do { 85 switch_threads(&from->thread.switch_buf, &to->thread.switch_buf);
86 current->thread.saved_task = NULL; 86 arch_switch_to(current);
87
88 switch_threads(&from->thread.switch_buf,
89 &to->thread.switch_buf);
90
91 arch_switch_to(current);
92
93 if (current->thread.saved_task)
94 show_regs(&(current->thread.regs));
95 to = current->thread.saved_task;
96 from = current;
97 } while (current->thread.saved_task);
98 87
99 return current->thread.prev_sched; 88 return current->thread.prev_sched;
100} 89}
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c
index 0dc4d1c6f98a..799d7e413bf5 100644
--- a/arch/um/kernel/sysrq.c
+++ b/arch/um/kernel/sysrq.c
@@ -1,6 +1,10 @@
1/* 1/*
2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Copyright (C) 2013 Richard Weinberger <richrd@nod.at>
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.
4 */ 8 */
5 9
6#include <linux/kallsyms.h> 10#include <linux/kallsyms.h>
@@ -8,59 +12,87 @@
8#include <linux/module.h> 12#include <linux/module.h>
9#include <linux/sched.h> 13#include <linux/sched.h>
10#include <asm/sysrq.h> 14#include <asm/sysrq.h>
15#include <os.h>
11 16
12/* Catch non-i386 SUBARCH's. */ 17struct stack_frame {
13#if !defined(CONFIG_UML_X86) || defined(CONFIG_64BIT) 18 struct stack_frame *next_frame;
14void show_trace(struct task_struct *task, unsigned long * stack) 19 unsigned long return_address;
20};
21
22static void do_stack_trace(unsigned long *sp, unsigned long bp)
15{ 23{
24 int reliable;
16 unsigned long addr; 25 unsigned long addr;
26 struct stack_frame *frame = (struct stack_frame *)bp;
17 27
18 if (!stack) { 28 printk(KERN_INFO "Call Trace:\n");
19 stack = (unsigned long*) &stack; 29 while (((long) sp & (THREAD_SIZE-1)) != 0) {
20 WARN_ON(1); 30 addr = *sp;
21 }
22
23 printk(KERN_INFO "Call Trace: \n");
24 while (((long) stack & (THREAD_SIZE-1)) != 0) {
25 addr = *stack;
26 if (__kernel_text_address(addr)) { 31 if (__kernel_text_address(addr)) {
27 printk(KERN_INFO "%08lx: [<%08lx>]", 32 reliable = 0;
28 (unsigned long) stack, addr); 33 if ((unsigned long) sp == bp + sizeof(long)) {
29 print_symbol(KERN_CONT " %s", addr); 34 frame = frame ? frame->next_frame : NULL;
35 bp = (unsigned long)frame;
36 reliable = 1;
37 }
38
39 printk(KERN_INFO " [<%08lx>]", addr);
40 printk(KERN_CONT " %s", reliable ? "" : "? ");
41 print_symbol(KERN_CONT "%s", addr);
30 printk(KERN_CONT "\n"); 42 printk(KERN_CONT "\n");
31 } 43 }
32 stack++; 44 sp++;
33 } 45 }
34 printk(KERN_INFO "\n"); 46 printk(KERN_INFO "\n");
35} 47}
36#endif
37 48
38/*Stolen from arch/i386/kernel/traps.c */ 49static unsigned long get_frame_pointer(struct task_struct *task,
39static const int kstack_depth_to_print = 24; 50 struct pt_regs *segv_regs)
51{
52 if (!task || task == current)
53 return segv_regs ? PT_REGS_BP(segv_regs) : current_bp();
54 else
55 return KSTK_EBP(task);
56}
40 57
41/* This recently started being used in arch-independent code too, as in 58static unsigned long *get_stack_pointer(struct task_struct *task,
42 * kernel/sched/core.c.*/ 59 struct pt_regs *segv_regs)
43void show_stack(struct task_struct *task, unsigned long *esp)
44{ 60{
45 unsigned long *stack; 61 if (!task || task == current)
62 return segv_regs ? (unsigned long *)PT_REGS_SP(segv_regs) : current_sp();
63 else
64 return (unsigned long *)KSTK_ESP(task);
65}
66
67void show_stack(struct task_struct *task, unsigned long *stack)
68{
69 unsigned long *sp = stack, bp = 0;
70 struct pt_regs *segv_regs = current->thread.segv_regs;
46 int i; 71 int i;
47 72
48 if (esp == NULL) { 73 if (!segv_regs && os_is_signal_stack()) {
49 if (task != current && task != NULL) { 74 printk(KERN_ERR "Received SIGSEGV in SIGSEGV handler,"
50 esp = (unsigned long *) KSTK_ESP(task); 75 " aborting stack trace!\n");
51 } else { 76 return;
52 esp = (unsigned long *) &esp;
53 }
54 } 77 }
55 78
56 stack = esp; 79#ifdef CONFIG_FRAME_POINTER
57 for (i = 0; i < kstack_depth_to_print; i++) { 80 bp = get_frame_pointer(task, segv_regs);
81#endif
82
83 if (!stack)
84 sp = get_stack_pointer(task, segv_regs);
85
86 printk(KERN_INFO "Stack:\n");
87 stack = sp;
88 for (i = 0; i < 3 * STACKSLOTS_PER_LINE; i++) {
58 if (kstack_end(stack)) 89 if (kstack_end(stack))
59 break; 90 break;
60 if (i && ((i % 8) == 0)) 91 if (i && ((i % STACKSLOTS_PER_LINE) == 0))
61 printk(KERN_INFO " "); 92 printk(KERN_CONT "\n");
62 printk(KERN_CONT "%08lx ", *stack++); 93 printk(KERN_CONT " %08lx", *stack++);
63 } 94 }
95 printk(KERN_CONT "\n");
64 96
65 show_trace(task, esp); 97 do_stack_trace(sp, bp);
66} 98}
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c
index 5c3aef74237f..974b87474a99 100644
--- a/arch/um/kernel/trap.c
+++ b/arch/um/kernel/trap.c
@@ -206,9 +206,12 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
206 int is_write = FAULT_WRITE(fi); 206 int is_write = FAULT_WRITE(fi);
207 unsigned long address = FAULT_ADDRESS(fi); 207 unsigned long address = FAULT_ADDRESS(fi);
208 208
209 if (regs)
210 current->thread.segv_regs = container_of(regs, struct pt_regs, regs);
211
209 if (!is_user && (address >= start_vm) && (address < end_vm)) { 212 if (!is_user && (address >= start_vm) && (address < end_vm)) {
210 flush_tlb_kernel_vm(); 213 flush_tlb_kernel_vm();
211 return 0; 214 goto out;
212 } 215 }
213 else if (current->mm == NULL) { 216 else if (current->mm == NULL) {
214 show_regs(container_of(regs, struct pt_regs, regs)); 217 show_regs(container_of(regs, struct pt_regs, regs));
@@ -230,7 +233,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
230 233
231 catcher = current->thread.fault_catcher; 234 catcher = current->thread.fault_catcher;
232 if (!err) 235 if (!err)
233 return 0; 236 goto out;
234 else if (catcher != NULL) { 237 else if (catcher != NULL) {
235 current->thread.fault_addr = (void *) address; 238 current->thread.fault_addr = (void *) address;
236 UML_LONGJMP(catcher, 1); 239 UML_LONGJMP(catcher, 1);
@@ -238,7 +241,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
238 else if (current->thread.fault_addr != NULL) 241 else if (current->thread.fault_addr != NULL)
239 panic("fault_addr set but no fault catcher"); 242 panic("fault_addr set but no fault catcher");
240 else if (!is_user && arch_fixup(ip, regs)) 243 else if (!is_user && arch_fixup(ip, regs))
241 return 0; 244 goto out;
242 245
243 if (!is_user) { 246 if (!is_user) {
244 show_regs(container_of(regs, struct pt_regs, regs)); 247 show_regs(container_of(regs, struct pt_regs, regs));
@@ -262,6 +265,11 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
262 current->thread.arch.faultinfo = fi; 265 current->thread.arch.faultinfo = fi;
263 force_sig_info(SIGSEGV, &si, current); 266 force_sig_info(SIGSEGV, &si, current);
264 } 267 }
268
269out:
270 if (regs)
271 current->thread.segv_regs = NULL;
272
265 return 0; 273 return 0;
266} 274}
267 275
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 87df5e3acc26..016adf0985d5 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -13,6 +13,7 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/processor.h> 15#include <asm/processor.h>
16#include <asm/sections.h>
16#include <asm/setup.h> 17#include <asm/setup.h>
17#include <as-layout.h> 18#include <as-layout.h>
18#include <arch.h> 19#include <arch.h>
@@ -234,7 +235,6 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1,
234 void *unused2) 235 void *unused2)
235{ 236{
236 bust_spinlocks(1); 237 bust_spinlocks(1);
237 show_regs(&(current->thread.regs));
238 bust_spinlocks(0); 238 bust_spinlocks(0);
239 uml_exitcode = 1; 239 uml_exitcode = 1;
240 os_dump_core(); 240 os_dump_core();
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 905924b773d3..7b605e4dfffa 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -304,3 +304,11 @@ int set_signals(int enable)
304 304
305 return ret; 305 return ret;
306} 306}
307
308int os_is_signal_stack(void)
309{
310 stack_t ss;
311 sigaltstack(NULL, &ss);
312
313 return ss.ss_flags & SS_ONSTACK;
314}
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 82cdd8906f3d..a7ba27b2752b 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -1,5 +1,6 @@
1config UNICORE32 1config UNICORE32
2 def_bool y 2 def_bool y
3 select ARCH_MIGHT_HAVE_PC_PARPORT
3 select HAVE_MEMBLOCK 4 select HAVE_MEMBLOCK
4 select HAVE_GENERIC_DMA_COHERENT 5 select HAVE_GENERIC_DMA_COHERENT
5 select HAVE_DMA_ATTRS 6 select HAVE_DMA_ATTRS
diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h
index 818b4a1edb5b..af36d8eabdf1 100644
--- a/arch/unicore32/include/asm/thread_info.h
+++ b/arch/unicore32/include/asm/thread_info.h
@@ -118,12 +118,6 @@ static inline struct thread_info *current_thread_info(void)
118#endif 118#endif
119 119
120/* 120/*
121 * We use bit 30 of the preempt_count to indicate that kernel
122 * preemption is occurring. See <asm/hardirq.h>.
123 */
124#define PREEMPT_ACTIVE 0x40000000
125
126/*
127 * thread information flags: 121 * thread information flags:
128 * TIF_SYSCALL_TRACE - syscall trace active 122 * TIF_SYSCALL_TRACE - syscall trace active
129 * TIF_SIGPENDING - signal pending 123 * TIF_SIGPENDING - signal pending
diff --git a/arch/unicore32/kernel/puv3-nb0916.c b/arch/unicore32/kernel/puv3-nb0916.c
index 181108b8ecce..0c6618e71897 100644
--- a/arch/unicore32/kernel/puv3-nb0916.c
+++ b/arch/unicore32/kernel/puv3-nb0916.c
@@ -54,6 +54,7 @@ static struct platform_pwm_backlight_data nb0916_backlight_data = {
54 .max_brightness = 100, 54 .max_brightness = 100,
55 .dft_brightness = 100, 55 .dft_brightness = 100,
56 .pwm_period_ns = 70 * 1024, 56 .pwm_period_ns = 70 * 1024,
57 .enable_gpio = -1,
57}; 58};
58 59
59static struct gpio_keys_button nb0916_gpio_keys[] = { 60static struct gpio_keys_button nb0916_gpio_keys[] = {
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 83f521aa103f..e903c71f7e69 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -22,6 +22,7 @@ config X86_64
22config X86 22config X86
23 def_bool y 23 def_bool y
24 select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS 24 select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
25 select ARCH_MIGHT_HAVE_PC_PARPORT
25 select HAVE_AOUT if X86_32 26 select HAVE_AOUT if X86_32
26 select HAVE_UNSTABLE_SCHED_CLOCK 27 select HAVE_UNSTABLE_SCHED_CLOCK
27 select ARCH_SUPPORTS_NUMA_BALANCING 28 select ARCH_SUPPORTS_NUMA_BALANCING
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 41250fb33985..57d021507120 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -31,6 +31,9 @@ ifeq ($(CONFIG_X86_32),y)
31 31
32 KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return 32 KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
33 33
34 # Don't autogenerate MMX or SSE instructions
35 KBUILD_CFLAGS += -mno-mmx -mno-sse
36
34 # Never want PIC in a 32-bit kernel, prevent breakage with GCC built 37 # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
35 # with nonstandard options 38 # with nonstandard options
36 KBUILD_CFLAGS += -fno-pic 39 KBUILD_CFLAGS += -fno-pic
@@ -57,8 +60,11 @@ else
57 KBUILD_AFLAGS += -m64 60 KBUILD_AFLAGS += -m64
58 KBUILD_CFLAGS += -m64 61 KBUILD_CFLAGS += -m64
59 62
63 # Don't autogenerate MMX or SSE instructions
64 KBUILD_CFLAGS += -mno-mmx -mno-sse
65
60 # Use -mpreferred-stack-boundary=3 if supported. 66 # Use -mpreferred-stack-boundary=3 if supported.
61 KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3) 67 KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
62 68
63 # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) 69 # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
64 cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) 70 cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index dce69a256896..d9c11956fce0 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -53,18 +53,18 @@ $(obj)/cpustr.h: $(obj)/mkcpustr FORCE
53 53
54# How to compile the 16-bit code. Note we always compile for -march=i386, 54# How to compile the 16-bit code. Note we always compile for -march=i386,
55# that way we can complain to the user if the CPU is insufficient. 55# that way we can complain to the user if the CPU is insufficient.
56KBUILD_CFLAGS := $(USERINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ 56KBUILD_CFLAGS := $(USERINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ \
57 -DDISABLE_BRANCH_PROFILING \ 57 -DDISABLE_BRANCH_PROFILING \
58 -Wall -Wstrict-prototypes \ 58 -Wall -Wstrict-prototypes \
59 -march=i386 -mregparm=3 \ 59 -march=i386 -mregparm=3 \
60 -include $(srctree)/$(src)/code16gcc.h \ 60 -include $(srctree)/$(src)/code16gcc.h \
61 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ 61 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
62 -mno-mmx -mno-sse \
62 $(call cc-option, -ffreestanding) \ 63 $(call cc-option, -ffreestanding) \
63 $(call cc-option, -fno-toplevel-reorder,\ 64 $(call cc-option, -fno-toplevel-reorder,\
64 $(call cc-option, -fno-unit-at-a-time)) \ 65 $(call cc-option, -fno-unit-at-a-time)) \
65 $(call cc-option, -fno-stack-protector) \ 66 $(call cc-option, -fno-stack-protector) \
66 $(call cc-option, -mpreferred-stack-boundary=2) 67 $(call cc-option, -mpreferred-stack-boundary=2)
67KBUILD_CFLAGS += $(call cc-option, -m32)
68KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ 68KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
69GCOV_PROFILE := n 69GCOV_PROFILE := n
70 70
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index dcd90df10ab4..c8a6792e7842 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -13,6 +13,7 @@ KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
13cflags-$(CONFIG_X86_32) := -march=i386 13cflags-$(CONFIG_X86_32) := -march=i386
14cflags-$(CONFIG_X86_64) := -mcmodel=small 14cflags-$(CONFIG_X86_64) := -mcmodel=small
15KBUILD_CFLAGS += $(cflags-y) 15KBUILD_CFLAGS += $(cflags-y)
16KBUILD_CFLAGS += -mno-mmx -mno-sse
16KBUILD_CFLAGS += $(call cc-option,-ffreestanding) 17KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
17KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) 18KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
18 19
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 7d6ba9db1be9..e0fc24db234a 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -3,8 +3,9 @@
3# 3#
4 4
5avx_supported := $(call as-instr,vpxor %xmm0$(comma)%xmm0$(comma)%xmm0,yes,no) 5avx_supported := $(call as-instr,vpxor %xmm0$(comma)%xmm0$(comma)%xmm0,yes,no)
6avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1\
7 $(comma)4)$(comma)%ymm2,yes,no)
6 8
7obj-$(CONFIG_CRYPTO_ABLK_HELPER_X86) += ablk_helper.o
8obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o 9obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o
9 10
10obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o 11obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o
diff --git a/arch/x86/crypto/ablk_helper.c b/arch/x86/crypto/ablk_helper.c
deleted file mode 100644
index 43282fe04a8b..000000000000
--- a/arch/x86/crypto/ablk_helper.c
+++ /dev/null
@@ -1,149 +0,0 @@
1/*
2 * Shared async block cipher helpers
3 *
4 * Copyright (c) 2012 Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
5 *
6 * Based on aesni-intel_glue.c by:
7 * Copyright (C) 2008, Intel Corp.
8 * Author: Huang Ying <ying.huang@intel.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
24 *
25 */
26
27#include <linux/kernel.h>
28#include <linux/crypto.h>
29#include <linux/init.h>
30#include <linux/module.h>
31#include <crypto/algapi.h>
32#include <crypto/cryptd.h>
33#include <asm/i387.h>
34#include <asm/crypto/ablk_helper.h>
35
36int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key,
37 unsigned int key_len)
38{
39 struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm);
40 struct crypto_ablkcipher *child = &ctx->cryptd_tfm->base;
41 int err;
42
43 crypto_ablkcipher_clear_flags(child, CRYPTO_TFM_REQ_MASK);
44 crypto_ablkcipher_set_flags(child, crypto_ablkcipher_get_flags(tfm)
45 & CRYPTO_TFM_REQ_MASK);
46 err = crypto_ablkcipher_setkey(child, key, key_len);
47 crypto_ablkcipher_set_flags(tfm, crypto_ablkcipher_get_flags(child)
48 & CRYPTO_TFM_RES_MASK);
49 return err;
50}
51EXPORT_SYMBOL_GPL(ablk_set_key);
52
53int __ablk_encrypt(struct ablkcipher_request *req)
54{
55 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
56 struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm);
57 struct blkcipher_desc desc;
58
59 desc.tfm = cryptd_ablkcipher_child(ctx->cryptd_tfm);
60 desc.info = req->info;
61 desc.flags = 0;
62
63 return crypto_blkcipher_crt(desc.tfm)->encrypt(
64 &desc, req->dst, req->src, req->nbytes);
65}
66EXPORT_SYMBOL_GPL(__ablk_encrypt);
67
68int ablk_encrypt(struct ablkcipher_request *req)
69{
70 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
71 struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm);
72
73 if (!irq_fpu_usable()) {
74 struct ablkcipher_request *cryptd_req =
75 ablkcipher_request_ctx(req);
76
77 memcpy(cryptd_req, req, sizeof(*req));
78 ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
79
80 return crypto_ablkcipher_encrypt(cryptd_req);
81 } else {
82 return __ablk_encrypt(req);
83 }
84}
85EXPORT_SYMBOL_GPL(ablk_encrypt);
86
87int ablk_decrypt(struct ablkcipher_request *req)
88{
89 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
90 struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm);
91
92 if (!irq_fpu_usable()) {
93 struct ablkcipher_request *cryptd_req =
94 ablkcipher_request_ctx(req);
95
96 memcpy(cryptd_req, req, sizeof(*req));
97 ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
98
99 return crypto_ablkcipher_decrypt(cryptd_req);
100 } else {
101 struct blkcipher_desc desc;
102
103 desc.tfm = cryptd_ablkcipher_child(ctx->cryptd_tfm);
104 desc.info = req->info;
105 desc.flags = 0;
106
107 return crypto_blkcipher_crt(desc.tfm)->decrypt(
108 &desc, req->dst, req->src, req->nbytes);
109 }
110}
111EXPORT_SYMBOL_GPL(ablk_decrypt);
112
113void ablk_exit(struct crypto_tfm *tfm)
114{
115 struct async_helper_ctx *ctx = crypto_tfm_ctx(tfm);
116
117 cryptd_free_ablkcipher(ctx->cryptd_tfm);
118}
119EXPORT_SYMBOL_GPL(ablk_exit);
120
121int ablk_init_common(struct crypto_tfm *tfm, const char *drv_name)
122{
123 struct async_helper_ctx *ctx = crypto_tfm_ctx(tfm);
124 struct cryptd_ablkcipher *cryptd_tfm;
125
126 cryptd_tfm = cryptd_alloc_ablkcipher(drv_name, 0, 0);
127 if (IS_ERR(cryptd_tfm))
128 return PTR_ERR(cryptd_tfm);
129
130 ctx->cryptd_tfm = cryptd_tfm;
131 tfm->crt_ablkcipher.reqsize = sizeof(struct ablkcipher_request) +
132 crypto_ablkcipher_reqsize(&cryptd_tfm->base);
133
134 return 0;
135}
136EXPORT_SYMBOL_GPL(ablk_init_common);
137
138int ablk_init(struct crypto_tfm *tfm)
139{
140 char drv_name[CRYPTO_MAX_ALG_NAME];
141
142 snprintf(drv_name, sizeof(drv_name), "__driver-%s",
143 crypto_tfm_alg_driver_name(tfm));
144
145 return ablk_init_common(tfm, drv_name);
146}
147EXPORT_SYMBOL_GPL(ablk_init);
148
149MODULE_LICENSE("GPL");
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index f80e668785c0..835488b745ee 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -34,7 +34,7 @@
34#include <asm/cpu_device_id.h> 34#include <asm/cpu_device_id.h>
35#include <asm/i387.h> 35#include <asm/i387.h>
36#include <asm/crypto/aes.h> 36#include <asm/crypto/aes.h>
37#include <asm/crypto/ablk_helper.h> 37#include <crypto/ablk_helper.h>
38#include <crypto/scatterwalk.h> 38#include <crypto/scatterwalk.h>
39#include <crypto/internal/aead.h> 39#include <crypto/internal/aead.h>
40#include <linux/workqueue.h> 40#include <linux/workqueue.h>
diff --git a/arch/x86/crypto/camellia_aesni_avx2_glue.c b/arch/x86/crypto/camellia_aesni_avx2_glue.c
index 414fe5d7946b..4209a76fcdaa 100644
--- a/arch/x86/crypto/camellia_aesni_avx2_glue.c
+++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c
@@ -14,6 +14,7 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <crypto/ablk_helper.h>
17#include <crypto/algapi.h> 18#include <crypto/algapi.h>
18#include <crypto/ctr.h> 19#include <crypto/ctr.h>
19#include <crypto/lrw.h> 20#include <crypto/lrw.h>
@@ -21,7 +22,6 @@
21#include <asm/xcr.h> 22#include <asm/xcr.h>
22#include <asm/xsave.h> 23#include <asm/xsave.h>
23#include <asm/crypto/camellia.h> 24#include <asm/crypto/camellia.h>
24#include <asm/crypto/ablk_helper.h>
25#include <asm/crypto/glue_helper.h> 25#include <asm/crypto/glue_helper.h>
26 26
27#define CAMELLIA_AESNI_PARALLEL_BLOCKS 16 27#define CAMELLIA_AESNI_PARALLEL_BLOCKS 16
diff --git a/arch/x86/crypto/camellia_aesni_avx_glue.c b/arch/x86/crypto/camellia_aesni_avx_glue.c
index 37fd0c0a81ea..87a041a10f4a 100644
--- a/arch/x86/crypto/camellia_aesni_avx_glue.c
+++ b/arch/x86/crypto/camellia_aesni_avx_glue.c
@@ -14,6 +14,7 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <crypto/ablk_helper.h>
17#include <crypto/algapi.h> 18#include <crypto/algapi.h>
18#include <crypto/ctr.h> 19#include <crypto/ctr.h>
19#include <crypto/lrw.h> 20#include <crypto/lrw.h>
@@ -21,7 +22,6 @@
21#include <asm/xcr.h> 22#include <asm/xcr.h>
22#include <asm/xsave.h> 23#include <asm/xsave.h>
23#include <asm/crypto/camellia.h> 24#include <asm/crypto/camellia.h>
24#include <asm/crypto/ablk_helper.h>
25#include <asm/crypto/glue_helper.h> 25#include <asm/crypto/glue_helper.h>
26 26
27#define CAMELLIA_AESNI_PARALLEL_BLOCKS 16 27#define CAMELLIA_AESNI_PARALLEL_BLOCKS 16
diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c
index c6631813dc11..e6a3700489b9 100644
--- a/arch/x86/crypto/cast5_avx_glue.c
+++ b/arch/x86/crypto/cast5_avx_glue.c
@@ -26,13 +26,13 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/crypto.h> 27#include <linux/crypto.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <crypto/ablk_helper.h>
29#include <crypto/algapi.h> 30#include <crypto/algapi.h>
30#include <crypto/cast5.h> 31#include <crypto/cast5.h>
31#include <crypto/cryptd.h> 32#include <crypto/cryptd.h>
32#include <crypto/ctr.h> 33#include <crypto/ctr.h>
33#include <asm/xcr.h> 34#include <asm/xcr.h>
34#include <asm/xsave.h> 35#include <asm/xsave.h>
35#include <asm/crypto/ablk_helper.h>
36#include <asm/crypto/glue_helper.h> 36#include <asm/crypto/glue_helper.h>
37 37
38#define CAST5_PARALLEL_BLOCKS 16 38#define CAST5_PARALLEL_BLOCKS 16
diff --git a/arch/x86/crypto/cast6_avx_glue.c b/arch/x86/crypto/cast6_avx_glue.c
index 8d0dfb86a559..09f3677393e4 100644
--- a/arch/x86/crypto/cast6_avx_glue.c
+++ b/arch/x86/crypto/cast6_avx_glue.c
@@ -28,6 +28,7 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/crypto.h> 29#include <linux/crypto.h>
30#include <linux/err.h> 30#include <linux/err.h>
31#include <crypto/ablk_helper.h>
31#include <crypto/algapi.h> 32#include <crypto/algapi.h>
32#include <crypto/cast6.h> 33#include <crypto/cast6.h>
33#include <crypto/cryptd.h> 34#include <crypto/cryptd.h>
@@ -37,7 +38,6 @@
37#include <crypto/xts.h> 38#include <crypto/xts.h>
38#include <asm/xcr.h> 39#include <asm/xcr.h>
39#include <asm/xsave.h> 40#include <asm/xsave.h>
40#include <asm/crypto/ablk_helper.h>
41#include <asm/crypto/glue_helper.h> 41#include <asm/crypto/glue_helper.h>
42 42
43#define CAST6_PARALLEL_BLOCKS 8 43#define CAST6_PARALLEL_BLOCKS 8
diff --git a/arch/x86/crypto/serpent_avx2_glue.c b/arch/x86/crypto/serpent_avx2_glue.c
index 23aabc6c20a5..2fae489b1524 100644
--- a/arch/x86/crypto/serpent_avx2_glue.c
+++ b/arch/x86/crypto/serpent_avx2_glue.c
@@ -14,6 +14,7 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <crypto/ablk_helper.h>
17#include <crypto/algapi.h> 18#include <crypto/algapi.h>
18#include <crypto/ctr.h> 19#include <crypto/ctr.h>
19#include <crypto/lrw.h> 20#include <crypto/lrw.h>
@@ -22,7 +23,6 @@
22#include <asm/xcr.h> 23#include <asm/xcr.h>
23#include <asm/xsave.h> 24#include <asm/xsave.h>
24#include <asm/crypto/serpent-avx.h> 25#include <asm/crypto/serpent-avx.h>
25#include <asm/crypto/ablk_helper.h>
26#include <asm/crypto/glue_helper.h> 26#include <asm/crypto/glue_helper.h>
27 27
28#define SERPENT_AVX2_PARALLEL_BLOCKS 16 28#define SERPENT_AVX2_PARALLEL_BLOCKS 16
diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c
index 9ae83cf8d21e..ff4870870972 100644
--- a/arch/x86/crypto/serpent_avx_glue.c
+++ b/arch/x86/crypto/serpent_avx_glue.c
@@ -28,6 +28,7 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/crypto.h> 29#include <linux/crypto.h>
30#include <linux/err.h> 30#include <linux/err.h>
31#include <crypto/ablk_helper.h>
31#include <crypto/algapi.h> 32#include <crypto/algapi.h>
32#include <crypto/serpent.h> 33#include <crypto/serpent.h>
33#include <crypto/cryptd.h> 34#include <crypto/cryptd.h>
@@ -38,7 +39,6 @@
38#include <asm/xcr.h> 39#include <asm/xcr.h>
39#include <asm/xsave.h> 40#include <asm/xsave.h>
40#include <asm/crypto/serpent-avx.h> 41#include <asm/crypto/serpent-avx.h>
41#include <asm/crypto/ablk_helper.h>
42#include <asm/crypto/glue_helper.h> 42#include <asm/crypto/glue_helper.h>
43 43
44/* 8-way parallel cipher functions */ 44/* 8-way parallel cipher functions */
diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c
index 97a356ece24d..8c95f8637306 100644
--- a/arch/x86/crypto/serpent_sse2_glue.c
+++ b/arch/x86/crypto/serpent_sse2_glue.c
@@ -34,6 +34,7 @@
34#include <linux/types.h> 34#include <linux/types.h>
35#include <linux/crypto.h> 35#include <linux/crypto.h>
36#include <linux/err.h> 36#include <linux/err.h>
37#include <crypto/ablk_helper.h>
37#include <crypto/algapi.h> 38#include <crypto/algapi.h>
38#include <crypto/serpent.h> 39#include <crypto/serpent.h>
39#include <crypto/cryptd.h> 40#include <crypto/cryptd.h>
@@ -42,7 +43,6 @@
42#include <crypto/lrw.h> 43#include <crypto/lrw.h>
43#include <crypto/xts.h> 44#include <crypto/xts.h>
44#include <asm/crypto/serpent-sse2.h> 45#include <asm/crypto/serpent-sse2.h>
45#include <asm/crypto/ablk_helper.h>
46#include <asm/crypto/glue_helper.h> 46#include <asm/crypto/glue_helper.h>
47 47
48static void serpent_decrypt_cbc_xway(void *ctx, u128 *dst, const u128 *src) 48static void serpent_decrypt_cbc_xway(void *ctx, u128 *dst, const u128 *src)
diff --git a/arch/x86/crypto/sha256_ssse3_glue.c b/arch/x86/crypto/sha256_ssse3_glue.c
index 50226c4b86ed..f248546da1ca 100644
--- a/arch/x86/crypto/sha256_ssse3_glue.c
+++ b/arch/x86/crypto/sha256_ssse3_glue.c
@@ -281,7 +281,7 @@ static int __init sha256_ssse3_mod_init(void)
281 /* allow AVX to override SSSE3, it's a little faster */ 281 /* allow AVX to override SSSE3, it's a little faster */
282 if (avx_usable()) { 282 if (avx_usable()) {
283#ifdef CONFIG_AS_AVX2 283#ifdef CONFIG_AS_AVX2
284 if (boot_cpu_has(X86_FEATURE_AVX2)) 284 if (boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_BMI2))
285 sha256_transform_asm = sha256_transform_rorx; 285 sha256_transform_asm = sha256_transform_rorx;
286 else 286 else
287#endif 287#endif
@@ -319,4 +319,4 @@ MODULE_LICENSE("GPL");
319MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm, Supplemental SSE3 accelerated"); 319MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm, Supplemental SSE3 accelerated");
320 320
321MODULE_ALIAS("sha256"); 321MODULE_ALIAS("sha256");
322MODULE_ALIAS("sha384"); 322MODULE_ALIAS("sha224");
diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c
index a62ba541884e..4e3c665be129 100644
--- a/arch/x86/crypto/twofish_avx_glue.c
+++ b/arch/x86/crypto/twofish_avx_glue.c
@@ -28,6 +28,7 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/crypto.h> 29#include <linux/crypto.h>
30#include <linux/err.h> 30#include <linux/err.h>
31#include <crypto/ablk_helper.h>
31#include <crypto/algapi.h> 32#include <crypto/algapi.h>
32#include <crypto/twofish.h> 33#include <crypto/twofish.h>
33#include <crypto/cryptd.h> 34#include <crypto/cryptd.h>
@@ -39,7 +40,6 @@
39#include <asm/xcr.h> 40#include <asm/xcr.h>
40#include <asm/xsave.h> 41#include <asm/xsave.h>
41#include <asm/crypto/twofish.h> 42#include <asm/crypto/twofish.h>
42#include <asm/crypto/ablk_helper.h>
43#include <asm/crypto/glue_helper.h> 43#include <asm/crypto/glue_helper.h>
44#include <crypto/scatterwalk.h> 44#include <crypto/scatterwalk.h>
45#include <linux/workqueue.h> 45#include <linux/workqueue.h>
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h
index da31c8b8a92d..b17f4f48ecd7 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
@@ -77,7 +77,7 @@ static inline void atomic_sub(int i, atomic_t *v)
77 */ 77 */
78static inline int atomic_sub_and_test(int i, atomic_t *v) 78static inline int atomic_sub_and_test(int i, atomic_t *v)
79{ 79{
80 GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, i, "%0", "e"); 80 GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, "er", i, "%0", "e");
81} 81}
82 82
83/** 83/**
@@ -141,7 +141,7 @@ static inline int atomic_inc_and_test(atomic_t *v)
141 */ 141 */
142static inline int atomic_add_negative(int i, atomic_t *v) 142static inline int atomic_add_negative(int i, atomic_t *v)
143{ 143{
144 GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, i, "%0", "s"); 144 GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, "er", i, "%0", "s");
145} 145}
146 146
147/** 147/**
diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h
index 3f065c985aee..46e9052bbd28 100644
--- a/arch/x86/include/asm/atomic64_64.h
+++ b/arch/x86/include/asm/atomic64_64.h
@@ -72,7 +72,7 @@ static inline void atomic64_sub(long i, atomic64_t *v)
72 */ 72 */
73static inline int atomic64_sub_and_test(long i, atomic64_t *v) 73static inline int atomic64_sub_and_test(long i, atomic64_t *v)
74{ 74{
75 GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, i, "%0", "e"); 75 GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, "er", i, "%0", "e");
76} 76}
77 77
78/** 78/**
@@ -138,7 +138,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v)
138 */ 138 */
139static inline int atomic64_add_negative(long i, atomic64_t *v) 139static inline int atomic64_add_negative(long i, atomic64_t *v)
140{ 140{
141 GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, i, "%0", "s"); 141 GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, "er", i, "%0", "s");
142} 142}
143 143
144/** 144/**
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 6d76d0935989..9fc1af74dc83 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -205,7 +205,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr)
205 */ 205 */
206static inline int test_and_set_bit(long nr, volatile unsigned long *addr) 206static inline int test_and_set_bit(long nr, volatile unsigned long *addr)
207{ 207{
208 GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, nr, "%0", "c"); 208 GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", "c");
209} 209}
210 210
211/** 211/**
@@ -251,7 +251,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr)
251 */ 251 */
252static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) 252static inline int test_and_clear_bit(long nr, volatile unsigned long *addr)
253{ 253{
254 GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, nr, "%0", "c"); 254 GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", "c");
255} 255}
256 256
257/** 257/**
@@ -304,7 +304,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr)
304 */ 304 */
305static inline int test_and_change_bit(long nr, volatile unsigned long *addr) 305static inline int test_and_change_bit(long nr, volatile unsigned long *addr)
306{ 306{
307 GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, nr, "%0", "c"); 307 GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", "c");
308} 308}
309 309
310static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) 310static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr)
diff --git a/arch/x86/include/asm/crypto/ablk_helper.h b/arch/x86/include/asm/crypto/ablk_helper.h
deleted file mode 100644
index 4f93df50c23e..000000000000
--- a/arch/x86/include/asm/crypto/ablk_helper.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Shared async block cipher helpers
3 */
4
5#ifndef _CRYPTO_ABLK_HELPER_H
6#define _CRYPTO_ABLK_HELPER_H
7
8#include <linux/crypto.h>
9#include <linux/kernel.h>
10#include <crypto/cryptd.h>
11
12struct async_helper_ctx {
13 struct cryptd_ablkcipher *cryptd_tfm;
14};
15
16extern int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key,
17 unsigned int key_len);
18
19extern int __ablk_encrypt(struct ablkcipher_request *req);
20
21extern int ablk_encrypt(struct ablkcipher_request *req);
22
23extern int ablk_decrypt(struct ablkcipher_request *req);
24
25extern void ablk_exit(struct crypto_tfm *tfm);
26
27extern int ablk_init_common(struct crypto_tfm *tfm, const char *drv_name);
28
29extern int ablk_init(struct crypto_tfm *tfm);
30
31#endif /* _CRYPTO_ABLK_HELPER_H */
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index 5b23e605e707..4ad6560847b1 100644
--- a/arch/x86/include/asm/local.h
+++ b/arch/x86/include/asm/local.h
@@ -52,7 +52,7 @@ static inline void local_sub(long i, local_t *l)
52 */ 52 */
53static inline int local_sub_and_test(long i, local_t *l) 53static inline int local_sub_and_test(long i, local_t *l)
54{ 54{
55 GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, i, "%0", "e"); 55 GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, "er", i, "%0", "e");
56} 56}
57 57
58/** 58/**
@@ -92,7 +92,7 @@ static inline int local_inc_and_test(local_t *l)
92 */ 92 */
93static inline int local_add_negative(long i, local_t *l) 93static inline int local_add_negative(long i, local_t *l)
94{ 94{
95 GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, i, "%0", "s"); 95 GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, "er", i, "%0", "s");
96} 96}
97 97
98/** 98/**
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 7d7443283a9d..947b5c417e83 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -15,7 +15,7 @@ struct pci_sysdata {
15 int domain; /* PCI domain */ 15 int domain; /* PCI domain */
16 int node; /* NUMA node */ 16 int node; /* NUMA node */
17#ifdef CONFIG_ACPI 17#ifdef CONFIG_ACPI
18 void *acpi; /* ACPI-specific data */ 18 struct acpi_device *companion; /* ACPI companion device */
19#endif 19#endif
20#ifdef CONFIG_X86_64 20#ifdef CONFIG_X86_64
21 void *iommu; /* IOMMU private data */ 21 void *iommu; /* IOMMU private data */
diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h
index 1ff990f1de8e..8f7866a5b9a4 100644
--- a/arch/x86/include/asm/rmwcc.h
+++ b/arch/x86/include/asm/rmwcc.h
@@ -16,8 +16,8 @@ cc_label: \
16#define GEN_UNARY_RMWcc(op, var, arg0, cc) \ 16#define GEN_UNARY_RMWcc(op, var, arg0, cc) \
17 __GEN_RMWcc(op " " arg0, var, cc) 17 __GEN_RMWcc(op " " arg0, var, cc)
18 18
19#define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ 19#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \
20 __GEN_RMWcc(op " %1, " arg0, var, cc, "er" (val)) 20 __GEN_RMWcc(op " %1, " arg0, var, cc, vcon (val))
21 21
22#else /* !CC_HAVE_ASM_GOTO */ 22#else /* !CC_HAVE_ASM_GOTO */
23 23
@@ -33,8 +33,8 @@ do { \
33#define GEN_UNARY_RMWcc(op, var, arg0, cc) \ 33#define GEN_UNARY_RMWcc(op, var, arg0, cc) \
34 __GEN_RMWcc(op " " arg0, var, cc) 34 __GEN_RMWcc(op " " arg0, var, cc)
35 35
36#define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ 36#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \
37 __GEN_RMWcc(op " %2, " arg0, var, cc, "er" (val)) 37 __GEN_RMWcc(op " %2, " arg0, var, cc, vcon (val))
38 38
39#endif /* CC_HAVE_ASM_GOTO */ 39#endif /* CC_HAVE_ASM_GOTO */
40 40
diff --git a/arch/x86/include/asm/simd.h b/arch/x86/include/asm/simd.h
new file mode 100644
index 000000000000..ee80b92f0096
--- /dev/null
+++ b/arch/x86/include/asm/simd.h
@@ -0,0 +1,11 @@
1
2#include <asm/i387.h>
3
4/*
5 * may_use_simd - whether it is allowable at this time to issue SIMD
6 * instructions or access the SIMD register file
7 */
8static __must_check inline bool may_use_simd(void)
9{
10 return irq_fpu_usable();
11}
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index c46a46be1ec6..3ba3de457d05 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -153,8 +153,6 @@ struct thread_info {
153#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) 153#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
154#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) 154#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
155 155
156#define PREEMPT_ACTIVE 0x10000000
157
158#ifdef CONFIG_X86_32 156#ifdef CONFIG_X86_32
159 157
160#define STACK_WARN (THREAD_SIZE/8) 158#define STACK_WARN (THREAD_SIZE/8)
diff --git a/arch/x86/include/asm/trace/irq_vectors.h b/arch/x86/include/asm/trace/irq_vectors.h
index 2874df24e7a4..4cab890007a7 100644
--- a/arch/x86/include/asm/trace/irq_vectors.h
+++ b/arch/x86/include/asm/trace/irq_vectors.h
@@ -72,6 +72,17 @@ DEFINE_IRQ_VECTOR_EVENT(x86_platform_ipi);
72DEFINE_IRQ_VECTOR_EVENT(irq_work); 72DEFINE_IRQ_VECTOR_EVENT(irq_work);
73 73
74/* 74/*
75 * We must dis-allow sampling irq_work_exit() because perf event sampling
76 * itself can cause irq_work, which would lead to an infinite loop;
77 *
78 * 1) irq_work_exit happens
79 * 2) generates perf sample
80 * 3) generates irq_work
81 * 4) goto 1
82 */
83TRACE_EVENT_PERF_PERM(irq_work_exit, is_sampling_event(p_event) ? -EPERM : 0);
84
85/*
75 * call_function - called when entering/exiting a call function interrupt 86 * call_function - called when entering/exiting a call function interrupt
76 * vector handler 87 * vector handler
77 */ 88 */
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
index b93e09a0fa21..37813b5ddc37 100644
--- a/arch/x86/include/uapi/asm/msr-index.h
+++ b/arch/x86/include/uapi/asm/msr-index.h
@@ -147,6 +147,8 @@
147#define MSR_PP1_ENERGY_STATUS 0x00000641 147#define MSR_PP1_ENERGY_STATUS 0x00000641
148#define MSR_PP1_POLICY 0x00000642 148#define MSR_PP1_POLICY 0x00000642
149 149
150#define MSR_CORE_C1_RES 0x00000660
151
150#define MSR_AMD64_MC0_MASK 0xc0010044 152#define MSR_AMD64_MC0_MASK 0xc0010044
151 153
152#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) 154#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index ed165d657380..d278736bf774 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -62,6 +62,7 @@ unsigned disabled_cpus;
62 62
63/* Processor that is doing the boot up */ 63/* Processor that is doing the boot up */
64unsigned int boot_cpu_physical_apicid = -1U; 64unsigned int boot_cpu_physical_apicid = -1U;
65EXPORT_SYMBOL_GPL(boot_cpu_physical_apicid);
65 66
66/* 67/*
67 * The highest APIC ID seen during enumeration. 68 * The highest APIC ID seen during enumeration.
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 3daece79a142..bca023bdd6b2 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -339,7 +339,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
339#endif 339#endif
340 340
341/* 341/*
342 * On a AMD dual core setup the lower bits of the APIC id distingush the cores. 342 * On a AMD dual core setup the lower bits of the APIC id distinguish the cores.
343 * Assumes number of cores is a power of two. 343 * Assumes number of cores is a power of two.
344 */ 344 */
345static void amd_detect_cmp(struct cpuinfo_x86 *c) 345static void amd_detect_cmp(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 1414c90feaba..0641113e2965 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Routines to indentify caches on Intel CPU. 2 * Routines to identify caches on Intel CPU.
3 * 3 *
4 * Changes: 4 * Changes:
5 * Venkatesh Pallipadi : Adding cache identification through cpuid(4) 5 * Venkatesh Pallipadi : Adding cache identification through cpuid(4)
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c
index f2cc63e9cf08..b6f794aa1693 100644
--- a/arch/x86/kernel/cpu/scattered.c
+++ b/arch/x86/kernel/cpu/scattered.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Routines to indentify additional cpu features that are scattered in 2 * Routines to identify additional cpu features that are scattered in
3 * cpuid space. 3 * cpuid space.
4 */ 4 */
5#include <linux/cpu.h> 5#include <linux/cpu.h>
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index b3cd3ebae077..bc4a088f9023 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -313,6 +313,16 @@ static size_t __init gen6_stolen_size(int num, int slot, int func)
313 return gmch_ctrl << 25; /* 32 MB units */ 313 return gmch_ctrl << 25; /* 32 MB units */
314} 314}
315 315
316static inline size_t gen8_stolen_size(int num, int slot, int func)
317{
318 u16 gmch_ctrl;
319
320 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL);
321 gmch_ctrl >>= BDW_GMCH_GMS_SHIFT;
322 gmch_ctrl &= BDW_GMCH_GMS_MASK;
323 return gmch_ctrl << 25; /* 32 MB units */
324}
325
316typedef size_t (*stolen_size_fn)(int num, int slot, int func); 326typedef size_t (*stolen_size_fn)(int num, int slot, int func);
317 327
318static struct pci_device_id intel_stolen_ids[] __initdata = { 328static struct pci_device_id intel_stolen_ids[] __initdata = {
@@ -320,8 +330,8 @@ static struct pci_device_id intel_stolen_ids[] __initdata = {
320 INTEL_I915GM_IDS(gen3_stolen_size), 330 INTEL_I915GM_IDS(gen3_stolen_size),
321 INTEL_I945G_IDS(gen3_stolen_size), 331 INTEL_I945G_IDS(gen3_stolen_size),
322 INTEL_I945GM_IDS(gen3_stolen_size), 332 INTEL_I945GM_IDS(gen3_stolen_size),
323 INTEL_VLV_M_IDS(gen3_stolen_size), 333 INTEL_VLV_M_IDS(gen6_stolen_size),
324 INTEL_VLV_D_IDS(gen3_stolen_size), 334 INTEL_VLV_D_IDS(gen6_stolen_size),
325 INTEL_PINEVIEW_IDS(gen3_stolen_size), 335 INTEL_PINEVIEW_IDS(gen3_stolen_size),
326 INTEL_I965G_IDS(gen3_stolen_size), 336 INTEL_I965G_IDS(gen3_stolen_size),
327 INTEL_G33_IDS(gen3_stolen_size), 337 INTEL_G33_IDS(gen3_stolen_size),
@@ -336,6 +346,8 @@ static struct pci_device_id intel_stolen_ids[] __initdata = {
336 INTEL_IVB_D_IDS(gen6_stolen_size), 346 INTEL_IVB_D_IDS(gen6_stolen_size),
337 INTEL_HSW_D_IDS(gen6_stolen_size), 347 INTEL_HSW_D_IDS(gen6_stolen_size),
338 INTEL_HSW_M_IDS(gen6_stolen_size), 348 INTEL_HSW_M_IDS(gen6_stolen_size),
349 INTEL_BDW_M_IDS(gen8_stolen_size),
350 INTEL_BDW_D_IDS(gen8_stolen_size)
339}; 351};
340 352
341static void __init intel_graphics_stolen(int num, int slot, int func) 353static void __init intel_graphics_stolen(int num, int slot, int func)
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 42a392a9fd02..d4bdd253fea7 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -248,6 +248,15 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
248 return ret; 248 return ret;
249} 249}
250 250
251static int is_ftrace_caller(unsigned long ip)
252{
253 if (ip == (unsigned long)(&ftrace_call) ||
254 ip == (unsigned long)(&ftrace_regs_call))
255 return 1;
256
257 return 0;
258}
259
251/* 260/*
252 * A breakpoint was added to the code address we are about to 261 * A breakpoint was added to the code address we are about to
253 * modify, and this is the handle that will just skip over it. 262 * modify, and this is the handle that will just skip over it.
@@ -257,10 +266,13 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
257 */ 266 */
258int ftrace_int3_handler(struct pt_regs *regs) 267int ftrace_int3_handler(struct pt_regs *regs)
259{ 268{
269 unsigned long ip;
270
260 if (WARN_ON_ONCE(!regs)) 271 if (WARN_ON_ONCE(!regs))
261 return 0; 272 return 0;
262 273
263 if (!ftrace_location(regs->ip - 1)) 274 ip = regs->ip - 1;
275 if (!ftrace_location(ip) && !is_ftrace_caller(ip))
264 return 0; 276 return 0;
265 277
266 regs->ip += MCOUNT_INSN_SIZE - 1; 278 regs->ip += MCOUNT_INSN_SIZE - 1;
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index da3c599584a3..c752cb43e52f 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -558,6 +558,17 @@ void native_machine_shutdown(void)
558{ 558{
559 /* Stop the cpus and apics */ 559 /* Stop the cpus and apics */
560#ifdef CONFIG_X86_IO_APIC 560#ifdef CONFIG_X86_IO_APIC
561 /*
562 * Disabling IO APIC before local APIC is a workaround for
563 * erratum AVR31 in "Intel Atom Processor C2000 Product Family
564 * Specification Update". In this situation, interrupts that target
565 * a Logical Processor whose Local APIC is either in the process of
566 * being hardware disabled or software disabled are neither delivered
567 * nor discarded. When this erratum occurs, the processor may hang.
568 *
569 * Even without the erratum, it still makes sense to quiet IO APIC
570 * before disabling Local APIC.
571 */
561 disable_IO_APIC(); 572 disable_IO_APIC();
562#endif 573#endif
563 574
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 5439117d5c4c..dec48bfaddb8 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -143,6 +143,8 @@ static inline int kvm_apic_id(struct kvm_lapic *apic)
143 return (kvm_apic_get_reg(apic, APIC_ID) >> 24) & 0xff; 143 return (kvm_apic_get_reg(apic, APIC_ID) >> 24) & 0xff;
144} 144}
145 145
146#define KVM_X2APIC_CID_BITS 0
147
146static void recalculate_apic_map(struct kvm *kvm) 148static void recalculate_apic_map(struct kvm *kvm)
147{ 149{
148 struct kvm_apic_map *new, *old = NULL; 150 struct kvm_apic_map *new, *old = NULL;
@@ -180,7 +182,8 @@ static void recalculate_apic_map(struct kvm *kvm)
180 if (apic_x2apic_mode(apic)) { 182 if (apic_x2apic_mode(apic)) {
181 new->ldr_bits = 32; 183 new->ldr_bits = 32;
182 new->cid_shift = 16; 184 new->cid_shift = 16;
183 new->cid_mask = new->lid_mask = 0xffff; 185 new->cid_mask = (1 << KVM_X2APIC_CID_BITS) - 1;
186 new->lid_mask = 0xffff;
184 } else if (kvm_apic_sw_enabled(apic) && 187 } else if (kvm_apic_sw_enabled(apic) &&
185 !new->cid_mask /* flat mode */ && 188 !new->cid_mask /* flat mode */ &&
186 kvm_apic_get_reg(apic, APIC_DFR) == APIC_DFR_CLUSTER) { 189 kvm_apic_get_reg(apic, APIC_DFR) == APIC_DFR_CLUSTER) {
@@ -841,7 +844,8 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
841 ASSERT(apic != NULL); 844 ASSERT(apic != NULL);
842 845
843 /* if initial count is 0, current count should also be 0 */ 846 /* if initial count is 0, current count should also be 0 */
844 if (kvm_apic_get_reg(apic, APIC_TMICT) == 0) 847 if (kvm_apic_get_reg(apic, APIC_TMICT) == 0 ||
848 apic->lapic_timer.period == 0)
845 return 0; 849 return 0;
846 850
847 remaining = hrtimer_get_remaining(&apic->lapic_timer.timer); 851 remaining = hrtimer_get_remaining(&apic->lapic_timer.timer);
@@ -1691,7 +1695,6 @@ static void apic_sync_pv_eoi_from_guest(struct kvm_vcpu *vcpu,
1691void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu) 1695void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu)
1692{ 1696{
1693 u32 data; 1697 u32 data;
1694 void *vapic;
1695 1698
1696 if (test_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention)) 1699 if (test_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention))
1697 apic_sync_pv_eoi_from_guest(vcpu, vcpu->arch.apic); 1700 apic_sync_pv_eoi_from_guest(vcpu, vcpu->arch.apic);
@@ -1699,9 +1702,8 @@ void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu)
1699 if (!test_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention)) 1702 if (!test_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention))
1700 return; 1703 return;
1701 1704
1702 vapic = kmap_atomic(vcpu->arch.apic->vapic_page); 1705 kvm_read_guest_cached(vcpu->kvm, &vcpu->arch.apic->vapic_cache, &data,
1703 data = *(u32 *)(vapic + offset_in_page(vcpu->arch.apic->vapic_addr)); 1706 sizeof(u32));
1704 kunmap_atomic(vapic);
1705 1707
1706 apic_set_tpr(vcpu->arch.apic, data & 0xff); 1708 apic_set_tpr(vcpu->arch.apic, data & 0xff);
1707} 1709}
@@ -1737,7 +1739,6 @@ void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu)
1737 u32 data, tpr; 1739 u32 data, tpr;
1738 int max_irr, max_isr; 1740 int max_irr, max_isr;
1739 struct kvm_lapic *apic = vcpu->arch.apic; 1741 struct kvm_lapic *apic = vcpu->arch.apic;
1740 void *vapic;
1741 1742
1742 apic_sync_pv_eoi_to_guest(vcpu, apic); 1743 apic_sync_pv_eoi_to_guest(vcpu, apic);
1743 1744
@@ -1753,18 +1754,24 @@ void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu)
1753 max_isr = 0; 1754 max_isr = 0;
1754 data = (tpr & 0xff) | ((max_isr & 0xf0) << 8) | (max_irr << 24); 1755 data = (tpr & 0xff) | ((max_isr & 0xf0) << 8) | (max_irr << 24);
1755 1756
1756 vapic = kmap_atomic(vcpu->arch.apic->vapic_page); 1757 kvm_write_guest_cached(vcpu->kvm, &vcpu->arch.apic->vapic_cache, &data,
1757 *(u32 *)(vapic + offset_in_page(vcpu->arch.apic->vapic_addr)) = data; 1758 sizeof(u32));
1758 kunmap_atomic(vapic);
1759} 1759}
1760 1760
1761void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr) 1761int kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr)
1762{ 1762{
1763 vcpu->arch.apic->vapic_addr = vapic_addr; 1763 if (vapic_addr) {
1764 if (vapic_addr) 1764 if (kvm_gfn_to_hva_cache_init(vcpu->kvm,
1765 &vcpu->arch.apic->vapic_cache,
1766 vapic_addr, sizeof(u32)))
1767 return -EINVAL;
1765 __set_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention); 1768 __set_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention);
1766 else 1769 } else {
1767 __clear_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention); 1770 __clear_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention);
1771 }
1772
1773 vcpu->arch.apic->vapic_addr = vapic_addr;
1774 return 0;
1768} 1775}
1769 1776
1770int kvm_x2apic_msr_write(struct kvm_vcpu *vcpu, u32 msr, u64 data) 1777int kvm_x2apic_msr_write(struct kvm_vcpu *vcpu, u32 msr, u64 data)
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
index c730ac9fe801..c8b0d0d2da5c 100644
--- a/arch/x86/kvm/lapic.h
+++ b/arch/x86/kvm/lapic.h
@@ -34,7 +34,7 @@ struct kvm_lapic {
34 */ 34 */
35 void *regs; 35 void *regs;
36 gpa_t vapic_addr; 36 gpa_t vapic_addr;
37 struct page *vapic_page; 37 struct gfn_to_hva_cache vapic_cache;
38 unsigned long pending_events; 38 unsigned long pending_events;
39 unsigned int sipi_vector; 39 unsigned int sipi_vector;
40}; 40};
@@ -76,7 +76,7 @@ void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data);
76void kvm_apic_write_nodecode(struct kvm_vcpu *vcpu, u32 offset); 76void kvm_apic_write_nodecode(struct kvm_vcpu *vcpu, u32 offset);
77void kvm_apic_set_eoi_accelerated(struct kvm_vcpu *vcpu, int vector); 77void kvm_apic_set_eoi_accelerated(struct kvm_vcpu *vcpu, int vector);
78 78
79void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr); 79int kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr);
80void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu); 80void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu);
81void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu); 81void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu);
82 82
diff --git a/arch/x86/kvm/mmu_audit.c b/arch/x86/kvm/mmu_audit.c
index daff69e21150..1185fe7a7f47 100644
--- a/arch/x86/kvm/mmu_audit.c
+++ b/arch/x86/kvm/mmu_audit.c
@@ -296,4 +296,4 @@ static struct kernel_param_ops audit_param_ops = {
296 .get = param_get_bool, 296 .get = param_get_bool,
297}; 297};
298 298
299module_param_cb(mmu_audit, &audit_param_ops, &mmu_audit, 0644); 299arch_param_cb(mmu_audit, &audit_param_ops, &mmu_audit, 0644);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 21ef1ba184ae..5d004da1e35d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3214,8 +3214,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
3214 r = -EFAULT; 3214 r = -EFAULT;
3215 if (copy_from_user(&va, argp, sizeof va)) 3215 if (copy_from_user(&va, argp, sizeof va))
3216 goto out; 3216 goto out;
3217 r = 0; 3217 r = kvm_lapic_set_vapic_addr(vcpu, va.vapic_addr);
3218 kvm_lapic_set_vapic_addr(vcpu, va.vapic_addr);
3219 break; 3218 break;
3220 } 3219 }
3221 case KVM_X86_SETUP_MCE: { 3220 case KVM_X86_SETUP_MCE: {
@@ -5739,36 +5738,6 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu)
5739 !kvm_event_needs_reinjection(vcpu); 5738 !kvm_event_needs_reinjection(vcpu);
5740} 5739}
5741 5740
5742static int vapic_enter(struct kvm_vcpu *vcpu)
5743{
5744 struct kvm_lapic *apic = vcpu->arch.apic;
5745 struct page *page;
5746
5747 if (!apic || !apic->vapic_addr)
5748 return 0;
5749
5750 page = gfn_to_page(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT);
5751 if (is_error_page(page))
5752 return -EFAULT;
5753
5754 vcpu->arch.apic->vapic_page = page;
5755 return 0;
5756}
5757
5758static void vapic_exit(struct kvm_vcpu *vcpu)
5759{
5760 struct kvm_lapic *apic = vcpu->arch.apic;
5761 int idx;
5762
5763 if (!apic || !apic->vapic_addr)
5764 return;
5765
5766 idx = srcu_read_lock(&vcpu->kvm->srcu);
5767 kvm_release_page_dirty(apic->vapic_page);
5768 mark_page_dirty(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT);
5769 srcu_read_unlock(&vcpu->kvm->srcu, idx);
5770}
5771
5772static void update_cr8_intercept(struct kvm_vcpu *vcpu) 5741static void update_cr8_intercept(struct kvm_vcpu *vcpu)
5773{ 5742{
5774 int max_irr, tpr; 5743 int max_irr, tpr;
@@ -6069,11 +6038,6 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
6069 struct kvm *kvm = vcpu->kvm; 6038 struct kvm *kvm = vcpu->kvm;
6070 6039
6071 vcpu->srcu_idx = srcu_read_lock(&kvm->srcu); 6040 vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);
6072 r = vapic_enter(vcpu);
6073 if (r) {
6074 srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
6075 return r;
6076 }
6077 6041
6078 r = 1; 6042 r = 1;
6079 while (r > 0) { 6043 while (r > 0) {
@@ -6132,8 +6096,6 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
6132 6096
6133 srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx); 6097 srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
6134 6098
6135 vapic_exit(vcpu);
6136
6137 return r; 6099 return r;
6138} 6100}
6139 6101
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index a7cccb6d7fec..c96314abd144 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -61,6 +61,7 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
61#if PAGETABLE_LEVELS > 2 61#if PAGETABLE_LEVELS > 2
62void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 62void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
63{ 63{
64 struct page *page = virt_to_page(pmd);
64 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT); 65 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
65 /* 66 /*
66 * NOTE! For PAE, any changes to the top page-directory-pointer-table 67 * NOTE! For PAE, any changes to the top page-directory-pointer-table
@@ -69,7 +70,8 @@ void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
69#ifdef CONFIG_X86_PAE 70#ifdef CONFIG_X86_PAE
70 tlb->need_flush_all = 1; 71 tlb->need_flush_all = 1;
71#endif 72#endif
72 tlb_remove_page(tlb, virt_to_page(pmd)); 73 pgtable_pmd_page_dtor(page);
74 tlb_remove_page(tlb, page);
73} 75}
74 76
75#if PAGETABLE_LEVELS > 3 77#if PAGETABLE_LEVELS > 3
@@ -209,7 +211,7 @@ static int preallocate_pmds(pmd_t *pmds[])
209 if (!pmd) 211 if (!pmd)
210 failed = true; 212 failed = true;
211 if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) { 213 if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
212 free_page((unsigned long)pmds[i]); 214 free_page((unsigned long)pmd);
213 pmd = NULL; 215 pmd = NULL;
214 failed = true; 216 failed = true;
215 } 217 }
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 7fb24e53d4c8..4f25ec077552 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -518,7 +518,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
518 sd = &info->sd; 518 sd = &info->sd;
519 sd->domain = domain; 519 sd->domain = domain;
520 sd->node = node; 520 sd->node = node;
521 sd->acpi = device->handle; 521 sd->companion = device;
522 /* 522 /*
523 * Maybe the desired pci bus has been already scanned. In such case 523 * Maybe the desired pci bus has been already scanned. In such case
524 * it is unnecessary to scan the pci bus with the given domain,busnum. 524 * it is unnecessary to scan the pci bus with the given domain,busnum.
@@ -589,7 +589,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
589{ 589{
590 struct pci_sysdata *sd = bridge->bus->sysdata; 590 struct pci_sysdata *sd = bridge->bus->sysdata;
591 591
592 ACPI_HANDLE_SET(&bridge->dev, sd->acpi); 592 ACPI_COMPANION_SET(&bridge->dev, sd->companion);
593 return 0; 593 return 0;
594} 594}
595 595
diff --git a/arch/x86/platform/efi/early_printk.c b/arch/x86/platform/efi/early_printk.c
index 6599a0027b76..81b506d5befd 100644
--- a/arch/x86/platform/efi/early_printk.c
+++ b/arch/x86/platform/efi/early_printk.c
@@ -142,7 +142,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num)
142 efi_y += font->height; 142 efi_y += font->height;
143 } 143 }
144 144
145 if (efi_y + font->height >= si->lfb_height) { 145 if (efi_y + font->height > si->lfb_height) {
146 u32 i; 146 u32 i;
147 147
148 efi_y -= font->height; 148 efi_y -= font->height;
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 92c02344a060..cceb813044ef 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -690,13 +690,6 @@ void __init efi_init(void)
690 690
691 set_bit(EFI_MEMMAP, &x86_efi_facility); 691 set_bit(EFI_MEMMAP, &x86_efi_facility);
692 692
693#ifdef CONFIG_X86_32
694 if (efi_is_native()) {
695 x86_platform.get_wallclock = efi_get_time;
696 x86_platform.set_wallclock = efi_set_rtc_mmss;
697 }
698#endif
699
700#if EFI_DEBUG 693#if EFI_DEBUG
701 print_efi_memmap(); 694 print_efi_memmap();
702#endif 695#endif
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 0f92173a12b6..efe4d7220397 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -1070,12 +1070,13 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
1070 unsigned long status; 1070 unsigned long status;
1071 1071
1072 bcp = &per_cpu(bau_control, cpu); 1072 bcp = &per_cpu(bau_control, cpu);
1073 stat = bcp->statp;
1074 stat->s_enters++;
1075 1073
1076 if (bcp->nobau) 1074 if (bcp->nobau)
1077 return cpumask; 1075 return cpumask;
1078 1076
1077 stat = bcp->statp;
1078 stat->s_enters++;
1079
1079 if (bcp->busy) { 1080 if (bcp->busy) {
1080 descriptor_status = 1081 descriptor_status =
1081 read_lmmr(UVH_LB_BAU_SB_ACTIVATION_STATUS_0); 1082 read_lmmr(UVH_LB_BAU_SB_ACTIVATION_STATUS_0);
diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile
index 88692871823f..9cac82588cbc 100644
--- a/arch/x86/realmode/rm/Makefile
+++ b/arch/x86/realmode/rm/Makefile
@@ -73,9 +73,10 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ -D_WAKEUP \
73 -march=i386 -mregparm=3 \ 73 -march=i386 -mregparm=3 \
74 -include $(srctree)/$(src)/../../boot/code16gcc.h \ 74 -include $(srctree)/$(src)/../../boot/code16gcc.h \
75 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ 75 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
76 -mno-mmx -mno-sse \
76 $(call cc-option, -ffreestanding) \ 77 $(call cc-option, -ffreestanding) \
77 $(call cc-option, -fno-toplevel-reorder,\ 78 $(call cc-option, -fno-toplevel-reorder,\
78 $(call cc-option, -fno-unit-at-a-time)) \ 79 $(call cc-option, -fno-unit-at-a-time)) \
79 $(call cc-option, -fno-stack-protector) \ 80 $(call cc-option, -fno-stack-protector) \
80 $(call cc-option, -mpreferred-stack-boundary=2) 81 $(call cc-option, -mpreferred-stack-boundary=2)
81KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ 82KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index 14ef8d1dbc33..ed56a1c4ae73 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -31,6 +31,11 @@ config X86_64
31 def_bool 64BIT 31 def_bool 64BIT
32 select MODULES_USE_ELF_RELA 32 select MODULES_USE_ELF_RELA
33 33
34config ARCH_DEFCONFIG
35 string
36 default "arch/um/configs/i386_defconfig" if X86_32
37 default "arch/um/configs/x86_64_defconfig" if X86_64
38
34config RWSEM_XCHGADD_ALGORITHM 39config RWSEM_XCHGADD_ALGORITHM
35 def_bool 64BIT 40 def_bool 64BIT
36 41
diff --git a/arch/x86/um/asm/processor_32.h b/arch/x86/um/asm/processor_32.h
index 6c6689e574ce..c112de81c9e1 100644
--- a/arch/x86/um/asm/processor_32.h
+++ b/arch/x86/um/asm/processor_32.h
@@ -33,6 +33,8 @@ struct arch_thread {
33 .faultinfo = { 0, 0, 0 } \ 33 .faultinfo = { 0, 0, 0 } \
34} 34}
35 35
36#define STACKSLOTS_PER_LINE 8
37
36static inline void arch_flush_thread(struct arch_thread *thread) 38static inline void arch_flush_thread(struct arch_thread *thread)
37{ 39{
38 /* Clear any TLS still hanging */ 40 /* Clear any TLS still hanging */
@@ -53,4 +55,7 @@ static inline void arch_copy_thread(struct arch_thread *from,
53#define current_text_addr() \ 55#define current_text_addr() \
54 ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) 56 ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
55 57
58#define current_sp() ({ void *sp; __asm__("movl %%esp, %0" : "=r" (sp) : ); sp; })
59#define current_bp() ({ unsigned long bp; __asm__("movl %%ebp, %0" : "=r" (bp) : ); bp; })
60
56#endif 61#endif
diff --git a/arch/x86/um/asm/processor_64.h b/arch/x86/um/asm/processor_64.h
index 4b02a8455bd1..c3be85205a65 100644
--- a/arch/x86/um/asm/processor_64.h
+++ b/arch/x86/um/asm/processor_64.h
@@ -19,6 +19,8 @@ struct arch_thread {
19 .fs = 0, \ 19 .fs = 0, \
20 .faultinfo = { 0, 0, 0 } } 20 .faultinfo = { 0, 0, 0 } }
21 21
22#define STACKSLOTS_PER_LINE 4
23
22static inline void arch_flush_thread(struct arch_thread *thread) 24static inline void arch_flush_thread(struct arch_thread *thread)
23{ 25{
24} 26}
@@ -32,4 +34,7 @@ static inline void arch_copy_thread(struct arch_thread *from,
32#define current_text_addr() \ 34#define current_text_addr() \
33 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) 35 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
34 36
37#define current_sp() ({ void *sp; __asm__("movq %%rsp, %0" : "=r" (sp) : ); sp; })
38#define current_bp() ({ unsigned long bp; __asm__("movq %%rbp, %0" : "=r" (bp) : ); bp; })
39
35#endif 40#endif
diff --git a/arch/x86/um/sysrq_32.c b/arch/x86/um/sysrq_32.c
index c9bee5b8c0d3..16ee0e450e3e 100644
--- a/arch/x86/um/sysrq_32.c
+++ b/arch/x86/um/sysrq_32.c
@@ -30,70 +30,4 @@ void show_regs(struct pt_regs *regs)
30 printk(" DS: %04lx ES: %04lx\n", 30 printk(" DS: %04lx ES: %04lx\n",
31 0xffff & PT_REGS_DS(regs), 31 0xffff & PT_REGS_DS(regs),
32 0xffff & PT_REGS_ES(regs)); 32 0xffff & PT_REGS_ES(regs));
33
34 show_trace(NULL, (unsigned long *) &regs);
35} 33}
36
37/* Copied from i386. */
38static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
39{
40 return p > (void *)tinfo &&
41 p < (void *)tinfo + THREAD_SIZE - 3;
42}
43
44/* Adapted from i386 (we also print the address we read from). */
45static inline unsigned long print_context_stack(struct thread_info *tinfo,
46 unsigned long *stack, unsigned long ebp)
47{
48 unsigned long addr;
49
50#ifdef CONFIG_FRAME_POINTER
51 while (valid_stack_ptr(tinfo, (void *)ebp)) {
52 addr = *(unsigned long *)(ebp + 4);
53 printk("%08lx: [<%08lx>]", ebp + 4, addr);
54 print_symbol(" %s", addr);
55 printk("\n");
56 ebp = *(unsigned long *)ebp;
57 }
58#else
59 while (valid_stack_ptr(tinfo, stack)) {
60 addr = *stack;
61 if (__kernel_text_address(addr)) {
62 printk("%08lx: [<%08lx>]", (unsigned long) stack, addr);
63 print_symbol(" %s", addr);
64 printk("\n");
65 }
66 stack++;
67 }
68#endif
69 return ebp;
70}
71
72void show_trace(struct task_struct* task, unsigned long * stack)
73{
74 unsigned long ebp;
75 struct thread_info *context;
76
77 /* Turn this into BUG_ON if possible. */
78 if (!stack) {
79 stack = (unsigned long*) &stack;
80 printk("show_trace: got NULL stack, implicit assumption task == current");
81 WARN_ON(1);
82 }
83
84 if (!task)
85 task = current;
86
87 if (task != current) {
88 ebp = (unsigned long) KSTK_EBP(task);
89 } else {
90 asm ("movl %%ebp, %0" : "=r" (ebp) : );
91 }
92
93 context = (struct thread_info *)
94 ((unsigned long)stack & (~(THREAD_SIZE - 1)));
95 print_context_stack(context, stack, ebp);
96
97 printk("\n");
98}
99
diff --git a/arch/x86/um/sysrq_64.c b/arch/x86/um/sysrq_64.c
index a0e7fb1134a0..38b4e4abd0f8 100644
--- a/arch/x86/um/sysrq_64.c
+++ b/arch/x86/um/sysrq_64.c
@@ -12,7 +12,7 @@
12#include <asm/ptrace.h> 12#include <asm/ptrace.h>
13#include <asm/sysrq.h> 13#include <asm/sysrq.h>
14 14
15void __show_regs(struct pt_regs *regs) 15void show_regs(struct pt_regs *regs)
16{ 16{
17 printk("\n"); 17 printk("\n");
18 print_modules(); 18 print_modules();
@@ -33,9 +33,3 @@ void __show_regs(struct pt_regs *regs)
33 printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n", 33 printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
34 PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs)); 34 PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
35} 35}
36
37void show_regs(struct pt_regs *regs)
38{
39 __show_regs(regs);
40 show_trace(current, (unsigned long *) &regs);
41}
diff --git a/arch/x86/um/vdso/.gitignore b/arch/x86/um/vdso/.gitignore
new file mode 100644
index 000000000000..9cac6d072199
--- /dev/null
+++ b/arch/x86/um/vdso/.gitignore
@@ -0,0 +1,2 @@
1vdso-syms.lds
2vdso.lds
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
index 9481004ac119..470153e8547c 100644
--- a/arch/xtensa/include/asm/thread_info.h
+++ b/arch/xtensa/include/asm/thread_info.h
@@ -76,8 +76,6 @@ struct thread_info {
76 76
77#endif 77#endif
78 78
79#define PREEMPT_ACTIVE 0x10000000
80
81/* 79/*
82 * macros/functions for gaining access to the thread information structure 80 * macros/functions for gaining access to the thread information structure
83 */ 81 */